public function feedbackAction() { $data = $_POST["feedback"]; $data = ToolModel::getRealIpAddr() . "/" . $data . "/" . time(); $feedback = explode("/", $data); $db = new PlaygroundModel(); $sql = "INSERT INTO `playground_feedback` (`ip`,`uuid`,`foursquare`,`instagram`,`feedback`,`createtime`) VALUES('{$feedback['0']}','{$feedback['1']}','{$feedback['2']}','{$feedback['3']}','{$feedback['4']}','{$feedback['5']}');"; $db->run($sql); echo "done"; }
public function feedbackAction() { $db = new PlaygroundModel(); $sql = "SELECT * FROM `playground_feedback` order by `id` DESC;"; $ret = $db->fetchArray($sql); $feedbacks = array(); foreach ($ret as $line) { $line["feedback"] = urldecode($line["feedback"]); $line["feedback"] = ToolModel::toHtml($line["feedback"]); if ($line["createtime"] != 0) { $line["createtime"] = ToolModel::countTime($line["createtime"]); } else { $line["createtime"] = ""; } $feedbacks[] = $line; } $this->_mainContent->assign("feedbacks", $feedbacks); $this->display(); }