Title1

Title2

Title3

18-3 op_form 樣板


    {* prod.php and op_form *}
    {if $WEB.file_name == "prod.php" and $op == "op_form"}
      <div class="container" style="margin-top:20px;">
        <div style="margin:10px 0;">
          <button onclick="window.location.href='{$smarty.session.CurrentUrl}'" type="button" class="btn btn-warning">返回</button>
        </div>
        <div class="panel panel-primary">
          <div class="panel-heading">
            <h3 class="panel-title">{$DBV.form_title}</h3>
          </div>
          <div class="panel-body">
            <form action="{$WEB.file_name}" method="post" enctype="multipart/form-data">

              <div class="row">

                <div class="col-md-6">
                  <div class="form-group">
                    <label>標題</label>
                    <input type="text" class="form-control" id="title " name="title" value="{$DBV.title}" placeholder="標題">
                  </div>
                </div>

                <div class="col-md-2">
                  <div class="form-group">
                    <label style="display:block;">啟用狀態</label>

                    <input type='radio' name='enable' id='enable_1' value='1' {if $DBV.enable==1}checked{/if} >
                    <label for='enable_1'>是</label>&nbsp;&nbsp;

                    <input type='radio' name='enable' id='enable_0' value='0' {if $DBV.enable==0}checked{/if}>
                    <label for='enable_0'>否</label>

                  </div>
                </div>

                <div class="col-md-2">
                  <div class="form-group">
                    <label>排序</label>
                    <input type="text" class="form-control" id="sort"  name="sort"  value="{$DBV.sort}" placeholder="排序">
                  </div>
                </div>

              </div>
              <div class="row">
                <div class="col-md-3">
                  <div class="form-group">
                    <label>類別</label>
                    <select name="kind" class="form-control" size="1">
                      <{$DBV.kind_option}>
                    </select>
                  </div>

                </div>
                <script src="{$smarty.const.WEB_URL}/class/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
                <div class="col-md-3">
                  <div class="form-group">
                    <label>日期</label>
                    {$DBV.date}
                  </div>
                </div>
                <div class="col-md-3">
                  <div class="form-group">
                    <label>價格</label>
                    <input type="text" class="form-control" id="price"  name="price"  value="{$DBV.price}" placeholder="價格">
                  </div>

                </div>
              </div>
              <!-- 摘要-->
              <div class="row">
                <div class="col-md-12">
                  <div class="form-group">
                    <label>摘要</label>
                    <textarea class="form-control" rows="5" id="summary" name="summary">{$DBV.summary}</textarea>
                  </div>
                </div>
              </div>

              <script src="{$smarty.const.WEB_URL}/class/ckeditor/ckeditor.js"></script>
              <!-- 內容-->
              <div class="row">
                <div class="col-md-12">
                  <div class="form-group">
                    <label>內容</label>
                    <textarea class="form-control" rows="5" id="content" name="content">{$DBV.content}</textarea>
                  </div>
                </div>
              </div>
              <script>
                  CKEDITOR.replace( 'content' );
              </script>

              <div class="row">
                <div class="col-md-9">
                  <div class="form-group">
                    <label>上傳圖片</label>
                    <input name='file' type="file" id="file" class="form-control" accept="image/*" >
                  </div>
                </div>
                {if $DBV.file_name}
                  <div class="col-md-3">
                    <img src="{$DBV.file_name}" class="img-responsive" />
                  </div>
                {/if}
              </div>


              <!--用來控制程式流程-->
              <input type="hidden" name="op" value="{$DBV.op}">
              <input type="hidden" name="sn" value="{$DBV.sn}">
              <button type="submit" class="btn btn-default">送出</button>
            </form>



          </div>
        </div>
      </div>

    {/if}