oppossom
Messages postés
43
Date d'inscription
lundi 25 février 2008
Statut
Membre
Dernière intervention
14 avril 2008
29 févr. 2008 à 12:20
voila le code complet de mon page
<html>
<head><title>services plage horaire</title>
<style type= "text/css">
h2{font-family: verdana;color:#0000ff}
.bleu{color:#3366ff;font-weight:italic}
.rouge{color:#ff0000;font-weight:italic}
</style>
</head>
<form method="POST" action="">
Service Plage Horaire
<fieldset>
<legend>Pointage
</legend>
<label for ="idta">Identifiant TA : </label>
<label for="datedepart">Date de depart : </label>H
<label for="datedarret">Date d'arret : </label>H
<?php
//parametres de connexion
$machine="localhost";
$utilisateur="root";
$mot_passe="";
$nom_base="plage_horaire";
//connexion au SGBD Mysql
$con=mysql_connect($machine,$utilisateur,$mot_passe) or die ('Erreur : '.mysql_error());
//s'il y a de connection
//selection de la base des donnees
mysql_select_db($nom_base);
//Récupérer les données
$idTA=$_POST['idTA'];
$datedepart=$_POST['datedepart'];
$datedarret=$_POST['datedarret'];
function calcul_nbr_heures_par_jours($datedepart,$datedarret){
$idTA=$_POST['idTA'];
$datedepart=$_POST['datedepart'];
$datedarret=$_POST['datedarret'];
for($idTA=1 ;$idTA<100; $idTA++){
if($i =="x"){
//le x designe la valeur de nbr de jour du date systeme
//comment la recuperer ??????? c'est un autre soucis
for($i=1;$i<33;$i++){
$nbhji=$datedepart+$datedarret;
/*la requete d'insertion de nbhji suivant i (compteur) dans
la table pointage sous le colone convenable */
$query_function="INSERT INTO pointage (idTA,nbhj1,nbhj2,nbhj3,nbhj4,nbhj5,nbhj6,nbhj7,nbhj8,nbhj9,nbhj10,nbhj11,nbhj12,nbhj13,nbhj14,nbhj15,nbhj16,nbhj17,nbhj18,nbhj19,nbhj20,nbhj21,nbhj22,nbhj23,nbhj24,nbhj25,nbhj26,nbhj27,nbhj28,nbhj29,nbhj30,nbhj31)
VALUES ('','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.','.$nbhji.');";
$resultat=mysql_query($query_function,$con) or die("L'insertion a echouée car :". mysql_error() .".");
}
}
}
}
?>
</fieldset>
</form>