<script type="text/javascript" src="<?php echo BASE_URL;?>public/js/library/swfobject.js"></script>

 

<?php
if($this->listData[0]->Image=='')
    {
        $imagePath = ConfigUrl::root().'uploads/image/noimage.png';
        $this->listData[0]->Image = 'noimage.png';
    }

if(trim($this->listData[0]->Video) <> ''){
    $video_extn     = "";
    $arrVideoExtn   = explode(".",trim($this->listData[0]->Video));
    if(is_array($arrVideoExtn) && count($arrVideoExtn) > 0){
        $video_extn     = strtolower($arrVideoExtn[count($arrVideoExtn)-1]);
    }
        
    $video      = ConfigUrl::root().'uploads/video/'.$this->listData[0]->Video;
    $swf        = 'AS3_Javascript';
    $showFlag   = true;
}else if(trim($this->listData[0]->VideoURL) != ''){
    $video      = explode("=",$this->listData[0]->VideoURL);
    $video      = $video[sizeof($video)-1];
    $swf        = 'videoplayeryoutube';
    $showFlag   = true;
}   
?>

<script language="javascript" >
<?php if(trim($video_extn) == "flv"){ ?>
window.onload = function(){ 
  sendTextToAS3();
};
<?php } ?>

    var flashvars = {};

	
	function sendToAS3(elem){
		var Txt = elem.value;


		var flash =	document.getElementById("as3_js");

		flash.sendTextFromJS(Txt);

	//document.getElementById('sendToFlash').value = "";
	}
	function sendTextToAS3(){ 
	      // var Txt = document.getElementById('htmlText').value;
               flashvars.videoid = "<?php echo $video;?>";
               var params = {};
               params.allowfullscreen = "true";
	       var attributes = {};
	       attributes.id = "as3_js";     
	       swfobject.embedSWF("<?php echo BASE_URL;?>uploads/<?php echo $swf; ?>.swf", "alt", "600", "329", "9.0.0", false, flashvars, params, attributes);
         
        }



</script>


<div class="inner_rightpanel">
<div class="bread_crumb">
    
<div class="clear"></div>
</div>

<div class="content_area_div">

<div class="content_area">

<div class="details_page">
<?php if($this->listData[0]->Image=="")
{
    ?>
<div  class="details_wrap2">

<div class="product_details_div_wrp2">
<h2><?php echo $this->listData[0]->Title; ?></h2>
<p><?php echo $this->listData[0]->Description; ?></p>

<div class="details_controlls_wrp2">



<div class="details_ratings_date">
 <?php if(PRODUCT_RATE_MODE=="Y") {?>
<div class="rating_div">
Rating
<div class="clear"></div>
</div>
<?php } ?>
<div class="date_div">
Date : <?php echo date("m/d/Y",strtotime($this->listData[0]->dPostDate)); ?>
<div class="clear"></div>
</div>


<div class="clear"></div>
</div>

<div class="clear"></div>
</div>

<div class="clear"></div>
</div>

<div class="clear"></div>
</div>
<?php }
else
{



$imageVal   = $this->listData[0]->Image;
$imgPath= BASE_PATH.'uploads/image/'.$this->listData[0]->Image;

if($imageVal=="")
{
    $imageVal ='noimage.png';
}
else
{
    $imageVal =$this->listData[0]->Image;   
}

$imageLoc   = ConfigUrl::root().'uploads/image/'.$imageVal;





    if(file_exists(BASE_PATH.'uploads/image/'.$imageVal)==false)
    {
        $imageLoc =ConfigUrl::root().'uploads/image/noimage.png';
    }
    else
    {
       $imageLoc = ConfigUrl::root().'uploads/image/'.$imageVal;
    }



    ?>
<div class="details_wrap1">

<div class="pic_div">
    <img src="<?php echo $imageLoc; ?>" alt="cambigimage" height="302px" width="302px"  >
<div class="clear"></div>
</div>

<div class="product_details_div">
<h2 style="float:left "><?php echo $this->listData[0]->Title; ?></h2>
<div style="overflow:hidden; float:right">
	<div class="date_div">
		Posted On :<?php echo date("m/d/Y",strtotime($this->listData[0]->dPostDate)); ?> &nbsp;
		<div class="clear"></div>
	</div>
</div>
<div class="clear"></div>
<p><?php echo $this->listData[0]->Description; ?></p>

<div class="details_controlls">


<div class="rating-pnl">
 <?php if(PRODUCT_RATE_MODE=="Y") {?>
<?php
                                                $productRating = $this->productRating;
                                                if ($this->productRating > 0) {
 ?> Rating : <div class="rating_<?php echo $productRating; ?>" id="rating_<?php echo $this->productRating; ?>"></div> <?php } else {
                                echo "Not  Rated  Yet";
                            } ?>
<div class="clear"></div>
</div>
<!--div class="details_ratings_date">


<div class="clear"></div>
</div-->
<?php } ?>
<!--<div class="date_div">
Date :<?php echo date("m/d/Y",strtotime($this->listData[0]->dPostDate)); ?>
<div class="clear"></div>
</div>-->


<div class="clear"></div>
</div>

<div class="clear"></div>
</div>

<div class="clear"></div>
</div>


<div class="clear"></div>
</div>
<?php
}
?>
<div class="watch_video" >
<?php
$map_flag = false;
if(trim($this->listData[0]->Zipcode) <> ''){
    $location = trim($this->listData[0]->Zipcode);
    $map_flag = true;
}
elseif(trim($this->listData[0]->Address) <> ''){
    $location = trim($this->listData[0]->Address);
    $map_flag = true;
}

