1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
| <?php require_once('conexion.php'); ?>
<?php
/*
-----------------------------------
------ SCRIPT DE PROTECTION -------
-----------------------------------
*/
session_start(); // On relaye la session
if (session_is_registered("authentification") && $_SESSION['privilege'] == "admin"){ // vérification sur la session authentification (la session est elle enregistrée ?)
// ici les éventuelles actions en cas de réussite de la connexion
}
else {
header("Location:connexion2.php?erreur=intru"); // redirection en cas d'echec
}
?>
<?php
if($_POST['action'] == 'submitted')
{
$champs1 = $_POST['structure_responsable'];
$champs2 = $_POST['validé_par'];
$id= $_SESSION['id_user'];
if (($champs1 !== "") && ($champs2==! "" ))
{
mysql_select_db($database_dbprotect, $dbprotect);
$add_user1 = sprintf("INSERT INTO structure_responsable(id_str,valeur,id_user) values ('','$champs1','$id')");
$add_user2 = sprintf("INSERT INTO validé_par (id_valide, valeur,id_user) values ('','$champs2','$id')");
mysql_select_db($database_dbprotect, $dbprotect);
$result1= mysql_query($add_user1, $dbprotect) or die(mysql_error());
$result2= mysql_query($add_user2, $dbprotect) or die(mysql_error());
}
else
{
if ($champs2 == "")
{
mysql_select_db($database_dbprotect, $dbprotect);
$add_user1 = sprintf("INSERT INTO structure_responsable(id_str,valeur,id_user) values ('','$champs1','$id')");
mysql_select_db($database_dbprotect, $dbprotect);
$result1= mysql_query($add_user1, $dbprotect) or die(mysql_error());
}
else
{
if ($champs1 == "")
{
mysql_select_db($database_dbprotect, $dbprotect);
$add_user2 = sprintf("INSERT INTO validé_par (id_valide,valeur,id_user) values ('','$champs2','$id')");
mysql_select_db($database_dbprotect, $dbprotect);
$result2= mysql_query($add_user2, $dbprotect) or die(mysql_error());
}
}
}
header("Location:modif.php?add=ok"); // redirection si création réussie
}
?>
<html>
<head>
<title>Espace modification</title>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<br> <br> <br>
<table width="600" height="280" border="1" align="center" BGCOLOR=" #F0F8FF" >
<tr>
<th width="639" align="Center" >
<div id="moi" align="center">
<h2><MARQUEE behavior="scroll" align="center" direction="left" height="120" scrollamount="2" scrolldelay="1" onmouseover='this.stop()' onmouseout='this.start()'>
Mise en oeuvre d'un projet Foad</MARQUEE></h2>
</div>
</th>
</tr>
<tr >
<td align ="center" >
<h3>* Tableau de bord de conduite de projet * </h3>
<fieldset align="center">
<form name="page_form" action="" method="post">
<table width="530" cellpadding="4" cellspacing="1" border="0" align = "center" frame= "hsides">
<tr>
<td>Modification du champ <em>"Structure-Responsable" </em>:</td>
<td><input type="text" name="structure_responsable" size="15" value=""></td>
</tr>
<tr>
<td >Modification du champ <em>"validé par" </em>:</td>
<td><input type="text" name="validé_par" size="15" value=""> </td>
</tr>
<tr></tr><tr></tr><tr></tr><tr></tr>
<tr></tr>
<tr align ="center"><br><br>
<td colspan=2><input type="hidden" name="action" value="submitted">
<input name="submit" value="Enregistrer" type="submit"></td>
<tr align ="center"> <td colspan=2><input type="button" value=" Valider" onClick="document.location='accueil2.php'"> </td>
</tr>
<br>
</table>
<br>
</form>
<br>
</fieldset>
<br>
</table></body>
</html> |
Partager