Академический Документы
Профессиональный Документы
Культура Документы
2615
<?php
require '../../content/db.php';
require_once '../../dompdf/autoload.inc.php';
if(!function_exists('isuserBank'))
{
function isuserBank($p){
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
$date1=$_POST["deb"];
$date2=$_POST["fin"];
$code = $_POST["label"];
use Dompdf\Dompdf;
//$document->loadHtml($page);
//$coonect = mysqli_connect("localhost","root","root","lastdb");
//$query="select llx_product.label ,llx_command_files.total_card ,'testtype' as
type from llx_product inner join llx_command_files on llx_product.rowid =
llx_command_files.rowid";
//$query="select llx_product.label
,llx_command_files.import_key,llx_command_files.file_reception_start,llx_command_fi
les.file_reception_end,llx_command_files.total_card from llx_product inner join
llx_command_files on llx_product.rowid = llx_command_files.fk_object";
//$query="select * from llx_extranet_product ".isuserBank('llx_extranet_product');
$query="select b.card_type, c.label, c.stock+count(1) as stock_int, count(1) as
consomme, c.stock as stock_act, SUM(IF(b.line_status>100,1,0)) as reject, c.tested
from llx_command_files a, llx_command_filedet b, llx_extranet_product c where
a.rowid = b.fk_object and b.card_type = c.card_type and b.bank_code = c.bank_code
and file_reception_start between '2017/05/01' and '2017/05/31' group by
a.clt_reference, c.label limit 150";
$result= mysqli_query($coonect,$query);
$output = "
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
.info{
position: absolute;top: -5%;right: 5%;width: 50%
}
.info *{
background-color:#fff;
}
#nameCompany{
color:blue
}
img{
width:20%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
";
//$document->loadHtml($html);
// </tr>';
$data_line[] = '<tr>
<td>'.$row["label"].'</td>
<td>'.$row["card_type"].'</td>
<td>'.$row["stock_int"].'</td>
<td>'.$row["consomme"].'</td>
<td>'.$row["stock_act"].'</td>
<td>'.$row["reject"].'</td>
<td>'.$row["tested"].'</td>
</tr>';
}
$CountLine = array_chunk($data_line,12);
$data = [];
$kys = count($CountLine);
for($i = 0 ;$i < $kys ;$i++){
$data[$i][] = "<table page-break-inside: auto;>
<tr>
<th>Nom</th>
<th>type carte</th>
<th>stock initial</th>
<th>stock consomm</th>
<th>stock actuel</th>
<th>Qte Testes</th>
<th>Qte Rejetes</th>
</tr>
<tbody>".implode('',$Countline[$i])."</tbody></table>";
$output .= '</tbody></table>';
$document->loadHtml($output);
$document->setPaper('A4', 'landscape');
$document->render();
$document->stream("pdf",array("Attachment"=>0));
?>
https://docs.google.com/viewerng/viewer?url=https://img1.file-upload.com/cgi-
bin/dl.cgi/o4jkii7kdsqyrhnwaca5aqsrs4jlsylyrljehxzhlirbtbehjphgqbq/e2lymno618az.pdf