Salut voici les codes:
Les différentes tables sont:
agence(idagence, libelle, idGroupestat, telephone)
groupestatistique(idGroupestat, nomgroupe)
caisse(idcaisse,nomcaisse,idagence)
caissier(idcaissier,idcaisse,idagence,nomcaissier...)
utilisateur(userId, idagence, login, passuser, etat , fonction, nomuser)
CONNEXION
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connex = "localhost";
$database_connex = "pointcaisse";
$username_connex = "root";
$password_connex = "";
$connex = mysql_pconnect($hostname_connex, $username_connex, $password_connex) or trigger_error(mysql_error(),E_USER_ERROR);
?>
PAGE INDEX
<?php require_once('Connections/connex.php'); ?>
<?php
$colname_identuser = "0";
if (isset($_POST['Login'])) {
$colname_identuser = (get_magic_quotes_gpc()) ? $_POST['Login'] : addslashes($_POST['Login']);
}
mysql_select_db($database_connex, $connex);
$query_identuser = sprintf(" SELECT a.IdAgence, u.NomUser, a.libelle, u.UserID, u.Login, u.IDAgence, u.UserID FROM agence a, utilisateur u WHERE u.Login = %s AND u.IdAgence = a.IdAgence", $colname_identuser);
$identuser = mysql_query($query_identuser, $connex) or die(mysql_error());
$row_identuser = mysql_fetch_assoc($identuser);
$totalRows_identuser = mysql_num_rows($identuser);
?>
<?php
if (!isset($_SESSION))
{
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['login'])) {
$loginUsername=$_POST['login'];
$password=$_POST['passwd'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "ajustgene.php";
$MM_redirectLoginFailed = "index.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_connex, $connex);
$LoginRS__query=sprintf("SELECT Login, PassUser FROM utilisateur WHERE Login='%s' AND PassUser='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $connex) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<html>
<head>
<title><? echo $titre; ?></title>
</head>
<body bgcolor="#FFffff" onLoad="document.register.login.focus();">
<table height="100%" border=0 width="100%" cellspacing=0 cellpadding=0>
<tr>
<td>
<table border=0 width="100%" cellspacing=0 cellpadding=4>
<tr><td valign="top" width='1%'>
<form ACTION="<?php echo $loginFormAction; ?>" method=POST name="register" id="register">
<div align="center"><font color="#FF9900" size="3" face="Arial, Helvetica, sans-serif"><strong>POINT DE CAISSE SNC- FINANCES</strong></font> <font color="#FF9900" size="3" face="Arial, Helvetica, sans-serif"><strong>WESTERN UNION</strong></font></div>
<table width="450" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#446093">
<tr>
<td height="67" valign="middle">
<div align="center"><strong><font color="#FFFFFF" size="3" face="Geneva, Arial, Helvetica, sans-serif">.::
IDENTIFICATION UTILISATEUR ::.</font></strong>
</div></td>
</tr>
<tr>
<td height="180" valign="middle" bgcolor="#FFFFFF">
<table width="48%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td align="right" nowrap><font face="arial" size="-1">Utilisateur :</font></td>
<td><input name="login" type="text" size="17" maxlength="32"></td>
</tr>
<tr>
<td align="right" nowrap><font face="arial" size="-1">Mot de passe :</font></td>
<td><input name="passwd" type="password" size="17" maxlength="32"></td>
</tr>
<tr><td align=center valign=bottom colspan=2>
<br></td></tr>
<tr><td align=center valign=bottom colspan=2><input name="ouvrirsession" type=submit id="ouvrirsession" value="ouvrir session"></td>
</tr>
</table>
<br>
</td>
</tr>
</table>
</form></td>
</tr>
</table>
<td></tr>
<tr><td valign="top" align="center">
<table border=0 cellpadding=0 cellspacing=0><tr>
<td align=center valign=bottom width="100%"><font size=-2 face=arial><b>Copyright
© 2008 SNC FINANCES Tous droits réservés.
</b></font></td>
</tr></table>
<td></tr>
</table>
</body>
</html>
<?php
mysql_free_result($identuser);
?>
PAGE SAISIE FICHE AJUSTAGE GENERALE
<table width="240" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#000000" >
<tr>
<td width="337" height="25" bgcolor="38499A">
<strong><font color=white size="2" face="Verdana, Arial, Helvetica, sans-serif"> AJUSTAGE GENERALE DE CAISSE </font></strong></td>
</tr>
</table>
<hr align="center" width="100%" size="1" color="#1F5F22" noshade>
<form action="<?php echo $editFormAction; ?>" method="POST" name="formajustgene" id="formajustgene" >
<table width="552" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0">
<tr>
<td width="15%"><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Date</strong></font></td>
<td width="39%"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><em><? echo date("d/m/Y H:i:s"); ?></em></strong></font></td>
<td width="19%" class="Style8"><div align="right"><font color="#0000FF"><strong>Journée du </strong></font></div></td>
<td width="27%" class="Style8"><input name="JourneeDu" type="text" id="JoourneeDu2" value="aaaa-mm-jj" /></td>
</tr>
<tr>
<td class="Style8"><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Agence</strong></font></td>
<td colspan="3" class="Style8 Style1">
</tr></span></font>
<tr>
<td colspan="4" class="Style8"><span class="Style10"><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Nom de l'opérateur-caissier </strong></font><font color="#0000FF"> :</font></span></td>
</tr>
<tr>
<td colspan="4" class="Style8"> </td>
</tr>
<tr>
<td colspan="4"><hr></td>
</tr>
</table>
<table width="100%">
<tr>
<td width="1%" align="center"><font face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
<td height="23" colspan="2" align="center"><div align="left" class="Style11">
<div align="right"><font color="#0000FF" face="Verdana, Arial, Helvetica, sans-serif">ANCIEN SOLDE(Solde comptable de la veille) </font></div>
</div></td>
<td width="17%" align="center"><div align="right">
<input name="AncienSoldeGeneral" type="text" id="AncienSoldeGeneral" size="15" />
</div></td>
</tr>
<tr>
<td height="24"><font face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
<td colspan="2"><div align="right"><font face="Verdana, Arial, Helvetica, sans-serif"><span class="Style11"><font color="#0000FF">APPRO </font></span></font></div></td>
<td align="center"><div align="right">
<input name="ApproGeneral" type="text" id="ApproGeneral" size="15">
</div></td>
</tr>
<tr>
<td height="23" colspan="3" align="center"><div align="left" class="Style11">
<div align="right"><font color="#0000FF" face="Verdana, Arial, Helvetica, sans-serif">PAIEMENT</font></div>
</div></td>
<td height="23" align="center"><input name="PaiementGeneral" type="text" id="PaiementGeneral" size="15" /></td>
</tr>
<tr>
<td height="23" colspan="3" align="center"><div align="left" class="Style11">
<div align="right"><font color="#0000FF" face="Verdana, Arial, Helvetica, sans-serif">PRINCIPAL</font></div>
</div></td>
<td height="23" align="center"><input name="PrincipalGeneral" type="text" id="PrincipalGeneral" size="15" /></td>
</tr>
<tr>
<td height="23" colspan="3" align="center"><div align="left" class="Style11">
<div align="right"><font color="#0000FF" face="Verdana, Arial, Helvetica, sans-serif">CHARGE</font> </div>
</div></td>
<td height="23" align="center"><input name="ChargesGeneral" type="text" id="ChargesGeneral" size="15" /></td>
</tr>
<tr>
<td height="23" colspan="3" align="center"><div align="left" class="Style11">
<div align="right"><font color="#0000FF" face="Verdana, Arial, Helvetica, sans-serif">TAXE</font></div>
</div></td>
<td height="23" align="center"><input name="TaxeGeneral " type="text" id="TaxeGeneral " size="15" /></td>
</tr>
<tr>
<td height="23" colspan="3" align="center"><div align="left" class="Style11">
<div align="right"><font color="#0000FF" face="Verdana, Arial, Helvetica, sans-serif">DIFFERENCE DE CAISSE</font></div>
</div></td>
<td height="23" align="center"><input name="DiffCaisseGeneral" type="text" id="DiffCaisseGeneral" size="15" /></td>
</tr>
<tr>
<td height="23" colspan="3" align="center"><div align="left" class="Style11">
<div align="right"><font color="#0000FF" face="Verdana, Arial, Helvetica, sans-serif">NOUVEAU SOLDE</font></div>
</div></td>
<td height="23" align="center"><input name="NouveauSoldeGeneral" type="text" id="NouveauSoldeGeneral" size="15" /></td>
</tr>
<tr>
<td height="23" colspan="4" align="center"><hr></td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td width="178%" height="21" colspan="3"><hr align="left"></td>
</tr>
<tr>
<td height="21" colspan="3">
<div align="center">
<input name="enregajustgene" type="submit" id="enregajustgene" value="Enregistrer" />
</div></td>
</tr>
</table>
<p align="left">
<input type="hidden" name="MM_insert" value="formajustgene">
</p>
</td>
</tr>
</table>
</form>
PAGE DE RECHERCHE
?php require_once('Connections/connex.php'); ?>
<?php
mysql_select_db($database_connex, $connex);
$query_ListeGroupeStat = "SELECT * FROM groupestatistique ORDER BY NomGroupe ASC";
$ListeGroupeStat = mysql_query($query_ListeGroupeStat, $connex) or die(mysql_error());
$row_ListeGroupeStat = mysql_fetch_assoc($ListeGroupeStat);
$totalRows_ListeGroupeStat = mysql_num_rows($ListeGroupeStat);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
[ Lien ]">
<html xmlns="
[ Lien ]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
<style type="text/css">
<!--
.Style1 { color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<body>
<p> </p>
<form id="form1" name="form1" method="post" action="affichepointglobal.php">
<table width="286" border="0" align="center" cellpadding="1" cellspacing="1">
<tr >
<td height="25" bordercolor="#CCCCCC" bgcolor="#003399" with="25"><div align="center" class="Style1"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">ETAT JOURNALIER DES TRANSACTIONS </font></div></td>
</tr>
</table>
<label><br />
<br />
</label>
<label></label>
<table width="69%" border="0" align="left" cellpadding="2" cellspacing="2" bgcolor="">
<tr>
<td width="25%" bgcolor="<? echo $tdbgcolor; ?>"><table width="247" border="0" align="left" cellpadding="1" cellspacing="1">
<tr >
<td width="243" height="25" bordercolor="#CCCCCC" bgcolor="#003399" with="25"><div align="center" class="Style1">
<label>Selectionner le Groupe Statistique</label>
</div></td>
</tr>
</table></td>
<td><select name="IDGroupestat" id="IDGroupestat">
<?php
do {
?>
<option value="<?php echo $row_ListeGroupeStat['IDGroupestat']?>"><?php echo $row_ListeGroupeStat['NomGroupe']?></option>
<?php
} while ($row_ListeGroupeStat = mysql_fetch_assoc($ListeGroupeStat));
$rows = mysql_num_rows($ListeGroupeStat);
if($rows > 0) {
mysql_data_seek($ListeGroupeStat, 0);
$row_ListeGroupeStat = mysql_fetch_assoc($ListeGroupeStat);
}
?>
</select></td>
</tr>
<tr>
<td bgcolor="<? echo $tdbgcolor; ?>"><table width="245" border="0" align="right" cellpadding="1" cellspacing="1">
<tr >
<td width="241" height="25" bordercolor="#CCCCCC" bgcolor="#003399" with="25"><div align="center" class="Style1">
<div align="right">Journée du</div>
</div></td>
</tr>
</table></td>
<td><table>
<tr>
<?php
$sdate=date("Y-m-d");
$jma=explode("-",$sdate);
$jour=$jma[2];
$mois=$jma[1];
$annee=$jma[0];
?>
<td><select name="jour_d">
<?php
for ($i=1; $i<=31; $i++)
{
if($i<10) $i="0".$i;
if ($i==$jour+0) echo "<option value=\"$i\" selected >$i</option>";
else echo "<option value=\"$i\">$i</option>";
}
?>
</select></td>
<td>/</td>
<td><select name="mois_d">
<?php
for ($i=1; $i<=12; $i++)
{
if($i<10) $i="0".$i;
if ($i==$mois+0) echo "<option value=\"$i\" selected >$i</option>";
else echo "<option value=\"$i\">$i</option>";
}
?>
</select></td>
<td>/</td>
<td><select name="annee_d">
<option value="<? echo $annee; ?>" ><? echo $annee; ?></option>
<option value="<? echo $annee-1; ?>" selected="selected" ><? echo $annee-1; ?></option>
<option value="<? echo $annee+1; ?>"><? echo $annee+1; ?></option>
</select></td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="right"><font face="Verdana, Arial, Helvetica, sans-serif">
<input name="BTaffichepoint" type="submit" id="BTaffichepoint" value="Afficher" />
</font></div></td>
<td> </td>
</tr>
<p></p>
</table>
<p> </p>
<p> </p>
<p> </p>
<p><font face="Verdana, Arial, Helvetica, sans-serif"> </font></p>
<p> </p>
</form>
<p> </p>
<p> </p>
</body>
</html>
<?php
mysql_free_result($ListeGroupeStat);
?>
PAGE DE RESULTAT
<?php require_once('Connections/connex.php'); ?>
<?php
$colname1_ListeAgce = "0000-00-00";
if (isset($_POST['JourneeDu'])) {
$colname1_ListeAgce = (get_magic_quotes_gpc()) ? $_POST['JourneeDu'] : addslashes($_POST['JourneeDu']);
}
$colname_ListeAgce = "1";
if (isset($_POST['IDGroupestat'])) {
$colname_ListeAgce = (get_magic_quotes_gpc()) ? $_POST['IDGroupestat'] : addslashes($_POST['IDGroupestat']);
}
mysql_select_db($database_connex, $connex);
$query_ListeAgce = sprintf("SELECT a.IDAgence,a.libelle, j.IDAjustageGeneral, j.IDAgence, j.AncienSoldeGeneral, j.ApproGeneral, j.ChargesGeneral, j.PaiementGeneral, j.PrincipalGeneral, j.ChargeGeneral, j.TaxeGeneral, j.DiffCaisseGeneral, j.NouveauSoldeGeneral, j.JourneeDu, g.IDGroupestat FROM ajustagegeneral j, agence a, groupestatistique g WHERE a.IDGroupestat = %s AND a.IDGroupestat = g.IDGroupestat AND j.IDAgence = a.IDAgence AND date('Y-m-J') = %s AND j.JourneeDu = date ('Y-m-J')", $colname_ListeAgce,$colname1_ListeAgce);
$ListeAgce = mysql_query($query_ListeAgce, $connex) or die(mysql_error());
$row_ListeAgce = mysql_fetch_assoc($ListeAgce);
$totalRows_ListeAgce = mysql_num_rows($ListeAgce);
?>
<link href="css/text.css" rel="stylesheet" type="text/css">
<link href="css/udzone.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Style1 {
color: #FFFFFF;
font-weight: bold;
}
.Style4 {color: #0000CC}
.Style9 {font-size: 12px}
-->
</style>
<table width="286" border="0" align="center" cellpadding="1" cellspacing="1">
<tr >
<td height="25" bordercolor="#CCCCCC" bgcolor="#003399" with="25">
<div align="center" class="Style1"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">ETAT JOURNALIER DES TRANSACTIONS </font></div></td>
</tr>
</table>
<hr size="2">
<p class="Style9"><em><font face="Verdana, Arial, Helvetica, sans-serif"><strong><span class="Style4">Date de la consultation :</span><? echo date("d/m/Y H:i:s"); ?></strong></font></em></p>
<p><br>
</p>
<table width="100%" align="center" cellpadding="1" cellspacing="1" bordercolor="#0000FF" bgcolor="#0033CC">
<tr bgcolor="#000066">
<td width="10%" height="25" bordercolor="#CCCCCC" bgcolor="#003399"> <div align="center" class="Style1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Agences</font></div></td>
<td width="11%" bordercolor="#CCCCCC" bgcolor="#003399"> <div align="center" class="Style1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Acien Solde</font></div></td>
<td width="9%" bordercolor="#CCCCCC" bgcolor="#003399"><div align="center" class="Style1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Appro</font></div></td>
<td width="8%" bordercolor="#CCCCCC" bgcolor="#003399"> <div align="center" class="Style1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Paiement</font></div></td>
<td width="8%" bordercolor="#CCCCCC" bgcolor="#003399"> <div align="center" class="Style1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Principal</font></div></td>
<td width="6%" bordercolor="#CCCCCC" bgcolor="#003399"> <div align="center" class="Style1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Charge</font></div></td>
<td width="8%" bordercolor="#CCCCCC" bgcolor="#003399"><div align="center" class="Style1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Taxe</font></div></td>
<td width="14%" bordercolor="#CCCCCC" bgcolor="#003399"><div align="center" class="Style1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Différence de caisse</font></div></td>
<td width="11%" bordercolor="#CCCCCC" bgcolor="#003399"><div align="center" class="Style1"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Nouveau solde</font></div></td>
</tr>
<?php do { ?>
<tr bgcolor="#000066">
<td height="25" bordercolor="#CCCCCC" bgcolor="#FFFFFF"><div align="center"><?php echo $row_ListeAgce['libelle']; ?></div></td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><div align="center"><?php echo $row_ListeAgce['AncienSoldeGeneral']; ?></div></td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><div align="center"><?php echo $row_ListeAgce['ApproGeneral']; ?></div></td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><div align="center"><?php echo $row_ListeAgce['PaiementGeneral']; ?></div></td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><div align="center"><?php echo $row_ListeAgce['PrincipalGeneral']; ?></div></td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><div align="center"><?php echo $row_ListeAgce['ChargesGeneral']; ?></div></td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><div align="center"><?php echo $row_ListeAgce['TaxeGeneral']; ?></div></td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><div align="center"><?php echo $row_ListeAgce['DiffCaisseGeneral']; ?></div></td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"><div align="center"><?php echo $row_ListeAgce['NouveauSoldeGeneral']; ?></div></td>
</tr>
<?php } while ($row_ListeAgce = mysql_fetch_assoc($ListeAgce)); ?>
</table>
<p> </p>
<?php
mysql_free_result($ListeAgce);
?>