Cost center modified

This commit is contained in:
venbatechnologies@gmail.com 2017-05-12 14:54:40 +05:30
parent 35c50688cb
commit eff7eb33d4
3 changed files with 75 additions and 6 deletions

View File

@ -53,7 +53,7 @@ class CostCenter extends BaseController
$data['userRecords'] = $this->costcenter_model->CostListing($searchText, $returns["page"], $returns["segment"]);
//print_r( $data) ;
$this->global['pageTitle'] = 'Siddharth : Test List';
$this->global['pageTitle'] = 'Siddharth : Cost List';
$this->loadViews("costListing", $this->global, $data, NULL);

View File

@ -382,7 +382,8 @@ $(function() {
<input type="hidden" name="txtSelectedDepartment" id="txtSelectedDepartment" />
<input type="hidden" name="txtRowCount" id="txtRowCount" />
<input type="submit" class="btn btn-info" value="Submit" />
<input type="reset" class="btn btn-info" value="Cancel" />
<!-- <input type="reset" class="btn btn-info" value="Cancel" />-->
<a href="<?php echo base_url() ?>costListing" class="btn btn-info" id="cancel" value="Cancel">Cancel</a>
</div>
@ -514,7 +515,7 @@ $("#Edit").on("shown.bs.modal", function(e) {
$('#txtRowCount').val(temp);
CountRows();
}
else
{
@ -599,6 +600,59 @@ $('.tempClickEdit').click(function(){
return true;
}
function Rowcount()
{
var rowCount = $('#BudgetTable').length;
if(rowCount=='4')
{
$("#addbudgetmodel").modal('hide');
}
else
{
$("#addbudgetmodel").modal('show');
}
}
var totalRowCount = 0;
var rowCount = 0;
var table = document.getElementById("BudgetTable");
var rows = table.getElementsByTagName("tr");
function CountRows() {
totalRowCount = 0;
rowCount = 0;
table = document.getElementById("BudgetTable");
rows = table.getElementsByTagName("tr")
for (var i = 0; i < rows.length; i++) {
totalRowCount++;
if (rows[i].getElementsByTagName("td").length > 0) {
rowCount++;
}
}
var message = "Total Row Count: " + totalRowCount;
message += "\nRow Count: " + rowCount;
//alert(message);
if(totalRowCount>"4")
{
$("#addbudgetmodel").modal('hide');
}
else
{
return false;
}
}
</script>
<script>
@ -693,8 +747,22 @@ $('.tempClickEdit').click(function(){
function validate()
{
//var rowCount = $('#BudgetTable').rows.length;
//if(rowCount=='4')
//{
// $("#addbudgetmodel").modal('hide');
//}
if($("#txtSelectedDepartment").val().length < 1)
{
{
alert('Please Select Department');
return false;
}
@ -711,7 +779,8 @@ function validate()
else
{
return true;
}
}
}
</script>

View File

@ -521,7 +521,7 @@ $(function() {
<div class="box-footer" style="text-align:right">
<input type="hidden" name="txtSelectedDepartment" id="txtSelectedDepartment" />
<input type="submit" class="btn btn-info" value="Update" />
<input type="reset" class="btn btn-info" value="Cancel" />
<a href="<?php echo base_url() ?>costListing" class="btn btn-info" id="cancel" value="Cancel">Cancel</a>
</div>