<?php 
  
  $hs=$xcon->getMyNeedPost($ownID);
    
 if ($hs->rowCount()>0) {
  
   $hH=$hs->fetchAll();
 
?>
<b><small>MY NEEDS POST</small></b>
 <form action="hexaNdeal.php" method="post">

		 <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>">

         <small><i>(<input  class="posi" type="submit" value="Switch other's need" name="post"  >)</i></small>
 </form>
<?php
foreach ($hH as $key => $hD) {


$needid=$hD['needid']; 
$Of=$xcon->getMyNeedPostPeopleOffer($ownID,$needid); 	
   ?>
  
 <section style="padding-left:10%;">
 <b> <?php echo $hD['title'] ?> </b>

 <small>(Post by:<i><?php echo $hD['cperson']."(".$hD['cphone'].")";?></i></small>
 <small>Posted:<i><?php echo $hD['posteddate']."(status:".$hD['status'].")";?></i></small>
 <small>Category:<i><?php echo $hD['category'];?></i></small>)
<?php
if ($Of->rowCount()<=0)
    {
	 echo "Offer: (".$Of->rowCount().")";
    }
    else{
    	?>
         <form action="getThisMyNeedOffer.php" method="post">
          <input class="hi" type="hidden" name="owniD"  value="<?php echo $ownID;?>"> 
          <input class="hi" type="hidden" name="needid"  value="<?php echo $needid;?>">
          Offer:(<input  class="posi" type="submit" value="<?php echo $Of->rowCount();?>" name="post"  >)
         </form>
        <?php
        }
       ?>
 <br/>
 <b> Description </b><br/>
   <?php echo $hD['description'] ?><br>     
  <small>Location:<i><?php echo $hD['region'].",".$hD['district'].",".$hD['street']."(Deadline:".$hD['deadline'].")";?></i></small>  
 
 </section><p/> 
 		  
<?php
 
}
  
}
else
{
	?> <b><small>MY NEED'S POST</small></b> 
		<p/><small>Not posted yet!.. </small><p/>  
			
	 
	<?php
	     require('getOtherNeedPost.php');
?> 
<?php
}  
?>