Hello I am trying to save the value of "usraufgabenart " in the table events as “arbzaufgabe”.
Unfortunately I did not.
Is there an example to look after how it is possible? I am also looking information to have more than one $list for one sql query…
thanks
Pol
$list = new OptionsConnector($res, $dbtype);
$sql = “SELECT Id as value, CONCAT_WS(’ ',Name,Vorname,usraufgabenart) as label, Reportsto,usraufgabenart FROM mitarbeiter WHERE (Id = $my_current_user_id) OR (Id IN (SELECT Id FROM mitarbeiter WHERE Reportsto = $my_current_user_id))”;
$list->render_sql($sql,“value”,“value,label”);
$scheduler = new schedulerConnector($res, $dbtype);
$scheduler->set_options(“type”, $list);
function insert_related($action){
//Set the value, this should then insert naturally along with the rest of the data.
$newValue = date(“H:i:s”, strtotime($action->get_value(“start_date”)));
$action->set_value(“starttime”, $newValue);
$newValue = date("H:i:s", strtotime($action->get_value("end_date")));
$action->set_value("endtime", $newValue);
$newValue = date("N", strtotime($action->get_value("end_date")));
$action->set_value("inkltage", $newValue);
}
//$scheduler->render_table(“events”,“event_id”,“start_date,end_date,event_name,details,starttime,test”);
$scheduler->event->attach(“beforeProcessing”,“insert_related”); //After saving
$scheduler->render_sql(“Select * FROM events WHERE (User = $my_current_user_id) OR (User IN (SELECT Id FROM mitarbeiter WHERE Reportsto = $my_current_user_id))”,“event_id”,“start_date,end_date,event_name,details,starttime,endtime,pause,inkltage,test,User,arbzaufgabe,arbzart”);
} else { //wenn nicht eigeloggt dann an login weiterleiten
header(“Location: login.php”);
}