";
echo "window.location.replace(\"./index.html\")";
echo "";
exit;
}
$thisDate = date_create();
$thisTimestamp = date_timestamp_get($thisDate);
if( isset($_SESSION["timestamp"]) ) {
$oldTimestamp=$_SESSION["timestamp"];
$diff = $thisTimestamp - $oldTimestamp;
if( $diff >= (60*5) ) {
echo "";
exit;
}
echo "diff=" . $diff . "
";
}
$_SESSION["timestamp"] = $thisTimestamp;
var_dump($_SESSION);
$mode = "ADD"; // ADD,MODIFY,DELETE
$desc = "This will create a new Info posting.";
$id = 0;
$thisInfo = null;
$val = null;
if( isset( $_GET['mode'] ) ) {
$mode = $_GET['mode'];
}
if( $mode == "DELETE" ) {
// del mode
echo "DELETE MODE";
// must have row id to fill form with
if( isset( $_GET['id'] )) {
$id = $_GET['id'];
}
if( $id == null ) { // is error, return to home page
echo "";
}
$thisInfo = fetchInfoTable( $id );
var_dump( $thisInfo );
if( count( $thisInfo ) < 1 ) { // didn't find given row
echo "";
}
$desc = "This will DELETE an exisitng Info posting.";
} else if( $mode == "MODIFY" ) {
// edit mode -> del info + add info
// must have row id to fill form with
if( isset( $_GET['id'] )) {
$id = $_GET['id'];
}
if( $id == null ) { // is error, return to home page
echo "";
}
$thisInfo = fetchInfoTable( $id );
if( count( $thisInfo ) < 1 ) { // didn't find given row
echo "";
}
$desc = "This will MODIFY an exisitng Info posting.";
} else {
// add mode
$thisInfo[0] = array( "0", "Title", "default.png", "info", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec facilisis sem, et luctus est. Donec nec tortor erat." );
}
?>