function pidigits($N) { $k = 1; $n1 = gmp_init(4); $n2 = gmp_init(3); $d = gmp_init(1); $i = 0; while ($i < $N) { $y = digit($n1, $n2, $d); if ($y !== false) { echo gmp_strval($y); $i++; if ($i % 10 == 0) { echo "\t:", $i, "\n"; } extractd($n1, $n2, $d, $y); } else { produce($n1, $n2, $d, $k); $k++; } } if ($i % 10 != 0) { echo str_repeat(' ', 10 - $N % 10), "\t:", $N, "\n"; } }
<?php $tmp = "SELECT * FROM temp_jual_detail WHERE jual_id='JL-{$inc}'"; $qtmp = mysql_query($tmp); while ($dtmp = mysql_fetch_array($qtmp)) { echo "\n <tr>\n <td>{$dtmp['barang_id']}</td>\n <td>{$dtmp['barang_nama']}</td>\n <td>{$dtmp['kategori']}</td>\n <td>{$dtmp['satuan']}</td>\n <td>{$dtmp['qty']}</td>\n <td align=right>" . digit($dtmp['harga_satuan']) . "</td>\n <td align=right>" . digit($dtmp['harga_total']) . "</td>\n <td><a href=proses.php?proses=hapus_item_jual&id={$dtmp['barang_id']}><div id=tombol>hapus</div></a></td>\n </tr>"; } ?> <tr> <td id="namaField" colspan="5"> </td> <td style="color:#FFF; border:none; background-color:#333" align="right">total:</td> <td style="color:#FFF; border:none; background-color:#333" align="right"> <?php $jml = "SELECT SUM(harga_total) AS htotal FROM temp_jual_detail WHERE jual_id='JL-{$inc}'"; $qjml = mysql_query($jml); $djml = mysql_fetch_array($qjml); echo digit($djml['htotal']); ?> </td> <td id="namaField"><input name="total" type="hidden" value="<?php echo $djml['htotal']; ?> " /></td> </tr> </table> <!--tabel pembayaran--> <table border="0" cellspacing="1" cellpadding="0"> <tr> <td id="noborder">Total Bayar</td> <td id="noborder">:</td> <td id="noborder"><label> <input type="text" name="jml_bayar" id="input" class="validate[required]" />
} $sum2 .= " ORDER BY jual_id DESC"; $qsum2 = mysql_query($sum2); $dsum2 = mysql_fetch_array($qsum2); ?> <!--<tr> <td colspan="4" align="right" style="color:#FFF; border:none; background-color:#333">Total =</td> <td align="right" style="color:#FFF; border:none; background-color:#333"><?php echo "Rp " . digit($dsum2['ttotal']); ?> </td> <td align="right" style="color:#FFF; border:none; background-color:#333"> <?php $qsum_jml_bayar = mysql_query($sum_jml_bayar); $dsum_jml_bayar = mysql_fetch_array($qsum_jml_bayar); echo "Rp " . digit($dsum_jml_bayar['total_jml_bayar']); ?> </td> <td align="right" style="color:#FFF; border:none; background-color:#333"><?php echo "Rp " . digit($total_piutang); ?> </td> <td align="right" style="color:#FFF; border:none; background-color:#333"></td> </tr>--> </table> </div> </div> <!-- /BOX --> </div> </div>
?> </a> </td> <td><?php echo "{$row['no_fak']}"; ?> </td> <td><?php echo "{$row['tgl_trans']}"; ?> </td> <td><?php echo "{$row['supplier_nama']}"; ?> </td> <td align="right"><?php echo "Rp "; echo digit($row['biaya_kirim']); ?> </td> <td align="right"><?php echo "Rp "; echo digit($row['total']); ?> </td> </tr> <?php } ?> </table>
} $sum1 = "SELECT SUM(biaya_kirim) AS total_ongkos FROM beli WHERE tgl_trans BETWEEN '{$tgl_awal}' AND '{$tgl_akhir}'"; $qsum1 = mysql_query($sum1); $dsum1 = mysql_fetch_array($qsum1); $sum2 = "SELECT SUM(total) AS total_harga FROM beli WHERE tgl_trans BETWEEN '{$tgl_awal}' AND '{$tgl_akhir}'"; $qsum2 = mysql_query($sum2); $dsum2 = mysql_fetch_array($qsum2); ?> <tr> <td style="color:#FFF; background-color:#333; border:none;" colspan="4" align="right" id="tabel_judul">Total :</td> <td style="color:#FFF; background-color:#333; border:none;" align="right"><?php echo "Rp " . digit($dsum1['total_ongkos']); ?> </td> <td style="color:#FFF; background-color:#333; border:none;" align="right"><?php echo "Rp " . digit($dsum2['total_harga']); ?> </td> </tr> </table> </div> </div> <!-- /BOX --> </div> </div> </body> </html> <?php } else { echo "anda tidak berhak meng-akses halaman ini !"; }
</td> <td style="color:#FFF; background-color:#333; border:none;"> </td> <td style="color:#FFF; background-color:#333; border:none;" align="right">Total =</td> <td style="color:#FFF; background-color:#333; border:none;" align="right"> <?php $jual = "SELECT * FROM jual WHERE jual_id='{$_GET['id']}'"; $qjual = mysql_query($jual); $djual = mysql_fetch_array($qjual); echo "Rp " . digit($djual['total']); ?> </td> </tr> <tr> <td colspan="6" style="color:#FFF; background-color:#333; border:none;" align="right">Bayar =</td> <td style="color:#FFF; background-color:#333; border:none;" align="right"><?php echo "Rp " . digit($djual['jml_bayar']); ?> </td> </tr> <tr> <td colspan="6" style="color:#FFF; background-color:#333; border:none;" align="right">Piutang =</td> <td style="color:#FFF; background-color:#333; border:none;" align="right"> <?php $piutang = $djual['total'] - $djual['jml_bayar']; echo "Rp " . digit($piutang); ?> </td> </tr> </table> </body> </html>
?> </td> <td><?php echo "{$row['pelanggan_nama']}"; ?> </td> <td align="right"><?php echo "Rp "; echo digit($row['total']); ?> </td> <td align="right"><?php echo "Rp "; echo digit($row['jml_bayar']); ?> </td> <td align="right"><?php echo "Rp "; echo digit($piutang); ?> </td> <td><?php echo "{$row['tgl_jatuh_tempo']}"; ?> </td> </tr> <?php } ?> </table>
<html> <body> <?php require_once 'functions.php'; $valid = TRUE; if (isset($_POST['submit'])) { foreach ($_POST as $key => $value) { ${$key} = $value; } $valid = $fn = checklength($fname, 1, 30); $ln = checklength($lname, 1, 30); $valid = $valid && $ln; $a = digit($age); $valid = $valid && $a; $em = checkemail($email); $valid = $valid && $em; $com = checklength($comment, 1, 250); $valid = $valid && $com; if ($valid == 1) { echo "form filled successfully!"; exit; } } else { $fn = $ln = $a = $com = $em = TRUE; $fname = $lname = $age = $comment = $email = ""; } if (!$valid) { ?> <style type="text/css"> td.error {
public function reportOutsourceWeekExcel() { /** * Data * */ $this->data['form']['date_from'] = $this->session->userdata('wdate_from'); $this->data['form']['date_to'] = $this->session->userdata('wdate_to'); $this->data['form']['week'] = $this->session->userdata('wweek'); $this->data['form']['week2'] = $this->session->userdata('wweek2'); $start = $this->data['form']['week']; $end = $this->data['form']['week2']; $xyear = substr($this->data['form']['date_from'], 6, 4); if (!$start) { $start = 0; $end = 0; } // select year switch ($xyear) { case "2009": $xmin = 53; break; case "2010": $xmin = 52; break; case "2011": $xmin = 52; break; case "2012": $xmin = 52; break; case "2013": $xmin = 52; break; case "2014": $xmin = 52; break; case "2015": $xmin = 53; break; case "2016": $xmin = 52; break; case "2017": $xmin = 52; break; case "2018": $xmin = 52; break; case "2019": $xmin = 52; break; case "2020": $xmin = 53; break; default: $xmin = 52; break; } if ($start <= $end) { $start = $start; $end = $end; } else { $start = $start; $end = $end + $xmin; } $this->load->library('PHPExcel'); $objPHPExcel = new PHPExcel(); $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel, "Excel2007"); $objPHPExcel->getProperties()->setTitle("Mantap")->setDescription("description"); $objPHPExcel->setActiveSheetIndex(0); $objWorksheet = $objPHPExcel->getActiveSheet(); $objWorksheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE); $objWorksheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5); $objWorksheet->getPageSetup()->setScale(93); $border = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN))); $fill = array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'rotation' => 0, 'startcolor' => array('rgb' => 'CCCCCC'), 'endcolor' => array('argb' => 'CCCCCC')); $objPHPExcel->getDefaultStyle()->getFont()->setName('Trebuchet MS')->setSize(8); $col = 0; $row = 1; $objWorksheet->setCellValueByColumnAndRow($col, $row, "OUTSOURCE REPORT BY WEEK"); $objWorksheet->mergeCellsByColumnAndRow($col, $row + 0, $col + 3, $row + 0); $row++; $objWorksheet->setCellValueByColumnAndRow($col, $row, 'PERIODE : ' . $this->data['form']['date_from'] . ' to ' . $this->data['form']['date_to']); $objWorksheet->mergeCellsByColumnAndRow($col, $row + 0, $col + 3, $row + 0); $col = $col; $row += 2; $cc = 3 + ($end + 1 - $start) * 9 + 5; $desc = "Ket : DK : Dalam Kota Per Hari,LK : Luar Kota Per Hari,S : Sakit Per Hari,I : Ijin Per Jam ,C : Cuti Per Hari & Ijin >=4 jam, L : Libur Per Hari, OT : Lembur Per Jam"; $objWorksheet->setCellValueByColumnAndRow($col, $row, $desc); $objWorksheet->getStyleByColumnAndRow($col, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->mergeCellsByColumnAndRow($col, $row, $col + $cc, $row); $row++; $holidays = $this->reportModel->getReportHolidayWeek($this->data['form']); if (isset($holidays)) { $str = ''; foreach ($holidays as $k => $v) { $str .= $v['date'] . ':' . $v['descr'] . ','; } } $objWorksheet->setCellValueByColumnAndRow($col, $row, 'Libur : ' . $str); $objWorksheet->getStyleByColumnAndRow($col, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->mergeCellsByColumnAndRow($col, $row, $col + $cc, $row); $col = $col; $row += 2; $objWorksheet->setCellValueByColumnAndRow($col, $row, 'No'); $objWorksheet->getStyleByColumnAndRow($col, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col, $row)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col, $row)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col)->setWidth(5); $objWorksheet->mergeCellsByColumnAndRow($col, $row, $col, $row + 1); $objWorksheet->getStyleByColumnAndRow($col, $row + 1)->applyFromArray($border); $objWorksheet->mergeCellsByColumnAndRow($col, $row, $col, $row + 1); $objWorksheet->getStyleByColumnAndRow($col, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->setCellValueByColumnAndRow($col + 1, $row, 'Name'); $objWorksheet->getStyleByColumnAndRow($col + 1, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 1, $row)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 1, $row)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 1)->setWidth(30); $objWorksheet->mergeCellsByColumnAndRow($col + 1, $row, $col + 1, $row + 1); $objWorksheet->getStyleByColumnAndRow($col + 1, $row + 1)->applyFromArray($border); $objWorksheet->setCellValueByColumnAndRow($col + 2, $row, 'NIK'); $objWorksheet->getStyleByColumnAndRow($col + 2, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 2, $row)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 2, $row)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 2)->setWidth(10); $objWorksheet->mergeCellsByColumnAndRow($col + 2, $row, $col + 2, $row + 1); $objWorksheet->getStyleByColumnAndRow($col + 2, $row + 1)->applyFromArray($border); $objWorksheet->setCellValueByColumnAndRow($col + 3, $row, 'Jabatan'); $objWorksheet->getStyleByColumnAndRow($col + 3, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 3, $row)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 3, $row)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 3)->setWidth(15); $objWorksheet->mergeCellsByColumnAndRow($col + 3, $row, $col + 3, $row + 1); $objWorksheet->getStyleByColumnAndRow($col + 3, $row + 1)->applyFromArray($border); $xi = 0; $xo = 9; for ($is = $start; $is <= $end; $is++) { if ($is <= $xmin) { $i = $is; } else { $i = $is - $xmin; } $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi, $row, 'Minggu ' . $i); $objWorksheet->mergeCellsByColumnAndRow($col + 4 + $xi, $row, $col + 4 + $xi + $xo, $row); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row)->getFill()->applyFromArray($fill); for ($j = 0; $j < $xo + 1; $j++) { $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + $j, $row)->applyFromArray($border); } $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi, $row + 1, 'DK'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 1, $row + 1, 'LK'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 1, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 1, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 1, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 1)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 2, $row + 1, 'SS'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 2, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 2, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 2, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 2)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 3, $row + 1, 'S'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 3, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 3, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 3, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 3)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 4, $row + 1, 'I'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 4, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 4, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 4, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 4)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 5, $row + 1, 'C'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 5, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 5, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 5, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 5)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 6, $row + 1, 'L'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 6, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 6, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 6, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 6)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 7, $row + 1, 'TK'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 7, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 7, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 7, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 7)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 8, $row + 1, 'OT'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 8, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 8, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 8, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 8)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 9, $row + 1, 'Keterangan'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 9, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 9, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 9, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 9)->setWidth(50); $xi += 10; } $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi, $row, 'Total'); $objWorksheet->mergeCellsByColumnAndRow($col + 4 + $xi, $row, $col + 4 + $xi + $xo - 1, $row); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row)->getFill()->applyFromArray($fill); for ($j = 0; $j < 9; $j++) { $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + $j, $row)->applyFromArray($border); } $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi, $row + 1, 'DK'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 1, $row + 1, 'LK'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 1, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 1, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 1, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 1)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 2, $row + 1, 'SS'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 2, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 2, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 2, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 2)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 3, $row + 1, 'S'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 3, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 3, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 3, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 3)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 4, $row + 1, 'I'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 4, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 4, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 4, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 4)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 5, $row + 1, 'C'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 5, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 5, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 5, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 5)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 6, $row + 1, 'L'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 6, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 6, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 6, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 6)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 7, $row + 1, 'TK'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 7, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 7, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 7, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 7)->setWidth(5); $objWorksheet->setCellValueByColumnAndRow($col + 4 + $xi + 8, $row + 1, 'OT'); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 8, $row + 1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 8, $row + 1)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 4 + $xi + 8, $row + 1)->getFill()->applyFromArray($fill); $objWorksheet->getColumnDimensionByColumn($col + 4 + $xi + 8)->setWidth(5); $col = $col; $row += 2; $cc = 3 + ($end + 1 - $start) * 10 + 9; $department = array('PT BDO Konsultan Indonesia Outsource'); foreach ($department as $d => $key) { $objWorksheet->setCellValueByColumnAndRow($col, $row, $key); $objWorksheet->getStyleByColumnAndRow($col, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col, $row)->applyFromArray($border); $objWorksheet->mergeCellsByColumnAndRow($col, $row, $col + $cc, $row); for ($j = 0; $j < $cc + 1; $j++) { $objWorksheet->getStyleByColumnAndRow($col + $j, $row)->applyFromArray($border); } $row += 1; $no = 1; $employee = $this->reportModel->getEmployeeWeek($key); foreach ($employee as $k => $v) { $objWorksheet->setCellValueByColumnAndRow($col + 0, $row, $no); $objWorksheet->getStyleByColumnAndRow($col + 0, $row)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 0, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + 0, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->setCellValueByColumnAndRow($col + 1, $row, $v['employeename']); $objWorksheet->getStyleByColumnAndRow($col + 1, $row)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 1, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + 1, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->setCellValueByColumnAndRow($col + 2, $row, "'" . $v['employeeid']); $objWorksheet->getStyleByColumnAndRow($col + 2, $row)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 2, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + 2, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->setCellValueByColumnAndRow($col + 3, $row, $v['employeetitle']); $objWorksheet->getStyleByColumnAndRow($col + 3, $row)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + 3, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + 3, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $xi = 4; $vw = 0; $vl = 0; $vs = 0; $vi = 0; $vc = 0; $vl = 0; $vtk = 0; $vo = 0; $tdk = 0; $tlk = 0; $tss = 0; $ts = 0; $tij = 0; $tc = 0; $tli = 0; $tot = 0; $ttk = 0; for ($is = $start; $is <= $end; $is++) { $week = $is; $year = $xyear; if ($is > $xmin) { $week = $is - $xmin; $year = $xyear + 1; } $days = array(0 => date("d/m/Y", strtotime($year . "W" . digit($week) . "1")), 1 => date("d/m/Y", strtotime($year . "W" . digit($week) . "2")), 2 => date("d/m/Y", strtotime($year . "W" . digit($week) . "3")), 3 => date("d/m/Y", strtotime($year . "W" . digit($week) . "4")), 4 => date("d/m/Y", strtotime($year . "W" . digit($week) . "5"))); $timesheetdate = ''; $dk = 0; $lk = 0; $ss = 0; $s = 0; $ij = 0; $c = 0; $li = 0; $ot = 0; $tk = 0; $tk_mon = $days[0]; $tk_tue = $days[1]; $tk_wed = $days[2]; $tk_thu = $days[3]; $tk_fri = $days[4]; $description = ""; $tkdescription = "TK :"; $ldescription = "Libur :"; $cdescription = "Cuti :"; $idescription = "Izin :"; $sdescription = "Sakit :"; $timesheet = $this->reportModel->getEmployeeWeekDetails($v['employee_id'], $week, $year); foreach ($timesheet as $key => $val) { switch ($val["timesheetdate"]) { case $days[0]: $tk_mon = ""; break; case $days[1]: $tk_tue = ""; break; case $days[2]: $tk_wed = ""; break; case $days[3]: $tk_thu = ""; break; case $days[4]: $tk_fri = ""; break; } // Dalam Kota if ($val['transport_type'] < 3 && $val["JOBTYPE"] != "HRD") { if ($val['timesheetdate'] != $timesheetdate) { $dk += 1; } } // Luar Kota if ($val['transport_type'] == 3 && $val['JOBTYPE'] != 'HRD') { if ($val['timesheetdate'] != $timesheetdate) { $lk += 1; } } // count of izin if ($val["job_id"] == 470) { $ss += $val["hour"]; } // count of sakit / sick if ($val['job_id'] <= 3 && $val['hour'] >= 4) { $s += 8; $sdescription .= $val["timesheetdate"] . ", "; } // count of izin if ($val["hour"] < 4 and ($val["job_id"] >= 4 and $val["job_id"] <= 9 or $val["job_id"] == 17)) { $ij += $val["hour"]; $idescription .= $val["timesheetdate"] . ", "; } // count of cuti if ($val["hour"] >= 4 and ($val["job_id"] >= 4 and $val["job_id"] <= 9 or $val["job_id"] == 17 or $val["job_id"] >= 10 and $val["job_id"] <= 12)) { $c += 8; $cdescription .= $val["timesheetdate"] . ", "; } // count of libur if ($val["job_id"] == 499) { $li += 8; $ldescription .= $val["timesheetdate"] . ", "; } if ($val["overtime"] > 0) { $ot += $val["overtime"]; } $timesheetdate = $val['timesheetdate']; } $s = ceil($s > 0 ? $s / 8 : 0); $c = ceil($c > 0 ? $c / 8 : 0); $li = ceil($li > 0 ? $li / 8 : 0); $total_week = $dk + $lk + $s + $c + $li; $tk = 0; if ($total_week < 5) { $tk = 5 - $total_week; $tkdescription .= $tk_mon ? $tk_mon . ", " : " "; $tkdescription .= $tk_tue ? $tk_tue . ", " : " "; $tkdescription .= $tk_wed ? $tk_wed . ", " : " "; $tkdescription .= $tk_thu ? $tk_thu . ", " : " "; $tkdescription .= $tk_fri ? $tk_fri . ", " : " "; } if ($s > 0) { $description .= $sdescription . " "; } if ($ij > 0) { $description .= $idescription . " "; } if ($c > 0) { $description .= $cdescription . " "; } if ($li > 0) { $description .= $ldescription . " "; } if ($tk > 0) { $description .= $tkdescription . " "; } //if ($description) //$description = substr($description,0,(strlen($description) -1)); $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $dk); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $lk); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $ss); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $s); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $ij); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $c); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $li); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $tk); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $ot); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $description); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->getAlignment()->setWrapText(true); $xi++; $tdk += $dk > 0 ? $dk : 0; $tlk += $lk > 0 ? $lk : 0; $tss += $ss > 0 ? $ss : 0; $ts += $s > 0 ? $s : 0; $tij += $ij > 0 ? $ij : 0; $tc += $c > 0 ? $c : 0; $tli += $li > 0 ? $li : 0; $tot += $ot > 0 ? $ot : 0; $ttk += $tk > 0 ? $tk : 0; } $xi = $xi; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $tdk); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $tlk); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $tss); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $ts); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $tij); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $tc); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $tli); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $tk); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $xi++; $objWorksheet->setCellValueByColumnAndRow($col + $xi, $row, $tot); $objWorksheet->getStyleByColumnAndRow($col + $xi, $row)->applyFromArray($border); $row++; $no++; } $row++; } $file = "./media/OutsourceWeek.xlsx"; $objWriter->save($file); redirect('../media/OutsourceWeek.xlsx'); }
<td><?php echo "<a href=proses.php?proses=hapus_item_beli&status=satu&id={$drinci['barang_id']}><div id=tombol>hapus</div></a>"; ?> </td> </tr> <?php } ?> <tr> <td style="color:#FFF; background-color:#333; border:none" colspan="6" align="right">total :</td> <td style="color:#FFF; background-color:#333; border:none" align="right"> <?php $sum = "SELECT SUM(harga_total)AS total FROM temp_beli_detail WHERE beli_id='BM-{$inc}'"; $qsum = mysql_query($sum); $dsum = mysql_fetch_array($qsum); echo digit($dsum['total']); ?> </td> <td style="color:#FFF; background-color:#333; border:none"> </td> </tr> </table> <table border="0" cellspacing="1" cellpadding="0"> <tr> <td><input type="submit" name="simpan" id="tombol" value="simpan" /></td> <td><input type="reset" name="batal" id="tombol" value="batal" /></td> </tr> </table> </form> </td>
?> <tr> <td style="color:#FFF; background-color:#333; border:none" colspan="3" align="right">total Qty :</td> <td style="color:#FFF; background-color:#333; border:none"> <?php $sumQty = "SELECT SUM(qty) AS totalQty FROM beli_detail WHERE beli_id='{$_GET['id']}'"; $qsumQty = mysql_query($sumQty); $dsumQty = mysql_fetch_array($qsumQty); echo $dsumQty['totalQty']; ?> </td> <td style="color:#FFF; background-color:#333; border:none"> </td> <td style="color:#FFF; background-color:#333; border:none" align="right">Total =</td> <td style="color:#FFF; background-color:#333; border:none" align="right"><?php echo "Rp "; echo digit($data['total']); ?> </td> </tr> <tr> <td style="color:#FFF; background-color:#333; border:none" colspan="6" align="right">Total keseluruhan (total + ongkos truk) =</td> <td style="color:#FFF; background-color:#333; border:none" align="right"><?php $alltotal = $data['total'] + $data['biaya_kirim']; echo "Rp "; echo digit($alltotal); ?> </td> </tr> </table> </body> </html>
function item($id) { if (articleInfo('id', $id)) { $db = new FQuery(); $sql = $db->select(FDBPrefix . "article", "*,\n\t\t\tDATE_FORMAT(date,'%W, %d %M %Y %H:%i') as time,\n\t\t\tDATE_FORMAT(date,'%Y-%m-%d %H:%i:%s') as timer,\n\t\t\tDATE_FORMAT(date,'%d %M %Y') as date,\n\t\t\tDATE_FORMAT(date,'%W') as D,\n\t\t\tDATE_FORMAT(date,'%d') as f,\n\t\t\tDATE_FORMAT(date,'%b') as b,\n\t\t\tDATE_FORMAT(date,'%a') as a,\n\t\t\tDATE_FORMAT(date,'%D') as d,\n\t\t\tDATE_FORMAT(date,'%m') as n,\n\t\t\tDATE_FORMAT(date,'%M') as m,\n\t\t\tDATE_FORMAT(date,'%y') as y,\n\t\t\tDATE_FORMAT(date,'%Y') as Y,\n\t\t\tDATE_FORMAT(date,'%h') as h,\n\t\t\tDATE_FORMAT(date,'%H') as H,\n\t\t\tDATE_FORMAT(date,'%p') as p,\n\t\t\tDATE_FORMAT(date,'%i') as i,\n\t\t\tDATE_FORMAT(date,'%s') as s", "id={$id} AND status=1"); $qr = @mysql_fetch_array($sql); if ($qr) { $category = categoryInfo('name', $qr['category']); $catLevel = categoryInfo('level', $qr['category']); $catLink = categoryLink($qr['category']); if (!empty($qr['author_id'])) { $author = userInfo('name', $qr['author_id']); } else { $author = 'Administrator'; } $autMail = userInfo('email', $qr['author_id']); $autBio = userInfo('about', $qr['author_id']); $autBio = str_replace("\n", "<br>", $autBio); if (empty($autBio)) { $autBio = "Sorry, no description about me."; } if (!empty($qr['author'])) { $author = $qr['author']; } articleHits($qr['hits']); $tag = mod_param('tags', $qr['parameter']); $sdate = mod_param('show_date', $qr['parameter']); $shits = mod_param('show_hits', $qr['parameter']); $srate = mod_param('show_rate', $qr['parameter']); $tpanel = mod_param('panel_top', $qr['parameter']); $bpanel = mod_param('panel_bottom', $qr['parameter']); $stag = mod_param('show_tags', $qr['parameter']); $voter = mod_param('rate_counter', $qr['parameter']); $rate = mod_param('rate_value', $qr['parameter']); $stitle = mod_param('show_title', $qr['parameter']); $sauthor = mod_param('show_author', $qr['parameter']); $comment = mod_param('show_comment', $qr['parameter']); $scategory = mod_param('show_category', $qr['parameter']); $catLinks = categoryLink($qr['category']); $catHref = "<a href='{$catLinks}'>{$category}</a>"; $fpanel = "*" . menu_param('panel_format', Page_ID); $panel = str_replace('%rel', "", $fpanel); if (empty($panel) or !strpos($panel, '%')) { $a = "<b>%A</b> ·"; if (!$sauthor) { $a = ''; } if (siteConfig('lang') == 'id') { $date = "%f %m %Y ·"; } else { $date = "%m, %f %Y ·"; } if (!$sdate) { $date = ''; } if (siteConfig('lang') == 'id') { $panel = "{$a} {$date} %c"; } else { $panel = "{$a} %c"; } } $panel = str_replace('%A', "{$author}", $panel); if ($scategory) { $panel = str_replace('%c', "{$catHref}", $panel); } else { $panel = str_replace('· %c', '', $panel); } if (!$sdate and !$scategory) { $panel = str_replace('·', '', $panel); $panel = str_replace('%c', '', $panel); } $panel = str_replace('%h', $qr['hits'], $panel); $timeRel = dateRelative($qr['H'], $qr['i'], $qr['s'], $qr['n'], $qr['f'], $qr['Y']); if ($timeRel and strpos($fpanel, '%rel')) { $panel = str_replace(', ', "", $panel); $panel = str_replace('%d', "", $panel); $panel = str_replace('%b', "", $panel); $panel = str_replace('%f', "{$timeRel}", $panel); $panel = str_replace('%m', "", $panel); $panel = str_replace('%n', "", $panel); $panel = str_replace('%y', "", $panel); $panel = str_replace('%Y', "", $panel); $panel = str_replace('%H', "", $panel); $panel = str_replace('%h', "", $panel); $panel = str_replace('%i', "", $panel); $panel = str_replace('%s', "", $panel); $panel = str_replace('%p', "", $panel); if (strlen($panel) < 3) { $panel = $timeRel; } } else { if (siteConfig('lang') == 'id') { $panel = str_replace('%f', $qr['f'], $panel); } else { $panel = str_replace('%f', $qr['d'], $panel); } $panel = str_replace("%rel", $panel, $panel); $panel = str_replace('%d', $qr['d'], $panel); $panel = str_replace('%D', $qr['D'], $panel); $panel = str_replace('%b', $qr['b'], $panel); $panel = str_replace('%a', $qr['a'], $panel); $panel = str_replace('%m', $qr['m'], $panel); $panel = str_replace('%n', $qr['n'], $panel); $panel = str_replace('%y', $qr['y'], $panel); $panel = str_replace('%Y', $qr['Y'], $panel); $panel = str_replace('%H', $qr['H'], $panel); $panel = str_replace('%h', $qr['h'], $panel); $panel = str_replace('%i', $qr['i'], $panel); $panel = str_replace('%s', $qr['s'], $panel); $panel = str_replace('%p', $qr['p'], $panel); } $panel = str_replace('*', "", $panel); /* voter */ if (!is_numeric($voter) or !is_numeric($rate)) { $voter = 0; } $rate = @round($rate / $voter, 1) * 20; /* tags */ $tags = null; if (!empty($qr['tags'])) { $tags = tagToLink($qr['tags']); } $article = $qr['article']; if (checkLocalhost()) { $article = str_replace(FLocal . "media/", "media/", $article); $article = str_replace("/media/", FUrl . "media/", $article); } /* perijinan akses artikel */ if (USER_LEVEL > $catLevel and USER_LEVEL > $qr['level']) { echo Article_cant_access; } else { $this->article = $article; $this->category = $category; $this->catlink = $catLink; $this->author = $author; $this->autmail = $autMail; $this->autbio = $autBio; $this->title = $qr['title']; $this->day = $qr['f']; $this->month = $qr['m']; $this->year = $qr['y']; $this->hits = digit($qr['hits']); $this->comment = $comment; $this->panel = $panel; $this->tags = $tags; $this->stag = $stag; $this->sdate = $sdate; $this->sauthor = $sauthor; $this->stitle = $stitle; $this->tpanel = $tpanel; $this->bpanel = $bpanel; $this->scategory = $scategory; $this->shits = $shits; $this->srate = $srate; $this->rate = $rate; $this->voter = $voter; } } } }