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
|
<?php
require('includes/application_top.php');
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top">
<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table>
</td>
<!-- body_text //-->
<td width="100%" valign="top">
<table>
<tr>
<td class="pageHeading">Supprimer une vignette de votre liste</td>
</tr>
<tr/>
<tr/>
<?php
if ($HTTP_POST_VARS['supprimer'] == "Supprimer") {
$rep = DIR_FS_CATALOG_VIGNETTE;
$id = $HTTP_POST_VARS['fichier'];
$query = "SELECT path FROM ". TABLE_VIGNETTE ." WHERE id = '". $id ."'";
$result = tep_db_query($query);
while($data = mysql_fetch_assoc($result)){
$fich = $data['path'];
}
$path = $rep.$fich;
$query = "DELETE FROM ". TABLE_VIGNETTE ." WHERE id = ". $id ;
tep_db_query($query);
if(unlink($path)){
echo "<tr>
<td class='dataTableContent'>
<p>Votre vignette a bien été supprimé</p>
</td>
</tr>";
}
}
else{
?>
<tr>
<td class="dataTableContent">
<p>Pour supprimer une vignette de votre liste, choissisez là dans la liste ci-dessous et cliquez sur le bouton supprimer.</p>
</td>
</tr>
<tr/>
<tr>
<td class="dataTableContent">
<table>
<?php
$rep = DIR_FS_CATALOG_VIGNETTE;
echo tep_draw_form('vign_del',FILENAME_DEL_VIGN,'','post');
$query = "SELECT id,path,alt FROM ". TABLE_VIGNETTE;
$result = tep_db_query($query);
echo "<tr><td></table>";
$donnees = false;
//debut ajout
$cpt=0;
while($data=mysql_fetch_array($result)) {
$donnees = true;
// la il est egal a 0 ca veut dire qu c'est ta premier image ou ta 8eme image equivalenty a (0/= 0+ 0, 8/8 = 1+ 0 , 16/8= 2+0
$output = (!($cpt%8))?"<tr><td>":"<td>";
echo $output;
echo "<tr><td>";
//affichage de l'image
echo "<img src = '".HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES.DIR_WS_VIGNETTE.$data['path']."' alt = '".$data['alt']."'>";
echo "</td></tr><tr><td align = 'center'>";
//affichage du bouton d'option:
echo tep_draw_input_field('fichier',$data['id'],'','','radio');
echo " </td></tr>";
// la il est egal a 7 ca veut dire qu c'est ta premier image ou ta 7eme image equivalenty a (7/= 0*8+ 7, 15/8 = (8*1)+ 7 , 23/8= 2*8+7
$output = (($cpt%8)==7)?"</td></tr><tr>":"</td>";
echo $output;
$cpt++;
}
echo "</table></td></tr>";
/*while($data = mysql_fetch_assoc($result)){
$donnees = true;
echo "<tr><td>";
echo "<img src = '".HTTP_SERVER.DIR_WS_CATALOG.DIR_WS_IMAGES.DIR_WS_VIGNETTE.$data['path']."' alt = '".$data['alt']."'>";
echo "</td><td>";
echo tep_draw_input_field('fichier',$data['id'],'','','radio');
echo "</td></tr>";
}*/
if($donnees === true){
echo "<tr><td>";
echo tep_draw_input_field('supprimer','Supprimer','','','submit');
echo "</td></tr>";
}
else
echo "<tr>
<td class='dataTableContent'>
<p><em>Note : </em>vous n'avez pas de vignettes dans votre liste.</p>
</td>
</tr>";
?>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- footer //-->
<?php
}
require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> |