You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
142 lines
5.4 KiB
142 lines
5.4 KiB
<?php
|
|
include "header.php";
|
|
|
|
// 與會人員部門選單
|
|
$attend_str = "";
|
|
$sql = "select department_id, name from department group by department_id order by department_id;";
|
|
$res = mysqli_query($link, $sql);
|
|
while ($row = mysqli_fetch_row($res)) {
|
|
list($department_id, $department_name) = $row;
|
|
$sql2 = "select accountid, name from account where department_id = '$department_id' order by role_id";
|
|
$res2 = mysqli_query($link, $sql2);
|
|
while ($row2 = mysqli_fetch_row($res2)) {
|
|
$attend_str .= '<option value="'.$row2[0].'" data-section="'.$department_name.'" data-index="1">'.$row2[1].'</option>';
|
|
}
|
|
mysqli_free_result($res2);
|
|
}
|
|
mysqli_free_result($res);
|
|
|
|
// 會議時間
|
|
$stime_str = $etime_str = "";
|
|
$now_min = date("i");
|
|
if ($now_min < 30) $next_start = date("H").":30:00";
|
|
else $next_start = date("H", strtotime("+1 hour")).":00:00";
|
|
$next_end = date("H:i:s", strtotime("+1 hour -1 second", strtotime($next_start)));
|
|
//echo $next_start."~".$next_end;
|
|
for ($i=8; $i<24; $i++) {
|
|
$hour = str_pad($i, 2, "0", STR_PAD_LEFT);
|
|
for ($j=0; $j<2; $j++) {
|
|
$min = str_pad($j*30, 2, "0", STR_PAD_LEFT);
|
|
$stime_sel = $hour.":".$min.":00";
|
|
$stime_str .= '<option value="'.$stime_sel.'"';
|
|
if ($next_start == $stime_sel) $stime_str .= ' selected';
|
|
$stime_str .= '>'.substr($stime_sel, 0, 5).'</option>';
|
|
|
|
$min = str_pad($j*30+29, 2, "0", STR_PAD_LEFT);
|
|
$etime_sel = $hour.":".$min.":59";
|
|
$etime_sel_text = date("H:i", strtotime("+1 second", strtotime($etime_sel)));
|
|
$etime_str .= '<option value="'.$etime_sel.'"';
|
|
if ($next_end == $etime_sel) $etime_str .= ' selected';
|
|
$etime_str .= '>'.$etime_sel_text.'</option>';
|
|
}
|
|
}
|
|
?>
|
|
<link rel="stylesheet" href="css/tree/jquery.tree-multiselect.min.css">
|
|
<script src="css/tree/jquery-ui.min.js"></script>
|
|
<script src="css/tree/jquery.tree-multiselect.js"></script>
|
|
<style type="text/css">
|
|
@media screen and (max-width: 992px){
|
|
|
|
}
|
|
</style>
|
|
<div class="container">
|
|
<?php
|
|
include "meeting-record-submit.php";
|
|
/*
|
|
if($_SERVER["REQUEST_METHOD"] == "POST"){
|
|
if(empty($_POST["id"]) && empty($_POST["expert_id"]) && empty($_POST["personal_id"])){
|
|
echo "<p class='error'>Please fill up the required field!</p>";
|
|
} else {
|
|
echo "<p class='success'>Record has added successfully</p>";
|
|
}
|
|
}
|
|
*/
|
|
?>
|
|
|
|
<form class="form-inline" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
|
|
<div>
|
|
<label for="title">會議主題</label>
|
|
<input type="text" name="title" id="title" size="30" maxlength="25" required>
|
|
</div>
|
|
<div>
|
|
<label for="mdate">會議日期</label><br>
|
|
<input type="date" name="mdate" id="mdate" class="form-control" value="<?php echo date("Y-m-d"); ?>" required>
|
|
</div>
|
|
<div>
|
|
<label for="stime">開始時間</label>
|
|
<select name="stime">
|
|
<?php echo $stime_str; ?>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="etime">結束時間</label>
|
|
<select name="etime">
|
|
<?php echo $etime_str; ?>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="room">地點</label>
|
|
<select name="room" id="room" required>
|
|
<option value="">請選擇</option>
|
|
<option value="1">C區會議室1</option>
|
|
<option value="2">C區會議室2</option>
|
|
<option value="3">大直會議室</option>
|
|
<option value="4">網路會議</option>
|
|
<option value="5">其他</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="equip">使用資源</label>
|
|
<input type="text" name="equip" id="equip" size="30" maxlength="25">
|
|
</div>
|
|
<div>
|
|
<label for="content">會議內容</label><br>
|
|
<textarea class="form-control" name="content" id="content" rows="8" cols="70" required></textarea>
|
|
</div>
|
|
<div style="width:100%">
|
|
<label for="attend">與會人員</label><br>
|
|
<select id="attend" multiple="multiple">
|
|
<?php echo $attend_str; ?>
|
|
<!--
|
|
<option value="abc" data-section="section/ayy" data-index="1">abc</option>
|
|
<option value="ayyy" >ayyy</option>
|
|
<option value="disabled1" readonly>wow it's readonly</option>
|
|
<option value="disabled2" readonly>also readonly!</option>
|
|
-->
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<br>
|
|
<button type="submit" name="submit" id="submit">確定</button>
|
|
<h4 class="text-danger">按下「確定」後,系統將發信通知已勾選的與會人員!</h4>
|
|
</div>
|
|
<input type="hidden" name="create_at" value="<?php echo date("Y-m-d H:i:s"); ?>">
|
|
<input type="hidden" name="attend_all" id="attend_all">
|
|
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
|
</form>
|
|
</div>
|
|
<script>
|
|
var tree = $("#attend").treeMultiselect({
|
|
allowBatchSelection: true,
|
|
//enableSelectAll: true,
|
|
//searchable: true,
|
|
sortable: true,
|
|
startCollapsed: true
|
|
});
|
|
$(function(){
|
|
$('#submit').click(function(){
|
|
$('#attend_all').val($("#attend").val());
|
|
});
|
|
});
|
|
</script>
|
|
<?php include "footer.php"; ?>
|
|
|