예제 #1
0
<?php

include '../../inc/config.php';
$session->auth_or_redirect('admin', '/', true);
$action = $_GET['f'];
$todayDate = date('Y-m-d H:i:s');
switch ($action) {
    case 'new':
        $extender = new Extender();
        $extender->create($_POST['extender']);
        $URL = './index.php';
        break;
    case 'edit':
        parse_str(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
        $extender = new Extender();
        $extender = $extender->find($id);
        $extender->update($_POST['extender']);
        $URL = './index.php';
        break;
    case 'delete':
        parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY));
        $extender = new Extender();
        $extender = $extender->find($id);
        $extender->delete();
        $URL = './index.php';
        break;
    default:
        break;
}
header("Location: {$URL}");
include ROOT . '/inc/closedb.php';
예제 #2
0
<?php

require '../../inc/admin/config.php';
$session->auth_or_redirect('admin', '/', true);
$admin_title = 'Manage Extenders';
include ROOT . '/inc/admin/header.php';
$extenders = new Extender();
$paginator = new Paginator($extenders->find());
?>

<p><a href="/admin">Back to Admin Home</a></p>
  
<a href="./new.php"><img src="/images/admin/button_add.jpg" alt="Add New Extender" id="button_add" /></a>

<div id="extenders_index">
  <table>
    <tr>
      <th>Title</th>
			<th>Current Version</th>
			<th>Display</th>
    </tr>
    <?php 
foreach ($paginator->this_page() as $extender) {
    ?>
    <tr>
      <td><?php 
    echo $extender->title;
    ?>
</td>
			<td <?php 
    if (!$extender->latest) {