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

<?php
/*
  ******************************************************
  ***   A-Dater Pro        Version 2                 ***
  ***   File name          maaramata.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');

  include('includes/log_check.php');

  include('includes/mode_check.php');


  //Muutmine või kustutamine

  if(isset($_POST['submit'])){

  	array_pop($_POST);

  	foreach ($_POST AS $number => $olek){

      if($olek == 3){

      	$select_kustuta = mysql_query("SELECT pilt FROM pildid WHERE id='".(int)$number."'");

      	$row_kustuta = mysql_fetch_assoc($select_kustuta);

      	unlink('thumb/'.$row_kustuta['pilt']);

  	    unlink('pilt/'.$row_kustuta['pilt']);

  	    mysql_query("DELETE FROM kommentaarid WHERE pildi_id='".(int)$number."'");

  	    mysql_query("DELETE FROM pildid WHERE id='".(int)$number."'");

      }

      elseif($olek == 1 || $olek == 2){

        mysql_query("UPDATE pildid SET olek='".(int)$olek."', mode='".$_SESSION['id']."' WHERE id ='".(int)$number."' LIMIT 1");      	

      }

  	}  	

  }

  $select_pilt = mysql_query("

    SELECT

      pildid.id AS id,

      pildid.pilt AS pilt,

      pildid.kasutaja_id AS kasutaja_id,

      kasutajad.kasutaja AS kasutaja

    FROM 

      pildid,

      kasutajad

    WHERE 

      pildid.olek = 0

      &&

      kasutajad.id = pildid.kasutaja_id

      ||

      pildid.olek = 2

      &&

      kasutajad.id = pildid.kasutaja_id

    ORDER BY

      pildid.date

  ");

  if(mysql_num_rows($select_pilt) > 0){

    $olekud = $include_olekud;

    print '<div class="sisu_paigutus2">

	       <table id="border_blue">

            <tr id="bg_dblue">

              <td class="text_sinine">'.safe_display($word_185).'</td>

              <td class="text_sinine" width="120">'.safe_display($word_186).'</td>

              <td class="text_sinine" width="120">'.safe_display($word_187).'</td>

            </tr>

            <form method="POST" action="index.php?leht=maaramata">';

    while($row_pilt = mysql_fetch_assoc($select_pilt)){

      print '<tr id="bg_blue">

  	          <td><a href="pilt/'.$row_pilt['pilt'].'" target="_blank"><img src="thumb/'.$row_pilt['pilt'].'"></img></a></td>

  	          <td align="center"><div style="padding-left: 25px;"><div id="user_icon"></div><div id="div_float_left" style="padding-left: 3px;"><a href="index.php?leht=kasutaja&id='.$row_pilt['kasutaja_id'].'">'.$row_pilt['kasutaja'].'</a></div></div></td>

  	          <td align="center">

  	            <select name="'.(int)$row_pilt['id'].'">';

  	            foreach($olekud AS $number => $olek){

  	              print '<option value="'.(int)$number.'">'.$olek.'</option>';

  	            }   

      print     '</select>     

  	          </td>

  	        </tr>';

    }

    print '<tr>

              <td colspan="2" id="bg_blue"></td>

              <td id="bg_blue" align="center"><input name="submit" type="submit" value="'.safe_display($word_188).'"></td>

            </tr>

          </form>

          </table></div>';

  }

  else{

  	print '<br><p>'.safe_display($word_189).'</p>';

  }

?>

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