:::

2-1 blocks/list_signup.php

<?php
function list_signup($options){
  global $xoopsDB;

  $action_id=intval($_GET['action_id']);


  if($action_id){

    include_once XOOPS_ROOT_PATH . "/modules/tadtools/sweet_alert.php";
    $sweet_alert = new sweet_alert();
    $sweet_alert->render("delete_signup", XOOPS_URL."/modules/tad_signup/index.php?op=delete_signup&action_id=", 'action_id', "確定要取消嗎?" , "取消後就不能參加活動囉!" , "是!含淚取消!");

    $signups['action_id']=$action_id;
    $signups['show_button']=$options[0];

    $signups_tbl=$xoopsDB->prefix('signups');
    $users_tbl=$xoopsDB->prefix('users');

    $sql="SELECT b.* FROM `{$signups_tbl}` AS a 
    JOIN `{$users_tbl}` AS b ON a.`uid`=b.`uid`
    WHERE a.`action_id`='{$action_id}'";
    $result = $xoopsDB->query($sql) or web_error($sql);
    $signups['users']=[];

    while($data=$xoopsDB->fetchArray($result)){
        $signups['users'][]=$data;
    }
    return $signups;
  }
}


//編輯函數
function list_signup_edit($options){
    $opt0_1 = $options[0] == 1 ? 'checked' : '';
    $opt0_0 = $options[0] != 1 ? 'checked' : '';

    $form   = "
    <div class='form-group'>
      <label class='col-sm-2 control-label'>
        是否顯示報名按鈕?
      </label>
      <div class='col-sm-10'>
        <label class='radio-inline'>
          <input type='radio' name='options[0]' value=1 {$opt0_1}> 是
        </label>
        <label class='radio-inline disabled'>
          <input type='radio' name='options[0]' value=0 {$opt0_0}> 否
        </label>
      </div>
    </div>";
  return $form;
}

 


:::

書籍目錄

展開 | 闔起

快速登入


http%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D931%26tbsn%3D31

計數器

今天: 3182318231823182
昨天: 8046804680468046
總計: 8041835804183580418358041835804183580418358041835