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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
| <?php
session_start();
// connection au serveur
include("config.php");
// include("fonct.php");
$auj=date("Y-m-d");
$auj2 = date("Y-m-d", strtotime('+15 day'));
$hr=date('H:i:s');
// }
$exo= date("Y");
$deb1=$_POST['aaaa']."-".$_POST['mm']."-".$_POST['jj'];
$fin1=$_POST['aaaa1']."-".$_POST['mm1']."-".$_POST['jj1'];
$andeb = date('Y',strtotime($deb1));
$anfin = date('Y',strtotime($fin1));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<!-- entet de page -->
<title>SUNU Missions ::: Planifier une mission</title>
<link href="styl_aff.css" rel="stylesheet" type="text/css">
<link rel="icon" title="logo" type="image/jpeg" href="images/logo.png"/>
<script language="javascript">
function Go()
{
document.location.href="valid3.php";
}
</script>
</head>
<body >
<div id="conteneur">
<form name="enr" method="post" action="enr.php" >
<center><img src="images/bannier_admin.png" height="150" width="99%" alt="ua" /></center>
<fieldset id="EA">
<div id="formulaire_EA">
<?php
if($_GET['action']=="modif")
{
//supression des enregistrements existants
$req="SELECT * FROM `$bd`.`demande` where exo='$_GET[an]' and service='$_GET[dep]' and id='$_GET[idf]' ";
echo $req."<br/>";
$aff = mysql_query($req,$connection);
while ($val= mysql_fetch_array($aff))
{
$requetespecial2="DELETE FROM `$bd`.`demande` where exo='$val[exo]' and service='$val[service]' and id='$val[id]' and matricule='$val[matricule]' ";
echo $requetespecial2."<br/>";
mysql_query($requetespecial2,$connection);
}
//insertion des nouveaux enregistrements
$col14 = $_POST['col14'];
if(!empty($_POST['col14']))
{
$options_text = implode("','",$col14);
$reqint="SELECT * FROM `$bd`.`utilisateurs` where matricule in ('".$options_text."')";
echo $reqint;
}
$aff5 = mysql_query($reqint,$connection);
while ($val5= mysql_fetch_array($aff5))
{
//sauvegarde dans la BD
$requetespecial="INSERT INTO `$bd`.`demande` (`id`, `exo`, `matricule`, `service`, `depart`, `arrivee`, `debut`,`fin`, `debut2`, `fin2`, `Dsoum`, `Hsoum`, `valid`, `Etat`, `VR`, `VR2`, `AreoR`, `nuiteeR`,`perdiemR`, `Aero`, `perdiem`, `nuitee`, `F_int`, `Fjust`, `Elieu`, `namef`, `rappf`, `namefterm`, `print`)
VALUES ('$_GET[idf]', '$_GET[an]', '$val5[matricule]', '$_GET[dep]', '', '', '$deb1', '$fin1', '', '', '$auj','$hr', 0, '0', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', '', '', 0)";
echo $requetespecial;
mysql_query($requetespecial,$connection);
}
//ajout de l'enregistrement autres
if ($_POST['autres']=="autres")
{
$requetespecial3="INSERT INTO `$bd`.`demande` (`repr`,`id`, `exo`, `matricule`, `service`, `depart`, `arrivee`, `debut`,
`fin`, `debut2`, `fin2`, `Dsoum`, `Hsoum`, `valid`, `Etat`, `VR`, `VR2`, `AreoR`, `nuiteeR`,
`perdiemR`, `Aero`, `perdiem`, `nuitee`, `F_int`, `Fjust`, `Elieu`, `namef`, `rappf`, `namefterm`, `print`) VALUES
('1','$_GET[idf]', '$_GET[an]', '$_POST[autr2]', '$_GET[dep]', '', '', '$deb1', '$fin1', '', '', '$auj',
'$hr', 0, '0', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, '', '', '', 0)";
// echo $requetespecial3;
mysql_query($requetespecial3,$connection);
}
//modification de l'état de la mission
$requetespecial4="UPDATE `$bd`.`planning` SET `etat` ='1' WHERE `exo`='$_GET[an]'
and `id`='$_GET[idf]'
and `service`='$_GET[dep]' ";
mysql_query($requetespecial4,$connection);
// echo $requetespecial4;
// insertion dans le journal
$action= "Planification mission $_GET[an]/$_GET[dep]/$_GET[idf] ";
include ("action.php");
echo "<p>
<center>
<table border=0>
<TR> <TD col width='30px'><img src='images/Check.png'><a></TD>
<TD > <strong>la mission N° $_GET[an]/$_GET[dep]/$_GET[idf] a été bien planifiée. voulez vous la soumettre à validation ?</strong></TD>
</TR>
</table>
<a href='dem.php?idf=$_GET[idf]&an=$_GET[an]&dep=$_GET[dep]&action=modif'>Oui</a> <a href='valid3.php'>Non</a>
</center>
</p>
";
}
?> |
Partager