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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
|
<?php require_once('../Connections/ConnexionTransport.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "User,Admin";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../Index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?
$dateFr = $_POST['DateMission'];
list($jour, $mois, $annee) = explode("/",$dateFr);
$array = array($annee,$mois,$jour);
$dateEn = implode("-",$array);
?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO demandetransport (UserLogin, DateDemande, TimeDemande, DateMission, DureeMission, SvDemandeur, DestinationMission, ViaMission, PcDate, PcHeure, PcLieu, DenominationMission, ValidationMission) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['UserLogin'], "text"),
GetSQLValueString($_POST['DateDemande'], "text"),
GetSQLValueString($_POST['TimeDemande'], "text"),
GetSQLValueString($_POST['DateMission'], "text"),
GetSQLValueString($_POST['DureeMission'], "text"),
GetSQLValueString($_POST['SvDemandeur'], "text"),
GetSQLValueString($_POST['DestinationMission'], "text"),
GetSQLValueString($_POST['ViaMission'], "text"),
GetSQLValueString($_POST['PcDate'], "text"),
GetSQLValueString($_POST['PcHeure'], "text"),
GetSQLValueString($_POST['PcLieu'], "text"),
GetSQLValueString($_POST['DenominationMission'], "text"),
GetSQLValueString($_POST['ValidationMission'], "text"));
mysql_select_db($database_ConnexionTransport, $ConnexionTransport);
$Result1 = mysql_query($insertSQL, $ConnexionTransport) or die(mysql_error());
$IdDemandeActuelle = mysql_insert_id();
$insertGoTo = "DemandeDeTransportVehicule.php?recordIDDemande=".$IdDemandeActuelle;
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$colname_rsUser = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_rsUser = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_ConnexionTransport, $ConnexionTransport);
$query_rsUser = sprintf("SELECT * FROM `user` WHERE UserLogin = '%s'", $colname_rsUser);
$rsUser = mysql_query($query_rsUser, $ConnexionTransport) or die(mysql_error());
$row_rsUser = mysql_fetch_assoc($rsUser);
$totalRows_rsUser = mysql_num_rows($rsUser);
?>
<html>
<head>
<title>Demande de transport</title>
</head>
<body>
<table width="100%" cellpadding="" cellspacing="" bordercolor="#676767" bgcolor="#FFFFFF">
<tr>
<th bordercolor="#676767" scope="row"><div align="left"><img src="/transport/Pictures/Logo.jpg" width="350" height="100"></div></th>
</tr>
<tr>
<th bordercolor="#FFFFFF" bgcolor="#999999" scope="row"><span class="Style4"><a href="Acceuil.php">Acceuil</a> | <a href="DemandeDeTransport.php">Demande de transport</a> | <a href="InfoPerso.php">Données personnelles</a> | <a href="Listing.php?recordIDDate=<? echo date('d/m/Y')?>">Listing</a> | <a href="../Administrateur/Acceuil.php">Admin</a> </span></th>
</tr>
<tr>
<th bordercolor="#FFFFFF" scope="row"> </th>
</tr>
<tr>
<th bordercolor="#FFFFFF" scope="row"><div align="center">
<form name="form1" method="POST" action="<?php echo $editFormAction; ?>">
<table width="800" border="0" cellspacing="2" cellpadding="2">
<tr>
<th width="402" scope="row"> </th>
<td width="384"><p>
<input type="hidden" name="DateDemande" value="<? echo date('Y-m-d'); ?>"><input type="hidden" name="TimeDemande" value="<? echo date('H:i')?>">
<input type="hidden" name="ValidationMission" value="En attente">
</p> </td>
</tr>
<tr>
<th scope="row"><div align="right">Dénomination de la mission: </div></th>
<td><div align="left">
<input type="text" name="DenominationMission">
</div></td>
</tr>
<tr>
<th scope="row"><div align="right">Demande effectuée par : </div></th>
<td><div align="left"><?php echo $row_rsUser['UserRank']; ?> <?php echo $row_rsUser['UserNom']; ?>
<input type="hidden" name="UserLogin" value="<?php echo $row_rsUser['UserLogin']; ?>">
</div></td>
</tr>
<tr>
<th scope="row"><div align="right">Service demandeur: </div></th>
<td><div align="left">
<input name="SvDemandeur" type="text" value="<?php echo $row_rsUser['UserService']; ?>">
</div></td>
</tr>
<tr>
<th scope="row"><div align="right">Date de la mission: </div></th>
<td><div align="left">
<input type="text" name="DateMission">
<em>(respectez le format "jj/mm/yyyy")</em></div></td>
</tr>
<tr>
<th scope="row"><div align="right">Durée de la mission: </div></th>
<td><input name="DureeMission" type="text" size="5">
<em>Jour(s).</em></td>
</tr>
<tr>
<th scope="row"><div align="right">Destination de la mission: </div></th>
<td><input type="text" name="DestinationMission"></td>
</tr>
<tr>
<td scope="row"><div align="right">Détail du trajet (via...): </div></td>
<td><textarea name="ViaMission" cols="40" rows="3"></textarea></td>
</tr>
<tr>
<th scope="row"><div align="right">Date de Prise en Charge des véhicules: </div></th>
<td><input type="text" name="PcDate">
<em>(respectez le format "jj/mm/yyyy")</em></td>
</tr>
<tr>
<td scope="row"><div align="right">Heure de prise en charge: </div></td>
<td><input type="text" name="PcHeure">
<em>(respectez le format "HH.MM")</em></td>
</tr>
<tr>
<td scope="row"><div align="right">Endroit de prise en charge: </div></td>
<td><input type="text" name="PcLieu"></td>
</tr>
<tr>
<th scope="row"><div align="right"></div></th>
<td><div align="right">
<input type="submit" name="Submit" value="Suivant>>">
</div></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
<input type="hidden" name="MM_insert" value="form1">
</form>
</div></th>
</tr>
<tr>
<th bordercolor="#FFFFFF" scope="row"> </th>
</tr>
<tr>
<td bordercolor="#FFFFFF" class="Style3" scope="row"><div align="center">©S4-Mat</div></td>
</tr>
<tr>
<td bordercolor="#FFFFFF" class="Style3" scope="row"><div align="center"></div></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsUser);
?> |
Partager