<?
function runSQL($rsql) {
$db['default']['hostname'] = "localhost";
$db['default']['username'] = '';
$db['default']['password'] = "";
$db['default']['database'] = "";
$db['live']['hostname'] = 'localhost';
$db['live']['username'] = '';
$db['live']['password'] = '';
$db['live']['database'] = '';
$active_group = 'default';
$base_url = "http://".$_SERVER['HTTP_HOST'];
$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
if (strpos($base_url,'webplicity.net')) $active_group = "live";
$connect = mysql_connect($db[$active_group]['hostname'],$db[$active_group]['username'],$db[$active_group]['password']) or die ("Error: could not connect to database");
$db = mysql_select_db($db[$active_group]['database']);
$result = mysql_query($rsql) or die ('test');
return $result;
mysql_close($connect);
}
function countRec($fname,$tname) {
$sql = "SELECT count($fname) FROM $tname ";
$result = runSQL($sql);
while ($row = mysql_fetch_array($result)) {
return $row[0];
}
}
$page = $_POST['page'];
$rp = $_POST['rp'];
$sortname = $_POST['sortname'];
$sortorder = $_POST['sortorder'];
if (!$sortname) $sortname = 'name';
if (!$sortorder) $sortorder = 'desc';
$sort = "ORDER BY $sortname $sortorder";
if (!$page) $page = 1;
if (!$rp) $rp = 10;
$start = (($page-1) * $rp);
$limit = "LIMIT $start, $rp";
$sql = "SELECT iso,name,printable_name,iso3,numcode FROM country $sort $limit";
$result = runSQL($sql);
$total = countRec('iso','country');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header("Cache-Control: no-cache, must-revalidate" );
header("Pragma: no-cache" );
header("Content-type: text/xml");
$xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$xml .= "<rows>";
$xml .= "<page>$page</page>";
$xml .= "<total>$total</total>";
while ($row = mysql_fetch_array($result)) {
$xml .= "<row id='".$row['iso']."'>";
$xml .= "<cell><![CDATA[".$row['iso']."]]></cell>";
$xml .= "<cell><![CDATA[".utf8_encode($row['name'])."]]></cell>";
//$xml .= "<cell><![CDATA[".print_r($_POST,true)."]]></cell>";
$xml .= "<cell><![CDATA[".utf8_encode($row['printable_name'])."]]></cell>";
$xml .= "<cell><![CDATA[".utf8_encode($row['iso3'])."]]></cell>";
$xml .= "<cell><![CDATA[".utf8_encode($row['numcode'])."]]></cell>";
$xml .= "</row>";
}
$xml .= "</rows>";
echo $xml;
?>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
flexigrid.zip (32个子文件)
flexigrid
css
images
add.png 837B
close.png 828B
.DS_Store 6KB
flexigrid
flexigrid.css 14KB
images
uup.png 130B
wbg.gif 868B
bg.gif 854B
hl.png 189B
last.gif 220B
fhbg.gif 836B
btn-sprite.gif 955B
line.gif 817B
ddn.png 111B
magnifier.png 615B
load.png 827B
up.png 224B
dn.png 220B
load.gif 2KB
next.gif 185B
first.gif 217B
prev.gif 186B
post2.php 2KB
post.php 2KB
flash.png 50KB
sample1.html 3KB
index.html 21KB
lib
jquery
jquery.js 29KB
style.css 2KB
coffee.png 682B
flexigrid.js 39KB
accept.png 781B
flexigrid.pack.js 18KB
共 32 条
- 1
资源评论
loocao
- 粉丝: 47
- 资源: 61
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功