예제 #1
0
$pdf->Write(5, "Remarks");
$pdf->SetXY(250, 50);
$pdf->Write(5, "System Engr.");
$pdf->Ln(7);
$query = "select * from reports order by report_id asc";
$result = odbc_exec($conn, $query);
$counter = 1;
$total = 0;
while ($data = odbc_fetch_array($result)) {
    $report_id = $data['report_id'];
    $report_date = $data['report_date'];
    $report_location = $data['report_location'];
    $machine = $data['machine'];
    $serial_no = $data['serial_no'];
    $program = $data['program'];
    $problem = $data['problem'];
    $diagnosis = $data['diagnosis'];
    $work_done = $data['work_done'];
    $remarks = $data['remarks'];
    $system_engineer = $data['system_engineer'];
    $pdf->SetFont('Arial', '', 12);
    $pdf->SetX(10);
    $pdf->SetWidths(array(15, 25, 20, 30, 30, 30, 30, 30, 30, 30, 40));
    $pdf->Row(array($counter, $report_date, $report_location, $machine, $serial_no, $program, $problem, $diagnosis, $remarks, $system_engineer));
    $total++;
    $counter++;
}
$pdf->Ln(4);
$pdf->Cell(0, 10, "Total number of record:  " . $total, 0, 1, "R");
$s = $pdf->Output('file.pdf', 'I');
// die();
    } else {
        while (list($idgudang, $namagudang) = mysql_fetch_row($qcb)) {
            $pdf->Cell(4, 0.6, "{$namagudang}", 1, 0, 'C');
        }
    }
}
$pdf->ln();
$pdf->SetFont('Arial', 'B', 9);
$str = "select id, area from gl_area ";
if ($area != '') {
    $str .= " where id='{$area}' ";
}
$str .= "order by area asc ";
$query = mysql_query($str) or die(mysql_error());
while (list($idarea, $namaarea) = mysql_fetch_row($query)) {
    $pdf->SetX(7.25);
    $qcb = mysql_query("select id, gudang from gl_gudang where area = '{$idarea}' order by gudang asc") or die(mysql_error());
    $jqcb = mysql_num_rows($qcb);
    if ($jqcb == '0') {
        $pdf->Cell(1, 1, "", 1, 0, 'C');
    } else {
        while (list($idgudang, $namagudang) = mysql_fetch_row($qcb)) {
            $pdf->Cell(1, 1, "CORP", 1, 0, 'C');
            $pdf->Cell(1, 1, "RTL", 1, 0, 'C');
            $pdf->Cell(1, 1, "TK", 1, 0, 'C');
            $pdf->Cell(1, 1, "UGC", 1, 0, 'C');
        }
    }
}
$h = 0;
$pdf->SetY(7.3);
if ($area != '') {
    $str .= " where id='{$area}' ";
}
$str .= " order by area asc ";
$query = mysql_query($str) or die(mysql_error());
while (list($idarea, $namaarea) = mysql_fetch_row($query)) {
    $pdf->Cell(5, 0.7, "{$namaarea}", 1, 0, 'C');
}
$pdf->Cell(5, 0.7, "TOTAL", 1, 1, 'C');
//ISI TABEL
$pdf->SetFont('Arial', '', 9);
$status = array(1 => 'Corporate', 2 => 'Retail', 3 => 'Tugas Kantor', 4 => 'Ops / UGC');
$no = 1;
$totalkeseluruhan = 0;
foreach ($status as $key => $value) {
    $pdf->SetX(1.5);
    $pdf->Cell(2, 0.7, "{$no}", 1, 0, 'C');
    $pdf->Cell(6, 0.7, "{$value}", 1, 0, 'C');
    $str = "select id, area from gl_area ";
    if ($area != '') {
        $str .= " where id='{$area}' ";
    }
    $str .= " order by area asc ";
    $querysub = mysql_query($str) or die(mysql_error());
    $total = 0;
    while (list($idarea, $namaarea) = mysql_fetch_row($querysub)) {
        list($jmlunit) = mysql_fetch_row(mysql_query("select count(*) from gl_masterkendaraan where area='{$idarea}' and unitstok='{$key}'"));
        if ($jmlunit == 0) {
            $jmlunit = '';
        }
        $pdf->Cell(5, 0.7, "{$jmlunit}", 1, 0, 'C');
예제 #4
0
파일: pdf.php 프로젝트: whissper/order_test
    return iconv('UTF-8', 'windows-1251', $val);
}
$month_rus = array("января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря");
define('FPDF_FONTPATH', './font/');
require './mc_table/mc_table.php';
if (isset($_POST['jsonstring'])) {
    $_SESSION['applydata'] = json_decode($_POST['jsonstring']);
}
if (isset($_GET['getpdf'])) {
    $applyData = $_SESSION['applydata'];
    $pdf = new PDF_MC_Table('P');
    $pdf->SetMargins(25, 10, 10);
    $pdf->AddFont('TimesNewRomanPSMT', '', 'times.php');
    $pdf->AddPage();
    $pdf->SetFont('TimesNewRomanPSMT', '', 12);
    $pdf->SetX(110);
    $pdf->MultiCell(88, 5, sav2_convert("Государственное бюджетное учреждение \n Республики Коми \"Центр по предоставлению \n государственных услуг в сфере \n социальной защиты населения "), 0, 'R');
    $pdf->SetX(110);
    $pdf->SetTextColor(0, 0, 255);
    $pdf->MultiCell(88, 6, sav2_convert($applyData->{'org-town'} . "\""), 'B', 'R');
    $pdf->SetTextColor(0, 0, 0);
    $pdf->Ln();
    $pdf->MultiCell($width, 5, sav2_convert("ЗАЯВЛЕНИЕ \n о признании семьи или одиноко проживающего гражданина \n малоимущими и назначении государственной социальной помощи"), 0, 'C');
    $pdf->Ln();
    $pdf->Cell(6, 5, sav2_convert('от'), 0);
    $pdf->SetTextColor(0, 0, 255);
    $pdf->MultiCell($width, 5, sav2_convert($applyData->{'customer-fio'}), 'B', 'C');
    $pdf->SetTextColor(0, 0, 0);
    $pdf->Cell($width, 5, sav2_convert("(фамилия, имя, отчество)"), 0, 1, 'C');
    $pdf->Cell($width, 6, sav2_convert("зарегистрированного(ой) по месту жительства (месту пребывания) по адресу:"), 0, 1, 'L');
    $pdf->SetTextColor(0, 0, 255);
$pdf->SetFont('Arial', 'B', 12);
$pdf->MultiCell(0, 5, utf8_decode("\nRepública Bolivariana de Venezuela\nUniversidad del Zulia\nFacultad Experimental de Ciencias\nDivisión de Programas Especiales\nSistema de Pasantías\n"), 0, "C", 0);
$pdf->MultiCell(165, 5, utf8_decode("\n\nReporte General"), 0, "C", 0);
$pdf->MultiCell(165, 5, utf8_decode("\n{$rowPer['tipo']} - {$rowPer['anio']}"), 0, "C", 0);
$pdf->Ln();
$inscritos = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id AND periodo.activo = TRUE WHERE pasantia.m01_registrada IS NOT NULL");
$aprobados = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id AND periodo.activo = TRUE WHERE pasantia.aprobada = TRUE");
$reprobados = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id AND periodo.activo = TRUE WHERE pasantia.aprobada = FALSE");
$pdf->Image("logotipo.jpg", 20, 12, -280);
//GENERAR LA TABLA
$pdf->SetXY(57, 70);
$pdf->SetFont('Arial', 'B', 12);
$pdf->SetWidths(array(30, 30, 30));
$pdf->SetAligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
$pdf->Row(array("Inscritos", "Aprobados", "Reprobados"));
$pdf->SetX(57);
$pdf->SetFont('Arial', '', 12);
$pdf->SetWidths(array(30, 30, 30));
$pdf->SetAligns(array('C', 'C', 'C'));
$pdf->Row(array("{$inscritos}", "{$aprobados}", "{$reprobados}"));
//GENERAR LA GRAFICA
$graph = new PieGraph(640, 480);
$graph->SetShadow();
$graph->title->Set("APROBADOS / REPROBADOS");
$graph->title->SetFont(FF_FONT2, FS_BOLD);
if ($aprobados != 0 || $reprobados != 0) {
    $data = array($aprobados, $reprobados);
    $p1 = new PiePlot($data);
    $p1->value->Show(true);
    $p1->SetLegends(array("Aprobados", "Reprobados"));
} else {
    $booking[] = $hasil['booking_date'];
}
//Print_r($booking);
// disini bermain nya
//D 1344 QE
global $q, $s;
$s = 0;
$ketemu = false;
$no = 1;
$max = 30;
//max baris perhalaman
$v = 0;
$query2 = mysql_query("SELECT DISTINCT a.nopolisi,a.tipekendaraan FROM gl_masterkendaraan as a inner join gl_tipekendaraan as b on (a.tipekendaraan = b.id) where a.cabang = {$cabang}") or die(mysql_error());
while (list($nopolisi, $tipekend) = mysql_fetch_row($query2)) {
    //Print_r($nopolisi);
    $pdf->SetX(1);
    if ($v == $max) {
        $pdf->AddPage();
        $pdf->SetXY(1, 3);
        $pdf->SetFont('Arial', 'B', 11);
        $pdf->SetFillColor(125, 125, 125);
        $pdf->SetTextColor(255, 255, 255);
        $pdf->Cell(1, 0.7, "No", 1, 0, 'C', true);
        $pdf->Cell(2.8, 0.7, "UNIT", 1, 0, 'C', true);
        $days = array();
        for ($i = 1; $i <= $num; $i++) {
            $pdf->Cell(0.8, 0.7, "{$i}", 1, 0, 'C', true);
        }
        $pdf->Cell(3.8, 0.7, "CASHIN", 1, 0, 'C', true);
        $pdf->Cell(3.8, 0.7, "CASHOUT", 1, 0, 'C', true);
        $pdf->Cell(3.8, 0.7, "PPN", 1, 1, 'C', true);
$pdf->Cell(3, 1, "Jumlah", 1, 0, 'C');
$pdf->Ln();
$pdf->SetFont('Arial', '', 9);
//Isi
$str = "select id, gudang from gl_gudang ";
if ($area != '') {
    $str .= "where area = '{$area}'";
}
$query = mysql_query($str) or die(mysql_error());
$totdata = mysql_num_rows($query);
if ($totdata == '0') {
    echo "<tr><td colspan='7' align='center'><i>Data belum ada</i></td></tr>";
} else {
    $no = 1;
    while (list($idgudang, $namagudang) = mysql_fetch_row($query)) {
        $pdf->SetX(0.5);
        $pdf->Cell(1, 1, "{$no}", 1, 0, 'C');
        $pdf->Cell(5, 1, "{$namagudang}", 1, 0, 'C');
        list($jumcorporate) = mysql_fetch_row(mysql_query("select count(*) from gl_masterkendaraan where cabang = '{$idgudang}' and unitstok='1'"));
        if ($jumcorporate == '0') {
            $jumcorporate = '';
        }
        $pdf->Cell(3, 1, "{$jumcorporate}", 1, 0, 'C');
        list($jumretail) = mysql_fetch_row(mysql_query("select count(*) from gl_masterkendaraan where cabang = '{$idgudang}' and unitstok='2'"));
        if ($jumretail == '0') {
            $jumretail = '';
        }
        $pdf->Cell(2, 1, "{$jumretail}", 1, 0, 'C');
        list($jumtugaskantor) = mysql_fetch_row(mysql_query("select count(*) from gl_masterkendaraan where cabang = '{$idgudang}' and unitstok='3'"));
        if ($jumtugaskantor == '0') {
            $jumtugaskantor = '';