ria/app/Views/storerequisition.php
2024-09-11 08:54:25 +05:30

164 lines
4.4 KiB
PHP
Executable File

<?php
$DraftCount =0;
$StoreReqNo = '';
//echo $StoreReqNo;
if(!empty($Store))
{
foreach ($Store as $St)
{
if ($St->StatusName=='DRAFT')
{
$DraftCount++;
$StoreReqNo = $St->StoreReqNo;
}
}
//echo $StoreReqNo;
}?>
<style>
span.highlight {
background-color: yellow;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class=" container-fluid">
<div class="box-header">
<center><b><h3 class="box-title">Requisition Listing</h3></b></center>
</div>
<?php if($DraftCount > 0 ) { ?><p>
<span class="highlight">The Store Requisition No <b><?php echo $StoreReqNo;?></b> is in Draft status.</span> Please act on the requisition.<span class="highlight">Then only you can raise New StoreRequisition. </span>
</p> <?php } ?>
<div class="row">
<div class="col-xs-12 text-right" style="margin-bottom:-3%;">
<div class="form-group">
<?php if($DraftCount == 0)
{ ?>
<a class="btn btn-success" href="<?php echo base_url(); ?>storerequisitionlist/addstores"/>Raise Store Requisition</a><?php
}?>
</div>
</div>
</div>
<table id="Requisition" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead>
<tr>
<th>Store Requisition No</th>
<th>Tot No.OfLineItem </th>
<th>Issued Item Count</th>
<th>Pending Item Count</th>
<th>Status</th>
<th>Requested Date</th>
<th>Action</th>
</tr>
</thead>
<?php
if(!empty($Store))
{
// echo "VIEW";
// print_r($Store);
foreach($Store as $record)
{ //print_r($record);
?>
<tr>
<td><?php echo $record->StoreReqNo ?></td>
<td align="right"><?php echo $record->TotalNoofLineItems ?></td>
<td align="right"><?php echo $record->IssuesItems ?></td>
<td align="right"><?php echo $record->PendingItems ?></td>
<td><?php echo $record->StatusName ?></td>
<td align="right"><?php $dt = new DateTime($record->ReqDate);
$ReqDate = $dt->format('d-m-Y'); echo $ReqDate ?>
<td> <a data-toggle="tooltip" href="<?php echo base_url().'EditStoreRequisition?StoreReqNo='.$record->StoreReqNo; ?>"><i class="fa fa-pencil" data-toggle="tooltip" title="<?php echo $record->StoreReqNo; ?> - Click here to view addstorerequisitionslip"></i>&nbsp;&nbsp;&nbsp;</a> <a data-toggle="tooltip" onclick="DeleteRow('<?php echo $record->StoreReqNo; ?>' )" ><span class="glyphicon glyphicon-trash" title="<?php echo $record->StoreReqNo; ?> - Click here to Delete Requisition details"></span></a> </td>
</tr>
<?php
}
}
?>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<script>
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() ?>storerequisitionlist/DeleteReqNo",
success:function(data) {
if(data)
{
$('#content').loader('hide');
alert(data);
location.reload();
}
else
{
alert("Error");
}
}});
}
}
</script>
<script>
$(function () {
$('#Requisition').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs" : [{"targets":5, "type":"date-eu"}],
"aaSorting": [[ 5, "desc" ]],
"info": true,
"autoWidth": true
});
});
</script>
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>