$connection2->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch (PDOException $e) {
    echo $e->getMessage();
}
@session_start();
//Set timezone from session variable
date_default_timezone_set($_SESSION[$guid]["timezone"]);
$gibbonCourseClassID = $_GET["gibbonCourseClassID"];
$return = $_GET["return"];
$URL = $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Markbook/{$return}";
if (isActionAccessible($guid, $connection2, "/modules/Markbook/markbook_view.php") == FALSE) {
    //Fail 0
    $URL .= "&exportReturn=fail0";
    header("Location: {$URL}");
} else {
    try {
        $data = array("gibbonCourseClassID" => $gibbonCourseClassID);
        $sql = "SELECT * FROM gibbonMarkbookColumn JOIN gibbonCourseClass ON (gibbonMarkbookColumn.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) WHERE gibbonCourseClass.gibbonCourseClassID=:gibbonCourseClassID";
        $result = $connection2->prepare($sql);
        $result->execute($data);
    } catch (PDOException $e) {
        //Fail 0
        $URL .= "&exportReturn=fail0";
        header("Location: {$URL}");
        break;
    }
    //Proceed!
    $exp = new ExportToExcel();
    $exp = new ExportToExcel();
    $exp->exportWithPage($guid, "./markbook_viewExportAllContents.php", "markbookAll.xls", $gibbonCourseClassID);
}
                            header("Location: {$URL}");
                        } else {
                            if ($emailFail == TRUE) {
                                //Success 1
                                $URL .= "&bulkReturn=success1";
                                header("Location: {$URL}");
                            } else {
                                //Success 0
                                $URL .= "&bulkReturn=success0";
                                header("Location: {$URL}");
                            }
                        }
                    } else {
                        if ($action == "export") {
                            $_SESSION[$guid]["financeInvoiceExportIDs"] = $gibbonFinanceInvoiceIDs;
                            $exp = new ExportToExcel();
                            $exp->exportWithPage($guid, "./invoices_manage_processBulkExportContents.php", "invoices.xls", "&gibbonSchoolYearID={$gibbonSchoolYearID}");
                            // THIS CODE HAS BEEN COMMENTED OUT, AS THE EXPORT RETURNS WITHOUT IT...NOT SURE WHY!
                            //Success 0
                            //$URL.="&bulkReturn=success0" ;
                            //header("Location: {$URL}");
                        } else {
                            $URL .= "&bulkReturn=fail3";
                            header("Location: {$URL}");
                        }
                    }
                }
            }
        }
    }
}
示例#3
0
 static function export($formName, $encoding, $options)
 {
     switch ($encoding) {
         case 'HTML':
             require_once 'ExportToHtmlTable.php';
             $exporter = new ExportToHtmlTable();
             $exporter->export($formName, $options);
             break;
         case 'HTMLBOM':
             // IQY callback
             require_once 'ExportToHtmlTable.php';
             $exporter = new ExportToHtmlTable();
             $exporter->setUseBom(true);
             $exporter->export($formName, $options);
             break;
         case 'DT':
             require_once 'ExportToHtmlTable.php';
             if (!is_array($options)) {
                 $options = array();
             }
             $options['useDT'] = true;
             if (!isset($options['printScripts'])) {
                 $options['printScripts'] = true;
             }
             if (!isset($options['printStyles'])) {
                 $options['printStyles'] = 'true';
             }
             $exporter = new ExportToHtmlTable();
             $exporter->export($formName, $options);
             break;
         case 'HTMLTemplate':
             require_once 'ExportToHtmlTemplate.php';
             $exporter = new ExportToHtmlTemplate();
             $exporter->export($formName, $options);
             break;
         case 'IQY':
             require_once 'ExportToIqy.php';
             $exporter = new ExportToIqy();
             $exporter->export($formName, $options);
             break;
         case 'CSVUTF8BOM':
             $options['unbuffered'] = 'true';
             require_once 'ExportToCsvUtf8.php';
             $exporter = new ExportToCsvUtf8();
             $exporter->setUseBom(true);
             $exporter->export($formName, $options);
             break;
         case 'TSVUTF16LEBOM':
             $options['unbuffered'] = 'true';
             require_once 'ExportToCsvUtf16le.php';
             $exporter = new ExportToCsvUtf16le();
             $exporter->export($formName, $options);
             break;
         case 'GLD':
             require_once 'ExportToGoogleLiveData.php';
             $exporter = new ExportToGoogleLiveData();
             $exporter->export($formName, $options);
             break;
         case 'GSS':
             $options['unbuffered'] = 'true';
             require_once 'ExportToGoogleSS.php';
             $exporter = new ExportToGoogleSS();
             $exporter->export($formName, $options);
             break;
         case 'JSON':
             require_once 'ExportToJson.php';
             $exporter = new ExportToJson();
             $exporter->export($formName, $options);
             break;
         case 'VALUE':
             require_once 'ExportToValue.php';
             $exporter = new ExportToValue();
             $exporter->export($formName, $options);
             break;
         case 'COUNT':
             require_once 'ExportToValue.php';
             if (!is_array($options)) {
                 $options = array();
             }
             $options['function'] = 'count';
             unset($options['show']);
             unset($options['hide']);
             $exporter = new ExportToValue();
             $exporter->export($formName, $options);
             break;
         case 'CSVSJIS':
             require_once 'ExportToCsvUtf8.php';
             $exporter = new ExportToCsvUtf8();
             $exporter->setUseBom(false);
             $exporter->setUseShiftJIS(true);
             $exporter->export($formName, $options);
             break;
         case 'RSS':
             require_once 'ExportToRSS.php';
             $exporter = new ExportToRSS();
             $exporter->export($formName, $options);
             break;
         case 'ENTRY':
             require_once 'ExportEntry.php';
             $exporter = new ExportEntry();
             $exporter->export($formName, $options);
             break;
         case 'xlsx':
             require_once 'ExportToExcel.php';
             $exporter = new ExportToExcel();
             $exporter->export($formName, $options);
             break;
         case 'ods':
             require_once 'ExportToExcel.php';
             $exporter = new ExportToExcel();
             $options['format'] = 'ods';
             $exporter->export($formName, $options);
             break;
         case 'CSVUTF8':
         default:
             require_once 'ExportToCsvUtf8.php';
             $exporter = new ExportToCsvUtf8();
             $exporter->setUseBom(false);
             $exporter->export($formName, $options);
             break;
     }
 }
    echo $e->getMessage();
}
@session_start();
//Module includes
include "./moduleFunctions.php";
//Set timezone from session variable
date_default_timezone_set($_SESSION[$guid]["timezone"]);
$URL = $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . getModuleName($_GET["address"]) . "/report_transport_student.php";
if (isActionAccessible($guid, $connection2, "/modules/Students/report_transport_student.php") == FALSE) {
    //Fail 0
    $URL .= "&exportReturn=fail0";
    header("Location: {$URL}");
} else {
    try {
        $data = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"]);
        $sql = "SELECT gibbonPerson.gibbonPersonID, transport, surname, preferredName, address1, address1District, address1Country, nameShort FROM gibbonPerson JOIN gibbonStudentEnrolment ON (gibbonPerson.gibbonPersonID=gibbonStudentEnrolment.gibbonPersonID) JOIN gibbonRollGroup ON (gibbonStudentEnrolment.gibbonRollGroupID=gibbonRollGroup.gibbonRollGroupID) WHERE gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID AND status='Full' AND (dateStart IS NULL OR dateStart<='" . date("Y-m-d") . "') AND (dateEnd IS NULL  OR dateEnd>='" . date("Y-m-d") . "') ORDER BY transport, surname, preferredName";
        $result = $connection2->prepare($sql);
        $result->execute($data);
    } catch (PDOException $e) {
        print "<div class='error'>" . $e->getMessage() . "</div>";
    }
    if ($result->rowCount() < 1) {
        //Fail 3
        $URL .= "&exportReturn=fail3";
        header("Location: {$URL}");
    } else {
        //Proceed!
        $exp = new ExportToExcel();
        $exp->exportWithPage($guid, "./report_transport_studentExportContents.php", "studentTransport.xls");
    }
}
示例#5
0
$gibbonRollGroupID = $_GET["gibbonRollGroupID"];
$URL = $_SESSION[$guid]["absoluteURL"] . "/index.php";
try {
    $data = array("gibbonPersonIDTutor" => $_SESSION[$guid]["gibbonPersonID"], "gibbonPersonIDTutor2" => $_SESSION[$guid]["gibbonPersonID"], "gibbonPersonIDTutor3" => $_SESSION[$guid]["gibbonPersonID"]);
    $sql = "SELECT * FROM gibbonRollGroup WHERE (gibbonPersonIDTutor=:gibbonPersonIDTutor OR gibbonPersonIDTutor2=:gibbonPersonIDTutor2 OR gibbonPersonIDTutor3=:gibbonPersonIDTutor3)";
    $result = $connection2->prepare($sql);
    $result->execute($data);
} catch (PDOException $e) {
    //Fail 0
    $URL .= "?exportReturn=fail0";
    header("Location: {$URL}");
}
if ($result) {
    if ($gibbonRollGroupID == "") {
        //Fail 1
        $URL .= "?exportReturn=fail1";
        header("Location: {$URL}");
    } else {
        if ($result->rowCount() < 1) {
            //Fail 3
            $URL .= "?exportReturn=fail3";
            header("Location: {$URL}");
        } else {
            //Proceed!
            $exp = new ExportToExcel();
            $sql = "SELECT surname, preferredName, email FROM gibbonStudentEnrolment INNER JOIN gibbonPerson ON gibbonStudentEnrolment.gibbonPersonID=gibbonPerson.gibbonPersonID WHERE gibbonRollGroupID=" . $gibbonRollGroupID . " AND status='Full' AND (dateStart IS NULL OR dateStart<='" . date("Y-m-d") . "') AND (dateEnd IS NULL  OR dateEnd>='" . date("Y-m-d") . "') ORDER BY surname, preferredName";
            $exp = new ExportToExcel();
            $exp->exportWithQuery($sql, "classList.xls", $connection2);
        }
    }
}
            $sqlWhere .= "gibbonLibraryTypeID=:gibbonLibraryTypeID AND ";
        }
        if ($gibbonSpaceID != "") {
            $data["gibbonSpaceID"] = $gibbonSpaceID;
            $sqlWhere .= "gibbonSpaceID=:gibbonSpaceID AND ";
        }
        if ($status != "") {
            $data["status"] = $status;
            $sqlWhere .= "status=:status AND ";
        }
        if ($sqlWhere == "WHERE ") {
            $sqlWhere = "";
        } else {
            $sqlWhere = substr($sqlWhere, 0, -5);
        }
        $sql = "SELECT * FROM gibbonLibraryItem {$sqlWhere} ORDER BY id";
        $result = $connection2->prepare($sql);
        $result->execute($data);
    } catch (PDOException $e) {
        print "<div class='error'>" . $e->getMessage() . "</div>";
    }
    if ($result->rowCount() < 1) {
        //Fail 3
        $URL .= "&exportReturn=fail3";
        header("Location: {$URL}");
    } else {
        //Proceed!
        $exp = new ExportToExcel();
        $exp->exportWithPage($guid, "./report_catalogSummaryExportContents.php", "catalogSummary.xls", "ownershipType={$ownershipType}&gibbonLibraryTypeID={$gibbonLibraryTypeID}&gibbonSpaceID={$gibbonSpaceID}&status={$status}");
    }
}
if ($gibbonFinanceBudgetCycleID == "" or $action == "") {
    print "Fatal error loading this page!";
} else {
    $URL = $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . getModuleName($_POST["address"]) . "/expenses_manage.php&gibbonFinanceBudgetCycleID={$gibbonFinanceBudgetCycleID}";
    if (isActionAccessible($guid, $connection2, "/modules/Finance/expenses_manage.php") == FALSE) {
        //Fail 0
        $URL .= "&bulkReturn=fail0";
        header("Location: {$URL}");
    } else {
        $gibbonFinanceExpenseIDs = $_POST["gibbonFinanceExpenseIDs"];
        if (count($gibbonFinanceExpenseIDs) < 1) {
            $URL .= "&bulkReturn=fail3";
            header("Location: {$URL}");
        } else {
            $partialFail = FALSE;
            //Export
            if ($action == "export") {
                $_SESSION[$guid]["financeExpenseExportIDs"] = $gibbonFinanceExpenseIDs;
                $exp = new ExportToExcel();
                $exp->exportWithPage($guid, "./expenses_manage_processBulkExportContents.php", "invoices.xls", "&gibbonFinanceBudgetCycleID={$gibbonFinanceBudgetCycleID}");
                // THIS CODE HAS BEEN COMMENTED OUT, AS THE EXPORT RETURNS WITHOUT IT...NOT SURE WHY!
                //Success 0
                //$URL.="&bulkReturn=success0" ;
                //header("Location: {$URL}");
            } else {
                $URL .= "&bulkReturn=fail3";
                header("Location: {$URL}");
            }
        }
    }
}
示例#8
0
 public function export_xls($date, $thesis)
 {
     $table = $this->export_table($date, $thesis);
     $excel = new ExportToExcel();
     switch ($thesis) {
         case 'D3':
             $excel->exportWithPage($table, "Rekap-data-yudisium-d3-" . $date . ".xls");
             break;
         case 'Skripsi':
             $excel->exportWithPage($table, "Rekap-data-yudisium-s1-" . $date . ".xls");
             break;
         default:
             $excel->exportWithPage($table, "Rekap-data-yudisium-all-" . $date . ".xls");
             break;
     }
 }
