} else {
     $siblingSchoolJoiningDate2 = dateConvert($guid, $siblingSchoolJoiningDate2);
 }
 $siblingName3 = $_POST["siblingName3"];
 $siblingDOB3 = $_POST["siblingDOB3"];
 if ($siblingDOB3 == "") {
     $siblingDOB3 = NULL;
 } else {
     $siblingDOB3 = dateConvert($guid, $siblingDOB3);
 }
 $siblingSchool3 = $_POST["siblingSchool3"];
 $siblingSchoolJoiningDate3 = $_POST["siblingSchoolJoiningDate3"];
 if ($siblingSchoolJoiningDate3 == "") {
     $siblingSchoolJoiningDate3 = NULL;
 } else {
     $siblingSchoolJoiningDate3 = dateConvert($guid, $siblingSchoolJoiningDate3);
 }
 //GET PAYMENT FIELDS
 $payment = $_POST["payment"];
 $companyName = NULL;
 if (isset($_POST["companyName"])) {
     $companyName = $_POST["companyName"];
 }
 $companyContact = NULL;
 if (isset($_POST["companyContact"])) {
     $companyContact = $_POST["companyContact"];
 }
 $companyAddress = NULL;
 if (isset($_POST["companyAddress"])) {
     $companyAddress = $_POST["companyAddress"];
 }
