本文整理汇总了PHP中Model::close方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::close方法的具体用法?PHP Model::close怎么用?PHP Model::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model
的用法示例。
在下文中一共展示了Model::close方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$model = new Model();
$data["auth"] = $this->util->estAuthent();
if (!isset($get["num"])) {
$data["liste"] = $model->getElevesGroupe($util->getNumGroupe());
$data["droit"] = $this->util->estProf();
$model->close();
$this->setViewMenu();
$this->view->init('passprof.php', $data);
$this->setViewBas();
} else {
$l = $get["l"];
if ($get["l"] == "p") {
$data["tableau"] = $model->getTableauSyntheseNew($get["num"]);
$data["synth"] = $model->getSynth($get["num"]);
$model->close();
$this->view->init('synthese.php', $data);
} else {
$data["bilan"] = $model->getBilan($get["num"]);
$model->close();
$this->setViewMenu();
$this->view->init('bilan.php', $data);
$this->setViewBas();
}
}
}
示例2: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$this->setViewMenu();
if (isset($get["vers"])) {
$vers = $get["vers"];
} else {
$vers = 1;
}
if (isset($get["depuis"])) {
$depuis = $get["depuis"];
} else {
$depuis = 1;
}
$model = new Model();
if (isset($get["enregistrer"])) {
//on a cliqué un bouton enregistrer
if (isset($get["li"])) {
//il y a des situs (inutile ici...)
$model->validSitu($get["chk"], $this->util->getId(), $get["li"]);
}
}
$data["lessitus"] = $model->getSitus($util->getId(), $util->getNumGroupe(), $vers);
$data["auth"] = $this->util->estAuthent();
$data["vers"] = $vers;
$data["type"] = "V";
//validations
$this->view->init('dessitus.php', $data);
$this->setViewBas();
$model->close();
}
示例3: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$model = new Model();
if (isset($get["mode"])) {
$mode = $get["mode"];
$numsitu = $get["numsitu"];
switch ($mode) {
case 1:
$model->supprSitu($numsitu);
break;
case 2:
$model->recupSitu($numsitu);
break;
case 3:
$model->destrucSitu($numsitu);
break;
}
}
$data["lessitusel"] = $model->getSitusEl($util->getId());
$model->close();
$this->setViewMenu();
$data["auth"] = $this->util->estAuthent();
$this->view->init('dessitusel.php', $data);
$this->setViewBas();
}
示例4: verificarLogin
public function verificarLogin()
{
$obj = new loginHelper();
if ($obj->getDataSession("usuario_login") == null) {
throw new Exception_Form("Você precisa efetuar o login novamente para continuar.");
} else {
$model = new Model();
$model->open();
$model->set("sql", "\n\t\t\t\t\tINSERT INTO `systemlog` \n\t\t\t\t\t\t(`method`, `url`, `dados`, `login`, `data`) \n\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t(:method,:url,:dados,:login,now())\n\t\t\t\t");
$model->set('params', array(":method" => $this->_method, ":url" => $_SERVER['REQUEST_URI'], ":dados" => implode(';', $this->_dados), ":login" => $obj->getDataSession("usuario_login")));
$model->query();
$model->close();
}
}
示例5: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$model = new Model();
//tableau reglementaire en premiere page
$data["tableau"] = $model->getTableauSyntheseNew($util->getId());
//puis une page par situation
//pas vues dans cette version
$data["synth"] = $model->getSynth($util->getId());
$model->close();
$data["auth"] = $this->util->estAuthent();
$this->view->init('synthese.php', $data);
}
示例6: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$model = new Model();
if (isset($get["ep"])) {
$ep = $get["ep"];
} else {
$ep = 1;
}
$data["passeport"] = $model->getPasseport($util->getId(), $ep, $util->estLibre());
$model->close();
$data["auth"] = $this->util->estAuthent();
$this->view->init('passeport.php', $data);
}
示例7: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$model = new Model();
$this->setViewMenu();
$mess = '';
if (isset($get["envoi"])) {
//bouton envoi
$nb = 0;
if (isset($get["groupes"])) {
$ls = $get["groupes"];
for ($i = 0; $i < count($ls); $i++) {
//pour chaque groupe
$res = $model->getMelsElevesGroupe($ls[$i]);
for ($j = 0; $j < count($res); $j++) {
//pour chaque élève j d'un groupe i
$this->envoimel($res[$j]["mel"], $res[$j]["mdp"]);
$nb++;
}
}
}
if (isset($get["professeurs"])) {
$ls = $get["professeurs"];
for ($i = 0; $i < count($ls); $i++) {
//pour chaque prof
$res = $model->getMelProfesseur($ls[$i]);
$this->envoimel($res[0]["mel"], $res[0]["mdp"]);
$nb++;
}
}
if (isset($get["etudiants"])) {
$ls = $get["etudiants"];
for ($i = 0; $i < count($ls); $i++) {
//pour chaque élève
$res = $model->getMelEleve($ls[$i]);
$this->envoimel($res[0]["mel"], $res[0]["mdp"]);
$nb++;
}
}
$mess = $nb . " message(s) envoyé(s)";
}
$data = array("groupes" => $model->getGroupes(), "professeurs" => $model->getProfesseurs(), "etudiants" => $model->getEtudiants(), "messagetexte" => $mess);
$model->close();
$data["auth"] = $this->util->estAuthent();
$this->view->init('passe.php', $data);
$this->setViewBas();
}
示例8: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$this->setViewMenu();
if (isset($get["depuis"])) {
$depuis = $get["depuis"];
} else {
$depuis = 1;
}
$model = new Model();
$data["bilan"] = $model->getBilan($this->util->getId());
$data["auth"] = $this->util->estAuthent();
$this->view->init('bilan.php', $data);
$this->setViewBas();
$model->close();
}
示例9: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$this->setViewMenu();
if (isset($get["depuis"])) {
$depuis = $get["depuis"];
} else {
$depuis = 1;
}
if (isset($get["t"])) {
$t = $get["t"];
} else {
$t = "";
}
if (isset($get["iddoc"])) {
$iddoc = $get["iddoc"];
} else {
$iddoc = 0;
}
if (isset($get["e"])) {
$e = $get["e"];
} else {
$e = "t";
}
//fichier titre pas supprimé par defaut
$model = new Model();
if (!is_null($get["sauve"])) {
//enregistre
$iddoc = $model->sauveDoc($e, $iddoc, $get["titre"], $get["el"], $this->util->getNom(), $this->util->getId(), $t);
}
if ($iddoc != 0) {
//relit
$data["doc"] = $model->getUnDoc($e, $iddoc, $this->util->getId(), $t);
}
$data["auth"] = $this->util->estAuthent();
$data["iddoc"] = $iddoc;
$data["t"] = $t;
$data["e"] = $e;
$this->view->init('saisiecpt.php', $data);
$this->setViewBas();
$model->close();
}
示例10: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$model = new Model();
$data["auth"] = $this->util->estAuthent();
if (isset($get["num"])) {
$num = $get["num"];
$data["nom"] = $get["nom"];
$data["eleves"] = $model->getElevesGroupe($num);
$data["profs"] = $model->getProfsGroupe($num);
} else {
$data["groupes"] = $model->getGroupes();
}
$this->setViewMenu();
$this->view->init('suivigr.php', $data);
$model->close();
$this->setViewBas();
}
示例11: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$this->setViewMenu();
if (!isset($get["vers"])) {
$vers = 1;
} else {
$vers = $get["vers"];
}
if (!isset($get["depuis"])) {
$depuis = 1;
} else {
$depuis = $get["depuis"];
}
$model = new Model();
if (isset($get["num"])) {
$num = $get["num"];
} else {
$num = null;
}
if (isset($get["ty"])) {
$ty = $get["ty"];
} else {
$ty = 0;
}
//rest par défaut
if (!is_null($num)) {
if ($ty == 1) {
//on supprime
$model->suppPersonne($vers, $num);
} else {
//restaure
$model->restPersonne($vers, $num);
}
}
$data["suppr"] = $model->getSuppr($vers);
$data["vers"] = $vers;
$data["auth"] = $this->util->estAuthent();
$model->close();
$this->view->init('suppr.php', $data);
$this->setViewBas();
}
示例12: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$model = new Model();
$data["auth"] = $this->util->estAuthent();
if (isset($get["num"])) {
$this->model();
$nt = $get["num"];
$model = new Model();
$liste = $model->getMDPGroupe($nt);
$repfic = 'dirrw/csv/';
$nf = 'mp' . substr('000' . $nt, -3, 3);
$nomfic = $repfic . $nf . ".csv";
$fic = fopen($nomfic, "w");
$li = "Date sauvegarde;" . date("Y-m-d") . "\r\n";
fputs($fic, $li);
$li = "numero;nom;prenom;mel;motPasse\r\n";
fputs($fic, $li);
foreach ($liste as $ligne) {
$li = '';
foreach ($ligne as $cle => $val) {
if ($li == '') {
$li = $val;
} else {
$li = $li . ';' . $val;
}
}
$li .= "\r\n";
fputs($fic, $li);
}
fclose($fic);
$data["fic"] = $nf . ".csv";
} else {
$data["groupes"] = $model->getGroupes();
}
$this->setViewMenu();
$this->view->init('mpasse.php', $data);
$model->close();
$this->setViewBas();
}
示例13: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$mel = $this->ha($get["login"]);
$mdp = $this->ha($get["mdp"]);
//$groupe=$this->ha($get["groupe"]);
$data = null;
if ($this->ctrlmel($mel)) {
$model = new Model();
//if ($mel!="" && $mdp!="" && $groupe!=""){ //3 champs remplis
if ($mel != "" && $mdp != "") {
//2 champs remplis
$crypte = new Crypte();
if ($crypte->getCrypte()) {
$mdp = md5($mdp);
}
//if ($tb=$model->getAuthent($mel,$mdp,$groupe)){
if ($tb = $model->getAuthent($mel, $mdp)) {
$this->util->init($tb[0]["num"], $tb[0]["nom"], $tb[0]["prenom"], $tb[0]["niveau"], $tb[0]["groupes"]);
$_SESSION['ctrl'] = $this->util;
}
}
$model->close();
}
$this->setViewMenu();
$suff = "";
if ($this->util->estEtudiant()) {
$suff = "e";
}
if ($this->util->estProf() || $this->util->estLecteur()) {
$suff = "p";
}
if ($this->util->estAdmin()) {
$suff = "a";
}
$this->view->init('corpsaccueil' . $suff . '.php', $data);
$this->setViewBas();
}
示例14: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$this->setViewMenu();
if (isset($get["depuis"])) {
$depuis = $get["depuis"];
} else {
$depuis = 1;
}
$model = new Model();
if (isset($get["t"])) {
$t = $get["t"];
if (isset($get["a"])) {
$a = $get["a"];
switch ($a) {
case "s":
//suppression
$model->supprimerDoc($get["iddoc"], $t, $this->util->getId());
break;
case "r":
//restaure
$model->restaurerDoc($get["iddoc"], $t, $this->util->getId());
break;
case "d":
//detruire
$model->detruireDoc($get["iddoc"], $t, $this->util->getId());
break;
}
}
}
$data["liste"] = $model->getLesDoc($this->util->getId());
$data["auth"] = $this->util->estAuthent();
//$data["t"]=$t;
$this->view->init('voircpt.php', $data);
$this->setViewBas();
$model->close();
}
示例15: __construct
public function __construct($util, $get = null)
{
parent::__construct($util);
$this->model();
$model = new Model();
$data["auth"] = $this->util->estAuthent();
if (isset($get["num"])) {
$num = $get["num"];
$data["nom"] = $get["nom"];
$data["eleves"] = $model->getElevesGroupe($num);
//$data["profs"]=$model->getProfsGroupe($num);
} else {
if (isset($get["etud"])) {
foreach ($get["etud"] as $unetud) {
$model->suppPersonne(2, $unetud);
}
}
$data["groupes"] = $model->getGroupes();
}
$model->close();
$this->setViewMenu();
$this->view->init('finetude.php', $data);
$this->setViewBas();
}