当前位置: 首页>>代码示例>>PHP>>正文


PHP factory::admin_factory方法代码示例

本文整理汇总了PHP中factory::admin_factory方法的典型用法代码示例。如果您正苦于以下问题:PHP factory::admin_factory方法的具体用法?PHP factory::admin_factory怎么用?PHP factory::admin_factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在factory的用法示例。


在下文中一共展示了factory::admin_factory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: while

     * Here, admin accepts or decilnes posts from users, before it will show on main page
     * */
    $check_session = factory::user();
    if ($check_session->check_session() == true) {
        if ($check_session->check_admin() == true) {
            $stmt = $pdo->query('SELECT id, Title, Text, Image FROM waiting_posts');
            echo '<ul>';
            while ($row = $stmt->fetch()) {
                echo '<div class="post-border well well-lg " style="background-color:rgba(16,16,16,0.95);border:15px solid #272727;">' . '<li style="list-style-type:none;text-align:center;font-weight:bold;color:white;">' . $row['Title'] . "<br />" . "<img src=" . $row['Image'] . " class=\"margin-auto img img-responsive\" ; /></a><br />" . $row['Text'] . "<br /><br />" . '</li></a>
					<a href="http://projects.e-kei.pl/inba/waiting.php?decision=accept&id=' . $row['id'] . ' "><button class="btn btn-success" type="button"><i class="fa fa-check fa-4x"></i></button></a>
					<a href="http://projects.e-kei.pl/inba/waiting.php?decision=decline&id=' . $row['id'] . ' "><button class=" btn btn-danger" type="button"><i class="fa fa-times fa-4x"></i></button></a>
					</div>';
            }
        }
    }
} catch (Exception $e) {
    echo "<h1 class=\"text-center\" style=\"color:grey;\">" . $e->getMessage() . "</h1>";
}
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    try {
        if (isset($_GET['decision']) && isset($_GET['id'])) {
            $decision = factory::admin_factory();
            $decision->decision($_GET['decision'], $_GET['id']);
            header("refresh:1;url=http://projects.e-kei.pl/inba/waiting.php");
        }
    } catch (Exception $e) {
        echo 'Wystąpił błąd bazy danych: ' . $e->getMessage();
    }
}
ob_end_flush();
include 'footer.html';
开发者ID:CodeEmperor,项目名称:inba,代码行数:31,代码来源:waiting.php


注:本文中的factory::admin_factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。