if($this->isValidZip > 0){
    ?>
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&key=<?php echo MAP_API_KEY; ?>"></script>
    <script type="text/javascript">
      var geocoder;
      var map;

      var disp_address = '<?php echo trim(preg_replace('/\s\s+/', ', ', $this->listData[0]->Address)).', '.$this->listData[0]->Zipcode; ?>';

      function initialize() {
        geocoder = new google.maps.Geocoder();
        var latlng = new google.maps.LatLng(-34.397, 150.644);
        var mapOptions = {
          zoom: 12,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        }
        map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
        codeAddress();
      }

      function codeAddress() {
        var address = '<?php echo trim(preg_replace('/\s\s+/', ', ', $location)); ?>';
        geocoder.geocode( { 'address': address}, function(results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
            map.setCenter(results[0].geometry.location);
            var marker = new google.maps.Marker({
                map: map,
                position: results[0].geometry.location
            });

            var infoWindow = new google.maps.InfoWindow();
            var html='<b><u>Address</u></b><br />'+disp_address;
            google.maps.event.addListener(marker, 'click', function() {
                infoWindow.setContent(html);
                infoWindow.open(map, marker);
            });
          }
        });
      }
    </script>
    <div id="map_canvas" style="width:350px; height:320px; margin: 20px 10px 20px 0; float: left"></div>
    <script type="text/javascript">
        initialize();
    </script>
    <?php
}
if($showFlag){
?>
<div class="videosz" style="float:left">
    <h4>&nbsp;</h4>
<div class="clear"></div>


<?php 
if(trim($video_extn) == "mp4" || trim($video_extn) == "webm" || trim($video_extn) == "ogv"){ 
    if(trim($video) <> ""){
?>
<video width="600" height="329" controls>
<source src="<?php echo $video; ?>" type="video/mp4">
<!--<source src="movie.ogg" type="video/ogg">-->
</video> 
<div class="clear">&nbsp;</div>
<?php 
    }
}else{ ?>
<!--------VIDEO PLAYER------------>




<div class="js"  >

</div>

<div class="as3" style="float:left">
	<div id="alt"></div>
</div>



<!--------VIDEO PLAYER------------>
<?php } ?>

</div>

    <?php }?>

   <div class="clear"></div>
    <?php
    $tableArray = array('nBusId','nUserId','nCatid','dPostDate','nStatus','nFeatured','Title','Description','Image','Video','VideoURL','Zipcode','Address','Country','maxSearches');
      $fileExt    = array('txt','doc','pdf','xls');
	 ?>
