Location: PHPKode > projects > A-Dater Pro - Online Dating Script > a-dater-pro-online-dating-script/sop.php
<center>

<?php
/*
  ******************************************************
  ***   A-Dater Pro        Version 2                 ***
  ***   File name          sop.php                   ***
  ***   Script Owner       Alfacom Systems           ***
  ***   Script Homepage    www.a-dater.com           ***
  ***   Licence Terms      www.a-dater.com/licence   ***
  ***                                                ***
  ***   You need to purchase a license if you want   ***
  ***   to use this script with ads or without the   ***
  ***   reference to www.a-dater.com                 ***
  ******************************************************
*/

  include('includes/include_check.php');


  $selectTest = mysql_query("SELECT sopNah FROM seaded");

  $rowTest = mysql_fetch_assoc($selectTest);

  $do = false;

  if($rowTest['sopNah'] == 1){

    $do = true;

  }

  elseif($rowTest['sopNah'] == 2){

    if(isset($_SESSION['id'])){

      $do = true;

    }

else{

      $error = '<br><p>'.safe_display($word_402).'</p>';

    }

  }

  elseif($rowTest['sopNah'] == 3){

    if(isset($_SESSION['id']) && isVip((int)$_SESSION['id'])){

      $do = true;

    }

    else{

    	$error = '<br><p>'.safe_display($word_403).'</p>';

    }

  }

   elseif ($rowTest['sopNah'] == 0){

  	$error = '<br><p>'.safe_display($word_404).'</p>';

  }  

  if($do && isset($_GET['id']) || isset($_SESSION['id']) && $_SESSION['id'] == $_GET['id']){

?>

  <div class="sisu_paigutus2">

    <table id="border_blue" width="450">

      <tr id="bg_dblue">

        <td class="text_sinine" align="center"><?php print safe_display($word_405) ?></td>

        <td class="text_sinine" align="center"><?php print safe_display($word_406) ?></td>

        <td class="text_sinine" align="center"><?php print safe_display($word_407) ?></td>

      </tr>

<?php

  if($_GET['action'] == 1){

    $select = mysql_query("SELECT * FROM sobrad WHERE sobra_id = ".(int)$_GET['id']." && olek = 1 ORDER BY date");

    while($row = mysql_fetch_assoc($select)){

    $selectKes = mysql_query("SELECT * FROM kasutajad WHERE id = ".(int)$row['kasutaja_id']);

	$rowKes = mysql_fetch_assoc($selectKes);

	$selectKeda = mysql_query("SELECT * FROM kasutajad WHERE id = ".(int)$row['sobra_id']);

	$rowKeda = mysql_fetch_assoc($selectKeda);

?>

  <tr id="bg_blue">

    <td align="center"><a href="index.php?leht=kasutaja&id=<?=(int)$rowKes['id']?>"><?=safe_display($rowKes['kasutaja'])?></a></td>

    <td align="center"><a href="index.php?leht=kasutaja&id=<?=(int)$rowKeda['id']?>"><?=safe_display($rowKeda['kasutaja'])?></a></td>

    <td align="center"><?=display_new_timestamp($row['date'])?></td>

  </tr>

<?php

    }

  }

  elseif($_GET['action'] == 2){

    $select = mysql_query("SELECT * FROM sobrad WHERE kasutaja_id = ".(int)$_GET['id']." && olek = 1 ORDER BY date");

    while($row = mysql_fetch_assoc($select)){

    $selectKes = mysql_query("SELECT * FROM kasutajad WHERE id = ".(int)$row['kasutaja_id']);

	$rowKes = mysql_fetch_assoc($selectKes);

	$selectKeda = mysql_query("SELECT * FROM kasutajad WHERE id = ".(int)$row['sobra_id']);

	$rowKeda = mysql_fetch_assoc($selectKeda);

?>

  <tr id="bg_blue">

    <td align="center"><a href="index.php?leht=kasutaja&id=<?=(int)$rowKes['id']?>"><?=safe_display($rowKes['kasutaja'])?></a></td>

    <td align="center"><a href="index.php?leht=kasutaja&id=<?=(int)$rowKeda['id']?>"><?=safe_display($rowKeda['kasutaja'])?></a></td>

    <td align="center"><?=display_new_timestamp($row['date'])?></td>

  </tr>

<?php

    }

  }

  print '</table>';

  }

  else{

  	print $error;

  }

  print'

  </div>';

?>

</center>
Return current item: A-Dater Pro - Online Dating Script