JSlip  1.0
user_menu_select.tmplt
Go to the documentation of this file.
1 <?php
2 /**
3  * @link https://datagram.co.jp/source/bksj for the canonical source repository
4  * @copyright Copyright (c) 2006-2019 Datagram Ltd. (https://datagram.co.jp)
5  * @license https://datagram.co.jp/source/bksj/license.txt
6  */
7 
8 $view = $ctrl->view;
9 $basic = $ctrl->dat['basic'];
10 $err = (empty($ctrl->dat['err'])) ? [] : $ctrl->dat['err'];
11 $bid = $_SESSION['minfo']['bid'];
12 ?>
13 <script type="text/javascript">
14 
15  var my = {
16 
17  next: null,
18  func: null,
19  act: null,
20  bid: null,
21  v_bid: null,
22  err: <?php echo json_encode($err) ?>,
23 
24  gotoNext: function(func) {
25  this.func.val(func);
26  this.bid.val(<?= $bid ?>);
27  this.act.val('');
28  this.next.attr('target', '_self');
29  this.next.submit();
30  return false;
31  },
32 
33  setBid: function() {
34  this.func.val('UserMenu');
35  this.bid.val(this.v_bid.val());
36  this.act.val('setBid');
37  this.next.attr('target', '_self');
38  this.next.submit();
39  return false;
40  },
41 
42  chkErr: function() {
43  for (var i in this.err) {
44  alert("Error : " + i + " : " + this.err[i]);
45  }
46  },
47 
48  init: function() {
49  this.next = $('#next');
50  this.func = $('#func');
51  this.act = $('#act');
52  this.bid = $('#bid');
53  this.v_bid = $('#v_bid');
54  this.chkErr();
55  }
56  }
57 
58  $(function(){
59  my.init();
60  });
61 
62 </script>
63 
64 <form method="post" name="next" id="next" action="<?= $base ?>">
65  <input type="hidden" name="func" id="func">
66  <input type="hidden" name="bid" id="bid">
67  <input type="hidden" name="act" id="act">
68 </form>
69 
70 <table id="my_header" width="100%">
71  <tr>
72  <td align="left">&nbsp;メニュー</td>
73  <td align="right">
74  <button type="button" class="my_magenta" style="width: 120px;" onclick="return my.gotoNext('Login'); ">ログアウト</button>
75  </td>
76  </tr>
77 </table>
78 
79 <br>
80 
81 <table width="100%">
82  <tr>
83  <td align="center">
84  <select id="v_bid">
85 <?php
86 foreach ($basic as $b) {
87  $slct = ($bid == $d['id']) ? ' selected' : '';
88  $opt = $view->str($b['disp_name'])
89  . ' ' . $view->str($b['term_year']) . '年度'
90  . '(' . $view->strDate($b['term_begin'])
91  . '~' . $view->strDate($b['term_end']) . ')'
92  ;
93  echo '<option value="' . $b['id'] . '"' . $slct . '>' . $opt . '</option>' . "\n";
94 }
95 ?>
96  </select>
97  </td>
98  </tr>
99  <tr>
100  <td align="center">
101  &nbsp;
102  </td>
103  </tr>
104  <tr>
105  <td align="center">
106  <button type="button" class="my_cyan" style="width: 100px;" onclick="return my.setBid();">決定</button>
107  </td>
108  </tr>
109 </table>