175 lines
5.1 KiB
PHP
175 lines
5.1 KiB
PHP
|
|
<?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 id="loader_wrapper" style="display:none;">
|
|
<div id="loadingDiv" style="height: 120%;position: absolute;width: 100%;top: 0px;background: white;text-align: center;z-index: 9999999999999999999999999999999999;left: -0px;">
|
|
|
|
<div style="position: relative;top:200px" id="load-img">
|
|
|
|
<img src="<?php echo base_url();?>uploads/spinner.gif" class="img-fluid">
|
|
<h3>Syncing with zoho books...</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<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-primary">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-primary" 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-primary" value = "Add New Specification">
|
|
</div>
|
|
|
|
</div> -->
|
|
<br/>
|
|
<table id="testspecifications" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
|
<thead style="background-color:#ddf">
|
|
<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>
|
|
<?php if(!empty($data->document)){?>
|
|
<a target="_blank" href="<?php echo base_url()?>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 date_format(date_create($data->batchdate),'d-m-Y');?></td><td><?php echo $data->product_name;?></td><td><?php echo $data->client_name;?></td></tr>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
<p> </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(); ?>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() ?>quality/zohobooks_api_fetch_all",
|
|
type:"post",
|
|
data:{sync},
|
|
|
|
success:function(data){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alert("Sync Completed");
|
|
// alert(data.invoice);
|
|
|
|
|
|
},
|
|
complete: function(){
|
|
$('#loader_wrapper').css("display", "none");
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|