Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified attributionFonctions/__add_agent.php
100644 → 100755
Empty file.
Empty file modified attributionFonctions/__add_fonction.php
100644 → 100755
Empty file.
32 changes: 9 additions & 23 deletions attributionFonctions/__add_tache.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
<?php

require_once('tache.class.php');
require_once('tache.dao.php');


if(isset($_POST['description'],$_POST['datedebut'],$_POST['datefin'],$_POST['idagent']) && !empty($_POST['description']) && !empty($_POST['datedebut']) && !empty($_POST['datefin']) && !empty($_POST['idagent']))
{
require_once("tache.class.php");
require_once("tache.dao.php");
$t=new Tache(1,$_POST['description'],$_POST['datedebut'],$_POST['datefin'],$_POST['idagent']);
$ajout=new TacheDAO();
$ins=$ajout->ajouterTache($t);
header('Location: taches.php');

if(isset($_POST['idagent']) and isset($_POST['description']) and !empty($_POST['datedebut']) and !empty($_POST['datefin']))
{
$tache = new Tache(0, $_POST['description'], $_POST['datedebut'], $_POST['datefin'], $_POST['idagent']);
$tdao = new TacheDAO();

if($tdao->AddTache($tache) == true)
{
header('Location: taches.php');
}
else
{
header('Location: taches.php');
}

}
else
{
echo 'Remplissez Tous Les Champs';
}
}

?>
28 changes: 14 additions & 14 deletions attributionFonctions/__changer_tache.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

require_once('tache.class.php');
require_once('tache.dao.php');

$t = new Tache($_POST['id'], '', '', '', $_POST['idagent']);
$tdao = new TacheDAO();
$tdao->updateTache($t);
header('Location: taches.php');


<?php
var_dump($_POST);
if(isset($_POST['description'],$_POST['datedebut'],$_POST['datefin'],$_POST['id_ag']))
{
require_once("tache.dao.php");
require_once("tache.class.php");
$t=new Tache($_POST['id_ag'],$_POST['description'],$_POST['datedebut'],$_POST['datefin'],$_POST['id_ag']);
$in=new TacheDAO();
$s=$in->modifierTache($t);
header('Location: taches.php');
}
?>
Empty file modified attributionFonctions/agent.class.php
100644 → 100755
Empty file.
Empty file modified attributionFonctions/agent.dao.php
100644 → 100755
Empty file.
Empty file modified attributionFonctions/agents.php
100644 → 100755
Empty file.
Empty file modified attributionFonctions/attribution_fonctions.mwb
100644 → 100755
Empty file.
Empty file modified attributionFonctions/attribution_fonctions.mwb.bak
100644 → 100755
Empty file.
Empty file modified attributionFonctions/attribution_fonctions.sql
100644 → 100755
Empty file.
Empty file modified attributionFonctions/changer_fonction.php
100644 → 100755
Empty file.
88 changes: 26 additions & 62 deletions attributionFonctions/changer_tache.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,34 @@
<link rel="stylesheet" href="style.css" />
</head>
<body>

<?php
include_once('head.php');
require_once('tache.class.php');
require_once('tache.dao.php');
$tdao = new TacheDAO();

