Your IP : 216.73.216.65


Current Path : /home/ataenra/www/ATA/INTRANET/Tech/
Upload File :
Current File : /home/ataenra/www/ATA/INTRANET/Tech/Tgcchoix.php

<?php



if($Tech[15] == 15){$T = "eq1";}elseif($Tech[16] == 16){$T = "eq2";}elseif($Tech[17] == 17){$T = "eq2";}



//RECUP DES INFORMATIONS SUR TABLE chantier

    //Tableau des chantiers planifies par equipe

    $list1 = $dbco->prepare("SELECT * FROM dossier D WHERE  D.Etat = 'chantierP' "); 

    $list1->execute();



    //Tableau1 des chantiers en cours par equipe

    $list2 = $dbco->prepare("SELECT * FROM dossier WHERE Etat IN ('ChantierC', 'ChantierT') "); 

    $list2->execute();



    //Tableau des chantiers termines par equipe

    $list3 = $dbco->prepare("SELECT * FROM dossier WHERE  Etat = 'Termine'  LIMIT 8"); 

    $list3->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/Outils/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">TECH GESTION CHANTIER</span>

                </div> 

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

                <a href="index.php/htech" 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 PLANIFIES</h5>

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

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

                        <thead>

                        <tr>

                            <th>ID</th>

                            <th>Code Postal</th>

                            <th>Type</th>  

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

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

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

                            <th>ACTION</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)) {

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

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

                            $proj1 = $dbco->prepare("SELECT * FROM ".$R1->tableprojet." WHERE IDp = ".$R1->IDprojet.""); 

                            $proj1->execute(); 

                            $P1 = $proj1->fetch(PDO::FETCH_OBJ);

                            if(($check)&&($P1->EQ == $T)){

                            ?>



                        <tr>

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

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

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

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

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

                            <td><?php echo $P1->JChantier; ?></td>

                            <td><?php 

                                

                               

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

                            <td> <?php if($R1->Etat=="ChantierP"){echo  '<a class="btn btn-danger" href="./ATA/INTRANET/Tech/start.php?ID='.$R1->ID.'">START</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 </h5>

                        

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

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

                          $proj2->execute(); 

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

                          if(($P2->EQ == $T)){

                            

                            if(($R2->typeprojet == "PAC_AE_S"||$R2->typeprojet == "PAC_AE_H")&&($P2->TypePac == "GAZ")){require "tableauGAZ.php";}

                        elseif(($R2->typeprojet == "PAC_AE_M")||($P2->TypePac =="EAU")){require "tableauEAU.php";}elseif(($R2->typeprojet == "PAC_AA_S"||$R2->typeprojet == "PAC_AA_MS")&& ($P2->TypePac =="GAZ")){require "tableauSPLIT.php";}

                        elseif(($R2->typeprojet == "PAC_AA_G" )&&($P2->TypePac =="Gainable")){require "tableauGainable.php";}?>         

    

    

                       <?php } } ?> 

                </div>

            </div>



            <div class="container1">

                <div class="table-responsive">

                        <h5 class="btn-lg btn-success"> CHANTIER TERMINES </h5>

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

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

        

                        <tr>

                            <th>ID</th>    

                            <th>Date Demarrage</th>

                            <th>Date Cloture</th>

                            <th>NB Prevu</Th>

                            <th>Realise en</Th>

                            <th>Type</th>

                           

                        </tr>



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

                                ?>

                            

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

                                $proj3->execute(); 

                                $P3 = $proj3->fetch(PDO::FETCH_OBJ);

                                if(($P3->EQ == $T)){?>

                        <tr>

                            

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

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

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

                                <?php $soumis4 = $R3->DateFinalisation; $dateTime4 = new DateTime($soumis4); ?>

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

                            <td><?php echo ''.$P3->JChantier.' Jours'; ?></td>

                            <td><?php $date1 = new DateTime($R3->DateDemarrage);

                                      $date2 = new DateTime($R3->DateFinalisation);

                                      $diff = $date2->diff($date1)->format("%a");

                                      echo ''.$diff.' Jours'; ?></td>

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

                           

                                                               

                        </tr>

                        <?php } } ?>

    

                    </table>

                        </div>

                </div>

            </div>

            

            </form>

        </div>

    </body>

</html>