</div>
    <div class="clear">
        <table width="100%" border="0" class="table-details">
            <?php if($this->listData[0]->Address<>""){ ?>
            <tr><td width="50%"><b>Address</b></td><td><?php echo $this->listData[0]->Address; ?></td></tr>
            <?php } ?>

            <?php foreach($this->listData[0] as $product => $val )
                    {
                       /* if(!in_array($product,$tableArray))
                        {
                            if($val<>"")
                            {
                                $valFile = explode('.',$val);
                                if(in_array($valFile[sizeof($valFile)-1],$fileExt))
                                    echo '<tr><td width="50%"><b>'.$this->listingFields[$product].'</b></td><td><a href="'.ConfigUrl::root().'uploads/doc/'.$val.'" target="_blank">Download</a></td></tr>';
                                else
                                    echo '<tr><td width="50%"><b>'.$this->listingFields[$product].'</b></td><td>'.$val.'</td></tr>';
                            }
                        }*/
						if(!in_array($product,$tableArray))
                        {//echopre($product);
                            if($val<>"")
                            {
                                if($this->listingFields[$product]!=''){
                                    $valFile = explode('.',$val);
                                    if(in_array($valFile[sizeof($valFile)-1],$fileExt))
                                        echo '<tr><td width="50%"><b>'.$this->listingFields[$product].'</b></td><td><a href="'.ConfigUrl::root().'uploads/doc/'.$val.'" target="_blank">Download</a></td></tr>';
                                    else{
                                        if($this->fieldtype[$product]=='1'){
                                           $link_type    =   explode(':',$val);
                                           if($link_type[0]=='http' OR $link_type[0]=='https' ){
                                                $url_link   =$val;
                                            }
                                            else{
                                                $url_link   ='http://'.$val;
                                            }
                                            echo '<tr><td width="50%"><b>'.$this->listingFields[$product].'</b></td><td><a href="'.$url_link.'" target="_blank">'.$url_link.'</a></td></tr>';
                                        }
                                        else{
                                            echo '<tr><td width="50%"><b>'.$this->listingFields[$product].'</b></td><td>'.$val.'</td></tr>';
                                        }
                                    }
                                }
                            }
                        }
						else{
                            if($val<>"")
                            {
                              $tbl_array=array('Zipcode','Address','Country');
                              if(in_array($product,$tbl_array)){
                                //echo '<tr><td width="50%"><b>'.$product.'</b></td><td>'.$val.'</td></tr>'; 
                                 if($this->fieldtype[$product]=='1'){
                                    $link_type    =   explode(':',$val);
                                           if($link_type[0]=='http' OR $link_type[0]=='https' ){
                                                $url_link   =$val;
                                            }
                                            else{
                                                $url_link   ='http://'.$val;
                                            }
                                            echo '<tr><td width="50%"><b>'.$product.'</b></td><td><a href="'.$url_link.'" target="_blank">'.$url_link.'</a></td></tr>';
                                }
                                else{
                                    if($product=='Country'){
                                        global $countries;
                                        echo '<tr><td width="50%"><b>'.$product.'</b></td><td>'.$countries[US].'</td></tr>';
                                    }
                                    else{
                                         echo '<tr><td width="50%"><b>'.$product.'</b></td><td>'.$val.'</td></tr>';
                                    }
                                   
                                }
                              }
                            }
                        }
                    }
             ?>
             <?php //if($this->listData[0]->Country) { ?>
                <!--<tr><td width="50%"><b>Country</b></td><td><?php echo $this->listData[0]->Country; ?></td></tr>-->
            <?php //} ?>
            <?php $paymentStatus = $this->listData[0]->nPaymentStatus == 'P' ? 'Paid' : 'Not Paid';?>
            <tr><td width="50%"><b>Payment Status</b></td><td><?php echo $paymentStatus ?></td></tr>

            <?php $isFeatured = $this->listData[0]->nFeatured == '1' ? 'Yes' : 'No';?>
            <tr><td width="50%"><b>Featured</b></td><td><?php echo $isFeatured; ?></td></tr>
        </table>
    </div>
<!-- Details Comment Section Start -->
<?php if(PRODUCT_COMMENT_MODE=="Y") {?>
<div class="comment_section">
<h2>Comments</h2>
<ul>
<?php
foreach ($this->productComment as $comment)
{
?>

<li>

<div class="commet_list">
<p><?php echo $comment->vComment; ?></p>
<div class="commtz_by">
<h5><span>Posted By </span>: <?php echo $comment->vName; ?></h5>
<h6></h6>
</div>

<div class="clear"></div>
</div>

</li>
<?php } ?>


</ul>



<div class="clear"></div>
</div>

<!-- Details Comment Section End -->



<div class="clear"></div>
</div>
<?php } ?>

<div class="clear"></div>
</div>





<div class="clear"></div>
</div>


<div class="clear"></div>
</div>



<div class="clear"></div>

<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
