FIX_CHANGE_PRODUCT_PRODUCT_LIST:AADHAVAN
This commit is contained in:
commit
c5bdd88533
@ -9,6 +9,7 @@ use App\Models\ProductModel;
|
||||
use App\Models\ManufacturerModel;
|
||||
|
||||
|
||||
|
||||
class Products extends BaseController
|
||||
{
|
||||
|
||||
@ -62,6 +63,10 @@ class Products extends BaseController
|
||||
$data['tax']=$tax;
|
||||
$BikemakeModel = new BikemakeModel();
|
||||
$data['make'] = $BikemakeModel->findAll();
|
||||
$VendorModel = new VendorModel();
|
||||
$data['vendors']=$VendorModel->findAll();
|
||||
$ManufacturerModel = new ManufacturerModel();
|
||||
$data['manufacturers']=$ManufacturerModel->findAll();
|
||||
$data['page_name']="Add Product";
|
||||
} else if ($product_id !== '0') {
|
||||
$data['page_name']="Edit Product";
|
||||
@ -80,8 +85,11 @@ class Products extends BaseController
|
||||
$data['tax']=$tax;
|
||||
$VendorModel = new VendorModel();
|
||||
$data['vendors']=$VendorModel->findAll();
|
||||
|
||||
|
||||
$ManufacturerModel = new ManufacturerModel();
|
||||
$data['manufacturers']=$ManufacturerModel->findAll();
|
||||
$preferredVendorId = $products['prefered_vendor'];
|
||||
// Pass the preferred vendor ID to the view
|
||||
$data['preferredVendorId'] = $preferredVendorId; // print_r($data);die;
|
||||
// print_r($data);die;
|
||||
}
|
||||
$data['product_id'] = $product_id;
|
||||
@ -101,7 +109,7 @@ class Products extends BaseController
|
||||
'product_name' => $this->request->getPost('productname'),
|
||||
'product_category' => $this->request->getPost('productcategory'),
|
||||
'mfr_part_no' => $this->request->getPost('mfr_part_no'),
|
||||
'serial_no' => $this->request->getPost('serial_no'),
|
||||
|
||||
'unit_price' => $this->request->getPost('unit_price'),
|
||||
'commision_rate' => $this->request->getPost('commision_rate'),
|
||||
'sgst' => $tax,
|
||||
@ -110,16 +118,20 @@ class Products extends BaseController
|
||||
'qty_stock'=> $this->request->getPost('qty_in_stock'),
|
||||
'qty_in_demand'=> $this->request->getPost('qty_in_demand'),
|
||||
'description' => $this->request->getPost('description'),
|
||||
'vendor' => $this->request->getPost('vendor'),
|
||||
'vendor' =>json_encode( $this->request->getPost('vendor')),
|
||||
'purchase_order_level' => $this->request->getPost('purchase_order_level'),
|
||||
'reorder_level' => $this->request->getPost('reorder_level'),
|
||||
'quality' => $this->request->getPost('quality'),
|
||||
'make_id' => $this->request->getPost('make'),
|
||||
'models_id' => json_encode($this->request->getPost('model')),
|
||||
'rack_number' => $this->request->getPost('rack_number'),
|
||||
'manufacturer_id' => $this->request->getPost('manufacturer'),
|
||||
'prefered_vendor' => $this->request->getPost('prefered_vendor'),
|
||||
'isactive' => 1 ,
|
||||
'branch_id' => $this->session->get('logged_user_branch_id')
|
||||
];
|
||||
// print_r($data);die;
|
||||
|
||||
// print_r($data);die;
|
||||
$product_id = $this->request->getPost('product_id');
|
||||
|
||||
|
||||
@ -129,9 +141,13 @@ class Products extends BaseController
|
||||
} else {
|
||||
|
||||
$ProductModel->insert($data);
|
||||
$product_id = $ProductModel->getInsertID();
|
||||
}
|
||||
|
||||
|
||||
$orderNumber = 'TM' . str_pad($product_id, 8, '0', STR_PAD_LEFT);
|
||||
// print_r($orderNumber);die;
|
||||
// Update sales order with generated order number
|
||||
$ProductModel->update($product_id, ['sku_id' => $orderNumber]);
|
||||
return redirect()->to('product_index');
|
||||
}
|
||||
|
||||
|
||||
@ -87,6 +87,7 @@ class Vehicle extends BaseController
|
||||
'colour' => $this->request->getPost('colour'),
|
||||
'year_of_manufacturing' => $this->request->getPost('year_of_manufacturing'),
|
||||
'branch_id' => $this->session->get('logged_user_branch_id'),
|
||||
'specific' => $this->request->getPost('specific'),
|
||||
'isactive' => 1 // Assuming this is a default value or handled separately
|
||||
];
|
||||
// print_r($data);die;
|
||||
|
||||
@ -36,29 +36,14 @@ class Vendor extends BaseController
|
||||
if ($vendor_id === '0') {
|
||||
$data['vendor'] = [];
|
||||
$data['page_name'] = "Add Vendor";
|
||||
$BikemakeModel = new BikemakeModel();
|
||||
$data['make'] = $BikemakeModel->findAll();
|
||||
$data['models'] = []; // Initialize models array for the view
|
||||
} else {
|
||||
$VendorModel = new VendorModel();
|
||||
$vendor = $VendorModel->where('vendor_id', $vendor_id)->get()->getRowArray();
|
||||
$vendor['model_ids'] = json_decode($vendor['model'], true);
|
||||
$vendor['make_ids'] = json_decode($vendor['make'], true);
|
||||
|
||||
$data['vendor'] = $vendor;
|
||||
$data['page_name'] = "Edit Vendor";
|
||||
|
||||
// Load models based on the selected make IDs
|
||||
$BikemodelModel = new BikemodelsModel();
|
||||
$models = [];
|
||||
foreach ($vendor['make_ids'] as $make_id) {
|
||||
$models[] = $BikemodelModel->where('make_id', $make_id)->findAll();
|
||||
}
|
||||
$data['models'] = $models; // Pass models array to the view
|
||||
|
||||
// Load make data
|
||||
$BikemakeModel = new BikemakeModel();
|
||||
$data['make'] = $BikemakeModel->findAll();
|
||||
}
|
||||
|
||||
$data['vendor_id'] = $vendor_id;
|
||||
@ -71,30 +56,28 @@ class Vendor extends BaseController
|
||||
{
|
||||
$VendorModel = new VendorModel();
|
||||
|
||||
// Retrieve the selected make IDs and model IDs from the form
|
||||
$make_ids = $this->request->getPost('make');
|
||||
$model_ids = $this->request->getPost('model');
|
||||
|
||||
// Convert model IDs to JSON format
|
||||
$model_json = json_encode($model_ids);
|
||||
$make_json=json_encode($make_ids);
|
||||
$data = [
|
||||
'vendor_name' => $this->request->getPost('vendor_name'),
|
||||
'contact_name' => $this->request->getPost('contact_name'),
|
||||
'gstnumber' => $this->request->getPost('gstnumber'),
|
||||
'vendor_email' => $this->request->getPost('email'),
|
||||
'address' => $this->request->getPost('address'),
|
||||
'vendor_mobile' => $this->request->getPost('mobile'),
|
||||
'city' => $this->request->getPost('city'),
|
||||
'state' => $this->request->getPost('state'),
|
||||
'postal_code' => $this->request->getPost('postalcode'),
|
||||
'country' => $this->request->getPost('country'),
|
||||
'category' => $this->request->getPost('category'),
|
||||
'website' => $this->request->getPost('website'),
|
||||
'contact_person_name1' => $this->request->getPost('contact_person_name1'),
|
||||
'contact_person_name2' => $this->request->getPost('contact_person_name2'),
|
||||
'contact_person_name3' => $this->request->getPost('contact_person_name3'),
|
||||
'contact_person_mobile1' => $this->request->getPost('contact_person_mobile1'),
|
||||
'contact_person_mobile2' => $this->request->getPost('contact_person_mobile2'),
|
||||
'contact_person_mobile3' => $this->request->getPost('contact_person_mobile3'),
|
||||
'contact_person_resignation1' => $this->request->getPost('contact_person_resignation1'),
|
||||
'contact_person_resignation2' => $this->request->getPost('contact_person_resignation2'),
|
||||
'contact_person_resignation3' => $this->request->getPost('contact_person_resignation3'),
|
||||
'isactive' => 1 ,
|
||||
'branch_id' => $this->session->get('logged_user_branch_id'),
|
||||
'make' => $make_json, // Store the selected make IDs
|
||||
'model' => $model_json, // Store the selected model IDs in JSON format
|
||||
];
|
||||
|
||||
$vendor_id = $this->request->getPost('vendor_id');
|
||||
|
||||
@ -5,7 +5,7 @@ class ProductModel extends Model
|
||||
{
|
||||
protected $table = 'products';
|
||||
protected $primaryKey = 'product_id';
|
||||
protected $allowedFields = ['sku_id','product_id','manufacturer_id','make_id','models_id','quality','product_name','branch_id','search_tag','product_category','mfr_part_no','purchase_order_level','serial_no','unit_price','commision_rate','sgst','cgst','purchase_cost','usage_unit','vendor','qty_stock','reorder_level','handler','qty_in_demand','product_image','description','isactive'];
|
||||
protected $allowedFields = ['sku_id','product_id','rack_number','manufacturer_id','make_id','models_id','quality','product_name','branch_id','prefered_vendor','product_category','mfr_part_no','purchase_order_level','unit_price','commision_rate','sgst','cgst','purchase_cost','usage_unit','vendor','qty_stock','reorder_level','handler','qty_in_demand','product_image','description','isactive'];
|
||||
|
||||
|
||||
public function getTax()
|
||||
|
||||
@ -7,7 +7,7 @@ class VehicleModel extends Model
|
||||
|
||||
protected $table = 'vehicle';
|
||||
protected $primaryKey = 'vehicle_id';
|
||||
protected $allowedFields = ['branch_id','vehicle_id','make','model','reg_no','year_of_manufacturing','colour','client_id','address','country','state','city','email','postal_code','mobile_no','isactive'];
|
||||
protected $allowedFields = ['branch_id','vehicle_id','make','model','reg_no','year_of_manufacturing','colour','client_id','address','country','state','city','email','postal_code','mobile_no','specific','isactive'];
|
||||
|
||||
public function getCustomerandVehicle($branch_id)
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@ class VendorModel extends Model
|
||||
{
|
||||
protected $table = 'vendor';
|
||||
protected $primaryKey = 'vendor_id';
|
||||
protected $allowedFields = ['vendor_id','branch_id','vendor_name','vendor_email','vendor_mobile','contact_name','website','gstnumber','conatct_person','vendortype','make','model','category','address','state','postal_code','city','country','description','isactive'];
|
||||
protected $allowedFields = ['vendor_id','branch_id','vendor_name','vendor_email','manufacturer_id','contact_person_name1','contact_person_name2','contact_person_name3','contact_person_mobile1','contact_person_mobile2','contact_person_mobile3','contact_person_designation1','contact_person_designation2','contact_person_designation3','gstnumber','conatct_person','vendortype','make','model','category','address','state','postal_code','city','country','description','isactive'];
|
||||
|
||||
public function get_vendors_by_model($model_ids)
|
||||
{
|
||||
|
||||
@ -56,27 +56,20 @@
|
||||
<input type="text" class="form-control" name="productname" placeholder="Product Name" value="<?= isset($products['product_name']) ? $products['product_name'] : '' ?>" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="vendor" class="col-form-label">Vendor<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="vendor" name="vendor" required>
|
||||
<!-- Placeholder option -->
|
||||
<option value="">Select Vendor</option>
|
||||
|
||||
<?php foreach ($vendors as $vendor): ?>
|
||||
<option value="<?= $vendor['vendor_id'] ?>" <?= isset($products['vendor']) && $products['vendor'] == $vendor['vendor_id'] ? 'selected' : '' ?>>
|
||||
<?= $vendor['vendor_name'] ?>
|
||||
<label for="manufacturer" class="col-form-label">Manufacturer<span class="text-danger">*</span></label>
|
||||
<select class="form-control SelExample" id="manufacturer" name="manufacturer" required>
|
||||
<option value="">Select a Manufacturer</option>
|
||||
<?php foreach ($manufacturers as $value): ?>
|
||||
<option value="<?= $value['manufacturer_id'] ?>" <?= isset($products['manufacturer_id']) && $products['manufacturer_id'] == $value['manufacturer_id'] ? 'selected' : '' ?>>
|
||||
<?= $value['manufacturer_name'] ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="vendor" class="col-form-label">Quality<span class="text-danger">*</span></label>
|
||||
<select class="form-control " name="quality" required data-toggle="select2" >
|
||||
<!-- <option value="">Select a Status</option> -->
|
||||
<option value="Q1" <?= isset($products['quality']) && $products['quality'] === 'Q1' ? 'selected' : '' ?>>Q1</option>
|
||||
<option value="Q2" <?= isset($products['quality']) && $products['quality'] === 'Q2' ? 'selected' : '' ?>>Q2 </option>
|
||||
<option value="Q3" <?= isset($products['quality']) && $products['quality'] === 'Q3' ? 'selected' : '' ?>>Q3</option>
|
||||
<option value="Q4" <?= isset($products['quality']) && $products['quality'] === 'Q4' ? 'selected' : '' ?>>Q4</option>
|
||||
<label for="quality" class="col-form-label">Quality<span class="text-danger">*</span></label>
|
||||
<select class="form-control" name="quality" id="quality" required data-toggle="select2">
|
||||
<!-- Options for quality will be populated dynamically via JavaScript -->
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -85,12 +78,39 @@
|
||||
<input type="text" class="form-control" name="mfr_part_no" placeholder="Manfacturer Part Number" value="<?= isset($products['mfr_part_no']) ? $products['mfr_part_no'] : '' ?>" >
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputPassword4" class="col-form-label">Serial Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="serial_no" placeholder="Serial Number"value="<?= isset($products['serial_no']) ? $products['serial_no'] : '' ?>" required>
|
||||
<label for="vendor" class="col-form-label">Vendor<span class="text-danger">*</span></label>
|
||||
<select class="form-control SelExample" id="vendor" name="vendor[]" required multiple>
|
||||
<!-- Placeholder option -->
|
||||
<option value="">Select Vendor</option>
|
||||
|
||||
<?php foreach ($vendors as $vendor): ?>
|
||||
<option value="<?= $vendor['vendor_id'] ?>" <?= isset($products['vendor']) && in_array($vendor['vendor_id'], json_decode($products['vendor'], true)) ? 'selected' : '' ?>>
|
||||
<?= $vendor['vendor_name'] ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4" class="col-form-label">Product Category<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="productcategory" placeholder="Product Category" value="<?= isset($products['product_category']) ? $products['product_category'] : '' ?>" required>
|
||||
<label for="preferred_vendor" class="col-form-label">Preferred Vendor<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="preferred_vendor" name="prefered_vendor" required>
|
||||
<!-- Loop through vendors and set selected attribute if ID matches preferredVendorId -->
|
||||
<?php foreach ($vendors as $vendor): ?>
|
||||
<option value="<?= $vendor['vendor_id'] ?>" <?= ( $vendor['vendor_id'] == $preferredVendorId) ? 'selected' : '' ?>>
|
||||
<?= $vendor['vendor_name'] ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4" class="col-form-label">Product Category<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" name="productcategory" placeholder="Product Category" value="<?= isset($products['product_category']) ? $products['product_category'] : '' ?>" >
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4" class="col-form-label">Rack Number<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" name="rack_number" placeholder="Rack Number" value="<?= isset($products['rack_number']) ? $products['rack_number'] : '' ?>" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -142,7 +162,7 @@
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputPassword4" class="col-form-label">Purchase Re-Order Level<span class="text-danger"></span></label>
|
||||
<input type="number" class="form-control" id="purchase_reorder_level" name="purchase_reorder_level" placeholder="Purchase Re-Order Level" value="<?= isset($products['purchase_reorder_level']) ? $products['purchase_reorder_level'] : '' ?>" required>
|
||||
<input type="number" class="form-control" id="purchase_reorder_level" name="reorder_level" placeholder="Purchase Re-Order Level" value="<?= isset($products['reorder_level']) ? $products['reorder_level'] : '' ?>" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" hidden>
|
||||
@ -283,3 +303,81 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
border-bottom: 1px solid #747474;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// Function to update the quality dropdown based on selected manufacturer
|
||||
function updateQualityDropdown(manufacturerId) {
|
||||
// Clear existing options
|
||||
$('#quality').empty();
|
||||
// Find the selected manufacturer
|
||||
var selectedManufacturer = <?= json_encode($manufacturers) ?>.find(function(manufacturer) {
|
||||
return manufacturer.manufacturer_id == manufacturerId;
|
||||
});
|
||||
// Populate quality options based on all manufacturers
|
||||
var allQualities = <?= json_encode($manufacturers) ?>.map(function(manufacturer) {
|
||||
return manufacturer.quality.split(',');
|
||||
}).flat().filter(function(item, index, self) {
|
||||
return self.indexOf(item) === index;
|
||||
}).sort();
|
||||
allQualities.forEach(function(quality) {
|
||||
$('#quality').append('<option value="' + quality.trim() + '" ' + (selectedManufacturer && selectedManufacturer.quality.includes(quality.trim()) ? 'selected' : '') + '>' + quality.trim() + '</option>');
|
||||
});
|
||||
}
|
||||
|
||||
// Call the function initially
|
||||
$(document).ready(function() {
|
||||
// Get the selected manufacturer ID
|
||||
var selectedManufacturerId = $('#manufacturer').val();
|
||||
// Update the quality dropdown initially
|
||||
updateQualityDropdown(selectedManufacturerId);
|
||||
|
||||
// Update the quality dropdown when manufacturer selection changes
|
||||
$('#manufacturer').change(function() {
|
||||
var manufacturerId = $(this).val();
|
||||
updateQualityDropdown(manufacturerId);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Set selected manufacturer and quality for editing
|
||||
$(document).ready(function() {
|
||||
// Check if products data is available (for editing)
|
||||
var productsData = <?= json_encode($products) ?>;
|
||||
if (productsData) {
|
||||
// Set selected manufacturer
|
||||
$('#manufacturer').val(productsData.manufacturer_id);
|
||||
// Trigger change event to update quality dropdown
|
||||
$('#manufacturer').trigger('change');
|
||||
// Set selected quality
|
||||
|
||||
$('#quality').val(productsData.quality);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
// Function to update the preferred vendor dropdown based on selected vendors
|
||||
function updatePreferredVendorDropdown() {
|
||||
var selectedVendors = $('#vendor').val();
|
||||
// Clear existing options
|
||||
$('#preferred_vendor').empty();
|
||||
// Populate preferred vendor options based on selected vendors
|
||||
selectedVendors.forEach(function(vendorId) {
|
||||
var vendorName = $('#vendor option[value="' + vendorId + '"]').text();
|
||||
$('#preferred_vendor').append('<option value="' + vendorId + '" >' + vendorName + '</option>');
|
||||
});
|
||||
}
|
||||
|
||||
// Call the function initially
|
||||
$(document).ready(function() {
|
||||
// Update the preferred vendor dropdown initially
|
||||
updatePreferredVendorDropdown();
|
||||
|
||||
// Update the preferred vendor dropdown when vendors selection changes
|
||||
$('#vendor').change(function() {
|
||||
updatePreferredVendorDropdown();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -30,9 +30,9 @@
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th>SKU Id</th>
|
||||
<th>Product Name</th>
|
||||
<th>Category</th>
|
||||
<?php if(!$manufacturer_id) { ?><th>Serial Number</th><?php } ?>
|
||||
<th>Unit Price</th>
|
||||
<th>Qty in Stock</th>
|
||||
<th>Sgst</th>
|
||||
@ -46,9 +46,10 @@
|
||||
<?php foreach ($products as $value) :
|
||||
if ($value['isactive'] == 1) : ?>
|
||||
<tr>
|
||||
<td><?= $value['sku_id']; ?></td>
|
||||
<td><?= $value['product_name']; ?></td>
|
||||
<td><?= $value['product_category']; ?></td>
|
||||
<?php if(!$manufacturer_id) { ?><td><?= $value['serial_no']; ?></td><?php } ?>
|
||||
|
||||
<td><?= number_format($value['unit_price']); ?></td>
|
||||
<td><?= $value['qty_stock']; ?></td>
|
||||
<td><?= $value['cgst']; ?>%</td>
|
||||
|
||||
@ -57,6 +57,10 @@
|
||||
<label for="inputPassword4" class="col-form-label">Colour</label>
|
||||
<input type="text" class="form-control" name="colour" placeholder="Colour"value="<?= isset($vehicle['colour']) ? $vehicle['colour'] : '' ?>" >
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputPassword4" class="col-form-label">Specific</label>
|
||||
<input type="text" class="form-control" name="specific" placeholder="Specific" value="<?= isset($vehicle['specific']) ? $vehicle['specific'] : '' ?>" >
|
||||
</div>
|
||||
</div>
|
||||
</br>
|
||||
<h4 class="header-title">Client Details :</h4>
|
||||
|
||||
@ -32,23 +32,22 @@
|
||||
<label for="inputEmail4" class="col-form-label">Email</label>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email" value="<?= isset($vendor['vendor_email']) ? $vendor['vendor_email'] : '' ?>" >
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4" class="col-form-label">Website<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" name="website" placeholder="Website" value="<?= isset($vendor['website']) ? $vendor['website'] : '' ?>" >
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4" class="col-form-label">Category<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" name="category" placeholder="Category" value="<?= isset($vendor['category']) ? $vendor['category'] : '' ?>" >
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4" class="col-form-label">GST Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="gstnumber" placeholder="GST Number" value="<?= isset($vendor['gstnumber']) ? $vendor['gstnumber'] : '' ?>" pattern="[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[0-9]{1}[Z]{1}[0-9A-Z]{1}" title="Enter a valid GST Number">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputPassword4" class="col-form-label">Vendor Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control " name="vendortype" required data-toggle="select2" >
|
||||
<!-- <option value="">Select a Status</option> -->
|
||||
<option value="">Select a Type</option>
|
||||
<option value="Retailer" <?= isset($vendor['vendortype']) && $vendor['vendortype'] === 'Retailer' ? 'selected' : '' ?>>Retailer</option>
|
||||
<option value="Authorised Dealer" <?= isset($vendor['vendortype']) && $vendor['vendortype'] === 'Authorised Dealer' ? 'selected' : '' ?>>Authorised Dealer</option>
|
||||
<option value="Wholesale Dealer" <?= isset($vendor['vendortype']) && $vendor['vendortype'] === 'Wholesale Dealer' ? 'selected' : '' ?>>Wholesale Dealer</option>
|
||||
@ -56,26 +55,8 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="inputPassword4" class="col-form-label">Make<span class="text-danger">*</span></label>
|
||||
<select class="form-control SelExample" id="make" name="make[]" required multiple>
|
||||
<!-- Options for make -->
|
||||
<?php foreach ($make as $value): ?>
|
||||
<option value="<?= $value['make_id'] ?>" <?= isset($vendor['make_ids']) && in_array($value['make_id'], $vendor['make_ids']) ? 'selected' : '' ?>><?= $value['make'] ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="inputPassword4" class="col-form-label">Model<span class="text-danger">*</span></label>
|
||||
<select class="form-control status-select" id="model" name="model[]" required data-toggle="select2" multiple>
|
||||
<!-- Options for models -->
|
||||
<?php foreach ($models as $make_models): ?>
|
||||
<?php foreach ($make_models as $model): ?>
|
||||
<option value="<?= $model['model_id'] ?>" <?= isset($vendor['model_ids']) && in_array($model['model_id'], $vendor['model_ids']) ? 'selected' : '' ?>><?= $model['model_name'] ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -84,16 +65,49 @@
|
||||
<h4 class="header-title">Contact Person Details :</h4>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4" class="col-form-label">Contact Person Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="contact_name" placeholder="Contactt Name" value="<?= isset($vendor['contact_name']) ? $vendor['contact_name'] : '' ?>" required>
|
||||
<label for="inputEmail4" class="col-form-label">Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="contact_person_name1" placeholder="Name" value="<?= isset($vendor['contact_person_name1']) ? $vendor['contact_person_name1'] : '' ?>" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputAddress" class="col-form-label">Contact Mobile<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile" value="<?= isset($vendor['vendor_mobile']) ? $vendor['vendor_mobile'] : '' ?>" maxlength="10" minlength="10" onkeypress = "return onlyNumbers(event)" required/>
|
||||
<label for="inputAddress" class="col-form-label">Mobile<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="contact_person_mobile1" placeholder="Mobile" value="<?= isset($vendor['contact_person_mobile1']) ? $vendor['contact_person_mobile1'] : '' ?>" maxlength="10" minlength="10" onkeypress = "return onlyNumbers(event)" required/>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputAddress" class="col-form-label">Designation<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="contact_person_designation1" placeholder="Designation" value="<?= isset($vendor['contact_person_designation1']) ? $vendor['contact_person_designation1'] : '' ?>" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4" class="col-form-label">Name</label>
|
||||
<input type="text" class="form-control" name="contact_person_name2" placeholder="Name" value="<?= isset($vendor['contact_person_name2']) ? $vendor['contact_person_name2'] : '' ?>" >
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputAddress" class="col-form-label">Mobile</label>
|
||||
<input type="text" class="form-control" name="contact_person_mobile2" placeholder="Mobile" value="<?= isset($vendor['contact_person_mobile2']) ? $vendor['contact_person_mobile2'] : '' ?>" maxlength="10" minlength="10" onkeypress = "return onlyNumbers(event)" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputAddress" class="col-form-label">Designation</label>
|
||||
<input type="text" class="form-control" name="contact_person_designation2" placeholder="Designation" value="<?= isset($vendor['contact_person_designation2']) ? $vendor['contact_person_designation2'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputEmail4" class="col-form-label">Name</label>
|
||||
<input type="text" class="form-control" name="contact_person_name3" placeholder="Name" value="<?= isset($vendor['contact_person_name3']) ? $vendor['contact_person_name3'] : '' ?>" >
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputAddress" class="col-form-label">Mobile</label>
|
||||
<input type="text" class="form-control" name="contact_person_mobile3" placeholder="Mobile" value="<?= isset($vendor['contact_person_mobile3']) ? $vendor['contact_person_mobile3'] : '' ?>" maxlength="10" minlength="10" onkeypress = "return onlyNumbers(event)" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputAddress" class="col-form-label">Designation</label>
|
||||
<input type="text" class="form-control" name="contact_person_designation3" placeholder="Designation" value="<?= isset($vendor['contact_person_designation3']) ? $vendor['contact_person_designation3'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="vendor_id" name="vendor_id" value="<?= isset($vendor['vendor_id']) ? $vendor['vendor_id'] : '' ?>">
|
||||
<h4 class="header-title">Address Information :</h4>
|
||||
<h4 class="header-title">Vendor Address Information :</h4>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="inputPassword4" class="col-form-label">Address</label>
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
<th>#</th>
|
||||
<th>Vendor Name</th>
|
||||
<th>Email</th>
|
||||
<th>Mobile</th>
|
||||
<th>Category</th>
|
||||
<th>Action</th>
|
||||
|
||||
@ -48,7 +47,6 @@
|
||||
<td><?= $value['vendor_id']; ?></td>
|
||||
<td><?= $value['vendor_name']; ?></td>
|
||||
<td><?= $value['vendor_email']; ?></td>
|
||||
<td><?= $value['vendor_mobile']; ?></td>
|
||||
<td><?= $value['category']; ?></td> <!-- Call the model method -->
|
||||
<td>
|
||||
<a href="<?= "new_vendor/" . $value['vendor_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user