123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- @extends('admin.master')
-
- @section('content')
- <div class="row">
- <div class="col-lg-12">
- <!-- 指定新增的端點 -->
- <form id="EditForm" class="form-horizontal" method="post"
- action="{{ url('/backend/dataManagement/tcheckinManagement/store') }}">
- {{ csrf_field() }}
- <div class="panel panel-primary">
- <div class="panel-heading">
- <!-- 更改文案 -->
- <h4 class="panel-title">{{ ($operdata == "") ? "Create " : "Modify " }}簽到贈點</h4>
- </div>
- <div class="panel-body">
- <div>
- <!-- 表格本體 -->
- <table class="table" cellspacing="0" id="DetailsView1" style="border-collapse:collapse;">
- <tbody>
- <!-- 欄位:自增量 -->
- @if ($operdata == "")
- <input type="hidden" name="mode" value="insert"/>
- <!-- Insert Mode -->
- @else
- <!-- Edit Mode -->
- <tr>
- <td class="col-lg-2">自增量</td>
- <td>
- <input name="id" type="hidden" value="{{ $operdata['id'] }}" id="id"/>
- {{ $operdata['id'] }}
- </td>
- </tr>
- @endif
- <!-- 欄位:滿幾天 -->
- <!-- ALL Mode -->
- <tr>
- <td class="header-require col-lg-2">滿幾天</td>
- <td>
- <div class="col-lg-3 nopadding">
- @if ($operdata == "")
- <input name="day" type="text" value="" maxlength="2" id="day"
- class="form-control">
- @else
- <input name="day" type="text" value="{{ $operdata['day'] }}"
- maxlength="2" id="day" class="form-control">
- @endif
- <label class="error" for="day"></label>
- </div>
- </td>
- </tr>
- <!-- 欄位:吉點 -->
- <!-- ALL Mode -->
- <tr>
- <td class="header-require col-lg-2">吉點</td>
- <td>
- <div class="col-lg-3 nopadding">
- @if ($operdata == "")
- <input name="gp" type="text" value="" maxlength="2" id="gp"
- class="form-control">
- @else
- <input name="gp" type="text" value="{{ $operdata['gp'] }}"
- maxlength="2" id="gp" class="form-control">
- @endif
- <label class="error" for="gp"></label>
- </div>
- </td>
- </tr>
- <!-- 欄位:建立日期 -->
- <!-- ALL Mode -->
- @if ($operdata == "")
- @else
- <tr>
- <td class="header-require col-lg-2">建立日期</td>
- <td>
- <div class="col-lg-3 nopadding">
- {{ $operdata['cdate'] }}
- </div>
- </td>
- </tr>
- @endif
- <!-- 欄位:最後修改日期 -->
- <!-- ALL Mode -->
- @if ($operdata == "")
- @else
- <tr>
- <td class="header-require col-lg-2">最後修改日期</td>
- <td>
- <div class="col-lg-3 nopadding">
- {{ $operdata['mdate'] }}
- </div>
- </td>
- </tr>
- @endif
- <!-- 欄位:最後修改人 -->
- <!-- ALL Mode -->
- @if ($operdata == "")
- @else
- <tr>
- <td class="header-require col-lg-2">最後修改人</td>
- <td>
- <div class="col-lg-3 nopadding">
- {{ $operdata['oid'] }}
- </div>
- </td>
- </tr>
- @endif
- <!-- 下控制按鈕 -->
- <tr>
- <td> </td>
- <td>
- <div style="text-align: right">
- @if ($operdata == "")
- <!-- Insert Mode -->
- <input type="submit" name="btnUpdate_foot" value="Create"
- id="btnUpdate_foot" class="btn btn-primary btn-xs"
- onclick="submitForm();">
- @else
- <!-- Edit Mode -->
- <input type="submit" name="btnUpdate_foot" value="Modify"
- id="btnUpdate_foot" class="btn btn-primary btn-xs"
- onclick="submitForm();">
- @endif
- <input type="button" name="btnBackTo2_foot" value="Back"
- id="btnBackTo2_foot" class="btn btn-default btn-xs">
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <!-- panel-body -->
- </div>
- </form>
- </div>
- </div>
- @endsection
-
- @section('extjs')
- <script>
- $(document).ready(function () {
- $("#btnBackTo2").click(function () {
- // 上方的返回列表按鈕觸發
- location.href = '{{ url('backend/dataManagement/tcheckinManagement') }}';
- });
- $("#btnBackTo2_foot").click(function () {
- // 下方的返回列表按鈕觸發
- location.href = '{{ url('backend/dataManagement/tcheckinManagement') }}';
- });
- // 初始化需要偵錯的表格
- $('#EditForm').validate();
- // 正規表達驗證初始化
- $.validator.addMethod(
- "regex",
- function (value, element, regexp) {
- var re = new RegExp(regexp);
- return this.optional(element) || re.test(value);
- }
- );
- // 各欄位
- $('#day').rules("add", {
- required: true,
- number: true,
- minlength: 1,
- maxlength: 2,
- messages: {
- required: "滿幾天 length must between 1-2",
- number: "滿幾天 must number",
- minlength: "滿幾天 length must between 1-2",
- maxlength: "滿幾天 length must between 1-2"
- }
- });
- $('#gp').rules("add", {
- required: true,
- number: true,
- minlength: 1,
- maxlength: 2,
- messages: {
- required: "吉點 length must between 1-2",
- number: "吉點 must number",
- minlength: "吉點 length must between 1-2",
- maxlength: "吉點 length must between 1-2"
- }
- });
- });
-
- //提交與取消按鈕
- function submitForm() {
- if (!!($("#EditForm").valid()) === false) {
- return false;
- } else {
- $(document).ready(function () {
- $.blockUI({
- css: {
- border: 'none',
- padding: '15px',
- backgroundColor: '#000',
- '-webkit-border-radius': '10px',
- '-moz-border-radius': '10px',
- opacity: .5,
- color: '#FFF'
- }
- });
- });
- }
- }
-
- function cancelValidate() {
- $("#EditForm").validate().cancelSubmit = true;
- }
-
- </script>
- @endsection
|