Forum 4SI
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le Deal du moment : -15%
(Adhérents Fnac) LEGO® Star Wars™ ...
Voir le deal
552.49 €

corrigé sujet 2010 8h 30

Aller en bas

corrigé sujet 2010 8h 30 Empty corrigé sujet 2010 8h 30

Message par Admin Lun 7 Mai - 20:37

****************transaction.htm*****************************
<html>

<head>
<meta http-equiv="Content-Language" content="fr">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>transaction</title>
<script language="javascript">
function control()
{
if (document.trans.compte_t.value=="")
{
alert("Numéro de compte vide!");
return false;
}

if(document.trans.compte_t.value.length!=20)
{
alert("Numéro de compte sur 20 chiffres!");
return false;

}
if (document.trans.organisme.selectedIndex==0)
{
alert("Veuillez choisir un organisme bénéficiaire!");
return false;
}

if (document.trans.facture.value=="")
{
alert("Numéro de facture vide!");
return false;
}

if ((Number(document.trans.montant.value)<=0) || (Number(document.trans.montant.value)>200))
{
alert("Montant de facture non valide!");
return false;
}




}
</script>

<meta name="Microsoft Theme" content="aftrnoon 1011">
</head>

<body>
<form name="trans" method="post" action="payer.php" onsubmit="return control()" >
<div align="center">
<table border="0" width="579" id="table1" cellpadding="8" height="391">
<tr>
<td colspan="2" height="60">
<p align="center"><u><font size="5"><b><i>Paiement d'une facture</i></b></font></u></td>
</tr>
<tr>
<td width="541" colspan="2"><hr style="height: 3px"></td>
</tr>
<tr>
<td width="237"><b><font size="4">Numéro de compte</font></b></td>
<td width="304">
<input type="text" name="compte_t" size="31" style="padding:1px; border-style:solid; border-width:2px; "></td>
</tr>
<tr>
<td width="237"><font size="4"><b>Organisme bénéficiaire</b></font></td>
<td width="304">
<select size="1" name="organisme" style="font-weight: 700; border-style: solid; border-width: 1px; ">
<option>Vueillez choisir un organisme</option>
<option value="STEG">STEG</option>
<option value="SONEDE">SONEDE</option>
<option value="Telecom">Telecom</option>
<option value="Tunisiana">Tunisiana</option>
</select></td>
</tr>
<tr>
<td width="237" align="center">

<p align="left"><b><font size="4">Numéro facture</font></b></td>
<td width="304" align="center">

<input name="facture" size="31" style="padding:1px; border-style:solid; border-width:2px; float:left"></td>
</tr>
<tr>
<td width="237" align="center">

<p align="left"><b><font size="4">Montant de transaction</font></b></td>
<td width="304" align="center">

<p align="left">
<input name="montant" size="19" style="padding:1px; border-style:solid; border-width:2px; float:left" value="0.000">&nbsp;
<b>DT</b></td>
</tr>
<tr>
<td width="237" align="center">

<p align="left"><b><font size="4">Date transaction</font></b></td>
<td width="304" align="center">

<p align="left"><input type="text" name="date" size="19" style="padding:1px; border-style:solid; border-width:2px; ">
<i>(aaaa-mm-jj)</i></td>
</tr>
<tr>
<td width="237" align="center">

<font size="3">

<input type="submit" value="Payer" name="B1" style="font-weight: 700; float: right; border-style: solid; border-width: 1px; font-size:12pt"></font></td>
<td width="304" align="center">

<font size="3">

<input type="reset" value="Annuler" name="B2" style="font-weight: bold; float: left; border-style: solid; border-width: 1px; font-size:12pt"></font></td>
</tr>
<tr>
<td width="559" colspan="2" align="center">

</td>
</tr>
</table>
</div>
</form>
</body>

</html>
************payer.php********************************
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Transaction</title>
<link rel="stylesheet" href="aftr1011.css">
<meta name="Microsoft Theme" content="aftrnoon 1011">
</head>

