Server_AccessControl/views/schedule/form.tpl
2020-10-13 17:31:53 +07:00

125 lines
6.4 KiB
Smarty

<style>
.select-picker{
width: 80px;
}
</style>
<input type="hidden" name="CurrentPos" value="">
<div class="row">
<div class="col-md-5">
<div class="form-group" id="name">
<div class="input-group">
<div class="input-group-addon">Tên lịch trình <i class="text-red">*</i></div>
<input type="text" class="form-control" value="{$model->name|default:""}" name="Name">
</div>
<span class="help-block hidden"></span>
</div>
</div>
<div class="col-md-7">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">Chú thích</div>
<input type="text" class="form-control" value="{$model->description|default:""}" name="Description">
</div>
</div>
</div>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Ngày</th>
<th style="width: 25%;" class="text-center">Khung giờ 1</th>
<th style="width: 25%;" class="text-center">Khung giờ 2</th>
<th style="width: 25%;" class="text-center">Khung giờ 3</th>
<th></th>
</tr>
</thead>
<tbody>
{foreach from=$dayOfWeek item=day key=k}
<tr>
<td>{$day}</td>
<td class="text-center">
<div class="time-picker-data" id="data-{$k}1">
{if $model[$k|cat:"Time1"]}
{$time=explode("-",$model[$k|cat:"Time1"])}
{if $time[0]!=="00:00" || $time[1]!=="00:00"}
<span style="cursor: pointer;" onclick="openFormTimePicker(this);" data-id="{$k}1">{$time[0]} - {$time[1]}</span>
{else}
<i class="fa fa-plus fa-1-5x text-green" style="cursor: pointer;" onclick="openFormTimePicker(this);" data-id="{$k}1"></i>
{/if}
{else}
<i class="fa fa-plus fa-1-5x text-green" style="cursor: pointer;" onclick="openFormTimePicker(this);" data-id="{$k}1"></i>
{/if}
</div>
<div class="time-picker-form hidden" id="form-{$k}1">
<input type='text' name='From{$k}1' class="select-picker" value="{$time[0]|default:"00:00"}" readonly="">
-
<input type='text' name='To{$k}1' class="select-picker" value="{$time[1]|default:"00:00"}" readonly="">
</div>
</td>
<td class="text-center">
<div class="time-picker-data" id="data-{$k}2">
{if $model[$k|cat:"Time2"]}
{$time=explode("-",$model[$k|cat:"Time2"])}
{if $time[0]!=="00:00" || $time[1]!=="00:00"}
<span style="cursor: pointer;" onclick="openFormTimePicker(this);" data-id="{$k}2">{$time[0]} - {$time[1]}</span>
{else}
<i class="fa fa-plus fa-1-5x text-green" style="cursor: pointer;" onclick="openFormTimePicker(this);" data-id="{$k}2"></i>
{/if}
{else}
<i class="fa fa-plus fa-1-5x text-green" style="cursor: pointer;" onclick="openFormTimePicker(this);" data-id="{$k}2"></i>
{/if}
</div>
<div class="time-picker-form hidden" id="form-{$k}2">
<input type='text' name='From{$k}2' class="select-picker" value="{$time[0]|default:"00:00"}" readonly="">
-
<input type='text' name='To{$k}2' class="select-picker" value="{$time[1]|default:"00:00"}" readonly="">
</div>
</td>
<td class="text-center">
<div class="time-picker-data" id="data-{$k}3">
{if $model[$k|cat:"Time3"]}
{$time=explode("-",$model[$k|cat:"Time3"])}
{if $time[0]!=="00:00" || $time[1]!=="00:00"}
<span style="cursor: pointer;" onclick="openFormTimePicker(this);" data-id="{$k}3">{$time[0]} - {$time[1]}</span>
{else}
<i class="fa fa-plus fa-1-5x text-green" style="cursor: pointer;" onclick="openFormTimePicker(this);" data-id="{$k}3"></i>
{/if}
{else}
<i class="fa fa-plus fa-1-5x text-green" style="cursor: pointer;" onclick="openFormTimePicker(this);" data-id="{$k}3"></i>
{/if}
</div>
<div class="time-picker-form hidden" id="form-{$k}3">
<input type='text' name='From{$k}3' class="select-picker" value="{$time[0]|default:"00:00"}" readonly="">
-
<input type='text' name='To{$k}3' class="select-picker" value="{$time[0]|default:"00:00"}" readonly="">
</div>
</td>
<td class="text-center">
<div class="btn-group">
<button class="btn btn-info btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-copy"></i>
</button>
<ul class="dropdown-menu" role="menu">
{foreach from=$dayOfWeek item=d_copy key=k_copy}
{if $k_copy!==$k}
<li>
<a href="#" onclick="_copy(this);
return false;" data-from="{$k}" data-target="{$k_copy}">{$d_copy}</a>
</li>
{/if}
{/foreach}
</ul>
</div>
</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="text-right">
<button class="btn btn-primary" onclick="save(this);" data-href="{$url}">
<i class="fa fa-floppy-o"></i> Lưu
</button>
<button class="btn btn-default" data-dismiss="modal">
<span class="fa fa-remove"></span> Hủy
</button>
</div>