include "../pdf/fpdf/fpdf.php"; //include "../barcode/barcode.php"; //include "../barcode/bars.php"; $pdf = new FPDF(); $pdf->Open(); $pdf->addPage(); $pdf->setAutoPageBreak(true); $pdf->setFont('Arial', '', 12); $pdf->text(10, 25, 'Tes User DB'); $pdf->Line(10, 31, 198, 31); $yi = 50; $ya = 44; $pdf->setFont('Arial', '', 9); $pdf->setFillColor(222, 222, 222); $pdf->setXY(10, $ya); $pdf->CELL(6, 6, 'ID', 1, 0, 'C', 1); $pdf->CELL(40, 6, 'Username', 1, 0, 'C', 1); $pdf->CELL(50, 6, 'Password', 1, 0, 'C', 1); $ya = $yi + $row; $sql = "SELECT id, password, username FROM user"; $result = $conn->query($sql); $i = 1; $no = 1; $max = 31; //$row = 6; if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $pdf->setXY(10, $ya); $pdf->setFont('arial', '', 9); $pdf->setFillColor(255, 255, 255); $pdf->cell(6, 6, $row["id"], 1, 0, 'C', 1);
$pdf->Cell(0, 5, "Services Availed: ", "", 0, 2, ""); for ($ctr = 0; $ctr < sizeof($serviceSeparate); $ctr++) { $serviceName = "SELECT * FROM services WHERE id = '{$serviceSeparate[$ctr]}'"; $get = mysqli_query($connect, $serviceName); $fetch = mysqli_fetch_assoc($get); $pdf->Cell(0, 10, "", 0, 1, "C"); $pdf->Cell(0, 0, "" . $fetch['service_name'] . "", "", 0, 2, ""); $pdf->Cell(0, 0, " " . $fetch['price'] . ".00", 0, 0, "R"); } $pdf->Cell(0, 5, "", 0, 1, " "); $pdf->Cell(0, 10, " ", 0, 1, "C"); $pdf->Cell(0, 0, "Total:"); $pdf->Cell(0, 0, "" . $row['total_amount'] . ".00", 0, 0, "R"); $pdf->Cell(0, 10, "", 0, 1, "C"); $pdf->Cell(0, 0, "Payment: "); $pdf->CELL(0, 0, " " . $row['payment'] . ".00", 0, 0, "R"); $pdf->Cell(0, 10, "", 0, 1, "C"); $pdf->Cell(0, 0, "Change Due: "); $pdf->Cell(0, 0, " " . $row['change_'] . ".00", 0, 0, "R"); $pdf->Cell(0, 5, "", 0, 1, "C"); $pdf->Cell(0, 0, "___________________________________________________________________", 0, 1, "C"); $pdf->Cell(0, 10, "", 0, 1, "C"); $dateSeparate = explode("/", $row['date']); $dateConnect = " "; for ($ctr = 0; $ctr < sizeof($dateSeparate); $ctr++) { $dateConnect = $dateConnect . $dateSeparate[$ctr]; } $pdf->SetFont("Arial", "", 12); $pdf->Cell(0, 5, "Telephone number: 09XXX-XXXXXX", 0, 2, "C"); $pdf->Cell(0, 1, "", 0, 1, "C"); $pdf->Cell(0, 5, "" . $row['date'] . " ", 0, 1, "C");
function ImprimeCredito($id, $doc) { $data = new pegaso(); $actstatus = $data->ActStatusImpresoCredito($id); $actruta = $data->ActRuta($id, $doc); $datostrans = $data->ObtieneDatosCredito($id); $cabecera = $data->OCL($doc); $detalle = $data->detalleOC($doc); $pdf = new FPDF('P', 'mm', 'Letter'); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 15); $pdf->SetTextColor(198, 23, 23); $pdf->SetXY(180, 5); $pdf->CELL(60, 5, $datostrans->CREDITO); $pdf->Image('app/views/images/headerpdf_cr.jpg', 10, 15, 205, 55); $pdf->SetFont('Arial', 'I', 11); $pdf->SetTextColor(14, 3, 3); $pdf->Ln(80); $pdf->Cell(60, 10, "Fecha: "); $pdf->Cell(60, 10, $datostrans->FECHA); $pdf->Ln(20); $pdf->Cell(60, 10, "Beneficiario: "); $pdf->Cell(60, 10, $datostrans->BENEFICIARIO); $pdf->Ln(20); $pdf->Cell(60, 10, "Documento: "); $pdf->Cell(60, 10, $datostrans->DOCUMENTO); $pdf->Ln(20); $pdf->Cell(60, 10, "Importe: "); $pdf->Cell(60, 10, "\$ " . $datostrans->MONTO); $pdf->Ln(20); $pdf->Cell(60, 10, "Fecha Realizacion: "); $pdf->Cell(60, 10, $datostrans->FECHA_APLI); $pdf->Ln(30); $pdf->Cell(60, 10, "_______________________ _______________________ __________________"); $pdf->Ln(5); $pdf->Cell(60, 10, "Nombre de quien Recibe Firma de Recibido Fecha de Recibo "); //$pdf->Output('Transferencia '.$datostrans->DOCUMENTO .'.pdf', 'i'); /* Falta crear consulta que traiga el número de folio generado */ $pdf->AddPage(); $pdf->Image('app/views/images/headerpdf_cr.jpg', 10, 15, 205, 55); $pdf->SetFont('Arial', 'I', 12); $pdf->Ln(70); foreach ($cabecera as $t) { $tipo = $t->CAMPLIB2; if ($tipo == 'E') { $tipo = 'Entrega'; } elseif ($tipo == 'R') { $tipo = 'Recoleccion'; } else { $tipo = 'No reconocido'; } $pdf->Cell(60, 10, "Fecha: "); $pdf->Cell(60, 10, $t->FECHAELAB); $pdf->Ln(12); $pdf->Cell(60, 10, "Documento: "); $pdf->Cell(60, 10, $t->CVE_DOC); $pdf->Ln(12); $pdf->Cell(60, 10, "Nombre: "); $pdf->Cell(60, 10, $t->NOMBRE); $pdf->Ln(8); $pdf->Cell(60, 10, "Direccion: "); $pdf->Cell(60, 10, $t->CALLE . " No Ext: " . $t->NUMEXT . " No. Int:" . $t->NUMINT . " Colonia: " . $t->COLONIA); $pdf->Ln(8); $pdf->Cell(60, 10, "Direccion 2: "); $pdf->Cell(60, 10, $t->CODIGO . $t->MUNICIPIO . " Telefono :" . $t->TELEFONO); $pdf->Ln(8); $pdf->Cell(60, 10, "Confirmado con: "); $pdf->Cell(60, 10, $t->CAMPLIB4); $pdf->Ln(8); $pdf->Cell(60, 10, "Realizado por: "); $pdf->Cell(60, 10, $tipo); $pdf->Ln(12); } $pdf->SetFont('Times', 'I', 9); $pdf->Cell(20, 7, 'Partida', 1); $pdf->Cell(23, 7, 'Pedido', 1); $pdf->Cell(33, 7, 'Articulo', 1); $pdf->Cell(70, 7, 'Descr', 1); $pdf->Cell(20, 7, 'Cantidad', 1); $pdf->Cell(25, 7, 'Total Partida', 1); $pdf->Ln(); foreach ($detalle as $col) { $pdf->Cell(20, 7, $col->NUM_PAR, 1); $pdf->Cell(23, 7, $col->COTIZA, 1); $pdf->Cell(33, 7, $col->CVE_ART, 1); $pdf->Cell(70, 7, $col->DESCR, 1); $pdf->Cell(20, 7, $col->CANT, 1); $pdf->Cell(25, 7, $col->TOT_PARTIDA, 1); $pdf->Ln(); } foreach ($cabecera as $t1) { $pdf->Output('Transferencia' . $t1->CVE_DOC . '.pdf', 'i'); } }
$pdf->addPage(); $pdf->setFont('Times', 'B', 30, 'C'); $pdf->text(10, 15, 'Dynamic Link Library'); $pdf->setFont('Helvetica', 'I', 20, 'C'); $pdf->text(10, 22.5, 'Perpustakaan Online SMK Negeri 10 Jakarta'); $pdf->setFont('Helvetica', '', 20, 'C'); $pdf->text(10, 32, 'Laporan Buku'); $pdf->text(10, 22.5, 'Perpustakaan Online SMK Negeri 10 Jakarta'); $pdf->setFont('Helvetica', '', 15, 'C'); $pdf->text(10, 39, 'Bulan ' . $_GET[bulan]); $yi = 50; $ya = 44; $pdf->setFont('Arial', '', 9); $pdf->setFillColor(183, 199, 93); $pdf->setXY(10, $ya); $pdf->CELL(10, 6, 'No', 1, 0, 'C', 1); $pdf->CELL(20, 6, 'ID', 1, 0, 'C', 1); $pdf->CELL(80, 6, 'Judul', 1, 0, 'C', 1); $pdf->CELL(60, 6, 'Rak', 1, 0, 'C', 1); $pdf->CELL(20, 6, 'Jumlah', 1, 0, 'C', 1); $ya = $yi + $row; $sql = mysql_query("select*from buku"); $i = 1; $no = 1; $max = 31; $row = 6; while ($data = mysql_fetch_array($sql)) { $rak = mysql_query("select*from rak where id='{$data['rak']}'"); $kar = mysql_fetch_array($rak); if ($ya > 250) { $pdf->addPage();
$sql = mysql_query("select*from peminjaman where tglkembali!='' or denda!=''"); $a = "yang sudah dikembalikan"; } else { $sql = mysql_query("select*from peminjaman"); } } $pdf->text(10, 32, 'Laporan Buku ' . $a); $pdf->text(10, 22.5, 'Perpustakaan Online SMK Negeri 10 Jakarta'); $pdf->setFont('Helvetica', '', 15, 'C'); $pdf->text(10, 39, 'Bulan ' . $_GET[bulan]); $yi = 50; $ya = 44; $pdf->setFont('Arial', '', 9); $pdf->setFillColor(183, 199, 93); $pdf->setXY(10, $ya); $pdf->CELL(8, 6, 'No', 1, 0, 'C', 1); $pdf->CELL(20, 6, 'ID', 1, 0, 'C', 1); $pdf->CELL(50, 6, 'Nama Peminjam', 1, 0, 'C', 1); $pdf->CELL(25, 6, 'Tgl Pinjam', 1, 0, 'C', 1); $pdf->CELL(25, 6, 'Tgl Kembali', 1, 0, 'C', 1); $pdf->CELL(25, 6, 'Sudah Kembali', 1, 0, 'C', 1); $ya = $yi + $row; $i = 1; $no = 1; $max = 31; $row = 6; while ($data = mysql_fetch_array($sql)) { $rak = mysql_query("select*from detail_akun where id_akun='{$data['id_peminjam']}'"); $kar = mysql_fetch_array($rak); if ($ya > 250) { $pdf->addPage();