diff --git a/app/Controllers/Vehicle.php b/app/Controllers/Vehicle.php index 7613135..67a5187 100644 --- a/app/Controllers/Vehicle.php +++ b/app/Controllers/Vehicle.php @@ -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; diff --git a/app/Controllers/Vendor.php b/app/Controllers/Vendor.php index b3d490e..a59f33e 100644 --- a/app/Controllers/Vendor.php +++ b/app/Controllers/Vendor.php @@ -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'); diff --git a/app/Models/VehicleModel.php b/app/Models/VehicleModel.php index 9f6b2fd..2cff2fd 100644 --- a/app/Models/VehicleModel.php +++ b/app/Models/VehicleModel.php @@ -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) { diff --git a/app/Models/VendorModel.php b/app/Models/VendorModel.php index 547b2e1..853d9a0 100644 --- a/app/Models/VendorModel.php +++ b/app/Models/VendorModel.php @@ -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) { diff --git a/app/Views/vehicle_form.php b/app/Views/vehicle_form.php index 588e1a2..3491543 100644 --- a/app/Views/vehicle_form.php +++ b/app/Views/vehicle_form.php @@ -57,6 +57,10 @@ +
+ + +

Client Details :

diff --git a/app/Views/vendor_form.php b/app/Views/vendor_form.php index e97ef79..995f3ad 100644 --- a/app/Views/vendor_form.php +++ b/app/Views/vendor_form.php @@ -32,50 +32,31 @@ -
- - -
+
-
- - -
-
- - -
-
- - -
-
- - -
+
+ + +
+ +
+ + +
+ + + @@ -84,16 +65,49 @@

Contact Person Details :

- - + +
- - + +
-
+
+ + +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ -

Address Information :

+

Vendor Address Information :

diff --git a/app/Views/vendor_list.php b/app/Views/vendor_list.php index e344b56..935ba77 100644 --- a/app/Views/vendor_list.php +++ b/app/Views/vendor_list.php @@ -33,7 +33,6 @@ # Vendor Name Email - Mobile Category Action @@ -47,8 +46,7 @@ - - + " class="edit-button">