ob_start();
include '../includes/db_func.php';
include 'includes/classes/Admin.php';
include 'check_login.php';
include 'includes/classes/event.php';
if($_POST['event_upload'])
{
$name = $_POST['name'];
$target_path = "$web_root/$event_path/";
$path_parts = pathinfo(basename($_FILES['uploadedfile']['name']));
$type = $_FILES['uploadedfile']['type'];
$upload_file_name = time() . "." . $path_parts['extension'] ;
$target_path = $target_path . $upload_file_name;
# echo $target_path."
";
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
{
# echo "in";
$params = array('thumbnail_path' => $upload_file_name,'path' => $upload_file_name,'name'=>$name,'type'=>$type);
$event = new Event($params);
$event->save();
}
else
{
# echo "out";
}
header('location:events.php');
}
if($_POST['cancel_event'])
{
header('location:events.php');
}
$header_links = "Eevents / Add ";
include 'includes/header.php';
include 'includes/side_bar.php';
include 'includes/center_start.php';
?>