view,model,controller,helper server code : ps
This commit is contained in:
parent
6074d6496c
commit
48eb7b0ef7
@ -47,18 +47,22 @@
|
||||
|
||||
$active_group = 'default';
|
||||
$active_record = TRUE;
|
||||
// old DB
|
||||
// $db['default']['hostname'] = '52.172.253.20';
|
||||
|
||||
// $db['default']['hostname'] = 'localhost';
|
||||
// $db['default']['username'] = 'kasiram9_prod';
|
||||
// $db['default']['password'] = 'sia!1234';
|
||||
// $db['default']['database'] = 'kasiram9_SIAPROD';
|
||||
|
||||
// new DB
|
||||
$db['default']['hostname'] = '119.18.54.85';
|
||||
$db['default']['username'] = 'venbaehn_sia';
|
||||
$db['default']['password'] = 'gmjGKp8DyyxqnSc';
|
||||
$db['default']['database'] = 'venbaehn_sia';
|
||||
|
||||
// $db['default']['hostname'] = 'vprodb1.mysql.database.azure.com';
|
||||
// $db['default']['username'] = 'dbroot';
|
||||
// $db['default']['password'] = 'root@DB23';
|
||||
// $db['default']['database'] = 'sia_prod';
|
||||
|
||||
$db['default']['dbdriver'] = 'mysqli';
|
||||
$db['default']['dbprefix'] = '';
|
||||
$db['default']['pconnect'] = TRUE;
|
||||
|
||||
@ -271,7 +271,7 @@ function add($pathname)
|
||||
{
|
||||
|
||||
//echo "t54";
|
||||
log_message('error'," Service Emr-po FNS.");
|
||||
|
||||
|
||||
//die();
|
||||
|
||||
@ -379,7 +379,6 @@ function add($pathname)
|
||||
if(count($Req)>0)
|
||||
{
|
||||
$RegNo = $Req[0]['ReqNo'];
|
||||
log_message('error'," Service Emr-po Requistion Number. ".$RegNo);
|
||||
}
|
||||
|
||||
|
||||
@ -391,7 +390,6 @@ function add($pathname)
|
||||
if(count($POMaster)>0)
|
||||
{
|
||||
$PONO = $POMaster[0]['PONO'];
|
||||
log_message('error'," Service Emr-po Number. ".$PONO);
|
||||
}
|
||||
|
||||
$RegDetailsStatus=REQITEM_POCREATED;
|
||||
@ -447,7 +445,6 @@ function add($pathname)
|
||||
if(count($ReqDetQuery)>0)
|
||||
{
|
||||
$ItemNo = $ReqDetQuery[0]['ItemNo'];
|
||||
log_message('error'," Service Emr-po Requistion Lineitem . ".$ItemNo);
|
||||
}
|
||||
|
||||
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'ServiceMaterialDescription'=>$ServiceMaterialDescription,'ServiceFrequency'=>$ServiceFrequency,'Per'=>$Per,'ItemNo'=>$ItemNo);
|
||||
@ -458,7 +455,6 @@ function add($pathname)
|
||||
if(count($POLineItem)>0)
|
||||
{
|
||||
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
||||
log_message('error'," Service Emr-po Lineitem . ".$LineItemNo);
|
||||
}
|
||||
if(trim($POType) == SERVICE )
|
||||
{
|
||||
@ -466,7 +462,6 @@ function add($pathname)
|
||||
$ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt);
|
||||
|
||||
$ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList);
|
||||
log_message('error'," Service Emr-po Tax ID . ".$ServiceTax);
|
||||
|
||||
}
|
||||
}
|
||||
@ -499,12 +494,11 @@ $prefile =array();
|
||||
|
||||
|
||||
$pathname = 'browseFiles'.$i;
|
||||
log_message('error'," Service Emr-po Browse File Path Name ".$pathname);
|
||||
|
||||
if(!empty($_FILES[$pathname]['name']))
|
||||
{
|
||||
|
||||
$files = str_replace(" ","",$_FILES[$pathname]['name']);
|
||||
log_message('error'," Service Emr-po File Name ".$files);
|
||||
|
||||
$fcount = 0;
|
||||
|
||||
@ -527,8 +521,7 @@ $prefile =array();
|
||||
if($fcount == 0)
|
||||
{
|
||||
$Picture = $this->add($pathname);
|
||||
//echo $Picture;
|
||||
log_message('error'," Revenue Emr-po File status ".$Picture);
|
||||
//echo $Picture;
|
||||
$arr[] = array($Picture);
|
||||
|
||||
}
|
||||
@ -555,8 +548,7 @@ $prefile =array();
|
||||
{
|
||||
|
||||
$myfile = array('FilePath'=>$filename,'PONO'=>$PONO);
|
||||
$fileno = $this->purchaseorder_model->fileupload($myfile);
|
||||
log_message('error'," Revenue Emr-po File Number.".$fileno);
|
||||
$this->purchaseorder_model->fileupload($myfile);
|
||||
}
|
||||
|
||||
|
||||
@ -572,7 +564,6 @@ $prefile =array();
|
||||
|
||||
|
||||
echo "<script>alert('You Have Successfully Saved the Purchase order! $PONO');</script>";
|
||||
log_message('error'," Service Emr-po successfully created. ".$PONO."-".$POStatus);
|
||||
redirect('purchaseorder/PurchaseOrderList','refresh');
|
||||
|
||||
}
|
||||
@ -581,7 +572,6 @@ $prefile =array();
|
||||
// echo 'Emergency Service Purchase Order Created Successfully!The PO NO Is: '.$PONO;
|
||||
|
||||
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
|
||||
log_message('error'," Service Emr-po successfully created. ".$PONO."-".$POStatus);
|
||||
redirect('purchaseorder/PurchaseOrderList','refresh');
|
||||
|
||||
}
|
||||
@ -594,25 +584,25 @@ $prefile =array();
|
||||
//This used to Create Revenue Emergency Purchase Order
|
||||
function addNewRevenuePurchaseOrder()
|
||||
{
|
||||
log_message('error'," Revenue Emr-po FNS.");
|
||||
|
||||
$txtspl=$this->input->post('txtSpecial');
|
||||
// echo "\n *** txtspl".$txtspl;
|
||||
|
||||
|
||||
$txtspl=$this->input->post('txtSpecial');
|
||||
|
||||
|
||||
$POdt =$this->input->post('PODate');
|
||||
$PODate = $this->getDateformat($POdt);
|
||||
$SupplierID = $this->input->post('drpSupplier');
|
||||
$DeliveryAddr = $this->input->post('DeliveryAddr');
|
||||
$dt = $this->input->post('Deliverydt');
|
||||
$DeliveryOption = $this->input->post('DateRange');
|
||||
// echo "\n DeliveryOption ".$DeliveryOption;
|
||||
if($DeliveryOption==1){
|
||||
$Deliverydt = '';
|
||||
$DeliverySchedule = $this->input->post('Scheduleby');
|
||||
}
|
||||
else{
|
||||
$Deliverydt = $this->getDateformat($dt);
|
||||
$DeliverySchedule = '';
|
||||
}
|
||||
$DeliveryOption = $this->input->post('DateRange');
|
||||
if($DeliveryOption==1){
|
||||
$Deliverydt = '';
|
||||
$DeliverySchedule = $this->input->post('Scheduleby');
|
||||
}
|
||||
else{
|
||||
$Deliverydt = $this->getDateformat($dt);
|
||||
$DeliverySchedule = '';
|
||||
}
|
||||
|
||||
$Modeofshipment=$this->input->post('emergmodeofshipment');
|
||||
$supplierreference=$this->input->post('emergsupplierreference');
|
||||
@ -621,23 +611,30 @@ $prefile =array();
|
||||
$fincap=$this->input->post('emergfincap');
|
||||
$revenuetype=$this->input->post('PoTypeOptions');
|
||||
$insurancestatus=$this->input->post('insuranceStatus');
|
||||
if($insurancestatus == 1) $insuranceno=$this->input->post('insuranceNo');
|
||||
else $insuranceno="";
|
||||
|
||||
$CostCenterName = $this->input->post('CostCenterName');
|
||||
if($insurancestatus == 1){
|
||||
$insuranceno=$this->input->post('insuranceNo');
|
||||
}else{
|
||||
$insuranceno="";
|
||||
}
|
||||
$CostCenterName = $this->input->post('CostCenterName');
|
||||
$POType = $this->input->post('POType');
|
||||
$PoRange = $this->input->post('txtPoRange');
|
||||
|
||||
$SpcialInstruction = $this->input->post('txtSpcialInstruction');
|
||||
$RequistionComments = "Created Emergency Revenue PO";
|
||||
$RequistionComments = "Created Emergency Revenue PO";
|
||||
$TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary');
|
||||
|
||||
if($txtspl==0) $POStatus=REQITEM_Emergency_PO_CREATED;
|
||||
else $POStatus=SPECIAL_PO;
|
||||
|
||||
// echo "\n *** POStatus ".$POStatus;
|
||||
if($txtspl==0)
|
||||
{
|
||||
$POStatus=REQITEM_Emergency_PO_CREATED;
|
||||
}
|
||||
else
|
||||
{
|
||||
$POStatus=SPECIAL_PO;
|
||||
}
|
||||
|
||||
//$POStatus = $this->input->post('TextStatus');
|
||||
$RequestedBy = $this->input->post('drpDepartment');
|
||||
$RequestedBy = $this->input->post('drpDepartment');
|
||||
$CreateBy = $this->session->userdata ( 'userId' );
|
||||
// $RowCount = $this->input->post('TextRowCount');
|
||||
|
||||
@ -649,56 +646,62 @@ $prefile =array();
|
||||
// $DeletedRow = $this->input->post('TextDeletedRowCount');
|
||||
|
||||
$DeletedRow = $this->input->post('txtDeletedRow1');
|
||||
$splRow = $this->input->post('splrow');
|
||||
|
||||
|
||||
|
||||
$splRow = $this->input->post('splrow');
|
||||
|
||||
// echo $DeletedRow;
|
||||
|
||||
$ReqStatus = REQITEM_Emergency_PO_CREATED;
|
||||
$Local_Interstate=$this->input->post('Range');
|
||||
$ReqStatus = REQITEM_Emergency_PO_CREATED;
|
||||
$Local_Interstate=$this->input->post('Range');
|
||||
|
||||
$comma_separated = explode(':', $DeletedRow);
|
||||
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
$PaymentTerms=$this->input->post('PaymentMethod');
|
||||
$PaymentTerms=$this->input->post('PaymentMethod');
|
||||
$OtherPayment=$this->input->post('Otherpayment');
|
||||
|
||||
if($POStatus==SPECIAL_PO) $Qualitycheck=$this->input->post('txtQuality');
|
||||
else $Qualitycheck=1;
|
||||
|
||||
if($POStatus==SPECIAL_PO)
|
||||
{
|
||||
$Qualitycheck=$this->input->post('txtQuality');
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$Qualitycheck=1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//add requistion
|
||||
$Request = array('ReqType'=>$POType, 'RequestedDept'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$RequistionComments,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy);
|
||||
// print_r($Request);
|
||||
// echo "\n *** ";
|
||||
$Request = array('ReqType'=>$POType, 'RequestedDept'=>$RequestedBy,'CostCenterCode'=>$CostCenterName,'Status'=>$ReqStatus,'Comments'=>$RequistionComments,'ReqDate'=>$createddt,'CreatedDate'=>$createddt,'CreatedBy'=>$CreateBy);
|
||||
|
||||
$Req = $this->requistion_model->addRequistion($Request);
|
||||
//$RegNo='01';
|
||||
$RegNo='';
|
||||
if(count($Req)>0)
|
||||
{
|
||||
$RegNo = $Req[0]['ReqNo'];
|
||||
log_message('error'," Revenue Emr-po Req Raised Number".$RegNo);
|
||||
}
|
||||
// echo "i HAVE".$RegNo;
|
||||
// die();
|
||||
$Req = $this->requistion_model->addRequistion($Request);
|
||||
|
||||
$RegNo='';
|
||||
if(count($Req)>0)
|
||||
{
|
||||
$RegNo = $Req[0]['ReqNo'];
|
||||
}
|
||||
// PO Master
|
||||
|
||||
$POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Supplier_Reference'=>$supplierreference,'Other_Reference'=>$otherreference,'InsuranceNumber'=>$insuranceno,'InsuranceStatus'=>$insurancestatus,'Fincap'=>$fincap,'POSubType'=>$revenuetype,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType);
|
||||
//print_r($POList);
|
||||
//echo "\n *** ";
|
||||
$POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$revenuetype);
|
||||
//print_r($POList);
|
||||
$POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$revenuetype);
|
||||
|
||||
$PONO = '';
|
||||
if(count($POMaster)>0)
|
||||
{
|
||||
$PONO = $POMaster[0]['PONO'];
|
||||
log_message('error'," Revenue Emr-po Number .".$PONO);
|
||||
}
|
||||
//echo $PONO;
|
||||
// PO Line Items
|
||||
$RegDetailsStatus=REQITEM_POCREATED;
|
||||
$LineItemStatus = REQITEM_NEW;
|
||||
$PONO = '';
|
||||
if(count($POMaster)>0)
|
||||
{
|
||||
$PONO = $POMaster[0]['PONO'];
|
||||
}
|
||||
//echo $PONO;
|
||||
// PO Line Items
|
||||
$RegDetailsStatus=REQITEM_POCREATED;
|
||||
$LineItemStatus = REQITEM_NEW;
|
||||
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
|
||||
$MaterialCode = $this->input->post('materialCode'.$i);
|
||||
@ -718,7 +721,7 @@ $prefile =array();
|
||||
$FreightType = $this->input->post('FreightType'.$i);
|
||||
$FreightValue = $this->input->post('FreightVal'.$i);
|
||||
$AfterFreightValue = $this->input->post('AfterFreightVal'.$i);
|
||||
$NOOfTrip = $this->input->post('NoOfTrip'.$i);
|
||||
$NOOfTrip = $this->input->post('NoOfTrip'.$i);
|
||||
$InsuranceValue = $this->input->post('Insval'.$i);
|
||||
$TotalOrderValue = $this->input->post('TotalOrderValue'.$i);
|
||||
$revenuedescription = $this->input->post('service_description'.$i);
|
||||
@ -743,196 +746,231 @@ $prefile =array();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if($SkipInsert == "False")
|
||||
}
|
||||
if($SkipInsert == "False")
|
||||
{
|
||||
//add requistion details
|
||||
$ReqDetails = array('ReqNo'=>$RegNo, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Status'=>$RegDetailsStatus,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$createddt);
|
||||
// print_r($ReqDetails);
|
||||
$ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails);
|
||||
log_message('error'," Revenue Emr-po RequistionDetails count . ".count($ReqDetQuery)." ReqNo".isset($ReqDetQuery[0]['ItemNo'])?$ReqDetQuery[0]['ItemNo']:" -- ");
|
||||
|
||||
//add requistion details
|
||||
$ReqDetails = array('ReqNo'=>$RegNo, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Status'=>$RegDetailsStatus,'UpdatedBy'=>$CreateBy,'UpdatedOn'=>$createddt);
|
||||
|
||||
|
||||
$ReqDetQuery = $this->requistion_model->addRequistionDetails($ReqDetails);
|
||||
|
||||
$POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$RegNo,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'Per'=>$per,'ServiceMaterialDescription'=>$revenuedescription);
|
||||
//print_r($POLineItemList);
|
||||
//echo "\n *** ";
|
||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||
|
||||
//$LineItemNo = 'LI000';
|
||||
|
||||
$LineItemNo = '';
|
||||
if(count($POLineItem)>0)
|
||||
{
|
||||
$LineItemNo = $POLineItem[0]['LineItemNo'];
|
||||
log_message('error'," Revenue Emr-po Line Item Number . ".$LineItemNo);
|
||||
}
|
||||
//echo $LineItemNo;
|
||||
|
||||
/*----------------------------*/
|
||||
// $logpo =array('PONO'=>$PONO,'Date'=>$PODate,'POType'=>$POType,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'SupplierID'=>$SupplierID,'LineItemNos'=>$LineItemNo);
|
||||
/*----------------------------*/
|
||||
// $logpo =array('PONO'=>$PONO,'Date'=>$PODate,'POType'=>$POType,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'SupplierID'=>$SupplierID,'LineItemNos'=>$LineItemNo);
|
||||
|
||||
// $logaddpo = $this->purchaseorder_model->newlogpo($logpo);
|
||||
|
||||
|
||||
// $logaddpo = $this->purchaseorder_model->newlogpo($logpo);
|
||||
|
||||
/*----------------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
if(trim($POType) == REVENUE )
|
||||
{
|
||||
// echo 'Success';
|
||||
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt, 'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip);
|
||||
//print_r($RevenueTaxList);
|
||||
//echo "\n";
|
||||
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
|
||||
//echo 'Revenue tax Success';
|
||||
log_message('error'," Revenue Emr-po tax Successfully . ");
|
||||
// echo 'Success';
|
||||
$RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt, 'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip);
|
||||
//print_r($RevenueTaxList);
|
||||
$RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList);
|
||||
//echo 'Revenue tax Success';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($txtspl==1 || $txtspl==2)
|
||||
{
|
||||
$PONOigr = $PONO;
|
||||
if($txtspl==1 || $txtspl==2)
|
||||
{
|
||||
|
||||
//secho "cwwe";
|
||||
//die();
|
||||
|
||||
$PONOigr = $PONO;
|
||||
|
||||
//echo $PONOigr;
|
||||
//die();
|
||||
//IGR Data Entry
|
||||
//$DeliveryChellanOrInvoiceNo = $this->input->post('ChallanInvNo');
|
||||
|
||||
$DeliveryChellanInvoiceNo=$this->input->post('ChallanInvNo');
|
||||
|
||||
//IGR Data Entry
|
||||
//$DeliveryChellanOrInvoiceNo = $this->input->post('ChallanInvNo');
|
||||
$DeliveryChellan = $this->input->post('ChallanInvDate');
|
||||
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
|
||||
|
||||
$MaterialReceive = $this->input->post('MRC');
|
||||
$MaterialReceivedate = $this->getDateformat($MaterialReceive);
|
||||
|
||||
$DeliveryChellanInvoiceNo=$this->input->post('ChallanInvNo');
|
||||
|
||||
$DeliveryChellan = $this->input->post('ChallanInvDate');
|
||||
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
|
||||
|
||||
$MaterialReceive = $this->input->post('MRC');
|
||||
$MaterialReceivedate = $this->getDateformat($MaterialReceive);
|
||||
$Vehicle = $this->input->post('VehicleNo');
|
||||
$Courier = $this->input->post('CourierNo');
|
||||
|
||||
|
||||
$Vehicle = $this->input->post('VehicleNo');
|
||||
$Courier = $this->input->post('CourierNo');
|
||||
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
|
||||
$Remarksmrir='Emergency PO without Quality Check';
|
||||
//$Remarks = $this->input->post('Remarks');
|
||||
//$RowCount = $this->input->post('TextRowCount');
|
||||
//echo $RowCount;
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
$IGRStatus = IGR_CREATED;
|
||||
$Remarksmrir='Emergency PO without Quality Check';
|
||||
//$Remarks = $this->input->post('Remarks');
|
||||
//$RowCount = $this->input->post('TextRowCount');
|
||||
//echo $RowCount;
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
$IGRStatus = IGR_CREATED;
|
||||
|
||||
|
||||
|
||||
$igr = array();
|
||||
$paymentstatus = NO_PAIDIGR;
|
||||
$igr = array('PONO'=>$PONO,'VehicleNo'=>$Vehicle,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$DeliveryChellanDate,'CourierNo'=>$Courier,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt,'MaterialRcvdDate'=>$MaterialReceivedate,'Paymentstatus'=>$paymentstatus);
|
||||
$igr = array();
|
||||
$paymentstatus = NO_PAIDIGR;
|
||||
$igr = array('PONO'=>$PONO,'VehicleNo'=>$Vehicle,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'MaterialRcvdDate'=>$DeliveryChellanDate,'CourierNo'=>$Courier,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt,'MaterialRcvdDate'=>$MaterialReceivedate,'Paymentstatus'=>$paymentstatus);
|
||||
|
||||
//print_r($igr);
|
||||
//echo "\n";
|
||||
//print_r($igr);
|
||||
|
||||
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
||||
//$IGRNO = 'igr001';
|
||||
$IGRNO = '';
|
||||
if(count($igrM)>0)
|
||||
{
|
||||
foreach ($igrM as $key )
|
||||
{
|
||||
$IGRNO=$key->IGRNO;
|
||||
log_message('error'," Revenue Emr-po IGR Number.".$IGRNO);
|
||||
}
|
||||
}
|
||||
if($Qualitycheck==0)
|
||||
{
|
||||
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
||||
|
||||
|
||||
$mrirmastervalues = array('MRIRStatus'=>MRIR_APPROVED,'IGRNO'=>$IGRNO,'PONO'=>$PONO,'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt,'Remarks'=>$Remarksmrir);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$IGRNO = '';
|
||||
if(count($igrM)>0)
|
||||
{
|
||||
foreach ($igrM as $key )
|
||||
{
|
||||
$IGRNO=$key->IGRNO;
|
||||
}
|
||||
}
|
||||
// echo $IGRNO;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($Qualitycheck==0)
|
||||
{
|
||||
|
||||
|
||||
$mrirmastervalues = array('MRIRStatus'=>MRIR_APPROVED,'IGRNO'=>$IGRNO,'PONO'=>$PONO,'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt,'Remarks'=>$Remarksmrir);
|
||||
|
||||
$mrirmaster = $this->mrir_model->master_mrir($mrirmastervalues);
|
||||
$mrirmaster = $this->mrir_model->master_mrir($mrirmastervalues);
|
||||
|
||||
|
||||
// $MRIRNO = 'MRIR001';
|
||||
$MRIRNO = '';
|
||||
$MRIRNO = '';
|
||||
|
||||
|
||||
if(count($mrirmaster)>0)
|
||||
{
|
||||
foreach ($mrirmaster as $key ) {
|
||||
if(count($mrirmaster)>0)
|
||||
|
||||
{
|
||||
foreach ($mrirmaster as $key ) {
|
||||
|
||||
$MRIRNO=$key->MRIRNo; }
|
||||
log_message('error'," Revenue Emr-po MRIR Number.".$MRIRNO);
|
||||
}
|
||||
$MRIRNO=$key->MRIRNo; }
|
||||
}
|
||||
|
||||
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
|
||||
|
||||
$MaterialCode = $this->input->post('materialCode'.$i);
|
||||
$Quantity = $this->input->post('quantity'.$i);
|
||||
$Remarked = "Special PO Without Quality Check";
|
||||
$MRIRStatus=MRIR_APPROVED;
|
||||
$MaterialCode = $this->input->post('materialCode'.$i);
|
||||
$Quantity = $this->input->post('quantity'.$i);
|
||||
|
||||
$Remarked = "Special PO Without Quality Check";
|
||||
|
||||
$MRIRStatus=MRIR_APPROVED;
|
||||
|
||||
|
||||
|
||||
//this array to store the value in child table..
|
||||
$mrirdetailvalues = array('MRIRNO'=>$MRIRNO,'MaterialCode'=>$MaterialCode,'ActualQuantityReceived'=>$Quantity,'Remarks'=>$Remarked,'MRIRStatus'=>$MRIRStatus);
|
||||
//this array to store the value in child table..
|
||||
$mrirdetailvalues = array('MRIRNO'=>$MRIRNO,'MaterialCode'=>$MaterialCode,'ActualQuantityReceived'=>$Quantity,'Remarks'=>$Remarked,'MRIRStatus'=>$MRIRStatus);
|
||||
|
||||
// print_r($mrirdetailvalues);
|
||||
// echo 'MRIRItemNo001';
|
||||
$mrirdetails = $this->mrir_model->detail_mrir($mrirdetailvalues);
|
||||
log_message('error'," Revenue Emr-po MRIR Item Number.".$mrirdetails[0]['MRIRItemNo']);
|
||||
$getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim($MaterialCode));
|
||||
// print_r($getAvailableqty);
|
||||
// echo "\n get available Qty";
|
||||
if(count($getAvailableqty)>0)
|
||||
|
||||
//print_r($mrirdetailvalues);
|
||||
//die();
|
||||
|
||||
$mrirdetails = $this->mrir_model->detail_mrir($mrirdetailvalues);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim($MaterialCode));
|
||||
|
||||
if(count($getAvailableqty)>0)
|
||||
{
|
||||
$avlQty = $getAvailableqty[0]['Quantity'];
|
||||
}
|
||||
|
||||
$updatStock = array('Quantity'=>($Quantity+$avlQty),'Status'=>'0','UpdatedOn'=>$createddt,'UpdatedBy'=>$CreatedBy,'Remarks'=>'Stock added for '. $MRIRNO);
|
||||
// print_r($updatStock);
|
||||
// echo "\n updat Stock";
|
||||
$this->mrir_model->UpdateStock($updatStock,trim($MaterialCode));
|
||||
$updatStock = array('Quantity'=>($Quantity+$avlQty),'Status'=>'0','UpdatedOn'=>$createddt,'UpdatedBy'=>$CreatedBy,'Remarks'=>'Stock added for '. $MRIRNO);
|
||||
|
||||
$this->mrir_model->UpdateStock($updatStock,trim($MaterialCode));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$IGRItemStatus = REQITEM_NEW;
|
||||
}
|
||||
|
||||
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
|
||||
|
||||
$IGRItemStatus = REQITEM_NEW;
|
||||
|
||||
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
|
||||
$MaterialCode = trim($this->input->post('materialCode'.$i));
|
||||
$MaterialCode = trim($this->input->post('materialCode'.$i));
|
||||
|
||||
$QuantityAsPerInvoice = $this->input->post('quantity'.$i);
|
||||
$QuantityAsPerInvoice = $this->input->post('quantity'.$i);
|
||||
|
||||
$OrderedQuantity = $this->input->post('quantity'.$i);
|
||||
$OrderedQuantity = $this->input->post('quantity'.$i);
|
||||
|
||||
$ReceivedQty = $this->input->post('AQuantity'.$i);
|
||||
$ReceivedQty = $this->input->post('AQuantity'.$i);
|
||||
|
||||
$emergencyitemcode = $this->input->post('emergencyitemcode');
|
||||
$emergencyitemcode = $this->input->post('emergencyitemcode');
|
||||
|
||||
$PendingQty = 0;
|
||||
//echo $QuantityAsPerInvoice;
|
||||
//echo $PendingQty.'ReceivedQty'.$ReceivedQty;
|
||||
//echo ' ';
|
||||
$PendingQty = 0;
|
||||
//echo $QuantityAsPerInvoice;
|
||||
//echo $PendingQty.'ReceivedQty'.$ReceivedQty;
|
||||
//echo ' ';
|
||||
|
||||
if(strlen($QuantityAsPerInvoice)>0 && $QuantityAsPerInvoice != '0')
|
||||
{
|
||||
$Remarks = "Special PO Created";
|
||||
$ItemStatus = '';
|
||||
//if($QuantityAsPerInvoice == $OrderedQuantity)
|
||||
if(strlen($QuantityAsPerInvoice)>0 && $QuantityAsPerInvoice != '0')
|
||||
{
|
||||
$Remarks = "Special PO Created";
|
||||
$ItemStatus = '';
|
||||
//if($QuantityAsPerInvoice == $OrderedQuantity)
|
||||
|
||||
if($PendingQty == 0.00 )
|
||||
{
|
||||
$ItemStatus = IGR_CREATED;
|
||||
}
|
||||
else
|
||||
{
|
||||
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
|
||||
}
|
||||
if($PendingQty == 0.00 )
|
||||
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
{
|
||||
$ItemStatus = IGR_CREATED;
|
||||
}
|
||||
else
|
||||
{
|
||||
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
|
||||
}
|
||||
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
|
||||
|
||||
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt);
|
||||
@ -940,52 +978,52 @@ $prefile =array();
|
||||
|
||||
//print_r($igrDetails);
|
||||
|
||||
//echo "\n **** ";
|
||||
|
||||
|
||||
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
||||
|
||||
//print_r($igrD);
|
||||
//* ================================================== * /
|
||||
//$IGRItemNo = 'IGRItemNo001';
|
||||
|
||||
|
||||
//print_r($igrD);
|
||||
//* ================================================== * /
|
||||
$IGRItemNo = '';
|
||||
foreach($igrD as $value)
|
||||
{
|
||||
|
||||
$IGRItemNo = $value->IGRItemNo;
|
||||
log_message('error'," Revenue Emr-po IGR Item Number.".$IGRItemNo);
|
||||
}
|
||||
|
||||
//echo $IGRItemNo;
|
||||
//echo $IGRItemNo;
|
||||
$MaterialstockHistoryadd= array('Ref_No'=>$IGRItemNo,'MaterialCode'=>$MaterialCode,'Transaction_type'=>'Add','Ref_Type'=>'IGR','SupplierID'=>$SupplierID,'Quantity'=>$QuantityAsPerInvoice,'ItemValue'=>$itemRate,'CreatedBy'=>$CreatedBy,'CreatedOn'=>$createddt);
|
||||
|
||||
|
||||
$MStockHistory = $this->inwardgateregister_model->addMaterialStockHistory($MaterialstockHistoryadd);
|
||||
//print_r($MaterialstockHistoryadd);
|
||||
log_message('error'," Revenue Emr-po Material Stock History added. count ".count($MStockHistory));
|
||||
//*=====================================================*/
|
||||
$this->inwardgateregister_model->addMaterialStockHistory($MaterialstockHistoryadd);
|
||||
//*=====================================================*/
|
||||
|
||||
|
||||
//*===================================================*/
|
||||
//*===================================================*/
|
||||
|
||||
$get_pre_qty= $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||
$av_qty=0;
|
||||
if(!empty($get_pre_qty))
|
||||
{
|
||||
foreach($get_pre_qty as $gt)
|
||||
{
|
||||
$av_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
$get_pre_qty= $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||
$av_qty=0;
|
||||
if(!empty($get_pre_qty))
|
||||
{
|
||||
foreach($get_pre_qty as $gt)
|
||||
{
|
||||
$av_qty=$gt->Current_stock;
|
||||
}
|
||||
}
|
||||
|
||||
$currentav_qty= $QuantityAsPerInvoice+$av_qty;
|
||||
$currentav_qty= $QuantityAsPerInvoice+$av_qty;
|
||||
|
||||
|
||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||
// print_r($current_qty);
|
||||
// echo "\n ****";
|
||||
$mMaster = $this->inwardgateregister_model->addmaterialmaster($current_qty,$MaterialCode);
|
||||
log_message('error'," Revenue Emr-po Material Master Qty added.".$mMaster);
|
||||
$current_qty= array('Current_stock'=>$currentav_qty);
|
||||
|
||||
//*==================================================*/
|
||||
$this->inwardgateregister_model->addmaterialmaster($current_qty,$MaterialCode);
|
||||
|
||||
|
||||
|
||||
|
||||
//*==================================================*/
|
||||
|
||||
|
||||
|
||||
@ -998,115 +1036,123 @@ $prefile =array();
|
||||
$ReceivedQuantity=$key->ReceivedQuantity;
|
||||
}
|
||||
}
|
||||
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
|
||||
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
|
||||
|
||||
//echo '';
|
||||
|
||||
$POLineItem = array('ReceivedQuantity'=>$totalReceivedqty,'Status'=>$ItemStatus,'UpdateBY'=>$CreatedBy,'UpdatedOn'=>$createddt );
|
||||
|
||||
$pod = $this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
|
||||
log_message('error'," Revenue Emr-po updating PO.sub details totalReceivedqty,Status ".$totalReceivedqty." ".$ItemStatus." ".$pod);
|
||||
}
|
||||
|
||||
|
||||
//$myfile = array('FilePath'=>$filename);
|
||||
// $emergencyitemcode = $this->input->post('emergencyitemcode'.$i);
|
||||
// ($this->input->post('materialCode'.$i));
|
||||
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem,$PONO,$MaterialCode);
|
||||
}
|
||||
|
||||
|
||||
//$myfile = array('FilePath'=>$filename);
|
||||
// $emergencyitemcode = $this->input->post('emergencyitemcode'.$i);
|
||||
// ($this->input->post('materialCode'.$i));
|
||||
|
||||
}
|
||||
|
||||
$counts = $this->input->post('hidecounter');
|
||||
$constants = $this->input->post('hideconstant');
|
||||
$counts = $this->input->post('hidecounter');
|
||||
$constants = $this->input->post('hideconstant');
|
||||
|
||||
|
||||
// $arr = [];
|
||||
// $arr = [];
|
||||
|
||||
// for($i=1;$i<=$constants;$i++){
|
||||
// $pathname = 'browseFiles'.$i;
|
||||
// for($i=1;$i<=$constants;$i++){
|
||||
// $pathname = 'browseFiles'.$i;
|
||||
|
||||
|
||||
|
||||
// if(!empty($_FILES[$pathname]['name']))
|
||||
// {
|
||||
// $Picture = $this->addfile($pathname);
|
||||
// //echo $Picture;
|
||||
// $arr[$i] = array($Picture);
|
||||
// }
|
||||
// if(!empty($_FILES[$pathname]['name']))
|
||||
// {
|
||||
// $Picture = $this->addfile($pathname);
|
||||
// //echo $Picture;
|
||||
// $arr[$i] = array($Picture);
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
$arr = [];
|
||||
$prefile =array();
|
||||
$arr = [];
|
||||
$prefile =array();
|
||||
|
||||
for($i=1;$i<=$constants;$i++)
|
||||
{
|
||||
$pathname = 'browseFiles'.$i;
|
||||
log_message('error'," Revenue Emr-po Browse File Path Name ".$pathname);
|
||||
for($i=1;$i<=$constants;$i++)
|
||||
{
|
||||
$pathname = 'browseFiles'.$i;
|
||||
|
||||
if(!empty($_FILES[$pathname]['name']))
|
||||
{
|
||||
if(!empty($_FILES[$pathname]['name']))
|
||||
{
|
||||
|
||||
$files = str_replace(" ","",$_FILES[$pathname]['name']);
|
||||
log_message('error'," Revenue Emr-po File Name ".$files);
|
||||
$files = str_replace(" ","",$_FILES[$pathname]['name']);
|
||||
|
||||
$fcount = 0;
|
||||
$fcount = 0;
|
||||
|
||||
foreach ($prefile as $value)
|
||||
{
|
||||
|
||||
if($value == $files) $fcount++;
|
||||
foreach ($prefile as $value)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
if($fcount == 0)
|
||||
{
|
||||
$Picture = $this->addfile($pathname);
|
||||
log_message('error'," Revenue Emr-po File status ".$Picture);
|
||||
$arr[] = array($Picture);
|
||||
|
||||
}
|
||||
|
||||
$prefile[] = $files;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arr))
|
||||
if($value == $files)
|
||||
{
|
||||
foreach($arr as $ma)
|
||||
{
|
||||
|
||||
$index = 0;
|
||||
$filename = null;
|
||||
foreach($ma as $key=>$value)
|
||||
{
|
||||
$index++;
|
||||
if($index == 1){
|
||||
$filename = $value;
|
||||
}
|
||||
}
|
||||
if(!empty($filename)){
|
||||
|
||||
$myfile = array('FilePath'=>$filename,'PONO'=>$PONO,'IGRNO'=>$IGRNO);
|
||||
//print_r($myfile);
|
||||
$fileno = $this->purchaseorder_model->fileupload($myfile);
|
||||
log_message('error'," Revenue Emr-po File Number.".$fileno);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$fcount++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($fcount == 0)
|
||||
{
|
||||
$Picture = $this->addfile($pathname);
|
||||
//echo $Picture;
|
||||
$arr[] = array($Picture);
|
||||
|
||||
}
|
||||
|
||||
$prefile[] = $files;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arr))
|
||||
{
|
||||
foreach($arr as $ma)
|
||||
{
|
||||
|
||||
|
||||
$index = 0;
|
||||
$filename = null;
|
||||
foreach($ma as $key=>$value)
|
||||
{
|
||||
$index++;
|
||||
if($index == 1){
|
||||
$filename = $value;
|
||||
}
|
||||
}
|
||||
if(!empty($filename))
|
||||
{
|
||||
|
||||
$myfile = array('FilePath'=>$filename,'PONO'=>$PONO,'IGRNO'=>$IGRNO);
|
||||
$this->purchaseorder_model->fileupload($myfile);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
|
||||
log_message('error'," Revenue Emr-po successfully created. ".$PONO);
|
||||
redirect('purchaseorder/PurchaseOrderList','refresh');
|
||||
|
||||
|
||||
|
||||
echo "<script>alert('You Have Successfully created the Purchase order! $PONO');</script>";
|
||||
redirect('purchaseorder/PurchaseOrderList','refresh');
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -588,7 +588,7 @@ $prefile =array();
|
||||
$IGRNO=$key->IGRNO;
|
||||
}
|
||||
}
|
||||
echo $IGRNO;
|
||||
//echo $IGRNO;
|
||||
|
||||
$IGRItemStatus = REQITEM_NEW;
|
||||
$TotalPendingQty = '';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -984,9 +984,12 @@ function phpAlert($msg) {
|
||||
}
|
||||
|
||||
$Estimate_first = explode(".",$Estimate);
|
||||
if(!is_numeric($Estimate) || (strlen((string)$Estimate))>8 || (strlen((string)$Estimate_first[0]))> 5)
|
||||
if(!is_numeric($Estimate) || (strlen((string)$Estimate))>8 || (strlen((string)$Estimate_first[0]))> 7)
|
||||
{
|
||||
//echo $EmpID . "-Loan Recoverd Invalid Data!";
|
||||
// echo $Estimate;
|
||||
// print_r($Estimate_first);
|
||||
|
||||
// echo $EmpID . "-Loan Recoverd Invalid Data!";
|
||||
$ErrorFlag++;
|
||||
}
|
||||
|
||||
@ -1008,6 +1011,9 @@ function phpAlert($msg) {
|
||||
|
||||
|
||||
}
|
||||
// echo $TotalErrorFlag;
|
||||
// echo $ErrorEmpId;
|
||||
// die();
|
||||
|
||||
if($TotalErrorFlag == 0)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -514,8 +514,8 @@ class report extends BaseController
|
||||
$PO= $this->input->post('id');
|
||||
|
||||
//$PONO= substr($PO,10);
|
||||
$split_id = explode('-', $PO,2);
|
||||
$PONO=$split_id[1];
|
||||
$split_id = explode('-', $PO,2);
|
||||
$PONO=$split_id[1];
|
||||
$data = $this->dahsboard_Model->getfile($PONO);
|
||||
|
||||
// print_r( $data);die;
|
||||
@ -535,10 +535,8 @@ class report extends BaseController
|
||||
//echo $PONO; die;
|
||||
|
||||
$igrfile= $this->dahsboard_Model->getfiles($igr,$PONO);
|
||||
print_r($igrfile);
|
||||
// $igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO);
|
||||
$billfile = $this->dahsboard_Model->viewIGRFile1($igr,$PONO);
|
||||
print_r($billfile);
|
||||
|
||||
$data = array_merge($igrfile,$billfile);
|
||||
|
||||
|
||||
@ -29,7 +29,6 @@ class requisitionform extends BaseController
|
||||
*/
|
||||
function requisitionlisting()
|
||||
{
|
||||
log_message('error'," Requisition Listing Fns Called");
|
||||
$this->global['pageTitle'] = 'Siddharth : Requisition Listing';
|
||||
|
||||
$userID = $this->session->userdata ( 'userId' );
|
||||
@ -52,7 +51,6 @@ class requisitionform extends BaseController
|
||||
|
||||
function requisition()
|
||||
{
|
||||
log_message('error'," Raise Requisition Fns Called");
|
||||
$this->global['pageTitle'] = 'Siddharth : Raise Requisition';
|
||||
|
||||
$data['RequestType'] = $this->requistion_model->getConfigValue('C020');
|
||||
@ -60,7 +58,6 @@ class requisitionform extends BaseController
|
||||
$data['EmpList'] = $this->requistion_model->getAllEmployees();
|
||||
$data['ServiceOption'] = $this->requistion_model->getConfigValue('C022');
|
||||
$userID = $this->session->userdata ( 'userId' );
|
||||
log_message('error'," Raise Requisition userId ".$userID);
|
||||
|
||||
$data['Emp'] = $this->requistion_model->getEmpIdByUserID($userID);
|
||||
|
||||
@ -355,7 +352,6 @@ class requisitionform extends BaseController
|
||||
function addNewRequistion()
|
||||
{
|
||||
|
||||
log_message('error'," add new Requisition Fns Called");
|
||||
$this->form_validation->set_rules('RequestType','RequestType','trim|required');
|
||||
$this->form_validation->set_rules('EmpID','EmpID','trim|required');
|
||||
|
||||
@ -365,18 +361,17 @@ class requisitionform extends BaseController
|
||||
}
|
||||
else
|
||||
{
|
||||
log_message('error'," add new Requisition GET[ID] ".$_GET['ID']);
|
||||
$Status= $_GET['ID'];
|
||||
log_message('error'," add new Requisition GET[ID] ".$_GET['ID']);
|
||||
|
||||
$RequestType = strtoupper(trim($this->input->post('RequestType')));
|
||||
$Requestedby = strtoupper(trim($this->input->post('EmpID')));
|
||||
log_message('error'," add new Requisition empid ".$Requestedby);
|
||||
$RequestedbyDept = $this->session->userdata ( 'DEPCode' );
|
||||
$CostCenter = $this->input->post('CostCenter');
|
||||
$CreateBy = $this->session->userdata ( 'userId' );
|
||||
$UpdatedBy = $this->session->userdata ( 'userId' );
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
|
||||
$UpdatedBy = $this->session->userdata ( 'userId' );
|
||||
$DeletedRow = $this->input->post('txtDeletedRow');
|
||||
$RowCount = $this->input->post('txtRowCount');
|
||||
|
||||
@ -439,8 +434,8 @@ class requisitionform extends BaseController
|
||||
$Quantity = $this->input->post('Quantity'.$i);
|
||||
$OtherD = $this->input->post('otherD'.$i);
|
||||
|
||||
//$ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'MaterialDescription'=>$OtherD);
|
||||
$ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'MaterialDescription'=>$OtherD,'UpdatedBy'=>$UpdatedBy);
|
||||
// $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'MaterialDescription'=>$OtherD);
|
||||
$ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'MaterialDescription'=>$OtherD,'UpdatedBy'=>$UpdatedBy);
|
||||
$this->requistion_model->addRequistionDetails($ReqDetails,$ReqNumber);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -131,10 +131,10 @@ where (CurrentStock+OpeningStock)<reorder";
|
||||
|
||||
|
||||
|
||||
// $query=$CI->db->query($subQuery,array());
|
||||
$query=$CI->db->query($subQuery,array());
|
||||
//print_r($this->db->last_query());
|
||||
|
||||
return array();
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,73 +1,73 @@
|
||||
<?php
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
* InvoicePlane
|
||||
*
|
||||
* @author InvoicePlane Developers & Contributors
|
||||
* @copyright Copyright (c) 2012 - 2017 InvoicePlane.com
|
||||
* @license https://invoiceplane.com/license.txt
|
||||
* @link https://invoiceplane.com
|
||||
*/
|
||||
|
||||
|
||||
function generateNewToken()
|
||||
{
|
||||
$ch=curl_init();
|
||||
$refresh_token = '1000.6608673cee76166874b326b8183a38ab.5fa4b2fa427fe64c5a8700f7170e3a58';
|
||||
$client_id = '1000.T9H4WV9XTGUJRB6HRDMQANB6VT04NH';
|
||||
$client_secret = '91ec3fc047493706ae9c15c086741d90ef1de3cd6c';
|
||||
$redirect_uri = 'https://sia.sidharthindustries.com/SIA/';
|
||||
$url_getauthtoken = 'https://accounts.zoho.com/oauth/v2/token?refresh_token='.$refresh_token.'&client_id='.$client_id.'&client_secret='.$client_secret.'&redirect_uri='.$redirect_uri.'&grant_type=refresh_token';
|
||||
$accesstoken = '1000.095b66fc95fc81874c1cfc7d15b0904e.10bc9956d9b9ec14cce1350ee0cf8254';
|
||||
$headers=array('Authorization:Zoho-oauthtoken '.$accesstoken,'Content-Type:application/json');
|
||||
curl_setopt($ch, CURLOPT_URL, $url_getauthtoken);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
$body = '{}';
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS,$body);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$res_token=curl_exec($ch);
|
||||
$ress = json_decode($res_token);
|
||||
return $ress->access_token;
|
||||
}
|
||||
|
||||
|
||||
function getheringInvoiceDetails($date_today , $date_yesterday , $accesstoken)
|
||||
{
|
||||
$ch=curl_init();
|
||||
$organization_id = '655654572';
|
||||
$url_org ="https://books.zoho.com/api/v3/invoices?";
|
||||
$fields=array("usestate" => "true","organization_id" => $organization_id,"date_start" => $date_yesterday,"date_end" => $date_today);
|
||||
$data_all = http_build_query($fields);
|
||||
$headers=array('Authorization:Zoho-oauthtoken '.$accesstoken,'Content-Type:application/json');
|
||||
$data_access = $url_org.$data_all;
|
||||
curl_setopt($ch, CURLOPT_URL, $url_org.$data_access);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
$body = '{}';
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS,$body);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$result=curl_exec($ch);
|
||||
$data['headers_new'] = $headers;
|
||||
$data['data'] = curl_exec($ch);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
function getheringInvoiceSubDetails($invoice_id , $organization_id , $headers)
|
||||
{
|
||||
$ch=curl_init();
|
||||
$url2 = 'https://books.zoho.com/api/v3/invoices/'.$invoice_id.'?organization_id='.$organization_id;
|
||||
curl_setopt($ch, CURLOPT_URL, $url2);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
$body2 = '{}';
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS,$body2);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
return curl_exec($ch);
|
||||
}
|
||||
|
||||
<?php
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
* InvoicePlane
|
||||
*
|
||||
* @author InvoicePlane Developers & Contributors
|
||||
* @copyright Copyright (c) 2012 - 2017 InvoicePlane.com
|
||||
* @license https://invoiceplane.com/license.txt
|
||||
* @link https://invoiceplane.com
|
||||
*/
|
||||
|
||||
|
||||
function generateNewToken()
|
||||
{
|
||||
$ch=curl_init();
|
||||
$refresh_token = '1000.6608673cee76166874b326b8183a38ab.5fa4b2fa427fe64c5a8700f7170e3a58';
|
||||
$client_id = '1000.T9H4WV9XTGUJRB6HRDMQANB6VT04NH';
|
||||
$client_secret = '91ec3fc047493706ae9c15c086741d90ef1de3cd6c';
|
||||
$redirect_uri = 'https://sia.sidharthindustries.com/SIA/';
|
||||
$url_getauthtoken = 'https://accounts.zoho.com/oauth/v2/token?refresh_token='.$refresh_token.'&client_id='.$client_id.'&client_secret='.$client_secret.'&redirect_uri='.$redirect_uri.'&grant_type=refresh_token';
|
||||
$accesstoken = '1000.095b66fc95fc81874c1cfc7d15b0904e.10bc9956d9b9ec14cce1350ee0cf8254';
|
||||
$headers=array('Authorization:Zoho-oauthtoken '.$accesstoken,'Content-Type:application/json');
|
||||
curl_setopt($ch, CURLOPT_URL, $url_getauthtoken);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
$body = '{}';
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS,$body);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$res_token=curl_exec($ch);
|
||||
$ress = json_decode($res_token);
|
||||
return $ress->access_token;
|
||||
}
|
||||
|
||||
|
||||
function getheringInvoiceDetails($date_today , $date_yesterday , $accesstoken)
|
||||
{
|
||||
$ch=curl_init();
|
||||
$organization_id = '655654572';
|
||||
$url_org ="https://books.zoho.com/api/v3/invoices?";
|
||||
$fields=array("usestate" => "true","organization_id" => $organization_id,"date_start" => $date_yesterday,"date_end" => $date_today);
|
||||
$data_all = http_build_query($fields);
|
||||
$headers=array('Authorization:Zoho-oauthtoken '.$accesstoken,'Content-Type:application/json');
|
||||
$data_access = $url_org.$data_all;
|
||||
curl_setopt($ch, CURLOPT_URL, $url_org.$data_access);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
$body = '{}';
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS,$body);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$result=curl_exec($ch);
|
||||
$data['headers_new'] = $headers;
|
||||
$data['data'] = curl_exec($ch);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
function getheringInvoiceSubDetails($invoice_id , $organization_id , $headers)
|
||||
{
|
||||
$ch=curl_init();
|
||||
$url2 = 'https://books.zoho.com/api/v3/invoices/'.$invoice_id.'?organization_id='.$organization_id;
|
||||
curl_setopt($ch, CURLOPT_URL, $url2);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
$body2 = '{}';
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS,$body2);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
return curl_exec($ch);
|
||||
}
|
||||
|
||||
|
||||
@ -1,176 +1,176 @@
|
||||
<?php defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
|
||||
|
||||
/**
|
||||
* Class : BaseController
|
||||
* Base Class to control over all the classes
|
||||
* @author : Kishor Mali
|
||||
* @version : 1.1
|
||||
* @since : 15 November 2016
|
||||
*/
|
||||
class BaseController extends CI_Controller {
|
||||
protected $role = '';
|
||||
protected $vendorId = '';
|
||||
protected $name = '';
|
||||
protected $Designation = '';
|
||||
protected $DEPCode = '';
|
||||
protected $HeadDept = '';
|
||||
protected $DepartmentName = '';
|
||||
protected $roleText = '';
|
||||
protected $global = array ();
|
||||
|
||||
/**
|
||||
* Takes mixed data and optionally a status code, then creates the response
|
||||
*
|
||||
* @access public
|
||||
* @param array|NULL $data
|
||||
* Data to output to the user
|
||||
* running the script; otherwise, exit
|
||||
*/
|
||||
public function response($data = NULL) {
|
||||
$this->output->set_status_header ( 200 )->set_content_type ( 'application/json', 'utf-8' )->set_output ( json_encode ( $data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ) )->_display ();
|
||||
exit ();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to check the user is logged in or not
|
||||
*/
|
||||
function isLoggedIn() {
|
||||
$isLoggedIn = $this->session->userdata ( 'isLoggedIn' );
|
||||
|
||||
if (! isset ( $isLoggedIn ) || $isLoggedIn != TRUE) {
|
||||
$this->load->library('uri');
|
||||
if ($this->uri->segment(2) == 'zohobooks_api_fetch_all') {
|
||||
redirect('login/zohobooks_api_fetch_all');
|
||||
}
|
||||
redirect ( 'login' );
|
||||
} else {
|
||||
$this->role = $this->session->userdata ( 'role' );
|
||||
// print_r($this->role);die();
|
||||
// session_start();
|
||||
log_message('ERROR','#####In BaseController - isLoggedIn function ci session : ' . $this->session->userdata ( 'name' ));
|
||||
// log_message('ERR?OR','#####In BaseController - isLoggedIn function session super global methid : ' . $_SESSION['name']);
|
||||
$this->vendorId = $this->session->userdata ( 'userId' );
|
||||
$this->name = $this->session->userdata ( 'name' );
|
||||
$this->roleText = $this->session->userdata ( 'roleText' );
|
||||
//$this->Designation = $this->session->userdata ( 'Designation' );
|
||||
$this->DEPCode = $this->session->userdata ( 'DEPCode' );
|
||||
$this->HeadDept = $this->session->userdata ( 'HeadDept' );
|
||||
$this->DepartmentName = $this->session->userdata ( 'DepartmentName' );
|
||||
$this->EmpID = $this->session->userdata ( 'EmpID' );
|
||||
$this->depaccess = $this->session->userdata ('depaccess');
|
||||
$this->global ['name'] = $this->name;
|
||||
$this->global ['role'] = $this->role;
|
||||
$this->global ['role_text'] = $this->roleText;
|
||||
$this->global ['DEPCode'] = $this->DEPCode;
|
||||
$this->global ['Designation'] = $this->Designation;
|
||||
$this->global ['DepAccesslist'] = $this->depaccess;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to check the access
|
||||
*/
|
||||
function isAdmin() {
|
||||
if ($this->role != ROLE_ADMIN) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to check the access
|
||||
*/
|
||||
function isTicketter() {
|
||||
if ($this->role != ROLE_ADMIN || $this->role != ROLE_MANAGER) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to load the set of views
|
||||
*/
|
||||
function loadThis() {
|
||||
$this->global ['pageTitle'] = 'CodeInsect : Access Denied';
|
||||
|
||||
$this->load->view ( 'includes/header', $this->global );
|
||||
$this->load->view ( 'access' );
|
||||
$this->load->view ( 'includes/footer' );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to logged out user from system
|
||||
*/
|
||||
function logout() {
|
||||
ob_start();
|
||||
$this->load->driver('cache');
|
||||
$this->session->set_userdata();
|
||||
delete_cookie('ci_session');
|
||||
//$this->session->userdata = array('test' => 'tst');
|
||||
$this->session->sess_destroy();
|
||||
$this->cache->clean();
|
||||
ob_clean();
|
||||
redirect ( 'login' );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to load views
|
||||
* @param {string} $viewName : This is view name
|
||||
* @param {mixed} $headerInfo : This is array of header information
|
||||
* @param {mixed} $pageInfo : This is array of page information
|
||||
* @param {mixed} $footerInfo : This is array of footer information
|
||||
* @return {null} $result : null
|
||||
*/
|
||||
function loadViews($viewName = "", $headerInfo = NULL, $pageInfo = NULL, $footerInfo = NULL){
|
||||
|
||||
$this->load->view('includes/header', $headerInfo);
|
||||
$this->load->view($viewName, $pageInfo);
|
||||
$this->load->view('includes/footer', $footerInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used provide the pagination resources
|
||||
* @param {string} $link : This is page link
|
||||
* @param {number} $count : This is page count
|
||||
* @param {number} $perPage : This is records per page limit
|
||||
* @return {mixed} $result : This is array of records and pagination data
|
||||
*/
|
||||
function paginationCompress($link, $count, $perPage = 10) {
|
||||
$this->load->library ( 'pagination' );
|
||||
|
||||
$config ['base_url'] = base_url () . $link;
|
||||
$config ['total_rows'] = $count;
|
||||
$config ['uri_segment'] = SEGMENT;
|
||||
$config ['per_page'] = $perPage;
|
||||
$config ['num_links'] = 5;
|
||||
$config ['full_tag_open'] = '<nav><ul class="pagination">';
|
||||
$config ['full_tag_close'] = '</ul></nav>';
|
||||
$config ['first_tag_open'] = '<li class="arrow">';
|
||||
$config ['first_link'] = 'First';
|
||||
$config ['first_tag_close'] = '</li>';
|
||||
$config ['prev_link'] = 'Previous';
|
||||
$config ['prev_tag_open'] = '<li class="arrow">';
|
||||
$config ['prev_tag_close'] = '</li>';
|
||||
$config ['next_link'] = 'Next';
|
||||
$config ['next_tag_open'] = '<li class="arrow">';
|
||||
$config ['next_tag_close'] = '</li>';
|
||||
$config ['cur_tag_open'] = '<li class="active"><a href="#">';
|
||||
$config ['cur_tag_close'] = '</a></li>';
|
||||
$config ['num_tag_open'] = '<li>';
|
||||
$config ['num_tag_close'] = '</li>';
|
||||
$config ['last_tag_open'] = '<li class="arrow">';
|
||||
$config ['last_link'] = 'Last';
|
||||
$config ['last_tag_close'] = '</li>';
|
||||
|
||||
$this->pagination->initialize ( $config );
|
||||
$page = $config ['per_page'];
|
||||
$segment = $this->uri->segment ( SEGMENT );
|
||||
|
||||
return array (
|
||||
"page" => $page,
|
||||
"segment" => $segment
|
||||
);
|
||||
}
|
||||
}
|
||||
<?php defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
|
||||
|
||||
/**
|
||||
* Class : BaseController
|
||||
* Base Class to control over all the classes
|
||||
* @author : Kishor Mali
|
||||
* @version : 1.1
|
||||
* @since : 15 November 2016
|
||||
*/
|
||||
class BaseController extends CI_Controller {
|
||||
protected $role = '';
|
||||
protected $vendorId = '';
|
||||
protected $name = '';
|
||||
protected $Designation = '';
|
||||
protected $DEPCode = '';
|
||||
protected $HeadDept = '';
|
||||
protected $DepartmentName = '';
|
||||
protected $roleText = '';
|
||||
protected $global = array ();
|
||||
|
||||
/**
|
||||
* Takes mixed data and optionally a status code, then creates the response
|
||||
*
|
||||
* @access public
|
||||
* @param array|NULL $data
|
||||
* Data to output to the user
|
||||
* running the script; otherwise, exit
|
||||
*/
|
||||
public function response($data = NULL) {
|
||||
$this->output->set_status_header ( 200 )->set_content_type ( 'application/json', 'utf-8' )->set_output ( json_encode ( $data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ) )->_display ();
|
||||
exit ();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to check the user is logged in or not
|
||||
*/
|
||||
function isLoggedIn() {
|
||||
$isLoggedIn = $this->session->userdata ( 'isLoggedIn' );
|
||||
|
||||
if (! isset ( $isLoggedIn ) || $isLoggedIn != TRUE) {
|
||||
$this->load->library('uri');
|
||||
if ($this->uri->segment(2) == 'zohobooks_api_fetch_all') {
|
||||
redirect('login/zohobooks_api_fetch_all');
|
||||
}
|
||||
redirect ( 'login' );
|
||||
} else {
|
||||
$this->role = $this->session->userdata ( 'role' );
|
||||
// print_r($this->role);die();
|
||||
// session_start();
|
||||
log_message('ERROR','#####In BaseController - isLoggedIn function ci session : ' . $this->session->userdata ( 'name' ));
|
||||
// log_message('ERR?OR','#####In BaseController - isLoggedIn function session super global methid : ' . $_SESSION['name']);
|
||||
$this->vendorId = $this->session->userdata ( 'userId' );
|
||||
$this->name = $this->session->userdata ( 'name' );
|
||||
$this->roleText = $this->session->userdata ( 'roleText' );
|
||||
//$this->Designation = $this->session->userdata ( 'Designation' );
|
||||
$this->DEPCode = $this->session->userdata ( 'DEPCode' );
|
||||
$this->HeadDept = $this->session->userdata ( 'HeadDept' );
|
||||
$this->DepartmentName = $this->session->userdata ( 'DepartmentName' );
|
||||
$this->EmpID = $this->session->userdata ( 'EmpID' );
|
||||
$this->depaccess = $this->session->userdata ('depaccess');
|
||||
$this->global ['name'] = $this->name;
|
||||
$this->global ['role'] = $this->role;
|
||||
$this->global ['role_text'] = $this->roleText;
|
||||
$this->global ['DEPCode'] = $this->DEPCode;
|
||||
$this->global ['Designation'] = $this->Designation;
|
||||
$this->global ['DepAccesslist'] = $this->depaccess;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to check the access
|
||||
*/
|
||||
function isAdmin() {
|
||||
if ($this->role != ROLE_ADMIN) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to check the access
|
||||
*/
|
||||
function isTicketter() {
|
||||
if ($this->role != ROLE_ADMIN || $this->role != ROLE_MANAGER) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to load the set of views
|
||||
*/
|
||||
function loadThis() {
|
||||
$this->global ['pageTitle'] = 'CodeInsect : Access Denied';
|
||||
|
||||
$this->load->view ( 'includes/header', $this->global );
|
||||
$this->load->view ( 'access' );
|
||||
$this->load->view ( 'includes/footer' );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to logged out user from system
|
||||
*/
|
||||
function logout() {
|
||||
ob_start();
|
||||
$this->load->driver('cache');
|
||||
$this->session->set_userdata();
|
||||
delete_cookie('ci_session');
|
||||
//$this->session->userdata = array('test' => 'tst');
|
||||
$this->session->sess_destroy();
|
||||
$this->cache->clean();
|
||||
ob_clean();
|
||||
redirect ( 'login' );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used to load views
|
||||
* @param {string} $viewName : This is view name
|
||||
* @param {mixed} $headerInfo : This is array of header information
|
||||
* @param {mixed} $pageInfo : This is array of page information
|
||||
* @param {mixed} $footerInfo : This is array of footer information
|
||||
* @return {null} $result : null
|
||||
*/
|
||||
function loadViews($viewName = "", $headerInfo = NULL, $pageInfo = NULL, $footerInfo = NULL){
|
||||
|
||||
$this->load->view('includes/header', $headerInfo);
|
||||
$this->load->view($viewName, $pageInfo);
|
||||
$this->load->view('includes/footer', $footerInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function used provide the pagination resources
|
||||
* @param {string} $link : This is page link
|
||||
* @param {number} $count : This is page count
|
||||
* @param {number} $perPage : This is records per page limit
|
||||
* @return {mixed} $result : This is array of records and pagination data
|
||||
*/
|
||||
function paginationCompress($link, $count, $perPage = 10) {
|
||||
$this->load->library ( 'pagination' );
|
||||
|
||||
$config ['base_url'] = base_url () . $link;
|
||||
$config ['total_rows'] = $count;
|
||||
$config ['uri_segment'] = SEGMENT;
|
||||
$config ['per_page'] = $perPage;
|
||||
$config ['num_links'] = 5;
|
||||
$config ['full_tag_open'] = '<nav><ul class="pagination">';
|
||||
$config ['full_tag_close'] = '</ul></nav>';
|
||||
$config ['first_tag_open'] = '<li class="arrow">';
|
||||
$config ['first_link'] = 'First';
|
||||
$config ['first_tag_close'] = '</li>';
|
||||
$config ['prev_link'] = 'Previous';
|
||||
$config ['prev_tag_open'] = '<li class="arrow">';
|
||||
$config ['prev_tag_close'] = '</li>';
|
||||
$config ['next_link'] = 'Next';
|
||||
$config ['next_tag_open'] = '<li class="arrow">';
|
||||
$config ['next_tag_close'] = '</li>';
|
||||
$config ['cur_tag_open'] = '<li class="active"><a href="#">';
|
||||
$config ['cur_tag_close'] = '</a></li>';
|
||||
$config ['num_tag_open'] = '<li>';
|
||||
$config ['num_tag_close'] = '</li>';
|
||||
$config ['last_tag_open'] = '<li class="arrow">';
|
||||
$config ['last_link'] = 'Last';
|
||||
$config ['last_tag_close'] = '</li>';
|
||||
|
||||
$this->pagination->initialize ( $config );
|
||||
$page = $config ['per_page'];
|
||||
$segment = $this->uri->segment ( SEGMENT );
|
||||
|
||||
return array (
|
||||
"page" => $page,
|
||||
"segment" => $segment
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,194 +1,194 @@
|
||||
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class configmodel extends CI_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is used to get the user listing count
|
||||
* @param string $searchText : This is optional search text
|
||||
* @param number $page : This is pagination offset
|
||||
* @param number $segment : This is pagination limit
|
||||
* @return array $result : This is result
|
||||
*/
|
||||
function Configlisting()
|
||||
{
|
||||
|
||||
$this->db->select('Config.Config_ID, Config.ConfigName ,Config.Comments,Config.CreatedDate');
|
||||
$this->db->from('T_ConfigMaster as Config');
|
||||
// $this->db->join('t_configdetails as Con','Con.Config_ID=Config.Config_ID');
|
||||
$this->db->order_by('Config.CreatedDate','desc');
|
||||
//$this->db->order_by('hourlyid','desc');
|
||||
|
||||
$query = $this->db->get();
|
||||
$result = $query->result();
|
||||
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* This function used to get user information by id
|
||||
* @param number $userId : This is user id
|
||||
* @return array $result : This is user information
|
||||
*/
|
||||
|
||||
function addconfigmaster($config)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_ConfigMaster', $config);
|
||||
|
||||
$insert_id = $this->db->affected_rows();
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
//return $insert_id;
|
||||
$sql='SELECT Config_ID as Config_ID FROM T_ConfigMaster Order by CreatedDate desc limit 1';
|
||||
$res = $this->db->query($sql);
|
||||
return $res->result_array();
|
||||
}
|
||||
|
||||
|
||||
function addconfigdetails($configvalue)
|
||||
{
|
||||
//print_r($configvalue);
|
||||
// $this->db->trans_start();
|
||||
$this->db->insert('T_ConfigDetails', $configvalue);
|
||||
|
||||
$insert_id = $this->db->affected_rows();
|
||||
|
||||
// $this->db->trans_complete();
|
||||
// print_r( $this->db->last_query());
|
||||
//print_r ($insert_id);die();
|
||||
return $insert_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* This function used to Department list which is not available in the Costcenter master
|
||||
* @param number $CostCenterCode : CostCenterCode as Parameter
|
||||
* @return array $result : This is user information
|
||||
*/
|
||||
function GetBudgetTypeNotinCostCenter($CostCenterCode,$ConfigID)
|
||||
{
|
||||
|
||||
$subQuery = 'select ConfigValue from T_ConfigDetails Bud where ConfigValue not in
|
||||
(select BudgetType from T_CostCenter_Budget where CostCenterCode=? and BudgetYear=(select max(BudgetYear) from T_CostCenter_Budget)) and Config_ID=?';
|
||||
|
||||
$query = $this->db->query($subQuery, array($CostCenterCode,$ConfigID));
|
||||
|
||||
// print_r($this->db->last_query());
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function GetConfigCenterMaster($ConfigID='')
|
||||
{
|
||||
//echo $ConfigID ;die();
|
||||
$this->db->select('*' );
|
||||
$this->db->from('T_ConfigMaster ');
|
||||
//$this->db->join('T_ConfigDetails con','con.Config_ID = COM.Config_ID','left');
|
||||
$this->db->where('Config_ID', $ConfigID);
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function GetConfigCenterDetails($ConfigID='')
|
||||
{
|
||||
//echo $ConfigID ;die();
|
||||
$this->db->select('*' );
|
||||
$this->db->from('T_ConfigMaster COM');
|
||||
$this->db->join('T_ConfigDetails con','con.Config_ID = COM.Config_ID','left');
|
||||
|
||||
$this->db->where('COM.Config_ID', $ConfigID);
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
function updateconfig($config,$Configid)
|
||||
{
|
||||
$this->db->where('Config_ID', $Configid);
|
||||
|
||||
$this->db->update('T_ConfigMaster', $config);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
function updateconfigvalue($configval,$Key)
|
||||
{
|
||||
$this->db->where('Key', $Key);
|
||||
|
||||
$this->db->update('T_ConfigDetails', $configval);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
function EditBudget($Budget)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_CostCenter_Budget', $Budget);
|
||||
|
||||
$insert_id = $this->db->affected_rows();
|
||||
|
||||
$this->db->trans_complete();
|
||||
// print_r( $this->db->last_query());
|
||||
return $insert_id;
|
||||
}
|
||||
|
||||
function DeleteBudget($BudgetType='',$BudgetYear='',$CostCenterCode ='')
|
||||
{
|
||||
$this->db->where("BudgetType", $BudgetType);
|
||||
$this->db->where("BudgetYear", $BudgetYear);
|
||||
$this->db->where("CostCenterCode", $CostCenterCode);
|
||||
$this->db->delete('T_CostCenter_Budget');
|
||||
//print_r( $this->db->last_query());
|
||||
}
|
||||
|
||||
function DeleteDepartment($DepCode='',$CostCode='')
|
||||
{
|
||||
$this->db->where("DEPCode", $DepCode);
|
||||
$this->db->where("CostCenterCode", $CostCode);
|
||||
$this->db->delete('T_CostCenter_Departments');
|
||||
//print_r( $this->db->last_query());
|
||||
}
|
||||
|
||||
function checkDeptCostExists($DepCode='',$CostCode='')
|
||||
{
|
||||
$this->db->select('CostCenterCode,DEPCode');
|
||||
$this->db->from('T_CostCenter_Departments');
|
||||
$this->db->where('DEPCode',$DepCode);
|
||||
$this->db->where('CostCenterCode',$CostCode);
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
if ($query->num_rows > 0) {
|
||||
return $query->result_array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to get the Config value from configuration table
|
||||
* @return array $result : This is result of the query
|
||||
*/
|
||||
function getConfigValue($ConfigID )
|
||||
{
|
||||
|
||||
$this->db->select('ConfigValue');
|
||||
$this->db->from('T_ConfigDetails');
|
||||
$this->db->where('Config_id ',$ConfigID );
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class configmodel extends CI_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* This function is used to get the user listing count
|
||||
* @param string $searchText : This is optional search text
|
||||
* @param number $page : This is pagination offset
|
||||
* @param number $segment : This is pagination limit
|
||||
* @return array $result : This is result
|
||||
*/
|
||||
function Configlisting()
|
||||
{
|
||||
|
||||
$this->db->select('Config.Config_ID, Config.ConfigName ,Config.Comments,Config.CreatedDate');
|
||||
$this->db->from('T_ConfigMaster as Config');
|
||||
// $this->db->join('t_configdetails as Con','Con.Config_ID=Config.Config_ID');
|
||||
$this->db->order_by('Config.CreatedDate','desc');
|
||||
//$this->db->order_by('hourlyid','desc');
|
||||
|
||||
$query = $this->db->get();
|
||||
$result = $query->result();
|
||||
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* This function used to get user information by id
|
||||
* @param number $userId : This is user id
|
||||
* @return array $result : This is user information
|
||||
*/
|
||||
|
||||
function addconfigmaster($config)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_ConfigMaster', $config);
|
||||
|
||||
$insert_id = $this->db->affected_rows();
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
//return $insert_id;
|
||||
$sql='SELECT Config_ID as Config_ID FROM T_ConfigMaster Order by CreatedDate desc limit 1';
|
||||
$res = $this->db->query($sql);
|
||||
return $res->result_array();
|
||||
}
|
||||
|
||||
|
||||
function addconfigdetails($configvalue)
|
||||
{
|
||||
//print_r($configvalue);
|
||||
// $this->db->trans_start();
|
||||
$this->db->insert('T_ConfigDetails', $configvalue);
|
||||
|
||||
$insert_id = $this->db->affected_rows();
|
||||
|
||||
// $this->db->trans_complete();
|
||||
// print_r( $this->db->last_query());
|
||||
//print_r ($insert_id);die();
|
||||
return $insert_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* This function used to Department list which is not available in the Costcenter master
|
||||
* @param number $CostCenterCode : CostCenterCode as Parameter
|
||||
* @return array $result : This is user information
|
||||
*/
|
||||
function GetBudgetTypeNotinCostCenter($CostCenterCode,$ConfigID)
|
||||
{
|
||||
|
||||
$subQuery = 'select ConfigValue from T_ConfigDetails Bud where ConfigValue not in
|
||||
(select BudgetType from T_CostCenter_Budget where CostCenterCode=? and BudgetYear=(select max(BudgetYear) from T_CostCenter_Budget)) and Config_ID=?';
|
||||
|
||||
$query = $this->db->query($subQuery, array($CostCenterCode,$ConfigID));
|
||||
|
||||
// print_r($this->db->last_query());
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function GetConfigCenterMaster($ConfigID='')
|
||||
{
|
||||
//echo $ConfigID ;die();
|
||||
$this->db->select('*' );
|
||||
$this->db->from('T_ConfigMaster ');
|
||||
//$this->db->join('T_ConfigDetails con','con.Config_ID = COM.Config_ID','left');
|
||||
$this->db->where('Config_ID', $ConfigID);
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function GetConfigCenterDetails($ConfigID='')
|
||||
{
|
||||
//echo $ConfigID ;die();
|
||||
$this->db->select('*' );
|
||||
$this->db->from('T_ConfigMaster COM');
|
||||
$this->db->join('T_ConfigDetails con','con.Config_ID = COM.Config_ID','left');
|
||||
|
||||
$this->db->where('COM.Config_ID', $ConfigID);
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
function updateconfig($config,$Configid)
|
||||
{
|
||||
$this->db->where('Config_ID', $Configid);
|
||||
|
||||
$this->db->update('T_ConfigMaster', $config);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
function updateconfigvalue($configval,$Key)
|
||||
{
|
||||
$this->db->where('Key', $Key);
|
||||
|
||||
$this->db->update('T_ConfigDetails', $configval);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
function EditBudget($Budget)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_CostCenter_Budget', $Budget);
|
||||
|
||||
$insert_id = $this->db->affected_rows();
|
||||
|
||||
$this->db->trans_complete();
|
||||
// print_r( $this->db->last_query());
|
||||
return $insert_id;
|
||||
}
|
||||
|
||||
function DeleteBudget($BudgetType='',$BudgetYear='',$CostCenterCode ='')
|
||||
{
|
||||
$this->db->where("BudgetType", $BudgetType);
|
||||
$this->db->where("BudgetYear", $BudgetYear);
|
||||
$this->db->where("CostCenterCode", $CostCenterCode);
|
||||
$this->db->delete('T_CostCenter_Budget');
|
||||
//print_r( $this->db->last_query());
|
||||
}
|
||||
|
||||
function DeleteDepartment($DepCode='',$CostCode='')
|
||||
{
|
||||
$this->db->where("DEPCode", $DepCode);
|
||||
$this->db->where("CostCenterCode", $CostCode);
|
||||
$this->db->delete('T_CostCenter_Departments');
|
||||
//print_r( $this->db->last_query());
|
||||
}
|
||||
|
||||
function checkDeptCostExists($DepCode='',$CostCode='')
|
||||
{
|
||||
$this->db->select('CostCenterCode,DEPCode');
|
||||
$this->db->from('T_CostCenter_Departments');
|
||||
$this->db->where('DEPCode',$DepCode);
|
||||
$this->db->where('CostCenterCode',$CostCode);
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
if ($query->num_rows > 0) {
|
||||
return $query->result_array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to get the Config value from configuration table
|
||||
* @return array $result : This is result of the query
|
||||
*/
|
||||
function getConfigValue($ConfigID )
|
||||
{
|
||||
|
||||
$this->db->select('ConfigValue');
|
||||
$this->db->from('T_ConfigDetails');
|
||||
$this->db->where('Config_id ',$ConfigID );
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@ -1772,10 +1772,10 @@ if ($cname!= ''){
|
||||
|
||||
}
|
||||
|
||||
$sql.=" group by pono,igrn";
|
||||
$sql.="group by pono,igrn";
|
||||
// echo $m;
|
||||
// echo $sid;
|
||||
// echo $sql;exit;
|
||||
//echo $sql;
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
$filequery = $query->result();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -189,8 +189,7 @@ TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
|
||||
|
||||
if($insert_id>0)
|
||||
{
|
||||
// $subQuery = 'select max(MRIRNO) as MRIRNo from T_MRIR_Master';
|
||||
$subQuery = 'select MRIRNO from T_MRIR_Master order by Createdon desc limit 1';
|
||||
$subQuery = 'select max(MRIRNO) as MRIRNo from T_MRIR_Master';
|
||||
$query = $this->db->query($subQuery);
|
||||
return $query->result();//_array();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -451,8 +451,7 @@ function purchaseorderListing($forwhat='')
|
||||
// print_r($this->db->last_query());
|
||||
if($insert_id>0)
|
||||
{
|
||||
// $subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master';
|
||||
$subQuery = 'select PONO from T_PurchaseOrder_Master order by CreatedDate desc limit 1';
|
||||
$subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master';
|
||||
|
||||
$query = $this->db->query($subQuery);
|
||||
|
||||
@ -491,8 +490,7 @@ function purchaseorderListing($forwhat='')
|
||||
// print_r($this->db->last_query());
|
||||
if($insert_id>0)
|
||||
{
|
||||
//$subQuery = 'select max(LineItemNo) as LineItemNo from T_PurchaseOrder_LineItem';
|
||||
$subQuery = 'select LineItemNo from T_PurchaseOrder_LineItem order by CreatedDate desc limit 1';
|
||||
$subQuery = 'select max(LineItemNo) as LineItemNo from T_PurchaseOrder_LineItem';
|
||||
|
||||
$query = $this->db->query($subQuery);
|
||||
|
||||
|
||||
@ -547,4 +547,4 @@ ifnull(Po.Quantity,0) as POQTY,sta.StatusName
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -350,7 +350,7 @@ class requistion_model extends CI_Model
|
||||
$this->db->trans_complete();
|
||||
if($insert_id>0)
|
||||
{
|
||||
$subQuery = 'select ReqNo from T_Requestion_Master order by CreatedDate desc limit 1';
|
||||
$subQuery = 'select max(ReqNo) as ReqNo from T_Requestion_Master';
|
||||
|
||||
$query = $this->db->query($subQuery);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
78
application/models/zohobook_api_model.php
Normal file
78
application/models/zohobook_api_model.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
class Zohobook_api_model extends CI_Model {
|
||||
|
||||
public function ip_tax_rates($gst)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from('ip_tax_rates');
|
||||
$this->db->where('tax_rate_percent', $gst);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result_array();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function ip_clients($gst_no)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from('ip_clients');
|
||||
$this->db->where('client_tax_code', $gst_no);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result_array();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function ip_products($sku)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from('ip_products');
|
||||
$this->db->where('sku', $sku);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result_array();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function ip_invoices($invoice_number , $invoice_date)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from('ip_invoices');
|
||||
$this->db->where('invoice_number', $invoice_number);
|
||||
$this->db->where('invoice_date_created', $invoice_date);
|
||||
$query = $this->db->get();
|
||||
$query = $query->num_rows();
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function insert($data,$table)
|
||||
{
|
||||
$this->db->insert($table,$data);
|
||||
return $this->db->insert_id();
|
||||
}
|
||||
|
||||
function sql_invoice_update($action, $invoice_number, $invoice_date_created ,$table)
|
||||
{
|
||||
// echo 'model';
|
||||
// print_r($action);
|
||||
// echo '<br>';
|
||||
$this->db->where('invoice_number',$invoice_number);
|
||||
$this->db->where('invoice_date_created',$invoice_date_created);
|
||||
$this->db->update($table,$action);
|
||||
return true;
|
||||
}
|
||||
|
||||
function get_data($table ,$col_name ,$id)
|
||||
{
|
||||
$this->db->select();
|
||||
$this->db->from($table);
|
||||
$this->db->where($col_name , $id);
|
||||
$query = $this->db->get();
|
||||
$query = $query->result_array();
|
||||
return $query;
|
||||
}
|
||||
|
||||
function update($action,$id,$table){
|
||||
$this->db->where('id',$id);
|
||||
$this->db->update($table,$action);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,170 +1,170 @@
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
//print_r($records);
|
||||
|
||||
?>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Product Test Reports List</center>
|
||||
</h1>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div id="loader_wrapper" style="display:none;">
|
||||
<div id="loadingDiv" style="height: 120%;position: absolute;width: 100%;top: 0px;background: white;text-align: center;z-index: 9999999999999999999999999999999999;left: -0px;">
|
||||
|
||||
<div style="position: relative;top:200px" id="load-img">
|
||||
|
||||
<img src="<?php echo base_url();?>uploads/spinner.gif" class="img-fluid">
|
||||
<h3>Syncing with zoho books...</h3>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<!--<center><h3 class="box-title">-->
|
||||
<div class="box-tools">
|
||||
<!-- <form action="<?php echo base_url() ?>assetListing" method="POST" id="searchList">-->
|
||||
<div class="col-md-3">
|
||||
<a href=" <?php echo base_url().'quality/report';?> " type="button" class="btn btn-primary">Add New</a>
|
||||
</div>
|
||||
<div class="col-md-3 col-md-offset-1" style="margin-bottom:2px">
|
||||
<a href=" javascript:void(0)" type="button" class="btn btn-primary" onclick="synczohobooks()">Sync With Zoho Books</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div><!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="product"',$products2,set_value('product',$products2[-1]),'id="product"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="customer"',$customers2,set_value('customer',$customers2[-1]),'id="customer"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<br/>
|
||||
<table id="testspecifications" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th>Test Report ID</th>
|
||||
<th>Invoice ID</th>
|
||||
<th>Batch Date</th>
|
||||
<th>Product Name</th>
|
||||
<th>Customer Name</th>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specAppend">
|
||||
<?php
|
||||
if(!empty($records))
|
||||
{
|
||||
|
||||
foreach($records as $data)
|
||||
{
|
||||
|
||||
//print_r($data);echo "</br></br>";
|
||||
?>
|
||||
<tr> <td><a href="<?php echo base_url()?>quality/viewIndReport/<?php echo $data->testreport_id ?>"><?php echo $data->testreport_id?></a>
|
||||
<?php if(!empty($data->document)){?>
|
||||
<a target="_blank" href="<?php echo base_url()?>uploads/QAD/<?php echo $data->document ?>"><span class="fa fa-file-o"></span></a>
|
||||
<?php }?>
|
||||
</td> <td><?php echo $data->invoiceid?></td> <td style="text-align:right;"><?php echo date_format(date_create($data->batchdate),'d-m-Y');?></td><td><?php echo $data->product_name;?></td><td><?php echo $data->client_name;?></td></tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p> </p>
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
<!-- <div class="box-footer clearfix">
|
||||
|
||||
</div> -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||
$('#testspecifications').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
//"columnDefs" : [{"targets":2, "type":"date-eu"}],
|
||||
|
||||
"aaSorting": [[ 2, "desc" ]],
|
||||
"info": true,
|
||||
"autoWidth": true,
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script> -->
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
|
||||
function synczohobooks(){
|
||||
|
||||
|
||||
|
||||
var sync = true
|
||||
$('#loader_wrapper').css("display", "block");
|
||||
$.ajax({
|
||||
// $('#loadingDiv').show();
|
||||
|
||||
url:"<?php echo base_url() ?>login/zohobooks_api_fetch_all",
|
||||
type:"post",
|
||||
data:{sync},
|
||||
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
alert("Sync Completed");
|
||||
// alert(data.invoice);
|
||||
|
||||
|
||||
},
|
||||
|
||||
complete: function(){
|
||||
$('#loader_wrapper').css("display", "none");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
//print_r($records);
|
||||
|
||||
?>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Product Test Reports List</center>
|
||||
</h1>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div id="loader_wrapper" style="display:none;">
|
||||
<div id="loadingDiv" style="height: 120%;position: absolute;width: 100%;top: 0px;background: white;text-align: center;z-index: 9999999999999999999999999999999999;left: -0px;">
|
||||
|
||||
<div style="position: relative;top:200px" id="load-img">
|
||||
|
||||
<img src="<?php echo base_url();?>uploads/spinner.gif" class="img-fluid">
|
||||
<h3>Syncing with zoho books...</h3>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<!--<center><h3 class="box-title">-->
|
||||
<div class="box-tools">
|
||||
<!-- <form action="<?php echo base_url() ?>assetListing" method="POST" id="searchList">-->
|
||||
<div class="col-md-3">
|
||||
<a href=" <?php echo base_url().'quality/report';?> " type="button" class="btn btn-primary">Add New</a>
|
||||
</div>
|
||||
<div class="col-md-3 col-md-offset-1" style="margin-bottom:2px">
|
||||
<a href=" javascript:void(0)" type="button" class="btn btn-primary" onclick="synczohobooks()">Sync With Zoho Books</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div><!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
|
||||
<div class="box-body">
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="product"',$products2,set_value('product',$products2[-1]),'id="product"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<?php echo form_dropdown('name="customer"',$customers2,set_value('customer',$customers2[-1]),'id="customer"' ,'class="form-control select2');?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
<br/>
|
||||
<table id="testspecifications" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
|
||||
<th>Test Report ID</th>
|
||||
<th>Invoice ID</th>
|
||||
<th>Batch Date</th>
|
||||
<th>Product Name</th>
|
||||
<th>Customer Name</th>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="specAppend">
|
||||
<?php
|
||||
if(!empty($records))
|
||||
{
|
||||
|
||||
foreach($records as $data)
|
||||
{
|
||||
|
||||
//print_r($data);echo "</br></br>";
|
||||
?>
|
||||
<tr> <td><a href="<?php echo base_url()?>quality/viewIndReport/<?php echo $data->testreport_id ?>"><?php echo $data->testreport_id?></a>
|
||||
<?php if(!empty($data->document)){?>
|
||||
<a target="_blank" href="<?php echo base_url()?>uploads/QAD/<?php echo $data->document ?>"><span class="fa fa-file-o"></span></a>
|
||||
<?php }?>
|
||||
</td> <td><?php echo $data->invoiceid?></td> <td style="text-align:right;"><?php echo date_format(date_create($data->batchdate),'d-m-Y');?></td><td><?php echo $data->product_name;?></td><td><?php echo $data->client_name;?></td></tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p> </p>
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
<!-- <div class="box-footer clearfix">
|
||||
|
||||
</div> -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||
$('#testspecifications').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
//"columnDefs" : [{"targets":2, "type":"date-eu"}],
|
||||
|
||||
"aaSorting": [[ 2, "desc" ]],
|
||||
"info": true,
|
||||
"autoWidth": true,
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script> -->
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
|
||||
function synczohobooks(){
|
||||
|
||||
|
||||
|
||||
var sync = true
|
||||
$('#loader_wrapper').css("display", "block");
|
||||
$.ajax({
|
||||
// $('#loadingDiv').show();
|
||||
|
||||
url:"<?php echo base_url() ?>login/zohobooks_api_fetch_all",
|
||||
type:"post",
|
||||
data:{sync},
|
||||
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
alert("Sync Completed");
|
||||
// alert(data.invoice);
|
||||
|
||||
|
||||
},
|
||||
|
||||
complete: function(){
|
||||
$('#loader_wrapper').css("display", "none");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -37,8 +37,6 @@ foreach($reportdata['company'] as $c)
|
||||
$pic = $c->ProfilePic;
|
||||
}
|
||||
}
|
||||
// echo $pic;die;
|
||||
// echo base_url().'uploads/images/'.$pic;die;
|
||||
?>
|
||||
<style>
|
||||
td{
|
||||
@ -74,7 +72,6 @@ td{
|
||||
<td colspan="6"><h2>PRE DISPATCH INSPECTION REPORT</h2></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<!-- <td rowspan="5" ><img src="http://localhost/siddharth_application/uploads/images/LOGO_SI_ISO_90012.png" alt="no image"/></td> -->
|
||||
<td rowspan="5" ><img src="<?php echo base_url().'uploads/images/'.$pic;?>" alt="no image"/></td>
|
||||
<td rowspan="5" width="38%"><b><?php echo $cname;?></b><br><?php echo $caddress;?></td>
|
||||
<td width="8%" >CUSTOMER NAME</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user