コード例 #1
0
ファイル: allstories.php プロジェクト: HBir/zahabe
			<div class="lank edit">
				<a href="allstories.php" title="Stories"><img src="assets/read.png" alt="Stories"></a>
			</div>
			<div class="lank edit rightmenu">
				<a href="remove.php?id=<?php 
echo $ID;
?>
" title="Edit"><img src="assets/edit.png" alt="edit"></a>
			</div>
			
			<div id="rows">
				<ol>
					<?php 
try {
    $db = new PDO('sqlite:zahabe.db');
    $result = getAllStories($db);
    foreach ($result as $row) {
        if (isset($row['Story'])) {
            print "<div class='storyicon'><a href='story.php?id=" . $row['ID'] . "'><img src='assets/read.png' alt='read full'></a></div>";
            print "<a href='story.php?id=" . $row['ID'] . "'><li value='" . $row['cnt'] . "'><span>" . $row['Text'] . "</span></li></a>";
        } else {
            print "<li>" . $row['Text'] . "</li>";
        }
    }
    $db = NULL;
} catch (PDOException $e) {
    print 'Exception : ' . $e->getMessage();
}
?>
				</ol>
			</div>
コード例 #2
0
ファイル: api.php プロジェクト: HBir/zahabe
if (isset($_GET['id'])) {
    $rows = getMVByID($db, $_GET['id']);
} else {
    if (isset($_GET['cnt'])) {
        $rows = getMVByNumber($db, $_GET['cnt']);
    } else {
        if (isset($_GET['add'])) {
            /*Not implemented*/
            print "To be implemented";
        } else {
            if (isset($_GET['type'])) {
                if ($_GET['type'] == "daily") {
                    $rows = getDailyMV($db);
                } else {
                    if ($_GET['type'] == "stories") {
                        $rows = getAllStories($db);
                    }
                }
            } else {
                $stmt = $db->prepare("SELECT Text, ID, Story, (select count(*) from MinnsDu b  where a.id >= b.id) as cnt\n                            FROM MinnsDu a LEFT JOIN Stories ON a.ID = Stories.MVID ORDER BY ID asc");
                $stmt->execute();
                $rows = $stmt->fetchAll();
            }
        }
    }
}
if (empty($rows)) {
    echo json_encode(["error" => "404 not found"]);
    http_response_code(404);
} else {
    print_r(json_encode($rows));
コード例 #3
0
                <div class="box-body">
                  <div class="table-responsive">
                    <table class="table no-margin">
                      <thead>
                        <tr>
                          <th>Story ID</th>
                          <th>Name</th>
                          <th>Status</th>
                          <th>Is Featured</th>
                          <th>Created At</th>
                          <th>Actions</th>
                        </tr>
                      </thead>
                      <tbody>
                          <?php 
$result = getAllStories();
if ($result > 0) {
    while ($topmenu = mysql_fetch_array($result)) {
        ?>
                          <tr>
                          <td><?php 
        echo $topmenu['story_id'];
        ?>
</td>
                          <td><?php 
        echo $topmenu['story_name'];
        ?>
</td>
                          <td>
                              <a href="update-story-status.php?id=<?php 
        echo $topmenu['story_id'];