/****************************************************** ' System :Eco-footprint 管理ページ ' Content:プレゼント管理リスト表示 '******************************************************/ $top = '../..'; $inc = "$top/inc"; include("$inc/login_check.php"); include("$inc/header.php"); $inc = "$top/../inc"; include("$inc/common.php"); include("$inc/define.php"); include("$inc/database.php"); include("$inc/select.php"); include("$inc/format.php"); include("$inc/list.php"); // アンケート状態 function decode_status($code) { switch ($code) { case 0: return '作成中'; case 1: return '実施中'; case 2: return '終了'; case 3: return '中止'; case 9: return '無効'; } return '不明'; } // 条件decode function decode_type($code) { switch ($code) { case 0: return '全員'; } return '不明'; } //メイン処理 set_global('etc', 'その他管理', 'プレゼント管理', BACK_TOP); // ソート条件 $order_by = order_by(1, 1, 'ps_present_no', 'ps_type', 'ps_name', 'ps_start_date', 'ps_lottery_date', 'ps_status'); // 表示行数条件 $limit = disp_limit(); //$sub1 = "select count(mb_seq_no) from v_member where mb_step=3 and mb_seq_no not in (select li_mb_seq_no from t_present_list)"; $sub1 = "select count(mb_seq_no) from t_member left join t_present_list on mb_seq_no=li_mb_seq_no and li_ps_no=ps_present_no" . " where mb_step=3 and li_mb_seq_no is null and mb_kind is null"; $sub2 = "select count(li_ps_sub_no) from t_present_list where li_status=3 and li_ps_no=ps_present_no"; $sub3 = "select count(li_ps_sub_no) from t_present_list where (li_status=1 or li_status=2) and li_ps_no=ps_present_no"; $sub4 = "select count(li_ps_sub_no) from t_present_list where li_status=9 and li_ps_no=ps_present_no"; $sub5 = "select count(li_ps_sub_no) from t_present_list where li_status=5 and li_ps_no=ps_present_no"; $sql = "select ps_present_no,ps_type,ps_name,ps_start_date,ps_end_date,ps_lottery_date,ps_status,ps_num,($sub1) as entry_count,($sub2) as send_count" . ",($sub3) as ref_count, ($sub4) as del_count, ($sub5) as finish_count" . " from t_present $order_by $limit"; $result = db_exec($sql); $nrow = pg_numrows($result); ?>
=$fetch->ps_present_no?> | =decode_type($fetch->ps_type)?> | =$fetch->ps_name?> | =format_datetime($fetch->ps_start_date)?> 〜 =format_datetime($fetch->ps_end_date)?> | =format_date($fetch->ps_lottery_date)?> | =decode_status($fetch->ps_status)?> | =number_format($fetch->ps_num)?> | =number_format($fetch->entry_count)?> | =$fetch->send_count?> | =$fetch->ref_count?> | =$fetch->del_count?> | =$fetch->finish_count?> |