ria/application/views/storerequisitionlisting.php
venbatechnologies@gmail.com 27e4508e78 issues fixes
2018-07-11 15:00:52 +05:30

379 lines
9.5 KiB
PHP

<!-- <?php
$DraftCount = '';
$ReqNo = '';
if(!empty($Status))
{
foreach ($Status as $St)
{
//$DraftCount = $St->cnt;
//$ReqNo = $St->ReqNo;
}
//echo $ReqNo;
}?> -->
<style>
span.highlight {
background-color: yellow;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<div>
<?php
$attributes = array('class' => 'form-label-left Storerequistion ','name' => 'Storerequistion','id' => 'Storerequistion');
echo form_open($this->config->base_url().'storerequisitioncontroller/addstorerequisitionlist',$attributes); ?>
</div>
</div>
<div class="col-md-3 col-md-offset-3">
<label>&nbsp;&nbsp;</label>
<div class="form-group">
<input type="hidden" name="FromDate" id="FromDate" />
<input type="hidden" name="ToDate" id="ToDate" />
<!-- <input type="Reset" class="btn btn-primary" >
<button type="button" class="close" data-dismiss="modal">&times;</button>
<a class="btn btn-info" onclick="Search()" >Search</a>
-->
</div>
</div>
</div>
</div>
<!-- model to show Store requisition detail -->
<div class="modal fade" id="storereqdetail" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<form>
<div class="modal-content">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<!-- <center><h4> Store Requisition Number Details </h4></center>-->
<center><h4><?php echo $PageTitle; ?></h4></center>
</div>
<div align="left">
<div class="col-md-12">
<div class="col-md-3">
<label>Requistion No</label>
<div class="form-group">
<?php
$data = array('name' => 'ReqNO','value' => set_value('ReqNO'),'id'=>'ReqNO', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-3">
<label>Requested By</label>
<div class="form-group">
<?php
$data = array('name' => 'ReqBy','value' => set_value('ReqBy'),'id'=>'ReqBy', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<label>Department</label>
<div class="form-group">
<?php
$data = array('name' => 'Desigination','value' => set_value('Desigination'),'id'=>'Desigination', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
<label>Requested Date</label>
<div class="form-group">
<?php
$data = array('name' => 'ReqDate','value' => set_value('ReqDate'),'id'=>'ReqDate', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<label>Cost Center Name</label>
<div class="form-group">
<?php
$data = array('name' => 'CostCenter','value' => set_value('CostCenter'),'id'=>'CostCenter', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<div align="right" style="padding-right:10px">
<div class="modal fade" role="dialog">
<thead style="background-color:#ddf">
<tr>
<th>SNo</th>
<th>Item Code</th>
<th>Item Description</th>
<th>UOM</th>
<th>Requested Quantity</th>
<th>Issued Quantity</th>
<th>Remarks</th>
</tr>
</thead>
<tbody id="tbleAppend">
</tbody>
</div>
</div>
</table>
<div class="modal-footer"> <div class="col-md-12">
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Ok</a>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class=" container-fluid">
<div class="box-header">
<!-- <CENTER><h3 class="box-title">Resico Industries - Store Requisition Listing</h3></CENTER> -->
<CENTER><h3 class="box-title"><?php echo $pageTitle; ?></h3></CENTER> -->
</div>
<table id="Requisition" class="table table-bordered table-hover editabletable" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>Store Requisition No</th>
<th>Requested Department</th>
<th>Requested By</th>
<th>Requested Date</th>
<th>Status</th>
<th>Approver Comments</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($TotNoOfLine))
{
$index = 0;
foreach($TotNoOfLine as $record)
{
$index = $index +1;
?>
<tr id="<?php echo $index ?>" >
<td><a data-toggle="tooltip" href="<?php echo base_url().'storerequisitioncontroller/issuestorerequisition?ReqNo='.$record->StoreReqNo; ?>" title="<?php echo $record->StoreReqNo; ?> - Click here to view store Requisition details" ><u><?php echo $record->StoreReqNo ?></u></a>
</td>
<td><?php echo $record->DepartmentName ?></td>
<td><?php echo $record->Requestedby ?></td>
<td align="right"><?php
$rdate = new DateTime($record->ReqDate) ;
$ReqDate = $rdate->format('d-m-Y');
echo $ReqDate; ?></td>
<td><?php echo $record->StatusName ?></td>
<td><?php echo $record->Remarks ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<div id="content"></div>
</div>
</div>
</div>
</div>
</section>
</div>
<script>
var startDate = '';
var endDate = '';
function SaveIssueQuantity(rowid)
{
var IssueQty = $("#IssuedQuantity"+RowId).val();
if( IssueQty != '')
{
$('#content').loader('show');
$.ajax({
data:{id:IssueQty},
type:"POST",
url:"<?php echo base_url() ?>storerequisitioncontroller/SaveIssuedQuantity",
success:function(data) {
$('#content').loader('hide');
swal(data);
location.reload();
}
});
}
}
function Reset()
{
$('#RequisitionStatus').val("-1");
$('#SearchDate').val('');
}
$("#storereqdetail").on("shown.bs.modal", function(e) {
var ReqId = $(e.relatedTarget).data('userid');
$('#ReqNO').val(ReqId);
$("#CostCenter").val('');
$("#tbleAppend").empty();
$("#ReqDate").val('');
$("#Desigination").val('');
$('#content').loader('show');
$.ajax({
data:{id:ReqId},
type:"POST",
dataType: 'json',
url:"<?php echo base_url() ?>storerequisitioncontroller/ViewRequest",
success:function(json) {
$('#content').loader('hide');
$("#ReqBy").val(json.Requist[0]['Requestedby']);
$("#ReqDate").val(json.Requist[0]['ReqDate']);
$("#Desigination").val(json.Requist[0]['DepartmentName']);
$("#CostCenter").val(json.Requist[0]['CostCenterName']);
$("#tbleAppend").append(json.Items);
}
});
});
function DeleteRow(rowid)
{
id = rowid;
var answer = confirm(" Do you want to delete the Requisition?")
if (answer)
{
$.ajax({
data:{id:id},
type:"POST",
url:"<?php echo base_url() ?>storerequisitioncontroller/DeleteReqNo",
success:function(data) {
if(data)
{
$('#content').loader('hide');
swal(data);
location.reload();
}
else
{
swal("Error");
}
}});
}
}
$(function() {
var d = new Date();
var month = d.getMonth();
var day = d.getDate();
var year = d.getFullYear() ;
var SIAStartYear = year - 2015;
var mindt = year-70;
var maxdt = year-15;
$( ".datePicker" ).datepicker(
{
minDate : new Date(year-SIAStartYear,1,1),
maxDate :'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,
}
);
$(".select2").select2();
$('#SearchDate').daterangepicker(
{
locale: {
format: 'DD-MM-YYYY'
},
showDropdowns: true
},
function(start, end, label) {
startDate = start.format('DD-MM-YYYY');
endDate = end.format('DD-MM-YYYY');
$('#FromDate').val(startDate);
$('#ToDate').val(endDate);
});
});
$(function () {
$('#Requisition').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
</script>