:::

10-4 templates/post_form.tpl

<form action="{$action}" id='myForm' method="post" role="form">
    <!-- 事項,描述,到期日,優先順序,是否完成,指派對象 -->
    <div class="form-group">
        <label for="title">事項:</label>
        <input type="text" name="title" id="title" class="form-control" placeholder="請輸入標題" value="{$content.title}">
    </div>

    <div class="form-group">
        <label for="directions">描述:</label>
        <textarea class="form-control" name="directions" id="directions" rows="3">{$content.directions}</textarea>
    </div>

    <div class="form-group">
        <label for="end">到期日:</label>
        <input type="text" name="end" id="end" class="form-control" placeholder="請輸入yyyy-mm-dd"
            value="{$content.title}">
    </div>

    <div class="form-group">
        <label for="priority">優先順序:{$content.priority}</label>
        <select class="form-control" name="priority" id="priority">
            <option value="高" {if $content.priority=='高'} selected {/if}> 高 </option> <option value="中" {if $content.priority=='中'} selected {/if}> 中 </option>
            <option value="低" {if $content.priority=='低'} selected {/if}> 低</option>
        </select>
    </div>

    <div class="form-group">
        <label for="done">是否完成:{$content.done}</label>
        <div class="form-check form-check-inline">
            <label class="form-check-label">
                <input class="form-check-input" type="radio" name="done" id="done_1" value="1" {if $content.done=='1'}checked {/if}> 是
            </label>
        </div>
        <div class="form-check form-check-inline">
            <label class="form-check-label">
                <input class="form-check-input" type="radio" name="done" id="done_0" value="0" {if $content.done=='0' || $content.done==''}checked {/if}> 否
            </label>
        </div>
    </div>

    <div class="form-group">
        <label for="done">指派對象:</label>
        <div class="form-check form-check-inline">
            <label class="form-check-label">
                <input class="form-check-input" type="checkbox" name="assign[]" value="爸爸" {if "爸爸"|in_array:$content.assign_arr}checked="checked" {/if}> 爸爸
            </label>
        </div>
        <div class="form-check form-check-inline">
            <label class="form-check-label">
                <input class="form-check-input" type="checkbox" name="assign[]" value="媽媽" {if "媽媽"|in_array:$content.assign_arr}checked="checked" {/if}> 媽媽
            </label>
        </div>
        <div class="form-check form-check-inline">
            <label class="form-check-label">
                <input class="form-check-input" type="checkbox" name="assign[]" value="哥哥" {if "哥哥"|in_array:$content.assign_arr}checked="checked" {/if}> 哥哥
            </label>
        </div>
        <div class="form-check form-check-inline">
            <label class="form-check-label">
                <input class="form-check-input" type="checkbox" name="assign[]" value="我" {if "我"|in_array:$content.assign_arr}checked="checked" {/if}> 我
            </label>
        </div>
        <div class="form-check form-check-inline">
            <label class="form-check-label">
                <input class="form-check-input" type="checkbox" name="assign[]" value="妹妹" {if "妹妹"|in_array:$content.assign_arr}checked="checked" {/if}> 妹妹
            </label>
        </div>
    </div>
    <hr>
    <div class="text-center">
        <input type="hidden" name="op" value="{$next_op}">
        <input type="hidden" name="sn" value="{$sn}">
        <input type="submit" name="send" value="儲存" class="btn btn-primary" />
    </div>
</form>