241 lines
3.1 KiB
PHP
241 lines
3.1 KiB
PHP
<?php
|
|
|
|
|
|
|
|
// é
|
|
|
|
|
|
|
|
require_once( __DIR__ . '/../../../fonctions/authplugins.php' );
|
|
|
|
|
|
|
|
autorisation( "cadeau" );
|
|
|
|
|
|
|
|
$cadeauEstOffert = false;
|
|
|
|
|
|
|
|
$titreCadeau = "";
|
|
|
|
$imageCadeau =
|
|
|
|
$etatEnvoiCadeau = "";
|
|
|
|
$etats = array();
|
|
|
|
|
|
|
|
$cadeau = new Cadeau();
|
|
|
|
$refCommande = lireParam( 'ref', 'string' );
|
|
|
|
|
|
|
|
if ( $cadeau->chargerAvecRefCommande( $refCommande ) ) {
|
|
|
|
|
|
|
|
$image = new Image();
|
|
|
|
$imageDesc = new Imagedesc();
|
|
|
|
|
|
|
|
$cadeauEstOffert = true;
|
|
|
|
|
|
|
|
if ( $imageDesc->charger( $cadeau->image, 1 ) ) {
|
|
|
|
|
|
|
|
$titreCadeau = $imageDesc->titre;
|
|
|
|
if ( $image->charger( $cadeau->image ) ) {
|
|
|
|
|
|
|
|
$imageCadeau = "../fonctions/redimlive.php?type=contenu&nomorig=" . $image->fichier . "&width=80&height=80";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$etatEnvoiCadeau = $cadeau->etat;
|
|
|
|
|
|
|
|
$etats = array(
|
|
|
|
'0' => $cadeau->traduireEtat( 0 ) ,
|
|
|
|
'1' => $cadeau->traduireEtat( 1 ) ,
|
|
|
|
'2' => $cadeau->traduireEtat( 2 ) ,
|
|
|
|
'3' => $cadeau->traduireEtat( 3 ) ,
|
|
|
|
);
|
|
|
|
|
|
|
|
// Traitement aciton : changer_etat_livraison_cadeau
|
|
|
|
$action = lireParam( 'action', 'string' );
|
|
|
|
if ( $action == "changer_etat_livraison_cadeau" ) {
|
|
|
|
|
|
|
|
$etatEnvoiCadeau = lireParam( 'etat_envoi_cadeau', 'int' );
|
|
|
|
if ( !empty( $etatEnvoiCadeau ) && $etatEnvoiCadeau >= 0 && $etatEnvoiCadeau <= 3 ) {
|
|
|
|
|
|
|
|
$cadeau->etat = intval( $etatEnvoiCadeau );
|
|
|
|
$cadeau->maj();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$etatEnvoiCadeau = $cadeau->etat;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<div class="bordure_bottom" style="margin:0 0 10px 0;">
|
|
|
|
<div class="entete_liste_client">
|
|
|
|
<div class="titre">CADEAU ASSOCIE A LA COMMANDE</div>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
if ( $cadeauEstOffert ) {
|
|
|
|
?>
|
|
|
|
<ul class="ligne_claire_BlocDescription" style="background-image: url(gfx/degrade_ligne1.png); background-repeat: repeat-x;">
|
|
|
|
<li class="designation" style="width:290px; background-image: url(gfx/degrade_ligne1.png); background-repeat: repeat-x;">Cadeau</li>
|
|
|
|
<li><?php echo $titreCadeau; ?></li>
|
|
|
|
</ul>
|
|
|
|
<ul class="ligne_fonce_BlocDescription">
|
|
|
|
<li class="designation" style="width:290px; height: 84px;">Image</li>
|
|
|
|
<li>
|
|
|
|
<img src="<?php echo $imageCadeau; ?>" alt="" />
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<ul class="ligne_fonce_BlocDescription">
|
|
|
|
<li class="designation" style="width:290px; height: 46px;">Etat</li>
|
|
|
|
<li>
|
|
|
|
<form action="commande_details.php?ref=<?php echo $refCommande; ?>" method="post">
|
|
|
|
|
|
|
|
<input type="hidden" name="ref" value="<?php echo $refCommande; ?>" />
|
|
|
|
<input type="hidden" name="action" value="changer_etat_livraison_cadeau" />
|
|
|
|
|
|
|
|
<select name="etat_envoi_cadeau">
|
|
|
|
<?php
|
|
|
|
|
|
|
|
foreach ( $etats as $cle => $etat ) {
|
|
|
|
|
|
|
|
$selection = "";
|
|
|
|
if ( $cle == $etatEnvoiCadeau ) {
|
|
|
|
|
|
|
|
$selection = " selected='selected' ";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "
|
|
|
|
<option value='" . $cle . "' " . $selection . ">" . $etat . "</a>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<br />
|
|
|
|
|
|
|
|
<input type="submit" value="Valider" />
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
?>
|
|
|
|
<ul class="ligne_fonce_BlocDescription">
|
|
|
|
<li class="designation" style="width:290px;">Pas de cadeau pour cette commande</li>
|
|
|
|
<li> </li>
|
|
|
|
</ul>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|