| Current Path : /home/ataenra/www/ATA/INTRANET/Commerce/ |
| Current File : /home/ataenra/www/ATA/INTRANET/Commerce/gpchoix.php |
<?php
$com = $AF;
require "./ATA/INTRANET/Outils/co.php";
if (isset($_POST['action'])) {
$Update = $dbco->prepare('UPDATE dossier SET etat = :Etat WHERE ID = :ID');
$Update->bindvalue(':Etat','Soumis');
$Update->bindvalue('ID', $_POST['IDV']);
$Update->execute();
header("location:../index.php/comgp");
}
if($com == "Di4lz"){
//Tableau des projets en "Etude" pour le commercial connecté
$list1 = $dbco->prepare("SELECT D.DateCreation, D.ID, D.IDprojet, D.tableprojet, D.typeprojet, D.CodePC, D.PhotoI, D.DocsAides, D.EtatAides, D.PrimeATA, C.nom FROM dossier D JOIN client C ON D.IDclient = C.IDc WHERE D.Etat = 'Etude' ");
$list1->execute();
//Tableau des projets "Soumis", " En traitement" et "A signer" pour le commercial connecté
$list2 = $dbco->prepare("SELECT DateCreation, ID, IDprojet, tableprojet, typeprojet, Etat, CodePC, PhotoI, DocsAides, EtatAides, PrimeATA, nom FROM dossier D JOIN client C ON D.IDclient = C.IDc WHERE D.Etat IN ('Soumis', 'En traitement', 'A signer', 'Valide') ORDER BY ID DESC");
$list2->execute();
//Tableau des Chantiers "En cours" et "A receptionner" pour le commercial connecté
$list3 = $dbco->prepare("SELECT DateCreation, ID, IDprojet, tableprojet, typeprojet, Etat, CodePC, PhotoI, DocsAides, EtatAides, PrimeATA, nom FROM dossier D JOIN client C ON D.IDclient = C.IDc WHERE D.Etat IN ('Chantier', 'En preparation', 'ChantierP', 'ChantierC', 'ChantierT', 'A receptionner', 'Termine', 'Archive') ORDER BY ID DESC");
$list3->execute();
}
if($com != "Di4lz"){
//Tableau des projets en "Etude" pour le commercial connecté
$list1 = $dbco->prepare("SELECT D.DateCreation, D.ID, D.IDprojet, D.tableprojet, D.typeprojet, D.CodePC, D.PhotoI, D.DocsAides, D.EtatAides, D.PrimeATA, C.nom FROM dossier D JOIN client C ON D.IDclient = C.IDc WHERE D.Etat = 'Etude' AND D.user = '$com' ");
$list1->execute();
//Tableau des projets "Soumis", " En traitement" et "A signer" pour le commercial connecté
$list2 = $dbco->prepare("SELECT DateCreation, ID, IDprojet, tableprojet, typeprojet, Etat, CodePC, PhotoI, DocsAides, EtatAides, PrimeATA, nom FROM dossier D JOIN client C ON D.IDclient = C.IDc WHERE D.Etat IN ('Soumis', 'En traitement', 'A signer', 'Valide') AND D.user = '$com' ORDER BY ID DESC");
$list2->execute();
//Tableau des Chantiers "En cours" et "A receptionner" pour le commercial connecté
$list3 = $dbco->prepare("SELECT DateCreation, ID, IDprojet, tableprojet, typeprojet, Etat, CodePC, PhotoI, DocsAides, EtatAides, PrimeATA, nom FROM dossier D JOIN client C ON D.IDclient = C.IDc WHERE D.Etat IN ('Chantier', 'En preparation', 'ChantierP', 'ChantierC', 'ChantierT', 'A receptionner', 'Termine', 'Archive') AND D.user = '$com' ORDER BY ID DESC");
$list3->execute();
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<title>ATA GESTION PROJETS</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="./ATA/INTRANET/Commerce/css/agcom.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="containerPage">
<div class="containerTitre">
<div class="row" >
<div class="col-md-1">
<img src="./ATA/INTRANET/Outils/required/ATA-Logo.jpg" alt="ISO" width=100% class= />
</div>
<div class="col-md-10">
<span class="align-middle">GESTION DE VOS PROJETS</span>
</div>
<div class="col-md-1">
<a href="index.php/hcom" title="">
<img alt="HOME" src="./ATA/INTRANET/Outils/required/home1.png" alt="ISO" width=100% class="img-responsive" class="align-center"/> </a>
</div>
</div>
</div>
<form method="POST" autocomplete="off" >
<!-- -------------------TABLEAU N°1 ----------------------------------------------->
<div class="container1">
<div class="table-responsive">
<h6 class="btn-lg btn-info"> PROJETS EN CREATION </h6>
<div style="overflow-x: hidden; overflow-y: scroll; width: 100%; height: 126px;">
<table class='table table-hover table-bordered table-condensed'>
<thead>
<tr>
<th>Date</th>
<th>ID</th>
<th>Type</th>
<th>Nom</th>
<th>Code Postal</th>
<th>Simulation PDF</th>
<th>Photos Install</th>
<th>Gestion des aides</th>
<th>Docs aides</th>
<th>Action</th>
</tr>
</thead>
<?php while ($R1 = $list1->fetch(PDO::FETCH_OBJ)) {?>
<?php $proj1 = $dbco->prepare("SELECT * FROM ".$R1->tableprojet." WHERE IDp = '".$R1->IDprojet."'");
$proj1->execute();
$P1 = $proj1->fetch(PDO::FETCH_OBJ)?>
<tr>
<?php $dateS = $R1->DateCreation; $DS = new DateTime($dateS); ?>
<td><?php echo $DS->Format('d-m-Y'); ?></td>
<td><?php echo $R1->ID; ?></td>
<td><?php echo $R1->typeprojet; ?></td>
<td><?php echo $R1->nom; ?></td>
<td><?php echo $R1->CodePC; ?></td>
<?php $files = './ATA/FICHIERS/'.$R1->ID.'/Simulation/Simulation'.$R1->ID.'.pdf';$check = @fopen($files, 'r'); ?>
<td><?php if(!$check){ echo '<a class="btn btn-primary" toggle="tooltip" data-placement="top" title="Genere le fichier de simulation et envoie au client" href="./ATA/INTRANET/GenPDF/1Simulation/genpdfresultat.php?ID='.$R1->ID.'">GENERER</a>';
}if($check){echo '<a class="btn btn-primary" href="./ATA/FICHIERS/'.$R1->ID.'/Simulation/Simulation'.$R1->ID.'.pdf" download="">TELECHARGER</a>';} ?></td>
<td><?php echo $R1->PhotoI; ?></td>
<td><?php echo $R1->PrimeATA; ?></td>
<td><?php echo $R1->DocsAides; ?></td>
<td>
<?php if($R1->PhotoI=="Non")
{echo '<a class="btn btn-danger" href="./ATA/INTRANET/Commerce/photo.php?ID='.$R1->ID.'">Photos</a>';} ?>
<?php if(($R1->DocsAides=="Non")&&($R1->PrimeATA=="Oui"))
{echo '<a class="btn btn-danger" href="./ATA/INTRANET/Commerce/aides.php?ID='.$R1->ID.'">Aides</a>';} ?>
<?php if((($R1->PhotoI=="Oui")&&($R1->DocsAides=="Oui"))||(($R1->PhotoI=="Oui")&&($R1->PrimeATA=="Non")))
{ echo '<input class="btn btn-success" type="submit" name="action" value="Valider"><input type="hidden" name="IDV" value="'.$R1->ID.'">';} ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
<!-- -------------------TABLEAU N°2 ----------------------------------------------->
<div class="container1">
<div class="table-responsive">
<h6 class="btn-lg btn-warning"> PROJETS SOUMIS EN ATTENTE </h6>
<div style="overflow-x: hidden; overflow-y: scroll; width: 100%; height: 126px;">
<table class='table table-hover table-bordered table-condensed'>
<thead>
<tr>
<th>ETAT</th>
<th>Date</th>
<th>ID</th>
<th>Type</th>
<th>Nom</th>
<th>Code Postal</th>
<th>Dossier Aides</th>
<th>Action</th>
</tr>
</thead>
<?php while ($R2 = $list2->fetch(PDO::FETCH_OBJ)) {?>
<tr>
<td><?php if($R2->Etat=="Soumis"){echo '<a class="btn btn-info">Soumis</a>';} ?>
<?php if($R2->Etat=="En traitement"){echo '<a class="btn btn-warning">En traitement</a>';} ?>
<?php if($R2->Etat=="A signer"){echo '<a class="btn btn-danger">A signer</a>';} ?>
<?php if($R2->Etat=="Valide"){echo '<a class="btn btn-info">En validation</a>';} ?>
<td><?php $dateS1 = $R2->DateCreation; $DS1 = new DateTime($dateS1); ?>
<?php echo $DS1->Format('d-m-Y'); ?></td>
<td><?php echo $R2->ID; ?></td>
<td><?php echo $R2->typeprojet; ?></td>
<td><?php echo $R2->nom; ?></td>
<td><?php echo $R2->CodePC; ?></td>
<td><?php if($R2->EtatAides=="Dossier disponible"){echo '<a class="btn btn-warning">DOSSIER ENVOYE</a>';}?>
<?php if($R2->EtatAides=="Valide"){echo '<a class="btn btn-success">SONERGIA OK</a>';}?>
<?php if($R2->EtatAides=="A faire"){echo '<a class="btn btn-info" ">EN COURS</a>';}?>
<?php if($R2->EtatAides=="Client"){echo '<a class="btn btn-info" ">A la charge du client</a>';}?></td>
<td>
<?php if($R2->Etat=="A signer"){echo '<a class="btn btn-success" href="./ATA/FICHIERS/'.$R2->ID.'/Devis/DevisFinal'.$R2->ID.'.pdf" download="">DEVIS PDF</a>';} ?>
<?php if($R2->Etat=="A signer") {echo '<a class="btn btn-danger" href="./ATA/INTRANET/Admin/updevisS.php?ID='.$R2->ID.'">UP DEVIS SIGNE</a>';} ?>
<?php if($R2->Etat=="Valide") {echo '<a class="btn btn-success" href="./ATA/FICHIERS/'.$R2->ID.'/Devis/DevisValide.'.$R2->ID.'.pdf" download="">DEVIS PDF</a>';} ?>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
<!-- --------------------------- TABLEAU N°3-- ------------------- -->
<div class="container1">
<div class="table-responsive">
<h5 class="btn-lg btn-success"> CHANTIERS EN COURS</h5>
<div style="overflow-x: hidden; overflow-y: scroll; width: 100%; height: 126px;">
<table class='table table-hover table-bordered table-condensed'>
<thead>
<tr>
<th>ETAT</th>
<th>Date</th>
<th>ID</th>
<th>Type</th>
<th>Nom</th>
<th>Code Postal</th>
<th>Action</th>
</tr>
</thead>
<?php while ($R3 = $list3->fetch(PDO::FETCH_OBJ)) {?>
<tr>
<td>
<?php if($R3->Etat=="En preparation"){echo '<a class="btn btn-info">En preparation</a>';} ?>
<?php if($R3->Etat=="ChantierP"){echo '<a class="btn btn-info">Chantier Panifie</a>';} ?>
<?php if($R3->Etat=="ChantierC"){echo '<a class="btn btn-info">Chantier en cours</a>';} ?>
<?php if($R3->Etat=="ChantierT"){echo '<a class="btn btn-info">Chantier en finalisation</a>';} ?>
<?php if($R3->Etat=="A receptionner"){echo '<a class="btn btn-danger">A RECEPTIONNER</a>';} ?>
<?php if($R3->Etat=="Termine"){echo '<a class="btn btn-success">TERMINE</a>';} ?></td>
<td><?php $dateS2 = $R3->DateCreation; $DS2 = new DateTime($dateS2); ?>
<?php echo $DS2->Format('d-m-Y'); ?></td>
<td><?php echo $R3->ID; ?></td>
<td><?php echo $R3->typeprojet; ?></td>
<td><?php echo $R3->nom; ?></td>
<td><?php echo $R3->CodePC; ?></td>
<td>
<?php $files = './ATA/FICHIERS/'.$R3->ID.'/DIU/DIU'.$R3->ID.'.pdf';$check = @fopen($files, 'r');?>
<?php if($R3->Etat=="A receptionner"){echo '<a class="btn btn-warning" href="./ATA/INTRANET/admin/reception.php?ID='.$R3->ID.'&T=Oui">Finaliser avec client </a>';} ?>
<?php if(($R3->Etat=="Termine")&&(!$check)) {echo '<a class="btn btn-info">DIU EN REDACTION</a>';} ?>
<?php if(($R3->Etat=="Termine")&&($check)) {echo '<a class="btn btn-success" href="./ATA/FICHIERS/'.$R3->ID.'/DIU/DIU'.$R3->ID.'.pdf" download="">DOSSIER INTERV ULTERIEUR</a>';} ?>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</form>
</div>
</body>
</html>