コード例 #1
0
ファイル: byEmployee.php プロジェクト: hostellerie/nexpro
<?php

$_glob_fit_height = 3;
$_glob_fit_width = 1;
$ts = new nexTime();
if ($whichManager > 0) {
    $csv = $ts->getCSVListOfAssignedEmployees($whichManager, true);
} else {
    $csv = $ts->getAllUIDsWhichHaveSupervisors();
}
if ($csv == '') {
    $csv = '0';
}
$sql = "Select {$_TABLES['users']}.uid,{$_TABLES['users']}.fullname from {$_TABLES['users']} left outer join {$_TABLES['nextime_extra_user_data']} on {$_TABLES['users']}.uid = {$_TABLES['nextime_extra_user_data']}.uid where {$_TABLES['users']}.uid in ({$csv}) AND ";
$sql .= "( {$_TABLES['nextime_extra_user_data']}.special_exclusion <>1 OR {$_TABLES['nextime_extra_user_data']}.special_exclusion is null)";
$res = DB_query($sql);
$nrows = DB_numRows($res);
$timesthru = 0;
while ($A = DB_fetchArray($res)) {
    if ($timesthru > 0) {
        $objPHPExcel->createSheet();
        //$objPHPExcel->setActiveSheetIndex($timesthru);
    }
    $objPHPExcel->setActiveSheetIndex($timesthru);
    $techNumber = DB_getItem($_TABLES['nextime_extra_user_data'], "tech_number", "uid={$A['uid']}");
    $objPHPExcel->getActiveSheet()->setTitle($A['fullname'] . ' - #' . $techNumber);
    $objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
    $objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL);
    $objPHPExcel->getActiveSheet()->getPageSetup()->setFitToHeight(3);
    $objPHPExcel->getActiveSheet()->getPageSetup()->setFitToWidth(1);
    $objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 9);