diff --git a/application/config/routes.php b/application/config/routes.php
index c23ad02f..a8f795ec 100644
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -236,6 +236,7 @@ $route['Report_cumulative_raw'] = "report/rawi_cumulative";
$route['Report_consolidate_category'] = "report/rawi_consolidate";
$route['Report_pending_purchase'] = "report/pending_purchase";
+$route['Empperform']="report/per";
// Company Information
$route['companyview'] = 'companycontroller/companyview';
diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php
index d78e1a21..bb88f85f 100644
--- a/application/controllers/amendmentpurchaseorder.php
+++ b/application/controllers/amendmentpurchaseorder.php
@@ -266,17 +266,17 @@ class amendmentpurchaseorder extends BaseController
$Otherpaymentamend=$this->input->post('Otherpayment');
$prePaymentTerms=$this->input->post('beforePaymentTerms');
$preTotalOdervalue=$this->input->post('preTotalOdervalue');
- $MAD.="Amended TotalOrder Value: :" . $preTotalOdervalue ."
";
+ $MAD.="Current TotalOrder Value: :" . $preTotalOdervalue ."
";
$testdate=date("Y-m-d");
if($PaymentTerms!=$prePaymentTerms)
{
if($prePaymentTerms != 'PT08'){ $Otherpaymentamend='';}
- $MAD.="Amended PaymentTerms : ". $PaymentTermsText . $Otherpaymentamend ."
";
+ $MAD.="Current PaymentTerms : ". $PaymentTermsText . $Otherpaymentamend ."
";
}
if(($dt != $predeliverydate)|| ($DeliverySchedule1 != $preschedule))
{
- $MAD.='Amended Delivery Option : ' . $predeliverydate . $preschedule . '
' ;
+ $MAD.='Current Delivery Option : ' . $predeliverydate . $preschedule . '
' ;
}
$SpecialInstruction = $this->input->post('txtSpcialInstruction');
@@ -376,99 +376,99 @@ class amendmentpurchaseorder extends BaseController
if(($Quantity-$preqty)!=0)
{
$rowspanvalue++;
- $CAD.="
| Amended Quantity : ".$preqty ." | Current Qty : ".$Quantity." |
";
+ $CAD.="| Current Quantity : ".$preqty ." | Revised Qty : ".$Quantity." |
";
}
if(($itemRate-$preitemrate)!=0)
{
$rowspanvalue++;
- $CAD.="| Amended Rate : " . $preitemrate." | Current Item Rate : ".$itemRate." |
";
+ $CAD.="| Current Rate : " . $preitemrate." | Revised Item Rate : ".$itemRate." |
";
}
if($DiscountType != $beforeDiscountType){
$rowspanvalue++;
- $CAD.="| Amended DiscountType : " . $beforeDiscountType." | Current DiscountType : ".$DiscountType." |
";
+ $CAD.="| Current DiscountType : " . $beforeDiscountType." | Revised DiscountType : ".$DiscountType." |
";
}
if(($DiscountValue-$preDiscountValue)!=0)
{
$rowspanvalue++;
- $CAD.="| Amended Discount : ". $preDiscountValue ." | Current Discount : ".$DiscountValue." |
";
+ $CAD.="| Current Discount : ". $preDiscountValue ." | Revised Discount : ".$DiscountValue." |
";
}
if(($AfterDiscount-$beforeAfterDiscount)!=0)
{
$rowspanvalue++;
- $CAD.="| Amended Discount Value : ". $beforeAfterDiscount ." | Current Discount Value : ".$AfterDiscount." |
";
+ $CAD.="| Current Discount Value : ". $beforeAfterDiscount ." | Revised Discount Value : ".$AfterDiscount." |
";
}
if($PackagingType != $beforePackagingType){
$rowspanvalue++;
- $CAD.="| Amended Packaging Type : ". $beforePackagingType ." | Current Packaging Type : ".$PackagingType." |
";
+ $CAD.="| Current Packaging Type : ". $beforePackagingType ." | Revised Packaging Type : ".$PackagingType." |
";
}
if(($PackagingValue-$prePackagingValue)!=0)
{
$rowspanvalue++;
- $CAD.="| Amended Package Value : ". $prePackagingValue." | Current Package Value : ".$PackagingValue." |
";
+ $CAD.="| Current Package Value : ". $prePackagingValue." | Revised Package Value : ".$PackagingValue." |
";
}
if(($AfterPackagingValue-$beforeAfterPackagingValue)!=0)
{
$rowspanvalue++;
- $CAD.="| Amended Package Value : ". $beforeAfterPackagingValue." | Current Package Value : ".$AfterPackagingValue." |
";
+ $CAD.="| Current Package Value : ". $beforeAfterPackagingValue." | Revised Package Value : ".$AfterPackagingValue." |
";
}
if(($VatValue-$preVatValue)!=0)//SGST
{
$rowspanvalue++;
- $CAD.="| Amended SGST : ". $preVatValue." | Current SGST : ".$VatValue." |
";
+ $CAD.="| Current SGST : ". $preVatValue." | Revised SGST : ".$VatValue." |
";
}
if(($AfterVatValue-$beforeAfterVatValue)!=0)//SGST
{
$rowspanvalue++;
- $CAD.="| Amended SGST value : ". $beforeAfterVatValue." | Current SGST Value : ".$AfterVatValue." |
";
+ $CAD.="| Current SGST value : ". $beforeAfterVatValue." | Revised SGST Value : ".$AfterVatValue." |
";
}
if(($GSTValue-$preGSTValue)!=0)//CGST
{
$rowspanvalue++;
- $CAD.="| Amended CGST : ". $preGSTValue." | Current CGST : ".$GSTValue." |
";
+ $CAD.="| Current CGST : ". $preGSTValue." | Revised CGST : ".$GSTValue." |
";
}
if(($AfterGSTValue-$beforeAfterGSTValue)!=0)//CGST
{
$rowspanvalue++;
- $CAD.="| Amended CGST Value : ". $beforeAfterGSTValue." | Current CGST Value : ".$AfterGSTValue." |
";
+ $CAD.="| Current CGST Value : ". $beforeAfterGSTValue." | Revised CGST Value : ".$AfterGSTValue." |
";
}
if(($OtherTaxValue-$preOtherTaxValue)!=0)//IGST
{
$rowspanvalue++;
- $CAD.="| Amended IGST : ". $preOtherTaxValue." | Current IGST : ".$OtherTaxValue." |
";
+ $CAD.="| Current IGST : ". $preOtherTaxValue." | Revised IGST : ".$OtherTaxValue." |
";
}
if(($AfterOtherTaxValue-$beforeAfterOtherTaxValue)!=0)//IGST
{
$rowspanvalue++;
- $CAD.="| Amended IGST : ". $beforeAfterOtherTaxValue." | Current IGST : ".$AfterOtherTaxValue." |
";
+ $CAD.="| Current IGST : ". $beforeAfterOtherTaxValue." | Revised IGST : ".$AfterOtherTaxValue." |
";
}
if($FreightType != $beforeFreightType){
$rowspanvalue++;
- $CAD.="| Amended Freight Type : ". $beforeFreightType." | Current Freight Type : ".$FreightType." |
";
+ $CAD.="| Current Freight Type : ". $beforeFreightType." | Revised Freight Type : ".$FreightType." |
";
}
if(($FreightType=="PER TRIP") || ($beforeFreightType=="PER TRIP")){
if($NoofTrips != $beforeNoofTrips)
{
$rowspanvalue++;
- $CAD.="| Amended No of Trips : ". $beforeNoofTrips." | Current No of Trips : ".$NoofTrips." |
";
+ $CAD.="| Current No of Trips : ". $beforeNoofTrips." | Revised No of Trips : ".$NoofTrips." |
";
}
}
if(($FreightValue-$preFreightValue)!=0)
{
$rowspanvalue++;
- $CAD.="| Amended Freight : ". $preFreightValue." | Current Freight : ".$FreightValue." |
";
+ $CAD.="| Current Freight : ". $preFreightValue." | Revised Freight : ".$FreightValue." |
";
}
if(($AfterFreightValue-$beforeAfterFreightValue)!=0)
{
$rowspanvalue++;
- $CAD.="| Amended Freight Value : ". $beforeAfterFreightValue." | Current Freight Value : ".$AfterFreightValue." |
";
+ $CAD.="| Current Freight Value : ". $beforeAfterFreightValue." | Revised Freight Value : ".$AfterFreightValue." |
";
}
if(($InsuranceValue-$preInsuranceValue)!=0)
{
$rowspanvalue++;
- $CAD.="| Amended Insurance Value : ". $preInsuranceValue." | Current Insurance Value : ".$InsuranceValue." |
";
+ $CAD.="| Current Insurance Value : ". $preInsuranceValue." | Revised Insurance Value : ".$InsuranceValue." |
";
}
if($rowspanvalue>0)
{
@@ -536,11 +536,11 @@ class amendmentpurchaseorder extends BaseController
$dschedule=$this->input->post('Scheduleby');
$beforedschedule=$this->input->post('beforeScheduleby');
$preTotalordervalue=$this->input->post('preTotalordervalue');
- $MAD.="Amended TotalOrder Value: " . $preTotalordervalue . "
";
+ $MAD.="Current TotalOrder Value: " . $preTotalordervalue . "
";
if(($ddate != $beforeddate)||($dschedule != $beforedschedule))
{
- $MAD.="Amended DeliveryOption : " . $beforeddate . $beforedschedule."
";
+ $MAD.="Current DeliveryOption : " . $beforeddate . $beforedschedule."
";
}
$PaymentTermsText=$this->input->post('beforePaymentTermsText');
@@ -552,7 +552,7 @@ class amendmentpurchaseorder extends BaseController
if($PaymentTerms != $beforePaymentTerms)
{
if($beforePaymentTerms != 'PT08'){ $Otherpaymentamend='';}
- $MAD.="Amended PaymentTerms : ". $PaymentTermsText . $Otherpaymentamend."
";
+ $MAD.="Current PaymentTerms : ". $PaymentTermsText . $Otherpaymentamend."
";
}
$POType = $this->input->post('POType');
@@ -644,33 +644,33 @@ class amendmentpurchaseorder extends BaseController
if($Quantity != $beforeQuantity)
{
$rowspanvalue++;
- $CAD.="| Amended Qty : " . $beforeQuantity ." | Current Qty : " . $Quantity . " |
";
+ $CAD.="| Current Qty : " . $beforeQuantity ." | Revised Qty : " . $Quantity . " |
";
}
if($itemRate != $beforeitemRate)
{
$rowspanvalue++;
- $CAD.="| Amended Rate : " . $beforeitemRate ." | Current Rate : " . $itemRate . " |
";
+ $CAD.="| Current Rate : " . $beforeitemRate ." | Revised Rate : " . $itemRate . " |
";
}
if(($SGST != $beforeSGST) && ($AfterSGST != $beforeSGSTvalue))
{
$rowspanvalue+=2;
- $CAD.="| Amended SGST% : " . $beforeSGST ." | Current SGST% : " . $SGST . " |
| Amended SGST value : " . $beforeSGSTvalue ." | Current SGST value: " . $AfterSGST . " |
";
+ $CAD.="| Current SGST% : " . $beforeSGST ." | Revised SGST% : " . $SGST . " |
| Current SGST value : " . $beforeSGSTvalue ." | Revised SGST value: " . $AfterSGST . " |
";
}
if(($CGST != $beforeCGST) && ($AfterCGST != $beforeCGSTvalue))
{
$rowspanvalue+=2;
- $CAD.="| Amended CGST% : " . $beforeCGST ." | Current CGST% : " . $CGST . " |
| Amended CGST value : " . $beforeCGSTvalue ." | Current CGST value: " . $AfterCGST . " |
";
+ $CAD.="| Current CGST% : " . $beforeCGST ." | Revised CGST% : " . $CGST . " |
| Current CGST value : " . $beforeCGSTvalue ." | Revised CGST value: " . $AfterCGST . " |
";
}
if(($IGST != $beforeIGST) && ($AfterIGST != $beforeIGSTvalue))
{
$rowspanvalue+=2;
- $CAD.="| Amended IGST% : " . $beforeIGST ." | Current IGST% : " . $IGST . " |
| Amended IGST value : " . $beforeIGSTvalue ." | Current IGST value: " . $AfterIGST . " |
";
+ $CAD.="| Current IGST% : " . $beforeIGST ." | Revised IGST% : " . $IGST . " |
| Current IGST value : " . $beforeIGSTvalue ." | Revised IGST value: " . $AfterIGST . " |
";
}
if($otherallowance != $beforeotherallowance)
{
$rowspanvalue++;
- $CAD.="| Amended OtherAllowances : " . $beforeotherallowance ." | Current OtherAllowances : " . $otherallowance . " |
";
+ $CAD.="| Current OtherAllowances : " . $beforeotherallowance ." | Revised OtherAllowances : " . $otherallowance . " |
";
}
if($rowspanvalue>0)
{
@@ -741,7 +741,7 @@ class amendmentpurchaseorder extends BaseController
$Otherpayment=$this->input->post('Otherpayment');
$Otherpaymentamend=$this->input->post('Otherpayment');
$PreServiceTotalorder = $this->input->post('preServiceTotalorderValue');//For Domestic Pre Total Value
- $Totalserviceorder = $this->input->post('Totalservicesummary');//For Domestic Current Total value
+ $Totalserviceorder = $this->input->post('Totalservicesummary');//For Domestic Revised Total value
$TotalCapitalorder= $this->input->post('CapitalToatlOrder');//For International total CapitalOrder
$preTotalCapitalorder= $this->input->post('preinterTotalorderValue');//For International pre total CapitalOrder
@@ -754,27 +754,27 @@ class amendmentpurchaseorder extends BaseController
$ServiceTypeOptions=$this->input->post('PoTypeOptions');
if($PoRange==1){
- $MAD.="Amended TotalOrder Value: " . $PreServiceTotalorder . "
";
+ $MAD.="Current TotalOrder Value: " . $PreServiceTotalorder . "
";
}else if($PoRange==0){
- $MAD.="Amended TotalOrder Value: " . $preTotalCapitalorder . "
";
+ $MAD.="Current TotalOrder Value: " . $preTotalCapitalorder . "
";
}
if($PaymentMethod != $prePaymentmethod)
{
if($prePaymentmethod != 'PT08'){ $Otherpaymentamend='';}
- $MAD.="Amended Paymemnt Terms : " .$prePaymentmethodtext."
";
+ $MAD.="Current Paymemnt Terms : " .$prePaymentmethodtext."
";
}
if($predispatch != $curdispatch)
{
- $MAD.="Amended Delivery Option : " .$predispatch.$preDeliverySchedule.$preDate."
";
+ $MAD.="Current Delivery Option : " .$predispatch.$preDeliverySchedule.$preDate."
";
}
if($DeliverySchedule1!= $preDeliverySchedule)
{
- $MAD.="Amended DeliveyOption : " .$preDeliverySchedule.$preDate.$predispatch."
";
+ $MAD.="Current DeliveyOption : " .$preDeliverySchedule.$preDate.$predispatch."
";
}
if($preDate != $Date)
{
- $MAD.="Amended DeliveyOption : " .$preDate.$preDeliverySchedule."
";
+ $MAD.="Current DeliveyOption : " .$preDate.$preDeliverySchedule."
";
}
$capitalType = $this->input->post('capitalType');
@@ -940,60 +940,60 @@ class amendmentpurchaseorder extends BaseController
if($Quantity != $preQuantity)
{
$rowspanvalue++;
- $CAD.="| Amended Qty : " . $preQuantity ." | Current Qty : " . $Quantity . " |
";
+ $CAD.="| Current Qty : " . $preQuantity ." | Revised Qty : " . $Quantity . " |
";
}
if($itemRate != $preitemRate)
{
$rowspanvalue++;
- $CAD.="| Amended Rate : " . $preitemRate ." | Current Rate : " . $itemRate . " |
";
+ $CAD.="| Current Rate : " . $preitemRate ." | Revised Rate : " . $itemRate . " |
";
}
if($PoRange==1){
if(($DiscountValue!=$preDiscountValue) && ($AfterDiscount!=$preAfterDiscount)){
$rowspanvalue+=2;
- $CAD.="| Amended Discount : " . $preDiscountValue ." | Current Discount : " . $DiscountValue . " |
| Amended Discount value : " . $preAfterDiscount ." | Current Discount value: " . $AfterDiscount . " |
";
+ $CAD.="| Current Discount : " . $preDiscountValue ." | Revised Discount : " . $DiscountValue . " |
| Current Discount value : " . $preAfterDiscount ." | Revised Discount value: " . $AfterDiscount . " |
";
}
if(($SGST != $preSGST) && ($SGSTvalue != $preSGSTvalue))
{
$rowspanvalue+=2;
- $CAD.="| Amended SGST% : " . $preSGST ." | Current SGST% : " . $SGST . " |
| Amended SGST value : " . $preSGSTvalue ." | Current SGST value: " . $SGSTvalue . " |
";
+ $CAD.="| Current SGST% : " . $preSGST ." | Revised SGST% : " . $SGST . " |
| Current SGST value : " . $preSGSTvalue ." | Revised SGST value: " . $SGSTvalue . " |
";
}
if(($CGST != $preCGST) && ($CGSTvalue != $preCGSTvalue))
{
$rowspanvalue+=2;
- $CAD.="| Amended CGST% : " . $preCGST ." | Current CGST% : " . $CGST . " |
| Amended CGST value : " . $preCGSTvalue ." | Current CGST value: " . $CGSTvalue . " |
";
+ $CAD.="| Current CGST% : " . $preCGST ." | Revised CGST% : " . $CGST . " |
| Current CGST value : " . $preCGSTvalue ." | Revised CGST value: " . $CGSTvalue . " |
";
}
if(($IGST != $preIGST) && ($IGSTvalue != $preIGSTvalue))
{
$rowspanvalue+=2;
- $CAD.="| Amended IGST% : " . $preIGST ." | Current IGST% : " . $IGST . " |
| Amended IGST value : " . $preIGSTvalue ." | Current IGST value: " . $IGSTvalue . " |
";
+ $CAD.="| Current IGST% : " . $preIGST ." | Revised IGST% : " . $IGST . " |
| Current IGST value : " . $preIGSTvalue ." | Revised IGST value: " . $IGSTvalue . " |
";
}
if($otherallowance != $preotherallowance)
{
$rowspanvalue++;
- $CAD.="| Amended OtherAllowances : " . $preotherallowance ." | Current OtherAllowances : " . $otherallowance . " |
";
+ $CAD.="| Current OtherAllowances : " . $preotherallowance ." | Revised OtherAllowances : " . $otherallowance . " |
";
}
if($FreightTypeloc != $beforeFreightTypeloc)
{
$rowspanvalue++;
- $CAD.="| Amended Freight Type : " . $beforeFreightTypeloc ." | Current Qty : " . $FreightTypeloc . " |
";
+ $CAD.="| Current Freight Type : " . $beforeFreightTypeloc ." | Revised Qty : " . $FreightTypeloc . " |
";
}
if($FreightNoofTriploc != $beforeFreightNoofTriploc)
{
$rowspanvalue++;
- $CAD.="| Amended Freight Nooftrips : " . $beforeFreightNoofTriploc ." | Current Freight Nooftrips: " . $FreightNoofTriploc . " |
";
+ $CAD.="| Current Freight Nooftrips : " . $beforeFreightNoofTriploc ." | Revised Freight Nooftrips: " . $FreightNoofTriploc . " |
";
}
if($Freightrateloc != $beforeFreightrateloc)
{
$rowspanvalue++;
- $CAD.="| Amended Freight Rate : " . $beforeFreightrateloc ." | Current Freight Rate: " . $Freightrateloc . " |
";
+ $CAD.="| Current Freight Rate : " . $beforeFreightrateloc ." | Revised Freight Rate: " . $Freightrateloc . " |
";
}
if($FreightAmountloc != $beforeFreightAmountloc)
{
$rowspanvalue++;
- $CAD.="| Amended Freight Amount : " .$beforeFreightAmountloc ." | Current Freight Amount: " . $FreightAmountloc . " |
";
+ $CAD.="| Current Freight Amount : " .$beforeFreightAmountloc ." | Revised Freight Amount: " . $FreightAmountloc . " |
";
}
@@ -1001,21 +1001,21 @@ class amendmentpurchaseorder extends BaseController
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Assessable : ".$beforeAssable ." | Current CustomDuty:".$Assable." |
";
+ $CAD=$CAD."| Current Assessable : ".$beforeAssable ." | Revised CustomDuty:".$Assable." |
";
}
if(($Subtotal-$beforeSubtotal)!=0)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Subtotal : ".$beforeSubtotal ." | Current Subtotal:".$Subtotal." |
";
+ $CAD=$CAD."| Current Subtotal : ".$beforeSubtotal ." | Revised Subtotal:".$Subtotal." |
";
}
if(($Igst-$beforeIgst)!=0)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended IGST Percentage : ".$beforeIgst ." | Current IGST Percentage:".$Igst." |
";
+ $CAD=$CAD."| Current IGST Percentage : ".$beforeIgst ." | Revised IGST Percentage:".$Igst." |
";
}
}
@@ -1104,7 +1104,7 @@ class amendmentpurchaseorder extends BaseController
$TotalOrder = $this->input->post('txttot');
$AmendTotal=$this->input->post('txttotamend');
- $MAD.="Amended Total Order Value: :" . $AmendTotal ."
";
+ $MAD.="Current Total Order Value: :" . $AmendTotal ."
";
$POStatus = $this->input->post('txtStatus');
$CreateBy = $this->session->userdata ( 'userId' );
@@ -1145,7 +1145,7 @@ class amendmentpurchaseorder extends BaseController
if($PaymentTerms!=$beforePaymentTerms)
{
- $MAD.="Amended Payment Terms " . $beforePaymentTerms."
";
+ $MAD.="Current Payment Terms " . $beforePaymentTerms."
";
}
$Palaceoforigin=$this->input->post('PlaceOforigin');
@@ -1154,7 +1154,7 @@ class amendmentpurchaseorder extends BaseController
if($Palaceoforigin!=$beforePalaceoforigin)
{
- $MAD.=$MAD."Amended Place of Origin: " . $beforePalaceoforigin."
";
+ $MAD.=$MAD."Current Place of Origin: " . $beforePalaceoforigin."
";
}
$POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID, 'POType'=>$POType,'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'ReleasedBy'=>$updatedBy,'ReleasedOn'=>$updateddt,'Import_PlaceofOrgin'=>$Palaceoforigin,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'AmendedDetails'=>$MAD,'PaymentOtherDescription'=>$OtherPayment,'InsuranceStatus'=>$insurestatus,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption);
@@ -1251,14 +1251,14 @@ class amendmentpurchaseorder extends BaseController
if(($itemRate-$beforeitemRate)!=0)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Rate : ".$beforeitemRate ." | Current Rate:".$itemRate." |
";
+ $CAD=$CAD."| Current Rate : ".$beforeitemRate ." | Revised Rate:".$itemRate." |
";
}
if(($Quantity-$beforeQuantity)!=0)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Quantity : ".$beforeQuantity ." | Current Quantity:".$Quantity." |
";
+ $CAD=$CAD."| Current Quantity : ".$beforeQuantity ." | Revised Quantity:".$Quantity." |
";
}
@@ -1266,87 +1266,87 @@ class amendmentpurchaseorder extends BaseController
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Landing percentage : ".$beforeLandingCharge ." | Current Landing Percentage:".$LandingCharge." |
";
+ $CAD=$CAD."| Current Landing percentage : ".$beforeLandingCharge ." | Revised Landing Percentage:".$LandingCharge." |
";
}
if(($CustomDuty-$beforeCustomDuty)!=0)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended CustomDuty : ".$beforeCustomDuty ." | Current CustomDuty:".$CustomDuty." |
";
+ $CAD=$CAD."| Current CustomDuty : ".$beforeCustomDuty ." | Revised CustomDuty:".$CustomDuty." |
";
}
if($CustomEd-$beforeCustomEd)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended CustomEd : ".$beforeCustomEd ." | Current CustomEd:".$CustomEd." |
";
+ $CAD=$CAD."| Current CustomEd : ".$beforeCustomEd ." | Revised CustomEd:".$CustomEd." |
";
}
if($CustomSH-$beforeCustomSH)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended CustomSH : ".$beforeCustomSH ." | Current CustomSH:".$CustomSH." |
";
+ $CAD=$CAD."| Current CustomSH : ".$beforeCustomSH ." | Revised CustomSH:".$CustomSH." |
";
}
if($FreightType!=$beforeFreightType)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Freight Type: ".$beforeFreightType ." | Current Freight Type:".$FreightType." |
";
+ $CAD=$CAD."| Current Freight Type: ".$beforeFreightType ." | Revised Freight Type:".$FreightType." |
";
}
if($NoOfTrip-$beforeNoOfTrip)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended No of Trip: ".$beforeNoOfTrip ." | Current Additional Excise duty:".$NoOfTrip." |
";
+ $CAD=$CAD."| Current No of Trip: ".$beforeNoOfTrip ." | Revised Additional Excise duty:".$NoOfTrip." |
";
}
if($Freightrate-$beforeFreightrate)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Freightrate: ".$beforeFreightrate ." | Current Freightrate:".$Freightrate." |
";
+ $CAD=$CAD."| Current Freightrate: ".$beforeFreightrate ." | Revised Freightrate:".$Freightrate." |
";
}
if($Freightamount-$beforeFreightamount)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Freight Amount: ".$beforeFreightamount ." | Current Freight Amount:".$Freightamount." |
";
+ $CAD=$CAD."| Current Freight Amount: ".$beforeFreightamount ." | Revised Freight Amount:".$Freightamount." |
";
}
if($per!=$beforeper)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Per Value: ".$beforeper ." | Current Per Value:".$per." |
";
+ $CAD=$CAD."| Current Per Value: ".$beforeper ." | Revised Per Value:".$per." |
";
}
if(($Assable-$beforeAssable)!=0)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Assessable : ".$beforeAssable ." | Current CustomDuty:".$Assable." |
";
+ $CAD=$CAD."| Current Assessable : ".$beforeAssable ." | Revised CustomDuty:".$Assable." |
";
}
if(($Subtotal-$beforeSubtotal)!=0)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Subtotal : ".$beforeSubtotal ." | Current Subtotal:".$Subtotal." |
";
+ $CAD=$CAD."| Current Subtotal : ".$beforeSubtotal ." | Revised Subtotal:".$Subtotal." |
";
}
if(($Igst-$beforeIgst)!=0)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended IGST Percentage : ".$beforeIgst ." | Current IGST Percentage:".$Igst." |
";
+ $CAD=$CAD."| Current IGST Percentage : ".$beforeIgst ." | Revised IGST Percentage:".$Igst." |
";
}
if(($Grossdutypayable-$beforeGrossdutypayable)!=0)
{
$rowspanvalue++;
- $CAD=$CAD."| Amended Gross Duty Payable : ".$beforeGrossdutypayable ." | Current Gross Duty Payable:".$Grossdutypayable." |
";
+ $CAD=$CAD."| Current Gross Duty Payable : ".$beforeGrossdutypayable ." | Revised Gross Duty Payable:".$Grossdutypayable." |
";
}
if($rowspanvalue>0)
diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php
index 080baeca..0a5234b1 100644
--- a/application/controllers/inwardgateregister.php
+++ b/application/controllers/inwardgateregister.php
@@ -78,6 +78,40 @@ class inwardgateregister extends BaseController
echo json_encode($data);
}
+
+ /**
+ * To upload IGR files
+ */
+ function uploadFile()
+ {
+
+ $pathinfo = pathinfo($_FILES['myfile']['name']);
+ $config['upload_path'] = 'uploads/Igrfiles/';
+ $config['allowed_types'] = 'png|jpg|jpeg|pdf|docx';
+ $config['file_name'] = $_FILES['myfile']['name'];
+
+ //Load upload library and initialize configuration
+ $this->load->library('upload',$config);
+ $this->upload->initialize($config);
+
+
+ if($this->upload->do_upload('myfile'))
+ {
+ $uploadData = $this->upload->data();
+ $uploadfilename = $uploadData['file_name'];
+ return $uploadfilename;
+
+ }
+ else
+ {
+ $error = array('error' => $this->upload->display_errors());
+ $uploadfilename = '';
+ print_r($error);
+ return 0;
+ }
+
+ }
+
/**
* To Store IGR data into DB
*/
@@ -102,10 +136,29 @@ class inwardgateregister extends BaseController
$createddt = $dt->format('Y-m-d H:i:s');
$IGRStatus = IGR_CREATED;
+
+ $document = null;
+
+ $fs = 0;
+ if(!empty($_FILES['myfile']['name']))
+ {
+
+ $config['file_name'] = $_FILES['myfile']['name'];
+ $config['upload_path'] = 'uploads/Igrfiles/';
+ $config['allowed_types'] = 'png|jpg|jpeg|pdf|docx';
+ $path = $config['upload_path'];
+ $filename = $config['file_name'];
+ $document = $path.$filename;
+
+ $fs = $this->uploadFile();
+ $document = $path.$fs;
+
+ }
+
$igr = array();
- $igr = array('PONO'=>$PONO,'VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'CourierNo'=>$CourierNo,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt);
+ $igr = array('PONO'=>$PONO,'VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'CourierNo'=>$CourierNo,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt,'file'=>$document);
$igrM = $this->inwardgateregister_model->addigrM($igr);
@@ -169,7 +222,7 @@ class inwardgateregister extends BaseController
}
$this->inwardgateregister_model->UpdatePOMaster($PONO,$CreatedBy);
- echo 'Successfully Created IGR Number:'. $IGRNO;
+ echo "";
}
/**
diff --git a/application/controllers/login.php b/application/controllers/login.php
index c88b8c9e..ce75d32a 100644
--- a/application/controllers/login.php
+++ b/application/controllers/login.php
@@ -53,7 +53,7 @@ class Login extends CI_Controller
$this->load->library('form_validation');
- $this->form_validation->set_rules('email', 'Email', 'required|valid_email|max_length[128]|xss_clean|trim');
+ //$this->form_validation->set_rules('email', 'Email', 'required|valid_email|max_length[128]|xss_clean|trim');
$this->form_validation->set_rules('password', 'Password', 'required|max_length[32]|');
$designation='';
$role='';
diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php
index a2fec7d0..756fea79 100755
--- a/application/controllers/payslip.php
+++ b/application/controllers/payslip.php
@@ -452,6 +452,7 @@ class payslip extends BaseController
$current = date("m-Y");
$data['month'] = $this-> monthlypay_model->monthlyListing($current);
$data['fresh'] = $this-> monthlypay_model->getEmpPayDetailsforMonthInputs($current);
+ $data['dropdownvalue'] = $current;
$this->global['pageTitle'] = 'Resico : Payroll Monthly Inputs';
$this->loadViews("monthlypayinputs", $this->global,$data,NULL);
@@ -464,11 +465,19 @@ class payslip extends BaseController
function changeMonth()
{
- $current = $this->input->post('param1');
- $month = $this-> monthlypay_model->monthlyListing($current);
- $fresh = $this-> monthlypay_model->getEmpPayDetailsforMonthInputs($current);
- $data = json_encode(array_merge($month,$fresh));
- echo $data;
+ // $current = $this->input->post('param1');
+ // $month = $this-> monthlypay_model->monthlyListing($current);
+ // $fresh = $this-> monthlypay_model->getEmpPayDetailsforMonthInputs($current);
+ // $data = json_encode(array_merge($month,$fresh));
+ // echo $data;
+ $current = $this->input->post('monthyear');
+ $data['month'] = $this-> monthlypay_model->monthlyListing($current);
+ $data['fresh'] = $this-> monthlypay_model->getEmpPayDetailsforMonthInputs($current);
+ $data['dropdownvalue'] = $current;
+ $this->global['pageTitle'] = 'Siddharth : Payroll Monthly Inputs';
+ $this->loadViews("monthlypayinputs", $this->global,$data,NULL);
+
+
}
/**
@@ -619,11 +628,25 @@ class payslip extends BaseController
*/
function payslipLisiting()
{
+ $curr_year = date('Y');
+ $curr_month =date('m');
+ $curr_monthyear = $curr_month.'-'.$curr_year;
$this->global['pageTitle'] = 'Resico : Payslip Listing';
$data['PayInfo'] = $this->payroll_model->GetPayslipdata();
+ $data['dropdownvalue'] = $curr_monthyear;
$this->loadViews("paysliplist", $this->global, $data , NULL);
}
+ function reload_paysliplist()
+ {
+ $pre_monthyear = $this->input->post('month');
+
+ $this->global['pageTitle'] = 'Siddharth : Payslip Listing';
+ $data['PayInfo'] = $this->payroll_model->GetPayslipdata($pre_monthyear);
+ $data['dropdownvalue'] = $pre_monthyear;
+
+ $this->loadViews("paysliplist", $this->global, $data , NULL);
+ }
/**
* To view the Supplier information and load's the edit supplier screen
*/
diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php
index 2bd1b15d..1cd50c92 100644
--- a/application/controllers/purchaseorder.php
+++ b/application/controllers/purchaseorder.php
@@ -1233,7 +1233,7 @@ class purchaseorder extends BaseController
$PoStatus='';
-
+ $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO);
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF();
$data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO);
$data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO);
@@ -1310,15 +1310,16 @@ $AdvanceAmount=0.00;
{
$PoStatus='';
+ $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO);
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF();
- $data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO);
+ $data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO);
$data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetailsForpdf($PONO);
$data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO);
- $data['serviceTaxList'] = $this->purchaseorder_model->GetServiceTaxDetails($PONO);
+ $data['serviceTaxList'] = $this->purchaseorder_model->GetServiceTaxDetails($PONO);
- $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
+ $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR');
@@ -1403,6 +1404,7 @@ public function importpoprint($PONO)
$Depcode='';
$Currencycode='';
$PoStatus='';
+ $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO);
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF();
$data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO);
$data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO);
@@ -2659,10 +2661,10 @@ function addNewImportPurchaseOrder()
$PoStatus='';
// Load the pdf page with multiviews
+ $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO);
$data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF();
$data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO);
$data['POItem'] = $this->purchaseorder_model->GetCapitalPurchaseOrderDetailsForPDF($PONO);
-
$data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO);
$CurrencyType='';
diff --git a/application/controllers/quality.php b/application/controllers/quality.php
index 443bc7a5..2d4426cb 100644
--- a/application/controllers/quality.php
+++ b/application/controllers/quality.php
@@ -420,6 +420,7 @@ class quality extends BaseController
function addNewInward_Report()
{
$data['records'] = $this->quality_model->getIGRNOforReport();
+ $data['reports'] = $this->quality_model->getIGRNOReport();
$data['emplist'] = $this->quality_model->getEmplistforReport();
$this->global['pageTitle'] = 'Resico : Inward Inspection';
$this->loadViews("inward_report_create", $this->global,$data,NULL);
diff --git a/application/controllers/report.php b/application/controllers/report.php
index affc18cb..28ec4eed 100755
--- a/application/controllers/report.php
+++ b/application/controllers/report.php
@@ -380,7 +380,10 @@ class report extends BaseController
if ($this->input->post('financialyear')) {
- $data['year']=$this->dahsboard_Model->report_year_wise();
+ $ab=$this->input->post('financialyear');
+ $a=substr($ab,0,-5);
+ $b=substr($ab,5,5);
+ $data['year']=$this->dahsboard_Model->report_year_wise($a,$b);
$data['finyear']=$this->dahsboard_Model->report_finyear();
//$this->loadviews("Report_year_wise",$this->global,$data, NULL);
@@ -517,7 +520,7 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
- $data['spurchse']=$this->dahsboard_Model->consolidate_month($m,$cname,$mid,$fa,$aa);
+ $data['spurchse']=$this->dahsboard_Model->consolidate_month($m,$sid,$mid,$fa,$aa);
if($this->DEPCode == MANAGEMENT)
{
$this->loadviews("Report_consolidate_m",$this->global,$data, NULL);
@@ -542,7 +545,7 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
- $data['spurchse']=$this->dahsboard_Model->consolidate_year($cname,$mid,$fa,$aa);
+ $data['spurchse']=$this->dahsboard_Model->consolidate_year($sid,$mid,$fa,$aa);
if($this->DEPCode == MANAGEMENT)
{
$this->loadviews("Report_consolidate_y",$this->global,$data, NULL);
@@ -732,9 +735,11 @@ class report extends BaseController
if ($this->input->post('financialyear')) {
-
- $data['year']=$this->dahsboard_Model->ireport_year_wise();
- $data['finyear']=$this->dahsboard_Model->report_finyear();
+ $ab=$this->input->post('financialyear');
+ $a=substr($ab,0,-5);
+ $b=substr($ab,5,5);
+ $data['year']=$this->dahsboard_Model->ireport_year_wise($a,$b);
+ $data['finyear']=$this->dahsboard_Model->report_finyear();
//$this->loadviews("Report_year_wise",$this->global,$data, NULL);
}
@@ -883,7 +888,7 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
- $data['spurchse']=$this->dahsboard_Model->i_consolidate_month($m,$cname,$prod,$fa,$aa);
+ $data['spurchse']=$this->dahsboard_Model->i_consolidate_month($m,$sid,$prod,$fa,$aa);
// print_r( $data['spurchse']);
if($this->DEPCode == MANAGEMENT)
{
@@ -912,7 +917,7 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
- $data['spurchse']=$this->dahsboard_Model->i_consolidate_year($cname,$prod,$fa,$aa);
+ $data['spurchse']=$this->dahsboard_Model->i_consolidate_year($sid,$mid,$fa,$aa);
// print_r( $data['spurchse']);
if($this->DEPCode == MANAGEMENT)
{
@@ -1204,6 +1209,32 @@ class report extends BaseController
}
+ public function per()
+ {
+
+ $this->global['pageTitle'] = 'Siddharth : Reports';
+
+ $ab=$this->input->post('financialyear');
+
+ $fa=substr($ab,0,-5);
+
+ $aa=substr($ab,5,5);
+
+ $m=$this->input->post('month');
+
+
+ $data['fy']=$this->dahsboard_Model->fy();
+ $data['per']=$this->dahsboard_Model->per($fa,$aa,$m);
+
+ if($this->DEPCode == MANAGEMENT)
+ {
+ $this->loadviews("report_emp",$this->global,$data, NULL);
+ }
+ else
+ {
+ $this->loadViews("access", $this->global, $data, NULL);
+ }
+ }
public function cashbook()
{
diff --git a/application/controllers/requisitionform.php b/application/controllers/requisitionform.php
index f246d5f2..c3b4ce6c 100644
--- a/application/controllers/requisitionform.php
+++ b/application/controllers/requisitionform.php
@@ -104,7 +104,13 @@ class requisitionform extends BaseController
}
$data['ReqPOType'] = $ReqPOType =='' ? $ReqType:$ReqPOType;
- $data['LineItem'] = $this->requistion_model->getEditRequistItemList($ReqNo);
+ $data['LineItem'] = $this->requistion_model->getEditRequistItemList($ReqNo);
+ $data['description']='';
+
+ foreach($data['LineItem'] as $line)
+ {
+ $description= $line->MaterialDescription;
+ }
$data['CostCenter'] = $this->requistion_model->getCostCenterUserID($userID);
$data['MaterialCode'] = $this->requistion_model->EditMaterialCode($ReqNo, $ReqType);
$data['ServiceOption'] = $this->requistion_model->getConfigValue('C022');
@@ -404,9 +410,10 @@ class requisitionform extends BaseController
if($SkipInsert == "False")
{
$MaterialCode = $this->input->post('MaterialCode'.$i);
- $Quantity = $this->input->post('Quantity'.$i);
+ $Quantity = $this->input->post('Quantity'.$i);
+ $OtherD = $this->input->post('otherD'.$i);
- $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity);
+ $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'MaterialDescription'=>$OtherD);
$this->requistion_model->addRequistionDetails($ReqDetails,$ReqNumber);
}
@@ -480,16 +487,17 @@ class requisitionform extends BaseController
if($SkipInsert == "False")
{
$MaterialCode = $this->input->post('MaterialCode'.$i);
- $Quantity = $this->input->post('Quantity'.$i);
+ $Quantity = $this->input->post('Quantity'.$i);
+ $otherD =$this->input->post('otherD'.$i);
$IsExists = $this->requistion_model->LineItemIsExists($ReqNumber,$MaterialCode);
if(count( $IsExists) == 0)
{
- $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate);
+ $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate,'MaterialDescription'=>$otherD);
$this->requistion_model->addRequistionDetails($ReqDetails,$ReqNumber);
}
else
{
- $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate);
+ $ReqDetails = array('ReqNo'=>$ReqNumber, 'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'UpdatedBy'=>$UpdatedBy,'UpdatedOn'=>$updatedDate,'MaterialDescription'=>$otherD);
$this->requistion_model->UpdateRequistionLineItem($ReqDetails,$ReqNumber,$MaterialCode);
}
diff --git a/application/controllers/supplier.php b/application/controllers/supplier.php
index ad460b9a..fb23ad8c 100644
--- a/application/controllers/supplier.php
+++ b/application/controllers/supplier.php
@@ -203,12 +203,13 @@ class supplier extends BaseController
{
$pan = $this->input->post('panno');
+ $gst = $this->input->post('GSTNo');
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
$this->form_validation->set_rules('Address','Address','trim|required|');
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]');
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]');
$this->form_validation->set_rules('emailid','emailid', 'valid_email|max_length[128]|required');
- $this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]');
+ $this->form_validation->set_rules('TIN','TIN','trim|max_length[11]');
if($pan=='')
{
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]');
@@ -217,7 +218,14 @@ class supplier extends BaseController
{
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]|callback_checkPanValidate');
}
- $this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidate');
+ if($gst=='')
+ {
+ $this->form_validation->set_rules('GSTNo','GSTNo','trim|max_length[15]');
+ }
+ else
+ {
+ $this->form_validation->set_rules('GSTNo','GSTNo','trim|max_length[15]|callback_checkGstValidate');
+ }
if($this->form_validation->run() == FALSE)
{
@@ -326,13 +334,14 @@ class supplier extends BaseController
function editsupplier()
{
$pan = $this->input->post('panno');
+ $gst = $this->input->post('GSTNo');
$this->form_validation->set_rules('SupplierName','Supplier Name','trim|required');
$this->form_validation->set_rules('Address','Address','trim|required|');
$supplierID = $this->input->post('SupplierID');
$this->form_validation->set_rules('ContactNumber','Contact Number','trim|required|max_length[13]');
$this->form_validation->set_rules('AlternateContactNumber','Alternate Contact Number','trim|max_length[13]');
$this->form_validation->set_rules('emailid','emailid','valid_email|max_length[128]|required');
- $this->form_validation->set_rules('TIN','TIN','trim|required|max_length[11]');
+ $this->form_validation->set_rules('TIN','TIN','trim|max_length[11]');
if($pan=='')
{
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]');
@@ -341,11 +350,16 @@ class supplier extends BaseController
{
$this->form_validation->set_rules('panno', 'panno', 'trim|max_length[10]|callback_checkPanValidateSupplier');
}
+ if($gst=='')
+ {
+ $this->form_validation->set_rules('GSTNo','GSTNo','trim|max_length[15]');
+ }
+ else
+ {
+ $this->form_validation->set_rules('GSTNo','GSTNo','trim|max_length[15]|callback_checkGstValidateSupplier');
+ }
- $this->form_validation->set_rules('GSTNo','GSTNo','trim|requried|max_length[15]|callback_checkGstValidateSupplier');
-
-
-
+
if($this->form_validation->run() == FALSE)
{
$this->viewsupplier($supplierID);
diff --git a/application/controllers/user.php b/application/controllers/user.php
index 5cdd43a4..facfffa2 100755
--- a/application/controllers/user.php
+++ b/application/controllers/user.php
@@ -11,7 +11,7 @@ require APPPATH . '/libraries/BaseController.php';
*/
class user extends BaseController
{
- /**
+ /**
* Default constructor of the class
*/
public function __construct()
@@ -19,7 +19,8 @@ class user extends BaseController
parent::__construct();
$this->load->model('user_model');
$this->load->model('dahsboard_Model');
- $this->load->library('form_validation');
+ $this->load->library('form_validation');
+ $this->load->model('costcenter_model');
$this->isLoggedIn();
}
@@ -29,35 +30,28 @@ class user extends BaseController
*/
public function index()
{
- $this->global['pageTitle'] = 'Resico : Dashboard';
+ $this->global['pageTitle'] = 'Siddharth : Dashboard';
$this->load->model('employeedetails_model');
$this->load->model('dahsboard_Model');
- $data['EmpCount'] = $this->employeedetails_model->getEmployeeCount();
- $data['UserCount'] = $this->dahsboard_Model->getUserCount();
+ $data['EmpCount'] = $this->employeedetails_model->getEmployeeCount();
+
$data['totalpurchaseorder']=$this->dahsboard_Model->totalpurchaseorder();
- //print_r( $data['totalpurchaseorder']);
+
$data['totalordervalue']=$this->dahsboard_Model->totalordervalue();
$data['pendingpo']=$this->dahsboard_Model->pendingpo();
- // $data['totalserviceamount']=$this->dahsboard_Model->totalserviceamount();
- // $data['totalcapitalamount']=$this->dahsboard_Model->totalcapitalamount();
- // $data['totalimportamount']=$this->dahsboard_Model->totalimportamount();
- // $data['totalrevenueamount']=$this->dahsboard_Model->totalrevenueamount();
-
- // $data['totalservicepo']=$this->dahsboard_Model->totalservicepo();
- // $data['totalrevenuepo']=$this->dahsboard_Model->totalrevenuepo();
$data['totalimportpo']=$this->dahsboard_Model->totalimportpo();
- //$data['totalcapitalpo']=$this->dahsboard_Model->totalcapitalpo();
+
$data['details']=$this->dahsboard_Model->reqdetail();
$data['pending_details']=$this->dahsboard_Model->req_pending();
- // $data['list']=$this->dahsboard_Model->req_list();
+
$data['serviceprogress']=$this->dahsboard_Model->serviceprogress();
$data['revenueprogress']=$this->dahsboard_Model->revenueprogress();
@@ -72,696 +66,899 @@ class user extends BaseController
//dashboard pie chart
$data['importbudgt'] = $this->dahsboard_Model->importbudgt();
- //$data['importbal'] = $this->dahsboard_Model->importbal();
- $data['servicebudgt'] = $this->dahsboard_Model->servicebudgt();
- //$data['servicebal'] = $this->dahsboard_Model->servicebal();
+ $data['servicebudgt'] = $this->dahsboard_Model->servicebudgt();
$data['revenuebudgt'] = $this->dahsboard_Model->revenuebudgt();
- //$data['revenuebal'] = $this->dahsboard_Model->revenuebal();
$data['capitalbud'] = $this->dahsboard_Model->capitalbud();
- //$data['capitalbal'] = $this->dahsboard_Model->capitalbal();
- $data['typebal'] = $this->dahsboard_Model->typebal();
-
+ $data['typebal'] = $this->dahsboard_Model->typebal();
- /* HR DASHBOARD Controller Start*/
- $data['totemp'] = $this->dahsboard_Model->totemp();
- $data['totloan'] = $this->dahsboard_Model->totloan();
- $data['totpay'] = $this->dahsboard_Model->totpay();
- $data['totrec'] = $this->dahsboard_Model->totrec();
- $data['emplist'] = $this->dahsboard_Model->emplist();
+ /* HR DASHBOARD Controller Start*/
- /* yesterday absent list count in employee*/
- $dates = date('Y-m');
- $date = $dates . '-01';
- // echo $date;
- $dat = date('d', strtotime("-1 days"));
- //echo $date;
+ $data['totemp'] = $this->dahsboard_Model->totemp();
+ $data['totloan'] = $this->dahsboard_Model->totloan();
+ $data['totpay'] = $this->dahsboard_Model->totpay();
+ $data['totrec'] = $this->dahsboard_Model->totrec();
+ $data['emplist'] = $this->dahsboard_Model->emplist();
+ $date = $this->input->post("id");
+ $dates = date('Y-m');
+ $date = $dates . '-01';
+ // // // echo $date;
+ $dat = date('d', strtotime("-1 days"));
+ // //echo $date;
- $WH = 'WH' . date('j', strtotime("-1 days"));
+ $WH = 'WH' . date('j', strtotime("-1 days"));
- //echo($WH);
- $yesterday = $this->dahsboard_Model->attyesterday($WH, $date);
+ $yesterday = $this->dahsboard_Model->attyesterday($WH, $date);
//print_r($yesterday);die;
- $values = 0;
- foreach ($yesterday as $weekda => $value) {
+ $valuess = 0;
+ foreach ($yesterday as $weekda => $value)
+ {
- if ($value[$WH] == 0) {
+ if ($value[$WH] == 0)
+ {
- $values++;
- }
+ $valuess++;
+ }
- }
- // echo $values;
- $data['values'] = $values;
+ }
+ // echo $values;
+ $data['today'] = $valuess;
+
+ $daydate = date('Y-m',strtotime($date));
+ //echo $date; die;
+ $daydate = $daydate . '-01';
+
+
+ $yesterday = $this->dahsboard_Model->attyesterday($WH, $daydate);
+ // print_r($yesterday);
- /*Today absent list count in employee*/
- $dates = date('Y-m');
- //echo $date;
- $date = $dates . '-01';
+ //$absEmp =array($absEmp);
+ $values = 0;
+ $absEmp = array();
+ //echo $value; die;
+ foreach ($yesterday as $weekda => $value)
+ {
+ // echo $value[$WH];
- $dat = date('d');
- //echo $date;
+ if ($value[$WH] == 0)
+ {
- $WH = 'WH' . date('j');
- //echo $WH;die;
+ $values++;
+ $absendId = $value['EmpID'];
+ $absendName = $value['FirstName'];
+ $absEmp [] = $absendId . "-" . $absendName; //absend empid and name list
+ }
+ }
- $yesterday = $this->dahsboard_Model->attyesterday($WH, $date);
- //print_r($yesterday);die;
+ //print_r($absentName);die;
+ // $data['today'] = $values;
+ $data['abs_name'] = $absEmp;
+
+ $OT = 'OT' . date('j',strtotime($date));
+
+ $CUR_month = date('t');
+ //echo $CUR_month;
+ //echo $daydate;
+ $toDayEmployee = $this->dahsboard_Model->yesterdayAllPersentEmpSalary($WH, $OT, $daydate);
+ //$EmpID = $toDayEmployee[0]->EmpID;
+ //print_r($toDayEmployee); die;
- //$absEmp =array($absEmp);
- $values = 0;
- $absEmp = array();
- //echo $value; die;
- foreach ($yesterday as $weekda => $value) {
+ $EmpID = 0;
- if ($value[$WH] == 0) {
+ $employeeSalary = 0;
- $values++;
- $absendId = $value['EmpID'];
- $absendName = $value['FirstName'];
+ foreach ($toDayEmployee as $value)
+ {
+ $values = 0;
+ $totalothour = 0;
+ if ($value[$WH] != 0)
+ {
- $absEmp [] = $absendId . "-" . $absendName; //absend empid and name list
+ $totalothour = $value[$OT];
+ //echo $totalothour;die;
+ $values = 1;
+ //print_r($values); die;
+ $Empid = $value['EmpID'];
+ //print_r($value['EmpID']);
- // foreach($absEmp as $value => $absentEmpName){
+ $totalEmployeePersent = $this->dahsboard_Model->persentEmployeeDetails($Empid);
+
+ // echo $Empid;
+ // print_r($totalEmployeePersent);
- // echo $absentEmpName; die;
+ if(!empty($totalEmployeePersent))
+ {
- // }
+ $HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
+ $Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
+ $totalsalary = $totalEmployeePersent[0]->TotalSalary;
+ $dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
+ //$allowances =$totalEmployeePersent[0]->Allowances;
+ //echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary));
+ //$Allowances = $allowances * $values;
+ $Food_Allowances = $dayFoodAmt * $values;
- }
+ $daySalary = $Basic_Pay / $CUR_month;
+ /**per day salary working hour**/
+ //echo $daySalary.'
';
-
- }
-
- //print_r($absentName);die;
- $data['today'] = $values;
- $data['absname'] = $absEmp;
- // function todayEmployeeSalaylist()
- //{
-
- $date = date('Y-m');
- //echo $date; die;
- $date = $date . '-01';
- $dat = date('d');
-
- //echo $dat; die;
- $WH = 'WH' . date('j');
- $OT = 'OT' . date('j');
-
- $CUR_month = date('t');
- // echo $CUR_month; die;
-
- $toDayEmployee = $this->dahsboard_Model->dayAllPersentEmpSalary($WH, $OT, $date);
- //$EmpID = $toDayEmployee[0]->EmpID;
-
- // print_r($toDayEmployee); die;
-
- $EmpID = 0;
-
- $employeeSalary = 0;
-
- foreach ($toDayEmployee as $value) {
- $values = 0;
- $totalothour = 0;
- if ($value[$WH] != 0) {
- $totalothour = $value[$OT];
- //echo $totalothour;die;
- $values = 1;
-
- //print_r($values); die;
- $Empid = $value['EmpID'];
- //echo $Empid; die;
-
- $totalEmployeePersent = $this->dahsboard_Model->persentEmployeeDetails($Empid);
- //print_r($totalEmployeePersent);die;
-
- $HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
- $Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
- $totalsalary = $totalEmployeePersent[0]->TotalSalary;
- $dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
- //$allowances =$totalEmployeePersent[0]->Allowances;
- //$Allowances = $allowances * $values;
- $Food_Allowances = $dayFoodAmt * $values;
-
- $daySalary = $Basic_Pay / $CUR_month;
- /**per day salary working hour**/
- //echo $daySalary.'
';
-
- $dayHra = $HRA_Amount / $CUR_month;
- /** per day hra amount **/
- //echo $dayHra.'
';
- $onehoursSalary = ($daySalary + $dayHra) / 8;
- /**one hour salay ot calculation**/
- if ($totalothour != 0) /** if ot not equal zero **/ {
- $totSalayOT = $totalothour * $onehoursSalary;
- } else {
- $totSalayOT = 0;
+ $dayHra = $HRA_Amount / $CUR_month;
+ /** per day hra amount **/
+ //echo $dayHra.'
';
+
+ $onehoursSalary = ($daySalary + $dayHra) / 8;
+ /**one hour salay ot calculation**/
+ if ($totalothour != 0) /** if ot not equal zero **/
+ {
+ $totSalayOT = $totalothour * $onehoursSalary;
+ }
+ else
+ {
+ $totSalayOT = 0;
}
- $currentDaySalary = $daySalary * $values;
- /** current day salary working days calculation**/
+ $currentDaySalary = $daySalary * $values;
+ /** current day salary working days calculation**/
- $currentDayHra = $dayHra * $values;
- /** total working days hra calculations**/
- // echo $currentDayHra.'
';
- $currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT;
- /** current date pf calculation**/
- if ($totalsalary <= 20000) {
+ $currentDayHra = $dayHra * $values;
+ /** total working days hra calculations**/
+ // echo $currentDayHra.'
';
+ $currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT;
+ /** current date pf calculation**/
+ if ($totalsalary <= 20000)
+ {
- $esiAmount = $currentDatePF * 1.75 / 100;
- /** esiamount not elgiable for 20000 **/
- } else {
- $esiAmount = 0;
- }
- $pfAmount = $currentDaySalary * 12 / 100;
- /** pf amount per day**/
+ $esiAmount = $currentDatePF * 1.75 / 100;
+ /** esiamount not elgiable for 20000 **/
+ }
+ else
+ {
+ $esiAmount = 0;
+ }
+ $pfAmount = $currentDaySalary * 12 / 100;
+ /** pf amount per day**/
- //echo $totalothour;die;
- $salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
- $salaryInCurrentday = $salaryInCurrentdays - ($esiAmount + $pfAmount);
- $employeeSalary += round($salaryInCurrentday);
+ //echo $totalothour;die;
+ $salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
+ $salaryInCurrentday = $salaryInCurrentdays - ($esiAmount + $pfAmount);
+ $employeeSalary += round($salaryInCurrentday);
}
+ // echo $employeeSalary;
+ }
- }
+ }
- //$salaryInCurrentday++;
+ //$salaryInCurrentday++;
- $data['employeeSalary'] = $employeeSalary;
+ $data['employeeSalary'] = $employeeSalary;
- // }
+
+ $working = array();
+ $overtime = array();
+ //$holid = array();
+ for ($i = 1; $i <= $dat; $i++) //echo $dat; die;
+ {
+
- // function monthTodayEmployeeSalaylist()
- // {
+ $Working [] = 'WH' . $i;
+ $overtime [] = 'OT' . $i;
- $date = date('Y-m');
- //echo $date; die;
- $date = $date . '-01';
- $dat = date('d');
+ $CUR_month = date('t');
+ // echo $CUR_month; die;
+ // foreach ($holiday as $value)
+ // {
+ // //$holid []= 'WH'.$value;
+ // if($i==$value) {
+ // $holid []=$value;
+ // }
+ // }
- // $currentdaydates =date('d');
- $working = array();
- $overtime = array();
- for ($i = 1; $i <= $dat; $i++) //echo $dat; die;
- {
- $Working [] = 'WH' . $i;
- $overtime [] = 'OT' . $i;
-
- $CUR_month = date('t');
- // echo $CUR_month; die;
- }
- //print_r($WH);die;
- $WH = implode(",", $Working);
- $OT = implode(",", $overtime);
- $salarycurrentdate = array();
- $toDayEmployee = $this->dahsboard_Model->dayAllPersentEmpSalary($WH, $OT, $date);
- //$EmpID = $toDayEmployee[0]->EmpID;
- //
+ }
+ //print_r($WH);die;
+ $WH = implode(",", $Working);
- // print_r($toDayEmployee); die;
+ $OT = implode(",", $overtime);
+ $salarycurrentdate = array();
- $employeeSalary = 0;
- // for($i=1;$i<=$dat;$i++)
- // {
+
+ $toDayEmployee = $this->dahsboard_Model->dayAllPersentEmpSalary($WH, $OT, $date);
+
- $totalSalary = 0;
- $working = explode(",", $WH);
- $overtime = explode(",", $OT);
- foreach ($toDayEmployee as $value) {
- $values = 0;
- foreach ($working as $work) {
+ $totalSalary = 0;
+ $working = explode(",", $WH);
+ $overtime = explode(",", $OT);
+ foreach ($toDayEmployee as $value)
+ {
+ $values = 0;
+ foreach ($working as $work)
+ {
// foreach ($overtime as $extra) {
- if ($value[$work] != 0 || $value['OT' . substr($work, 2)] != 0) {
- $totalothour = $value['OT' . substr($work, 2)];
- //echo $totalothour;
- $values = 1;
-
- //print_r($values); die;
- $Empid = $value['EmpID'];
- //echo $Empid;
-
- $totalEmployeePersent = $this->dahsboard_Model->persentEmployeeDetails($Empid);
- //print_r($totalEmployeePersent);
-
- $HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
- $Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
- $totalsalary = $totalEmployeePersent[0]->TotalSalary;
- $dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
- //$allowances =$totalEmployeePersent[0]->Allowances;
- //$Allowances = $allowances * $values;
- $Food_Allowances = $dayFoodAmt * $values;
-
- $daySalary = $Basic_Pay / $CUR_month;
- /**per day salary working hour**/
- //echo $daySalary.'
';
-
- $dayHra = $HRA_Amount / $CUR_month;
- /** per day hra amount **/
- //echo $dayHra.'
';
- $onehoursSalary = ($daySalary + $dayHra) / 8;
- /**one hour salay ot calculation**/
- if ($totalothour != 0) /** if ot not equal zero **/ {
- $totSalayOT = $totalothour * $onehoursSalary;
- } else {
- $totSalayOT = 0;
- }
- $currentDaySalary = $daySalary * $values;
- /** current day salary working days calculation**/
-
-
- $currentDayHra = $dayHra * $values;
- /** total working days hra calculations**/
- // echo $currentDayHra.'
';
- $currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT;
- /** current date pf calculation**/
- if ($totalsalary <= 20000) {
-
- $esiAmount = $currentDatePF * 1.75 / 100;
- /** esiamount not elgiable for 20000 **/
- } else {
- $esiAmount = 0;
- }
- $pfAmount = $currentDaySalary * 12 / 100;
- /** pf amount per day**/
-
- //echo $totalothour;die;
- $salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances; /* + $Allowances;*/
- $salaryInCurrentday = $salaryInCurrentdays -($esiAmount+$pfAmount);
-
- $totalSalarys = $totalSalary + $salaryInCurrentday;
-
- $totalSalary = round($totalSalarys);
-// $salarycurrentdate[] = $salaryInCurrentday;;
- }
-
-// }
- //print_r($salarycurrentdate);
-// $currentmonthsalary = array_sum($salarycurrentdate);
-// $totalSalary = $totalSalary + $salarycurrentdate;
- // $salaryInCurrentday++;
-// echo $totalSalary;
- //print_r($currentmonthsalary);
-
- }
- }
- $data['totalSalary'] = $totalSalary;
- //}
-
-
- $this->loadViews("dashboard", $this->global, $data, NULL);
- }
-
-
-
-
-
- public function getFinancialStartDate()
- {
- $CURMONTH = date('n');
- $CURYEAR = date('Y');
- $FINYEAR = 0;
- if ($CURMONTH >= 4)
- {
- $FINYEAR = $CURYEAR;
- } else
- {
- $FINYEAR = $CURYEAR - 1;
- }
-
- $dateInString = $FINYEAR . '-4-1';
- $result = date_create($dateInString);
- return $result;
- }
-
- public function getFinancialEndDate()
- {
- $CURMONTH = date('n');
- $CURYEAR = date('Y');
- $FINYEAR = 0;
- if ($CURMONTH < 4)
- {
- $FINYEAR = $CURYEAR;
- } else
- {
- $FINYEAR = $CURYEAR + 1;
- }
-
- $dateInString = $FINYEAR . '-3-31';
- $result = date_create($dateInString);
- return $result;
- }
-
-function monthattendance()
-{
-
- $date = date('Y-m');
- //echo $date;
- $dates = $date . '-01';
- $EmpID = $this->input->post('id');
- // echo $EmpID;die;
- $monthabs = $this->dahsboard_Model->attendance($EmpID, $dates);
- $persent_month = date('t');//current month of days 31
- $values = array();
- $otvalues = array();
-
- $weekdays = array();
- $otHours = array();
- $date = date('j');//current month current date
-
-
- $CURDATE =date('d');//current month current date
-
- $CUR_month = date('t'); //current month of days 31
-
-
- $CURYEAR = date('Y');
- $CURMONTH = date('m');
-
- $datejoin = $this->dahsboard_Model->joindate($EmpID);
- $DateofJoiningInString = $datejoin[0]->DateofJoining;
- $DateofJoining = date_create($DateofJoiningInString);
- $doj_month = date_format($DateofJoining, "n");
- $doj_year = date_format($DateofJoining, "Y");
- $doj_day = date_format($DateofJoining, "j");
- //echo $doj_day;
- for ($i = 1; $i <= $persent_month; $i++)
- {
- $weekdays[] = 'WH' . $i;
- $otHours[] = 'OT' . $i;
- }
-
- foreach ($monthabs as $weekda)
- {
- //print_r($weekda);
- foreach ($weekda as $key => $value)
- {
- //print_r($key);
- foreach ($weekdays as $weeks)
- {
- if ($weeks == $key)
- {
- //print_r($key);
- if ($value != 0)
- {
- //echo $value;
- $values[] = $value;
-
- }
- //echo $values;
- }
-
- }
- foreach ($otHours as $ot)
- {
- if ($ot == $key)
- {
- if ($value != 0)
- {
- $otvalues [] = $value;
-
- }
-
- }
- }
-
- }
- }
-
-
- $totalothour = array_sum($otvalues);
- $totalwhhour = sizeof($values);
- //echo $totalwhhour;
- if ($CURMONTH == $doj_month && $CURYEAR == $doj_year)
- {
- //echo $doj_day;
- $month['CUR_month'] = $CURDATE - $doj_day + 1;
- //print_r($month);
- }
- else
- {
- $month['CUR_month'] = $date;
- }
-
- if ($totalwhhour != 0)
- {
- // //echo $values;
- // $currentDateSalary = $this->dahsboard_Model->daysalary($EmpID, $dates);
- // $HRA_Amount = $currentDateSalary[0]->HRA_Amount;
- // $Basic_Pay = $currentDateSalary[0]->Basic_Pay;
- // $totalsalary = $currentDateSalary[0]->TotalSalary;
- // $dayFoodAmt = $currentDateSalary[0]->Food_Allowances;
-
- // $Food_Allowances = $dayFoodAmt * $values;
-
- // $daySalary = $Basic_Pay / $CUR_month;
-
- // $onehoursSalary = $daySalary / 8;
-
- // if ($totalothour != 0)
- // {
- // $totSalayOT = $totalothour * $onehoursSalary;
- // }
- // else
- // {
- // $totSalayOT = 0;
- // }
- // $currentDaySalary = $daySalary * $values;
-
- // $dayHra = $HRA_Amount / $CUR_month;
-
- // $currentDayHra = $dayHra * $values;
-
- // $currentDatePF = $currentDaySalary + $currentDayHra;
-
- // if ($totalsalary <= 20000)
- // {
- // $esiAmount = $currentDatePF * 1.75 / 100;
-
- // }
- // else
- // {
- // $esiAmount = 0;
- // }
- // $pfAmount = $currentDaySalary * 12 / 100;
-
- // $salaryInCurrentday = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
-
- $year = date('Y');
- $current_month = date('m');
-
- $month['values'] = $totalwhhour;
- //$data['salaryInCurrentday'] = round($salaryInCurrentday);
- $month['present_percentage'] = round(($totalwhhour / $month['CUR_month']) * 100);
-
- }
-
- else {
-
- $month['values'] = 0;
- //$data['salaryInCurrentday'] = 0;
- $month['present_percentage'] = 0;
-
- }
- echo json_encode($month);
- }
-
-
-function attendanceyear()
-{
- //echo "hai";die;
- $CURMONTH = date('m');
- $CURDATE = date('d');
- $CURYEAR = date('Y');
- $EmpID = $this->input->post('id');
- // $month = $this->monthattendance($EmpID);
- // echo json_encode($month);
- $day = array();
- $datejoin = $this->dahsboard_Model->joindate($EmpID);
- $DateofJoiningInString = $datejoin[0]->DateofJoining;
- $DateofJoining = date_create($DateofJoiningInString);
- $doj_month = date_format($DateofJoining, "n");
- $doj_year = date_format($DateofJoining, "Y");
- $doj_day = date_format($DateofJoining, "j");
- $finStart = $this->getFinancialStartDate();
- $finEnd = $this->getFinancialEndDate();
-
- $JoinedMonth = date_format($DateofJoining, "n");
- // echo $JoinedMonth; die;
-
- if ($DateofJoining >= $finStart && $DateofJoining <= $finEnd)
- {
- $JoinedMonthAttendance = $this->dahsboard_Model->getAllAttendances($EmpID,$JoinedMonth);
- $joinedMonthDaysCount = cal_days_in_month(CAL_GREGORIAN, $doj_month, $doj_year);
-
- if ($CURMONTH == $doj_month && $CURYEAR == $doj_year)
- {
- $joinedMonthWorkingDayCount = $CURDATE - $doj_day +1;
- }
- else
- {
- $joinedMonthWorkingDayCount = $joinedMonthDaysCount - $doj_day;
- }
-
- $joinedMonthDays = 0;
- for ($j = $doj_day; $j <= $joinedMonthDaysCount; $j++)
- {
- $weekdays[] = 'WH' . $j;
- }
- foreach ($JoinedMonthAttendance as $day)
- {
- foreach ($day as $key => $value)
- {
- foreach ($weekdays as $weeks)
- {
- if ($weeks == $key)
- {
- if ($value != 0)
- {
- //echo $value;
- $joinedMonthDays++;
- }
- }
-
- }
- }
-
- }
-
- // echo $joinedMonthWorkingDayCount;die;
-
- $result = $this->dahsboard_Model->attendanceyear($EmpID, $JoinedMonth + 1);
- $yearabs = $this->dahsboard_Model->getAllAttendance($EmpID, $CURMONTH);
- $TotalNoofDays = $result[0]->TotalWorkingDays;
- $DaysWorked = $result[0]->DaysWorked;
-
- // echo $DaysWorked; die;
- // print_r($DaysWorked);die;
- $values = 0;
- $weekdays = array();
- $date = date('d');
-
- $Work = array_sum($weekdays);
-
- for ($j = 1; $j <= $date; $j++)
- {
- $weekdays[] = 'WH' . $j;
- }
-
- foreach ($yearabs as $day)
- {
- foreach ($day as $key => $value)
+ if ($value[$work] != 0 || $value['OT' . substr($work, 2)] != 0)
{
- foreach ($weekdays as $weeks)
- {
- if ($weeks == $key)
- {
- if ($value != 0)
- {
- $values++;
- }
- }
+ $totalothour = $value['OT' . substr($work, 2)];
+ //echo $totalothour;
+ $values = 1;
- }
- }
- }
+ //print_r($values); die;
+ $Empid = $value['EmpID'];
+ //echo $Empid;
+
+ $totalEmployeePersent = $this->dahsboard_Model->persentEmployeeDetails($Empid);
+ if(!empty($totalEmployeePersent))
+ {
+
+ $HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
+ $Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
+ $totalsalary = $totalEmployeePersent[0]->TotalSalary;
+ $dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
+ //$allowances =$totalEmployeePersent[0]->Allowances;
+
+ // $Allowances = $allowances * $values;
+
+
+ $Food_Allowances = $dayFoodAmt * $values;
+
+ $daySalary = $Basic_Pay / $CUR_month;
+ /**per day salary working hour**/
+ //echo $daySalary.'
';
+
+ $dayHra = $HRA_Amount / $CUR_month;
+ /** per day hra amount **/
+ //echo $dayHra.'
';
+ $onehoursSalary = ($daySalary + $dayHra) / 8;
+ /**one hour salay ot calculation**/
+ if ($totalothour != 0) /** if ot not equal zero **/
+ {
+ $totSalayOT = $totalothour * $onehoursSalary;
+ }
+ else
+ {
+ $totSalayOT = 0;
+ }
+ $currentDaySalary = $daySalary * $values;
+ /** current day salary working days calculation**/
+
+
+ $currentDayHra = $dayHra * $values;
+ /** total working days hra calculations**/
+ // echo $currentDayHra.'
';
+ $currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT;
+ /** current date pf calculation**/
+ if ($totalsalary <= 20000)
+ {
+
+ $esiAmount = $currentDatePF * 1.75 / 100;
+ /** esiamount not elgiable for 20000 **/
+ } else {
+ $esiAmount = 0;
+ }
+ $pfAmount = $currentDaySalary * 12 / 100;
+ /** pf amount per day**/
+
+ //echo $totalothour;die;
+ $salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances ;
+
+ $salaryInCurrentday = $salaryInCurrentdays -($esiAmount+$pfAmount);
+ $totalSalarys = $totalSalary + $salaryInCurrentday;
+
+ $totalSalary = round($totalSalarys);
+// $salarycurrentdate[] = $salaryInCurrentday;;
+ // echo 'totalSalary';
+ }
- $DaysWorked = 0;
- if ($CURMONTH == $doj_month && $CURYEAR == $doj_year)
- {
- $TotalNoofDays = $TotalNoofDays + $joinedMonthWorkingDayCount;
- $DaysWorked = $joinedMonthDays;
}
- else
- {
- $TotalNoofDays = $TotalNoofDays + $CURDATE + $joinedMonthWorkingDayCount;
- $DaysWorked = $DaysWorked + $joinedMonthDays + $values;
- }
- // $DaysWorked = $DaysWorked + $joinedMonthDays + $values;
-//echo $TotalNoofDays.'-'.$DaysWorked;
+ }
+ }
+ $data['totalSalary'] = $totalSalary;
+ // print_r( 'totalSalary');die;
- $final_res = round(($DaysWorked / $TotalNoofDays) * 100);
- // echo "------";
- //echo $final_res;exit();
- $data['workeds'] = $DaysWorked;
- $data['yeardata'] = $final_res;
- $data['totaldays'] = $TotalNoofDays;
+ $this->loadViews("dashboard", $this->global, $data, NULL);
+ }
- }
+/*date click on day salary,absent name, total absent display*/
- else
- {
- $result = $this->dahsboard_Model->attendanceyear($EmpID, 4);
- $yearabs = $this->dahsboard_Model->getAllAttendance($EmpID, $CURMONTH);
- $TotalNoofDays = $result[0]->TotalWorkingDays;
- $DaysWorked = $result[0]->DaysWorked;
+function dateFunctionChangeVales()
+{
+
- $values = 0;
+ $date = $this->input->post("id");
+ $dates = date('Y-m');
+ $date = $dates . '-01';
+ // // echo $date;
+ // $dat = date('d', strtotime("-1 days"));
+ //echo $date;
- $weekdays = array();
- $date = date('d');
+ $WH = 'WH' . date('j', strtotime("-1 days"));
- $Work = array_sum($weekdays);
+ //echo($WH);
+ $yesterday = $this->dahsboard_Model->attyesterday($WH, $date);
+ //print_r($yesterday);die;
+ $values = 0;
+ foreach ($yesterday as $weekda => $value)
+ {
- for ($j = 1; $j <= $date; $j++)
- {
- $weekdays[] = 'WH' . $j;
- }
- foreach ($yearabs as $day)
- {
- foreach ($day as $key => $value)
- {
- foreach ($weekdays as $weeks)
- {
- if ($weeks == $key)
- {
- if ($value != 0)
- {
+ if ($value[$WH] == 0)
+ {
- $values++;
- }
- }
+ $values++;
+ }
- }
- }
- }
- $TotalNoofDays = $TotalNoofDays + $CURDATE;
- $DaysWorked = $DaysWorked + $values;
- $final_res = round(($DaysWorked / $TotalNoofDays) * 100);
- // echo "------";
- //echo $final_res;exit();
- $data['workeds'] = $DaysWorked;
- $data['yeardata'] = $final_res;
- $data['totaldays'] = $TotalNoofDays;
+ }
+ // echo $values;
+ $data['values'] = $values;
- // $month = $this->monthattendance();
- // $data['values'] = $values;
- // $data['salaryInCurrentday'] = round($salaryInCurrentday);
- // $data['present_percentage'] = round(($values / $data['CUR_month']) * 100);
- //print_r($data);die;
-
- }
- echo json_encode($data);
+ $date = $this->input->post("id");
+ // echo $date;
+ $daydate = date('Y-m',strtotime($date));
+ //echo $date; die;
+ $daydate = $daydate . '-01';
+ //$dat = date('d');
+ // echo $daydate; echo "";
+ $WH = 'WH' . date('j',strtotime($date));
+ // echo $WH;
+
+ $yesterday = $this->dahsboard_Model->attyesterday($WH, $daydate);
+ // print_r($yesterday);
+
+
+ //$absEmp =array($absEmp);
+ $values = 0;
+ $absEmp = array();
+ //echo $value; die;
+ foreach ($yesterday as $weekda => $value)
+ {
+ // echo $value[$WH];
+
+ if ($value[$WH] == 0)
+ {
+
+ $values++;
+ $absendId = $value['EmpID'];
+ $absendName = $value['FirstName'];
+ $absEmp [] = $absendId . "-" . $absendName; //absend empid and name list
+ }
+ }
+
+ //print_r($absentName);die;
+ $data['today'] = $values;
+ $data['absname'] = $absEmp;
+
+ $OT = 'OT' . date('j',strtotime($date));
+
+ $CUR_month = date('t');
+ //echo $CUR_month;
+ //echo $daydate;
+ $toDayEmployee = $this->dahsboard_Model->dayAllPersentEmpSalary($WH, $OT, $daydate);
+ //$EmpID = $toDayEmployee[0]->EmpID;
+
+ //print_r($toDayEmployee); die;
+
+ $EmpID = 0;
+
+ $employeeSalary = 0;
+
+ foreach ($toDayEmployee as $value)
+ {
+ $values = 0;
+ $totalothour = 0;
+
+ if ($value[$WH] != 0)
+ {
+
+ $totalothour = $value[$OT];
+ //echo $totalothour;die;
+ $values = 1;
+
+ //print_r($values); die;
+ $Empid = $value['EmpID'];
+ //print_r($value['EmpID']);
+
+ $totalEmployeePersent = $this->dahsboard_Model->persentEmployeeDetails($Empid);
+ // echo $Empid;
+ // print_r($totalEmployeePersent);
+
+ if(!empty($totalEmployeePersent))
+ {
+
+ $HRA_Amount = $totalEmployeePersent[0]->HRA_Amount;
+ $Basic_Pay = $totalEmployeePersent[0]->Basic_Pay;
+ $totalsalary = $totalEmployeePersent[0]->TotalSalary;
+ $dayFoodAmt = $totalEmployeePersent[0]->Food_Allowances;
+ //$allowances =$totalEmployeePersent[0]->Allowances;
+ //echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary));
+ //$Allowances = $allowances * $values;
+ $Food_Allowances = $dayFoodAmt * $values;
+
+ $daySalary = $Basic_Pay / $CUR_month;
+ /**per day salary working hour**/
+ //echo $daySalary.'
';
+
+ $dayHra = $HRA_Amount / $CUR_month;
+ /** per day hra amount **/
+ //echo $dayHra.'
';
+
+ $onehoursSalary = ($daySalary + $dayHra) / 8;
+ /**one hour salay ot calculation**/
+ if ($totalothour != 0) /** if ot not equal zero **/
+ {
+ $totSalayOT = $totalothour * $onehoursSalary;
+ } else {
+ $totSalayOT = 0;
+ }
+ $currentDaySalary = $daySalary * $values;
+ /** current day salary working days calculation**/
+
+
+ $currentDayHra = $dayHra * $values;
+ /** total working days hra calculations**/
+ // echo $currentDayHra.'
';
+ $currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT;
+ /** current date pf calculation**/
+ if ($totalsalary <= 20000)
+ {
+
+ $esiAmount = $currentDatePF * 1.75 / 100;
+ /** esiamount not elgiable for 20000 **/
+ } else {
+ $esiAmount = 0;
+ }
+ $pfAmount = $currentDaySalary * 12 / 100;
+ /** pf amount per day**/
+
+ //echo $totalothour;die;
+ $salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $Food_Allowances;
+ $salaryInCurrentday = $salaryInCurrentdays - ($esiAmount + $pfAmount);
+ $employeeSalary += round($salaryInCurrentday);
+
+ }
+ // echo $employeeSalary;
+ }
+
+ }
+
+
+ //$salaryInCurrentday++;
+
+
+ $data['employeeSalary'] = $employeeSalary;
+
+
+ // }
+ echo json_encode($data);
+}
+
+
+/*this function uesd to finance startdate */
+
+ public function getFinancialStartDate()
+ {
+
+
+
+ $CURMONTH = date('n');
+ $CURYEAR = date('Y');
+ $FINYEAR = 0;
+ if ($CURMONTH >= 4)
+ {
+ $FINYEAR = $CURYEAR;
+ } else
+ {
+ $FINYEAR = $CURYEAR - 1;
+ }
+
+ $dateInString = $FINYEAR . '-4-1';
+ $result = date_create($dateInString);
+ // print_r($result);
+
+ return $result;
+
}
+
+/*this function uesd to finance EndDate */
+ public function getFinancialEndDate()
+ {
+ $CURMONTH = date('n');
+ $CURYEAR = date('Y');
+ $FINYEAR = 0;
+ if ($CURMONTH < 4)
+ {
+ $FINYEAR = $CURYEAR;
+ } else
+ {
+ $FINYEAR = $CURYEAR + 1;
+ }
+
+ $dateInString = $FINYEAR . '-3-31';
+ $result = date_create($dateInString);
+
+
+ // print_r($result);
+ return $result;
+
+
+ }
+
+
+
+/*this function used to speedometer month emp performances display*/
+
+ function monthattendance($empID ='')
+{
+
+ $date = date('Y-m');
+ //echo $date;
+ $dates = $date . '-01';
+ $EmpID = '';
+ if(empty($empID)){
+ $EmpID = $this->input->post('id');
+ }
+ else
+ {
+ $EmpID = $empID;
+ }
+ // echo $EmpID;die;
+ $monthabs = $this->dahsboard_Model->attendance($EmpID, $dates);
+ $persent_month = date('t');//current month of days 31
+ $values = array();
+ $otvalues = array();
+
+ $weekdays = array();
+ $otHours = array();
+ $date = date('j');//current month current date
+
+
+ $CURDATE =date('d');//current month current date
+
+ $CUR_month = date('t'); //current month of days 31
+
+
+ $CURYEAR = date('Y');
+ $CURMONTH = date('m');
+
+ $datejoin = $this->dahsboard_Model->joindate($EmpID);
+ $DateofJoiningInString = $datejoin[0]->DateofJoining;
+ $DateofJoining = date_create($DateofJoiningInString);
+ $doj_month = date_format($DateofJoining, "n");
+ $doj_year = date_format($DateofJoining, "Y");
+ $doj_day = date_format($DateofJoining, "j");
+ //echo $doj_day;
+ for ($i = 1; $i <= $persent_month; $i++)
+ {
+ $weekdays[] = 'WH' . $i;
+ $otHours[] = 'OT' . $i;
+ }
+ $totalwhhours=0;
+ foreach ($monthabs as $weekda)
+ {
+ //print_r($weekda);
+ foreach ($weekda as $key => $value)
+ {
+ //print_r($key);
+ foreach ($weekdays as $weeks)
+ {
+ if ($weeks == $key)
+ {
+ //print_r($key);
+ if ($value != 0)
+ {
+ //echo $value;
+ $values[] = $value;
+
+ }
+ //echo $values;
+ }
+
+ }
+ foreach ($otHours as $ot)
+ {
+ if ($ot == $key)
+ {
+ if ($value != 0)
+ {
+ $otvalues [] = $value;
+
+ }
+
+ }
+ }
+
+ }
+ }
+
+
+ $totalothour = array_sum($otvalues);
+ //$totalwhhour = sizeof($values);
+ $totalwhhours = array_sum($values);
+
+ $totalwhhour = $totalwhhours/8;
+ //echo $totalwhhour;
+ if ($CURMONTH == $doj_month && $CURYEAR == $doj_year)
+ {
+ //echo $doj_day;
+ $data['CUR_month'] = $CURDATE - $doj_day + 1;
+ //print_r($month);
+ }
+ else
+ {
+ $data['CUR_month'] = $date;
+ }
+
+ if ($totalwhhour != 0)
+ {
+ $year = date('Y');
+ $current_month = date('m');
+
+ $data['values'] = $totalwhhour;
+ //$data['salaryInCurrentday'] = round($salaryInCurrentday);
+ $data['present_percentage'] = round(($totalwhhour / $data['CUR_month']) * 100);
+
+ }
+
+ else {
+
+ $data['values'] = 0;
+ //$data['salaryInCurrentday'] = 0;
+ $data['present_percentage'] = 0;
+
+ }
+ if(empty($empID)){
+ echo json_encode( $data);
+ }
+ else{
+ return $data;
+ }
+ }
+
+
+
+
+
+
+
+/*this function used to speedometer year emp performances display*/
+
+function attendanceyear($empID ='')
+{
+
+ $CURMONTH = date('m');
+ $CURDATE = date('d');
+ $CURYEAR = date('Y');
+ $EmpID = '';
+ if(empty($empID))
+ {
+ $EmpID = $this->input->post('id');
+ }
+ else
+ {
+ $EmpID = $empID;
+ }
+
+ $day = array();
+ $datejoin = $this->dahsboard_Model->joindate($EmpID);
+
+ $DateofJoiningInString = $datejoin[0]->DateofJoining;
+ $DateofJoining = date_create($DateofJoiningInString);
+ // print_r($DateofJoining);
+ $doj_month = date_format($DateofJoining, "n");
+ $doj_year = date_format($DateofJoining, "Y");
+ $doj_day = date_format($DateofJoining, "j");
+
+ $finStart = $this->getFinancialStartDate();
+ $finEnd = $this->getFinancialEndDate();
+
+ $JoinedMonth = date_format($DateofJoining, "n");
+
+ // print_r($finStart);print_r($finEnd);
+ //print $JoinedMonth;
+
+ if ($DateofJoining >= $finStart && $DateofJoining <= $finEnd)
+ {
+ $JoinedMonthAttendance = $this->dahsboard_Model->getAllAttendances($EmpID,$JoinedMonth);
+ $joinedMonthDaysCount = cal_days_in_month(CAL_GREGORIAN, $doj_month, $doj_year);
+
+ if ($CURMONTH == $doj_month && $CURYEAR == $doj_year)
+ {
+ $joinedMonthWorkingDayCount = $CURDATE - $doj_day +1 ;
+ }
+ else
+ {
+ $joinedMonthWorkingDayCount = $joinedMonthDaysCount - $doj_day +1;
+ }
+
+ $joinedMonthDays = 0;
+ for ($j = $doj_day; $j <= $joinedMonthDaysCount; $j++)
+ {
+ $weekdays[] = 'WH' . $j;
+ }
+ foreach ($JoinedMonthAttendance as $day)
+ {
+ foreach ($day as $key => $value)
+ {
+ foreach ($weekdays as $weeks)
+ {
+ if ($weeks == $key)
+ {
+ if ($value != 0)
+ {
+ // echo $value;
+ $joinedMonthDays++;
+ }
+ }
+
+ }
+ }
+
+ }
+
+ //echo $joinedMonthDays;die;
+
+ $result = $this->dahsboard_Model->attendanceyear($EmpID, $JoinedMonth + 1);
+
+ //print_r($result);
+ $yearabs = $this->dahsboard_Model->getAllAttendance($EmpID, $CURMONTH);
+ $TotalNoofDays = $result[0]->TotalWorkingDays;
+ $DaysWorked = $result[0]->DaysWorked;
+
+ // echo $TotalNoofDays;
+ // echo $DaysWorked;die;
+ $values = 0;
+ $values = array();
+ $weekdays = array();
+ $date = date('d');
+
+ $Work = array_sum($weekdays);
+
+ for ($j = 1; $j <= $date; $j++)
+ {
+ $weekdays[] = 'WH' . $j;
+ }
+ $totalhours =0;
+ foreach ($yearabs as $day)
+ {
+ foreach ($day as $key => $value)
+ {
+ foreach ($weekdays as $weeks)
+ {
+ if ($weeks == $key)
+ {
+ if ($value != 0)
+ {
+ //$values++;
+ //$totalhours = array_sum($value);
+ $values[] = $value;
+
+ }
+ }
+
+ }
+ }
+ }
+
+ $DaysWorked = 0;
+
+ $totalhours = array_sum($values);
+
+ $values = $totalhours/8;
+ //print_r($totalhours);
+
+ if ($CURMONTH == $doj_month && $CURYEAR == $doj_year)
+ {
+ $TotalNoofDays = $TotalNoofDays + $joinedMonthWorkingDayCount;
+ $DaysWorked = $joinedMonthDays;
+ }
+ else
+ {
+ $TotalNoofDays = $TotalNoofDays + $CURDATE + $joinedMonthWorkingDayCount;
+ $DaysWorked = $DaysWorked + $joinedMonthDays + $values;
+ }
+
+
+
+
+ $final_res = round(($DaysWorked / $TotalNoofDays) * 100);
+ // echo "------";
+ //echo $final_res;exit();
+ $data['workeds'] = $DaysWorked;
+ $data['yeardata'] = $final_res;
+ $data['totaldays'] = $TotalNoofDays;
+
+ }
+
+ else
+ {
+ $result = $this->dahsboard_Model->attendanceyear($EmpID, 4);
+ $yearabs = $this->dahsboard_Model->getAllAttendance($EmpID, $CURMONTH);
+ $TotalNoofDays = $result[0]->TotalWorkingDays;
+ $DaysWorked = $result[0]->DaysWorked;
+
+
+ $values = 0;
+ $values = array();
+ $weekdays = array();
+ $date = date('d');
+
+ $Work = array_sum($weekdays);
+
+ for ($j = 1; $j <= $date; $j++)
+ {
+ $weekdays[] = 'WH' . $j;
+ }
+ foreach ($yearabs as $day)
+ {
+ foreach ($day as $key => $value)
+ {
+ foreach ($weekdays as $weeks)
+ {
+ if ($weeks == $key)
+ {
+ if ($value != 0)
+ {
+
+ $values[]=$value;
+ }
+ }
+
+ }
+ }
+ }
+
+ $totalhours = array_sum($values);
+
+ $values = $totalhours/8;
+
+ $TotalNoofDays = $TotalNoofDays + $CURDATE;
+ $DaysWorked = $DaysWorked + $values;
+ $final_res = round(($DaysWorked / $TotalNoofDays) * 100);
+ // echo "------";
+ //echo $final_res;exit();
+ $data['workeds'] = $DaysWorked;
+ $data['yeardata'] = $final_res;
+ $data['totaldays'] = $TotalNoofDays;
+
+
+ }
+
+ if(empty($empID))
+ {
+
+ echo json_encode($data);
+ }
+ else
+ {
+ return $data;
+ }
+}
+
+
+
+
+
+
+
+
+
+
/****************HR DASHBOART Controller END **************************************/
/**
@@ -778,7 +975,7 @@ function attendanceyear()
$data['userRecords'] = $this->user_model->userListing();
- $this->global['pageTitle'] = 'Resico : User Listing';
+ $this->global['pageTitle'] = 'Siddharth : User Listing';
$this->loadViews("users", $this->global, $data, NULL);
}
@@ -799,8 +996,10 @@ function attendanceyear()
$data['EmpList'] = $this->user_model->getAllEmployees();
$data['roles'] = $this->user_model->getUserRoles();
+
+ $data['Department'] = $this->costcenter_model->getDepartment();
- $this->global['pageTitle'] = 'Resico : Add New User';
+ $this->global['pageTitle'] = 'Siddharth : Add New User';
$this->loadViews("addNew", $this->global, $data, NULL);
}
@@ -856,19 +1055,19 @@ function attendanceyear()
}
}
/**
- * To add new user to the system
+ * This function is used to add new user to the system
*/
function addNewUser()
{
- if($this->isAdmin() == TRUE)
- {
- $this->loadThis();
- }
- else
- {
+ // if($this->isAdmin() == TRUE)
+ // {
+ // $this->loadThis();
+ // }
+ // else
+ // {
$this->form_validation->set_rules('EmpList','EmpList','trim|callback_Employee_validateS');
- $this->form_validation->set_rules('role','role','trim|callback_Role_validate');
+ // $this->form_validation->set_rules('role','role','trim|callback_Role_validate');
$this->form_validation->set_rules('password','Password','required|max_length[20]');
$this->form_validation->set_rules('cpassword','Confirm Password','trim|required|matches[password]|max_length[20]');
@@ -879,40 +1078,98 @@ function attendanceyear()
}
else
{
- $EmpID = $this->input->post('EmpList');
- $roleId = $this->input->post('role');
- $password = $this->input->post('password');
- $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
- $Createddt = $dt->format('Y-m-d H:i:s');
+ $EmpID = $this->input->post('EmpList');
+ $roleId = '2';
+ $password = $this->input->post('password');
+ $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
+ $Createddt = $dt->format('Y-m-d H:i:s');
$email = $this->input->post('MailID');
+
+ $SelectedDepartment = $this->input->post('txtSelectedDepartment');
+
+
+ $comma_separated = explode(':', $SelectedDepartment);
- $userInfo = array('email'=>$email,'EmpID'=>$EmpID,'password'=>getHashedPassword($password),'roleId'=>$roleId,'createdBy'=>$this->vendorId,'createdDtm'=>$Createddt);
-
+ $userInfo = array('email'=>$email,'EmpID'=>$EmpID,'password'=>getHashedPassword($password),'roleId'=>$roleId,'createdBy'=>$this->vendorId,'createdDtm'=>$Createddt);
+
+
+
+ //die();
+
$result = $this->user_model->addNewUser($userInfo);
+
+
+
+ for ($j = 0; $j < count($comma_separated); $j++)
+ {
+ $DeptCode = $comma_separated[$j];
+
+ $userdept=array('EmpID'=>$EmpID,'Departmentcode'=>$DeptCode);
+
+ $access= $this->user_model->addAccess($userdept);
+
+ //echo $access;
+ }
if($result > 0)
{
-
- redirect('userListing','refresh');
- echo "";
+
+
+ echo "";
+ redirect('userListing','refresh');
- }
+ }
+
else
{
-
+
redirect('userListing','refresh');
- echo "";
+ echo "";
}
}
+ //}
+ }
+
+
+
+
+
+function Adduserdepartment()
+ {
+ $empid= $this->input->post('Eid');
+ $Depcode= $this->input->post('Department');
+ $userdept=array('EmpID'=>$empid,'Departmentcode'=>$Depcode);
+
+ $access= $this->user_model->addAccess($userdept);
+ if($access>0)
+ {
+ echo "Successfully Added";
}
}
+
+ function Deleteuserdepartment()
+ {
+ $empid= $this->input->post('Eid');
+ $Depcode= $this->input->post('Department');
+ $userdept=array('EmpID'=>$empid,'Departmentcode'=>$Depcode);
+
+ $access= $this->user_model->DeleteAccess($empid,$Depcode);
+
+ if($access>0)
+ {
+ echo "Successfully Deleted";
+ }
+
+ }
+
/**
- * To store edited user information
+ * This function is used load user edit information
+ * @param number $userId : Optional : This is user id
*/
function editOld($UserId = '')
{
@@ -928,7 +1185,7 @@ function attendanceyear()
}
$Uid = $_GET['UID'];
-
+ $Empid = $_GET['EMPID'];
$data['roles'] = $this->user_model->getUserRoles();
@@ -937,19 +1194,21 @@ function attendanceyear()
$data['EmpList'] = $this->user_model->GetEmployeeDetails($Uid);
//print_r($data);
+ $data['Departmentlist'] = $this->costcenter_model->getDepartmentnotadded($Empid);
$data['EmpRole'] = $this->user_model->GetRoleNameByUserID($Uid);
+ $data['AccessDept'] = $this->costcenter_model ->getaccessDept($Empid);
// $data['userInfo'] = $this->user_model->getUserInfo($userId);
- $this->global['pageTitle'] = 'Resico : Edit User';
+ $this->global['pageTitle'] = 'Siddharth : Edit User';
$this->loadViews("editOld", $this->global, $data, NULL);
}
}
- /**
- * To store edited user information
+ /**
+ * This function is used to edit the user information
*/
function editUser()
{
@@ -1005,7 +1264,8 @@ function attendanceyear()
/**
- * To delete the user
+ * This function is used to delete the user using userId
+ * @return boolean $result : TRUE / FALSE
*/
function deleteUser()
{
@@ -1023,19 +1283,19 @@ function attendanceyear()
}
- /**
- * To load the change password screen
+ /**
+ * This function is used to load the change password screen
*/
function loadChangePass()
{
- $this->global['pageTitle'] = 'Resico : Change Password';
+ $this->global['pageTitle'] = 'Siddharth : Change Password';
$this->loadViews("changePassword", $this->global, NULL, NULL);
}
/**
- * To store change the password of the user into DB
+ * This function is used to change the password of the user
*/
function changePassword()
{
@@ -1076,12 +1336,9 @@ function attendanceyear()
}
}
- /**
- * To load pagenotfound view
- */
function pageNotFound()
{
- $this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
+ $this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found';
$this->loadViews("404", $this->global, NULL, NULL);
}
diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php
index c8deeb3c..3cda6ef0 100755
--- a/application/models/dahsboard_model.php
+++ b/application/models/dahsboard_model.php
@@ -2,7 +2,14 @@
class dahsboard_Model extends CI_Model
{
-
+ function getUserCount()
+ {
+
+ $sql="select count(userId) as users FROM tbl_users where isDeleted ='0'";
+ $query =$this->db->query($sql);
+ return $query->result();
+
+ }
/* HR DASHBOART Model START*/
function totemp()
diff --git a/application/models/inwardgateregister_model.php b/application/models/inwardgateregister_model.php
index da39b79f..5416e3ec 100644
--- a/application/models/inwardgateregister_model.php
+++ b/application/models/inwardgateregister_model.php
@@ -10,7 +10,7 @@ class inwardgateregister_model extends CI_Model
function igrListing()
{
- $this->db->select('igr.*,PO.DeliveryDate,sup.SupplierName');
+ $this->db->select('igr.*,PO.DeliveryDate,sup.SupplierName,igr.file');
$this->db->from('T_IGR_Master igr');
$this->db->join('T_PurchaseOrder_Master PO','igr.PONO = PO.PONO');
$this->db->join('T_SupplierDetailsN` sup','PO.SupplierID = sup.SupplierID');
diff --git a/application/models/login_model.php b/application/models/login_model.php
index dcb0ea1c..5abac2f8 100644
--- a/application/models/login_model.php
+++ b/application/models/login_model.php
@@ -16,6 +16,7 @@ class Login_model extends CI_Model
$this->db->join('T_Employee_Details as Emp','BaseTbl.EmpID = Emp.EmpID');
$this->db->join('T_DepartmentDetails as DEPT','Emp.Departmentcode = DEPT.DEPCode');
$this->db->where('BaseTbl.email', $email);
+ $this->db->or_where('Emp.ContactNumber', $email);
$this->db->where('BaseTbl.isDeleted', 0);
$query = $this->db->get();
diff --git a/application/models/monthlypay_model.php b/application/models/monthlypay_model.php
index 3b87370d..ec5cd68a 100755
--- a/application/models/monthlypay_model.php
+++ b/application/models/monthlypay_model.php
@@ -10,17 +10,23 @@ class monthlypay_model extends CI_Model
*/
function monthlyListing($current="")
{
+ $curr_split = explode('-',$current);
+ $month_val = $curr_split[0];
+ $year_val = $curr_split[1];
+ $date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val);
+ $lastdate = $year_val.'-'.$month_val.'-'.$date_val;
- $this->db->select('T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Payroll.Key,T_Loan_Master.Loan_ID');
- $this->db->from('T_Monthly_Pay_Inputs');
- $this->db->join('T_Employee_Details','T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID');
- $this->db->join('T_Payroll','T_Monthly_Pay_Inputs.EmpID=T_Payroll.EmpID','left');
- $this->db->join('T_Loan_Master','T_Monthly_Pay_Inputs.EmpID=T_Loan_Master.EmpID','left');
- $this->db->where('Month_Year',$current);
+ $sql="select T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Loan_Master.Loan_ID,T_Payroll.Key
+ from T_Monthly_Pay_Inputs
+ left join T_Employee_Details on T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID and T_Employee_Details.DateofJoining <= ?
+ left join T_Payroll on T_Monthly_Pay_Inputs.EmpID=T_Payroll.EmpID
+ left join T_Loan_Master on T_Monthly_Pay_Inputs.EmpID=T_Loan_Master.EmpID and T_Loan_Master.is_Active = 1
+ where Month_Year = ?
+ order by T_Employee_Details.EmpID asc";
- $query = $this->db->get();
+ $query = $this->db->query($sql,array($lastdate,$current));
- $result = $query->result();
+ $result = $query->result();
return $result;
}
@@ -33,15 +39,20 @@ class monthlypay_model extends CI_Model
*/
function getEmpPayDetails($current="",$s="")
{
+ $month_val = date('m',strtotime($current));
+ $year_val = date('Y',strtotime($current));
+ $date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val);
+ $lastdate = $year_val.'-'.$month_val.'-'.$date_val;
+
+ $this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining');
+ $this->db->from('T_Employee_Details');
+ $this->db->where('T_Employee_Details.IsActive',1);
+ $this->db->where('T_Employee_Details.DateofJoining <=',$lastdate);
+ $this->db->order_by('EmpID','asc');
+ $query = $this->db->get();
+ $result = $query->result();
+ return $result;
- $this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining');
- $this->db->from('T_Employee_Details');
- $this->db->where('T_Employee_Details.IsActive',1);
- $this->db->order_by('EmpID','asc');
- $query = $this->db->get();
- $result = $query->result();
-
- return $result;
}
/**
@@ -53,18 +64,25 @@ class monthlypay_model extends CI_Model
{
$current = '01-'.$current;
-
$current = date_create($current);
$current = date_format($current,'Y-m-d');
- $sql = "select T_Emp_Pay_Data.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining,T_Attendance.Days_Worked as Days_worked,T_Attendance.Absent as LOP_Days,T_Attendance.Paid_Leave as Paid_leave,T_Attendance.Total_OTHrs as OT_Hrs_Worked,T_Attendance.NoofDays,T_Loan_Master.Loan_ID from T_Emp_Pay_Data
+
+ $month_val = date('m',strtotime($current));
+ $year_val = date('Y',strtotime($current));
+ $date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val);
+ $lastdate = $year_val.'-'.$month_val.'-'.$date_val;
+
+ $sql = "select T_Emp_Pay_Data.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining,T_Attendance.Days_Worked as Days_worked,T_Attendance.Absent as LOP_Days,T_Attendance.Paid_Leave as Paid_leave,T_Attendance.Total_OTHrs as OT_Hrs_Worked,T_Attendance.NoofDays,T_Loan_Master.Loan_ID,T_Payroll.Key from T_Emp_Pay_Data
left join T_Employee_Details on T_Employee_Details.EmpID = T_Emp_Pay_Data.EmpID
+ left join T_Payroll on T_Employee_Details.EmpID = T_Payroll.EmpID and month(T_Payroll.PayOn) = month(?) and year(T_Payroll.PayOn) = year(?)
left join T_Attendance on T_Emp_Pay_Data.EmpID = T_Attendance.EmpID
left join T_Loan_Master on T_Emp_Pay_Data.EmpID = T_Loan_Master.EmpID and T_Loan_Master.is_Active = 1
- where T_Employee_Details.DateofJoining <= CURRENT_DATE
- and month(T_Attendance.Month_Year) = month(?)";
+ where T_Employee_Details.DateofJoining <= ?
+ and month(T_Attendance.Month_Year) = month(?) and year(T_Attendance.Month_Year) = year(?)
+ order by T_Employee_Details.EmpID";
- $query = $this->db->query($sql,array($current));
- return $query->result();
+ $query = $this->db->query($sql,array($current,$current,$lastdate,$current,$current));
+ return $query->result();
}
/**
@@ -151,15 +169,19 @@ class monthlypay_model extends CI_Model
function monthlyAttendance($current="")
{
- $this->db->select('T_Attendance.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
- $this->db->from('T_Attendance');
+ $month_val = date('m',strtotime($current));
+ $year_val = date('Y',strtotime($current));
+ $date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val);
+ $lastdate = $year_val.'-'.$month_val.'-'.$date_val;
+ $this->db->select('T_Attendance.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
+ $this->db->from('T_Attendance');
$this->db->join('T_Employee_Details','T_Attendance.EmpID=T_Employee_Details.EmpID');
+ $this->db->where('T_Employee_Details.DateofJoining <= ',$lastdate);
$this->db->where('Month_Year',$current);
-
- $query = $this->db->get();
-
- $result = $query->result();
-
+ $this->db->where('T_Employee_Details.IsActive',1);
+ $this->db->order_by('T_Attendance.EmpID', 'asc');
+ $query = $this->db->get();
+ $result = $query->result();
return $result;
}
diff --git a/application/models/payroll_model.php b/application/models/payroll_model.php
index a7949d7b..a1b1b6b0 100755
--- a/application/models/payroll_model.php
+++ b/application/models/payroll_model.php
@@ -205,12 +205,15 @@ class Payroll_model extends CI_Model
function getReportforBank($bank,$payon)
{
+ $this->db->distinct();
$this->db->select('Pay.*,Emp.FirstName as FName ,Emp.LastName as Lname,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.IFSCCode as IFSC,Bank.Address as BAddress');
$this->db->from('T_Payroll Pay');
$this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID');
$this->db->join('T_Bank_Details Bank', 'Emp.BankBranchName = Bank.Bank_name');
$this->db->where('Emp.BankBranchName',$bank);
$this->db->where('Pay.PayOn',$payon);
+ $this->db->where('Pay.TotalSalary > 0');
+ $this->db->order_by("Pay.EmpID", "asc");
$query = $this->db->get();
return $query->result();
}
@@ -218,10 +221,14 @@ class Payroll_model extends CI_Model
function getReportforPFESI($payon)
{
- $this->db->select('Pay.EmployeeESI,Pay.PF,Pay.CompanyESI,Pay.CompanyPF,Pay.NoofDaysWorked,Pay.OTperHours,Emp.FirstName as FName ,Emp.LastName as Lname,Emp.PFNO,Emp.ESI');
- $this->db->from('T_Payroll Pay');
- $this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID');
- $this->db->where('Pay.PayOn',$payon);
+ $this->db->distinct();
+ $this->db->select('Pay.EmployeeESI,Pay.PF,Pay.CompanyESI,Pay.CompanyPF,Pay.NoofDaysWorked,Pay.OTperHours,Emp.FirstName as FName ,Emp.LastName as Lname,Emp.PFNO,Emp.ESI');
+ $this->db->from('T_Payroll Pay');
+ $this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID');
+ $this->db->where('Pay.PayOn',$payon);
+ $this->db->where('Pay.EmployeeESI > 0 ');
+ $this->db->where('Pay.CompanyESI > 0');
+ $this->db->order_by("Pay.EmpID", "asc");
$query = $this->db->get();
return $query->result();
@@ -425,7 +432,7 @@ class Payroll_model extends CI_Model
function getCompanyInformation()
{
- $subQuery = "select CompanyName,replace(Address,',','
') as Address,GSTNO,PAN,ContactNumber,EmailAddress,AlternateContactNumber,companyWebsite,StateCode
+ $subQuery = "select CompanyName,Address,GSTNO,PAN,ContactNumber,EmailAddress,AlternateContactNumber,companyWebsite,StateCode
from T_Company_Details ";
$query = $this->db->query($subQuery);
//print_r($query->result());die();
diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php
index 867ba4ee..d67199b5 100755
--- a/application/models/purchaseorder_model.php
+++ b/application/models/purchaseorder_model.php
@@ -42,8 +42,8 @@ class purchaseorder_model extends CI_Model
// $this->db->join('T_MaterialMaster mm','mm.MaterialCode = bill.MaterialCode');
$this->db->join('T_PurchaseOrder_Master pom','pom.PONO = bill.PONO');
$this->db->where('bill.PONO',$pono);
- //$this->db->or_where('pom.status',SPECIAL_PO);
- //$this->db->group_by('bill.BillNo');
+ //$this->db->or_where('pom.status',SPECIAL_PO);
+ $this->db->group_by('bill.BillNo');
$query = $this->db->get();
@@ -717,13 +717,14 @@ function GetPOType($ReqNo)
function GetServicePurchaseOrderDetails($PONO = '')
{
- $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.Per,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,ReceivedQuantity,Rate,LineItem.Status,(Quantity *Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount,Dept.DepartmentName
- ,TotalValue,CGST,After_CGST,SGST,After_SGST,IGST,After_IGST,otherallowance,LineItem.CostCenterCode,LineItem.ServiceFrequency,LineItem.ServiceMaterialDescription,Req.Schedule_Type,Req.NumberOfService,Req.Service_Period
+ $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.Per,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,LineItem.Quantity,ReceivedQuantity,Rate,LineItem.Status,(LineItem.Quantity *Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount,Dept.DepartmentName
+ ,TotalValue,CGST,After_CGST,SGST,After_SGST,IGST,After_IGST,otherallowance,LineItem.CostCenterCode,LineItem.ServiceFrequency,LineItem.ServiceMaterialDescription,Req.Schedule_Type,Req.NumberOfService,Req.Service_Period,ReqDet.MaterialDescription
FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo
- left join T_Employee_Details emp on Req.Requestedby = emp.EmpID
+ join T_Requestion_Details ReqDet on ReqDet.ReqNo = LineItem.ReqNo and LineItem.MaterialCode = ReqDet.MaterialCode
+ left join T_Employee_Details emp on Req.Requestedby = emp.EmpID
join T_DepartmentDetails Dept on Req.RequestedDept = Dept.DEPCode
where LineItem.PONO =?';
@@ -1743,4 +1744,21 @@ function GetRequistionMasterUsingReqNo($Req){
}
+
+function amendpdf($PONO='')
+{
+ $Amend ='select p.PONO,p.ParentPO,p.Status,p.TotalOrderValue,
+ m.Status as parentpostatus,
+ m.TotalOrderValue as partenttotalorder
+ from T_PurchaseOrder_Master as p
+ join T_PurchaseOrder_Master as m
+ on m.PONO = p.ParentPO
+ where p.PONO = ?';
+
+ $amendment = $this->db->query($Amend,array($PONO));
+
+ return $amendment->result();
+}
+
+
}
diff --git a/application/models/quality_model.php b/application/models/quality_model.php
index f776ec62..9d85cddb 100644
--- a/application/models/quality_model.php
+++ b/application/models/quality_model.php
@@ -352,7 +352,9 @@ class Quality_model extends CI_Model
$sql = 'select distinct IGRNO from T_IGR_Details
join T_MaterialMaster on T_IGR_Details.MaterialCode = T_MaterialMaster.MaterialCode
- where T_MaterialMaster.Category like "%Raw Material%" order by IGRNO desc';
+ where T_MaterialMaster.Category like "%Raw Material%"and date(T_IGR_Details.CreatedDate)
+ between date(SUBDATE(CURRENT_DATE,1)) and date(CURRENT_DATE)
+ order by IGRNO desc';
$result = $this->db->query($sql);
return $result->result();
}
@@ -373,7 +375,21 @@ class Quality_model extends CI_Model
}
-
+ function getIGRNOReport()
+ {
+
+ $this->db->select('igrno,igrlineitemno');
+ $this->db->from('T_Test_Report_Master');
+ $res['generated'] = ($this->db->get()->result());
+ $sql= 'select distinct IGRNO,IGRItemNo from T_IGR_Details join T_MaterialMaster on T_IGR_Details.MaterialCode = T_MaterialMaster.MaterialCode
+ where (T_IGR_Details.IGRNO not in (select igrno from T_Test_Report_Master where igrno != "")
+ or T_IGR_Details.IGRItemNo not in (select igrlineitemno from T_Test_Report_Master where igrno != "") )
+ and T_MaterialMaster.Category like "%Raw Material%"
+ order by T_IGR_Details.IGRNO DESC';
+ $r = $this->db->query($sql);
+ $res['notgenerated'] = ($r->result());
+ return $res;
+ }
function getIGRDataforReport($igrno,$igrlineitemno)
{
diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php
index 2b7cf0f7..4701d495 100755
--- a/application/views/EditservicePurchaseorder.php
+++ b/application/views/EditservicePurchaseorder.php
@@ -173,7 +173,7 @@ foreach ($PaymentTerms as $TER)
+
+
+
+
+
+ .small-box .icon
+ {
+ top: 0px !important;
+ }
+
+
@@ -147,13 +172,14 @@ if(!empty($EmpCount))
-
+
-
-
+
+
@@ -161,7 +187,7 @@ if(!empty($EmpCount))
-
@@ -176,18 +202,19 @@ if(!empty($EmpCount))
@@ -227,7 +254,15 @@ if(!empty($EmpCount))
+
+
+
+
+
+
+
+
@@ -246,13 +281,13 @@ if(!empty($EmpCount))
-
+
0
-
+
@@ -282,11 +317,12 @@ if(!empty($EmpCount))
chart.draw(data, options);
$('#emp').change(function() {
-
+ //var datepick = $('#datepic').val();
var id = $('#emp').val();
+
$("#yearabs").val('');
- if(id != '-1')
+ if(id != 0)
{
$('#content').loader('show');
@@ -297,26 +333,32 @@ if(!empty($EmpCount))
url:"user/attendanceyear",
success:function(json) {
console.log(json);
-
+ // alert(json.workeds);
$('#content').loader('hide');
$('#totaldays').text(json.totaldays);
$('#worked').text(json.workeds)
-
+
$("#yeardata").text(json.values);
data.setValue(0, 1, json.yeardata);
chart.draw(data, options);
},
- error:function(){
- swal('error');
- }
+ // error:function(){
+
+ // }
});
-
+
}
else
{
- swal('Please select the Employee');
+ alert('Please select the Employee');
+ $('#totaldays').text(0);
+ $('#worked').text(0);
+
+ $("#yeardata").text(0);
+ data.setValue(0, 1, 0);
+ chart.draw(data, options);
return false;
}
@@ -325,15 +367,7 @@ if(!empty($EmpCount))
-
-
+
@@ -354,7 +388,8 @@ if(!empty($EmpCount))
-
+
+
@@ -372,7 +407,7 @@ if(!empty($EmpCount))