Example #1
0
<?php

$id = mysqli_real_escape_string(db_connect(), $_GET['id']);
$info = new Page();
$page = $info->page_load_id($id);
if (!empty($_POST)) {
    $title = $_POST['title'];
    $body = $_POST['body'];
    $featured = $_POST['featured'];
    $metadescription = $_POST['metadescription'];
    $metakeywords = $_POST['metakeywords'];
    $info->page_save($id, '' . $title . '', '' . $body . '', '' . $featured . '', '' . $metadescription . '', '' . $metakeywords . '');
}
?>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h1 class="page-header">Page: <?php 
echo $page['title'];
?>
</h1>
    <form class="form-horizontal" enctype="multipart/form-data" method="post" accept-charset="utf-8" action="<?php 
echo BASE_URL;
?>
/admin/pages/edit?id=<?php 
echo $id;
?>
">

        <div class="form-group">
            <label for="title" class="col-sm-2 control-label">Title</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="title" name="title" placeholder="Title" value="<?php 
Example #2
0
<?php

if (!empty($_POST)) {
    $title = $_POST['title'];
    $body = $_POST['body'];
    $featured = $_POST['featured'];
    $metadescription = $_POST['metadescription'];
    $metakeywords = $_POST['metakeywords'];
    $page_class = new Page();
    $page_class->page_save('', '' . $title . '', '' . $body . '', '' . $featured . '', '' . $metadescription . '', '' . $metakeywords . '');
}
?>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h1 class="page-header">Pages</h1>
    <form class="form-horizontal" enctype="multipart/form-data" method="post" accept-charset="utf-8" action="<?php 
echo BASE_URL;
?>
/admin/pages/add">

        <div class="form-group">
            <label for="title" class="col-sm-2 control-label">Title</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="title" name="title" placeholder="Title" required>
            </div>
        </div>

        <div class="form-group">
            <label for="body" class="col-sm-2 control-label">Body</label>
            <div class="col-sm-10">
                <textarea id="body" name="body" class="form-control" rows="3" placeholder="Body"></textarea>
                <a class="btn btn-info" href="javascript:;" onclick="unloadTiny();"><span>Remove TinyMCE</span></a>