Example #1
0
 function getMasterBrandList_post()
 {
     $rules = required_organization_id();
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run()) {
         $brand_listing = $this->organization_category_m->get_brand_list();
         if (!empty($brand_listing)) {
             $this->apiresponse['success'] = 0;
             $this->apiresponse['response'] = array('message' => 'successfully get brand listing', 'data' => $brand_listing);
             $this->response($this->apiresponse, 200);
         } else {
             $this->apiresponse['success'] = 0;
             $this->apiresponse['response'] = array('message' => 'no brand found');
             $this->response($this->apiresponse, 200);
         }
     } else {
         $this->apiresponse['success'] = 0;
         $this->apiresponse['response'] = array('message' => $this->form_validation->error_array());
         $this->response($this->apiresponse, 200);
     }
 }
Example #2
0
 public function discountIdProductListing_post()
 {
     $rules = required_organization_id();
     $rules[] = array('field' => 'set', 'label' => 'set', 'rules' => 'trim|required');
     $rules[] = array('field' => 'discountId', 'label' => 'discountId', 'rules' => 'trim|required');
     $rules[] = array('field' => 'count', 'label' => 'Count', 'rules' => 'trim|required');
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run()) {
         $organizationId = $this->post('organizationId');
         $set = $this->post('set');
         $limit = $this->post('count');
         $discountId = $this->post('discountId');
         $set = $set - 1;
         $start = $set * $limit;
         $set++;
         $start1 = $set * $limit;
         $where = '';
         $discountListing = $this->api_discount_m->get_product_discount_list($organizationId, $discountId, $start, $limit, $where);
         $more = $this->api_discount_m->get_product_discount_list($organizationId, $discountId, $start1, 1, $where);
         if (!empty($more)) {
             $more = TRUE;
         } else {
             $more = FALSE;
         }
         if (!empty($discountListing)) {
             $this->apiresponse['success'] = 1;
             $this->apiresponse['response'] = array('message' => 'successfully get discount product  Listing', 'data' => $discountListing, 'more' => $more);
             $this->response($this->apiresponse, 200);
         } else {
             $this->apiresponse['success'] = 0;
             $this->apiresponse['response'] = array('message' => 'No Record Found');
             $this->response($this->apiresponse, 200);
         }
     } else {
         $this->apiresponse['success'] = 0;
         $this->apiresponse['response'] = array('message' => $this->form_validation->error_array());
         $this->response($this->apiresponse, 200);
     }
 }
Example #3
0
 public function sendRecharge_post()
 {
     $rules = required_organization_id();
     $rules[] = array('field' => 'phoneNo', 'label' => 'amount', 'rules' => 'trim|required');
     $rules[] = array('field' => 'amount', 'label' => 'amount', 'rules' => 'trim|required');
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run()) {
         $this->load->library('recharge_lib');
         $mobilenumber = $this->post('phoneNo');
         $amount = $this->post('amount');
         $param['mobile_no'] = $mobilenumber;
         $param['amount'] = $amount;
         $this->custom_log->write_log('custom_log', print_r($param, true));
         $json_resp = $this->recharge_lib->do_recharge_request($param);
         $resp = json_decode($json_resp);
         $this->custom_log_lib->write_log('custom_log', print_r($resp, true));
     } else {
         $this->apiresponse['success'] = 0;
         $this->apiresponse['response'] = array('message' => $this->form_validation->error_array());
         $this->response($this->apiresponse, 200);
     }
 }
Example #4
0
 public function employeeList_post()
 {
     $rules = required_organization_id();
     $rules[] = array('field' => 'set', 'label' => 'set', 'rules' => 'trim|required');
     $rules[] = array('field' => 'count', 'label' => 'Count', 'rules' => 'trim|required');
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run()) {
         $organizationId = $this->post('organizationId');
         $limit = $this->post('count');
         $set = $this->post('set');
         $set = $set - 1;
         $start = $set * $limit;
         $set++;
         $start1 = $set * $limit;
         $employeelist = $this->employee_m->ajax_employee_list($start, $limit, $organizationId);
         $more = $this->employee_m->ajax_employee_list($start1, 1, $organizationId);
         //echo $this->db->last_query();
         if (!empty($more)) {
             $more = TRUE;
         } else {
             $more = FALSE;
         }
         if (!empty($employeelist)) {
             $this->apiresponse['success'] = 1;
             $this->apiresponse['response'] = array('message' => '', 'data' => $employeelist, 'more' => $more);
             $this->response($this->apiresponse, 200);
         } else {
             $this->apiresponse['success'] = 0;
             $this->apiresponse['response'] = array('message' => '', 'data' => 'no employee found');
             $this->response($this->apiresponse, 200);
         }
     } else {
         $this->apiresponse['success'] = 0;
         $this->apiresponse['response'] = array('message' => '', 'data' => 'please send valida parameter');
         $this->response($this->apiresponse, 200);
     }
 }
Example #5
0
 public function subCategoryListing_post()
 {
     $rules = required_organization_id();
     $rules[] = array('field' => 'set', 'label' => 'set', 'rules' => 'trim|required');
     $rules[] = array('field' => 'count', 'label' => 'Count', 'rules' => 'trim|required');
     $this->form_validation->set_rules($rules);
     if ($this->form_validation->run()) {
         $organizationId = $this->post('organizationId');
         $limit = $this->post('count');
         $set = $this->post('set');
         $set = $set - 1;
         $start = $set * $limit;
         $set++;
         $start1 = $set * $limit;
         //$organizationId=$this->post('organizationId');
         if (isset($_POST['categoryId'])) {
             $categoryId = $this->post('categoryId');
             $where = 'organization_category.parentCategoryId = ' . $categoryId;
             if (isset($_POST['query'])) {
                 $query = $this->post('query');
                 $where = 'and organization_category.categoryCode like "%' . $query . '%"';
             }
         } else {
             $where = '';
             if (isset($_POST['query'])) {
                 $query = $this->post('query');
                 $where .= 'organization_category.categoryCode like "%' . $query . '%"';
             }
         }
         $category_array = $this->organization_category_m->sub_category_listing($organizationId, $start, $limit, $where);
         $more = $this->organization_category_m->sub_category_listing($organizationId, $start1, $limit, $where);
         if (!empty($more)) {
             $more = TRUE;
         } else {
             $more = FALSE;
         }
         //$category_array=$this->organization_category_m->sub_category_listing($organizationId);
         if (!empty($category_array)) {
             $this->apiresponse['success'] = 1;
             $this->apiresponse['response'] = array('message' => 'successfully listed category', 'data' => $category_array, 'more' => $more);
             $this->response($this->apiresponse, 200);
         } else {
             $this->apiresponse['success'] = 0;
             $this->apiresponse['response'] = array('message' => 'No result Found');
             $this->response($this->apiresponse, 200);
         }
     } else {
         $this->apiresponse['success'] = 0;
         $this->apiresponse['response'] = array('message' => $this->form_validation->error_array());
         $this->response($this->apiresponse, 200);
     }
 }