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 149 150 151 152 153 154 155 156
|
<html>
<head>
<?require("connexion.php");?>
<?$rs_id=$_GET["rs_id"];?>
<?
$g1=mysql_query("select * from resource_entity where rs_id=$rs_id");
$rs_name=mysql_result($g1,0,'rs_name');
$rs_category=mysql_result($g1,0,'rs_category');
$rs_type=mysql_result($g1,0,'rs_type');
$rs_description=mysql_result($g1,0,'rs_description');
$rs_pic=mysql_result($g1,0,'rs_pic');
?>
<?
if(isset($_POST["moda"])){
$a=$_POST["rs_na"];
$b=$_POST["rs_catego"];
$c=$_POST["rs_ty"];
$d=$_POST["rs_descripti"];
$p=$_POST["rs_pic"];
if($_POST["moda"]=="mod"){
mysql_query("UPDATE resource_entity SET rs_name='$a',rs_category='$b',rs_type='$c',rs_description='$d' WHERE rs_id='$rs_id'");
$rs_name=$a;
$rs_category=$b;
$rs_type=$c;
$rs_description=$d;
}
if($_POST["moda"]=="del"){
mysql_query("delete from resource_entity where rs_id=$rs_id");
}
print("<script>document.location.href=\"index.php?m=msc&a=rs\";</script>");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Description" content="dotProject Default Style" />
<meta name="Version" content="1.0" />
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<title>Updating <?echo $rs_name;?> </title>
<link rel="stylesheet" type="text/css" href="./style/default/main.css" media="all" />
<style type="text/css" media="all">@import "./style/default/main.css";</style>
<script language="javascript">
function modif(){
var r=document.rs_update;
r.moda.value="mod";
r.method="POST";
r.action="index.php?m=msc&a=modify_rs&rs_id=<?echo $rs_id?>";
r.submit();
}
function del()
{
if(confirm("Are you sure you want to delete it?")==true)
{
var r=document.rs_update;
r.moda.value="del";
r.method="POST";
r.action="index.php?m=msc&a=modify_rs&rs_id=<?echo $rs_id?>";
r.submit();
}
}
</script>
</head>
<body>
//tableau affichant les valeurs modifiable
<p><a href="index.php?m=msc&a=rs">Back to Network elements</a></p>
<form name='rs_update'>
<input type=hidden name="moda">
<table width="50%" border="0" class=std align="center">
<tr>
<th height="20" colspan="3" align="center">Updating <?echo $rs_name;?></th>
</tr>
<tr>
<td width="40%" height="31">
<div align="right"><b>Name </b></div>
</td>
<td width="60%" height="31" class=hilite align=left>
<input type=text class=text name='rs_na' value="<?echo $rs_name;?>">
</td>
</tr>
<tr>
<td width="40%" height="31">
<div align="right"><b>Category </b></div>
</td>
<td width="60%" height="31" class=hilite align=left>
<input type=text name='rs_catego' value="<?echo $rs_category;?>" class=text>
</td>
</tr>
<tr>
<td width="40%" height="31">
<div align="right"><b>Type </b></div>
</td>
<td width="60%" height="31" class=hilite align=left>
<input type=text name='rs_ty' value="<? echo $rs_type;?>" class=text>
</td>
</tr>
<tr>
<td width="40%" height="33">
<div align="right"><b>Description </b></div>
</td>
<td width="60%" height="33" class=hilite>
<textarea cols=50 rows=4 name='rs_descripti' ><?echo $rs_description;?></textarea>
</td>
</tr>
</table>
<br />
<table width="50%" border="0" class=std align="center">
<td width="40%" height="31">
<div align="right"><b>Picture</b><br>Please only use file <br> that no exceed 4 ko</div>
</td>
<td>
<form enctype="multipart/form-data" method="post" action="" >
<font >
<input type="hidden" name="MAX_FILE_SIZE" value="4096" > <!-- 2^12 -->
<input type="file" name="image" id="image" >
<input type="submit" value="Send" >
</font>
</td>
<td>
<!-- affichage de l'image -->
<label><b>Visulisation</b></label>
<img src="adresse du répertoire"/<?echo $rs_pic;?>" />
</td>
</table>
<p>
<div align="center">
<input type="button" class="button" style="width:100px;height:25px;" onclick="modif()" value="Update">
<input type="button" class="button" style="width:100px;height:25px;" onclick="del()" value="Delete">
</div>
</p>
</form>
</body>
</html> |