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

158 lines
4.8 KiB
PHP
Executable File

<?php
//print_r($records);
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Product Test Reports List</center>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<!--<center><h3 class="box-title">-->
<div class="box-tools">
<!-- <form action="<?php echo base_url() ?>assetListing" method="POST" id="searchList">-->
<div class="col-md-3">
<a href=" <?php echo base_url().'quality/report';?> " type="button" class="btn btn-success">Add New</a>
</div>
<div class="col-md-3 col-md-offset-1" style="margin-bottom:2px">
<a href=" javascript:void(0)" type="button" class="btn btn-success" onclick="synczohobooks()">Sync With Zoho Books</a>
</div>
</form>
</div><!--</h3></center>-->
</div><!-- /.box-header -->
<div class="box-body">
<!-- <div class="row">
<div class="col-md-3">
<?php echo form_dropdown('name="product"',$products2,set_value('product',$products2[-1]),'id="product"' ,'class="form-control select2');?>
</div>
<div class="col-md-3">
<?php echo form_dropdown('name="customer"',$customers2,set_value('customer',$customers2[-1]),'id="customer"' ,'class="form-control select2');?>
</div>
<div class="col-md-3">
<input type="button" id="addspec" class="btn btn-success" value = "Add New Specification">
</div>
</div> -->
<br/>
<table id="testspecifications" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead>
<tr>
<th>Test Report ID</th>
<th>Invoice ID</th>
<th>Batch Date</th>
<th>Product Name</th>
<th>Customer Name</th>
</tr>
</thead>
<tbody id="specAppend">
<?php
if(!empty($records))
{
foreach($records as $data)
{
//print_r($data);echo "</br></br>";
?>
<tr> <td><a href="<?php echo base_url()?>quality/viewIndReport/<?php echo $data->testreport_id ?>"><?php echo $data->testreport_id?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<?php if(!empty($data->document)){?>
<a target="_blank" href="<?php echo base_url()?>public/uploads/QAD/<?php echo $data->document ?>"><span class="fa fa-file-o"></span></a>
<?php }?>
</td> <td><?php echo $data->invoiceid?></td> <td style="text-align:right;"><?php echo format_date($data->batchdate,0,'d-m-Y');?></td><td><?php echo $data->product_name;?></td><td><?php echo $data->client_name;?></td></tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
<div class="row">
</div>
</div><!-- /.box-body -->
<!-- <div class="box-footer clearfix">
</div> -->
</div><!-- /.box -->
</div>
</div>
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script type="text/javascript">
$(function () {
$.fn.dataTable.moment( 'DD-MM-YYYY' );
$('#testspecifications').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
//"columnDefs" : [{"targets":2, "type":"date-eu"}],
"aaSorting": [[ 2, "desc" ]],
"info": true,
"autoWidth": true,
});
});
</script>
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script> -->
<script type="text/javascript">
function synczohobooks(){
var sync = true
$('#loader_wrapper').css("display", "block");
$.ajax({
// $('#loadingDiv').show();
url:"<?php echo base_url() ?>login/zohobooks_api_fetch_all",
type:"post",
data:{sync},
success:function(data){
console.log(data);
alert("Sync Completed");
// alert(data.invoice);
},
complete: function(){
$('#loader_wrapper').css("display", "none");
}
});
}
</script>