From c4cd8c26b5e207966e22659682319fc0b11497f8 Mon Sep 17 00:00:00 2001 From: sriramv Date: Wed, 5 Apr 2017 17:07:55 +0530 Subject: [PATCH] bug fixed --- application/controllers/assetdetails.php | 18 +- .../controllers/rawmaterialdetails.php | 12 +- application/controllers/supplier.php | 18 +- application/models/assetdetails_model.php | 10 +- .../models/rawmaterialdetails_model.php | 14 +- application/models/supplier_model.php | 8 +- application/views/addRawMaterial.php | 24 ++- application/views/addasset.php | 48 +++-- application/views/addsupplier.php | 76 +++++--- application/views/editOldRawmaterial.php | 4 +- application/views/editOldasset.php | 170 ++++++++++-------- application/views/editOldsupplier.php | 63 +++++-- application/views/rawmaterialListing.php | 4 +- application/views/supplierListing.php | 17 +- 14 files changed, 313 insertions(+), 173 deletions(-) diff --git a/application/controllers/assetdetails.php b/application/controllers/assetdetails.php index f9ce432f..64319921 100644 --- a/application/controllers/assetdetails.php +++ b/application/controllers/assetdetails.php @@ -129,7 +129,7 @@ class assetdetails extends BaseController $this->session->set_flashdata('error', 'Asset Not Create'); } - redirect('assetdetails/assetListing'); + redirect('assetListing'); } } @@ -198,7 +198,7 @@ class assetdetails extends BaseController $SupplierName = $this->input->post('SupplierName'); $DateOfPurchase = $this->input->post('DateOfPurchase'); $DateOfCommission = $this->input->post('DateOfCommission'); - $Createdby = $this->input->post('Createdby'); + $Createdby = $this->input->post('Createdby'); $AssetValue = $this->input->post('AssetValue'); $asset = array(); @@ -218,8 +218,8 @@ class assetdetails extends BaseController { $this->session->set_flashdata('error', 'Asset updation failed'); } - echo $asset; - // redirect('assetListing'); + //echo success; + redirect('assetListing'); } } @@ -227,8 +227,8 @@ class assetdetails extends BaseController /** * This function is used to delete the user using userId * @return boolean $result : TRUE / FALSE - - function deleteUser() + */ + function deleteasset() { if($this->isAdmin() == TRUE) { @@ -237,15 +237,15 @@ class assetdetails extends BaseController else { $userId = $this->input->post('userId'); - $userInfo = array('isDeleted'=>1,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:sa')); + $userInfo = array('isActive'=>1,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:sa')); - $result = $this->user_model->deleteUser($userId, $userInfo); + $result = $this->assetdetails_model->deleteUser($userId, $userInfo); if ($result > 0) { echo(json_encode(array('status'=>TRUE))); } else { echo(json_encode(array('status'=>FALSE))); } } } - */ + function viewasset($Asset_code = NULL) { diff --git a/application/controllers/rawmaterialdetails.php b/application/controllers/rawmaterialdetails.php index 3fe6c9a6..e1424f7a 100644 --- a/application/controllers/rawmaterialdetails.php +++ b/application/controllers/rawmaterialdetails.php @@ -218,8 +218,8 @@ class rawmaterialdetails extends BaseController /** * This function is used to delete the user using userId * @return boolean $result : TRUE / FALSE - - function deleteUser() + */ + function deleterawmaterial() { if($this->isAdmin() == TRUE) { @@ -227,15 +227,15 @@ class rawmaterialdetails extends BaseController } else { - $userId = $this->input->post('userId'); - $userInfo = array('isDeleted'=>1,'updatedBy'=>$this->vendorId, 'updatedDtm'=>date('Y-m-d H:i:sa')); + $MaterialCode = $this->input->post('MaterialCode'); + $Material = array('isActive'=>1,'updatedBy'=>$this->vendorId, 'updatedDate'=>date('Y-m-d H:i:sa')); - $result = $this->user_model->deleteUser($userId, $userInfo); + $result = $this->rawmaterialdetails_model->deleterawmaterial($MaterialCode, $Material); if ($result > 0) { echo(json_encode(array('status'=>TRUE))); } else { echo(json_encode(array('status'=>FALSE))); } } - }*/ + } diff --git a/application/controllers/supplier.php b/application/controllers/supplier.php index c3f4ee60..817cc713 100644 --- a/application/controllers/supplier.php +++ b/application/controllers/supplier.php @@ -287,7 +287,23 @@ class supplier extends BaseController } - + function deletesupplier() + { + if($this->isAdmin() == TRUE) + { + echo(json_encode(array('status'=>'access'))); + } + else + { + $supplierID = $this->input->post('SupplierID'); + $supplier = array('isActive'=>1,'updatedBy'=>$this->vendorId, 'updatedON'=>date('Y-m-d H:i:sa')); + + $result = $this->supplier_model->deletesupplier($supplierID, $supplier); + + if ($result > 0) { echo(json_encode(array('status'=>TRUE))); } + else { echo(json_encode(array('status'=>FALSE))); } + } + } function pageNotFound() diff --git a/application/models/assetdetails_model.php b/application/models/assetdetails_model.php index 75513d2d..0b0e3f86 100644 --- a/application/models/assetdetails_model.php +++ b/application/models/assetdetails_model.php @@ -157,13 +157,13 @@ function addNewasset($asset) * This function is used to delete the user information * @param number $userId : This is user id * @return boolean $result : TRUE / FALSE - - function deletePO($PO, $POinfo) + */ + function deleteasset($Asset_Code, $asset) { - $this->db->where('PO', $PO); - $this->db->update('T_PurchaseOrderDetails', $POInfo); + $this->db->where('Asset_Code', $Asset_Code); + $this->db->update('T_AssetDetails', $asset); return $this->db->affected_rows(); - }*/ + } } ?> \ No newline at end of file diff --git a/application/models/rawmaterialdetails_model.php b/application/models/rawmaterialdetails_model.php index b5e8343e..0c012b4d 100644 --- a/application/models/rawmaterialdetails_model.php +++ b/application/models/rawmaterialdetails_model.php @@ -17,7 +17,7 @@ class rawmaterialdetails_model extends CI_Model $likeCriteria = "(BaseT.MaterialCode LIKE '%".$searchText."%' OR BaseT.MaterialName LIKE '%".$searchText."%' OR BaseT.MaterialType LIKE '%".$searchText."%' - OR BaseT.SupplierID LIKE '%".$searchText."%')"; + OR BaseT.UOM LIKE '%".$searchText."%')"; $this->db->where($likeCriteria); } //$this->db->where('BaseT.isDeleted', 0); @@ -43,7 +43,7 @@ class rawmaterialdetails_model extends CI_Model $likeCriteria = "(BaseT.MaterialCode LIKE '%".$searchText."%' OR BaseT.MaterialName LIKE '%".$searchText."%' OR BaseT.MaterialType LIKE '%".$searchText."%' - OR BaseT.SupplierID LIKE '%".$searchText."%')"; + OR BaseT.UOM LIKE '%".$searchText."%')"; $this->db->where($likeCriteria); } //$this->db->where('BaseT.isDeleted', 0); @@ -138,13 +138,13 @@ function addNewRawMaterial($RawMaterial) * This function is used to delete the user information * @param number $userId : This is user id * @return boolean $result : TRUE / FALSE - - function deletePO($PO, $POinfo) + */ + function deleterawmaterial($RawMaterial, $MaterialCode) { - $this->db->where('PO', $PO); - $this->db->update('T_PurchaseOrderDetails', $POInfo); + $this->db->where('MaterialCode', $MaterialCode); + $this->db->update('T_MaterialMaster', $RawMaterial); return $this->db->affected_rows(); - }*/ + } } ?> \ No newline at end of file diff --git a/application/models/supplier_model.php b/application/models/supplier_model.php index 1169b89a..963630cc 100644 --- a/application/models/supplier_model.php +++ b/application/models/supplier_model.php @@ -172,7 +172,13 @@ function addNewsupplier($supplier) } - + function deletesupplier($supplierID, $supplier) + { + $this->db->where('supplierID', $supplierID); + $this->db->update('T_SupplierDetailsN', $supplier); + + return $this->db->affected_rows(); + } } diff --git a/application/views/addRawMaterial.php b/application/views/addRawMaterial.php index 0142e1f8..bb3a99a7 100644 --- a/application/views/addRawMaterial.php +++ b/application/views/addRawMaterial.php @@ -49,7 +49,7 @@
- + @@ -129,4 +129,22 @@
+ + + \ No newline at end of file diff --git a/application/views/addasset.php b/application/views/addasset.php index 46185754..66b74d54 100644 --- a/application/views/addasset.php +++ b/application/views/addasset.php @@ -1,4 +1,4 @@ -
+

