</tr>
        <tr>
          <td id="texto1">TIPO</td>
          <td id="texto1">******</td>
          <td colspan="3" id="texto1">OFICIO EXTERNO A TESORERIA</td>
        </tr>
        <tr>
          <td id="texto1">FECHA</td>
          <td colspan="2"style="text-transform:uppercase; font-size:10px;"><?php 
echo fechaesp($data['fechaactual']);
?>
</td>
          <td width="126" id="texto1">SEMANA</td>
          <td width="184" style="text-transform:uppercase; font-size:10px;"> del <?php 
if ($data['raya'] == 1) {
    echo fechaesp($data['fecha1']) . ' al ' . fechaesp($data['fecha2']);
}
?>
</td>
        </tr>
      </table>
      <br />
      <table width="300" border="0" align="center">
        <tr>
          <td align="right">PAGADO</td>
        </tr>
      </table>
      <br />
      PAGARSE LA ORDEN DE:<br />
      <table width="800" border="1">
        <tr>
Example #2
0
} else {
    header('Location: index.php');
}
$mensaje = "";
function fechaesp($fecha)
{
    $p = explode("-", $fecha);
    $y = $p[2];
    $m = $p[0];
    $d = $p[1];
    $fr = $y . '-' . $m . "-" . $d;
    return $fr;
}
if (isset($_POST['fecha'])) {
    include 'conn.php';
    $anio = fechaesp($_POST['fecha']);
    try {
        $dbh = conectarbase();
        /*** echo a message saying we have connected ***/
        //echo 'Connected to database';
        $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        /*foreach ($_POST as $key ) {
          	print $key;
          }*/
        $hinicio = strtotime($_POST['hinicio']);
        $hinicio = date("H:i:00", $hinicio);
        $hfin = strtotime($_POST['hfin']);
        $hfin = date("H:i:00", $hfin);
        /*** prepare the SQL statement ***/
        $stmt = $dbh->prepare("INSERT into horario (fecha,inicio,fin,espacio_idespacio) values (:fecha,:inicio,:fin,:espacio) ");
        $stmt->bindParam(':fecha', $anio, PDO::PARAM_STR, 10);