<?php include("DBConfig/Connection.php");

include("DBConfig/function.php");

 $post_res=mysqli_query($connect,"select * from post inner join servicesoperator  on `post_serviceOperID`=`ServicesOperator_id`
inner join services on `Services_id`=ServicesOperator_servicesID
 
 WHERE  postLink='".post($connect,$_REQUEST['link'])."'");
 
$row_post=mysqli_fetch_assoc($post_res) 

 
 ?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
                        <title><?php echo($row_post['post_title']); ?> </title>
    <link rel="stylesheet" href="css/content.css"></link>
</head>
<body>
    <div class="container page-container">
        <div class="page-header-wrapper">
            <span class="service-title"><?php echo($row_post['ServicesOperator_name']); ?></span>
                            <span class="service-logo"><img src="postFiles/<?php echo($row_post['ServicesOperator_logo']); ?>"></span>
                    </div>
        <div class="page-title">
            <p><?php echo($row_post['post_title']); ?></p>
            <p class="publish-time"><i class="fa fa-clock-o"></i> <?php echo($row_post['post_date']); ?> </p>
        </div>
                    <div id="carousel-generic" class="carousel slide" data-ride="carousel">
                <!-- Indicators -->
                                                                                                                                                                                                            
                <!-- Wrapper for slides -->
                
<?php    $postImages=mysqli_query($connect,"SELECT * FROM `postImages` WHERE `postImages_postid`='".post($connect,$row_post['post_id'])."'");
  
 if(mysqli_num_rows($postImages)!=0){
  ?>
                
                <div class="carousel-inner" role="listbox">
                
                  <?php 
				  $ximage=0;while($row_postImages=mysqli_fetch_assoc($postImages)){
					  $ximage++; ?>                             
                       <div class="item <?php if($ximage==1){ ?> active<?php }  ?>">
<img src="postFiles/<?php echo($row_postImages['postImages_image']); ?>" alt="">
</div>               
                                <?php  }  ?>                               
<?php /*?><div class="item active">
<img src="http://palsms.ps/contentBank/uploads/images/14866491401921963130.jpg" alt="">
</div>


<div class="item ">
<img src="http://palsms.ps/contentBank/uploads/images/14866491401372705100.jpg" alt="">
</div><?php */?>






                                                            </div>
                                                            
                                                            
                                                            
                                    <?php }   ?>                        
                                                            
                                                            
                                                            

                <!-- Controls -->
                                    <a class="left carousel-control" href="#carousel-generic" role="button" data-slide="prev">
                        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                        <span class="sr-only">Previous</span>
                    </a>
                    <a class="right carousel-control" href="#carousel-generic" role="button" data-slide="next">
                        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                        <span class="sr-only">Next</span>
                    </a>
                
            </div>
                <div class="page-content">
         <?php echo($row_post['post_text']); ?>
        </div>


<?php   if($row_post['post_ved_adu']!=''){ ?>


                    <div class="media-container">
                <audio controls>
                                        <source src="postFiles/<?php echo($row_post['post_ved_adu']); ?>" type="audio/mpeg">
                    Your browser does not support the audio element.
                </audio>
                
            </div>
            <?php   } ?>
            
            
                <div class="share-buttons">
                
                جميع الحقوق محفوظة <?php echo(date("Y")); ?>
            <?php /*?><p class="share-title">شارك الموضوع مع أصدقائك</p><?php */?>
            <!-- Go to www.addthis.com/dashboard to customize your tools -->
            
<?php /*?>
            <a href="http://www.facebook.com/share.php?u=http://offers.ps/platform/c<?php echo($row_post['postLink']); ?>" target="_blank" title="Share This on Facebook">
                <img src="http://palsms.ps/contentBank/assets/images/fb.png" alt="facebook share">
            </a>
            <a href="http://twitter.com/share?url=http://offers.ps/platform/c<?php echo($row_post['postLink']); ?>&text=<?php echo($row_post['post_title']); ?>" target="_blank" title="Tweet this page on Twitter">
                <img src="http://palsms.ps/contentBank/assets/images/tiwiter.png" alt="twitter share">
            </a>
            <a href="whatsapp://send?text=http://offers.ps/platform/c<?php echo($row_post['postLink']); ?>" target="_blank" title="Share This on whatsapp" data-action="share/whatsapp/share">
                <img src="http://palsms.ps/contentBank/assets/images/whatsup.png" alt="Whatsapp share">
            </a>
            <a href="sms:123456789&body=sometext">
                <img src="http://palsms.ps/contentBank/assets/images/sms.png" alt="sms share">
            </a><?php */?>

        </div>

    </div>
<script src="postsFiles/Js/app.min.js"></script>
<script src="postsFiles/Js/angular.min.js"></script>
    <script>
        $(document).ready(function(){
            $('#carousel-generic').carousel();
        });

    </script> 
    <!-- Go to www.addthis.com/dashboard to customize your tools -->
    </body>
</html> 