public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.grno,a.grdate,a.grheaderid,b.pono,c.fullname\r\n      from grheader a\r\n      left join poheader b on b.poheaderid = a.poheaderid\r\n      left join addressbook c on c.addressbookid = b.addressbookid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.grheaderid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Nota Penerimaan Barang';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     foreach ($dataReader as $row) {
         $this->pdf->setFont('Arial', 'B', 8);
         $this->pdf->text(10, 30, 'No ');
         $this->pdf->text(50, 30, ': ' . $row['grno']);
         $this->pdf->text(10, 35, 'Date ');
         $this->pdf->text(50, 35, ': ' . $row['grdate']);
         $this->pdf->text(10, 40, 'PO No ');
         $this->pdf->text(50, 40, ': ' . $row['pono']);
         $this->pdf->text(10, 45, 'Vendor ');
         $this->pdf->text(50, 45, ': ' . $row['fullname']);
         $sql1 = "select b.productname, a.qty, c.uomcode,d.description\r\n        from grdetail a\r\n        left join product b on b.productid = a.productid\r\n        left join unitofmeasure c on c.unitofmeasureid = a.unitofmeasureid\r\n        left join sloc d on d.slocid = a.slocid\r\n        where grheaderid = " . $row['grheaderid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, 55, 'Items');
         $this->pdf->SetY(60);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C', 'C'));
         $this->pdf->setFont('Arial', 'B', 6);
         $this->pdf->setwidths(array(10, 110, 20, 20, 20, 40));
         $this->pdf->Row(array('No', 'Nama Barang', 'Qty', 'Unit', 'Gudang'));
         $this->pdf->setFont('Arial', '', 6);
         $this->pdf->setaligns(array('L', 'L', 'L', 'L', 'L', 'L'));
         $i = 0;
         foreach ($dataReader1 as $row1) {
             $i = $i + 1;
             $this->pdf->row(array($i, $row1['productname'], Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberqty"], $row1['qty']), $row1['uomcode'], $row1['description']));
         }
         $this->pdf->text(10, $this->pdf->gety() + 10, 'PT SATKOMINDO MEDIYASA');
         $this->pdf->text(50, $this->pdf->gety() + 10, 'PETUGAS GUDANG');
         $this->pdf->text(100, $this->pdf->gety() + 10, 'PENGIRIM');
         $this->pdf->text(150, $this->pdf->gety() + 10, 'PENERIMA');
         $this->pdf->text(10, $this->pdf->gety() + 20, '----------------------');
         $this->pdf->text(50, $this->pdf->gety() + 20, '----------------------');
         $this->pdf->text(100, $this->pdf->gety() + 20, '----------------------');
         $this->pdf->text(150, $this->pdf->gety() + 20, '----------------------');
         $this->pdf->AddPage('P');
     }
     // me-render ke browser
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.dano,a.dadate,a.headernote,a.deliveryadviceid\r\n      from deliveryadvice a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.deliveryadviceid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Form Permintaan (Barang/Jasa)';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     foreach ($dataReader as $row) {
         $this->pdf->setFont('Arial', 'B', 8);
         $this->pdf->text(10, 30, 'No ');
         $this->pdf->text(50, 30, ': ' . $row['dano']);
         $this->pdf->text(10, 35, 'Date ');
         $this->pdf->text(50, 35, ': ' . $row['dadate']);
         $this->pdf->text(10, 40, 'Note ');
         $this->pdf->text(50, 40, ': ' . $row['headernote']);
         $sql1 = "select b.productname, a.qty, c.uomcode, a.itemtext\r\n        from deliveryadvicedetail a\r\n        left join product b on b.productid = a.productid\r\n        left join unitofmeasure c on c.unitofmeasureid = a.unitofmeasureid\r\n        where deliveryadviceid = " . $row['deliveryadviceid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, 50, 'Items');
         $this->pdf->SetY(55);
         $this->pdf->setFont('Arial', 'B', 6);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(10, 90, 25, 25, 40));
         $this->pdf->setFont('Arial', '', 6);
         $this->pdf->Row(array('No', 'Items', 'Qty', 'Unit', 'Remark'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L', 'L'));
         $i = 0;
         foreach ($dataReader1 as $row1) {
             $i = $i + 1;
             $this->pdf->row(array($i, $row1['productname'], Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberqty"], $row1['qty']), $row1['uomcode'], $row1['itemtext']));
         }
         $this->pdf->text(100, $this->pdf->gety() + 5, 'Jakarta, ' . $row['dadate']);
         $this->pdf->text(10, $this->pdf->gety() + 10, 'Approved By');
         $this->pdf->text(100, $this->pdf->gety() + 10, 'Proposed By');
         $this->pdf->text(10, $this->pdf->gety() + 20, '------------ ');
         $this->pdf->text(100, $this->pdf->gety() + 20, '------------');
         $this->pdf->AddPage('P');
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Material Stock Overview List';
     $pdf->AddPage('L');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $header = array('No', 'ID', 'Material Name', 'Sloc', 'Qty', 'UOM', 'Prod Trans Type', 'Ref Source');
     $model = new Productstock('search');
     $dataprovider = $model->search();
     $dataprovider->pagination = false;
     $data = $dataprovider->getData();
     $cols = $dataprovider->getKeys();
     $dataku = array(count($data));
     //var_dump($dataku);
     $w = array(10, 15, 70, 30, 30, 30, 40, 30);
     $pdf->SetTableHeader();
     //Header
     for ($i = 0; $i < count($header); $i++) {
         $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $pdf->Ln();
     $pdf->SetTableData();
     //Data
     $fill = false;
     $i = 0;
     foreach ($data as $datas) {
         $i = $i + 1;
         $pdf->Cell($w[0], 6, $i, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[1], 6, $datas['productstockid'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[2], 6, Product::model()->findbypk($datas['productid'])->productname, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[3], 6, Sloc::model()->findbypk($datas['slocid'])->sloccode, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[4], 6, $datas['qty'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[5], 6, Unitofmeasure::model()->findbypk($datas['unitofmeasureid'])->uomcode, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[6], 6, Prodtranstype::model()->findbypk($datas['prodtranstypeid'])->description, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[7], 6, $datas['refsource'], 'LR', 0, 'L', $fill);
         $pdf->Ln();
         $fill = !$fill;
     }
     $pdf->Cell(array_sum($w), 0, '', 'T');
     // me-render ke browser
     $pdf->Output('productstock.pdf', 'D');
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.*\r\n\t\t\t\tfrom translock a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.translockid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Transaction Lock List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 40, 40, 40));
     $this->pdf->Row(array('Menu Name', 'ID', 'Locked By', 'Locked Date'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['menuname'], $row1['tableid'], $row1['lockedby'], $row1['lockeddate']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.*\r\n\t\t\t\tfrom translog a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.translogid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Translog List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 30, 30, 30, 30, 30));
     $this->pdf->Row(array('User Name', 'Model', 'User Action', 'Field Name', 'Field New Value', 'Field Old Value'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['username'], $row1['model'], $row1['useraction'], $row1['fieldname'], $row1['fieldnewvalue'], $row1['fieldoldvalue']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.invoiceapid,a.fullname, a.oldnik, b.levelorgname, c.structurename,d.positionname,e.invoiceaptypename,\r\n        f.sexname,joindate,email,phoneno,alternateemail,hpno,a.addressbookid,a.accountno,a.taxno,g.maritalstatusname,\r\n        h.religionname,a.birthdate,i.cityname\r\n      from invoiceap a\r\n      left join levelorg b on b.levelorgid = a.levelorgid\r\n      left join orgstructure c on c.orgstructureid = a.orgstructureid\r\n      left join position d on d.positionid = a.positionid\r\n      left join invoiceaptype e on e.invoiceaptypeid = a.invoiceaptypeid\r\n      left join sex f on f.sexid = a.sexid\r\n      left join maritalstatus g on g.maritalstatusid = a.maritalstatusid\r\n      left join religion h on h.religionid = a.religionid\r\n      left join city i on i.cityid = a.birthcityid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.invoiceapid = " . $_GET['id'];
     }
     $sql = $sql . " order by invoiceapid";
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Invoiceap List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     foreach ($dataReader as $row) {
         if (file_exists($_SERVER['DOCUMENT_ROOT'] . Yii::app()->request->baseUrl . '/images/invoiceap/photo-' . $row['oldnik'] . '.jpg')) {
             $this->pdf->Image($_SERVER['DOCUMENT_ROOT'] . Yii::app()->request->baseUrl . '/images/invoiceap/photo-' . $row['oldnik'] . '.jpg', 10, 30, 30);
         }
         $this->pdf->setFont('Arial', 'B', 10);
         $this->pdf->text(50, 30, 'Nama: ' . $row['fullname']);
         $this->pdf->setFont('Arial', '', 8);
         $this->pdf->text(50, 35, 'Posisi: ' . $row['positionname']);
         $this->pdf->text(50, 40, 'Struktur: ' . $row['structurename']);
         $this->pdf->text(50, 45, 'Golongan: ' . $row['levelorgname']);
         $this->pdf->text(50, 50, 'Tempat Tanggal Lahir: ' . $row['cityname'] . ', ' . date(Yii::app()->params['dateviewfromdb'], strtotime($row['birthdate'])));
         $this->pdf->text(50, 55, 'Jenis Kelamin: ' . $row['sexname']);
         $this->pdf->text(50, 60, 'Marital Status: ' . $row['maritalstatusname']);
         $this->pdf->text(50, 65, 'Agama: ' . $row['religionname']);
         $this->pdf->text(50, 70, 'Telp: ' . $row['phoneno']);
         $this->pdf->text(50, 75, 'No HP: ' . $row['hpno']);
         $this->pdf->text(50, 80, 'Email Utama: ' . $row['email']);
         $this->pdf->text(50, 85, 'Email ke-2: ' . $row['alternateemail']);
         $this->pdf->text(50, 90, 'No Rekening: ' . $row['accountno']);
         $this->pdf->text(50, 95, 'NPWP: ' . $row['taxno']);
         $sql1 = "select b.addresstypename, a.addressname, c.cityname, a.phoneno\r\n        from address a\r\n        left join addresstype b on b.addresstypeid = a.addresstypeid\r\n        left join city c on c.cityid = a.cityid\r\n        where addressbookid = " . $row['addressbookid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, 100, 'Address List');
         $this->pdf->SetY(105);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(50, 50, 50, 30));
         $this->pdf->Row(array('Address Type', 'Address', 'City', 'Phone No'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['addresstypename'], $row1['addressname'], $row1['cityname'], $row1['phoneno']));
         }
         $sql1 = "select b.educationname, a.schoolname, a.schooldegree, c.cityname, a.yeargraduate\r\n        from invoiceapeducation a\r\n        left join education b on b.educationid = a.educationid\r\n        left join city c on c.cityid = a.cityid\r\n        where invoiceapid = " . $row['invoiceapid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, $this->pdf->gety() + 10, 'Education List');
         $this->pdf->sety($this->pdf->gety() + 15);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(50, 50, 30, 30, 30));
         $this->pdf->Row(array('Degree', 'School/Institut', 'Education Major', 'City', 'Year Graduate'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['educationname'], $row1['schoolname'], $row1['schooldegree'], $row1['cityname'], $row1['yeargraduate']));
         }
         $sql1 = "select a.informalname,a.organizer,a.period\r\n        from invoiceapinformal a\r\n        where invoiceapid = " . $row['invoiceapid'] . " and iswo=0";
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, $this->pdf->gety() + 10, 'Informal List');
         $this->pdf->sety($this->pdf->gety() + 15);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(60, 40, 50));
         $this->pdf->Row(array('Course / Training / Skill', 'Organizer', 'Period'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['informalname'], $row1['organizer'], $row1['period']));
         }
         $sql1 = "select a.informalname,a.organizer,a.period,a.sponsoredby\r\n        from invoiceapinformal a\r\n        where invoiceapid = " . $row['invoiceapid'] . " and iswo=1";
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, $this->pdf->gety() + 10, 'Working Experience List');
         $this->pdf->sety($this->pdf->gety() + 15);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(80, 30, 30, 50));
         $this->pdf->Row(array('Company', 'Golongan', 'Position', 'Period'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['informalname'], $row1['sponsoredby'], $row1['organizer'], $row1['period']));
         }
         $sql1 = "select b.familyrelationname, a.familyname, c.cityname,\r\n        d.sexname, a.birthdate, e.educationname, f.occupationname\r\n        from invoiceapfamily a\r\n        left join familyrelation b on b.familyrelationid = a.familyrelationid\r\n        left join city c on c.cityid = a.cityid\r\n        left join sex d on d.sexid = a.sexid\r\n        left join education e on e.educationid = a.educationid\r\n        left join occupation f on f.occupationid = a.occupationid\r\n        where invoiceapid = " . $row['invoiceapid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, $this->pdf->gety() + 10, 'Family Member');
         $this->pdf->sety($this->pdf->gety() + 15);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(50, 40, 30, 40, 30, 30, 30));
         $this->pdf->Row(array('Family Relation', 'Family Name', 'Sex', 'Occupation'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['familyrelationname'], $row1['familyname'], $row1['sexname'], $row1['occupationname']));
         }
         $sql1 = "select b.identitytypename, a.identityname\r\n        from invoiceapidentity a\r\n        left join identitytype b on b.identitytypeid = a.identitytypeid\r\n        where a.invoiceapid = " . $row['invoiceapid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, $this->pdf->gety() + 10, 'Identity List');
         $this->pdf->sety($this->pdf->gety() + 15);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(60, 50));
         $this->pdf->Row(array('Identity Type', 'Identity Name'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['identitytypename'], $row1['identityname']));
         }
         $sql1 = "select b.languagename,c.languagevaluename\r\n        from invoiceapforeignlanguage a\r\n        left join language b on b.languageid = a.languageid\r\n        left join languagevalue c on c.languagevalueid = a.languagevalueid\r\n        where a.invoiceapid = " . $row['invoiceapid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, $this->pdf->gety() + 10, 'Language Skill');
         $this->pdf->sety($this->pdf->gety() + 15);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(60, 50));
         $this->pdf->Row(array('Language', 'Language Value'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['languagename'], $row1['languagevaluename']));
         }
         $this->pdf->AddPage('P');
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select period\r\n\t\t\t\tfrom accperiod a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.accperiodid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Account Period List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C'));
     $this->pdf->setwidths(array(90));
     $this->pdf->Row(array('Account Period'));
     $this->pdf->setaligns(array('L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['period']));
     }
     // me-render ke browser
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "SELECT s.snrodid, a.description, s.curdd, s.curmm, s.curyy, s.curvalue, \r\n\t\ts.curcc, s.curpt, s.curpp\r\nFROM snrodet s\r\nleft join snro a on a.snroid = s.snroid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.snrodid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'SNRO Detail List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 20, 20, 20, 20, 20, 20, 20));
     $this->pdf->Row(array('SNRO', 'DD', 'MM', 'YY', 'CC', 'PT', 'PP', 'Value'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L', 'L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['description'], $row1['curdd'], $row1['curmm'], $row1['curyy'], $row1['curcc'], $row1['curpt'], $row1['curpp'], $row1['curvalue']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select maritalstatusname\r\n      from maritalstatus a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.maritalstatusid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Marital Status List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C'));
     $this->pdf->setwidths(array(90));
     $this->pdf->Row(array('Marital Status'));
     $this->pdf->setaligns(array('L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['maritalstatusname']));
     }
     // me-render ke browser
     $this->pdf->Output();
 }
 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();
     $sql = "select SELECT a.accounttypeid,a.accounttypename,b.accounttypename as parentaccounttypename,a.recordstatus\r\nFROM accounttype a\r\nleft join accounttype b on b.accounttypeid = a.parentaccounttypeid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.accounttypeid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Account Type List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(60, 60, 40, 40));
     $this->pdf->Row(array('Account Type', 'Parent Account Name'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['accounttypename'], $row1['parentaccounttypename']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     Yii::import('application.extensions.fpdf.*');
     require_once "pdf.php";
     $pdf = new PDF();
     $pdf->title = 'Insurance List';
     $pdf->AddPage('P');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $header = array('No', 'ID', 'Insurance Name');
     $dataprovider = Insurance::model()->searchwstatus();
     $dataprovider->pagination = false;
     $data = $dataprovider->getData();
     //var_dump(count($data));
     $w = array(10, 25, 70);
     $pdf->SetTableHeader();
     //Header
     for ($i = 0; $i < count($header); $i++) {
         $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $pdf->Ln();
     $pdf->SetTableData();
     //Data
     $fill = false;
     $i = 0;
     foreach ($data as $datas) {
         $i = $i + 1;
         $pdf->Cell($w[0], 6, $i, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[1], 6, $datas['addressbookid'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[2], 6, $datas['fullname'], 'LR', 0, 'L', $fill);
         $pdf->Ln();
         $fill = !$fill;
     }
     $pdf->Cell(array_sum($w), 0, '', 'T');
     // me-render ke browser
     $pdf->Output('insurance.pdf', 'D');
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $pdf = new PDF();
     $pdf->title = 'Purchasing Group List';
     $pdf->AddPage('P');
     $pdf->setFont('Arial', 'B', 12);
     // definisi font
     $pdf->setFont('Arial', 'B', 8);
     // menuliskan tabel
     $header = array('No', 'ID', 'Purchasing Organization', 'Purchasing Group Code', 'Description');
     $model = new Purchasinggroup('searchwstatus');
     $dataprovider = $model->searchwstatus();
     $dataprovider->pagination = false;
     $data = $dataprovider->getData();
     $cols = $dataprovider->getKeys();
     $dataku = array(count($data));
     //var_dump($dataku);
     $w = array(10, 15, 50, 40, 70);
     $pdf->SetTableHeader();
     //Header
     for ($i = 0; $i < count($header); $i++) {
         $pdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $pdf->Ln();
     $pdf->SetTableData();
     //Data
     $fill = false;
     $i = 0;
     foreach ($data as $datas) {
         $i = $i + 1;
         $pdf->Cell($w[0], 6, $i, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[1], 6, $datas['purchasinggroupid'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[2], 6, Purchasingorg::model()->findbypk($datas['purchasingorgid'])->purchasingorgcode, 'LR', 0, 'L', $fill);
         $pdf->Cell($w[3], 6, $datas['purchasinggroupcode'], 'LR', 0, 'L', $fill);
         $pdf->Cell($w[4], 6, $datas['description'], 'LR', 0, 'L', $fill);
         $pdf->Ln();
         $fill = !$fill;
     }
     $pdf->Cell(array_sum($w), 0, '', 'T');
     // me-render ke browser
     $pdf->Output('purchasinggroup.pdf', 'D');
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.purchasingorgcode, a.description\r\n      from purchasingorg a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.purchasingorgid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Purchasing Organization List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C'));
     $this->pdf->setwidths(array(50, 70));
     $this->pdf->Row(array('Purchasing Organization Code', 'Description'));
     $this->pdf->setaligns(array('L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['purchasingorgcode'], $row1['description']));
     }
     // me-render ke browser
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select b.menuname, a.menuobject\r\n\t\t\t\tfrom menuauth a \r\n\t\t\t\tleft join menuaccess b on b.menuaccessid = a.menuaccessid";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.menuauthid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Menu Object Authentication List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 40, 40, 60));
     $this->pdf->Row(array('Menu Name', 'Menu Object'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['menuname'], $row1['menuobject']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.catalogsysid,b.languagename,a.catalogname,a.catalogval,a.recordstatus\r\nfrom catalogsys a\r\nleft join language b on b.languageid=a.languageid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.catalogsysid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Catalog Translation System List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 40, 90, 40));
     $this->pdf->Row(array('Language', 'Catalog Name', 'Catalog Value'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['languagename'], $row1['catalogname'], $row1['catalogval']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.wfname, a.wfdesc, a.wfminstat, a.wfmaxstat\r\n\t\t\t\tfrom workflow a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.workflowid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Workflow List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 40, 40, 40));
     $this->pdf->Row(array('Workflow', 'Description', 'Min Stat', 'Max Stat'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['wfname'], $row1['wfdesc']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.employeeid,a.fullname, a.oldnik, b.levelorgname, c.structurename,d.positionname,e.employeetypename,\r\n        f.sexname,joindate,email,phoneno,alternateemail,hpno,a.addressbookid\r\n      from employee a\r\n      left join levelorg b on b.levelorgid = a.levelorgid\r\n      left join orgstructure c on c.orgstructureid = a.orgstructureid\r\n      left join position d on d.positionid = a.positionid\r\n      left join employeetype e on e.employeetypeid = a.employeetypeid\r\n      left join sex f on f.sexid = a.sexid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.employeeid = " . $_GET['id'];
     }
     $sql = $sql . " order by employeeid ";
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Employee List';
     $this->pdf->AddPage('L');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     foreach ($dataReader as $row) {
         if (file_exists($_SERVER['DOCUMENT_ROOT'] . Yii::app()->request->baseUrl . '/images/employee/photo-' . $row['oldnik'] . '.jpg')) {
             $this->pdf->Image($_SERVER['DOCUMENT_ROOT'] . Yii::app()->request->baseUrl . '/images/employee/photo-' . $row['oldnik'] . '.jpg', 10, 30, 30);
         }
         $this->pdf->setFont('Arial', 'B', 10);
         $this->pdf->text(50, 30, 'Nama: ' . $row['fullname']);
         $this->pdf->setFont('Arial', '', 8);
         $this->pdf->text(50, 35, 'Golongan: ' . $row['levelorgname']);
         $this->pdf->text(50, 40, 'Struktur: ' . $row['structurename']);
         $this->pdf->text(50, 45, 'Posisi: ' . $row['positionname']);
         $this->pdf->text(50, 50, 'Jenis Kelamin: ' . $row['sexname']);
         $this->pdf->text(50, 55, 'Email Utama: ' . $row['email']);
         $this->pdf->text(50, 65, 'Email ke-2: ' . $row['alternateemail']);
         $this->pdf->text(50, 70, 'Telp: ' . $row['phoneno']);
         $this->pdf->text(50, 75, 'No HP: ' . $row['hpno']);
         $sql1 = "select month,year,getschednamebyschedid(d1) as vd1,\r\n        getschednamebyschedid(d2) as vd2,\r\n        getschednamebyschedid(d3) as vd3,\r\n        getschednamebyschedid(d4) as vd4,\r\n        getschednamebyschedid(d5) as vd5,\r\n        getschednamebyschedid(d6) as vd6,\r\n        getschednamebyschedid(d7) as vd7,\r\n        getschednamebyschedid(d8) as vd8,\r\n        getschednamebyschedid(d9) as vd9,\r\n        getschednamebyschedid(d10) as vd10,\r\n        getschednamebyschedid(d11) as vd11,\r\n        getschednamebyschedid(d12) as vd12,\r\n        getschednamebyschedid(d13) as vd13,\r\n        getschednamebyschedid(d14) as vd14,\r\n        getschednamebyschedid(d15) as vd15,\r\n        getschednamebyschedid(d16) as vd16,\r\n        getschednamebyschedid(d17) as vd17,\r\n        getschednamebyschedid(d18) as vd18,\r\n        getschednamebyschedid(d19) as vd19,\r\n        getschednamebyschedid(d20) as vd20,\r\n        getschednamebyschedid(d21) as vd21,\r\n        getschednamebyschedid(d22) as vd22,\r\n        getschednamebyschedid(d23) as vd23,\r\n        getschednamebyschedid(d24) as vd24,\r\n        getschednamebyschedid(d25) as vd25,\r\n        getschednamebyschedid(d26) as vd26,\r\n        getschednamebyschedid(d27) as vd27,\r\n        getschednamebyschedid(d28) as vd28,\r\n        getschednamebyschedid(d29) as vd29,\r\n        getschednamebyschedid(d30) as vd30,\r\n        getschednamebyschedid(d31) as vd31\r\n        from employeeschedule a\r\n        where employeeid = " . $row['employeeid'] . " order by year desc, month desc";
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->text(10, 90, 'Schedule List');
         $this->pdf->SetY(95);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(10, 10, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8));
         $this->pdf->Row(array('Month', 'Year', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['month'], $row1['year'], $row1['vd1'], $row1['vd2'], $row1['vd3'], $row1['vd4'], $row1['vd5'], $row1['vd6'], $row1['vd7'], $row1['vd8'], $row1['vd9'], $row1['vd10'], $row1['vd11'], $row1['vd12'], $row1['vd13'], $row1['vd14'], $row1['vd15'], $row1['vd16'], $row1['vd17'], $row1['vd18'], $row1['vd19'], $row1['vd20'], $row1['vd21'], $row1['vd22'], $row1['vd23'], $row1['vd24'], $row1['vd25'], $row1['vd26'], $row1['vd27'], $row1['vd28'], $row1['vd29'], $row1['vd30'], $row1['vd31']));
         }
         $this->pdf->AddPage('L');
     }
     // me-render ke browser
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.description, a.formatdoc, a.formatno, a.repeatby\r\n\t\t\t\tfrom snro a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.snroid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'SNRO List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 40, 40, 40));
     $this->pdf->Row(array('Description', 'Format Doc', 'Format No', 'Repeat By'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['description'], $row1['formatdoc'], $row1['formatno'], $row1['repeatby']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.groupname\r\n\t\t\t\tfrom groupaccess a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.groupaccessid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Group Access List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 40, 40, 40));
     $this->pdf->Row(array('Group Name'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['groupname']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select b.educationname, a.educationmajorname\r\n      from educationmajor a\r\n      inner join education b on b.educationid = a.educationid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.educationmajorid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Education Major List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C'));
     $this->pdf->setwidths(array(90, 90));
     $this->pdf->Row(array('Education', 'Education Major'));
     $this->pdf->setaligns(array('L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['educationname'], $row1['educationmajorname']));
     }
     // me-render ke browser
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select b.wfname, a.wfstat, a.wfstatusname\r\n\t\t\t\tfrom wfstatus a\r\n\t\t\t\tleft join workflow b on b.workflowid = a.workflowid\t";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.wfstatusid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Workflow Status List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 40, 40, 40));
     $this->pdf->Row(array('Workflow', 'Workflow Status (Number)', 'Workflow Status (Text)'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['wfname'], $row1['wfstat'], $row1['wfstatusname']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select b.invoiceid,fakturpajakno,fullname,invoicedate,\r\n\t\t\t\t(select addressname as custaddress from address z where z.addressbookid = c.addressbookid limit 1) as addressname,\r\n\t\t\t\t(select cityname from city y left join address x on x.cityid = y.cityid where x.addressbookid = c.addressbookid limit 1) as cityname,\r\n\t\t\t\tc.taxno,d.taxvalue,\r\n\t\t\t\t(select companyname from company limit 1) as companyname,\r\n\t\t\t\t(select address from company limit 1) as companyaddressname,\r\n\t\t\t\t(select cityname from company w left join city v on v.cityid = w.cityid limit 1) as companycityname,\r\n\t\t\t\t(select taxno from company limit 1) as companytaxno\r\n\t\t\tfrom fakturpajak a\r\n\t\t\tleft join invoice b on b.invoiceid = a.invoiceid\r\n\t\t\tleft join addressbook c on c.addressbookid = b.addressbookid \r\n\t\t\tleft join tax d on d.taxid = b.taxid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.fakturpajakid = " . $_GET['id'];
     }
     $sql = $sql . " order by fakturpajakid";
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->isheader = false;
     $this->pdf->AddPage('P');
     foreach ($dataReader as $row) {
         $this->pdf->setFont('Arial', '', 6);
         $this->pdf->rect(115, 5, 75, 18);
         $this->pdf->text(120, 10, 'Lembar ke-1 : Untuk Pembeli BKP/Penerima JKP (putih)');
         $this->pdf->text(120, 15, 'Lembar ke-2 : Untuk PKP yang menerbitkan faktur pajak (merah)');
         $this->pdf->text(120, 20, 'Lembar ke-3 : Extra copy (kuning)');
         $this->pdf->setFont('Arial', 'B', 12);
         $this->pdf->text(50, 30, 'FAKTUR PAJAK');
         $this->pdf->setFont('Arial', '', 8);
         $this->pdf->rect(10, 35, 180, 6);
         $this->pdf->text(12, 39, 'Kode dan Nomor Seri Faktur Pajak : ' . $row['fakturpajakno']);
         $this->pdf->rect(10, 41, 180, 6);
         $this->pdf->text(12, 45, 'Pengusaha Kena Pajak');
         $this->pdf->rect(10, 47, 180, 20);
         $this->pdf->text(12, 51, 'N a m a');
         $this->pdf->text(50, 51, ':');
         $this->pdf->text(60, 51, $row['companyname']);
         $this->pdf->text(12, 56, 'A l a m a t');
         $this->pdf->text(50, 56, ':');
         $this->pdf->text(60, 56, $row['companyaddressname']);
         $this->pdf->text(12, 61, '');
         $this->pdf->text(50, 61, '');
         $this->pdf->text(60, 61, $row['companycityname']);
         $this->pdf->text(12, 66, 'NPWP');
         $this->pdf->text(50, 66, ':');
         $this->pdf->text(60, 66, $row['companytaxno']);
         $this->pdf->rect(10, 67, 180, 6);
         $this->pdf->text(12, 71, 'Pembeli Barang Kena Pajak / Penerima Jasa Kena Pajak');
         $this->pdf->rect(10, 73, 180, 22);
         $this->pdf->text(12, 78, 'N a m a');
         $this->pdf->text(50, 78, ':');
         $this->pdf->text(60, 78, $row['fullname']);
         $this->pdf->text(12, 83, 'A l a m a t');
         $this->pdf->text(50, 83, ':');
         $this->pdf->text(60, 83, $row['addressname']);
         $this->pdf->text(12, 88, '');
         $this->pdf->text(50, 88, '');
         $this->pdf->text(60, 88, $row['cityname']);
         $this->pdf->text(12, 93, 'NPWP');
         $this->pdf->text(50, 93, ':');
         $this->pdf->text(60, 93, $row['taxno']);
         $sql1 = "select itemname,qty,uomcode,price,currencyname,rate,a.description,\r\n\t    price * " . $row['taxvalue'] . "/100 as taxvalue\r\n        from invoicedet a\r\n\t\tleft join currency b on b.currencyid = a.currencyid\r\n\t\tleft join unitofmeasure c on c.unitofmeasureid = a.unitofmeasureid\r\n        where invoiceid = " . $row['invoiceid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->SetY($this->pdf->gety() + 85);
         $this->pdf->setFont('Arial', 'B', 8);
         $this->pdf->setaligns(array('C', 'C', 'C'));
         $this->pdf->setwidths(array(20, 90, 70));
         $this->pdf->setbordercell(array('LTRB', 'LTRB', 'LTRB'));
         $this->pdf->Row(array('No Urut', 'Nama Barang Kena Pajak / Jasa Kena Pajak', 'Harga Jual/Penggantian/Uang Muka/Termin'));
         $this->pdf->setFont('Arial', '', 8);
         $this->pdf->setaligns(array('L', 'L', 'R'));
         $this->pdf->setbordercell(array('LR', 'LR', 'LR'));
         $total = 0;
         $i = 0;
         foreach ($dataReader1 as $row1) {
             $i = $i + 1;
             $this->pdf->row(array($i, $row1['itemname'], 'Rp.' . Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberprice"], $row1['price'])));
             $total = $total + $row1['price'];
         }
         for ($i = 0; $i < 10; $i++) {
             $this->pdf->row(array(' ', ' ', ' '));
         }
         $this->pdf->setbordercell(array('LTB', 'TRB', 'LTRB'));
         $this->pdf->row(array('', 'Harga Jual/Penggantian/Uang Muka/Termin**)', 'Rp.' . Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberprice"], $total)));
         $this->pdf->row(array('', 'Dikurangi Potongan Harga', '-'));
         $this->pdf->row(array('', 'Dikurangi Uang Muka yang telah diterima', '-'));
         $this->pdf->row(array('', 'Dasar Pengenaan Pajak', 'Rp.' . Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberprice"], $total)));
         $this->pdf->row(array('', 'PPN = 10% x Dasar Pengenaan Pajak', 'Rp.' . Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberprice"], $total * $row['taxvalue'] / 100)));
         $this->pdf->sety($this->pdf->gety() + 10);
         $this->pdf->text(12, $this->pdf->gety(), 'Pajak Penjualan Atas Barang Mewah');
         $this->pdf->text(150, $this->pdf->gety(), 'Jakarta, tgl ' . date(Yii::app()->params['dateviewfromdb'], strtotime($row['invoicedate'])));
         $this->pdf->sety($this->pdf->gety() + 10);
         $this->pdf->setaligns(array('C', 'C', 'C'));
         $this->pdf->setwidths(array(15, 15, 15));
         $this->pdf->setbordercell(array('LTRB', 'LTRB', 'LTRB'));
         $this->pdf->Row(array('Tarif', 'DPP', 'PPnBM'));
         $this->pdf->setbordercell(array('LR', 'LR', 'LR'));
         $this->pdf->Row(array('.........%', 'Rp........', 'Rp........'));
         $this->pdf->Row(array('.........%', 'Rp........', 'Rp........'));
         $this->pdf->Row(array('.........%', 'Rp........', 'Rp........'));
         $this->pdf->Row(array('.........%', 'Rp........', 'Rp........'));
         $this->pdf->setbordercell(array('LTB', 'RTB', 'LRTB'));
         $this->pdf->Row(array('Jumlah', '', 'Rp........'));
         $this->pdf->text(12, $this->pdf->gety() + 20, '**) Coret yang tidak perlu');
         $this->pdf->text(150, $this->pdf->gety(), 'Nama        Maya Dhamayanti');
         $this->pdf->text(150, $this->pdf->gety() + 5, 'Jabatan     Accounting');
         /*  $this->pdf->rect(10,$this->pdf->gety()+5,20,5);$this->pdf->rect(30,$this->pdf->gety()+5,20,5);$this->pdf->rect(50,$this->pdf->gety()+5,20,5);
               $this->pdf->text(12,$this->pdf->gety()+8,'Tarif');$this->pdf->text(32,$this->pdf->gety()+8,'DPP');$this->pdf->text(52,$this->pdf->gety()+8,'PPnBM');
                 $this->pdf->rect(10,$this->pdf->gety()+10,20,5);$this->pdf->rect(30,$this->pdf->gety()+10,20,5);$this->pdf->rect(50,$this->pdf->gety()+10,20,5);
               $this->pdf->text(12,$this->pdf->gety()+8,'Tarif');$this->pdf->text(32,$this->pdf->gety()+8,'DPP');$this->pdf->text(52,$this->pdf->gety()+8,'PPnBM');
         */
         $this->pdf->AddPage('P');
     }
     $this->pdf->Output();
 }
 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();
     $sql = "select facilitytypename,recordstatus from facilitytype ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.facilitytypeid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Facility Type List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C'));
     $this->pdf->setwidths(array(50, 50, 50, 30));
     $this->pdf->Row(array('Facility Type'));
     $this->pdf->setaligns(array('L', 'C'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['facilitytypename']));
     }
     // me-render ke browser
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select invoiceid,invoiceno,sono,fullname,amount,currencyname,rate,invoicedate,headernote, taxvalue,\r\n\t   (select addressname from address e where e.addressbookid = a.addressbookid limit 1) as addressname,\r\n\t   (select cityname from address e left join city f on f.cityid = e.cityid where e.addressbookid = a.addressbookid limit 1) as cityname\r\n\t\tfrom invoice a \r\n\t\tleft join currency b on b.currencyid = a.currencyid \r\n\t\tleft join tax c on c.taxid = a.taxid \r\n\t\tleft join addressbook d on d.addressbookid = a.addressbookid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.invoiceid = " . $_GET['id'];
     }
     $sql = $sql . " order by invoiceid";
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Invoice';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     foreach ($dataReader as $row) {
         $this->pdf->rect(10, 40, 190, 10);
         $this->pdf->setFont('Arial', 'B', 10);
         $this->pdf->text(20, 45, 'No: ' . $row['invoiceno']);
         $this->pdf->text(150, 45, 'Tanggal: ' . date(Yii::app()->params['dateviewfromdb'], strtotime($row['invoicedate'])));
         $this->pdf->rect(10, 50, 190, 20);
         $this->pdf->setFont('Arial', '', 10);
         $this->pdf->text(20, 55, 'Customer: ' . $row['fullname']);
         $this->pdf->text(20, 60, '' . $row['addressname']);
         $this->pdf->text(20, 65, '' . $row['cityname']);
         $sql1 = "select itemname,qty,uomcode,price,currencyname,rate,a.description,\r\n\t    price * " . $row['taxvalue'] . "/100 as taxvalue\r\n        from invoicedet a\r\n\t\tleft join currency b on b.currencyid = a.currencyid\r\n\t\tleft join unitofmeasure c on c.unitofmeasureid = a.unitofmeasureid\r\n        where invoiceid = " . $row['invoiceid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->SetY($this->pdf->gety() + 40);
         $this->pdf->setFont('Arial', 'B', 8);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(30, 30, 20, 20, 25, 25, 40));
         $this->pdf->Row(array('Item', 'Keterangan', 'Qty', 'Unit', 'Price', 'Tax', 'Total'));
         $this->pdf->setFont('Arial', '', 8);
         $this->pdf->setaligns(array('L', 'L', 'R', 'C', 'R', 'R', 'R'));
         $total = 0;
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['itemname'], $row1['description'], Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberqty"], $row1['qty']), $row1['uomcode'], Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberprice"], $row1['price']), Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberprice"], $row1['taxvalue']), Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberprice"], $row1['price'] + $row1['taxvalue'])));
             $total = $total + ($row1['price'] + $row1['taxvalue']);
         }
         $this->pdf->row(array('', '', '', '', '', 'Total', Yii::app()->numberFormatter->format(Yii::app()->params["defaultnumberprice"], $total)));
         $this->pdf->text(30, $this->pdf->gety() + 10, 'NOTE: ');
         $this->pdf->text(150, $this->pdf->gety() + 10, 'PT. WINTAGE LOGISTIC');
         $this->pdf->text(30, $this->pdf->gety() + 15, 'HARAP PEMBAYARAN DI TRANSFER KE :');
         $this->pdf->text(30, $this->pdf->gety() + 20, 'PT WINTAGE LOGISTIC');
         $this->pdf->text(30, $this->pdf->gety() + 25, 'A/C No: 877-0175233 Bank BCA Cab. Cempaka Mas');
         $this->pdf->text(150, $this->pdf->gety() + 35, 'AUTHORIZED SIGNATURE');
         $this->pdf->AddPage('P');
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select b.fullname, a.pono, a.docdate,b.addressbookid,a.poheaderid,c.paymentname\r\n      from poheader a\r\n      left join addressbook b on b.addressbookid = a.addressbookid\r\n      left join paymentmethod c on c.paymentmethodid = a.paymentmethodid ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.poheaderid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Purchase Order';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     foreach ($dataReader as $row) {
         $this->pdf->setFont('Arial', 'B', 8);
         $this->pdf->text(100, 30, 'Purchase Order No ');
         $this->pdf->text(130, 30, $row['pono']);
         $this->pdf->text(100, 35, 'PO Date ');
         $this->pdf->text(130, 35, date(Yii::app()->params['dateviewfromdb'], strtotime($row['docdate'])));
         $this->pdf->text(100, 40, 'Payment ');
         $this->pdf->text(130, 40, $row['paymentname']);
         $sql1 = "select b.addresstypename, a.addressname, c.cityname, a.phoneno\r\n        from address a\r\n        left join addresstype b on b.addresstypeid = a.addresstypeid\r\n        left join city c on c.cityid = a.cityid\r\n        where addressbookid = " . $row['addressbookid'] . " order by addressid " . " limit 1";
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         foreach ($dataReader1 as $row1) {
             $this->pdf->setFont('Arial', 'B', 6);
             $this->pdf->Rect(5, 25, 60, 25);
             $this->pdf->text(10, 30, 'Vendor');
             $this->pdf->setFont('Arial', '', 6);
             $this->pdf->text(10, 35, 'Name');
             $this->pdf->text(20, 35, ': ' . $row['fullname']);
             $this->pdf->text(10, 40, 'Address');
             $this->pdf->text(20, 40, ': ' . $row1['addressname']);
             $this->pdf->text(10, 45, 'Phone');
             $this->pdf->text(20, 45, ': ' . $row1['phoneno']);
         }
         $sql1 = "select a.poheaderid,c.uomcode,a.poqty,a.delvdate,a.netprice,(poqty * netprice) as total,b.productname,\r\n        d.symbol,d.i18n,e.taxvalue\r\n        from podetail a\r\n        left join product b on b.productid = a.productid\r\n        left join unitofmeasure c on c.unitofmeasureid = a.unitofmeasureid\r\n        left join currency d on d.currencyid = a.currencyid\r\n        left join tax e on e.taxid = a.taxid\r\n        where poheaderid = " . $row['poheaderid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $total = 0;
         $this->pdf->sety(55);
         $this->pdf->setFont('Arial', 'B', 6);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(20, 20, 80, 30, 30));
         $this->pdf->setFont('Arial', '', 6);
         $this->pdf->Row(array('Qty', 'Units', 'Description', 'Unit Price', 'Total'));
         $this->pdf->setaligns(array('C', 'C', 'L', 'R', 'R'));
         foreach ($dataReader1 as $row1) {
             Yii::app()->setLanguage($row1['i18n']);
             $this->pdf->row(array($row1['poqty'], $row1['uomcode'], $row1['productname'], Yii::app()->numberFormatter->formatCurrency($row1['netprice'], $row1['symbol']), Yii::app()->numberFormatter->formatCurrency($row1['total'], $row1['symbol'])));
             $total = $row1['total'] + $total;
         }
         Yii::app()->setLanguage('en');
         $this->pdf->rect(160, $this->pdf->gety(), 30, 5);
         $this->pdf->text(132, $this->pdf->gety() + 3, 'Sub Total');
         $this->pdf->text(161, $this->pdf->gety() + 3, Yii::app()->numberFormatter->formatCurrency($total, $row1['symbol']));
         $this->pdf->sety($this->pdf->gety() + 5);
         $this->pdf->rect(160, $this->pdf->gety(), 30, 5);
         $this->pdf->text(132, $this->pdf->gety() + 3, 'Total');
         $this->pdf->text(161, $this->pdf->gety() + 3, Yii::app()->numberFormatter->formatCurrency($total, $row1['symbol']));
     }
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.addressbookid,a.fullname,a.taxno,a.abno,c.accountcode\r\n\t\t\t\tfrom addressbook a \r\n\t\t\t\tleft join account c on c.accountid = a.acchutangid\r\n\t\t\t\twhere iscustomer=1 ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "and a.addressbookid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Customer List';
     $this->pdf->AddPage('L');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     foreach ($dataReader as $row) {
         $this->pdf->setaligns(array('C', 'C', 'C'));
         $this->pdf->setwidths(array(90, 40, 30));
         $this->pdf->Row(array('Name', 'NPWP', 'Account Hutang'));
         $this->pdf->setaligns(array('L', 'L', 'L'));
         $this->pdf->row(array($row['fullname'], $row['taxno'], $row['accountcode']));
         $sql1 = "select a.addressname,a.rt,a.rw,b.cityname,c.addresstypename,d.kelurahanname,e.subdistrictname,a.phoneno\r\n\t\t\t\tfrom address a \r\n\t\t\t\tleft join city b on b.cityid = a.cityid\r\n\t\t\t\tleft join addresstype c on c.addresstypeid = a.addresstypeid\r\n\t\t\t\tleft join kelurahan d on d.kelurahanid = a.kelurahanid\r\n\t\t\t\tleft join subdistrict e on e.subdistrictid = a.subdistrictid\r\n\t\t\t\twhere addressbookid= " . $row['addressbookid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->SetY($this->pdf->GetY() + 10);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(30, 30, 30, 30, 30, 30, 30, 30));
         $this->pdf->Row(array('Address Type', 'Address', 'RT', 'RW', 'Sub Subdistrict', 'Subdistrict', 'City', 'Phone No'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L', 'L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['addresstypename'], $row1['addressname'], $row1['rt'], $row1['rw'], $row1['kelurahanname'], $row1['subdistrictname'], $row1['cityname'], $row1['phoneno']));
         }
         $sql1 = "select a.addresscontactname,b.contacttypename,a.phoneno,a.mobilephone,a.emailaddress\r\n\t\t\t\tfrom addresscontact a \r\n\t\t\t\tleft join contacttype b on b.contacttypeid = a.contacttypeid\r\n\t\t\t\twhere a.addressbookid= " . $row['addressbookid'];
         $command1 = $this->connection->createCommand($sql1);
         $dataReader1 = $command1->queryAll();
         $this->pdf->SetY($this->pdf->GetY() + 10);
         $this->pdf->setaligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
         $this->pdf->setwidths(array(60, 50, 50, 50, 50, 50, 30, 30));
         $this->pdf->Row(array('PIC', 'Contact Type', 'Phone No', 'Mobile Phone', 'Email Address'));
         $this->pdf->setaligns(array('L', 'L', 'L', 'L', 'L', 'L', 'L', 'L'));
         foreach ($dataReader1 as $row1) {
             $this->pdf->row(array($row1['addresscontactname'], $row1['contacttypename'], $row1['phoneno'], $row1['mobilephone'], $row1['emailaddress']));
         }
         $this->pdf->AddPage('L');
     }
     // me-render ke browser
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select taxcode, taxvalue, description\r\n\t\t\t\tfrom tax a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.taxid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Tax List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 50, 90));
     $this->pdf->Row(array('Tax Code', 'Tax Value', 'Description'));
     $this->pdf->setaligns(array('L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['taxcode'], $row1['taxvalue'], $row1['description']));
     }
     // me-render ke browser
     $this->pdf->Output();
 }
 public function actionDownload()
 {
     parent::actionDownload();
     $sql = "select a.menuname, a.menucode, a.menuurl, a.description\r\n\t\t\t\tfrom menuaccess a ";
     if ($_GET['id'] !== '') {
         $sql = $sql . "where a.menuaccessid = " . $_GET['id'];
     }
     $command = $this->connection->createCommand($sql);
     $dataReader = $command->queryAll();
     $this->pdf->title = 'Country List';
     $this->pdf->AddPage('P');
     $this->pdf->setFont('Arial', 'B', 12);
     // definisi font
     $this->pdf->setFont('Arial', 'B', 8);
     $this->pdf->setaligns(array('C', 'C', 'C', 'C'));
     $this->pdf->setwidths(array(40, 40, 40, 60));
     $this->pdf->Row(array('Menu Name', 'Menu Code', 'Menu Url', 'Description'));
     $this->pdf->setaligns(array('L', 'L', 'L', 'L'));
     foreach ($dataReader as $row1) {
         $this->pdf->row(array($row1['menuname'], $row1['menucode'], $row1['menuurl'], $row1['description']));
     }
     $this->pdf->Output();
 }