bebeboutik/adm/scaddressedit.php

146 lines
4.8 KiB
PHP
Raw Normal View History

2016-01-04 12:48:08 +01:00
<?php
require_once(dirname(__FILE__).'/../config/config.inc.php');
require_once(dirname(__FILE__).'/init.php');
if($cookie->isLoggedBack() && $cart = Tools::getValue('id_cart')) {
$address = Db::getInstance()->ExecuteS('SELECT * FROM ps_socolissimo_delivery_info WHERE id_cart = '.pSQL(intval(Tools::getValue('id_cart'))));
if(count($address) > 0) {
$address = $address[0];
if(isset($_POST['submitSC'])) {
Db::getInstance()->Execute('UPDATE ps_socolissimo_delivery_info SET
delivery_mode = "'.pSQL(Tools::getValue('delivery_mode', '')).'",
prname = "'.pSQL(Tools::getValue('prname', '')).'",
prfirstname = "'.pSQL(Tools::getValue('prfirstname', '')).'",
cecompanyname = "'.pSQL(Tools::getValue('cecompanyname', '')).'",
prcompladress = "'.pSQL(Tools::getValue('prcompladress', '')).'",
pradress1 = "'.pSQL(Tools::getValue('pradress1', '')).'",
pradress2 = "'.pSQL(Tools::getValue('pradress2', '')).'",
pradress3 = "'.pSQL(Tools::getValue('pradress3', '')).'",
pradress4 = "'.pSQL(Tools::getValue('pradress4', '')).'",
przipcode = "'.pSQL(Tools::getValue('przipcode', '')).'",
prtown = "'.pSQL(Tools::getValue('prtown', '')).'",
cephonenumber = "'.pSQL(Tools::getValue('cephonenumber', '')).'",
ceemail = "'.pSQL(Tools::getValue('ceemail', '')).'",
cedeliveryinformation = "'.pSQL(Tools::getValue('cedeliveryinformation', '')).'",
cedoorcode1 = "'.pSQL(Tools::getValue('cedoorcode1', '')).'",
cedoorcode2 = "'.pSQL(Tools::getValue('cedoorcode2', '')).'",
prid = "'.pSQL(Tools::getValue('prid', '')).'"
WHERE id_cart = '.pSQL(intval(Tools::getValue('id_cart'))));
}
?>
<html><head>
<style type="text/css">
body {
overflow: auto;
font-size: 12px;
color: #222222;
font-family: sans-serif;
}
label {
font-weight: bold;
display: block;
}
fieldset {
overflow: auto;
float: left;
width: 200px;
}
p {
overflow: auto;
}
</style>
</head><body onunload="window.opener.location.reload(true);" onload="<?php if(isset($_POST['submitSC'])) { ?>window.close();<?php } ?>">
2016-01-04 12:48:08 +01:00
<form action="" method="post">
<fieldset>
<p>
<label>Mode de livraison</label>
<select name="delivery_mode" style="width: 177px;">
<?php
$modes = array('DOM' => 'Livraison à domicile (DOM)', 'BPR' => 'Livraison en Bureau de Poste (BPR)',
'A2P' => 'Livraison Commerce de proximité (A2P)', 'MRL' => 'Livraison Commerce de proximité (MRL)', 'CMT' => 'Livraison Commerce (CMT)',
'CIT' => 'Livraison en Cityssimo (CIT)', 'ACP' => 'Agence ColiPoste (ACP)', 'CDI' => 'Centre de distribution (CDI)', 'BDP' => 'Bureau de poste Belge (BDP)',
'RDV' => 'Livraison sur Rendez-vous (RDV)');
foreach($modes as $k => $v) {
echo '<option value="'.$k.'"'.($address['delivery_mode'] == $k? ' selected="selected"': '').'>'.$v.'</option>';
}
?>
</select>
</p>
<p>
<label>Nom</label>
<input type="text" name="prname" value="<?php echo $address['prname']; ?>" />
</p>
<p>
<label>Prénom</label>
<input type="text" name="prfirstname" value="<?php echo $address['prfirstname']; ?>" />
</p>
<p>
<label>Téléphone</label>
<input type="text" name="cephonenumber" value="<?php echo $address['cephonenumber']; ?>" />
</p>
<p>
<label>Email</label>
<input type="text" name="ceemail" value="<?php echo $address['ceemail']; ?>" />
</p>
<p>
<label>Entreprise</label>
<input type="text" name="cecompanyname" value="<?php echo $address['cecompanyname']; ?>" />
</p>
</fieldset>
<fieldset>
<p>
<label>Adresse 1</label>
<input type="text" name="pradress1" value="<?php echo $address['pradress1']; ?>" />
</p>
<p>
<label>Adresse 2</label>
<input type="text" name="pradress2" value="<?php echo $address['pradress2']; ?>" />
</p>
<p>
<label>Adresse 3</label>
<input type="text" name="pradress3" value="<?php echo $address['pradress3']; ?>" />
</p>
<p>
<label>Adresse 4</label>
<input type="text" name="pradress4" value="<?php echo $address['pradress4']; ?>" />
</p>
<p>
<label>Code postal</label>
<input type="text" name="przipcode" value="<?php echo $address['przipcode']; ?>" />
</p>
<p>
<label>Ville</label>
<input type="text" name="prtown" value="<?php echo $address['prtown']; ?>" />
</p>
</fieldset>
<fieldset>
<p>
<label>Complément d'adresse</label>
<input type="text" name="prcompladress" value="<?php echo $address['prcompladress']; ?>" />
</p>
<p>
<label>Informations sur la livraison</label>
<textarea><?php echo $address['cedeliveryinformation']; ?></textarea>
</p>
<p>
<label>Code porte 1</label>
<input type="text" name="cedoorcode1" value="<?php echo $address['cedoorcode1']; ?>" />
</p>
<p>
<label>Code porte 2</label>
<input type="text" name="cedoorcode2" value="<?php echo $address['cedoorcode2']; ?>" />
</p>
<p>
<label>ID point retrait</label>
<input type="text" name="prid" value="<?php echo $address['prid']; ?>" />
</p>
<p><input type="submit" value="Envoyer" name="submitSC" /></p>
</fieldset>
</form>
</body></html>
<?php
}
}
?>