
<?php echo $this->extend('/template'); ?>
<?php echo $this->section('content') ?>
<head>
<title>MENGGANTI PASSWORD</title>
</head>


 <div id="dlgkpasss" class="easyui-dialogs" style="width:400px;height:250px;padding:10px 20px"
            closed="true" buttons="#dlg-buttonspass">
        <h3 class="box-title"><span class="glyphicon glyphicon-th-large"></span>&nbsp;&nbsp;SET / UBAH PASSWORD</h3>

        <div>Masukkan Password Lama dan Password Baru/Pengganti<br/><br/></div>
        <form id="fmkpass" method="post" novalidate>

        <input type="hidden" id = "user_id" name="user_id" value="" />  
		<div class="fitem">
            <input id = "passwordold" name="passwordold" class="easyui-textbox" multiline="false"  label="Password Lama" labelPosition="left" labelWidth="120px" style="width:90%;">
		</div>
		<div class="fitem">
            <input id = "password" name="password" class="easyui-textbox" multiline="false"  label="Password Baru" labelPosition="left" labelWidth="120px" style="width:90%;">
		</div>
        </form>
        <div style="margin-top:20px;"></div>
        <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="savepassword()" style="width:90px">Simpan</a>
        </div>



<script>
function setpassword(user_id)
{
    $('#dlgkpass').dialog('open').dialog('setTitle','Edit / Ubah Password');
    $('#fmkpass').form('clear');
    $('#user_id').val(user_id);
    //$('#csrftoken_erb2021').val("<?= csrf_hash() ?>");
    url = 'kpassganti';
}



function savepassword(){
    $('#fmkpass').form('submit',{
        url: "/kpassganti",
        onSubmit: function(param){
            param.csrftoken_erb2021 = '<?= csrf_hash() ?>';
            return $(this).form('validate');
        },
        success: function(result){
            var result = eval('('+result+')');
            if (result.errorMsg){
                    $.messager.show({
                        title: 'Error',
                        msg: result.errorMsg
                    });
                } else {
                    $('#dlgkpass').dialog('close');        // close the dialog
                    $('#dgkuser').datagrid('reload');    // reload the user data
                }
            }
        });
    }    










</script>

 <?php echo $this->endSection() ?>
