/** * Public function that creates a single instance */ public static function getInstance() { if (!isset(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
<?php if (!isset($_GET['q'])) { exit; } include "lib/feedback.php"; $f = new feedback(); $a = explode(",", $_GET['q']); $id = $a[1]; $service = $a[0]; ?> <!doctype html> <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]--> <!--[if IE 7]> <html class="ie7 oldie"> <![endif]--> <!--[if IE 8]> <html class="ie8 oldie"> <![endif]--> <!--[if gt IE 8]><!--> <html class=""> <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Customer Feedback Form</title> <link href="boilerplate.css" rel="stylesheet" type="text/css"> <link href="site.css" rel="stylesheet"/> <link href="sample.css" rel="stylesheet" type="text/css"> <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link rel="stylesheet" href="font-awesome-4.4.0/css/font-awesome.css">
function evaluateAction() { $GLOBALS['mem_buff'] = new memBuff(); $error = ''; // откуда пришел пользователь if (preg_match("/\\/([A-Za-z0-9]{14,32})\\/\$/", front::$_req['pg'], $o)) { $from = 'feedback'; } else { if (preg_match("/\\/([0-9]+)_([0-9\\.]+)\\/\$/", front::$_req['pg'], $o)) { $from = 'webim'; } } front::og("tpl")->page = front::$_req['pg']; if ($from == 'webim') { // консультант front::og("tpl")->evtype = 'webim'; $thread = $o[1]; $visitor = $o[2]; $webim = new webim(); if ($webim->Check($thread, $visitor) && $webim->GetChat(get_uid(FALSE), $thread)) { front::og("tpl")->thread = $webim->thread; front::og("tpl")->operator = $webim->operator; } else { if (front::$_req['evaluate']) { $alert = 'Указанного обращения не существует или вы уже оставили отзыв.'; echo "Error:" . $alert; exit; } else { front::og("tpl")->error = $error = 'Указанного обращения не существует или вы уже оставили отзыв.'; } } } else { // обратная связь front::og("tpl")->evtype = 'feedback'; $feedback = new feedback(); if (!($code = $feedback->DecodeUCode($o[1])) || !$feedback->Check($code['uc'], $code['id'])) { front::og("tpl")->error = $error = 'Указанного обращения не существует или вы уже оставили отзыв.'; } else { front::og("tpl")->code = $code; } front::og("tpl")->kind_name = $feedback->departaments[substr($code['id'], 0, 2)]; } if (front::$_req['evaluate'] && !$error) { $e1 = intval(front::$_req['e1']); $e2 = intval(front::$_req['e2']); $e3 = intval(front::$_req['e3']); $wish = change_q(front::$_req['wish'], TRUE, 0, FALSE); $alert = ''; if (!$alert && !in_array($e1, array(0, 1, 2, 3, 4, 5))) { $alert = 'Ошибка в оценке "Ожидание ответа".'; } if (!$alert && !in_array($e2, array(0, 1, 2, 3, 4, 5))) { $alert = 'Ошибка в оценке "Доступное содержание".'; } if (!$alert && !in_array($e3, array(0, 1, 2, 3, 4, 5))) { $alert = 'Ошибка в оценке "Общее впечатление".'; } if (!$alert && !$e1 && !$e2 && !$e3 && !$wish) { $alert = 'Пожалуйста, поставте хотя бы одну оценку или напишите пожелание.'; } if (!$alert) { $wish = substr(iconv('UTF-8', 'CP1251', $wish), 0, feedback::MAX_WISH_CHARS - 1); if ($from == 'webim') { $alert = $webim->Evaluate($e1, $e2, $e3, $wish); } else { $alert = $feedback->Evaluate($code['uc'], $code['id'], $e1, $e2, $e3, $wish); } } echo $alert ? "Error:" . iconv('CP1251', 'UTF-8', $alert) : "Success:"; exit; } front::og("tpl")->script = array('feedback.js'); front::og("tpl")->display("about/about_evaluate.tpl"); }
private function get_condition() { $condition = ''; if (($gid = (int) $this->input['groupid']) > 0 || ($gradeid = (int) $this->input['gradeid']) > 0) { $this->memberCredits->setJoin(' LEFT JOIN ' . DB_PREFIX . 'member as m ON m.member_id = mc.u_id'); $gid && ($condition = ' AND m.gid = \'' . $gid . '\''); $gradeid && ($condition = ' AND m.gradeid = \'' . $gradeid . '\''); $this->memberCredits->setWhere($condition); } else { if (isset($this->input['startcredit1']) || isset($this->input['endcredit1'])) { if (($startcredit1 = (int) $this->input['startcredit1']) || isset($this->input['startcredit1'])) { $condition = ' AND credit1>=' . $startcredit1; $this->memberCredits->setWhere($condition); } if ((($endcredit1 = (int) $this->input['endcredit1']) || isset($this->input['endcredit1'])) && $endcredit1 >= $startcredit1) { $condition = ' AND ' . 'credit1<=' . $endcredit1; $this->memberCredits->setWhere($condition); } } else { if (isset($this->input['startcredit2']) || isset($this->input['endcredit2'])) { if (($startcredit2 = (int) $this->input['startcredit2']) || isset($this->input['startcredit2'])) { $condition = ' AND credit2>=' . $startcredit2; $this->memberCredits->setWhere($condition); } if ((($endcredit2 = (int) $this->input['endcredit2']) || isset($this->input['endcredit2'])) && $endcredit2 >= $startcredit2) { $condition = ' AND ' . 'credit2<=' . $endcredit2; $this->memberCredits->setWhere($condition); } } else { if (($fbid = (int) $this->input['fbid']) > 0) { $feedback = new feedback(); $membersId = $feedback->get_feed_members($fbid, '0,1'); if (!$membersId) { throw new Exception(FEEDBACK_ID_NO_MEMBER, 200); } $this->memberCredits->setWhere(array('u_id' => $membersId['member_id'])); } else { if ($spreadCode = trim($this->input['spreadcode'])) { $this->memberCredits->setJoin(' LEFT JOIN ' . DB_PREFIX . 'spread_record as sr ON mc.u_id=sr.fuid'); $condition = " AND sr.spreadcode = '" . $spreadCode . "'"; $this->memberCredits->setWhere($condition); } else { if (($invite_userid = (int) $this->input['invite_userid']) > 0) { $_invite = new invite(); $fuidArr = $_invite->select_uid_to_fuid($invite_userid, 'mi.fuid', 'fuid', 3, false); if (!$fuidArr) { throw new Exception(MEMBER_NO_INVITE_MEMBERS, 200); } $this->memberCredits->setWhere(array('u_id' => $fuidArr)); } else { if (($medalid = (int) $this->input['medalid']) > 0) { $this->memberCredits->setJoin(' LEFT JOIN ' . DB_PREFIX . 'member_medal as mm ON mm.member_id=mc.u_id'); $condition = " AND mm.medalid = " . $medalid . " AND (mm.expiration=0 OR mm.expiration>" . TIMENOW . ")"; $this->memberCredits->setWhere($condition); } else { if ($member_type = trim($this->input['member_type'])) { $this->memberCredits->setJoin(' LEFT JOIN ' . DB_PREFIX . 'member_bind as mb ON mb.member_id=mc.u_id'); $condition = ' AND mb.type = \'' . $member_type . '\''; $this->memberCredits->setWhere($condition); } else { if ($this->input['start_time'] || $this->input['end_time']) { $this->memberCredits->setJoin(' LEFT JOIN ' . DB_PREFIX . 'member as m ON m.member_id = mc.u_id'); if ($start_time = trim(urldecode($this->input['start_time']))) { $start_time = strtotime($start_time); $condition = " AND m.create_time >= " . (int) $start_time; $this->memberCredits->setWhere($condition); } if ($end_time = trim(urldecode($this->input['end_time']))) { $end_time = strtotime($end_time); if ($end_time >= $start_time) { $condition = " AND m.create_time <= " . (int) $end_time; $this->memberCredits->setWhere($condition); } } } } } } } } } } } if (($appid = (int) $this->input['mappid']) > 0) { $this->memberCredits->setJoin(' LEFT JOIN ' . DB_PREFIX . 'member as m ON m.member_id = mc.u_id'); $condition = " AND m.appid = " . $appid; $this->memberCredits->setWhere($condition); } if (isset($this->input['identifier'])) { $identifierUserSystem = new identifierUserSystem(); $identifier = $identifierUserSystem->setIdentifier((int) $this->input['identifier'])->checkIdentifier(); //多用户系统 $this->memberCredits->setJoin(' LEFT JOIN ' . DB_PREFIX . 'member as m ON m.member_id = mc.u_id'); $condition = " AND m.identifier = " . $identifier; $this->memberCredits->setWhere($condition); } $this->memberCredits->setAs('mc'); return $condition; }
$TML->assign('RAND', rand(1000, 9999)); $args = array(); foreach ($_GET as $key => $item) { if ($key != 'action') { $args[] = "{$key}={$item}"; } } $TML->assign('chaturi', "./?a=5" . join('&', $args)); $TML->assign('MAX_FILES', feedback::MAX_FILES); $TML->assign('u_token_key', $_SESSION['rand']); if ($has_errors) { echo "Error:{$errors[0]};{$errors['1']}" . ($errors[2] ? ';' . $errors[2] : ''); exit; } $visitSessionId = VisitSession::GetInstance()->updateCurrentOrCreateSession(); $params = array(); $params['visitsessionid'] = $visitSessionId; $params['lastpingvisitor'] = null; $params['offline'] = 1; $threads_count = MapperFactory::getMapper("Thread")->getNonEmptyThreadsCountByVisitorId($visitorid); $thread = Thread::getInstance()->CreateThread(WEBIM_CURRENT_LOCALE, STATE_CLOSED, $params); VisitSession::GetInstance()->UpdateVisitSession($visitSessionId, array('hasthread' => 1)); Thread::getInstance()->sendFirstMessageWithVisitorInfo($thread); Visitor::getInstance()->setVisitorNameCookie($visitor_name); $feedback = new feedback(); $uid = get_uid(false); $login = $_SESSION['webim_uname']; $email = $_SESSION['webim_email']; $feedback->Add($uid, $login, $email, $department, iconv("UTF-8", "WINDOWS-1251//IGNORE", $message), $attach); echo "Success: ok"; exit;
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $feedback = feedback::find($id); if ($feedback->author_id == Auth::user()->id) { $feedback->delete(); return redirect()->action('Insertions\\PostsController@index'); } else { return view('errors.503'); } }
<?php include "../controller/feedbackcontroller.php"; $feed = new feedback(); $feed->index(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Feed back</title> </head> <script language="JavaScript"> function Check_stu() { if (document.form1.UserName1.value == "") { alert("Enter username"); document.form1.UserName1.focus(); return false; } if (document.form1.phone.value == "") { alert("Enter phone"); document.form1.phone.focus(); return false; } if (document.form1.email.value == "") { alert("Enter email"); document.form1.email.focus(); return false;
<?php include "lib/feedback.php"; $f = new feedback(); ?> <!doctype html> <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]--> <!--[if IE 7]> <html class="ie7 oldie"> <![endif]--> <!--[if IE 8]> <html class="ie8 oldie"> <![endif]--> <!--[if gt IE 8]><!--> <html class=""> <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Customer Feedback Form</title> <link href="boilerplate.css" rel="stylesheet" type="text/css"> <link href="site.css" rel="stylesheet"/> <link href="sample.css" rel="stylesheet" type="text/css"> <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link rel="stylesheet" href="font-awesome-4.4.0/css/font-awesome.css"> <link rel="stylesheet" href="style.css"> <style> .ui-slider-handle { border-color: #ef2929; } .ui-slider-range { background: #e6f3f8; } </style> <!-- To learn more about the conditional comments around the html tags at the top of the file: