本文整理汇总了PHP中Feedback::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Feedback::find方法的具体用法?PHP Feedback::find怎么用?PHP Feedback::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feedback
的用法示例。
在下文中一共展示了Feedback::find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postReply
public function postReply()
{
$id = Input::get('m_id');
$data = Feedback::find($id);
$email = $data->email;
$data['message'] = Input::get('message');
$subject = Input::get('subject');
$user_data = array('message' => Input::get('message'));
Mail::send('emails.simple_message', array('data' => $user_data), function ($messages) use($subject, $email) {
$messages->to($email)->subject($subject);
});
return Redirect::back()->with('success', 'Success, Message Replied to <b>' . $email . '</b>');
}
示例2: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*
* @return void
*/
public function actionCreate()
{
$model = new Feedback();
if (($data = Yii::app()->getRequest()->getPost('Feedback')) !== null) {
$model->setAttributes($data);
if ($model->status == Feedback::STATUS_ANSWER_SENDED) {
$model->answer_user = Yii::app()->user->getId();
$model->answer_date = new CDbExpression('NOW()');
}
// Порядковый номер
$criteria = new CDbCriteria();
$criteria->select = new CDbExpression('MAX(sort) as sort');
$criteria->condition = 't.type_id = :type_id';
$criteria->params = array(':type_id' => $model->type_id);
$max = $model->find($criteria);
$model->sort = $max->sort + 10;
if ($model->save()) {
Yii::app()->user->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('FeedbackModule.feedback', 'Message saved!'));
$redirect = Yii::app()->getRequest()->getPost('submit-type') == '' ? (array) Yii::app()->getRequest()->getPost('submit-type', array('create')) : Yii::app()->user->getState('prevUrl');
$this->redirect($redirect);
}
}
$this->render('create', array('model' => $model));
}
示例3: Feedback
<?php
$feedback = new Feedback();
if (Input::get('del') && $_SESSION['role'] == 'Staff') {
$del = Input::get('del');
unset($_POST['del']);
if ($feedback->find($del)) {
$feedback->delete($del);
//force refresh
header('Location: /TCS/' . Input::get('page'));
exit;
}
}
if ($_SESSION['role'] == 'Staff') {
?>
<div class="row title-top-pad footer-padding">
<?php
if (Input::get('view')) {
$feedback->find(Input::get('view'));
?>
<h4>View Feedback</h4>
<h5>Type: <?php
echo $feedback->data()->category;
?>
</h5>
<h5>Message:</h5>
<h6><?php
示例4: function
//FeedBack Functions
//Get Feedback - OK
$app->get("/feedback/get/:job_id", function ($job_id) use($app) {
$r = Feedback::get_feedback($job_id);
$app->response->body(json_encode($r));
});
//Update Feedback - OK
$app->post("/feedback/update/", function () use($app) {
$params = $app->request()->params();
//Get all aprameters
$r = Feedback::update_feedback($params);
$app->response->body(json_encode($r));
});
//Delete Feedback - OK
$app->delete("/feedback/delete/:id", function ($id) use($app) {
$f = Feedback::find($id);
$f->delete();
$app->response->body();
});
//Insert Feedback
$app->post("/feedback/set", function () use($app) {
$params = $app->request()->params();
//Get all aprameters
$set_feedback = JobOffers::set_bid();
$app->response->body(json_encode($set_feedback));
});
//OFFERS
$app->post("/job/offer", function () use($app) {
$params = $app->request()->params();
$new_bid = JobOffers::set_bid($params);
$app->response->body(json_encode($new_bid));
示例5: getView
public function getView($id)
{
return View::make('feedbacks.view')->with('feedback', Feedback::find($id));
}