if(isset($_GET['id']))
{
$_tache = $tdao->getTache($_GET['id']);
if ($_tache != null)
{
echo
"<div>
<h2>Attribuer une tâche à un Agent</h2>
<form method=\"post\" action=\"\">
<label for=\"description\">Description :</label>
<input type=\"text\" name=\"description\" id=\"description\" value=\"".$_tache->getDescription()."\"/><br />
<label for=\"datedebut\">Date début :</label>
<input type=\"date\" name=\"datedebut\" id=\"datedebut\" /><br />
<label for=\"datefin\">Date fin :</label>
<input type=\"date\" name=\"datefin\" id=\"datefin\" value=\""."06/06/2017"."\"/><br />
<label for=\"idagent\">Agent :</label>
<select name=\"idagent\" id=\"idagent\">";
?>

<?php
require_once('agent.class.php');
require_once('agent.dao.php');

$adao = new AgentDAO();
$la = $adao->getAllAgent();

foreach($la as $a) {
echo '
<option value="'.$a->getId().'">'.$a->getNom().'</option>
';
}

?>

<?php echo "</select><br />
<input type=\"submit\" value=\"Enregistrer\" name=\"editTache\"/>
</form>
</div>"; ?>

<?php
if(isset($_POST['editTache']))
{
$tache = new Tache($_tache->getId(), mysql_real_escape_string($_POST['description']), $_POST['datedebut'], $_POST['datefin'], $_POST['idagent']);
if($tdao->editTache($tache) == true)
{
header('Location: taches.php');
}
else
{
echo "Erreur Lors De La Mise A Jour";
}
}
}
if(isset($_GET['id']) && !empty($_GET['id']))
{
$id=0;
$id=$_GET['id'];

}
include_once('foot.php');
?>
<?php include_once('head.php'); ?>

<div>
<h2>Attribuer une tâche à un Agent</h2>
<form method="post" action="__changer_tache.php">
<label for="description">Description :</label>
<input type="text" name="description" id="description" /><br />
<label for="datedebut">Date début :</label>
<input type="date" name="datedebut" id="datedebut" /><br />
<label for="datefin">Date fin :</label>
<input type="date" name="datefin" id="datefin" /><br />
<input type="hidden" name="id_ag" value=<?php echo $id;?>>


<input type="submit" value="Enregistrer" />
</form>
</div>


<?php include_once('foot.php'); ?>
</body>
</html>


</html>
Empty file modified attributionFonctions/connexion.dao.php
100644 → 100755
Empty file.
45 changes: 9 additions & 36 deletions attributionFonctions/del_tache.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,38 +1,11 @@
<!doctype>
<html>
<head>
<title>Attribution des fonctions</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<?php include_once('head.php'); ?>
<?php

<div>

<?php
require_once('tache.class.php');
require_once('tache.dao.php');
if(isset($_GET['id']) && !empty($_GET['id']))
{
require_once("tache.dao.php");
$sup=new TacheDAO();
$supprim=$sup->supprimerTache($_GET['id']);
header('Location: taches.php');
}


$tdao = new TacheDAO();

if(isset($_GET['id']))
{
$id = $_GET['id'];

if($tdao->delTache($id) === true)
{
echo "<p>Tache Supprimee Avec Succes</p>";
}
else
{
echo "<p>Tache Non Trouvee</p>";
}
}
?>
</div>

<?php include_once('foot.php'); ?>
</body>
</html>
?>
Empty file modified attributionFonctions/fonction.class.php
100644 → 100755
Empty file.
Empty file modified attributionFonctions/fonction.dao.php
100644 → 100755
Empty file.
Empty file modified attributionFonctions/fonctions.php
100644 → 100755
Empty file.
Empty file modified attributionFonctions/foot.php
100644 → 100755
Empty file.
Empty file modified attributionFonctions/head.php
100644 → 100755
Empty file.
8 changes: 3 additions & 5 deletions attributionFonctions/index.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,9 @@
<?php
require_once('fonction.class.php');
require_once('fonction.dao.php');
require_once('tache.dao.php');
require_once('agent.class.php');
require_once('agent.dao.php');

require_once('tache.class.php');
require_once('tache.dao.php');
$tdao = new TacheDAO();

$fdao = new FonctionDAO();
$lf = $fdao->getAllFonction();
Expand All @@ -75,6 +72,7 @@
</tr>
';
$compteur = 1;
$comt=new TacheDAO();
foreach($la as $a) {
echo '<tr>
<td>'.$compteur.'</td>
Expand All @@ -92,7 +90,7 @@
break;
}
}
echo '<td>'.$tdao->getTacheNbr($a->getId()).'</td>';
echo '<td>'.$comt->getNombreTache($a->getId()).'</td>';
echo '<td><a href="changer_fonction.php?id='.$a->getId().'&nom='.$a->getNom().'"><img src="change.jpg" alt="change" width="30px;" /></a></td>';
echo '</tr>';
$compteur++;
Expand Down
Empty file modified attributionFonctions/interro_rattrapage.pdf
100644 → 100755
Empty file.
Empty file modified attributionFonctions/style.css
100644 → 100755
Empty file.
Empty file modified attributionFonctions/tache.class.php
100644 → 100755
Empty file.
115 changes: 20 additions & 95 deletions attributionFonctions/tache.dao.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,107 +20,32 @@ function getAllTache() {

return $tabTache;
}
function delTache($id=null)

function supprimerTache($id_tache)
{
if($id != null)
{
$req = $this->bdd->query("DELETE FROM `tache` WHERE id='$id'");
if($req == TRUE)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
$req = $this->bdd->prepare('DELETE FROM tache WHERE id = :id');
$req->execute(array("id"=>$id_tache));
}
function getTache($id=null)
{
if($id != null)
{
$req = $this->bdd->query("SELECT * FROM tache WHERE id='$id'");
$tabTache = array();
while($data = $req->fetch()) {
$a = new Tache($data['id'], $data['description'], $data['datedebut'], $data['datefin'], $data['idagent']);
$tabTache[] = $a;
}


$req->closeCursor();

function ajouterTache(Tache $tache)
{
$req = $this->bdd->prepare('INSERT INTO tache SET description=:description,datedebut=:datedebut,datefin=:datefin,idagent=:idagent');
$req->execute(array("description"=>$tache->getDescription(),"datedebut"=>$tache->getDatedebut(),"datefin"=>$tache->getDatefin(),"idagent"=>$tache->getIdagent()));
}

function getNombreTache($idfonction) {
$req = $this->bdd->prepare('SELECT COUNT(*) FROM tache WHERE idagent = :idagent');
$req->execute(array('idagent' => $idfonction));

return $tabTache[0];
}
else
{
return null;
}
$resultat = $req->fetch()[0];
return $resultat;
}
function getTacheNbr($id=null)
function modifierTache(Tache $tache)
{
if($id != null)
{
$req = $this->bdd->query("SELECT count(*) FROM tache WHERE idagent='$id'");
$data = $req->fetchColumn();
$req->closeCursor();
return $data;
}
else
{
return 0;
}
}
function AddTache($tache = null)
{
if($tache != null)
{
$description = $tache->getDescription();
$dateDebut = $tache->getDatedebut();
$dateFin = $tache->getDatefin();
$idAgent = $tache->getIdagent();
$req = $this->bdd->query("INSERT INTO tache (id, description, datedebut, datefin, idagent) VALUES (null, '$description', '$dateDebut', '$dateFin','$idAgent')");
if($req == TRUE)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
function editTache($tache = null)
{
if($tache != null)
{
$description = $tache->getDescription();
$dateDebut = $tache->getDatedebut();
$dateFin = $tache->getDatefin();
$idAgent = $tache->getIdAgent();
$id = $tache->getId();
$req = $this->bdd->query("UPDATE tache SET description='$description', datedebut='$dateDebut', datefin='$dateFin', idAgent='$idAgent' WHERE id='$id'");
if($req == TRUE)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
$req = $this->bdd->prepare('UPDATE tache SET description=?,datedebut=?,datefin=? WHERE id=?');
$req->execute([$tache->getDescription(),$tache->getDatedebut(),$tache->getDatefin(),$tache->getId()]);
}

}

?>
Empty file modified attributionFonctions/taches.php
100644 → 100755
Empty file.