<?php

require_once __DIR__ . '/vendor/autoload.php';

 
$hi = '<table> <tr> <td> Hi there</td><td> </td></tr></table>';
//$mpdf->WriteHTML($hi);
//$mpdf->Output();

$html = '';
$html .= ' <table class="table table-bordered"  cellspacing="0" cellspadding="0" width="100%">
<thead>
<tr>
  <th scope="col">#</th>
  <th scope="col">First</th>
  <th scope="col">Last</th>
  <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
  <th scope="row">1</th>
  <td>Mark</td>
  <td>Otto</td>
  <td>@mdo</td>
</tr>
<tr>
  <th scope="row">2</th>
  <td>Jacob</td>
  <td>Thornton</td>
  <td>@fat</td>
</tr>
<tr>
  <th scope="row">3</th>
  <td>Larry</td>
  <td>the Bird</td>
  <td>@twitter</td>
</tr>
</tbody>
</table>';

 

 
$hi = '<table> <tr> <td> Hi there</td><td> </td></tr></table>';
//$mpdf->WriteHTML($hi);
//$mpdf->Output();

$html = '';
$html .= ' <table class="table table-bordered"  cellspacing="0" cellspadding="0" width="100%">
<thead>
<tr>
  <th scope="col">#</th>
  <th scope="col">First</th>
  <th scope="col">Last</th>
  <th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
  <th scope="row">1</th>
  <td>Mark</td>
  <td>Otto</td>
  <td>@mdo</td>
</tr>
<tr>
  <th scope="row">2</th>
  <td>Jacob</td>
  <td>Thornton</td>
  <td>@fat</td>
</tr>
<tr>
  <th scope="row">3</th>
  <td>Larry</td>
  <td>the Bird</td>
  <td>@twitter</td>
</tr>
</tbody>
</table>';

$storehere = array();
for($k =0; $k<3; $k++){
    $container = array();
    for($i =0; $i<4; $i++){
        $see = array('Product' =>23, 'price'=>2000, 'name'=>time());
        
        array_push( $container , $see);
    }
    $temp = array("Code" =>rand(), "attendant" =>'jack'.rand(), 'ownercat' =>rand(), 'jobdata' =>time(), 'products' =>$container);
    array_push( $storehere , $temp);
}


 


$bc = new \Mpdf\Barcode();
 

	/* 

	$mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8','format' => 'A4-L' ]);
    $stylesheet = file_get_contents('https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css');
    //$mpdf->WriteHTML($stylesheet,\Mpdf\HTMLParserMode::HEADER_CSS);

	$mpdf->SetDisplayMode('fullpage');
    $mpdf->WriteHTML($stylesheet,\Mpdf\HTMLParserMode::HEADER_CSS);
	$mpdf->WriteHTML( $html );
 // $mpdf->Output( 'devnote.pdf', 'F' ); 
	$mpdf->Output();
	exit;
    */
 

	$mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8','format' => 'A4-L' ]);
    //$stylesheet = file_get_contents('https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css');
    $stylesheet2 = file_get_contents('mpdfcss.css'); 

	$mpdf->SetDisplayMode('fullpage');
    //$mpdf->WriteHTML($stylesheet,\Mpdf\HTMLParserMode::HEADER_CSS);
    $mpdf->WriteHTML($stylesheet2,\Mpdf\HTMLParserMode::HEADER_CSS);
    $mpdf->SetWatermarkImage(
        'images/shoplogos/water.jpg',
        0.05,
        '',
        array(10,10)
    );

    //$mpdf->SetWatermarkImage('images/shoplogos/water.jpg');
    //<barcode code="04210000526"  type="UPCE" height="0.5" text="1"  size="2"/>
    $mpdf->showWatermarkImage = true;

    $mpdf->WriteHTML(' 
    

    <barcode code="12345678909"  type="UPCA" height="0.5" text="1"  size="2"/>
   
    
     
     

     
    
    
    
    
     ');

    
  // $mpdf->Output( 'devnote.pdf', 'F' ); 
	 $mpdf->Output();
	exit;
?>