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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
| <?php include "verif.php"?>
<?php require_once('../Connections/fsgt_comite93.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE personnel SET prenom=%s, nom=%s, statut=%s, fonctions=%s, activites=%s, img=%s WHERE id_staf=%s",
GetSQLValueString($_POST['prenom'], "text"),
GetSQLValueString($_POST['nom'], "text"),
GetSQLValueString($_POST['statut'], "text"),
GetSQLValueString($_POST['fonctions'], "text"),
GetSQLValueString($_POST['activites'], "text"),
GetSQLValueString($_POST['img'], "text"),
GetSQLValueString($_POST['id_staf'], "int"));
mysql_select_db($database_fsgt_comite93, $fsgt_comite93);
$Result1 = mysql_query($updateSQL, $fsgt_comite93) or die(mysql_error());
$updateGoTo = "personnel_admin.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
$colname_personnel = "-1";
if (isset($_GET['modif'])) {
$colname_personnel = $_GET['modif'];
}
mysql_select_db($database_fsgt_comite93, $fsgt_comite93);
$query_personnel = sprintf("SELECT * FROM personnel WHERE id_staf = %s", GetSQLValueString($colname_personnel, "int"));
$personnel = mysql_query($query_personnel, $fsgt_comite93) or die(mysql_error());
$row_personnel = mysql_fetch_assoc($personnel);
$totalRows_personnel = mysql_num_rows($personnel);
?>
<?php
include "../includes/bandeau.php";
include "../includes/menu_haut.php";
?>
<link href="../css/TextesCSS.css" rel="stylesheet" type="text/css" />
<div id="Layer2">
<table width="890" border="0">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="2" class="enTete">Modification de la fiche d'un salarié</td>
<td class="enTete"><a href="deconnexion.php">Deconnexion</a></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="157"><a href="index.php">Retour Accueil</a></td>
<td width="608"><a href="insertion_personnel.php">Ajouter un salarié</a></td>
<td width="111"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3">
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Id_staf:</td>
<td><?php echo $row_personnel['id_staf']; ?></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Prenom:</td>
<td><input name="prenom" type="text" class="Textes" value="<?php echo htmlentities($row_personnel['prenom'], ENT_COMPAT, 'utf-8'); ?>" size="35" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Nom:</td>
<td><input name="nom" type="text" class="Textes" value="<?php echo htmlentities($row_personnel['nom'], ENT_COMPAT, 'utf-8'); ?>" size="35" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Statut:</td>
<td><input name="statut" type="text" class="Textes" value="<?php echo htmlentities($row_personnel['statut'], ENT_COMPAT, 'utf-8'); ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Fonctions:</td>
<td><textarea name="fonctions" cols="32" rows="5" class="Textes"><?php echo htmlentities($row_personnel['fonctions'], ENT_COMPAT, 'utf-8'); ?></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Activites:</td>
<td><textarea name="activites" cols="32" rows="5" class="Textes"><?php echo htmlentities($row_personnel['activites'], ENT_COMPAT, 'utf-8'); ?></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Img:</td>
<td><input name="img" type="text" class="Textes" value="<?php echo htmlentities($row_personnel['img'], ENT_COMPAT, 'utf-8'); ?>" size="35" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Mettre à jour " /></td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1" />
<input type="hidden" name="id_staf" value="<?php echo $row_personnel['id_staf']; ?>" />
</form>
<p> </p> </td>
</tr>
</table>
</div>
</div>
<?php include "../includes/footer.php";?>
<?php
mysql_free_result($personnel);
?> |
Partager