<?php include 'header.php'; ?>   

<style type="text/css">
   .scale-image {
    object-fit: cover;
    max-width: 100%;
    height: 22vh;
    display: block;
    margin-left: auto;
    margin-right: auto;
   }
   .w-100x {
   object-fit: cover;
   width: 100%;
   /*height: 50px;*/
   height: 8vh;
   }
   .discard {
/*   position: absolute;
   top: 133px;
   padding: 2px 15px;
   color: #FFF;
   font-weight: bold;
   background-color: #dc3545b5;
   border-radius: 0 5px 5px 0;
   pointer-events: none;*/
   position: absolute;
    /*top: 133px;*/
    bottom: 45px;
    font-size: 12px !important;
    padding: 2px 7px 2px 6px;
    color: #FFF;
    font-weight: bold;
    background-color: #c734bc99;
    border-radius: 0 5px 5px 0;
    pointer-events: none;
   }
   .sehir {
   float: left;
   margin-top: 4px !important;
   padding-bottom: 0px !important;
   font-size: 12px !important;
   }

   .online-y{
    position: absolute;
    margin-top: 5vh;
    margin-left: 5vh;
    }

    .online-z{
       position: absolute;
       top: 12px;
       right: 12px;
    font-size: 20px;
    color: #00bb00;
    }

.online-c{
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
    color: #00bb00;
    }

    .blink2 {
    animation: blinkers 0.8s cubic-bezier(.5, 0, 1, 1) infinite alternate;  
}

@keyframes blinkers {  
  from { opacity: 1; }
  to { opacity: 0.4; }
}
.no-flick{
  -webkit-transform:translate3d(0,0,0) !important;
}

</style>

<script type="text/javascript">

