Exemplo n.º 1
0
} else {
    //On se connecte
    connectBase();
    // On recupere ID
    $id_user = $_POST['id_user'];
    // On recupere la ligne
    $select = 'SELECT id_user,mail,password,nom,prenom,droit FROM utilisateur WHERE id_user = '******' ';
    $result = mysql_query($select) or die('Erreur : ' . mysql_error());
    $total = mysql_num_rows($result);
    // On affiche le formulaire pre-rempli
    while ($row = mysql_fetch_array($result)) {
        $id_user = $row["id_user"];
        $mail = $row['mail'];
        $password = $row['password'];
        $nom = $row['nom'];
        $prenom = $row['prenom'];
        $droit = $row['droit'];
        echo "\r\n\t\t<h2 align=\"center\">/!\\ Attention /!\\</h2><br>\r\n\t\t<h4 align=\"center\">Etes-vous sur de vouloir supprimer l'enregistrement suivant ?</h4><br>\r\n\t\t<div class=\"col-md-3\"></div>\r\n\t\t\t<div class=\"col-md-6\" align=\"center\">\r\n\t\t<table class=\"table table-striped\">\r\n        <form name=\"inscription\" method=\"post\" action=\"supp_user.php\">\r\n\t\t<tr>\r\n\t\t\t<td>Utilisateur : </td>\r\n\t\t\t<td>{$mail}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Mot de passe :\t</td>\r\n\t\t\t<td>{$password}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Nom :\t</td>\r\n\t\t\t<td>{$nom}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Prenom :\t</td>\r\n\t\t\t<td>{$prenom}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Role :\t</td>\r\n\t\t\t<td>";
        if ($droit == "1") {
            echo "Chauffeur";
        }
        if ($droit == "2") {
            echo "Administration";
        }
        echo "\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t\t<input type=\"hidden\" name=\"id_user\" value=\"{$id_user}\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"center\"><input class=\"btn btn-danger\" type=\"submit\" name=\"supprimer\" value=\"Supprimer\"/></td>\r\n\t\t</tr>\r\n        </form>\r\n\t\t</table>";
    }
}
// on ferme la page
$ppage = piedpage_formulaire("user");
echo $ppage;
include "../footer.php";
Exemplo n.º 2
0
    $ct = $_POST['ct'];
    $revision = $_POST['revision'];
    $obs = $_POST['obs'];
    $defaut = $_POST['defaut'];
    $longueur = $_POST['longueur'];
    $largeur = $_POST['largeur'];
    $hauteur = $_POST['hauteur'];
    $etat = $_POST['etat'];
    $date = date("Y-m-d", strtotime($date));
    $visite = date("Y-m-d", strtotime($ct));
    $entretien = date("Y-m-d", strtotime($revision));
    //On se connecte
    connectBase();
    //On prépare la commande sql d'insertion
    $sql = 'INSERT INTO remorque VALUES("","' . $marque . '","' . $modele . '","' . $immat . '","' . $type . '","' . $date . '","' . $visite . '","' . $entretien . '","' . $obs . '","' . $defaut . '","' . $longueur . '","' . $largeur . '","' . $hauteur . '","' . $etat . '")';
    /*on lance la commande (mysql_query) et au cas où, 
    	on rédige un petit message d'erreur si la requête ne passe pas (or die) 
    	(Message qui intègrera les causes d'erreur sql)*/
    mysql_query($sql) or die('Erreur SQL !' . $sql . '<br />' . mysql_error());
    // on ferme la connexion
    mysql_close();
    // on valide la creation
    $msg = aff_creer("La Remorque");
    echo $msg;
} else {
    echo "\t\t\t\t\r\n\t\t<br><h1 align=\"center\">Ajout d'une Remorque</h1>\r\n\t\t<div class=\"col-md-3\"></div>\r\n\t\t<div class=\"col-md-6\" align=\"center\"><table class=\"table table-striped\">\r\n\t\t<h2>Entrez les données demandées :</h2><br>\t\r\n\t\t<form name=\"inscription\" method=\"post\" action=\"add_remorque.php\">\r\n\t\t<tr>\r\n\t\t\t<td>Marque :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"marque\"/></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Mod&egravele :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"modele\"/></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Immatriculation : </td>\r\n\t\t\t<td><input type=\"text\" name=\"immat\"/></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Type : </td>\r\n\t\t\t<td><input type=\"text\" name=\"type\"/></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Date construction :\t</td>\r\n\t\t\t<td><input type=\"date\" name=\"date\"/></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Date prochain Controle Technique :\t</td>\r\n\t\t\t<td><input type=\"date\" name=\"ct\"/></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Date prochaine r&eacutevision :\t</td>\r\n\t\t\t<td><input type=\"date\" name=\"revision\"></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Observation : </td>\r\n\t\t\t<td><textarea name=\"obs\" rows=\"4\" cols=\"30\"></textarea></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Defaut : </td>\r\n\t\t\t<td><textarea name=\"defaut\" rows=\"5\" cols=\"30\"></textarea></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Longueur :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"longueur\"/></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Largeur :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"largeur\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Hauteur :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"hauteur\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Etat :\t</td>\r\n\t\t\t<td>\r\n\t\t\t\t<select name=\"etat\">\r\n\t\t\t\t<option value=\"0\">Libre</option>\r\n\t\t\t\t<option value=\"1\">Utilisée</option>\r\n\t\t\t\t<option value=\"2\">En panne</option>\r\n\t\t\t\t</select>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t\t<td colspan=\"2\" align=\"center\"><input class=\"btn btn-success\" type=\"submit\" name=\"valider\" value=\"Valider\"/></td>\r\n        </form>\r\n\t\t</table>\r\n\t";
}
// on ferme la page
$ppage = piedpage_formulaire("remorques");
echo $ppage;
include "../footer.php";
Exemplo n.º 3
0
    $nom = $_POST['nom'];
    $adresse = $_POST['adresse'];
    $cp = $_POST['cp'];
    $ville = $_POST['ville'];
    $siret = $_POST['siret'];
    $tva = $_POST['tva'];
    $tel = $_POST['tel'];
    $fax = $_POST['fax'];
    $mail = $_POST['mail'];
    $contact = $_POST['contact'];
    $obs = $_POST['obs'];
    //On se connecte
    connectBase();
    //On prépare la commande sql d'insertion
    $sql = 'INSERT INTO client VALUES("","' . $nom . '","' . $adresse . '","' . $cp . '","' . $ville . '","' . $siret . '","' . $tva . '","' . $tel . '","' . $fax . '","' . $mail . '","' . $contact . '","' . $obs . '")';
    /*on lance la commande (mysql_query) et au cas où, 
    	on rédige un petit message d'erreur si la requête ne passe pas (or die) 
    	(Message qui intègrera les causes d'erreur sql)*/
    mysql_query($sql) or die('Erreur SQL !' . $sql . '<br />' . mysql_error());
    // on ferme la connexion
    mysql_close();
    // on valide la creation
    $msg = aff_creer("Le Client");
    echo $msg;
} else {
    echo "\r\n\t\t<h1 align=\"center\">Ajout d'un Client</h1>\r\n\t\t<div class=\"col-md-3\"></div>\r\n\t\t\t<div class=\"col-md-6\" align=\"center\">\r\n\t\t<table class=\"table table-striped\">\r\n\t\t\t<h2>Entrez les donn&eacutees demand&eacutees :</h2>\r\n\t\t<form name=\"inscription\" method=\"post\" action=\"add_client.php\">\r\n\t\t<tr>\r\n\t\t\t<td>Nom :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"nom\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Adresse :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"adresse\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Code Postal :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"cp\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Ville :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"ville\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Siret :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"siret\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>N°TVA :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"tva\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>T&eacutel&eacutephone :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"tel\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Fax :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"fax\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Mail :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"mail\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Contact :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"contact\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Observation :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"obs\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"center\"><input class=\"btn btn-success\" type=\"submit\" name=\"valider\" value=\"Valider\"/></td>\r\n\t\t</tr>\r\n        </form>\r\n\t\t</table>";
}
// on ferme la page
$ppage = piedpage_formulaire("clients");
echo $ppage;
include "../footer.php";
Exemplo n.º 4
0
    if (isset($_GET['id_tracteur'])) {
        $id_tracteur = $_GET['id_tracteur'];
    } else {
        $id_tracteur = $_POST['id_tracteur'];
    }
    // On recupere la ligne
    $select = 'SELECT * FROM tracteur WHERE id_tracteur = ' . "{$id_tracteur}" . ' ';
    $result = mysql_query($select) or die('Erreur : ' . mysql_error());
    $total = mysql_num_rows($result);
    // On affiche le formulaire pre-rempli
    while ($row = mysql_fetch_array($result)) {
        $id_tracteur = $row['id_tracteur'];
        $marque = $row['marque'];
        $modele = $row['modele'];
        $immatriculation = $row['immatriculation'];
        $date = $row['date'];
        $visite = $row['visite'];
        $revision = $row['entretien'];
        $observation = $row['observation'];
        $defaut = $row['defaut'];
        $km = $row['km'];
        $etat = $row['etat'];
        echo "\r\n\t\t<h2 align=\"center\">/!\\ Attention /!\\</h2><br>\r\n\t\t<h4 align=\"center\">Etes-vous sur de vouloir supprimer l'enregistrement suivant ?</h4><br>\r\n\t\t<div class=\"col-md-3\"></div>\r\n\t\t\t<div class=\"col-md-6\" align=\"center\">\r\n\t\t<table class=\"table table-striped\">\r\n        <form name=\"inscription\" method=\"post\" action=\"supp_tracteur.php\">\r\n\t\t<tr>\r\n\t\t\t<td>Marque :\t</td>\r\n\t\t\t<td>{$marque}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Mod&egravele :\t</td>\r\n\t\t\t<td>{$modele}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Immatriculation : </td>\r\n\t\t\t<td>{$immatriculation}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Date construction :\t</td>\r\n\t\t\t<td>{$date}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Date prochain Controle Technique :\t</td>\r\n\t\t\t<td>{$visite}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Date prochaine r&eacutevision :\t</td>\r\n\t\t\t<td>{$revision}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Observation : </td>\r\n\t\t\t<td>{$observation}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Defaut : </td>\r\n\t\t\t<td>{$defaut}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Kilométrage : </td>\r\n\t\t\t<td>{$km}</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"center\"><input class=\"btn btn-danger\" type=\"submit\" name=\"supprimer\" value=\"Supprimer\"/></td>\r\n\t\t</tr>\r\n\t\t\t<input type=\"hidden\" name=\"id_tracteur\" value=\"{$id_tracteur}\">\r\n\t\t\t</form>\r\n\t\t</table>";
    }
    // on ferme la connexion
    mysql_close();
}
// on ferme la page
$ppage = piedpage_formulaire("tracteurs");
echo $ppage;
include "../footer.php";
Exemplo n.º 5
0
    echo $msg;
} else {
    //On se connecte
    connectBase();
    // On recupere ID
    $id_chauffeur = $_POST['id_chauffeur'];
    // On recupere la ligne
    $select = 'SELECT * FROM chauffeur WHERE id_chauffeur = ' . "{$id_chauffeur}" . ' ';
    $result = mysql_query($select) or die('Erreur : ' . mysql_error());
    $total = mysql_num_rows($result);
    // On affiche le formulaire pre-rempli
    while ($row = mysql_fetch_array($result)) {
        $id_chauffeur = $row["id_chauffeur"];
        $nom = $row["nom"];
        $prenom = $row["prenom"];
        $tel = $row["tel"];
        $mail = $row["mail"];
        $permis = $row["permis"];
        $expiration = $row["expiration"];
        $fimo = $row['fimo'];
        $matiere = $row['matiere'];
        $ppetrolier = $row['ppetrolier'];
        echo "\r\n\t\t<h1 align=\"center\">Modification d'un Chauffeur</h1><br>\r\n\t\t<div class=\"col-md-3\"></div>\r\n\t\t\t<div class=\"col-md-6\" align=\"center\">\r\n\t\t<table class=\"table table-striped\">\r\n        <form name=\"inscription\" method=\"post\" action=\"mod_chauffeur.php\">\r\n\t\t<tr>\r\n\t\t\t<td>Nom :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"nom\" value=\"{$nom}\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Prénom :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"prenom\" value=\"{$prenom}\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Tel : </td>\r\n\t\t\t<td><input type=\"text\" name=\"tel\" value=\"{$tel}\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Mail :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"mail\" value=\"{$mail}\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>N°Permis :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"permis\" value=\"{$permis}\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Date d'expiration :\t</td>\r\n\t\t\t<td><input type=\"date\" name=\"date\" value=\"{$expiration}\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Date Fimo :\t</td>\r\n\t\t\t<td><input type=\"date\" name=\"fimo\" value=\"{$fimo}\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Date matière dangeureuse :\t</td>\r\n\t\t\t<td><input type=\"date\" name=\"matiere\" value=\"{$matiere}\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Date produits pétroliers :\t</td>\r\n\t\t\t<td><input type=\"date\" name=\"ppetrolier\" value=\"{$ppetrolier}\"></td>\r\n\t\t</tr>\r\n\t\t<input type=\"hidden\" name=\"id_chauffeur\" value=\"{$id_chauffeur}\">\t\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"center\"><input class=\"btn btn-success\" type=\"submit\" name=\"valider\" value=\"Valider\"/></td>\r\n\t\t</tr>\r\n        </form>\r\n\t\t</table>";
    }
    // on ferme la connexion
    mysql_close();
}
// on ferme la page
$ppage = piedpage_formulaire("chauffeurs");
echo $ppage;
include "../footer.php";
Exemplo n.º 6
0
    mysql_query($sql) or die('Erreur SQL !' . $sql . '<br />' . mysql_error());
    // on ferme la connexion
    mysql_close();
    // on valide la modification
    $msg = aff_modifier("Le Produit");
    echo $msg;
} else {
    //On se connecte
    connectBase();
    // On recupere ID
    $id_produit = $_POST['id_produit'];
    // On recupere la ligne
    $select = 'SELECT id_produit,detail,description,prix_revient,prix_vente FROM produits WHERE id_produit = ' . "{$id_produit}" . ' ';
    $result = mysql_query($select) or die('Erreur : ' . mysql_error());
    $total = mysql_num_rows($result);
    // On affiche le formulaire pre-rempli
    while ($row = mysql_fetch_array($result)) {
        $id_produit = $row['id_produit'];
        $detail = $row['detail'];
        $descr = $row['description'];
        $p_revient = $row['prix_revient'];
        $p_vente = $row['prix_vente'];
        echo "\r\n        <h1 align=\"center\">Modification d'un Produit</h1><br>\r\n\t\t<div class=\"col-md-3\"></div>\r\n\t\t\t<div class=\"col-md-6\" align=\"center\">\r\n\t\t<table class=\"table table-striped\">\r\n\t\t\t<form name=\"inscription\" method=\"post\" action=\"mod_produit.php\">\r\n\t\t<tr>\r\n\t\t\t<td>D&eacutetail :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"detail\" value=\"{$detail}\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Description :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"descr\" value=\"{$descr}\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Prix de Revient : </td>\r\n\t\t\t<td><input type=\"text\" name=\"p_revient\" value=\"{$p_revient}\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td>Prix de Vente :\t</td>\r\n\t\t\t<td><input type=\"text\" name=\"p_vente\" value=\"{$p_vente}\"/></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"center\"><input class=\"btn btn-success\" type=\"submit\" name=\"valider\" value=\"Valider\"/></td>\r\n\t\t</tr>\r\n\t\t<input type=\"hidden\" name=\"id_produit\" value=\"{$id_produit}\">\r\n\t\t\t</form>\r\n\t\t</table>";
    }
    // on ferme la connexion
    mysql_close();
}
// on ferme la page
$ppage = piedpage_formulaire("produits");
echo $ppage;
include "../footer.php";