115 lines
3.4 KiB
PHP
115 lines
3.4 KiB
PHP
<?php
|
|
include_once(realpath(dirname(__FILE__)) . "/../../../fonctions/authplugins.php");
|
|
autorisation("magasin");
|
|
?>
|
|
<?php
|
|
include_once(realpath(dirname(__FILE__)) . "/Magasin.class.php");
|
|
|
|
$magasin = new Magasin();
|
|
if($action == "supprimer"){
|
|
$magasin = new Magasin();
|
|
$magasin->charger($_GET['id']);
|
|
$magasin->delete();
|
|
}
|
|
?>
|
|
<?php
|
|
if($_REQUEST['action'] == "" || $_REQUEST['action'] == "supprimer"){
|
|
?>
|
|
<script type="text/javascript">
|
|
function confirmSupp(id){
|
|
if(confirm("Confirmez-vous cette action de suppression ?"))
|
|
location = "module.php?nom=magasin&action=supprimer&id=" + id;
|
|
}
|
|
</script>
|
|
|
|
<div id="contenu_int">
|
|
<p class="titre_rubrique">Magasins</p>
|
|
<p align="right" class="geneva11Reg_3B4B5B"><a href="accueil.php" class="lien04">Accueil </a> <img src="gfx/suivant.gif" width="12" height="9" border="0" /><a href="1" class="lien04">Gestion des magasins</a></p>
|
|
<table width="710" border="0" cellpadding="5" cellspacing="0">
|
|
|
|
<tr>
|
|
<td width="600" height="30" class="titre_cellule_tres_sombre">MAGASINS</td>
|
|
<td class="titre_cellule_tres_sombre">
|
|
<?php
|
|
$query = "select distinct(cp) from $magasin->table order by cp";
|
|
$resul = mysql_query($query, $magasin->link);
|
|
?>
|
|
<select name="cp" onChange="location='module.php?nom=magasin&cp=' + this.value;">
|
|
<?php
|
|
while($row = mysql_fetch_object($resul)){
|
|
?>
|
|
<option value="<?php echo $row->cp; ?>" <?php if($_REQUEST['cp'] == $row->cp) echo "selected=\"selected\"";?>><?php echo $row->cp; ?></option>
|
|
<?php
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table width="710" border="0" cellpadding="0" cellspacing="0" >
|
|
<tr>
|
|
<td height="30" class="titre_cellule">NOM</td>
|
|
|
|
<td height="30" class="titre_cellule">CODE POSTAL</td>
|
|
<td height="30" class="titre_cellule">VILLE</td>
|
|
<td height="30" class="titre_cellule"> </td>
|
|
<td height="30" class="titre_cellule"> </td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
$i = 0;
|
|
|
|
if($_REQUEST['cp'] != ""){
|
|
|
|
$query = "select * from $magasin->table where cp=\"" . $_REQUEST['cp'] . "\"";
|
|
$resul = mysql_query($query, $magasin->link);
|
|
|
|
|
|
while($row = mysql_fetch_object($resul)){
|
|
if(!($i%2)) $fond="cellule_sombre";
|
|
else $fond="cellule_claire";
|
|
$i++;
|
|
?>
|
|
|
|
<tr class="<?php echo $fond; ?>">
|
|
|
|
<td height="30"><?php echo $row->nom; ?></td>
|
|
<td height="30"><?php echo $row->cp; ?></td>
|
|
<td height="30"><?php echo $row->ville; ?></td>
|
|
<td height="30"><a href="module.php?nom=magasin&action=visualiser&id=<?php echo $row->id; ?>" class="txt_vert_11">Poursuivre</a> <img src="gfx/suivant.gif" width="12" height="9" border="0" /></td>
|
|
<td height="30"><a href="#" onClick="confirmSupp('<?php echo $row->id; ?>')"><img src="gfx/supprimer.gif" width="9" height="9" border="0" /></a></td>
|
|
</tr>
|
|
|
|
<?php
|
|
}
|
|
|
|
}
|
|
?>
|
|
|
|
</table>
|
|
|
|
<br />
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
<tr class="cellule_claire">
|
|
<td width="21%" height="30">Créer un magasin</td>
|
|
<td width="63%" height="30"></td>
|
|
<td width="16%" height="30">
|
|
<div align="left"><a href="module.php?nom=magasin&action=visualiser" class="txt_vert_11">Poursuivre </a><img src="gfx/suivant.gif" width="12" height="9" border="0" /></div>
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
else if($action == "visualiser")
|
|
include_once("../client/plugins/magasin/visualiser.php");
|
|
|
|
|
|
?>
|