<?php //require('includes/application_top.php') ;
/*
$Id: customer_call_back.php, v 0.1 23/07/2008 Delete Exp $
This script is not included in the original version of osCommerce
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Credits to : scriptaculo.us, http://www.cssplay.co.uk (Stu Nicholls)
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
// Obtenir une liste de date de disponibilit� du centre d'appel en fonction des dates et heures
//
function getNextDays()
{
$now = time() ;
$one_day = 3600 * 24 ;
$date_format = "%A %d %B %Y" ;
$timestamp = $now ;
// Heure Limite � partir de laquelle on repousse le rappel � demain
//
if( strftime("%H", $timestamp) > CUSTOMER_CALL_BACK_REQUEST_HOUR_LIMIT ) $now += $one_day ;
for($i=0, $out_date = array(), $days = 7 ; $i < $days ; $i++)
{
$timestamp = $now + $one_day * $i;
// Exclusion des jours ferm�s
//
if ( strstr(CUSTOMER_CALL_BACK_ALLOWED_DAYS, strftime("%u", $timestamp)) ) $days++ ;
else
{
$out_date[$timestamp] = strftime($date_format, $timestamp) ;
$out_date[$timestamp] = ucwords($out_date[$timestamp]);
}
}
return($out_date) ;
}
?>
<div id="customer_call_back_window">
<div id="xsnazzy">
<b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>
<div class="xboxcontent">
<INPUT type="hidden" id="warn_name" value="<?php echo CUSTOMER_CALL_BACK_WARN_NAME ?>" />
<INPUT type="hidden" id="warn_lastname" value="<?php echo CUSTOMER_CALL_BACK_WARN_LASTNAME ?>" />
<INPUT type="hidden" id="warn_phone" value="<?php echo CUSTOMER_CALL_BACK_WARN_PHONE ?>" />
<form action="javascript:get(document.getElementById('myform'));" name="myform" id="myform">
<!-- Formulaire de contact -->
<table width="100%" border="0">
<tr><td><H1><?php echo CUSTOMER_CALL_BACK_HEADING_TITLE ; ?></H1></td><td><a href="javascript:void(0);" = 'hidden';"><?php echo CUSTOMER_CALL_BACK_CLOSE ; ?></a></td></tr></table>
<hr />
<p>
<?php echo CUSTOMER_CALL_BACK_HEADING_TEXT ; ?>
</p>
<hr />
<table border="0" class="xboxform" width="100%">
<tr>
<td><?php echo CUSTOMER_CALL_BACK_TEXT_FORM_GENDER ; ?></td>
<td><SELECT id="gender">
<OPTION VALUE="1"><?php echo CUSTOMER_CALL_BACK_TEXT_FORM_GENDER_MALE ; ?></OPTION>
<OPTION VALUE="2"><?php echo CUSTOMER_CALL_BACK_TEXT_FORM_GENDER_FEMALE ; ?></OPTION>
</SELECT>
</td>
</tr>
<tr>
<td><?php echo CUSTOMER_CALL_BACK_TEXT_FORM_NAME ; ?></td>
<td><INPUT type=text id="name" size="30" /></td>
</tr>
<tr>
<td><?php echo CUSTOMER_CALL_BACK_TEXT_FORM_LASTNAME; ?></td>
<td><INPUT type=text id="lastname" size="30" /></td>
</tr>
<tr>
<td><?php echo CUSTOMER_CALL_BACK_TEXT_FORM_PHONE ; ?></td>
<td><INPUT type=text id="phone" size="15" /> <a class="main"><?php echo CUSTOMER_CALL_BACK_TEXT_FORM_PHONE_INFO ; ?></a></td>
</tr>
<tr>
<td colspan=2><br /><?php echo CUSTOMER_CALL_BACK_TEXT_FORM_MESSAGE ; ?></td>
<tr>
<td colspan="2"> <textarea rows="3" id="message"></textarea></td>
</tr>
<tr>
<td colspan=2> <?php echo CUSTOMER_CALL_BACK_TEXT_FORM_WISHED_DATE ; ?> </td></tr>
<tr><td colspan=2 align="center">
<SELECT id="date">
<?php
foreach(getNextDays() as $timestamp => $day)
{
printf('<OPTION VALUE="%s">%s</OPTION>', $timestamp, $day) ;
}
?>
</SELECT>
<SELECT id="hour">
<?php
$hours_ranges = explode(";", CUSTOMER_CALL_BACK_TEXT_WHISHED_HOUR) ;
foreach($hours_ranges as $id => $hour_range)
{
preg_match("/#([A-Za-z0-9=\"\.\- \t]*)#(.*)/", $hour_range, $select_options);
if ( strlen($select_options[2]) ) $hour_range = $select_options[2] ;
printf('<OPTION VALUE="%s" %s>%s</OPTION>', $id, $select_options[1], $hour_range) ;
}
?>
</SELECT>
</td></tr>
<tr>
<td align="left"><input type="button" name="button" value="<?php echo CUSTOMER_CALL_BACK_CLOSE ; ?>" = 'hidden';"></td>
<td align="right">
<input type="button" name="button" value="<?php echo CUSTOMER_CALL_BACK_SUBMIT ; ?>" />
</td>
</tr>
</form>
</table>
<!-- R�ponse AJAX de customer_call_back_process.php -->
<span id="response"></span>
<!-- R�ponse AJAX de customer_call_back_process.php [EOF]-->
</div>
<b class="xbottom"><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1"></b></b>
</div>
<!-- Formulaire de contact / EOF -->
</div>
<script type="text/javascript">
var customer_call_back_window = document.getElementById('customer_call_back_window');
if(customer_call_back_window)
{
new Draggable('customer_call_back_window');
}
</script>
<!-- </body> -->
<!-- <?php // if ( $hidethis) echo '<script>setTimeout(\'hide()\',5000)</script>' ; ?> !-->