예제 #1
0
파일: edit.php 프로젝트: kaz6120/Loggix
 */
$pathToIndex = '..';
require_once $pathToIndex . '/lib/Loggix/Application.php';
require_once $pathToIndex . '/lib/Loggix/View.php';
$app = new Loggix_Application();
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    if (isset($_GET['id'])) {
        $id = intval($_GET['id']);
        $sql = 'SELECT ' . '* ' . 'FROM ' . LOG_TABLE . ' ' . 'WHERE ' . 'id = :id';
        $stmt = $app->db->prepare($sql);
        $stmt->execute(array(':id' => $id));
        if ($item = $stmt->fetch()) {
            $item['id'] = $item['id'];
            $item['time'] = $app->setDateArray($item['date']);
            $item['title'] = htmlspecialchars($item['title']);
            $item['comment'] = htmlspecialchars($item['comment']);
            $item['excerpt'] = htmlspecialchars($item['excerpt']);
            $item['allow_comments'] = $item['allow_comments'];
            $item['allow_pings'] = $item['allow_pings'];
            switch ($item['draft']) {
                case '1':
                    $item['draft_status_1'] = ' checked="checked"';
                    $item['draft_status_0'] = '';
                    break;
                default:
                    $item['draft_status_1'] = '';
                    $item['draft_status_0'] = ' checked="checked"';
                    break;
            }