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
| <? require("../utils/connect.php");
//recupération des données du formulaire
@$day=$_POST['day'];
@$month=$_POST['month'];
@$year=$_POST['year'];
@$date=$year."-".$month."-".$day;
@$id=$_POST['id'];
$idmanif=$_GET['id'];
@$step=$_POST['step'];
if($step=="ok"){
$sql = "UPDATE `manifestation` SET DATEMANIF='{$date}', TITREMANIF='{$_POST['description']}',DESCRIPTIONMANIF='{$_POST['text']}' WHERE `idManifestation` = '".$id."'" ;
$res=mysql_query($sql,$connect);
if (mysql_affected_rows($connect)!=0){
print("<script language=\"javascript\" type=\"text/javascript\">window.location=\"./?message=Opération éffectuée\"</script>");
}
else{
print("<script language=\"javascript\" type=\"text/javascript\">window.location=\"./?message=Probleme de connexion MySql... Veuillez recommencer plus tard svp!!\"</script>");
}
}
if($step=="del"){
$sql="delete from manifestation where IDMANIFESTATION='{$_POST['id']}'";
$res=mysql_query($sql,$connect);
if (mysql_affected_rows($connect)!=0){
print("<script language=\"javascript\" type=\"text/javascript\">window.location=\"./?message=Opération éffectuée\"</script>");
}
else{
print("<script language=\"javascript\" type=\"text/javascript\">window.location=\"./?message=Probleme de connexion MySql... Veuillez recommencer plus tard\"</script>");
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Modification ou suppression d'une manifestation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../utils/style.css" rel="stylesheet" type="text/css">
<?
$sql="SELECT * from manifestation where IDMANIFESTATION='{$idmanif}'";
$res=mysql_query($sql,$connect);
while($val=mysql_fetch_array($res,MYSQL_ASSOC)){
$date=$val['DATEMANIF'];
$text=$val['TITREMANIF'];
$description=$val['DESCRIPTIONMANIF'];
}
?>
</head>
<body>
<h1>Modification ou suppression d'une manifestation</h1>
<table summary="" border="0">
<tr>
<td>
</td>
<td>
<form name="modifmanif" action="<? $_SERVER['PHP_SELF']?>" method="post">
<table summary="" border="0" width="75%">
<tr>
<td bgcolor="#FFFF99">Titre</td>
<td><input type="text" name="description" size="40" maxlength="256" value="<? print $text;?>"></td>
</tr>
<tr>
<td bgcolor="#FFFF99">Description détaillée de la manifestation </td>
<td><textarea name="text" cols="30" rows="5" ><? print $description;?></textarea>
</td>
</tr>
<tr>
<td bgcolor="#FFFF99">Date :</td>
<input type="hidden" name="step" value="ok" />
<input type="hidden" name="id" value="<? print $id ;?>">
<td>
<select name="day">
<script type="text/javascript">
<!--
for(var i =1; i <= 31; i++)
document.write("<option>"+i+"</option>");
// -->
</script>
</select>
<select name="month">
<option value="1">Janvier</option>
<option value="2">Février</option>
<option value="3">Mars</option>
<option value="4">Avril</option>
<option value="5">Mai</option>
<option value="6">Juin</option>
<option value="7">Juillet</option>
<option value="8">Aout</option>
<option value="9">Septembre</option>
<option value="10">Octobre</option>
<option value="11">Novembre</option>
<option value="12">Décembre</option>
</select>
<select name="year">
<script type="text/javascript">
<!--
for(var i =0; i <= 2; i++){
var annee;
var mtnt;
annee=new Date();
mtnt=annee.getFullYear()+i;
document.write("<option>"+mtnt+"</option>");
// -->
}
</script>
</select>
</td>
</tr>
</table>
<p align="center"><img width="85" height="23" src="../img/boutons/envoyer.gif" onclick="document.modifmanif.submit()" style="cursor:hand" />
</p>
</form>
<form action="<?php $_SERVER['PHP_SELF']?>" method="post" name="del">
<input type="hidden" name="step" value="del" />
<input type="hidden" name="id" value="<?print $id;?>" />
<center><img src="../img/boutons/suprimmer.gif" onClick="document.del.submit()" width="102" height="23" style="cursor:hand" alt="Supprimer"/>
</center>
</form>
</td>
</tr>
</table>
</body>
</html> |
Partager