예제 #1
0
                $actstr = utf8_decode($langfile["opened"]);
            } elseif ($logged["action"] == 5) {
                $actstr = utf8_decode($langfile["closed"]);
            } elseif ($logged["action"] == 6) {
                $actstr = utf8_decode($langfile["assigned"]);
            }

            $obstr = $logged["name"];
            $obstr = utf8_decode($obstr);
            $obstr = substr($obstr, 0, 75);

            $data = array($icon, $obstr, $actstr, $logged["datum"], $logged["username"]);
            $excel->writeLine($data);
        }
    }
    $excel->close();
    $loc = $url . "files/" . CL_CONFIG . "/ics/project-$id-log.xls";
    header("Location: $loc");
} elseif ($action == "showproject") {
    if (!chkproject($userid, $id)) {
        $errtxt = $langfile["notyourproject"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "$errtxt<br>$noperm");
        $template->assign("mode", "error");
        $template->display("error.tpl");
        die();
    }

    if (getArrayVal($_COOKIE, "milehead")) {
        $milestyle = "display:" . $_COOKIE['milehead'];
        $template->assign("milestyle", $milestyle);
예제 #2
0
$format_text =& $workbook->addFormat(array('Border' => '0', 'Size' => '8'));
$worksheet->setLandscape();
$worksheet->setPaper(1);
$workbook->writeMerge($worksheet, 1, 0, 5, 1, 'Sample Report', $format_title);
$col = 0;
$row = 2;
$cols = array(array('name' => 'Jenis', 'width' => 20), array('name' => 'Tanggal', 'width' => 20), array('name' => 'Perihal', 'width' => 70), array('name' => 'Kode', 'width' => 40), array('name' => 'Tahun', 'width' => 20));
foreach ($cols as $field) {
    $worksheet->writeString($row, $col, $field['name'], $format_title_field);
    //$worksheet->setColumn($row, $col,$field['width']+0);
    //$format_title_field->setTextWrap();
    $col++;
}
$row++;
$data = array();
while ($rowx = $rs->FetchNextObject()) {
    $data[] = array($rowx->JENIS, formatDate2($rowx->TANGGAL), $rowx->PERIHAL, $rowx->KODE, $rowx->TAHUN);
}
foreach ($data as $r) {
    $col = 0;
    foreach ($r as $c) {
        $worksheet->writeString($row, $col, $c, $format_text);
        $col++;
    }
    $row++;
}
$workbook->close();
if (set_magic_quotes_runtime(1) == false) {
    die("Set Magic Quote Runtime Failed.");
}
exit;