Esempio n. 2
0
         if ($AI != "") {
             $gibbonPersonMedicalUpdateID = $AI;
         } else {
             $gibbonPersonMedicalUpdateID = NULL;
         }
         $name = $_POST["name"];
         $gibbonAlertLevelID = NULL;
         if ($_POST["gibbonAlertLevelID"] != "Please select...") {
             $gibbonAlertLevelID = $_POST["gibbonAlertLevelID"];
         }
         $triggers = $_POST["triggers"];
         $reaction = $_POST["reaction"];
         $response = $_POST["response"];
         $medication = $_POST["medication"];
         if ($_POST["lastEpisode"] != "") {
             $lastEpisode = dateConvert($guid, $_POST["lastEpisode"]);
         } else {
             $lastEpisode = NULL;
         }
         $lastEpisodeTreatment = $_POST["lastEpisodeTreatment"];
         $comment = $_POST["comment"];
         try {
             $data = array("gibbonPersonMedicalUpdateID" => $gibbonPersonMedicalUpdateID, "gibbonPersonMedicalID" => $gibbonPersonMedicalID, "name" => $name, "gibbonAlertLevelID" => $gibbonAlertLevelID, "triggers" => $triggers, "reaction" => $reaction, "response" => $response, "medication" => $medication, "lastEpisode" => $lastEpisode, "lastEpisodeTreatment" => $lastEpisodeTreatment, "comment" => $comment, "gibbonPersonIDUpdater" => $_SESSION[$guid]["gibbonPersonID"]);
             $sql = "INSERT INTO gibbonPersonMedicalConditionUpdate SET gibbonPersonMedicalUpdateID=:gibbonPersonMedicalUpdateID, gibbonPersonMedicalID=:gibbonPersonMedicalID, name=:name, gibbonAlertLevelID=:gibbonAlertLevelID, triggers=:triggers, reaction=:reaction, response=:response, medication=:medication, lastEpisode=:lastEpisode, lastEpisodeTreatment=:lastEpisodeTreatment, comment=:comment, gibbonPersonIDUpdater=:gibbonPersonIDUpdater";
             $result = $connection2->prepare($sql);
             $result->execute($data);
         } catch (PDOException $e) {
             $partialFail = TRUE;
         }
     }
 }
 if ($type == "Positive") {
     $likeComment = "";
     if ($descriptor != NULL) {
         $likeComment .= $descriptor;
     }
     if ($descriptor != NULL and $comment != "") {
         $likeComment .= ": ";
     }
     if ($comment != "") {
         $likeComment .= $comment;
     }
 }
 foreach ($gibbonPersonIDMulti as $gibbonPersonID) {
     //Write to database
     try {
         $data = array("gibbonPersonID" => $gibbonPersonID, "date" => dateConvert($guid, $date), "type" => $type, "descriptor" => $descriptor, "level" => $level, "comment" => $comment, "followup" => $followup, "gibbonPersonIDCreator" => $_SESSION[$guid]["gibbonPersonID"], "gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"]);
         $sql = "INSERT INTO gibbonBehaviour SET gibbonPersonID=:gibbonPersonID, date=:date, type=:type, descriptor=:descriptor, level=:level, comment=:comment, followup=:followup, gibbonPersonIDCreator=:gibbonPersonIDCreator, gibbonSchoolYearID=:gibbonSchoolYearID";
         $result = $connection2->prepare($sql);
         $result->execute($data);
     } catch (PDOException $e) {
         $partialFail = TRUE;
     }
     $gibbonBehaviourID = $connection2->lastInsertID();
     //Attempt to add like on positive behaviour
     if ($type == "Positive") {
         $return = setLike($connection2, "Behaviour", $_SESSION[$guid]["gibbonSchoolYearID"], "gibbonBehaviourID", $gibbonBehaviourID, $_SESSION[$guid]["gibbonPersonID"], $gibbonPersonID, "Positive Behaviour", $likeComment);
     }
     if ($type == "Negative") {
         try {
             $dataDetail = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"], "gibbonPersonID" => $gibbonPersonID);
             $sqlDetail = "SELECT gibbonPersonIDTutor, gibbonPersonIDTutor2, gibbonPersonIDTutor3, surname, preferredName FROM gibbonRollGroup JOIN gibbonStudentEnrolment ON (gibbonStudentEnrolment.gibbonRollGroupID=gibbonRollGroup.gibbonRollGroupID) JOIN gibbonPerson ON (gibbonStudentEnrolment.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonStudentEnrolment.gibbonPersonID=:gibbonPersonID";
 //Get action with highest precendence
 $highestAction = getHighestGroupedAction($guid, $_GET["q"], $connection2);
 if ($highestAction == FALSE) {
     print "<div class='error'>";
     print _("The highest grouped action cannot be determined.");
     print "</div>";
 } else {
     $viewBy = $_GET["viewBy"];
     $subView = $_GET["subView"];
     if ($viewBy != "date" and $viewBy != "class") {
         $viewBy = "date";
     }
     if ($viewBy == "date") {
         $date = $_GET["date"];
         if ($_GET["dateHuman"] != "") {
             $date = dateConvert($guid, $_GET["dateHuman"]);
         }
         if ($date == "") {
             $date = date("Y-m-d");
         }
         list($dateYear, $dateMonth, $dateDay) = explode('-', $date);
         $dateStamp = mktime(0, 0, 0, $dateMonth, $dateDay, $dateYear);
     } else {
         if ($viewBy == "class") {
             $class = NULL;
             if (isset($_GET["class"])) {
                 $class = $_GET["class"];
             }
             $gibbonCourseClassID = $_GET["gibbonCourseClassID"];
         }
     }
Esempio n. 5
0
    exit;
}
// busca os dados do usuário a ser editado
$PDO = db_connect();
$sql = "SELECT nomeCliente, dataCadastro, email FROM clientes WHERE idCliente = :id";
$stmt = $PDO->prepare($sql);
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->execute();
$cliente = $stmt->fetch(PDO::FETCH_ASSOC);
/* se o método fetch () não retornar um array
 significa que o ID não corresponde a um usuário válido */
if (!is_array($cliente)) {
    echo "Nenhum cliente encontrado";
    exit;
}
$dataOK = dateConvert($cliente['dataCadastro']);
?>
<!DOCTYPE html>
<html lang="pt-br">

<head>
    <title>Edição de dados</title>
    <meta charset="utf-8">
	<link type="text/css" href="js/jquery-ui.css" rel="stylesheet"/>
    <link type="text/css" href="style.css" rel="stylesheet"/>
    <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui.js"></script>
    <script type="text/javascript" src="js/script.js"></script>
	<script type ="text/javascript" src="js/datepicker-pt-BR.js"></script>
			
    <script>
Esempio n. 6
0
					<tbody>
						<?php 
foreach ($Portfolio as $k => $v) {
    echo $v->logical_delete == 1 ? '<tr class="danger">' : '<tr>';
    echo '<td>';
    if (!empty($v->image_path)) {
        echo '<div class="btn-group">';
        echo '<button class="btn dropdown-toggle btn-primary btn-xs" data-toggle="dropdown"><span class="glyphicon glyphicon-camera"></span></button>';
        echo '<div class="dropdown-menu" style="margin:0;padding:0;border:0;">';
        echo '<img src="' . Router::webroot($v->image_path) . '" class="img-thumbnail" style="width:200px;"/>';
        echo '</div></div>&nbsp;|&nbsp;';
    }
    echo truncateStringWords($v->name, 40);
    echo '</td>';
    echo '<td>' . $v->category . '</td>';
    echo '<td>' . dateConvert($v->creation) . '</td>';
    echo '<td class="text-right">';
    echo $this->FormLink->visible('cockpit/portfolio/online/id:' . $v->id, $v->online);
    echo $this->FormLink->consult('cockpit/portfolio/consult/id:' . $v->id) . '&nbsp;';
    echo $this->FormLink->update('cockpit/portfolio/edit/id:' . $v->id) . '&nbsp;';
    echo $this->FormLink->delete('cockpit/portfolio/delete/id:' . $v->id) . '&nbsp;';
    echo '</td></tr>';
}
?>
					</tbody>
				</table>
			</div>
			<div class="panel-footer text-right">
				<?php 
echo $this->FormLink->back(COCKPIT);
?>
     //Fail 2
     $URL .= "&addReturn=fail2";
     header("Location: {$URL}");
     break;
 }
 //Proceed!
 $surname = $_POST["surname"];
 $firstName = $_POST["firstName"];
 $preferredName = $firstName;
 $officialName = $firstName . " " . $surname;
 $gender = $_POST["gender"];
 $dob = $_POST["dob"];
 if ($dob == "") {
     $dob = NULL;
 } else {
     $dob = dateConvert($guid, $dob);
 }
 $email = $_POST["email"];
 $username = $_POST["username"];
 $password = $_POST["password"];
 $salt = getSalt();
 $passwordStrong = hash("sha256", $salt . $password);
 $status = getSettingByScope($connection2, 'User Admin', 'publicRegistrationDefaultStatus');
 $gibbonRoleIDPrimary = getSettingByScope($connection2, 'User Admin', 'publicRegistrationDefaultRole');
 $gibbonRoleIDAll = $gibbonRoleIDPrimary;
 if ($surname == "" or $firstName == "" or $preferredName == "" or $officialName == "" or $gender == "" or $dob == "" or $email == "" or $username == "" or $password == "" or $gibbonRoleIDPrimary == "" or $gibbonRoleIDPrimary == "" or $status != "Pending Approval" and $status != "Full") {
     //Fail 3
     $URL .= "&addReturn=fail3";
     header("Location: {$URL}");
 } else {
     //Check strength of password
         $URL .= "&updateReturn=fail2";
         header("Location: {$URL}");
     } else {
         $name = $_POST["name"];
         $active = $_POST["active"];
         $description = $_POST["description"];
         $invoiceIssueDate = $_POST["invoiceIssueDate"];
         $invoiceDueDate = $_POST["invoiceDueDate"];
         if ($name == "" or $active == "" or $invoiceIssueDate == "" or $invoiceDueDate == "") {
             //Fail 3
             $URL .= "&addReturn=fail3";
             header("Location: {$URL}");
         } else {
             //Write to database
             try {
                 $data = array("gibbonSchoolYearID" => $gibbonSchoolYearID, "name" => $name, "active" => $active, "description" => $description, "invoiceIssueDate" => dateConvert($guid, $invoiceIssueDate), "invoiceDueDate" => dateConvert($guid, $invoiceDueDate), "gibbonPersonIDUpdate" => $_SESSION[$guid]["gibbonPersonID"], "gibbonFinanceBillingScheduleID" => $gibbonFinanceBillingScheduleID);
                 $sql = "UPDATE gibbonFinanceBillingSchedule SET gibbonSchoolYearID=:gibbonSchoolYearID, name=:name, active=:active, description=:description, invoiceIssueDate=:invoiceIssueDate, invoiceDueDate=:invoiceDueDate, gibbonPersonIDUpdate=:gibbonPersonIDUpdate, timestampUpdate='" . date("Y-m-d H:i:s") . "' WHERE gibbonFinanceBillingScheduleID=:gibbonFinanceBillingScheduleID";
                 $result = $connection2->prepare($sql);
                 $result->execute($data);
             } catch (PDOException $e) {
                 //Fail 2
                 $URL .= "&updateReturn=fail2";
                 header("Location: {$URL}");
                 break;
             }
             //Success 0
             $URL .= "&updateReturn=success0";
             header("Location: {$URL}");
         }
     }
 }
