本文整理汇总了PHP中Query_helper::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Query_helper::add方法的具体用法?PHP Query_helper::add怎么用?PHP Query_helper::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Query_helper
的用法示例。
在下文中一共展示了Query_helper::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dcms_save
private function dcms_save()
{
$user = User_helper::get_user();
$data = array();
if (!$this->check_validation()) {
$ajax['status'] = false;
$ajax['system_message'] = $this->message;
$this->jsonReturn($ajax);
} else {
$data['suggestion'] = $this->input->post('suggestion');
$data['date'] = date('Y-m-d');
$data['uisc_id'] = $user->uisc_id;
$data['created'] = $user->id;
$data['user_id'] = $user->id;
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::add($this->config->item('table_suggestion'), $data);
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$this->dcms_add();
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
示例2: login
public function login()
{
$user = User_helper::get_user();
if ($user) {
$this->dashboard_page();
} else {
if ($this->input->post()) {
if (User_helper::login($this->input->post("username"), $this->input->post("password"))) {
$user = User_helper::get_user();
$user_info['user_id'] = $user->id;
$user_info['login_time'] = time();
$user_info['ip_address'] = $this->input->ip_address();
$user_info['request_headers'] = json_encode($this->input->request_headers());
Query_helper::add($this->config->item('table_user_login_history'), $user_info);
$this->dashboard_page($this->lang->line("MSG_LOGIN_SUCCESS"));
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_USERNAME_PASSWORD_INVALID");
$this->jsonReturn($ajax);
}
} else {
$this->login_page();
//login page view
}
}
}
示例3: index
public function index($service_id)
{
$user = User_helper::get_user();
$time = time();
$service_info = Query_helper::get_info($this->config->item('table_api_services'), '*', array('status =1', 'id =' . $service_id), 1);
if ($service_info) {
$data['auth_token'] = random_string('unique') . $time;
$data['user_id'] = $user->id;
$data['service_id'] = $service_id;
$data['time'] = $time;
$data['status'] = 1;
$id = Query_helper::add($this->config->item('table_api_auth_token'), $data);
if ($id) {
redirect($service_info['service_url'] . $data['auth_token'], 'refresh');
} else {
echo "Unable to save data";
}
} else {
echo "invalid service";
}
}
示例4: system_save
private function system_save()
{
$user = User_helper::get_user();
$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 {
$user_id = $this->input->post('user_id');
//$row_id=$this->input->post('row_id');
$ticket_issue_id = $this->input->post('ticket_issue_id');
$ticket_priority = $this->input->post('ticket_priority');
$count = count($this->input->post('row_id'));
if ($id > 0) {
// unset($ticket_detail['id']);
//
// $ticket_detail['update_by']=$user->id;
// $ticket_detail['update_date']=time();
//
// $this->db->trans_start(); //DB Transaction Handle START
//
// Query_helper::update($this->config->item('table_ticket_assign'),$ticket_detail,array("id = ".$id));
//
// $this->db->trans_complete(); //DB Transaction Handle END
//
// if ($this->db->trans_status() === TRUE)
// {
// $this->message=$this->lang->line("MSG_UPDATE_SUCCESS");
// $save_and_new=$this->input->post('system_save_new_status');
// if($save_and_new==1)
// {
// $this->system_add();
// }
// else
// {
// $this->system_list();
// }
// }
// else
// {
// $ajax['status']=false;
// $ajax['system_message']=$this->lang->line("MSG_UPDATE_FAIL");
// $this->jsonReturn($ajax);
// }
} else {
$ticket_detail['status'] = $this->config->item('STATUS_ASSIGN');
$ticket_detail['create_by'] = $user->id;
$ticket_detail['create_date'] = time();
$ticket_issue_detail['status'] = $this->config->item('STATUS_ASSIGN');
$ticket_issue_detail['update_by'] = $user->id;
$ticket_issue_detail['update_date'] = time();
$this->db->trans_start();
//DB Transaction Handle START
for ($i = 0; $i < $count; $i++) {
if (isset($ticket_issue_id[$i])) {
$ticket_detail['user_id'] = $user_id;
$ticket_detail['ticket_issue_id'] = $ticket_issue_id[$i];
$ticket_detail['priority'] = $ticket_priority[$i];
Query_helper::add($this->config->item('table_ticket_assign'), $ticket_detail);
Query_helper::update($this->config->item('table_ticket_issue'), $ticket_issue_detail, array("id = " . $ticket_issue_id[$i]));
}
}
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
}
示例5: system_save
private function system_save()
{
$user = User_helper::get_user();
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 {
$data = $this->input->post('product_assign');
$data['create_by'] = $user->id;
$data['create_date'] = time();
$data['status'] = 1;
$data['assign_date'] = strtotime($data['assign_date']);
$data['return_date'] = strtotime($data['return_date']);
$this->db->trans_start();
//DB Transaction Handle START
$inserted_product = array();
foreach ($data['product_id'] as $product) {
$data['product_id'] = $product;
if (!in_array($product, $inserted_product)) {
Query_helper::add($this->config->item('table_product_assign'), $data);
}
$inserted_product[] = $product;
}
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
示例6: system_save
private function system_save()
{
$user = User_helper::get_user();
$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 {
$supplier_detail = $this->input->post('supplier');
if ($id > 0) {
unset($supplier_detail['id']);
$supplier_detail['update_by'] = $user->id;
$supplier_detail['update_date'] = time();
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::update($this->config->item('table_supplier'), $supplier_detail, array("id = " . $id));
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_UPDATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_UPDATE_FAIL");
$this->jsonReturn($ajax);
}
} else {
$supplier_detail['status'] = $this->config->item('STATUS_ACTIVE');
$supplier_detail['create_by'] = $user->id;
$supplier_detail['create_date'] = time();
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::add($this->config->item('table_supplier'), $supplier_detail);
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
}
示例7: system_save
private function system_save()
{
$user = User_helper::get_user();
$id = $this->input->post("id");
if (!$this->permissions['edit']) {
$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 {
$tasks = $this->input->post('tasks');
$user_group_id = $this->input->post('id');
$time = time();
$this->db->trans_start();
//DB Transaction Handle START
foreach ($tasks as $task) {
$data = array();
if (isset($task['list']) && $task['list'] == 1) {
$data['list'] = 1;
} else {
$data['list'] = 0;
}
if (isset($task['view']) && $task['view'] == 1) {
$data['view'] = 1;
} else {
$data['view'] = 0;
}
if (isset($task['add']) && $task['add'] == 1) {
$data['add'] = 1;
} else {
$data['add'] = 0;
}
if (isset($task['edit']) && $task['edit'] == 1) {
$data['edit'] = 1;
} else {
$data['edit'] = 0;
}
if (isset($task['delete']) && $task['delete'] == 1) {
$data['delete'] = 1;
} else {
$data['delete'] = 0;
}
if (isset($task['report']) && $task['report'] == 1) {
$data['report'] = 1;
} else {
$data['report'] = 0;
}
if (isset($task['print']) && $task['print'] == 1) {
$data['print'] = 1;
} else {
$data['print'] = 0;
}
if ($data['view'] || $data['add'] || $data['edit'] || $data['delete'] || $data['report'] || $data['print']) {
$data['list'] = 1;
}
if ($task['ugr_id'] > 0) {
$data['update_by'] = $user->id;
$data['update_date'] = $time;
Query_helper::update($this->config->item('table_user_group_role'), $data, array("id = " . $task['ugr_id']));
} else {
$data['user_group_id'] = $user_group_id;
$data['component_id'] = $task['component_id'];
$data['module_id'] = $task['module_id'];
$data['task_id'] = $task['task_id'];
$data['create_by'] = $user->id;
$data['create_date'] = $time;
Query_helper::add($this->config->item('table_user_group_role'), $data);
}
}
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_ROLE_ASSIGN_SUCCESS");
$this->system_list();
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_ROLE_ASSIGN_FAIL");
$this->jsonReturn($ajax);
}
}
}
示例8: system_save
private function system_save()
{
$user = User_helper::get_user();
$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 {
$data = array('name_en' => $this->input->post('name_en'), 'name_bn' => $this->input->post('name_bn'), 'component_id' => $this->input->post('component_id'), 'icon' => $this->input->post('icon'), 'description' => $this->input->post('description'), 'ordering' => $this->input->post('ordering'), 'status' => $this->input->post('status'));
if ($id > 0) {
$data['update_by'] = $user->id;
$data['update_date'] = time();
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::update($this->config->item('table_module'), $data, array("id = " . $id));
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_UPDATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_UPDATE_FAIL");
$this->jsonReturn($ajax);
}
} else {
$data['create_by'] = $user->id;
$data['create_date'] = time();
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::add($this->config->item('table_module'), $data);
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
}
示例9: system_save
private function system_save()
{
$user = User_helper::get_user();
$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 {
$data = $this->input->post('product');
$dir = $this->config->item("file_upload");
$uploaded = System_helper::upload_file($dir['users'], 1024, 'gif|jpg|png|doc|pdf|xls|xlsx');
$attachment = '';
if (array_key_exists('attachment', $uploaded)) {
if ($uploaded['attachment']['status']) {
$attachment = $uploaded['attachment']['info']['file_name'];
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->message .= $uploaded['attachment']['message'] . '<br>';
$this->jsonReturn($ajax);
}
}
if ($id > 0) {
unset($data['id']);
$data['update_by'] = $user->id;
$data['attachment'] = $attachment;
$data['status'] = 1;
$data['warranty_start_date'] = strtotime($data['warranty_start_date']);
$data['warranty_end_date'] = strtotime($data['warranty_end_date']);
$data['purchase_date'] = strtotime($data['purchase_date']);
$data['update_date'] = time();
$data['product_code'] = $data['product_code'][0];
$data['serial_number'] = $data['serial_number'][0];
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::update($this->config->item('table_product'), $data, array("id = " . $id));
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_UPDATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_UPDATE_FAIL");
$this->jsonReturn($ajax);
}
} else {
$data['create_by'] = $user->id;
$data['create_date'] = time();
$data['status'] = 1;
$data['attachment'] = $attachment;
$data['warranty_start_date'] = strtotime($data['warranty_start_date']);
$data['warranty_end_date'] = strtotime($data['warranty_end_date']);
$data['purchase_date'] = strtotime($data['purchase_date']);
$data['quantity'] = 1;
$product_code = $data['product_code'];
$serial_number = $data['serial_number'];
unset($data['product_code']);
unset($data['serial_number']);
$this->db->trans_start();
//DB Transaction Handle START
foreach ($product_code as $key => $code) {
$data['product_code'] = $code;
$data['serial_number'] = $serial_number[$key];
Query_helper::add($this->config->item('table_product'), $data);
}
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
//.........这里部分代码省略.........
示例10: system_save
private function system_save()
{
$user = User_helper::get_user();
$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 {
$media_info = $this->input->post('media');
$dir = $this->config->item("dcms_upload");
if ($media_info['media_type'] == 1) {
$directory = $dir['media_photo'];
unset($media_info['video_link']);
unset($media_info['print_year']);
unset($media_info['external_link']);
} elseif ($media_info['media_type'] == 2) {
$directory = $dir['media_photo'];
unset($media_info['print_year']);
unset($media_info['external_link']);
} elseif ($media_info['media_type'] == 3) {
$directory = $dir['media_print'];
unset($media_info['video_link']);
} elseif ($media_info['media_type'] == 4) {
$directory = $dir['media_publication'];
unset($media_info['video_link']);
unset($media_info['print_year']);
}
$uploaded = System_helper::upload_file($directory, 5120, 'gif|jpg|png|pdf|doc|docx');
if (array_key_exists('file_name', $uploaded)) {
if ($uploaded['file_name']['status']) {
$media_info['file_name'] = $uploaded['file_name']['info']['file_name'];
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->message .= $uploaded['file_name']['message'] . '<br>';
$this->jsonReturn($ajax);
}
}
if ($id > 0) {
unset($media_info['id']);
$media_info['update_by'] = $user->id;
$media_info['update_date'] = time();
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::update($this->config->item('table_media'), $media_info, array("id = " . $id));
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_UPDATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_UPDATE_FAIL");
$this->jsonReturn($ajax);
}
} else {
$media_info['create_by'] = $user->id;
$media_info['create_date'] = time();
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::add($this->config->item('table_media'), $media_info);
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
}
示例11: system_save
private function system_save()
{
//print_r($this->input->post());exit;
$user = User_helper::get_user();
$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 {
$notice_detail = $this->input->post('notice_detail');
$notice_detail_general = array();
$notice_detail_specific = array();
$dir = $this->config->item("dcms_upload");
$uploaded = System_helper::upload_file($dir['notice'], 5120, 'gif|jpg|png|pdf');
if (array_key_exists('upload_file', $uploaded)) {
if ($uploaded['upload_file']['status']) {
$notice_detail['upload_file'] = $uploaded['upload_file']['info']['file_name'];
} else {
$ajax['status'] = false;
$ajax['desk_message'] = $this->message .= $uploaded['upload_file']['message'] . '<br>';
$this->jsonReturn($ajax);
}
}
if ($id > 0) {
unset($notice_detail['id']);
$this->db->trans_start();
//DB Transaction Handle START
$notice_detail['update_by'] = $user->id;
$notice_detail['update_date'] = time();
Query_helper::update($this->config->item('table_notice'), $notice_detail, array("id = " . $id));
if ($notice_detail['notice_type'] == 1) {
$general_user_groups = $this->input->post('general_user_group');
// Initial Update
$this->notice_create_model->initial_notice_update($id);
$existing_general_viewers = $this->notice_create_model->existing_viewer_groups($id);
foreach ($general_user_groups as $general_user_group) {
if (in_array($general_user_group, $existing_general_viewers)) {
$notice_detail_general['status'] = $this->config->item('STATUS_ACTIVE');
Query_helper::update($this->config->item('table_notice_view'), $notice_detail_general, array("notice_id = " . $id, "viewer_user_group =" . $general_user_group));
} else {
$notice_detail_general['viewer_user_group'] = $general_user_group;
$notice_detail_general['sender_user_group'] = $user->user_group_id;
$notice_detail_general['notice_id'] = $id;
$notice_detail_general['status'] = $notice_detail['status'];
Query_helper::add($this->config->item('table_notice_view'), $notice_detail_general);
}
}
} elseif ($notice_detail['notice_type'] == 2) {
$sup_group_post = $this->input->post('sub_group');
if (sizeof($sup_group_post) > 0) {
// Initial Update
$this->notice_create_model->initial_notice_update($id);
$existing_specific_viewers = $this->notice_create_model->existing_viewer_groups($id);
foreach ($sup_group_post as $sup_group) {
if (in_array($sup_group, $existing_specific_viewers)) {
$notice_detail_specific['status'] = $this->config->item('STATUS_ACTIVE');
Query_helper::update($this->config->item('table_notice_view'), $notice_detail_specific, array("notice_id = " . $id, "viewer_user_group=" . $sup_group));
} else {
$notice_detail_specific['viewer_user_group'] = $sup_group;
$notice_detail_specific['sender_user_group'] = $user->user_group_id;
$notice_detail_specific['notice_id'] = $id;
$notice_detail_specific['division'] = $this->input->post('division');
$notice_detail_specific['zilla'] = $this->input->post('zilla');
$notice_detail_specific['upazila'] = $this->input->post('upazila');
$notice_detail_specific['unioun'] = $this->input->post('union');
$notice_detail_specific['citycorporation'] = $this->input->post('city_corporation');
$notice_detail_specific['citycorporationward'] = $this->input->post('city_corporation_ward');
$notice_detail_specific['municipal'] = $this->input->post('municipal');
$notice_detail_specific['municipalward'] = $this->input->post('municipal_ward');
$notice_detail_specific['uisc_id'] = $this->input->post('digital_center');
$notice_detail_specific['status'] = $notice_detail['status'];
Query_helper::add($this->config->item('table_notice_view'), $notice_detail_specific);
}
}
} else {
$notice_detail_specific['viewer_user_group'] = $this->input->post('specific_user_level');
$notice_detail_specific['sender_user_group'] = $user->user_group_id;
$notice_detail_specific['notice_id'] = $id;
$notice_detail_specific['division'] = $this->input->post('division');
$notice_detail_specific['zilla'] = $this->input->post('zilla');
$notice_detail_specific['upazila'] = $this->input->post('upazila');
$notice_detail_specific['unioun'] = $this->input->post('union');
$notice_detail_specific['citycorporation'] = $this->input->post('city_corporation');
$notice_detail_specific['citycorporationward'] = $this->input->post('city_corporation_ward');
//.........这里部分代码省略.........
示例12: system_save
private function system_save()
{
$user = User_helper::get_user();
$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 {
$zilla_detail = $this->input->post('zilla_detail');
if ($id > 0) {
//$zilla_detail['update_by']=$user->id;
//$zilla_detail['update_date']=time();
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::update($this->config->item('table_zillas'), $zilla_detail, array("id = " . $id));
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_UPDATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_UPDATE_FAIL");
$this->jsonReturn($ajax);
}
} else {
//$zilla_detail['create_by']=$user->id;
//$zilla_detail['create_date']=time();
$divid = $zilla_detail['divid'];
$zillas = Query_helper::get_info($this->config->item('table_zillas'), array('MAX(zillaid) as max_zilla_id'), array("divid = " . $divid));
if (strlen($zillas[0]['max_zilla_id'] + 1) == 1) {
$zillaid = "0" . ($zillas[0]['max_zilla_id'] + 1);
} else {
$zillaid = $zillas[0]['max_zilla_id'] + 1;
}
$zilla_detail['zillaid'] = $zillaid;
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::add($this->config->item('table_zillas'), $zilla_detail);
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
}
示例13: system_save
private function system_save()
{
$user = User_helper::get_user();
$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 {
$comment_detail = $this->input->post('comment');
if ($id > 0) {
$this->db->trans_start();
//DB Transaction Handle START
if ($user->user_group_level == $this->config->item('SUPPORT_GROUP_ID')) {
$comment_detail['type'] = $this->config->item('ticket_comment_support_user');
$comment_detail['ticket_assign_id'] = $id;
$comment_detail['create_by'] = $user->id;
$comment_detail['create_date'] = time();
Query_helper::add($this->config->item('table_ticket_resolve_comment'), $comment_detail);
} elseif ($user->user_group_level == $this->config->item('OFFICER_GROUP_ID')) {
$comment_detail['type'] = $this->config->item('ticket_comment_manager');
$comment_detail['ticket_assign_id'] = $id;
$comment_detail['create_by'] = $user->id;
$comment_detail['create_date'] = time();
Query_helper::add($this->config->item('table_ticket_resolve_comment'), $comment_detail);
$ticket_issue_detail['update_by'] = $user->id;
$ticket_issue_detail['create_date'] = time();
if (!empty($comment_detail['ticket_status_id'])) {
$ticket_issue_detail['status'] = $comment_detail['ticket_status_id'];
} else {
unset($ticket_issue_detail['status']);
}
Query_helper::update($this->config->item('table_ticket_issue'), $ticket_issue_detail, array("id = " . $comment_detail['ticket_issue_id']));
$ticket_assign_detail['update_by'] = $user->id;
$ticket_assign_detail['create_date'] = time();
if (!empty($comment_detail['ticket_status_id'])) {
$ticket_assign_detail['status'] = $comment_detail['ticket_status_id'];
} else {
unset($ticket_assign_detail['status']);
}
Query_helper::update($this->config->item('table_ticket_assign'), $ticket_assign_detail, array("id = " . $id));
} elseif ($user->user_group_level == $this->config->item('END_GROUP_ID')) {
$comment_detail['type'] = $this->config->item('ticket_comment_end_user');
$comment_detail['ticket_assign_id'] = $id;
$comment_detail['create_by'] = $user->id;
$comment_detail['create_date'] = time();
Query_helper::add($this->config->item('table_ticket_resolve_comment'), $comment_detail);
} else {
}
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_UPDATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_UPDATE_FAIL");
$this->jsonReturn($ajax);
}
} else {
// $comment_detail['status']=$this->config->item('STATUS_PENDING');
// $comment_detail['create_by']=$user->id;
// $comment_detail['create_date']=time();
//
// $ticket_issue_detail['status']=$this->config->item('STATUS_ASSIGN');
// $ticket_issue_detail['create_by']=$user->id;
// $ticket_issue_detail['create_date']=time();
//
// $this->db->trans_start(); //DB Transaction Handle START
// for($i=0;$i<$count;$i++)
// {
// if(isset($ticket_issue_id[$i]))
// {
// //echo $ticket_issue_id[$i]."<br />";
// $comment_detail['user_id']=$user_id;
// $comment_detail['ticket_issue_id']=$ticket_issue_id[$i];
// Query_helper::add($this->config->item('table_ticket_resolve'),$comment_detail);
// Query_helper::update($this->config->item('table_ticket_issue'),$ticket_issue_detail,array("id = ".$ticket_issue_id[$i]));
// }
// }
//.........这里部分代码省略.........
示例14: system_save
private function system_save()
{
$user = User_helper::get_user();
$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 {
$userDetail = $this->input->post('user_detail');
if ($id > 0) {
if ($userDetail['password'] != "") {
$encryptPass = md5(md5($userDetail['password']));
unset($userDetail['password']);
unset($userDetail['confirm_password']);
$userDetail['password'] = $encryptPass;
} else {
unset($userDetail['password']);
unset($userDetail['confirm_password']);
}
} else {
$encryptPass = md5(md5($userDetail['password']));
unset($userDetail['password']);
unset($userDetail['confirm_password']);
$userDetail['password'] = $encryptPass;
}
$user_group_id_level = explode('-', $this->input->post("user_detail[user_group_id]"));
$user_group_id = $user_group_id_level[0];
$user_group_level = $user_group_id_level[1];
$userDetail['user_group_id'] = $user_group_id;
if ($user_group_level == $this->config->item('SUPER_ADMIN_GROUP_ID') || $user_group_level == $this->config->item('A_TO_I_GROUP_ID') || $user_group_level == $this->config->item('DONOR_GROUP_ID') || $user_group_level == $this->config->item('MINISTRY_GROUP_ID')) {
$userDetail['division'] = '';
$userDetail['zilla'] = '';
$userDetail['upazila'] = '';
$userDetail['unioun'] = '';
$userDetail['citycorporation'] = '';
$userDetail['citycorporationward'] = '';
$userDetail['municipal'] = '';
$userDetail['municipalward'] = '';
$userDetail['uisc_id'] = 0;
} else {
if ($user_group_level == $this->config->item('DIVISION_GROUP_ID')) {
$userDetail['zilla'] = '';
$userDetail['upazila'] = '';
$userDetail['unioun'] = '';
$userDetail['citycorporation'] = '';
$userDetail['citycorporationward'] = '';
$userDetail['municipal'] = '';
$userDetail['municipalward'] = '';
$userDetail['uisc_id'] = 0;
} else {
if ($user_group_level == $this->config->item('DISTRICT_GROUP_ID')) {
$userDetail['upazila'] = '';
$userDetail['unioun'] = '';
$userDetail['citycorporation'] = '';
$userDetail['citycorporationward'] = '';
$userDetail['municipal'] = '';
$userDetail['municipalward'] = '';
$userDetail['uisc_id'] = 0;
} else {
if ($user_group_level == $this->config->item('UPAZILLA_GROUP_ID')) {
$userDetail['unioun'] = '';
$userDetail['citycorporation'] = '';
$userDetail['citycorporationward'] = '';
$userDetail['municipal'] = '';
$userDetail['municipalward'] = '';
$userDetail['uisc_id'] = 0;
} else {
if ($user_group_level == $this->config->item('UNION_GROUP_ID')) {
$userDetail['citycorporation'] = '';
$userDetail['citycorporationward'] = '';
$userDetail['municipal'] = '';
$userDetail['municipalward'] = '';
$userDetail['uisc_id'] = 0;
} else {
if ($user_group_level == $this->config->item('CITY_CORPORATION_GROUP_ID')) {
$userDetail['citycorporationward'] = '';
$userDetail['municipal'] = '';
$userDetail['municipalward'] = '';
$userDetail['uisc_id'] = 0;
} else {
if ($user_group_level == $this->config->item('CITY_CORPORATION_WORD_GROUP_ID')) {
$userDetail['municipal'] = '';
$userDetail['municipalward'] = '';
$userDetail['uisc_id'] = 0;
//.........这里部分代码省略.........
示例15: system_save
private function system_save()
{
$user = User_helper::get_user();
$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 {
$time = time();
$user_id = $id;
$uisc_id = $this->input->post('uisc_id');
if ($id > 0) {
$this->db->trans_start();
//DB Transaction Handle START
$dir = $this->config->item("dcms_upload");
$uploaded = System_helper::upload_file($dir['entrepreneur'], 10240, 'gif|jpg|png');
if (array_key_exists('profile_image', $uploaded)) {
if ($uploaded['profile_image']['status']) {
$user_data['picture_name'] = $uploaded['profile_image']['info']['file_name'];
Query_helper::update($this->config->item('table_users'), $user_data, array("id = " . $user_id));
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->message .= $uploaded['profile_image']['message'] . '<br>';
$this->jsonReturn($ajax);
}
}
// User Table update
$user_update_data = array();
$user_update_data['name_bn'] = $this->input->post('entrepreneur_name');
$user_update_data['name_en'] = $this->input->post('entrepreneur_name');
Query_helper::update($this->config->item('table_users'), $user_update_data, array("id = " . $id));
//////// START CHAIRMEN INFO ////////
$chairmen_info['update_by'] = $user->id;
$chairmen_info['update_date'] = $time;
//$chairmen_info['user_id']=$user_id;
$chairmen_info['uisc_id'] = $uisc_id;
$chairmen_info['chairmen_name'] = $this->input->post('chairmen_name');
$chairmen_info['chairmen_mobile'] = $this->input->post('chairmen_mobile');
$chairmen_info['chairmen_email'] = $this->input->post('chairmen_email');
$chairmen_info['chairmen_address'] = $this->input->post('chairmen_address');
if ($this->input->post('chairmen_id') > 0) {
Query_helper::update($this->config->item('table_entrepreneur_chairmen_info'), $chairmen_info, array("id = " . $this->input->post('chairmen_id')));
} else {
Query_helper::add($this->config->item('table_entrepreneur_chairmen_info'), $chairmen_info);
}
//////// END CHAIRMEN INFO ////////
//////// START SECRETARY_RELATED_INFO ////////
$secretary_info['update_by'] = $user->id;
$secretary_info['update_date'] = $time;
$secretary_info['user_id'] = $user_id;
$secretary_info['uisc_id'] = $uisc_id;
$secretary_info['secretary_name'] = $this->input->post('secretary_name');
$secretary_info['secretary_mobile'] = $this->input->post('secretary_mobile');
$secretary_info['secretary_email'] = $this->input->post('secretary_email');
$secretary_info['secretary_address'] = $this->input->post('secretary_address');
if ($this->input->post('secretary_id') > 0) {
Query_helper::update($this->config->item('table_secretary_infos'), $secretary_info, array("id = " . $this->input->post('secretary_id')));
} else {
Query_helper::add($this->config->item('table_secretary_infos'), $secretary_info);
}
//////// END SECRETARY_RELATED_INFO ////////
//////// START ENTREPRENEUR_RELATED_INFO ////////
$entrepreneur_info['update_by'] = $user->id;
$entrepreneur_info['update_date'] = $time;
$entrepreneur_info['user_id'] = $user_id;
$entrepreneur_info['uisc_id'] = $uisc_id;
$entrepreneur_info['entrepreneur_type'] = $this->input->post('entrepreneur_exp_type');
$entrepreneur_info['entrepreneur_name'] = $this->input->post('entrepreneur_name');
$entrepreneur_info['entrepreneur_mother_name'] = $this->input->post('entrepreneur_mother_name');
$entrepreneur_info['entrepreneur_father_name'] = $this->input->post('entrepreneur_father_name');
$entrepreneur_info['entrepreneur_mobile'] = $this->input->post('entrepreneur_mobile');
$entrepreneur_info['entrepreneur_email'] = $this->input->post('entrepreneur_email');
$entrepreneur_info['entrepreneur_sex'] = $this->input->post('entrepreneur_sex');
$entrepreneur_info['entrepreneur_address'] = $this->input->post('entrepreneur_address');
$entrepreneur_info['entrepreneur_nid'] = $this->input->post('entrepreneur_nid');
$entrepreneur_info['entrepreneur_bank_name'] = $this->input->post('entrepreneur_bank_name');
$entrepreneur_info['entrepreneur_bank_account_no'] = $this->input->post('entrepreneur_bank_account_no');
$entrepreneur_info['entrepreneur_bank_holder_name'] = $this->input->post('entrepreneur_bank_holder_name');
$entrepreneur_info['entrepreneur_blog_member'] = $this->input->post('entrepreneur_blog_member');
$entrepreneur_info['entrepreneur_fb_group_member'] = $this->input->post('entrepreneur_fb_group_member');
//$entrepreneur_info['ques_id']=$this->input->post('ques_id');
//$entrepreneur_info['ques_ans']=$this->input->post('ques_ans');
if ($this->input->post('entrepreneur_id') > 0) {
Query_helper::update($this->config->item('table_entrepreneur_infos'), $entrepreneur_info, array("id = " . $this->input->post('entrepreneur_id')));
//.........这里部分代码省略.........