Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
aadhavan valli 2024-08-21 17:22:02 +05:30
commit 89751a6499
5 changed files with 712 additions and 862 deletions

View File

@ -28,157 +28,108 @@ if (!empty($ReqDetails)) {
$noOfService = $Req->NumberOfService; $noOfService = $Req->NumberOfService;
} }
} }
//echo $ReqType;
$description = ''; $description = '';
if (!empty($ReqPOType)) { if (!empty($ReqPOType)) {
$strReqPOType = $ReqPOType; $strReqPOType = $ReqPOType;
} }
?> ?>
<style type="text/css">
.select2 {
width: 100% ! important;
}
.num {
text-align: right;
}
#drpMaterial~.select2 .select2-selection--single{
height: auto;
max-height: 45px;
padding: 5px 3px;
line-height: normal;
}
#drpMaterial~.select2 .select2-selection__rendered{
overflow: visible;
text-overflow: ellipsis;
white-space: pre-wrap;
line-height: normal;
}
</style>
<script type="text/javascript"> <script type="text/javascript">
window.onload = function() { window.onload = function() {
var serviceScheduleType = '<?php echo $serviceSchedule; ?>'; var serviceScheduleType = '<?php echo $serviceSchedule; ?>';
if (serviceScheduleType != '') { if (serviceScheduleType != '') {
if (serviceScheduleType != 'Recurring') { if (serviceScheduleType != 'Recurring') {
document.getElementById('DisplayScheduleDiv').style.display = 'block'; $('#DisplayScheduleDiv').show();
document.getElementById('ServicePeriodOption').style.display = 'none'; $('#ServicePeriodOption').hide();
document.getElementById('NoServices').style.display = 'none'; $('#NoServices').hide();
} else { } else {
document.getElementById('DisplayScheduleDiv').style.display = 'block'; $('#DisplayScheduleDiv').show();
document.getElementById('ServicePeriodOption').style.display = 'none'; $('#ServicePeriodOption').hide();
document.getElementById('NoServices').style.display = 'none'; $('#NoServices').hide();
} }
} else { } else {
document.getElementById('DisplayScheduleDiv').style.display = 'none'; document.getElementById('DisplayScheduleDiv').style.display = 'none';
document.getElementById('ServicePeriodOption').style.display = 'none'; $('#ServicePeriodOption').hide();
document.getElementById('NoServices').style.display = 'none'; $('#NoServices').hide();
} }
} }
</script> </script>
<div class="content-wrapper" style="min-height:537px;"> <div class="content-page">
<section class="content"> <div class="content">
<center><b><h3 class="box-title"><?= "Edit Requisition"; ?><b><?= $ReqNo ? " - ".$ReqNo : ""; ?></b></h3></b></center> <!-- Start Content-->
<div class="container-fluid"> <div class="container-fluid">
<div id="content"></div> <!-- Form row -->
<?php
$attributes = array('class' => 'form-label-left requistion ', 'name' => 'requistion', 'id' => 'requistion');
echo form_open(base_url() . 'EditRequisition', $attributes); ?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="row" align="right" style="padding-right:31px"> <div class="card" style="margin: 24px 0px !important;">
<a class="btn btn-cancel" href="<?php echo base_url(); ?>Requisition" ID="cancel">&nbsp;&nbsp;<span class="bold">Back</span></a> <div class="card-body">
<div class="pb-2 border-bottom border-light d-flex justify-content-between align-items-center">
<div>
<h4 class="header-title"><?= "Edit Requisition"; ?><b><?= $ReqNo ? " - ".$ReqNo : ""; ?></b></h4>
</div>
<a href="<?php echo base_url(); ?>Requisition" ID="cancel"><button type="button" class="btn btn-dark waves-effect waves-light">Back</button></a>
</div> </div>
<div class="col-md-3">
<label>Request Type</label>
<div class="form-group">
<?php
$data = array('name' => 'RequestType', 'value' => set_value('RequestType', $ReqType), 'id' => 'RequestType', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
<?php $attributes = array('class' => 'form-label-left requistion ', 'name' => 'requistion', 'id' => 'requistion');
echo form_open(base_url() . 'EditRequisition', $attributes);
?> ?>
<div class="form-row">
<div class="form-group col-md-3">
<input type="hidden" name="txtReqNo" id="txtReqNo" value="<?php echo $ReqNo ?>" /> <label for="EmpID" class="col-form-label">Requested By</label>
</div>
</div>
<div class="col-md-3">
<label>Requested By</label>
<div class="form-group">
<?php <?php
$data = array('name' => 'EmpID', 'value' => set_value('EmpID', $FirstName), 'id' => 'EmpID', 'class' => 'form-control', 'readonly' => 'true'); $data = array('name' => 'EmpID', 'value' => set_value('EmpID', $FirstName), 'id' => 'EmpID', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div>
<div class="form-group col-md-3">
<label for="RequestType" class="col-form-label">Request Type</label>
<?php
$data = array('name' => 'RequestType', 'value' => set_value('RequestType', $ReqType), 'id' => 'RequestType', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
<input type="hidden" name="txtReqNo" id="txtReqNo" value="<?php echo $ReqNo ?>" />
</div> </div>
</div> <div class="form-group col-md-3">
<div class="col-md-3"> <label for="DeptName" class="col-form-label">Department Name</label>
<label>Department Name</label>
<div class="form-group">
<?php <?php
$data = array('name' => 'DeptName', 'value' => set_value('DeptName', $DepartmentName), 'id' => 'DeptName', 'class' => 'form-control', 'readonly' => 'true'); $data = array('name' => 'DeptName', 'value' => set_value('DeptName', $DepartmentName), 'id' => 'DeptName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> <div class="form-group col-md-3">
<div class="col-md-3"> <label for="Designation" class="col-form-label">Designation</label>
<label>Designation</label>
<div class="form-group">
<?php <?php
$data = array('name' => 'Designation', 'value' => set_value('Designation', $Designation), 'id' => 'Designation', 'class' => 'form-control', 'readonly' => 'true'); $data = array('name' => 'Designation', 'value' => set_value('Designation', $Designation), 'id' => 'Designation', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
</div> <div class="form-row">
<div class="col-md-12"> <div class="form-group col-md-3">
<div class="col-md-3"> <label for="CostCenter" class="col-form-label">Cost Center Name<span class="text-danger">*</span></label>
<label>Cost Center Name</label>
<div class="form-group">
<?php <?php
$Costs = array($CostCenterCode => $CostCenterCode); $Costs = array($CostCenterCode => $CostCenterCode);
//print_r( $options);
if (!empty($CostCenter)) { if (!empty($CostCenter)) {
foreach ($CostCenter as $SID) : foreach ($CostCenter as $SID) :
// echo $SID->ConfigValue;
$Costs[$SID->CostCenterCode] = $SID->CostCenterCode . '-' . $SID->CostCenterName; $Costs[$SID->CostCenterCode] = $SID->CostCenterCode . '-' . $SID->CostCenterName;
endforeach; endforeach;
} }
echo form_dropdown('CostCenter', $Costs, set_value('CostCenter'), 'id="CostCenter"', 'class = "form-control select2"'); echo form_dropdown('CostCenter', $Costs, set_value('CostCenter'), 'id="CostCenter" class = "form-control"');
?> ?>
</div>
</div>
<div class="col-md-3" style="display:none">
<label>Available Budget Amount</label>&nbsp;<img id="AlertImg" src="<?php echo base_url(); ?>public/assets/dist/img/red.png" alt="your image" width="25px" style="display:none" />
<div class="form-group">
<?php
$data = array('name' => 'AvlBudgetAmount', 'value' => set_value('AvlBudgetAmount'), 'id' => 'AvlBudgetAmount', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div> </div>
</div>
<div class="col-md-3" id="DisplayScheduleDiv" style="display:none;"> <div class="form-group col-md-3" id="DisplayScheduleDiv" style="display:none;">
<label>Select Service Schedule Type</label> <label for="ScheduleType" class="col-form-label">Service Schedule Type</label>
<div class="form-group">
<?php <?php
$Schdule = array("One Time", "Recurring"); $Schdule = array("One Time", "Recurring");
@ -197,17 +148,11 @@ if (!empty($ReqPOType)) {
endforeach; endforeach;
} }
echo form_dropdown('ScheduleType', $SchType, set_value('ScheduleType'), 'id="ScheduleType"', 'class = "form-control"'); echo form_dropdown('ScheduleType', $SchType, set_value('ScheduleType'), 'id="ScheduleType"', 'class = "form-control"');
?> ?>
</div> </div>
</div> <div class="form-group col-md-3" id="ServicePeriodOption" style="display:none;">
<div class="col-md-2" id="ServicePeriodOption" style="display:none;"> <label for="ServiceOptions" class="col-form-label">Service Period Option</label>
<label>Select Service Period Option</label>
<div class="form-group">
<?php <?php
if (!empty($ServiceOption)) { if (!empty($ServiceOption)) {
foreach ($ServiceOption as $SerOptionsel) : foreach ($ServiceOption as $SerOptionsel) :
@ -224,200 +169,32 @@ if (!empty($ReqPOType)) {
endforeach; endforeach;
} }
echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control"'); echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control"');
?> ?>
</div> </div>
</div> <div class="form-group col-md-3" id="DisplayScheduleDiv" style="display:none;">
<div class="col-md-2" id="NoServices" style="display:none;"> <label for="ServiceNo" class="col-form-label">Number of Services</label>
<label>Number of Services</label>
<div class="form-group">
<?php <?php
$data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo', $noOfService), 'id' => 'ServiceNo', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);'); $data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo', $noOfService), 'id' => 'ServiceNo', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
</div> <div class="form-row">
</div> <div class="form-group col-md-12">
</div>
<div class="container-fluid">
<table class="table table-bordered" style="border:1px solid #333">
<div align="right" style="padding-right:10px">
<div align="right">
<?php if (count($MaterialCode) != 0) {?> <?php if (count($MaterialCode) != 0) {?>
<a data-toggle="modal" data-target="#myModal1" class="btn btn-success">Add Line Item</a> <a data-toggle="modal" data-target="#add-req-modal" class="btn btn-primary waves-effect float-right">Add Line Item</a>
<?php } ?> <?php } ?>
<div class="modal fade" id="myModal1" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center>
<h4>Add Line Item </h4>
</center>
</div>
<div align="left">
<div class="col-md-12" style="padding: 20px;">
<label>Material Code</label>
<div>
<?php
$options = array("0" => 'Material Code');
//print_r( $options);
if (!empty($MaterialCode)) {
foreach ($MaterialCode as $MID) :
$options[$MID->MaterialCode] = $MID->MaterialCode . ' ' . ' - ' . ' ' . $MID->MaterialName;
endforeach;
}
echo form_dropdown('drpMaterial', $options, set_value('drpMaterial'), 'id="drpMaterial"', 'class="form-control select2"');
?>
</div> </div>
</div> </div>
<div class="col-md-12" style="padding: 5px;"> <div class="form-row">
<div class="col-md-4"> <div class="table-responsive">
<table id="Items" class="table table-striped table-hover mb-0" style="font-size:12px;">
<label>Description</label>
<div class="form-group">
<?php
$data = array('name' => 'Description', 'value' => set_value('Description'), 'id' => 'Description', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4" id="otherDescription" style="display:none;">
<label>Other Description</label>
<div class="form-group">
<?php
$data = array('name' => 'otherD', 'value' => set_value('otherD'), 'id' => 'otherD', 'class' => 'form-control', 'rows' => '5', 'cols' => '70', 'maxlength' => '500');
echo Form_textarea($data);
?>
</div>
</div>
<div class="col-md-4">
<label>UOM</label>
<div>
<?php
$data = array('name' => 'UOM', 'value' => set_value('UOM'), 'id' => 'UOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4">
<label>Quantity</label>
<div class="form-group">
<?php
$data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event)', 'maxlength' => '20' , 'min' => '1');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">cancel</a>
<a class="btn btn-success font addClick" ID="addClick"><i class="fa fa-plus"></i>&nbsp;&nbsp;<span class="bold">Add</span></a>
</div>
</div>
</div>
</div>
</div><br />
<div class="modal fade" id="EditItem" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center>
<h4>Edit Line Item </h4>
</center>
</div>
<div align="left">
<div class="col-md-12" style="padding: 20px;">
<label>Material Code</label>
<div>
<?php
$data = array('name' => 'EditMaterialCode', 'value' => set_value('EditMaterialCode'), 'id' => 'EditMaterialCode', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-12" style="padding: 5px;">
<div class="col-md-4">
<label>Description</label>
<div class="form-group">
<?php
$data = array('name' => 'EditDescription', 'value' => set_value('EditDescription'), 'id' => 'EditDescription', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4" id="EditotherDescription">
<label>Other Description</label>
<div class="form-group">
<?php
// $data = array('name' => 'EditotherD','value' => set_value('EditotherD'),'id'=>'EditotherD', 'class' => 'form-control','readonly'=>'true' );
// echo form_input($data);
$data = array('name' => 'EditotherD', 'value' => set_value('EditotherD'), 'id' => 'EditotherD', 'class' => 'form-control', 'rows' => '5', 'cols' => '70', 'maxlength' => '500');
echo Form_textarea($data);
?>
</div>
</div>
<div class="col-md-4">
<label>UOM</label>
<div>
<?php
$data = array('name' => 'EditUOM', 'value' => set_value('EditUOM'), 'id' => 'EditUOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4">
<label>Quantity</label>
<div class="form-group">
<?php
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event)', 'maxlength' => '20' , 'min' => '1');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
<a class="btn btn-success font EditClick" ID="EditClick"><i class="fa fa-plus"></i>&nbsp;&nbsp;<span class="bold">Edit</span></a>
</div>
</div>
</div>
</div>
</div></br>
<table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead> <thead>
<tr> <tr>
<th>SNo</th> <th>SNo</th>
<th>Material Code</th> <th>Material Code</th>
<th>Material Name</th> <th>Material Name</th>
<th>Uom</th> <th>Uom</th>
<th>RequestedQuantity</th> <th>RequestedQuantity</th>
<th>PoQuantity</th> <th>PoQuantity</th>
<th>Status</th> <th>Status</th>
@ -437,69 +214,218 @@ if (!empty($ReqPOType)) {
<td align="left"><?php echo $index; ?></td> <td align="left"><?php echo $index; ?></td>
<input type="hidden" name="<?php echo 'te' . $index ?>" id="<?php echo 'te' . $index ?>" value="<?php echo $record->MaterialCode; ?>" /> <input type="hidden" name="<?php echo 'te' . $index ?>" id="<?php echo 'te' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'te' . $index ?>" id="<?php echo 'tes' . $index ?>" value="<?php echo $record->Quantity; ?>" /> <input type="hidden" name="<?php echo 'te' . $index ?>" id="<?php echo 'tes' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<td align="left"><?php echo $record->MaterialCode; ?></td> <td align="left"><?php echo $record->MaterialCode; ?></td>
<td align="left"><?php echo $record->MaterialName; ?></td> <td align="left"><?php echo $record->MaterialName; ?></td>
<td align="left"><?php echo $record->UOM; ?></td> <td align="left"><?php echo $record->UOM; ?></td>
<td align="left"><?php echo $record->Quantity; ?></td> <td align="left"><?php echo $record->Quantity; ?></td>
<td align="left"><?php echo $record->POQTY; ?></td> <td align="left"><?php echo $record->POQTY; ?></td>
<td align="left"><?php echo $record->StatusName; ?></td> <td align="left"><?php echo $record->StatusName; ?></td>
<input type="hidden" name="<?php echo 'materialdesc' . $index ?>" id="<?php echo 'materialdesc' . $index ?>" value="<?php echo isset($record->MaterialDescription) ? $record->MaterialDescription : ''; ?>" /> <input type="hidden" name="<?php echo 'materialdesc' . $index ?>" id="<?php echo 'materialdesc' . $index ?>" value="<?php echo isset($record->MaterialDescription) ? $record->MaterialDescription : ''; ?>" />
<td> <td>
<a class="a_tag_link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-target='#EditItem' data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->MaterialCode; ?> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $record->MaterialCode; ?>" data-userid="<?php echo $index; ?>" id="Del" class="a_tag_link"><span class="glyphicon glyphicon-trash"></span></a> <a data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-target='#edit-req-modal' data-toggle="modal" href="#edit-req-modal"><i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->MaterialCode; ?> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $record->MaterialCode; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="ri-delete-bin-7-fill"></span></a>
</td> </td>
</tr> </tr>
<?php $RowCount = $index; <?php $RowCount = $index;
} }
?>
<?php
} ?> } ?>
</tbody> </tbody>
</table> </table>
</div> <!-- end table-responsive-->
<div align="right" style="padding-right:10px"> </div>
<div class="form-row">
<input type="hidden" name="txtStatus" id="txtStatus" /> <input type="hidden" name="txtStatus" id="txtStatus" />
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" /> <input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $RowCount; ?>" /> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $RowCount; ?>" />
<!-- Available Budget Amt -->
<input type="hidden" name="AvlBudgetAmount" id="AvlBudgetAmount" />
</div>
<div class="form-row float-right">
<?php if ($Status == REQ_DRAFT) { ?> <?php if ($Status == REQ_DRAFT) { ?>
<input type="reset" class="btn btn-reset"> <input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">&nbsp;&nbsp;
<a class="btn btn-success Save" ID="Save" onclick="Save(0)">&nbsp;&nbsp;<span class="bold">Save As Draft</span></a> <a class="btn-primary waves-effect Save" ID="Save" onclick="Save(0)">&nbsp;&nbsp;<span class="bold">Save As Draft</span></a>
<a class="btn btn-success submit" ID="submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a> <a class="btn-primary waves-effect submit" ID="submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-approved submit" ID="submit" onclick="Save(2)">&nbsp;&nbsp;<span class="bold">Approve</span></a> <a class="btn-soft-primary waves-effect waves-light submit" ID="submit" onclick="Save(2)">&nbsp;&nbsp;<span class="bold">Approve</span></a>
<?php } else if ($Status == REQ_PENDING_APPROVAL) { ?> <?php } else if ($Status == REQ_PENDING_APPROVAL) { ?>
<input type="reset" class="btn btn-reset"> <input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">&nbsp;&nbsp;
<!--<a class="btn btn-success" ID="update" onclick="update()" >&nbsp;&nbsp;<span class="bold">Update</span></a> <a class="btn-primary waves-effect Save" ID="submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-success" href="<?php echo base_url(); ?>Requisition" ID="cancel">&nbsp;&nbsp;<span class="bold">Cancel</span></a> --> <a class="btn-soft-primary waves-effect waves-light submit" ID="submit" onclick="Save(2)">&nbsp;&nbsp;<span class="bold">Approve</span></a>
<a class="btn btn-success Save" ID="submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
<a class="btn btn-approved submit" ID="submit" onclick="Save(2)">&nbsp;&nbsp;<span class="bold">Approve</span></a>
<?php }?> <?php }?>
</div> </div>
<br> <?php echo form_close();?>
</div>
</section>
</div> </div>
</div>
</div>
</div>
<!-- end row -->
</div> <!-- container -->
<div id="add-req-modal" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add Line Item</h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="drpMaterial" class="control-label">Material Code</label>
<?php
$options = array("0" => 'Material Code');
if (!empty($MaterialCode)) {
foreach ($MaterialCode as $MID) :
$options[$MID->MaterialCode] = $MID->MaterialCode . ' ' . ' - ' . ' ' . $MID->MaterialName;
endforeach;
}
echo form_dropdown('drpMaterial', $options, set_value('drpMaterial'), 'id="drpMaterial" class="form-control"');
?>
</div>
</div>
</div>
<div class="row" id="otherDescription" style="display:none;">
<div class="col-md-12">
<div class="form-group">
<label for="otherD" class="control-label">Other Description</label>
<?php
$data = array('name' => 'otherD', 'value' => set_value('otherD'), 'id' => 'otherD', 'class' => 'form-control', 'rows' => '5', 'cols' => '70', 'maxlength' => '500');
echo Form_textarea($data);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="UOM" class="control-label">UOM</label>
<?php
$data = array('name' => 'UOM', 'value' => set_value('UOM'), 'id' => 'UOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="Quantity" class="control-label">Quantity</label>
<?php $data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event)', 'maxlength' => '20' , 'min' => '1');
echo form_input($data); ?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="Description" class="control-label">Description</label>
<?php
$data = array('name' => 'Description', 'value' => set_value('Description'), 'id' => 'Description', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect"
data-dismiss="modal" value="Cancel">Cancel</button>
<button type="button"
class="btn btn-info waves-effect waves-light addClick">Add</button>
</div>
</div>
</div>
</div><!-- /.modal -->
<div id="edit-req-modal" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Edit Line Item</h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="EditMaterialCode" class="control-label">Material Code</label>
<?php
$data = array('name' => 'EditMaterialCode', 'value' => set_value('EditMaterialCode'), 'id' => 'EditMaterialCode', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" id="EditotherDescription">
<div class="form-group">
<label for="EditotherD"
class="control-label">Other Description</label>
<?php
$data = array('name' => 'EditotherD', 'value' => set_value('EditotherD'), 'id' => 'EditotherD', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="EditUOM"
class="control-label">UOM</label>
<?php
$data = array('name' => 'EditUOM', 'value' => set_value('EditUOM'), 'id' => 'EditUOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="EditQuantity"
class="control-label">Quantity</label>
<?php
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event)', 'maxlength' => '20' , 'min' => '1');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="EditDescription" class="control-label">Description</label>
<?php
$data = array('name' => 'EditDescription', 'value' => set_value('EditDescription'), 'id' => 'EditDescription', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect"
data-dismiss="modal" value="Cancel">Cancel</button>
<button type="button"
class="btn btn-info waves-effect waves-light EditClick">Edit</button>
</div>
</div>
</div>
</div><!-- /.modal -->
</div> <!-- content -->
</div>
<script> <script>
$( document ).ready(function() { $( document ).ready(function() {
// $("#CostCenter").select2(); $("#CostCenter").select2();
// $("#drpMaterial").select2(); $("#drpMaterial").select2();
// $("#EditMaterialCode").select2(); $("#EditMaterialCode").select2();
}); });
function isNumberKey(evt) { function isNumberKey(evt) {
@ -540,9 +466,6 @@ if (!empty($ReqPOType)) {
$('#otherDescription').hide(); $('#otherDescription').hide();
$('#EditotherDescription').hide(); $('#EditotherDescription').hide();
$(".datePicker").datepicker({
dateFormat: 'dd/mm/yy'
});
//Initialize Select2 Elements //Initialize Select2 Elements
$(".select2").select2(); $(".select2").select2();
@ -553,8 +476,7 @@ if (!empty($ReqPOType)) {
var urlval = ''; var urlval = '';
urlval = "<?php echo base_url() ?>serviceAvilBudgetAmount"; urlval = "<?php echo base_url() ?>serviceAvilBudgetAmount";
$('#content').loader('show');
$.ajax({ $.ajax({
data: {id: id,type: ReqType}, data: {id: id,type: ReqType},
type: "POST", type: "POST",
@ -680,7 +602,7 @@ if (!empty($ReqPOType)) {
<td align="left"><%=Quantity%></td> <td align="left"><%=Quantity%></td>
<td align="left">0.00</td> <td align="left">0.00</td>
<td align="left">NEW</td> <td align="left">NEW</td>
<td><a data-target='#EditItem' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow(index)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a></td> <td><a data-target='#edit-req-modal' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#edit-req-modal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow(index)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr> </tr>
</script> </script>
<script> <script>
@ -965,14 +887,14 @@ if (!empty($ReqPOType)) {
theForm.append(input); theForm.append(input);
} }
$("#myModal1").on("shown.bs.modal", function(e) { $("#add-req-modal").on("shown.bs.modal", function(e) {
if ($("option:selected", $("#RequestType")).val() == '-1') { if ($("option:selected", $("#RequestType")).val() == '-1') {
alert('Please select the Request Type '); alert('Please select the Request Type ');
e.close(); e.close();
} }
}); });
$("#EditItem").on("shown.bs.modal", function(e) { $("#edit-req-modal").on("shown.bs.modal", function(e) {
userid = $(e.relatedTarget).data('userid'); userid = $(e.relatedTarget).data('userid');
//alert(userid); //alert(userid);
var tr = document.getElementById(userid); var tr = document.getElementById(userid);
@ -1059,14 +981,11 @@ if (!empty($ReqPOType)) {
$("#ScheduleType").change(function() { $("#ScheduleType").change(function() {
if ($('#ScheduleType').val().trim() != 'Recurring') { if ($('#ScheduleType').val().trim() != 'Recurring') {
document.getElementById('ServicePeriodOption').style.display = 'none'; $('#ServicePeriodOption').hide();
document.getElementById('NoServices').style.display = 'none'; $('#NoServices').hide();
} else { } else {
document.getElementById('ServicePeriodOption').style.display = 'none'; $('#ServicePeriodOption').hide();
document.getElementById('NoServices').style.display = 'none'; $('#NoServices').hide();
} }
}); });

View File

@ -61,5 +61,7 @@
<script src="<?php echo base_url(); ?>public/new_assets/libs/c3/c3.min.js"></script> <script src="<?php echo base_url(); ?>public/new_assets/libs/c3/c3.min.js"></script>
<script src="<?php echo base_url(); ?>public/new_assets/js/pages/c3.init.js"></script> <script src="<?php echo base_url(); ?>public/new_assets/js/pages/c3.init.js"></script>
<script src="<?php echo base_url(); ?>public/new_assets/libs/select2/js/select2.min.js"></script>
</body> </body>
</html> </html>

View File

@ -12,7 +12,7 @@
<!-- icons --> <!-- icons -->
<link href="../assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <link href="<?php echo base_url(); ?>public/new_assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<!-- third party css --> <!-- third party css -->
<link href="<?php echo base_url(); ?>public/new_assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" /> <link href="<?php echo base_url(); ?>public/new_assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url(); ?>public/new_assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" /> <link href="<?php echo base_url(); ?>public/new_assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />
@ -29,6 +29,7 @@
<!-- icons --> <!-- icons -->
<link href="<?php echo base_url(); ?>public/new_assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <link href="<?php echo base_url(); ?>public/new_assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url(); ?>public/new_assets/libs/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
<!-- jquery --> <!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

View File

@ -13,51 +13,30 @@ if (!empty($Emp)) {
} }
} }
?> ?>
<style type="text/css"> <div class="content-page">
.select2 { <div class="content">
width: 100% ! important; <!-- Start Content-->
}
.num {
text-align: right;
}
#MaterialCode~.select2 .select2-selection--single{
height: auto;
max-height: 45px;
padding: 5px 3px;
line-height: normal;
}
#MaterialCode~.select2 .select2-selection__rendered{
overflow: visible;
text-overflow: ellipsis;
white-space: pre-wrap;
line-height: normal;
}
</style>
<div class="content-wrapper" style="min-height:537px;">
<section class="content">
<center><b><h2><?= "Add Requisition"; ?></h2></b></center>
<div class="container-fluid"> <div class="container-fluid">
<div id="content"></div> <!-- Form row -->
<?php
$attributes = array('class' => 'form-label-left requistion ', 'name' => 'requistion', 'id' => 'requistion');
echo form_open(base_url() . 'Requisitionform::SearchRequistList', $attributes); ?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div align="right" style="padding-right:11px"> <div class="card" style="margin: 24px 0px !important;">
<a class="btn btn-cancel" href="<?php echo base_url(); ?>Requisition" ID="cancel">&nbsp;&nbsp;<span class="bold">Back</span></a> <div class="card-body">
<div class="pb-2 border-bottom border-light d-flex justify-content-between align-items-center">
</div>
</div>
<div class="col-md-12">
<div class="col-md-3">
<label>Requested By</label><span style="color:red;">*</span>
<div> <div>
<h4 class="header-title"><?= "Add Requisition"; ?></h4>
</div>
<a href="<?php echo base_url(); ?>Requisition" ID="cancel"><button type="button" class="btn btn-dark waves-effect waves-light">Back</button></a>
</div>
<?php $attributes = array('class' => 'form-label-left requistion ', 'name' => 'requistion', 'id' => 'requistion');
echo form_open(base_url() . 'Requisitionform::SearchRequistList', $attributes);
?>
<div class="form-row">
<div class="form-group col-md-3">
<label for="EmpID" class="col-form-label">Requested By<span class="text-danger">*</span></label>
<?php <?php
$RequestByOpt = array("-1" => 'Select Requested By'); $RequestByOpt = array("-1" => 'Select Requested By');
if (!empty($RequestBy)) { if (!empty($RequestBy)) {
@ -65,306 +44,95 @@ if (!empty($Emp)) {
$RequestByOpt[$EID->EmpID] = $EID->Full_Name; $RequestByOpt[$EID->EmpID] = $EID->Full_Name;
endforeach; endforeach;
} }
echo form_dropdown('EmpID', $RequestByOpt, set_value('EmpID'), 'id="EmpID"', 'class = "form-control select2"', 'required="true"'); echo form_dropdown('EmpID', $RequestByOpt, set_value('EmpID'), 'id="EmpID" class = "form-control" data-toggle="select2" required="true"');
// $data = array('name' => 'EmpID', 'value' => set_value('EmpID', $FirstName), 'id' => 'EmpID', 'class' => 'form-control', 'readonly' => 'true');
// echo form_input($data);
?> ?>
<!-- <input type="hidden" name="EmpID" id="EmpID" value=<?php //echo $EmpID ?> /> -->
</div> </div>
</div> <div class="form-group col-md-3">
<label for="RequestType" class="col-form-label">Request Type<span class="text-danger">*</span></label>
<div class="col-md-3">
<label>Request Type</label><span style="color:red;">*</span>
<div>
<?php <?php
$options = array("-1" => 'Select Request Type'); $options = array("-1" => 'Select Request Type');
//print_r( $options);
if (!empty($RequestType)) { if (!empty($RequestType)) {
foreach ($RequestType as $RID) : foreach ($RequestType as $RID) :
$options[$RID->ConfigValue] = $RID->ConfigValue; $options[$RID->ConfigValue] = $RID->ConfigValue;
endforeach; endforeach;
} }
echo form_dropdown('RequestType', $options, set_value('ConfigValue'), 'id="RequestType" class = "form-control" data-toggle="select2"', 'required="true"');
echo form_dropdown('RequestType', $options, set_value('ConfigValue'), 'id="RequestType"', 'class = "form-control select2"', 'required="true"');
?> ?>
</div> </div>
</div> <div class="form-group col-md-3">
<label for="DeptName" class="col-form-label">Department Name</label>
<div class="col-md-3">
<label>Department Name</label>
<div class="form-group">
<?php <?php
$data = array('name' => 'DeptName', 'value' => set_value('DeptName', $DepartmentName), 'id' => 'DeptName', 'class' => 'form-control', 'readonly' => 'true'); $data = array('name' => 'DeptName', 'value' => set_value('DeptName', $DepartmentName), 'id' => 'DeptName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> <div class="form-group col-md-3">
<div class="col-md-3"> <label for="Designation" class="col-form-label">Designation</label>
<label>Designation</label>
<div class="form-group">
<?php <?php
$data = array('name' => 'Designation', 'value' => set_value('Designation', $Designation), 'id' => 'Designation', 'class' => 'form-control', 'readonly' => 'true'); $data = array('name' => 'Designation', 'value' => set_value('Designation', $Designation), 'id' => 'Designation', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
</div> <div class="form-row">
<div class="col-md-12"> <div class="form-group col-md-3">
<div class="col-md-3"> <label for="CostCenter" class="col-form-label">Cost Center Name<span class="text-danger">*</span></label>
<label>Cost Center Name</label><span style="color:red;">*</span>
<div>
<?php <?php
$Costs = array("-1" => 'Select Cost Center Name'); $Costs = array("-1" => 'Select Cost Center Name');
//print_r( $options);
if (!empty($CostCenter)) { if (!empty($CostCenter)) {
foreach ($CostCenter as $SID) : foreach ($CostCenter as $SID) :
// echo $SID->ConfigValue;
$Costs[$SID->CostCenterCode] = $SID->CostCenterCode . '-' . $SID->CostCenterName; $Costs[$SID->CostCenterCode] = $SID->CostCenterCode . '-' . $SID->CostCenterName;
endforeach; endforeach;
} }
echo form_dropdown('CostCenter', $Costs, set_value('CostCenter'), 'id="CostCenter"', 'class = "form-control select2"'); echo form_dropdown(
'CostCenter',
$Costs,
set_value('CostCenter'),
'class="form-control" id="CostCenter" data-toggle="select2"'
);
?> ?>
</div> </div>
</div> <div class="form-group col-md-3" id="DisplayScheduleDiv" style="display:none;">
<div class="col-md-3" style="display:none"> <label for="ScheduleType" class="col-form-label">Service Schedule Type</label>
<label>Available Budget Amt</label>&nbsp;<img id="AlertImg" src="<?php echo base_url(); ?>public/assets/dist/img/red.png" alt="your image" width="15px" style="display:none" />
<div class="form-group">
<?php
$data = array('name' => 'AvlBudgetAmount', 'value' => set_value('AvlBudgetAmount'), 'id' => 'AvlBudgetAmount', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-3" id="DisplayScheduleDiv" style="display:none;">
<label>Service Schedule Type</label>
<div class="form-group">
<?php <?php
$Schdule = array("One Time", "Recurring"); $Schdule = array("One Time", "Recurring");
if (!empty($Schdule)) { if (!empty($Schdule)) {
foreach ($Schdule as $Sch) : foreach ($Schdule as $Sch) :
$SchType[$Sch] = $Sch; $SchType[$Sch] = $Sch;
endforeach; endforeach;
} }
echo form_dropdown('ScheduleType', $SchType, set_value('ScheduleType'), 'id="ScheduleType"', 'class = "form-control select2"'); echo form_dropdown('ScheduleType', $SchType, set_value('ScheduleType'), 'id="ScheduleType"', 'class = "form-control"', 'data-toggle="select2"');
?> ?>
</div> </div>
</div> <div class="form-group col-md-3" id="ServicePeriodOption" style="display:none;">
<div class="col-md-2" id="ServicePeriodOption" style="display:none;"> <label for="ServiceOptions" class="col-form-label">Service Period Option</label>
<label>Service Period Option</label>
<div class="form-group">
<?php <?php
if (!empty($ServiceOption)) { if (!empty($ServiceOption)) {
foreach ($ServiceOption as $SerOption) : foreach ($ServiceOption as $SerOption) :
$ServiceOptions[$SerOption->ConfigValue] = $SerOption->ConfigValue; $ServiceOptions[$SerOption->ConfigValue] = $SerOption->ConfigValue;
endforeach; endforeach;
} }
echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control select2"'); echo form_dropdown('ServiceOptions', $ServiceOptions, set_value('ServiceOptions'), 'id="ServiceOptions"', 'class = "form-control"', 'data-toggle="select2"');
?> ?>
</div> </div>
</div> <div class="form-group col-md-3" id="DisplayScheduleDiv" style="display:none;">
<div class="col-md-2" id="NoServices" style="display:none;"> <label for="ServiceNo" class="col-form-label">Number of Services</label>
<label>Number of Services</label>
<div class="form-group">
<?php <?php
$data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo'), 'id' => 'ServiceNo', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);'); $data = array('name' => 'ServiceNo', 'value' => set_value('ServiceNo'), 'id' => 'ServiceNo', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
<div class="form-row">
<div class="form-group col-md-12">
<a onclick="return validateBeforeAdd();" class="btn btn-primary waves-effect float-right">Add Line Item</a>
</div> </div>
</div> </div>
</div> <div class="form-row">
<div class="container-fluid"> <div class="table-responsive">
<table class="table table-bordered" style="border:1px solid #333"> <table id="Items" class="table table-striped table-hover mb-0" style="font-size:12px;">
<div align="right" style="padding-right:10px">
<div align="right">
<!-- <div class="col-md-3 col-md-offset-7" align="right" style="padding:10px">
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1"> IS THIS OPEN ORDER FORMAT
</div> -->
<a onclick="return validateBeforeAdd();" class="btn btn-success">Add Line Item</a>
<div class="modal fade" id="myModal1" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center>
<h4>Add Line Item </h4>
</center>
</div>
<div align="left">
<div class="col-md-12" style="padding: 20px;">
<label>Material Code</label>
<div>
<?php
$options = array("0" => 'Material Code');
//print_r( $options);
if (!empty($MaterialList)) {
foreach ($MaterialList as $MID) :
$options[$MID->MaterialCode] = $MID->MaterialCode . ' ' . ' - ' . ' ' . $MID->MaterialName;
endforeach;
}
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode"', 'class="form-control select2" ');
?>
</div>
</div>
<div class="col-md-12" style="padding: 5px;">
<div class="col-md-6" id="otherDescription" style="display:none;">
<label>Other Description</label>
<div class="form-group">
<?php
$data = array('name' => 'otherD', 'value' => set_value('otherD'), 'id' => 'otherD', 'class' => 'form-control', 'rows' => '5', 'cols' => '70', 'maxlength' => '500');
echo Form_textarea($data);
?>
</div>
</div>
<div class="col-md-6">
<label>UOM</label>
<div>
<?php
$data = array('name' => 'UOM', 'value' => set_value('UOM'), 'id' => 'UOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<label>Quantity</label>
<div class="form-group">
<?php
$data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event)', 'min' => '1','maxlength' => '20');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-12">
<label>Description</label>
<div class="form-group">
<?php
$data = array('name' => 'Description', 'value' => set_value('Description'), 'id' => 'Description', 'class' => 'form-control', 'readonly' => 'true','style' => 'max-height: 50px;');
echo form_textarea($data);
?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
<a class="btn btn-success font addClick"><span class="bold">Add</span></a>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="EditItem" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center>
<h4>Edit Line Item </h4>
</center>
</div>
<div align="left">
<div class="col-md-12" style="padding: 20px;">
<label>Material Code</label>
<div>
<?php
$data = array('value' => set_value('EditMaterialCode'), 'id' => 'EditMaterialCode', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-12" style="padding: 5px;">
<div class="col-md-6" id="EditotherDescription">
<label>Other Description</label>
<div class="form-group">
<?php
$data = array('name' => 'EditotherD', 'value' => set_value('EditotherD'), 'id' => 'EditotherD', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<label>UOM</label>
<div>
<?php
$data = array('name' => 'EditUOM', 'value' => set_value('EditUOM'), 'id' => 'EditUOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<label>Quantity</label>
<div class="form-group">
<?php
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event)','min' => '1', 'maxlength' => '20');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-12">
<label>Description</label>
<div class="form-group">
<?php
$data = array('name' => 'EditDescription', 'value' => set_value('EditDescription'), 'id' => 'EditDescription', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
<a class="btn btn-success font EditClick" ID="EditClick"><span class="bold">Edit</span></a>
</div>
</div>
</div>
</div>
</div>
<table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<!-- <thead style="background-color:#ddf"> -->
<thead> <thead>
<tr> <tr>
<th>SNo</th> <th>SNo</th>
@ -375,27 +143,190 @@ if (!empty($Emp)) {
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
<tbody id="tempAppend">
</tbody>
</table> </table>
</div> <!-- end table-responsive-->
<div align="right" style="padding-right:10px"> </div>
<div class="form-row">
<input type="hidden" name="txtRowCount" id="txtRowCount" /> <input type="hidden" name="txtRowCount" id="txtRowCount" />
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" /> <input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
<input type="reset" value="Reset" class="btn btn-reset" onclick="window.location.reload();"> <!-- Available Budget Amt -->
<a class="btn btn-success Save" ID="Save" onclick="Save()">&nbsp;&nbsp;<span class="bold">Save As Draft</span></a> <input type="hidden" name="AvlBudgetAmount" id="AvlBudgetAmount" />
<input type="submit" class="btn btn-approved" value="Approved" >
</div> </div>
<br> <div class="form-row float-right">
<input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">&nbsp;&nbsp;
<a class="btn btn-primary waves-effect Save" ID="Save" onclick="Save()">&nbsp;&nbsp;<span class="bold">Save As Draft</span></a>&nbsp;&nbsp;
<input type="submit" class="btn btn-soft-primary waves-effect waves-light" value="Approved">
</div> </div>
</section> <?php echo form_close();?>
</div> </div>
</div>
</div>
</div>
<!-- end row -->
</div> <!-- container -->
<div id="add-req-modal" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add Line Item</h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="MaterialCode" class="control-label">Material Code</label>
<?php
$options = array("0" => 'Material Code');
//print_r( $options);
if (!empty($MaterialList)) {
foreach ($MaterialList as $MID) :
$options[$MID->MaterialCode] = $MID->MaterialCode . ' ' . ' - ' . ' ' . $MID->MaterialName;
endforeach;
}
echo form_dropdown('MaterialCode', $options, set_value('MaterialCode'), 'id="MaterialCode" class="form-control select2" ');
?>
</div>
</div>
</div>
<div class="row" id="otherDescription" style="display:none;">
<div class="col-md-12">
<div class="form-group">
<label for="otherD" class="control-label">Other Description</label>
<?php
$data = array('name' => 'otherD', 'value' => set_value('otherD'), 'id' => 'otherD', 'class' => 'form-control', 'rows' => '5', 'cols' => '70', 'maxlength' => '500');
echo Form_textarea($data);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="UOM" class="control-label">UOM</label>
<?php
$data = array('name' => 'UOM', 'value' => set_value('UOM'), 'id' => 'UOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="Quantity" class="control-label">Quantity</label>
<?php $data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event)', 'min' => '1', 'maxlength' => '20');
echo form_input($data); ?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="Description" class="control-label">Description</label>
<?php
$data = array('name' => 'Description', 'value' => set_value('Description'), 'id' => 'Description', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'max-height: 50px;');
echo form_textarea($data);
?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect"
data-dismiss="modal" value="Cancel">Cancel</button>
<button type="button"
class="btn btn-info waves-effect waves-light addClick">Add</button>
</div>
</div>
</div>
</div><!-- /.modal -->
<div id="edit-req-modal" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Edit Line Item</h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="EditMaterialCode" class="control-label">Material Code</label>
<?php
$data = array('value' => set_value('EditMaterialCode'), 'id' => 'EditMaterialCode', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" id="EditotherDescription">
<div class="form-group">
<label for="EditotherD"
class="control-label">Other Description</label>
<?php
$data = array('name' => 'EditotherD', 'value' => set_value('EditotherD'), 'id' => 'EditotherD', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="EditUOM"
class="control-label">UOM</label>
<?php
$data = array('name' => 'EditUOM', 'value' => set_value('EditUOM'), 'id' => 'EditUOM', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="EditQuantity"
class="control-label">Quantity</label>
<?php
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event)', 'min' => '1', 'maxlength' => '20');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="EditDescription" class="control-label">Description</label>
<?php
$data = array('name' => 'EditDescription', 'value' => set_value('EditDescription'), 'id' => 'EditDescription', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect"
data-dismiss="modal" value="Cancel">Cancel</button>
<button type="button"
class="btn btn-info waves-effect waves-light EditClick">Edit</button>
</div>
</div>
</div>
</div><!-- /.modal -->
</div> <!-- content -->
</div>
<script> <script>
$('#otherDescription').hide(); $('#otherDescription').hide();
$('#EditotherDescription').hide(); $('#EditotherDescription').hide();
@ -413,9 +344,7 @@ if (!empty($Emp)) {
$(function() { $(function() {
$(".datePicker").datepicker({
dateFormat: 'dd/mm/yy'
});
//Initialize Select2 Elements //Initialize Select2 Elements
$(".select2").select2(); $(".select2").select2();
@ -479,7 +408,10 @@ if (!empty($Emp)) {
// Get the ID of the first option // Get the ID of the first option
var firstOptionId = $('#CostCenter option:first').val(); var firstOptionId = $('#CostCenter option:first').val();
// Reset the Select2 dropdown to the first option // Reset the Select2 dropdown to the first option
$('#CostCenter').val(firstOptionId).select2('data', { id: firstOptionId, text: $('#CostCenter option:selected').text() }); $('#CostCenter').val(firstOptionId).select2('data', {
id: firstOptionId,
text: $('#CostCenter option:selected').text()
});
removeHiddenRows($('#Items').find('tr').length); removeHiddenRows($('#Items').find('tr').length);
@ -489,7 +421,9 @@ if (!empty($Emp)) {
if (id != '-1') { if (id != '-1') {
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data: {id: id}, data: {
id: id
},
dataType: 'json', dataType: 'json',
type: "POST", type: "POST",
url: "<?php echo base_url(); ?>getMaterialCode", url: "<?php echo base_url(); ?>getMaterialCode",
@ -596,7 +530,7 @@ if (!empty($Emp)) {
<td align="left"><%=Quantity%></td> <td align="left"><%=Quantity%></td>
<td> <td>
<a class="a_tag_link" data-target='#EditItem' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a class="a_tag_link" href='#' onclick="Deleterow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a> <a class="a_tag_link" data-target='#edit-req-modal' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#edit-req-modal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a class="a_tag_link" href='#' onclick="Deleterow(index)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
</td> </td>
@ -623,14 +557,12 @@ if (!empty($Emp)) {
// return false; // return false;
// } // }
else { else {
$('#myModal1').modal('show'); $('#add-req-modal').modal('show');
$('#otherDescription').hide(); $('#otherDescription').hide();
} }
} }
</script> </script>
<script> <script>
function Save() { function Save() {
var id = '<?php echo REQ_DRAFT; ?>' var id = '<?php echo REQ_DRAFT; ?>'
@ -792,7 +724,7 @@ if (!empty($Emp)) {
addHidden(theForm, "otherD" + temp, materialdescription); addHidden(theForm, "otherD" + temp, materialdescription);
$('#txtRowCount').val(temp); $('#txtRowCount').val(temp);
$('#myModal1').modal('hide'); $('#add-req-modal').modal('hide');
toastr.success('Line Item Added!', 'Success'); toastr.success('Line Item Added!', 'Success');
@ -814,7 +746,7 @@ if (!empty($Emp)) {
} }
</script> </script>
<script> <script>
$("#myModal1").on("shown.bs.modal", function(e) { $("#add-req-modal").on("shown.bs.modal", function(e) {
if ($("option:selected", $("#RequestType")).val() == '-1') { if ($("option:selected", $("#RequestType")).val() == '-1') {
alert('Please select the Request Type '); alert('Please select the Request Type ');
e.close(); e.close();
@ -822,7 +754,7 @@ if (!empty($Emp)) {
}); });
</script> </script>
<script> <script>
$("#EditItem").on("shown.bs.modal", function(e) { $("#edit-req-modal").on("shown.bs.modal", function(e) {
userid = $(e.relatedTarget).data('userid'); userid = $(e.relatedTarget).data('userid');
// alert(userid); // alert(userid);
var tr = document.getElementById(userid); var tr = document.getElementById(userid);
@ -863,7 +795,7 @@ if (!empty($Emp)) {
$('#UOM' + userid).val(editUOM); $('#UOM' + userid).val(editUOM);
$('#Quantity' + userid).val(editQuantity); $('#Quantity' + userid).val(editQuantity);
$('#EditItem').modal('hide'); $('#edit-req-modal').modal('hide');
toastr.success('Line Item Updated!', 'Success'); toastr.success('Line Item Updated!', 'Success');
} }
@ -872,7 +804,8 @@ if (!empty($Emp)) {
<script> <script>
$(".requistion").submit(function(e) { $(".requistion").submit(function(e) {
// var id = '<?php //echo REQ_PENDING_APPROVAL; ?>' // don't delete 22/04/2022 // var id = '<?php //echo REQ_PENDING_APPROVAL;
?>' // don't delete 22/04/2022
var id = '<?php echo REQ_APPROVED; ?>' var id = '<?php echo REQ_APPROVED; ?>'
e.preventDefault(); e.preventDefault();
if (validate()) { if (validate()) {
@ -943,14 +876,13 @@ if (!empty($Emp)) {
<script> <script>
$("#ScheduleType").change(function() { $("#ScheduleType").change(function() {
if ($('#ScheduleType').val().trim() != 'Recurring') { if ($('#ScheduleType').val().trim() != 'Recurring') {
document.getElementById('ServicePeriodOption').style.display = 'none'; $('#ServicePeriodOption').hide();
document.getElementById('NoServices').style.display = 'none'; $('#NoServices').hide();
$('#ServiceNo').val(''); $('#ServiceNo').val('');
} else { } else {
document.getElementById('ServicePeriodOption').style.display = 'none'; $('#ServicePeriodOption').hide();
document.getElementById('NoServices').style.display = 'none'; $('#NoServices').hide();
document.getElementById('ServiceNo').value = 1; $('#ServiceNo').val(1);
} }
}); });

View File

@ -50,15 +50,16 @@
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="pb-2 d-flex justify-content-between align-items-center">
<div class="page-title-box page-title-box-alt"> <div class="page-title-box page-title-box-alt">
<h4 class="page-title">Transporter Details</h4> <h4 class="page-title">Transporter Details</h4>
</div> </div>
</div>
<div class="col-xs-12 col-md-6 text-right">
<div class="form-group"> <div class="form-group">
<a data-toggle="modal" href="#transporterwizard" data-id="0" data-name="" class="btn btn-success">Add New Transporter</a> <a data-toggle="modal" href="#transporterwizard" data-id="0" data-name="" class="btn btn-success">Add New Transporter</a>
</div> </div>
</div> </div>
</div>
</div>
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100"> <table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100">
<thead> <thead>
<tr> <tr>
@ -114,20 +115,16 @@
</div> <!-- content --> </div> <!-- content -->
</div> </div>
<!-- for Add and edit Modal --> <!-- for Add and edit Modal -->
<div class="modal fade" id="transporterwizard" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div id="transporterwizard" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<!-- Modal Header -->
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal"> <h4 class="modal-title"></h4>
<span aria-hidden="true">&times;</span> <button type="button" class="close" data-dismiss="modal"
<span class="sr-only">Close</span> aria-hidden="true">×</button>
</button>
<center><h4 class="modal-title" id="myModalLabel"></h4></center>
</div> </div>
<div class="modal-body p-4">
<!-- Modal Body -->
<div class="modal-body">
<form id="transporterForm" class="form-horizontal" role="form"> <form id="transporterForm" class="form-horizontal" role="form">
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
@ -141,19 +138,18 @@
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<!-- Modal Footer -->
<div class="modal-footer"> <div class="modal-footer">
<a class="btn btn-cancel" data-dismiss="modal">Cancel</a> <button type="button" class="btn btn-secondary waves-effect"
<a class="btn btn-success font tempClick" id="tempClick"> data-dismiss="modal" value="Cancel">Cancel</button>
<span class="bold">Submit</span> <button type="button"
</a> class="btn btn-info waves-effect waves-light tempClick" id="tempClick">Submit</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div><!-- /.modal -->
<script> <script>