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="上一步";

沒有留言: