function add() { $form_field = $data = array('L_strErrorMessage' => '', 'size' => '', 'fitid' => '', 'brandid' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_bsize') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['size'] = "trim|required"; //$rules['colourcode'] = "trim|required"; $this->validation->set_rules($rules); $fields['size'] = "Size"; //$fields['colourcode'] = "colour code"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if (!$this->bsize_model->is_size_already_exist_add($this->input->post('size'), $this->input->post('fitid'), $this->input->post('brandid'))) { if ($response = $this->bsize_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Size Added Successfully!!!'); redirect($this->config->item('base_url') . 'bsize/lists'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } else { $data['L_strErrorMessage'] = 'Size already exist.!'; } } } $data['allfit'] = $this->bsize_model->allfit(); $data['allbrand'] = $this->bsize_model->allbrand(); $this->load->view('add_bsize', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'status' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_status') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['status'] = "trim|required"; $this->validation->set_rules($rules); $fields['status'] = "Status Type"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if (!$this->status_model->is_status_already_exist_add($this->input->post('status'))) { if ($response = $this->status_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Status Added Successfully!!!'); redirect($this->config->item('base_url') . 'status/lists/'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } else { $data['L_strErrorMessage'] = 'Status already exist!'; } } } //$data['allparts']=$this->status_model->allparts(); $this->load->view('add_status', $data); }
function add_reguser() { $form_field = $data = array('L_strErrorMessage' => '', 'firstname' => '', 'lastname' => '', 'email' => '', 'username' => '', 'password' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_reguser') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['firstname'] = "trim|required"; $this->validation->set_rules($rules); $fields['firstname'] = "Firstname Name"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { /*if(!$this->reguser_model->is_product_already_exist_add($this->input->post('email'))) { */ if ($response = $this->reguser_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'User Added Successfully!!!'); redirect($this->config->item('base_url') . 'reguser/lists'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } /* } else { $data['L_strErrorMessage'] = 'Email Id already exist.!!'; } */ } } $data['allcountry'] = $this->reguser_model->allcountry(); $this->load->view('add_reguser', $data); }
function add($pid) { $form_field = $data = array('L_strErrorMessage' => '', 'subcatid' => '', 'pname' => '', 'desc' => '', 'youtubeurl' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_parts') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['pname'] = "trim|required"; $this->validation->set_rules($rules); $fields['pname'] = "Parts Name"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { //print_r($data);die(); if (!$this->parts_model->is_parts_already_exist_add($this->input->post('pname'))) { if ($response = $this->parts_model->add($data, $pid)) { $this->session->set_flashdata('L_strErrorMessage', 'Parts Added Succcessfully!!!!'); redirect($this->config->item('base_url') . 'parts/lists/' . $pid . ' '); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } else { $data['L_strErrorMessage'] = 'Parts already exist!'; } } } $this->load->view('add_parts', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'time_of_day' => '', 'start_time' => '', 'end_time' => '', 'status' => ''); $data['hoursRange'] = $this->appointment_time_model->hoursRange(); $data['dayTimes'] = $this->appointment_time_model->getDayTimes(); if (!isPageRefresh() || $this->input->post('action') == 'add_appointmentTime') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['time_of_day'] = "trim|required"; $rules['start_time'] = "trim|required"; $this->validation->set_rules($rules); $fields['time_of_day'] = "Time of Day"; $fields['start_time'] = "Time"; //$fields['price'] = "Price"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if ($response = $this->appointment_time_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Record Added Succcessfully!!!!'); redirect($this->config->item('base_url') . 'appointment_time/lists'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } } $this->load->view('add_appointment_time', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'product_id' => '', 'title' => '', 'review' => '', 'ratings' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_review') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['product_id'] = "trim|required"; $rules['title'] = "trim|required"; $rules['review'] = "trim|required"; $rules['ratings'] = "trim|required"; $this->validation->set_rules($rules); $fields['product_id'] = "product_id"; $fields['title'] = "title"; $fields['review'] = "review"; $fields['ratings'] = "ratings"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if ($response = $this->review_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Review Added Succcessfully!!!!'); redirect($this->config->item('base_url') . 'review/lists'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } } $data['product_list'] = $this->review_model->product_list(); //print_r($data);die; //$data['allusers'] = $this->users_model->allusers(); $this->load->view('add_review', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'fabricsname' => '', 'catid' => '', 'subcatid' => '', 'colourid' => '', 'designid' => '', 'pid' => '', 'name' => '', 'image' => '', 'price' => '', 'title' => '', 'description' => '', 'keyword' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_fabric') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } //PRINT_R($data);DIE; $this->load->library('validation'); $rules['fabricsname'] = "trim|required"; $this->validation->set_rules($rules); $fields['fabricsname'] = "Style Name"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if (!$this->fabric_model->is_fabric_already_exist_add($this->input->post('fabricsname'))) { if ($response = $this->fabric_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Style Added Successfully!!!'); redirect($this->config->item('base_url') . 'fabric/lists'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } else { $data['L_strErrorMessage'] = 'Style already exist!'; } } } $data['allcategory'] = $this->fabric_model->allcategory(); $data['allsubcategory'] = $this->fabric_model->allsubcategory(); $data['allcolour'] = $this->fabric_model->allcolour(); $data['allproduct'] = $this->fabric_model->allproduct(); $data['alldesign'] = $this->fabric_model->alldesign(); $this->load->view('add_fabric', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'cname' => '', 'permission' => '', 'editperm' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_location') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['cname'] = "trim|required"; $this->validation->set_rules($rules); $fields['cname'] = "Name"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if (!$this->permission_model->is_location_already_exist_add($this->input->post('cname'))) { if ($response = $this->permission_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'User Permission Added Succcessfully!!!!'); redirect($this->config->item('base_url') . 'permission/list_permission'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } else { $data['L_strErrorMessage'] = 'Permission already exist!'; } } } $data['allpermission'] = $this->permission_model->allpermission(); $this->load->view('add_permission', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'topicname' => '', 'userid' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_topics') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['topicname'] = "trim|required"; $this->validation->set_rules($rules); $fields['topicname'] = "Topic Name"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if (!$this->topics_model->is_colour_already_exist_add($this->input->post('topicname'))) { if ($response = $this->topics_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Topic Added Successfully!!!'); redirect($this->config->item('base_url') . 'topics/lists'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } else { $data['L_strErrorMessage'] = 'Topic already exist!'; } } } $data['topic_user'] = $this->topics_model->topic_user(); $this->load->view('add_insider', $data); }
function add($sid) { //echo $sid;die; $data = array('L_strErrorMessage' => '', 'subcatid' => '', 'size' => '', 'partsvalue' => '', 'fit' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_size') { foreach ($data as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['size'] = "trim|required"; $this->validation->set_rules($rules); $fields['size'] = "Size"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if (!$this->size_model->is_size_already_exist_add($this->input->post('size'), $sid, $this->input->post('fit'))) { if ($response = $this->size_model->add($data, $sid)) { $this->session->set_flashdata('L_strErrorMessage', 'Size Added Successfully!!!'); redirect($this->config->item('base_url') . 'size/lists/' . $sid . ' '); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } else { $data['L_strErrorMessage'] = 'Size already exist!'; } } } $data['allparts'] = $this->size_model->allparts($sid); $this->load->view('add_size', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'name' => '', 'login' => '', 'password' => '', 'email' => ' ', 'enabled' => '', 'category' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_users') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['name'] = "trim|required"; $rules['login'] = "******"; $rules['password'] = "******"; $rules['email'] = "trim|required"; $rules['enabled'] = "trim|required"; $this->validation->set_rules($rules); $fields['name'] = "Name"; $fields['login'] = "******"; $fields['password'] = "******"; $fields['email'] = "Email"; $fields['enabled'] = "Enable"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if (!$this->users_model->is_users_already_exist_add($this->input->post('login'), $this->input->post('email'))) { if ($response = $this->users_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Users Added Succcessfully!!!!'); redirect($this->config->item('base_url') . 'users/list_user'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } else { $data['L_strErrorMessage'] = 'User already exist!'; } } } $data['utype_list'] = $this->users_model->utype_list(); $data['allusers'] = $this->users_model->allusers(); $this->load->view('add_users', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'caption' => '', 'image' => '', 'slider_header' => '', 'slider_content' => '', 'button_label' => '', 'button_bgcolor' => '', 'url' => '', 'homepage' => '', 'first_row' => '', 'second_row' => '', 'third_row' => '', 'order' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_banner') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['caption'] = "trim|required"; $this->validation->set_rules($rules); $fields['caption'] = "Caption"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if ($_FILES['image']['name'] != '') { $tmp_name1 = $_FILES['image']['tmp_name']; $rootpath1 = $this->config->item('upload') . "banner/"; $logoname = $_FILES['image']['name']; move_uploaded_file($tmp_name1, $rootpath1 . $logoname); $tmp_path = $this->config->item('upload') . "banner/" . $logoname; $image_thumb = $this->config->item('upload') . "/banner/small/" . $logoname; $height = 50; $width = 50; $this->load->library('image_lib'); // CONFIGURE IMAGE LIBRARY $config['image_library'] = 'gd2'; $config['source_image'] = $tmp_path; $config['new_image'] = $image_thumb; $config['maintain_ratio'] = true; $config['height'] = $height; $config['width'] = $width; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); $tmp_path = $this->config->item('upload') . "banner/" . $logoname; $image_thumb = $this->config->item('upload') . "/banner/medium/" . $logoname; $height = 800; $width = 800; $this->load->library('image_lib'); // CONFIGURE IMAGE LIBRARY $config['image_library'] = 'gd2'; $config['source_image'] = $tmp_path; $config['new_image'] = $image_thumb; $config['maintain_ratio'] = true; $config['height'] = $height; $config['width'] = $width; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); $data['image'] = $logoname; } else { $data['image'] = ''; } /*if( $this->input->post('subcategory') != '' ) { $data['subcategory'] = implode(',', $_POST['subcategory']); } else { $data['subcategory'] = ""; }*/ if ($response = $this->banner_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Image Added Succcessfully!!!!'); redirect($this->config->item('base_url') . 'banner/lists'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } } $this->load->view('add_banner', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'cname' => '', 'image' => '', 'flag' => '', 'title' => '', 'description' => '', 'keyword' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_category') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['cname'] = "trim|required"; $this->validation->set_rules($rules); $fields['cname'] = "Category Name"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if ($_FILES['image']['name'] != '') { $tmp_name1 = $_FILES['image']['tmp_name']; $rootpath1 = $this->config->item('upload') . "category/"; $logoname = $_FILES['image']['name']; move_uploaded_file($tmp_name1, $rootpath1 . $logoname); $tmp_path = $this->config->item('upload') . "category/" . $logoname; $image_thumb = $this->config->item('upload') . "/category/small/" . $logoname; $height = 50; $width = 50; $this->load->library('image_lib'); // CONFIGURE IMAGE LIBRARY $config['image_library'] = 'gd2'; $config['source_image'] = $tmp_path; $config['new_image'] = $image_thumb; $config['maintain_ratio'] = true; $config['height'] = $height; $config['width'] = $width; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); $tmp_path = $this->config->item('upload') . "category/" . $logoname; $image_thumb = $this->config->item('upload') . "/category/medium/" . $logoname; $height = 800; $width = 800; $this->load->library('image_lib'); // CONFIGURE IMAGE LIBRARY $config['image_library'] = 'gd2'; $config['source_image'] = $tmp_path; $config['new_image'] = $image_thumb; $config['maintain_ratio'] = true; $config['height'] = $height; $config['width'] = $width; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); $data['image'] = $logoname; } else { $data['image'] = ''; } if (!$this->category_model->is_category_already_exist_add($this->input->post('cname'))) { if ($response = $this->category_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Category Added Successfully!!!'); redirect($this->config->item('base_url') . 'category/lists'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } else { $data['L_strErrorMessage'] = 'Category already exist!'; } } } $this->load->view('add_category', $data); }
function add() { $form_field = $data = array('L_strErrorMessage' => '', 'image' => '', 'fabric_id' => '', 'fabric_name' => '', 'price' => ''); if (!isPageRefresh() || $this->input->post('action') == 'add_hmlistpage') { foreach ($form_field as $key => $value) { $data[$key] = $this->input->post($key); } $this->load->library('validation'); $rules['fabric_id'] = "trim|required"; $rules['fabric_name'] = "trim|required"; $rules['price'] = "trim|required"; $this->validation->set_rules($rules); $fields['fabric_id'] = "Fabric Id"; $fields['fabric_name'] = "Fabric Name"; $fields['price'] = "Price"; $this->validation->set_fields($fields); if ($this->validation->run() == FALSE) { $data['L_strErrorMessage'] = $this->validation->error_string; } else { if ($_FILES['image']['name'] != '') { $tmp_name1 = $_FILES['image']['tmp_name']; $rootpath1 = $this->config->item('upload') . "hmlistpage/"; $logoname = $_FILES['image']['name']; move_uploaded_file($tmp_name1, $rootpath1 . $logoname); $tmp_path = $this->config->item('upload') . "hmlistpage/" . $logoname; $image_thumb = $this->config->item('upload') . "/hmlistpage/small/" . $logoname; $height = 50; $width = 50; $this->load->library('image_lib'); // CONFIGURE IMAGE LIBRARY $config['image_library'] = 'gd2'; $config['source_image'] = $tmp_path; $config['new_image'] = $image_thumb; $config['maintain_ratio'] = true; $config['height'] = $height; $config['width'] = $width; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); $tmp_path = $this->config->item('upload') . "hmlistpage/" . $logoname; $image_thumb = $this->config->item('upload') . "/hmlistpage/medium/" . $logoname; $height = 800; $width = 800; $this->load->library('image_lib'); // CONFIGURE IMAGE LIBRARY $config['image_library'] = 'gd2'; $config['source_image'] = $tmp_path; $config['new_image'] = $image_thumb; $config['maintain_ratio'] = true; $config['height'] = $height; $config['width'] = $width; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); $data['image'] = $logoname; } else { $data['image'] = ''; } /*if( $this->input->post('subcategory') != '' ) { $data['subcategory'] = implode(',', $_POST['subcategory']); } else { $data['subcategory'] = ""; }*/ if ($response = $this->hmlistpage_model->add($data)) { $this->session->set_flashdata('L_strErrorMessage', 'Record Added Succcessfully!!!!'); redirect($this->config->item('base_url') . 'hmlistpage/lists'); } else { $data['L_strErrorMessage'] = 'Some Errors prevented from adding data,please try later.'; } } } $this->load->view('add_list_product', $data); }