$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}");
                        }
                    }
                }
            }
        }
    }
}
    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");
    }
}
            $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}");
            }
        }
    }
}
示例#6
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);
    }
}