/** * //Devuelve pdf con datos de reserva * @param Input::get('idEventos') string cadena * * @return Response::make($result)->header('Content-Type', 'application/pdf') */ public function build() { if (Evento::withTrashed()->where('evento_id', '=', Input::get('idEventos'))->count() == 0) { return View::make('pdf.msg'); } $event = Evento::withTrashed()->where('evento_id', '=', Input::get('idEventos'))->first(); $events = Evento::withTrashed()->where('evento_id', '=', Input::get('idEventos'))->get(); $recursos = Evento::where('evento_id', '=', Input::get('idEventos'))->groupby('recurso_id')->get(); setlocale(LC_TIME, 'es_ES@euro', 'es_ES.UTF-8', 'esp'); $strDayWeek = sgrDate::getStrDayWeek($event->fechaEvento); $strDayWeekInicio = sgrDate::getStrDayWeek($event->fechaInicio); $strDayWeekFin = sgrDate::getStrDayWeek($event->fechaFin); $created_at = ucfirst(strftime('%A %d de %B a las %H:%M:%S', strtotime($event->created_at))); $impreso_at = ucfirst(strftime('%A %d de %B a las %H:%M:%S', strtotime('now'))); $html = View::make('pdf.justificante')->with(compact('event', 'events', 'strDayWeek', 'strDayWeekInicio', 'strDayWeekFin', 'recursos', 'created_at', 'impreso_at')); $result = myPDF::getPDF($html, 'comprobante'); return Response::make($result)->header('Content-Type', 'application/pdf'); }
$StayTime = $_POST['StayTime']; $Today = date("j F, Y"); require_once 'tcpdf_include.php'; class myPDF extends TCPDF { public function Footer() { $this->SetY(-15); $this->SetColor('text', 23, 54, 93, false, ''); $this->Cell(180, 0, '5-108 SEIEE BUILDINGS, SHANGHAI JIAO TONG UNIVERSITY,', 0, 1, 'C', false, '', 0); $this->Cell(180, 0, '800 DONGCHUAN ROAD, MINHANG, SHANGHAI 200240, CHINA', 0, 1, 'C', false, '', 0); $this->Cell(180, 0, 'Phone: +86 2134208259 Email: info@acp-conf.org www.acp-conf.org', 0, 1, 'C', false, '', 0); } } // create new PDF document $pdf = new myPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $fontname = $pdf->addTTFfont('font/arial.ttf', 'TrueTypeUnicode', '', 32); // set document information $pdf->SetCreator('2014 ACP Committee'); $pdf->SetAuthor('2014 ACP Committee'); $pdf->SetTitle('Invitation Letter'); $pdf->SetSubject(''); $pdf->SetKeywords(''); // set default header data $pdf->SetHeaderData('header.jpg', PDF_HEADER_LOGO_WIDTH, '' . '', '', array(255, 255, 255), array(255, 255, 255)); $pdf->setFooterData(array(23, 54, 93), array(255, 255, 255)); // set header and footer fonts $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array($fontname, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
case 'ITA': $created = 'Creato il '; $sender = 'Mittente: '; $recipient = 'Destinatario: '; $date = 'Data: '; $title = 'Titolo: '; $page = 'Pagina'; break; default: $created = 'Created on '; $sender = 'Sender: '; $recipient = 'Recipient: '; $date = 'Date: '; $title = 'Title: '; $page = 'Page'; break; } $pdf = new myPDF(); $pdf->SetFooterData($config['site_url'], $page); $pdf->Open(); $pdf->SetAuthor($game->player['user_name']); $pdf->SetTitle($config['site_url']); $pdf->SetAutoPageBreak(true, 15.0); $pdf->AddPage(); $pdf->SetFont('Arial', 'I', 8); $pdf->MultiCell(0, 7, $created . date('d.m.y H:i', time()) . '', 0, 'R'); $pdf->SetFont('Arial', 'B', 16); $pdf->MultiCell(0, 7, '' . $pdf->MultiCell(0, 7, $sender . $sendername['user_name']), $pdf->MultiCell(0, 7, $recipient . $game->player['user_name']), $pdf->MultiCell(0, 7, $date . $time), $pdf->MultiCell(0, 7, $title . $subject)); $pdf->Ln(); $pdf->MultiCell(0, 7, $text, 1); $pdf->Output();
$this->Cell($w[0], 6, $row[0], 'LR', 0, 'L', $fill); $this->Cell($w[1], 6, $row[1], 'LR', 0, 'L', $fill); $this->Cell($w[2], 6, $row[2], 'LR', 0, 'L', $fill); $this->Cell($w[3], 6, $row[3], 'LR', 0, 'L', $fill); $this->Cell($w[4], 6, $row[4], 'LR', 0, 'L', $fill); $this->Cell($w[5], 6, number_format($row[5]), 'LR', 0, 'R', $fill); $this->Ln(); $fill = !$fill; } $this->Cell(array_sum($w), 0, '', 'T'); } } require_once 'connect.php'; $query = "select\n C.ComponentReference,\n C.ComponentValue,\n C.ComponentPartNumber,\n C.ComponentManufacturer,\n C.ComponentFootPrint,\n IFNULL(I.quantity,0) AS quantity\n from \n Inventory as I\n Right Join\n Component as C\n ON\n C.ComponentID = I.ComponentID\n "; $stmt = $conn->prepare($query); if ($stmt->execute()) { $stmt->setFetchMode(PDO::FETCH_ASSOC); } while ($result = $stmt->fetch()) { $data[] = array($result['ComponentReference'], $result['ComponentValue'], $result['ComponentPartNumber'], $result['ComponentManufacturer'], $result['ComponentFootPrint'], $result['quantity']); } date_default_timezone_set('America/Los_Angeles'); $pdf = new myPDF('L', 'mm', 'Letter'); $date = date("m/d/Y h:i A"); $pdf->date = $date; $header = array('Reference', 'Value', 'Part Number', 'Manufacturer', 'Foot Print', 'Quantity On Hand'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->BuildTable($header, $data); $pdf->Output(); $conn = null;
$this->SetFont('Times', '', 12); $w = $this->GetStringWidth($title) + 150; $this->SetDrawColor(0, 0, 180); $this->SetFillColor(230, 0, 230); $this->SetTextColor(0, 0, 255); $this->SetLineWidth(1); $this->Cell($w, 9, $title, 1, 1, 'C', 1); $this->Ln(10); } //Page footer function Footer() { //Position at 1.5 cm from bottom $this->SetY(-15); $this->SetFont('Arial', 'I', 8); $this->Cell(0, 10, 'This is the page footer -> Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C'); } } $title = "FPDF Library Page Header"; $pdf = new myPDF('P', 'mm', 'Letter'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times', '', 24); $pdf->Cell(0, 0, 'some text at the top of the page', 0, 0, 'L'); $pdf->ln(225); $pdf->Cell(0, 0, 'More text toward the bottom', 0, 0, 'C'); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 15); // Cell(W, H, 'text', Border, Return, 'Allign') - basic syntax $pdf->Cell(0, 0, 'Top of page 2 after header', 0, 1, 'C'); $pdf->Output();
$query1 = "SELECT\n Used_OrderID,\n CONCAT_WS(' ',EmployeeFirstName,EmployeeLastName) AS Used_By,\n CONCAT_WS(' ',ToolType,ToolOption,ToolSize,ToolPulsePolarity,ToolNumber) AS Tool_Info,\n Used_OrderDate,\n Used_OrderNotes,\n Used_OrderSubTotal,\n Used_OrderStatus\n FROM\n Used_Order\n LEFT JOIN\n Employee\n ON\n Used_OrderEmployeeID = EmployeeID\n LEFT JOIN\n Tool\n ON\n Used_OrderToolID = ToolID\n WHERE\n Used_OrderID = '{$Used_OrderID}';"; $stmt1 = $conn->prepare($query1); $stmt1->execute(); $result1 = $stmt1->fetch(); $data1[] = array($result1['Used_OrderID'], $result1['Used_By'], $result1['Tool_Info'], $result1['Used_OrderDate'], $result1['Used_OrderNotes'], $result1['Used_OrderStatus']); $subtotal = $result1['Used_OrderSubTotal']; $query = "SELECT\n CONCAT_WS(' ',ComponentReference,ComponentValue,ComponentPartNumber,ComponentManufacturer) AS ComponentSpecs,\n Used_LineQuantity,\n Used_LineCost,\n Used_LineStatus,\n Used_LineDate,\n Used_LineSubTotal,\n ComponentID\n FROM\n Used_Line\n JOIN\n Used_Order\n JOIN\n Component\n WHERE\n Used_LineUsed_OrderID = '{$Used_OrderID}'\n AND\n Used_OrderID = '{$Used_OrderID}'\n AND\n Used_LineComponentID = ComponentID;"; $stmt = $conn->prepare($query); if ($stmt->execute()) { $stmt->setFetchMode(PDO::FETCH_ASSOC); } while ($result = $stmt->fetch()) { $data[] = array($result['ComponentSpecs'], $result['Used_LineQuantity'], $result['Used_LineCost'], $result['Used_LineStatus'], $result['Used_LineDate'], $result['Used_LineSubTotal']); } date_default_timezone_set('America/Los_Angeles'); $pdf = new myPDF('L', 'mm', 'Letter'); $date = date("m/d/Y h:i A"); $pdf->date = $date; $header1 = array('Usage Order #', 'Used By', 'For Tool', 'Date', 'Notes', 'Status'); $header = array('Component Used', 'Quantity Used', 'Cost', 'Status', 'Date Used', 'Subtotal'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetY(35); $pdf->BuildTable1($header1, $data1); $pdf->SetY(55); $pdf->BuildTable($header, $data); $pdf->Ln(6); $substring = " Total Subtotal: \$" . $subtotal . " "; $substrwidth = $pdf->GetStringWidth($substring); $substrX = 260 - $substrwidth; $pdf->SetX($substrX);
public function imprime() { //!!!***Validar parámetros de entrada***!!! //get Input or default $viewActive = Input::get('view', 'month'); $day = Input::get('day', date('d')); $month = Input::get('month', date('m')); $year = Input::get('year', date('Y')); $id_recurso = Input::get('idRecurso', ''); //$id_grupo = Input::get('groupID',''); $id_item = Input::get('item', 0); //Todos los items (equipos o puestos) $titulo = Input::get('titulo', false); $nombre = Input::get('nombre', false); $colectivo = Input::get('colectivo', false); $total = Input::get('total', false); //Total de puestos o equipos de una reserva $datatoprint = array('titulo' => $titulo, 'nombre' => $nombre, 'colectivo' => $colectivo, 'total' => $total); //Información a imprimir seleccionada por el usuario //Output $table = array('tCaption' => '', 'tHead' => '', 'tBody' => ''); $fecha = new DateTime($year . '-' . $month . '-1'); $recurso = Recurso::findOrFail($id_recurso); $sgrRecurso = RecursoFactory::getRecursoInstance($recurso->tipo); $sgrRecurso->setRecurso($recurso); $sgrCalendario = new sgrCalendario($fecha, $sgrRecurso); $table['tCaption'] = CalendarController::caption($viewActive, $day, $sgrCalendario->nombreMes(), $sgrCalendario->year()); switch ($viewActive) { case 'month': $table['tHead'] = CalendarController::head($viewActive, $sgrCalendario); $table['tBody'] = View::make('calendario.printBodyMonth')->with('sgrCalendario', $sgrCalendario)->with('id_recurso', $id_recurso)->with('id_grupo', '')->with('datatoprint', $datatoprint); break; case 'week': $horas = array('8:30', '9:30', '10:30', '11:30', '12:30', '13:30', '14:30', '15:30', '16:30', '17:30', '18:30', '19:30', '20:30', '21:30'); $sgrWeek = $sgrCalendario->sgrWeek(strtotime($year . '-' . $month . '-' . $day)); $table['tHead'] = View::make('calendario.print.weekhead')->with('sgrWeek', $sgrWeek); //$table['tBody'] = View::make('calendario.printBodyWeek')->with('horas',$horas)->with('sgrWeek',$sgrWeek)->with('id_recurso',$id_recurso)->with('id_grupo','')->with('datatoprint',$datatoprint); $table['tBody'] = (string) View::make('calendario.print.weekbody')->with('sgrCalendario', $sgrCalendario); break; default: # code... break; } if (0 != $id_recurso) { $nombre = Recurso::find($id_recurso)->nombre; } else { $recurso = Recurso::where('grupo_id', '=', $id_grupo)->first(); $nombre = $recurso->grupo; } $html = View::make('pdf.calendario')->with(compact('table', 'nombre')); //return $html; $nombreFichero = $day . '-' . $month . '-' . $year . '_' . $nombre; //return $html; $result = myPDF::getPDF($html, $nombreFichero); return Response::make($result)->header('Content-Type', 'application/pdf'); }
$this->ecrire($_REQUEST[$field] . " €"); $this->SetFont('Arial', '', 11); } } } function saison() { $annee = intval(date("Y")); $mois = intval(date("m")); if ($mois < 7) { $annee = $annee - 1; } $annee2 = $annee + 1; return "{$annee}/{$annee2}"; } $pdf = new myPDF('P', 'mm', 'A4'); $pdf->SetMargins(20, 15); $pdf->AddPage(); $pdf->image("../logoaikido.png", 20, 10, 28.1); $pdf->SetFont('Helvetica', 'B', 28); $pdf->Text(89, 15, iconv('UTF-8', 'windows-1252', 'AÏKIDO')); $pdf->Text(65, 25, 'Saint Cyr Club 78'); $pdf->SetFontSize(18); $pdf->Text(90, 35, '(ASCC78)'); $pdf->Text(75, 50, 'FICHE D\'INSCRIPTION'); $pdf->Text(78, 57, 'SAISON ' . saison()); $pdf->SetFont('Arial', '', 11); $pdf->SetXY(20, 70); $pdf->ecrire("Nom: "); $pdf->getValue("nom"); $pdf->SetX(88);
} global $iban; global $swiss_iban; global $bank; global $swiss_bank; global $swiftcode; global $swiss_swiftcode; ///*DEBUG //print_r($data); $var_prename = $data["firstname"]; $var_familyname = $data["lastname"]; $var_street = $data["street"]; $var_plz = $data["plzort"]["postcode"]; $var_city = $data["plzort"]["city"]; // Find out what type of participant we are dealing with (normal=1, Service Team.....) $pdf = new myPDF('P', 'mm', 'A4'); //A4, mm und Hochformat $pdf->AddPage(); //Neue Seite Hinzufuegen $pdf->SetLeftMargin(20); //linker Rand 20 mm $pdf->SetAuthor("Mission-Net"); $pdf->SetCreator("Mission-Net"); $st_pdf_keywords = 'Reg.-No.: ' . $var_registrationnr; $pdf->SetKeywords($st_pdf_keywords); $pdf->SetSubject("Mission-Net Registration"); $pdf->SetTitle("Registration for Mission-Net 2009"); //######################HEADER########### //--------------------------------------- // Information und Logo //---------------------------------------