Edit Asset Details
Edit Asset Details
Before - name="PaymentDays" value="before"/> + name="PaymentDays" value="before"/ required="true">
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 @@