|
@@ -1,13 +1,36 @@
|
|
<?php
|
|
<?php
|
|
|
|
+session_start();
|
|
|
|
+
|
|
|
|
+if (!isset($_SESSION['loggedin'])) {
|
|
|
|
+ header("Location: login.php");
|
|
|
|
+ exit;
|
|
|
|
+}
|
|
|
|
+?>
|
|
|
|
+<?php
|
|
|
|
+include_once 'class/sqlconnect.php';
|
|
|
|
+try {
|
|
|
|
+ $conn = new PDO("mysql:host=$host;dbname=$dbname", $dbusername, $dbpassword);
|
|
|
|
+ $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
|
+ $stmt = $conn->prepare("SELECT ID FROM users WHERE username = :username");
|
|
|
|
+ $stmt->bindParam(':username', $_SESSION['username']);
|
|
|
|
+ $stmt->execute();
|
|
|
|
+
|
|
|
|
+ $result = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
|
|
+ $idsession = $result['ID'];
|
|
|
|
+
|
|
|
|
+} catch (PDOException $e) {
|
|
|
|
+ echo "Error: " . $e->getMessage();
|
|
|
|
+}
|
|
|
|
+$conn = null;
|
|
include 'class/sqlconnect.php';
|
|
include 'class/sqlconnect.php';
|
|
- $query = "SELECT ID, NomSociete FROM Entreprise";
|
|
|
|
|
|
+ $query = "SELECT ID, NomSociete FROM Entreprise WHERE UserID =" . $idsession . ";";
|
|
$result = mysqli_query($conn, $query);
|
|
$result = mysqli_query($conn, $query);
|
|
$options = "";
|
|
$options = "";
|
|
while ($row = mysqli_fetch_assoc($result)) {
|
|
while ($row = mysqli_fetch_assoc($result)) {
|
|
$options .= "<option value={$row['ID']}>{$row['NomSociete']}</option>";
|
|
$options .= "<option value={$row['ID']}>{$row['NomSociete']}</option>";
|
|
}
|
|
}
|
|
|
|
|
|
- $query = "SELECT ID, Prenom, Nom, Mobile, IDEntreprise FROM Contact";
|
|
|
|
|
|
+ $query = "SELECT ID, Prenom, Nom, Mobile, IDEntreprise FROM Contact WHERE IDUser =" . $idsession . ";";
|
|
$result = mysqli_query($conn, $query);
|
|
$result = mysqli_query($conn, $query);
|
|
$options2 = "";
|
|
$options2 = "";
|
|
while ($row = mysqli_fetch_assoc($result)) {
|
|
while ($row = mysqli_fetch_assoc($result)) {
|
|
@@ -28,73 +51,73 @@
|
|
<a href="index.php">Revenir à l'accueil</a><br><br>
|
|
<a href="index.php">Revenir à l'accueil</a><br><br>
|
|
<h1>Création d'un entretien téléphonique</h1>
|
|
<h1>Création d'un entretien téléphonique</h1>
|
|
<form action="creationentretientel.php" method="post">
|
|
<form action="creationentretientel.php" method="post">
|
|
- <table style='border:1px solid #000;'>
|
|
|
|
- <tr style='border:1px solid #000;'>
|
|
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <table>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
<label for="idEntreprise">Nom de l'entreprise :</label>
|
|
<label for="idEntreprise">Nom de l'entreprise :</label>
|
|
</td>
|
|
</td>
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <td>
|
|
<select id="idEntreprise" name="idEntreprise">
|
|
<select id="idEntreprise" name="idEntreprise">
|
|
<?php echo $options; ?>
|
|
<?php echo $options; ?>
|
|
</select>
|
|
</select>
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
- <tr style='border:1px solid #000;'>
|
|
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
<label for="idContact">Contact de l'entreprise :</label>
|
|
<label for="idContact">Contact de l'entreprise :</label>
|
|
</td>
|
|
</td>
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <td>
|
|
<select id="idContact" name="idContact">
|
|
<select id="idContact" name="idContact">
|
|
<?php echo $options2; ?>
|
|
<?php echo $options2; ?>
|
|
</select>
|
|
</select>
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
- <tr style='border:1px solid #000;'>
|
|
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
<label for="dateHeurePrevueEntretien">Date/heure prévue de l'entretien :</label>
|
|
<label for="dateHeurePrevueEntretien">Date/heure prévue de l'entretien :</label>
|
|
</td>
|
|
</td>
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <td>
|
|
<input type="datetime-local" id="dateHeurePrevueEntretien" name="dateHeurePrevueEntretien">
|
|
<input type="datetime-local" id="dateHeurePrevueEntretien" name="dateHeurePrevueEntretien">
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
- <tr style='border:1px solid #000;'>
|
|
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
<label for="dateHeureEffectiveEntretien">Date/heure effective de l'entretien :</label>
|
|
<label for="dateHeureEffectiveEntretien">Date/heure effective de l'entretien :</label>
|
|
</td>
|
|
</td>
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <td>
|
|
<input type="datetime-local" id="dateHeureEffectiveEntretien" name="dateHeureEffectiveEntretien">
|
|
<input type="datetime-local" id="dateHeureEffectiveEntretien" name="dateHeureEffectiveEntretien">
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
- <tr style='border:1px solid #000;'>
|
|
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
<label for="ponctualiteEntreprise">Ponctualité de l'entreprise :</label>
|
|
<label for="ponctualiteEntreprise">Ponctualité de l'entreprise :</label>
|
|
</td>
|
|
</td>
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
- <input type="checkbox" id="ponctualiteEntreprise" name="ponctualiteEntreprise">
|
|
|
|
|
|
+ <td>
|
|
|
|
+ <input type="checkbox" value="1" id="ponctualiteEntreprise" name="ponctualiteEntreprise">
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
- <tr style='border:1px solid #000;'>
|
|
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
<label for="remuneration">Rémunération proposée:</label>
|
|
<label for="remuneration">Rémunération proposée:</label>
|
|
</td>
|
|
</td>
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <td>
|
|
<input type="text" id="remuneration" name="remuneration" value="<?php echo $remuneration; ?>" >
|
|
<input type="text" id="remuneration" name="remuneration" value="<?php echo $remuneration; ?>" >
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
- <tr style='border:1px solid #000;'>
|
|
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
<label for="poste">Poste proposé:</label>
|
|
<label for="poste">Poste proposé:</label>
|
|
</td>
|
|
</td>
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <td>
|
|
<input type="text" id="poste" name="poste" value="<?php echo $poste; ?>" >
|
|
<input type="text" id="poste" name="poste" value="<?php echo $poste; ?>" >
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
- <tr style='border:1px solid #000;'>
|
|
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
<label for="suivi">Déroulement et suivi Entretien :</label>
|
|
<label for="suivi">Déroulement et suivi Entretien :</label>
|
|
</td>
|
|
</td>
|
|
- <td style='border:1px solid #000;'>
|
|
|
|
- <textarea id="suivi" name="suivi" value="<?php echo $suivi; ?>" rows="4" cols="50"></textarea>
|
|
|
|
|
|
+ <td>
|
|
|
|
+ <textarea id="suivi" name="suivi" value="<?php echo $suivi; ?>" rows="20" cols="150"></textarea>
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
</table>
|
|
</table>
|
|
@@ -110,13 +133,17 @@
|
|
$ponctualiteEntreprise = $_POST['ponctualiteEntreprise'];
|
|
$ponctualiteEntreprise = $_POST['ponctualiteEntreprise'];
|
|
$remuneration = $_POST['remuneration'];
|
|
$remuneration = $_POST['remuneration'];
|
|
$poste = $_POST['poste'];
|
|
$poste = $_POST['poste'];
|
|
|
|
+ $poste = str_replace("'", "\'", $poste);
|
|
$suivi = $_POST['suivi'];
|
|
$suivi = $_POST['suivi'];
|
|
|
|
+ $suivi = htmlentities($suivi);
|
|
|
|
+ $suivi = str_replace("'", "\'", $suivi);
|
|
|
|
|
|
$sql = "INSERT INTO EntretienTelephonique (IDEntreprise, IDContact, DateHeurePrevueEntretien, DateHeureEffectiveEntretien, PonctualiteEntreprise, Remuneration, PosteAborde, SuiviEntretien)
|
|
$sql = "INSERT INTO EntretienTelephonique (IDEntreprise, IDContact, DateHeurePrevueEntretien, DateHeureEffectiveEntretien, PonctualiteEntreprise, Remuneration, PosteAborde, SuiviEntretien)
|
|
VALUES ('$idEntreprise', '$idContact', '$dateHeurePrevueEntretien', '$dateHeureEffectiveEntretien', '$ponctualiteEntreprise', '$remuneration', '$poste', '$suivi')";
|
|
VALUES ('$idEntreprise', '$idContact', '$dateHeurePrevueEntretien', '$dateHeureEffectiveEntretien', '$ponctualiteEntreprise', '$remuneration', '$poste', '$suivi')";
|
|
-
|
|
|
|
|
|
+
|
|
if ($conn->query($sql) === TRUE) {
|
|
if ($conn->query($sql) === TRUE) {
|
|
echo "L'entretien téléphonique a été enregistré avec succès.";
|
|
echo "L'entretien téléphonique a été enregistré avec succès.";
|
|
|
|
+ header("refresh:1; url=index.php");
|
|
} else {
|
|
} else {
|
|
echo "Erreur lors de l'enregistrement de l'entretien téléphonique: " . $conn->error;
|
|
echo "Erreur lors de l'enregistrement de l'entretien téléphonique: " . $conn->error;
|
|
}
|
|
}
|