EVOLUTION-NINJA
Edit File: Access.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Access extends CI_Controller { public function __construct() { parent::__construct(); $this->check_islogin(); //check user login session exist or not $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); $this->output->set_header('Pragma: no-cache'); $this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); $this->load->model('yarn_model'); $this->load->model('marketing_model'); $this->load->model('planning_yarn'); $this->load->model('planning_shade'); $this->load->model('vendor_model'); $this->load->model('access_model'); $this->load->model('vendor_model'); $this->load->model('store_model'); date_default_timezone_set('asia/kolkata'); } public function log() { echo $_REQUEST['name'];exit; echo "login"; } //Checking the Login or not private function check_islogin() { if (!$this->session->userdata('logged_in')) { redirect(base_url(), 'refresh'); } } public function session_data_pass() { if ($this->session->userdata('logged_in')) { return $this->yarn_model->get_userdata(); } } public function split_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ stock ---------------------------------> if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' || $data['emp_details']->designation == 'ACCOUNTS' || $data['emp_details']->designation == 'Accounts' || $data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $ttt1=date('d/m/Y'); $ddd1=date('d-m-Y'); $table='fabric_inspection_details'; $where=array('received_date'=>$ttt1,'split_noti'=>'Yes','insert_notification_status'=>0); $data['stock_split_data_res_count']=$this->vendor_model->fabric_inspection_split_count_amount_get_customerdata($table,$where); $ttt=date('d/m/Y'); $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$ttt,'split_noti'=>'Yes','insert_notification_status'=>0); $data['stock_madeups_split_data_res_count']=$this->vendor_model->fabric_inspection_split_count_amount_get_customerdata($table,$where); } else { $data['stock_split_data_res_count']=0; $data['stock_madeups_split_data_res_count']=0; } $stock=$data['stock_split_data_res_count'] + $data['stock_madeups_split_data_res_count']; return $stock; } public function access_details_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); $data['user_type_id']=$d->user_type_id; $table='swansilk_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $this->marketing_model->fetch_main_data($table,$where); } public function access_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); $data['user_type_id']=$d->user_type_id; $table='swansilk_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $this->marketing_model->fetch_where_data($table,$where); } public function access_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); return $d->user_type_id; } public function insert_user_type_data() { $data = array( 'user_type' => $this->input->post('dept_name'), 'delete_status' =>'ACTIVE', //'status' => '1' ); $table='swansilk_user_type'; $v=$this->vendor_model->insert_access($table,$data); $where=array('id'=>$v); $data=array('user_type_id'=>$v); $this->vendor_model->update_data($where,$table,$data); } public function indent_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ indent ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'HO Purchase Admin' ) { $d=date('d-m-Y'); $table='indent_add_indent'; $where=array('indented_date'=>$d,'insert_notification_status'=>0); $indent_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_add_indent'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_add_indent'; $where=array('approved_date'=>$d,'approval_notification_status'=>0); $indent_approval_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_insert_rows=0; $indent_update_rows=0; $indent_approval_rows=0; } //<!------------------------ po ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $indent_po_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_po_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'HO Purchase Admin' ) { $d=date('d-m-Y'); $table='indent_po'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_po_update_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d,'approval_notification_status'=>0); $indent_po_approval_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_po_update_rows1=0; $indent_po_approval_rows1=0; } $r=$indent_insert_rows + $indent_update_rows + $indent_approval_rows + $indent_po_insert_rows1 + $indent_po_update_rows1 + $indent_po_approval_rows1; return $r; } public function issue_loom_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ issue_loom ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { $d=date('d-m-Y'); $table='issue_loom'; $where=array('issued_date'=>$d,'insert_notification_status'=>0); $indent_insert_rows=$this->vendor_model->count_of_pcs($table,$where); $d=date('d-m-Y'); $table='issue_loom'; $where=array('rements_approved_date'=>$d,'update_notification_status'=>0); $indent_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='weaving_panel_planning_order'; $where=array('issue_approved_date'=>$d,'approval_notification_status'=>0); $indent_approval_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_insert_rows=0; $indent_approval_rows=0; $indent_update_rows=0; } $r=$indent_insert_rows + $indent_approval_rows + $indent_update_rows; return $r; } public function stock_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ stock ---------------------------------> if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' || $data['emp_details']->designation == 'ACCOUNTS' || $data['emp_details']->designation == 'Accounts') { $d=date('d-m-Y'); $table='fabric_transfer'; $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stoct_transfer_rows']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='swan_yarn_transfer'; $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stoct_transfer_rows1']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='yarn_transfer'; $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stoct_transfer_rows2']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['stoct_transfer_rows']=0; $data['stoct_transfer_rows1']=0; $data['stoct_transfer_rows2']=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $ttt1=date('d/m/Y'); $ddd1=date('d-m-Y'); $table='fabric_inspection_details'; $where=array('received_date'=>$ttt1); $where1=array('received_date'=>$ddd1); $data['stock_split_data']=$this->vendor_model->fabric_inspection_split_count_amount_get_customerdata($table,$where,$where1); //"(status='live' OR status='dead')" $d=date('d-m-Y'); $table='cs_transfer'; $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stoct_transfer_rows3']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['stoct_transfer_rows3']=0; $data['stock_split_data']=0; } $stock=$data['stoct_transfer_rows'] + $data['stoct_transfer_rows1'] + $data['stoct_transfer_rows2'] + $data['stoct_transfer_rows3'] + $data['stock_split_data']; return $stock; } public function rec_stock_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //<!---------------------- received stock ------------------------------> $d=date('d-m-Y'); $table='fabric_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='swan_yarn_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows1']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='yarn_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows2']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['rec_stoct_transfer_rows']=0; $data['rec_stoct_transfer_rows1']=0; $data['rec_stoct_transfer_rows2']=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='cs_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows3']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['rec_stoct_transfer_rows3']=0; } //$data['total_rec_stock_notifications']=$data['rec_stoct_transfer_rows'] + $data['rec_stoct_transfer_rows1'] + $data['rec_stoct_transfer_rows2'] + $data['rec_stoct_transfer_rows3'] ; $rec_stock=$data['rec_stoct_transfer_rows'] + $data['rec_stoct_transfer_rows1'] + $data['rec_stoct_transfer_rows2'] + $data['rec_stoct_transfer_rows3']; return $rec_stock; } public function marketing_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //<!---------------------- Marketing Module ------------------------------> $d=date('d-m-Y'); $where=$d; $data['marketing_rows']=$this->vendor_model->marketing_notification_getsuborder($where); $data['marketing_confirm_rows']=$this->vendor_model->marketing_notification_confirm_getsuborder($where); $data['marketing_update_num_rows']=$this->vendor_model->marketing_notification_update_getsuborder($where); $d=date('Y-m-d'); $where=$d; $data['marketing_on_date_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($where); $befdore_ten=date('Y-m-d',strtotime('+10 days')) . PHP_EOL; $data['marketing_ten_days_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($befdore_ten); $befdore_thirty=date('Y-m-d',strtotime('+30 days')) . PHP_EOL; $data['marketing_thirty_days_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($befdore_thirty); } else { $data['marketing_rows'] = 0; $data['marketing_confirm_rows'] = 0; $data['marketing_update_num_rows'] = 0; $data['marketing_on_date_rows'] = 0; $data['marketing_ten_days_rows'] = 0; $data['marketing_thirty_days_rows'] = 0; } $mark= $data['marketing_rows'] + $data['marketing_confirm_rows'] + $data['marketing_update_num_rows'] + $data['marketing_on_date_rows'] + $data['marketing_ten_days_rows'] + $data['marketing_thirty_days_rows']; return $mark; } public function issue_fabric_page_notifications() { //<!---------------------- issue fabric Module ------------------------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='fabric_addstock'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $f=$this->vendor_model->issue_fabric_count_amount_get_customerdata($table,$where); } else { $f=0; } // $mark= $data['marketing_rows'] + $data['marketing_confirm_rows'] + $data['marketing_update_num_rows'] + $data['marketing_on_date_rows'] + $data['marketing_ten_days_rows'] + $data['marketing_thirty_days_rows']; return $f; } public function issue_cs_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //<!---------------------- issue cs Module ------------------------------> $d=date('d-m-Y'); $table='cs_addstock'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $cs=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $cs=0; } return $cs; } public function planning_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'Marketing') { // //<!---------------------- Planning Module ------------------------------> $d=date('d-m-Y'); $data['planning_order_rows'] = $this->vendor_model->planning_notification_get_details($d); $dd=date('Y-m-d'); $where=$dd; $data['pallning_outsource_rows']=$this->vendor_model->outsource_planning_notification_get_details($where); $d=date('Y-m-d'); $where=$d; $data['planned_dyeing_on_date_rows']=$this->vendor_model->marketing_notification_deying_date_getsuborder($where); $data['planned_weaving_on_date_rows']=$this->vendor_model->marketing_notification_weaving_date_getsuborder($where); $befdore_seven=date('Y-m-d',strtotime('+7 days')) . PHP_EOL; $data['planned_dyeing_sevenn_days_rows']=$this->vendor_model->marketing_notification_deying_date_getsuborder($befdore_seven); $data['planned_weaving_sevenn_days_rows']=$this->vendor_model->marketing_notification_weaving_date_getsuborder($befdore_seven); $after_five=date('Y-m-d',strtotime('-5 days')) . PHP_EOL; $data['planned_dyeing_five_days_rows']=$this->vendor_model->marketing_notification_deying_date_getsuborder($after_five); $data['planned_weaving_five_days_rows']=$this->vendor_model->marketing_notification_weaving_date_getsuborder($after_five); } else { $data['planning_order_rows'] =0; $data['pallning_outsource_rows']=0; $data['planned_dyeing_on_date_rows'] =0; $data['planned_dyeing_sevenn_days_rows'] =0; $data['planned_dyeing_five_days_rows']=0; $data['planned_weaving_on_date_rows'] =0; $data['planned_weaving_sevenn_days_rows'] =0; $data['planned_weaving_five_days_rows']=0; } $p=$data['planning_order_rows'] + $data['pallning_outsource_rows'] + $data['planned_dyeing_on_date_rows'] + $data['planned_dyeing_sevenn_days_rows'] + $data['planned_dyeing_five_days_rows'] + $data['planned_weaving_on_date_rows'] + $data['planned_weaving_sevenn_days_rows'] + $data['planned_weaving_five_days_rows'] ; return $p; } public function sample_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $emp_details=$this->vendor_model->get_customerdata($table,$where); if($emp_details->designation == 'Super Admin' || $emp_details->designation == 'Admin') { //<!------------------------ Sample request ---------------------------------> $d=date('d-m-Y'); $table='sample_request'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $sample_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $sample_insert_rows=0; } if($emp_details->designation == 'Super Admin') { $d=date('d-m-Y'); $table='sample_request'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $sample_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $sample_update_rows=0; } $s= $sample_insert_rows + $sample_update_rows ; return $s; } public function work_order_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager') { //<!---------------------- work order ------------------------------> $d=date('d-m-Y'); $table='create_yarntwisting_work_order'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['work_order_twisting']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='workorder_dyeing'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['work_order_dyeing']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='workorder_dyeing_material'; $where=array('approved_date'=>$d,'insert_notification_status'=>0); $data['issue_work_order_dyeing_material_rows']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='finishing_embroidry'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['work_order_fabric_finishing']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='work_order_twisting'; $where=array('rec_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_twisting_finishing']=$this->vendor_model->count_amount_work_order_delivery_twisting_get_customerdata($table,$where); $d=date('d-m-Y'); $table='work_order_dyeing'; $where=array('rec_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_dyeing_finishing']=$this->vendor_model->count_amount_work_order_delivery_dyed_get_customerdata($table,$where); $d=date('d-m-Y'); $table='weaving_factory_stock'; $where=array('rec_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_weaving_finishing']=$this->vendor_model->count_amount_work_order_delivery_weaving_fabric_get_customerdata($table,$where); $d=date('d/m/Y'); $table='finishing_embroidry_stock'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_finishing_finishing']=$this->vendor_model->count_amount_work_order_delivery_fabric_finishing_emp_get_customerdata($table,$where); } else { $data['work_order_twisting']=0; $data['work_order_dyeing']=0; $data['work_order_fabric_finishing']=0; $data['work_order_delivery_twisting_finishing']=0; $data['work_order_delivery_dyeing_finishing']=0; $data['work_order_delivery_weaving_finishing']=0; $data['work_order_delivery_finishing_finishing']=0; $data['issue_work_order_dyeing_material_rows']=0; } $w=$data['work_order_twisting'] + $data['work_order_dyeing'] + $data['work_order_fabric_finishing'] + $data['work_order_delivery_twisting_finishing'] + $data['work_order_delivery_dyeing_finishing'] + $data['work_order_delivery_weaving_finishing'] + $data['work_order_delivery_finishing_finishing'] + $data['issue_work_order_dyeing_material_rows']; return $w; } public function packing_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ package list ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'Marketing' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'HO Marketing' || $data['emp_details']->designation == 'HO Marketing') { $d=date('d/m/Y'); $table='packing_list_data'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $package_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='packing_list_data'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $package_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d/m/Y'); $table='madeups_list_data'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $package_madeups_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $package_insert_rows=0; $package_update_rows=0; $package_madeups_insert_rows=0; } $packing= $package_insert_rows + $package_update_rows + $package_madeups_insert_rows; return $packing; } public function design_weaving_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ design weaving list ---------------------------------> if($data['emp_details']->designation == 'Super Admin') { $d=date('d-m-Y'); $table='design_weave'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $design_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_weave'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $design_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_weave'; $where=array('finalized_date'=>$d,'finalize_notification_status'=>0); $design_finalize_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_weave'; $where=array('approved_date'=>$d,'approval_notification_status'=>0); $design_approval_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $design_insert_rows=0; $design_update_rows=0; $design_finalize_rows=0; $design_approval_rows=0; } $design= $design_insert_rows + $design_update_rows + $design_finalize_rows + $design_approval_rows; return $design; } public function masters_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!----------------------------- Masters Module ---------------------------------------> if($data['emp_details']->designation == 'Super Admin' ) { $d=date('d-m-Y'); $table='import_yarn'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $yarn_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='import_yarn'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $yarn_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='article_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $article_updated_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='fabric_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $fabric_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='fabric_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $fabric_upadted_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='shade_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $shade_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='shade_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $shade_updated_row=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='color_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $color_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='color_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $color_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='customer_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $customer_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='box_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $box_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='madeups_box_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $madeups_box_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='product_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $product_master_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $yarn_insert_rows=0; $yarn_insert_rows1=0; $article_updated_rows=0; $fabric_insert_rows=0; $fabric_upadted_rows=0; $shade_insert_rows=0; $shade_updated_row=0; $color_insert_rows=0; $color_insert_rows1=0; $customer_insert_rows1=0; $box_insert_rows1=0; $madeups_box_insert_rows1=0; $product_master_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'Marketing' || $data['emp_details']->designation == 'Marketing' || $data['emp_details']->designation == 'HO Marketing' || $data['emp_details']->designation == 'HO Marketing') { $d=date('d-m-Y'); $table='article_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $article_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $design_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $article_insert_rows=0; $design_insert_rows=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'HO Purchase Admin') { $d=date('d-m-Y'); $table='indent_product'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_product_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_vendor_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_vednor_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_product_insert_rows1=0; $indent_vednor_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='design_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $design_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='customer_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $customer_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='box_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $box_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='madeups_box_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $madeups_box_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='outsource_vendor_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $outsource_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='outsource_vendor_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $outsource_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_vendor_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $indent_vednor_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_product'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $indent_product_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='product_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $product_master_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $design_insert_rows1=0; $customer_insert_rows=0; $box_insert_rows=0; $outsource_insert_rows=0; $outsource_insert_rows1=0; $indent_vednor_insert_rows=0; $indent_product_insert_rows=0; $product_master_insert_rows=0; $madeups_box_insert_rows=0; } $m=$yarn_insert_rows + $yarn_insert_rows1 + $article_insert_rows + $article_updated_rows + $fabric_insert_rows + $fabric_upadted_rows + $shade_updated_row + $design_insert_rows + $design_insert_rows1 + $color_insert_rows + $color_insert_rows1 + $customer_insert_rows + $customer_insert_rows1 + $box_insert_rows + $box_insert_rows1 + $outsource_insert_rows + $outsource_insert_rows1 + $indent_vednor_insert_rows + $indent_vednor_insert_rows1 + $indent_product_insert_rows + $indent_product_insert_rows1 + $product_master_insert_rows + $product_master_insert_rows1 + $madeups_box_insert_rows1 + $madeups_box_insert_rows; return $m; } public function madeups_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ madeups list ---------------------------------> if($data['emp_details']->designation == 'HO Madeups') { $d=date('d/m/Y'); $table='fabric_madeups'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $madeups_list_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d/m/Y'); $table='consumable_madeups'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $madeups_list_madeups_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else { $madeups_list_insert_rows=0; $madeups_list_madeups_insert_rows=0; } if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive') { $input=date('d/m/Y'); $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); if($rr == '0' && $rrr == '0') { $t=$rrr1 . '/' . $rr1 . '/' . $year; //$t=$day . '/' . $rr1 . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else if($rr == '0' && $rrr != '0') { //$t=$rrr1 . '/' . $rr1 . '/' . $year; $t=$day . '/' . $rr1 . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else if($rr != '0' && $rrr == '0') { //$t=$rrr1 . '/' . $rr1 . '/' . $year; $t=$rrr1 . '/' . $month . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else if($rr != '0' && $rrr != '0') { $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$input,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } } else { $madeups_list_madeups_delivery_insert_rows=0; } $madeups = $madeups_list_insert_rows + $madeups_list_madeups_insert_rows + $madeups_list_madeups_delivery_insert_rows; return $madeups; } public function inward_purchases_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; if($date_wise_data->module_status == 'old') { if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' ) { $table='indent_yarn_goods_details'; $where=array('received_date'=>$d); $data['yarn_delivery_inserted_rows']=$this->vendor_model->yarn_delivery1_insert_getsuborder1($d); $data['yarn_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d); $data['cs_delivery_inserted_rows1']=$this->vendor_model->cs_delivery_insertt_getsuborder1($d); $data['cs_delivery_insert_rows1']=$this->vendor_model->count_amount_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate); $data['cs_delivery_inserted_rows']=$this->vendor_model->cs_delivery_insertt_getsuborder1($newDate); $data['cs_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); $input=$newDate; $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t2=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows2']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t3=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows3']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows4']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['yarn_delivery_insert_rows']=0; $data['cs_delivery_insert_rows1']=0; $data['cs_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows2']=0; $data['fabric_delivery_insert_rows3']=0; $data['fabric_delivery_insert_rows4']=0; } } else { if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' ) { // $d=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['yarn_delivery_inserted_rows']=$this->vendor_model->yarn_delivery_insert_getsuborder1($d); $data['yarn_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows1']=$this->vendor_model->cs_delivery_insert_getsuborder1($d); $data['cs_delivery_insert_rows1']=$this->vendor_model->count_amount_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows']=$this->vendor_model->cs_delivery_insert_getsuborder1($newDate); $data['cs_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); $input=$newDate; $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t2=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows2']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t3=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows3']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows4']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['yarn_delivery_insert_rows']=0; $data['cs_delivery_insert_rows1']=0; $data['cs_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows2']=0; $data['fabric_delivery_insert_rows3']=0; $data['fabric_delivery_insert_rows4']=0; } } $data['total_res_inward_fabric']=$data['fabric_delivery_insert_rows'] + $data['fabric_delivery_insert_rows2'] + $data['fabric_delivery_insert_rows3'] + $data['fabric_delivery_insert_rows4'] + $data['yarn_delivery_insert_rows'] + $data['cs_delivery_insert_rows'] + $data['cs_delivery_insert_rows1']; $data['page_static']='inward_purchase'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications(); $data['total_stock_notifications']=0; //$this->stock_page_notifications(); $data['total_split_notifications']=0; //$this->split_page_notifications(); $data['inward_purchases_notifications']= 0; //$this->inward_page_notifications(); $data['total_rec_stock_notifications']=0; //$this->rec_stock_page_notifications(); $data['marketing_totals']=0; //$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=0; //$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=0; //$this->issue_cs_page_notifications(); $data['total_planning']=0; //$this->planning_page_notifications(); $data['total_sample_notifications']= 0; //$this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= 0; //$this->work_order_page_notifications(); $data['total_package_notifications']= 0; //$this->packing_page_notifications(); $data['total_design_notifications']=0; //$this->design_weaving_page_notifications(); $data['yarn_count']=0; //$this->masters_page_notifications(); $data['total_madeups_notifications']=0; //$this->madeups_page_notifications(); $data['inward_purchases_notifications']= 0; //$this->inward_page_notifications(); $data['fabric_inpection_notifications']= 0; //$this->new_stores_page_notifications(); $data['issue_loom_notifications']= 0; //$this->issue_loom_page_notifications(); $data['issue_loom_notifications']= 0; //$this->issue_loom_page_notifications(); $data['total_rows_notifications']=0; //$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications'] + $data['issue_loom_notifications'] + $data['inward_purchases_notifications'] + $data['total_split_notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/notification_page',$data); $this->load->view('templates/footer_inside'); } public function inward_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; //<!------------------------ new stores list ---------------------------------> // $d=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['yarn_delivery_inserted_rows']=$this->vendor_model->yarn_delivery_insert_getsuborder1($d); $data['yarn_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows1']=$this->vendor_model->cs_delivery_insert_getsuborder1($d); $data['cs_delivery_insert_rows1']=$this->vendor_model->count_amount_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows']=$this->vendor_model->cs_delivery_insert_getsuborder1($newDate); $data['cs_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); $input=$newDate; $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t2=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows2']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t3=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows3']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows4']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $new=$data['fabric_delivery_insert_rows'] + $data['fabric_delivery_insert_rows2'] + $data['fabric_delivery_insert_rows3'] + $data['fabric_delivery_insert_rows4'] + $data['yarn_delivery_insert_rows'] + $data['cs_delivery_insert_rows'] + $data['cs_delivery_insert_rows1']; // $new = $fabric_inpection_insert_rows + $fabric_delivery_insert_rows + $yarn_delivery_insert_rows + $cs_delivery_insert_rows; // print_r($new); // die(); return $new; } public function new_stores_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; //<!------------------------ new stores list ---------------------------------> if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { //$d=date('d-m-Y'); $table='fabric_inspection'; $where=$d; $where1=array('created_date'=>$d,'insert_notification_status'=>0); $data['fabric_inspection_inserted_rows']=$this->vendor_model->fabric_inspection_update_getsuborder1($where); $data['fabric_inspection_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['fabric_inspection_inserted_rows']=array(); $data['fabric_inspection_rows']=0; } $new= $data['fabric_inspection_rows'] ; // $new = $fabric_inpection_insert_rows + $fabric_delivery_insert_rows + $yarn_delivery_insert_rows + $cs_delivery_insert_rows; // print_r($new); // die(); return $new; } public function fabric_inspection_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; if($date_wise_data->module_status == 'old') { if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { //$d=date('d-m-Y'); $table='fabric_inspection'; $where=$d; $where1=array('created_date'=>$d); $data['fabric_inspection_inserted_rows']=$this->vendor_model->fabric_inspections_update_getsuborder1($where); $data['fabric_inspection_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['fabric_inspection_inserted_rows']=array(); $data['fabric_inspection_rows']=0; } } else { if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { //$d=date('d-m-Y'); $table='fabric_inspection'; $where=$d; $where1=array('created_date'=>$d,'insert_notification_status'=>0); $data['fabric_inspection_inserted_rows']=$this->vendor_model->fabric_inspection_update_getsuborder1($where); $data['fabric_inspection_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['fabric_inspection_inserted_rows']=array(); $data['fabric_inspection_rows']=0; } } $data['total_res_fabric']= $data['fabric_inspection_rows'] ; $data['page_static']='fabric_inspection'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications(); $data['total_stock_notifications']=0; //$this->stock_page_notifications(); $data['total_split_notifications']=0; //$this->split_page_notifications(); $data['inward_purchases_notifications']= 0; //$this->inward_page_notifications(); $data['total_rec_stock_notifications']=0; //$this->rec_stock_page_notifications(); $data['marketing_totals']=0; //$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=0; //$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=0; //$this->issue_cs_page_notifications(); $data['total_planning']=0; //$this->planning_page_notifications(); $data['total_sample_notifications']= 0; //$this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= 0; //$this->work_order_page_notifications(); $data['total_package_notifications']= 0; //$this->packing_page_notifications(); $data['total_design_notifications']=0; //$this->design_weaving_page_notifications(); $data['yarn_count']=0; //$this->masters_page_notifications(); $data['total_madeups_notifications']=0; //$this->madeups_page_notifications(); $data['inward_purchases_notifications']= 0; //$this->inward_page_notifications(); $data['fabric_inpection_notifications']= 0; //$this->new_stores_page_notifications(); $data['issue_loom_notifications']= 0; //$this->issue_loom_page_notifications(); $data['issue_loom_notifications']= 0; //$this->issue_loom_page_notifications(); $data['total_rows_notifications']=0; //$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications'] + $data['issue_loom_notifications'] + $data['inward_purchases_notifications'] + $data['total_split_notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/notification_page',$data); $this->load->view('templates/footer_inside'); } //xyz public function employee_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); // echo $uri; // die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; // $data['val'] = 1; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if(!empty($result->reference_url)){ if($result->reference_url == $data['val']) { $check=$data['val']; } } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if(!empty($url->reference_url)){ if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } } //----------tiill-------------------- $table='employee_details'; $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/employee_form', $data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function department_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if(!empty($result->reference_url)){ if($result->reference_url == $data['val']) { $check=$data['val']; } } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if(!empty($url->reference_url)){ if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } } //----------tiill-------------------- $table='swansilk_user_type'; $access_emp=$this->access_model->max_select_dept_id($table); $data['dept_id']=$access_emp->user_type_id+1; $table='sub_department_details'; $access_emp1=$this->access_model->max_select_sub_dept_id($table); $data['sub_dept_id']=$access_emp1->sub_dept_id+1; $table='swansilk_user_type'; $data['dept']=$this->access_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/department_form', $data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function user_access_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if(!empty($result->reference_url)){ if($result->reference_url == $data['val']) { $check=$data['val']; } } } if($check != "") { $table='employee_details'; $data['access_emp']=$this->access_model->getproduct_details(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/user_access_details', $data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function event_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if(!empty($result->reference_url)){ if($result->reference_url == $data['val']) { $check=$data['val']; } } } if($check != "") { $table='event_details'; $access_emp=$this->access_model->max_select_event_id($table); $data['event_id']=$access_emp->event_id+1; $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/event_form', $data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function history_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $details = $this->access_model->fetch_where_subgrid_data2(); echo json_encode($details); } public function insert_access_control_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); // if($_FILES['document']['name']) // { // //echo "a"; // $config['upload_path']='uploads/files/'; // $config['allowed_types'] = 'gif|jpg|png|jpeg|pdf'; // $this->load->library('upload',$config); // if(! $this->upload->do_upload('document')) // { // //echo 'error'; // } // else // { // $config['source_image']=$this->upload->upload_path.$this->upload->file_name; // $target='uploads/files/'.$this->upload->file_name; // //echo $target; // } // } // else // { // $target=""; // //echo $target; // } $data = array('location' => $this->input->post('location'), 'username' => $this->input->post('username'), 'name' => $this->input->post('name'), 'date_of_birth' => $this->input->post('date_of_birth'), 'gender' => $this->input->post('gender'), 'address' => $this->input->post('address'), 'phone' => $this->input->post('phone'), 'email' => $this->input->post('email'), 'blood_group' => $this->input->post('blood_group'), 'designation' => $this->input->post('designation'), 'user_type_id' => $this->input->post('role'), 'pan_aadhar' => $this->input->post('pan_aadhar_no'), 'password' => md5($this->input->post('pass')), // 'uploaded_files' => $target, 'status' => '1' ); $data1 = array( 'fname' => $this->input->post('name'), 'username' => $this->input->post('username'), 'email' => $this->input->post('email'), 'role' => $this->input->post('role'), 'password' => $this->input->post('pass'), ); $table='employee_details'; $this->db->insert($table,$data); $table1='user_management'; $this->db->insert($table1,$data1); } public function insert_event_form_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data = array( 'event_id' => $this->input->post('event_id'), 'event_name' => $this->input->post('event_name'), 'event_code' => $this->input->post('event_code'), 'status' => '1' ); $table='event_details'; $this->db->insert($table,$data); } public function insert_sub_dept_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data = array( 'sub_dept_id' => $this->input->post('sub_d_id'), 'department' => $this->input->post('dept'), 'sub_dept' => $this->input->post('sub_dept_name'), 'sub_dept_code' => $this->input->post('sub_dept_code'), 'status' => '1' ); $table='sub_department_details'; $this->db->insert($table,$data); } public function insert_dept_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data = array( 'dept_id' => $this->input->post('d_id'), 'department' => $this->input->post('dept_name'), 'department_code' => $this->input->post('dept_code'), 'status' => '1' ); $table='department_details'; $this->db->insert($table,$data); } public function event_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='event_details'; $details = $this->access_model->get_details($table); echo json_encode($details); } public function dept_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='swansilk_user_type'; $details = $this->access_model->get_details($table); echo json_encode($details); } public function sub_dept_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='sub_department_details'; $details = $this->access_model->get_details($table); echo json_encode($details); } public function employee_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='employee_details'; $details = $this->access_model->get_details($table); echo json_encode($details); } public function employee_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='employee_details'; $this->access_model->delete_function($table,$where); return true; } public function access_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='employee_details'; $details=$this->access_model->getproduct_details(); echo json_encode($details); } public function fabric_inspection_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='indent_goods_details'; $this->access_model->delete_function($table,$where); return true; } public function fabric_inspection_datadelete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='fabric_inspection_details'; $this->access_model->delete_function($table,$where); return true; } public function access_grid_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); // $f=$_GET['id']; // print_r($f); // $id=""; foreach($matches as $matches) { $id=$matches; // print_r($id); } $i= $id[0]; $table = 'employee_details'; $where = array('user_type_id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->user_type_id; // print_r($data1); // die(); $table = 'swansilk_access_controls'; $where = array('department_id'=>$data1); $getalldata = $this->vendor_model->fetch_where_subgrid_data($table,$where); // $access_menu_id=$this->access_details_id(); // print_r(unserialize($getalldata->menu_id)); $m_id=unserialize($getalldata->menu_id); $check=""; $data1=array(); foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); array_push($data1,$result); } $confirmed_data=$data1; //print_r($confirmed_data); echo json_encode($confirmed_data); } public function dept_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='swansilk_user_type'; $this->access_model->delete_function($table,$where); return true; } public function sub_dept_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='sub_department_details'; $this->access_model->delete_function($table,$where); return true; } public function access_privilege() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $table='user_type'; $data['departments']=$this->access_model->get_details($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/access-privilege', $data); $this->load->view('templates/footer_inside'); } public function access_rights() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/access-rights', $data); $this->load->view('templates/footer_inside'); } public function add_employee_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='employee_details'; // $access_emp=$this->access_model->max_select_emp_id($table); // print_r($access_emp); $table='consumed_at'; $where=array('status'=>1); $data['loc']=$this->access_model->get_data($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['departments'] = $this->vendor_model->get_all_departments(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/add_employee_details', $data); $this->load->view('templates/footer_inside'); } public function add_event_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='event_details'; $access_emp=$this->access_model->max_select_event_id($table); $data['event_id']=$access_emp->event_id+1; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/add_event_details', $data); $this->load->view('templates/footer_inside'); } public function add_department_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='swansilk_user_type'; $access_emp=$this->access_model->max_select_dept_id($table); $data['dept_id']=$access_emp->user_type_id+1; $table='sub_department_details'; $access_emp1=$this->access_model->max_select_sub_dept_id($table); $data['sub_dept_id']=$access_emp1->sub_dept_id+1; $table='swansilk_user_type'; $data['dept']=$this->access_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/add_department_details', $data); $this->load->view('templates/footer_inside'); } //Add access controls public function add_menu_access() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if(!empty($result->reference_url)){ if($result->reference_url == $data['val']) { $check=$data['val']; } } } if($check != "") { $data['menu'] = $this->vendor_model->get_all_menu(); $data['sub_menu1'] = $this->vendor_model->get_all_sub_menu(); //print_r($data['sub_menu']); //die(); $data['departments'] = $this->vendor_model->get_all_departments(); // print_r($data['sub_menu']); // die(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('access_rights/add_access',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function addmenu_access() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['menu'] = $this->vendor_model->get_all_menu(); $data['departments'] = $this->vendor_model->get_all_departments(); // print_r($data['sub_menu']); // die(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('access_rights/add_access',$data); $this->load->view('templates/footer_inside'); } //Menu list public function get_menu_list() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table = 'menu'; $where = array('delete_status'=>'ACTIVE'); $result = $this->access_model->get_where_result($table,$where); if($result) { echo json_encode(array('menu_list'=>$result,'result'=>1)); } else { echo json_encode(array('result'=>0)); } } public function single_department_access() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table = 'swansilk_access_controls'; $department_id = $this->input->post('department_id'); $where = array('delete_status' =>'ACTIVE','department_id' =>$department_id); $result = $this->vendor_model->get_where_row($table,$where); if(empty($result->menu_id)) { } else { $m_id = unserialize($result->menu_id); $data1=array(); foreach($m_id as $menu_id) { $menu = $this->access_model->get_all_menu($menu_id); array_push($data1,$menu); } $table = 'access_action_rights'; $department_id = $this->input->post('department_id'); $where = array('department_id' =>$department_id); $resultt = $this->vendor_model->get_where_result($table,$where); array_push($data1,$resultt); // print_r($data1); // die(); //$data=$data1; echo json_encode($data1); } } public function insert_access_rights() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data2=$this->input->post('ids'); $f_data=$this->input->post('ids1'); $first_data=$this->input->post('ids2'); $dept_id=$this->input->post('dept_id'); //$dept_id=$this->input->post('dept_id'); $table='access_action_rights'; $where=array('department_id'=>$dept_id); $this->vendor_model->delete_vendor($table,$where); $f_data1=substr($f_data, 0, -1); $exp=array(); $path = explode("|", $f_data1); $exp = array_merge($exp, $path); //print_r($exp); // die(); $data11=array(); foreach($exp as $val) { $num=0; $arr[]=''; $arr = preg_split('/(?<=\d)(?=[a-z])|(?<=[a-z])(?=\d)/i', $val); //print_r($arr); if($arr[0] == 'e') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'edit_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'edit_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'ed') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'export_doc_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'export_doc_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'edd') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'export_doc_id2'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'export_doc_id2'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'sdf') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'sdf_form'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'sdf_form'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'as') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'ship_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'ship_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'pm') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'pay_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'pay_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'us') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'unship_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'unship_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'py') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'unpay_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'unpay_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'c') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'cancel_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'cancel_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'cf') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'factory_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'factory_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'u') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'uncheck_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'uncheck_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 't') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'invoice_edit'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'invoice_edit'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'j') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'pack_edit'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'pack_edit'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'bx') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'box_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'box_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'pc') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'pc_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'pc_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 's') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'preview_submit'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'preview_submit'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'd') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'delete_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'delete_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'p') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'preview_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'preview_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'a') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'approval_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'approval_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'i') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'insert_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'insert_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'x') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'details_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'details_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'y') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'invoice_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'invoice_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'z') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'pkl_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'pkl_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } elseif($arr[0] == 'vmc') { $num=$arr[1]; if($num == '49' || $num == '50' || $num == '51' || $num == '52' || $num == '53' || $num == '54' || $num == '55' || $num == '56' || $num == '57' || $num == '58' || $num == '59' || $num == '60' || $num == '65' || $num == '97') { } else { $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'vmc_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'vmc_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } } $first_data1=substr($first_data, 0, -1); $exp=array(); $path = explode("|", $first_data1); $exp = array_merge($exp, $path); // print_r($exp); // die(); $data11=array(); foreach($exp as $val) { $num=0; $arr[]=''; $arr = preg_split('/(?<=\d)(?=[a-z])|(?<=[a-z])(?=\d)/i', $val); //print_r($arr); if($arr[0] == 'e') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'edit_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'edit_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } elseif($arr[0] == 'd') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'delete_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'delete_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } elseif($arr[0] == 'p') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'preview_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'preview_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } elseif($arr[0] == 'a') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'approval_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'approval_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } elseif($arr[0] == 'i') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'insert_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'insert_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); // print_r($exp); // die(); $data11=array(); foreach($exp as $val) { $num=0; $arr[]=''; $arr = preg_split('/(?<=\d)(?=[a-z])|(?<=[a-z])(?=\d)/i', $val); //print_r($arr); if($arr[0] == 'e') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'edit_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'edit_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } elseif($arr[0] == 'rs') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'remnats_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'remnats_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } elseif($arr[0] == 'd') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'delete_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'delete_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } elseif($arr[0] == 'p') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'preview_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'preview_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } elseif($arr[0] == 'a') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'approval_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'approval_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } elseif($arr[0] == 'i') { $num=$arr[1]; $table='access_action_rights'; $where=array('department_id'=>$dept_id ,'menu_id'=>$num); $row=$this->vendor_model->get_where_row($table,$where); //print_r($row); if(empty($row)) { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'insert_id'=>1, ); $table='access_action_rights'; $this->db->insert($table,$data); } else { $data=array('menu_id'=>$num, 'department_id'=>$dept_id, 'insert_id'=>1, ); $table='access_action_rights'; $where=array('department_id'=>$dept_id , 'menu_id'=>$num); $this->store_model->update_data($where,$table,$data); } } } $table = 'access_action_rights'; $department_id = $this->input->post('dept_id'); $where = array('department_id' =>$department_id); $result = $this->vendor_model->get_where_result($table,$where); //print_r($result); echo json_encode($result); } public function edit_access_rights() { //$data2=$this->input->post('ids'); //$dept_id=$this->input->post('dept_id'); $table = 'access_action_rights'; $department_id = $this->input->post('dept_id'); $where = array('department_id' =>$department_id); $result = $this->vendor_model->get_where_result($table,$where); //print_r($result); echo json_encode($result); } public function access_action_rights() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if(!empty($result->reference_url)){ if($result->reference_url == $data['val']) { $check=$data['val']; } } } if($check != "") { $data['departments'] = $this->vendor_model->get_all_departments(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/access_action_rights', $data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function employee_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); //$pizza = substr($uri, strpos($uri, "/") + 1); //$url= explode("?", $pizza); //$data['val']=$url[0]; $table='employee_details'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); // $str=$data['fetch_data']->width; // $data['numbers'] = preg_replace('/[^0-9]/', '', $str); // $table='department'; // $data['department']=$this->vendor_model->fetch_where_data($table); // $table='consumed_at'; // $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); // $table='indent_product'; // $data['product']=$this->vendor_model->fetch_where_data($table); // $table1='purchase_master'; // $data['producttype']=$this->vendor_model->fetch_where_data($table1); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['departments'] = $this->vendor_model->get_all_departments(); $access_menu_id=$this->access_details_id(); $table='consumed_at'; $where=array('status'=>1); $data['location']=$this->access_model->get_data($table,$where); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/edit_employee_form',$data); $this->load->view('templates/footer_inside'); } public function update_access_control_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data = array('location' => $this->input->post('location'), 'username' => $this->input->post('username'), 'name' => $this->input->post('name'), 'date_of_birth' => $this->input->post('date_of_birth'), 'gender' => $this->input->post('gender'), 'address' => $this->input->post('address'), 'phone' => $this->input->post('phone'), 'email' => $this->input->post('email'), 'blood_group' => $this->input->post('blood_group'), 'designation' => $this->input->post('designation'), 'user_type_id' => $this->input->post('role'), 'pan_aadhar' => $this->input->post('pan_aadhar_no'), 'password' => md5($this->input->post('pass')), // 'uploaded_files' => $target, 'status' => '1' ); $u_id=$this->input->post('u_id'); $table='employee_details'; $where=array('id'=>$u_id); $this->access_model->update_data($where,$table,$data); //$table1='user_management'; //$this->db->insert($table1,$data1); } ///////////////////////////////////////////// user chat //////////////////////////////////////////////////////// public function user_chat() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['departments'] = $this->vendor_model->get_all_departments(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('access_controls/user_chat', $data); $this->load->view('templates/footer_inside'); } public function chat_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $where=$id['userid']; $details1=$this->vendor_model->user_chatting_details($where); $details2=$this->vendor_model->user_chatting_details1($where); $details=array_merge($details1,$details2); $d=array(); $chatting_id=array(); foreach($details as $value) { if(!in_array($value->from_name, $d, true)){ array_push($d, $value->from_name); array_push($chatting_id, $value->id); } } $details_val = array(); foreach($d as $key=>$val) { $f=array('from_name'=>$d[$key], 'id'=>$chatting_id[$key], ); array_push($details_val,$f); } //print_r($details_val); //die(); echo json_encode($details_val); } public function chat_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $chat_ids=$this->input->post('id'); $table='chat_message'; $where=array('chat_id'=>$chat_ids); $chat_row=$this->vendor_model->get_customerdata($table,$where); $ids=$chat_row->to_id; $where=array('from_id'=>$id['userid'],'to_id'=>$chat_row->to_id); $table='chat_message'; $row1=$this->vendor_model->get_where_dataa($table,$where); $idss=$chat_row->from_id; $where=array('to_id'=>$id['userid'],'from_id'=>$chat_row->to_id); $table='chat_message'; $row2=$this->vendor_model->get_where_dataa($table,$where); $where=array('from_id'=>$id['userid'],'to_id'=>$chat_row->from_id); $table='chat_message'; $row3=$this->vendor_model->get_where_dataa($table,$where); $where=array('to_id'=>$id['userid'],'from_id'=>$chat_row->from_id); $table='chat_message'; $row4=$this->vendor_model->get_where_dataa($table,$where); if(empty($row1)) { } else { foreach($row1 as $r) { if($r->sender_one == 0) { $where=array('chat_id'=>$r->chat_id); $table='chat_message'; $datas=array('sender_one'=>$id['userid']); $this->vendor_model->update_data($where,$table,$datas); } else { $where=array('chat_id'=>$r->chat_id); $table='chat_message'; $datas=array('sender_two'=>$id['userid']); $this->vendor_model->update_data($where,$table,$datas); } } } if(empty($row2)) { } else { foreach($row2 as $r) { if($r->sender_one == 0) { $where=array('chat_id'=>$r->chat_id); $table='chat_message'; $datas=array('sender_one'=>$id['userid']); $this->vendor_model->update_data($where,$table,$datas); } else { $where=array('chat_id'=>$r->chat_id); $table='chat_message'; $datas=array('sender_two'=>$id['userid']); $this->vendor_model->update_data($where,$table,$datas); } } } if(empty($row3)) { } else { foreach($row3 as $r) { if($r->sender_one == 0) { $where=array('chat_id'=>$r->chat_id); $table='chat_message'; $datas=array('sender_one'=>$id['userid']); $this->vendor_model->update_data($where,$table,$datas); } else { $where=array('chat_id'=>$r->chat_id); $table='chat_message'; $datas=array('sender_two'=>$id['userid']); $this->vendor_model->update_data($where,$table,$datas); } } } if(empty($row4)) { } else { foreach($row4 as $r) { if($r->sender_one == 0) { $where=array('chat_id'=>$r->chat_id); $table='chat_message'; $datas=array('sender_one'=>$id['userid']); $this->vendor_model->update_data($where,$table,$datas); } else { $where=array('chat_id'=>$r->chat_id); $table='chat_message'; $datas=array('sender_two'=>$id['userid']); $this->vendor_model->update_data($where,$table,$datas); } } } // if(empty($row)) // { // $ids=$this->input->post('id'); // $where=array('from_id'=>$id['userid'],'to_id'=>$ids); // $table='chat_message'; // $datas=array('sender_one'=>$id['userid']); // $this->vendor_model->update_data($where,$table,$datas); // $ids=$this->input->post('id'); // $where=array('from_id'=>$ids,'to_id'=>$id['userid']); // $table='chat_message'; // $datas=array('sender_one'=>$id['userid']); // $this->vendor_model->update_data($where,$table,$datas); // } // else // { // $ids=$this->input->post('id'); // $where=array('from_id'=>$id['userid'],'to_id'=>$ids); // $table='chat_message'; // $datas=array('sender_two'=>$id['userid']); // $this->vendor_model->update_data($where,$table,$datas); // $ids=$this->input->post('id'); // $where=array('from_id'=>$ids,'to_id'=>$id['userid']); // $table='chat_message'; // $datas=array('sender_one'=>$id['userid']); // $this->vendor_model->update_data($where,$table,$datas); // } return true; } public function download_excel() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $to_id = $this->input->post('id'); $where=array('from_id'=>$id['userid'],'to_id'=>$to_id); $table='chat_message'; $result=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$where); $wheree=array('from_id'=>$to_id,'to_id'=>$id['userid']); $table='chat_message'; $resultt=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$wheree); $res=array_merge($result,$resultt); sort($res); echo json_encode($res); } } ?>