2013年8月5日 星期一

保留修改報名表單的網址

1.報名完成後,按「修改回覆內容」

2.請將「網址」,反白->複製->保存。若有需要修改時,則把網址貼至「網址列」即可修改


2013年8月3日 星期六

模組開發物件

按鈕
$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();
 }

2.

$last_button="上一步";

2013年7月25日 星期四

「UGM_自訂頁面」模組更新(2.0)

  1. 這一版的更新主要是將模組改為XOOPS 2.5.5的模組架構
    示範網站:http://www.taytzang.com.tw/web/
    請先上傳覆蓋模組,並執行模組更新:

  2. 檔案下載位置:
  3. 育將電腦工作室:XOOPS 模組開發及修改
    聯絡:tawan158@gmail.com ugm

2013年7月22日 星期一

「UGM_自訂頁面」模組更新(1.8)增加英文語系


  1. 這次更新主要是增加英文語系。
     示範網站:http://www.taytzang.com.tw/web
    請先上傳覆蓋模組,並執行模組更新:


2.檔案下載位置:



3.育將電腦工作室:XOOPS 模組開發及修改
   聯絡:tawan158@gmail.com     ugm

2013年7月8日 星期一

「UGM_自訂頁面」模組更新(1.8)增加佈景引入「下拉選單」、「圖片輪撥」功能



這次更新主要是增加增加佈景引入「下拉選單」、「圖片輪撥」功能。

示範網站:http://www.dawandrive.com.tw/index.php


1.請先上傳覆蓋模組,並執行模組更新,然後至偏好設定,設定「圖片輪撥」、「下拉選單」佈景的設定

2.請在佈景檔,適當位置加入下方語法


    <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.請建立下拉選單及圖片輪撥的資料

4.檔案下載位置:


2013年5月25日 星期六

XOOPS的時間函數運用(new)

本範例為「日期示範」

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));
# ---------------------------------------------------------------------------

 

2013年5月19日 星期日

收合插件

  • 將「ddaccordion」資料夾放入 「class」
  • ddaccordion() 函數放入「block_function.php」
#--------------------- 引入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");

2013年5月1日 星期三

dropbox

申請帳號:http://db.tt/z5mauB9b


把dropbox當「圖床」或放js、html,然後連結blog

只要把檔案放在dropbox的「Public」資料夾,

然後執行「copy public link」取得網址即完成。

例如:

http://www.shanmei.info/ 這個網站的slide

是放在:

https://dl.dropbox.com/u/61459273/www/shanmei/slide/index.html

很簡單吧~~~

2013年4月28日 星期日

連動選單



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;
}


2013年4月27日 星期六

涷結窗格

  $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;