Admin Management interface-Administrator admin [1]

Source: Internet
Author: User
Tags sql error

In this chapter we begin the design of the background management interface, this section mainly operates the Administrator module.
A L HTML Section
Non-admin login jump
<?php
Session_Start ();
if (!isset ($_session[' admin ')) {
Header (' location:login.php ');
}
?>
DataGrid data table for the Administrator module
<table id= "Manage" ></table>
Toolbar of the Administrator module
<div id= "Manage_tool" style= "padding:5px;" >
<div style= "margin-bottom:5px;" >
<a href= "#" class= "Easyui-linkbutton" iconcls= "Icon-add-new"
Plain= "true" onclick= "Manage_tool.add ();" > Add </a>
<a href= "#" class= "Easyui-linkbutton" iconcls= "Icon-edit-new"
Plain= "true" onclick= "Manage_tool.edit ();" > Modify </a>
<a href= "#" class= "Easyui-linkbutton"
iconcls= "Icon-delete-new" plain= "true" onclick= "Manage_tool.remove ();" >
Delete </a>
<a href= "#" class= "Easyui-linkbutton" iconcls= "Icon-reload"
Plain= "true" onclick= "manage_tool.reload ();" > Refresh </a>
<a href= "#" class= "Easyui-linkbutton" iconcls= "Icon-redo"
Plain= "true" id= "Redo" onclick= "Manage_tool.redo ();" > Cancel Selection </a>
</div>
<div style= "padding:0 0 0 7px;color: #333; " >
Query administrator: <input type= "text" class= "textbox"
Name= "Search_manager" style= "width:110px" >

Created from: <input type= "text" Name= "Date_from"
class= "Easyui-datebox" editable= "false" style= "width:110px" >
To: <input type= "text" name= "date_to" class= "Easyui-datebox"
Editable= "false" style= "width:110px" >
<a href= "#" class= "Easyui-linkbutton" iconcls= "Icon-search"
Onclick= "Manage_tool.search ();" > Enquiry </a>
</div>
</div>
JS file for Administrator module
<script type= "Text/javascript" src= "Js/manager.js" ></script>

Two Y jQuery Section
DataGrid data table
$ (' #manage '). DataGrid ({
URL: ' manager_data.php ',
Fit:true,
Fitcolumns:true,
Striped:true,
Rownumbers:true,
Border:false,
Pagination:true,
PAGESIZE:20,
PageList: [10, 20, 30, 40, 50],
Pagenumber:1,
Sortname: ' Date ',
SortOrder: ' Desc ',
Toolbar: ' #manage_tool ',
Columns: [[
{
Field: ' ID ',
Title: ' Auto Number ',
WIDTH:100,
Checkbox:true,
},
{
Field: ' Manager ',
Title: ' Administrator Account ',
WIDTH:100,
},
{
Field: ' Auth ',
Title: ' Have permission ',

WIDTH:100,
},
{
Field: ' Date ',
Title: ' Creation Time ',
WIDTH:100,
},
]],
});

Three P PHP Section
<?php
Require ' config.php ';
$page = $_post[' page '];
$pageSize = $_post[' rows '];
$first = $pageSize * ($page-1);
er = $_post[' order '];
$sort = $_post[' sort '];
$query = mysql_query ("Select Id,manager,auth,date from Easyui_admin
ORDER by $sort er LIMIT $first, $pageSize ") or Die (' SQL Error! ‘);
$total = mysql_num_rows (mysql_query ("Select Id,manager,auth,date
From Easyui_admin "));
$json = ";
while (!! $row = Mysql_fetch_array ($query, Mysql_assoc)) {
$json. = Json_encode ($row). ', ';
}
$json = substr ($json, 0,-1);
Echo ' {"Total": '. $total. ', "Rows": ['. $json. ']} ';
Mysql_close ();
?>

Admin Management interface-Administrator admin [1]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.