EVOLUTION-NINJA
Edit File: Dashboard.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Dashboard extends CI_Controller { public function __construct() { parent::__construct(); $this->load->database(); $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'); date_default_timezone_set('asia/kolkata'); } //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 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; } //display dashboard public function index() { $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['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $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['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('yarn_master/dashboard'); //$this->load->view('templates/user_footer'); } //display add quality page public function add_quality() { if ($this->input->post('submitquality')) { $this->form_validation->set_rules('yarntype', 'Yarn type', 'trim|required|xss_clean'); $this->form_validation->set_rules('yarnquality', 'Yarn Quality', 'trim|required|xss_clean'); $this->form_validation->set_rules('yarnname', 'Yarn Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('yarndenier', 'Yarn Denier', 'trim|required|xss_clean'); $this->form_validation->set_rules('yarnspecifications', 'Yarn Specification', 'trim|required|xss_clean'); $this->form_validation->set_rules('hanklength', 'Hank Length', 'trim|required|xss_clean'); $this->form_validation->set_rules('hankwt', 'Hank Weight', 'trim|required|xss_clean'); $tablename='yarn_quality_names'; $data['yarn_qua_details'] = $this->yarn_model->getpdfdata($tablename); if ($this->form_validation->run() == FALSE) { $data['check_specification'] = $this->yarn_model->check_spec_exists(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $tablename='yarn_quality_names'; $data['yarn_qua_details'] = $this->yarn_model->getpdfdata($tablename); $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('import_module/add_quality', $data); $this->load->view('templates/footer_inside'); } else { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $quality_data = array('yarnType' => $this->input->post('yarntype'), 'yarnQuality' => $this->input->post('yarnquality'), 'yarnName' => $this->input->post('yarnname'), 'yarnSpecification' => $this->input->post('yarnspecifications'), 'yarnDenier' => $this->input->post('yarndenier'), 'hankLength' => $this->input->post('hanklength'), 'hankWt' => $this->input->post('hankwt'), 'supplier' => $this->input->post('supplier'), 'created_date'=>date('d-m-Y'), 'created_by'=>$approved_by, ); $qtyinsert = $this->yarn_model->yarn_qty_insert($quality_data); if ($qtyinsert == 1) { redirect(base_url() . 'planning/yarn_details', 'refresh'); } else { echo "notinserted"; } } } else { $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(); $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); $tablename='yarn_quality_names'; $data['yarn_qua_details'] = $this->yarn_model->getpdfdata($tablename); $data['check_specification'] = $this->yarn_model->check_spec_exists(); $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(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('import_module/add_quality', $data); $this->load->view('templates/footer_inside'); } } //display add quality page //create Import file No in supplier master public function create_unique() { if ($_REQUEST['q'] == "import") { $charector = "I"; } else { $charector = "L"; } $this->db->like('import_fileno', $charector, 'after'); $query = $this->db->get('supplier_details'); $invoiceno = $query->num_rows() + 1; $invID = str_pad($invoiceno, 5, '0', STR_PAD_LEFT); if ($_REQUEST['q'] == "import") { echo "I" . $invID; } else { echo "L" . $invID; } } //display yarn master form. public function add_yarn() { if ($this->input->post('submitquality')) { $this->form_validation->set_rules('yarntype', 'Yarn type', 'trim|required|xss_clean'); $this->form_validation->set_rules('yarnquality', 'Yarn Quality', 'trim|required|xss_clean'); $this->form_validation->set_rules('yarndenier', 'Yarn Denier', 'trim|required|xss_clean'); $this->form_validation->set_rules('yarnspecifications', 'Yarn Specification', 'trim|required|xss_clean'); $this->form_validation->set_rules('hanklength', 'Hank Length', 'trim|required|xss_clean'); $this->form_validation->set_rules('hankwt', 'Hank Weight', 'trim|required|xss_clean'); $this->form_validation->set_rules('korashrinkage', 'Kora Shrinkage', 'trim|required|xss_clean'); $this->form_validation->set_rules('dyedshrinkage', 'Dyed Shrinkage', 'trim|required|xss_clean'); if ($this->form_validation->run() == FALSE) { $data['check_specification'] = $this->planning_yarn->check_spec_exists(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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('planning_module/add_yarn', $data); $this->load->view('templates/footer_inside'); } else { $quality_data = array('yarnType' => $this->input->post('yarntype'), 'yarnQuality' => $this->input->post('yarnquality'), 'yarnSpecification' => $this->input->post('yarnspecifications'), 'yarnDenier' => $this->input->post('yarndenier'), 'hankLength' => $this->input->post('hanklength'), 'hankWt' => $this->input->post('hankwt'), 'kora_shrinkage' => $this->input->post('korashrinkage'), 'dyed_shrinkage' => $this->input->post('dyedshrinkage') ); $qtyinsert = $this->planning_yarn->planning_yarn_insert($quality_data); if ($qtyinsert == 1) { redirect(base_url() . 'dashboard/planning_yarn_details', 'refresh'); } else { echo "not inserted"; } } } else { $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['check_specification'] = $this->planning_yarn->check_spec_exists(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('planning_module/add_yarn', $data); $this->load->view('templates/footer_inside'); } } public function planning_yarn_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['getalldata'] = $this->planning_yarn->display_yarnqty_data(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('planning_module/planning_yarn_details', $data); $this->load->view('templates/footer_inside'); } //display color master form. public function add_article() { $data['yarnqty'] = $this->yarn_model->display_yarnQuality(); $data['warp_denier'] = $this->yarn_model->display_yarndenier_warp(); $data['weft_denier'] = $this->yarn_model->display_yarndenier_weft(); if ($this->input->post('submitarticle')) { $this->form_validation->set_rules('articleNo', 'Article Number', 'trim|required|xss_clean|alpha_numeric'); $this->form_validation->set_rules('quality', 'Quality', 'trim|required|xss_clean'); $this->form_validation->set_rules('design', 'Design', 'trim|required|xss_clean'); $this->form_validation->set_rules('width', 'Width', 'trim|required|xss_clean'); $this->form_validation->set_rules('wrapEnd', 'Wrap End', 'trim|required|xss_clean'); $this->form_validation->set_rules('reed', 'Reed', 'trim|required|xss_clean'); $this->form_validation->set_rules('warptotalends', 'Warp Total Ends', 'trim|required|xss_clean'); $this->form_validation->set_rules('picks', 'Picks', 'trim|required|xss_clean'); $this->form_validation->set_rules('wrapQty', 'Wrap Quantity', 'trim|required|xss_clean'); $this->form_validation->set_rules('wrapDenier', 'Wrap Denier', 'trim|required|xss_clean'); $this->form_validation->set_rules('wrapSpecification', 'Wrap Specification', 'trim|required|xss_clean'); $this->form_validation->set_rules('warpfinaldenier', 'Warp Final denier', 'trim|required|xss_clean|alpha'); $this->form_validation->set_rules('wrapWt', 'Wrap Wt', 'trim|required|xss_clean'); $this->form_validation->set_rules('wrapSr', 'Wrap Sr', 'trim|required|xss_clean'); $this->form_validation->set_rules('wrapWaste', 'Wrap Waste', 'trim|required|xss_clean'); $this->form_validation->set_rules('loomFinWt', 'Loom Fin Wt', 'trim|required|xss_clean'); $this->form_validation->set_rules('weftQty', 'Weft Quantity', 'trim|required|xss_clean'); $this->form_validation->set_rules('weftDenier', 'Weft Denier', 'trim|required|xss_clean'); $this->form_validation->set_rules('weftSpecification', 'Weft Specification', 'trim|required|xss_clean'); $this->form_validation->set_rules('weftfinaldenier', 'Weft Final denier', 'trim|required|xss_clean|alpha'); $this->form_validation->set_rules('weftWt', 'Weft Wt', 'trim|required|xss_clean|numeric'); $this->form_validation->set_rules('weftSr', 'Weft Sr', 'trim|required|xss_clean|numeric'); $this->form_validation->set_rules('weftWaste', 'Weft Waste', 'trim|required|xss_clean|numeric'); $this->form_validation->set_rules('composition', 'Composition', 'trim|required|xss_clean|numeric'); $this->form_validation->set_rules('ratio', 'Ratio', 'trim|required|xss_clean|numeric'); $this->form_validation->set_rules('remark', 'Remark', 'trim|required|xss_clean|numeric'); if ($this->form_validation->run() == FALSE) { $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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('marketing/add_article', $data); $this->load->view('templates/footer_inside'); } else { $article_data = array( 'articleNo' => $this->input->post('articleNo'), 'quality' => $this->input->post('quality'), 'design' => $this->input->post('design'), 'width' => $this->input->post('width'), 'wrapEnd' => $this->input->post('wrapEnd'), 'reed' => $this->input->post('reed'), 'warp_total_ends' => $this->input->post('warptotalends'), 'picks' => $this->input->post('picks'), 'wrapQty' => $this->input->post('wrapQty'), 'wrapSpecification' => $this->input->post('wrapSpecification'), 'warpfinaldenier' => $this->input->post('warpfinaldenier'), 'wrapWt' => $this->input->post('wrapWt'), 'wrapDenier' => $this->input->post('wrapDenier'), 'wrapSr' => $this->input->post('wrapSr'), 'wrapWaste' => $this->input->post('wrapWaste'), 'loomFinWt' => $this->input->post('loomFinWt'), 'weftQty' => $this->input->post('weftQty'), 'weftSpecification' => $this->input->post('weftSpecification'), 'weftfinaldenier' => $this->input->post('weftfinaldenier'), 'weftWt' => $this->input->post('weftWt'), 'weftDenier' => $this->input->post('weftDenier'), 'weftSr' => $this->input->post('weftSr'), 'weftWaste' => $this->input->post('weftWaste') ); $articleinsert = $this->marketing_model->article_insert($article_data); if ($articleinsert == 1) { redirect(base_url() . 'dashboard/article_details', 'refresh'); } else { echo "notinserted"; } } } else { $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('marketing/add_article', $data); $this->load->view('templates/footer_inside'); } } public function add_usermanage() { if ($this->input->post('adduser')) { $this->form_validation->set_rules('firstname', 'First Name', 'trim|required|xss_clean|alpha_numeric'); $this->form_validation->set_rules('lastname', 'Last Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('username', 'UserName', 'trim|required|callback_check_database'); $this->form_validation->set_rules('emailid', 'Email', 'trim|required|callback_check_email'); $this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean'); $this->form_validation->set_rules('role', 'Role', 'trim|required|xss_clean'); if ($this->form_validation->run() == FALSE) { $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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('usermanagment/add_user_management'); $this->load->view('templates/footer_inside'); } else { $article_data = array( 'fName' => $this->input->post('firstname'), 'lName' => $this->input->post('lastname'), 'username' => $this->input->post('username'), 'email' => $this->input->post('emailid'), 'password' => $this->input->post('password'), 'role' => $this->input->post('role') ); $articleinsert = $this->marketing_model->add_usermanage($article_data); if ($articleinsert == 1) { redirect(base_url() . 'dashboard/user_managment', 'refresh'); } else { echo "notinserted"; } } } else { $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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('usermanagment/add_user_management'); $this->load->view('templates/footer_inside'); } } function check_database($chickclient) { $chickclient=$this->input->post('username'); $result=$this->marketing_model->checkclient($chickclient); if ($result) { $this->form_validation->set_message('check_database', 'UserName Already Exited'); return FALSE; } else { return TRUE; } } function check_email($chickemail) { $chickclient=$this->input->post('emailid'); $result=$this->marketing_model->checkemail($chickemail); if ($result) { $this->form_validation->set_message('check_email', 'Email Already Exited'); return FALSE; } else { return TRUE; } } /* public function add_planning_order() { $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'); $this->load->view('planning_module/add_planning_order1'); $this->load->view('templates/footer_inside'); }*/ public function article_master() { $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(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('marketing/add_article'); $this->load->view('templates/footer_inside'); } public function user_managment() { $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['getall']=$this->marketing_model->display_user_managment(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('usermanagment/user',$data); $this->load->view('templates/footer_inside'); } public function add_user() { $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(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('usermanagment/add_user_management'); $this->load->view('templates/footer_inside'); } public function delete_user_management() { $id=$_REQUEST['ide']; $this->marketing_model->delete_users($id); redirect(base_url().'dashboard/user_managment','refresh'); } public function edit_user_management($id) { $data['editdata']=$this->marketing_model->get_usermanage_editdata($id); if($this->input->post('edituser')) { $this->form_validation->set_rules('firstname', 'First Name', 'trim|required|xss_clean|alpha_numeric'); $this->form_validation->set_rules('lastname', 'Last Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('username', 'UserName', 'trim|required'); $this->form_validation->set_rules('emailid', 'Email', 'trim|required'); $this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean'); $this->form_validation->set_rules('role', 'Role', 'trim|required|xss_clean'); if($this->form_validation->run() == FALSE) { $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(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('usermanagment/edit_user_management',$data); $this->load->view('templates/footer_inside'); } else { $supplier_data = array('fName' => $this->input->post('firstname'), 'lName' => $this->input->post('lastname'), 'username' => $this->input->post('username'), 'email' => $this->input->post('emailid'), 'password' => $this->input->post('password'), 'role' => $this->input->post('role') ); $supupdate=$this->marketing_model->user_management_update($supplier_data,$id); if($supupdate==1) { redirect(base_url().'dashboard/user_managment','refresh'); } } } else { $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(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('usermanagment/edit_user_management',$data); $this->load->view('templates/footer_inside'); } } //csv download public function csv_download($tablename) { $this->load->dbutil(); $this->load->helper('download'); $query = $this->db->query("SELECT * FROM $tablename"); $delimiter = ","; $newline = "\r\n"; $data = $this->dbutil->csv_from_result($query, $delimiter, $newline); force_download("CSV_Report.csv", $data); } //pdf download public function pdf_download($tablename) { //$data['getalldata']=$this->yarn_model->getpdfdata($tablename); $this->load->helper('pdf_helper'); $data['getalldata'] = $tablename; //$data['datatalbe'] = "mahendra"; $this->load->view('pdfindex', $data); } //excel download test public function excel_download($tablename) { //load our new PHPExcel library $this->load->library('excel'); $data['getalldata'] = $this->yarn_model->getpdfdata($tablename); $this->load->view('excelindex', $data); } // public function masters_name_address() { $nameaddress = $this->yarn_model->get_name_address($_REQUEST['fileno']); //echo $_REQUEST['fileno']; //print_r($nameaddress); foreach ($nameaddress as $na_result) { echo $na_result->customer_name . '@@' . $na_result->address; } } public function testing() { $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(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('addmore'); } public function article_testing() { $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(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('addmore1'); } public function transactions_order_input_testing() { $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(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('addmore2'); } public function add_article_testing() { $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(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('addmore3'); } public function charts_amcharts() { $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'); $this->load->view('charts_amcharts'); } //logout public function logout() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $timestamp = date("Y-m-d H:i:s"); $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $datar=array('chat_online'=>'offline','offline_time'=>$timestamp); $this->yarn_model->update($table,$datar,$where); $this->session->sess_destroy(); redirect(base_url()); } public function edit_quality() { //$data['check_specification'] = $this->yarn_model->check_spec_exists(); $edit_id=$this->input->post('edit_id'); $where=array('id'=>$edit_id); $table='import_yarn'; $data['result'] = $this->yarn_model->fetch_main_data($table,$where); $table='yarn_stage'; $where=array('yarnID'=>$edit_id); $data['result1'] = $this->yarn_model->fetch_where_data($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $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(); $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); $tablename='yarn_quality_names'; $data['yarn_qua_details'] = $this->yarn_model->getpdfdata($tablename); $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('import_module/edit_quality', $data); $this->load->view('templates/footer_inside'); } public function edit_quality_data() { $edit_id=$this->input->post('edit_id'); $where=array('id'=>$edit_id); $quality_data = array('yarnType' => $this->input->post('yarntype'), 'yarnQuality' => $this->input->post('yarnquality'), 'yarnName' => $this->input->post('yarnname'), 'yarnSpecification' => $this->input->post('yarnspecifications'), 'yarnDenier' => $this->input->post('yarndenier'), 'hankLength' => $this->input->post('hanklength'), 'hankWt' => $this->input->post('hankwt'), 'supplier' => $this->input->post('supplier'), ); $table='import_yarn'; $this->db->update($table,$quality_data,$where); $this->db2->update($table,$quality_data,$where); $stage= $this->input->post('stage'); $direction=$this->input->post('direction'); $count= $this->input->post('count'); $where=array('yarnID'=>$edit_id); $table='yarn_stage'; $this->planning_shade->planning_delete($table,$where); //$this->planning_shade->planning_delete($table,$where); foreach($stage as $key=>$val) { $data = array('stage' => $stage[$key], 'direction' => $direction[$key], 'count' => $count[$key], 'yarnID' => $edit_id, ); $table='yarn_stage'; $this->db->insert($table,$data); $this->db2->insert($table,$data); } // $edit_id=$this->input->post('edit_id'); // $where=array('yarnID'=>$edit_id); // $table='yarn_stage'; // $this->db->update($table,$data,$where); } public function delete_quality() { $delete_id=$this->input->post('as'); $where=array('id'=>$delete_id); $table='import_yarn'; $data=array('status'=>1); $this->yarn_model->update_yarns($table,$data,$where); } public function resetpassword() { $email= $this->input->post('email'); $login_table= 'employee_details'; $check_email= array('email'=>$email); $email= $this->session->set_userdata($check_email); $checkingemail= $this->vendor_model->get_customerdata($login_table,$check_email); } 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 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' || $data['emp_details']->designation == 'HO Marketing' || $data['emp_details']->designation == 'HO 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; } //<!---------------------- planning module ------------------> public function planning_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 ---------------------------------> $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; $to_d=$date_wise_data->to_date; // $newDate = date("d/m/Y", strtotime($d)); 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' || $data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive') { if($date_wise_data->module_status == 'old') { $d=$date_wise_data->req_date; $to_d=$date_wise_data->to_date; $where=$d; $data['pallning_insert_rows']=$this->vendor_model->get_plannind_import_snot($d,$to_d); $data['pallning_rows']=$this->vendor_model->get_plannind_rows_import_snot($d,$to_d); } else { $d=$date_wise_data->req_date; $where=$d; $data['pallning_insert_rows']=$this->vendor_model->planning_notification_get_result($where); $data['pallning_rows']=$this->vendor_model->planning_notification_get_details($where); } if($date_wise_data->module_status == 'old') { $newDate = date("Y-m-d", strtotime($d)); //$dd=date('Y-m-d'); $where=$newDate; $newDate1 = date("Y-m-d", strtotime($to_d)); //$dd=date('Y-m-d'); $where1=$newDate1; $data['pallning_outsource_insert_rows']=$this->vendor_model->get_outsource_plannind_import_snot($where,$where1); $data['pallning_outsource_rows']=$this->vendor_model->get_outsource_plannind_rows_import_snot($where,$where1); } else { $newDate = date("Y-m-d", strtotime($d)); //$dd=date('Y-m-d'); $where=$newDate; $data['pallning_outsource_insert_rows']=$this->vendor_model->outsource_planning_notification_get_result($where); $data['pallning_outsource_rows']=$this->vendor_model->outsource_planning_notification_get_details($where); } if($date_wise_data->module_status == 'old') { $d=date('Y-m-d'); $where=$d; $data['planned_dyeing_on_date_rows']=0; $data['planned_weaving_on_date_rows']=0; $data['planned_dyeing_on_date_inserted_rows']=''; $data['planned_weaving_on_date_inserted_rows']=''; $befdore_seven=date('Y-m-d',strtotime('+7 days')) . PHP_EOL; $data['planned_dyeing_sevenn_days_rows']=0; $data['planned_weaving_sevenn_days_rows']=0; $data['planned_dyeing_sevenn_days_inserted_rows']=''; $data['planned_weaving_sevenn_days_inserted_rows']=''; $after_five=date('Y-m-d',strtotime('-5 days')) . PHP_EOL; $data['planned_dyeing_five_days_rows']=0; $data['planned_weaving_five_days_rows']=0; $data['planned_dyeing_five_days_inserted_rows']=''; $data['planned_weaving_five_days_inserted_rows']=''; } else { $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); $data['planned_dyeing_on_date_inserted_rows']=$this->vendor_model->planning_notification_dyeing_date_result_get_details($where); $data['planned_weaving_on_date_inserted_rows']=$this->vendor_model->planning_notification_weaving_date_result_get_details($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); $data['planned_dyeing_sevenn_days_inserted_rows']=$this->vendor_model->planning_notification_dyeing_date_result_get_details($befdore_seven); $data['planned_weaving_sevenn_days_inserted_rows']=$this->vendor_model->planning_notification_weaving_date_result_get_details($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); $data['planned_dyeing_five_days_inserted_rows']=$this->vendor_model->planning_notification_dyeing_date_result_get_details($after_five); $data['planned_weaving_five_days_inserted_rows']=$this->vendor_model->planning_notification_weaving_date_result_get_details($after_five); } } else { $data['pallning_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; } // print_r($data['planned_dyeing_on_date_inserted_rows']); // print_r('------------------------------------------'); // print_r($data['planned_weaving_on_date_inserted_rows']); //die(); $data['total_plan_sum']=$data['pallning_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'] ; $data['page_static']='planning'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $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('vendor_master/notification_page',$data); $this->load->view('templates/footer_inside'); } //<!---------------------- issue_fabric module ------------------> public function issue_fabric_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') { //<!------------------------ indent ---------------------------------> $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; // $d=date('d-m-Y'); $table='fabric_addstock'; if($date_wise_data->module_status == 'old') { $where=array('created_at'=>$d); } else { $where=array('created_at'=>$d,'insert_notification_status'=>0); } $data['issue_fabric_inserted_rows1']=$this->vendor_model->issue_fabric_noti_all_get_where_dataa($table,$where); $data['issue_fabric_inserted_rows2']=$this->vendor_model->issue_fabric_noti_qua_get_where_dataa($table,$where); $data['issue_fabric_rows']=$this->vendor_model->issue_fabric_count_amount_get_customerdata($table,$where); } else { $data['issue_fabric_rows']=0; } $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['page_static']='issue_fabric'; $data['user_type_id'] = $this->access_id(); $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'); } //<!---------------------- issue_cs module ------------------> public function issue_cs_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') { //<!------------------------ indent ---------------------------------> $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; $to_d=$date_wise_data->to_date; // $d=date('d-m-Y'); $table='cs_addstock'; if($date_wise_data->module_status == 'old') { $where=array('created_at'=>$d); $data['issue_cs_inserted_rows']=$this->vendor_model->cs_addstock_aold_noti_date_wise($d,$to_d); $data['issue_cs_inserted_rows2']=$this->vendor_model->add_stock_aold_noti_date_wise_counti($d,$to_d); $data['issue_cs_rows']=$this->vendor_model->add_stock_aold_noti_date_wise_counts($d,$to_d); } else { $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['issue_cs_inserted_rows']=$this->vendor_model->get_where_dataa($table,$where); $data['issue_cs_inserted_rows2']=$this->vendor_model->issue_cs_noti_qua_get_where_dataa($table,$where); $data['issue_cs_rows']=$this->vendor_model->issue_fabric_count_amount_get_customerdata($table,$where); } } else { $data['issue_cs_rows']=0; } $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['page_static']='issue_cs'; $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $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('vendor_master/notification_page',$data); $this->load->view('templates/footer_inside'); } public function work_order_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 == 'PPC Manager') { $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; $to_d=$date_wise_data->to_date; if($date_wise_data->module_status == 'old') { // $d=date('d-m-Y'); $table='create_yarntwisting_work_order'; $where=array('created_at'=>$d); $data['issue_work_order_twisting_inserted_rows']=$this->vendor_model->cyt_addstock_aold_noti_date_wise($d,$to_d); $data['issue_work_order_twisting_inserted_rows2']=$this->vendor_model->cyt_stock_aold_noti_date_wise_counti($d,$to_d); $data['issue_work_order_twisting_rows']=$this->vendor_model->cyt_stock_aold_noti_date_wise_counts($d,$to_d); // $d=date('d-m-Y'); $table='workorder_dyeing'; $where=array('created_at'=>$d); $data['issue_work_order_dyeing_inserted_rows']=$this->vendor_model->wd_addstock_aold_noti_date_wise($d,$to_d); $data['issue_work_order_dyeing_inserted_rows2']=$this->vendor_model->wd_stock_aold_noti_date_wise_counti($d,$to_d); $data['issue_work_order_dyeing_rows']=$this->vendor_model->wd_stock_aold_noti_date_wise_counts($d,$to_d); // $d=date('d-m-Y'); $table='workorder_dyeing_material'; $where=array('approved_date'=>$d); $data['issue_work_order_dyeing_material_inserted_rows']=$this->vendor_model->wdm_addstock_aold_noti_date_wise($d,$to_d); $data['issue_work_order_dyeing_material_rows2']=$this->vendor_model->wdm_stock_aold_noti_date_wise_counti($d,$to_d); $data['issue_work_order_dyeing_material_rows']=$this->vendor_model->wdm_stock_aold_noti_date_wise_counts($d,$to_d); // $d=date('d-m-Y'); $table='finishing_embroidry'; $where=array('created_at'=>$d); $data['issue_work_order_fabric_inserted_rows']=$this->vendor_model->fab_emb_addstock_aold_noti_date_wise($d,$to_d); $data['issue_work_order_fabric_inserted_rows2']=$this->vendor_model->fab_emb_stock_aold_noti_date_wise_counti($d,$to_d); $data['issue_work_order_fabric_rows']=$this->vendor_model->fab_emb_stock_aold_noti_date_wise_counts($d,$to_d); //<!----------- finish---------------> // $d=date('d-m-Y'); $table='work_order_twisting'; $where=array('rec_date'=>$d); $data['issue_work_order_del_twisting_inserted_rows']=$this->vendor_model->wot_emb_addstock_aold_noti_date_wise($d,$to_d); $data['issue_work_order_del_twisting_gross_inserted_rows2']=$this->vendor_model->wot_gross_aold_noti_date_wise_counti($d,$to_d); $data['issue_work_order_del_twisting_net_inserted_rows2']=$this->vendor_model->wot_net_wt_aold_noti_date_wise_counti($d,$to_d); $data['issue_work_order_del_twisting_tare_inserted_rows2']=$this->vendor_model->wot_tare_wt_aold_noti_date_wise_counti($d,$to_d); $data['work_order_delivery_del_twisting_finishing']=$this->vendor_model->wot_stock_aold_noti_date_wise_counts($d,$to_d); //$d=date('d-m-Y'); $table='work_order_dyeing'; $where=array('rec_date'=>$d); $data['work_order_delivery_dyeing1_finishing']=$this->vendor_model->wod_emb_addstock_aold_noti_date_wise($d,$to_d); $data['issue_work_order_del_dyeing2_gross_inserted_rows2']=$this->vendor_model->wod_gross_aold_noti_date_wise_counti($d,$to_d); $data['work_order_delivery_dyeing3__twisting_finishing']=$this->vendor_model->wod_stock_aold_noti_date_wise_counts($d,$to_d); //$d=date('d-m-Y'); $table=' weaving_factory_stock'; $where=array('rec_date'=>$d); $data['work_order_delivery_po1_finishing']=$this->vendor_model->wfs_res_colunot($d,$to_d); $data['work_order_delivery_sum1_finishing']=$this->vendor_model->wfs_rec_mtrs_colunot($d,$to_d); $data['work_order_delivery_sum2_finishing']=$this->vendor_model->wfs_rec_wt_get_colunot($d,$to_d); $data['work_order_delivery_count_po_finishing']=$this->vendor_model->wfs_num_rows_colucnot($d,$to_d); $newDate = date("d/m/Y", strtotime($d)); $newDate1 = date("d/m/Y", strtotime($to_d)); //$d=date('d/m/Y'); $table='finishing_embroidry_stock'; $where=array('received_date'=>$newDate,'insert_notification_status'=>0); $data['work_order_delivery_fab1_finishing']=$this->vendor_model->fes_res_colunot($newDate,$newDate1); $data['issue_work_order_del_fab2_gross_inserted_rows2']=$this->vendor_model->fes_rec_wt_get_colunot($newDate,$newDate1); $data['work_order_delivery_fab3__twisting_finishing']=$this->vendor_model->fes_num_rows_colucnot($newDate,$newDate1); } else { // $d=date('d-m-Y'); $table='create_yarntwisting_work_order'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['issue_work_order_twisting_inserted_rows']=$this->vendor_model->issue_fabric_noti_all_get_where_dataa($table,$where); $data['issue_work_order_twisting_inserted_rows2']=$this->vendor_model->issue_work_order_noti_qua_get_where_dataa($table,$where); $data['issue_work_order_twisting_rows']=$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['issue_work_order_dyeing_inserted_rows']=$this->vendor_model->issue_fabric_noti_all_get_where_dataa($table,$where); $data['issue_work_order_dyeing_inserted_rows2']=$this->vendor_model->issue_work_order_dyeing_noti_qua_get_where_dataa($table,$where); $data['issue_work_order_dyeing_rows']=$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_inserted_rows']=$this->vendor_model->issue_fabric_material_noti_all_get_where_dataa($table,$where); $data['issue_work_order_dyeing_material_rows2']=$this->vendor_model->issue_work_order_dyeing_material_noti_qua_get_where_dataa($table,$where); $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['issue_work_order_fabric_inserted_rows']=$this->vendor_model->issue_fabric_noti_all_get_where_dataa($table,$where); $data['issue_work_order_fabric_inserted_rows2']=$this->vendor_model->issue_work_order_fabric_noti_qua_get_where_dataa($table,$where); $data['issue_work_order_fabric_rows']=$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['issue_work_order_del_twisting_inserted_rows']=$this->vendor_model->count_amount_work_order_deliv_twist_get_customerdata($table,$d); $data['issue_work_order_del_twisting_gross_inserted_rows2']=$this->vendor_model->issue_work_order_deli_twi_noti_qua_get_where_dataa1($table,$where); $data['issue_work_order_del_twisting_net_inserted_rows2']=$this->vendor_model->issue_work_order_deli_twi_noti_qua_get_where_dataa2($table,$where); $data['issue_work_order_del_twisting_tare_inserted_rows2']=$this->vendor_model->issue_work_order_deli_twi_noti_qua_get_where_dataa3($table,$where); $data['work_order_delivery_del_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_dyeing1_finishing']=$this->vendor_model->count_amount_work_order_deliv_dyeing1_get_customerdata($table,$d); $data['issue_work_order_del_dyeing2_gross_inserted_rows2']=$this->vendor_model->issue_work_order_deli_dye_noti_qua_get_where_dataa3($table,$where); $data['work_order_delivery_dyeing3__twisting_finishing']=$this->vendor_model->count_amount_work_order_delivery_yarn_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_po1_finishing']=$this->vendor_model->count_amount_work_order_deliv_po_osl_get_customerdata($table,$where); $data['work_order_delivery_sum1_finishing']=$this->vendor_model->sum1_amount_work_order_deliv_po_osl_get_customerdata($table,$where); $data['work_order_delivery_sum2_finishing']=$this->vendor_model->sum2_amount_work_order_deliv_po_osl_get_customerdata($table,$where); $data['work_order_delivery_count_po_finishing']=$this->vendor_model->count_amount_work_order_delivery_weaving_fabric_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='finishing_embroidry_stock'; $where=array('received_date'=>$newDate,'insert_notification_status'=>0); $data['work_order_delivery_fab1_finishing']=$this->vendor_model->count_amount_work_order_deliv_fab_get_customerdata($table,$newDate); $data['issue_work_order_del_fab2_gross_inserted_rows2']=$this->vendor_model->issue_work_order_deli_fab_noti_qua_get_where_dataa3($table,$where); $data['work_order_delivery_fab3__twisting_finishing']=$this->vendor_model->count_amount_work_order_delivery_yarn_fab_get_customerdata($table,$where); } } else { $data['issue_work_order_twisting_rows']=0; $data['issue_work_order_dyeing_rows']=0; $data['issue_work_order_fabric_rows']=0; $data['work_order_delivery_del_twisting_finishing']=0; $data['work_order_delivery_dyeing3__twisting_finishing']=0; $data['work_order_delivery_fab3__twisting_finishing']=0; $data['work_order_delivery_count_po_finishing']=0; $data['issue_work_order_dyeing_material_rows']=0; } $data['total_created_work_order_notifications']=$data['issue_work_order_twisting_rows'] + $data['issue_work_order_dyeing_rows'] + $data['issue_work_order_fabric_rows'] + $data['work_order_delivery_del_twisting_finishing'] + $data['work_order_delivery_dyeing3__twisting_finishing'] + $data['work_order_delivery_fab3__twisting_finishing'] + $data['work_order_delivery_count_po_finishing'] + $data['issue_work_order_dyeing_material_rows']; $data['page_static']='create_work_order'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications'];$data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $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('vendor_master/notification_page',$data); $this->load->view('templates/footer_inside'); } //<!---------------------- package module ------------------> public function design_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') { //<!------------------------ indent ---------------------------------> $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; $to_d=$date_wise_data->to_date; //$d=date('d-m-Y'); $table='design_weave'; if($date_wise_data->module_status == 'old') { $where=array('created_date'=>$d); $data['designing_insert_rows']=$this->vendor_model->design_weave_old_noti_date_wise($d,$to_d); $design_insert_rows=$this->vendor_model->design_weave_old_noti_date_wise_counti($d,$to_d); } else { $where=array('created_date'=>$d,'insert_notification_status'=>0); $data['designing_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $design_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='design_weave'; if($date_wise_data->module_status == 'old') { $where=array('updated_on'=>$d); $data['designing_update_rows']=$this->vendor_model->design_weave_uold_noti_date_wise($d,$to_d); $design_update_rows=$this->vendor_model->design_weave_uold_noti_date_wise_counti($d,$to_d); } else { $where=array('updated_on'=>$d,'update_notification_status'=>0); $data['designing_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $design_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='design_weave'; if($date_wise_data->module_status == 'old') { $where=array('finalized_date'=>$d); $data['designing_finalize_rows']=$this->vendor_model->design_weave_fold_noti_date_wise($d,$to_d); $design_finalize_rows=$this->vendor_model->design_weave_fold_noti_date_wise_counti($d,$to_d); } else { $where=array('finalized_date'=>$d,'finalize_notification_status'=>0); $data['designing_finalize_rows']=$this->vendor_model->get_where_dataa($table,$where); $design_finalize_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='design_weave'; if($date_wise_data->module_status == 'old') { $where=array('approved_date'=>$d); $data['designing_approval_rows']=$this->vendor_model->design_weave_aold_noti_date_wise($d,$to_d); $design_approval_rows=$this->vendor_model->design_weave_aold_noti_date_wise_counti($d,$to_d); } else { $where=array('approved_date'=>$d,'approval_notification_status'=>0); $data['designing_approval_rows']=$this->vendor_model->get_where_dataa($table,$where); $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; } $data['total_design_notificationsr'] = $design_insert_rows + $design_update_rows + $design_finalize_rows + $design_approval_rows; $data['page_static']='design'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications'];$data['user_type_id'] = $this->access_id(); $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'); } //<!---------------------- package module ------------------> public function package_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' || $data['emp_details']->designation == 'HO Marketing' || $data['emp_details']->designation == 'HO Marketing') { //<!------------------------ indent ---------------------------------> $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; $to_d=$date_wise_data->to_date; //$d=date('d-m-Y'); $table='packing_list_data'; if($date_wise_data->module_status == 'old') { $where=array('created_at'=>$d); $data['package_insert_rows']=$this->vendor_model->packing_old_noti_date_wise($d,$to_d); $package_insert_rows=$this->vendor_model->packing_old_noti_date_wise_counti($d,$to_d); } else { $dd=date('d/m/Y'); $where=array('created_at'=>$dd,'insert_notification_status'=>0); $data['package_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $package_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='packing_list_data'; if($date_wise_data->module_status == 'old') { $where=array('updated_on'=>$d); $data['package_update_rows']=$this->vendor_model->upacking_old_noti_date_wise($d,$to_d); $package_update_rows=$this->vendor_model->upacking_old_noti_date_wise_counti($d,$to_d); } else { $where=array('updated_on'=>$d,'update_notification_status'=>0); $data['package_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $package_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } $newDate = date("d/m/Y", strtotime($d)); // $d=date('d/m/Y'); $table='madeups_list_data'; if($date_wise_data->module_status == 'old') { $where=array('created_at'=>$newDate); $data['package_madeups_insert_rows']=$this->vendor_model->madeups_old_noti_date_wise($d,$to_d); $package_madeups_insert_rows=$this->vendor_model->madeups_old_noti_date_wise_counti($d,$to_d); } else { $where=array('created_at'=>$newDate,'insert_notification_status'=>0); $data['package_madeups_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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; } $data['total_package_notificationsr'] = $package_insert_rows + $package_update_rows + $package_madeups_insert_rows; $data['page_static']='package'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['user_type_id'] = $this->access_id(); $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'); } //<!---------------------- package module ------------------> public function madeups_notifications() { $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications'];$data['user_type_id'] = $this->access_id(); $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); $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 ---------------------------------> $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); $newDate=$date_wise_data->req_date; $newDate1=$date_wise_data->to_date; $d = date("d/m/Y", strtotime($newDate)); $to_d = date("d/m/Y", strtotime($newDate1)); //$to_d=$date_wise_data->to_date; if($date_wise_data->module_status == 'old') { if($data['emp_details']->designation == 'HO Madeups' ) { $table='fabric_madeups'; $where=array('created_at'=>$d); $data['package_madeups_list_fabric_insert_rows']=$this->vendor_model->madeups_menu_old_noti_date_wise($d,$to_d); $madeups_list_insert_rows=$this->vendor_model->madeups_menu_old_noti_date_wise_counti($d,$to_d); //$d=date('d/m/Y'); $table='consumable_madeups'; $where=array('created_at'=>$d); $data['package_madeups_list_cs_insert_rows']=$this->vendor_model->consum_menu_old_noti_date_wise($d,$to_d); $data['package_madeups_list_cs_qua_insert_rows']=$this->vendor_model->consum_menu_old_noti_date_wise_counti_res($d,$to_d); $madeups_list_madeups_insert_rows=$this->vendor_model->consum_menu_old_noti_date_wise_counti($d,$to_d); } 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' || $data['emp_details']->designation == 'Super Admin') { $input=$d; $input1=$to_d; $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); $datee1 = explode('/', $input1); $day1 = $datee1[0]; $month1 = $datee1[1]; $year1 = $datee1[2]; $rre=substr($month1, 0, 1); $rre1=substr($month1, 1, 2); $rrre=substr($day1, 0, 1); $rrre1=substr($day1, 1, 2); if($rr == '0' && $rrr == '0') { $t=$rrr1 . '/' . $rr1 . '/' . $year; $t1=$rrre1 . '/' . $rre1 . '/' . $year1; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t); $data['package_madeups_list_fabric_delivery_insert_rows']=$this->vendor_model->fab_madeups_menu_old_noti_date_wise($t,$t1); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->fab_madeups_rows_menu_old_noti_date_wise($t,$t1); } else if($rr == '0' && $rrr != '0') { $t=$day . '/' . $rr1 . '/' . $year; $t1=$day1 . '/' . $rre1 . '/' . $year1; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t); $data['package_madeups_list_fabric_delivery_insert_rows']=$this->vendor_model->fab_madeups_menu_old_noti_date_wise1($t,$t1); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->fab_madeups_rows_menu_old_noti_date_wise1($t,$t1); } else if($rr != '0' && $rrr == '0') { $t=$rrr1 . '/' . $month . '/' . $year; $t1=$rrre1 . '/' . $month1 . '/' . $year1; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t); $data['package_madeups_list_fabric_delivery_insert_rows']=$this->vendor_model->fab_madeups_menu_old_noti_date_wise1($t,$t1); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->fab_madeups_rows_menu_old_noti_date_wise1($t,$t1); } else if($rr != '0' && $rrr != '0') { $d1=$d; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$d1); $data['package_madeups_list_fabric_delivery_insert_rows']=$this->vendor_model->fab_madeups_menu_old_noti_date_wise1($d,$to_d); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->fab_madeups_rows_menu_old_noti_date_wise1($d,$to_d); } } else { $madeups_list_madeups_delivery_insert_rows=0; } // old ends // } else { if($data['emp_details']->designation == 'HO Madeups') { $table='fabric_madeups'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['package_madeups_list_fabric_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['package_madeups_list_cs_insert_rows']=$this->vendor_model->madeups_noti_get_where_dataa($table,$where); $data['package_madeups_list_cs_qua_insert_rows']=$this->vendor_model->madeups_noti_qua_get_where_dataa($table,$where); $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=$d; $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; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $data['package_madeups_list_fabric_delivery_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else if($rr == '0' && $rrr != '0') { $t=$day . '/' . $rr1 . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $data['package_madeups_list_fabric_delivery_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else if($rr != '0' && $rrr == '0') { $t=$rrr1 . '/' . $month . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $data['package_madeups_list_fabric_delivery_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else if($rr != '0' && $rrr != '0') { $d1=$d; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$d1,'insert_notification_status'=>0); $data['package_madeups_list_fabric_delivery_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } } else { $madeups_list_madeups_delivery_insert_rows=0; } } //print_r($madeups_list_madeups_insert_rows); //die(); // else // { // $d=date('d/m/Y'); // $table='fabric_madeups_delivery_confirmation'; // $where=array('rec_date'=>$d); // $data['package_madeups_list_fabric_delivery_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); // $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); // } $data['total_madeups_notificationsr'] = $madeups_list_insert_rows + $madeups_list_madeups_insert_rows + $madeups_list_madeups_delivery_insert_rows ; $data['page_static']='madeups'; $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'); } //<!------------------------ sample request ------------------------------> public function sample_request_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; $to_d=$date_wise_data->to_date; //$d=date('d-m-Y'); $table='sample_request'; if($date_wise_data->module_status == 'old') { $where=array('created_date'=>$d); $data['sample_insert_rows']=$this->vendor_model->sample_old_noti_date_wise($d,$to_d); $sample_insert_rows1=$this->vendor_model->sample_old_noti_date_wise_counti($d,$to_d); } else { $where=array('created_date'=>$d,'insert_notification_status'=>0); $data['sample_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $sample_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='sample_request'; if($date_wise_data->module_status == 'old') { $where=array('updated_on'=>$d); $data['sample_update_rows']=$this->vendor_model->sample_old_unoti_date_wise($d,$to_d); $sample_update_rows1=$this->vendor_model->sample_old_unoti_date_wise_counti($d,$to_d); } else { $where=array('updated_on'=>$d,'update_notification_status'=>0); $data['sample_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $sample_update_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } $data['total_sample_notifications1'] = $sample_insert_rows1 + $sample_update_rows1 ; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['page_static']='sample'; $data['user_type_id'] = $this->access_id(); $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 marketing_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; $to_d=$date_wise_data->to_date; //$d=date('d-m-Y'); if($date_wise_data->module_status == 'old') { $where=$d; $data['marketing_insert_rows']=$this->vendor_model->get_plannind_import_marketing_snot($d,$to_d); $data['marketing_rows']=$this->vendor_model->get_plannind_rows_import_marketing_snot($d,$to_d); $data['marketing_confirm_rows']=$this->vendor_model->get_plannind_import_marketing_subnot($d,$to_d); $data['marketing_confirm_num_rows']=$this->vendor_model->get_plannind_rows_import_marketing_subnot($d,$to_d); $data['marketing_update_rows']=$this->vendor_model->get_plannind_import_marketing_subunot($d,$to_d); $data['marketing_update_num_rows']=$this->vendor_model->get_plannind_rows_import_marketing_subunot($d,$to_d); } else { $where=$d; $data['marketing_insert_rows']=$this->vendor_model->marketing_notification_get_details($where); $data['marketing_rows']=$this->vendor_model->marketing_notification_getsuborder($where); $data['marketing_confirm_rows']=$this->vendor_model->marketing_notification_confirm_get_details($where); $data['marketing_confirm_num_rows']=$this->vendor_model->marketing_notification_confirmgetsuborder($where); $data['marketing_update_rows']=$this->vendor_model->marketing_notification_update_get_details($where); $data['marketing_update_num_rows']=$this->vendor_model->marketing_notification_update_getsuborder($where); } if($date_wise_data->module_status == 'old') { $data['marketing_on_date_insert_rows']=''; $data['marketing_on_date_rows']=0; $data['marketing_ten_days_insert_rows']=''; $data['marketing_ten_days_rows']=0; $data['marketing_thirty_days_insert_rows']=''; $data['marketing_thirty_days_rows']=0; } else { $d=date('Y-m-d'); $where=$d; $data['marketing_on_date_insert_rows']=$this->vendor_model->marketing_notification_delivery_date_result_get_details($where); $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_insert_rows']=$this->vendor_model->marketing_notification_delivery_date_result_get_details($befdore_ten); $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_insert_rows']=$this->vendor_model->marketing_notification_delivery_date_result_get_details($befdore_thirty); $data['marketing_thirty_days_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($befdore_thirty); } $data['marketing_totals'] = $data['marketing_rows'] + $data['marketing_confirm_num_rows'] + $data['marketing_update_num_rows'] + $data['marketing_on_date_rows'] + $data['marketing_ten_days_rows'] + $data['marketing_thirty_days_rows']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['page_static']='marketing'; $data['user_type_id'] = $this->access_id(); $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 stock_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 ---------------------------------> $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; $to_d=$date_wise_data->to_date; //$d=date('d-m-Y'); $table='fabric_transfer'; if($date_wise_data->module_status == 'old') { $where=array('transfer_date'=>$d); $data['stock']=$this->vendor_model->get_from_to_indent_transfer_not($d,$to_d); $data['stock_count_wt']=$this->vendor_model->get_from_to_indent_transfer_cnot($d,$to_d); $data['stock_count_mtrs']=$this->vendor_model->get_from_to_indent_transfer_snot($d,$to_d); $data['stoct_transfer_rows']=$this->vendor_model->get_from_to_indent_transfer_cunot($d,$to_d); } else { $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stock']=$this->vendor_model->stock_location_get_where_dataa($table,$where); $data['stock_count_wt']=$this->vendor_model->stock_count_wt_get_data_fetch($table,$where); $data['stock_count_mtrs']=$this->vendor_model->stock_count_mtrs_get_data_fetch($table,$where); $data['stoct_transfer_rows']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='yarn_transfer'; if($date_wise_data->module_status == 'old') { $where=array('transfer_date'=>$d); $data['yarn_stock']=$this->vendor_model->get_from_to_indent_yarn_transfer_not($d,$to_d); $data['stock_count_net_wt']=$this->vendor_model->get_from_to_indent_yarn_transfer_nots($d,$to_d); $data['stoct_transfer_rows2']=$this->vendor_model->get_from_to_indent_transfer_cyunot($d,$to_d); } else { $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['yarn_stock']=$this->vendor_model->stock_location_get_where_dataa($table,$where); $data['stock_count_net_wt']=$this->vendor_model->stock_count_net_wt_get_data_fetch($table,$where); $data['stoct_transfer_rows2']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } $table='cs_transfer'; if($date_wise_data->module_status == 'old') { $where=array('transfer_date'=>$d); $data['cs_stock']=$this->vendor_model->get_from_to_indent_cs_transfer_not($d,$to_d); $data['stock_count_qua']=$this->vendor_model->get_from_to_indent_cs_transfer_notts($d,$to_d); $data['stoct_transfer_rows3']=$this->vendor_model->get_from_to_indent_transfer_csunot($d,$to_d); } else { $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['cs_stock']=$this->vendor_model->stock_location_get_where_dataa($table,$where); $data['stock_count_qua']=$this->vendor_model->stock_count_qua_get_data_fetch($table,$where); $data['stoct_transfer_rows3']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='swan_yarn_transfer'; if($date_wise_data->module_status == 'old') { $where=array('transfer_date'=>$d); $data['swan_stock']=$this->vendor_model->get_from_to_swan_yarn_transfer_not($d,$to_d); $data['stock_count_dyed_wt']=$this->vendor_model->get_from_to_swan_yarn_transfer_cnot($d,$to_d); $data['stoct_transfer_rows1']=$this->vendor_model->get_from_to_indent_transfer_swan_unot($d,$to_d); } else { $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['swan_stock']=$this->vendor_model->stock_location_get_where_dataa($table,$where); $data['stock_count_dyed_wt']=$this->vendor_model->stock_count_dyed_wt_get_data_fetch($table,$where); $data['stoct_transfer_rows1']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } $data['total_stock_notifications1']=$data['stoct_transfer_rows'] + $data['stoct_transfer_rows1'] + $data['stoct_transfer_rows2'] + $data['stoct_transfer_rows3']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['page_static']='stock'; $data['user_type_id'] = $this->access_id(); $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 rec_stock_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 ---------------------------------> $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; $to_d=$date_wise_data->to_date; // $d=date('d-m-Y'); $table='fabric_transfer'; if($date_wise_data->module_status == 'old') { $where=array('rec_date'=>$d); $data['rec_stock']=$this->vendor_model->get_from_to_indent_transfer_recnot($d,$to_d); $data['rec_stock_count_wt']=$this->vendor_model->get_from_to_indent_transfer_reccnot($d,$to_d); $data['rec_stock_count_mtrs']=$this->vendor_model->get_from_to_indent_transfer_recsnot($d,$to_d); $data['rec_stoct_transfer_rows']=$this->vendor_model->get_from_to_indent_transfer_reccunot($d,$to_d); } else { $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stock']=$this->vendor_model->stock_location_get_where_dataa($table,$where); $data['rec_stock_count_wt']=$this->vendor_model->stock_count_wt_get_data_fetch($table,$where); $data['rec_stock_count_mtrs']=$this->vendor_model->rec_stock_count_mtrs_get_data_fetch($table,$where); $data['rec_stoct_transfer_rows']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='yarn_transfer'; if($date_wise_data->module_status == 'old') { $where=array('rec_date'=>$d); $data['rec_yarn_stock']=$this->vendor_model->get_from_to_indent_yarn_transfer_recnot($d,$to_d); $data['rec_stock_count_net_wt']=$this->vendor_model->get_from_to_indent_yarn_transfer_recnots($d,$to_d); $data['rec_stoct_transfer_rows2']=$this->vendor_model->get_from_to_indent_transfer_reccyunot($d,$to_d); } else { $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_yarn_stock']=$this->vendor_model->stock_location_get_where_dataa($table,$where); $data['rec_stock_count_net_wt']=$this->vendor_model->rec_stock_count_net_wt_get_data_fetch($table,$where); $data['rec_stoct_transfer_rows2']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='cs_transfer'; if($date_wise_data->module_status == 'old') { $where=array('rec_date'=>$d); $data['rec_cs_stock']=$this->vendor_model->get_from_to_indent_cs_transfer_recnot($d,$to_d); $data['rec_stock_count_qua']=$this->vendor_model->get_from_to_indent_cs_transfer_recnotts($d,$to_d); $data['rec_stoct_transfer_rows3']=$this->vendor_model->get_from_to_indent_transfer_reccsunot($d,$to_d); } else { $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_cs_stock']=$this->vendor_model->stock_location_get_where_dataa($table,$where); $data['rec_stock_count_qua']=$this->vendor_model->rec_stock_count_qua_get_data_fetch($table,$where); $data['rec_stoct_transfer_rows3']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } //$d=date('d-m-Y'); $table='swan_yarn_transfer'; if($date_wise_data->module_status == 'old') { $where=array('rec_date'=>$d); $data['rec_swan_stock']=$this->vendor_model->get_from_to_swan_yarn_transfer_recnot($d,$to_d); $data['rec_stock_count_dyed_wt']=$this->vendor_model->get_from_to_swan_yarn_transfer_reccnot($d,$to_d); $data['rec_stoct_transfer_rows1']=$this->vendor_model->get_from_to_indent_transfer_swan_recunot($d,$to_d); } else { $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_swan_stock']=$this->vendor_model->stock_location_get_where_dataa($table,$where); $data['rec_stock_count_dyed_wt']=$this->vendor_model->rec_stock_count_dyed_wt_get_data_fetch($table,$where); $data['rec_stoct_transfer_rows1']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } $data['total_rec_stock_notifications1']=$data['rec_stoct_transfer_rows'] + $data['rec_stoct_transfer_rows1'] + $data['rec_stoct_transfer_rows2'] + $data['rec_stoct_transfer_rows3'] ; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['page_static']='rec_stock'; $data['user_type_id'] = $this->access_id(); $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 masters_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 ---------------------------------> $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; $to_d=$date_wise_data->to_date; if($date_wise_data->module_status == 'old') { if($data['emp_details']->designation == 'Super Admin' ) { //$d=date('d-m-Y'); $table='import_yarn'; $where=array('created_date'=>$d); $data['yarn_insert_rows']=$this->vendor_model->get_master_import_not($d,$to_d); $yarn_insert_rows=$this->vendor_model->get_master_import_cnot($d,$to_d); //$d=date('d-m-Y'); $table='import_yarn'; $where=array('updated_on'=>$d); $data['yarn_update_rows']=$this->vendor_model->get_master_import_unot($d,$to_d); $yarn_insert_rows1=$this->vendor_model->get_master_import_ucnot($d,$to_d); //$d=date('d-m-Y'); $table='article_master'; $where=array('updated_on'=>$d); $data['article_update_rows']=$this->vendor_model->get_master_import_aunot($d,$to_d); $article_updated_rows=$this->vendor_model->get_master_import_aucnot($d,$to_d); //$d=date('d-m-Y'); $table='fabric_master'; $where=array('created_date'=>$d); $data['fabric_insert_rows']=$this->vendor_model->get_master_import_fnot($d,$to_d); $fabric_insert_rows=$this->vendor_model->get_master_import_fcnot($d,$to_d); //$d=date('d-m-Y'); $table='fabric_master'; $where=array('updated_on'=>$d); $data['fabric_update_rows']=$this->vendor_model->get_master_import_funot($d,$to_d); $fabric_upadted_rows=$this->vendor_model->get_master_import_fucnot($d,$to_d); //$d=date('d-m-Y'); $table='shade_master'; $where=array('created_date'=>$d); $data['shade_insert_rows']=$this->vendor_model->get_master_import_snot($d,$to_d); $shade_insert_rows=$this->vendor_model->get_master_import_scnot($d,$to_d); //$d=date('d-m-Y'); $table='shade_master'; $where=array('updated_on'=>$d); $data['shade_update_rows']=$this->vendor_model->get_master_import_sunot($d,$to_d); $shade_updated_row=$this->vendor_model->get_master_import_sucnot($d,$to_d); //$d=date('d-m-Y'); $table='color_master'; $where=array('created_date'=>$d); $data['color_insert_rows']=$this->vendor_model->get_master_import_colnot($d,$to_d); $color_insert_rows=$this->vendor_model->get_master_import_colcnot($d,$to_d); //$d=date('d-m-Y'); $table='color_master'; $where=array('updated_on'=>$d); $data['color_update_rows']=$this->vendor_model->get_master_import_colunot($d,$to_d); $color_insert_rows1=$this->vendor_model->get_master_import_colucnot($d,$to_d); //$d=date('d-m-Y'); $table='design_master'; $where=array('updated_on'=>$d); $data['design_update_rows']=$this->vendor_model->get_master_import_desunot($d,$to_d); $design_insert_rows1=$this->vendor_model->get_master_import_desucnot($d,$to_d); //$d=date('d-m-Y'); $table='customer_master'; $where=array('updated_on'=>$d); $data['customer_update_rows']=$this->vendor_model->get_master_import_cusunot($d,$to_d); $customer_insert_rows1=$this->vendor_model->get_master_import_cusucnot($d,$to_d); //$d=date('d-m-Y'); $table='box_master'; $where=array('updated_on'=>$d); $data['box_update_rows']=$this->vendor_model->get_master_import_boxunot($d,$to_d); $box_insert_rows1=$this->vendor_model->get_master_import_boxucnot($d,$to_d); //$d=date('d-m-Y'); $table='madeups_box_master'; $where=array('updated_on'=>$d); $data['madeups_box_update_rows']=$this->vendor_model->get_master_import_mboxunot($d,$to_d); $madeups_box_insert_rows1=$this->vendor_model->get_master_import_mboxucnot($d,$to_d); //$d=date('d-m-Y'); $table='product_master'; $where=array('updated_on'=>$d); $data['product_master_update_rows']=$this->vendor_model->get_master_import_prounot($d,$to_d); $product_master_insert_rows1=$this->vendor_model->get_master_import_proucnot($d,$to_d); } else { $madeups_box_insert_rows1=0; $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; $design_insert_rows1=0; $customer_insert_rows1=0; $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 == 'HO Marketing' || $data['emp_details']->designation == 'HO Marketing') { //$d=date('d-m-Y'); $table='article_master'; $where=array('created_date'=>$d); $data['article_insert_rows']=$this->vendor_model->get_master_import_acunot($d,$to_d); $article_insert_rows=$this->vendor_model->get_master_import_acucnot($d,$to_d); } else { $article_insert_rows=0; } if($data['emp_details']->designation == 'Super 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='design_master'; $where=array('created_date'=>$d); $data['design_insert_rows']=$this->vendor_model->get_master_import_descunot($d,$to_d); $design_insert_rows=$this->vendor_model->get_master_import_descucnot($d,$to_d); } else { $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_vendor_master'; $where=array('updated_on'=>$d); $data['vednor_update_rows']=$this->vendor_model->get_master_import_invenunot($d,$to_d); $indent_vednor_insert_rows1=$this->vendor_model->get_master_import_invencnot($d,$to_d); //$d=date('d-m-Y'); $table='indent_product'; $where=array('updated_on'=>$d); $data['product_update_rows']=$this->vendor_model->get_master_import_inprounot($d,$to_d); $indent_product_insert_rows1=$this->vendor_model->get_master_import_inprocnot($d,$to_d); } else { $indent_vednor_insert_rows1=0; $indent_product_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //$d=date('d-m-Y'); $table='customer_master'; $where=array('created_date'=>$d); $data['customer_insert_rows']=$this->vendor_model->get_master_import_cuspunot($d,$to_d); $customer_insert_rows=$this->vendor_model->get_master_import_cusupcnot($d,$to_d); //$d=date('d-m-Y'); $table='box_master'; $where=array('created_date'=>$d); $data['box_insert_rows']=$this->vendor_model->get_master_import_boxpunot($d,$to_d); $box_insert_rows=$this->vendor_model->get_master_import_boxpucnot($d,$to_d); //$d=date('d-m-Y'); $table='madeups_box_master'; $where=array('created_date'=>$d); $data['madeups_box_insert_rows']=$this->vendor_model->get_master_import_mboxpunot($d,$to_d); $madeups_box_insert_rows=$this->vendor_model->get_master_import_mboxpucnot($d,$to_d); //$d=date('d-m-Y'); $table='outsource_vendor_master'; $where=array('created_date'=>$d); $data['outsource_insert_rows']=$this->vendor_model->get_master_import_ovnot($d,$to_d); $outsource_insert_rows=$this->vendor_model->get_master_import_ovcnot($d,$to_d); //$d=date('d-m-Y'); $table='outsource_vendor_master'; $where=array('updated_on'=>$d); $data['outsource_update_rows']=$this->vendor_model->get_master_import_ovunot($d,$to_d); $outsource_insert_rows1=$this->vendor_model->get_master_import_ovucnot($d,$to_d); //$d=date('d-m-Y'); $table='indent_vendor_master'; $where=array('created_date'=>$d); $data['vendor_insert_rows']=$this->vendor_model->get_master_import_ivnot($d,$to_d); $indent_vednor_insert_rows=$this->vendor_model->get_master_import_ivcnot($d,$to_d); //$d=date('d-m-Y'); $table='indent_product'; $where=array('created_date'=>$d); $data['product_insert_rows']=$this->vendor_model->get_master_import_ipnot($d,$to_d); $indent_product_insert_rows=$this->vendor_model->get_master_import_ipcnot($d,$to_d); //$d=date('d-m-Y'); $table='product_master'; $where=array('created_date'=>$d); $data['product_master_insert_rows']=$this->vendor_model->get_master_import_pmnot($d,$to_d); $product_master_insert_rows=$this->vendor_model->get_master_import_pmcnot($d,$to_d); } else { $madeups_box_insert_rows=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; } } else { if($data['emp_details']->designation == 'Super Admin' ) { //$d=date('d-m-Y'); $table='import_yarn'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $data['yarn_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['yarn_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['article_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['fabric_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['fabric_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['shade_insert_rows']=$this->vendor_model->shade_master_getsuborder1($d); $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); $data['shade_update_rows']=$this->vendor_model->shade_master_update_getsuborder1($d); $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); $data['color_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['color_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $color_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='design_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $data['design_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $design_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); $data['customer_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['box_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['madeups_box_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['product_master_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $product_master_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $madeups_box_insert_rows1=0; $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; $design_insert_rows1=0; $customer_insert_rows1=0; $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 == '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); $data['article_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $article_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $article_insert_rows=0; } if($data['emp_details']->designation == 'Super 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='design_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $data['design_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $design_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $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_vendor_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $data['vednor_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $indent_vednor_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_product'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $data['product_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $indent_product_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_vednor_insert_rows1=0; $indent_product_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //$d=date('d-m-Y'); $table='customer_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $data['customer_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['box_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['madeups_box_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['outsource_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['outsource_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['vendor_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['product_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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); $data['product_master_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $product_master_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $madeups_box_insert_rows=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; } } $data['total_master_sum']=$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_rows1 + $indent_product_insert_rows + $product_master_insert_rows + $product_master_insert_rows1 + $madeups_box_insert_rows + $madeups_box_insert_rows1; $data['page_static']='masters'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications'];$data['user_type_id'] = $this->access_id(); $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 date_notifications() { $this->db->truncate('date_notification'); $required_on = $this->input->post('required_on'); // Since there is no form field for required_to_on, we set a default value $required_to_on = 'default_value'; // Replace 'default_value' with an appropriate default, e.g., '2024-07-14' $status = $this->input->post('status'); $selected_modues = $this->input->post('selected_modues'); $data = array( 'req_date' => $required_on, 'to_date' => $required_to_on, 'module' => $selected_modues, 'module_status' => $status ); $table = 'date_notification'; $this->db->insert($table, $data); } public function indent_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 ---------------------------------> $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; $to_d=$date_wise_data->to_date; if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'HO Purchase Admin' ) { if($date_wise_data->module_status == 'old') { $where=array('indented_date'=>$d); $table='indent_add_indent'; $data['indent_insert_rows']=$this->vendor_model->get_from_to_indent_not($d,$to_d); $indent_insert_rows1=$this->vendor_model->get_from_to_indent_not_count($d,$to_d); } else { $where=array('indented_date'=>$d,'insert_notification_status'=>0); $table='indent_add_indent'; $data['indent_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $indent_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } $table='indent_add_indent'; if($date_wise_data->module_status == 'old') { $where=array('updated_on'=>$d); $data['indent_update_rows']=$this->vendor_model->get_from_to_indent_unot($d,$to_d); $indent_update_rows1=$this->vendor_model->get_from_to_indent_unot_count($d,$to_d); } else { $where=array('updated_on'=>$d,'update_notification_status'=>0); $data['indent_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $indent_update_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } $table='indent_add_indent'; if($date_wise_data->module_status == 'old') { $where=array('approved_date'=>$d); $data['indent_approval_rows']=$this->vendor_model->get_from_to_indent_anot($d,$to_d); $indent_approval_rows1=$this->vendor_model->get_from_to_indent_anot_count($d,$to_d); } else { $where=array('approved_date'=>$d,'approval_notification_status'=>0); $data['indent_approval_rows']=$this->vendor_model->get_where_dataa($table,$where); $indent_approval_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } } else { $indent_insert_rows1=0; $indent_update_rows1=0; $indent_approval_rows1=0; } //<!------------------------ po ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $table='indent_po'; if($date_wise_data->module_status == 'old') { $where=array('created_date'=>$d); $data['indent_po_insert_rows']=$this->vendor_model->get_from_to_indent_pcnot($d,$to_d); $indent_po_insert_rows1=$this->vendor_model->get_from_to_indent_pcnot_count($d,$to_d); } else { $where=array('created_date'=>$d,'insert_notification_status'=>0); } $data['indent_po_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $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' ) { $table='indent_po'; if($date_wise_data->module_status == 'old') { $where=array('updated_on'=>$d); $data['indent_po_update_rows']=$this->vendor_model->get_from_to_indent_punot($d,$to_d); $indent_po_update_rows1=$this->vendor_model->get_from_to_indent_punot_count($d,$to_d); } else { $where=array('updated_on'=>$d,'update_notification_status'=>0); } $data['indent_po_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $indent_po_update_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $table='indent_po'; if($date_wise_data->module_status == 'old') { $where=array('approved_date'=>$d); $data['indent_po_approval_rows']=$this->vendor_model->get_from_to_indent_panot($d,$to_d); $indent_po_approval_rows1=$this->vendor_model->get_from_to_indent_panot_count($d,$to_d); } else { $where=array('approved_date'=>$d,'approval_notification_status'=>0); } $data['indent_po_approval_rows']=$this->vendor_model->get_where_dataa($table,$where); $indent_po_approval_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_po_update_rows1=0; $indent_po_approval_rows1=0; } $data['total_indent_notifications1'] = $indent_insert_rows1 + $indent_update_rows1 + $indent_approval_rows1 + $indent_po_insert_rows1 + $indent_po_update_rows1 + $indent_po_approval_rows1; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['page_static']='indent'; $data['user_type_id'] = $this->access_id(); $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 notification_checkboxes() { $data2=$this->input->post('ids'); $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $osl_details=array(); foreach($exp as $val) { $arre = preg_split('/(?<=[0-9])(?=[a-z]+)/i',$val); $where_id=$arre[1]; if($where_id == 'indenti') { $table='indent_add_indent'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'indentu') { $table='indent_add_indent'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'indenta') { $table='indent_add_indent'; $where=array('id'=>$arre[0]); $data=array('approval_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'poi') { $table='indent_po'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'pou') { $table='indent_po'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'poa') { $table='indent_po'; $where=array('id'=>$arre[0]); $data=array('approval_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'importi') { $table='import_yarn'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'splits') { $table='fabric_inspection_details'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'msplits') { $table='fabric_madeups_delivery_confirmation'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'importu') { $table='import_yarn'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'articlei') { $table='article_master'; $where=array('articleID'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'articleu') { $table='article_master'; $where=array('articleID'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'fabrici') { $table='fabric_master'; $where=array('fabricID'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'fabricu') { $table='fabric_master'; $where=array('fabricID'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'shadei') { $table='design_master'; $where=array('shadeID'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'shadeu') { $table='design_master'; $where=array('shadeID'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'designi') { $table='design_master'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'designu') { $table='design_master'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'colori') { $table='color_master'; $where=array('colorID'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'coloru') { $table='color_master'; $where=array('colorID'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'outsorcei') { $table='outsource_vendor_master'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'outsorceu') { $table='outsource_vendor_master'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'customeri') { $table='customer_master'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'customeru') { $table='customer_master'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'boxi') { $table='box_master'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'boxu') { $table='box_master'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'vendori') { $table='indent_vendor_master'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'vendoru') { $table='indent_vendor_master'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'productypei') { $table='indent_product'; $where=array('productID'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'productypeu') { $table='indent_product'; $where=array('productID'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'producti') { $table='indent_product'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'productu') { $table='indent_product'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'issuefab') { $table='fabric_addstock'; $where1=array('id'=>$arre[0]); $fab_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('work_order'=>$fab_row->work_order,'created_at'=>$d); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'issuecs') { $table='cs_addstock'; $where1=array('id'=>$arre[0]); $cs_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('work_order'=>$cs_row->work_order,'created_at'=>$d); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } //----------------------------stock------------------------/////////////// else if($where_id == 'stockf') { $table='fabric_transfer'; $where1=array('id'=>$arre[0]); $fab_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('transfer_id_val'=>$fab_row->transfer_id_val,'transfer_date'=>$d,'product_type'=>$fab_row->product_type,'product_location'=>$fab_row->product_location,'transfer_location'=>$fab_row->transfer_location); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'stocky') { $table='yarn_transfer'; $where1=array('id'=>$arre[0]); $yarn_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('transfer_id_val'=>$yarn_row->transfer_id_val,'transfer_date'=>$d,'product_type'=>$yarn_row->product_type,'product_location'=>$yarn_row->product_location,'transfer_location'=>$yarn_row->transfer_location); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'stocks') { $table='swan_yarn_transfer'; $where1=array('id'=>$arre[0]); $swan_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('transfer_id_val'=>$swan_row->transfer_id_val,'transfer_date'=>$d,'product_type'=>$swan_row->product_type,'product_location'=>$swan_row->product_location,'transfer_location'=>$swan_row->transfer_location); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'stockc') { $table='cs_transfer'; $where1=array('id'=>$arre[0]); $cs_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('transfer_id_val'=>$cs_row->transfer_id_val,'transfer_date'=>$d,'product_type'=>$cs_row->product_type,'product_location'=>$cs_row->product_location,'transfer_location'=>$cs_row->transfer_location); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } //----------------------------rec stock------------------------/////////////// else if($where_id == 'recstockf') { $table='fabric_transfer'; $where1=array('id'=>$arre[0]); $fab_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('transfer_id_val'=>$fab_row->transfer_id_val,'rec_date'=>$d,'product_type'=>$fab_row->product_type,'product_location'=>$fab_row->product_location,'transfer_location'=>$fab_row->transfer_location); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'recstocky') { $table='yarn_transfer'; $where1=array('id'=>$arre[0]); $yarn_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('transfer_id_val'=>$yarn_row->transfer_id_val,'rec_date'=>$d,'product_type'=>$yarn_row->product_type,'product_location'=>$yarn_row->product_location,'transfer_location'=>$yarn_row->transfer_location); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'recstocks') { $table='swan_yarn_transfer'; $where1=array('id'=>$arre[0]); $swan_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('transfer_id_val'=>$swan_row->transfer_id_val,'rec_date'=>$d,'product_type'=>$swan_row->product_type,'product_location'=>$swan_row->product_location,'transfer_location'=>$swan_row->transfer_location); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'recstockc') { $table='cs_transfer'; $where1=array('id'=>$arre[0]); $cs_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('transfer_id_val'=>$cs_row->transfer_id_val,'rec_date'=>$d,'product_type'=>$cs_row->product_type,'product_location'=>$cs_row->product_location,'transfer_location'=>$cs_row->transfer_location); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } //////////////////////////sample /////////////////////// else if($where_id == 'samplei') { $table='sample_request'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'sampleu') { $table='sample_request'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } //////////////////////////planning /////////////////////// else if($where_id == 'planningi') { $table='sub_orders'; $where=array('id'=>$arre[0]); $data=array('approval_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } ////////////////////////// marketing /////////////////////// else if($where_id == 'marki') { $table='sub_orders'; $where1=array('id'=>$arre[0]); $marki=$this->vendor_model->get_customerdata($table,$where1); $where=array('id'=>$marki->orderID); $table='orders'; $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'markc') { $table='sub_orders'; $where1=array('id'=>$arre[0]); $markc=$this->vendor_model->get_customerdata($table,$where1); $where=array('id'=>$markc->orderID); $table='orders'; $data=array('approval_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'marku') { $table='sub_orders'; $where1=array('id'=>$arre[0]); $marku=$this->vendor_model->get_customerdata($table,$where1); $where=array('id'=>$marku->orderID); $table='orders'; $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } ////////////////////////// design weave /////////////////////// else if($where_id == 'designweavei') { $table='design_weave'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'designweavea') { $table='design_weave'; $where=array('id'=>$arre[0]); $data=array('approval_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'designweavef') { $table='design_weave'; $where=array('id'=>$arre[0]); $data=array('finalize_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'designweaveu') { $table='design_weave'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } ////////////////////////// package /////////////////////// else if($where_id == 'pkgi') { $table='packing_list_data'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'pkgu') { $table='packing_list_data'; $where1=array('id'=>$arre[0]); $s=$this->vendor_model->get_customerdata($table,$where1); $where=array('osl'=>$s->osl,'created_at'=>$s->created_at); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'madeupspf') { $table='madeups_list_data'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } ////////////////////////// madeups /////////////////////// else if($where_id == 'madeupsf') { $table='fabric_madeups'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'madeupsc') { $table='consumable_madeups'; $where1=array('id'=>$arre[0]); $s=$this->vendor_model->get_customerdata($table,$where1); $where=array('osl'=>$s->osl,'created_at'=>$s->created_at); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'madeupsd') { $table='fabric_madeups_delivery_confirmation'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } ////////////////////////// new stores /////////////////////// else if($where_id == 'inspeci') { $table='fabric_inspection'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'inspecti') { $table='indent_goods_details'; $where=array('po_list_id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'fdi') { $table='indent_goods_details'; $where=array('po_list_id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'fdii') { $table='indent_goods_details'; $where=array('po_list_id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'fdiii') { $table='indent_goods_details'; $where=array('po_list_id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'yarni') { $table='indent_yarn_goods_details'; $where=array('po_list_id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'csii') { $table='indent_cs_goods_details'; $where=array('po_list_id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } //---------------------------- work order------------------------/////////////// else if($where_id == 'twisti') { $table='create_yarntwisting_work_order'; $where1=array('id'=>$arre[0]); $twist_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('work_order'=>$twist_row->work_order,'created_at'=>$d); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'dyedi') { $table='workorder_dyeing'; $where1=array('id'=>$arre[0]); $twist_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('work_order'=>$twist_row->work_order,'created_at'=>$d); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'dyeing') { $table='workorder_dyeing_material'; $where1=array('id'=>$arre[0]); $twist_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('work_order'=>$twist_row->work_order,'approved_date'=>$d); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'fabrcfini') { $table='finishing_embroidry'; $where1=array('id'=>$arre[0]); $twist_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('work_order'=>$twist_row->work_order,'created_at'=>$d); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'deltwisti') { $table='work_order_twisting'; $where1=array('id'=>$arre[0]); $dtwist_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('yarn_id'=>$dtwist_row->yarn_id,'rec_date'=>$d); $table='work_order_twisting'; $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'deldyedi') { $table='work_order_dyeing'; $where1=array('id'=>$arre[0]); $dyed_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('dyed_id'=>$dyed_row->dyed_id,'rec_date'=>$d); $table='work_order_dyeing'; $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'delweavei') { $table='weaving_factory_stock'; $where1=array('id'=>$arre[0]); $weave_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d-m-Y'); $where=array('weaving_id'=>$weave_row->weaving_id,'rec_date'=>$d); $table='weaving_factory_stock'; $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'delfabri') { $table='finishing_embroidry_stock'; $where1=array('id'=>$arre[0]); $fabr_row=$this->vendor_model->get_customerdata($table,$where1); $d=date('d/m/Y'); $where=array('fin_emb_id'=>$fabr_row->fin_emb_id,'received_date'=>$d); $table='finishing_embroidry_stock'; $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } //////////////////////////issue_loom /////////////////////// else if($where_id == 'loomi') { $table='issue_loom'; $where=array('id'=>$arre[0]); $data=array('insert_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'loomu') { $table='weaving_panel_planning_order'; $where=array('id'=>$arre[0]); $data=array('approval_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } else if($where_id == 'loomr') { $table='issue_loom'; $where=array('id'=>$arre[0]); $data=array('update_notification_status'=>1); $this->vendor_model->update_data($where,$table,$data); } } } public function dashboard_fun() { $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=array('chat_online'=>'online'); $this->vendor_model->update_data($where,$table,$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['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $table='dashboard_table'; $where=array('status'=>0); $data['dashboard_menus']=$this->vendor_model->get_where_dataa($table,$where); $data['dashboard_monthly_menus']=$this->vendor_model->get_where_dataa($table,$where); $data['dashboard_year_menus']=$this->vendor_model->get_where_dataa($table,$where); ////////// po //////////////////////// $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $created_po=$this->vendor_model->dashboard_po_no($table,$where); $montly_creatred_po=$this->vendor_model->monthly_created_po_generate($table,$m,$y); $year_creatred_po=$this->vendor_model->year_created_po_generate($table,$y); $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $approved_po=$this->vendor_model->dashboard_po_no($table,$where); $montly_approved_po=$this->vendor_model->monthly_approved_po_generate($table,$m,$y); $year_approved_po=$this->vendor_model->year_approved_po_generate($table,$y); $data['tot_val']=$created_po + $approved_po; $data['monthly_tot_val']=$montly_creatred_po + $montly_approved_po; $data['year_tot_val']=$year_creatred_po + $year_approved_po; ///////////////////////// new stores /////////////////////////// $m=date('m'); $y=date('Y'); $d1=date('d/m/Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['new_fabric']=$this->vendor_model->new_stores_get_purchase_data_count($d1); $table='indent_po'; $where=array('confirm'=>'No'); $o='Fabrics'; $a='Yes'; $data['new_montly_fabric']=$this->vendor_model->mponthly_new_stores_fetch_dashboard_pos_list_id_count($table,$m,$y,$o,$a); $o='Fabrics'; $a='Yes'; $table='indent_po'; $where=array('confirm'=>'No'); $data['new_year_fabric']=$this->vendor_model->yearly_new_stores_fetch_dashboard_pos_list_id_count($table,$y,$o,$a); // $data['new_fabric'] = $data['fabric_delivery_insert_rows2'] + $data['fabric_delivery_insert_rows3'] + $data['fabric_delivery_insert_rows4']; // $data['new_montly_fabric'] = $data['monthly_fabric_delivery_insert_rows2'] + $data['monthly_fabric_delivery_insert_rows3'] + $data['monthly_fabric_delivery_insert_rows4']; // $data['new_year_fabric'] = $data['year_fabric_delivery_insert_rows2'] + $data['year_fabric_delivery_insert_rows3'] + $data['year_fabric_delivery_insert_rows4']; // print_r($data['new_fabric']); // die(); $d1=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('rec_date'=>$d1); $p1='Yarn - Raw'; $p2='Yarn - Twisted'; $p3='Yarn - Dyed'; $data['new_yarn_count1']=$this->vendor_model->news_dashboard_po_list_id($d1,$p1); $data['new_yarn_count2']=$this->vendor_model->news_dashboard_po_list_id($d1,$p2); $data['new_yarn_count3']=$this->vendor_model->news_dashboard_po_list_id($d1,$p3); $d1=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('rec_date'=>$d1); $p1='Yarn - Raw'; $p2='Yarn - Twisted'; $p3='Yarn - Dyed'; $data['new_yarn_count11']=$this->vendor_model->monthly_news_dashboard_po_list_id($table,$m,$y,$p1); $data['new_yarn_count22']=$this->vendor_model->monthly_news_dashboard_po_list_id($table,$m,$y,$p2); $data['new_yarn_count33']=$this->vendor_model->monthly_news_dashboard_po_list_id($table,$m,$y,$p3); $d1=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('rec_date'=>$d1); $p1='Yarn - Raw'; $p2='Yarn - Twisted'; $p3='Yarn - Dyed'; $data['new_yarn_count111']=$this->vendor_model->year_news_dashboard_po_list_id($table,$y,$p1); $data['new_yarn_count222']=$this->vendor_model->year_news_dashboard_po_list_id($table,$y,$p2); $data['new_yarn_count333']=$this->vendor_model->year_news_dashboard_po_list_id($table,$y,$p3); $d1=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('rec_date'=>$d1); $data['new_yarn_count']=$data['new_yarn_count1'] + $data['new_yarn_count2'] + $data['new_yarn_count3']; $data['new_montly_yarn_count']= $data['new_yarn_count11'] + $data['new_yarn_count22'] + $data['new_yarn_count33']; $data['new_year_yarn_count']=$data['new_yarn_count111'] + $data['new_yarn_count222'] + $data['new_yarn_count333']; $d1=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('rec_date'=>$d1); $data['new_cs_count']=$this->vendor_model->dashboard_po_list_id($table,$where); $data['new_montly_cs_count']=$this->vendor_model->monthly_cs_dashboard_po_list_id($table,$m,$y); $data['new_year_cs_count']=$this->vendor_model->year_cs_dashboard_po_list_id($table,$y); // $data['new_store_del']=$fabric + $yarn_count +$cs_count; // $data['monlty_new_store_del']=$montly_fabric + $montly_yarn_count +$montly_cs_count; // $data['year_new_store_del']=$year_fabric + $year_yarn_count +$year_cs_count; // print_r($data['new_store_del']); // print_r('-------------------'); // print_r($data['monlty_new_store_del']); // print_r('-------------'); // print_r($data['year_new_store_del']); // die(); // -------------------- fabric inspection --------------------- $input=date('d/m/Y'); $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rre1=substr($month, 0, 1); if($rre1 == 0) { $rr1=substr($month, 1, 2); } else { $rr1=substr($month, 0, 2); } $rrr=substr($day, 0, 1); $rrre1=substr($day, 0, 1); if($rrre1 == 0) { $rrr1=substr($day, 1, 2); } else { $rrr1=substr($day, 0, 2); } // $t=$rrr1 . '/' . $rr1 . '/' . $year; $t=date('d/m/Y'); $d1=date('d-m-Y'); $table='fabric_inspection_details'; $where=array('received_date'=>$t); $where1=array('received_date'=>$d1); $data['today_fabric_inspection1']=$this->vendor_model->fabric_inspection_count_amount_get_customerdata($table,$where,$where1); //$d1=date('d-m-Y'); // $table='fabric_inspection_details'; // $where=array('received_date'=>$d1); // $data['today_fabric_inspection2']=$this->vendor_model->count_amount_get_customerdata($table,$where); $data['fabric_inspection']=$data['today_fabric_inspection1']; $m=date('m'); $y=date('Y'); $table='fabric_inspection_details'; $data['month_fabric_inspection1']=$this->vendor_model->monthly_fabric_inspection_dashboard_po_list_id($table,$m,$y); $data['year_fabric_inspection1']=$this->vendor_model->year_fabric_inspection_dashboard_po_list_id($table,$y); $data['month_fabric_inspection2']=0; $data['year_fabric_inspection2']=0; $data['month_fabric_inspection']=$data['month_fabric_inspection1'] + $data['month_fabric_inspection2']; $data['year_fabric_inspection']=$data['year_fabric_inspection1'] + $data['year_fabric_inspection2']; // -------------------- Exported afbric --------------------- $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='fabric_addstock'; $where=array('created_at'=>$d1); $data['export_issue_fabric']=$this->vendor_model->issue_fabric_no_count_amount_get_customerdata($table,$where); $data['monthly_export_issue_fabric']=$this->vendor_model->monthly_export_fabric_dashboard_po_list_id($table,$m,$y); $data['year_export_issue_fabric']=$this->vendor_model->year_export_fabric_dashboard_po_list_id($table,$y); $d1=date('d-m-Y'); $d=date('d/m/Y'); $table='packing_list_data'; $where=array('created_at'=>$d1); $data['export_pack_fabric']=$this->vendor_model->exported_packing_rows_RESULT_fabric_details($d1,$d); $data['monthly_export_pack_fabric']=$this->vendor_model->monthly_export_packing_date_dashboard_po_list_id($table,$m,$y); $data['year_export_pack_fabric']=0; $d1=date('d/m/Y'); $table='packing_list_data'; $where=array('created_at'=>$d1); $data['export_packing_fabric1']=0; $data['monthly_export_pack_fabric1']=0; $data['year_export_pack_fabric1']=$this->vendor_model->year_export_packing_date_dashboard_po_list_id($table,$y); $data['today_exported_fabric']=$data['export_issue_fabric'] + $data['export_pack_fabric'] + $data['export_packing_fabric1']; $data['m_exported_fabric']=$data['monthly_export_issue_fabric'] + $data['monthly_export_pack_fabric'] + $data['monthly_export_pack_fabric1']; $data['y_exported_fabric']=$data['year_export_issue_fabric'] + $data['year_export_pack_fabric'] + $data['year_export_pack_fabric1']; // ----------------------------- issue conumable and spares --------------- // $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='cs_addstock'; $where=array('created_at'=>$d1); $data['issue_cs']=$this->vendor_model->issue_fabric_count_amount_get_customerdata($table,$where); $data['monthly_issue_cs']=$this->vendor_model->monthly_issue_cs_dashboard_po_list_id($table,$m,$y); $data['year_issue_cs']=$this->vendor_model->year_issue_cs_dashboard_po_list_id($table,$y); // -------------------- issue fabric --------------------- $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='fabric_addstock'; $where=array('created_at'=>$d1); $data['issue_fabric']=$this->vendor_model->issue_fabric_count_amount_get_customerdata($table,$where); $data['monthly_issue_fabric']=$this->vendor_model->monthly_issue_fabric_dashboard_po_list_id($table,$m,$y); $data['year_issue_fabric']=$this->vendor_model->year_issue_fabric_dashboard_po_list_id($table,$y); // -------------------- sample request --------------------- $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='sample_request'; $where=array('created_date'=>$d1); $data['sample_request']=$this->vendor_model->count_amount_get_customerdata($table,$where); $data['monthly_sample_request']=$this->vendor_model->monthly_count_amount_get_customerdata($table,$m,$y); $data['year_sample_request']=$this->vendor_model->year_count_amount_get_customerdata($table,$y); // -------------------- weaving details --------------------- $d1=date('d-m-Y'); $table='issue_loom'; $where=array('created_at'=>$d1); $data['issue_loom']=$this->vendor_model->waving_no_count_amount_get_customerdata($table,$where); // -------------------- design weaving --------------------- $m=date('m'); $y=date('Y'); $s=array('status'=>0); $d1=date('d-m-Y'); $table='design_weave'; $where=array('created_date'=>$d1); $data['today_current_design_weaving']=$this->vendor_model->count_amount_get_customerdata($table,$where); $data['month_current_design_weaving']=$this->vendor_model->monthly_design_count_amount_get_customerdata1($table,$m,$y,$s); $data['year_current_design_weaving']=$this->vendor_model->year_design_count_amount_get_customerdata1($table,$y,$s); $m=date('m'); $y=date('Y'); $ss1=array('status'=>1); $d1=date('d-m-Y'); $table='design_weave'; $where=array('approved_date'=>$d1); $data['today_pending_design_weaving']=$this->vendor_model->count_amount_get_customerdata($table,$where); $data['month_pending_design_weaving']=$this->vendor_model->pending_monthly_design_count_amount_get_customerdata1($table,$m,$y,$ss1); $data['year_pending_design_weaving']=$this->vendor_model->pending_year_design_count_amount_get_customerdata1($table,$y,$ss1); $m=date('m'); $y=date('Y'); $ss2=array('status'=>2); $d1=date('d-m-Y'); $table='design_weave'; $where=array('finalized_date'=>$d1); $data['today_complete_design_weaving']=$this->vendor_model->count_amount_get_customerdata($table,$where); $data['month_complete_design_weaving']=$this->vendor_model->complete_monthly_design_count_amount_get_customerdata1($table,$m,$y,$ss2); $data['year_complete_design_weaving']=$this->vendor_model->complete_year_design_count_amount_get_customerdata1($table,$y,$ss2); // print_r($data['month_pending_design_weaving']); // die(); $data['today_design_weaving_count']=$data['today_current_design_weaving'] + $data['today_pending_design_weaving'] + $data['today_complete_design_weaving']; $data['month_design_weaving_count']=$data['month_current_design_weaving'] + $data['month_pending_design_weaving'] + $data['month_complete_design_weaving']; $data['year_design_weaving_count']=$data['year_current_design_weaving'] + $data['year_pending_design_weaving'] + $data['year_complete_design_weaving']; // -------------------- marketing --------------------- $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='sub_orders'; $where=array('created_date'=>$d1); $dd='DTL'; $data['marketing']=$this->vendor_model->marketing_dashboard_po_list_id($d1,$dd); $data['month_marketing']=$this->vendor_model->monthly_marketing_dashboard_po_list_id($table,$m,$y,$dd); $data['year_marketing']=$this->vendor_model->year_marketing_dashboard_po_list_id($table,$y,$dd); $d1=date('d-m-Y'); $table='sub_orders'; $where=array('created_date'=>$d1); $dd='SAM'; $data['sam_marketing']=$this->vendor_model->marketing_dashboard_po_list_id($d1,$dd); $data['sam_month_marketing']=$this->vendor_model->monthly_marketing_dashboard_po_list_id($table,$m,$y,$dd); $data['sam_year_marketing']=$this->vendor_model->year_marketing_dashboard_po_list_id($table,$y,$dd); $d1=date('d-m-Y'); $table='sub_orders'; $where=array('created_date'=>$d1); $dd='STK'; $data['stk_marketing']=$this->vendor_model->marketing_dashboard_po_list_id($d1,$dd); $data['stk_month_marketing']=$this->vendor_model->monthly_marketing_dashboard_po_list_id($table,$m,$y,$dd); $data['stk_year_marketing']=$this->vendor_model->year_marketing_dashboard_po_list_id($table,$y,$dd); $data['today_sam_stk']= $data['sam_marketing'] + $data['stk_marketing']; $data['month_sam_stk']= $data['sam_month_marketing'] + $data['stk_month_marketing']; $data['year_sam_stk']= $data['sam_year_marketing'] + $data['stk_year_marketing']; // -------------------- planning --------------------- $m=date('m'); $y=date('Y'); $o='Yes'; $a='inhouse'; $p='Pending'; $s='planned'; $d1=date('Y-m-d'); $data['planning2']=$this->vendor_model->marketing_planning_notification_get_details2($d1); $data['month_planning2']=$this->vendor_model->mponthly_planning_fetch_dashboard_po_list_id1($table,$m,$y,$o,$a,$p,$s); $data['year_planning2']=$this->vendor_model->yearly_planning_fetch_dashboard_po_list_id1($table,$m,$y,$o,$a,$p,$s); $m=date('m'); $y=date('Y'); $o='Yes'; $a='outsource'; $p='Pending'; $s='planned'; $d1=date('Y-m-d'); $data['planning1']=$this->vendor_model->marketing_planning_notification_get_details222($d1); $data['month_planning1']=$this->vendor_model->mponthly_planning_fetch_dashboard_po_list_id12($table,$m,$y,$o,$a,$p,$s); $data['year_planning1']=$this->vendor_model->yearly_planning_fetch_dashboard_po_list_id12($table,$m,$y,$o,$a,$p,$s); $data['planning']=$data['planning1'] + $data['planning2']; $data['month_planning']= $data['month_planning2'] + $data['month_planning1']; $data['year_planning']=$data['year_planning1'] + $data['year_planning2']; // -------------------- madeups --------------------- $m=date('m'); $y=date('Y'); $table = 'fabric_madeups'; $d1=date('d/m/Y'); $where = array('created_at'=>$d1); $data['fab_madeups1']= $this->vendor_model->fabric_madeups_dashboard_po_list_id($table,$where); $data['month_fab_madeups1']= $this->vendor_model->monthly_fabric_madeups_res_created_po_generate($table,$m,$y); $data['year_fab_madeups1']= $this->vendor_model->year_fabric_madeups_res_created_po_generate($table,$y); $table = 'planned_order'; $d1=date('d-m-Y'); $f='Yes'; $where = array('confirm'=>'yes','issue_approved_date'=>$d1); $data['fab_madeups2']= $this->vendor_model->fabric_no_madeups_plan_madeups_no_planned_details($d1); $data['month_fab_madeups2']= $this->vendor_model->monthly_madeups_res_res_dashboard_po_list_id($table,$m,$y,$f); $data['year_fab_madeups2']= $this->vendor_model->yearly_madeups_res_res_dashboard_po_list_id($table,$y,$f); $data['fab_madeups']=$data['fab_madeups1'] + $data['fab_madeups2']; $data['month_fab_madeups']=$data['month_fab_madeups1'] + $data['month_fab_madeups2']; $data['year_fab_madeups']=$data['year_fab_madeups1'] + $data['year_fab_madeups2']; $table = 'consumable_madeups'; $d1=date('d/m/Y'); $where = array('created_at'=>$d1); $data['fab_madeups11']= $this->vendor_model->fabric_madeups_dashboard_po_list_id($table,$where); $data['month_fab_madeups11']= $this->vendor_model->monthly_fabric_madeups_res_created_po_generate($table,$m,$y); $data['year_fab_madeups11']= $this->vendor_model->year_fabric_madeups_res_created_po_generate($table,$y); $table = 'planned_order'; $d1=date('d-m-Y'); $f='Yes'; $where = array('confirm'=>'yes','issue_approved_date'=>$d1); $data['fab_madeups22']= $this->vendor_model->fabric_no_con_madeups_plan_madeups_no_planned_details($d1); $data['month_fab_madeups22']= $this->vendor_model->monthly_con_madeups_res_res_dashboard_po_list_id($table,$m,$y,$f); $data['year_fab_madeups22']= $this->vendor_model->yearly_con_madeups_res_res_dashboard_po_list_id($table,$y,$f); $data['consum_madeups']=$data['fab_madeups11'] + $data['fab_madeups22']; $data['month_consum_madeups']=$data['month_fab_madeups11'] + $data['month_fab_madeups22']; $data['year_consum_madeups']=$data['year_fab_madeups11'] + $data['year_fab_madeups22']; // $table = 'consumable_madeups'; // $d1=date('d/m/Y'); // $where = array('created_at'=>$d1); // $data['consum_madeups']= $this->vendor_model->fabric_madeups_dashboard_po_list_id($table,$where); // $m=date('m'); // $y=date('Y'); // $f='No'; // $data['pen_list']=$this->vendor_model->monthly_con_madeups_res_dashboard_po_list_id($table,$m,$y,$f); // // $fs='Yes'; // $data['app_list']=$this->vendor_model->monthly_con_madeups_res_dashboard_po_list_id($table,$m,$y,$fs); // $data['month_consum_madeups']=$data['pen_list'] + $data['app_list']; // $m=date('m'); // $y=date('Y'); // $f='No'; // $data['pen_list1']=$this->vendor_model->yearly_con_madeups_res_dashboard_po_list_id($table,$y,$f); // $fs='Yes'; // $data['app_list1']=$this->vendor_model->yearly_con_madeups_res_dashboard_po_list_id($table,$y,$fs); // $data['year_consum_madeups']=$data['pen_list1'] + $data['app_list1']; // print_r($data['month_consum_madeups']); // die(); // print_r($data['consum_madeups']); // print_r('--------------'); // print_r($data['month_consum_madeups']); // print_r('-----------------'); // print_r($data['year_consum_madeups']); // die(); $table = 'fabric_madeups_delivery_confirmation'; $d1=date('d/m/Y'); $where = array('rec_date'=>$d1); $data['fab_del_madeups']= $this->vendor_model->fabric_del_madeups_dashboard_po_list_id($table,$where); $data['month_fab_del_madeups']= $this->vendor_model->deliver_monthly_consumable_madeups_res_created_po_generate($table,$m,$y); $data['year_fab_del_madeups']= $this->vendor_model->deliver_year_consumable_madeups_res_created_po_generate($table,$y); $d=date('d/m/Y'); $t='No'; $data['fab_del_madeups']=$this->vendor_model->fabric_delivery_planned_madeups_no_res_planned_details1($d,$t); $table='indent_po'; $where=array('confirm'=>'No'); $f='No'; $data['month_fab_del_madeups']=$this->vendor_model->mponthly_madeups_result_fetch_delievry_dashboard_po_list_id1($table,$m,$y,$f); $table='indent_po'; $f='No'; $data['year_fab_del_madeups']=$this->vendor_model->yearly_madeups_result_fetch_delievry_dashboard_po_list_id1($table,$y,$f); // $data['made_ups']=$data['fab_madeups'] + $data['consum_madeups']; // -------------------- packing --------------------- $m=date('m'); $y=date('Y'); $d=date('d-m-Y'); $d2=date('d/m/Y'); $table='packing_list_data'; $where=array('created_at'=>$d); $where1=array('created_at'=>$d2); $data['package_insert_rows']=$this->vendor_model->packing_count_amount_get_customerdata($table,$where,$where1); $data['montly_packing']=$this->vendor_model->monthly_packing_created_po_generate($table,$m,$y); $data['year_packing']=$this->vendor_model->year_packing_created_po_generate($table,$y); $d=date('d/m/Y'); $table='madeups_list_data'; $where=array('created_at'=>$d); $data['package_madeups']=$this->vendor_model->count_amount_get_customerdata($table,$where); $data['montly_packing_madeups']=$this->vendor_model->monthly_packing_madeups_created_po_generate($table,$m,$y); $data['year_packing_madeups']=$this->vendor_model->year_packing_madeups_created_po_generate($table,$y); // -------------------- stock transfer --------------------- $m=date('m'); $y=date('Y'); $d=date('d-m-Y'); $table='fabric_transfer'; $where=array('transfer_date'=>$d); $data['today_fabric_stoct_transfer_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_fabric_stoct_transfer_rows']=$this->vendor_model->monthly_stock_transfer_res_dashboard_po_list_id($table,$m,$y); $data['year_fabric_stoct_transfer_rows']=$this->vendor_model->yearly_stock_transfer_res_dashboard_po_list_id($table,$y); $d=date('d-m-Y'); $table='fabric_transfer'; $where=array('rec_date'=>$d); $data['today_fabric_stoct_rec_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_fabric_stoct_rec_rows']=$this->vendor_model->monthly_stock_rec_res_dashboard_po_list_id($table,$m,$y); $data['year_fabric_stoct_rec_rows']=$this->vendor_model->yearly_stock_rec_res_dashboard_po_list_id($table,$y); $d=date('d-m-Y'); $table='cs_transfer'; $p='Consumables'; $where=array('transfer_date'=>$d,'product_type'=>'Consumables'); $data['today_c_stoct_transfer_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_c_stoct_transfer_rows']=$this->vendor_model->monthly_stock_transfer_cs_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_c_stoct_transfer_rows']=$this->vendor_model->yearly_stock_transfer_cs_res_dashboard_po_list_id($table,$y,$p); $d=date('d-m-Y'); $table='cs_transfer'; $p='Consumables'; $where=array('rec_date'=>$d,'product_type'=>'Consumables'); $data['today_c_stoct_rec_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_c_stoct_rec_rows']=$this->vendor_model->monthly_stock_rec_cs_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_c_stoct_rec_rows']=$this->vendor_model->yearly_stock_rec_cs_res_dashboard_po_list_id($table,$y,$p); $d=date('d-m-Y'); $table='cs_transfer'; $p='Spares'; $where=array('transfer_date'=>$d,'product_type'=>'Spares'); $data['today_s_stoct_transfer_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_s_stoct_transfer_rows']=$this->vendor_model->monthly_stock_transfer_cs_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_s_stoct_transfer_rows']=$this->vendor_model->yearly_stock_transfer_cs_res_dashboard_po_list_id($table,$y,$p); $d=date('d-m-Y'); $table='cs_transfer'; $p='Spares'; $where=array('rec_date'=>$d,'product_type'=>'Spares'); $data['today_s_stoct_rec_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_s_stoct_rec_rows']=$this->vendor_model->monthly_stock_rec_cs_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_s_stoct_rec_rows']=$this->vendor_model->yearly_stock_rec_cs_res_dashboard_po_list_id($table,$y,$p); // ---------- raw -----------------// $d=date('d-m-Y'); $table='yarn_transfer'; $p='Yarn - Raw'; $where=array('transfer_date'=>$d,'product_type'=>'Yarn - Raw'); $data['stoct_transfer_raw_rows2']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_fabric_stoct_transfer_raw_rows']=$this->vendor_model->monthly_stock_transfer_yarn_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_fabric_stoct_transfer_raw_rows']=$this->vendor_model->yearly_stock_transfer_yarn_res_dashboard_po_list_id($table,$y,$p); $d=date('d-m-Y'); $table='yarn_transfer'; $p='Yarn - Raw'; $where=array('rec_date'=>$d,'product_type'=>'Yarn - Raw'); $data['today_s_stoct_rec_raw_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_s_stoct_rec_raw_rows']=$this->vendor_model->monthly_stock_rec_stock_yarn_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_s_stoct_rec_raw_rows']=$this->vendor_model->yearly_stock_rec_stock_yarn_res_dashboard_po_list_id($table,$y,$p); // ---------- twist -----------------// $d=date('d-m-Y'); $table='yarn_transfer'; $p='Yarn - Twisted'; $where=array('transfer_date'=>$d,'product_type'=>'Yarn - Twisted'); $data['stoct_transfer_twist_rows2']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_fabric_stoct_transfer_twist_rows']=$this->vendor_model->monthly_stock_transfer_yarn_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_fabric_stoct_transfer_twist_rows']=$this->vendor_model->yearly_stock_transfer_yarn_res_dashboard_po_list_id($table,$y,$p); $d=date('d-m-Y'); $table='yarn_transfer'; $p='Yarn - Twisted'; $where=array('rec_date'=>$d,'product_type'=>'Yarn - Twisted'); $data['today_s_stoct_rec_twist_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_s_stoct_rec_twist_rows']=$this->vendor_model->monthly_stock_rec_stock_yarn_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_s_stoct_rec_twsit_rows']=$this->vendor_model->yearly_stock_rec_stock_yarn_res_dashboard_po_list_id($table,$y,$p); // ---------- dyed -----------------// $d=date('d-m-Y'); $table='yarn_transfer'; $p='Yarn - Dyed'; $where=array('transfer_date'=>$d,'product_type'=>'Yarn - Dyed'); $data['stoct_transfer_dyed_rows2']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_fabric_stoct_transfer_dyed_rows']=$this->vendor_model->monthly_stock_transfer_yarn_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_fabric_stoct_transfer_dyed_rows']=$this->vendor_model->yearly_stock_transfer_yarn_res_dashboard_po_list_id($table,$y,$p); $d=date('d-m-Y'); $table='yarn_transfer'; $p='Yarn - Dyed'; $where=array('rec_date'=>$d,'product_type'=>'Yarn - Dyed'); $data['today_s_stoct_rec_dyed_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_s_stoct_rec_dyed_rows']=$this->vendor_model->monthly_stock_rec_stock_yarn_res_dashboard_po_list_id($table,$m,$y,$p); $data['year_s_stoct_rec_dyed_rows']=$this->vendor_model->yearly_stock_rec_stock_yarn_res_dashboard_po_list_id($table,$y,$p); // ---------- swan -----------------// $d=date('d-m-Y'); $table='swan_yarn_transfer'; $where=array('transfer_date'=>$d); $data['stoct_transfer_swan_rows1']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_fabric_stoct_transfer_swan_rows']=$this->vendor_model->monthly_stock_rec_swan_result_dashboard_po_list_id($table,$m,$y); $data['year_fabric_stoct_transfer_swan_rows']=$this->vendor_model->yearly_stock_rec_swan_result_dashboard_po_list_id($table,$y); $d=date('d-m-Y'); $table='yarn_transfer'; $where=array('rec_date'=>$d); $data['today_s_stoct_rec_swan_rows']=$this->vendor_model->stock_transfer_count_amount_notification_get_customerdata($table,$where); $data['monthly_s_stoct_rec_swan_rows']=$this->vendor_model->monthly_stock_rec_result_swan_yarn_dashboard_po_list_id($table,$m,$y); $data['year_s_stoct_rec_swan_rows']=$this->vendor_model->yearly_stock_rec_result_swan_yarn_dashboard_po_list_id($table,$y); // ------------------------------- create work order -------------------------------------- $m=date('m'); $y=date('Y'); $d=date('d-m-Y'); $table='create_materialissue_work_order'; $where=array('created_at'=>$d); $data['today_twisting_wo']=$this->vendor_model->work_order_count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['month_twisting_wo']=$this->vendor_model->swan_monthly_create_twiusting_result_swan_yarn_dashboard_po_list_id1($table,$m,$y); $data['year_twisting_wo']=$this->vendor_model->swan_yearly_create_twiusting_result_swan_yarn_dashboard_po_list_id1($table,$y); $d=date('d-m-Y'); $table='workorder_dyeing_material'; $where=array('created_at'=>$d); $data['dyeing_wo']=$this->vendor_model->dyeing_work_order_count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['month_dyeing_wo']=$this->vendor_model->dye_swan_monthly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$m,$y); $data['year_dyeing_wo']=$this->vendor_model->dye_swan_yearly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$y); $d=date('d-m-Y'); $table='finishing_embroidry'; $where=array('created_at'=>$d); $data['fabric_emb_wo']=$this->vendor_model->work_order_count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['month_fab_wo']=$this->vendor_model->swan_monthly_create_fab_result_swan_yarn_dashboard_po_list_id1($table,$m,$y); $data['year_fab_wo']=$this->vendor_model->swan_yearly_create_fab_result_swan_yarn_dashboard_po_list_id1($table,$y); // ------------------------------- delivery work order -------------------------------------- $m=date('m'); $y=date('Y'); $d=date('d-m-Y'); $table='work_order_twisting'; $where=array('rec_date'=>$d); $data['today_work_order_delivery_twisting_finishing']=$this->vendor_model->count_amount_work_order_delivery_twisting_get_customerdata($table,$where); $data['monthly_work_order_delivery_twisting_finishing']=$this->vendor_model->delivery_twist_swan_monthly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$m,$y); $data['yearly_work_order_delivery_twisting_finishing']=$this->vendor_model->delivery_twist_swan_yearly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$y); $d=date('d-m-Y'); $table='weaving_factory_stock'; $where=array('rec_date'=>$d); $data['work_order_delivery_weaving_finishing']=$this->vendor_model->count_amount_work_order_delivery_weaving_fabric_get_customerdata($table,$where); $data['monthly_work_order_delivery_weaving_finishing']=$this->vendor_model->delivery_weaving_swan_monthly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$m,$y); $data['yearly_work_order_delivery_weaving_finishing']=$this->vendor_model->delivery_weaving_swan_yearly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$y); $d=date('d-m-Y'); $table='work_order_dyeing'; $where=array('rec_date'=>$d); $data['work_order_delivery_dyeing_finishing']=$this->vendor_model->count_amount_work_order_delivery_dyed_get_customerdata($table,$where); $data['monthly_work_order_delivery_dyeing_finishing']=$this->vendor_model->delivery_dyed_swan_monthly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$m,$y); $data['yearly_work_order_delivery_dyeing_finishing']=$this->vendor_model->delivery_dyed_swan_yearly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$y); $d=date('d/m/Y'); $table='finishing_embroidry_stock'; $where=array('received_date'=>$d); $data['work_order_delivery_finishing_finishing']=$this->vendor_model->count_amount_work_order_delivery_fabric_finishing_emp_get_customerdata($table,$where); $data['monthly_work_order_delivery_finishing_finishing']=$this->vendor_model->delivery_fabric_swan_monthly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$m,$y); $data['yearly_work_order_delivery_finishing_finishing']=$this->vendor_model->delivery_fabric_swan_yearly_create_dyeing_result_swan_yarn_dashboard_po_list_id1($table,$y); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $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('yarn_master/dashboard_date_wise',$data); $this->load->view('templates/db_check'); } 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 issue_loom_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 ---------------------------------> $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($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { if($date_wise_data->module_status == 'old') { $where=array('issued_date'=>$d); } else { $table='issue_loom'; $where=array('issued_date'=>$d,'insert_notification_status'=>0); } $table='issue_loom'; $data['issue_loom_insert_rows']=$this->vendor_model->get_where_dataa($table,$where); $issue_loom_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $table='issue_loom'; if($date_wise_data->module_status == 'old') { $where=array('rements_approved_date'=>$d); } else { $where=array('rements_approved_date'=>$d,'update_notification_status'=>0); } $data['issue_loom_update_rows']=$this->vendor_model->get_where_dataa($table,$where); $issue_loom_update_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $table='weaving_panel_planning_order'; if($date_wise_data->module_status == 'old') { $where=array('issue_approved_date'=>$d); } else { $where=array('issue_approved_date'=>$d,'approval_notification_status'=>0); } $data['issue_loom_approval_rows']=$this->vendor_model->get_where_dataa($table,$where); $issue_loom_approval_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); // print_r($data['issue_loom_insert_rows']); // print_r('--------------------------------------'); // print_r($data['issue_loom_approval_rows']); // die(); } else { $issue_loom_approval_rows1=0; $issue_loom_insert_rows1=0; $issue_loom_update_rows1=0; } $data['total_issue_loom_notifications1'] = $issue_loom_approval_rows1 + $issue_loom_insert_rows1 + $issue_loom_update_rows1; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['page_static']='issue_loom'; $data['user_type_id'] = $this->access_id(); $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_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; $to_d=$date_wise_data->to_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->indent_po_get_colunot($d,$to_d); $data['yarn_delivery_insert_rows']=$this->vendor_model->indent_po_rows_colucnot($d,$to_d); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d); $data['cs_delivery_inserted_rows1']=$this->vendor_model->indent_cs_get_colunot($d,$to_d); $data['cs_delivery_insert_rows1']=$this->vendor_model->indent_cs_rows_colucnot($d,$to_d); $newDate = date("d/m/Y", strtotime($d)); $newDate1 = date("d/m/Y", strtotime($to_d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate); $data['cs_delivery_inserted_rows']=$this->vendor_model->indent_cs_date_wise_get_colunot($newDate,$newDate1); $data['cs_delivery_insert_rows']=$this->vendor_model->indent_cs_date_wise_rows_colucnot($newDate,$newDate1); $input=$newDate; $input1=$newDate1; $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); $datee1 = explode('/', $input1); $day1 = $datee1[0]; $month1 = $datee1[1]; $year1 = $datee1[2]; $rre=substr($month1, 0, 1); $rre1=substr($month1, 1, 2); $rrre=substr($day1, 0, 1); $rrre1=substr($day1, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $t12=$rrre1 . '/' . $rre1 . '/' . $year1; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->indent_goods_date_wise_get_colunot($t1,$t12); $data['fabric_delivery_insert_rows']=$this->vendor_model->indent_goods_date_wise_rows_colucnot($t1,$t12); $t2=$day . '/' . $rr1 . '/' . $year; $t21=$day1 . '/' . $rre1 . '/' . $year1; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->indent_goods_date_wise_get_colunot($t2,$t21); $data['fabric_delivery_insert_rows2']=$this->vendor_model->indent_goods_date_wise_rows_colucnot($t2,$t21); $t3=$rrr1 . '/' . $month . '/' . $year; $t31=$rrre1 . '/' . $month1 . '/' . $year1; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->indent_goods_date_wise_get_colunot($t3,$t31); $data['fabric_delivery_insert_rows3']=$this->vendor_model->indent_goods_date_wise_rows_colucnot($t3,$t31); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->indent_goods_date_wise_get_colunot($input,$input1); $data['fabric_delivery_insert_rows4']=$this->vendor_model->indent_goods_date_wise_rows_colucnot($input,$input1); } 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();notifications'];$data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $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('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; $to_d=$date_wise_data->to_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->get_fabric_inspection_master_import_snot($d,$to_d); $data['fabric_inspection_rows']=$this->vendor_model->get_fabric_inspection_master_rows_import_snot($d,$to_d); } 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();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 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 split_stock_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 ---------------------------------> $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); $rr=$date_wise_data->req_date; $rd=$date_wise_data->to_date; $d=date('d/m/Y',strtotime($rr)); $to_d=date('d/m/Y',strtotime($rd)); //$d=date('d-m-Y'); if($date_wise_data->module_status == 'old') { $where=array('rec_date'=>$d,'split_noti'=>'Yes'); $table='fabric_madeups_delivery_confirmation'; $data['split_madeups_stock_count']=$this->vendor_model->get_from_to_split_stock_unot($d,$to_d); $data['madeups_stock_res']=$this->vendor_model->get_from_to_split_stock_unot_res($d,$to_d); } else { $where=array('rec_date'=>$d,'insert_notification_status'=>0,'split_noti'=>'Yes'); $table='fabric_madeups_delivery_confirmation'; $data['split_madeups_stock_count']=$this->vendor_model->count_amount_get_customerdata($table,$where); $data['madeups_stock_res']=$this->vendor_model->get_where_dataa($table,$where); } if($date_wise_data->module_status == 'old') { $where=array('received_date'=>$d,'split_noti'=>'Yes'); $table='fabric_inspection_details'; $data['split_fabric_stock_count']=$this->vendor_model->get_from_to_splits_stock_unot($d,$to_d); $data['fabric_stock_res']=$this->vendor_model->get_from_to_splits_stock_unot_res($d,$to_d); } else { $where=array('received_date'=>$d,'insert_notification_status'=>0,'split_noti'=>'Yes'); $table='fabric_inspection_details'; $data['split_fabric_stock_count']=$this->vendor_model->count_amount_get_customerdata($table,$where); $data['fabric_stock_res']=$this->vendor_model->fabric_inspection_splits_count_res_amount_get_customerdata($table,$d); } $data['total_split_stock_notifications1']=$data['split_madeups_stock_count'] + $data['split_fabric_stock_count']; $data['total_split_notifications']=$this->split_page_notifications(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['page_static']='splited'; $data['user_type_id'] = $this->access_id(); $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'); } ///////////////////// 22-11-2018 /////////////////////////////// public function preview_quality() { //$data['check_specification'] = $this->yarn_model->check_spec_exists(); $edit_id=$this->input->post('edit_id'); $where=array('id'=>$edit_id); $table='import_yarn'; $data['result'] = $this->yarn_model->fetch_main_data($table,$where); $table='yarn_stage'; $where=array('yarnID'=>$edit_id); $data['result1'] = $this->yarn_model->fetch_where_data($table,$where); $data['result2'] = $this->yarn_model->fetch_where_data($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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(); $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); $tablename='yarn_quality_names'; $data['yarn_qua_details'] = $this->yarn_model->getpdfdata($tablename); $data['access'] = $this->access_details(); $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('import_module/preview_quality', $data); $this->load->view('templates/footer_inside'); } public function database_backup() { $tables = false; $backup_name = false; $mysqli = new mysqli('localhost', 'decotextil', 'Deco1236', 'decotextil_new'); $name='decotextil'; $mysqli->select_db($name); $mysqli->query("SET NAMES 'utf8'"); $queryTables = $mysqli->query('SHOW TABLES'); while ($row = $queryTables->fetch_row()) { $target_tables[] = $row[0]; } if ($tables !== false) { $target_tables = array_intersect($target_tables, $tables); } $content = "SET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\r\nSET AUTOCOMMIT = 0;\r\nSTART TRANSACTION;\r\nSET time_zone = \"+00:00\";\r\n\r\n\r\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\r\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\r\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\r\n/*!40101 SET NAMES utf8mb4 */;\r\n--Database: `" . $name . "`\r\n\r\n\r\n"; foreach ($target_tables as $table) { $result = $mysqli->query('SELECT * FROM ' . $table); $fields_amount = $result->field_count; $rows_num = $mysqli->affected_rows; $res = $mysqli->query('SHOW CREATE TABLE ' . $table); $TableMLine = $res->fetch_row(); $content .= "\n\n" . $TableMLine[1] . ";\n\n"; for ($i = 0, $st_counter = 0; $i < $fields_amount; $i++, $st_counter = 0) { while ($row = $result->fetch_row()) { //when started (and every after 100 command cycle): if ($st_counter % 100 == 0 || $st_counter == 0) { $content .= "\nINSERT INTO " . $table . " VALUES"; } $content .= "\n("; for ($j = 0; $j < $fields_amount; $j++) { $row[$j] = str_replace("\n", "\\n", addslashes($row[$j])); if (isset($row[$j])) { $content .= '"' . $row[$j] . '"'; } else { $content .= '""'; } if ($j < ($fields_amount - 1)) { $content.= ','; } } $content .=")"; //every after 100 command cycle [or at last line] ....p.s. but should be inserted 1 cycle eariler if ((($st_counter + 1) % 100 == 0 && $st_counter != 0) || $st_counter + 1 == $rows_num) { $content .= ";"; } else { $content .= ","; } $st_counter = $st_counter + 1; } } $content .="\n\n\n"; } $content .= "\r\n\r\n/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\r\n/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\r\n/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;"; $backup_name = $backup_name ? $backup_name : $name . "_(" . date('H-i-s') . "_" . date('d-m-Y') . ")" . ".sql"; header('Content-Type: application/octet-stream'); header("Content-Transfer-Encoding: Binary"); header("Content-disposition: attachment; filename=\"" . $backup_name . "\""); echo $content; exit; } /////////////////////// 28-12-2018 //////////////////////// public function current_month_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); $RT = 'marketing/transactions_order_details?prop_id=1'; if($RT == 'marketing/transactions_order_details?prop_id=1') { $data['url_val']='1'; $data['val']='marketing/transactions_order_details?prop_id=1'; $data['ref']='indent'; } else if($RT == 'marketing/transactions_order_details?prop_id=2') { $data['val']='marketing/transactions_order_details?prop_id=1'; $data['url_val']='2'; $data['ref']='today_dashboard'; } else if($RT == 'marketing/transactions_order_details?prop_id=3') { $data['url_val']='3'; $data['val']='marketing/transactions_order_details?prop_id=1'; $data['ref']='month_dashboard'; } else if($RT == 'marketing/transactions_order_details?prop_id=4') { $data['url_val']='4'; $data['val']='marketing/transactions_order_details?prop_id=1'; $data['ref']='year_dashboard'; } $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('marketing/transactions_order_details?prop_id=1' == $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-------------------- $data['getalldata'] = $this->marketing_model->display_transaction_data(); //echo '<pre>';print_R($data['getalldata']);exit; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $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['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('dashboard/current_month_delivery_list', $data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function getcurrent_month_details() { $get = $this->uri->segment(3); $fromdate=$this->input->get('fromdate'); $enddate=$this->input->get('enddate'); // $get = $this->uri->segment(3); // preg_match_all('/([0-9]+|[a-zA-Z]+)/',$get,$matches); // foreach($matches as $mm) // { // $m=$mm[1]; // } // // $m=date('m'); // $y=date('Y'); // $d1=date('d-m-Y'); $table='sub_orders'; // $where=array('created_date'=>$d1); $dd='DTL'; $getalldata=$this->vendor_model->monthly_current_month_delievry_osl_list($table,$fromdate,$enddate,$dd); echo json_encode($getalldata); } public function pending_order_list_details() { $get = $this->uri->segment(3); $table = 'sub_orders'; $dd = 'DTL'; $getalldata = $this->vendor_model->pending_order_list_details($table, $dd); echo json_encode($getalldata); } public function completed_order_list_details() { $get = $this->uri->segment(3); $table='sub_orders'; $dd='DTL'; $getalldata=$this->vendor_model->completed_order_list_details($table,$dd); echo json_encode($getalldata); } public function notification_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['getall']=$this->marketing_model->display_user_managment(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_split_notifications']=$this->split_page_notifications(); $data['inward_purchases_notifications']= $this->inward_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['inward_purchases_notifications']= $this->inward_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['issue_loom_notifications']= $this->issue_loom_page_notifications(); $data['issue_loom_notifications']= $this->issue_loom_page_notifications(); $data['total_rows_notifications']=$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']; $this->load->view('templates/header_inside',$data); $this->load->view('templates/notification_details',$data); $this->load->view('templates/footer_inside'); } function logout_function() { $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=array('chat_online'=>'offline'); $this->vendor_model->update_data($where,$table,$data); } }