function teklifac(){
    $("#belesVitrin").modal("show");
}

  $(document).ready(function() {



   kesfetGetir();
   populerGetir();
   setTimeout(function(){ $("html, body").scrollTop(0); }, 1000);

   <?php if($myUser['user_picture']=="assets/img/no-avatar.png"){

$rand0 = rand(0,1);
if($rand0==1){

    ?>

setTimeout(function(){ 
  notification('notification-11', 7000);
}, 2000);



<?php }} ?>

 });


  function miniProfil(value1){


$("#mini_profil_src").attr("src", "https://c.tenor.com/wXTO9bFFJXMAAAAM/loading-slow-internet.gif");

var value2 = $("#img_"+value1).attr('src');

value2 = value2.replace("_thumb.jpg",".jpg");
value2 = value2.replace("people/thumb","people");

$("#mini_profil").modal("show");

   setTimeout(function(){ 

        $("#mini_profil_src").attr("src", value2);
$("#mini_href").attr("href", "/profil.php?id="+value1)
    }, 150);  






  }

  function begeniGonder(value){



    var url = "assets/api.php";
    var bilgi = {
      type: 'begeni',
      begenilen_id: value
    }
    $.post(url,bilgi,function(response) {
      var json = JSON.parse(response);

      if(json.result==1){
        $(".user_"+value).attr('name','checkmark-circle-outline');
        console.log('begenildi');

var url = "admin/functions.php";
        var bilgi = {
        from: <?=$myUser['user_id']?>,
        to: value,
        type: 'bildirim_gonder',
        type2: 'like'
        }

        $.post(url,bilgi,function(response) {
            
//$("#mIcerik").focus();
console.log(response);


          
        });

      }else if(json.result==100){
  
  $('#bjetonAl').modal('show'); 

  }
      


   })

  }

  function kesfetGetir(val){
    $('#getirButton').prop("disabled", true);
    $('#getirButton').html('<span class="spinner-border spinner-border-sm mr-05" role="status" aria-hidden="true"></span>Yükleniyor...');

    if(val==null){
      var val = -1;
    }

    $.ajax({
      url: 'api.php',
      method: 'post',
      data: { 'sehir': 'xxx', 'type':'kesfet' },
      success: function (e) {
        var jVeri = JSON.parse(e);
        var kisiVer = 0;
        for(var k in jVeri) {

var randsayi = Math.floor(Math.random() * 3);


/*var profil_isim = jVeri[k]['user_fullname'].split(" ");*/
var profil_isim = jVeri[k]['user_fullname'];

/*var regex = /(?!^)[\s\S](?!$)/g;
var w = profil_isim[1];
var censored = w.replace(regex, "*")
var ismi = profil_isim[0];
var soyadi = censored;*/

var profil_resim = jVeri[k]['user_picture'];

if(profil_resim=="assets/img/no-avatar.png"){
  if(jVeri[k]['user_cinsiyet']=="kadin"){
                profil_resim = "assets/img/k.png";
            }else if(jVeri[k]['user_cinsiyet']=="erkek"){
                profil_resim = "assets/img/e.png";
            }else{

            }
}

if(jVeri[k]['user_bot']==1){
profil_resim = profil_resim.replace(".jpg","_thumb.jpg");
profil_resim = profil_resim.replace("people","people/thumb");
}



          kisiVer = '<div class="col-6 mb-3">';
          kisiVer += '<div class="card product-card">';
          kisiVer += '<div class="card-body">';
          if(randsayi==1){
          kisiVer += '<ion-icon class="online-z blink2" name="radio-button-on-outline"></ion-icon>';
          }
          kisiVer += '<div class="discard">'+profil_isim+', '+jVeri[k]['user_yas']+'</div>';
          kisiVer += '<a onclick="miniProfil('+jVeri[k]['user_id']+');"><img id="img_'+jVeri[k]['user_id']+'" src="'+profil_resim+'" class="scale-image" alt="'+profil_isim+'"></a>';
          kisiVer += '<div align="right" style="margin-top:7px;">';
          kisiVer += '<button type="button" onclick="begeniGonder('+jVeri[k]['user_id']+')" style="margin-right: 4px;" class="btn btn-icon btn-sm btn-instagram">';
          kisiVer += '<ion-icon class="user_'+jVeri[k]['user_id']+'" name="heart-outline"></ion-icon>';
          kisiVer += '</button>';
          kisiVer += '<button type="button" class="btn btn-icon btn-sm btn-facebook">';
          kisiVer += '<a style="text-decoration: none; color: inherit;" href="./mesajlar.php?id='+jVeri[k]['user_id']+'"><ion-icon name="mail-outline"></ion-icon></a>';
          kisiVer += '</button>';
          kisiVer += '<p class="text sehir" style="float: left;"><?=$myUser['user_sehir']?></p>';
          kisiVer += '</div>';
          kisiVer += '</div>';
          kisiVer += '</div>';
          kisiVer += '</div>';


          $('.uyeler1').append(kisiVer);

        }

        var nVal = val+1;



        $("#sayfasi_"+val).focus();
//console.log("buna odaklanıyorum: #sayfasi_"+val)





$("#getirButton").attr('onclick', 'kesfetGetir('+nVal+')');
$('.uyeler1').append('<input type="text" style="margin-left:-250px !important; opacity:0;pointer-events: none; filter:alpha(opacity=0);" id="sayfasi_'+nVal+'" value="1" disabled/>') 
$('#getirButton').html('<ion-icon name="add-circle-outline"></ion-icon>Daha Fazla Kişi Göster');
$('#getirButton').prop("disabled", false);
}
});
  }


  function populerGetir(){
    $.ajax({
      url: 'api.php?type=finder&limit=10',
      method: 'post',
      data: { 'id': 'bos' },
      success: function (e) {
        var jVeri = JSON.parse(e);
        var kisiVer = 0;
        for(var k in jVeri) {

          var profil_resim = jVeri[k]['user_picture'];
          var profil_isim = jVeri[k]['user_fullname'];

if(profil_resim=="assets/img/no-avatar.png"){
  if(jVeri[k]['user_cinsiyet']=="kadin"){
                profil_resim = "assets/img/k.png";
            }else if(jVeri[k]['user_cinsiyet']=="erkek"){
                profil_resim = "assets/img/e.png";
            }else{

            }
}

if(jVeri[k]['user_bot']==1){
profil_resim = profil_resim.replace(".jpg","_thumb.jpg");
profil_resim = profil_resim.replace("people","people/thumb");
}



          kisiVer = '<div class="item"><ion-icon class="online-c blink2 md hydrated" name="radio-button-on-outline" role="img" aria-label="radio button on outline"></ion-icon>';
          kisiVer += '<a href="./profil.php?id='+jVeri[k]['user_id']+'"><img src="'+profil_resim+'" alt="'+profil_isim+'" class="imaged w-100x"></a>';
          kisiVer += '</div>';

          $('.populer1').append(kisiVer);

        }

        $('.carousel-cankat1').owlCarousel({
          'stagePadding': 32,
          'loop': true,
          'margin': 16,
          'nav': false,
          'items': 5,
          'dots': false,
          'responsiveClass': true,
          'responsive': {
            0: {
              'items': 0x5
            },
            768: {
              'items': 0x8
            }
          }
        });


$('.carousel-cankat').owlCarousel({
    'stagePadding': 32,
    'loop': true,
    'margin': 16,
    'nav': false,
    'items': 5,
    'dots': false,
    'autoplay':true,
    'autoplayTimeout':5000,
    'autoplayHoverPause':true,
    'responsiveClass': true,
          'responsive': {
            0: {
              'items': 0x5
            },
            768: {
              'items': 0x8
            }
    }
});

      }
    });
  }



        function buyJeton2(value){
        Android.javaFuncs(value+"-"+"<?=$myUser['user_id']?>")
      }

