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
| <form action="historique.php" method="post" id=c class=>
<b>Mouvement : </b>
<INPUT TYPE=radio NAME=evo value='' checked><span class="b red">tous</span>
<INPUT TYPE=radio NAME=evo value=in>entrée
<INPUT TYPE=radio NAME=evo value=out >sortie
<br> <br>
<?php echo " <b > Destinataire : </b> <input type=text name=ou >  ";
$date =date("d m Y");
// décrémentation de la date du jour
$date2= mktime(0,0,0,date("m" ), date("d" ) -10 ,date("Y" ) -1);
$date2=date("d m Y", $date2);
echo"
<b>Date entre </b>
<INPUT TYPE=text NAME=date1 value='$date2' size=8>
<b>et</b> <INPUT TYPE=text NAME=date2 value='$date' size=8>
";
?>
<input type="submit" NAME="rec" value="Valider">
</form>
<?php
include ('connection.php') ;
//Fonction 18 09 2008 en 2008-09-18
function in($string) {
list( $d, $m, $y) = explode(' ', $string);
return $y . '-' . $m. '-' .$d;
} $deb= in($_POST['date1']);
$fi= in($_POST['date2']);
//Fonction 2008-09-18 en 18 09 2008
function out($var) {
list( $a, $b, $c) = explode('-', $var);
return $c . ' ' . $b. ' ' .$a;
}
$debut=($data['date1']);
$debut= out($debut);
$fin=($data['date2']);
$fin= out($fin);
$ou=($_POST['ou']);
$rec=($_POST['rec']);
$mov=($_POST['evo']);
// empty ($mov) = vide $mov isset($var) = $var remplie
if (empty ($rec) )
{ $requete = "SELECT * FROM globale,historique where globale.id=historique.produit ORDER BY id2 DESC "; }
elseif (empty ($mov) and empty($ou))
{ $requete = "SELECT * FROM globale,historique where globale.id=historique.produit and date>='$deb' and date<='$fi' ORDER BY id2 DESC "; }
elseif (empty ($mov) and isset($ou))
{ $requete = "SELECT * FROM globale,historique where globale.id=historique.produit and où='$ou' and date>='$deb' and date<='$fi' ORDER BY id2 DESC "; }
else {$requete = "SELECT * FROM globale,historique where globale.id=historique.produit and move='$mov' ORDER BY id2 DESC ";} |
Partager