0) { $varRows = $c->query("SELECT * from post where id = ?", $strId); if (count($varRows) !== 1) { BootstrapRender::message("Zero or more than one row returned", "danger"); } $varRow = $varRows[0]; $strPath = $varRow["path"]; $strContent = $varRow["content"]; } if (Request::posts("path", "content")) { $strPath = Request::getPosted("path"); $strContent = Request::getPosted("content"); if ($strId == null || strlen($strId) < 1) { $c->query( "INSERT into post (author, path, content) values (?, ?, ?)", "caharkness@gmail.com", $strPath, $strContent); $strId = $c->query("SELECT * from post where rowid = last_insert_rowid()")[0]["id"]; } $c->query( "UPDATE post set path = ?, content = ?, updated = current_timestamp", $strPath, $strContent); Respond::redirect("/edit/{$strId}"); } if (strlen($strId) > 0) { $varRows = $c->query("SELECT * from post where id = ?", $strId); } ?>
"path", "label" => "Path", "value" => $strPath ]); ?> "content", "label" => "Content", "tag" => "textarea", "value" => $strContent ]); ?> [[ "label" => "Submit", "icon" => "save" ]] ]); ?>