本文整理匯總了PHP中ProjetManager::exists方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProjetManager::exists方法的具體用法?PHP ProjetManager::exists怎麽用?PHP ProjetManager::exists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ProjetManager
的用法示例。
在下文中一共展示了ProjetManager::exists方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elseif
{
if (file_exists('../model/' . $myClass . '.php')) {
include '../model/' . $myClass . '.php';
} elseif (file_exists('../controller/' . $myClass . '.php')) {
include '../controller/' . $myClass . '.php';
}
}
spl_autoload_register("classLoad");
include '../config.php';
//classes loading end
session_start();
//post input processing
if (!empty($_POST['nom'])) {
$nom = htmlentities($_POST['nom']);
$projetManager = new ProjetManager($pdo);
if ($projetManager->exists($nom) > 0) {
$_SESSION['projet-add-error'] = "<strong>Erreur Ajout Projet : </strong>Un projet existe déjà avec ce nom : " . $nomProjet . ".";
header('Location:../projets.php');
exit;
} else {
$numeroTitre = htmlentities($_POST['numeroTitre']);
$emplacement = htmlentities($_POST['emplacement']);
$superficie = htmlentities($_POST['superficie']);
$description = htmlentities($_POST['description']);
$dateCreation = htmlentities($_POST['dateCreation']);
$status = "En cours";
$createdBy = $_SESSION['userMerlaTrav']->login();
$created = date('Y-m-d');
$idSociete = htmlentities($_POST['idSociete']);
//create object
$projet = new Projet(array('nom' => $nom, 'numeroTitre' => $numeroTitre, 'emplacement' => $emplacement, 'superficie' => $superficie, 'description' => $description, 'dateCreation' => $dateCreation, 'status' => $status, 'createdBy' => $createdBy, 'created' => $created, 'idSociete' => $idSociete));