?> <li><a href="<?php echo base_url(); ?> report/report_home/">প্রতিবেদন</a></li> <li><a href="<?php echo base_url(); ?> home/logout/">লগ আউট</a></li> </ul> <div class="clearfix"></div> </div> </div> <?php $uisc = User_helper::get_uisc_info(); if (sizeof($uisc) > 0) { ?> <div class="col-lg-12 text-right"> <p class="text-primary"> সেবা কেন্দ্রের নাম: <?php echo $uisc->uisc_name; ?> </p> </div> <div class="clearfix"></div> <br/> <?php } ?>
private function system_save() { $user = User_helper::get_user(); $uisc = User_helper::get_uisc_info(); $id = $this->input->post("id"); if ($id > 0) { if (!$this->permissions['edit']) { $ajax['status'] = false; $ajax['system_message'] = $this->lang->line("YOU_DONT_HAVE_ACCESS"); $this->jsonReturn($ajax); die; } } else { if (!$this->permissions['add']) { $ajax['status'] = false; $ajax['system_message'] = $this->lang->line("YOU_DONT_HAVE_ACCESS"); $this->jsonReturn($ajax); die; } } if (!$this->check_validation()) { $ajax['status'] = false; $ajax['system_message'] = $this->message; $this->jsonReturn($ajax); } else { //$service_detail['createdby']=$user->id; $service_detail['created_time'] = time(); $service_detail['uisc_id'] = $uisc->id; $service_detail['user_id'] = $user->id; //$service_detail['status']=$this->config->item('SERVICES_STATUS_PROPOSED'); $this->db->trans_start(); //DB Transaction Handle START $all_update['status'] = $this->config->item('STATUS_INACTIVE'); Query_helper::update($this->config->item('table_services_uisc'), $all_update, array("user_id = " . $user->id)); $number_of_service = sizeof($this->input->post("service_id")); $service_id = $this->input->post('service_id'); $uisc_service_id = $this->input->post('uisc_service_id'); for ($i = 0; $i < $number_of_service; $i++) { $check_post = $service_id[$i]; if ($this->input->post($check_post)) { $uisc_service_post_id = $uisc_service_id[$i]; // $single_data['remaining']="'remaining'+1"; // Query_helper::update($this->config->item('table_services_uisc'),$single_data,array("user_id = ".$user->id, "service_id = ".$uisc_service_post_id)); $update_sql = "update " . $this->config->item('table_services_uisc') . " set remaining=remaining+1 where user_id='" . $user->id . "' AND service_id='{$uisc_service_post_id}'"; $this->db->query($update_sql); $service_detail['service_id'] = $check_post; $service_detail['remaining'] = 1; Query_helper::add($this->config->item('table_services_uisc'), $service_detail); } } /* $number_of_own_service=sizeof($this->input->post("own_service_id")); $service_id=$this->input->post('service_id'); $uisc_service_id=$this->input->post('uisc_service_id'); for($i=0; $i<$number_of_service; $i++) { $check_post=$service_id[$i]; if($this->input->post($check_post)) { $uisc_service_post_id=$uisc_service_id[$i]; // $single_data['remaining']="'remaining'+1"; // Query_helper::update($this->config->item('table_services_uisc'),$single_data,array("user_id = ".$user->id, "service_id = ".$uisc_service_post_id)); $update_sql="update ".$this->config->item('table_services_uisc')." set remaining=remaining+1 where user_id='".$user->id."' AND service_id='$uisc_service_post_id'"; $this->db->query($update_sql); $service_detail['service_id']=$check_post; $service_detail['remaining']=1; Query_helper::add($this->config->item('table_services_uisc'),$service_detail); } } */ // $service_detail_uisc['uisc_id']=$user->id; // $service_detail_uisc['service_id']=$service_last_id; // $service_detail_uisc['user_id']=$user->id; // $service_detail_uisc['created_time']=time(); // Query_helper::add($this->config->item('table_services_uisc'),$service_detail_uisc); $this->db->trans_complete(); //DB Transaction Handle END //die(); if ($this->db->trans_status() === TRUE) { $this->message = $this->lang->line("MSG_CREATE_SUCCESS"); $this->system_add(); } else { $ajax['status'] = false; $ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL"); $this->jsonReturn($ajax); } } }