$gibbonMarkbookColumnID = $_GET["gibbonMarkbookColumnID"];
$gibbonCourseClassID = $_GET["gibbonCourseClassID"];
$return = $_GET["return"];
$URL = $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Markbook/{$return}";
if (isActionAccessible($guid, $connection2, "/modules/Markbook/markbook_view.php") == FALSE) {
    //Fail 0
    $URL .= "&exportReturn=fail0";
    header("Location: {$URL}");
} else {
    try {
        $data = array("gibbonCourseClassID" => $gibbonCourseClassID, "gibbonMarkbookColumnID" => $gibbonMarkbookColumnID);
        $sql = "SELECT * FROM gibbonMarkbookColumn JOIN gibbonCourseClass ON (gibbonMarkbookColumn.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) WHERE (gibbonMarkbookColumn.gibbonCourseClassID=:gibbonCourseClassID AND gibbonMarkbookColumnID=:gibbonMarkbookColumnID)";
        $result = $connection2->prepare($sql);
        $result->execute($data);
    } catch (PDOException $e) {
        //Fail 0
        $URL .= "&exportReturn=fail0";
        header("Location: {$URL}");
        break;
    }
    if ($result->rowCount() != 1) {
        //Fail 3
        $URL .= "&exportReturn=fail3";
        header("Location: {$URL}");
    } else {
        //Proceed!
        $exp = new ExportToExcel();
        $exp = new ExportToExcel();
        $exp->exportWithPage($guid, "./markbook_viewExportContents.php", "markbookColumn.xls", $gibbonMarkbookColumnID);
    }
}