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
| <?php if (isset($_GET['liasse']) AND $_GET['liasse']=='liasse_a') { ?>
<?php
$sql = "SELECT * FROM liasse_a where n_doss='".mysql_real_escape_string($_GET['n_doss'])."'";
$qry = mysql_query($sql) or die(__LINE__.mysql_error().$sql);
$get_date = function($data_jours) {
$today = new DateTime();
$today->setTime(0, 0);
$jours = (isset($_POST['jours']) && ctype_digit($_POST['jours'])) ? $_POST['jours'] : 0;
if (isset($_POST['submit']) && ($_POST['submit'] === 'moins')) {
$jours = -$jours;
}
$nb = $data_jours + $jours;
$func = ($nb < 0) ? 'sub' : 'add';
$interval = new DateInterval("P{$nb}D");
return $today->$func($interval)->format('d-m-Y');
};
$i = -1; // index des enregistrements
?>
<table cellpadding="5" cellspacing="5">
<tr>
<td><strong>CODE SCENARIO</strong></td>
<td><strong>LIBELLE</strong></td>
<td><strong>ACTION</strong></td>
<td><strong>DESCRIPTION</strong></td>
<td><strong>DATE</strong></td>
</tr>
<form action="<?php echo (isset($_POST['go'])) ? 'go2.php' : '#'; ?>" method="post">
<input type="hidden" name="liasse" value="<?php echo $_GET['liasse']; ?>"/>
<input type="hidden" name="n_doss" value="<?php echo $_GET['n_doss']; ?>"/>
<?php while($row = mysql_fetch_assoc($qry)): ?>
<tr>
<td><input name="data[<?php echo ++$i; ?>][code_s]" type="text" value="<?php echo $row['code_s'];?>" size="10"></td>
<td><input name="data[<?php echo $i; ?>][libelle]" type="text" value="<?php echo $row['libelle']; ?>" size="45"></td>
<td><input name="data[<?php echo $i; ?>][action]" type="text" value="<?php echo $row['action']; ?>" size="15"></td>
<td><input name="data[<?php echo $i; ?>][libelle]" type="text" value="<?php echo $row['description']; ?>" size="55"></td>
<td><input type="text" name="data[<?php echo $i; ?>][date]" value="<?php $jours = $row['date_action'] ; echo $jours ; ?>" size="12"></td>
</tr>
<?php endwhile; ?>
<p>
<strong>Décalage des date </strong>
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#FFFF99">
<input type="image" src="images/minus_remove_green.png" width="22" height="22" name="submit" value="moins" />
<input name="jours" type="text" value="" size="5" />
<input type="image" src="images/plus_add_green.png" width="22" height="22" name="submit" value="plus" /> |
Partager