本文整理汇总了PHP中Feedback类的典型用法代码示例。如果您正苦于以下问题:PHP Feedback类的具体用法?PHP Feedback怎么用?PHP Feedback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Feedback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: actionFeedback
public function actionFeedback()
{
$content = zmf::val('content', 1);
if (!$content) {
$this->jsonOutPut(0, '内容不能为空哦~');
}
//一个小时内最多只能反馈5条
if (zmf::actionLimit('feedback', '', 5, 3600)) {
$this->jsonOutPut(0, '操作太频繁,请稍后再试');
}
$attr['uid'] = $this->uid;
$attr['type'] = 'web';
$attr['contact'] = zmf::val('email', 1);
$attr['appinfo'] = zmf::val('url', 1);
$attr['sysinfo'] = Yii::app()->request->userAgent;
$attr['content'] = $content;
$model = new Feedback();
$model->attributes = $attr;
if ($model->validate()) {
if ($model->save()) {
$this->jsonOutPut(1, '感谢您的反馈');
} else {
$this->jsonOutPut(1, '感谢您的反馈');
}
} else {
$this->jsonOutPut(0, '反馈失败,请重试');
}
}
开发者ID:ph7pal,项目名称:momo,代码行数:28,代码来源:AjaxController.php
示例2: actionFeedback
public function actionFeedback()
{
$form = new FeedbackForm('insert');
$formName = get_class($form);
$this->performAjaxValidation($form);
// проверить не передан ли тип и присвоить его аттрибуту модели
$module = Yii::app()->getModule('feedback');
if (Yii::app()->getRequest()->getIsPostRequest() && !empty($_POST[$formName])) {
$form->setAttributes(Yii::app()->getRequest()->getPost($formName));
if ($form->validate()) {
// обработка запроса
$feedback = new Feedback();
$feedback->setAttributes($form->getAttributes());
if ($feedback->save()) {
Yii::app()->eventManager->fire(FeedbackEvents::SUCCESS_SEND_MESSAGE, new SendFeedbackMessageEvent($feedback));
if (Yii::app()->getRequest()->getIsAjaxRequest()) {
Yii::app()->ajax->success(Yii::t('FeedbackModule.feedback', 'Your message sent! Thanks!'));
}
Yii::app()->getUser()->setFlash(YFlashMessages::SUCCESS_MESSAGE, Yii::t('FeedbackModule.feedback', 'Your message sent! Thanks!'));
$this->redirect($module->successPage ? [$module->successPage] : ['/feedback/contact/index/']);
} else {
if (Yii::app()->getRequest()->getIsAjaxRequest()) {
Yii::app()->ajax->failure(Yii::t('FeedbackModule.feedback', 'It is not possible to send message!'));
}
Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, Yii::t('FeedbackModule.feedback', 'It is not possible to send message!'));
}
} else {
if (Yii::app()->getRequest()->getIsAjaxRequest()) {
Yii::app()->ajax->rawText(CActiveForm::validate($form));
}
}
}
$this->render('index', ['model' => $form, 'module' => $module]);
}
开发者ID:kuzmina-mariya,项目名称:4seasons,代码行数:34,代码来源:ContactController.php
示例3: add_feedback
public function add_feedback()
{
$type = Input::get('type');
$title = Input::get('title');
$content = Input::get('content');
if (!isset($type)) {
return Response::json(array('errCode' => 1, 'message' => '请选者反馈类型'));
}
if (!isset($title)) {
return Response::json(array('errCode' => 2, 'message' => '请输入标题'));
}
if (!isset($content)) {
return Response::json(array('errCode' => 3, 'message' => '请输入内容'));
}
$feedback = new Feedback();
$feedback->user_id = Sentry::getUser()->user_id;
$feedback->type = $type;
$feedback->title = $title;
$feedback->content = $content;
$feedback->status = 0;
if (!$feedback->save()) {
return Response::json(array('errCode' => 4, 'message' => '保存失败'));
}
return Response::json(array('errCode' => 0, 'message' => '保存成功'));
}
开发者ID:Jv-Juven,项目名称:carService,代码行数:25,代码来源:FeedbackController.php
示例4: submitAction
public function submitAction()
{
// Get our context (this takes care of starting the session, too)
$context = $this->getDI()->getShared('ltiContext');
$this->view->disable();
$this->view->ltiContext = $context;
$this->view->userAuthorized = $context->valid;
// Check for valid LTI context
if ($context->valid) {
// Store user feedback in the Feedback Phalcon model
$feedback = new Feedback();
$feedback->type = $_POST["feedbackType"];
$feedback->feedback = $_POST["feedback"];
$feedback->student_email = $context->getUserEmail();
$feedback->student_name = $context->getUserName();
// The Phalcon model code takes care of creating a new row in the PostgreSQL database
if ($feedback->save()) {
echo "Thank you for your feedback!";
} else {
echo "There was an error saving your feedback";
}
// Send an email with this feedback to the developer
$to = $this->getDI()->getShared('config')->feedback_email;
$subject = 'Dashboard Feedback: ' . $feedback->type . " " . date(DATE_RFC2822);
$message = $feedback->feedback . "\n Sent by " . $feedback->student_name . ", " . $feedback->student_email;
$headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
} else {
echo "You must be signed in to submit feedback";
}
}
开发者ID:BYU-Open-Analytics,项目名称:visualization,代码行数:31,代码来源:FeedbackController.php
示例5: save
public function save(Feedback $feedback)
{
if ($feedback->isValid()) {
$feedback->isNew() ? $this->add($feedback) : $this->modify($feedback);
} else {
throw new RuntimeException('Le feedback doit être valide pour être enregistrée');
}
}
开发者ID:Tipkin-Commons,项目名称:tipkin,代码行数:8,代码来源:FeedbacksManager.class.php
示例6: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Feedback('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Feedback'])) {
$model->attributes = $_GET['Feedback'];
}
$this->render('admin', array('model' => $model));
}
开发者ID:paranoidxc,项目名称:iwebhost,代码行数:13,代码来源:FeedbackController.php
示例7: executeLeave
public function executeLeave(HTTPRequest $request)
{
$this->authenticationRedirection();
if (!$request->getExists('feedbackRequestId')) {
$this->app->httpResponse()->redirect404();
exit;
}
$feedbackRequestId = htmlspecialchars($request->getData('feedbackRequestId'));
$feedbackRequest = $this->_feedbackRequestsManager->get($feedbackRequestId);
if (is_null($feedbackRequest)) {
$this->app->httpResponse()->redirect404();
exit;
}
if ($request->postExists('submit-form')) {
$feedback = new Feedback();
$feedback->setAnnounceId($feedbackRequest->getAnnounceId());
$feedback->setUserAuthorId($feedbackRequest->getUserAuthorId());
$feedback->setUserOwnerId($feedbackRequest->getUserOwnerId());
$feedback->setUserSubscriberId($feedbackRequest->getUserSubscriberId());
$feedback->setReservationId($feedbackRequest->getReservationId());
$mark = htmlspecialchars($request->postData('mark'));
$comment = htmlspecialchars($request->postData('comment'));
$feedback->setMark($mark);
$feedback->setComment($comment);
$this->_feedbacksManager->save($feedback);
$this->_feedbackRequestsManager->delete($feedbackRequest->id());
$this->app->user()->setFlash('feedback-saved');
$this->app->httpResponse()->redirect('/feedback');
exit;
}
$this->page->smarty()->assign('feedbackRequest', $feedbackRequest);
}
开发者ID:Tipkin-Commons,项目名称:tipkin,代码行数:32,代码来源:FeedbackController.class.php
示例8: fbHandler
function fbHandler($p)
{
$session = SessionHandler::getInstance();
$o = new Feedback();
$o->type = USER;
$o->subject = $p['subj'];
$o->body = $p['body'];
$o->from = $session->id;
$o->time_created = sql_datetime(time());
$o->store();
js_redirect('');
// jump to start page
}
开发者ID:martinlindhe,项目名称:core_dev,代码行数:13,代码来源:feedback.php
示例9: actionAjaxSave
public function actionAjaxSave()
{
if (Yii::app()->request->isAjaxRequest) {
$model = new Feedback();
$model->attributes = $_POST['Feedback'];
if ($model->save()) {
echo true;
}
Yii::app()->end();
} else {
throw new CHttpException(400);
}
}
开发者ID:BrunoCheble,项目名称:novopedido,代码行数:13,代码来源:FeedbackController.php
示例10: submit
public function submit()
{
if ($this->validate()) {
$feedback = new Feedback();
$feedback->name = $this->name;
$feedback->content = $this->content;
$feedback->email = $this->email;
$feedback->phone = $this->phone;
$feedback->create_time = date('Y-m-d');
$feedback->is_reply = 0;
return $feedback->save();
}
return false;
}
开发者ID:kinghinds,项目名称:kingtest2,代码行数:14,代码来源:FeedbackForm.php
示例11: testService
/**
* Base feedback test
*/
public function testService()
{
$this->connection->expects($this->any())->method('is')->will($this->returnValue(false));
$this->connection->expects($this->once())->method('create');
$this->connection->expects($this->never())->method('write');
$this->connection->expects($this->once())->method('read')->with($this->equalTo(-1))->will($this->returnValue($this->packData() . $this->packData() . $this->packData()));
// Create service
$service = new Feedback();
$service->setConnection($this->connection);
// Testing get invalid devices
$devices = $service->getInvalidDevices();
$this->assertNotEmpty($devices);
$this->assertEquals(3, count($devices));
}
开发者ID:sgmendez,项目名称:AppleApnPush,代码行数:17,代码来源:FeedbackTest.php
示例12: readFeedbackList
function readFeedbackList()
{
$db = new Feedback();
$course_id = $db->getCourseID($_POST["course"]);
$lecture_list = $db->readContents($course_id, $_POST["lecture"]);
$jsonarray = array();
for ($i = 0; $i < sizeof($lecture_list); $i++) {
$jsonarray[$i] = array();
$jsonarray[$i]["feedback_no"] = $lecture_list[$i][0];
$jsonarray[$i]["content_text"] = $lecture_list[$i][4];
$jsonarray[$i]["div_no"] = $lecture_list[$i][7];
$jsonarray[$i]["confirm_flag"] = $lecture_list[$i][6];
}
print json_encode($jsonarray);
}
开发者ID:HYUWebProject,项目名称:pinback,代码行数:15,代码来源:loadFeedbackPage.php
示例13: getInstance
/**
* get singleton instance.
* role: visitor|player|administrator
* @return Feedback|null|object
*/
public static function getInstance()
{
if (!self::$instance) {
self::$instance = new Feedback();
}
return self::$instance;
}
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:12,代码来源:Feedback.class.php
示例14: dashboard
/**
* Show Admin Dashboard
* GET /admin/dashboard
*
* @return Response
*/
public function dashboard()
{
$users = \DB::table('users')->count();
$posts = \Post::all()->count();
$feedback = \Feedback::all()->count();
return \View::make('admin.dashboard', compact('posts', 'users', 'feedback'));
}
开发者ID:pogliozzy,项目名称:larabase,代码行数:13,代码来源:AdminController.php
示例15: form_appears_and_saves
/**
* @test
*/
public function form_appears_and_saves()
{
Config::inst()->update('Controller', 'extensions', array('QuickFeedbackExtension'));
$controller = new TestController();
$result = $controller->handleRequest(new SS_HTTPRequest('GET', 'form_appears_and_saves'), DataModel::inst());
$body = $result->getBody();
$this->assertContains('Form_QuickFeedbackForm', $body);
$this->assertContains('Form_QuickFeedbackForm_Rating', $body);
$this->assertContains('Form_QuickFeedbackForm_Comment', $body);
preg_match('/action="([^"]+)"/', $body, $action);
if (!count($action)) {
$this->fail('No form action');
}
preg_match('/name="SecurityID" value="([^"]+)"/', $body, $token);
if (!count($action)) {
$this->fail('No token');
}
$parts = explode('/', $action[1]);
$action = end($parts);
$time = time();
$data = ['SecurityID' => $token[1], 'Rating' => '0', 'Comment' => 'comment at ' . $time];
$controller->handleRequest(new SS_HTTPRequest('POST', $action, array(), $data), DataModel::inst());
$existing = Feedback::get()->filter('Comment', 'comment at ' . $time)->first();
if (!$existing) {
$this->fail('Record missing');
}
}
开发者ID:helpfulrobot,项目名称:mandrew-silverstripe-quickfeedback,代码行数:30,代码来源:QuickFeedbackExtensionTest.php
示例16: loadModel
public function loadModel($id)
{
if (($model = Feedback::model()->findByPk($id)) === null) {
throw new CHttpException(404, 'Страница не найдена');
}
return $model;
}
开发者ID:kuzmina-mariya,项目名称:gallery,代码行数:7,代码来源:FeedbackBackendController.php
示例17: getDescription
/**
* @inheritdoc
*/
public function getDescription()
{
switch ($this->key) {
case self::KEY_NUEVO_PEDIDO:
$pedido = ProyectoPedido::findOne($this->key_id);
return Yii::t('app', 'Pedido #{pedido} por {usuario}', ['pedido' => $pedido->id, 'usuario' => $pedido->asignado0->usuario->username]);
break;
case self::KEY_NUEVO_PEDIDO_ACC:
$pedido = AccionCentralizadaPedido::findOne($this->key_id);
return Yii::t('app', 'Pedido #{pedido} por {usuario}', ['pedido' => isset($pedido->id) ? $pedido->id : '', 'usuario' => isset($pedido->asignado0->nombreUsuario) ? isset($pedido->asignado0->nombreUsuario) : '']);
break;
case self::KEY_PEDIDO_ACC_APROBADO:
$acc_uej = AcEspUej::findOne($this->key_id);
$pedido = $acc_uej->Nombreunidadejecutora;
$aprobado = $acc_uej->aprobado == 1 ? 'aprobados' : 'no aprobados';
return Yii::t('app', 'Pedidos De Unidad Ejecutora ' . $pedido . ' fuerón ' . $aprobado . '');
break;
case self::KEY_FEEDBACK:
$feedback = Feedback::findOne($this->key_id);
return Yii::t('app', 'Observación del proyecto #{id}
<div class="actions pull-right">
<span class="notification-seen fa fa-eye" onclick="feedback({id})"></span>
</div>
', ['id' => $feedback->id]);
break;
}
}
开发者ID:minpppst,项目名称:rsc,代码行数:30,代码来源:Notification.php
示例18: modify
protected function modify(Feedback $feedback)
{
$q = $this->dao->prepare('UPDATE ' . $this->table() . ' SET ANNOUNCE_ID = :announceId, USER_OWNER_ID = :userOwnerId, USER_SUBSCRIBER_ID = :userSubscriberId, USER_AUTHOR_ID = :userAuthorId, RESERVATION_ID = :reservationId, MARK = :mark, COMMENT = :comment WHERE ID = :id');
$q->bindValue(':announceId', $feedback->getAnnounceId(), PDO::PARAM_INT);
$q->bindValue(':userOwnerId', $feedback->getUserOwnerId(), PDO::PARAM_INT);
$q->bindValue(':userSubscriberId', $feedback->getUserSubscriberId(), PDO::PARAM_INT);
$q->bindValue(':userAuthorId', $feedback->getUserAuthorId(), PDO::PARAM_INT);
$q->bindValue(':reservationId', $feedback->getReservationId(), PDO::PARAM_INT);
$q->bindValue(':mark', $feedback->getMark());
$q->bindValue(':comment', $feedback->getComment());
$q->bindValue(':id', $feedback->id(), PDO::PARAM_INT);
$q->execute();
}
开发者ID:Tipkin-Commons,项目名称:tipkin,代码行数:13,代码来源:FeedbacksManager_PDO.class.php
示例19: add_feedback
public function add_feedback()
{
if (!Input::has('title')) {
return Response::json(array('error_code' => 2, 'message' => '请输入标题'));
}
if (!Input::has('content')) {
return Response::json(array('error_code' => 3, 'message' => '请输入反馈内容'));
}
$feedback = new Feedback();
$feedback->title = Input::get('title');
$feedback->content = Input::get('content');
$feedback->user_id = Session::get('user.id');
if (!$feedback->save()) {
return Response::json(array('error_code' => 1, 'message' => '反馈失败'));
}
return Response::json(array('error_code' => 0, 'message' => '反馈成功'));
}
开发者ID:Jv-Juven,项目名称:hospital-register-system,代码行数:17,代码来源:FeedbackController.php
示例20: run
public function run()
{
$models = Feedback::model()->finished()->review()->slider()->findAll(array('limit' => (int) $this->limit, 'order' => 't.sort ASC'));
if (empty($models)) {
return;
}
$this->render($this->view, array('models' => $models));
}
开发者ID:kuzmina-mariya,项目名称:unizaro-stone,代码行数:8,代码来源:ReviewsWidget.php
注:本文中的Feedback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论