Exemplo n.º 1
0
<?php

session_start();
require_once "../codebase/connector/scheduler_connector.php";
$res = mysql_connect("localhost", "root", "");
mysql_select_db("calendar");
// $conn = new SchedulerConnector($res);
$details = new DataConnector($res);
$details->configure("cus", "c_id", "c_id,c_fname");
$conn = new SchedulerConnector($res);
$conn->mix("cus", $details, array("c_id" => "c_id"));
// function my_update($data){
//     $data->add_field("c_id",1);
//  $data->set_value("c_id","10");
//     //will be included in update processing
// }
// $conn->event->attach("beforeUpdate","my_update");
$conn->enable_log("temp.log");
$c_id = $_SESSION["login"];
$type = $_GET['type'];
$eid = $_GET['eid'];
// $conn->render_table("bookevent","event_id","start_date,end_date,event_name");
function insert_session($action)
{
    $action->add_field("cid", $_SESSION["login"]);
    $action->add_field("eid", $_GET["eid"]);
}
$conn->event->attach("beforeProcessing", "insert_session");
// $conn->event->attach("Select","select * from bookevent where c_id={c_id}");
// $conn->render_table("bookevent","event_id","start_date,end_date,event_name,cid");
// $conn->render_sql("select * from bookevent where c_id = ".$c_id." AND `start_date` >= '2015-07-08 00:00:00' AND `end_date` <= '2015-07-11 00:00:00' ","event_id","start_date,end_date,event_name,rec_type,event_pid,event_length,details,event_location,lat,lng");