</script>


         
      

<!-- Search Component -->
<div id="search" class="appHeader">
   <form class="search-form">
      <div class="form-group searchbox">
         <input type="text" class="form-control" placeholder="Search...">
         <i class="input-icon">
            <ion-icon name="search-outline"></ion-icon>
         </i>
         <a href="javascript:;" class="ml-1 close toggle-searchbox">
            <ion-icon name="close-circle"></ion-icon>
         </a>
      </div>
   </form>
</div>
<!-- * Search Component -->
<!-- App Capsule -->
<div id="appCapsule">






                <!-- ios style-->
                <div id="notification-11" class="notification-box tap-to-close">
                    <div class="notification-dialog ios-style">
                        <div class="notification-header">
                            <div class="in">
                                <img src="https://play-lh.googleusercontent.com/-S5u0GtO8RPmdb4pvGAyW2qH0Bei7lQvdplCVIxLXzRTjCp4xzPdXl9ICArYSjDcESho=s180-rw" alt="image" class="imaged w24 rounded">
                                <strong>HeySen Bilgilendirme!</strong>
                            </div>
                            <div class="right">
                                <span>Şimdi</span>
                                <a href="component-notification.html#" class="close-button">
                                    <ion-icon name="close-circle"></ion-icon>
                                </a>
                            </div>
                        </div>
                        <div class="notification-content">
                            <div class="in">
                                <h3 class="subtitle">Merhaba <?=$myUser['user_fullname']?>!</h3>
                                <div class="text">
                                    Şehrindeki <b>En Popüler Üyeler</b> kısmında görünmek istiyorsan profil fotoğrafını güncellemelisin. Unutma, kaliteli bir profil fotoğrafı insanların dikkatini çekecek ve sana mesaj atmalarını sağlayacaktır.<br/><br/>Profil Fotoğrafını sağ alttaki Hesabım sekmesinden değiştirebilirsin.
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- * ios style -->







<div class="section full mt-1 mb-2">

<?php 
$suanki = time();
$refSure = ($myUser['user_ref']+24*60*60);

if($refSure>=$suanki){

$yaziliSure = date('d.m.Y H:i', $refSure);

echo '<div class="section-title">';

echo '<a href="javascript:void(0)" class="blink2 btn-text-warning"> <ion-icon style="margin-bottom: -2px; font-size: 16px;" name="flame-outline"></ion-icon>'.$yaziliSure.' Tarihine Kadar Vitrindesiniz!</a>';

echo '</div>';

}else{

?>


   <div class="section-title">Vitrin - En Popüler Üyeler 

<?php

$gelenDil = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2); // tr

