Aide sur php/mysql
li2000
Messages postés
18
Date d'inscription
Statut
Membre
Dernière intervention
-
malaouip -
malaouip -
Bonjour,
J'ai un calendrier de RDV avec plage d'heure je veux récupérer la date et l'heure sélectionné dans ce tableau pour l'enregistré dans une basse de bonné, après la validation de l'heure choisi elle ne sera plus afficher sur le tableau comment faire cela voilà mon code php :
<?php
if(isset($_GET["Samedi"])) // Une semaine précise est demandée
{
$ts = $_GET["Samedi"];
}
else //On prendra la semaine d'aujourd'hui
{
$diff = (date('w')+1) * 86400; //Différence en secondes par rapport au lundi - exemple : mercredi(2) * 86400
$ts = (time() - $diff); //On récupère le TimeStamp du lundi
}
//Initialisation des variables
$week = date('W', $ts); //Semaine en cours
$avant = $ts - 604800; //TimeStamp Lundi précédant = le ts du lundi - 60sec * 60min * 24h * 7jours
$apres = $ts +604800; //TimeStamp Lundi suivant = le ts du lundi + 60sec * 60min * 24h * 7jours
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Calendrier par Semaine - Semaine <?php echo $week;?></title>
<link type="text/css" rel="stylesheet" href="bouton.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/JavaScript" src="test.js"></script>
</head>
<body>
<div align="center">
<a href="calendrier20.php?Samedi=<?php echo $avant;?>"><< précédent</a>
Semaine <?php echo $week;?>
<a href="calendrier20.php?Samedi=<?php echo $apres;?>">suivant >></a>
</div>
<table align="center" border="1" width="420px" style=" text-decoration:none;background-color:#f2f6fb">
<thead>
<td align="center" width="14%"><b>Sam</b></td>
<td align="center" width="14%"><b>Dim</b></td>
<td align="center" width="14%"><b>Lun</b></td>
<td align="center" width="14%"><b>Mar</b></td>
<td align="center" width="14%"><b>Mer</b></td>
<td align="center" width="14%"><b>Jeu</b></td>
</thead>
<tbody>
<tr>
<?php
for($i=0;$i<=5;$i++)
{
echo '<td align="center" style="border:1px color:#666666">';
echo date('d / m Y', $ts);
echo '</td>';
$ts = $ts + 86400; //On passe au jour suivant car un jour = 60sec * 60min * 24h
}
?>
</tr>
<?php
$li = array (
'08:00','08:20','08:40',
'09:00','09:20','09:40',
'10:00','10:20','10:40',
'11:00','11:20','11:40',
'13:00','13:20','13:40',
'14:00','14:20','14:40',
'15:00','15:20','15:40'
);
for ($i=0; $i<21; $i++)
{
echo "<tr>";
for ($j=0; $j<6; $j++)
{
echo '<td width="70" height="30">';
echo '<input type="button" name="active" id="'.$j.$i.'" value="'.$li[$i].'" class="bouton" onclick="changeCouleur(\''.$j.$i.'\');" />';
echo '</td>';
}
echo "</tr>";
}
?>
</tbody>
</table>
</body>
</html>
merci pour votre aide.
J'ai un calendrier de RDV avec plage d'heure je veux récupérer la date et l'heure sélectionné dans ce tableau pour l'enregistré dans une basse de bonné, après la validation de l'heure choisi elle ne sera plus afficher sur le tableau comment faire cela voilà mon code php :
<?php
if(isset($_GET["Samedi"])) // Une semaine précise est demandée
{
$ts = $_GET["Samedi"];
}
else //On prendra la semaine d'aujourd'hui
{
$diff = (date('w')+1) * 86400; //Différence en secondes par rapport au lundi - exemple : mercredi(2) * 86400
$ts = (time() - $diff); //On récupère le TimeStamp du lundi
}
//Initialisation des variables
$week = date('W', $ts); //Semaine en cours
$avant = $ts - 604800; //TimeStamp Lundi précédant = le ts du lundi - 60sec * 60min * 24h * 7jours
$apres = $ts +604800; //TimeStamp Lundi suivant = le ts du lundi + 60sec * 60min * 24h * 7jours
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Calendrier par Semaine - Semaine <?php echo $week;?></title>
<link type="text/css" rel="stylesheet" href="bouton.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/JavaScript" src="test.js"></script>
</head>
<body>
<div align="center">
<a href="calendrier20.php?Samedi=<?php echo $avant;?>"><< précédent</a>
Semaine <?php echo $week;?>
<a href="calendrier20.php?Samedi=<?php echo $apres;?>">suivant >></a>
</div>
<table align="center" border="1" width="420px" style=" text-decoration:none;background-color:#f2f6fb">
<thead>
<td align="center" width="14%"><b>Sam</b></td>
<td align="center" width="14%"><b>Dim</b></td>
<td align="center" width="14%"><b>Lun</b></td>
<td align="center" width="14%"><b>Mar</b></td>
<td align="center" width="14%"><b>Mer</b></td>
<td align="center" width="14%"><b>Jeu</b></td>
</thead>
<tbody>
<tr>
<?php
for($i=0;$i<=5;$i++)
{
echo '<td align="center" style="border:1px color:#666666">';
echo date('d / m Y', $ts);
echo '</td>';
$ts = $ts + 86400; //On passe au jour suivant car un jour = 60sec * 60min * 24h
}
?>
</tr>
<?php
$li = array (
'08:00','08:20','08:40',
'09:00','09:20','09:40',
'10:00','10:20','10:40',
'11:00','11:20','11:40',
'13:00','13:20','13:40',
'14:00','14:20','14:40',
'15:00','15:20','15:40'
);
for ($i=0; $i<21; $i++)
{
echo "<tr>";
for ($j=0; $j<6; $j++)
{
echo '<td width="70" height="30">';
echo '<input type="button" name="active" id="'.$j.$i.'" value="'.$li[$i].'" class="bouton" onclick="changeCouleur(\''.$j.$i.'\');" />';
echo '</td>';
}
echo "</tr>";
}
?>
</tbody>
</table>
</body>
</html>
merci pour votre aide.
A voir également:
- Aide sur php/mysql
- Easy php - Télécharger - Divers Web & Internet
- Mysql community server - Télécharger - Bases de données
- Expert php pinterest - Télécharger - Langages
- Php alert - Forum PHP
- Mysql a répondu : documentation connexion impossible : paramètres incorrects. - Forum Bases de données