diff --git a/application/config/routes.php b/application/config/routes.php
index 02069f7e..6b4c3e0f 100755
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -272,5 +272,11 @@ $route['addNewdepartment'] = "department/addNewdepartment";
$route['editOlddepartment'] = "department/viewdepartment";
$route['editOlddepartment/(:num)'] = "department/viewdepartment/$1";
$route['editdepartment'] = "department/editdepartment";
+
+//<-------------Reports page----------------->
+$route['normalinprocess'] = "inprocess/addNewInprocessInspection";
+$route['nissaninprocess'] = "inprocess/addNewNissaanInprocessInspection";
+
+
/* End of file routes.php */
/* Location: ./application/config/routes.php */
diff --git a/application/controllers/inprocess.php b/application/controllers/inprocess.php
new file mode 100644
index 00000000..85949be8
--- /dev/null
+++ b/application/controllers/inprocess.php
@@ -0,0 +1,881 @@
+isLoggedIn();
+ $this->load->model('quality_model');
+ $this->load->model('inprocess_model');
+ $this->load->library('form_validation');
+ //$this->load->library('dompdf_gen');
+
+ }
+ /**
+ * This function used to load the first screen of the user
+ */
+ public function index()
+ {
+
+ $data['reportlist'] = $this->inprocess_model->getAllTestReports();
+ $this->global['pageTitle'] = 'Siddharth : Inprocess Test Reports List';
+
+ $this->loadViews("reportlist_inprocesstest", $this->global, $data , NULL);
+ }
+
+
+ public function addNewInprocessInspection()
+ {
+ $data['productsoutward'] = $this->quality_model->getAllprodcuts();
+ $data['customersoutward'] = $this->quality_model->getAllcustomers();
+ $data['emplist'] = $this->quality_model->getEmplistforReport();
+
+ $this->global['pageTitle'] = 'Siddharth : New Inprcess Test Report ';
+ $this->loadViews("newinprocessreport", $this->global, $data , NULL);
+ }
+
+
+ function addNewNissanInprocessInspection()
+ {
+ $data['productsoutward'] = $this->quality_model->getAllprodcuts();
+ $data['customersoutward'] = $this->quality_model->getAllcustomers();
+ $data['emplist'] = $this->quality_model->getEmplistforReport();
+
+ $this->global['pageTitle'] = 'Siddharth : New Inprcess Test Report ';
+ $this->loadViews("newnissaninprocessreport", $this->global, $data , NULL);
+ }
+
+ function editIndInprocessReport()
+ {
+ $rid = $this->uri->segment(3);
+ $data['reportdata'] = $this->inprocess_model->getIndividualInprocessReportData($rid);
+ $pspecid = null;
+ $psubtype = null;
+ $time = null;
+ $temparray = array();
+ $time = array();
+ $index = 0;
+
+ foreach($data['reportdata']['masterreport'] as $key => $d)
+ {
+
+
+ if($pspecid != $d->specid){
+ $index++;
+ $temparray[$index] = array('specid'=>$d->specid,'specname'=>$d->testtype,'smin'=>$d->min,'smax'=>$d->max,'suom'=>$d->uom,'stype'=>$d->subtype,$d->ivalue);
+ $time = array_merge($time,array($d->itime));
+ }
+ else{
+
+
+ array_push($temparray[$index],$d->ivalue);
+ $time = array_merge($time,array($d->itime));
+ }
+ $pspecid = $d->specid;
+
+ }
+
+ $data['reportdata']['masterreport'] = $temparray;
+ $data['timearray'] = $time;
+ $data['emplist'] = $this->quality_model->getEmplistforReport();
+
+ if($data['reportdata']['master'][0]->test_type == 0 )
+ {
+ $this->global['pageTitle'] = 'Siddharth : Edit Inprocess Report';
+ $this->loadViews("editInprocessReport", $this->global, $data , NULL);
+ }
+ else
+ {
+ //echo "Under Developing";
+
+ $this->global['pageTitle'] = 'Siddharth : Edit Nissan Inprocess Report';
+ $this->loadViews("editNissanInprocessReport", $this->global, $data , NULL);
+ }
+ }
+
+
+ function getAllSpecforReport()
+ {
+ $productid = $this->input->post('param1');
+ $customerid = $this->input->post('param2');
+ //echo 'from cn'.$productid.'-'.$customerid;exit();
+ $res = $this->quality_model->getSpecifications($productid,$customerid);
+ echo json_encode($res);
+ }
+
+
+ function saveTestReportData()
+ {
+
+
+ date_default_timezone_get('Asia/Kolkata');
+ $testjson = $this->input->post('param1');
+ $testjson2 = $this->input->post('param2');
+ $afsjson = $this->input->post('param3');
+ $loijson = $this->input->post('param4');
+
+ $productid = $this->input->post('param5');
+ $customerid = $this->input->post('param6');
+ $batchno = $this->input->post('param7');
+ $batchdate = $this->input->post('param8');
+ $batchdate = date_format(date_create($batchdate),'Y-m-d');
+ $plantname = $this->input->post('param9');
+ $sanddesc = $this->input->post('param10');
+ $resindesc = $this->input->post('param11');
+ $qty = $this->input->post('param12');
+ $times = $this->input->post('param13');
+ $times = explode(",",$times);
+ $approvedby = $this->input->post('param14');
+ $remarks = $this->input->post('param15');
+
+
+ $testphpdata = json_decode($testjson,true);
+ $testphpdata2 = json_decode($testjson2,true);
+ $loiphpdata = json_decode($loijson,true);
+ $afsphpdata = json_decode($afsjson,true);
+ //print_r($afsphpdata);die();
+ $createdon = date('Y-m-d H:i:s');
+ $createby = $this->session->userdata ( 'userId' );
+ $document = null;
+ if(!empty($_FILES['rfile']['name']))
+ {
+
+
+ $fs = $this->uploadFile();
+ $document = $fs;
+
+ }
+
+ $masterreportdata = array('productid'=>$productid,'customerid'=>$customerid,'batchno'=>$batchno,'batchdate'=>$batchdate,'plantname'=>$plantname,'sand_description'=>$sanddesc,'resin_description'=>$resindesc,'qty'=>$qty,'remarks'=>$remarks,'document'=>$document,'createdby'=>$createby,'approvedby'=>$approvedby);
+ $MASTERID = $this->inprocess_model->saveMasterTestData($masterreportdata);
+ //$MASTERID = 1;
+ foreach($testphpdata as $data)
+ {
+ //print_r($data);
+
+
+ $temparray = array();
+
+ $specid = $data['SPECID'];
+ $subtype = 0;
+ $actarray = array($data['ACT X1'],$data['ACT X2'],$data['ACT X3'],$data['ACT X4'],$data['ACT X5'],$data['ACT X6'],$data['ACT X7'],$data['ACT X8']);
+
+ for($i=1;$i<=8;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
+ }
+
+ $this->inprocess_model->saveTestReportData($temparray);
+ }
+
+
+ foreach($testphpdata2 as $data)
+ {
+ //print_r($data);
+
+
+ $temparray = array();
+
+ $specid = $data['SPECID'];
+ $subtype = 1;
+
+ $cstarray = array($data['CST X1'],$data['CST X2'],$data['CST X3'],$data['CST X4'],$data['CST X5'],$data['CST X6'],$data['CST X7'],$data['CST X8']);
+ $rstarray = array($data['RST Y1'],$data['RST Y2'],$data['RST Y3']);
+
+
+ for($i=1;$i<=3;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>'','ivalue'=>$rstarray[$i-1]);
+ }
+
+ for($i=4;$i<=11;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-4],'ivalue'=>$cstarray[$i-4]);
+ }
+
+ $this->inprocess_model->saveTestReportData($temparray);
+ }
+
+
+ $count =0;
+ foreach($afsphpdata as $afs)
+ {
+ //print_r($afs);
+
+ $count++;
+ if($count != 12){
+ $ssize = $afs['Sieve Size µm'];
+ $spec = $afs['Spec'];
+ $factor = $afs['Factor'];
+ $rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
+ $cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
+ $cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
+ $afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+ //print_r($afstabledata);
+ $afsid = $this->inprocess_model->saveTestReportAFSData($afstabledata);
+ }
+ }
+ //die();
+
+ foreach($loiphpdata as $loi)
+ {
+ //print_r($loi);
+ $loidetails = $loi['Description'];
+ $spec = $loi['Spec'];
+ $rst1 = $loi['RST Y1'];
+ $rst2 = $loi['RST Y2'];
+ $rst3 = $loi['RST Y3'];
+ $cst1 = $loi['CST X1'];$cst2 = $loi['CST X2'];$cst3 = $loi['CST X3'];$cst4 = $loi['CST X4'];
+ $cst5 = $loi['CST X5'];$cst6 = $loi['CST X6'];$cst7 = $loi['CST X7'];$cst8 = $loi['CST X8'];
+
+ $loitabledata = array('masterreport_id'=>$MASTERID,'loidetails'=>$loidetails,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+
+ $loiid = $this->inprocess_model->saveTestReportLOIData($loitabledata);
+
+ }
+
+
+
+ echo "Report Data Saved Successfully!";
+
+
+ }
+
+
+
+ function updateTestReportData()
+ {
+
+
+ date_default_timezone_get('Asia/Kolkata');
+ $testjson = $this->input->post('param1');
+ $testjson2 = $this->input->post('param2');
+ $afsjson = $this->input->post('param3');
+ $loijson = $this->input->post('param4');
+
+ $productid = $this->input->post('param5');
+ $customerid = $this->input->post('param6');
+ $batchno = $this->input->post('param7');
+ $batchdate = $this->input->post('param8');
+ $batchdate = date_format(date_create($batchdate),'Y-m-d');
+ $plantname = $this->input->post('param9');
+ $sanddesc = $this->input->post('param10');
+ $resindesc = $this->input->post('param11');
+ $qty = $this->input->post('param12');
+ $times = $this->input->post('param13');
+ $times = explode(",",$times);
+ $approvedby = $this->input->post('param14');
+ $remarks = $this->input->post('param15');
+ $masterid = $this->input->post('param16');
+ $olddoc = $this->input->post('param17');
+
+
+ $testphpdata = json_decode($testjson,true);
+ $testphpdata2 = json_decode($testjson2,true);
+ $loiphpdata = json_decode($loijson,true);
+ $afsphpdata = json_decode($afsjson,true);
+ //print_r($afsphpdata);die();
+ $createdon = date('Y-m-d H:i:s');
+ $createby = $this->session->userdata ( 'userId' );
+ $document = $olddoc;
+
+ if(!empty($_FILES['rfile']['name']))
+ {
+ $file = getcwd()."\\uploads\INPROCESS\\".$document;
+
+
+ if(unlink($file)){ echo "sucess";}else{ echo "Failed";}
+ $fs = $this->uploadFile();
+ $document = $fs;
+
+ }
+
+ $masterreportdata = array('productid'=>$productid,'customerid'=>$customerid,'batchno'=>$batchno,'batchdate'=>$batchdate,'plantname'=>$plantname,'sand_description'=>$sanddesc,'resin_description'=>$resindesc,'qty'=>$qty,'remarks'=>$remarks,'document'=>$document,'updatedby'=>$createby,'approvedby'=>$approvedby);
+ $this->inprocess_model->updateMasterTestData($masterreportdata,$masterid);
+
+ foreach($testphpdata as $data)
+ {
+ //print_r($data);
+
+
+ $temparray = array();
+
+ $specid = $data['SPECID'];
+ $subtype = 0;
+ $actarray = array($data['ACT X1'],$data['ACT X2'],$data['ACT X3'],$data['ACT X4'],$data['ACT X5'],$data['ACT X6'],$data['ACT X7'],$data['ACT X8']);
+
+ for($i=1;$i<=8;$i++)
+ {
+
+ //$temparray[$i] = array('itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
+ $temparray[$i] = array('masterreport_id'=>$masterid,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
+ }
+
+ $this->inprocess_model->updateTestReportData($temparray,$masterid,$specid);
+ }
+
+
+ foreach($testphpdata2 as $data)
+ {
+ //print_r($data);
+
+
+ $temparray = array();
+
+ $specid = $data['SPECID'];
+ $subtype = 1;
+
+ $cstarray = array($data['CST X1'],$data['CST X2'],$data['CST X3'],$data['CST X4'],$data['CST X5'],$data['CST X6'],$data['CST X7'],$data['CST X8']);
+ $rstarray = array($data['RST Y1'],$data['RST Y2'],$data['RST Y3']);
+
+
+
+ for($i=1;$i<=3;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$masterid,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>'','ivalue'=>$rstarray[$i-1]);
+ }
+
+ for($i=4;$i<=11;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$masterid,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-4],'ivalue'=>$cstarray[$i-4]);
+ }
+
+ $this->inprocess_model->updateTestReportData($temparray,$masterid,$specid);
+ }
+
+
+ $count =0;
+ foreach($afsphpdata as $afs)
+ {
+ //print_r($afs);
+
+ $count++;
+ if($count != 12){
+ $ssize = $afs['Sieve Size µm'];
+ $spec = $afs['Spec'];
+ $factor = $afs['Factor'];
+ $rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
+ $cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
+ $cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
+ $afstabledata = array('spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+ $this->inprocess_model->updateTestReportAFSData($afstabledata,$masterid,$ssize,$factor);
+ }
+ }
+
+
+ foreach($loiphpdata as $loi)
+ {
+ //print_r($loi);
+ $loidetails = $loi['Description'];
+ $spec = $loi['Spec'];
+ $rst1 = $loi['RST Y1'];
+ $rst2 = $loi['RST Y2'];
+ $rst3 = $loi['RST Y3'];
+ $cst1 = $loi['CST X1'];$cst2 = $loi['CST X2'];$cst3 = $loi['CST X3'];$cst4 = $loi['CST X4'];
+ $cst5 = $loi['CST X5'];$cst6 = $loi['CST X6'];$cst7 = $loi['CST X7'];$cst8 = $loi['CST X8'];
+
+ $loitabledata = array('spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+
+ $loiid = $this->inprocess_model->updateTestReportLOIData($loitabledata,$masterid,$loidetails);
+
+ }
+
+
+
+ echo "Report Data Saved Successfully!";
+
+
+ }
+
+
+
+
+
+
+
+ function printIndInprocessReport()
+ {
+ $rid = $this->input->post('masterreportid');
+
+ $data['reportdata'] = $this->inprocess_model->getIndividualInprocessReportData($rid);
+ $pspecid = null;
+ $psubtype = null;
+ $time = null;
+ $temparray = array();
+ $time = array();
+ $index = 0;
+
+ foreach($data['reportdata']['masterreport'] as $key => $d)
+ {
+
+
+ if($pspecid != $d->specid){
+ $index++;
+ $temparray[$index] = array('specid'=>$d->specid,'specname'=>$d->testtype,'smin'=>$d->min,'smax'=>$d->max,'suom'=>$d->uom,'stype'=>$d->subtype,$d->ivalue);
+ $time = array_merge($time,array($d->itime));
+ }
+ else{
+
+
+ array_push($temparray[$index],$d->ivalue);
+ $time = array_merge($time,array($d->itime));
+ }
+ $pspecid = $d->specid;
+
+ }
+
+ $data['reportdata']['masterreport'] = $temparray;
+ $data['timearray'] = $time;
+ $data['emplist'] = $this->quality_model->getEmplistforReport();
+ $this->global['pageTitle'] = 'Siddharth :Inprocess Report';
+ $html = $this->load->View("viewindinprocesspdf",$data,true);
+ require APPPATH . '/third_party/mpdf/mpdf.php';
+ $mpdf=new mPDF('utf-8','A4-P',7,10,10, 10, 10, 24, 4, 6);
+ $mpdf->SetDisplayMode('fullpage');
+
+ $mpdf->list_indent_first_level = 1;
+ $mpdf->setAutoTopMargin = 'stretch';
+ $mpdf->setAutoBottomMargin = 'stretch';
+ $mpdf->WriteHTML($html);
+ $mpdf->Output($filename.'.pdf','I');
+ }
+
+ function printIndNissanInprocessReport()
+ {
+ $rid = $this->input->post('masterreportid');
+
+ $data['reportdata'] = $this->inprocess_model->getIndividualInprocessReportData($rid);
+ //print_r($data['reportdata'] );die();
+ $pspecid = null;
+ $psubtype = null;
+ $time = null;
+ $temparray = array();
+ $time = array();
+ $index = 0;
+
+ foreach($data['reportdata']['masterreport'] as $key => $d)
+ {
+
+
+ if($pspecid != $d->specid){
+ $index++;
+ $temparray[$index] = array('specid'=>$d->specid,'specname'=>$d->testtype,'smin'=>$d->min,'smax'=>$d->max,'suom'=>$d->uom,'stype'=>$d->subtype,$d->ivalue);
+ $time = array_merge($time,array($d->itime));
+ }
+ else{
+
+
+ array_push($temparray[$index],$d->ivalue);
+ $time = array_merge($time,array($d->itime));
+ }
+ $pspecid = $d->specid;
+
+ }
+
+ $data['reportdata']['masterreport'] = $temparray;
+ $data['timearray'] = $time;
+ $data['emplist'] = $this->quality_model->getEmplistforReport();
+ $this->global['pageTitle'] = 'Siddharth :Inprocess Report';
+ $html = $this->load->View("viewindnissaninprocesspdf",$data,true);
+ require APPPATH . '/third_party/mpdf/mpdf.php';
+ $mpdf=new mPDF('utf-8','A4-P',7,10,10, 10, 10, 24, 4, 6);
+ $mpdf->SetDisplayMode('fullpage');
+
+ $mpdf->list_indent_first_level = 1;
+ $mpdf->setAutoTopMargin = 'stretch';
+ $mpdf->setAutoBottomMargin = 'stretch';
+ $mpdf->WriteHTML($html);
+ $mpdf->Output($filename.'.pdf','I');
+ }
+
+
+
+ function saveNissanTestReportData()
+ {
+
+
+ date_default_timezone_get('Asia/Kolkata');
+ $testjson = $this->input->post('param1');
+ $testjson2 = $this->input->post('param2');
+ $afsjson = $this->input->post('param3');
+ $loijson = $this->input->post('param4');
+
+ $productid = $this->input->post('param5');
+ $customerid = $this->input->post('param6');
+ $batchno = $this->input->post('param7');
+ $batchdate = $this->input->post('param8');
+ $batchdate = date_format(date_create($batchdate),'Y-m-d');
+ $plantname = $this->input->post('param9');
+ $sanddesc = $this->input->post('param10');
+ $resindesc = $this->input->post('param11');
+ $qty = $this->input->post('param12');
+ $times = $this->input->post('param13');
+ $times = explode(",",$times);
+ $approvedby = $this->input->post('param14');
+ $remarks = $this->input->post('param15');
+ $nissansubtype = $this->input->post('param16');
+ //echo $nissansubtype;
+
+ $testphpdata = json_decode($testjson,true);
+ $testphpdata2 = json_decode($testjson2,true);
+ $loiphpdata = json_decode($loijson,true);
+ $afsphpdata = json_decode($afsjson,true);
+ //print_r($afsphpdata);die();
+ $createdon = date('Y-m-d H:i:s');
+ $createby = $this->session->userdata ( 'userId' );
+ $document = null;
+ if(!empty($_FILES['rfile']['name']))
+ {
+
+
+ $fs = $this->uploadFile();
+ $document = $fs;
+
+ }
+
+ $masterreportdata = array('productid'=>$productid,'customerid'=>$customerid,'batchno'=>$batchno,'batchdate'=>$batchdate,'plantname'=>$plantname,'sand_description'=>$sanddesc,'resin_description'=>$resindesc,'qty'=>$qty,'test_type'=>1,'subtype'=>$nissansubtype,'remarks'=>$remarks,'document'=>$document,'createdby'=>$createby,'approvedby'=>$approvedby);
+ $MASTERID = $this->inprocess_model->saveMasterTestData($masterreportdata);
+ //$MASTERID = 1;
+ foreach($testphpdata as $data)
+ {
+ //print_r($data);
+
+
+ $temparray = array();
+
+ $specid = $data['SPECID'];
+ $subtype = 0;
+ $actarray = array($data['ACT X1'],$data['ACT X2'],$data['ACT X3'],$data['ACT X4'],$data['ACT X5'],$data['ACT X6'],$data['ACT X7'],$data['ACT X8']);
+
+ for($i=1;$i<=8;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
+ }
+
+ $this->inprocess_model->saveTestReportData($temparray);
+ }
+
+
+ foreach($testphpdata2 as $data)
+ {
+ //print_r($data);
+
+
+ $temparray = array();
+
+ $specid = $data['SPECID'];
+ $subtype = 1;
+
+ $cstarray = array($data['CST X1'],$data['CST X2'],$data['CST X3'],$data['CST X4'],$data['CST X5'],$data['CST X6'],$data['CST X7'],$data['CST X8']);
+ $rstarray = array($data['RST Y1'],$data['RST Y2'],$data['RST Y3']);
+
+
+ for($i=1;$i<=3;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>'','ivalue'=>$rstarray[$i-1]);
+ }
+
+ for($i=4;$i<=11;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-4],'ivalue'=>$cstarray[$i-4]);
+ }
+
+ $this->inprocess_model->saveTestReportData($temparray);
+ }
+
+
+
+ foreach($afsphpdata as $key => $afs)
+ {
+
+
+ if($nissansubtype == 0){
+ if(($key != 3) && ($key != 9) && ($key != 12) && ($key != 14)){
+
+ $ssize = $afs['Sieve Size µm'];
+ $spec = $afs['Spec'];
+ $factor = $afs['Factor'];
+ $rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
+ $cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
+ $cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
+ $afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+ //print_r($afstabledata);
+ $afsid = $this->inprocess_model->saveTestReportAFSData($afstabledata);
+ }
+ }
+ else
+ {
+ if(($key != 6) && ($key != 9) && ($key != 12) && ($key != 14)){
+
+ $ssize = $afs['Sieve Size µm'];
+ $spec = $afs['Spec'];
+ $factor = $afs['Factor'];
+ $rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
+ $cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
+ $cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
+ $afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+ //print_r($afstabledata);
+ $afsid = $this->inprocess_model->saveTestReportAFSData($afstabledata);
+ }
+ }
+ }
+
+
+ foreach($loiphpdata as $loi)
+ {
+ //print_r($loi);
+ $loidetails = $loi['Description'];
+ $spec = $loi['Spec'];
+ $rst1 = $loi['RST Y1'];
+ $rst2 = $loi['RST Y2'];
+ $rst3 = $loi['RST Y3'];
+ $cst1 = $loi['CST X1'];$cst2 = $loi['CST X2'];$cst3 = $loi['CST X3'];$cst4 = $loi['CST X4'];
+ $cst5 = $loi['CST X5'];$cst6 = $loi['CST X6'];$cst7 = $loi['CST X7'];$cst8 = $loi['CST X8'];
+
+ $loitabledata = array('masterreport_id'=>$MASTERID,'loidetails'=>$loidetails,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+
+ $loiid = $this->inprocess_model->saveTestReportLOIData($loitabledata);
+
+ }
+
+
+
+ echo "Report Data Saved Successfully!";
+
+
+ }
+
+
+ function uploadFile()
+ {
+
+ $pathinfo = pathinfo($_FILES['rfile']['name']);
+ $config['upload_path'] = 'uploads/INPROCESS/';
+ $config['allowed_types'] = '*';
+ $filename = $_FILES['rfile']['name'];
+ $ext = end(explode('.',$filename));
+
+ $ext = strtolower($ext);
+ $fn = 'inprocess' . date('Y-m-d') . time() . '.' . $ext;
+ //print_r($fn);die();
+ $config['file_name'] = $fn;
+ //echo $config['file_name'];
+ $this->load->library('upload',$config);
+ $this->upload->initialize($config);
+
+
+ if($this->upload->do_upload('rfile'))
+ {
+ $uploadData = $this->upload->data();
+ $uploadfilename = $uploadData['file_name'];
+ return $uploadfilename;
+
+ }
+ else
+ {
+ $error = array('error' => $this->upload->display_errors());
+ $uploadfilename = '';
+ print_r($error);
+ return null;
+ }
+
+ }
+
+
+
+
+
+function updateNissanInprocessTestReportData()
+ {
+
+ //echo "controller";die();
+ date_default_timezone_get('Asia/Kolkata');
+ $testjson = $this->input->post('param1');
+ $testjson2 = $this->input->post('param2');
+ $afsjson = $this->input->post('param3');
+ $loijson = $this->input->post('param4');
+
+ $productid = $this->input->post('param5');
+ $customerid = $this->input->post('param6');
+ $batchno = $this->input->post('param7');
+ $batchdate = $this->input->post('param8');
+ $batchdate = date_format(date_create($batchdate),'Y-m-d');
+ $plantname = $this->input->post('param9');
+ $sanddesc = $this->input->post('param10');
+ $resindesc = $this->input->post('param11');
+ $qty = $this->input->post('param12');
+ $times = $this->input->post('param13');
+ $times = explode(",",$times);
+ $approvedby = $this->input->post('param14');
+ $remarks = $this->input->post('param15');
+ $nissansubtype = $this->input->post('param16');
+ $masterid = $this->input->post('param17');
+ $olddoc = $this->input->post('param18');
+ //echo $nissansubtype;
+
+ $testphpdata = json_decode($testjson,true);
+ $testphpdata2 = json_decode($testjson2,true);
+ $loiphpdata = json_decode($loijson,true);
+ $afsphpdata = json_decode($afsjson,true);
+ //print_r($afsphpdata);die();
+ $createdon = date('Y-m-d H:i:s');
+ $createby = $this->session->userdata ( 'userId' );
+ $document = $olddoc;
+ if(!empty($_FILES['rfile']['name']))
+ {
+
+
+ $fs = $this->uploadFile();
+ $document = $fs;
+
+ }
+ //echo 'From COn'.$masterid;
+ $masterreportdata = array('productid'=>$productid,'customerid'=>$customerid,'batchno'=>$batchno,'batchdate'=>$batchdate,'plantname'=>$plantname,'sand_description'=>$sanddesc,'resin_description'=>$resindesc,'qty'=>$qty,'test_type'=>1,'subtype'=>$nissansubtype,'remarks'=>$remarks,'document'=>$document,'updatedby'=>$createby,'approvedby'=>$approvedby);
+ //print_r($masterreportdata);
+ $this->inprocess_model->updateNissanMasterTestData($masterreportdata,$masterid);
+ $MASTERID = $masterid;
+ foreach($testphpdata as $data)
+ {
+ //print_r($data);
+
+
+ $temparray = array();
+
+ $specid = $data['SPECID'];
+ $subtype = 0;
+ $actarray = array($data['ACT X1'],$data['ACT X2'],$data['ACT X3'],$data['ACT X4'],$data['ACT X5'],$data['ACT X6'],$data['ACT X7'],$data['ACT X8']);
+
+ for($i=1;$i<=8;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-1],'ivalue'=>$actarray[$i-1]);
+ }
+
+ $this->inprocess_model->updateNissanTestReportData($temparray,$masterid,$specid);
+ }
+
+
+ foreach($testphpdata2 as $data)
+ {
+ //print_r($data);
+
+
+ $temparray = array();
+
+ $specid = $data['SPECID'];
+ $subtype = 1;
+
+ $cstarray = array($data['CST X1'],$data['CST X2'],$data['CST X3'],$data['CST X4'],$data['CST X5'],$data['CST X6'],$data['CST X7'],$data['CST X8']);
+ $rstarray = array($data['RST Y1'],$data['RST Y2'],$data['RST Y3']);
+
+
+ for($i=1;$i<=3;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>'','ivalue'=>$rstarray[$i-1]);
+ }
+
+ for($i=4;$i<=11;$i++)
+ {
+
+ $temparray[$i] = array('masterreport_id'=>$MASTERID,'specid'=>$specid,'subtype'=>$subtype,'iteration'=>$i,'itime'=>$times[$i-4],'ivalue'=>$cstarray[$i-4]);
+ }
+
+ $this->inprocess_model->updateNissanTestReportData($temparray,$masterid,$specid);
+ }
+
+
+
+ foreach($afsphpdata as $key => $afs)
+ {
+
+
+ if($nissansubtype == 0){
+ if(($key != 3) && ($key != 9) && ($key != 12) && ($key != 14)){
+
+ $ssize = $afs['Sieve Size µm'];
+ $spec = $afs['Spec'];
+ $factor = $afs['Factor'];
+ $rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
+ $cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
+ $cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
+ $afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+ //print_r($afstabledata);
+ $afsid = $this->inprocess_model->updateNissanTestReportAFSData($afstabledata,$masterid,$ssize,$factor);
+ }
+ }
+ else
+ {
+ if(($key != 6) && ($key != 9) && ($key != 12) && ($key != 14)){
+
+ $ssize = $afs['Sieve Size µm'];
+ $spec = $afs['Spec'];
+ $factor = $afs['Factor'];
+ $rst1 = $afs['RST Y1'];$rst2 = $afs['RST Y2'];$rst3 = $afs['RST Y3'];
+ $cst1 = $afs['CST X1'];$cst2 = $afs['CST X2'];$cst3 = $afs['CST X3'];$cst4 = $afs['CST X4'];
+ $cst5 = $afs['CST X5'];$cst6 = $afs['CST X6'];$cst7 = $afs['CST X7'];$cst8 = $afs['CST X8'];
+ $afstabledata = array('masterreport_id'=>$MASTERID,'sieve_size'=>$ssize,'factor'=>$factor,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+ //print_r($afstabledata);
+ $afsid = $this->inprocess_model->updateNissanTestReportAFSData($afstabledata,$masterid,$ssize,$factor);
+ }
+ }
+ }
+
+
+ foreach($loiphpdata as $loi)
+ {
+ //print_r($loi);
+ $loidetails = $loi['Description'];
+ $spec = $loi['Spec'];
+ $rst1 = $loi['RST Y1'];
+ $rst2 = $loi['RST Y2'];
+ $rst3 = $loi['RST Y3'];
+ $cst1 = $loi['CST X1'];$cst2 = $loi['CST X2'];$cst3 = $loi['CST X3'];$cst4 = $loi['CST X4'];
+ $cst5 = $loi['CST X5'];$cst6 = $loi['CST X6'];$cst7 = $loi['CST X7'];$cst8 = $loi['CST X8'];
+
+ $loitabledata = array('masterreport_id'=>$MASTERID,'loidetails'=>$loidetails,'spec'=>$spec,'rst1'=>$rst1,'rst2'=>$rst2,'rst3'=>$rst3,
+ 'cst1'=>$cst1,'cst2'=>$cst2,'cst3'=>$cst3,'cst4'=>$cst4,'cst5'=>$cst5,'cst6'=>$cst6,'cst7'=>$cst7,'cst8'=>$cst8,);
+
+ $loiid = $this->inprocess_model->updateNissanTestReportLOIData($loitabledata,$masterid,$loidetails);
+
+ }
+
+
+
+ echo "Report Data Saved Successfully!";
+
+
+ }
+}
+
+?>
diff --git a/application/controllers/quality.php b/application/controllers/quality.php
index 672f2e39..85072d62 100755
--- a/application/controllers/quality.php
+++ b/application/controllers/quality.php
@@ -74,7 +74,8 @@ class quality extends BaseController
$customer = $this->input->post('param3');
$jsondata = $this->input->post('param1');
$type = $this->input->post('param4');
- //echo $customer;exit();
+
+
$createdby = $this->session->userdata ( 'userId' );
$phpdata = json_decode($jsondata);
@@ -90,19 +91,21 @@ class quality extends BaseController
$min = $data->Min;
$max = $data->Max;
$temp = $data->Temp;
- $isExist = $this->quality_model->checkExist($product,$customer,$name);
+ $sub = $data->SubCatagory;
+
+ $isExist = $this->quality_model->checkExist($product,$customer,$name,$type);
//echo $isExist[0]->count;die();
if($isExist[0]->count == 0)
{
- $tostore = array('customer_id'=>$customer,'product_id'=>$product,'testtype'=>$name,'uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'created_by'=>$createdby);
+ $tostore = array('customer_id'=>$customer,'product_id'=>$product,'testtype'=>$name,'uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'subtype' => $sub,'created_by'=>$createdby);
$res = $this->quality_model->addSpecMast($tostore);
//echo 'i'.$res;
}
else if($isExist[0]->count == 1)
{
- $tostore = array('uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'updated_by'=>$createdby);
+ $tostore = array('uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'subtype'=>$sub,'updated_by'=>$createdby);
$res = $this->quality_model->updateSpecMast($tostore,$product,$customer,$name);
//echo 'u'.$res;
}
@@ -209,8 +212,18 @@ class quality extends BaseController
{
$productid = $this->input->post('param1');
$customerid = $this->input->post('param2');
- //echo 'from cn'.$productid.'-'.$customerid;exit();
- $res = $this->quality_model->getSpecifications($productid,$customerid);
+ $res = '';
+ if($this->input->post('param3'))
+ {
+ $ttype = $this->input->post('param3');
+ $res = $this->quality_model->getSpecifications($productid,$customerid,$ttype);
+ }
+ else
+ {
+ $res = $this->quality_model->getSpecifications($productid,$customerid);
+ }
+
+
echo json_encode($res);
}
diff --git a/application/models/inprocess_model.php b/application/models/inprocess_model.php
new file mode 100644
index 00000000..d532b468
--- /dev/null
+++ b/application/models/inprocess_model.php
@@ -0,0 +1,261 @@
+db->select('product_id,product_name,product_description');
+ $this->db->from('ip_products');
+ $result = $this->db->get();
+ return $result->result();
+ }
+
+ function getAllcustomers()
+ {
+ $this->db->select('client_id,client_name');
+ $this->db->from('ip_clients');
+ $result = $this->db->get();
+ return $result->result();
+ }
+
+ function getAllTestReports()
+ {
+ $this->db->select('masterreport_id,productid,ip_products.product_name,customerid,ip_clients.client_name,batchno,batchdate,document');
+ $this->db->join('ip_products','T_Inprocess_Testreport_Master.productid=ip_products.product_id');
+ $this->db->join('ip_clients','T_Inprocess_Testreport_Master.customerid=ip_clients.client_id');
+ $this->db->from('T_Inprocess_Testreport_Master');
+ $result = $this->db->get();
+ return $result->result();
+ }
+
+
+
+ function getSpecifications($productid,$customerid)
+ {
+ //echo 'from model'.$productid.'-'.$customerid;
+ // $this->db->where('product_id',$productid);
+ // $this->db->where('customer_id',$customerid);
+ // $res = $this->db->get('T_Prodcut_Specification_Master');
+ $sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ?";
+ $res = $this->db->query($sql,array($productid,$customerid));
+ // print_r($this->db->last_query());
+ return $res->result();
+ //print_r($res->result());
+
+ }
+
+ function getEmplistforReport()
+ {
+ $this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.Departmentcode,T_DepartmentDetails.shortName,');
+ $this->db->from('T_Employee_Details');
+ $this->db->join('T_DepartmentDetails','T_Employee_Details.Departmentcode=T_DepartmentDetails.DEPCode');
+ //$this->db->join('ip_invoice_items','ip_invoices.invoice_number=ip_invoice_items.invoice_number');
+ //$this->db->join('ip_products','ip_invoice_items.item_product_id=ip_products.product_id');
+ //$this->db->join('ip_invoice_custom','ip_invoices.invoice_number=ip_invoice_custom.invoice_number and invoice_custom_fieldid=62');
+ $this->db->order_by('T_Employee_Details.EmpID');
+ $res = $this->db->get();
+ return $res->result();
+
+ }
+
+
+ function saveMasterTestData($masterreportdata)
+ {
+ $this->db->insert('T_Inprocess_Testreport_Master',$masterreportdata);
+ $id = $this->db->insert_id();
+ return $id;
+ }
+
+ function saveTestReportData($testreportdata)
+ {
+
+ foreach($testreportdata as $data)
+ {
+ $this->db->insert('T_Inprocess_Testreport',$data);
+ //$row = $this->db->affected_rows();
+ //return $row;
+ //print_r($data);
+ }
+ }
+
+ function saveTestReportAFSData($afstabledata)
+ {
+ $this->db->insert('T_Inprocess_AFSTestreport',$afstabledata);
+ $row = $this->db->affected_rows();
+ //return $row;
+ }
+
+ function saveTestReportLOIData($loitabledata)
+ {
+ $this->db->insert('T_Inprocess_LOITestreport',$loitabledata);
+ $row = $this->db->affected_rows();
+ //return $row;
+ }
+
+ function getIndividualInprocessReportData($reportid)
+ {
+
+ $this->db->select('T_Inprocess_Testreport_Master.*,ip_clients.client_name,ip_products.product_name,ip_products.product_description,T_Employee_Details.FirstName,T_Employee_Details.LastName');
+ $this->db->from('T_Inprocess_Testreport_Master');
+ $this->db->join('ip_clients','T_Inprocess_Testreport_Master.customerid=ip_clients.client_id');
+ $this->db->join('ip_products','T_Inprocess_Testreport_Master.productid=ip_products.product_id');
+ $this->db->join('tbl_users','T_Inprocess_Testreport_Master.createdby=tbl_users.userid');
+ $this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID');
+ $this->db->where('T_Inprocess_Testreport_Master.masterreport_id',$reportid);
+
+ $res = $this->db->get();
+ $reportdata['master'] = $res->result();
+
+ $this->db->select('T_Inprocess_Testreport.*,T_Prodcut_Specification_Master.testtype,T_Prodcut_Specification_Master.min,T_Prodcut_Specification_Master.max,T_Prodcut_Specification_Master.uom');
+ $this->db->from('T_Inprocess_Testreport');
+ $this->db->join('T_Prodcut_Specification_Master','T_Inprocess_Testreport.specid=T_Prodcut_Specification_Master.productspecmaster_id');
+ $this->db->where('masterreport_id',$reportid);
+ $res1 = $this->db->get();
+ $reportdata['masterreport'] = $res1->result();
+
+
+ $this->db->select('T_Inprocess_LOITestreport.*');
+ $this->db->from('T_Inprocess_LOITestreport');
+ $this->db->where('masterreport_id',$reportid);
+ $res1 = $this->db->get();
+ $reportdata['masterreportloi'] = $res1->result();
+
+ $this->db->select('T_Inprocess_AFSTestreport.*');
+ $this->db->from('T_Inprocess_AFSTestreport');
+ $this->db->where('masterreport_id',$reportid);
+ $res1 = $this->db->get();
+ $reportdata['masterreportafs'] = $res1->result();
+
+ $this->db->select('T_Company_Details.CompanyName,T_Company_Details.Address,T_Company_Details.ProfilePic');
+ $this->db->from('T_Company_Details');
+ //$this->db->where('testreport_id',$reportid);
+ $res1 = $this->db->get();
+ $reportdata['company'] = $res1->result();
+
+ return $reportdata;
+
+ }
+
+
+
+ function getTestMasterforList()
+ {
+ $this->db->select('T_Test_Report_Master.testreport_id,T_Test_Report_Master.invoiceid,T_Test_Report_Master.batchdate,T_Test_Report_Master.document,ip_clients.client_id,ip_clients.client_name,ip_products.product_id,ip_products.product_name,ip_products.product_description');
+ $this->db->from('T_Test_Report_Master');
+ $this->db->join('ip_invoices','T_Test_Report_Master.invoiceid=ip_invoices.invoice_number');
+ $this->db->join('ip_clients','ip_invoices.client_id=ip_clients.client_id');
+ $this->db->join('ip_invoice_items','ip_invoices.invoice_id=ip_invoice_items.invoice_id');
+ $this->db->join('ip_products','ip_products.product_id=ip_invoice_items.item_product_id');
+ //$this->db->where('T_Test_Report_Master.invoiceid','!=0');
+ $res = $this->db->get();
+ return $res->result();
+ }
+
+
+ function updateMasterTestData($masterreportdata,$masterid)
+ {
+ $this->db->where('masterreport_id',$masterid);
+ $this->db->update('T_Inprocess_Testreport_Master',$masterreportdata);
+
+
+ }
+
+
+ function updateTestReportData($testreportdata,$masterid,$specid)
+ {
+
+ foreach($testreportdata as $data)
+ {
+
+
+ $this->db->where('masterreport_id',$masterid);
+ $this->db->where('specid',$specid);
+ $this->db->where('iteration',$data['iteration']);
+ $this->db->where('subtype',$data['subtype']);
+ $this->db->update('T_Inprocess_Testreport',$data);
+
+ //echo $this->db->last_query();
+
+ }
+ }
+
+ function updateTestReportAFSData($afstabledata,$masterid,$ssize,$factor)
+ {
+ $this->db->where('masterreport_id',$masterid);
+ $this->db->where('sieve_size',$ssize);
+ $this->db->where('factor',$factor);
+ $this->db->update('T_Inprocess_AFSTestreport',$afstabledata);
+
+ // echo $this->db->last_query();
+
+
+ }
+
+ function updateTestReportLOIData($loitabledata,$masterid,$loidetails)
+ {
+ $this->db->where('masterreport_id',$masterid);
+ $this->db->where('loidetails',$loidetails);
+ $this->db->update('T_Inprocess_LOITestreport',$loitabledata);
+ //echo $this->db->last_query();
+
+
+ }
+
+ //FOR NISSAN INPROCESS
+
+
+ function updateNissanMasterTestData($masterreportdata,$masterid)
+ {
+ //echo "from model";
+ //print_r($masterreportdata);die();
+ $this->db->where('masterreport_id',$masterid);
+ $this->db->update('T_Inprocess_Testreport_Master',$masterreportdata);
+
+
+ }
+
+
+ function updateNissanTestReportData($testreportdata,$masterid,$specid)
+ {
+
+ foreach($testreportdata as $data)
+ {
+
+
+ $this->db->where('masterreport_id',$masterid);
+ $this->db->where('specid',$specid);
+ $this->db->where('iteration',$data['iteration']);
+ $this->db->where('subtype',$data['subtype']);
+ $this->db->update('T_Inprocess_Testreport',$data);
+
+ //echo $this->db->last_query();
+
+ }
+ }
+
+ function updateNissanTestReportAFSData($afstabledata,$masterid,$ssize,$factor)
+ {
+ $this->db->where('masterreport_id',$masterid);
+ $this->db->where('sieve_size',$ssize);
+ $this->db->where('factor',$factor);
+ $this->db->update('T_Inprocess_AFSTestreport',$afstabledata);
+
+ // echo $this->db->last_query();
+
+
+ }
+
+ function updateNissanTestReportLOIData($loitabledata,$masterid,$loidetails)
+ {
+ $this->db->where('masterreport_id',$masterid);
+ $this->db->where('loidetails',$loidetails);
+ $this->db->update('T_Inprocess_LOITestreport',$loitabledata);
+ //echo $this->db->last_query();
+
+
+ }
+
+}
+?>
+
\ No newline at end of file
diff --git a/application/models/quality_model.php b/application/models/quality_model.php
index df507c19..534c251b 100755
--- a/application/models/quality_model.php
+++ b/application/models/quality_model.php
@@ -44,13 +44,14 @@ class Quality_model extends CI_Model
return $result->result();
}
- function checkExist($product,$customer,$name)
+ function checkExist($product,$customer,$name,$type)
{
$this->db->select('count(*) as count');
$this->db->from('T_Prodcut_Specification_Master');
$this->db->where('product_id',$product);
$this->db->where('customer_id',$customer);
$this->db->where('testtype',$name);
+ $this->db->where('type',$type);
$result = $this->db->get();
return $result->result();
}
@@ -152,14 +153,25 @@ class Quality_model extends CI_Model
return $res->result();
}
- function getSpecifications($productid,$customerid)
+ function getSpecifications($productid,$customerid,$ttype="")
{
//echo 'from model'.$productid.'-'.$customerid;
// $this->db->where('product_id',$productid);
// $this->db->where('customer_id',$customerid);
// $res = $this->db->get('T_Prodcut_Specification_Master');
- $sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ?";
- $res = $this->db->query($sql,array($productid,$customerid));
+ $sql ='';
+ $res = "";
+ if(!empty($ttype))
+ {
+ $sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ? and type = ?";
+ $res = $this->db->query($sql,array($productid,$customerid,$ttype));
+ }
+ else
+ {
+ $sql = "Select * from T_Prodcut_Specification_Master where product_id = ? and customer_id = ?";
+ $res = $this->db->query($sql,array($productid,$customerid));
+ }
+
// print_r($this->db->last_query());
return $res->result();
//print_r($res->result());
diff --git a/application/views/editInprocessReport.php b/application/views/editInprocessReport.php
new file mode 100644
index 00000000..5285b489
--- /dev/null
+++ b/application/views/editInprocessReport.php
@@ -0,0 +1,1656 @@
+
+";
+// }
+// $d = base_url().'uploads/INPROCESS'.$reportdata['master'][0]->document;
+// echo $d;
+
+$approvedby = array(-1=>'Select Approver Name');
+foreach($emplist as $r)
+{
+ $approvedby[$r->FirstName.' '.$r->LastName] = $r->FirstName.' '.$r->LastName.'-'.$r->shortName;
+}
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | SNO |
+ Description |
+ SpecMin |
+ SpecMax |
+ SpecUOM |
+ RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 | SPECID |
+
+
+
+
+ $mas)
+ {
+ if($mas['stype'] == 1 )
+ {
+ $id = strtolower($mas['specname']);
+ $id = str_replace(' ', '', $id);
+ $index++;
+
+
+ ?>
+ | | | | |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+
+
+
+
+
+
Raw Sand Tests
+
Coated Sand Tests
+
+
+
+
+
+ | NO | Factor | Sieve Size µm | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+ $afs)
+ {
+
+ $rst1total += $afs->rst1;$rst2total += $afs->rst2;$rst3total += $afs->rst3;
+ $cst1total += $afs->cst1;$cst2total += $afs->cst2;$cst3total += $afs->cst3;$cst4total += $afs->cst4;$cst5total += $afs->cst5;$cst6total += $afs->cst6;$cst7total += $afs->cst7;$cst8total += $afs->cst8;
+
+ ?>
+
+ | factor; ?> | sieve_size;?> | spec; ?> |
+
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
+
+
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | NO | Description | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+
+
+ $loi)
+ {
+ ?>
+
+
+
+ | loidetails?> |
+ spec;?> |
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
.'uploads/INPROCESS/'.$reportdata['master'][0]->document;?>)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/editNissanInprocessReport.php b/application/views/editNissanInprocessReport.php
new file mode 100644
index 00000000..aeafbada
--- /dev/null
+++ b/application/views/editNissanInprocessReport.php
@@ -0,0 +1,3352 @@
+
+subtype == 0)
+{
+ $type = 'Type 5';
+ $afsdata5 = $reportdata['masterreportafs'];
+}
+else
+{
+ $type = 'Type 7';
+ $afsdata7 = $reportdata['masterreportafs'];
+}
+
+// echo "******************Type 5***********************";
+// print_r($afsdata5);
+// echo "******************Type 7***********************";
+// print_r($afsdata7);
+$approvedby = array(-1=>'Select Approver Name');
+foreach($emplist as $r)
+{
+ $approvedby[$r->FirstName.' '.$r->LastName] = $r->FirstName.' '.$r->LastName.'-'.$r->shortName;
+}
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | SNO |
+ Description |
+ SpecMin |
+ SpecMax |
+ SpecUOM |
+ RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 | SPECID |
+
+
+
+ $mas)
+ {
+ if($mas['stype'] == 1 )
+ {
+ $id = strtolower($mas['specname']);
+ $id = str_replace(' ', '', $id);
+ $index++;
+
+
+ ?>
+ | | | | |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+
+
+
+
+
+
+
+
Raw Sand Tests
+
Coated Sand Tests
+
+
+
+
+
+ | NO | Factor | Sieve Size µm | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+ $afs)
+ {
+
+ if($key == 10){
+
+ $rst1total += $afs->rst1;$rst2total += $afs->rst2;$rst3total += $afs->rst3;
+ $cst1total += $afs->cst1;$cst2total += $afs->cst2;$cst3total += $afs->cst3;$cst4total += $afs->cst4;$cst5total += $afs->cst5;$cst6total += $afs->cst6;$cst7total += $afs->cst7;$cst8total += $afs->cst8;
+ }
+ if($key == 9 || $key == 8)
+ {
+ $rst1total3 += $afs->rst1;$rst2total3 += $afs->rst2;$rst3total3 += $afs->rst3;
+ $cst1total3 += $afs->cst1;$cst2total3 += $afs->cst2;$cst3total3 += $afs->cst3;$cst4total3 += $afs->cst4;$cst5total3 += $afs->cst5;$cst6total3 += $afs->cst6;$cst7total3 += $afs->cst7;$cst8total3 += $afs->cst8;
+ }
+
+ if($key == 6 || $key == 7)
+ {
+ $rst1total2 += $afs->rst1;$rst2total2 += $afs->rst2;$rst3total2 += $afs->rst3;
+ $cst1total2 += $afs->cst1;$cst2total2 += $afs->cst2;$cst3total2 += $afs->cst3;$cst4total2 += $afs->cst4;$cst5total2 += $afs->cst5;$cst6total2 += $afs->cst6;$cst7total2 += $afs->cst7;$cst8total2 += $afs->cst8;
+ }
+ if($key >= 0 && $key <= 5)
+ {
+ $rst1total1 += $afs->rst1;$rst2total1 += $afs->rst2;$rst3total1 += $afs->rst3;
+ $cst1total1 += $afs->cst1;$cst2total1 += $afs->cst2;$cst3total1 += $afs->cst3;$cst4total1 += $afs->cst4;$cst5total1 += $afs->cst5;$cst6total1 += $afs->cst6;$cst7total1 += $afs->cst7;$cst8total1 += $afs->cst8;
+ }
+
+
+ ?>
+
+ | factor; ?> | sieve_size;?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
| Total | | | | | | | | | | | |
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | NO | Factor | Sieve Size µm | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+ $afs)
+ {
+
+ if($key == 10){
+
+ $rst51total += $afs->rst1;$rst52total += $afs->rst2;$rst53total += $afs->rst3;
+ $cst51total += $afs->cst1;$cst52total += $afs->cst2;$cst53total += $afs->cst3;$cst54total += $afs->cst4;$cst55total += $afs->cst5;$cst56total += $afs->cst6;$cst57total += $afs->cst7;$cst58total += $afs->cst8;
+ }
+ if($key == 9 || $key == 8)
+ {
+ $rst51total3 += $afs->rst1;$rst52total3 += $afs->rst2;$rst53total3 += $afs->rst3;
+ $cst51total3 += $afs->cst1;$cst52total3 += $afs->cst2;$cst53total3 += $afs->cst3;$cst54total3 += $afs->cst4;$cst55total3 += $afs->cst5;$cst56total3 += $afs->cst6;$cst57total3 += $afs->cst7;$cst58total3 += $afs->cst8;
+ }
+
+ if($key >= 3 && $key <= 7)
+ {
+ $rst51total2 += $afs->rst1;$rst52total2 += $afs->rst2;$rst53total2 += $afs->rst3;
+ $cst51total2 += $afs->cst1;$cst52total2 += $afs->cst2;$cst53total2 += $afs->cst3;$cst54total2 += $afs->cst4;$cst55total2 += $afs->cst5;$cst56total2 += $afs->cst6;$cst57total2 += $afs->cst7;$cst58total2 += $afs->cst8;
+ }
+ if($key >= 0 && $key <= 2)
+ {
+ $rst51total1 += $afs->rst1;$rst52total1 += $afs->rst2;$rst53total1 += $afs->rst3;
+ $cst51total1 += $afs->cst1;$cst52total1 += $afs->cst2;$cst53total1 += $afs->cst3;$cst54total1 += $afs->cst4;$cst55total1 += $afs->cst5;$cst56total1 += $afs->cst6;$cst57total1 += $afs->cst7;$cst58total1 += $afs->cst8;
+ }
+
+
+ ?>
+
+ | factor; ?> | sieve_size;?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
| Total | | | | | | | | | | | |
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | NO | Description | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+
+
+ $loi)
+ {
+ ?>
+
+
+
+ | loidetails?> |
+ spec;?> |
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
.'uploads/INPROCESS/'.$reportdata['master'][0]->document;?>)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/includes/header.php b/application/views/includes/header.php
index b701975a..6e31e732 100755
--- a/application/views/includes/header.php
+++ b/application/views/includes/header.php
@@ -348,6 +348,92 @@ $(function() {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/views/newinprocessreport.php b/application/views/newinprocessreport.php
new file mode 100644
index 00000000..8232cacd
--- /dev/null
+++ b/application/views/newinprocessreport.php
@@ -0,0 +1,1413 @@
+
+'Select Product');
+foreach($productsoutward as $rec)
+{
+ $products[$rec->product_id] = $rec->product_name;
+}
+
+$customers = array(-1=>'Select Customer');
+foreach($customersoutward as $rec)
+{
+ $customers[$rec->client_id] = $rec->client_name;
+}
+
+//print_r($emplist);
+$approvedby = array(-1=>'Select Approver Name');
+foreach($emplist as $r)
+{
+ $approvedby[$r->FirstName.' '.$r->LastName] = $r->FirstName.' '.$r->LastName.'-'.$r->shortName;
+}
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | SNO |
+ Description |
+ SpecMin |
+ SpecMax |
+ SpecUOM |
+ RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 | SPECID |
+
+
+
+
+
+
+
+
+
+
+
Raw Sand Tests
+
Coated Sand Tests
+
+
+
+
+
+ | NO | Factor | Sieve Size µm | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+ | 1 | 5 | 10 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 2 | 10 | 20 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 3 | 20 | 30 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 4 | 30 | 40 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 5 | 40 | 50 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 6 | 50 | 70 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+
+ | 7 | 70 | 100 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 8 | 100 | 140 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 9 | 140 | 200 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 10 | 200 | 300 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 11 | 300 | pan | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | Total | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | NO | Description | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+
+ | 1 | Furnace in Time | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 2 | Furnace out Time | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 3 | Cooling Time | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 4 | Crusible Weight (w1) | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 5 | Before Furnace (w2) | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 6 | After Furnace (w3) | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/newnissaninprocessreport.php b/application/views/newnissaninprocessreport.php
new file mode 100644
index 00000000..aa6b80f7
--- /dev/null
+++ b/application/views/newnissaninprocessreport.php
@@ -0,0 +1,2286 @@
+
+'Select Product');
+foreach($productsoutward as $rec)
+{
+ $products[$rec->product_id] = $rec->product_name;
+}
+
+$customers = array(-1=>'Select Customer');
+foreach($customersoutward as $rec)
+{
+ $customers[$rec->client_id] = $rec->client_name;
+}
+
+//print_r($emplist);
+$approvedby = array(-1=>'Select Approver Name');
+foreach($emplist as $r)
+{
+ $approvedby[$r->FirstName.' '.$r->LastName] = $r->FirstName.' '.$r->LastName.'-'.$r->shortName;
+}
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | SNO |
+ Description |
+ SpecMin |
+ SpecMax |
+ SpecUOM |
+ RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 | SPECID |
+
+
+
+
+
+
+
+
+
+
Raw Sand Tests
+
Coated Sand Tests
+
+
+
+
+
+ | NO | Factor | Sieve Size µm | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+ | 1 | 5 | 10 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 2 | 10 | 20 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 3 | 20 | 30 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 4 | 30 | 40 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 5 | 40 | 50 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 6 | 50 | 70 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | Total | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 7 | 70 | 100 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 8 | 100 | 140 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+
+ | Total | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+
+
+ | 9 | 140 | 200 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 10 | 200 | 300 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | Total | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+
+
+ | 11 | 300 | pan | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | Total | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+
+
+
+
+
+
+
+ | NO | Factor | Sieve Size µm | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+ | 1 | 5 | 10 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 2 | 10 | 20 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 3 | 20 | 30 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ | Total | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 4 | 30 | 40 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 5 | 40 | 50 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 6 | 50 | 70 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+
+ | 7 | 70 | 100 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 8 | 100 | 140 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+
+ | Total | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+
+
+ | 9 | 140 | 200 | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | 10 | 200 | 300 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | Total | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+ 0.00 | 0.00 | 0.00 | 0.00 |
+
+
+ | 11 | 300 | pan | 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+ 0.00 |
+
+
+ | Total | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+
+
+
+
+
+
+
+
+
+
+ | NO | Description | Spec | RST Y1 | RST Y2 | RST Y3 | CST X1 | CST X2 | CST X3 | CST X4 | CST X5 | CST X6 | CST X7 | CST X8 |
+
+
+
+
+
+
+ | 1 | Furnace in Time | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 2 | Furnace out Time | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 3 | Cooling Time | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 4 | Crusible Weight (w1) | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 5 | Before Furnace (w2) | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+ | 6 | After Furnace (w3) | | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/views/qualitymaster.php b/application/views/qualitymaster.php
index 02ccd54f..a204eece 100755
--- a/application/views/qualitymaster.php
+++ b/application/views/qualitymaster.php
@@ -66,18 +66,7 @@ foreach($customersinward as $customer)
- 'newsletter',
- // 'id' => 'newsletter',
- // 'value' => 'accept',
- // 'checked' => TRUE,
- // 'style' => 'margin:10px'
- // );
-
- // echo form_checkbox($data);
- ?>
OutWard
@@ -106,7 +95,18 @@ foreach($customersinward as $customer)
+
+
+
+
+ 'inprocess','value' => 'accept','checked' => false);
+ echo form_checkbox($data);
+
+ ?>
+
+
InProcess
@@ -123,6 +123,7 @@ foreach($customersinward as $customer)
Min |
Max |
Temp |
+
SubCatagory |
@@ -182,6 +183,11 @@ foreach($customersinward as $customer)
| Temp | |
+
+
+ | Sub Category | Raw Sand Test |
+
+
@@ -225,6 +231,7 @@ foreach($customersinward as $customer)
<%=Min%> |
<%=Max%> |
<%=Temp%> |
+
<%=SubCatagory%> |
@@ -247,12 +254,15 @@ $('#OutWard').attr('checked','true');
//alert('InWard');
$('#inwardarea').show();
$('#outwardarea').hide();
+ $('#inprocessarea').hide();
+
}
else if(val == 1)
{
//alert('OutWard');
$('#inwardarea').hide();
$('#outwardarea').show();
+ $('#inprocessarea').show();
}
}
$('#product').select2();
@@ -305,6 +315,8 @@ function addNewRow()
var min = $('#min').val();
var max = $('#max').val();
var temp = $('#temp').val();
+ var sub = 0;
+ if($('#subcata').is(':checked')){ sub = 1;}
if(sname == '' || uom =='' || min == '' || max == '' || temp == '')
{
@@ -316,19 +328,26 @@ function addNewRow()
var rows = document.getElementById('testspecifications').rows.length;
//rows = rows-1;
var template = jQuery("#addList").html();
- $('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp}));
+ $('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp,SubCatagory:sub}));
$('#spname').val('');
$('#uom').val('');
$('#min').val('');
$('#max').val('');
$('#temp').val('');
+ $('#subcata').attr('checked',false);
document.getElementById('spname').focus();
}
}
$("#specmodel").on("shown.bs.modal", function(e) {
+ $('#sub').hide();
+ if($('#OutWard').is(':checked') && $('#inprocess').is(':checked'))
+ {
+ $('#sub').show();
+ }
+ else{ $('#sub').hide(); }
document.getElementById('spname').focus();
});
@@ -339,9 +358,18 @@ $("#specmodel").on("shown.bs.modal", function(e) {
var type = '';
var product = '';
var customer = '';
+ // var subtype = '';
if($('#OutWard').is(':checked'))
{
type = 'OUTWARD';
+ if($('#inprocess').is(':checked'))
+ {
+ type = 'INPROCESS';
+ // if($('#subcata').is(':checked'))
+ // {
+ // subtype = 1;
+ // }
+ }
product = $('#product').val();
customer = $('#customer').val();
}
@@ -351,6 +379,9 @@ $("#specmodel").on("shown.bs.modal", function(e) {
product = $('#productinward').val();
customer = $('#customerinward').val();
}
+
+
+
var alldata = $("#testspecifications").tableToJSON();
//alert(JSON.stringify(alldata));
alldata=JSON.stringify(alldata)
diff --git a/application/views/reportlist_inprocesstest.php b/application/views/reportlist_inprocesstest.php
new file mode 100644
index 00000000..26fa0347
--- /dev/null
+++ b/application/views/reportlist_inprocesstest.php
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Test Report ID |
+ Batch No |
+ Batch Date |
+ Product Name |
+ Customer Name |
+
+
+
+
+
+
+ ";
+ ?>
+ | masterreport_id?>
+ document)){?>
+
+
+ | batchno?> | batchdate),'d-m-Y');?> | product_name;?> | client_name;?> |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/views/viewIndSpec.php b/application/views/viewIndSpec.php
index f8816b26..db7e698d 100755
--- a/application/views/viewIndSpec.php
+++ b/application/views/viewIndSpec.php
@@ -82,6 +82,7 @@ foreach($specifications as $s)
Min |
Max |
Temp |
+
SubCatagory |
Action |
@@ -96,7 +97,8 @@ foreach($specifications as $s)
{
$index++;
?>
-
| testtype?> | uom?> | min?> | max?> | temp)){ echo $data->temp; } else { echo "-"; }?> | |
+
| testtype?> | uom?> | min?> | max?> | temp)){ echo $data->temp; } else { echo "-"; }?> |
+ style="text-align:center;">subtype;?> | |
Temp | |
+
+ | Sub Category | Raw Sand Test |
+
@@ -175,17 +180,21 @@ foreach($specifications as $s)
"autoWidth": true
});
+
+
});
@@ -215,6 +224,8 @@ function addNewRow()
var min = $('#min').val();
var max = $('#max').val();
var temp = $('#temp').val();
+ var sub = 0;
+ if($('#subcata').is(':checked')){sub = 1;}
if(sname == '' || uom =='' || min == '' || max == '' || temp == '')
{
alert('Please Enter all specification');
@@ -226,7 +237,7 @@ function addNewRow()
//rows = rows-1;
//alert(rows);
var template = jQuery("#addList").html();
- $('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp}));
+ $('#specAppend').append(_.template(template,{index:rows,Name:sname,UOM:uom,Min:min,Max:max,Temp:temp,SubCatagory:sub}));
$('#spname').val('');
$('#uom').val('');
@@ -239,7 +250,14 @@ function addNewRow()
$("#specmodel").on("shown.bs.modal", function(e) {
- document.getElementById('spname').focus();
+ var type = $('#ttype').val();
+ //alert(type);
+ if(type == 'INPROCESS')
+ {
+ $('#sub').show();
+ }
+ else {$('#sub').hide();}
+ document.getElementById('spname').focus();
});
diff --git a/application/views/viewindinprocesspdf.php b/application/views/viewindinprocesspdf.php
new file mode 100644
index 00000000..2f6ba228
--- /dev/null
+++ b/application/views/viewindinprocesspdf.php
@@ -0,0 +1,271 @@
+
+CompanyName;
+ $caddress = $c->Address;
+ $pic = $c->ProfilePic;
+ }
+}
+?>
+
+
+
+
+
+
+
+IN PROCESS TEST REPORT |
+
+
+
+
+| REPORT FOR |
+client_name.'-'.$reportdata['master'][0]->product_name .'-'.$reportdata['master'][0]->product_description;?> |
+
+
+| PLANT NAME |
+plantname;?> |
+BATCH NO |
+batchno;?> |
+
+
+| BATCH DATE |
+batchdate),'d-m-Y');?> |
+
+
+| QTY |
+qty;?>Kgs |
+SAND DESCRIPTION |
+sand_description;?> |
+
+
+| RESIN DESCRIPTION |
+resin_description;?> |
+
+
+
+
+
+
+
+| SNO | DESCRIPTION | SPECIFICATION | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| Min | Max | UOM | | | | | | | | |
+
+ $mas)
+ {
+ if($mas['stype'] == 0 )
+ {
+
+
+
+ ?>
+ | | | | |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+| SNO | DESCRIPTION | SPEC | Raw Sand Tests | Coated Sand Tests |
+
+
+ $mas)
+ {
+ if($mas['stype'] == 1)
+ {
+
+
+
+ if($mas['stype'] == 1){
+ $index++;
+ ?>
+ | | |
+
+ |
+
+ |
+
+ |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+
+
+
+ | | |
+ NA | NA | NA | | | | | | | | |
+
+
+
+
+
+
+
+
+
+| SNO | Factor | Mesh | Spec | Raw Sand Tests | Coated Sand Tests |
+
+
+ $afs)
+ {
+
+ $rst1total += $afs->rst1;$rst2total += $afs->rst2;$rst3total += $afs->rst3;
+ $cst1total += $afs->cst1;$cst2total += $afs->cst2;$cst3total += $afs->cst3;$cst4total += $afs->cst4;$cst5total += $afs->cst5;$cst6total += $afs->cst6;$cst7total += $afs->cst7;$cst8total += $afs->cst8;
+
+ ?>
+
+ | factor; ?> | sieve_size;?> | spec; ?> |
+
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
+
+
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+
+
+
+
+
+
+| SNO | Description | Spec | Raw Sand Tests | Coated Sand Tests |
+
+
+
+ $loi)
+ {
+ ?>
+
+
+
+ | loidetails?> |
+ spec;?> |
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
+
+
+
+
+
+
Remarks:
remarks; ?>
+
+
+
+| INSPECTOR NAME :session->userdata ( 'name' );?> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | APPROVED BY :approvedby; ?> |
+| |
+| |
+
+
+
+
+
diff --git a/application/views/viewindnissaninprocesspdf.php b/application/views/viewindnissaninprocesspdf.php
new file mode 100644
index 00000000..e642f559
--- /dev/null
+++ b/application/views/viewindnissaninprocesspdf.php
@@ -0,0 +1,431 @@
+
+CompanyName;
+ $caddress = $c->Address;
+ $pic = $c->ProfilePic;
+ }
+}
+$type = '-';
+if($reportdata['master'][0]->subtype == 0)
+{
+ $type = 'Type 5';
+
+}
+else { $type = 'Type 7'; }
+?>
+
+
+
+
+
+
+
+IN PROCESS TEST REPORT |
+
+
+
+
+| REPORT FOR subtype?> |
+client_name.'-'.$reportdata['master'][0]->product_name .'-'.$reportdata['master'][0]->product_description.'-'.$type;?> |
+
+
+| PLANT NAME |
+plantname;?> |
+BATCH NO |
+batchno;?> |
+
+
+| BATCH DATE |
+batchdate),'d-m-Y');?> |
+
+
+| QTY |
+qty;?>Kgs |
+SAND DESCRIPTION |
+sand_description;?> |
+
+
+| RESIN DESCRIPTION |
+resin_description;?> |
+
+
+
+
+
+
+
+| SNO | DESCRIPTION | SPECIFICATION | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| Min | Max | UOM | | | | | | | | |
+
+ $mas)
+ {
+ if($mas['stype'] == 0 )
+ {
+
+
+
+ ?>
+ | | | | |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+| SNO | DESCRIPTION | SPEC | Raw Sand Tests | Coated Sand Tests |
+
+
+ $mas)
+ {
+ if($mas['stype'] == 1)
+ {
+
+
+
+ if($mas['stype'] == 1){
+ $index++;
+ ?>
+ | | |
+
+ |
+
+ |
+
+ |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+ > |
+
+
+
+
+ | | |
+ NA | NA | NA | | | | | | | | |
+
+
+
+
+
+
+
+
+
+| SNO | Factor | Mesh | Spec | Raw Sand Tests | Coated Sand Tests |
+
+
+
+
+subtype == 0){
+
+ $rst51total1 = 0;$rst52total1 = 0;$rst53total1 = 0;$cst51total1 = 0;$cst52total1 = 0;$cst53total1 = 0;$cst54total1 = 0;$cst55total1 = 0;$cst56total1 = 0;$cst57total1 = 0;$cst58total1 = 0;
+
+ $rst51total2 = 0;$rst52total2 = 0;$rst53total2 = 0;$cst51total2 = 0;$cst52total2 = 0;$cst53total2 = 0;$cst54total2 = 0;$cst55total2 = 0;$cst56total2 = 0;$cst57total2 = 0;$cst58total2 = 0;
+
+ $rst51total3 = 0;$rst52total3 = 0;$rst53total3 = 0;$cst51total3 = 0;$cst52total3 = 0;$cst53total3 = 0;$cst54total3 = 0;$cst55total3 = 0;$cst56total3 = 0;$cst57total3 = 0;$cst58total3 = 0;
+
+ $rst51total = 0;$rst52total = 0;$rst53total = 0;$cst51total = 0;$cst52total = 0;$cst53total = 0;$cst54total = 0;$cst55total = 0;$cst56total = 0;$cst57total = 0;$cst58total = 0;
+ foreach($reportdata['masterreportafs'] as $key => $afs)
+ {
+
+ if($key == 10){
+
+ $rst51total += $afs->rst1;$rst52total += $afs->rst2;$rst53total += $afs->rst3;
+ $cst51total += $afs->cst1;$cst52total += $afs->cst2;$cst53total += $afs->cst3;$cst54total += $afs->cst4;$cst55total += $afs->cst5;$cst56total += $afs->cst6;$cst57total += $afs->cst7;$cst58total += $afs->cst8;
+ }
+ if($key == 9 || $key == 8)
+ {
+ $rst51total3 += $afs->rst1;$rst52total3 += $afs->rst2;$rst53total3 += $afs->rst3;
+ $cst51total3 += $afs->cst1;$cst52total3 += $afs->cst2;$cst53total3 += $afs->cst3;$cst54total3 += $afs->cst4;$cst55total3 += $afs->cst5;$cst56total3 += $afs->cst6;$cst57total3 += $afs->cst7;$cst58total3 += $afs->cst8;
+ }
+
+ if($key >= 3 && $key <= 7)
+ {
+ $rst51total2 += $afs->rst1;$rst52total2 += $afs->rst2;$rst53total2 += $afs->rst3;
+ $cst51total2 += $afs->cst1;$cst52total2 += $afs->cst2;$cst53total2 += $afs->cst3;$cst54total2 += $afs->cst4;$cst55total2 += $afs->cst5;$cst56total2 += $afs->cst6;$cst57total2 += $afs->cst7;$cst58total2 += $afs->cst8;
+ }
+ if($key >= 0 && $key <= 2)
+ {
+ $rst51total1 += $afs->rst1;$rst52total1 += $afs->rst2;$rst53total1 += $afs->rst3;
+ $cst51total1 += $afs->cst1;$cst52total1 += $afs->cst2;$cst53total1 += $afs->cst3;$cst54total1 += $afs->cst4;$cst55total1 += $afs->cst5;$cst56total1 += $afs->cst6;$cst57total1 += $afs->cst7;$cst58total1 += $afs->cst8;
+ }
+
+
+ ?>
+
+ | factor; ?> | sieve_size;?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
| Total | | | | | | | | | | | |
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+
+ $afs)
+ {
+
+ if($key == 10){
+
+ $rst1total += $afs->rst1;$rst2total += $afs->rst2;$rst3total += $afs->rst3;
+ $cst1total += $afs->cst1;$cst2total += $afs->cst2;$cst3total += $afs->cst3;$cst4total += $afs->cst4;$cst5total += $afs->cst5;$cst6total += $afs->cst6;$cst7total += $afs->cst7;$cst8total += $afs->cst8;
+ }
+ if($key == 9 || $key == 8)
+ {
+ $rst1total3 += $afs->rst1;$rst2total3 += $afs->rst2;$rst3total3 += $afs->rst3;
+ $cst1total3 += $afs->cst1;$cst2total3 += $afs->cst2;$cst3total3 += $afs->cst3;$cst4total3 += $afs->cst4;$cst5total3 += $afs->cst5;$cst6total3 += $afs->cst6;$cst7total3 += $afs->cst7;$cst8total3 += $afs->cst8;
+ }
+
+ if($key == 6 || $key == 7)
+ {
+ $rst1total2 += $afs->rst1;$rst2total2 += $afs->rst2;$rst3total2 += $afs->rst3;
+ $cst1total2 += $afs->cst1;$cst2total2 += $afs->cst2;$cst3total2 += $afs->cst3;$cst4total2 += $afs->cst4;$cst5total2 += $afs->cst5;$cst6total2 += $afs->cst6;$cst7total2 += $afs->cst7;$cst8total2 += $afs->cst8;
+ }
+ if($key >= 0 && $key <= 5)
+ {
+ $rst1total1 += $afs->rst1;$rst2total1 += $afs->rst2;$rst3total1 += $afs->rst3;
+ $cst1total1 += $afs->cst1;$cst2total1 += $afs->cst2;$cst3total1 += $afs->cst3;$cst4total1 += $afs->cst4;$cst5total1 += $afs->cst5;$cst6total1 += $afs->cst6;$cst7total1 += $afs->cst7;$cst8total1 += $afs->cst8;
+ }
+
+
+ ?>
+
+ | factor; ?> | sieve_size;?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ spec; ?> |
+
+
+
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
| Total | | | | | | | | | | | |
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+ | Total | | | | | | | | | | | |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+| SNO | Description | Spec | Raw Sand Tests | Coated Sand Tests |
+
+
+
+ $loi)
+ {
+ ?>
+
+
+
+ | loidetails?> |
+ spec;?> |
+ rst1;?> |
+ rst2;?> |
+ rst3;?> |
+
+ cst1;?> |
+ cst2;?> |
+ cst3;?> |
+ cst4;?> |
+ cst5;?> |
+ cst6;?> |
+ cst7;?> |
+ cst8;?> |
+
+
+
+
+
+
+
+
Remarks:
remarks; ?>
+
+
+
+| INSPECTOR NAME :session->userdata ( 'name' );?> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | APPROVED BY :approvedby; ?> |
+| |
+| |
+
+
+
+
+