From 617e139bcfd4191b6d224a88f29f03d4afff324e Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Tue, 24 Apr 2018 19:23:04 +0530 Subject: [PATCH] resinbatchcard changes --- application/controllers/resinbatchcard.php | 72 ++- application/models/quality_model.php | 12 +- application/views/editresinbatchcard.php | 506 ++++++++++++++++-- application/views/newresinbatchcard.php | 409 +++++++++++--- .../views/resinbatchcardreportlist.php | 8 +- 5 files changed, 878 insertions(+), 129 deletions(-) diff --git a/application/controllers/resinbatchcard.php b/application/controllers/resinbatchcard.php index b671351e..02109e0c 100644 --- a/application/controllers/resinbatchcard.php +++ b/application/controllers/resinbatchcard.php @@ -64,7 +64,7 @@ class resinbatchcard extends BaseController function saveTestReportData() { - + //echo "system soft"; date_default_timezone_get('Asia/Kolkata'); $productid = $this->input->post('param1'); @@ -89,6 +89,14 @@ class resinbatchcard extends BaseController $resinname = $this->input->post('param13'); $oplist = $this->input->post('param14'); $oplist = json_decode($oplist); + $operator = $this->input->post('param15'); + $sandigrnos = $this->input->post('param16'); + $Resinigrnos = $this->input->post('param17'); + $Hexamineigrnos = $this->input->post('param18'); + $CSigrnos = $this->input->post('param19'); + $Catalystigrno = $this->input->post('param20'); + $bagsigrnos = $this->input->post('param21'); + $tonigrnos= $this->input->post('param22'); if(!empty($_FILES['rfile']['name'])) @@ -122,9 +130,41 @@ class resinbatchcard extends BaseController } } - $masterreportdata = array('productid'=>$productid,'customerid'=>$customerid,'batchdate'=>$batchdate,'plantname'=>$plantname,'resinname'=>$resinname,'machinecode'=>$macinecode,'trpbatchcardno'=>$trpbatchcard,'igrno'=>$igrnos,'igrlineno'=>$igrlinenos,'remarks'=>$remarks,'createdby'=>$createby,'approvedby'=>$approvedby,'document'=>$document,'sandtotal'=>$sandtotal,'resintotal'=>$resintotal,'hextotal'=>$hextotal,'cstotal'=>$cstotal,'catalysttotal'=>$catalysttotal,'bags50total'=>$bags50total,'ton1bagstotal'=>$ton1bagstotal,'producitonloss'=>$producitonloss,'finishedproduct'=>$finishedproduct); - + $masterreportdata = array('productid'=>$productid, + 'customerid'=>$customerid, + 'batchdate'=>$batchdate, + 'plantname'=>$plantname, + 'resinname'=>$resinname, + 'machinecode'=>$macinecode, + 'trpbatchcardno'=>$trpbatchcard, + 'igrno'=>$igrnos, + 'igrlineno'=>$igrlinenos, + 'remarks'=>$remarks, + 'createdby'=>$createby, + 'approvedby'=>$approvedby, + 'document'=>$document, + 'sandtotal'=>$sandtotal, + 'resintotal'=>$resintotal, + 'hextotal'=>$hextotal, + 'cstotal'=>$cstotal, + 'catalysttotal'=>$catalysttotal, + 'bags50total'=>$bags50total, + 'ton1bagstotal'=>$ton1bagstotal, + 'producitonloss'=>$producitonloss, + 'finishedproduct'=>$finishedproduct, + 'operatedby'=>$operator, + 'igrno_for_sand'=>$sandigrnos, + 'igrno_for_resin'=>$Resinigrnos, + 'igrno_for_haxamine'=>$Hexamineigrnos, + 'igrno_for_cs'=>$CSigrnos, + 'igrno_for_catalyst'=>$Catalystigrno, + 'igrno_for_bags'=>$bagsigrnos, + 'igrno_for_tonbags'=>$tonigrnos + ); + + // print_r($masterreportdata); + // die(); $MASTERID = $this->quality_model->saveResinBatchCardMasterTestData($masterreportdata); // echo $MASTERID;die(); //$MASTERID = 56; @@ -170,7 +210,6 @@ class resinbatchcard extends BaseController $trpbatchcard = $this->input->post('param6'); $igrnos = $this->input->post('param7'); $igrlinenos = $this->input->post('param8'); - $remarks = $this->input->post('param9'); $approvedby = $this->input->post('param10'); @@ -183,6 +222,14 @@ class resinbatchcard extends BaseController $MASTERID = $this->input->post('param14'); $opstoinsert = $this->input->post('param15'); $opstodelete = $this->input->post('param16'); + $operatedby = $this->input->post('param17'); + $sandigrnos = $this->input->post('param18'); + $Resinigrnos = $this->input->post('param19'); + $Hexamineigrnos = $this->input->post('param20'); + $CSigrnos = $this->input->post('param21'); + $Catalystigrno = $this->input->post('param22'); + $bagsigrnos = $this->input->post('param23'); + $tonigrnos= $this->input->post('param24'); $opstoinsert = json_decode($opstoinsert); $opstodelete = json_decode($opstodelete); @@ -232,7 +279,14 @@ class resinbatchcard extends BaseController } } - $masterreportdata = array('remarks'=>$remarks,'updatedby'=>$createby,'approvedby'=>$approvedby,'document'=>$document,'sandtotal'=>$sandtotal,'resintotal'=>$resintotal,'hextotal'=>$hextotal,'cstotal'=>$cstotal,'catalysttotal'=>$catalysttotal,'bags50total'=>$bags50total,'ton1bagstotal'=>$ton1bagstotal,'producitonloss'=>$producitonloss,'finishedproduct'=>$finishedproduct); + $masterreportdata = array('remarks'=>$remarks,'updatedby'=>$createby,'approvedby'=>$approvedby,'document'=>$document,'sandtotal'=>$sandtotal,'resintotal'=>$resintotal,'hextotal'=>$hextotal,'cstotal'=>$cstotal,'catalysttotal'=>$catalysttotal,'bags50total'=>$bags50total,'ton1bagstotal'=>$ton1bagstotal,'producitonloss'=>$producitonloss,'finishedproduct'=>$finishedproduct,'operatedby'=>$operatedby, + 'igrno_for_sand'=>$sandigrnos, + 'igrno_for_resin'=>$Resinigrnos, + 'igrno_for_haxamine'=>$Hexamineigrnos, + 'igrno_for_cs'=>$CSigrnos, + 'igrno_for_catalyst'=>$Catalystigrno, + 'igrno_for_bags'=>$bagsigrnos, + 'igrno_for_tonbags'=>$tonigrnos); //print_r($masterreportdata); $this->quality_model->updateResinBatchCardMasterTestData($masterreportdata,$MASTERID); @@ -366,6 +420,10 @@ class resinbatchcard extends BaseController $data['emplist'] = $this->quality_model->getEmplistforReport(); $data['records'] = $this->quality_model->getResinBatchCardDetails($rbcid); //print_r($data['records']); + $data['machinelist'] = $this->quality_model->getMachineList(); + $data['igrno'] = $this->quality_model->getIGRNos(); + $data['igrlineitem'] = $this->quality_model->getIGRItemNos(); + $data['trpbatchcardnos'] = $this->quality_model->getTRPBatchcardNos(); $data['operatorslist'] = $this->quality_model->getOperatorsListforReport(); $data['existoperatorslist'] = $this->quality_model->getExistOperatorsListforReport($rbcid); //print_r($data['records']);die(); @@ -379,10 +437,6 @@ class resinbatchcard extends BaseController function printResinBatchReport() { - - - - $rbcid = $this->uri->segment(3); $data['records'] = $this->quality_model->getResinBatchCardDetails($rbcid); //print_r( $data['records']); diff --git a/application/models/quality_model.php b/application/models/quality_model.php index 41ba6492..9c00fff1 100755 --- a/application/models/quality_model.php +++ b/application/models/quality_model.php @@ -310,11 +310,13 @@ class Quality_model extends CI_Model function getResinBatchCardTestMasterList() { - $sql = 'Select resinbatch_id,productid,ip_products.product_name,ip_products.product_description,customerid,client_name,batchdate,igrno,igrlineno,T_ResinBatchCard_Master.createdby,approvedby,document,T_Employee_Details.FirstName from T_ResinBatchCard_Master + $sql = 'Select resinbatch_id,productid,ip_products.product_name,ip_products.product_description,customerid,client_name,batchdate,igrno,igrlineno,operatedby,T_ResinBatchCard_Master.createdby,approvedby,document,ED.FirstName from T_ResinBatchCard_Master join ip_products on T_ResinBatchCard_Master.productid=ip_products.product_id join ip_clients on T_ResinBatchCard_Master.customerid=ip_clients.client_id join tbl_users on T_ResinBatchCard_Master.createdby = tbl_users.userId - join T_Employee_Details on T_Employee_Details.EmpID = tbl_users.EmpID'; + join T_Employee_Details ED on ED.EmpID = T_ResinBatchCard_Master.operatedby + join T_Employee_Details EmpDtl on EmpDtl.EmpID = tbl_users.EmpID'; + $res = $this->db->query($sql); return $res->result(); } @@ -576,6 +578,12 @@ class Quality_model extends CI_Model $res = $this->db->query($sql); return $res->result(); } + function getIGRItemNos() + { + $sql = 'select IGRItemNo from T_IGR_Details order by IGRItemNo desc'; + $res = $this->db->query($sql); + return $res->result(); + } } ?> \ No newline at end of file diff --git a/application/views/editresinbatchcard.php b/application/views/editresinbatchcard.php index 1b988e77..03f7fcd9 100644 --- a/application/views/editresinbatchcard.php +++ b/application/views/editresinbatchcard.php @@ -24,18 +24,47 @@ background-color:#ada5d2 ; 'Select Employee'); -foreach($operatorslist as $re) -{ - - $operators[$re->EmpID] = $re->EmpID.'-'.$re->FirstName.'-'.$re->LastName; -} +$newoperator = array(-1 => 'Select Operator'); + foreach($operatorslist as $re) + { + $operators[$re->EmpID] = $re->EmpID.'-'.$re->FirstName.'-'.$re->LastName; + $newoperator[$re->EmpID] = $re->EmpID.'-'.$re->FirstName.'-'.$re->LastName; + } $approvedby = array(-1=>'Select Approver Name'); -foreach($emplist as $r) + foreach($emplist as $r) + { + $approvedby[$r->FirstName.' '.$r->LastName] = $r->FirstName.' '.$r->LastName.'-'.$r->shortName; + } +$machines = array(-1=>'Select Machine Name'); + + foreach($machinelist as $r) + { + $machines[$r->Machine_Code] = $r->Machine_Code.'-'.$r->Machine_Name; + } + +$igrnos = array(-1=>'Select IGRNO'); +$igrlinenos = array(-1=>'Select IGR Line Item'); +foreach($igrlineitem as $igrline) { - $approvedby[$r->FirstName.' '.$r->LastName] = $r->FirstName.' '.$r->LastName.'-'.$r->shortName; + $igrlinenos[$igrline->IGRItemNo] = $igrline->IGRItemNo; +} + foreach($igrno as $r) + { + $igrnos[$r->IGRNO] = $r->IGRNO; + } +$trpbatchnos = array(-1=>'Select TRP Batch Card No'); +foreach($trpbatchcardnos as $r) +{ + $trpbatchnos[$r->dailyid] = $r->dailyid; } - +// echo $records['masterdata'][0]->igrno_for_sand; +// echo $records['masterdata'][0]->igrno_for_resin; +// echo $records['masterdata'][0]->igrno_for_haxamine; +// echo $records['masterdata'][0]->igrno_for_cs; +// echo $records['masterdata'][0]->igrno_for_catalyst; +// echo $records['masterdata'][0]->igrno_for_bags; +// echo $records['masterdata'][0]->igrno_for_tonbags; ?>