Your IP : 216.73.216.65


Current Path : /home/ataenra/www/ATA/INTRANET/Commerce/
Upload File :
Current File : /home/ataenra/www/ATA/INTRANET/Commerce/rdv.php

<?php


$com = $_SESSION['AF']; 
//RECUP DES INFORMATIONS SUR TABLE chantier
    //Tableau des chantiers planifies par equipe
    $list1 = $dbco->prepare("SELECT * FROM rdvclient WHERE  User = '$com' AND ETAT IN ('PRDV', 'RDV OK', 'Projet')"); 
    $list1->execute();




?>



<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="UTF-8">
  <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="css/bootstrap-4.4.1.css" rel="stylesheet">-->
  <link href="./ATA/INTRANET/Outils/css/Profil.css" rel="stylesheet" type="text/css">
  <title>FORMULAIRE POINTAGE</title>
</head>

<body>

	<div class="containerPage"> 
    <div class="containerTitre">
    <div class="row">
            <div class="col-md-2-l">
            <img src="./ATA/INTRANET/Outils/required/ATA-Logo.jpg" alt="ISO" width=30% class= />
            </div>   
            <div class="col-md-8">
            <span class="align-middle">GESTION DE VOS RDV</span>
            </div> 
            <div class="col-md-2-r">
            <a href="index.php/hcom" title="">
            <img alt="HOME" src="./ATA/INTRANET/Outils/required/home1.png" alt="ISO" width=30% /> </a>
            </div>
            </div>
    </div>
 
    <div class="container1">
    <form method="post" autocomplete="off" >


<?php 
if(isset($_POST['Projet'])){

    //Update de la base rdv 
    $UP3 = $dbco->prepare("UPDATE rdvclient set ID = :id, Etat = :Etat where ID = :id");
    $UP3->bindvalue('id',$_POST['IDRDV']);
    $UP3->bindvalue('Etat','Projet');
    $UP3->execute();
    
    header("location: ../../../index.php/hcom");
    header("refresh: 0.1");
    }

if(isset($_POST['DelRDV'])){

        //Update de la base rdv 
        $UP3 = $dbco->prepare("UPDATE rdvclient set ID = :id, Etat = :Etat where ID = :id");
        $UP3->bindvalue('id',$_POST['IDRDV']);
        $UP3->bindvalue('Etat','DEL');
        $UP3->execute();
        
        header("location: ../../../index.php/hcom");
        header("refresh: 0.1");
        }

if(isset($_POST['PriseRDV'])){

//Update de la base rdv 
$UP3 = $dbco->prepare("UPDATE rdvclient set ID = :id, Etat = :Etat, Adresse = :Adresse, CodeP = :CodeP, Ville = :Ville, DateRDV =:DateRDV where ID = :id");
$UP3->bindvalue('id',$_POST['IDRDV']);
$UP3->bindvalue('Etat','RDV OK');
$UP3->bindvalue('Adresse',$_POST['ARDV']);
$UP3->bindvalue('CodeP',$_POST['CPRDV']);
$UP3->bindvalue('Ville',$_POST['VRDV']);
$UP3->bindvalue('DateRDV',$_POST['DateRDV']);
$UP3->execute();

header("location: ../../../index.php/hcom");
header("refresh: 0.1");
}

if(isset($_POST['PRDV'])){
echo '<div class="Row"';
echo '<div class="col-md-3"><br><p> Date RDV de Mr '.$_POST["NRDV"].': <input class="form-control" type="date" required name="DateRDV" value="" />';
echo '<p> Adresse : <input class="form-control" type="Text" required name="ARDV" value="'.$_POST['ARDV'].'" />';
echo '<p> Code Postal : <input class="form-control" type="Text" required name="CPRDV" value="'.$_POST['CPRDV'].'" />';
echo '<p> Ville : <input class="form-control" type="Text" required name="VRDV" value="'.$_POST['VRDV'].'" />';
echo '<input type="hidden" name="IDRDV" value="'.$_POST["IDRDV"].'" />';

echo '<br><input class="btn btn-success" type="Submit" name="PriseRDV" value="Valider RDV" /><br><br>';
echo '</div>';
}
?>



	
		    
                
            
                     <h5><strong>LISTE DES RENDEZ-VOUS</strong></h5>
                    
                  
                     <table class='table table-hover table-bordered table-condensed'>
                            <thead>
                            <tr>
                            <th>Date</th>
                            <th>Etat</th>
                            <th>Nom</th>
                            <th>Prenom</th>
                            <th>Numero</th>
                            <th>Adresse</th>
                            <th>Code Postal</th>
                            <th>Ville</th>
                            <th>Date RDV</th>
                            <th>Action</th>
                            </tr>
                            </thead>

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

                            <tr>
                            <?php $datec = $R1->DateC; $DT = new DateTime($datec); ?>
                            <td><?php echo $DT->Format('d-m-Y'); ?></td>
                            <td><?php echo $R1->Etat; ?></td>
                            <td><?php echo $R1->Nom; ?></td>
                            <td><?php echo $R1->Prenom; ?></td>
                            <td><?php echo $R1->Num; ?></td>
                            <td><?php echo $R1->Adresse; ?></td>
                            <td><?php echo $R1->CodeP; ?></td>
                            <td><?php echo $R1->Ville; ?></td>
                            <td><?php echo $R1->DateRDV; ?></td>
                            <td>
                                <?php if($R1->Etat =="PRDV")
{echo '<input class="btn btn-danger" type="Submit" name="PRDV" value="Prendre RDV" />';
echo '<input type="hidden" name="NRDV" value="'.$R1->Nom.'" />';
echo '<input type="hidden" name="IDRDV" value="'.$R1->ID.'" />';
echo '<input type="hidden" name="ARDV" value="'.$R1->Adresse.'" />';
echo '<input type="hidden" name="CPRDV" value="'.$R1->CodeP.'" />';
echo '<input type="hidden" name="VRDV" value="'.$R1->Ville.'" />';
}elseif($R1->Etat =="RDV OK"){echo '<input class="btn btn-warning" type="Submit" name="Projet" value="Projet" />';
echo '<input type="hidden" name="IDRDV" value="'.$R1->ID.'" />';
echo '<input class="btn btn-danger" type="Submit" name="DelRDV" value="Supprimer" />';
} 

                    ?></td>


                                                               
                            </tr>
                        <?php } ?>
                        </table>   








                   

           
                   
                    
                </form>
                  
    </div>   
	

</body>
</html>