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
26 changes: 26 additions & 0 deletions attributionFonctions/__add_tache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
require_once('tache.class.php');
require_once('tache.dao.php');


if (isset($_POST['description'], $_POST['datedebut'], $_POST['datefin'], $_POST['idagent'])
and !empty($_POST['description']) and !empty($_POST['datedebut']) and !empty($_POST['datefin']) and !empty($_POST['idagent'])) {

$tache = new Tache(0, $_POST['description'], $_POST['datedebut'], $_POST['datefin'], $_POST['idagent']);
$tdao = new TacheDAO();
$lt = $tdao->getAllTache();
$find = false;
foreach ($lt as $t) {
if ($tache->getDescription() == $t->getDescription()) {
$find = true;
}
}
if (!$find) {
$tdao->add($tache);
header('Location: taches.php');
}

}else{
echo 'problems ';
}
?>
20 changes: 20 additions & 0 deletions attributionFonctions/__changer_fonction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype>
<?php
function getNombreAgent($idfonction) {
$req = $this->bdd->prepare('SELECT COUNT(*) FROM agent WHERE idfonction = :idfonction');
$req->execute(array('idfonction' => $idfonction));

$resultat = $req->fetch()[0];
return $resultat;
function getAllAgent() {
$req = $this->bdd->query('SELECT * FROM Agentgent');
$tabAgent = array();
while($genre = $req->fetch()) {
$a = new Agent($Agent['id'], $Agent['nom'], $Agent['genre'], $Agent['tel'], $Agent['email'], $Agent['idfonction']);
$tabAgent[] = $a;
if genre=
}
}

?>

16 changes: 16 additions & 0 deletions attributionFonctions/__modif_tache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
require_once('tache.dao.php');
require_once('tache.class.php');

if (isset($_POST['id'], $_POST['description'], $_POST['datedebut'], $_POST['datefin'], $_POST['idagent'])
and !empty($_POST['description']) and !empty($_POST['datedebut']) and !empty($_POST['datefin']) and !empty($_POST['idagent'])) {

$tdao = new TacheDAO();
$tdao->modifyTache($_POST['id'], $_POST['description'], $_POST['datedebut'], $_POST['datefin'], $_POST['idagent']);

header('Location: taches.php');

}else{
echo 'error on page __modi_tache.php';
}
?>
45 changes: 45 additions & 0 deletions attributionFonctions/agent.dao_2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

require_once('connexion.dao.php');

class AgentDAO {
private $bdd;
function __construct() {
$this->bdd = Connexion::getConnexion();
}

function getAllAgent() {
$req = $this->bdd->query('SELECT * FROM agent');
$tabAgent = array();
while($data = $req->fetch()) {
$a = new Agent($data['id'], $data['nom'], $data['genre'], $data['tel'], $data['email'], $data['idfonction']);
$tabAgent[] = $a;
}

$req->closeCursor();

return $tabAgent;
}

function add(Agent $a) {
$req = $this->bdd->prepare('INSERT INTO agent(nom, genre, tel, email, idfonction)
VALUES(:nom, :genre, :tel, :email, :idfonction)');
$req->execute(array(
'nom' => $a->getNom(),
'genre' => $a->getGenre(),
'tel' => $a->getTel(),
'email' => $a->getEmail(),
'idfonction' => $a->getIdfonction()
));
}

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

$resultat = $req->fetch()[0];
return $resultat;
}
}

?>
123 changes: 123 additions & 0 deletions attributionFonctions/attribution_fonction.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Dim 25 Juin 2017 à 12:21
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

--
-- Base de données : `attribution_fonctions`
--
CREATE DATABASE IF NOT EXISTS `attribution_fonctions` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `attribution_fonctions`;

-- --------------------------------------------------------

--
-- Structure de la table `agent`
--

CREATE TABLE IF NOT EXISTS `agent` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(255) NOT NULL,
`genre` char(1) NOT NULL,
`tel` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`idfonction` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
UNIQUE KEY `nom_UNIQUE` (`nom`),
UNIQUE KEY `tel_UNIQUE` (`tel`),
UNIQUE KEY `email_UNIQUE` (`email`),
KEY `fk_agent_fonction_idx` (`idfonction`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=34 ;

--
-- Contenu de la table `agent`
--

INSERT INTO `agent` (`id`, `nom`, `genre`, `tel`, `email`, `idfonction`) VALUES
(1, 'BITOTA MASANGU Patricia', 'F', '+24323037963', 'pat@gmail.com', 2),
(2, 'NGOY KYALUPATA Heritier', 'M', '+24323037852', 'heritier@gmail.com', 6),
(3, 'RAMAZANI NASSOR Lord', 'M', '+24323037741', 'lord@gmail.com', 5),
(4, 'BAMWEPELA MBAYO Maurice', 'M', '+24323037456', 'maurice@gmail.com', 3),
(5, 'FUMUNI BUTAKAR Germaine', 'F', '+24323037123', 'germaine@gmail.com', 3),
(6, 'LUMBU POMBO Stella', 'F', '+24323037159', 'stella@gmail.com', 6);

-- --------------------------------------------------------

--
-- Structure de la table `fonction`
--

CREATE TABLE IF NOT EXISTS `fonction` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`intitule` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
UNIQUE KEY `intitule_UNIQUE` (`intitule`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;

--
-- Contenu de la table `fonction`
--

INSERT INTO `fonction` (`id`, `intitule`, `description`) VALUES
(1, 'Réseaux informatiques', ' Mettre des ordinateurs et serveurs en réseau, Configurer des ordinateurs pour l''accès à un réseau.'),
(2, 'Développement et maintenance', 'Développer/maintenir des sites web, des outils et des bases de données'),
(3, 'Maintenance des logiciels', 'Configurer un poste de travail, Résoudre un dysfonctionnement de logiciels'),
(4, 'Maintenance du matériel', 'Remplacer et ajouter un ordinateur et ses composants, Remédier des pannes matérielles'),
(5, 'Sécurité', 'Appliquer les stratégies de sécurité (piratage informatique, confidentialité), Appliquer les stratégies de protection physique des données'),
(6, 'Communication professionnelle', 'Donner des conseils aux utilisateurs, Orienter un client dans l’acquisition de matériel, Collaborer en entreprise, Assurer un service Servicedesk/Helpline, Incidents / Gestion de problèmes (problem management) , Procédures, instructions de travail');

-- --------------------------------------------------------

--
-- Structure de la table `tache`
--

CREATE TABLE IF NOT EXISTS `tache` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(255) NOT NULL,
`datedebut` datetime NOT NULL,
`datefin` datetime NOT NULL,
`idagent` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
KEY `fk_tache_agent1_idx` (`idagent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;

--
-- Contenu de la table `tache`
--

INSERT INTO `tache` (`id`, `description`, `datedebut`, `datefin`, `idagent`) VALUES
(1, 'Etablir un cahier des charges', '2017-06-25 00:00:00', '2017-06-29 00:00:00', 2),
(2, 'Etablir un prototype/maquette', '2017-06-28 00:00:00', '2017-07-03 00:00:00', 4),
(3, 'Concevoir la structure des bases de données', '2017-07-02 00:00:00', '2017-07-08 00:00:00', 1),
(4, 'Mettre en production un site statique', '2017-07-04 00:00:00', '2017-07-09 00:00:00', 3),
(5, 'Maintenir et mettre à jour la structure et le contenu d''un site', '2017-06-21 00:00:00', '2017-07-06 00:00:00', 2),
(6, 'Concevoir et programmer des applications bureautiques', '2017-06-02 00:00:00', '2017-06-27 00:00:00', 6),
(7, 'Concevoir et programmer des applications\r\nrobotiques', '2017-07-20 00:00:00', '2017-07-29 00:00:00', 5);

--
-- Contraintes pour les tables exportées
--

--
-- Contraintes pour la table `agent`
--
ALTER TABLE `agent`
ADD CONSTRAINT `fk_agent_fonction` FOREIGN KEY (`idfonction`) REFERENCES `fonction` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Contraintes pour la table `tache`
--
ALTER TABLE `tache`
ADD CONSTRAINT `fk_tache_agent1` FOREIGN KEY (`idagent`) REFERENCES `agent` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
54 changes: 54 additions & 0 deletions attributionFonctions/changer_tache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<?php include_once('head.php'); ?>
<div>
<h2>Changer une tâche à affecter à un Agent</h2>
<form method="post" action="__modif_tache.php">
<?php
echo '<input type="hidden" name="id" value="'.$_GET['id'].'" />';
?>
<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 />
<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>
';
}

?>

</select><br />
<input type="submit" value="Modifier" />
</form>
</div>
<?php
if (isset($_GET['id']) and !empty($_GET['id'])) {


}else{
echo 'error somewhere';
}
?>
<?php include_once('foot.php'); ?>
</body>
</html>
30 changes: 30 additions & 0 deletions attributionFonctions/del.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

include_once('fonction.class.php');
include_once('fonction.dao.php');
include_once('agent.class.php');
include_once('agent.dao.php');
if(isset($_GET['id']) and !empty($_GET['id'])) {

$fdao=new FonctionDAO();
$fdao->sup($_GET['id']);

//header('Location: ../vue/service.php');


} else {
echo 'Erreur quelque part';
}

if(isset($_GET['id_agent']) and !empty($_GET['id_agent'])) {

$adao=new AgentDAO();
$adao->delete($_GET['id_agent']);

//header('Location: ../vue/service.php');


} else {
echo 'Erreur quelque part';
}
?>
12 changes: 12 additions & 0 deletions attributionFonctions/del_tache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
require_once('tache.dao.php');

if (isset($_GET['id']) and !empty($_GET['id'])) {

$tdao = new TacheDAO();
$tdao->supprimer($_GET['id']);
header('Location: taches.php');
}else{
echo 'error on page del_tache.php';
}
?>
4 changes: 3 additions & 1 deletion attributionFonctions/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
require_once('fonction.dao.php');
require_once('agent.class.php');
require_once('agent.dao.php');
require_once('tache.dao.php');

$fdao = new FonctionDAO();
$lf = $fdao->getAllFonction();
$adao = new AgentDAO();
$la = $adao->getAllAgent();
$tdao = new TacheDAO();

echo '<table>';
echo '
Expand Down Expand Up @@ -88,7 +90,7 @@
break;
}
}
echo '<td></td>';
echo '<td>'.$tdao->nombreTache($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
Binary file added attributionFonctions/interro_1.docx
Binary file not shown.
Binary file added attributionFonctions/interro_1.pdf
Binary file not shown.
Binary file added attributionFonctions/interro_2.pdf
Binary file not shown.
Loading