Ejemplo n.º 1
0
$cataObj = new Cores\Models\CataModel();
$allCataObj = $cataObj->selectAll();
print_r($allCataObj);
echo '<br>====================<br>';
//njx_comments test
$commentObj = new Cores\Models\CommentsModel();
$allCommentObj = $commentObj->selectAll();
print_r($allCommentObj);
echo '<br>====================<br>';
//njx_users test
$usersObj = new Cores\Models\UsersModel();
$allUserObj = $usersObj->selectAll();
print_r($allUserObj);
echo '<br>====================<br>';
//njx_items test
$itemsObj = new Cores\Models\ItemsModel();
$allItemObj = $itemsObj->selectAll();
print_r($allItemObj);
echo '<br>====================<br>';
//njx_remarks test
$remarksObj = new Cores\Models\RemarksModel();
$remarksObj = $remarksObj->selectAll();
print_r($remarksObj);
echo '<br>====================<br>';
//njx_fields test
$fieldsObj = new Cores\Models\FieldsModel();
$allFieldsObj = $fieldsObj->selectAll();
print_r($allFieldsObj);
echo '<br>====================<br>';
//njx_fields_options test
$fieldsOptionsObj = new Cores\Models\FieldsOptionsModel();
Ejemplo n.º 2
0
Archivo: item.php Proyecto: shiyake/PHP
}
$itemsObj = new Cores\Models\ItemsModel();
$pageCount = count($itemsObj->selectAll());
$allPages = ceil($pageCount / 20);
$prevPage = $page - 1;
if ($prevPage <= 0) {
    $prevPage = 1;
}
$nextPage = $page + 1;
if ($nextPage > $allPages) {
    $nextPage = $allPages;
}
$prompt = '';
if (!empty($_GET['action']) && !empty($_GET['iid'])) {
    $iid = $_GET['iid'];
    $itemsObj = new Cores\Models\ItemsModel();
    switch ($_GET['action']) {
        case 'reject_item':
            $result = $itemsObj->reject($iid);
            $prompt = success('拒绝成功');
            break;
        case 'approve_item':
            $result = $itemsObj->approve($iid);
            $prompt = success('通过成功');
            break;
        case 'view_comments':
            // $result=$itemsObj->
            break;
        case 'up_order':
            $result = $itemsObj->upOrder($iid);
            $prompt = success('升级成功');
Ejemplo n.º 3
0
Archivo: test.php Proyecto: shiyake/PHP
$allCommentObj = $commentObj->selectAll();
print_r($allCommentObj);
echo '<br>========================================<br>';
// $added=$commentObj->add('1111','22222');
// print_r($added);
echo '<br>====================<br>';
//njx_users test
$usersObj = new Cores\Models\UsersModel();
$allUserObj = $usersObj->selectAll();
print_r($allUserObj);
echo '<br>========================================<br>';
$added = $usersObj->add('11111', '1122222', '548486');
print_r($added);
echo '<br>====================<br>';
//njx_items test
$itemsObj = new Cores\Models\ItemsModel();
$allItemObj = $itemsObj->selectAll();
print_r($allItemObj);
echo '<br>========================================<br>';
// $itemsObj->add('111111','222222222');
echo '<br>======upOrde======<br>';
$itemsObj->upOrder('1');
echo '<br>====================<br>';
//njx_remarks test
$remarksObj = new Cores\Models\RemarksModel();
$AllremarksObj = $remarksObj->selectAll();
print_r($AllremarksObj);
echo '<br>========================================<br>';
$added = $remarksObj->add('ddsdssd', '2222222222');
print_r($added);
echo '<br>====================<br>';
Ejemplo n.º 4
0
<?php

$fieldOptions = new Cores\Models\FieldsOptionsModel();
$field = new Cores\Models\FieldsModel();
$fieldList = $fieldOptions->selectAll();
if (!empty($_GET['action'])) {
    switch ($_GET['action']) {
        case 'add_new_item':
            $itemObj = new Cores\Models\ItemsModel();
            $uid = '3CEC7A3B-58BD-82B7-E4BA-8849286079BE';
            $caid = $_POST['item_cata_add'];
            $title = $_POST['item_theme_add'];
            $count = null;
            if (!empty($_GET['count'])) {
                $count = $_GET['count'];
            } else {
                alert('count未定义');
                redirectTo('admin.php?v=' . $_GET['v']);
            }
            if ($title == null || $caid == null) {
                alert('项目类别或项目主题不能为空');
                redirectTo('admin.php?v=' . $_GET['v']);
            }
            $itemAdded = $itemObj->add($uid, $caid, $title);
            $itemId = $itemAdded[0]->getIid();
            if ($itemId == null) {
                alert('添加投稿失败,请重试!');
            } else {
                if (is_array($fieldList)) {
                    foreach ($fieldList as $key => $value) {
                        $foid = $value->getFoid();
Ejemplo n.º 5
0
                                        </div>
                                    </div>
                                    <div role="tabpanel" class="tab-pane" id="points">
                                        <div class="table-responsive">
                                            <table class="table table-hover" id="item-approved-list">
                                                <thead>
                                                    <tr>
                                                        <th>#</th>
                                                        <th>所属文章</th>
                                                        <th>分值</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php 
$result = $remarksObj->selectAll($remarksPage);
$itemObj = new Cores\Models\ItemsModel();
$j = $remarksPage > 1 ? $remarksPage * 5 + 1 : 0;
if (is_array($result)) {
    foreach ($result as $key => $value) {
        $j++;
        $itemName = $itemObj->selectOne($value->getItemId());
        $itemName = $itemName[0]->getTitle();
        echo '  <tr>
                                                                            <td>' . $j . '</td>
                                                                            <td>' . $itemName . '</td>
                                                                            <td>' . $value->getPoints() . '</td>
                                                                            <td>
                                                                                <a href="admin.php?v=' . $_GET['v'] . '&action=view_reamrks&remarkId=' . $value->getRemarkId() . '&remarksPage=' . $remarksPage . '" class="btn btn-primary btn-sm">查看</a>
                                                                                <a href="admin.php?v=' . $_GET['v'] . '&action=edit_remarks&remarkId=' . $value->getRemarkId() . '&remarksPage=' . $remarksPage . '" class="btn btn-primary btn-sm">修改</a>
                                                                                <a href="admin.php?v=' . $_GET['v'] . '&action=delete_remarks&remarkId=' . $value->getRemarkId() . '&remarksPage=' . $remarksPage . '" class="btn btn-danger btn-sm">删除</a>
                                                                            </td>