<?php
include("header.php");
?>
<div class="w3-row-padding ">
  <div class="w3-twothird w3-white" style='margin-bottom:10px'>
   <?php 
   $ky=$_REQUEST["post"];
   foreach(single_notes($connect,$ky) as $row){
	      
   $title=$row["topic"];
   $covsm=$row["cover_sm"];
   $covlg=$row["cover_lg"];
   $notes=$row["notes"];
   $user=$row["user"];
   $service=$row["service"];
   }
   ?>
    <h1 class='w3-text-blue'><?php echo ucwords($title);?></h1>
		
    <div  class="w3-justify">
	  <img src="<?php echo "../admin/pages/notes/".$covsm;?>" alt="<?php echo  $title;?>" style="max-width:100%;min-height:250px;max-height:300px;margin-bottom:10px">
	  
	  
      <p><?php echo $notes;?></p> 
	</div>

  </div>
  
  <div class="w3-third" style='padding:5px'>
			
	 	<div class="w3-container w3-padding w3-indigo">
		 <h5 class=''>Related Posts</h5>
		</div>
		
		<?php
		 foreach(srelated_notes($connect,$service,$ky) as $row){
	      
   $id=$row["id"];
   $title=ucwords($row["topic"]);
   $covsm=$row["cover_sm"];
   $covlg=$row["cover_lg"];
   // $notes=strip_tags($row["notes"]);
   $notes=strip_tags($row["notes"]);
   $user=$row["user"];
   $service=$row["service"];
   
   $strlength=strlen($notes);
	if($strlength>100){
		$n=substr(strtolower($notes),0,100)."<h4 style='font-size:20px'>.... </h4> ";
		
		
	}else{
		$n=$notes;
	}
   
   ?>
   
    <div class="w3-container  w3-hover-opacity w3-light-grey w3-justify" style='cursor:pointer;padding:2px' id='<?php echo  $id;?>' onclick='window.location.assign("post.php?post=<?php echo $id;?>")'>
		<div class="w3-col s3 " style='max-width:200px;margin:5px'>
			<img src="<?php echo "../admin/pages/notes/".$covsm;?>" style="width:100%;min-height:115px;max-height:250px">
		  </div>
      <h2 class='w3-text-indigo'><?php echo $title;?></h2>
      <p class="" style='font-size:'><?php echo $n;?></p>
	  </div><br>
	 <?php } ?>
	
		
	 
	
		<div class="w3-container w3-white w3-card-2" style='padding:0px'>
					<div class="w3-container w3-padding w3-blue">
					  <h5 class=''>Subscribe For Updates</h5>
					</div>
					<div class="w3-container" style='padding:0px'>
	<form class="w3-container padding-16" style='' id='form-subscribe' method='post'>
						
						<p>
						<label>Email</label>
						<input class="w3-input w3-border" type="eamil" name='user-email' autocomplete=on required>
						</p>
						 
						<p >
						<input type="hidden" name="btn_action" value='Add-Subscriber' id="btn_action" />
						<button type='submit' class="w3-btn-block w3-large w3-red w3-round " >Subscribe</button>
						</p>
					  </form>   
					</div>
			 </div>
	
	
  </div>
  
  
</div>
<br>
<?php
include("footer.php");
?>
		