public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Unit of Measure List'; $pdf->AddPage('P'); $pdf->setFont('Arial', 'B', 12); // definisi font $pdf->setFont('Arial', 'B', 8); // menuliskan tabel $connection = Yii::app()->db; $sql = "select a.uomcode,a.description\r\n from unitofmeasure a"; $command = $connection->createCommand($sql); $dataReader = $command->queryAll(); $pdf->setaligns(array('C', 'C', 'C', 'C')); $pdf->setwidths(array(50, 90)); $pdf->Row(array('Unit of Measure', 'Description')); $pdf->setaligns(array('L', 'L')); foreach ($dataReader as $row1) { $pdf->row(array($row1['uomcode'], $row1['description'])); } // me-render ke browser $pdf->Output('unitofmeasure.pdf', 'D'); }
public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Schedule Master List'; $pdf->AddPage('P'); $pdf->setFont('Arial', 'B', 12); // definisi font $pdf->setFont('Arial', 'B', 8); // menuliskan tabel $connection = Yii::app()->db; $sql = "select a.onleavename, a.cutimax,a.cutistart,b.formatdoc,c.shortstat\r\n from onleavetype a\r\n left join snro b on b.snroid = a.snroid\r\n left join absstatus c on c.absstatusid = a.absstatusid"; $command = $connection->createCommand($sql); $dataReader = $command->queryAll(); $pdf->setaligns(array('C', 'C', 'C', 'C', 'C')); $pdf->setwidths(array(50, 20, 20, 50, 20)); $pdf->Row(array('Onleave', 'Cuti Max', 'Cuti Start', 'Format Doc', 'Cuti Status')); $pdf->setaligns(array('L', 'L', 'L', 'L', 'L')); foreach ($dataReader as $row1) { $pdf->row(array($row1['onleavename'], $row1['cutimax'], $row1['cutistart'], $row1['formatdoc'], $row1['shortstat'])); } // me-render ke browser $pdf->Output('onleavetype.pdf', 'D'); }
public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Material Status List'; $pdf->AddPage('P'); $pdf->setFont('Arial', 'B', 12); // definisi font $pdf->setFont('Arial', 'B', 8); // menuliskan tabel $connection = Yii::app()->db; $sql = "select a.materialstatusname\r\n from materialstatus a"; $command = $connection->createCommand($sql); $dataReader = $command->queryAll(); $pdf->setaligns(array('C', 'C')); $pdf->setwidths(array(50, 70)); $pdf->Row(array('Material Status Name')); $pdf->setaligns(array('L', 'L')); foreach ($dataReader as $row1) { $pdf->row(array($row1['materialstatusname'])); } // me-render ke browser $pdf->Output('materialstatus.pdf', 'D'); }
public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Storage Location List'; $pdf->AddPage('P'); $pdf->setFont('Arial', 'B', 12); // definisi font $pdf->setFont('Arial', 'B', 8); // menuliskan tabel $connection = Yii::app()->db; $sql = "select b.plantcode, a.sloccode, a.description\r\n from sloc a\r\n left join plant b on b.plantid = a.plantid"; $command = $connection->createCommand($sql); $dataReader = $command->queryAll(); $pdf->setaligns(array('C', 'C', 'C', 'C')); $pdf->setwidths(array(30, 30, 70)); $pdf->Row(array('Plant', 'Sloc Code', 'Description')); $pdf->setaligns(array('L', 'L', 'L')); foreach ($dataReader as $row1) { $pdf->row(array($row1['plantcode'], $row1['sloccode'], $row1['description'])); } // me-render ke browser $pdf->Output('sloc.pdf', 'D'); }
public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Employee Informal List'; $pdf->AddPage('P'); $sql1 = "select splettername, description, validperiod\r\n from splettertype a"; $pdf->setFont('Arial', 'B', 8); $connection = Yii::app()->db; $command1 = $connection->createCommand($sql1); $dataReader1 = $command1->queryAll(); $pdf->text(10, 40, 'Course / Trainig / skill List'); $pdf->SetY(45); $pdf->setaligns(array('C', 'C', 'C')); $pdf->setwidths(array(50, 40, 30)); $pdf->Row(array('SP Letter Name', 'Description', 'Period')); $pdf->setaligns(array('L', 'L', 'L')); foreach ($dataReader1 as $row1) { $pdf->row(array($row1['splettername'], $row1['description'], $row1['validperiod'])); } // me-render ke browser $pdf->Output('splettertype.pdf', 'D'); }
public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Schedule Master List'; $pdf->AddPage('P'); $pdf->setFont('Arial', 'B', 12); // definisi font $pdf->setFont('Arial', 'B', 8); // menuliskan tabel $connection = Yii::app()->db; $sql = "select a.employeestatusname, a.taxvalue\r\n from employeestatus a"; $command = $connection->createCommand($sql); $dataReader = $command->queryAll(); $pdf->setaligns(array('C', 'C', 'C', 'C')); $pdf->setwidths(array(50, 30, 30, 30)); $pdf->Row(array('Employee Status', 'Tax Value')); $pdf->setaligns(array('L', 'R', 'C', 'C')); foreach ($dataReader as $row1) { $pdf->row(array($row1['employeestatusname'], $row1['taxvalue'])); } // me-render ke browser $pdf->Output('employeestatus.pdf', 'D'); }
public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Asset List'; $pdf->AddPage('L'); $pdf->setFont('Arial', 'B', 12); // definisi font $pdf->setFont('Arial', 'B', 8); // menuliskan tabel $connection = Yii::app()->db; $sql = "select b.productname,c.sloccode,a.expiredate,a.serialno,a.qty,d.uomcode,a.buydate,\r\n a.buyprice,e.currencyname,a.picproduct,a.location,a.locationdate\r\n from productdetail a\r\n left join product b on b.productid = a.productid\r\n left join sloc c on c.slocid = a.slocid\r\n left join unitofmeasure d on d.unitofmeasureid = a.unitofmeasureid\r\n left join currency e on e.currencyid = a.currencyid"; $command = $connection->createCommand($sql); $dataReader = $command->queryAll(); $pdf->setaligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C')); $pdf->setwidths(array(50, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20)); $pdf->Row(array('Material Name', 'Sloc', 'Expire Date', 'Serial No', 'Qty', 'UOM Code', 'Buy Date', 'Buy Price', 'Currency', 'PIC Product', 'Location', 'Loc Date')); $pdf->setaligns(array('L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L')); foreach ($dataReader as $row1) { $pdf->row(array($row1['productname'], $row1['sloccode'], $row1['expiredate'], $row1['serialno'], $row1['qty'], $row1['uomcode'], $row1['buydate'], $row1['buyprice'], $row1['currencyname'], $row1['picproduct'], $row1['location'], $row1['locationdate'])); } // me-render ke browser $pdf->Output('productdetail.pdf', 'D'); }
public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Material Group List'; $pdf->AddPage('P'); $pdf->setFont('Arial', 'B', 12); // definisi font $pdf->setFont('Arial', 'B', 8); // menuliskan tabel $connection = Yii::app()->db; $sql = "select a.materialgroupcode, a.description,\r\n b.materialgroupcode as parentgroupcode,c.materialtypecode as materialtype\r\n from materialgroup a\r\n left join materialgroup b on b.materialgroupid = a.parentmatgroupid \r\n left join materialtype c on c.materialtypeid = a.materialtypeid"; $command = $connection->createCommand($sql); $dataReader = $command->queryAll(); $pdf->setaligns(array('C', 'C', 'C', 'C')); $pdf->setwidths(array(30, 50, 30, 30)); $pdf->Row(array('Code', 'Material Type', 'Description', 'Parent Group Code')); $pdf->setaligns(array('L', 'L', 'L', 'L')); foreach ($dataReader as $row1) { $pdf->row(array($row1['materialgroupcode'], $row1['description'], $row1['materialtype'], $row1['parentgroupcode'])); } // me-render ke browser $pdf->Output('materialgroup.pdf', 'D'); }
//,"RM /ANY Time of Text", // "Time Replied to RM / ANY","Time CR text","Time Reply to CR", //"Time forward to Boss","Time Approved by Boss" $result = $conn->query($SELECT_po); $width = array(32, 14, 30, 30, 25, 25, 14, 14, 40, 15, 25, 23, 45, 45); $pdf->AddPage(); $y = $pdf->getY(); //echo "<br>".$pdf->getY(); $pdf->Ln(); $pdf->Ln(); $pdf->Ln(); $pdf->Ln(); $pdf->setY($y + 22); // echo "<br>2".$pdf->getY(); $data2 = array(); $pdf->row($width, $head, 1, $data2, $data2); while ($row = $result->fetch_assoc()) { if (empty($engineer[$row['engineer']])) { $engineer[$row['engineer']] = ""; } if (empty($secretary[$row['secretary']])) { $secretary[$row['secretary']] = ""; } $data = array(date("F j, Y", strtotime($row['date_created'])), $row['letter_code'], $row['payment_type'], $row['company_name'], $engineer[$row['engineer']], $secretary[$row['secretary']], $row['po'], $row['jo'], $row['item_description'], $row['page'], $row['supplier'], $row['total_amount']); $SELECT = "select * from po_item_file where trans_no='" . $row['trans_no'] . "' and item!=''"; $result1 = $conn->query($SELECT); $rows = 1; // echo "<br>Rows".$rows; //$y=$pdf->getY(); $width2 = array($width[count($width) - 1]); $data2 = array();
public function actionDownload() { parent::actionDownload(); $pdf = new PDF(); $pdf->title = 'Form Permintaan (Barang/Jasa)'; $pdf->AddPage('P'); $pdf->setFont('Arial', 'B', 12); // definisi font $pdf->setFont('Arial', 'B', 8); // menuliskan tabel $connection = Yii::app()->db; $sql = "select a.dano,a.dadate,a.headernote,a.deliveryadviceid\n from deliveryadvice a\n where deliveryadviceid = " . $_GET['id']; $command = $connection->createCommand($sql); $dataReader = $command->queryAll(); foreach ($dataReader as $row) { $pdf->setFont('Arial', 'B', 8); $pdf->text(10, 30, 'No '); $pdf->text(50, 30, ': ' . $row['dano']); $pdf->text(10, 35, 'Date '); $pdf->text(50, 35, ': ' . $row['dadate']); $pdf->text(10, 40, 'Note '); $pdf->text(50, 40, ': ' . $row['headernote']); $sql1 = "select b.productname, a.qty, c.uomcode, a.itemtext\n from deliveryadvicedetail a\n left join product b on b.productid = a.productid\n left join unitofmeasure c on c.unitofmeasureid = a.unitofmeasureid\n where deliveryadviceid = " . $row['deliveryadviceid']; $command1 = $connection->createCommand($sql1); $dataReader1 = $command1->queryAll(); $pdf->text(10, 50, 'Items'); $pdf->SetY(55); $pdf->setFont('Arial', 'B', 6); $pdf->setaligns(array('C', 'C', 'C', 'C', 'C')); $pdf->setwidths(array(10, 90, 25, 25, 40)); $pdf->setFont('Arial', '', 6); $pdf->Row(array('No', 'Items', 'Qty', 'Unit', 'Remark')); $pdf->setaligns(array('L', 'L', 'L', 'L', 'L')); $i = 0; foreach ($dataReader1 as $row1) { $i = $i + 1; $pdf->row(array($i, $row1['productname'], Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberqty"], $row1['qty']), $row1['uomcode'], $row1['itemtext'])); } $pdf->text(100, $pdf->gety() + 5, 'Jakarta, ' . $row['dadate']); $pdf->text(10, $pdf->gety() + 10, 'Approved By'); $pdf->text(100, $pdf->gety() + 10, 'Proposed By'); $pdf->text(10, $pdf->gety() + 20, '------------ '); $pdf->text(100, $pdf->gety() + 20, '------------'); $pdf->AddPage('P'); } $pdf->Output(); }