<?php
$user->id = $_GET[id];
$u = $user->user();

if ($u[blokir]=='Y') {
    $blokir = 'Blokir';
}else{
    $blokir = 'Aktif';
}
?>
<div class="page-content">
    <div class="row">
        <div class="col-xs-12">
            <div class="page-header">
                <h1>
                    Data Petugas
                    <small>
                        <i class="ace-icon fa fa-angle-double-right"></i>
                        Edit Data Petugas
                    </small>
                </h1>
            </div><!-- /.page-header -->
        </div>
        <form class="form-horizontal" role="form" action="view/view/modul/mod_petugas/aksi_petugas.php?aksi=edit" method="post" >
            <div class="col-xs-12 col-sm-9">
                <input type="hidden" name="id" value="<?php echo $_GET[id]; ?>">
                <input type="hidden" name="username" value="<?php echo $u[username]; ?>">
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Username </label>
                    <div class="col-sm-9">
                        <input type="text" id="form-field-1" placeholder="Username" name="username" class="col-xs-10 col-sm-5" value="<?php echo $u[username]; ?>" disabled />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Password </label>
                    <div class="col-sm-9">
                        <input type="password" id="form-field-1" placeholder="Password" name="password" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Ulangi Password </label>
                    <div class="col-sm-9">
                        <input type="password" id="form-field-1" placeholder="Ulangi Password" name="rpassword" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Nama </label>
                    <div class="col-sm-9">
                        <input type="text" id="form-field-1" placeholder="Nama" name="nama" class="col-xs-10 col-sm-5" value="<?php echo $u[nama]; ?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> NIP </label>
                    <div class="col-sm-9">
                        <input type="text" id="form-field-1" placeholder="NIP" name="nip" class="col-xs-10 col-sm-5" value="<?php echo $u[nip]; ?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Email </label>
                    <div class="col-sm-9">
                        <input type="text" id="form-field-1" placeholder="Email" name="email" class="col-xs-10 col-sm-5" value="<?php echo $u[email]; ?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Alamat </label>
                    <div class="col-sm-9">
                        <input type="text" id="form-field-1" placeholder="Alamat" name="alamat" class="col-xs-10 col-sm-5" value="<?php echo $u[alamat]; ?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Telepon </label>
                    <div class="col-sm-9">
                        <input type="text" id="form-field-1" placeholder="Telepon" name="tlp" class="col-xs-10 col-sm-5" value="<?php echo $u[telpon]; ?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Level </label>
                    <div class="col-sm-9">
                        <select id="form-field-1" class="col-xs-10 col-sm-5" name="level">
                            <?php
                                $l = $level->listlevel();
                                while($i<count($l)){
                                    if ($l[$i][id_level]==$u[id_level]) {
                                        ?>
                                            <option value="<?php echo $l[$i][id_level]; ?>" selected><?php echo $l[$i][level]; ?></option>
                                        <?php
                                    }else{
                                        ?>
                                            <option value="<?php echo $l[$i][id_level]; ?>"><?php echo $l[$i][level]; ?></option>
                                        <?php
                                    }
                                    
                                    $i++;
                                }
                                unset($i);  
                            ?>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Blokir </label>
                    <div class="col-sm-9">
                        <select id="form-field-select-1" class="col-xs-10 col-sm-5" name="blokir">
                            <option value="<?php echo $u[blokir]; ?>" selected><?php echo $blokir; ?></option>
                            <option value="Y">Aktif</option>
                            <option value="N">Blokir</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-info" type="submit">
                            <i class="ace-icon fa fa-check bigger-110"></i>
                            Submit
                        </button>
                        &nbsp; &nbsp; &nbsp;
                        <button class="btn" type="reset">
                            <i class="ace-icon fa fa-undo bigger-110"></i>
                            Reset
                        </button>
                        &nbsp; &nbsp; &nbsp;
                        <a href="index.php?module=petugas">
                            <button class="btn" type="button">
                                <i class="ace-icon fa fa-undo bigger-110"></i>
                                Cancel
                            </button>
                        </a>
                    </div>
                </div>
            </div>                            
        </form>
    </div><!-- /.row -->
</div><!-- /.page-content -->