add in edit requisition screen
This commit is contained in:
parent
fd27c95395
commit
276f4f41db
@ -241,6 +241,13 @@ class requisitionform extends BaseController
|
||||
|
||||
}
|
||||
|
||||
function editrequisitionlisting()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Siddharth : Edit Requisition Listing';
|
||||
|
||||
$this->loadViews("editrequisitionform", $this->global, NULL);
|
||||
}
|
||||
|
||||
function pageNotFound()
|
||||
{
|
||||
$this->global['pageTitle'] = 'CodeInsect : 404 - Page Not Found';
|
||||
|
||||
728
application/views/editrequisitionform.php
Normal file
728
application/views/editrequisitionform.php
Normal file
@ -0,0 +1,728 @@
|
||||
|
||||
<style>
|
||||
.table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td {border: 1px solid #333;}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
|
||||
|
||||
<section class="content">
|
||||
|
||||
<div>
|
||||
<center><b><h2>Siddharth Industries - Edit Requisition Form</h2></b></center>
|
||||
<div class="container-fluid">
|
||||
<div id="content"></div>
|
||||
|
||||
<?php
|
||||
$attributes = array('class' => 'form-label-left requistion ','name' => 'requistion','id' => 'requistion');
|
||||
|
||||
echo form_open($this->config->base_url().'addNewcost/',$attributes); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row" align="right">
|
||||
<a class="btn btn-primary" href="<?php echo base_url(); ?>Requisition" ID="cancel"> <span class="bold">Back</span></a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Request Type</label>
|
||||
<div>
|
||||
<?php
|
||||
$options = array("-1"=>'Select Request Type');
|
||||
//print_r( $options);
|
||||
|
||||
if(!empty($RequestType))
|
||||
{
|
||||
foreach ($RequestType as $RID):
|
||||
|
||||
|
||||
$options[$RID->ConfigValue] = $RID->ConfigValue;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('RequestType', $options,set_value('ConfigValue'),'id="RequestType"' ,'class = "form-control select2"','required="true"','disabled=disabled');
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Requested By</label>
|
||||
<div>
|
||||
<?php
|
||||
$options = array("-1"=>'Select Requested By');
|
||||
//print_r( $options);
|
||||
|
||||
if(!empty($EmpList))
|
||||
{
|
||||
foreach ($EmpList as $EID):
|
||||
|
||||
|
||||
$options[$EID->EmpID] = $EID->EmpID.' '.' - '.' '.$EID->FirstName.' . '.' '.$EID->LastName;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('EmpID', $options,set_value('EmpID'),'id="EmpID"' ,'class = "form-control"','disabled=disabled');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Department Name</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'DeptName','value' => set_value('DeptName'),'id'=>'DeptName', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Designation</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Designation','value' => set_value('Designation'),'id'=>'Designation', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Cost Center Name</label>
|
||||
<div>
|
||||
<?php
|
||||
$options = array("-1"=>'Select Cost Center Name');
|
||||
//print_r( $options);
|
||||
|
||||
if(!empty($Cost))
|
||||
{
|
||||
foreach ($Cost as $SID):
|
||||
// echo $SID->ConfigValue;
|
||||
$Budget[$SID->CostCenterCode] = $SID->CostCenterCode;
|
||||
|
||||
endforeach;
|
||||
|
||||
}
|
||||
echo form_dropdown('CostCenter', $options,set_value('CostCenter'),'id="CostCenter"' ,'class = "form-control"', 'disabled=disabled');
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Available Budget Amount</label>
|
||||
<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>
|
||||
</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">
|
||||
<a data-toggle="modal" data-target="#myModal1" class="btn btn-primary">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">×</button>
|
||||
<center><h4>Add Line Item </h4></center>
|
||||
</div>
|
||||
<div align="left">
|
||||
|
||||
<div class="col-md-6">
|
||||
<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"');
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<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-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' ,'onkeypress'=>'return isNumberKey(event)','maxlength'=>'20');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-info font addClick" ID="addClick" ><i class="fa fa-plus"></i> <span class="bold">Add</span></a>
|
||||
<a class="btn btn-info" data-dismiss="modal" value="Cancel">cancel</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">×</button>
|
||||
<center><h4>Edit Line Item </h4></center>
|
||||
</div>
|
||||
<div align="left">
|
||||
|
||||
<div class="col-md-6">
|
||||
<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-6">
|
||||
<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-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','onkeypress'=>'return isNumberKey(event)','maxlength'=>'20');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-info font EditClick" ID="EditClick" ><i class="fa fa-plus"></i> <span class="bold">Edit</span></a>
|
||||
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div></br>
|
||||
|
||||
<table id="Items" class="table table-striped responsive-utilities jambo_table" >
|
||||
<thead style="background-color: #CFCFCF;">
|
||||
<tr>
|
||||
<th>SNo</th>
|
||||
<th>Material Code</th>
|
||||
<th>Material Name</th>
|
||||
<th>Uom</th>
|
||||
<th>Quantity</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tempAppend">
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<div align="right" style="padding-right:10px">
|
||||
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
||||
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
|
||||
<a class="btn btn-primary" ID="update" onclick="update()" > <span class="bold">Update</span></a>
|
||||
<a class="btn btn-primary" href="<?php echo base_url(); ?>Requisition" ID="cancel"> <span class="bold">Cancel</span></a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function isNumberKey(evt)
|
||||
{
|
||||
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||||
if (charCode != 46 && charCode > 31
|
||||
&& (charCode < 48 || charCode > 57))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
$( ".datePicker" ).datepicker({ dateFormat: 'dd/mm/yy' });
|
||||
|
||||
//Initialize Select2 Elements
|
||||
$(".select2").select2();
|
||||
|
||||
$('#EmpID').change(function() {
|
||||
var ReqType = $('#RequestType').val();
|
||||
if(ReqType == "-1")
|
||||
{
|
||||
alert('Please select the Request Type');
|
||||
return false;
|
||||
}
|
||||
var id = $('#EmpID').val();
|
||||
|
||||
if(id != '-1')
|
||||
{
|
||||
$('#content').loader('show');
|
||||
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
dataType: 'json',
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>requisitionform/GetSelectedEmpDetails?ReqType="+ReqType,
|
||||
success:function(json) {
|
||||
$('#content').loader('hide');
|
||||
//alert(json.Cost);
|
||||
$("#DeptName").val(json.emp[0]['DepartmentName']);
|
||||
$("#Designation").val(json.emp[0]['Designation']);
|
||||
|
||||
$("#CostCenter").empty();
|
||||
$("#CostCenter").append(json.Cost);
|
||||
//$("#AvlBudgetAmount").val(json.AvlAmount);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please select the Employee details');
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#CostCenter').change(function() {
|
||||
|
||||
var id = $('#CostCenter').val();
|
||||
$("#AvlBudgetAmount").val('');
|
||||
var ReqType = $('#RequestType').val();
|
||||
if(id != '-1')
|
||||
{
|
||||
$('#content').loader('show');
|
||||
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
dataType: 'json',
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>requisitionform/getAvailableBudAmount?ReqType="+ReqType,
|
||||
success:function(json) {
|
||||
$('#content').loader('hide');
|
||||
$("#AvlBudgetAmount").val(json.Cost[0]['BudgetAmount']);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please select the Employee details');
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
$('#RequestType').change(function()
|
||||
{
|
||||
|
||||
$('#txtRowCount').val('');
|
||||
$('#txtDeletedRow').val('');
|
||||
$("#Description").val('');
|
||||
$("#UOM").val('');
|
||||
removeHiddenRows($('#Items').find('tr').length);
|
||||
var id = $('#RequestType').val();
|
||||
|
||||
if(id != '-1')
|
||||
{
|
||||
$('#content').loader('show');
|
||||
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
dataType: 'json',
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>requisitionform/getMaterialCode",
|
||||
success:function(json) {
|
||||
$('#content').loader('hide');
|
||||
|
||||
$("#MaterialCode").empty();
|
||||
$("#MaterialCode").append(json.Material);
|
||||
// $("#Description").val(json.MaterialName);
|
||||
//$("#UOM").val(json.UOM);
|
||||
}
|
||||
|
||||
});
|
||||
//$('#content').loader('hide');
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please select the RequestType');
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
$('#MaterialCode').change(function() {
|
||||
|
||||
var id = $('#MaterialCode').val();
|
||||
|
||||
$("#Description").val('');
|
||||
$("#UOM").val('');
|
||||
if(id != '-1')
|
||||
{
|
||||
$('#content').loader('show');
|
||||
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
dataType: 'json',
|
||||
type:"POST",
|
||||
url:"<?php echo base_url();?>requisitionform/getMaterialDetails",
|
||||
success:function(json) {
|
||||
$('#content').loader('hide');
|
||||
//alert(json.MatDetail);
|
||||
$("#Description").val(json.MatDetail[0]['MaterialName']);
|
||||
$("#UOM").val(json.MatDetail[0]['UOM']);
|
||||
}
|
||||
|
||||
});
|
||||
//$('#content').loader('hide');
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Please select the RequestType');
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<script type="text/html" id="tempList">
|
||||
<tr id="<%=index%>">
|
||||
<td align="left"><%=index%></td>
|
||||
<td align="left"><%=MaterialCode%></td>
|
||||
|
||||
<td align="left"><%=MaterialName%></td>
|
||||
|
||||
<td align="left"><%=UOM%></td>
|
||||
|
||||
<td align="left"><%=Quantity%></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> </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>
|
||||
</script>
|
||||
<script>
|
||||
var index = '1';
|
||||
var userid = '';
|
||||
function removeHiddenRows(rowcount)
|
||||
{
|
||||
var step;
|
||||
//alert(rowcount);
|
||||
for (step = 1; step < rowcount; step++) {
|
||||
var td = document.getElementById(step);
|
||||
td.parentNode.removeChild(td);
|
||||
$("#MaterialCode"+step).remove();
|
||||
$("#Description"+step).remove();
|
||||
$("#UOM"+step).remove();
|
||||
$("#Quantity"+step).remove();
|
||||
index = '1';
|
||||
userid = '';
|
||||
}
|
||||
}
|
||||
function Save()
|
||||
{
|
||||
|
||||
var id = 'Draft';
|
||||
if(validate())
|
||||
{
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:$('.requistion').serialize(),
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>requisitionform/addNewRequistion?ID="+id,
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
$('#txtRowCount').val('');
|
||||
$('#txtDeletedRow').val('');
|
||||
|
||||
//window.location = baseurl + 'CostCenter/CostListing';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Error");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
function validate()
|
||||
{
|
||||
if($("option:selected", $("#RequestType")).val() == '-1')
|
||||
{
|
||||
alert('Please Select ReqType Names');
|
||||
return false;
|
||||
}
|
||||
else if($("option:selected", $("#EmpID")).val() == '-1')
|
||||
{
|
||||
alert('Please Select Reqby');
|
||||
return false;
|
||||
}
|
||||
else if($("#txtRowCount").val().length < 1)
|
||||
{
|
||||
alert('Please Add Line Item');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
function DeleteRow(rowid)
|
||||
{
|
||||
var DelRows = $('#txtDeletedRow').val();
|
||||
|
||||
var answer = confirm(" Do you want to delete the Item from the List?")
|
||||
if (answer)
|
||||
{
|
||||
var td = document.getElementById(rowid);
|
||||
td.parentNode.removeChild(td);
|
||||
|
||||
if(DelRows != '')
|
||||
{
|
||||
DelRows = DelRows + ":" + rowid;
|
||||
}
|
||||
else
|
||||
{
|
||||
DelRows= "0" + ":" + rowid;
|
||||
}
|
||||
$('#txtDeletedRow').val(DelRows);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('.addClick').click(function(){
|
||||
|
||||
if ($("#MaterialCode option:selected").val() =='-1' )
|
||||
{
|
||||
alert('Please Select the MaterialCode ');
|
||||
}
|
||||
|
||||
if(document.getElementById('Quantity').value == '' )
|
||||
{
|
||||
alert('Please Enter the Quantity');
|
||||
|
||||
}
|
||||
|
||||
if ($("#MaterialCode option:selected").val() !='-1' && $('#Quantity').val() != '' )
|
||||
{
|
||||
var temp = index;
|
||||
var materialCode = $("#MaterialCode option:selected").val();
|
||||
var materialName = $("#Description").val();
|
||||
var uom = $("#UOM").val();
|
||||
var quantity = $("#Quantity").val();
|
||||
|
||||
$('#MaterialCode option[value='+materialCode+']').remove();
|
||||
|
||||
$('#Description').val('');
|
||||
$('#UOM').val('');
|
||||
$('#Quantity').val('');
|
||||
|
||||
index = parseInt(index)+1;
|
||||
|
||||
var template = jQuery("#tempList").html();
|
||||
|
||||
|
||||
$('#tempAppend').append(_.template(template,{index:temp,MaterialCode:materialCode,MaterialName:materialName,UOM:uom,Quantity:quantity}));
|
||||
|
||||
|
||||
var theForm = $(".requistion");
|
||||
|
||||
addHidden(theForm,"MaterialCode"+temp,materialCode);
|
||||
addHidden(theForm,"Description"+temp,materialName);
|
||||
addHidden(theForm,"UOM"+temp,uom);
|
||||
addHidden(theForm,"Quantity"+temp,quantity);
|
||||
|
||||
$('#txtRowCount').val(temp);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
function addHidden(theForm, key, value) {
|
||||
// Create a hidden input element, and append it to the form:
|
||||
var input = document.createElement('input');
|
||||
input.type = 'hidden';
|
||||
input.name = key;'name-as-seen-at-the-server';
|
||||
input.id = key;'name-as-seen-at-the-server';
|
||||
input.value = value;
|
||||
theForm.append(input);
|
||||
}
|
||||
$("#myModal1").on("shown.bs.modal", function(e) {
|
||||
if($("option:selected", $("#RequestType")).val() == '-1')
|
||||
{
|
||||
alert('Please select the Request Type ');
|
||||
e.close();
|
||||
}
|
||||
});
|
||||
|
||||
$("#EditItem").on("shown.bs.modal", function(e) {
|
||||
userid = $(e.relatedTarget).data('userid');
|
||||
// alert(userid);
|
||||
var tr= document.getElementById(userid);
|
||||
var cellval = tr.cells;
|
||||
//alert(x[1].innerHTML);
|
||||
$('#EditMaterialCode').val(cellval[1].innerHTML);
|
||||
$('#EditDescription').val(cellval[2].innerHTML);
|
||||
$('#EditUOM').val(cellval[3].innerHTML);
|
||||
$('#EditQuantity').val(cellval[4].innerHTML);
|
||||
});
|
||||
|
||||
$('.EditClick').click(function(){
|
||||
|
||||
if(document.getElementById('EditQuantity').value == '' )
|
||||
{
|
||||
alert('Please Enter the Quantity' );
|
||||
}
|
||||
|
||||
if ( $('#EditQuantity').val() != '' )
|
||||
{
|
||||
|
||||
var editMaterialCode = $("#EditMaterialCode").val();
|
||||
var editDescription = $("#EditDescription").val();
|
||||
var editUOM = $('#EditUOM').val();
|
||||
var editQuantity = $('#EditQuantity').val();
|
||||
|
||||
var tr= document.getElementById(userid);
|
||||
var cellval = tr.cells;
|
||||
cellval[1].innerHTML = editMaterialCode;
|
||||
cellval[2].innerHTML = editDescription;
|
||||
cellval[3].innerHTML =editUOM;
|
||||
cellval[4].innerHTML = editQuantity;
|
||||
|
||||
$('#MaterialCode'+userid).val(editMaterialCode);
|
||||
$('#Description'+userid).val(editDescription);
|
||||
$('#UOM'+userid).val(editUOM);
|
||||
$('#Quantity'+userid).val(editQuantity);
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
$(".requistion").submit(function(e) {
|
||||
|
||||
var id= "Pending Approval";
|
||||
e.preventDefault();
|
||||
if(validate())
|
||||
{
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:$('.requistion').serialize(),
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>requisitionform/addNewRequistion?ID="+id,
|
||||
success:function(data) {
|
||||
if(data)
|
||||
{
|
||||
$('#content').loader('hide');
|
||||
alert(data);
|
||||
$('#txtRowCount').val('');
|
||||
$('#txtDeletedRow').val('');
|
||||
|
||||
//window.location = baseurl + 'CostCenter/CostListing';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Error");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
@ -1,6 +1,6 @@
|
||||
|
||||
<script>
|
||||
<!-- Editable table-->
|
||||
<!--<script>
|
||||
|
||||
$(function () {
|
||||
$("td").dblclick(function () {
|
||||
var OriginalContent = $(this).text();
|
||||
@ -19,7 +19,7 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>-->
|
||||
<style>
|
||||
.table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td {border: 1px solid #333;}
|
||||
|
||||
@ -229,42 +229,63 @@
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table table-bordered editableTable" style="border:1px solid #333">
|
||||
<table class="table table-bordered editableTable" style="border:1px solid #333">
|
||||
<div align="right" style="padding-right:10px">
|
||||
|
||||
<div class="modal fade" role="dialog">
|
||||
|
||||
<thead style="background-color:#fff">
|
||||
<tr>
|
||||
<th><input type="checkbox" name="name1" /> </th>
|
||||
|
||||
<th>Requisition Number</th>
|
||||
<th>Requisition Date</th>
|
||||
<th>Status</th>
|
||||
<th>Remarks</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="name2" /> </td>
|
||||
|
||||
<td><a data-toggle="modal" data-target="#myModal"><u>REQ000001</u></a></td>
|
||||
<td>2/3/2017</td>
|
||||
<td>Pending</td>
|
||||
<td data-name="sel">
|
||||
<select name="status">
|
||||
<option value="1">Pending</option>
|
||||
<option value="2">Approval</option>
|
||||
<option value="3">Reject</option>
|
||||
</select>
|
||||
</td>
|
||||
<td contenteditable="true">Need to get quick</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="name2" /> </td>
|
||||
<td><a data-toggle="modal" data-target="#myModal"><u>REQ000002</u></a></td>
|
||||
|
||||
<td><a data-toggle="modal" data-target="#myModal"><u>REQ000001</u></a></td>
|
||||
<td>5/4/2017</td>
|
||||
<td>Pending</td>
|
||||
<td data-name="sel">
|
||||
<select name="status">
|
||||
<option value="1">Pending</option>
|
||||
<option value="2">Approval</option>
|
||||
<option value="3">Reject</option>
|
||||
</select>
|
||||
</td>
|
||||
<td contenteditable="true">Need to get quick</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="name2" /> </td>
|
||||
<td><a data-toggle="modal" data-target="#myModal"><u>REQ000003</u> </a></td>
|
||||
|
||||
<td><a data-toggle="modal" data-target="#myModal"><u>REQ000001</u></a></td>
|
||||
<td>9/4/2017</td>
|
||||
<td>Pending</td>
|
||||
|
||||
<td data-name="sel">
|
||||
<select name="status">
|
||||
<option value="1">Pending</option>
|
||||
<option value="2">Approval</option>
|
||||
<option value="3">Reject</option>
|
||||
</select>
|
||||
</td>
|
||||
<td contenteditable="true">Need to get quick</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
|
||||
@ -1,15 +1,3 @@
|
||||
<?php
|
||||
|
||||
$DraftCount = '';
|
||||
if(!empty($Status))
|
||||
{
|
||||
foreach ($Status as $St)
|
||||
{
|
||||
$DraftCount = $St->cnt;
|
||||
}
|
||||
//echo $DraftCount;
|
||||
}?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
@ -33,10 +21,7 @@ speed:500
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-right">
|
||||
<div class="form-group">
|
||||
<?php if($DraftCount == 0)
|
||||
{ ?>
|
||||
<a class="btn btn-primary" onclick="Test()" href="<?php echo base_url(); ?>RequisitionForm">Raise New Requisition</a><?php }?>
|
||||
|
||||
<a class="btn btn-primary" href="<?php echo base_url(); ?>RequisitionForm">Raise New Requisition</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -55,29 +40,47 @@ speed:500
|
||||
|
||||
<tr bgcolor="steelblue">
|
||||
<th>Requisition No</th>
|
||||
<th>Requisition Date</th>
|
||||
<th> Requisition Date</th>
|
||||
<th>Status</th>
|
||||
<th>CreatedDate</th>
|
||||
<th>Department</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
<?php
|
||||
if(!empty($ReqList))
|
||||
{
|
||||
foreach($ReqList as $record)
|
||||
{
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $record->ReqNo ?></td>
|
||||
<td><?php echo $record->ReqType ?></td>
|
||||
<td><?php echo $record->Status ?></td>
|
||||
<td><?php echo $record->CreatedDate ?></td>
|
||||
<td><i class="fa fa-pencil" aria-hidden="true"></i> <i class="fa fa-trash" aria-hidden="true"></i></td>
|
||||
<td>REQ000001</td>
|
||||
<td>5/5/2017</td>
|
||||
<td>active</td>
|
||||
<td>admin</td>
|
||||
<td><a href="<?php echo base_url(); ?>requisitionform/editrequisitionlisting" ><i class="fa fa-pencil" aria-hidden="true"></i></a> <i class="fa fa-trash" aria-hidden="true"></i></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td>REQ000002</td>
|
||||
<td>6/5/2017</td>
|
||||
<td>active</td>
|
||||
<td>admin</td>
|
||||
<td><a href="<?php echo base_url(); ?>requisitionform/editrequisitionlisting" ><i class="fa fa-pencil" aria-hidden="true"></i></a><i class="fa fa-trash" aria-hidden="true"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>REQ000003</td>
|
||||
<td>7/5/2017</td>
|
||||
<td>active</td>
|
||||
<td>admin</td>
|
||||
<td><a href="<?php echo base_url(); ?>requisitionform/editrequisitionlisting" ><i class="fa fa-pencil" aria-hidden="true"></i></a> <i class="fa fa-trash" aria-hidden="true"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>REQ000004</td>
|
||||
<td>8/5/2017</td>
|
||||
<td>active</td>
|
||||
<td>admin</td>
|
||||
<td><a href="<?php echo base_url(); ?>requisitionform/editrequisitionlisting" ><i class="fa fa-pencil" aria-hidden="true"></i></a> <i class="fa fa-trash" aria-hidden="true"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>REQ000005</td>
|
||||
<td>9/5/2017</td>
|
||||
<td>active</td>
|
||||
<td>admin</td>
|
||||
<td><a href="<?php echo base_url(); ?>requisitionform/editrequisitionlisting" ><i class="fa fa-pencil" aria-hidden="true"></i></a> <i class="fa fa-trash" aria-hidden="true"></i></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div><!-- /.box-body -->
|
||||
@ -86,5 +89,4 @@ speed:500
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user