Separate html pages based on the CI framework

Source: Internet
Author: User
After separating html pages based on the CI framework, I found a shift function on the Internet, but the code is php, mysql, and html mashups. now I am using the CI framework. I just got started with the framework, will not be separated, please help to separate this page according to the CI framework mode database page: class_moder.php processing page: adm seeking to separate the html page according to the CI framework
I found a shift-by-order function on the Internet, but the code is php, mysql, and html mashups. now I am using the CI framework and will not be separated shortly after I first came into contact with the framework, please help separate this page according to the CI framework mode
Database page: class_moder.php
Processing page: admin. php
Html page: sort.html


 

 

News is moved up and down 
 

 
 

Header ("Content-type: text/html; charset = gb2312 ");
Include ("mysql. class. php ");
$ Conn = new mysql ("localhost", "root", "root", "test", "", "gbk ");
If (! Emptyempty ($ _ GET ["weight"]) {
If ($ _ GET ["move"] = "up "){
// Obtain the previous news information
$ Query = $ conn-> query ("select * from 'article' where 'weight'> '$ _ GET [weight] 'Order by 'weight' asc limit 1 ");
If ($ conn-> db_num_rows (query)> 0 ){
$ Rows = $ conn-> fetch_array ($ query );
$ Conn-> query ("update 'article' set 'weight' = '$ rows [weight] 'Where 'weight' =' $ _ GET [weight] '");
$ Conn-> query ("update 'article' set 'weight' = '$ _ GET [weight] 'Where 'id' =' $ rows [ID] '");
} Else {
Echo "script" alert ('already at the top '); script ";
}
} Else if ($ _ GET ["move"] = "down "){
// Obtain the next news
$ Query = $ conn-> query ("select * from 'article' where 'weight' <'$ _ GET [weight] 'Order by 'weight' desc limit 1 ");
If ($ conn-> db_num_rows (query)> 0 ){
$ Rows = $ conn-> fetch_array ($ query );
$ Conn-> query ("update 'article' set 'weight' = '$ rows [weight] 'Where 'weight' =' $ _ GET [weight] '");
$ Conn-> query ("update 'article' set 'weight' = '$ _ GET [weight] 'Where 'id' =' $ rows [ID] '");
} Else {
Echo "script" alert ('bottom already '); script ";
}
}
}
?>

Move articles up and down 
 
IDTitleMobile 

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.