1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
<?php $page_settings = array( 'formid' => 'Approval', // for permission 'section' => 'Master', // parent/page title 'subsection' => 'App Notification', // page title 'domain' => 'app_notification', // table/model name 'access' => 'GNr', // for permission ); require_once "check_login.php";
$sql = "select student_main.cmsloginid, student_main.student_no, student_main.contactname from student_main inner join sys_cms_login on sys_cms_login.cmsloginid = student_main.cmsloginid where student_main.deleted = ? and sys_cms_login.deleted = ? and sys_cms_login.app_device_id is not null and sys_cms_login.app_notification_token is not null order by student_main.student_no ASC"; $parameters = array(0, 0); $students = bind_pdo($sql, $parameters, "selectall");
$sql = "select tutor_main.cmsloginid, tutor_main.tutor_no, tutor_main.nickname from tutor_main inner join sys_cms_login on sys_cms_login.cmsloginid = tutor_main.cmsloginid where tutor_main.deleted = ? and sys_cms_login.deleted = ? and sys_cms_login.app_device_id is not null and sys_cms_login.app_notification_token is not null order by tutor_main.tutor_no ASC"; $parameters = array(0, 0); $tutors = bind_pdo($sql, $parameters, "selectall"); ?> <!DOCTYPE html> <html> <head> <?php require_once "_html_head.php"; ?> </head> <body class="hold-transition skin-blue sidebar-mini"> <div class="wrapper">
<?php require_once "_header.php"; ?>
<?php require_once "_menu.php"; ?>
<!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header">
<h1> <?= _lang($page_settings['subsection']) ?> <small><?= _lang("Create") ?></small> </h1>
<ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> <?= _lang($page_settings['section']) ?></a></li> <li class="active"> <a href="<?= $page_settings['domain'] ?>_index.php"><?= _lang($page_settings['subsection']) ?></a> </li> </ol>
</section>
<!-- Main content --> <section class="content">
<!-- Your Page Content Here -->
<!-- main form --> <form action="<?= $page_settings['domain'] ?>_process.php" class="myform" method="POST" enctype="multipart/form-data"> <input type="hidden" name="action" value="ADD"/>
<div class="row"> <div class="col-xs-12"> <div class="box">
<div class="box-header"> <div class="col-md-3"> <div class="btn-group"> <a href="<?= $page_settings['domain'] ?>_index.php" class="btn btn-default"><i class="fa fa-chevron-left" aria-hidden="true"></i> <?= _lang('Cancel') ?> </a>
<button type="submit" class="btn btn-primary"> <i class="fa fa-floppy-o" aria-hidden="true"></i> <?= _lang('Save') ?> </button> </div> </div> <div class="col-md-6"> <!--<h3 class="box-title"><? /*= _h($row["name_{$_SESSION["wlangcode"]}"]) */ ?> (<? /*= _h($row["code"]) */ ?>)</h3>--> </div>
<div class="col-md-12 msg"> <?php if (isset($_GET["msg"])) echo $_GET['msg']; ?> </div> </div>
<!-- /.box-header --> <div class="box-body"> <div class="col-md-12 form-group"> <label for="" class="col-sm-3 control-label required_field">通知標題</label> <div class="col-sm-9 form-group"> <input type="text" name="title" class="form-control input-sm"> </div> </div>
<div class="col-md-12 form-group"> <label for="" class="col-sm-3 control-label required_field">通知內容</label> <div class="col-sm-9 form-group"> <input type="text" name="content" class="form-control input-sm"> </div> </div>
<div class="col-md-12 form-group"> <label for="" class="col-sm-3 control-label required_field">發送給用戶<br>只顯示APP用戶</label> <div class="col-sm-9 form-group"> <div class="col-sm-6 form-group"> <?php echo '學生用戶: <button type="button" id="select_all_student" onclick="select_all(\'.student\', this)">全選</button><br>'; foreach ($students as $student) { echo '<input type="checkbox" name="to_cmsloginid[]" value="' . $student["cmsloginid"] . '|' . $student["contactname"] . ' (' . $student["student_no"] . ')" class="student"> ' . $student["contactname"] . ' (' . $student["student_no"] . ')<br>'; } ?> </div>
<div class="col-sm-6 form-group"> <?php echo '導師用戶: <button type="button" id="select_all_tutor" onclick="select_all(\'.tutor\', this)">全選</button><br>'; foreach ($tutors as $tutor) { echo '<input type="checkbox" name="to_cmsloginid[]" value="' . $tutor["cmsloginid"] . '|' . $tutor["nickname"] . ' (' . $tutor["tutor_no"] . ')" class="tutor"> ' . $tutor["nickname"] . ' (' . $tutor["tutor_no"] . ')<br>'; } ?> </div> </div> </div> </div> <!-- /.box-body --> </div> <!-- /.box --> </div> <!-- /.col --> </div> <!-- /.row --> </form>
<!-- End of Your Page Content Here -->
</section><!-- /.content --> </div><!-- /.content-wrapper -->
<?php require_once "_footer.php"; ?>
<?php require_once "_aside.php"; ?>
</div><!-- ./wrapper -->
<!-- REQUIRED JS SCRIPTS --> <?php require_once "_html_script.php"; ?>
<script type="text/javascript"> function select_all(type, _this) { if ($(_this).text() == "全選") { $(type).prop("checked", true).change(); $(_this).text("取消全選"); } else { $(type).prop("checked", false).change(); $(_this).text("全選"); } }
$(function () {
}); </script> </body> </html>
|