Esempio n. 1
0
 public function action_remove()
 {
     PermissionHelper::Verification('Editor');
     $id = $_GET['id'];
     $review = ReviewService::GetById($id);
     ReviewService::Delete($review);
     header("Location: /Review/item");
 }
 function action_newReview()
 {
     session_start();
     $login = $_SESSION["login"];
     if (!is_null($login)) {
         $tovarId = $_POST['tovarId'];
         $review = new Review();
         $review->product_id = $tovarId;
         $review->account_id = AccountService::GetByName($login, true)->account_id;
         $review->value = $_POST['reviewText'];
         ReviewService::Create($review);
         header("Location: /Review/thanks");
     } else {
         header("Location: /Account/Login");
     }
 }
Esempio n. 3
0
switch ($status) {
    case -1:
        $statusText = "全部";
        break;
    case 10:
        $statusText = "未审核";
        break;
    case 20:
        $statusText = "已审核";
        break;
}
$size = 10;
$start = ($pnum - 1) * $size;
$total = 0;
$pages = ReviewService::find($key, $status, $pid, $start, 15);
$total = ReviewService::getTotal($key, $status, $pid);
//分页使用
$tt = ceil($total / 15 * 8);
$ee = ceil($pnum / 8);
$lastpg = ceil($total / 15);
$dd = 8 * $ee;
if ($dd > $lastpg) {
    $dd = $lastpg;
}
$ss = 8 * ($ee - 1) + 1;
$pre_url = 'review.php?p=' . ($pnum - 1) . '&s=' . $status;
if (!empty($key)) {
    $pre_url = 'review.php?k=' . $key . '&p=' . ($pnum - 1) . '&s=' . $status;
}
$next_url = 'review.php?p=' . ($pnum + 1) . '&s=' . $status;
if (!empty($key)) {
Esempio n. 4
0
<table class="table table-bordered" id="review">
    <tr>
        <th>Имя пользователя</th>
        <th>Коментарий</th>
    </tr>
    <?php 
$reviewdata = ReviewHelper::PopulateReviewViewModelList(ReviewService::GetByProductId($data->Id));
if (isset($reviewdata)) {
    foreach ($reviewdata as $review) {
        ?>
        <tr>
            <td style="width: 150px"><?php 
        echo $review->account->name;
        ?>
</td>
            <td><?php 
        echo $review->value;
        ?>
</td>
        </tr>
    <?php 
    }
}
?>
</table>
<form class=form-inline" action="/Account/newReview" method="post">
    <input type="hidden" name="tovarId" value="<?php 
echo $data->Id;
?>
">
    <div class="form-group" style="vertical-align: middle">
Esempio n. 5
0
function doNotShowIndex($req)
{
    $pageid = $req['pageid'];
    $flag = ReviewService::updateShowIndex($pageid, 0);
    $response['status'] = $flag ? 1 : 0;
    echo json_encode($response);
}