@@ -42,7 +42,7 @@
- +
@@ -53,7 +53,7 @@
- +
@@ -64,7 +64,7 @@
+ +
@@ -93,8 +93,8 @@
- - + +
@@ -102,8 +102,8 @@
- + - max= value="" class="form-control" placeholder="" /> + max= value="" class="form-control" placeholder="" / required="true">
- max= value="" class="form-control" placeholder="" /> + max= value="" class="form-control" placeholder="" / required="true">
- - + +
@@ -183,4 +183,22 @@

+ + + \ No newline at end of file diff --git a/application/views/addsupplier.php b/application/views/addsupplier.php index 74baa8b3..aad6be20 100644 --- a/application/views/addsupplier.php +++ b/application/views/addsupplier.php @@ -32,13 +32,13 @@
- +
- +
@@ -46,7 +46,7 @@
- +
@@ -56,13 +56,13 @@
- +
- +
@@ -71,19 +71,19 @@
- +
- +
- +
@@ -92,7 +92,7 @@
- +
@@ -100,20 +100,20 @@
- - + +
- +
- +
@@ -126,42 +126,45 @@
- + + -
-
+
Before - +
After - +
- - + +
@@ -170,7 +173,7 @@ @@ -274,9 +277,27 @@ function validatePAN() { } } } + +function validateexcise() { + var reg = /(?=.*[A-Za-z]).{5,}(?=.*[0-9]).{5,}(?=.*[A-Za-z]).{2,}(?=.*[0-9]).{3,}$/; + + var Exiseregistration = $('#Exiseregistration').val(); + if(Exiseregistration != "") + { + if (reg.test(Exiseregistration) == false) + { + alert('Please Enter Valid Exise registration Number'); + return (false); + } + else + { + return true; + } + } +} //Validate Supplier Name function validatesuppliername() { - var reg = /^[A-Za-z ]{3,30}$/; + var reg = /^[A-Za-z ()]{3,30}$/; var suppliername = $('#SupplierName').val(); if(suppliername != "") @@ -310,5 +331,12 @@ function validatenumbers() { } } - + function Validate() +{ +if($("option:selected", $("#PaymentTerms")).val() == '0') + { + alert('Please Select Payment Terms'); + return ; + } +} diff --git a/application/views/editOldRawmaterial.php b/application/views/editOldRawmaterial.php index 8eec53f3..8b525a3b 100644 --- a/application/views/editOldRawmaterial.php +++ b/application/views/editOldRawmaterial.php @@ -56,8 +56,8 @@ if(!empty($userRecords))
- - + +
diff --git a/application/views/editOldasset.php b/application/views/editOldasset.php index 79d48e81..e65aa6a4 100644 --- a/application/views/editOldasset.php +++ b/application/views/editOldasset.php @@ -9,11 +9,9 @@ $User = ''; $SupplierName = ''; $DateOfPurchase = ''; $DateOfCommission = ''; +$CreatedDate = ''; $AssetValue = ''; $Createdby = ''; - - - if(!empty($asset)) { foreach ($asset as $uf) @@ -21,27 +19,21 @@ if(!empty($asset)) $Asset_Code = $uf->Asset_Code; $Asset_Name = $uf->Asset_Name; $Description = $uf->Description; - $Department = $uf->Department; + $Department = $uf->Department; $Location = $uf->Location; $User = $uf->User; $SupplierName = $uf->SupplierName; $DateOfPurchase = $uf->DateOfPurchase; $DateOfCommission = $uf->DateOfCommission; - $Createdby = $uf->Createdby; + $CreatedDate = $uf->CreatedDate; $AssetValue = $uf->AssetValue; - + $Createdby = $uf->Createdby; } } ?> -
@@ -49,11 +41,12 @@ function demo(){
Asset Details
+
- Back + Back

@@ -65,42 +58,34 @@ function demo(){
-

Edit Asset Details

+

Edit Asset Details

-
+
-
- - - - -
+ + +
- -
+
-
- +
-
-
- - -
+
+
+
-
- - +
-
- -
-
+
+ +
-
- +
-
- -
-
-
-
- - -
-
-
- - +
+
+ + +
+
+ + -
-
-
+
+
- max= value="" class="form-control" placeholder="" /> + max= value="" class="form-control" placeholder="" required="true"/>
- -
+
- max= value="" class="form-control" placeholder="" /> + max= value="" class="form-control" placeholder="" required="true"/>
-
+
- - - + + + +
- -
-
+
+
+ +
- +
+ load->helper('form'); + $error = $this->session->flashdata('error'); + if($error) + { + ?> +
+ + session->flashdata('error'); ?> +
+ + session->flashdata('success'); + if($success) + { + ?> +
+ + session->flashdata('success'); ?> +
+ + +
+
+ ', '
'); ?> +
+
+
+ +
+
+ + \ No newline at end of file diff --git a/application/views/editOldsupplier.php b/application/views/editOldsupplier.php index 5bfa5b76..97beddaa 100644 --- a/application/views/editOldsupplier.php +++ b/application/views/editOldsupplier.php @@ -15,7 +15,7 @@ $UANumber = ''; $PaymentTerms = ''; $PaymentDays = ''; $PayableAT = ''; - +$Createdby = ''; if(!empty($supplier)) @@ -38,6 +38,7 @@ if(!empty($supplier)) $PaymentTerms = $uf->PaymentTerms; $PaymentDays = $uf->PaymentDays; $PayableAT = $uf->PayableAT; + $Createdby = $uf->Createdby; } @@ -86,14 +87,14 @@ function demo(){
- +
- +
@@ -101,7 +102,7 @@ function demo(){
- +
@@ -111,13 +112,13 @@ function demo(){
- +
- +
@@ -126,19 +127,19 @@ function demo(){
- +
- +
- +
@@ -147,7 +148,7 @@ function demo(){
- +
@@ -155,20 +156,20 @@ function demo(){
- - + +
- +
- +
@@ -201,21 +202,22 @@ function demo(){

Before - name="PaymentDays" value="before"/> + name="PaymentDays" value="before"/ required="true">
After - name="PaymentDays" value="after"/> + name="PaymentDays" value="after"/>
- + +
@@ -332,7 +334,7 @@ function validatePAN() { } //Validate Supplier Name function validatesuppliername() { - var reg = /^[A-Za-z ]{3,30}$/; + var reg = /^[A-Za-z ()]{3,30}$/; var suppliername = $('#SupplierName').val(); if(suppliername != "") @@ -385,5 +387,30 @@ function validatesuppliername() { } } + function validateexcise() { + var reg = /(?=.*[A-Za-z]).{5,}(?=.*[0-9]).{5,}(?=.*[A-Za-z]).{2,}(?=.*[0-9]).{3,}$/; + + var Exiseregistration = $('#Exiseregistration').val(); + if(Exiseregistration != "") + { + if (reg.test(Exiseregistration) == false) + { + alert('Please Enter Valid Exise registration Number'); + return (false); + } + else + { + return true; + } + } +} + function Validate() +{ +if($("option:selected", $("#PaymentTerms")).val() == '0') + { + alert('Please Select Payment Terms'); + return ; + } +} diff --git a/application/views/rawmaterialListing.php b/application/views/rawmaterialListing.php index 2d63ddbb..db000ab6 100644 --- a/application/views/rawmaterialListing.php +++ b/application/views/rawmaterialListing.php @@ -37,7 +37,7 @@ Material Type UOM - Edit + Action @@ -59,7 +59,7 @@         - +     Contact Number Alternate Contact Number Email Address - Exiseregistration + Exise Registration TIN PAN - GSTNO - GSTRange - CollectrateAddress + GST NO + GST Range + Collectrate Address UANumber - PaymentTerms - PaymentDays - PayableAT + Payment Terms + Payment Days + Payable AT Create Date Action @@ -81,7 +81,8 @@         - +     +