if($gelenDil=="tr" AND $myUser['user_jeton']<=3 AND $myUser['user_ref']==0 AND $myUser['user_cinsiyet']=="erkek"){
echo '<a href="javascript:void(0)" data-toggle="modal" data-target="#vitrinteklif" class="blink2 btn btn-text-warning"> <ion-icon name="arrow-down-circle-outline"></ion-icon> VİTRİNE ÇIK! </a>';
}



?>

    

</div>

<?php } ?>

   <div class="carousel-cankat owl-carousel owl-drag owl-theme populer1">
     
 
   </div>
</div>
    <div class="divider bg-danger mt-3 mb-2">
                <div class="icon-box bg-danger">
                    <ion-icon name="heart-outline"></ion-icon>
                </div>
            </div>



<div class="section mt-1 mb-4">

<div class="alert alert-outline-success mt-3" role="alert">
                    Bölgenizde <c class="blink2"><b><?=rand(78,99)?> çevrimiçi kullanıcı</b></c> var.
                </div>

   <div class="section-title">Yakınında Olan Üyeler</div>
   <div class="row uyeler1">
      
<!--       <div class="col-6 mb-3">
         <div class="card product-card">
            <div class="card-body">
              <ion-icon class="online-z blink2" name="radio-button-on-outline"></ion-icon>
              <div class="discard">Hilal Bayram, 20</div>
               <img src="assets/people/<?=rand(1,29)?>.jpg" class="scale-image" alt="product image">
               <div align="right" style="margin-top:7px;">
                  <button type="button" class="btn btn-icon btn-sm btn-instagram">
                     <ion-icon name="heart-outline"></ion-icon>
                  </button>
                  <button type="button" class="btn btn-icon btn-sm btn-facebook">
                     <ion-icon name="mail-outline"></ion-icon>
                  </button>
                  <p class="text sehir" style="float: left;">Adana</p>
               </div>
            </div>
         </div>
      </div> -->
   </div>

<button id="getirButton" type="button" onclick="kesfetGetir(1)" class="btn btn-primary btn-block">Daha Fazla Kişi Göster</button>

</div>



<?php 

if($myUser['user_ref']==1234){
    echo '<script>
    $(document ).ready(function() {
setTimeout(function(){ 
$("#vitrinteklif").modal("show");
 }, 1500);
});
    </script>';
}


?>


<!-- Dialog Iconed Inline -->
        <div class="modal fade dialogbox" id="vitrinteklif" data-backdrop="static" tabindex="-1"
            role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-icon text-warning">
                        <ion-icon name="diamond-outline"></ion-icon>
                    </div>
                    <div class="modal-header">
                        <h5 class="modal-title">Ücretsiz Vitrin Teklifi</h5>
                    </div>
                    <div class="modal-body">
                        <b>"En Popüler Üyeler"</b> kısmında ücretsiz olarak profilini yayınlayak, uygulamadaki çevrimiçi kadınların dikkatini çekip sana mesaj atmasını ister misin?
                    </div>
                    <div class="modal-footer">
                        <div class="btn-inline">
                            <a href="javascript:void(0)" onclick="teklifac();" class="btn btn-text-success" data-dismiss="modal">
                                <ion-icon name="thumbs-up-outline"></ion-icon>
                                Evet
                            </a>
                            <a href="component-dialog.html#" class="btn btn-text-secondary" data-dismiss="modal">
                                <ion-icon name="hourglass-outline"></ion-icon>
                                Sonra
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- * Dialog Iconed Inline -->

