Cost center modified
This commit is contained in:
parent
35c50688cb
commit
eff7eb33d4
@ -53,7 +53,7 @@ class CostCenter extends BaseController
|
|||||||
$data['userRecords'] = $this->costcenter_model->CostListing($searchText, $returns["page"], $returns["segment"]);
|
$data['userRecords'] = $this->costcenter_model->CostListing($searchText, $returns["page"], $returns["segment"]);
|
||||||
|
|
||||||
//print_r( $data) ;
|
//print_r( $data) ;
|
||||||
$this->global['pageTitle'] = 'Siddharth : Test List';
|
$this->global['pageTitle'] = 'Siddharth : Cost List';
|
||||||
|
|
||||||
$this->loadViews("costListing", $this->global, $data, NULL);
|
$this->loadViews("costListing", $this->global, $data, NULL);
|
||||||
|
|
||||||
|
|||||||
@ -382,7 +382,8 @@ $(function() {
|
|||||||
<input type="hidden" name="txtSelectedDepartment" id="txtSelectedDepartment" />
|
<input type="hidden" name="txtSelectedDepartment" id="txtSelectedDepartment" />
|
||||||
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
||||||
<input type="submit" class="btn btn-info" value="Submit" />
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -514,7 +515,7 @@ $("#Edit").on("shown.bs.modal", function(e) {
|
|||||||
|
|
||||||
$('#txtRowCount').val(temp);
|
$('#txtRowCount').val(temp);
|
||||||
|
|
||||||
|
CountRows();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -599,6 +600,59 @@ $('.tempClickEdit').click(function(){
|
|||||||
|
|
||||||
return true;
|
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>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -693,6 +747,20 @@ $('.tempClickEdit').click(function(){
|
|||||||
|
|
||||||
function validate()
|
function validate()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//var rowCount = $('#BudgetTable').rows.length;
|
||||||
|
//if(rowCount=='4')
|
||||||
|
//{
|
||||||
|
// $("#addbudgetmodel").modal('hide');
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($("#txtSelectedDepartment").val().length < 1)
|
if($("#txtSelectedDepartment").val().length < 1)
|
||||||
{
|
{
|
||||||
alert('Please Select Department');
|
alert('Please Select Department');
|
||||||
@ -713,5 +781,6 @@ function validate()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -521,7 +521,7 @@ $(function() {
|
|||||||
<div class="box-footer" style="text-align:right">
|
<div class="box-footer" style="text-align:right">
|
||||||
<input type="hidden" name="txtSelectedDepartment" id="txtSelectedDepartment" />
|
<input type="hidden" name="txtSelectedDepartment" id="txtSelectedDepartment" />
|
||||||
<input type="submit" class="btn btn-info" value="Update" />
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user