求按照CI框架分离html页面
在网上找了一个移序的功能,但是代码是php、mysql、html混搭的,现在用的是CI框架,刚接触框架不久,不会分离,请各位帮忙照着CI框架的模式分离这个页面
数据库页面:class_moder.php
处理页面:admin.php
html页面:sort.html
<br> nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br> <br> <br> <meta> <br> <title>实现新闻的上移下移功能</title> <br> <br> <br> <br> <style> <br /> *{font-size:12px;} <br /> td{height:24px; line-height:24px; text-align:center} <br /> </style> <br> <br> <?php <br /> header("Content-type:text/html;charset=gb2312"); <br> include("mysql.class.php"); <br> $conn=new mysql("localhost","root","root","test"," ","gbk"); <br> if(!emptyempty($_GET["weight"])){ <br> if($_GET["move"]=="up"){ <br> //获取上一条新闻信息 <br> $query=$conn->query("select * from `article` where `weight` > '$_GET[weight]' order by `weight` asc limit 1"); <br> if($conn->db_num_rows(query)>0){ <br> $rows=$conn->fetch_array($query); <br> $conn->query("update `article` set `weight`='$rows[weight]' where `weight`='$_GET[weight]'"); <br> $conn->query("update `article` set `weight`='$_GET[weight]' where `ID`='$rows[ID]'"); <br> }else{ <br> echo "<script>alert('已经在最顶上');</script>"; <br> } <br> }else if($_GET["move"]=="down"){ <br> //获取下一条新闻信息 <br> $query=$conn->query("select * from `article` where `weight` if($conn->db_num_rows(query)>0){ <br> $rows=$conn->fetch_array($query); <br> $conn->query("update `article` set `weight`='$rows[weight]' where `weight`='$_GET[weight]'"); <br> $conn->query("update `article` set `weight`='$_GET[weight]' where `ID`='$rows[ID]'"); <br> }else{ <br> echo "<script>alert('已经在最底下');</script>"; <br> } <br> } <br> } <br> ?> <br>
ID | 标题 | 移动 |