<script>



    $(document ).ready(function() {



    
    document.querySelector('.js-decline').addEventListener('click', function () {
      decline();
    });

    document.querySelector('.js-accept').addEventListener('click', function () {
      accept();
    });

  function decline () {
$("#aramaDialog").modal("hide");
  }

  function accept () {

$("#aramaDialog").modal("hide");
$("#arama_kilit").modal("show");

  }


<?php 

$sayix = rand(0,2);
if($myUser['user_call']==0 AND $myUser['user_cinsiyet']=="erkek" AND $myUser['user_aramaizin']==1 AND $sayix==0){

echo 'setTimeout(function(){ 
$("#aramaDialog").modal("show");
 }, 2000);


setTimeout(function(){ 
decline();
 }, 30000);';

}

?>





});




    </script>

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link rel="stylesheet" href="assets/call/style.css">
<!--     <script  src="assets/call/script.js"></script> -->

<?php 

if($myUser['user_call']==0 AND $myUser['user_aramaizin']==1 AND $myUser['user_cinsiyet']=="erkek" AND $sayix==0){

if(isset($user_id)){


function randBot(){
  global $db;
  $query = $db->query("SELECT * FROM kullanicilar WHERE user_bot = 1 ORDER BY RAND() LIMIT 1", PDO::FETCH_ASSOC);
  foreach($query as $veri){
    $bot_id = $veri['user_id'];
  }
  return $bot_id;
}

$bot_idi = randBot();

$araBot = $db->query("SELECT * FROM kullanicilar WHERE user_id = '{$bot_idi}'")->fetch(PDO::FETCH_ASSOC);

$parcaisim = explode(" ", $araBot['user_fullname']);

$query = $db->prepare("INSERT INTO aramalar SET
u_from = ?,
u_to = ?,
ip = ?,
cookie = ?,
onesignal = ?,
zaman = ?");
$insert = $query->execute(array(
     $bot_idi, $user_id, $ip, $user_token, $user_onesignal, time()
   ));

?>

        <!-- Arama Dialog Basic -->
        <div class="modal fade dialogbox" id="aramaDialog" data-backdrop="static" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content" style="background: #3e4651; display: contents;">



<div class="Cards">
  <div class="Card js-card">
    <div class="Card-image">
      <div class="Card-imageCallEffect"></div>
      <div class="Card-imageCallEffect"></div>
      <div class="Card-imageCallEffect"></div>
      <div class="Card-imageContent">
        <img src="<?=$araBot['user_picture']?>">
      </div>
    </div>
    <div class="Card-content mt-2">
      <h3 class="js-callDetail">Gelen Sesli Arama</h3>
      <h2><?=$araBot['user_fullname']?></h2>
      <p>
        <span class="js-callInfo">Yaş: <?=$araBot['user_yas']?> = <?=$myUser['user_sehir']?></span>
      </p>
    </div>

    <div class="Card-actions">
      <div class="Card-action js-decline">
        <div class="Card-actionButton Card-actionButton--decline">
          <i class="material-icons">close</i>
        </div>
        <p>Reddet</p>
      </div>
      <div class="Card-action js-accept">
        <div class="Card-actionButton Card-actionButton--accept">
          <i class="material-icons">done</i>
        </div>
        <p>Kabul Et</p>
      </div>
    </div>
  </div>
</div>
                </div>
            </div>
        </div>
        <!-- * Arama Dialog Basic -->


        <!-- Dialog Iconed Inline -->
        <div class="modal fade dialogbox" id="arama_kilit" data-backdrop="static" tabindex="-1"
            role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                     <div class="modal-icon text-danger">
                        <ion-icon name="volume-mute-outline"></ion-icon>
                    </div>
                    <div class="modal-header">
                        <h5 class="modal-title">Aramalar Kilitli!</h5>
                    </div>
                    <div class="modal-body">
                        HeySen içerisinde dilediğiniz gibi arama yapıp sesli görüşebilmek için arama kilidini kaldırın!
                    </div>
                    <div class="modal-footer">
                        <div class="btn-inline">
                            <a onclick="buyJeton2('callunlock');" href="javascript:void(0)" class="btn btn-text-success" data-dismiss="modal">
                                <ion-icon name="lock-open-outline"></ion-icon>
                                Kilidi Aç
                            </a>
                            <a href="component-dialog.html#" class="btn btn-text-secondary" data-dismiss="modal">
                                <ion-icon name="hourglass-outline"></ion-icon>
                                Sonra
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- * Dialog Iconed Inline -->

<?php 

}}

?>


        <!-- Dialog Image -->
        <div class="modal fade dialogbox" id="mini_profil" data-backdrop="static" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content" style="max-width: 350px !important;">
                    <img id="mini_profil_src" src="assets/img/sample/photo/1.jpg" alt="image" class="img-fluid">
                    <div class="modal-footer">
                        <div class="btn-inline">
                            <a id="mini_href" href="javascript:void(0)" class="btn btn-text-danger">
                                <ion-icon name="eye-outline"></ion-icon>
                                Profil
                            </a>
                            <a href="javascript:void(0)" class="btn btn-text-primary" data-dismiss="modal">
                                <ion-icon name="close-outline"></ion-icon>
                                Vazgeç
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- * Dialog Image -->


                <!-- Beleş Jeton -->
        <div class="modal fade modalbox" id="belesVitrin" data-backdrop="static" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">Ücretsiz Vitrin Teklifi!</h5>
                        <a href="javascript:;" data-dismiss="modal">Kapat</a>
                    </div>
                    <div class="modal-body">

                            <div class="section mb-2">

 <div class="alert alert-warning mb-1" role="alert">
                    <center>Aşağıdaki Görevi Tamamlayarak<br />
                    Ücretsiz Olarak Vitrine Çıkabilirsin!</center>
                </div>


                <div class="alert alert-primary mb-1" role="alert">
                    <center>Referans Numaran: <?=$myUser['user_id']?></center>
                </div>

<!-- href="https://play.google.com/store/apps/details?id=com.tg.tuca" target="_blank" -->
                    <a onclick="playAc('com.heysen.sevgilibul');" type="button" class="btn btn-danger mr-1 mb-1 btn-block">
                    <ion-icon name="logo-google-playstore" role="img" class="md hydrated" aria-label="document text outline"></ion-icon>
                    Buraya Dokun ve Play Store'a Git
                </a>

<!-- <div class="divider bg-danger mt-2 mb-2">
                <div class="icon-box bg-danger">
                    <ion-icon name="arrow-down" role="img" class="md hydrated" aria-label="arrow down"></ion-icon>
                </div>
            </div> -->
<!--   <center><div class="mt-3 mb-2 toast-center">Aşağıdakileri Yapmalısın</div></center> -->









            <div class="section">
                <!-- timeline -->
                <div class="timeline">
                    <div class="item">
                        <div class="dot"></div>
                        <div class="content">
                            <h4 class="title">1- Yukarıda yazan referans numaranı kopyala.</h4>
                        </div>
                    </div>
                    <div class="item">
                        <div class="dot bg-danger"></div>
                        <div class="content">
                            <h4 class="title">2- Yukarıdaki Kırmızı Buton'a dokun ve Play Store'a Git.</h4>
                        </div>
                    </div>
                    <div class="item">
                        <div class="dot bg-warning"></div>
                        <div class="content">
                            <h4 class="title">3- Uygulamamız için 5 yıldızı seçip uzun ve açıklayıcı bir yorum yaz, yorumun içerisine referans numaranı yazmayı unutma.</h4>
                        </div>
                    </div>
                    <div class="item">
                        <div class="dot bg-info"></div>
                        <div class="content">
                            <h4 class="title">4- Bütün işlemleri yaptıktan sonra Vitrin'de görünmeyi bekle, insanlar mesaj atmaya başladığında vitrinin aktif olduğunu göreceksin. Genelde 15 dakika içerisinde vitrine eklenirsin.</h4>
                        </div>
                    </div>
                </div>
                <!-- * timeline -->
            </div>

                            </div>
                        </div>
            
                </div>
            </div>
        </div>
        <!-- * Beleş Jeton -->


<?php include 'footer.php'; ?>