Example #1
0
require "bd.inc.php";
if (!isset($_GET['nomEntreprise'])) {
} else {
    if (verifEntreprise($_GET['nomEntreprise']) == null) {
    } else {
        //if(isset($_SESSION["estConnecteClient"])) {
        if ($_SESSION["nomSession"] != $_GET['nomEntreprise']) {
        } else {
            $_SESSION["nomE"] = $_GET['nomEntreprise'];
            $connexion = connect();
            $nomE = $_GET['nomEntreprise'];
            $nomAffichage = str_replace(' ', '_', $nomE);
            //permet de récuperer les infos de connexion
            $i = infosEntreprise();
            //récupère la liste des prestations de l'entreprise
            $prest = listePrestations();
            //Le mot de passe doit être renseigner
            if (isset($_POST['mdp'])) {
                //$mdp = md5($_POST['mdp']);
                $mdp = $_POST['mdp'];
            }
            //Les informations doivent être correcte
            if (!empty($_POST['login']) && !empty($_POST['mdp'])) {
                //récupération des infos de connexion des clients
                $j = logClient($_POST['login'], $_POST['mdp']);
                if ($j != null) {
                    if ($_POST['login'] == $j->login_client && $mdp == $j->mdp_client) {
                        $_SESSION["client"] = $j->id_client;
                        $_SESSION["estConnecte"] = 1;
                        $_SESSION["nomSession"] = $_GET['nomEntreprise'];
                    }
require "fonctions.inc.php";
require "ajout.inc.php";
require "bd.inc.php";
if ($_SESSION["nomE"] == "Nom de l'entreprise non spécifiée") {
} else {
    if (verifEntreprise($_SESSION['nomE']) == null) {
    } else {
        if (!isset($_SESSION["nomSession"])) {
        } else {
            if ($_SESSION["nomSession"] != $_GET['nomEntreprise']) {
            } else {
                $nomE = $_SESSION["nomSession"];
                $connexion = connect();
                $rqt = infosEmploye();
                $i = infosEntreprise();
                $listePresta = listePrestations();
                $listeEmpVerif = verifEmploye();
                $listePlan = listePlanning();
                if (isset($_POST['ajout'])) {
                    $ajoutOk = 1;
                    while ($val = $listeEmpVerif->fetch(PDO::FETCH_OBJ)) {
                        if ($val->nom_employe == $_POST['nom'] && $val->prenom_employe == $_POST['prenom']) {
                            $ajoutOk = 0;
                        }
                    }
                    if ($ajoutOk == 1) {
                        $code = code($nomE . "_employe", 'id_employe');
                        //Vérification des champs
                        if ($_POST['nom'] == null || $_POST['prenom'] == null || $_POST['adresse'] == null || $_POST['mail'] == null || $_POST['tel'] == null) {
                            $erreur1 = 1;
                        } else {