示例#1
0
function getCurrentVersion($guid, $connection2, $version)
{
    $output = "";
    $output .= "<script type=\"text/javascript\">";
    $output .= "\$(document).ready(function(){";
    $output .= "\$.ajax({";
    $output .= "crossDomain: true, type:\"GET\", contentType: \"application/json; charset=utf-8\",async:false,";
    $output .= "url: \"https://gibbonedu.org/services/version/version.php?callback=?\",";
    $output .= "data: \"\",dataType: \"jsonp\", jsonpCallback: 'fnsuccesscallback',jsonpResult: 'jsonpResult',";
    $output .= "success: function(data) {";
    $output .= "if (data['version']==='false') {";
    $output .= "\$(\"#status\").attr(\"class\",\"error\");";
    $output .= "\$(\"#status\").html('" . _('Version check failed') . ".') ;";
    $output .= "}";
    $output .= "else {";
    $output .= "if (parseFloat(data['version'])<=parseFloat('" . $version . "')) {";
    $output .= "\$(\"#status\").attr(\"class\",\"success\");";
    $output .= "\$(\"#status\").html('" . sprintf(_('Version check successful. Your Gibbon installation is up to date at %1$s.'), $version) . " " . sprintf(_('If you have recently updated your system files, please check that your database is up to date in %1$sUpdates%2$s.'), "<a href=\\'" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/System Admin/update.php\\'>", "</a>") . "') ;";
    $output .= "}";
    $output .= "else {";
    $output .= "\$(\"#status\").attr(\"class\",\"warning\");";
    $output .= "\$(\"#status\").html('" . sprintf(_('Version check successful. Your Gibbon installation is out of date. Please visit %1$s to download the latest version.'), "<a target=\"blank\" href=\\'http://gibbonedu.org/download\\'>the Gibbon download page</a>") . "') ;";
    $output .= "}";
    $output .= "}";
    $output .= "},";
    $output .= "error: function (data, textStatus, errorThrown) {";
    $output .= "\$(\"#status\").attr(\"class\",\"error\");";
    $output .= "\$(\"#status\").html('" . _('Version check failed') . ".') ;";
    $output .= "}";
    $output .= "});";
    $output .= "});";
    $output .= "</script>";
    $cuttingEdgeCode = getSettingByScope($connection2, "System", "cuttingEdgeCode");
    if ($cuttingEdgeCode != "Y") {
        $output .= "<div id='status' class='warning'>";
        $output .= "<div style='width: 100%; text-align: center'>";
        $output .= "<img style='margin: 10px 0 5px 0' src='" . $_SESSION[$guid]["absoluteURL"] . "/themes/Default/img/loading.gif' alt='Loading'/><br/>";
        $output .= _("Checking for Gibbon updates.");
        $output .= "</div>";
        $output .= "</div>";
    }
    return $output;
}
     break;
 }
 //Write back to gibbonFinanceExpense
 try {
     $data = array("gibbonFinanceExpenseID" => $gibbonFinanceExpenseID, "status" => 'Paid', "paymentDate" => $paymentDate, "paymentAmount" => $paymentAmount, "gibbonPersonIDPayment" => $gibbonPersonIDPayment, "paymentMethod" => $paymentMethod, "paymentReimbursementReceipt" => $attachment, "paymentReimbursementStatus" => "Requested");
     $sql = "UPDATE gibbonFinanceExpense SET status=:status, paymentDate=:paymentDate, paymentAmount=:paymentAmount, gibbonPersonIDPayment=:gibbonPersonIDPayment, paymentMethod=:paymentMethod, paymentReimbursementReceipt=:paymentReimbursementReceipt, paymentReimbursementStatus=:paymentReimbursementStatus WHERE gibbonFinanceExpenseID=:gibbonFinanceExpenseID";
     $result = $connection2->prepare($sql);
     $result->execute($data);
 } catch (PDOException $e) {
     //Fail2
     $URL .= "&editReturn=fail2";
     header("Location: {$URL}");
     break;
 }
 //Notify reimbursement officer that action is required
 $reimbursementOfficer = getSettingByScope($connection2, "Finance", "reimbursementOfficer");
 if ($reimbursementOfficer != FALSE and $reimbursementOfficer != "") {
     $notificationText = sprintf(_('Someone has requested reimbursement for "%1$s" in budget "%2$s".'), $row["title"], $row["budget"]);
     setNotification($connection2, $guid, $reimbursementOfficer, $notificationText, "Finance", "/index.php?q=/modules/Finance/expenses_manage_edit.php&gibbonFinanceExpenseID={$gibbonFinanceExpenseID}&gibbonFinanceBudgetCycleID={$gibbonFinanceBudgetCycleID}&status=&gibbonFinanceBudgetID=" . $row["gibbonFinanceBudgetID"]);
 }
 //Write paid change to log
 try {
     $data = array("gibbonFinanceExpenseID" => $gibbonFinanceExpenseID, "gibbonPersonID" => $_SESSION[$guid]["gibbonPersonID"], "action" => "Payment");
     $sql = "INSERT INTO gibbonFinanceExpenseLog SET gibbonFinanceExpenseID=:gibbonFinanceExpenseID, gibbonPersonID=:gibbonPersonID, timestamp='" . date("Y-m-d H:i:s") . "', action=:action";
     $result = $connection2->prepare($sql);
     $result->execute($data);
 } catch (PDOException $e) {
     //Fail2
     $URL .= "&editReturn=fail2";
     header("Location: {$URL}");
     break;
     $result = $connection2->prepare($sql);
     $result->execute($data);
 } catch (PDOException $e) {
     print "<div class='error'>" . $e->getMessage() . "</div>";
 }
 if ($result->rowCount() < 1) {
     print "<div class='error'>";
     print _("There are no records to display.");
     print "</div>";
 } else {
     print "<table cellspacing='0' style='width: 100%'>";
     print "<tr class='head'>";
     print "<th>";
     print _("Activity");
     print "</th>";
     $options = getSettingByScope($connection2, "Activities", "activityTypes");
     if ($options != "") {
         print "<th>";
         print _("Type");
         print "</th>";
     }
     print "<th>";
     if ($dateType != "Date") {
         print _("Term");
     } else {
         print _("Dates");
     }
     print "</th>";
     print "<th>";
     print _("Status");
     print "</th>";
示例#4
0
require_once "paypalfunctions.php";
//==================================
// PayPal Express Checkout Module
//==================================
//'------------------------------------
//' The paymentAmount is the total value of
//' the shopping cart, that was set
//' earlier in a session variable
//' by the shopping cart page
//'------------------------------------
$paymentAmount = $_GET["Payment_Amount"];
//'------------------------------------
//' The currencyCodeType and paymentType
//' are set to the selections made on the Integration Assistant
//'------------------------------------
$currency = getSettingByScope($connection2, "System", "currency");
if ($currency != FALSE and $currency != "") {
    $currencyCodeType = substr($currency, 0, 3);
} else {
    $currencyCodeType = "USD";
}
$paymentType = "Sale";
//'------------------------------------
//' The returnURL is the location where buyers return to when a
//' payment has been succesfully authorized.
//'
//' This is set to the value entered on the Integration Assistant
//'------------------------------------
$returnURL = $_SESSION[$guid]["absoluteURL"] . "/" . $_GET["return"];
//'------------------------------------
//' The cancelURL is the location buyers are sent to when they hit the
 try {
     $dataStudents = array("gibbonCourseClassID" => $gibbonCourseClassID);
     $sqlStudents = "SELECT title, surname, preferredName, gibbonPerson.gibbonPersonID, dateStart FROM gibbonCourseClassPerson JOIN gibbonPerson ON (gibbonCourseClassPerson.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE role='Student' AND gibbonCourseClassID=:gibbonCourseClassID 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";
     $resultStudents = $connection2->prepare($sqlStudents);
     $resultStudents->execute($dataStudents);
 } catch (PDOException $e) {
     print "<div class='error'>" . $e->getMessage() . "</div>";
 }
 if ($resultStudents->rowCount() < 1) {
     print "<tr>";
     print "<td colspan=2>";
     print "<i>" . _('There are no records to display.') . "</i>";
     print "</td>";
     print "</tr>";
 } else {
     $PAS = getSettingByScope($connection2, 'System', 'primaryAssessmentScale');
     while ($rowStudents = $resultStudents->fetch()) {
         if ($count % 2 == 0) {
             $rowNum = "even";
         } else {
             $rowNum = "odd";
         }
         $count++;
         //COLOR ROW BY STATUS!
         print "<tr class={$rowNum}>";
         print "<td>";
         print "<div style='padding: 2px 0px'>" . $count . ") <b><a href='index.php?q=/modules/Students/student_view_details.php&gibbonPersonID=" . $rowStudents["gibbonPersonID"] . "&subpage=Markbook#" . $gibbonCourseClassID . "'>" . formatName("", $rowStudents["preferredName"], $rowStudents["surname"], "Student", true) . "</a><br/></div>";
         print "<input name='{$count}-gibbonPersonID' id='{$count}-gibbonPersonID' value='" . $rowStudents["gibbonPersonID"] . "' type='hidden'>";
         print "</td>";
         try {
             $dataEntry = array("gibbonCourseClassID" => $gibbonCourseClassID, "gibbonPersonIDStudent" => $rowStudents["gibbonPersonID"]);
     $sql = "SELECT * FROM gibbonPerson WHERE username=:username OR email=:email";
     $result = $connection2->prepare($sql);
     $result->execute($data);
 } catch (PDOException $e) {
     //Fail 2
     $URL .= "&addReturn=fail2";
     header("Location: {$URL}");
     break;
 }
 if ($result->rowCount() > 0) {
     //Fail 4
     $URL .= "&addReturn=fail4";
     header("Location: {$URL}");
 } else {
     //Check publicRegistrationMinimumAge
     $publicRegistrationMinimumAge = getSettingByScope($connection2, 'User Admin', 'publicRegistrationMinimumAge');
     $ageFail = FALSE;
     if ($publicRegistrationMinimumAge == "") {
         $ageFail = TRUE;
     } else {
         if ($publicRegistrationMinimumAge > 0 and $publicRegistrationMinimumAge > getAge(dateConvertToTimestamp($dob), TRUE, TRUE)) {
             $ageFail = TRUE;
         }
     }
     if ($ageFail == TRUE) {
         //Fail 5
         $URL .= "&addReturn=fail5";
         header("Location: {$URL}");
     } else {
         //Write to database
         try {
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
include "../../config.php";
//New PDO DB connection
try {
    $connection2 = new PDO("mysql:host={$databaseServer};dbname={$databaseName};charset=utf8", $databaseUsername, $databasePassword);
    $connection2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $connection2->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch (PDOException $e) {
    echo $e->getMessage();
}
//Get alternative header names
$attainmentAlternativeName = getSettingByScope($connection2, "Markbook", "attainmentAlternativeName");
$attainmentAlternativeNameAbrev = getSettingByScope($connection2, "Markbook", "attainmentAlternativeNameAbrev");
$effortAlternativeName = getSettingByScope($connection2, "Markbook", "effortAlternativeName");
$effortAlternativeNameAbrev = getSettingByScope($connection2, "Markbook", "effortAlternativeNameAbrev");
@session_start();
$gibbonCourseClassID = $_SESSION[$guid]["exportToExcelParams"];
if (isActionAccessible($guid, $connection2, "/modules/Markbook/markbook_view.php") == FALSE) {
    //Acess denied
    print "<div class='error'>";
    print _("You do not have access to this action.");
    print "</div>";
} else {
    $alert = getAlert($connection2, 02);
    //Count number of columns
    try {
        $data = array("gibbonCourseClassID" => $gibbonCourseClassID);
        $sql = "SELECT * FROM gibbonMarkbookColumn WHERE gibbonCourseClassID=:gibbonCourseClassID ORDER BY complete, completeDate DESC";
        $result = $connection2->prepare($sql);
        $result->execute($data);
示例#8
0
                    print _('Outcomes');
                    ?>
</h3>
								</td>
							</tr>
							<tr>
								<td colspan=2> 
									<p><?php 
                    print _('Link this lesson to outcomes (defined in the Manage Outcomes section of the Planner), and track which outcomes are being met in which lessons.');
                    ?>
</p>
								</td>
							</tr>
							<?php 
                    $type = "outcome";
                    $allowOutcomeEditing = getSettingByScope($connection2, "Planner", "allowOutcomeEditing");
                    $categories = array();
                    $categoryCount = 0;
                    ?>
 
							<style>
								#<?php 
                    print $type;
                    ?>
 { list-style-type: none; margin: 0; padding: 0; width: 100%; }
								#<?php 
                    print $type;
                    ?>
 div.ui-state-default { margin: 0 0px 5px 0px; padding: 5px; font-size: 100%; min-height: 58px; }
								div.ui-state-default_dud { margin: 5px 0px 5px 0px; padding: 5px; font-size: 100%; min-height: 58px; }
								html>body #<?php 
示例#9
0
                    }
                    ?>
					
								</td>
							</tr>
							<?php 
                } else {
                    print "<input type=\"hidden\" name=\"privacy\" value=\"\">";
                }
            }
            if ($imagePrivacySet == false) {
                print "<input type=\"hidden\" name=\"imagePrivacy\" value=\"\">";
            }
            //Student options for agreements
            if ($student) {
                $studentAgreementOptions = getSettingByScope($connection2, "School Admin", "studentAgreementOptions");
                if ($studentAgreementOptions != "") {
                    ?>
							<tr>
								<td> 
									<b><?php 
                    print _('Student Agreements');
                    ?>
</b><br/>
									<span style="font-size: 90%"><i><?php 
                    print _('Check to indicate that student has signed the relevant agreement.');
                    ?>
<br/>
									</i></span>
								</td>
								<td class="right">
示例#10
0
										$("#emailReminder").val('Y');
									}
								 });
							});
						</script>
						<tr class='break emailReminder'>
							<td colspan=2> 
								<h3><?php 
                print _('Email Reminder');
                ?>
</h3>
								<input type='hidden' id='emailReminder' name='emailReminder' value='Y'/>
							</td>
						</tr>
						<?php 
                $email = getSettingByScope($connection2, "Finance", "email");
                if ($email == "") {
                    print "<tr class='emailReminder'>";
                    print "<td colspan=2>";
                    print "<div class='error'>";
                    print _("An outgoing email address has not been set up under Invoice & Receipt Settings, and so no emails can be sent.");
                    print "</div>";
                    print "<input type='hidden' name='email' value='{$email}'/>";
                    print "<td>";
                    print "<tr>";
                } else {
                    print "<input type='hidden' name='email' value='{$email}'/>";
                    if ($row["invoiceTo"] == "Company") {
                        if ($row["companyEmail"] != "" and $row["companyContact"] != "" and $row["companyName"] != "") {
                            ?>
									<tr class='emailReminder'>
示例#11
0
																		var password=new LiveValidation('password');
																		password.add(Validate.Presence);
																		<?php 
                            $alpha = getSettingByScope($connection2, "System", "passwordPolicyAlpha");
                            if ($alpha == "Y") {
                                print "password.add( Validate.Format, { pattern: /.*(?=.*[a-z])(?=.*[A-Z]).*/, failureMessage: \"" . _('Does not meet password policy.') . "\" } );";
                            }
                            $numeric = getSettingByScope($connection2, "System", "passwordPolicyNumeric");
                            if ($numeric == "Y") {
                                print "password.add( Validate.Format, { pattern: /.*[0-9]/, failureMessage: \"" . _('Does not meet password policy.') . "\" } );";
                            }
                            $punctuation = getSettingByScope($connection2, "System", "passwordPolicyNonAlphaNumeric");
                            if ($punctuation == "Y") {
                                print "password.add( Validate.Format, { pattern: /[^a-zA-Z0-9]/, failureMessage: \"" . _('Does not meet password policy.') . "\" } );";
                            }
                            $minLength = getSettingByScope($connection2, "System", "passwordPolicyMinLength");
                            if (is_numeric($minLength)) {
                                print "password.add( Validate.Length, { minimum: " . $minLength . "} );";
                            }
                            ?>
																	 </script>
																</td>
															</tr>
															<tr>
																<td> 
																	<b><?php 
                            print _('Confirm Password');
                            ?>
 *</b><br/>
																	<span style="font-size: 90%"><i></i></span>
																</td>
                 print _("A welcome email was successfully sent to") . " " . formatName("", $informStudentEntry["preferredName"], $informStudentEntry["surname"], "Student") . ".";
                 print "</div>";
             } else {
                 print "<div class='error'>";
                 print _("A welcome email could not be sent to") . " " . formatName("", $informStudentEntry["preferredName"], $informStudentEntry["surname"], "Student") . ".";
                 print "</div>";
             }
         }
     }
 }
 //SEND PARENTS EMAIL
 if ($informParents == "Y") {
     print "<h4>";
     print "Parent Welcome Email";
     print "</h4>";
     $notificationParentsMessage = getSettingByScope($connection2, "Application Form", "notificationParentsMessage");
     foreach ($informParentsArray as $informParentsEntry) {
         if ($informParentsEntry["email"] != "" and $informParentsEntry["surname"] != "" and $informParentsEntry["preferredName"] != "" and $informParentsEntry["username"] != "" and $informParentsEntry["password"]) {
             $to = $informParentsEntry["email"];
             $subject = sprintf(_('Welcome to %1$s at %2$s'), $_SESSION[$guid]["systemName"], $_SESSION[$guid]["organisationNameShort"]);
             if ($notificationParentsMessage != "") {
                 $body = sprintf(_('Dear %1$s,\\n\\nWelcome to %2$s, %3$s\'s system for managing school information. You can access the system by going to %4$s and logging in with your new username (%5$s) and password (%6$s). You can learn more about using %7$s on the official support website (https://gibbonedu.org/support/parents).\\n\\nIn order to maintain the security of your data, we highly recommend you change your password to something easy to remember but hard to guess. This can be done by using the Preferences page after logging in (top-right of the screen).\\n\\n'), formatName("", $informParentsEntry["preferredName"], $informParentsEntry["surname"], "Student"), $_SESSION[$guid]["systemName"], $_SESSION[$guid]["organisationNameShort"], $_SESSION[$guid]["absoluteURL"], $informParentsEntry["username"], $informParentsEntry["password"], $_SESSION[$guid]["systemName"]) . $notificationParentsMessage . sprintf(_('\\n\\nPlease feel free to reply to this email should you have any questions.\\n\\n%1$s,\\n\\n%2$s Administrator'), $_SESSION[$guid]["organisationAdministratorName"], $_SESSION[$guid]["systemName"]);
             } else {
                 $body = sprintf(_('Dear %1$s,\\n\\nWelcome to %2$s, %3$s\'s system for managing school information. You can access the system by going to %4$s and logging in with your new username (%5$s) and password (%6$s). You can learn more about using %7$s on the official support website (https://gibbonedu.org/support/parents).\\n\\nIn order to maintain the security of your data, we highly recommend you change your password to something easy to remember but hard to guess. This can be done by using the Preferences page after logging in (top-right of the screen).\\n\\n'), formatName("", $informParentsEntry["preferredName"], $informParentsEntry["surname"], "Student"), $_SESSION[$guid]["systemName"], $_SESSION[$guid]["organisationNameShort"], $_SESSION[$guid]["absoluteURL"], $informParentsEntry["username"], $informParentsEntry["password"], $_SESSION[$guid]["systemName"]) . sprintf(_('\\n\\nPlease feel free to reply to this email should you have any questions.\\n\\n%1$s,\\n\\n%2$s Administrator'), $_SESSION[$guid]["organisationAdministratorName"], $_SESSION[$guid]["systemName"]);
             }
             $headers = "From: " . $_SESSION[$guid]["organisationAdministratorEmail"];
             if (mail($to, $subject, $body, $headers)) {
                 print "<div class='success'>";
                 print _("A welcome email was successfully sent to") . " " . formatName("", $informParentsEntry["preferredName"], $informParentsEntry["surname"], "Student") . ".";
                 print "</div>";
             } else {
示例#13
0
                            print _("Submit");
                            ?>
">
								</td>
							</tr>
						</table>
					</form>
					<?php 
                        }
                    }
                    $gibbonPersonID = NULL;
                    if (isset($_GET["search"])) {
                        $gibbonPersonID = $_GET["search"];
                    }
                    $showParentAttainmentWarning = getSettingByScope($connection2, "Markbook", "showParentAttainmentWarning");
                    $showParentEffortWarning = getSettingByScope($connection2, "Markbook", "showParentEffortWarning");
                    if ($gibbonPersonID != "" and $count > 0) {
                        //Confirm access to this student
                        try {
                            $dataChild = array("gibbonPersonID" => $gibbonPersonID, "gibbonPersonID2" => $_SESSION[$guid]["gibbonPersonID"]);
                            $sqlChild = "SELECT * FROM gibbonFamilyChild JOIN gibbonFamily ON (gibbonFamilyChild.gibbonFamilyID=gibbonFamily.gibbonFamilyID) JOIN gibbonFamilyAdult ON (gibbonFamilyAdult.gibbonFamilyID=gibbonFamily.gibbonFamilyID) JOIN gibbonPerson ON (gibbonFamilyChild.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE gibbonPerson.status='Full' AND (dateStart IS NULL OR dateStart<='" . date("Y-m-d") . "') AND (dateEnd IS NULL  OR dateEnd>='" . date("Y-m-d") . "') AND gibbonFamilyChild.gibbonPersonID=:gibbonPersonID AND gibbonFamilyAdult.gibbonPersonID=:gibbonPersonID2 AND childDataAccess='Y'";
                            $resultChild = $connection2->prepare($sqlChild);
                            $resultChild->execute($dataChild);
                        } catch (PDOException $e) {
                            print "<div class='error'>" . $e->getMessage() . "</div>";
                        }
                        if ($resultChild->rowCount() < 1) {
                            print "<div class='error'>";
                            print _("The selected record does not exist, or you do not have access to it.");
                            print "</div>";
                        } else {
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@session_start();
if (isActionAccessible($guid, $connection2, "/modules/Students/student_view_details_notes_add.php") == FALSE) {
    //Acess denied
    print "<div class='error'>";
    print _("You do not have access to this action.");
    print "</div>";
} else {
    $enableStudentNotes = getSettingByScope($connection2, "Students", "enableStudentNotes");
    if ($enableStudentNotes != "Y") {
        print "<div class='error'>";
        print _("You do not have access to this action.");
        print "</div>";
    } else {
        $gibbonPersonID = $_GET["gibbonPersonID"];
        $subpage = $_GET["subpage"];
        if ($gibbonPersonID == "" or $subpage == "") {
            print "<div class='error'>";
            print _("You have not specified one or more required parameters.");
            print "</div>";
        } else {
            try {
                $data = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"], "gibbonPersonID" => $gibbonPersonID);
                $sql = "SELECT * FROM gibbonPerson JOIN gibbonStudentEnrolment ON (gibbonPerson.gibbonPersonID=gibbonStudentEnrolment.gibbonPersonID) WHERE 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") . "') AND gibbonPerson.gibbonPersonID=:gibbonPersonID";
     $resultHomework = $connection2->prepare($sqlHomework);
     $resultHomework->execute($dataHomework);
 } catch (PDOException $e) {
     $homework .= $e->getMessage();
 }
 if ($resultHomework->rowCount() > 0) {
     $homework .= "<ul>";
     while ($rowHomework = $resultHomework->fetch()) {
         $homework .= "<li><b>" . $rowHomework["course"] . "." . $rowHomework["class"] . "</b> - " . $rowHomework["name"] . " - " . sprintf(_('Due on %1$s at %2$s.'), dateConvertBack($guid, substr($rowHomework["homeworkDueDateTime"], 0, 10)), substr($rowHomework["homeworkDueDateTime"], 11, 5)) . "</li>";
     }
     $homework .= "</ul><br/>";
 } else {
     $homework .= _("There are no records to display.") . "<br/><br/>";
 }
 $behaviour = "";
 $parentWeeklyEmailSummaryIncludeBehaviour = getSettingByScope($connection2, "Planner", "parentWeeklyEmailSummaryIncludeBehaviour");
 if ($parentWeeklyEmailSummaryIncludeBehaviour == "Y") {
     //Get behaviour records for the past week, ready for email
     $behaviour .= "<h2>" . _('Behaviour') . "</h2>";
     try {
         $dataBehaviourPositive = array("gibbonPersonID" => $row["gibbonPersonID"], "gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"]);
         $sqlBehaviourPositive = "SELECT * FROM gibbonBehaviour WHERE gibbonPersonID=:gibbonPersonID AND gibbonSchoolYearID=:gibbonSchoolYearID AND type='Positive' AND date>'" . date('Y-m-d', strtotime("-1 week")) . "' AND date<='" . date("Y-m-d") . "'";
         $resultBehaviourPositive = $connection2->prepare($sqlBehaviourPositive);
         $resultBehaviourPositive->execute($dataBehaviourPositive);
     } catch (PDOException $e) {
     }
     try {
         $dataBehaviourNegative = array("gibbonPersonID" => $row["gibbonPersonID"], "gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"]);
         $sqlBehaviourNegative = "SELECT * FROM gibbonBehaviour WHERE gibbonPersonID=:gibbonPersonID AND gibbonSchoolYearID=:gibbonSchoolYearID AND type='Negative' AND date>'" . date('Y-m-d', strtotime("-1 week")) . "' AND date<='" . date("Y-m-d") . "'";
         $resultBehaviourNegative = $connection2->prepare($sqlBehaviourNegative);
         $resultBehaviourNegative->execute($dataBehaviourNegative);
示例#16
0
     $budgets = getBudgetsByPerson($connection2, $_SESSION[$guid]["gibbonPersonID"]);
     foreach ($budgets as $budget) {
         if ($budget[2] == "Full" or $budget[2] == "Write") {
             $budgetsAccess = TRUE;
         }
     }
 }
 if ($budgetsAccess == FALSE) {
     print "<div class='error'>";
     print _("You do not have Full or Write access to any budgets.");
     print "</div>";
 } else {
     //Get and check settings
     $expenseApprovalType = getSettingByScope($connection2, "Finance", "expenseApprovalType");
     $budgetLevelExpenseApproval = getSettingByScope($connection2, "Finance", "budgetLevelExpenseApproval");
     $expenseRequestTemplate = getSettingByScope($connection2, "Finance", "expenseRequestTemplate");
     if ($expenseApprovalType == "" or $budgetLevelExpenseApproval == "") {
         print "<div class='error'>";
         print _("An error has occurred with your expense and budget settings.");
         print "</div>";
     } else {
         //Check if there are approvers
         try {
             $data = array();
             $sql = "SELECT * FROM gibbonFinanceExpenseApprover JOIN gibbonPerson ON (gibbonFinanceExpenseApprover.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE status='Full'";
             $result = $connection2->prepare($sql);
             $result->execute($data);
         } catch (PDOException $e) {
             print $e->getMessage();
         }
         if ($result->rowCount() < 1) {
示例#17
0
										</form>
										<?php 
                                    }
                                }
                            }
                        }
                    } else {
                        if ($mode = "unregister") {
                            if ($continue == FALSE) {
                                print "<div class='error'>";
                                print _("Your request failed due to a database error.");
                                print "</div>";
                            } else {
                                $today = date("Y-m-d");
                                //Should we show date as term or date?
                                $dateType = getSettingByScope($connection2, "Activities", "dateType");
                                try {
                                    if ($dateType != "Date") {
                                        $data = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"], "gibbonPersonID" => $gibbonPersonID, "gibbonActivityID" => $gibbonActivityID);
                                        $sql = "SELECT DISTINCT gibbonActivity.* FROM gibbonActivity JOIN gibbonStudentEnrolment ON (gibbonActivity.gibbonYearGroupIDList LIKE concat( '%', gibbonStudentEnrolment.gibbonYearGroupID, '%' )) WHERE gibbonActivity.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonPersonID=:gibbonPersonID AND gibbonActivityID=:gibbonActivityID AND NOT gibbonSchoolYearTermIDList='' AND active='Y' {$and}";
                                    } else {
                                        $data = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"], "gibbonPersonID" => $gibbonPersonID, "gibbonActivityID" => $gibbonActivityID, "listingStart" => $today, "listingEnd" => $today);
                                        $sql = "SELECT DISTINCT gibbonActivity.* FROM gibbonActivity JOIN gibbonStudentEnrolment ON (gibbonActivity.gibbonYearGroupIDList LIKE concat( '%', gibbonStudentEnrolment.gibbonYearGroupID, '%' )) WHERE gibbonActivity.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonPersonID=:gibbonPersonID AND gibbonActivityID=:gibbonActivityID AND listingStart<=:listingStart AND listingEnd>=:listingEnd AND active='Y' {$and}";
                                    }
                                    $result = $connection2->prepare($sql);
                                    $result->execute($data);
                                } catch (PDOException $e) {
                                    print "<div class='error'>" . $e->getMessage() . "</div>";
                                }
                                if ($result->rowCount() != 1) {
                                    print "<div class='error'>";
示例#18
0
            ?>
</option>
							</select>
						</td>
					</tr>
					<tr id="accessRowParents">
						<td> 
							<b><?php 
            print _('Viewable to Parents');
            ?>
 *</b><br/>
							<span style="font-size: 90%"><i></i></span>
						</td>
						<td class="right">
							<?php 
            $sharingDefaultParents = getSettingByScope($connection2, "Planner", "sharingDefaultParents");
            ?>
							<select name="viewableParents" id="viewableParents" style="width: 302px">
								<option <?php 
            if ($sharingDefaultParents == "Y") {
                print "selected";
            }
            ?>
 value="Y"><?php 
            print _('Yes');
            ?>
</option>
								<option <?php 
            if ($sharingDefaultParents == "N") {
                print "selected";
            }
示例#19
0
     $budgetsAccess = TRUE;
 } else {
     foreach ($budgets as $budget) {
         if ($budget[2] == "Full" or $budget[2] == "Write" or $budget[2] == "READ") {
             $budgetsAccess = TRUE;
         }
     }
 }
 if ($budgetsAccess == FALSE) {
     print "<div class='error'>";
     print _("You do not have Full or Write access to any budgets.");
     print "</div>";
 } else {
     //Get and check settings
     $expenseApprovalType = getSettingByScope($connection2, "Finance", "expenseApprovalType");
     $budgetLevelExpenseApproval = getSettingByScope($connection2, "Finance", "budgetLevelExpenseApproval");
     if ($expenseApprovalType == "" or $budgetLevelExpenseApproval == "") {
         print "<div class='error'>";
         print _("An error has occurred with your expense and budget settings.");
         print "</div>";
     } else {
         //Check if there are approvers
         try {
             $data = array();
             $sql = "SELECT * FROM gibbonFinanceExpenseApprover JOIN gibbonPerson ON (gibbonFinanceExpenseApprover.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE status='Full'";
             $result = $connection2->prepare($sql);
             $result->execute($data);
         } catch (PDOException $e) {
             print $e->getMessage();
         }
         if ($result->rowCount() < 1) {
//Gibbon system-wide includes
include "./functions.php";
include "./config.php";
//New PDO DB connection
try {
    $connection2 = new PDO("mysql:host={$databaseServer};dbname={$databaseName};charset=utf8", $databaseUsername, $databasePassword);
    $connection2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $connection2->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch (PDOException $e) {
    echo $e->getMessage();
}
$output = "";
//CHECK FOR SYSTEM ALARM
if (isset($_SESSION[$guid]["gibbonRoleIDCurrentCategory"])) {
    if ($_SESSION[$guid]["gibbonRoleIDCurrentCategory"] == "Staff") {
        $alarm = getSettingByScope($connection2, "System", "alarm");
        if ($alarm == "General" or $alarm == "Lockdown") {
            $type = "general";
            if ($alarm == "Lockdown") {
                $type = "lockdown";
            }
            $output .= "<script>\n\t\t\t\tif (\$('div#TB_window').is(':visible')==true && \$('div#TB_window').attr('class')!='alarm') {\n\t\t\t\t\t\$(\"#TB_window\").remove();\n\t\t\t\t\t\$(\"body\").append(\"<div id='TB_window'></div>\");\n\t\t\t\t}\n\t\t\t\tif (\$('div#TB_window').is(':visible')===false) {\n\t\t\t\t\tvar url = '" . $_SESSION[$guid]["absoluteURL"] . "/index_notification_ajax_alarm.php?type=" . $type . "&KeepThis=true&TB_iframe=true&width=1000&height=500';\n\t\t\t\t\ttb_show('', url);\n\t\t\t\t\t\$('div#TB_window').addClass('alarm') ;\n\t\t\t\t}\n\t\t\t</script>";
        } else {
            $output .= "<script>\n\t\t\t\tif (\$('div#TB_window').is(':visible')==true && \$('div#TB_window').attr('class')=='alarm') {\n\t\t\t\t\ttb_remove();\n\t\t\t\t}\n\t\t\t</script>";
        }
    }
}
//GET & SHOW NOTIFICATIONS
try {
    $dataNotifications = array("gibbonPersonID" => @$_SESSION[$guid]["gibbonPersonID"], "gibbonPersonID2" => @$_SESSION[$guid]["gibbonPersonID"]);
    $sqlNotifications = "(SELECT gibbonNotification.*, gibbonModule.name AS source FROM gibbonNotification JOIN gibbonModule ON (gibbonNotification.gibbonModuleID=gibbonModule.gibbonModuleID) WHERE gibbonPersonID=:gibbonPersonID)\n\tUNION\n\t(SELECT gibbonNotification.*, 'System' AS source FROM gibbonNotification WHERE gibbonModuleID IS NULL AND gibbonPersonID=:gibbonPersonID2)\n\tORDER BY timestamp DESC, source, text";
示例#21
0
function receiptContents($guid, $connection2, $gibbonFinanceInvoiceID, $gibbonSchoolYearID, $currency = "", $email = FALSE)
{
    $return = "";
    try {
        $data = array("gibbonSchoolYearID" => $gibbonSchoolYearID, "gibbonSchoolYearID2" => $gibbonSchoolYearID, "gibbonFinanceInvoiceID" => $gibbonFinanceInvoiceID);
        $sql = "SELECT gibbonPerson.gibbonPersonID, studentID, surname, preferredName, gibbonFinanceInvoice.*, companyContact, companyName, companyAddress, gibbonRollGroup.name AS rollgroup FROM gibbonFinanceInvoice JOIN gibbonFinanceInvoicee ON (gibbonFinanceInvoice.gibbonFinanceInvoiceeID=gibbonFinanceInvoicee.gibbonFinanceInvoiceeID) JOIN gibbonPerson ON (gibbonFinanceInvoicee.gibbonPersonID=gibbonPerson.gibbonPersonID) JOIN gibbonStudentEnrolment ON (gibbonStudentEnrolment.gibbonPersonID=gibbonPerson.gibbonPersonID) JOIN gibbonRollGroup ON (gibbonStudentEnrolment.gibbonRollGroupID=gibbonRollGroup.gibbonRollGroupID) WHERE gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID2 AND gibbonFinanceInvoice.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonFinanceInvoiceID=:gibbonFinanceInvoiceID";
        $result = $connection2->prepare($sql);
        $result->execute($data);
    } catch (PDOException $e) {
        $return = FALSE;
    }
    if ($result->rowCount() == 1) {
        //Let's go!
        $row = $result->fetch();
        if ($email == TRUE) {
            $return .= "<div style='width: 100%; text-align: right'>";
            $return .= "<a target='_blank' href='" . $_SESSION[$guid]["absoluteURL"] . "'><img height='100px' width='400px' class='School Logo' alt='Logo' src='" . $_SESSION[$guid]["absoluteURL"] . "/" . $_SESSION[$guid]["organisationLogo"] . "'/></a>";
            $return .= "</div>";
        }
        //Receipt Text
        $receiptText = getSettingByScope($connection2, "Finance", "receiptText");
        if ($receiptText != "") {
            $return .= "<p>";
            $return .= $receiptText;
            $return .= "</p>";
        }
        $style = "";
        $style2 = "";
        $style3 = "";
        $style4 = "";
        if ($email == TRUE) {
            $style = "border-top: 1px solid #333; ";
            $style2 = "border-bottom: 1px solid #333; ";
            $style3 = "background-color: #f0f0f0; ";
            $style4 = "background-color: #f6f6f6; ";
        }
        //Receipt Details
        $return .= "<table cellspacing='0' style='width: 100%'>";
        $return .= "<tr>";
        $return .= "<td style='padding-top: 15px; padding-left: 10px; vertical-align: top; {$style} {$style3}' colspan=3>";
        $return .= "<span style='font-size: 115%; font-weight: bold'>" . _('Receipt To') . " (" . $row["invoiceTo"] . ")</span><br/>";
        if ($row["invoiceTo"] == "Company") {
            $invoiceTo = "";
            if ($row["companyContact"] != "") {
                $invoiceTo .= $row["companyContact"] . ", ";
            }
            if ($row["companyName"] != "") {
                $invoiceTo .= $row["companyName"] . ", ";
            }
            if ($row["companyAddress"] != "") {
                $invoiceTo .= $row["companyAddress"] . ", ";
            }
            $return .= substr($invoiceTo, 0, -2);
        } else {
            try {
                $dataParents = array("gibbonFinanceInvoiceeID" => $row["gibbonFinanceInvoiceeID"]);
                $sqlParents = "SELECT parent.title, parent.surname, parent.preferredName, parent.email, parent.address1, parent.address1District, parent.address1Country, homeAddress, homeAddressDistrict, homeAddressCountry FROM gibbonFinanceInvoicee JOIN gibbonPerson AS student ON (gibbonFinanceInvoicee.gibbonPersonID=student.gibbonPersonID) JOIN gibbonFamilyChild ON (gibbonFamilyChild.gibbonPersonID=student.gibbonPersonID) JOIN gibbonFamily ON (gibbonFamilyChild.gibbonFamilyID=gibbonFamily.gibbonFamilyID) JOIN gibbonFamilyAdult ON (gibbonFamily.gibbonFamilyID=gibbonFamilyAdult.gibbonFamilyID) JOIN gibbonPerson AS parent ON (gibbonFamilyAdult.gibbonPersonID=parent.gibbonPersonID) WHERE gibbonFinanceInvoiceeID=:gibbonFinanceInvoiceeID AND (contactPriority=1 OR (contactPriority=2 AND contactEmail='Y')) ORDER BY contactPriority, surname, preferredName";
                $resultParents = $connection2->prepare($sqlParents);
                $resultParents->execute($dataParents);
            } catch (PDOException $e) {
                $return .= "<div class='error'>" . $e->getMessage() . "</div>";
            }
            if ($resultParents->rowCount() < 1) {
                $return .= "<div class='warning'>" . _('There are no family members available to send this receipt to.') . "</div>";
            } else {
                $return .= "<ul style='margin-top: 3px; margin-bottom: 3px'>";
                while ($rowParents = $resultParents->fetch()) {
                    $return .= "<li>";
                    $invoiceTo = "";
                    $invoiceTo .= "<b>" . formatName(htmlPrep($rowParents["title"]), htmlPrep($rowParents["preferredName"]), htmlPrep($rowParents["surname"]), "Parent", false) . "</b>, ";
                    if ($rowParents["address1"] != "") {
                        $invoiceTo .= $rowParents["address1"] . ", ";
                        if ($rowParents["address1District"] != "") {
                            $invoiceTo .= $rowParents["address1District"] . ", ";
                        }
                        if ($rowParents["address1Country"] != "") {
                            $invoiceTo .= $rowParents["address1Country"] . ", ";
                        }
                    } else {
                        $invoiceTo .= $rowParents["homeAddress"] . ", ";
                        if ($rowParents["homeAddressDistrict"] != "") {
                            $invoiceTo .= $rowParents["homeAddressDistrict"] . ", ";
                        }
                        if ($rowParents["homeAddressCountry"] != "") {
                            $invoiceTo .= $rowParents["homeAddressCountry"] . ", ";
                        }
                    }
                    $return .= substr($invoiceTo, 0, -2);
                    $return .= "</li>";
                }
                $return .= "</ul>";
            }
        }
        $return .= "</td>";
        $return .= "</tr>";
        $return .= "<tr>";
        $return .= "<td style='width: 33%; padding-top: 15px; padding-left: 10px; vertical-align: top; {$style} {$style4}'>";
        $return .= "<span style='font-size: 115%; font-weight: bold'>" . _('Fees For') . "</span><br/>";
        $return .= formatName("", htmlPrep($row["preferredName"]), htmlPrep($row["surname"]), "Student", true) . "<br/><span style='font-style: italic; font-size: 85%'>" . _('Roll Group') . " " . $row["rollgroup"] . "</span><br/>";
        $return .= "</td>";
        $return .= "<td style='width: 33%; padding-top: 15px; vertical-align: top; {$style} {$style4}'>";
        $return .= "<span style='font-size: 115%; font-weight: bold'>" . _('Status') . "</span><br/>";
        $return .= $row["status"];
        $return .= "</td>";
        $return .= "<td style='width: 33%; padding-top: 15px; vertical-align: top; {$style} {$style4}'>";
        $return .= "<span style='font-size: 115%; font-weight: bold'>" . _('Schedule') . "</span><br/>";
        if ($row["billingScheduleType"] == "Ad Hoc") {
            $return .= _("Ad Hoc");
        } else {
            try {
                $dataSched = array("gibbonFinanceBillingScheduleID" => $row["gibbonFinanceBillingScheduleID"]);
                $sqlSched = "SELECT * FROM gibbonFinanceBillingSchedule WHERE gibbonFinanceBillingScheduleID=:gibbonFinanceBillingScheduleID";
                $resultSched = $connection2->prepare($sqlSched);
                $resultSched->execute($dataSched);
            } catch (PDOException $e) {
                $return .= "<div class='error'>" . $e->getMessage() . "</div>";
            }
            if ($resultSched->rowCount() == 1) {
                $rowSched = $resultSched->fetch();
                $return .= $rowSched["name"];
            }
        }
        $return .= "</td>";
        $return .= "</tr>";
        $return .= "<tr>";
        $return .= "<td style='width: 33%; padding-top: 15px; padding-left: 10px; vertical-align: top; {$style} {$style2} {$style3}'>";
        $return .= "<span style='font-size: 115%; font-weight: bold'>" . _('Due Date') . "</span><br/>";
        $return .= dateConvertBack($guid, $row["invoiceDueDate"]);
        $return .= "</td>";
        $return .= "<td style='width: 33%; padding-top: 15px; vertical-align: top; {$style} {$style2} {$style3}'>";
        $return .= "<span style='font-size: 115%; font-weight: bold'>" . _('Date Paid') . "</span><br/>";
        $return .= dateConvertBack($guid, $row["paidDate"]);
        $return .= "</td>";
        $return .= "<td style='width: 33%; padding-top: 15px; vertical-align: top; {$style} {$style2} {$style3}'>";
        $return .= "<span style='font-size: 115%; font-weight: bold'>" . _('Invoice Number') . "</span><br/>";
        $invoiceNumber = getSettingByScope($connection2, "Finance", "invoiceNumber");
        if ($invoiceNumber == "Person ID + Invoice ID") {
            $return .= ltrim($row["gibbonPersonID"], "0") . "-" . ltrim($gibbonFinanceInvoiceID, "0");
        } else {
            if ($invoiceNumber == "Student ID + Invoice ID") {
                $return .= ltrim($row["studentID"], "0") . "-" . ltrim($gibbonFinanceInvoiceID, "0");
            } else {
                $return .= ltrim($gibbonFinanceInvoiceID, "0");
            }
        }
        $return .= "</td>";
        $return .= "</tr>";
        $return .= "</table>";
        //Fee table
        $return .= "<h3 style='padding-top: 40px; padding-left: 10px; margin: 0px; {$style4}'>";
        $return .= _("Fee Table");
        $return .= "</h3>";
        $feeTotal = 0;
        try {
            $dataFees["gibbonFinanceInvoiceID"] = $row["gibbonFinanceInvoiceID"];
            $sqlFees = "SELECT gibbonFinanceInvoiceFee.gibbonFinanceInvoiceFeeID, gibbonFinanceInvoiceFee.feeType, gibbonFinanceFeeCategory.name AS category, gibbonFinanceInvoiceFee.name AS name, gibbonFinanceInvoiceFee.fee, gibbonFinanceInvoiceFee.description AS description, NULL AS gibbonFinanceFeeID, gibbonFinanceInvoiceFee.gibbonFinanceFeeCategoryID AS gibbonFinanceFeeCategoryID, sequenceNumber FROM gibbonFinanceInvoiceFee JOIN gibbonFinanceFeeCategory ON (gibbonFinanceInvoiceFee.gibbonFinanceFeeCategoryID=gibbonFinanceFeeCategory.gibbonFinanceFeeCategoryID) WHERE gibbonFinanceInvoiceID=:gibbonFinanceInvoiceID ORDER BY sequenceNumber";
            $resultFees = $connection2->prepare($sqlFees);
            $resultFees->execute($dataFees);
        } catch (PDOException $e) {
            $return .= "<div class='error'>" . $e->getMessage() . "</div>";
        }
        if ($resultFees->rowCount() < 1) {
            $return .= "<div class='error'>";
            $return .= _("There are no records to display");
            $return .= "</div>";
        } else {
            $return .= "<table cellspacing='0' style='width: 100%; {$style4}'>";
            $return .= "<tr class='head'>";
            $return .= "<th style='text-align: left; padding-left: 10px'>";
            $return .= _("Name");
            $return .= "</th>";
            $return .= "<th style='text-align: left'>";
            $return .= _("Category");
            $return .= "</th>";
            $return .= "<th style='text-align: left'>";
            $return .= _("Description");
            $return .= "</th>";
            $return .= "<th style='text-align: left'>";
            $return .= _("Fee") . "<br/>";
            if ($currency != "") {
                $return .= "<span style='font-style: italic; font-size: 85%'>" . $currency . "</span>";
            }
            $return .= "</th>";
            $return .= "</tr>";
            $count = 0;
            $rowNum = "odd";
            while ($rowFees = $resultFees->fetch()) {
                if ($count % 2 == 0) {
                    $rowNum = "even";
                } else {
                    $rowNum = "odd";
                }
                $count++;
                $return .= "<tr style='height: 25px' class={$rowNum}>";
                $return .= "<td style='padding-left: 10px'>";
                $return .= $rowFees["name"];
                $return .= "</td>";
                $return .= "<td>";
                $return .= $rowFees["category"];
                $return .= "</td>";
                $return .= "<td>";
                $return .= $rowFees["description"];
                $return .= "</td>";
                $return .= "<td>";
                if (substr($currency, 4) != "") {
                    $return .= substr($currency, 4) . " ";
                }
                $return .= number_format($rowFees["fee"], 2, ".", ",");
                $feeTotal += $rowFees["fee"];
                $return .= "</td>";
                $return .= "</tr>";
            }
            $return .= "<tr style='height: 35px'>";
            $return .= "<td colspan=3 style='text-align: right'>";
            $return .= "<b>" . _('Invoice Total:') . "</b>";
            $return .= "</td>";
            $return .= "<td>";
            if (substr($currency, 4) != "") {
                $return .= substr($currency, 4) . " ";
            }
            $return .= "<b>" . number_format($feeTotal, 2, ".", ",") . "</b>";
            $return .= "</td>";
            $return .= "</tr>";
            $return .= "<tr style='height: 35px' class='current'>";
            $return .= "<td colspan=3 style='text-align: right; {$style2}'>";
            $return .= "<b>" . _('Amount Paid:') . "</b>";
            $return .= "</td>";
            $return .= "<td style='{$style2}'>";
            if (substr($currency, 4) != "") {
                $return .= substr($currency, 4) . " ";
            }
            $return .= "<b>" . number_format($row["paidAmount"], 2, ".", ",") . "</b>";
            $return .= "</td>";
            $return .= "</tr>";
        }
        $return .= "</table>";
        //Invoice Notes
        $receiptNotes = getSettingByScope($connection2, "Finance", "receiptNotes");
        if ($receiptNotes != "") {
            $return .= "<h3 style='margin-top: 40px'>";
            $return .= _("Notes");
            $return .= "</h3>";
            $return .= "<p>";
            $return .= $receiptNotes;
            $return .= "</p>";
        }
        return $return;
    }
}
示例#22
0
                        ?>
 *</b><br/>
									</td>
									<td class="right">
										<input name="description" id="description" maxlength=1000 value="<?php 
                        print htmlPrep($row2["description"]);
                        ?>
" type="text" style="width: 300px">
										<script type="text/javascript">
											var description=new LiveValidation('description');
											description.add(Validate.Presence);
										</script>
									</td>
								</tr>
								<?php 
                        $types = getSettingByScope($connection2, "Markbook", "markbookType");
                        if ($types != FALSE) {
                            $types = explode(",", $types);
                            ?>
									<tr>
										<td> 
											<b><?php 
                            print _('Type');
                            ?>
 *</b><br/>
											<span style="font-size: 90%"><i></i></span>
										</td>
										<td class="right">
											<select name="type" id="type" style="width: 302px">
												<option value="Please select..."><?php 
                            print _('Please select...');
示例#23
0
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@session_start();
//Module includes
include "./modules/" . $_SESSION[$guid]["module"] . "/moduleFunctions.php";
$makeUnitsPublic = getSettingByScope($connection2, "Planner", "makeUnitsPublic");
if ($makeUnitsPublic != "Y") {
    //Acess denied
    print "<div class='error'>";
    print _("Your request failed because you do not have access to this action.");
    print "</div>";
} else {
    print "<div class='trail'>";
    print "<div class='trailHead'><a href='" . $_SESSION[$guid]["absoluteURL"] . "'>" . _("Home") . "</a> > <a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Planner/units_public.php&gibbonSchoolYearID=" . $_GET["gibbonSchoolYearID"] . "'>" . _("Learn With Us") . "</a> > </div><div class='trailEnd'>" . _('View Unit') . "</div>";
    print "</div>";
    //Check if courseschool year specified
    $gibbonSchoolYearID = $_GET["gibbonSchoolYearID"];
    $gibbonUnitID = $_GET["gibbonUnitID"];
    if ($gibbonUnitID == "" or $gibbonSchoolYearID == "") {
        print "<div class='error'>";
        print _("You have not specified one or more required parameters.");
示例#24
0
	PayPal API Module
	 
	Defines all the global variables and the wrapper functions 
	********************************************/
$PROXY_HOST = '127.0.0.1';
$PROXY_PORT = '808';
$SandboxFlag = false;
//'------------------------------------
//' PayPal API Credentials
//' Replace <API_USERNAME> with your API Username
//' Replace <API_PASSWORD> with your API Password
//' Replace <API_SIGNATURE> with your Signature
//'------------------------------------
$API_UserName = getSettingByScope($connection2, "System", "paypalAPIUsername");
$API_Password = getSettingByScope($connection2, "System", "paypalAPIPassword");
$API_Signature = getSettingByScope($connection2, "System", "paypalAPISignature");
// BN Code 	is only applicable for partners
$sBNCode = "PP-ECWizard";
/*	
' Define the PayPal Redirect URLs.  
' 	This is the URL that the buyer is first sent to do authorize payment with their paypal account
' 	change the URL depending if you are testing on the sandbox or the live PayPal site
'
' For the sandbox, the URL is       https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=
' For the live site, the URL is        https://www.paypal.com/webscr&cmd=_express-checkout&token=
*/
if ($SandboxFlag == true) {
    $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
    $PAYPAL_URL = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
} else {
    $API_Endpoint = "https://api-3t.paypal.com/nvp";
     $result = $connection2->prepare($sql);
     $result->execute($data);
 } catch (PDOException $e) {
     //Fail2
     $URL .= "&deleteReturn=fail2";
     header("Location: {$URL}");
     break;
 }
 if ($result->rowCount() != 1) {
     //Fail 2
     $URL .= "&updateReturn=fail2";
     header("Location: {$URL}");
 } else {
     //Validate Inputs
     $gibbonPersonID = $_POST["gibbonPersonID"];
     $expenseApprovalType = getSettingByScope($connection2, "Finance", "expenseApprovalType");
     $sequenceNumber = NULL;
     if ($expenseApprovalType == "Chain Of All") {
         $sequenceNumber = $_POST["sequenceNumber"];
     }
     if ($gibbonPersonID == "" or $expenseApprovalType == "Y" and $sequenceNumber == "") {
         //Fail 3
         $URL .= "&updateReturn=fail3";
         header("Location: {$URL}");
     } else {
         //Check unique inputs for uniquness
         try {
             if ($expenseApprovalType == "Chain Of All") {
                 $data = array("gibbonPersonID" => $gibbonPersonID, "sequenceNumber" => $sequenceNumber, "gibbonFinanceExpenseApproverID" => $gibbonFinanceExpenseApproverID);
                 $sql = "SELECT * FROM gibbonFinanceExpenseApprover WHERE (gibbonPersonID=:gibbonPersonID OR sequenceNumber=:sequenceNumber) AND NOT gibbonFinanceExpenseApproverID=:gibbonFinanceExpenseApproverID";
             } else {
                $sqlSelect = "SELECT gibbonPersonID, surname, preferredName, status FROM gibbonPerson WHERE gibbonPersonID=:gibbonPersonID ORDER BY surname, preferredName";
                $resultSelect = $connection2->prepare($sqlSelect);
                $resultSelect->execute($dataSelect);
            } catch (PDOException $e) {
            }
            if ($resultSelect->rowCount() == 1) {
                $rowSelect = $resultSelect->fetch();
                print "<input readonly name='gibbonPersonIDStatusResponsiblename' id='gibbonPersonIDStatusResponsiblename' value='" . formatName("", htmlPrep($rowSelect["preferredName"]), htmlPrep($rowSelect["surname"]), "Student", true) . "' type='text' style='width: 300px'>";
                print "<input name='gibbonPersonIDStatusResponsible' id='gibbonPersonIDStatusResponsible' value='" . $row["gibbonPersonIDStatusResponsible"] . "' type='hidden' style='width: 300px'>";
            }
            ?>
						</td>
					</tr>
					<tr>
						<?php 
            $loanLength = getSettingByScope($connection2, "Library", "defaultLoanLength");
            if (is_numeric($loanLength) == FALSE or $loanLength < 0) {
                $loanLength = 7;
            }
            ?>
						<td> 
							<b><?php 
            print _('Expected Return Date');
            ?>
 *</b><br/>
							<span style="font-size: 90%"><i><?php 
            print sprintf(_('Default renew length is today plus %1$s day(s)'), $loanLength);
            ?>
.</i></span>
						</td>
						<td class="right">
示例#27
0
            $resultSelect = $connection2->prepare($sqlSelect);
            $resultSelect->execute($dataSelect);
        } catch (PDOException $e) {
        }
        while ($rowSelect = $resultSelect->fetch()) {
            print "<option value='" . $rowSelect["gibbonFinanceInvoiceeID"] . "'>" . htmlPrep($rowSelect["name"]) . " - " . formatName("", htmlPrep($rowSelect["preferredName"]), htmlPrep($rowSelect["surname"]), "Student", true) . "</option>";
            $students[$count]["gibbonFinanceInvoiceeID"] = $rowSelect["gibbonFinanceInvoiceeID"];
            $students[$count]["student"] = formatName("", htmlPrep($rowSelect["preferredName"]), htmlPrep($rowSelect["surname"]), "Student", true);
            $students[$count]["rollGroup"] = htmlPrep($rowSelect["name"]);
            $students[$count]["dayType"] = htmlPrep($rowSelect["dayType"]);
            $count++;
        }
        ?>
							</optgroup>
							<?php 
        $dayTypeOptions = getSettingByScope($connection2, 'User Admin', 'dayTypeOptions');
        if ($dayTypeOptions != "") {
            $dayTypes = explode(",", $dayTypeOptions);
            foreach ($dayTypes as $dayType) {
                print "<optgroup label='--{$dayType} " . _('Students by Roll Groups') . "--'>";
                foreach ($students as $student) {
                    if ($student["dayType"] == $dayType) {
                        print "<option value='" . $student["gibbonFinanceInvoiceeID"] . "'>" . $student["rollGroup"] . " - " . $student["student"] . "</option>";
                    }
                }
                print "</optgroup>";
            }
        }
        ?>
							<optgroup label='--<?php 
        print _('All Enrolled Students by Alphabet');
         }
     }
 }
 if ($from == "" or count($emails) < 1) {
     $emailFail = TRUE;
 } else {
     //Prep message
     $body = "";
     if ($row["reminderCount"] == "0") {
         $reminderText = getSettingByScope($connection2, "Finance", "reminder1Text");
     } else {
         if ($row["reminderCount"] == "1") {
             $reminderText = getSettingByScope($connection2, "Finance", "reminder2Text");
         } else {
             if ($row["reminderCount"] >= "2") {
                 $reminderText = getSettingByScope($connection2, "Finance", "reminder3Text");
             }
         }
     }
     if ($reminderText != "") {
         $reminderOutput = $row["reminderCount"] + 1;
         if ($reminderOutput > 3) {
             $reminderOutput = "3+";
         }
         $body .= "<p>Reminder " . $reminderOutput . ": " . $reminderText . "</p><br/>";
     }
     $body .= invoiceContents($guid, $connection2, $gibbonFinanceInvoiceID, $gibbonSchoolYearID, $_SESSION[$guid]["currency"], TRUE) . "<p style='font-style: italic;'>Email sent via " . $_SESSION[$guid]["systemName"] . " at " . $_SESSION[$guid]["organisationName"] . ".</p>";
     $bodyPlain = "This email is not viewable in plain text: enable rich text/HTML in your email client to view the reminder. Please reply to this email if you have any questions.";
     //Update reminder count
     if ($row["reminderCount"] < 3) {
         try {
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
include "../../functions.php";
include "../../config.php";
//New PDO DB connection
try {
    $connection2 = new PDO("mysql:host={$databaseServer};dbname={$databaseName};charset=utf8", $databaseUsername, $databasePassword);
    $connection2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $connection2->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch (PDOException $e) {
    echo $e->getMessage();
}
@session_start();
$enableDescriptors = getSettingByScope($connection2, "Behaviour", "enableDescriptors");
$enableLevels = getSettingByScope($connection2, "Behaviour", "enableLevels");
//Set timezone from session variable
date_default_timezone_set($_SESSION[$guid]["timezone"]);
$URL = $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . getModuleName($_POST["address"]) . "/behaviour_manage_addMulti.php&gibbonPersonID=" . $_GET["gibbonPersonID"] . "&gibbonRollGroupID=" . $_GET["gibbonRollGroupID"] . "&gibbonYearGroupID=" . $_GET["gibbonYearGroupID"] . "&type=" . $_GET["type"];
if (isActionAccessible($guid, $connection2, "/modules/Behaviour/behaviour_manage_add.php") == FALSE) {
    //Fail 0
    $URL .= "&addReturn=fail0";
    header("Location: {$URL}");
} else {
    //Proceed!
    if (isset($_POST["gibbonPersonIDMulti"])) {
        $gibbonPersonIDMulti = $_POST["gibbonPersonIDMulti"];
    } else {
        $gibbonPersonIDMulti = NULL;
    }
    $date = $_POST["date"];
示例#30
0
				</td>
			</tr>
			<tr>
				<td> 
					<b><?php 
    print _('Cost');
    ?>
 *</b><br/>
					<span style="font-size: 90%"><i><?php 
    print _('For entire programme') . ". " . $_SESSION[$guid]["currency"] . ".";
    ?>
<br/></i></span>
				</td>
				<td class="right">
					<?php 
    if (getSettingByScope($connection2, "Activities", "payment") == "None" or getSettingByScope($connection2, "Activities", "payment") == "Single") {
        ?>
						 	<input readonly name="paymentNote" id="paymentNote" maxlength=100 value="Per Activty payment is switched off" type="text" style="width: 300px">
							<?php 
    } else {
        ?>
							<input name="payment" id="payment" maxlength=7 value="0.00" type="text" style="width: 300px">
							<script type="text/javascript">
								var payment=new LiveValidation('payment');
								payment.add(Validate.Presence);
								payment.add(Validate.Numericality);
							</script>
							 <?php 
    }
    ?>