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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
| <HTML>
<center>
<HEAD>
<title>Application Caisse de la STP</title>
<!---Lien du fichie style.css-->
<link rel="stylesheet" type="text/css" href="style/design.css"/>
<link rel="shortcut icon" href="favicon.ico" type="images/x-icon"/>
<script type="text/javascript" src="javascript/dept_xhr.js" charset="iso_8859-1"></script>
<script type="text/javascript" src="javascript/nomchauff.js" charset="iso_8859-1"></script>
<script type="text/javascript" src="javascript/soc.js" charset="iso_8859-1"></script>
<title>Page d'accueil: CAISSE</title>
</HEAD>
<BODY>
<div id="fondec">
<div id="bandeau">
<h3> Société de Gestion des transports</h3>
<div id="gauche">
 
<a href="interfaceOp.php">Réaliser inventaire</a>
</br>
<a href="operation.php">Opérations</a>
</br>
<a href="exportGlobal.php">Global journée</a>
</br>
<a href="suspendChauff.php">Suspendre un chauffeur</a>
</br>
<a href="depot.php">Dépôt</a>
</div>
<h1>Caisse</h1>
<?php
include('verifSession.php');
include('config.php');
?>
<a HREF="deconnexion.php">Se déconnecter?</a> 
<a href="eure.php">Exporter</a>
</div>
<form name="frm" id="frm" action="<?php echo($_SERVER['PHP_SELF']);?>" method="POST">
<?php
$zql="SELECT IdSoc FROM t_recette WHERE dateSaisie=now() ORDER BY Idrecette DESC LIMIT 1";
$reszql=mysql_query($zql) or die('Affiche pas la dernière société sélectionnée');
while($done=mysql_fetch_row($reszql))
{ $test=$done[0]; }
$qry="SELECT IdSoc from t_recette ORDER BY Idrecette DESC LIMIT 1";
$result=mysql_query($qry) or die ('Affiche pas le numéro de la societe!');
while($datas=mysql_fetch_row($result))
{
$dat=$datas[0];
}
?>
<table border="1">
<tr>
<th>Société</th>
<th width="8%"><font face="times new roman"><b>Nom</b></font></th>
<th width="6%"><font face="times new roman"><b>Matricule</b></font></th>
<th width="4%"><font face="times new roman"><b>Ligne</b></font></th>
<th width="10%"><font face="times new roman"><b>Date Recette</b></font></th>
<th width="8%"><font face="times new roman"><b>Recette trieuse</b></font></th>
<th width="8%"><font face="times new roman"><b>Recette</b></font></th>
<th width="8%"><font face="times new roman"><b>Gazole</b></font></th>
<th width="8%"><font face="times new roman"><b>Carte</b></font></th>
<th width="8%"><font face="times new roman"><b>Relica</b></font></th>
<th width="8%"><font face="times new roman"><b>Avance</b></font></th>
<th width="10%"><font face="times new roman"><b>Observation</b></font></th>
</tr>
<tr>
<td><input type="text" size="1" name="list0" value="<?php echo $test; ?>" onblur="controle(this.form);"/></td>
<td><span id="blocNom"></span></td>
<td><input type="text" name="idselect" size="7" readonly="readonly"/></td>
<td width="10%"><span id='blocLigne'></span></td>
<?php
$sqll="SELECT DATE_FORMAT(Daterecette, '%d/%m/%Y')
FROM t_recette
WHERE Daterecette=now()";
$ress=mysql_query($sqll);
while($donnee=mysql_fetch_row($ress))
{
$date=$donnee[0];
}
?>
<td><INPUT type="text" name="Date_Recette" size="10" value="<?php if (isset($date)) {echo $date;} ?>"></td>
<td><input type="text" size="7" name="recetteMachine" onblur="controlerForm(this.form)"></td>
<td><INPUT type="text" size="8" name="MontantRecette"></td>
<td><INPUT type="text" size="8" name="Gazoline"></td>
<td><INPUT type="text" size="8" name="CarteValeur" onblur="calculCV(this.value);" value="0"></td>
<td><INPUT type="text" size="8" name="RelicaCarte"></td>
<td><INPUT type="text" size="10" name="MontantAvance"></td>
<td><INPUT type="text" size="10" name="Observation"></td>
<input type="hidden" name="ligne">
</table>
<input type="submit" name="btsend" value="Enregistrer"/>
<?php
if(isset($_POST['btsend']))
{
$idsoc = $_POST['list0'];
$idchauff=$_POST['idselect'];
$ligne=$_POST['ligne'];
$daterecette=$_POST['Date_Recette'];
$recetteMachine = $_POST['recetteMachine'];
$recette = $_POST['MontantRecette'];
$gazole = $_POST['Gazoline'];
$carte = $_POST['CarteValeur'];
$relica = $_POST['RelicaCarte'];
$avance = $_POST['MontantAvance'];
$obs = $_POST['Observation'];
$log=$_SESSION['login'];
$req="SELECT IdUser FROM user WHERE login='$log'";
$res=mysql_query($req) or die ('Erreur');
while($data=mysql_fetch_row($res))
{
$iduser=$data[0];
}
//on écrit la requête sql
$sql = "INSERT INTO t_recette(Idchaufgesco, Ligne, Daterecette, dateSaisie, Carte,
Relica, Avance, RecetteMachine, Recette, Observation, IdUser, Gazole,IdSoc)
VALUES('$idchauff','$ligne',STR_TO_DATE('$daterecette', '%d/%m/%Y'),now(),'$carte',
'$relica','$avance','$recetteMachine','$recette','$obs','$iduser','$gazole','$idsoc')";
// on insère les informations du formulaire dans la table
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
/*Si il y a un montant pour les avances*/
/*Alors la requête d'insertion s'exécute*/
}
/*Réinitialise les variables*/
$_POST['list0']="";
$idchauff=0;
$ligne=0;
$datesaisie="";
$daterecette="";
$recetteMachine=0;
$recette=0;
$gazole=0;
$carte=0;
$relica=0;
$avance=0;
$obs="";
$test=0;
$sql="";
$sql2="";
?>
</div>
<script type="text/javascript">
var maintenant = new Date();
var jour = maintenant.getDate();
var mois = maintenant.getMonth() + 1;
var annee = maintenant.getYear();
var heures = maintenant.getHours();
var minutes = maintenant.getMinutes();
var format = ((minutes < 10) ? ":0" : ":");
if (annee<2000) annee=annee+1900;
document.write("<b>Recette(s) du "
+ jour + "." + mois + "." + annee + "<\/b>");
</script>
</br>
</br>
<!-- Tableau activité -->
<span id="blocSoc"></span>
<div id="piedpage">
</br>
<div id="powered">SGT@Corporation</div>
</div>
</form>
</BODY>
</center>
</HTML> |
Partager