本文整理汇总了PHP中input::getInput方法的典型用法代码示例。如果您正苦于以下问题:PHP input::getInput方法的具体用法?PHP input::getInput怎么用?PHP input::getInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类input
的用法示例。
在下文中一共展示了input::getInput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getJson
public function getJson($addWhere = '', $addSql = '', $showMax = 12)
{
$sort = input::getInput("mix.sort") ? input::getInput("mix.sort") : 'id';
$order = input::getInput("mix.order") ? input::getInput("mix.order") : "asc";
$page = input::getInput("mix.page") ? input::getInput("mix.page") : 1;
$rows = input::getInput("mix.rows") ? input::getInput("mix.rows") : 10;
$db = sf::getLib("db");
if ($select) {
$sql = $select . " ";
} else {
$sql = "SELECT * FROM `" . $this->table . "` ";
}
$addWhere && ($sql .= "WHERE " . $addWhere . " ");
if ($addSql) {
$sql .= $addSql . " ";
} else {
$sql .= " ORDER BY {$sort} {$order} ";
}
if (!router::get("totalnum" . $key)) {
$query = $db->query($sql);
$total = $db->num_rows($query);
} else {
$total = router::get("totalnum" . $key);
}
$sql .= "LIMIT " . $rows * ($page - 1) . "," . $rows;
$query = $db->query($sql);
while ($row = $db->fetch_array($query)) {
$result[] = $this->fillObject($row)->toArray();
}
return '{"total":' . $total . ',"rows":' . json_encode($result) . '}';
}
示例2: main
function main()
{
$data['user'] = sf::getModel("managers", input::getInput("session.userid"));
view::set($data);
view::apply("inc_body", "admin/main");
view::display("admin/page");
}
示例3: send
/**
* 发送简历
*/
function send()
{
if (input::getInput("post")) {
$back = sf::getModel("backs");
$back->setSubject(input::getInput("post.subject"));
$back->setUserName(input::getInput("post.user_name"));
$back->setUserSex(input::getInput("post.user_sex"));
$back->setUserAge(input::getInput("post.user_age"));
$back->setUserDegree(input::getInput("post.user_degree"));
$back->setIdcard(input::getInput("post.idcard"));
$back->setUserPhone(input::getInput("post.user_phone"));
$back->setUserIm(input::getInput("post.user_im"));
$back->setUserEmail(input::getInput("post.user_email"));
$back->setUserAddress(input::getInput("post.user_address"));
$back->setPostCode(input::getInput("post.post_code"));
$back->setWorkAt(input::getInput("post.work_at"));
$back->setStudyList(input::getInput("post.study_list"));
$back->setWorkList(input::getInput("post.work_list"));
$back->setUpdatedAt(date("Y-m-d H:i:s"));
$back->save();
$this->page_debug(lang::get("Has been saved!"), site_url("job/index"));
}
view::set("job", sf::getModel("jobs", input::getInput("get.id")));
view::apply("inc_body", "template/job_send");
view::display("template/page");
}
示例4: index
function index()
{
$page = sf::getModel("pages")->showPage($this->type, input::getInput("get.id"));
config::set('title', $page->getSubject());
view::set("page", $page);
view::apply("inc_body", "template/about_us");
view::display("template/page");
}
示例5: show
/**
* 查看产品
*/
function show()
{
$product = sf::getModel("products", input::getInput("get.id"));
//设置页面title
config::set('title', $product->getSubject());
view::set("product", $product);
view::apply("inc_body", "template/product_show");
view::display("template/page");
}
示例6: show
/**
* 查看新闻
*/
function show()
{
$article = sf::getModel("articles", input::getInput("get.id"));
//设置页面title
config::set('title', $article->getSubject());
view::set("article", $article);
view::apply("inc_body", "template/article_show");
view::display("template/page");
}
示例7: delete
/**
* 删除数据
*/
function delete()
{
if (input::getInput("post.select_id")) {
$ids = implode("','", input::getInput("post.select_id"));
} else {
$ids = input::getInput("get.id");
}
sf::getModel("Authorizations")->remove("`id` IN('" . $ids . "')");
$this->page_debug(lang::get("Has been deleted!"), getFromUrl());
}
示例8: index
function index()
{
if (input::getInput("post.site")) {
$htmlStr = $this->getHtmlStr(input::getInput("post.site"));
file_put_contents(APPPATH . "config/Config.config.php", "<?php\r\n" . 'config::set(' . $htmlStr . ");\r\n?>");
$this->page_debug(lang::get('Has been save!'), getFromUrl());
}
view::apply("inc_body", "admin/configure/index");
view::display("admin/page");
}
示例9: delete
/**
* 删除数据
*/
function delete()
{
if (input::getInput("post.select_id")) {
$ids = implode("','", input::getInput("post.select_id"));
} else {
$ids = input::getInput("get.id");
}
if (sf::getModel("Order_froms")->remove("`id` IN ('" . $ids . "')")) {
$this->page_debug(lang::get("Has been deleted!"), getFromUrl());
} else {
$this->page_debug(lang::get("Nothing to do!"), getFromUrl());
}
}
示例10: password
function password()
{
$user = sf::getModel("users", input::getInput("session.userid"));
if (input::getInput("post.password")) {
if ($user->check(input::getInput("post.oldpassword"))) {
$user->setUserPassword(input::getInput("post.password"));
$user->setUpdatedAt(date("Y-m-d H:i:s"));
$user->save();
$this->page_debug(lang::get("Has been changed!"), site_url("login/index"));
} else {
$msg = lang::get("Password is error!");
}
}
view::set("msg", $msg);
view::set("user", $user);
view::apply("inc_body", "template/user_password");
view::display("template/page");
}
示例11: edit
function edit()
{
if (input::getInput("session.SafetyCode") != input::getInput("post.SafetyCode")) {
$this->page_debug(lang::get("The safety code is error!"), getFromUrl());
}
$book = sf::getModel("books", input::getInput("post.id") ? input::getInput("post.id") : input::getInput("get.id"));
if (input::getInput("post.content")) {
$book->setContent(input::getInput("post.content"));
$book->setUserName(input::getInput("post.user_name"));
$book->setUserPhone(input::getInput("post.user_phone"));
$book->setUserQq(input::getInput("post.user_qq"));
$book->setUserEmail(input::getInput("post.user_email"));
$book->setUpdatedAt(date("Y-m-d H:i:s"));
$book->save();
$this->page_debug(lang::get("Has been saved!"), getFromUrl());
}
$this->page_debug(lang::get("Has been saved!"), getFromUrl());
}
示例12: ajax
/**
* AJAX取得数据
*/
function ajax()
{
$comment = sf::getModel("comments");
$type = input::getInput("post.type") ? input::getInput("post.type") : input::getInput("get.type");
if (input::getInput("post.content")) {
if (input::getInput("session.SafetyCode") != input::getInput("post.SafetyCode")) {
$this->page_debug(lang::get("The safety code is error!"), getFromUrl());
}
$comment->setTypeStr(input::getInput("post.type"));
$comment->setContent(input::getInput("post.content"));
$comment->setUserId(input::getInput("session.userid"));
$comment->setUserName(input::getInput("post.user_name") ? input::getInput("post.user_name") : 'Guest');
$comment->setUpdatedAt(date("Y-m-d H:i:s"));
$comment->save();
}
view::set("type", $type);
view::set("pager", $comment->selectAll("`type_str` = '" . $type . "' ", "ORDER BY updated_at DESC", 5));
view::display("comment/comment");
}
示例13: index
/**
* иб╦═╝Ы└Щ
*/
function index()
{
if (input::getInput("post")) {
$order = sf::getModel("order_froms");
$order->setSubject(input::getInput("post.subject"));
$order->setNumber(input::getInput("post.number"));
$order->setPrice(input::getInput("post.price"));
$order->setUserId(input::getInput("session.userid"));
$order->setUserName(input::getInput("post.user_name"));
$order->setUserSex(input::getInput("post.user_sex"));
$order->setUserMobile(input::getInput("post.user_mobile"));
$order->setUserPhone(input::getInput("post.user_phone"));
$order->setUserFax(input::getInput("post.user_fax"));
$order->setUserEmail(input::getInput("post.user_email"));
$order->setUserAddress(input::getInput("post.user_address"));
$order->setNotebook(input::getInput("post.notebook"));
$order->setUpdatedAt(date("Y-m-d H:i:s"));
$order->save();
$this->page_debug(lang::get("Has been saved!"), getFromUrl());
}
view::set("subject", input::getInput("get.subject"));
view::apply("inc_body", "template/order_from");
view::display("template/page");
}
示例14: comment
/**
* 评论
*/
function comment()
{
$comment = sf::getModel("comments");
$type = input::getInput("post.type") ? input::getInput("post.type") : 'common';
if (input::getInput("post.content")) {
if (config::get('comment_must_login', false) && !input::getInput("session.userid")) {
exit('{state:false,msg:"' . lang::get("You do not have permission to visit!") . '"}');
}
$comment->setTypeStr($type);
input::getInput("post.subject") && $comment->setSubject(input::getInput("post.subject"));
input::getInput("post.content") && $comment->setContent(input::getInput("post.content"));
$comment->setUserId(input::getInput("session.userid") ? input::getInput("session.userid") : 0);
$comment->setUserName(input::getInput("session.username") ? input::getInput("session.username") : 'Guest');
$comment->setUpdatedAt(date("Y-m-d H:i:s"));
if ($comment->save()) {
exit('{state:true,msg:"' . lang::get('Has been save!') . '",subject:"' . $comment->getSubject() . '",content:"' . $comment->getContent() . '",username:"' . $comment->getUserName() . '",date:"' . $comment->getUpdatedAt("Y/m/d") . '"}');
} else {
exit('{state:false,msg:"' . lang::get('Save error!') . '"}');
}
}
view::set("pager", $comment->selectAll("type_str = '" . $type . "' ", 'ORDER BY `updated_at` DESC', config::get('comment_show_max_in_page', 5)));
$htmlStr = view::getContent("common/comment");
exit("{state:true,htmlStr:'" . $htmlStr . "'}");
}
示例15:
<td bgcolor="#fafafa"><input name="price" id="price" />
<span>*</span></td>
</tr>
<tr>
<td bgcolor="#f8f8f8">货物数量:</td>
<td bgcolor="#fafafa"><input name="number" id="number" />
<span>*</span></td>
</tr>
<tr>
<td colspan="2" bgcolor="#f8f8f8">请填写客户信息:</td>
</tr>
<tr>
<td width="15%" bgcolor="#f8f8f8">您的姓名:</td>
<td width="85%" bgcolor="#fafafa"><input name="user_name" value="<?php
echo input::getInput("session.username");
?>
" />
<span>*</span></td>
</tr>
<tr>
<td bgcolor="#f8f8f8">如何称呼:</td>
<td bgcolor="#fafafa"><input type="radio" checked="checked" value="先生" name="user_sex" />
先生
<input type="radio" value="女士" name="user_sex" />
女士</td>
</tr>
<tr>
<td bgcolor="#f8f8f8">移动电话:</td>
<td bgcolor="#fafafa"><input name="user_mobile" id="user_mobile" />
<span>*</span></td>