<?php session_start();
if(!empty($_SESSION['admin_connect_id']))
{ require('../../config.php');

date_default_timezone_set('Africa/Algiers');
$d_aj=date('Y-m-d H:i:s');
$heure=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['heure']))) ;

$unite=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['unite']))) ;
$destinations=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['destinations']))) ;
$parcours=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['parcours']))) ;
$client=mysqli_real_escape_string($con,htmlspecialchars(trim($_POST['client']))) ;



$added_by=$_SESSION['admin_connect_id'];

$sql2 = "INSERT INTO planning (plndest,plnclient,plnheure,plnunite,plnpar,plnadded_by,plncreated_at,plnupdated_at) VALUES 
('$destinations','$client','$heure','$unite','$parcours','$added_by','$d_aj','$d_aj')";

  if(mysqli_query($con,$sql2)){
  echo 1;
  } else {
echo 0;
 }

    }

?>