<?php

	// include files
	require_once('../admin/php/config.php');
	require_once('../admin/php/db.php');
	require_once('../admin/php/login.php');
	require_once('php/info.php');
	require_once('../admin/php/status.php');
	require_once('../admin/php/massiv.php');
	//
	// query
	$userquery = $_SESSION['idb'];
	$page_name = "photo";
	$result = mysql_query("SELECT * FROM $page_name WHERE user = '$userquery' AND  hidden_status <> '3' ORDER by id DESC", $db);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo($admin_title);?></title>
<link rel="stylesheet" type="text/css" href="../admin/css/style.css" />
</head>
<body>
<script src="../admin/script.js" language="javascript"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="18%" valign="top" style="padding:10px;"><?php include('menu.php'); ?></td>
    <td width="82%" valign="top" style="padding: 10px;">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top" class="adm_ct">
          <table width="100%" border="0" cellpadding="5" cellspacing="5">
            <tr>
              <td width="5%" valign="top"><strong>ID.LN</strong></td>
              <td width="95%" valign="top" colspan="2"><strong>Photo | Title | Gallery | City | Moderator | Edit | Unlock / Lock | Delete</strong></td>
            </tr>
            <?php
			// code
			echo('<tr bgcolor="'.$col["1"].'">'."\n");
			echo('<td width="100%" valign="top" colspan="3">'."\n");
			// add page
			echo('<a href="edit_'.$page_name.'.php?eventb=add"><img src="img/t6b.gif" border="0" alt="add page"></a>&nbsp;');
			//
			echo('<a href="edit_'.$page_name.'.php?eventb=add" class="t2">Add photo</a>');
			echo('</td>'."\n");
			echo('</tr>'."\n");
			// result
			if(@$myrow = mysql_fetch_array($result))
			{
				do
				{
			?>
              <tr bgcolor="<?php echo($col["1"]); ?>">
                <td width="5%" valign="top">
				<?php
					//
					echo('<b>'.$myrow['id'].'.'.$myrow['list_number'].'</b>');
				?>
				</td>
                <td width="90%" valign="top">
				<?php
					// image
					if($myrow['url'] != "")
					{
						echo('<img src="'.$photo_path_admin.$myrow['url'].'" width="60" height="40" border="0">');
					}
					// title
					echo(' Title: ');
					if($myrow['title1'] != "")
					{
						echo('<font face="'.$info["langfont"]["1"].'"><b>'.$myrow['title1'].'</b></font>');
					}
					// title
					if($myrow['title2'] != "")
					{
						echo(', <font face="'.$info["langfont"]["2"].'"><b>'.$myrow['title2'].'</b></font>');
					}
					// type
					if($myrow['type'] != "")
					{
						echo(', Gallery: <b><font face="'.$info["langfont"]["2"].'">'.$info["rub"][$myrow['type']].'</b></font>');
					}
					// city
					if($myrow['city'] != "")
					{
						//
						$city = $myrow['city'];
						$resultc = mysql_query("SELECT * FROM city WHERE id = '$city' AND hidden_status <> '3' ORDER by list_number ASC", $db);
						if(@$myrowc = mysql_fetch_array($resultc))
						{
						}
						//
						echo(', City: <b><font face="'.$info["langfont"]["2"].'">'.@$myrowc['title2'].' ('.$myrow['city'].')</b></font>');
					}
					// user
					if($myrow['user'] != "")
					{
						//
						$user = $myrow['user'];
						$resultc = mysql_query("SELECT * FROM moderators WHERE id = '$user' AND hidden_status <> '3' ORDER by list_number ASC", $db);
						if(@$myrowc = mysql_fetch_array($resultc))
						{
						}
						//
						echo(', User: <b><font face="'.$info["langfont"]["2"].'">'.@$myrowc['username'].' ('.$myrow['user'].')</b></font>');
					}
					echo('<br>');
				?>
				</td>
                <td width="5%" valign="top">
				<?php
					// change
					echo('<a href="edit_'.$page_name.'.php?id='.$myrow['id'].'&eventb=change"><img src="img/red.gif" border="0" alt="change"></a>&nbsp;');
					// status admin
					//echo('<a href="javascript:hidden_status(\''.$myrow['id'].'\',\''.$myrow['hidden_status_admin'].'\',\'change_status_admin\',\''.$page_name.'\');"><img src="img/statusb'.$myrow['hidden_status_admin'].'.gif" border="0" alt="hidden status (admin)"></a>&nbsp;');
					// status
					echo('<a href="javascript:hidden_status(\''.$myrow['id'].'\',\''.$myrow['hidden_status'].'\',\'change_status\',\''.$page_name.'\');"><img src="img/status'.$myrow['hidden_status'].'.gif" border="0" alt="hidden status"></a>&nbsp;');
					// delete
					echo('<a href="javascript:delete_page(\''.$myrow['id'].'\',\'delete\',\''.$page_name.'\');"><img src="img/delete.gif" border="0" alt="delete"></a>');	
				?>
				</td>
              </tr>
				<?php
				} 
				while($myrow = mysql_fetch_array($result));
			}
			?>
          </table>
		  </td>
      </tr>
    </table>
	</td>
  </tr>
</table>
</body>
</html>