Esempio n. 1
0
 function Header()
 {
     global $e, $o, $titulo;
     $this->Image('../../main/imagenes/logo.png', 10, 8, 55);
     $this->SetY(8);
     $this->SetFont('Arial', '', 16);
     $this->Cell(60);
     $this->Cell(130 + ($this->or == 'L' ? 70 : 0), 8, toStr('PRESALUD NACIONAL C.A.'), 0, 1, 'C');
     $this->SetFont('Arial', '', 10);
     $this->Cell(60);
     $this->Cell(130 + ($this->or == 'L' ? 70 : 0), 4, toStr('J-31361106-9'), 0, 1, 'C');
     $this->Cell(60);
     $this->Cell(130 + ($this->or == 'L' ? 70 : 0), 4, toStr('C.C. Paseo Las Industrias, Nueva Etapa, Nivel 2, Local 2-131, Zona Industrial Sur.'), 0, 1, 'C');
     $this->Cell(60);
     $this->Cell(130 + ($this->or == 'L' ? 70 : 0), 4, toStr('Valencia - Edo. Carabobo. Telefonos: (0241) 8323754 / 8323076 / 8321680 / 8322624.'), 0, 1, 'C');
     $this->Line(10, 32, 200 + ($this->or == 'L' ? 70 : 0), 32);
     $this->SetY(34);
     $this->Cell(130, 4, toStr('Creado por: ' . $_SESSION["octa-lite-user"]["NOMBRE"]), 0, 0, 'L');
     $this->SetFont('Arial', '', 16);
     $this->Cell(60 + ($this->or == 'L' ? 70 : 0), 8, toStr($titulo), 0, 0, 'R');
     $this->Ln(6);
     $this->SetY(38);
     $this->SetFont('Arial', '', 9);
     $this->Cell(60, 6, toStr('Pag. ' . $this->PageNo() . ' de {nb}'));
     $this->Ln(2);
 }
Esempio n. 2
0
function printText($text, $align = 'L', $isBold = false, $fonSize = 18, $padding = 0)
{
    global $im, $fc, $mx;
    $ft = $isBold ? "fonts/ARIALBD.TTF" : "fonts/ARIAL.TTF";
    $sac = "";
    $texte = explode(" ", toStr($text));
    foreach ($texte as $k => $v) {
        $sacline .= $v . " ";
        $type_space = imagettfbbox($fonSize, 0, $ft, $sacline);
        if (abs($type_space[4] - $type_space[0]) > 560 - $padding or count($texte) - 1 == $k) {
            $sac .= count($texte) - 1 == $k ? $v : '';
            $type_space = imagettfbbox($fonSize, 0, $ft, $sac);
            $a = 0;
            if ($align == 'C') {
                $a = 300 - abs($type_space[4] - $type_space[0]) / 2;
            }
            if ($align == 'R') {
                $a = 600 - abs($type_space[4] - $type_space[0]) - 10;
            }
            imagettftext($im, $fonSize, 0, $a + $padding, $mx, $fc, $ft, $sac);
            $mx += abs($type_space[5] - $type_space[1]) + 10;
            $sacline = $v;
            $sac = "";
        }
        $sac .= $v . " ";
    }
}
Esempio n. 3
0
function imageDecrypt($key, $img)
{
    $escape = 7;
    $extractedBin = "";
    for ($x = 0; $x < imagesx($key); $x++) {
        //Compare color of both images at pixel coordinate
        $rgbKey = imagecolorat($key, $x, 0);
        $rgbImg = imagecolorat($img, $x, 0);
        //var_dump($rgbImg);
        if ($rgbKey == $rgbImg) {
            $extractedBin .= "0";
            $escape--;
            if ($escape == 0) {
                //var_dump($extractedBin);
                break;
            }
        } else {
            $extractedBin .= "1";
            $escape = 7;
        }
        if ($x > 7 && substr($extractedBin, 0, 7) == "1111111") {
            return null;
        }
    }
    $msglen = toStr($extractedBin);
    $msglen = intval($msglen);
    $msg = "";
    for ($y = 1; $y < imagesy($img); $y++) {
        for ($x = 0; $x < imagesx($img); $x++) {
            $rgbKey = imagecolorat($key, $x, $y);
            $rgbImg = imagecolorat($img, $x, $y);
            if ($rgbKey == $rgbImg) {
                $msg .= "0";
            } else {
                $msg .= "1";
            }
            $msglen--;
            if ($msglen <= 0) {
                break 2;
            }
        }
    }
    return toStr($msg);
}
Esempio n. 4
0
        $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, "FECHA");
        $objWorkSheet->getColumnDimension($nameCols[$icol])->setAutoSize(true);
        $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, "COD PAC");
        $objWorkSheet->getColumnDimension($nameCols[$icol])->setAutoSize(true);
        $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, "PACIENTE");
        $objWorkSheet->getColumnDimension($nameCols[$icol])->setAutoSize(true);
        $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, "TIT");
        $objWorkSheet->getColumnDimension($nameCols[$icol])->setAutoSize(true);
        $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, "TITULAR");
        $objWorkSheet->getColumnDimension($nameCols[$icol])->setAutoSize(true);
        $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, "MONTO");
        $objWorkSheet->getColumnDimension($nameCols[$icol])->setAutoSize(true);
        $sql = mssql_query($sqla);
        while ($row = mssql_fetch_array($sql)) {
            $irow++;
            $icol = -1;
            $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, $row["NUMERO"]);
            $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, $row["FECHA"]);
            $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, $row["CPAC"]);
            $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, toStr($row["PACIENTE"]));
            $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, $row["CTIT"]);
            $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, toStr($row["TITULAR"]));
            $objWorkSheet->setCellValueByColumnAndRow(++$icol, $irow, $row["MONTO"]);
        }
        $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
        header('Content-Type: application/vnd.ms-excel');
        header('Content-Disposition: attachment;filename="' . $titulo . '"');
        header('Cache-Control: max-age=0');
        $objWriter->save('php://output');
        break;
}