if(!(empty($_POST['rut'])) and !(empty($_POST['nombre'])) and !(empty($_POST['telefono'])) and !(empty($_POST['patente'])) and !(empty($_POST['marca'])) and !(empty($_POST['modelo'])) and !(empty($_POST['motor'])) and !(empty($_POST['periodo'])) and !(empty($_POST['combustible'])) and !(empty($_POST['vin']))){
$rut = $_POST['rut'];
$nombre = $_POST['nombre'];
$telefono = $_POST['telefono'];
$marca = $_POST['marca'];
$modelo = $_POST['modelo'];
$motor = $_POST['motor'];
$periodo = $_POST['periodo'];
$combustible = $_POST['combustible'];
$patente = $_POST['patente'];
$vin = $_POST['vin'];
$kilometraje = $_POST['kilometraje'];
setlocale(LC_TIME, "spanish");
$fecha = date("y-m-d");
$newDate = date("d-m-Y", strtotime($fecha));
$mesDesc = strftime("%d de %B de %Y", strtotime($newDate));
$trabajos = $_POST['trabajos'];
$comentarios = $_POST['comentarios'];
$orden = $_POST['orden'];
$filas = $_POST['tabla_trabajos'];
$html = '<table width="100%" style="vertical-align: bottom;">
<tr><td width="100%" style="text-align:center"><img src="imagenes/logo-negro.png" width="300"/></td></tr>
<tr><td width="100%" style="text-align:center"><p>General Korner #721 - Paradero 30 Gran Avenida - El Bosque</p><td><tr>
<tr><td width="100%" style="text-align:center"><p>www.ecuservicechile.cl - contacto@ecuservicechile.cl</p><td><tr>
<tr><td width="100%" style="text-align:center"><p>+56 9 5728 1246 | +56 9 3214 0292</p><td><tr>
</table>
<table width="100%" style="vertical-align: bottom;border-bottom: 1px solid rgba(90,90,90,.9)">
<tr>
<td width="82%"><h1>ORDEN DE TRABAJO</h1></td>
<td><h1>N°: '.$orden.'</h1></td>
</tr>
</table>
<table width="100%">
<tr>
<td width="85%">'.$mesDesc.'</td>
</tr>
</table>
<h4>DATOS DEL CLIENTE</h4>
<table class="cliente">
<tbody>
<tr>
<td><strong>NOMBRE:</strong></td><td>'.$nombre.'</td>
<td><strong>RUT:</strong></td><td>'.$rut.'</td>
<td><strong>TELEFONO:</strong></td><td>'.$telefono.'</td>
</tr>
</tbody>
</table>
<h4>DATOS DEL VEHICULO</h4>
<table class="datos-vehiculo">
<tbody>
<tr>
<td><strong>MARCA:</strong></td><td>'.$marca.'</td><td><strong>MODELO:</strong></td><td>'.$modelo.'</td>
</tr>
<tr>
<td><strong>MOTOR:</strong></td><td>'.$motor.'</td><td><strong>AÑO:</strong></td><td>'.$periodo.'</td>
</tr>
<tr>
<td><strong>COMBUSTIBLE:</strong></td><td>'.$combustible.'</td><td><strong>PATENTE:</strong></td><td>'.$patente.'</td>
</tr>
<tr>
<td><strong>VIN:</strong></td><td>'.$vin.'</td><td><strong>KILOMETRAJE:</strong></td><td>22.908
</td>
</tr>
</tbody>
</table>
<h4>DESCRIPCIÓN DEL TRABAJO</h4>
<table class="trabajos">
<tbody>
<tr><td>'.nl2br($trabajos).'</td></tr>
</tbody>
</table>
<h4>COMENTARIOS ADICIONALES</h4>
<p>'.nl2br($filas).'</p>
<p style="font-size:11px;text-align:justify; position: absolute;bottom:30px;border-top:0.5px solid rgba(0,0,0,.1); width:85%">Estimado cliente, le informamos que para los servicios que contemplen cambios de piezas eléctricas originales, la garantía es de 10 días a contar del día de la instalación, siempre y cuando están sean adquiridas a través de nosotros. Del mismo modo anterior, para piezas mecánicas la garantía es de 3 meses, al igual que los servicios de mantenciones. Servicios como DPF OFF o EGR OFF la garantía otorgada por el servicio es de 3 años siempre y cuando la falla sea adjudicada al servicio entregado. Para garantía de otros servicios, favor consultar al momento de pagar el servicio.</p>';
include('MPDF/mpdf.php');
$mpdf=new mPDF('c','A4');
$css = file_get_contents('recursos/css/style.css');
$mpdf->WriteHTML($css , 1);
$mpdf->WriteHTML($html);
$mpdf->Output('prueba.pdf','I');
exit;
}