html
$select_uint_form="
單位:";
$select_user_form="
使用者:";
javascript
ajax.php
include_once "header.php";
$op=(empty($_REQUEST['op']))?"main":$_REQUEST['op'];
$unit=intval($_REQUEST['unit']);
switch($op){
//
case "get_user":
echo get_user_form_unit($unit);
//echo json_encode(array("prod_sort"=>$main['prod_sort'],"total"=>$main['total']));
break;
//預設動作
default:
$main="";
break;
}
#################################################################################
# 以單位取得使用者的選單
#
#
#
#
#
################################################################################
function get_user_form_unit($unit_sn){
global $xoopsDB;
$sql="select a.* ,b.`name`,b.`uname` from ".$xoopsDB->prefix("ugm_apply_users")." as a left join ".$xoopsDB->prefix("users")." as b on a.`uid`=b.`uid` where a.`unit_sn`='{$unit_sn}' ";
$result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error());
$main="";
while($all=$xoopsDB->fetchArray($result)){
foreach($all as $k=>$v){
$$k=$v;
}
$uid_name=$name?$name:$uname;
$main.="";
}
return $main;
}
沒有留言:
張貼留言