You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (intval($_GET['id'])>0 && intval($_GET['dt_modified'])>0) {
$dbh = new PDO($db['driver'].':host='.$db['hostname'].';dbname='.$db['database'], $db['username'], $db['password']);
$sql = 'SELECT id,body,unix_timestamp(dt_modified) dt_modified from wiki_page where id='.intval($_GET['id']).' AND unix_timestamp(dt_modified) > '.intval($_GET['dt_modified']) ;
$rows=[];
foreach ($dbh->query($sql) as $row) {
$rows[]=$row;
}
$wrap=array('success'=>$rows);
print_r(json_encode($wrap));
}
} else if ($_GET['action']=="save") {
if (intval($_POST['id'])>0 && !empty($_POST['body'])) {
$dbh = new PDO($db['driver'].':host='.$db['hostname'].';dbname='.$db['database'], $db['username'], $db['password']);
$sql = "update wiki_page set body='".$_POST['body']."', dt_modified=now() where id=".intval($_POST['id']) ;
$dbh->query($sql);
$sql = 'SELECT id,body,unix_timestamp(dt_modified) dt_modified from wiki_page where id='.intval($_POST['id']) ;