<?php
session_start();
require('../45789417/ref4780.php');
if (!isset($_SESSION['userid'])) {
  echo "<script language='Javascript'> location.href='../login.php';</script>";
    exit();
  };
/* Values received via ajax */
$id = $_GET['id'];
$status = $_GET['st'];
$end_events = date("Y-m-d H:i:s");

// connection to the database
require_once('4798945.php');
 // update the records
$sql = "UPDATE se_evenement SET status=?, end_events=? WHERE id=?";
$q = $bdd->prepare($sql);
$q->execute(array($status,$end_events,$id));

echo "<script type='text/javascript'>  
window.location='view_event.php?id=$id';
</script>"

?>
