<?php
include("includes/before-header.php");
if(isset($_GET['id'])&&$_GET['id']!=""){
$id=$_GET['id'];
$query="SELECT * FROM categories WHERE id={$_GET['id']}";
$result=mysqli_query($link,$query);
if($row=mysqli_fetch_array($result)){
$title="دانلود رایگان نت های {$row['name']}";
$description="نت های {$row['name']} پیانو را به رایگان دانلود کنید.";
$keywords="{$row['name']}, نت های {$row['name']}, دسته بندی {$row['name']} نت ها, سبک {$row['name']}, دانلود رایگان نت های {$row['name']}, نت رایگان, خرید نت موسیقی";
$og_type='website';
$og_image='/images/og-logo.png';
$ad_aside=true;
$ad_bottom=true;
$css='nenc.css';
include("includes/header.php");
$id=$_GET['id'];
$query="SELECT * FROM categories WHERE id={$_GET['id']}";
$result=mysqli_query($link,$query);
if($row=mysqli_fetch_array($result)){
?>
<h1><center>دانلود رایگان نت های <?php echo($row['name']); ?></center></h1>
<table width="100%" style="text-align: center">
<tr><td></td><td></td></tr>
<tr>
<?php 
$count=0;
$query="SELECT * from notes WHERE categoryid=$id ORDER BY id DESC";
$result=mysqli_query($link,$query);
while($row=mysqli_fetch_array($result)){
if($count%2==0&&$ismobile==false||$ismobile==true){
	echo("</tr><tr>");
}
$count++;
?>
<td style="width: <?php if($ismobile==false) echo('49'); else echo('100') ?>%;" <?php if($ismobile==true) echo('colspan="2"'); ?> ><center>
	<table class='t' onMouseOver="document.getElementById('nt<?php echo($row['id']) ?>').style='font-weight: 600';style.border= 'solid #9B9B9B 1px'" onMouseOut="document.getElementById('nt<?php echo($row['id']) ?>').style='font-weight: 500';style.border= 'none'">
	<tr><td colspan="2" id="nt<?php echo($row['id']) ?>"><a href="notes/<?php echo($row['url']); ?>" class="ti">
		دانلود رایگان نت <?php echo($row['name']); ?></a></td></tr>
	<tr><td colspan="2"><a href="notes/<?php echo($row['url']); ?>">
	<img src="images/notes/<?php echo($row['image']); ?>" class="i" alt="نت پیانو <?php echo($row['name']); ?>"></a></td></tr>
	<tr><td>آهنگساز:</td>
	<td><?php echo($row['songwriter']); ?></td>
	</tr>
	<?php if($row['singer']!=""){ ?>
	<tr><td>خواننده:</td>
	<td><?php echo($row['singer']); ?></td>
	</tr>
	<?php } ?>
	<?php if($row['details']!=""){ ?>
	<tr>
	<td colspan="2"><?php echo(substr(strip_tags($row['details']),0,80)."..."); ?></td>
	</tr>
	<?php } ?>
	<tr><td colspan="2" class="te">
	<a href="notes/<?php echo($row['url']); ?>"><button class='e' onMouseOver="style.cursor='pointer'">ادامه مطلب</button></a></td></tr>
	</table>
</center></td>
<?php } ?>	
</tr>
</table>
<?php }
if($count==0)
	echo("<span style='color:red;font-size: 130%'><center>هیچ نتی در این دسته بندی یافت نشد!</center></span>"); ?><br>
<?php }else
	header("Location: categories");
}else
	header("Location: categories");
include("includes/footer.php") ?>