<?php
require_once("Schedule.php");
if(isset($_POST["action"])){
$Y = $_POST["Y"];
$n = $_POST["n"];
$j = $_POST["j"];
$inicio = $_POST["Start"];
$desc = $_POST["Desc"];
$fin = $_POST["Fin"];
switch($_POST["action"]){
case "Create":
$c = new Schedule($Y, $n, $j);
$c->create($Y, $n, $j);
echo "New schedule created";
break;
case "Add":
$c = new Schedule($Y, $n, $j);
if($c->getData($Y, $n, $j)){
$c->add($inicio, $desc, $fin);
echo "New entry added";
}
break;
case "See":
$c = new Schedule($Y, $n, $j);
if($c->getData($Y, $n, $j)){
$c->see();
} else {
echo "Date does not exist";
}
break;
default:
echo "Command error";
}
}
?>
|