1.報名完成後,按「修改回覆內容」
2.請將「網址」,反白->複製->保存。若有需要修改時,則把網址貼至「網址列」即可修改
$add_button="<a href='{$_SERVER['PHP_SELF']}?op=ugm_market_hire_form' class='Button'><span>按鈕</span></a>";
固定表格<table border='0' cellspacing='3' cellpadding='3' id='ugm_tb' style='word-wrap:break-word; word-break:break-all;table-layout:fixed;'>表單
<td><input type='text' name='hier[{$sn}][userfees]' value='{$userfees}' id='userfees_{$sn}' class='validate[required,custom[integer]]' style='width:60px'></td>
<td><input type='text' name='hier[{$sn}][cleaningfees]' value='{$cleaningfees}' id='cleaningfees_{$sn}' class='validate[required,custom[integer]]' style='width:60px'></td>
<td><input type='text' name='hier[{$sn}][delayfees]' value='{$delayfees}' id='delayfees_{$sn}' class='validate[custom[integer]]' style='width:60px'></td>
<td><input type='text' name='hier[{$sn}][ps]' value='{$ps}' id='ps_{$sn}' style='width:140px'></td>
接收foreach ($_REQUEST['hier'] as $sn => $data){
foreach ($data as $k => $v){
//以下會產生這些變數: $userfees, $cleaningfees,$delayfees,$ps
$$k=$v;
}
echo $sn."<br>";
echo $userfees."<br>";
echo $cleaningfees."<br>";
echo $delayfees."<br>";
echo $ps."<br>";
die();
}
$last_button="上一步";
<div >
<{includeq file="$xoops_rootpath/modules/ugm_page/templates/ugm_page_block_slider.html"}> <!-- 引入ugm_page 自訂頁面第一個圖片輪撥 -->
</div>
<div>
<{includeq file="$xoops_rootpath/modules/ugm_page/templates/ugm_page_block_menu.html"}><!-- 引入ugm_page 自訂頁面第一個下拉選單 -->
<div class="clear"></div>
</div>
3.請建立下拉選單及圖片輪撥的資料
本範例為「日期示範」
FORM_預設值:
//設定「start_date」欄位預設值
$start_date=(!isset($DBV['start_date']))?"":date("Y-m-d",xoops_getUserTimestamp($DBV['start_date']));
//設定「end_date」欄位預設值
$end_date=(!isset($DBV['end_date']))?"":date("Y-m-d",xoops_getUserTimestamp($DBV['end_date']));
INSERT_寫入資料庫:
# -------- 處理時間(日期格式->時間戳記) -------------------------------------- $_POST['start_date']=userTimeToServerTime(strtotime($_POST['start_date'])); $_POST['end_date']=userTimeToServerTime(strtotime($_POST['end_date'])); # -------------------------------------------------------------------------
LIST_從資料庫撈出:
# -------- 處理時間(時間戳記->日期格式) -------------------------------------
$start_date=date("Y-m-d",xoops_getUserTimestamp($start_date));
$end_date=date("Y-m-d",xoops_getUserTimestamp($end_date));
# ---------------------------------------------------------------------------
#--------------------- 引入jquery -------------------------------------
if(!file_exists(XOOPS_ROOT_PATH."/modules/tadtools/jquery.php")){
redirect_header("index.php",3, _TAD_NEED_TADTOOLS);
}
include_once XOOPS_ROOT_PATH."/modules/tadtools/jquery.php";
$jquery_path = get_jquery(); //一般只要此行即可
#-------- jquery 收合 --------------------------------
$ddaccordion=ddaccordion();
# 收合內容
$main_body="
<!-- 有標題、內容 -->
<a class='menuitem submenuheader' href='#' >物品類別2</a>
<div class='submenu'>
<table border='0' cellspacing='3' cellpadding='3' id='ugm_tb' style='word-wrap:break-word; word-break:break-all'>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
</table>
</div>
<!-- 有標題、內容 -->
<a class='menuitem submenuheader' href='#' >物品類別2</a>
<div class='submenu'>
<table border='0' cellspacing='3' cellpadding='3' id='ugm_tb' style='word-wrap:break-word; word-break:break-all'>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
<tr class='alt'><td>1111</td></tr>
</table>
</div>
<!-- 有標題、內容 -->
<a class='menuitem ' href='#' >物品類別2</a>
";
$main=$jquery_path.ugm_javascript(1).$ddaccordion."
<form action='{$_SERVER['PHP_SELF']}' method='post' id='myForm' enctype='multipart/form-data'>
<div class='glossymenu'>
{$main_body}
</div>
</form>";
$main=ugm_div("管理主頁",$main,"","width:500px");
$select_uint_form="
單位:";
$select_user_form="
使用者:";
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;
}
$main=$jquery_path.ugm_javascript(1)."
<link href='class/ScrollTable/superTables.css' rel='Stylesheet' type='text/css' />
<script type='text/javascript' src='class/ScrollTable/superTables.js'></script>
<style>
.fakeContainer {
margin: 20px;
padding: 0px;
border: none;
width: 95%;
height: 300px;
overflow: hidden;
}
</style>
<div class='fakeContainer'>
<table id='ugm_tb' border='0' cellspacing='3' cellpadding='3'>
<tr><th>標題</th>{$main_head}</tr>
{$main_body}
</table>
</div>
<script type='text/javascript'>
(function() {
new superTable('ugm_tb', {
cssSkin : 'sSky', //颜色方案
fixedCols : 1 //固定几列
});
})();
</script>
";
# 這裡若用「%」設寬度且標題過長,則垂直捲軸失效
$main=$select_form.ugm_div($xoopsModuleConfig['statements_title']." - {$year} 年 {$month} 月份 各單位領用消耗品統計表",$main,"","width:95%;");
return $main;