📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
paketsatisscripti.demodesign.com.tr
/
admin
📝
ajax.php
← Geri Dön
<?php ob_start(); session_start(); include("../config/config.php"); include("../config/api.php"); if(!isset($_SESSION["yetkili"])){ header("Location: login"); exit; } $userid=$_SESSION["yetkili_id"]; $user = @mysqli_query($baglanti,"SELECT * FROM admin WHERE id='$userid'"); $user = $user->fetch_assoc(); if(@$user["id"]==Null){ exit; } if(@$_POST["servis"]!=Null){ $servis=htmlentities($_POST["servis"], ENT_QUOTES, "UTF-8"); $sorgu = @mysqli_query($baglanti,"select * from api where id ='$servis'"); $sonuc = $sorgu->fetch_assoc(); if($sonuc["id"]==Null){ exit; } $api = new Api(); $api->api_url = $sonuc['api']; $api->api_key = $sonuc['anahtar']; $services = (array)$api->services(); $ek=htmlentities(@$_POST["ek"], ENT_QUOTES, "UTF-8"); $say=0; echo' <div class="form-group"> <label for="subject" class="control-label">Servis</label> <div id="servis"></div> <select name="servisid" class="form-control" onchange="servisfiyat'.$ek.'(this.value)"> <option value="">Servis Seçiniz</option> '; while(@$services[$say]->service!=Null){ if (isset($_POST["ok"])) { if ($_POST["ok"] == $services[$say]->service) { echo '<option value="'.$services[$say]->service.'" selected>'.$services[$say]->name.'</option>'; } else { echo '<option value="'.$services[$say]->service.'">'.$services[$say]->name.'</option>'; } } else { echo '<option value="'.$services[$say]->service.'">'.$services[$say]->name.'</option>'; } $say++; } echo '</select></div>'; } elseif(@$_POST["servis2"]!=Null){ $servis=htmlentities($_POST["servis2"], ENT_QUOTES, "UTF-8"); $sorgu = @mysqli_query($baglanti,"select * from api where id ='$servis'"); $sonuc = $sorgu->fetch_assoc(); if($sonuc["id"]==Null){ exit; } $api = new Api(); $api->api_url = $sonuc['api']; $api->api_key = $sonuc['anahtar']; $services = (array)$api->services(); $say=0; echo' <div class="table-responsive"> <table class="table table-hover table-bordered" id="sampleTable"> <thead> <tr> <th colspan="4"></th> <th>Sağlayıcı <br>Kategori</th> </tr> </thead> <tbody> '; $kate=null; $katsay=0; //<td><input type="text" class="form-control" style="width:100px;" name="fiyat'.$services[$say]->service.'" value="'.$services[$say]->rate.'"></td> while(@$services[$say]->service!=Null){ if($services[$say]->type=="Package"){ $tip="Paket"; } elseif($services[$say]->type=="Custom Comments" || $services[$say]->type=="Custom Comments Package"){ $tip="Yorum"; } elseif($services[$say]->type=="Comment Likes" || $services[$say]->type=="Comment Likes Package"){ $tip="Yorum Beğeni"; } else{ $tip="Servis"; } if($kate!=$services[$say]->category){ @$kaysay++; echo '<tr><td><input type="checkbox" class="siparisa'.$kaysay.'" value=""></td> <td colspan="3" style="margin-top:10px"><b>'.$services[$say]->category.'</b></td> <td><input type="checkbox" class="siparissa'.$kaysay.'" ></td> </tr>'; $kate=$services[$say]->category; } echo '<tr> <td><input type="checkbox" class="siparis'.$kaysay.'" name="servis[]" value="'.$services[$say]->service.'"></td> <td>'.$services[$say]->name.'</td> <td>'.$tip.'</td> <td>'.$services[$say]->rate.'</td> <td><input type="checkbox" class="sipariss'.$kaysay.'" name="sagla[]" value="'.$services[$say]->service.'"></td> </tr>'; ?> <script> $(function() { $('.siparisa<?php echo $kaysay;?>').click(function() { $('.siparis<?php echo $kaysay;?>').prop('checked', this.checked); }); }); </script> <script> $(function() { $('.siparissa<?php echo $kaysay;?>').click(function() { $('.sipariss<?php echo $kaysay;?>').prop('checked', this.checked); }); }); </script> <?php $say++; } echo '</tbody></table></div>'; } elseif(@$_POST["mod"]!=Null){ $mod=htmlentities($_POST["mod"], ENT_QUOTES, "UTF-8"); if($mod=="Api"){ ?> <div class="form-group"> <label for="subject" class="control-label">Api</label> <select name="api" id="apidata" class="form-control" required="" onchange="serviscek(this.value)"> <option value="">Sağlayıcı Seçiniz</option> <?php $destekcek=mysqli_query($baglanti,"select * from api ORDER BY id DESC"); while($satir=mysqli_fetch_array($destekcek)) { echo '<option value="'.$satir['id'].'">'.$satir['ad'].'</option>'; } ?> </select> </div> <?php } else{ ?> <?php } } elseif(@$_POST["moda2"]!=Null){ $mod=htmlentities($_POST["moda2"], ENT_QUOTES, "UTF-8"); $ek=htmlentities($_POST["ek"], ENT_QUOTES, "UTF-8"); if($mod=="Api"){ ?> <div class="form-group"> <label for="subject" class="control-label">Api</label> <select name="api" id="apidata" class="form-control" required="" onchange="serviscek<?php echo $ek;?>(this.value)"> <option value="">Sağlayıcı Seçiniz</option> <?php $destekcek=mysqli_query($baglanti,"select * from api ORDER BY id DESC"); while($satir=mysqli_fetch_array($destekcek)) { echo '<option value="'.$satir['id'].'">'.$satir['ad'].'</option>'; } ?> </select> </div> <?php } else{ ?> <?php } } elseif(@$_POST["tip"]!=Null){ $tip=htmlentities($_POST["tip"], ENT_QUOTES, "UTF-8"); if($tip=="0"){ ?> <div class="form-group"> <label for="subject" class="control-label">Paket Süresi (Gün)</label> <input type="number" min="1" class="form-control" required="" name="sure"> </div> <?php } elseif($tip=="1"){ ?> <div class="form-group"> <label for="subject" class="control-label">Gönderi Sayısı</label> <input type="number" min="0" class="form-control" required="" name="gonderi"> </div> <?php } } elseif(@$_POST["ozel"]=="1"){ ?> <div class="service-mode__wrapper"> <div class="switch-form__group"><label class="switch-form"><input type="checkbox" name="start_count_switch" id="refiller-switch" value="0" disabled=""><span class="slider-form round"></span></label><label for="refiller-switch" class="switch-form-label"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Sipariş Özelleştir </font></font></label></div> <div class="alert alert-info text-center">Bu özellik çok yakında sizlerle!</div> </div> <?php } elseif(@$_POST["fiyat"]!=Null){ if($_POST["fiyat"]=="0"){ ?> <div class="form-group"> <label for="subject" class="control-label">Paket Fiyatı</label> <input type="text" class="form-control" pattern="[0-9.]*" required="" name="fiyat"> </div> <div class="form-group"> <label for="subject" class="control-label">Paket Miktar</label> <input type="number" class="form-control" required="" name="adet"> </div> <?php } elseif(@$_POST["api"]!=Null){ $fiyat=htmlentities($_POST["fiyat"], ENT_QUOTES, "UTF-8"); $api=htmlentities($_POST["api"], ENT_QUOTES, "UTF-8"); $katecek=mysqli_query($baglanti,"select * from api where id='$api' "); $katecek=mysqli_fetch_array($katecek); $api = new Api(); $api->api_url = $katecek['api']; $api->api_key = $katecek['anahtar']; $services = (array)$api->services(); $balance = (array)$api->balance(); $say=0; while(@$services[$say]->service!=Null){ if($fiyat==$services[$say]->service){ $fiyat=$services[$say]->rate; $min=$services[$say]->min; $max=$services[$say]->max; break; } $say++; } ?> <div> <div class="form-group form-group__provider-block" id="sip2"> <label>Paket Fiyatı</label> <div class="form-group__provider-value">Api Fiyat: <?php echo $fiyat." ".@$balance["currency"]; ?></div> <div class="form-group"> <div class="input-group"> <input type="text" class="form-control" pattern="[0-9.]*" id="fiyattxt" name="fiyat" value="<?php echo $fiyat; ?>"> </div> </div> </div> <div class="form-group form-group__provider-block" id="sip2"> <label>Paket Miktar</label> <div class="form-group__provider-value">Max: <?php echo $max; ?></div> <div class="form-group"> <div class="input-group"> <input type="text" class="form-control" pattern="[0-9.]*" id="fiyattxt" name="adet" value="<?php echo $max; ?>"> </div> </div> </div> </div> <script> const source = document.getElementById('sabit'); const source2 = document.getElementById('yuzde'); const inputHandler = function(e) { var source_value = Number(source.value); var source2_value = Number(source2.value); var service = document.getElementById('fiyate'); var service_value = Number(service.defaultValue); var sonuc = service_value+source_value; var sonucs = (sonuc/100)*source2_value; sonucs=sonucs+sonuc; document.getElementById('fiyate').value=sonucs; } source.addEventListener('input', inputHandler); source.addEventListener('propertychange', inputHandler); source2.addEventListener('input', inputHandler); source2.addEventListener('propertychange', inputHandler); </script> <?php } } ?>
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula