/**
  * 编辑主题时页面新增的表单项目
  * @param Integer $fid: 版块ID
  * @param Integer $tid: 当前帖子ID
  * @return string 通过 return 返回即可输出到编辑主题页面中 
  */
 public function editpost($fid, $tid)
 {
     require_once './function/feedback.php';
     $typelist = getTypeList();
     $thread["proposalinfo"] = getFeedback($tid, $fid);
     include template('forum/post_proposal');
 }
Ejemplo n.º 2
0
        $create_feedback = createFeedback($json);
        if ($create_feedback !== null) {
            header('Content-Type: application/json');
            http_response_code(201);
            echo json_encode($create_feedback);
            exit;
        } else {
            header('Content-Type: application/json');
            echo json_encode(['error' => 'Error: Feedback unable to be put into system!']);
            exit;
        }
    }
} else {
    if (isset($_GET['admin_gm_id'])) {
        $admin_gm_id = trim($_GET['admin_gm_id']);
        $feedback = getFeedback($admin_gm_id);
        if ($feedback !== null) {
            header('Content-Type: application/json');
            echo json_encode($feedback);
            exit;
        } else {
            header('Content-Type: application/json');
            echo json_encode(['error' => 'Error: GM ID not found in system!']);
            exit;
        }
    } else {
        if (isset($_GET['interaction_id'])) {
            $interaction_id = trim($_GET['interaction_id']);
            $request = getSingleFeedback($interaction_id);
            if ($request !== null) {
                header('Content-Type: application/json');
Ejemplo n.º 3
0
            $statement->execute(array(':title' => $title, ':teaser' => $teaser, ':content' => $content, ':postedOn' => time(), ':teaserIMG' => ''));
            $id = $conn->lastInsertId();
            $feedback = getFeedback("Your article has been posted. See it <a href='article.php?id={$id}'>here</a>.", 'success');
        } else {
            $statement = $conn->prepare("UPDATE articles SET\n        title = :title,\n        teaser = :teaser,\n        content = :content\n        WHERE id = :id");
            $statement->execute(array(':title' => $title, ':teaser' => $teaser, ':content' => $content, ':id' => $_GET['edit']));
            $feedback = getFeedback("Your article has been updated. See it <a href='article.php?id={$_GET['edit']}'>here</a>.", 'success');
        }
    } else {
        $feedback = getFeedback('Please add a title, teaser and image to your blog post.', 'warning');
    }
}
if (isset($_GET['deleteId'])) {
    $statement = $conn->prepare("DELETE FROM articles WHERE id = :id");
    $statement->execute(array(':id' => $_GET['deleteId']));
    $feedback = getFeedback('Your Post has been deleted.', 'success');
}
if (isset($_GET['edit'])) {
    $statement = $conn->prepare("SELECT * FROM articles WHERE id = :id");
    $statement->execute(array(':id' => $_GET['edit']));
    $articleToEdit = $statement->fetch(PDO::FETCH_OBJ);
}
?>
<!DOCTYPE html>

        <html lang="en">
          <head>
            <meta charset="utf-8">
            <title>littleBlog | Startseite</title>
            <link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.css">
            <link rel="stylesheet" href="css/main.css">
Ejemplo n.º 4
0
            # Stimmt sein Passwort mit dem eingegeben PW überein?
            if ($user->password === $password) {
                # Logge den User ein
                $_SESSION['id'] = $user->id;
                $_SESSION['username'] = $user->username;
                $_SESSION['rights'] = $user->rights;
                header('Location: admin.php');
                exit;
            } else {
                $feedback = getFeedback('Please correct your log–in data.', 'danger');
            }
        } else {
            $feedback = getFeedback('This user does not exist.', 'danger');
        }
    } else {
        $feedback = getFeedback('Please fill out all fields.', 'warning');
    }
}
?>
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>littleBlog | Login</title>
    <link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.css">
    <link rel="stylesheet" href="css/main.css">
  </head>
  <body>
    <div id="site-wrap">
      <h2>Little Blog</h2>