/* -----------------------------------------------------------------------------
Returns the HTML of a labeled input text element with Bootstrap class names
Input:
Name of element (string)
Text label of element (string)
Value of element (string)
Is the element required (boolean)
Output: HTML text (string)
----------------------------------------------------------------------------- */
function return_input_text($name, $label, $value='', $required=false) {
if ($required) $req = 'required';
else $req = '';
return '
';
}
/* -----------------------------------------------------------------------------
Echos return_input_text
----------------------------------------------------------------------------- */
function echo_input_text($name, $label, $value) {
echo return_input_text($name, $label, $value);
}
/* -----------------------------------------------------------------------------
Returns the HTML of a form for inserting rows into the pages table
Input: Previously submitted values (associative array)
Output: HTML text (string)
----------------------------------------------------------------------------- */
function return_page_form($values) {
return '
';
}
/* -----------------------------------------------------------------------------
Echos return_page_form
----------------------------------------------------------------------------- */
function echo_page_form($values) {
echo return_page_form($values);
}
/* -----------------------------------------------------------------------------
Inserts a new row into the pages table.
Input: Posted values (associative array)
Output: None
----------------------------------------------------------------------------- */
function insert_page($values) {
$pageid = $values['pageid'];
$title = $values['title'];
$content = $values['content'];
$parent = $values['parent'];
$sql = "INSERT INTO ea30brei_pages (pageid, title, content, parent) VALUES ('$pageid','$title','$content','$parent')";
run_query($sql);
}
?>