Код: Выделить всё
public function vendor_services($id)
{
$q = $this->db->where(['id'=>$id])
->get('vendor_services');
return $q->result();
}
public function add_vendor_services($id,$service)
{
$query = $this->db->get('vendor_services');
foreach ($query->result() as $row)
{
$ids[]=$row->id;
}
foreach($ids as $vid) {
if($id == $vid) {
$q1 = $this->db->get_where('vendor_services',array('id'=>$vid));
$serv=$q1->row()->service_offered;
if($serv===$service)
return;
else {
$this->db->set('id',$id)
->set('service_offered',$service)
->insert('vendor_services');
return;
}
} else {
$this->db->set('id',$id)
->set('service_offered',$service)
->insert('vendor_services');
return;
}
}
}
{
$q =$this->db->get_where('services_list',array('id'=>$id));
if($q->num_rows())
{
return $q->row()->name;
} else {
return FALSE;
}
}
Код: Выделить всё
$vendor = $this->input->post();
$service_id = $this->input->post('service');
unset($vendor['service']);
$loc_id = $this->input->post('locations');
$login_email = $this->session->userdata('email_id');
$vendor['locations'] = $this->Vendormodel->get_location($loc_id);
$this->Vendormodel->add_vendor_profile($login_email,$vendor);
$id1 = $this->Vendormodel->get_vendor_id($login_email);
if(isset($service_id))
foreach($service_id as $id){
$post[]=$this->Vendormodel->get_services($id);
}
if(isset($service_id))
foreach($post as $service){
$this->Vendormodel->add_vendor_services($id1,$service);
}
$vendordash['det'] = $this->Vendormodel->vendor_details($login_email);
$vendordash['services'] = $this->Vendormodel->vendor_services($id1);
$this->load->view('vendor/vendor_dashboard',$vendordash);
Код: Выделить всё
Service Offering
>Engineering and Design
>Operations and support
>Product management
>Developer relations and technical solutions
>Sales and account management
>Partnerships
>Sales and operations
>Administrative services
>Business strategy planning
>Finance solutions
>Legal and government relations
>Marketing and communications
>Real estate and workplace services
>Social impact solutions
>Consultancy services
>Investors and funding
Подробнее здесь: https://stackoverflow.com/questions/382 ... ple-inputs