Esempio n. 9
0
						<tr>
							<?php 
echo '<th>' . BackendTranslate::getLabel('login') . '</th>';
echo '<th style="width:10%;">' . BackendTranslate::getLabel('categories') . '</th>';
echo '<th style="width:10%;">' . BackendTranslate::getLabel('login_last') . '</a></th>';
echo '<th style="width:30%;" class="text-right">' . BackendTranslate::getLabel('action') . '</th>';
?>
						</tr>
					</thead>
					<tbody>						
						<?php 
foreach ($User as $k => $v) {
    echo $v->logical_delete == 1 ? '<tr class="danger">' : '<tr>';
    echo '<td>' . $v->login . '</td>';
    echo '<td>' . $v->category . '</td>';
    echo '<td>' . dateConvert($v->login_last) . '</td>';
    echo '<td class="text-right">';
    echo $this->FormLink->consult('cockpit/user/consult/id:' . $v->id . '/name:' . $v->login) . '&nbsp;';
    echo $this->FormLink->delete('cockpit/user/delete/id:' . $v->id . '/name:' . $v->login);
    echo '</td></tr>';
}
?>
					</tbody>
				</table>
			</div>
			<div class="panel-footer text-right">
				<?php 
echo $this->FormLink->back(COCKPIT);
?>
			</div>
		</div>
