public function imprimer() { parent::printable(); $view = new View(); $view->Assign("pdf", $this->pdf); switch ($this->request->code) { case "0001": $personnel = $this->Personnel->findSingleRowBy(["IDPERSONNEL" => $this->request->idpersonnel]); $view->Assign("personnel", $personnel); $ens = $this->Personnel->getEnseignements($this->request->idpersonnel); $view->Assign("enseignements", $ens); echo $view->Render("enseignant" . DS . "impression" . DS . "fiche", false); break; case "0002": break; } }
public function imprimer() { ob_start(); parent::printable(); $code = $this->request->code; $view = new View(); $view->Assign("pdf", $this->pdf); switch ($code) { # Impression du taux de couverture des programmes et heures case "0001": $this->pdf->isLandscape = true; echo $view->Render("statistique" . DS . "impression" . DS . "couverture", false); break; case "0002": # Impression du bilan global des resultats echo $view->Render("statistique" . DS . "impression" . DS . "bilanresultat", false); break; case "0005": $this->getBilanGlobal($view); echo $view->Render("statistique" . DS . "impression" . DS . "bilanresultat"); break; } echo ob_get_contents(); ob_end_flush(); }
public function ajax($action) { $json = array(); $json[0] = ""; $view = new View(); $heure_de_cours = array(["08:00", "08:55"], ["09:00", "09:55"], ["10:00", "11:05"], ["11:00", "12:00"], ["12:00", "12:55"], ["13:00", "13:55"], ["13:55", "14:50"], ["14:55", "15:50"], ["16:00", "16:55"], ["17:00", "17:55"]); $view->Assign("heure_de_cours", $heure_de_cours); $view->Assign("idselect", $this->comboClasses->idname); switch ($action) { case "charger": $enseignements = $this->Enseignement->getEnseignements($this->request->idclasse); $view->Assign("enseignements", $enseignements); $json[0] = $view->Render("emplois" . DS . "ajax" . DS . "enseignement", FALSE); break; case "ajout": $params = ["jour" => $this->request->jour, "idenseignement" => $this->request->idenseignement, "heuredebut" => $this->request->heuredebut, "heurefin" => $this->request->heurefin]; $this->Emplois->insert($params); break; case "supprimer": $this->Emplois->delete($this->request->idemplois); break; } //dataTable de l'emploi du temps: Onglet 1 $ens = $this->Emplois->getEmplois($this->request->idclasse); $view->Assign("enseignements", $ens); $json[1] = $view->Render("emplois" . DS . "ajax" . DS . "emplois", false); //apercu de l'emploi du temps: Onglet 2 $json[2] = $view->Render("emplois" . DS . "ajax" . DS . "apercu", false); echo json_encode($json); }
/** Pour les onglets eleves */ public function eleve($val) { $view = new View(); $arr = array(); $onglet1 = $view->Render("ajax" . DS . "80010", false); $onglet2 = $view->Render("ajax" . DS . "80011", false); $arr[0] = $onglet1; $arr[1] = $onglet2; print json_encode($arr); }
public function ajax($action) { $view = new View(); $json = array(); $compte = $this->Compteeleve->findSingleRowBy(["ELEVE" => $this->request->eleve]); switch ($action) { case "supprimer": $this->Scolarite->delete($this->request->idscolarite); break; case "charger": //Frais dont l'eleve doit payer $frais = $this->Frais->getEleveFrais($this->request->eleve, $this->session->anneeacademique); $view->Assign("frais", $frais); $json[1] = $view->Render("scolarite" . DS . "ajax" . DS . "comboFrais", false); $caisses = $this->Caisse->findBy(["COMPTE" => $compte['IDCOMPTE']]); $view->Assign("caisses", $caisses); $json[2] = $view->Render("scolarite" . DS . "ajax" . DS . "comboCaisses", false); break; case "ajout": $frais = $this->Frais->findSingleRowBy(["IDFRAIS" => $this->request->idfrais]); //Rechercher le montant lie a cette operation caisse $caisse = $this->Caisse->findSingleRowBy(['IDCAISSE' => $this->request->idcaisse]); /** * Rechercher tous le total des payement se basant sur cette operation caisse */ $total = $this->Scolarite->getTotalByCaisse($this->request->idcaisse); /** * definir le montant du payement = montant de l'operation caisse - montant total des scolarite se basant * sur cette operation caisse */ $montantscolarite = intval($caisse['MONTANT']) - intval($total['TOTAL']); if ($montantscolarite == 0) { $json[1] = $caisse['MONTANT']; } else { $montant = $montantscolarite < $frais['MONTANT'] ? $montantscolarite : $frais['MONTANT']; $personnel = $this->Personnel->findSingleRowBy(["USER" => $this->session->iduser]); $params = ["eleve" => $this->request->eleve, "frais" => $this->request->idfrais, "montant" => $montant, "datepayement" => date("Y-m-d", time()), "anneeacademique" => $this->session->anneeacademique, "realiserpar" => $personnel['IDPERSONNEL']]; $this->Scolarite->insert($params); //Debiter le compte $json[1] = ''; } break; } $scolarites = $this->Scolarite->getScolarites($this->request->eleve, $this->session->anneeacademique); $view->Assign("scolarites", $scolarites); $json[0] = $view->Render("scolarite" . DS . "ajax" . DS . "scolarite", false); echo json_encode($json); }
public function index() { $this->view->clientsJS("connexion" . DS . "index"); $view = new View(); $view->Assign("errors", false); $view->setCSS("public/css/connexion.css"); //le formulaire est soumis if (isset($this->request->login) && isset($this->request->pwd)) { if ($this->Connexion->authenticate($this->request->login, md5($this->request->pwd)) === TRUE) { $_SESSION['user'] = $this->request->login; //Definir la valeur du Timeout lors de la connexion a 10 min $_SESSION['timeout'] = time() + TIME_OUT; $_SESSION['anneeacademique'] = $this->request->anneeacademique; //Garder la trace de connexion dans la table connexion $this->keepTrack(); if (isset($_SESSION['activeurl'])) { header("Location:" . $_SESSION['activeurl']); } else { header("Location:" . SITE_ROOT); } } else { $view->Assign("errors", true); } } $view->Assign("post", $this->request); $this->loadModel("anneeacademique"); $anneeAcad = $this->Anneeacademique->selectAll(); $anneeacademique = new Combobox($anneeAcad, "anneeacademique", "ANNEEACADEMIQUE", "ANNEEACADEMIQUE"); $view->Assign("anneeacademique", $anneeacademique->view()); $content = $view->Render("connexion" . DS . "index", false); $this->Assign("content", $content); }
/** * Code droit 512: Saisie d'une operation caise */ public function saisie() { $this->view->clientsJS("caisse" . DS . "caisse"); $view = new View(); $content = $view->Render("caisse" . DS . "saisie", false); $this->Assign("content", $content); }
public function envoi() { if (!isAuth(307)) { return; } $this->view->clientsJS("message" . DS . "envoi"); $view = new View(); if (!empty($this->request->message)) { # Envoyer le SMS et rediriger vers la page de suivi de SMS $this->activateSMS(); $retval = $this->send($this->request->destinataire, $this->request->message); if ($retval === false) { $view->Assign("errors", true); } else { $view->Assign("errors", false); # Inserer dans la table message envoyes $personnel = $this->Personnel->getBy(["USER" => $this->session->iduser]); $params = ["dateenvoie" => date("Y-m-d H:i:s", time()), "destinataire" => $this->request->destinataire, "expediteur" => $personnel['IDPERSONNEL'], "message" => $this->request->message]; $this->Messageenvoye->insert($params); } } $destinataires = $this->Repertoire->getDestinataires(); $view->Assign("destinataires", $destinataires); $content = $view->Render("message" . DS . "envoi", false); $this->Assign("content", $content); }
public function ajaxverrouillage() { $action = $this->request->action; $view = new View(); $json = array(); switch ($action) { case "verrouiller": $this->Sequence->update(["VERROUILLER" => 1], ["IDSEQUENCE" => $this->request->idsequence]); # Verrouiller egalement toutes les notes dans la table notation de ce semestre $this->Notation->update(["VERROUILLER" => 1], ["SEQUENCE" => $this->request->idsequence]); # Verrouiller les appels de cette sequence $sequence = $this->Sequence->get($this->request->idsequence); $this->Appel->lockAppelsByPeriode($sequence['DATEDEBUT'], $sequence['DATEFIN']); # Inserer dans la BD, un resume des bulletins de la sequence $this->recapitulerMoyenne($this->request->idsequence); break; case "deverrouiller": $this->Sequence->update(["VERROUILLER" => 0], ["IDSEQUENCE" => $this->request->idsequence]); # Deverrouiller egalement les notes de ce semestre $this->Notation->update(['VERROUILLER' => 0], ["SEQUENCE" => $this->request->idsequence]); # Deverrouiller les appels de cette sequences $sequence = $this->Sequence->get($this->request->idsequence); $this->Appel->unlockAppelsByPeriode($sequence['DATEDEBUT'], $sequence['DATEFIN']); # Supprimer le resume des bulletins precedement defini lors du verrouillage $this->Recapitulatifbulletin->deleteBy(["sequence" => $this->request->idsequence]); break; } $sequences = $this->Sequence->getSequences($this->session->anneeacademique); $view->Assign("sequences", $sequences); $json[0] = $view->Render("sequence" . DS . "ajax" . DS . "tableSequence", false); echo json_encode($json); }
public function index() { $view = new View(); $this->loadJPGraph(); $content = $view->Render("jpgraph" . DS . "index", false); $this->Assign("content", $content); }
public function imprimer() { parent::printable(); $view = new View(); $view->Assign("pdf", $this->pdf); echo $view->Render("index" . DS . "impression" . DS . "font", false); }
public function index() { $view = new View(); $str = "Utilisateur connecté : " . $_SESSION['user'] . "/" . $_SESSION['profile'] . "/IPW " . $_SESSION['anneeacademique']; $view->Assign("infos", $str); $content = $view->Render("index" . DS . "index", false); $this->Assign("content", $content); }
public function ajaxsaisie($action) { $json = array(); $json[0] = ""; $view = new View(); $horaire = $this->Horaire->selectAll(); $heure_debut = array(); foreach ($horaire as $line) { $heure_debut[] = substr($line["HEUREDEBUT"], 0, strlen($line["HEUREDEBUT"]) - 3); } $view->Assign("horaire", $horaire); $view->Assign("heure_debut", json_encode($heure_debut)); switch ($action) { case "charger": $enseignements = $this->Enseignement->getEnseignements($this->request->idclasse); $view->Assign("enseignements", $enseignements); $json[0] = $view->Render("emplois" . DS . "ajax" . DS . "enseignement", FALSE); break; case "ajout": $horaires = $this->Horaire->getHoraireIntervalle($this->request->horairedebut, $this->request->horairefin, $this->session->anneeacademique); foreach ($horaires as $h) { $params = ["jour" => $this->request->jour, "enseignement" => $this->request->enseignement, "horaire" => $h['IDHORAIRE']]; # Inserer dans la BD $this->Emplois->insert($params); } if (empty($this->request->horairefin)) { $params = ["jour" => $this->request->jour, "enseignement" => $this->request->enseignement, "horaire" => $this->request->horairedebut]; # Inserer dans la BD $this->Emplois->insert($params); } break; case "supprimer": $this->Emplois->delete($this->request->idemplois); break; } //dataTable de l'emploi du temps: Onglet 1 $ens = $this->Emplois->getEmplois($this->request->idclasse); $view->Assign("enseignements", $ens); $json[1] = $view->Render("emplois" . DS . "ajax" . DS . "emplois", false); //apercu de l'emploi du temps: Onglet 2 $json[2] = $view->Render("emplois" . DS . "ajax" . DS . "apercu", false); echo json_encode($json); }
public function edit($id) { if (!empty($this->request->idresponsable)) { $acceptsms = isset($this->request->acceptesms) ? "1" : "0"; $params = ["civilite" => $this->request->comboCivilite, "nom" => $this->request->nom, "prenom" => $this->request->prenom, "adresse" => $this->request->adresse, "bp" => $this->request->bp, "portable" => $this->request->portable, "telephone" => $this->request->telephone, "email" => $this->request->email, "profession" => $this->request->profession, "acceptesms" => $acceptsms, "numsms" => $this->request->numsms]; $this->Responsable->update($params, ["IDRESPONSABLE" => $this->request->idresponsable]); header("Location:" . Router::url("responsable")); } $view = new View(); $resp = $this->Responsable->findSingleRowBy(['IDRESPONSABLE' => $id]); $this->comboCivilite->selectedid = $resp['CIVILITE']; $view->Assign("comboCivilite", $this->comboCivilite->view()); $view->Assign("resp", $resp); $content = $view->Render("responsable" . DS . "edit", false); $this->Assign("content", $content); }
public function mdp() { if (!empty($this->request->pwd) && !empty($this->request->comboUtilisateurs)) { $mdpcrypte = md5($this->request->pwd); $this->User->update(["PASSWORD" => $mdpcrypte], ["IDUSER" => $this->request->comboUtilisateurs]); header("Location:" . Router::url("user", "droit")); } $this->view->clientsJS("parametre" . DS . "mdp"); $view = new View(); $users = $this->User->selectAll(); $comboUtilsateurs = new Combobox($users, "comboUtilisateurs", "IDUSER", "LOGIN"); $comboUtilsateurs->first = " "; $view->Assign("comboUtilisateurs", $comboUtilsateurs->view()); $content = $view->Render("parametre" . DS . "mdp", false); $this->Assign("content", $content); }
public function imprimer() { parent::printable(); $view = new View(); $view->Assign("pdf", $this->pdf); $action = $this->request->code; switch ($action) { # Impression de la grille horaire, repartition horaire par matiere case "0001": $planifications = $this->Planification->selectAll(); $view->Assign("planifications", $planifications); $matieres = $this->Matiere->selectAll(); $view->Assign("matieres", $matieres); $classes = $this->Classe->selectAll(); $view->Assign("classes", $classes); echo $view->Render("planification" . DS . "impression" . DS . "grillehoraire", false); break; } }
function testRenderTemplate() { $view = new View($this->TestTemplateFileName); $view->TestVariable = 'bar'; $this->assertTrue($view->Render() == ''); file_put_contents($this->TestTemplateFileName, 'Some template data'); $this->assertTrue($view->Render() == 'Some template data'); file_put_contents($this->TestTemplateFileName, 'Foo <?php echo $this->FakeVar; ?> data'); $this->assertTrue($view->Render() == 'Foo data'); file_put_contents($this->TestTemplateFileName, 'Foo <?php echo $TestVariable; ?> data'); $this->assertTrue($view->Render() == 'Foo bar data'); file_put_contents($this->TestTemplateFileName, 'Foo <?php echo $this->TestVariable; ?> data'); $this->assertTrue($view->Render() == 'Foo bar data'); $this->assertTrue($view == 'Foo bar data'); @unlink($this->TestTemplateFileName); $this->assertTrue($view == ''); $view->SetFileName(''); $this->assertTrue($view == ''); }
public function index() { $header = new View(); $header->Assign('username', 'xavism'); $this->Assign('header', $header->Render('header', false)); $menu = new View(); $menu->Assign('username', 'Xavi'); $this->Assign('menu', $menu->Render('menu', false)); $content = new View(); $registres = new Registres_Model(); $content->Assign('registres', $registres->getRegistreById(1)); $content->Assign('registres_humitat', $registres->getRegistreById(2)); $content->Assign('content-title', 'Bienvenido!'); $this->Assign('content', $content->Render('content', false)); $footer = new View(); $this->Assign('footer', $footer->Render('footer', false)); $this->Load_View('index'); $this->view->Set_Site_Title('FinApps'); }
public function DoStuff() { if (isset($_GET["lang"])) { $lang = $_GET["lang"]; } else { $lang = "en"; } if (file_exists("{$lang}.ini")) { Strings::LoadLanguageFile("{$lang}.ini"); } else { Strings::LoadLanguageFile("en.ini"); } $view = new View(); $model = new Model(); if ($view->IsLoginHappening()) { $messageid = $model->TryLogin($view->GetUserData()); $message = Strings::Get(Strings::SECTION_LOGIN, $messageid); $view->SetMessage($message); } $view->Render(); }
public function index() { if (!isAuth(206)) { return; } $view = new View(); $this->view->clientsJS("repertoire" . DS . "index"); $rep = $this->Repertoire->selectAll(); $repertoires = new Grid($rep, 1); $repertoires->actionbutton = false; $repertoires->addcolonne(0, "CIVILITE", "CIVILITE"); $repertoires->addcolonne(1, "NOM", "NOM"); $repertoires->addcolonne(2, "TELEPHONE", "TELEPHONE"); $repertoires->addcolonne(3, "PORTABLE", "PORTABLE"); $repertoires->addcolonne(4, "EMAIL", "EMAIL"); $repertoires->dataTable = "tableRepertoire"; $view->Assign("total", count($rep)); $view->Assign("repertoires", $repertoires->display()); $content = $view->Render("repertoire" . DS . "index", false); $this->Assign("content", $content); }
public function __construct() { parent::__construct(); global $url; //$url est une variable globale defini dans Router.php $urlArray = explode("/", $url); /** Conservation de l'url de la page active */ if ($urlArray[0] != "connexion") { $_SESSION['activeurl'] = $url; } //Extraire le mot Eleve dans la chaine EleveController (par exple) $model = strtolower(substr(get_class($this), 0, strlen(get_class($this)) - 10)); $this->loadModel($model); $this->getInfoSchool(); //Verifier si ce n'est pas une requete AJAX if (!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) { //Charger la page template, confere destructeur __destruct $this->view = new View(); $this->view->Assign("authentified", isset($this->session->user)); //Peut se faire directement dans le template //Charger le CSS //$this->view->setCSS('public' . DS . 'css' . DS . 'style.css'); //charger le titre de la page //$this->view->setSiteTitle('Logiciel de gestion des activités académiques'); //HEADER GENERALE $header = new View(); $header->Assign('app_title', "LOCAN"); $header->Assign("authentified", isset($this->session->user)); if (isset($this->session->user)) { $header->Assign("menu", $this->menus->getMenus()); } $this->Assign('header', $header->Render('header', false)); //FOOTER GENERALE $footer = new View(); $this->Assign('footer', $footer->Render('footer', false)); } }
public function ajaxSauvegarde() { $action = $this->request->action; $view = new View(); $info = ""; switch ($action) { case "nouvelle": $chemin = $this->backupDB(); $d = new DateFR("now"); $params = ["DESCRIPTION" => "", "LIEN" => $chemin, "TAILLE" => filesize($chemin), "DATESAUVEGARDE" => date("Y-m-d H:i:s", time())]; $this->Sauvegarde->insert($params); $info = "Sauvegarde effectuée avec succès"; break; case "supprimer": $sauve = $this->Sauvegarde->get($this->request->idsauvegarde); if (file_exists($sauve["LIEN"])) { unlink($sauve["LIEN"]) or die("Impossible de supprimer le fichier sauvegarde " . $sauve["LIEN"]); } $this->Sauvegarde->delete($this->request->idsauvegarde); $info = "Sauvegarde supprimée avec succès"; break; case "restaurer": $sauve = $this->Sauvegarde->get($this->request->idsauvegarde); $bdPassword = "******" . DB_PASSWORD; if (empty(DB_PASSWORD)) { $restoreexe = "mysql -u root " . DB_NAME . " < " . $sauve['LIEN']; } else { $restoreexe = "mysql -u root " . $bdPassword . " " . DB_NAME . " < " . $sauve['LIEN']; } exec($restoreexe); $info = "Restauration effectuée avec succès"; break; } $view->Assign("info", $info); $sauvegardes = $this->Sauvegarde->selectAll(); $view->Assign("sauvegardes", $sauvegardes); echo $view->Render("sauvegarde" . DS . "ajax" . DS . "sauvegarde", false); }
function ajax($action) { $view = new View(); $json = array(); switch ($action) { case "ajouter": $params = ["DESCRIPTION" => $this->request->description, "MONTANT" => $this->request->montant, "ECHEANCES" => $this->request->echeances, "CLASSE" => $this->request->idclasse]; $this->Frais->insert($params); break; case "supprimer": $this->Frais->delete($this->request->idfrais); break; case "load": break; case "edit": $params = ["DESCRIPTION" => $this->request->description, "CLASSE" => $this->request->idclasse, "ECHEANCES" => $this->request->echeances, "MONTANT" => $this->request->montant]; $this->Frais->update($params, ["IDFRAIS" => $this->request->idfrais]); break; } $frais = $this->Frais->findBy(["CLASSE" => $this->request->idclasse]); $view->Assign("frais", $frais); $json[0] = $view->Render("frais" . DS . "ajax" . DS . "frais", false); echo json_encode($json); }
public function ajaxoperation() { $action = $this->request->action; $json = array(); $view = new View(); $datedebut = parseDate($this->request->datedebut); $datefin = parseDate($this->request->datefin); switch ($action) { case "validerOperation": $this->Caisse->update(["valide" => 1], ["idcaisse" => $this->request->idcaisse]); break; case "percuRecu": # Inserer la perception du montant par l'utilisateur connecter $personnel = $this->Personnel->getBy(["USER" => $this->session->iduser]); $params = ["percupar" => $personnel['IDPERSONNEL'], "dateperception" => date("Y-m-d H:i:s", time())]; $this->Caisse->update($params, ["idcaisse" => $this->request->idcaisse]); # Envoi du SMS a ce numero $this->notifyVersement(); break; } # 1 = Operation en cours, 2 = Operation validee, 3 = Operation dont le montant est percue $filtre = $this->request->filtre; if (empty($datedebut)) { $datedebut = "1970-01-01"; } if ($filtre == 1) { $operations = $this->Caisse->getOperationsEncours($datedebut, $datefin); } elseif ($filtre == 2) { $operations = $this->Caisse->getOperationsValidees($datedebut, $datefin); } elseif ($filtre == 3) { $operations = $this->Caisse->getOperationsPercues($datedebut, $datefin); } elseif (!empty($this->request->datedebut)) { $operations = $this->Caisse->getOperationsByJour($datedebut, $datefin); } else { $operations = $this->Caisse->selectAll(); } $view->Assign("operations", $operations); $json[0] = $view->Render("caisse" . DS . "ajax" . DS . "operation", false); # montant $totaux = $this->Caisse->getMontantTotaux($datedebut, $datefin); $view->Assign("totaux", $totaux); $json[1] = $view->Render("caisse" . DS . "ajax" . DS . "tableTotaux", false); echo json_encode($json); }
<?php $view = new View(); $db = new Database(); $view->Header("Profil użytkownika: " . $user->getDisplayName()); $view->Render();
public function imprimer() { parent::printable(); $code = $this->request->code; $view = new View(); $view->Assign("pdf", $this->pdf); switch ($code) { # Impression de la programmation pedagogique case "0001": $enseignement = $this->Enseignement->get($this->request->idenseignement); $view->Assign("enseignement", $enseignement); $chapitres = $this->Chapitre->getChapitresByEnseignement($this->request->idenseignement); $view->Assign("chapitres", $chapitres); echo $view->Render("pedagogie" . DS . "impression" . DS . "programmationpedagogique", false); break; # impression du suivi pedagogique # impression du suivi pedagogique case "0002": # Si toutes les lecons de ce chapitre sont, alors afficher a cote fait $chapitres = $this->Chapitre->getChapitresByEnseignement($this->request->idenseignement); $view->Assign("chapitres", $chapitres); echo $view->Render("pedagogie" . DS . "impression" . DS . "suivipedagogique", false); break; } }
if (!empty($_POST['email']) && !ctype_space($_POST['email']) && preg_match($string, $_POST['email'])) { View::$vars->email = trim($_POST['email']); } else { View::$vars->Errors['email'] = Language::GetText('error_email'); } // Validate feedback if (!empty($_POST['feedback']) && !ctype_space($_POST['feedback'])) { View::$vars->feedback = trim($_POST['feedback']); } else { View::$vars->Errors['feedback'] = Language::GetText('error_message'); } // Send email if no errors if (empty(View::$vars->Errors)) { $subject = 'Message received From ' . $config->sitename; $Msg = "Name: " . View::$vars->name . "\n"; $Msg .= "E-mail: " . View::$vars->email . "\n"; $Msg .= "Message:\n" . View::$vars->feedback; App::Alert($subject, $Msg); Plugin::Trigger('contact.send'); View::$vars->message_type = 'success'; View::$vars->message = Language::GetText('success_contact_sent'); } else { View::$vars->message_type = 'error'; View::$vars->message = Language::GetText('errors_below'); View::$vars->message .= '<br /><br /> - ' . implode('<br /> - ', View::$vars->Errors); } } // Output Page Plugin::Trigger('contact.before_render'); View::Render('contact.tpl');
} // Delete message (Request came from view message page) } else { if (isset($_GET['delete']) && is_numeric($_GET['delete']) && $_GET['delete'] > 0) { $data = array('recipient' => View::$vars->user->user_id, 'message_id' => $_GET['delete']); $message_id = Message::Exist($data); if ($message_id) { Message::Delete($message_id); View::$vars->message = Language::GetText('success_messages_purged'); View::$vars->message_type = 'success'; Plugin::Trigger('message_inbox.delete_message'); } } } /****************** Prepare page to run ******************/ // Retrieve total count $query = "SELECT message_id FROM " . DB_PREFIX . "messages WHERE recipient = " . View::$vars->user->user_id; $result_count = $db->Query($query); $total = $db->Count($result_count); // Initialize pagination View::$vars->pagination = new Pagination($url, $total, $records_per_page); $start_record = View::$vars->pagination->GetStartRecord(); // Retrieve limited results $query .= " LIMIT {$start_record}, {$records_per_page}"; View::$vars->result = $db->Query($query); // Output page Plugin::Trigger('message_inbox.before_render'); View::Render('myaccount/message_inbox.tpl');
public function ajaxoperation() { $action = $this->request->action; $json = array(); $view = new View(); switch ($action) { case "percuRecu": # Inserer la perception du montant par l'utilisateur connecter $personnel = $this->Personnel->getBy(["USER" => $this->session->iduser]); $params = ["percupar" => $personnel['IDPERSONNEL'], "dateperception" => date("Y-m-d H:i:s", time())]; $this->Caisse->update($params, ["idcaisse" => $this->request->idcaisse]); break; case "validerOperation": $this->Caisse->update(["valide" => 1], ["idcaisse" => $this->request->idcaisse]); break; } $operations = $this->Caisse->findBy(["eleve" => $this->request->ideleve]); $view->Assign("operations", $operations); $json[0] = $view->Render("caisse" . DS . "ajax" . DS . "operation", false); echo json_encode($json); }
public function delete($id) { $inscription = $this->Inscription->findSingleRowBy(["IDINSCRIPTION" => $id]); $idclasse = $inscription['IDCLASSE']; if ($this->Inscription->delete($id)) { # Supprimer les notes qu'il a eu lorsqu'il etai inscrit dans # cette classe /*$this->Note->deleteNoteByDesinscription($inscription['ANNEEACADEMIQUE'], $inscription['IDELEVE']);*/ $json = array(); $elevesinscrits = $this->Inscription->getInscrits($idclasse, $this->session->anneeacademique); $view = new View(); $view->Assign("eleves", $elevesinscrits); $json[0] = $view->Render("classe" . DS . "ajax" . DS . "eleve", false); //Liste des eleves non inscrits mis a jour $elevesnoninscripts = $this->Inscription->getNonInscrits($this->session->anneeacademique); $comboEleve = new Combobox($elevesnoninscripts, "listeeleve", "IDELEVE", "CNOM"); $view->Assign("comboEleves", $comboEleve->view()); $json[1] = $view->Render("classe" . DS . "ajax" . DS . "dialog-1", false); } else { $json[0] = "Erreur de suppression"; $json[1] = new Combobox(NULL, "listeeleve", "IDELEVE", "CNOM"); } echo json_encode($json); }