Exemple #1
0
    } else {
        Template::assign('complaint_level', $param['complaint_level']);
        $param['complaint_level'] = $data['complaintLevel'][$param['complaint_level']];
    }
}
$start_date = $param['start_date'] = $_GET['start_date'] = $_GET['start_date'] ? $_GET['start_date'] : date('Y-m');
//var_dump($param);exit;
// if (Common::isPost ()) {
if ($start_date != '') {
    $page_size = PAGE_SIZE;
    $page_no = $page_no < 1 ? 1 : $page_no;
    $start = ($page_no - 1) * $page_size;
    if ($_GET['download'] == 1) {
        $data['result'] = Complaint::search($param, $start, 0);
    } else {
        $data['result'] = Complaint::search($param, $start, $page_size);
    }
    $row_count = Complaint::searchCount($param);
}
$data['province'] = Info::getProvince(false);
$data['bussLine'] = Info::getBussLine('buss_line', false);
//导出excel下载
if ($_GET['download'] == 1) {
    $downloadStr = array_to_string($data);
    Common::exportExcel($downloadStr, 'search');
    exit;
}
$page_html = Pagination::showPager("search.php?" . $http_query, $page_no, PAGE_SIZE, $row_count);
// $page_html=Pagination::showPager("search.php?class_name=$class_name&user_name=$user_name&start_date=$start_date&end_date=$end_date",$page_no,PAGE_SIZE,$row_count);
$export_excel = "search.php?download=1&" . $http_query;
Template::assign("error", $error);
 public function actionRelational()
 {
     $report_id = Yii::app()->getRequest()->getParam('id');
     $thread_id = Complaint::model()->findByPk($report_id)->post_item_id;
     //Yii::log('Thread ID: ' . $thread_id, 'log');
     $model = new Complaint('search');
     $model->unsetAttributes();
     $gridColumns = array(array('name' => 'user.username', 'header' => 'Username'), array('name' => 'reply.message', 'value' => '$data->reply_id ? $data->reply->message : "<strong>(OP)</strong> " . $data->postItem->description ', 'header' => 'Message', 'type' => 'html'), array('name' => 'reason', 'header' => 'Complaint'), array('htmlOptions' => array('nowrap' => 'nowrap'), 'class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{view} | {safe} {disable}', 'cssClassExpression' => '!$data->reply_id ? "op" : "reply"', 'viewButtonUrl' => 'Yii::app()->controller->createUrl("/post/readTopic", array("id"=>$data->post_item_id))', 'buttons' => array('safe' => array('label' => 'Safe', 'icon' => 'thumbs-up', 'url' => 'Yii::app()->createUrl("complaint/replySafe", array("id"=>$data->complaint_id))'), 'disable' => array('label' => 'Disable', 'icon' => 'eye-close', 'url' => 'Yii::app()->createUrl("complaint/disableReply", array("reply_id"=>$data->reply_id, "complaint_id" => $data->complaint_id))', 'click' => 'function() {confirm("ok?");}'))));
     $this->renderPartial('_relational', array('id' => $thread_id, 'gridDataProvider' => $model->search(false, $thread_id), 'gridColumns' => $gridColumns));
 }
 public function actionReported()
 {
     $model = new Complaint('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Thread'])) {
         $model->attributes = $_GET['Thread'];
     }
     $dataProvider = $model->search();
     $this->render('admin', array('model' => $model, 'dataProvider' => $dataProvider));
 }