@session_start();
//Set timezone from session variable
date_default_timezone_set($_SESSION[$guid]["timezone"]);
$URL = $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . getModuleName($_POST["address"]) . "/schoolYear_manage_add.php";
if (isActionAccessible($guid, $connection2, "/modules/School Admin/schoolYear_manage_add.php") == FALSE) {
    //Fail 0
    $URL .= "&addReturn=fail0";
    header("Location: {$URL}");
} else {
    //Proceed!
    //Validate Inputs
    $name = $_POST["name"];
    $status = $_POST["status"];
    $sequenceNumber = $_POST["sequenceNumber"];
    $firstDay = dateConvert($guid, $_POST["firstDay"]);
    $lastDay = dateConvert($guid, $_POST["lastDay"]);
    if ($name == "" or $status == "" or $sequenceNumber == "" or is_numeric($sequenceNumber) == FALSE or $firstDay == "" or $lastDay == "") {
        //Fail 3
        $URL .= "&addReturn=fail3";
        header("Location: {$URL}");
    } else {
        //Check unique inputs for uniquness
        try {
            $data = array("name" => $name, "sequenceNumber" => $sequenceNumber);
            $sql = "SELECT * FROM gibbonSchoolYear WHERE name=:name OR sequenceNumber=:sequenceNumber";
            $result = $connection2->prepare($sql);
            $result->execute($data);
        } catch (PDOException $e) {
            //Fail 2
            $URL .= "&addReturn=fail2";
            header("Location: {$URL}");
 if ($dateType == "Term") {
     $gibbonSchoolYearTermIDList = "";
     if (isset($_POST["gibbonSchoolYearTermID"])) {
         $terms = $_POST["gibbonSchoolYearTermID"];
         $gibbonSchoolYearTermIDList = "";
         for ($i = 0; $i < count($terms); $i++) {
             $gibbonSchoolYearTermIDList = $gibbonSchoolYearTermIDList . $terms[$i] . ",";
         }
         $gibbonSchoolYearTermIDList = substr($gibbonSchoolYearTermIDList, 0, -1);
     }
 } else {
     if ($dateType == "Date") {
         $listingStart = dateConvert($guid, $_POST["listingStart"]);
         $listingEnd = dateConvert($guid, $_POST["listingEnd"]);
         $programStart = dateConvert($guid, $_POST["programStart"]);
         $programEnd = dateConvert($guid, $_POST["programEnd"]);
     }
 }
 $gibbonYearGroupIDList = "";
 for ($i = 0; $i < $_POST["count"]; $i++) {
     if (isset($_POST["gibbonYearGroupIDCheck{$i}"])) {
         if ($_POST["gibbonYearGroupIDCheck{$i}"] == "on") {
             $gibbonYearGroupIDList = $gibbonYearGroupIDList . $_POST["gibbonYearGroupID{$i}"] . ",";
         }
     }
 }
 $gibbonYearGroupIDList = substr($gibbonYearGroupIDList, 0, strlen($gibbonYearGroupIDList) - 1);
 $maxParticipants = $_POST["maxParticipants"];
 $payment = $_POST["payment"];
 $description = $_POST["description"];
 if ($dateType == "" or $name == "" or $provider == "" or $active == "" or $registration == "" or $maxParticipants == "" or $payment == "" or $dateType == "Date" and ($listingStart == "" or $listingEnd == "" or $programStart == "" or $programEnd == "")) {
     $result = $connection2->prepare($sql);
     $result->execute($data);
 } catch (PDOException $e) {
     //Fail2
     $URL .= "&editReturn=fail2";
     header("Location: {$URL}");
     break;
 }
 if ($result->rowCount() != 1) {
     //Fail 0
     $URL .= "&editReturn=fail0";
     header("Location: {$URL}");
 } else {
     $row = $result->fetch();
     //Get relevant
     $paymentDate = dateConvert($guid, $_POST["paymentDate"]);
     $paymentAmount = $_POST["paymentAmount"];
     $gibbonPersonIDPayment = $_POST["gibbonPersonIDPayment"];
     $paymentMethod = $_POST["paymentMethod"];
     //Move attached file
     $time = time();
     $attachment = "";
     //Check for folder in uploads based on today's date
     $path = $_SESSION[$guid]["absolutePath"];
     if (is_dir($path . "/uploads/" . date("Y", $time) . "/" . date("m", $time)) == FALSE) {
         mkdir($path . "/uploads/" . date("Y", $time) . "/" . date("m", $time), 0777, TRUE);
     }
     $unique = FALSE;
     $count = 0;
     while ($unique == FALSE and $count < 100) {
         $suffix = randomPassword(16);
         if ($status == "On Loan") {
             $type = "Loan";
         } else {
             if ($status == "Repair") {
                 $type = "Repair";
             } else {
                 if ($status == "Reserved") {
                     $type = "Reserve";
                 }
             }
         }
     }
 }
 $returnExpected = NULL;
 if ($_POST["returnExpected"] != "") {
     $returnExpected = dateConvert($guid, $_POST["returnExpected"]);
 }
 $returnAction = $_POST["returnAction"];
 $gibbonPersonIDReturnAction = NULL;
 if ($_POST["gibbonPersonIDReturnAction"] != "") {
     $gibbonPersonIDReturnAction = $_POST["gibbonPersonIDReturnAction"];
 }
 //Write to database
 try {
     $data = array("gibbonLibraryItemEventID" => $gibbonLibraryItemEventID, "type" => $type, "status" => $status, "gibbonPersonIDOut" => $_SESSION[$guid]["gibbonPersonID"], "timestampOut" => date('Y-m-d H:i:s', time()), "returnExpected" => $returnExpected, "returnAction" => $returnAction, "gibbonPersonIDReturnAction" => $gibbonPersonIDReturnAction);
     $sql = "UPDATE gibbonLibraryItemEvent SET type=:type, status=:status, gibbonPersonIDOut=:gibbonPersonIDOut, timestampOut=:timestampOut, returnExpected=:returnExpected, returnAction=:returnAction, gibbonPersonIDReturnAction=:gibbonPersonIDReturnAction WHERE gibbonLibraryItemEventID=:gibbonLibraryItemEventID";
     $result = $connection2->prepare($sql);
     $result->execute($data);
 } catch (PDOException $e) {
     //Fail 2
     $URL .= "&addReturn=fail2" . $e->getMessage();
     //Fail2
     $URL .= "&deleteReturn=fail2";
     header("Location: {$URL}");
     break;
 }
 if ($result->rowCount() != 1) {
     //Fail 2
     $URL .= "&updateReturn=fail2";
     header("Location: {$URL}");
 } else {
     //Validate Inputs
     $name = $_POST["name"];
     $status = $_POST["status"];
     $sequenceNumber = $_POST["sequenceNumber"];
     $dateStart = dateConvert($guid, $_POST["dateStart"]);
     $dateEnd = dateConvert($guid, $_POST["dateEnd"]);
     if ($name == "" or $status == "" or $sequenceNumber == "" or is_numeric($sequenceNumber) == FALSE or $dateStart == "" or $dateEnd == "") {
         //Fail 3
         $URL .= "&updateReturn=fail3";
         header("Location: {$URL}");
     } else {
         //Check unique inputs for uniquness
         try {
             $data = array("name" => $name, "sequenceNumber" => $sequenceNumber, "gibbonFinanceBudgetCycleID" => $gibbonFinanceBudgetCycleID);
             $sql = "SELECT * FROM gibbonFinanceBudgetCycle WHERE (name=:name OR sequenceNumber=:sequenceNumber) AND NOT gibbonFinanceBudgetCycleID=:gibbonFinanceBudgetCycleID";
             $result = $connection2->prepare($sql);
             $result->execute($data);
         } catch (PDOException $e) {
             //Fail 2
             $URL .= "&updateReturn=fail2";
             header("Location: {$URL}");
Esempio n. 15
0
<br/>
			<?php 
$nextmatchP4 = $this->request(CALENDAR, 'getNextMatch', 2);
if (empty($nextmatchP4)) {
    echo 'P4E Saison 2015-2016 terminée';
} else {
    echo 'P4E <span>' . $nextmatchP4->game . ' le ' . dateConvert($nextmatchP4->dayofgame) . '</span>';
}
?>
<br/>
			<?php 
$nextmatchDame = $this->request(CALENDAR, 'getNextMatch', 8);
if (empty($nextmatchDame)) {
    echo 'P2Dame Saison 2015-2016 terminée';
} else {
    echo 'Dames <span>' . $nextmatchDame->game . ' le ' . dateConvert($nextmatchDame->dayofgame) . '</span>';
}
?>
		</div>
	</div>
	<div class="panel panel-info">
		<div class="panel-heading"><?php 
echo FrontendTranslate::getLabel('last_result');
?>
</div>
		<div class="panel-body">
			<?php 
$lastresultP3 = $this->request(CALENDAR, 'getLastResult', 1);
if (empty($lastresultP3)) {
    echo 'Résultat P3B bientôt disponible';
} else {
Esempio n. 16
0
 $homework = $_POST["homework"];
 if ($_POST["homework"] == "Yes") {
     $homework = "Y";
     $homeworkDetails = $_POST["homeworkDetails"];
     if ($_POST["homeworkDueDateTime"] != "") {
         $homeworkDueDateTime = $_POST["homeworkDueDateTime"] . ":59";
     } else {
         $homeworkDueDateTime = "21:00:00";
     }
     if ($_POST["homeworkDueDate"] != "") {
         $homeworkDueDate = dateConvert($guid, $_POST["homeworkDueDate"]) . " " . $homeworkDueDateTime;
     }
     if ($_POST["homeworkSubmission"] == "Yes") {
         $homeworkSubmission = "Y";
         if ($_POST["homeworkSubmissionDateOpen"] != "") {
             $homeworkSubmissionDateOpen = dateConvert($guid, $_POST["homeworkSubmissionDateOpen"]);
         } else {
             $homeworkSubmissionDateOpen = date("Y-m-d");
         }
         if (isset($_POST["homeworkSubmissionDrafts"])) {
             $homeworkSubmissionDrafts = $_POST["homeworkSubmissionDrafts"];
         }
         $homeworkSubmissionType = $_POST["homeworkSubmissionType"];
         $homeworkSubmissionRequired = $_POST["homeworkSubmissionRequired"];
         if ($_POST["homeworkCrowdAssess"] == "Yes") {
             $homeworkCrowdAssess = "Y";
             if (isset($_POST["homeworkCrowdAssessOtherTeachersRead"])) {
                 $homeworkCrowdAssessOtherTeachersRead = "Y";
             } else {
                 $homeworkCrowdAssessOtherTeachersRead = "N";
             }
Esempio n. 17
0
 public function date($name)
 {
     $value = isset($this->controller->request->data->{$name}) ? stripslashes($this->controller->request->data->{$name}) : EMPTYSTRING;
     $value = empty($value) ? dateConvert(dateInit()) : dateConvert($value);
     $buffer = EMPTYSTRING;
     $buffer .= $this->init($name);
     $buffer .= '<div class="input-group date form_datetime col-md-5" id="input' . $name . 'picker" data-date="' . $value . '" data-date-format="dd/mm/yyyy hh:ii">';
     $buffer .= '<input class="form-control" type="text" readonly value="' . $value . '" name="' . $name . '" required>';
     $buffer .= '<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>';
     $buffer .= '</div>';
     $buffer .= $this->end($name);
     return $buffer;
 }
Esempio n. 18
0
require_once 'init.php';
// resgata os valores do formulário
$name = isset($_POST['name']) ? $_POST['name'] : null;
$email = isset($_POST['email']) ? $_POST['email'] : null;
$gender = isset($_POST['gender']) ? $_POST['gender'] : null;
$birthdate = isset($_POST['birthdate']) ? $_POST['birthdate'] : null;
$id = isset($_POST['id']) ? $_POST['id'] : null;
// validação (bem simples, mais uma vez)
if (empty($name) || empty($email) || empty($gender) || empty($birthdate)) {
    echo "Volte e preencha todos os campos";
    exit;
}
// a data vem no formato dd/mm/YYYY
// então precisamos converter para YYYY-mm-dd
$isoDate = dateConvert($birthdate);
// atualiza o banco
$PDO = db_connect();
$sql = "UPDATE users SET name = :name, email = :email, gender = :gender, birthdate = :birthdate WHERE id = :id";
$stmt = $PDO->prepare($sql);
$stmt->bindParam(':name', $name);
$stmt->bindParam(':email', $email);
$stmt->bindParam(':gender', $gender);
$stmt->bindParam(':birthdate', $isoDate);
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
if ($stmt->execute()) {
    header('Location: index.php');
} else {
    echo "Erro ao alterar";
    print_r($stmt->errorInfo());
}
                         $sqlInvoiceFee = "INSERT INTO gibbonFinanceInvoiceFee SET gibbonFinanceInvoiceID=:gibbonFinanceInvoiceID, feeType=:feeType, name=:name, description=:description, gibbonFinanceFeeCategoryID=:gibbonFinanceFeeCategoryID, fee=:fee, sequenceNumber={$count}";
                     }
                     $resultInvoiceFee = $connection2->prepare($sqlInvoiceFee);
                     $resultInvoiceFee->execute($dataInvoiceFee);
                 } catch (PDOException $e) {
                     $invoiceFeeFailCount++;
                 }
             }
         }
         //Update invoice
         try {
             if ($scheduling == "Scheduled") {
                 $dataInvoiceAdd = array("gibbonPersonIDUpdate" => $_SESSION[$guid]["gibbonPersonID"], "notes" => $rowInvoice["notes"] . " " . $notes, "gibbonFinanceInvoiceID" => $rowInvoice["gibbonFinanceInvoiceID"]);
                 $sqlInvoiceAdd = "UPDATE gibbonFinanceInvoice SET gibbonPersonIDUpdate=:gibbonPersonIDUpdate, notes=:notes, timeStampUpdate='" . date("Y-m-d H:i:s") . "' WHERE gibbonFinanceInvoiceID=:gibbonFinanceInvoiceID";
             } else {
                 $dataInvoiceAdd = array("invoiceDueDate" => dateConvert($guid, $invoiceDueDate), "gibbonPersonIDUpdate" => $_SESSION[$guid]["gibbonPersonID"], "notes" => $rowInvoice["notes"] . " " . $notes, "gibbonFinanceInvoiceID" => $rowInvoice["gibbonFinanceInvoiceID"]);
                 $sqlInvoiceAdd = "UPDATE gibbonFinanceInvoice SET invoiceDueDate=:invoiceDueDate, gibbonPersonIDUpdate=:gibbonPersonIDUpdate, notes=:notes, timeStampUpdate='" . date("Y-m-d H:i:s") . "' WHERE gibbonFinanceInvoiceID=:gibbonFinanceInvoiceID";
             }
             $resultInvoiceAdd = $connection2->prepare($sqlInvoiceAdd);
             $resultInvoiceAdd->execute($dataInvoiceAdd);
         } catch (PDOException $e) {
             $invoiceFailCount++;
             $thisInvoiceFailed = TRUE;
         }
     } else {
         if ($thisInvoiceFailed == FALSE) {
             $invoiceFailCount++;
             $thisInvoiceFailed = TRUE;
         }
     }
 }
Esempio n. 20
0
 public function dateText($name, $readonly, $required)
 {
     $value = isset($this->controller->request->data->{$name}) ? stripslashes($this->controller->request->data->{$name}) : EMPTYSTRING;
     $value = empty($value) ? dateConvert(dateInit()) : dateConvert($value);
     $buffer = EMPTYSTRING;
     $buffer .= $this->init($name);
     $buffer .= '<input type="text" id="input' . $name . '" name="' . $name . '" value="' . $value . '" class="form-control" ' . $this->readonly($readonly) . ' ' . $this->required($required) . '>';
     $buffer .= $this->end();
     return $buffer;
 }
    //Fail 0
    $URL .= "&addReturn=fail0";
    header("Location: {$URL}");
} else {
    //Proceed!
    $gibbonPersonID = $_POST["gibbonPersonID"];
    $initials = $_POST["initials"];
    if ($initials == "") {
        $initials = NULL;
    }
    $type = $_POST["type"];
    $jobTitle = $_POST["jobTitle"];
    $firstAidQualified = $_POST["firstAidQualified"];
    $firstAidExpiry = NULL;
    if ($firstAidQualified == "Y" and $_POST["firstAidExpiry"] != "") {
        $firstAidExpiry = dateConvert($guid, $_POST["firstAidExpiry"]);
    }
    $countryOfOrigin = $_POST["countryOfOrigin"];
    $qualifications = $_POST["qualifications"];
    $biographicalGrouping = $_POST["biographicalGrouping"];
    $biographicalGroupingPriority = $_POST["biographicalGroupingPriority"];
    $biography = $_POST["biography"];
    //Validate Inputs
    if ($gibbonPersonID == "" or $type == "") {
        //Fail 3
        $URL .= "&addReturn=fail3";
        header("Location: {$URL}");
    } else {
        //Check unique inputs for uniquness
        try {
            if ($initials == "") {
Esempio n. 22
0
 //Check if we are OK to go
 if ($type == "" or $locations[$result["location"]] == "" or $result["username"] != "" and $users[$result["username"]] == "" or $result["department"] != "" and $departments[$result["department"]] == "") {
     //NOT OK!
     print "<div class='error'>";
     print sprintf(_('Record with ID %1$s had some information malformations.'), $data[2]);
     print "</div>";
 } else {
     //OK!
     //GET FIELDS READY
     $name = $result["name"];
     $id = $result["id"];
     $producer = $result["producer"];
     $vendor = $result["vendor"];
     $purchaseDate = NULL;
     if ($result["purchaseDate"] != "") {
         $purchaseDate = dateConvert($guid, $result["purchaseDate"]);
     }
     $invoiceNumber = $result["invoiceNumber"];
     $gibbonSpaceID = $locations[$result["location"]];
     $locationDetail = $result["locationDetail"];
     $ownershipType = $result["ownershipType"];
     $gibbonPersonIDOwnership = NULL;
     if ($result["username"] != "") {
         $gibbonPersonIDOwnership = $users[$result["username"]];
     }
     $gibbonDepartmentID = NULL;
     if ($result["department"] != "") {
         $gibbonDepartmentID = $departments[$result["department"]];
     }
     $borrowable = $result["borrowable"];
     $status = $result["status"];
     print "<input name='address' value='" . $_GET["q"] . "' type='hidden'>";
     print "</fieldset>";
     print "</form>";
 }
 //SHOW CURRENT TIMETABLE IN EDIT VIEW
 print "<a name='tt'></a>";
 print "<h2>";
 print "Current Timetable View";
 print "</h2>";
 $gibbonTTID = NULL;
 if (isset($_GET["gibbonTTID"])) {
     $gibbonTTID = $_GET["gibbonTTID"];
 }
 $ttDate = NULL;
 if (isset($_POST["ttDate"])) {
     $ttDate = dateConvertToTimestamp(dateConvert($guid, $_POST["ttDate"]));
 }
 $tt = renderTT($guid, $connection2, $gibbonPersonID, $gibbonTTID, FALSE, $ttDate, "/modules/Timetable Admin/courseEnrolment_manage_byPerson_edit.php", "&gibbonPersonID={$gibbonPersonID}&gibbonSchoolYearID={$gibbonSchoolYearID}&type={$type}#tt", FALSE, TRUE);
 if ($tt != FALSE) {
     print $tt;
 } else {
     print "<div class='error'>";
     print _("There are no records to display.");
     print "</div>";
 }
 //SHOW OLD ENROLMENT RECORDS
 print "<h2>";
 print "Old Enrolment";
 print "</h2>";
 try {
     $data = array("gibbonSchoolYearID" => $gibbonSchoolYearID, "gibbonPersonID" => $gibbonPersonID);
Esempio n. 24
0
    ?>
				<?php 
    echo $v->logical_delete == 1 ? '<tr class="danger">' : '<tr>';
    ?>
					<td style="text-align: center;"><a href="<?php 
    echo Router::generateURL('cockpit/slider/online/' . $v->id);
    ?>
" class="label label-<?php 
    echo $v->online == 1 ? SUCCESS : DANGER;
    ?>
"><?php 
    echo $v->online == 1 ? BackendTranslate::getLabel('yes') : BackendTranslate::getLabel('no');
    ?>
</a></td>
					<td><?php 
    echo dateConvert($v->publication);
    ?>
</td>
					<td><?php 
    echo truncateStringWords($v->name, 75);
    ?>
</td>
					<td class="text-right">
						<?php 
    echo $this->FormLink->consult('cockpit/slider/consult/' . $v->id);
    ?>
						<?php 
    echo $this->FormLink->update('cockpit/slider/edit/' . $v->id);
    ?>
						<?php 
    echo $this->FormLink->delete('cockpit/slider/delete/' . $v->id);
Esempio n. 25
0
 $emergency2Relationship = $_POST["emergency2Relationship"];
 $profession = $_POST["profession"];
 $employer = $_POST["employer"];
 $jobTitle = $_POST["jobTitle"];
 $gibbonHouseID = $_POST["gibbonHouseID"];
 if ($gibbonHouseID == "") {
     $gibbonHouseID = NULL;
 } else {
     $gibbonHouseID = $gibbonHouseID;
 }
 $studentID = $_POST["studentID"];
 $dateStart = $_POST["dateStart"];
 if ($dateStart == "") {
     $dateStart = NULL;
 } else {
     $dateStart = dateConvert($guid, $dateStart);
 }
 $gibbonSchoolYearIDClassOf = $_POST["gibbonSchoolYearIDClassOf"];
 if ($gibbonSchoolYearIDClassOf == "") {
     $gibbonSchoolYearIDClassOf = NULL;
 }
 $lastSchool = $_POST["lastSchool"];
 $transport = $_POST["transport"];
 $transportNotes = $_POST["transportNotes"];
 $lockerNumber = $_POST["lockerNumber"];
 $vehicleRegistration = $_POST["vehicleRegistration"];
 $privacyOptions = NULL;
 if (isset($_POST["privacyOptions"])) {
     $privacyOptions = $_POST["privacyOptions"];
 }
 $privacy = "";
">
						</td>
					</tr>
				</table>
			</form>
		<?php 
        } else {
            if ($step == 2) {
                print "<h2>";
                print _("Step 2 - Availability Check");
                print "</h2>";
                $gibbonSpaceID = NULL;
                if (isset($_POST["gibbonSpaceID"])) {
                    $gibbonSpaceID = $_POST["gibbonSpaceID"];
                }
                $date = dateConvert($guid, $_POST["date"]);
                $timeStart = $_POST["timeStart"];
                $timeEnd = $_POST["timeEnd"];
                $repeat = $_POST["repeat"];
                $repeatDaily = NULL;
                $repeatWeekly = NULL;
                if ($repeat == "Daily") {
                    $repeatDaily = $_POST["repeatDaily"];
                } else {
                    if ($repeat == "Weekly") {
                        $repeatWeekly = $_POST["repeatWeekly"];
                    }
                }
                try {
                    $dataSelect = array("gibbonSpace" => $gibbonSpaceID);
                    $sqlSelect = "SELECT * FROM gibbonSpace WHERE gibbonSpace.gibbonSpaceID=:gibbonSpace";
 print "</p>";
 try {
     $data = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"], "gibbonTTID" => $gibbonTTID);
     $sql = "SELECT * FROM gibbonTT WHERE gibbonTTID=:gibbonTTID AND gibbonSchoolYearID=:gibbonSchoolYearID";
     $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 _("The selected record does not exist, or you do not have access to it.");
     print "</div>";
 } else {
     $row = $result->fetch();
     $startDayStamp = strtotime(dateConvert($guid, $ttDate));
     //Count back to first Monday before first day
     while (date("D", $startDayStamp) != "Mon") {
         $startDayStamp = $startDayStamp - 86400;
     }
     //Check which days are school days
     $daysInWeek = 0;
     $days = array();
     $timeStart = "";
     $timeEnd = "";
     $days["Mon"] = "N";
     $days["Tue"] = "N";
     $days["Wed"] = "N";
     $days["Thu"] = "N";
     $days["Fri"] = "N";
     $days["Sat"] = "N";
            $result = $connection2->prepare($sql);
            $result->execute($data);
        } catch (PDOException $e) {
            print "<div class='error'>" . $e->getMessage() . "</div>";
        }
        if ($result->rowCount() > 0) {
            $row = $result->fetch();
            $gibbonRollGroupID = $row["gibbonRollGroupID"];
        }
    } else {
        $gibbonRollGroupID = $_GET["gibbonRollGroupID"];
    }
    if (isset($_GET["currentDate"]) == FALSE) {
        $currentDate = date("Y-m-d");
    } else {
        $currentDate = dateConvert($guid, $_GET["currentDate"]);
    }
    $today = date("Y-m-d");
    ?>
	
	<form method="get" action="<?php 
    print $_SESSION[$guid]["absoluteURL"];
    ?>
/index.php">
		<table class='smallIntBorder' cellspacing='0' style="width: 100%">	
			<tr class='break'>
				<td colspan=2>
					<h3>
					<?php 
    print _('Choose Roll Group');
    ?>
 } else {
     $gibbonPersonIDMulti = null;
 }
 $badgesBadgeID = $_POST['badgesBadgeID'];
 $date = $_POST['date'];
 $comment = $_POST['comment'];
 if ($gibbonPersonIDMulti == null or $date == '' or $badgesBadgeID == '' or $gibbonSchoolYearID == '') {
     //Fail 3
     $URL .= '&return=error3';
     header("Location: {$URL}");
 } else {
     $partialFail = false;
     foreach ($gibbonPersonIDMulti as $gibbonPersonID) {
         //Write to database
         try {
             $data = array('badgesBadgeID' => $badgesBadgeID, 'gibbonSchoolYearID' => $gibbonSchoolYearID, 'date' => dateConvert($guid, $date), 'gibbonPersonID' => $gibbonPersonID, 'comment' => $comment, 'gibbonPersonIDCreator' => $_SESSION[$guid]['gibbonPersonID']);
             $sql = 'INSERT INTO badgesBadgeStudent SET badgesBadgeID=:badgesBadgeID, gibbonSchoolYearID=:gibbonSchoolYearID, date=:date, gibbonPersonID=:gibbonPersonID, comment=:comment, gibbonPersonIDCreator=:gibbonPersonIDCreator';
             $result = $connection2->prepare($sql);
             $result->execute($data);
         } catch (PDOException $e) {
             $partialFail = true;
         }
         $badgesBadgeStudentID = $connection2->lastInsertID();
         //Attempt to add like
         $likeComment = '';
         if ($comment != '') {
             $likeComment .= $comment;
         }
         $return = setLike($connection2, 'Badges', $_SESSION[$guid]['gibbonSchoolYearID'], 'badgesBadgeStudentID', $badgesBadgeStudentID, $_SESSION[$guid]['gibbonPersonID'], $gibbonPersonID, 'Badges Granted', $likeComment);
         //Notify User
         $notificationText = __($guid, 'Someone has granted you a badge.');
Esempio n. 30
0
/report_students_left.php">
					<input type="submit" value="<?php 
    print _("Submit");
    ?>
">
				</td>
			</tr>
		</table>
	</form>
	<?php 
    if ($endDateFrom != "" and $endDateTo != "") {
        print "<h2>";
        print _("Results");
        print "</h2>";
        try {
            $data = array("endDateFrom" => dateConvert($guid, $endDateFrom), "endDateTo" => dateConvert($guid, $endDateTo));
            if ($ignoreStatus == "on") {
                $sql = "SELECT DISTINCT gibbonPerson.gibbonPersonID, surname, preferredName, username, dateEnd, nextSchool, departureReason FROM gibbonPerson JOIN gibbonStudentEnrolment ON (gibbonStudentEnrolment.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE dateEnd>=:endDateFrom AND dateEnd<=:endDateTo ORDER BY surname, preferredName";
            } else {
                $sql = "SELECT DISTINCT gibbonPerson.gibbonPersonID, surname, preferredName, username, dateEnd, nextSchool, departureReason FROM gibbonPerson JOIN gibbonStudentEnrolment ON (gibbonStudentEnrolment.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE dateEnd>=:endDateFrom AND dateEnd<=:endDateTo AND status='Left' ORDER BY surname, preferredName";
            }
            $result = $connection2->prepare($sql);
            $result->execute($data);
        } catch (PDOException $e) {
            print "<div class='error'>" . $e->getMessage() . "</div>";
        }
        if ($result->rowCount() > 0) {
            print "<table cellspacing='0' style='width: 100%'>";
            print "<tr class='head'>";
            print "<th>";
            print _("Count");