rmClient.php 1.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Insert Client </title>	
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
      <?php

        include("connexion.php");

        $client = $_POST['idClient'];
        $animal = $_POST['idAnimal'];
        $traitement = $_POST['idTraitement'];
        try
	{
       		$vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
	} 
	catch(PDOException $e)
	{
		echo "Erreur de la connexion '$e'";
	}

        if($client != "")
        {
          if ($animal != "")
          {
            if ($traitement != "")
            {
			$vSql ="DELETE FROM Animal where idTraitement = '$traitement';"; 
			try
			{
				$vSt = $vConn->prepare($vSql);
				$vSt->execute();
			} 
			catch(PDOException $e)
			{
				echo "Erreur en l'affichage des clients '$e'";
			}

			$vSql ="DELETE FROM Animal where idAnimal = '$animal';"; 
			try
			{
				$vSt = $vConn->prepare($vSql);
				$vSt->execute();
			} 
			catch(PDOException $e)
			{
				echo "Erreur en l'affichage des clients '$e'";
			}


			$vSql ="DELETE FROM Client where idClient = '$client';";   
			try
			{
		       		$vSt = $vConn->prepare($vSql);
				$vSt->execute();
			} 
			catch(PDOException $e)
			{
				echo "Erreur en le remove du client '$e'";
			}

			
			echo "Succès dans l'effacement";

            }
            else
             echo "Il faut de donner le traitement";
          }
          else
           echo "Il faut de donner l'animal";
        }
        else
         echo "Il faut de donner le client";
       ?>


  </body>
</html>