<?php
session_start();
//if($_SESSION[city]!="")
//{
include ('dbf.php');
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>نرم افزار كتابداري و كتابخواني نوين</title>
</head>
</html>
<table dir="ltr" align="center" border="0" style="padding-top:10px;background-repeat:no-repeat;width:100%"   >
 <tr>
   <td id="header"  valign="top" align="center"><?php  include_once ('header.php');?></td>
 </tr>
   	<div id="menu" align="center">
		  <?php
//		  if($_SESSION[onvan]=='عضو')
//			 include('menuozv.php');
//		  elseif($_SESSION[onvan]=='')
		  	 if($_SESSION[onvan]=='')
		     echo"<script>window.location='index.php'</script>";
		   ?>
	</div>

 <tr>
	<td height="700" width="100%" align="center" valign="top"  style="padding-top:10px;border-style:ridge;border-width:thick;padding-right:5px;padding-left:5px;border-color:#6D3E06">
		<span style="font-family:B Nazanin;font-size:17pt"><b>لیست کتب</b></span><br/>
		<table align="center" width="70%" border="0" dir="rtl">
			<tr style="font-family:B Nazanin;font-size:14pt" bgcolor="<?php echo $_SESSION[backheader]; ?>">
			 	<td align="center" width="5%"><b>رديف</td>
			 	<td align="center" width="40%"><b>نام کتاب</td>
			 	<td align="center" width="10%"><b>مشاهده </td>
 			</tr>
 			<?php

 				$color=array($_SESSION['bgcolor'],$_SESSION['bgcolor1']); $a=0;
 				$forder=$_GET['forder'];
				$start=$_GET['start'];
				$page_name="textpage4.php";
                if(strlen($start) > 0 and !is_numeric($start)){
                 echo "Data Error";
                 exit;
                 }
               	 $eu = ($start - 0);
                 $limit = 10;
                 $this1 = $eu + $limit;
   	             $back = $eu - $limit;
       	         $next = $eu + $limit;

				$fg=mysql_query("select * from `soati`  group by name order by ip");
				$nume=mysql_num_rows($fg);




				$fg=mysql_query("select * from soati group by name order by oulaviat limit $eu, $limit");

				$i=1;
				while($v=mysql_fetch_assoc($fg))
				{
				$ipp=$v['ip'];
//				$fg1=mysql_query("select * from ketab where (city='{$_SESSION['city']}' and id='{$v['id']}') order by id ");
//				$v11=mysql_fetch_assoc($fg1);
				?>
			<tr align="center"  style="font-family:B Nazanin;font-size:16pt" onmouseover="this.style.backgroundColor='<?php echo $_SESSION[backheader];?>';" onmouseout="this.style.backgroundColor='<?php echo $color[$a]; ?>';"  bgcolor=<?php echo $color[$a]; ?>>
				<?php
				echo "</td><td>$i</td>
				<td><span class:blacktext>".$v['name']."</td>";
				?>
				<td>
					<a href="textpage4.php?phf=7&&rizbook=<?php echo $ipp; ?>" >
					<img src="images/12.png" width="20" height="20">
					</a>
				</td>
				<?php
				echo "</span>";

				if($a==1) $a=0;  else $a=1;
				$i++;
				}

				?>
			</tr>
			<tr  bgcolor="<?php echo $_SESSION[backheader]; ?>" >
				<td colspan="12" >
					<?php
					if(!isset($_POST['sear']) and !$forder)
					include ('paging3.php');
					?>
				</td>
			</tr>
		</table>
		<?php
		if (isset($_GET['rizbook']))
		{
		$fg142=mysql_query("select * from soati where (ip='{$_GET['rizbook']}') order by oulaviat ");
		$v142=mysql_fetch_assoc($fg142);
		?>
		<br/>
		<br/>
		<br/>
		<br/>
		<span style="font-family:B Nazanin;font-size:17pt"><b>لیست فایل های صوتی مربوط به کتاب :
		</span><span style="font-family:B Nazanin;font-size:17pt;color:purple">
		<?php echo $v142['name']; ?>
		</b></span><br/>
		<table align="center" width="70%" border="0" dir="rtl">
			<tr style="font-family:B Nazanin;font-size:14pt" bgcolor="<?php echo $_SESSION[backheader]; ?>">
			 	<td align="center" width="5%"><b>رديف</td>
			 	<td align="center" width="40%"><b>نام</td>
			 	<td align="center" width="10%"><b>MP3</td>
 			</tr>
 			<?php

 				$color=array($_SESSION['bgcolor'],$_SESSION['bgcolor1']); $a=0;

				$fg=mysql_query("select * from soati where (name='{$v142['name']}') order by oulaviat ");

				$i=1;
				while($v=mysql_fetch_assoc($fg))
				{
				$ipp=$v['ip'];
//				$fg1=mysql_query("select * from ketab where (city='{$_SESSION['city']}' and id='{$v['id']}') order by id ");
//				$v11=mysql_fetch_assoc($fg1);
				?>
			<tr align="center"  style="font-family:B Nazanin;font-size:16pt" onmouseover="this.style.backgroundColor='<?php echo $_SESSION[backheader];?>';" onmouseout="this.style.backgroundColor='<?php echo $color[$a]; ?>';"  bgcolor=<?php echo $color[$a]; ?>>
				<?php
				echo "</td><td>$i</td>
				<td><span class:blacktext>".$v['name1']."</td>";
				?>
				<td>
					<a target="_blank" href="soati/<?php echo $v['ip']; ?>.mp3" >
					فایل
					</a>
				</td>
				<?php
				echo "</span>";

				if($a==1) $a=0;  else $a=1;
				$i++;
				}

				?>
			</tr>
			<tr  bgcolor="<?php echo $_SESSION[backheader]; ?>" >
				<td colspan="12" align="center">
					<a href="textpage4.php?phf=7" >
					<img src="images/r1.png" width="20" height="20">
					</a>
				</td>
			</tr>
		</table>
		<?php
		}
		?>
	</td>
 </tr>

 <tr>
   <td id="header" ><?php  include ('foteer.php');?></td>
 </tr>
</table>
<?php
//}
//else
//include('index.php');
?>
