<div class="page-breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="fa fa-home"></i>
            <a href="#" style="color: #797979">主頁</a>
        </li>

        <li class='active' style='color:#ef4130'>管理員帳戶</li>
    </ul>
</div>

<div class="page-header position-relative">
    <div class="header-title">
        <h1>
            管理員帳戶
        </h1>
    </div>
    <!--Header Buttons-->
    <div class="header-buttons">
        <a class="sidebar-toggler" href="#">
            <i class="glyphicon glyphicon-resize-horizontal"></i>
        </a>
        <a class="refresh" id="refresh-toggler" href="#">
            <i class="glyphicon glyphicon-refresh"></i>
        </a>
        <a class="fullscreen" id="fullscreen-toggler" href="#">
            <i class="glyphicon glyphicon-fullscreen"></i>
        </a>
    </div>
    <!--Header Buttons End-->
</div>

<div class="content">
    <table class="partial_form_table">
        <form method="post" action="/backend/admin/update">
            <tr>
                <td class="partial_form_label">
                    <label>名字</label>
                </td>
                <td>
                    <input type="text" class="form-control" id="first_name" name="first_name" placeholder="請填寫用戶名字" value="<?=$first_name?>">
                </td>
            </tr>
            <tr>
                <td class="partial_form_label">
                    <label>姓氏</label>
                </td>
                <td>
                    <input type="text" class="form-control" id="last_name" name="last_name" placeholder="請填寫用戶姓氏" value="<?=$last_name?>">
                </td>
            </tr>
            <tr>
                <td class="partial_form_label">
                    <label>登入名稱</label>
                </td>
                <td>
                    <input type="text" class="form-control" id="username" name="username" placeholder="請填寫電郵地址，作為登入名稱" value="<?=$username?>">
                </td>
            </tr>
            <tr>
                <td class="partial_form_label">
                    <label>電話號碼</label>
                </td>
                <td>
                    <input type="text" class="form-control" id="phone" name="phone" placeholder="請填寫聯絡電話" value="<?=$mobile?>">
                </td>
            </tr>
            <tr>
                <td class="partial_form_label">
                    <label>設定密碼</label>
                </td>
                <td>
                    <input type="password" class="form-control" id="password" name="password" placeholder="請填寫登入密碼">
                </td>
            </tr>
            <tr>
                <td class="partial_form_label">
                    <label>確認密碼</label>
                </td>
                <td>
                    <input type="password" class="form-control" id="confirm_password" name="confirm_password" placeholder="請重新輸入密碼">
                </td>
            </tr>
            <tr>
                <td></td>
                <td><small>登入名稱為英文字或數字組成（不分大小寫）</small></td>
            </tr>

            <tr>
                <td>

                </td>
                <td>
                    <input type="hidden" name="id" value="<?=$id?>">
                    <button type="submit" class="btn btn-default submit" value="確定">確定</button>
                </td>
            </tr>
        </form>
    </table>
</div>

<script>
$('.submit').on('click',function(){
    if($('#first_name').val() == ''){
        alert('請輸入用戶名字');
        return false;
    }
    if($('#last_name').val() == ""){
        alert('請輸入用戶姓氏');
        return false;
    }
    if($("#username").val() == ''){
        alert("請輸入登入名稱");
        return false;
    }
    if($('#phone').val() == ""){
        alert("請輸入電話號碼");
        return false;
    }
    if($('#password').val() ==""){
        alert("請輸入密碼");
        return false;
    }
    if($('#confirm_password').val() == ""){
        alert('請再次輸入密碼以作確認');
        return false;
    }

    if($('#password').val() != $('#confirm_password').val()){
        alert("兩組密碼不相同");
        return false;
    }
});
</script>

