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
| <?
include("menu1.php");
include("configbase.php");
$pays=$_GET['pays'];
$id_soc = $_GET["id_soc"];
$ville = $_GET['ville'];
$soc_org = $_GET['soc_org'];
$ser_lab = $_GET['ser_lab'];
$cp = $_GET['cp'];
$tel = $_GET['tel'];
$fax = $_GET['fax'];
$id = $_GET['id'];
$id_cmd = $_GET['id_cmd'];
$type = $_GET['type'];
$id_cmd_pdt = $_GET["id_cmd_pdt"];
$req4 = "select *
from commande
where id_command = $id_cmd";
$res4 = mysql_query($req4);
$row4 = mysql_fetch_assoc($res4);
$langue = $row4["lang"];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/PR-html40/strict.dtd">
<html><HEAD><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<SCRIPT language="JavaScript">
<!--
function dispChoix(bouton)
{
var radios = document.getElementsByName('date');
var textes = document.getElementsByName('nombre');
if (bouton.length != undefined)
{
for(var i = 0; i < radios.length; i++)
{
textes[i].disabled = ! bouton[i].checked;
}
}else{
if (textes.length)
{
textes[0].disabled = false;
}
}
}
function choix()
{
checkbox = form1.date;
texte = form1.nombre;
tab = new Array(checkbox.length);
numero = new Array(texte.length);
for (var i=0; i<checkbox.length;i++)
{
if (checkbox[i].checked)
{
tab[i] = checkbox[i].value;
}
if(texte[i].disabled == false) numero[i] = texte[i].value;
}
e = tab.join(",");
t = numero.join(",");
lien= "passer_commande5.php?nombre="+t+"&date="+e+"&id_soc=<? echo $id_soc?>&pays=<? echo $pays?>&soc_org=<? echo $soc_org?>&ser_lab=<? echo $ser_lab?>&ville=<? echo $ville?>&cp=<? echo $cp?>&tel=<? echo $tel?>&fax=<? echo $fax?>&id=<? echo $id?>&id_cmd=<? echo $id_cmd?>&type=<? echo $type?>&id_cmd_pdt=<? echo $id_cmd_pdt?>";
//window.location.href=lien;
alert(lien);
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></HEAD>
<BODY BGCOLOR="#AODOFF" TEXT="#OO60c0">
<?
//Définition des date au format jour-mois-année
$date_today = date("d-m-Y");
$f = date ( "d-m-Y" , mktime ( 0 , 0 , 0 , 12 , 31 , date("Y") ) ) ;
//Extraction des données
list($jour1, $mois1, $annee1) = explode('-', $f);
list($jour2, $mois2, $annee2) = explode('-', $date_today);
//Calcul des timestamp
$timestamp1 = mktime(0,0,0,$mois1,$jour1,$annee1);
$timestamp2 = mktime(0,0,0,$mois2,$jour2,$annee2);
$a = number_format(abs($timestamp2 - $timestamp1)/(86400*7*4));
$c = $a/4;
$k = 1;
?>
<form name="form1" method="post" action="" onSubmit="choix();">
<table width="90%" border=1 align="center" cellpadding=7 cellspacing=0 bordercolor="#AODOFF" bgcolor="white">
<tr>
<?
for($j=1;$j<$c;$j++)
{
for($i=$k;$i<$k+4;$i++)
{
?>
<th align="center" width="7%">
<input name="date" type="checkbox" value="<? echo date('d-m-Y', mktime ( 0 , 0 , 0 , (date('m')+$i) , 1 , date('Y') ) )?>" onClick="dispChoix(this.form.date);">
<? echo date('d-m-Y', mktime ( 0 , 0 , 0 , (date('m')+$i) , 1 , date('Y') ) ) ;?>
<input type="text" name="nombre" size="5" disabled="disabled"></th>
<?
}
?>
</tr>
<?
$k = $k + 4;
}
?>
<tr>
<?
for($m=$i;$m<$i+($a-$k);$m++)
{
?>
<th align="center" width="7%">
<input name="date" type="checkbox" value="<? echo date ( 'd-m-Y' , mktime ( 0 , 0 , 0 , (date('m')+$m) , 1 , date('Y') ) ) ;?>" onClick="dispChoix(this.form.date);">
<? echo date ( 'd-m-Y' , mktime ( 0 , 0 , 0 , (date('m')+$m) , 1 , date('Y') ) ) ;?>
<input type="text" name="nombre" size="5" disabled="disabled"></th>
<?
}
?></tr>
<tr>
<th align="center" colspan="4"><input type="submit" name="Submit" value="Envoyer"></th>
</tr>
</table>
</form>
</body>
</html> |
Partager