<body>

<?php
if (isset($_POST['compte_t']))
{
$num_compte = $_POST['compte_t'];
mysql_connect("localhost","root","");
mysql_select_db("bdsujet2010");
// verification du compte dans la table Compte
$req = "SELECT * FROM compte Where Num_Compte='$num_compte'";
$res = mysql_query($req);
$nbr_comptes = mysql_num_rows($res);


if ($nbr_comptes == 1)
{
$c = mysql_fetch_array($res);
$solde = $c[3];
$ben = $_POST['organisme'];
$num_facture = $_POST['facture'];
$montant = $_POST['montant'];
$date = $_POST['date'];

// le compte exsite, ajout de la transaction et mise à jour du solde

$req_ajout="INSERT INTO transaction(Beneficiaire,Montant,Date,Num_Facture,Num_Compte) Values ('$ben','$montant','$date','$num_facture','$num_compte')";
$res_ajout=mysql_query($req_ajout);
echo "Votre solde est : ".$solde." DT<br><hr>Votre Transaction a été ajoutée avec succées sous le numéro ".mysql_insert_id();

// La mise à jour du solde du compte
$solde-=$montant;

$req_maj="UPDATE compte SET Solde='$solde' where Num_Compte='$num_compte'";
mysql_query($req_maj);

echo "<br><hr> Votre nouveau solde est : ".$solde." DT ";

}
else
{
echo " Compte inéxsitant, veuillez réessayer !!! ";
}

}
?>
</body>
</html>
**************identification.php********************************
.<?php
if (isset($_POST['compte']))
{
$num_compte = $_POST['compte'];
$password = $_POST['pass'];

mysql_connect("localhost","root","");
mysql_select_db("bdsujet2010");
$req = "SELECT * FROM compte Where Num_Compte='$num_compte' and Mot_Passe='$password'";
$res = mysql_query($req);
$n = mysql_num_rows($res);

if ($n==0)
{
echo "<br><H3> Erreur d'identification <H3><a href='identification.php'> RETOUR </a>";
}
else
{
// affichage du menu apres identification
echo "<br><H2> <u>Services en ligne</u> <H2><a href='Presentation.html' target='D'> Présentation des services </a><br><br><a href='Transaction.html' target='D'> Paiement factures </a><br><br><a href='mailto://ebanking@bankX.com.tn' target='D'> Contacter nous </a>";

}
}
else
{
?>

<html>

<head>
<meta http-equiv="Content-Language" content="fr">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Identification d'un client</title>
<meta name="Microsoft Theme" content="aftrnoon 1011">
</head>

<body>
<form method="POST" action="identification.php" >
<table border="0" width="374" id="table1" cellpadding="8">
<tr>
<td colspan="2"><u><i><b><font size="5">Identification d'un client</font></b></i></u></td>
</tr>
<tr>
<td width="159"><b><font size="4">Numéro de compte</font></b></td>
<td width="177">
<input type="text" name="compte" size="23" style="border-style: solid; border-width: 2px; padding-left: 2px; padding-right: 2px; padding-top: 1px; padding-bottom: 1px"></td>
</tr>
<tr>
<td width="159"><b><font size="4">Mot de passe</font></b></td>
<td width="177">
<input type="password" name="pass" size="23" style="border-style: solid; border-width: 2px; padding-left: 2px; padding-right: 2px; padding-top: 1px; padding-bottom: 1px"></td>
</tr>
<tr>
<td width="354" colspan="2" align="center">

<input type="submit" value="S'identifier" name="B1" style="font-weight: 700; float: left; border-style: solid; border-width: 1px"></td>
</tr>
</table>
</form>
</body>

</html>
<?php } ?>

Admin
Admin

Messages : 40
Date d'inscription : 27/09/2007

https://missaoui-lcp.forumpro.fr

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser