Your IP : 216.73.216.65


Current Path : /home/ataenra/www/ATA/INTRANET/Admin/
Upload File :
Current File : /home/ataenra/www/ATA/INTRANET/Admin/agcchoix.php

<?php

//RECUP DES INFORMATIONS SUR TABLE chantier



    //Tableau de tous les projets en cours

    $list1 = $dbco->prepare("SELECT * FROM dossier D JOIN client C ON D.IDclient=C.IDc WHERE D.Etat = 'En preparation'"); 

    $list1->execute();



    //Tableau des projets en attente sonergia

    $list2 = $dbco->prepare("SELECT * FROM dossier D JOIN client C ON D.IDclient=C.IDc WHERE D.Etat IN ('ChantierP', 'ChantierC', 'ChantierT', 'A receptionner')"); 

    $list2->execute();



    //Tableau des chantiers poses

    $list3 = $dbco->prepare("SELECT * FROM dossier D JOIN client C ON D.IDclient=C.IDc WHERE  Etat = 'Termine'"); 

    $list3->execute();

 

    //Tableau des projets archives

    $list4 = $dbco->prepare("SELECT * FROM dossier D JOIN client C ON D.IDclient=C.IDc WHERE  Etat = 'Archive'"); 

    $list4->execute();







?>



<!-- DOCUMENT HTML A AFFICHER-->



<!DOCTYPE html>

    <html lang="en">

    <head>

        <title>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/Admin/css/agcom.css" rel="stylesheet" type="text/css">

    </head>



    <body>

   

    <div class="containerPage">

    <div class="containerTitre">

            <div class="row" >

                <div class="col-md-2">

	    		<img src="./ATA/INTRANET/Outils/required/ATA_logo_horiz.jpg" alt="ISO" width=120% class="img-responsive" />

                </div>   

                <div class="col-md-8">

				<span class="align-middle">ADMIN GESTION CHANTIER</span>

                </div> 

                <div class="col-md-2">

                <a href="index.php/hadm" title="">

	            <img alt="HOME" src="./ATA/INTRANET/Outils/required/home1.png" alt="ISO" width=30% class="img-responsive" class="align-right"/> </a>  

                    

                </div>

                

	         </div>	

	    </div>

            <form method="post" autocomplete="off">

            <div class="container1">

                <div class="table-responsive">

                        <h5 class="btn-lg btn-info">CHANTIER A PREPARER (Documents / Materiel / Fournitures / Plannification)</h5>

                        <div style="overflow-x: hidden; overflow-y: scroll; width: 100%; height: 176px;">

                        <table class="table table-condensed" border="0">

                        <thead>

                        <tr>

                            <th>DATE</th>

                            <th>ID</th>

                            <th>AF</th>

                            <th>Type</th>  

                            <th>COMMANDE MATERIEL</th> <!--A realiser / +info dans commande / si validation => "Commandé le DATE" / passe Etat en :"En preparation"--> 

                            <th>PREPARATION CHANTIER</th> <!--A realiser / +info dans preparation / si validation => "Préparé le DATE" / passe Etat en :"A planifier"-->

                            <th>PLANIFICATION</th> <!--Bulle avec numero de télephone / au click passer sur page de plannification / "planifié le DATE" / Etat en "A poser" -->

                            <th>DOCUMENTS CHANTIER</th> <!--Bulle GENERER DOCUMENTS lien vers page d'affichage / VALIDER / passe Etat en :"A preparer"-->

                        </tr>

                        </thead>



                        <tbody>

                        <?php while ($R1 = $list1->fetch(PDO::FETCH_OBJ)) { ?>

                           <!--recuperer les infos dans la table du projet avec son nom et l'ID stocké dans dossier-->

                          

                        <tr>

                            <?php $soumis1 = $R1->DateCreation; $dateTime1 = new DateTime($soumis1); ?>

                            <td><?php echo $dateTime1->Format('d-m-Y'); ?></td>

                            <td><?php echo $R1->ID; ?></td>

                            <td><?php echo $R1->user; ?></td>

                            <td><?php echo $R1->typeprojet; ?></td>

                            <td>

                                <?php if($R1->Etatprep=="A commander") {echo '<a class="btn btn-danger" href="./ATA/INTRANET/Admin/commande.php?ID='.$R1->ID.'">A commander</a>'; }?>

                                <?php if($R1->Etatprep=="A preparer"||$R1->Etatprep=="A planifier"||$R1->Etatprep=="Termine"||$R1->Etatprep=="A recevoir") {$Commande1 = $R1->DateCommande; $dateTime2 = new DateTime($Commande1); echo '<a class="btn btn-info">Commandé le '.$dateTime2->format('d-m-Y').'</a>'; }?></td> 

                            <td>

                                <?php if($R1->Etatprep=="A recevoir") { echo '<a class="btn btn-warning">ATTENTE MATERIEL</a>';} ?>
                                <?php if($R1->Etatprep=="A preparer") {echo '<a class="btn btn-danger" href="./ATA/INTRANET/Admin/pointage.php?ID='.$R1->ID.'">A preparer</a>';} ?>

                                <?php if($R1->Etatprep=="A planifier"||$R1->Etatprep=="Termine") { $Prepa1 = $R1->DatePreparation; $dateTime3 = new DateTime($Prepa1); echo '<a class="btn btn-info" >Prepare le '.$dateTime3->format('d-m-Y').'</a>';} ?></td>



                            <td><?php if($R1->Etatprep=="A planifier") {echo '<a class="btn btn-warning" href="./ATA/INTRANET/Admin/planification.php?ID='.$R1->ID.'">A planifier '.$R1->NumP.'</a>';} ?>

                                <?php if($R1->Etatprep=="Termine") { $Plani1 = $R1->DatePlanification; $dateTime4 = new DateTime($Plani1);echo '<a class="btn btn-info">Planifié le '.$dateTime4->format('d-m-Y').'</a>';} ?></td>

                                                                                             

                            

                                <td><?php 

                                $files = '../JOOMLA/ATA/FICHIERS/'.$R1->ID.'/Documents/dossier'.$R1->ID.'.pdf';

                                $check = @fopen($files, 'r');

                                if((!$check)&&($R1->Etatprep!="A planifier")){ echo '<a class="btn btn-warning">PREPARATION NECESSAIRE</a>';}

                                elseif((!$check)&&($R1->Etatprep=="Termine")){ echo '<a class="btn btn-primary" href="./ATA/INTRANET/GenPDF/4Dossierclient/genpdfdossier.php?ID='.$R1->ID.'">GENERER</a>';}

                                if($check){echo '<a class="btn btn-primary" href="./ATA/FICHIERS/'.$R1->ID.'/Documents/dossier'.$R1->ID.'.pdf" download="">TELECHARGER</a>';} ?></td>

                            

                            </tr>

                        </tbody>              

                        <?php } ?>



                    </table>

                    </div>

                </div>

            </div>

            

            <div class="container1">

                <div class="table-responsive">

                        <h5 class="btn-lg btn-warning"> CHANTIERS EN COURS (Planifiés / En cours / Poses / A receptionner )</h5>

                        <div style="overflow-x: hidden; overflow-y: scroll; width: 100%; height: 176px;">

                        <table class="table table-condensed" border="0">

        

                        <tr>

                            

                            <th>ETAT</th>

                            <th>Date Devis</th>

                            <th>ID</th>

                            <th>Commercial</th>

                            <th>Code Postal</th>

                            <th>Type</th>

                            <th>Planifie le</th>

                            <th>Termine le</th>

                            <th>Equipe</th>

                            <th>Action</th>

                        </tr>



                        <?php while ($R2 = $list2->fetch(PDO::FETCH_OBJ)) {?>

                            <?php $proj2 = $dbco->prepare("SELECT * FROM $R2->tableprojet WHERE IDp = $R2->IDprojet"); 

                                  $proj2->execute(); 

                                  $P2 = $proj2->fetch(PDO::FETCH_OBJ)?>

                        <tr>

                            <?php $soumis2 = $R2->DateCreation; $dateTime5 = new DateTime($soumis2); ?>

                            

                            <td><?php if($R2->Etat=="Chantier"){echo '<a class="btn btn-info">Materiel en commande</a>';} ?>

                                <?php if($R2->Etat=="En preparation"){echo '<a class="btn btn-info">En preparation</a>';} ?>

                                <?php if($R2->Etat=="ChantierP"){echo '<a class="btn btn-info">Chantier Panifie</a>';} ?>

                                <?php if($R2->Etat=="ChantierC"){echo '<a class="btn btn-info">Chantier en cours</a>';} ?>

                                <?php if($R2->Etat=="ChantierT"){echo '<a class="btn btn-info">Chantier en finalisation</a>';} ?>

                                <?php if($R2->Etat=="A receptionner"){echo '<a class="btn btn-danger">A RECEPTIONNER</a>';} ?>

                                <?php if($R2->Etat=="Termine"){echo '<a class="btn btn-success">TERMINE</a>';} ?></td>

                            <td><?php echo $dateTime5->Format('d-m-Y'); ?></td>

                            <td><?php echo $R2->ID; ?></td>

                            <td><?php echo $R2->user; ?></td>

                            <td><?php echo $R2->CodePC; ?></td>

                            <td><?php echo $R2->typeprojet; ?></td>

                            <?php $soumis3 = $R2->DatePlanification; $dateTime6 = new DateTime($soumis3); ?>

                            <td><?php echo $dateTime6->Format('d-m-Y'); ?></td>

                            <td><?php if($R2->Etat == 'ChantierT'){ 

                                  $soumis4 = $R2->DateFinalisation; $dateTime7 = new DateTime($soumis4);

                                  echo "<td>".$dateTime7->Format('d-m-Y')."</td>";} ?></td>

                            <td><?php echo $P2->EQ; ?></td>

                            <td><?php 

                                $files = '../JOOMLA/ATA/FICHIERS/'.$R2->ID.'/Documents/dossier'.$R2->ID.'.pdf';

                                $check = @fopen($files, 'r');

                                if((!$check)&&($R2->Etatprep=="A planifier")){ echo '<a class="btn btn-warning">PREPARATION NECESSAIRE</a>';}

                                elseif((!$check)&&($R2->Etatprep=="Termine")){ echo '<a class="btn btn-primary" href="./ATA/INTRANET/GenPDF/4Dossierclient/genpdfdossier.php?ID='.$R2->ID.'&Tp='.$R2->tableprojet.'&Tm='.$P2->tablemateriel.'">GENERER</a>';}

                                if(($check)&&($R2->Etat =="ChantierP")) {echo '<a class="btn btn-primary" href="./ATA/FICHIERS/'.$R2->ID.'/Documents/dossier'.$R2->ID.'.pdf" download="">TELECHARGER</a>';} 

                                if(($check)&&($R2->Etat =="ChantierC")) {echo '<a class="btn btn-info" >EN COURS</a>';} 

                                if(($check)&&($R2->Etat =="ChantierT")) {echo '<a class="btn btn-info" >TERMINE</a>';} 

                                if($R2->Etat=="A receptionner"){echo '<a class="btn btn-warning" href="./ATA/INTRANET/admin/reception.php?ID='.$R2->ID.'&T=Oui">Finaliser avec client </a>';} 

                                ?></td>

                                                               

                        </tr>

                        <?php } ?>

                        </table>

                        </div>

                </div>

            </div>



            <div class="container1">

                <div class="table-responsive">

                        <h5 class="btn-lg btn-success"> CHANTIER TERMINES (Facture Finale / Pointage Reglement / Generation DIU )</h5>

                        <div style="overflow-x: hidden; overflow-y: scroll; width: 100%; height: 176px;">

                        <table class="table table-condensed" border="0">

        

                        <tr>

                            <th>Date Demarrage</th>

                            <th>ID</th>

                            <th>Commercial</th>

                            <th>Nom</th>

                            <th>Code Postal</th>

                            <th>Type</th>

                            <th>Etat</th>

                            <th>Action</th>

                        </tr>



                        <?php while ($R3 = $list3->fetch(PDO::FETCH_OBJ)) {?>



                        <tr>

                            <?php $soumis3 = $R3->DateDemarrage; $dateTime7 = new DateTime($soumis3); ?>

                            <td><?php echo $dateTime7->Format('d-m-Y'); ?></td>

                            <td><?php echo $R3->ID; ?></td>

                            <td><?php echo $R3->user; ?></td>

                            <td><?php echo $R3->nom; ?></td>

                            <td><?php echo $R3->CodeP; ?></td>

                            <td><?php echo $R3->typeprojet; ?></td>    

                            <td><?php echo $R3->Etat; ?></td>

                            <?php   $DIU = '../JOOMLA/ATA/FICHIERS/'.$R3->ID.'/DIU/DIU'.$R3->ID.'.pdf';$checkDIU = @fopen($DIU, 'r');

                                    $facture = '../JOOMLA/ATA/FICHIERS/'.$R3->ID.'/Facture/Facture.'.$R3->ID.'.pdf';$checkFact = @fopen($facture, 'r');

                            ?>

                            <td>

                                <?php if(($R3->Etat=="Termine")&&(!$checkFact)) {echo '<a class="btn btn-warning" href="./ATA/INTRANET/admin/upfacture.php?ID='.$R3->ID.'">UP FACTURE</a>';} ?>

                                <?php if(($R3->Etat=="Termine")&&(!$checkDIU)&&($checkFact)&&($R3->EtatAides=="Valide")) {echo '<a class="btn btn-success" href="./ATA/INTRANET/GenPDF/3Sonergia/genpdfsonergiafinal.php?ID='.$R3->ID.'">FINALISER SONERGIA</a>';} ?>

                                <?php if(($R3->Etat=="Termine")&&(!$checkDIU)&&($checkFact)&&($R3->EtatAides=="Dossier termine")||($R3->EtatAides=="Client")) {echo '<a class="btn btn-success" href="./ATA/INTRANET/GenPDF/8DIU/genpdfDIU.php?ID='.$R3->ID.'&Tp='.$R3->tableprojet.'">GENERER DIU</a>';} ?>

                                <?php if(($R3->Etat=="Termine")&&($checkDIU)) {echo '<a class="btn btn-success" href="./ATA/FICHIERS/'.$R3->ID.'/DIU/DIU'.$R3->ID.'.pdf" download="">DOSSIER INTERV ULTERIEUR</a>';} ?></td>                          

                        </tr>

                        <?php } ?>

    

                    </table>

                    </div>

                </div>

            </div>

            

            <div class="container1">

                <div class="table-responsive">

                        <h5 class="btn-lg btn-primary"> CHANTIER ARCHIVES (Apres signature DIU)</h5>

                        <div style="overflow-x: hidden; overflow-y: scroll; width: 100%; height: 176px;">

                        <table class="table table-condensed" border="0">

        

                        <tr>

                            <th>Date Demarrage</th>

                            <th>ID</th>

                            <th>Commercial</th>

                            <th>Nom</th>

                            <th>Code Postal</th>

                            <th>Type</th>

                            <th>Sonergia</th>

                            <th>Devis</th>

                            <th>Etat</th>

                            <th>Action</th>

                        </tr>



                        <?php while ($R4 = $list4->fetch(PDO::FETCH_OBJ)) {?>



                        <tr>

                            <?php $soumis4 = $R4->DateD; $dateTime8 = new DateTime($soumis4); ?>

                            <td><?php echo $dateTime8->Format('d-m-Y'); ?></td>

                            <td><?php echo $R4->ID; ?></td>

                            <td><?php echo $R4->user; ?></td>

                            <td><?php echo $R4->nom; ?></td>

                            <td><?php echo $R4->CodeP; ?></td>

                            <td><?php echo $R4->TypeF; ?></td>

                            <td><?php echo $R4->EtatAides; ?></td>

                            <td><?php echo $R4->Devis; ?></td>

                            <td><?php echo $R4->Etat; ?></td>

                            <?php   $files = '../JOOMLA/ATA/FICHIERS/'.$R4->ID.'/DIU/DIU'.$R4->ID.'.pdf';$check = @fopen($files, 'r');?>

                            <td>

                                <?php if(($R4->Etat=="Archive")&&($check)) {echo '<a class="btn btn-success" href="./ATA/FICHIERS/'.$R4->ID.'/DIU/DIU'.$R4->ID.'.pdf" download="">DOSSIER INTERV ULTERIEUR</a>';} ?></td>                          

                        </tr>

                        <?php } ?>

    

                    </table>

                    </div>

                </div>

            </div>







            </form>

        </div>

    </body>

</html>