diff --git a/application/views/addCostCenter.php b/application/views/addCostCenter.php index 44cf80f5..d4cc1f4c 100644 --- a/application/views/addCostCenter.php +++ b/application/views/addCostCenter.php @@ -649,8 +649,10 @@ $('.tempClickEdit').click(function(){ $(".addCost").submit(function(e) { e.preventDefault(); + if(validate()) + { $('#content').loader('show'); -$.ajax({ + $.ajax({ data:$('.addCost').serialize(), type:"POST", url:"CostCenter/addNewcost", @@ -667,14 +669,38 @@ $.ajax({ } else { - } - alert("Error"); - + alert("Error"); + } } }); + } }); - + + +function validate() +{ + if($("#txtSelectedDepartment").val().length < 1) + { + alert('Please Select Department'); + return false; + } + else if($("#txtRowCount").val().length < 1) + { + alert('Please Add Budget'); + return false; + } + else if($("option:selected", $("#ApprovedBy")).val() == '-1') + { + alert('Please Select Approver Names'); + return false; + } + else + { + return true; + } + +} \ No newline at end of file diff --git a/application/views/costListing.php b/application/views/costListing.php index 5cdde288..573bd308 100644 --- a/application/views/costListing.php +++ b/application/views/costListing.php @@ -1,3 +1,13 @@ +
@@ -30,9 +40,9 @@
-
- - +
+
+ @@ -49,15 +59,15 @@ { ?> - - - - + + + +
Cost Center ID Cost Name Description
CostCentreID ?>CostName ?>Description ?>CreatedDate ?>code ?>CostCenterName ?>ApprovedBy ?>FirstName ?> -     -     +     +