HOME SHELL

NULLCOMMUNITY
 LiteSpeed
 Linux server2.poyrazhosting.com 3.10.0-962.3.2.lve1.5.77.el7.x86_64 #1 SMP Mon Dec 12 07:06:14 EST 2022 x86_64
 safemode : OFF
 MySQL: OFF | Perl: OFF | cURL: ON | WGet: OFF
  >  / home / cuneytsener53 / istakip.snrsoft.com.tr / inc /

Server Ip : 104.21.78.54




Filename/home/cuneytsener53/istakip.snrsoft.com.tr/inc/panel-kullanicilari.php
Size6.18 kb
Permissionrw-r--r--
Owner
Create time04-Mar-2025 08:29
Last modified19-Aug-2024 14:08
Last accessed29-Mar-2025 23:21
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php


if($yetki->panel_kullanicilari != 1){
header('refresh: 0; url='.$site.'yetkisiz-erisim');
die();
}

$_title = 'Panel Kullanıcıları';

checkDemoMode($demo);


if(isset($_GET['sil'])){

$islem = $db->exec("DELETE FROM admin WHERE id = '{$_GET['sil']}' LIMIT 1");
echo $islem ? basari() : hata();

}

if($_POST){


$yetki = json_encode(array(
'ozet' => @$_POST['ozet'],
'panel_kullanicilari' => @$_POST['panel_kullanicilari'],
'musteri_yonetimi' => @$_POST['musteri_yonetimi'],
'genel_ayarlar' => @$_POST['genel_ayarlar'],
'teklifler' => @$_POST['teklifler'],
'teklifler' => @$_POST['teklifler'],
'teknik_servis' => @$_POST['teknik_servis'],
'host_domain' => @$_POST['host_domain'],
'on_muhasebe' => @$_POST['on_muhasebe'],

));

if(isset($_GET['duzenle'])){

$getir = $db->query("SELECT * FROM admin WHERE id = '{$_GET['duzenle']}' LIMIT 1")->fetch(PDO::FETCH_ASSOC);
$sifre = !empty($_POST['sifre']) ? md5($_POST['sifre']) : $getir['sifre'];

$islem = $db->prepare("UPDATE admin SET ad = ?, sifre = ?, yetki = ? WHERE id = ? LIMIT 1");
$islem = $islem->execute(array($_POST['ad'],$sifre,$yetki,$_GET['duzenle']));

}else{

$islem = $db->prepare("INSERT INTO admin SET ad = ?, sifre = ?, yetki = ?");
$islem = $islem->execute(array($_POST['ad'],md5($_POST['sifre']), $yetki));

}

echo $islem ? basari() : hata();

}

if(isset($_GET['duzenle'])){
$getir = $db->query("SELECT * FROM admin WHERE id = '{$_GET['duzenle']}' LIMIT 1")->fetch(PDO::FETCH_ASSOC);
echo $getir ? '' : hata();
?>
<script type="text/javascript">
$(function(){
<?php
foreach (json_decode($getir['yetki']) as $y => $v) {
?>checkbox_sec('<?php echo $y; ?>',<?php echo $v; ?>);<?php
}
?>
});
</script>
<?php
}

?>
<div class="col-md-5 mt-3">
<div class="card box-shadow-0">
<div class="card-header">
<h4 class="card-title mb-1">Ekleme ve Güncelleme Formu</h4>
<p class="mb-2">Bu sayfada yeni veri ekleyebilir, güncelleyebilir veya silebilirsiniz.</p>
</div>
<div class="card-body pt-0">
<div class="table-responsive">
<table class="table table-bordered border text-nowrap mb-0" id="basic-edit">
<thead>
<tr>
<th>ID</th>
<th>Kullanıcı Adı</th>
<th>İşlem</th>
</tr>
</thead>
<tbody>
<?php
$query = $db->query("SELECT * FROM admin ORDER BY id DESC", PDO::FETCH_ASSOC);
if($query->rowCount()){
foreach($query as $row){
echo '
<tr>
<td>'.$row['id'].'</td>
<td>'.$row['ad'].'</td>
<td style="width: 100px">
<div class="btn-list">
<a href="'.$sayfa.'/duzenle/'.$row['id'].'" class="btn btn-sm btn-primary">
<span class="fe fe-edit"></span>
</a>
<button data-sil="'.$sayfa.'/sil/'.$row['id'].'" class="btn btn-sm btn-danger">
<span class="fe fe-trash-2"></span>
</button>
</div>
</td>
</tr>
';
}
}else{
echo '<tr><td colspan="3">'.veri_yok().'</td></tr>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>

<div class="col-md-7 mt-3">
<div class="card box-shadow-0">
<div class="card-header">
<h4 class="card-title mb-1">Ekleme ve Güncelleme Formu</h4>
<p class="mb-2">Bu sayfada yeni veri ekleyebilir, güncelleyebilir veya silebilirsiniz.</p>
</div>
<div class="card-body pt-0">
<form action="" method="post" id="panel-kullanicilari">
<div class="table-responsive">
<table class="form-table table table-bordered mg-b-0 text-md-nowrap">
<tr>
<th colspan="3">
<span>Kullanıcı Adı</span>
<input type="text" name="ad" class="form-control" value="<?php echo @$getir['ad']; ?>" required>
</th>
</tr>
<tr>
<th colspan="3">
<span>Şifre</span>
<input type="text" name="sifre" class="form-control" value="" <?php if(!isset($getir)){ echo 'required'; } ?>>
</th>
</tr>
<tr>
<th><label class="ckbox"><input type="checkbox" name="ozet" value="1" class="mb-2"><span>Özet</span></label></th>
<th><label class="ckbox"><input type="checkbox" name="panel_kullanicilari" value="1" class="mb-2"><span>Panel Kullanıcıları</span></label></th>
<th><label class="ckbox"><input type="checkbox" name="musteri_yonetimi" value="1" class="mb-2"><span>Müşteri Yönetimi</span></label></th>
</tr>
<tr>
<th><label class="ckbox"><input type="checkbox" name="genel_ayarlar" value="1" class="mb-2"><span>Genel Ayarlar</span></label></th>
<th><label class="ckbox"><input type="checkbox" name="teklifler" value="1" class="mb-2"><span>Teklifler</span></label></th>
<th><label class="ckbox"><input type="checkbox" name="teknik_servis" value="1" class="mb-2"><span>Teknik Servis</span></label></th>
</tr>
<tr>
<th><label class="ckbox"><input type="checkbox" name="host_domain" value="1" class="mb-2"><span>Host & Domain Yönetimi</span></label></th>
<th><label class="ckbox"><input type="checkbox" name="on_muhasebe" value="1" class="mb-2"><span>Ön Muhasebe</span></label></th>
</tr>
</table>
<div class="form-group mb-0 mt-3">
<center>
<button type="button" id="tumu" data-ap="1" class="btn btn-info-gradient" style="width: 150px;">Tümünü Seç</button>
<button type="submit" class="btn btn-success-gradient">Kaydet</button>
</center>
</div>
</div>
</form>

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

<script>
$(function(){
$('#tumu').click(function(){
if($(this).attr('data-ap') == 1){
$(this).attr('data-ap',0);
$('#panel-kullanicilari [type="checkbox"]').attr("checked", true);
}else{
$(this).attr('data-ap',1);
$('#panel-kullanicilari [type="checkbox"]').attr("checked", false);
}

});
});
</script>