Cost center

This commit is contained in:
gandhimathi Bharathirajan 2017-05-06 17:13:29 +05:30
parent 7660cd9d23
commit bb44f1ea5a
2 changed files with 75 additions and 12 deletions

View File

@ -66,8 +66,8 @@ speed:500
<td>
<a href="<?php echo base_url().'CostCenter/editOldcost/'.$record->code; ?>"><i class="fa fa-pencil"></i>&nbsp;&nbsp;&nbsp;</a>
<a href="<?php echo base_url().'CostCenter/viewcost/'.$record->code; ?>"><i class="fa fa-eye"></i>&nbsp;&nbsp;&nbsp;</a>
<a href="<?php echo base_url().'CostCenter/editOldcost?CostCode='.$record->code; ?>"><i class="fa fa-pencil"></i>&nbsp;&nbsp;&nbsp;</a>
<a href="<?php echo base_url().'CostCenter/viewcost?CostCode='.$record->code; ?>"><i class="fa fa-eye"></i>&nbsp;&nbsp;&nbsp;</a>
</td>

View File

@ -1,3 +1,31 @@
<?php
$CostCenterCode = '';
$CostCenterName = '';
$ApprovedBy = '';
$FirstName ='';
$Designation ='';
if(!empty($CostMaster))
{
foreach ($CostMaster as $Cost)
{
$CostCenterCode = $Cost->CostCenterCode;
$CostCenterName = $Cost->CostCenterName;
$ApprovedBy = $Cost->ApprovedBy;
//echo $ApprovedBy;
$FirstName =$Cost->FirstName;
$Designation =$Cost->Designation;
}
}
?>
<script>
$(function() {
var d = new Date();
@ -70,7 +98,7 @@ $(function() {
<div class="form-group">
<?php
$data = array('name' => 'CostCode','value' => set_value('CostCode'),'id'=>'CostCode', 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;','maxlength'=>'5' );
$data = array('name' => 'CostCode','value' => set_value( 'CostCode',$CostCenterCode ),'id'=>'CostCode', 'class' => 'form-control' ,'readonly' => 'true' );
echo form_input($data);
?>
</div>
@ -83,7 +111,7 @@ $(function() {
<label for="Description">Cost Center Name:</label><font color="Red">*</font>
<div class="form-group">
<?php
$data = array('name' => 'CostName','value' => set_value('CostName'),'id'=>'CostName', 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;','maxlength'=>'20');
$data = array('name' => 'CostName','value' => set_value('CostName',$CostCenterName),'id'=>'CostName', 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;','maxlength'=>'20');
echo form_input($data);
?>
</div>
@ -126,8 +154,16 @@ $(function() {
<b>&nbsp;</b>
<?php
$option["0"] = 'Selected Department';
echo form_multiselect('selectDistriList[]', $option,set_value('selectDistriList[]'),'id="selectDistriList"','size="10"');
$options["0"] = 'Selected Department';
if(!empty($CostDepts))
{
foreach ($CostDepts as $SID):
$options[$SID->DEPCode] = $SID->DEPCode.' '.' - '.' '.$SID->DepartmentName;
endforeach;
}
echo form_multiselect('selectDistriList[]', $options,set_value('selectDistriList[]'),'id="selectDistriList"','size="10"');
?>
</div>
@ -140,20 +176,20 @@ $(function() {
<div class="form-group">
<?php
$options = array("-1"=>'Select Approver');
//print_r( $options);
$option[$ApprovedBy] = $ApprovedBy . " - " . $FirstName . " - " . $Designation;
if(!empty($Approver))
{
foreach ($Approver as $SID):
$options[$SID->EmpID] = $SID->EmpID . " - " . $SID->FirstName . " - " . $SID->Designation;
$option[$SID->EmpID] = $SID->EmpID . " - " . $SID->FirstName . " - " . $SID->Designation;
endforeach;
}
echo form_dropdown('ApprovedBy',$options,set_value('ApprovedBy'),'id="ApprovedBy"', 'class = "form-control "'); ?>
echo form_dropdown('ApprovedBy',$option,set_value('ApprovedBy'),'id="ApprovedBy"', 'class = "form-control "'); ?>
</div>
@ -272,7 +308,7 @@ $(function() {
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table id="BudgetTable" class="table table-striped responsive-utilities jambo_table" style="display:none;">
<table id="BudgetTable" class="table table-striped responsive-utilities jambo_table" >
<thead style="background-color: #CFCFCF;">
<th>Budget Type</th>
@ -281,7 +317,34 @@ $(function() {
<th>Remarks</th>
<th>Action</th>
</thead>
<tbody id="tempAppend">
<tbody id="tempAppend">
<?php
$index = 0;
if(!empty($CostBudget))
{
foreach($CostBudget as $record)
{
$index =$index + 1;
?>
<tr id="<?php echo $index ?>">
<td align="left"><?php echo $record->BudgetType ?></td>
<td align="left"><?php echo $record->BudgetYear ?></td>
<td align="left"><?php echo $record->BudgetAmount ?></td>
<td align="left"><?php echo $record->Remarks ?></td>
<td>
<a data-target='#Edit' data-id="<?php echo $index ?>" data-userid="<?php echo $index ?>" data-toggle="modal" href="#Edit"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->BudgetType ?> Budget details"></i>&nbsp;&nbsp;&nbsp;</a>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>