diff --git a/Query.php b/Query.php deleted file mode 100644 index 1b7f62a..0000000 --- a/Query.php +++ /dev/null @@ -1,10 +0,0 @@ - + function doClick() { + $script + } + +
+ +
+EOF; +} + +function response_with_href($message, $class, $href) +{ + reponse_with_click($message, $class, << + + + + + +
+ +
tip:选中题目查看选项
+
+
+
+EOF; + $query = new QuestionQuery(); + DbUtil::query("select * from question", $query); + if (empty($query->getQuestionArray())) { + warn_res_with_click("题库暂无题目,需要添加题目", <<getQuestionArray() as $item) { + if ($item instanceof Question) { + $id = $item->getQuestionId(); + $title = $item->getQuestionTitle(); + echo << + $title? + X + + EOF; + } + } + } + echo << +
+
+
+
+ + +
+
+ 问题 +
+ +
+ ? +
+
+ 问题内容不为空 +
+
+ +
+
+ +
+ + +
+ 请选中一个正确答案 +
+
+
+
+
+
+ +
+ 答案内容不为空 +
+
+ +
+ 请选中一个正确答案 +
+ +
+
+
+
+
+ +
+ 答案内容不为空 +
+
+ + +
+ 请选中一个正确答案 +
+
+
+
+
+
+ +
+ 答案内容不为空 +
+
+ + +
+ 请选中一个正确答案 +
+
+
+
+ + +
+
+ +
+
+ +
+ + + +EOF; +} else if (isset($_POST["action"]) && $_POST["action"] == "add") { +// 答案数 + $answer_count = 4; + + if (empty($_POST["question"])) { + error_res("问题不能为空!"); + } else if (empty($_POST["answer"])) { + error_res("答案内容不能为空!"); + } else if (!is_array($_POST["answer"])) { + error_res("非法答案参数"); + } else if (count($_POST["answer"]) != $answer_count) { + error_res("答案数量不等于4个!"); + } else if (count(array_unique($_POST["answer"])) != $answer_count) { + error_res("答案不能重复!"); + } else if (empty($_POST["right_answer"])) { + error_res("没有正确答案!"); + } else { + try { + DbUtil::insert_with_param("insert into question (question_title) values (?)", "s", new class() implements DoConn + { + public function before_close(mysqli $conn) + { + $id = mysqli_insert_id($conn); + foreach ($_POST["answer"] as $answer) { + DbUtil::insert("insert into answer (question_id, answer, is_true) values (?,?,?)", "isi", $id, $answer, array_search($answer, $_POST["answer"]) + 1 == (int)($_POST["right_answer"])); + } + } + }, $_POST["question"]); + info_res("保存成功"); + } catch (Exception $e) { + error($e); + error_res("保存异常,请稍后再试或者联系管理员!"); + } + + + } + +} else if (isset($_GET["action"]) && $_GET["action"] == "list") { + if (empty($_GET["question_id"])) { + error_res("没有指定问题id,无法查看详情信息!"); + } else if (!is_numeric($_GET["question_id"])) { + error_res("问题id不合法"); + } else { + $query_result = new AnswerQuery(); + DbUtil::query("select * from answer where question_id=?", $query_result, array($_GET["question_id"])); + if (empty($query_result->getAnswerArray())) { + error_res("问题id不合法"); + } else { + echo '
'; + foreach ($query_result->getAnswerArray() as $item) { + if ($item instanceof Answer) { + $answer = $item->getAnswer(); + $is_true = $item->getIsTrue() == 1 ? "checked" : ""; + echo << + +
+ + +
+
+ +EOF; + + } else { + error("类型不匹配"); + error_res("操作异常,请联系管理员"); + } + } + echo '
'; + + } + } +} else if (isset($_GET["action"]) && $_GET["action"] == "delete") { + if (empty($_GET["question_id"])) { + error_res("缺少问题id"); + } else if (!is_numeric($_GET["question_id"])) { + error_res("非法参数id"); + } else { + try { + DbUtil::delete("DELETE q,a FROM question as q,answer as a WHERE q.question_id=a.question_id and q.question_id=?", "i", (int)$_GET["question_id"]); + info_res("问题删除成功"); + } catch (Exception $e) { + error($e); + error_res("操作异常,请联系管理员"); + } + + } +} else { + \error("非法操作!"); +} + diff --git a/api/BaiduImage.php b/api/BaiduImage.php index e026b2a..d7656cc 100644 --- a/api/BaiduImage.php +++ b/api/BaiduImage.php @@ -43,7 +43,7 @@ function query_waste_soring($image_res) // 查询token $token_result = new class() extends AbstractTokenQuery { - public function bind_param(mysqli_stmt $stmt, array $param) + public function bind_param(mysqli_stmt $stmt, array $param = null) { } diff --git a/api/QueryText.php b/api/QueryText.php index 23be02c..fe1d4a3 100644 --- a/api/QueryText.php +++ b/api/QueryText.php @@ -13,12 +13,13 @@ class QueryText { $garbage_result = new class() extends AbstractGarbageQuery { + // 参数绑定 - public function bind_param(mysqli_stmt $stmt, array $param) + public function bind_param(mysqli_stmt $stmt, array $param = null) { if (count($param) > 1) { $stmt->bind_param(str_repeat("s", count($param)), $param[0], ...array_slice($param, 1)); - } else { + } else if (count($param) == 1) { $stmt->bind_param(str_repeat("s", count($param)), $param[0]); } diff --git a/api/QuestionAPI.php b/api/QuestionAPI.php new file mode 100644 index 0000000..93914c0 --- /dev/null +++ b/api/QuestionAPI.php @@ -0,0 +1,49 @@ +getQuestionArray())) { + json_res(json_encode(array(["status" => false, "msg" => "生成题库失败,题库为空,请联系管理员添加题目"]), JSON_UNESCAPED_UNICODE)); + return; +} else { + foreach ($q_result->getQuestionArray() as $querstion_item) { + if ($querstion_item instanceof Question) { + $answer_res = new AnswerQuery(); + DbUtil::query("select * from answer where question_id=? order by rand()", $answer_res, array($querstion_item->getQuestionId())); + if (empty($answer_res->getAnswerArray())) { + error("无法查询question_id=" . $querstion_item->getQuestionId() . "答案"); + json_res(json_encode(array(["status" => false, "msg" => "生成题库失败,请联系管理员"]), JSON_UNESCAPED_UNICODE)); + return; + } else { + $querstion_item->setAnswer($answer_res->getAnswerArray()); + foreach ($answer_res->getAnswerArray() as $answer_item) { + if ($answer_item instanceof Answer) { + if ($answer_item->getIsTrue() == "1") { + $querstion_item->setRightAnswer(array_search($answer_item, $answer_res->getAnswerArray())); + break; + } + } else { + error("实体类型不匹配" . var_dump($answer_res[0])); + json_res(json_encode(array(["status" => false, "msg" => "生成题库失败,请联系管理员"]), JSON_UNESCAPED_UNICODE)); + return; + } + } + } + } else { + error("实体类型不匹配" . var_dump($querstion_item)); + json_res(json_encode(array(["status" => false, "msg" => "生成题库失败,请联系管理员"]), JSON_UNESCAPED_UNICODE)); + return; + } + } + + json_res(json_encode(array("status" => true, "msg" => "成功创建题库,包含" . count($q_result->getQuestionArray()) . "条题目", "result" => $q_result->getQuestionArray()), JSON_UNESCAPED_UNICODE)); +} diff --git a/baidu/BaiduAiRequest.php b/baidu/BaiduAiRequest.php index eac4b0a..cdc69ff 100644 --- a/baidu/BaiduAiRequest.php +++ b/baidu/BaiduAiRequest.php @@ -37,7 +37,7 @@ class BaiduAiRequest DbUtil::delete("delete from api_token"); $token = new ApiToken(null, $json_res["refresh_token"], $json_res["expires_in"], null, $json_res["scope"], $json_res["session_key"], $json_res["access_token"], $json_res["session_secret"]); DbUtil::insert("insert into api_token (refresh_token, expires_in, end_time, scope, session_key, access_token, session_secret) values (?,?,?,?,?,?,?)", - "sisssss", $token->getRefreshToken(), $token->getExpiresIn(), date_format(date_create(date(default_format))->add(date_interval_create_from_date_string($token->getExpiresIn() . " seconds")), default_format), $token->getScope(), $token->getSessionKey(), $token->getAccessToken(), $token->getSessionSecret()); + $types = "sisssss", $token->getRefreshToken(), $token->getExpiresIn(), date_format(date_create(date(default_format))->add(date_interval_create_from_date_string($token->getExpiresIn() . " seconds")), default_format), $token->getScope(), $token->getSessionKey(), $token->getAccessToken(), $token->getSessionSecret()); info("token保存成功"); return $token; } diff --git a/database/DbUtil.php b/database/DbUtil.php index 19249c9..c155342 100644 --- a/database/DbUtil.php +++ b/database/DbUtil.php @@ -6,12 +6,19 @@ require_once __ROOT__ . "/Log.php"; interface DoExcute { // 参数处理 - function bind_param(mysqli_stmt $stmt, array $param); + function bind_param(mysqli_stmt $stmt, array $param = null); // 执行结果处理 function doResult(mysqli_stmt $stmt); } + +interface DoConn +{ +// 连接关闭前处理 + function before_close(mysqli $conn); +} + class DbUtil { @@ -45,12 +52,12 @@ class DbUtil } // 插入数据 - public static function modify($action, $sql, $types = "", ...$_) + public static function modify($action, $sql, DoConn $do_conn = null, $types = "", ...$_) { try {// 创建连接 $conn = self::getConn(); - $stmt = $conn->prepare("$sql");//创建一个预定义的对象 ?占位 + $stmt = $conn->prepare($sql);//创建一个预定义的对象 ?占位 if (!empty($types)) { $stmt->bind_param($types, ...$_);// 参数绑定 } @@ -58,6 +65,9 @@ class DbUtil info($action . $stmt->affected_rows . "条数据"); $stmt->close(); info("执行sql.$sql.成功"); + if (!empty($do_conn)) { + $do_conn->before_close($conn); + } self::closeConn($conn);// 关闭连接 } catch (Exception $e) { error($action . "数据异常" . $e); @@ -67,24 +77,29 @@ class DbUtil // 插入数据 public static function insert($sql, $types = "", ...$_) { - self::modify("插入", $sql, $types, ...$_); + self::modify("插入", $sql, null, $types, ...$_); + } + + public static function insert_with_param($sql, $types, $db_conn, ...$_) + { + self::modify("插入", $sql, $db_conn, $types, ...$_); } // 更新数据 public static function update($sql, $types = "", ...$_) { - self::modify("更新", $sql, $types, ...$_); + self::modify("更新", $sql, null, $types, ...$_); } // 删除数据 public static function delete($sql, $types = "", ...$_) { - self::modify("删除", $sql, $types, ...$_); + self::modify("删除", $sql, null, $types, ...$_); } //查询数据 - public static function query($sql, DoExcute $doExcute, array $param = array()) + public static function query($sql, DoExcute $doExcute, array $param = null) { try {// 创建连接 $conn = self::getConn(); diff --git a/database/Query.php b/database/Query.php index c959cfc..f63df62 100644 --- a/database/Query.php +++ b/database/Query.php @@ -2,7 +2,9 @@ require_once __ROOT__ . "/entity/ApiToken.php"; require_once __ROOT__ . "/entity/Garbage.php"; - +require_once __ROOT__ . "/entity/Question.php"; +require_once __ROOT__ . "/entity/Answer.php"; +require_once __ROOT__ . "/database/DbUtil.php"; //Token查询 abstract class AbstractTokenQuery implements DoExcute { @@ -86,7 +88,7 @@ function getGarbageQuery($sql, $keyword): AbstractGarbageQuery { $garbage_result = new class() extends AbstractGarbageQuery { - public function bind_param(mysqli_stmt $stmt, array $param) + public function bind_param(mysqli_stmt $stmt, array $param = null) { if (count($param) > 1) { $stmt->bind_param(str_repeat("s", count($param)), $param[0], ...array_slice($param, 1)); @@ -100,4 +102,86 @@ function getGarbageQuery($sql, $keyword): AbstractGarbageQuery DbUtil::query($sql, $garbage_result, $keyword); return $garbage_result; -} \ No newline at end of file +} + +class QuestionQuery implements DoExcute +{ + + private $question_array = array(); + + public function bind_param(mysqli_stmt $stmt, array $param = null) + { + + } + + public function doResult(mysqli_stmt $stmt) + { + $stmt->bind_result($col1, $col2); + while ($stmt->fetch()) { + $q = new Question($col1, $col2); + array_push($this->question_array, $q); + } + } + + /** + * @return array + */ + public function getQuestionArray(): array + { + return $this->question_array; + } + + +} + +//查询问题答案 +class AnswerQuery implements DoExcute +{ + + private $answer_array = array(); + + public function bind_param(mysqli_stmt $stmt, array $param = null) + { + if (!empty($param)) { + $stmt->bind_param("i", $param[0]); + } + } + + public function doResult(mysqli_stmt $stmt) + { + $stmt->bind_result($col1, $col2, $col3, $col4); + while ($stmt->fetch()) { + $a = new Answer($col1, $col2, $col3, $col4); + array_push($this->answer_array, $a); + } + } + + /** + * @return array + */ + public function getAnswerArray(): array + { + return $this->answer_array; + } + + +} + +//查询问题 +class QueryRandQuestion implements DoExcute +{ + public function bind_param(mysqli_stmt $stmt, array $param = null) + { + + } + + public function doResult(mysqli_stmt $stmt) + { + $stmt->bind_result($col1, $col2, $col3, $col4, $col5); + while ($stmt->fetch()) { + + } + } +} + +; \ No newline at end of file diff --git a/entity/Answer.php b/entity/Answer.php new file mode 100644 index 0000000..1a14511 --- /dev/null +++ b/entity/Answer.php @@ -0,0 +1,66 @@ +answer_id = $answer_id; + $this->question_id = $question_id; + $this->answer = $answer; + $this->is_true = $is_true; + } + + /** + * @return mixed + */ + public function getAnswerId() + { + return $this->answer_id; + } + + /** + * @return mixed + */ + public function getQuestionId() + { + return $this->question_id; + } + + /** + * @return mixed + */ + public function getAnswer() + { + return $this->answer; + } + + /** + * @return mixed + */ + public function getIsTrue() + { + return $this->is_true; + } + + public function jsonSerialize() + { + $data = []; + foreach ($this as $key => $val) { + if ($val !== null) $data[$key] = $val; + } + return $data; + } +} \ No newline at end of file diff --git a/entity/Garbage.php b/entity/Garbage.php index f4cfce8..d4f4044 100644 --- a/entity/Garbage.php +++ b/entity/Garbage.php @@ -1,5 +1,4 @@ update_at; } - public function jsonSerialize() { $data = []; diff --git a/entity/Menu.php b/entity/Menu.php new file mode 100644 index 0000000..c4ffbf0 --- /dev/null +++ b/entity/Menu.php @@ -0,0 +1,38 @@ +name = $name; + $this->interface = $interface; + } + + /** + * @return mixed + */ + public function getName() + { + return $this->name; + } + + /** + * @return mixed + */ + public function getInterface() + { + return $this->interface; + } + + +} \ No newline at end of file diff --git a/entity/Question.php b/entity/Question.php new file mode 100644 index 0000000..b8f8efa --- /dev/null +++ b/entity/Question.php @@ -0,0 +1,80 @@ +question_id = $question_id; + $this->question_title = $question_title; + } + + /** + * @return mixed + */ + public function getQuestionId() + { + return $this->question_id; + } + + /** + * @return mixed + */ + public function getQuestionTitle() + { + return $this->question_title; + } + + /** + * @param mixed $question_id + */ + public function setQuestionId($question_id): void + { + $this->question_id = $question_id; + } + + /** + * @param mixed $question_title + */ + public function setQuestionTitle($question_title): void + { + $this->question_title = $question_title; + } + + public function jsonSerialize() + { + $data = []; + foreach ($this as $key => $val) { + if ($val !== null) $data[$key] = $val; + } + return $data; + } + + /** + * @param array $answer + */ + public function setAnswer(array $answer): void + { + $this->answer = $answer; + } + + /** + * @param mixed $right_answer + */ + public function setRightAnswer($right_answer): void + { + $this->right_answer = $right_answer; + } + + +} \ No newline at end of file diff --git a/head.php b/head.php index fa86683..b91e824 100644 --- a/head.php +++ b/head.php @@ -5,9 +5,11 @@ function getMenu($menu) echo << $menu - - - + + + + + EOF; } diff --git a/index.php b/index.php index 0f58ec8..9486155 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,12 @@ "百度API配置", "WasteSorting" => "垃圾分类管理", "Question" => "题目管理"); + require_once "config.php"; require_once __ROOT__ . "/head.php"; +require_once __ROOT__ . "/entity/Menu.php"; + +//菜单信息 +$menus = array("API" => new Menu("百度API配置", "/admin/ApiConfig.php"), new Menu("垃圾分类", "/admin/WasteSorting.php"), new Menu("题目管理", "/admin/Question.php")); + getMenu("后台管理"); @@ -14,16 +19,19 @@ echo << EOF; foreach ($menus as $key => $value) { - echo << - $value - -EOF; + + if ($value instanceof Menu) { + echo ''; + } } echo << - Disabled + 欢迎管理员luffy登陆 diff --git a/static/js/popper.min.js b/static/js/popper.min.js new file mode 100644 index 0000000..8a17212 --- /dev/null +++ b/static/js/popper.min.js @@ -0,0 +1,5 @@ +/* + Copyright (C) Federico Zivolo 2019 + Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). + */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function i(e){return e&&e.referenceNode?e.referenceNode:e}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1=o.clientWidth&&n>=o.clientHeight}),l=0a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-us[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f],10),E=parseFloat(w['border'+f+'Width'],10),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)f(l.top)||'bottom'===n&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.rightwindow.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={"x-placement":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge}); +//# sourceMappingURL=popper.min.js.map diff --git a/test.php b/test.php index 9c50f97..30df085 100644 --- a/test.php +++ b/test.php @@ -1,23 +1,29 @@ - - -菜鸟教程(runoob.com) - - +//echo << +// +// +//菜鸟教程(runoob.com) +// +// +// +//
+// +//
+// +//
+// +// +// +//EOF; + +var_dump(array_search(new Answer(1, 2, 3, 4), array(new Answer(4, 5, 6, 7), new Answer(2, 2, 3, 4)))); -
- -
- -
- - -EOF;