/**
  * Insert one changes logs to the database
  * 
  * @author Jonathan Sandoval <*****@*****.**>
  * @param   String       $typéChange    The type of the change to efect (insert, update, delete)
  * @param   String       $descriptionC  The description of the change
  * @return  boolean      If was posible to insert the data
  */
 static function addChangesLogs($typeChange = "", $descriptionC = "")
 {
     if ($typeChange == "") {
         return false;
     }
     $date = time();
     $user = SessionManager::getCurrentUser();
     if ($user === NULL) {
         return false;
     }
     $idUser = $user->getId();
     $tableChangesLogs = DatabaseManager::getNameTable('TABLE_CHANGES_LOGS');
     $query = "INSERT INTO {$tableChangesLogs}\r\n                          (date, idUser, type, description) \r\n                          VALUES \r\n                          ({$date}, {$idUser}, '{$typeChange}', '{$descriptionC}')";
     return DatabaseManager::singleAffectedRow($query);
 }
<?php

require_once __DIR__ . "/../../../Backend/Certs/BaptismCertificate.php";
SessionManager::validateUserInPage('baptismLook.php');
if (isset($_GET) && $_GET["idBaptism"] !== NULL && isset($_SESSION) && $_SESSION["user_id"] !== NULL) {
    $user = SessionManager::getCurrentUser();
    $pdf = new BaptismCertificate($user->getId(), $_GET["idBaptism"], $_GET["full"]);
    $pdf->AliasNbPages();
    $pdf->AddPage();
    $pdf->displayData();
    $pdf->Output();
} else {
    echo "<script>\n                url = String(window.location);\n                url = url.substr(0, url.indexOf('cert'));\n                window.location.href = url + 'main.php';\n              </script>";
}
Пример #3
0
<?php

require_once __DIR__ . "/../../Backend/SessionManager.php";
require_once __DIR__ . "/../../Backend/BibleQuote.php";
require_once __DIR__ . "/../../Backend/LanguageSupport.php";
SessionManager::validateUserInPage('main.php');
//Get File contest from template
$string = file_get_contents("template/Main.html");
$string = str_replace("|biblic|", BibleQuote::randomQuote(), $string);
//Remplace the nav
$user_name = strtoupper(SessionManager::getCurrentUser()->getUsername());
$string = str_replace("Username", $user_name, $string);
//Remplace the nav
$string = str_replace("|NavBar|", SessionManager::getNavBar(), $string);
//Display the page
$string = LanguageSupport::HTMLEvalLanguage($string);
echo $string;