', '&', '{', '}', '*','$','1','2','3','4','5','6','7','8','9','0'); $cng=array('<', '>', '&', '{', '}', '*','$','£'); $value= strtolower($value); $value = str_replace($cng, '', trim($value)); $langth=strlen($value); if(substr($value,$langth-7,$langth)=='escorts') { $value = substr($value,0,$langth-7); } if(substr($value,$langth-7,$langth)=='escort') { $value = substr($value,0,$langth-6); } $value = str_replace(' ', '-', trim($value)); $value=trim(str_replace(chr(194)," ",$value)); return $value; } function special_char($string) { return preg_replace('/([\200-\277])/e', "'&#'.(ord('\\1')).';'", $string); } function parse_input($text) { if (get_magic_quotes_gpc()) { $text = stripslashes($text); } if (function_exists("mysql_real_escape_string")) { $text = mysql_real_escape_string($text); } else { $text = addslashes($text); } return trim($text); } function parse_output($text) { if(get_magic_quotes_gpc()) { $text = stripslashes($text); } // $text =htmlspecialchars($text); // $text = htmlentities($text); return $text; } function get_pageurl($id, $type) { global $db; $gal_query="select url from tbl_redirect where type='".$type."' and id='".$id."'"; $rsq_gall1=$db->siri_query($gal_query); $rs_gall1=$db->siri_fetch_array($rsq_gall1); $pageurl=$rs_gall1['url']; return $pageurl; } function Change_Format($str_date) { $arr_date = explode("-",$str_date); return $arrnew_date = $arr_date[2]."-".$arr_date[1]."-".$arr_date[0]; } function words_limit($string,$limit) { if(strpos($string,'-')) { $words = explode("-", $string); } else{ $words = explode(" ", $string); } return implode(" ", array_splice($words, 0, $limit)); } function limit_words($string,$limit) { if(strpos($string,'-')) { $words = explode("-", $string); } else{ $words = explode(" ", $string); } //$words = explode(" ", $string); return implode(" ",array_splice($words, 0 , $limit)); } function gallery_name($gal_id) { global $db; $gal_query="select GalleryName from tblgallery where GalleryID='".$gal_id."'"; $rsq_gall1=$db->siri_query($gal_query); $rs_gall1=$db->siri_fetch_array($rsq_gall1); $GalleryName=$rs_gall1['GalleryName']; return $GalleryName; } function key_id($id,$type) { global $db; $gal_query="select key_id from ".TBL_PREFIX_NAME."modellisting where model_id ='".$id."' and type='".$type."' order by autoid desc limit 1"; $rsq_gall1=$db->query($gal_query); $rs_gall1=$db->fetch($rsq_gall1); $key_id=$rs_gall1['key_id']; if($key_id!='') { return $key_id; } else { return $key_id=='0'; } } function location_name($gal_id) { global $db; $gal_query="select attributes_name from ".TBL_PREFIX_NAME."attribute_listings where attributes_type = '3' and attributes_display_status='1' and id='".$gal_id."'"; $rsq_gall1=$db->query($gal_query); $rs_gall1=$db->fetch($rsq_gall1); $location=$rs_gall1['attributes_name']; if($location!='') { return $location; } else { return $gal_id; } } function nationality_name($gal_id) { global $db; $gal_query="select attributes_name from ".TBL_PREFIX_NAME."attribute_listings where attributes_type = '2' and attributes_display_status='1' and id='".$gal_id."'"; $rsq_gall1=$db->query($gal_query); $rs_gall1=$db->fetch($rsq_gall1); $location=$rs_gall1['attributes_name']; if($location!='') { return $location; } else { return $gal_id; } } function location_count_escorts($id) { $id=str_replace("_"," ",$id); global $db; $gal_query='select * from tblmodel a inner join gallmodel b on b.`model_id` = a.ModelID where a.Location = "'.$id.'" and b.Dispstatus=1'; $rsq_gall1=$db->siri_query($gal_query); $num=$db->siri_num_rows($rsq_gall1); return $num; } function postcode_count_escorts($id) { $id=str_replace("_"," ",$id); global $db; $gal_query="select * from appears a inner join gallmodel b on b.`model_id` = a.model_id where a.keyword_id='".$id."' and a.type=1 and b.Dispstatus=1"; $rsq_gall1=$db->siri_query($gal_query); $num=$db->siri_num_rows($rsq_gall1); return $num; } function review_count_escorts($id) { global $db; $gal_query='select * from tblreview where ModelID = "'.$id.'"'; $rsq_gall1=$db->siri_query($gal_query); $num=$db->siri_num_rows($rsq_gall1); return $num; } function model_name($id) { global $db; $gal_query="select ModelName from tblmodel where ModelID='".$id."'"; $rsq_gall1=$db->siri_query($gal_query); $rs_gall1=$db->siri_fetch_array($rsq_gall1); $ModelName=$rs_gall1['ModelName']; return $ModelName; } function change_name($name) { $name=str_replace(" ","-",$name); $name=trim(strtolower($name)); $name=str_replace("escorts","",$name); $name=str_replace("girls","",$name); $name=str_replace("massage","massage-",$name); return $name; } function gallery_url($name) { $name=($name=='all escorts')?'gallery':$name; $name=str_replace("escorts","",$name); $name=str_replace(" ","-",trim($name)); $name=trim(strtolower($name)); return $name; } function change_url($name) { $name=str_replace(" ","-",$name); $name=trim(strtolower($name)); return $name; } function subval_sort($a,$subkey) { foreach($a as $k=>$v) { $b[$k] = strtolower($v[$subkey]); } asort($b); foreach($b as $key=>$val) { $c[] = $a[$key]; } return $c; } function get_modelid($name) { global $db; $cat_qry="SELECT ModelID FROM tblmodel WHERE ModelName='".$name."'"; $rsq=$db->siri_query($cat_qry); $rs_model=$db->siri_fetch_array($rsq); return $rs_model['ModelID']; } function get_modelid_url($name) { global $db; $cat_qry="SELECT ModelID FROM tblmodel WHERE Urlname='".$name."'"; $rsq=$db->siri_query($cat_qry); $rs_model=$db->siri_fetch_array($rsq); return $rs_model['ModelID']; } $web_pages = array ( "1" => "index1", "2" => "Gallery", "3" => "Contact us", "4" => "Gallery Category", "5" => "Links", "6" => "Banner", "7" => "Add Link", "8" => "Recruitment", "9" => "Sitemap", ); function get_rate($rate) { $rate=str_replace("£","",$rate); $rate=str_replace("£","",$rate); if($rate) { if(preg_match("/^([a-zA-Z-])/i", $rate,$matches)) { $re_rates=$rate; } else { $re_rates= '£'.$rate; } } else { $re_rates=$rate; } return $re_rates; } function escort_thumbnail($id) { global $db; $gal_image="select imgURL from db_photo where model_id='".$id."' and imgType='thumbnail' "; $rsq_image=$db->siri_query($gal_image); $rs_image=$db->siri_fetch_array($rsq_image); $mage_name=$rs_image['imgURL']; return $mage_name; } function escort_image($id,$type) { global $db; if($type=="featured_image" || $type=="thumbnail" ) { $image_name=escort_thumbnail($id); } else { $gal_image="select $type from tblmodel where ModelID='".$id."'"; $rsq_image=$db->siri_query($gal_image); $rs_image=$db->siri_fetch_array($rsq_image); $image_name=$rs_image[$type]; } return $image_name; } function get_message($message,$url) { //global $db; $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_URL, $url); $data = curl_exec($ch); curl_close($ch); $keyword_arr = explode(",",$data); $murl = str_replace(' ',' ',$message); $msg_details = strtolower($murl); $find_src=""; if(count($keyword_arr)>0) { foreach($keyword_arr as $key => $value) { if(strstr($msg_details,strtolower(trim("$value")))) { $find_src.=$value.", "; } } return $find_src; } } function escort_services($id) { global $db; $gal_services="select service from tblservices where id='".$id."'"; $rsq_services=$db->siri_query($gal_services); $rs_services=$db->siri_fetch_array($rsq_services); $services=$rs_services['service']; return $services; } function getting_postcode($id) { global $db; $gal_services="select keyword_id from appears where model_id='".$id."' and type=1"; $rsq_services=$db->siri_query($gal_services); $postcode_name=""; $rsq_count=$db->siri_num_rows($rsq_services); if($rsq_count >0) { while($rs_services=$db->siri_fetch_array($rsq_services)) { $services=$rs_services['keyword_id']; $qry3 ="select location,id from tbl_postcode where id='$services'"; $propres3 = $db->siri_query($qry3); $propdata3=$db->siri_fetch_array($propres3); $post_name=change_name($propdata3["location"]); $url=''; $postcode_name .= $url.$propdata3['location'].", "; } $post=trim($postcode_name,', '); } else { $post=""; } return $post; } function getting_postcode_model($id) { global $db; $gal_services="select model_id from appears where keyword_id='".$id."' and type=1 group by model_id"; $rsq_services=$db->siri_query($gal_services); $postcode_name=""; $rsq_count=$db->siri_num_rows($rsq_services); if($rsq_count >0) { while($rs_services=$db->siri_fetch_array($rsq_services)) { $model_id=$rs_services['model_id']; $qry3="SELECT c.ModelName as ModelName,c.ModelID as ModelID FROM `gallmodel` a, tblmodel c WHERE c.ModelID ='$model_id' AND a.`model_id` = c.ModelID and a.dispstatus='1' " ; $propres3 = $db->siri_query($qry3); $propdata3=$db->siri_fetch_array($propres3); $url=''; $postcode_name .= $url.$propdata3['ModelName'].", "; } $post=trim($postcode_name,', '); } else { $post=""; } return $post; } function getting_location_model($id) { global $db; $gal_services="select location from tbl_nationality where id='".$id."' and type=2"; $rsq_services=$db->siri_query($gal_services); $rs_services=$db->siri_fetch_array($rsq_services); $postcode_name=""; $location=$rs_services['location']; $qry3="SELECT c.ModelName as ModelName,c.ModelID as ModelID FROM `gallmodel` a, tblmodel c WHERE c.Location ='$location' AND a.`model_id` = c.ModelID and a.dispstatus='1' group by c.ModelID" ; $rsq_services=$db->siri_query($qry3); $rsq_count=$db->siri_num_rows($rsq_services); if($rsq_count >0) { while($rs_services=$db->siri_fetch_array($rsq_services)) { $url=''; $postcode_name .= $url.$rs_services['ModelName'].", "; } $post=trim($postcode_name,', '); } else { $post=""; } return $post; } function getting_tube_model($id) { global $db; $gal_services="select location from tbl_nationality where (tube_station1='".$id."' or tube_station2='".$id."') and type=2"; $rsq_services=$db->siri_query($gal_services); $rs_services=$db->siri_fetch_array($rsq_services); $rsq_count1=$db->siri_num_rows($rsq_services); $postcode_name=""; $location=$rs_services['location']; $qry3="SELECT c.ModelName as ModelName,c.ModelID as ModelID FROM `gallmodel` a, tblmodel c WHERE c.Location ='$location' AND a.`model_id` = c.ModelID and a.dispstatus='1' group by c.ModelID" ; $rsq_services=$db->siri_query($qry3); $rsq_count=$db->siri_num_rows($rsq_services); if($rsq_count >0 && $rsq_count1 >0) { while($rs_services=$db->siri_fetch_array($rsq_services)) { $url=''; $postcode_name .= $url.$rs_services['ModelName'].", "; } $post=trim($postcode_name,', '); } else { $post=""; } return $post; } function get_loc_name($loc) { global $db; $rsq_services=$db->siri_query("select location from tbl_nationality where id='".$loc."' and type=2"); $rs_services=$db->siri_fetch_array($rsq_services); return $rs_services['location']; } /////////Add By Jugal///////// function checkpath($PATH) { if(!is_dir($PATH)) { mkdir($PATH,0777); } } function renamefile($path, $filename) { $arr=explode('.',$filename); $ext = $arr[count($arr)-1]; $allowed = "/[^a-z0-9\\_]/i"; $body = preg_replace($allowed,"",$arr[0]); $filename1 = $body.'.'.$ext; $cpt = 1; while (@file_exists($path.$filename1)) { $body1 = $body . '_' . $cpt; $filename1 = $body1 . '.' . $ext; $cpt++; } return $filename1; } function getextention($fname) { if(!preg_match("/(.+)\.(.*?)\Z/", $fname, $matches)) { } return $matches[2]; } function FileUplod($PATH,$FILENAME,$FILEBOX) { checkpath($PATH); $PATH = $PATH.'/'; $ext=getextention($FILENAME); $fname=time()."_".mt_rand(1,1000).".".$ext; $FILENAME = renamefile($PATH,$fname); $file=$PATH.$FILENAME; $uploaded="TRUE"; global $_FILES; if (! @file_exists($file)) { if( isset( $_FILES[$FILEBOX] ) ) { if (is_uploaded_file($_FILES[$FILEBOX]['tmp_name'])) { move_uploaded_file($_FILES[$FILEBOX]['tmp_name'], $file); }else{ $uploaded="FALSE"; } } } //end of if @fileexists return $FILENAME; } function SingleResult($sql) { global $db; $result=$db->query($sql); $value=$db->fetch($result); $rsval=$value['0']; return $rsval; } function getprofile_url($name) { $name=trim($name); $name=str_replace(" ","-",$name); $name='profile/'.$name; return $name ; } /******** Function By ajay ***********/ function page_deatils($page_id) { global $db; $qry =$db->query("select * from ".TBL_PREFIX_NAME."page_contant where id=$page_id"); $data = $db->fetch($qry); $arr_page['page_name']=$data['page_name']; $arr_page['pageheading']=$data['pageheading']; $arr_page['metatitle']=$data['metatitle']; $arr_page['metakeywords']=$data['metakeywords']; $arr_page['metadescription']=$data['metadescription']; $arr_page['description']=$data['description']; $arr_page['description1']=$data['description1']; $arr_page['page_url']=$data['page_url']; $arr_page['page_image']=$data['page_image']; return $arr_page; } function escortsOfMonths() { global $db; $rsq21=$db->query("SELECT i1.imgURL as escort_month_image, a1.Urlname as Urlname, a1.Age as Age, a1.ModelName as ModelName,a1.ModelID as ModelID,a1.messageview as messageview FROM `".TBL_PREFIX_NAME."model` as a1 INNER JOIN ".TBL_PREFIX_NAME."modellisting as b1 on a1.ModelID=b1.model_id INNER JOIN ".TBL_PREFIX_NAME."modelimage as i1 on i1.model_id=a1.ModelID where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.escort_month_flag='1' and a1.member_area='0' and b1.Dispstatus =1 and i1.imgType='EscortMonth' and b1.type='1' and i1.imgURL !='' and b1.key_id ='1' order by rand() limit 0,1"); if(mysql_num_rows($rsq21)>0) { $rs21=$db->fetch($rsq21); $arr['Urlname']=$rs21['Urlname']; $arr['ModelID']=$rs21['ModelID']; $arr['imgURL']=$rs21['imgURL']; $arr['escort_month_image']=$rs21['escort_month_image']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['Age']=$rs21["Age"]; $arr['messageview']=$rs21["messageview"]; }else { $arr = 0; } return $arr; } function escortsOfDay() { global $db; $rsq21=$db->query("SELECT i1.imgURL as escort_day_image, a1.Urlname as Urlname, a1.Age as Age, a1.ModelName as ModelName,a1.ModelID as ModelID FROM `".TBL_PREFIX_NAME."model` as a1 INNER JOIN ".TBL_PREFIX_NAME."modellisting as b1 on a1.ModelID=b1.model_id INNER JOIN ".TBL_PREFIX_NAME."modelimage as i1 on a1.ModelID=i1.model_id where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.escort_day_flag='1' and a1.member_area='0' and b1.Dispstatus =1 and i1.imgType='EscortDay' and b1.type='1' and b1.key_id ='1' and i1.imgURL !='' order by rand() limit 0,1"); if(mysql_num_rows($rsq21)>0) { $rs21=$db->fetch($rsq21); $arr['Urlname']=$rs21['Urlname']; $arr['ModelID']=$rs21['ModelID']; $arr['imgURL']=$rs21['imgURL']; $arr['escort_day_image']=$rs21['escort_day_image']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; }else { $arr = 0; } return $arr; } function headerescort($limit) { global $db; if(!empty($limit)) { $order = ' order by rand() limit 0,'.$limit; } $rsq21=$db->query("SELECT i1.imgURL as imgURL, a1.Urlname as Urlname, a1.ModelName as ModelName,a1.Age as Age, a1.messageview as messageview,a1.ModelID as ModelID FROM `".TBL_PREFIX_NAME."model` as a1 INNER JOIN ".TBL_PREFIX_NAME."modellisting as b1 on a1.ModelID =b1.model_id INNER JOIN ".TBL_PREFIX_NAME."modelimage as i1 on i1.model_id=a1.ModelID where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.header_flag='1' and a1.member_area='0' and b1.Dispstatus =1 and b1.type='1' and i1.imgType='ChineseMonth' and b1.key_id ='1' and i1.imgURL !='' GROUP BY b1.model_id ".$order." "); if(mysql_num_rows($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['Urlname']=$rs21['Urlname']; $arr['ModelID']=$rs21['ModelID']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['messageview']=$rs21["messageview"]; $newarr[$i]=$arr; $i++; } }else { $newarr = 0; } return $newarr; } function availableEscort($limit) { global $db; if(!empty($limit)) { $order = ' order by rand() limit 0,'.$limit; } $rsq21=$db->query("SELECT i1.imgURL as imgURL, a1.Urlname as Urlname, a1.ModelName as ModelName,a1.Age as Age, a1.messageview as messageview,a1.ModelID as ModelID FROM `".TBL_PREFIX_NAME."model` as a1 INNER JOIN ".TBL_PREFIX_NAME."modellisting as b1 on a1.ModelID=b1.model_id INNER JOIN ".TBL_PREFIX_NAME."modelimage as i1 on i1.model_id=a1.ModelID where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.awylity='1' and a1.member_area='0' and b1.Dispstatus =1 and b1.type='1' and i1.imgType='AvailableEscort' and b1.key_id ='1' and i1.imgURL !='' GROUP BY b1.model_id $order "); if(mysql_num_rows($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { //$arr[]=array("Urlname" =>$rs21['Urlname'], "ModelID" =>$rs21['ModelID'],"imgURL" =>$rs21['imgURL'],"ModelID" =>$rs21['ModelID'],"ModelID" =>$rs21['ModelID'], ) $arr['Urlname']=$rs21['Urlname']; $arr['ModelID']=$rs21['ModelID']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['messageview']=$rs21["messageview"]; $newarr[$i]=$arr; $i++; } }else { $newarr = 0; } return $newarr; } function availableEscort1() { global $db; $order = ' order by rand()' ; $rsq21=$db->query("SELECT i1.imgURL as imgURL, a1.Urlname as Urlname, a1.ModelName as ModelName,a1.Age as Age, a1.messageview as messageview,a1.ModelID as ModelID FROM `".TBL_PREFIX_NAME."model` as a1 INNER JOIN ".TBL_PREFIX_NAME."modellisting as b1 on a1.ModelID=b1.model_id INNER JOIN ".TBL_PREFIX_NAME."modelimage as i1 on i1.model_id=a1.ModelID where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.awylity='1' and a1.member_area='0' and b1.Dispstatus =1 and b1.type='1' and i1.imgType='AvailableEscort' and b1.key_id ='1' and i1.imgURL !='' GROUP BY b1.model_id $order "); if(mysql_num_rows($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['Urlname']=$rs21['Urlname']; $arr['ModelID']=$rs21['ModelID']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['messageview']=$rs21["messageview"]; $newarr[$i]=$arr; $i++; } }else { $newarr =0; } return $newarr; } function EscortsOfTheWeek($limit) { global $db; if(!empty($limit)) { //$order = 'order by rand() '; $order = ' order by rand() limit 0,'.$limit; } $rsq21=$db->query("SELECT i1.imgURL as imgURL, a1.Urlname as Urlname, a1.ModelName as ModelName,a1.Age as Age , a1.messageview as messageview , a1.ModelID as ModelID,a1.member_area as member_area FROM `".TBL_PREFIX_NAME."model` as a1 INNER JOIN ".TBL_PREFIX_NAME."modellisting as b1 on a1.ModelID=b1.model_id INNER JOIN ".TBL_PREFIX_NAME."modelimage as i1 on a1.ModelID=i1.model_id where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.escort_month_flag='1' and b1.Dispstatus =1 and i1.imgType='EscortMonth' and b1.type='1' and b1.key_id ='1' and i1.imgURL !='' GROUP BY b1.model_id $order " ); /*$rsq21=$db->query("SELECT i1.imgURL as imgURL, a1.Urlname as Urlname, a1.ModelName as ModelName,a1.Age as Age, a1.messageview as messageview,a1.ModelID as ModelID FROM `".TBL_PREFIX_NAME."model` as a1, ".TBL_PREFIX_NAME."modellisting as b1 ,".TBL_PREFIX_NAME."modelimage as i1 where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.newentry='1' and a1.member_area='0' and b1.Dispstatus =1 and b1.type='1' and i1.imgType='NewEscort' and b1.key_id ='1' GROUP BY b1.model_id $order "); */ if(mysql_num_rows($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['Urlname']=$rs21['Urlname']; $arr['ModelID']=$rs21['ModelID']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['messageview']=$rs21["messageview"]; $arr['member_area']=$rs21["member_area"]; $newarr[$i]=$arr; $i++; } }else { $newarr =0; } return $newarr; } function featuredEscorts($limit) { global $db; if(!empty($limit)) { //$order = 'order by rand() '; $order = ' order by rand() limit 0,'.$limit; } $rsq21=$db->query("SELECT i1.imgURL as imgURL, a1.Urlname as Urlname, a1.ModelName as ModelName,a1.Age as Age , a1.messageview as messageview , a1.ModelID as ModelID,a1.member_area as member_area FROM `".TBL_PREFIX_NAME."model` as a1 INNER JOIN ".TBL_PREFIX_NAME."modellisting as b1 on a1.ModelID=b1.model_id INNER JOIN ".TBL_PREFIX_NAME."modelimage as i1 on a1.ModelID=i1.model_id where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.feature='1' and b1.Dispstatus =1 and i1.imgType='FeaturedEscort' and b1.type='1' and b1.key_id ='1' and i1.imgURL !='' GROUP BY b1.model_id $order " ); /*$rsq21=$db->query("SELECT i1.imgURL as imgURL, a1.Urlname as Urlname, a1.ModelName as ModelName,a1.Age as Age, a1.messageview as messageview,a1.ModelID as ModelID FROM `".TBL_PREFIX_NAME."model` as a1, ".TBL_PREFIX_NAME."modellisting as b1 ,".TBL_PREFIX_NAME."modelimage as i1 where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.newentry='1' and a1.member_area='0' and b1.Dispstatus =1 and b1.type='1' and i1.imgType='NewEscort' and b1.key_id ='1' GROUP BY b1.model_id $order "); */ if(mysql_num_rows($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['Urlname']=$rs21['Urlname']; $arr['ModelID']=$rs21['ModelID']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['messageview']=$rs21["messageview"]; $arr['member_area']=$rs21["member_area"]; $newarr[$i]=$arr; $i++; } }else { $newarr =0; } return $newarr; } function newEscorts($limit="") { global $db; if(!empty($limit)) { //$order = ' order by ModelID desc limit 0,'.$limit; $order = ' order by rand() limit 0,'.$limit; } $rsq21=$db->query("SELECT i1.imgURL as imgURL, a1.Urlname as Urlname, a1.ModelName as ModelName,a1.Measurements as Measurements,a1.Age as Age,a1.member_area as member_area, a1.messageview as messageview,a1.ModelID as ModelID FROM `".TBL_PREFIX_NAME."model` as a1 INNER JOIN ".TBL_PREFIX_NAME."modellisting as b1 on a1.ModelID=b1.model_id INNER JOIN ".TBL_PREFIX_NAME."modelimage as i1 on i1.model_id=a1.ModelID where a1.ModelID = i1.model_id and a1.ModelID = b1.model_id and a1.newentry='1' and b1.Dispstatus =1 and b1.type='1' and i1.imgType='NewEscort' and i1.imgURL!='' and b1.key_id ='1' GROUP BY b1.model_id $order "); if(mysql_num_rows($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['Urlname']=$rs21['Urlname']; $arr['ModelID']=$rs21['ModelID']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['messageview']=$rs21["messageview"]; $arr['Measurements']=$rs21["Measurements"]; $arr['member_area']=$rs21["member_area"]; $newarr[$i]=$arr; $i++; } }else { $newarr =0; } return $newarr; } function bookingEscorts($limit="") { global $db; if(!empty($limit)) { $order = ' order by rand() limit 0,'.$limit; }else { $order = 'order by a.Disporder desc'; } if(!empty($_SESSION['login_username'])){ $mem_con=" "; } else { $mem_con=" and c.member_area='0'"; } $rsq21=$db->query("SELECT d.imgURL as imgURL, c.Urlname as Urlname, c.ModelName as ModelName,c.Age as Age,c.messageview as messageview, c.ModelID as ModelID, c.member_area as member_area,c.newentry as new,c.awylity as away,c.exclusive as exclusive,a.autoid as GalleryID FROM `".TBL_PREFIX_NAME."modellisting` a INNER JOIN ".TBL_PREFIX_NAME."model c on a.model_id=c.ModelID INNER JOIN ".TBL_PREFIX_NAME."modelimage d on d.model_id=c.ModelID WHERE a.`model_id` = c.ModelID and d.model_id=a.`model_id` and d.imgType='thumbnail' and a.type=1 and a.dispstatus='1' and a.key_id ='1' and d.imgURL!='' group by c.ModelID $order "); if($db->num($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['Urlname']=$rs21['Urlname']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['ModelID']=$rs21['ModelID']; $arr['GalleryID']=$rs21['GalleryID']; $arr['messageview']=$rs21["messageview"]; $arr['member_area']=$rs21["member_area"]; $arr['new']=$rs21["new"]; $arr['away']=$rs21["away"]; $arr['exclusive']=$rs21["exclusive"]; $newarr[$i]=$arr; $i++; } }else { $newarr = 0; } return $newarr; } function bookingEscorts2($limit="",$ModelID) { global $db; if(!empty($limit)) { $order = ' order by rand() limit 0,'.$limit; }else { $order = 'order by a.Disporder desc'; } /* if(!empty($_SESSION['login_username'])){ $mem_con=" "; } else { $mem_con=" and c.member_area='0'"; } */ $rsq21=$db->query("SELECT d.imgURL as imgURL,c.member_area as member_area, c.Urlname as Urlname, c.ModelName as ModelName,c.Age as Age,c.messageview as messageview, c.ModelID as ModelID, c.member_area as member_area,c.newentry as new,c.awylity as away,c.exclusive as exclusive,a.autoid as GalleryID FROM `".TBL_PREFIX_NAME."modellisting` a INNER JOIN ".TBL_PREFIX_NAME."model c on c.ModelID=a.model_id INNER JOIN ".TBL_PREFIX_NAME."modelimage d on d.model_id=c.ModelID WHERE a.`model_id` = c.ModelID and d.model_id=a.`model_id` and d.imgType='thumbnail' and a.type=1 and a.dispstatus='1' and c.ModelID='".$ModelID."' and d.imgURL!='' group by c.ModelID $order "); if($db->num($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['Urlname']=$rs21['Urlname']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['ModelID']=$rs21['ModelID']; $arr['GalleryID']=$rs21['GalleryID']; $arr['messageview']=$rs21["messageview"]; $arr['member_area']=$rs21["member_area"]; $arr['new']=$rs21["new"]; $arr['away']=$rs21["away"]; $arr['exclusive']=$rs21["exclusive"]; $newarr[$i]=$arr; $i++; } }else { $newarr = "no any escorts avilable"; } return $newarr; } function MemberEscorts() { global $db; $rsq21=$db->query("SELECT d.imgURL as imgURL, c.Urlname as Urlname, c.ModelName as ModelName,c.Age as Age,c.messageview as messageview, c.location_type as location_type, c.ModelID as ModelID,a.autoid as GalleryID FROM `".TBL_PREFIX_NAME."modellisting` a INNER JOIN ".TBL_PREFIX_NAME."model c on a.model_id=c.ModelID INNER JOIN ".TBL_PREFIX_NAME."modelimage d on d.model_id=c.ModelID WHERE a.`model_id` = c.ModelID and d.model_id=a.`model_id` and d.imgType='thumbnail' and c.member_area='1' and a.type=1 and a.dispstatus='1' and d.imgURL!='' group by c.ModelID order by a.Disporder desc "); if($db->num($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['Urlname']=$rs21['Urlname']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['ModelID']=$rs21['ModelID']; $arr['GalleryID']=$rs21['GalleryID']; $arr['messageview']=$rs21["messageview"]; $newarr[$i]=$arr; $i++; } }else { $newarr = "no any escorts avilable"; } return $newarr; } function commonTable($type) { global $db; $rsq21=$db->query("SELECT * FROM `".TBL_PREFIX_NAME."comman` where type = '".$type."' and status='Active' "); if($db->num($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['id']=$rs21['id']; $arr['content']=$rs21['content']; $arr['imgURL']=$rs21['imgURL']; $arr['ModelName']=$rs21["ModelName"]; $arr['Age']=$rs21["Age"]; $arr['ModelID']=$rs21['ModelID']; $arr['GalleryID']=$rs21['GalleryID']; $newarr[$i]=$arr; $i++; } }else { $newarr = "No Any Records avilable"; } return $newarr; } function complexion_name($id) { global $db; $gal_query="select content from ".TBL_PREFIX_NAME."comman where id='".$id."' and type = '1' and status='Active'"; $rsq_gall1=$db->query($gal_query); $rs_gall1=$db->fetch($rsq_gall1); $location=$rs_gall1['content']; if($location!='') { return $location; } else { return $id; } } function Hair_name($id) { global $db; $gal_query="select content from ".TBL_PREFIX_NAME."comman where id='".$id."' and type = '2' and status='Active'"; $rsq_gall1=$db->query($gal_query); $rs_gall1=$db->fetch($rsq_gall1); $location=$rs_gall1['content']; if($location!='') { return $location; } else { return $id; } } function Eyes_name($id) { global $db; $gal_query="select content from ".TBL_PREFIX_NAME."comman where id='".$id."' and type = '4' and status='Active'"; $rsq_gall1=$db->query($gal_query); $rs_gall1=$db->fetch($rsq_gall1); $location=$rs_gall1['content']; if($location!='') { return $location; } else { return $id; } } function Build_name($id) { global $db; $gal_query="select content from ".TBL_PREFIX_NAME."comman where id='".$id."' and type = '3' and status='Active'"; $rsq_gall1=$db->query($gal_query); $rs_gall1=$db->fetch($rsq_gall1); $location=$rs_gall1['content']; if($location!='') { return $location; } else { return $id; } } function categoryList() { global $db; $rsq21=$db->query("select * from ".TBL_PREFIX_NAME."linkcategory order by disporder desc "); if($db->num($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['categoryID']=$rs21['categoryID']; $arr['categoryTitle']=$rs21['categoryTitle']; $arr['pageTitle']=$rs21['pageTitle']; $arr['mataTitle']=$rs21['mataTitle']; $arr['pageDescription']=$rs21['pageDescription']; $arr['pageKeyword']=$rs21['pageKeyword']; $arr['modpath']=$rs21['modpath']; $newarr[$i]=$arr; $i++; } }else { $newarr = "No Any Records avilable"; } return $newarr; } function bannerList($categoryID) { global $db; $rsq21=$db->query("select * from ".TBL_PREFIX_NAME."linkdetail where linkStatus='1' and linkCategory='$categoryID' and DispStatus='1' order by toporder"); if($db->num($rsq21)>0) { $i=0; while($rs21=$db->fetch($rsq21)) { $arr['bannercode']=$rs21['bannercode']; $arr['website']=$rs21['website']; $arr['image']=$rs21['image']; $arr['URL']=$rs21['URL']; $newarr[$i]=$arr; $i++; } }else { $newarr = "No Any Records avilable"; } return $newarr; } function displey_error($error) { if(trim($error)!='') { $val='
'.$error.''; return $val; } } function is_valid_email($email) { $result = TRUE; if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) { $result = FALSE; } return $result; } function encrypted_value($flag=1) { $key = md5('ESP_guitars_rock'); $original_value = 'Bing is actually famous, I checked in Google'; $iv = substr(md5('Metallica'),0,mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CFB)); $encrypted_value = base64_encode(mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $original_value, MCRYPT_MODE_CFB, $iv)); //Now create a decent hash with a 10 character salt $salt = substr(md5(uniqid(rand(), true)), 0, 10); $hashed_value = $salt . substr(sha1($salt . $original_value),-10); if($flag==1) { return $encrypted_value; } else if($flag==2) { return $hashed_value; } } function new_hashed_value($encrypted_value,$hashed_value) { $key = md5('ESP_guitars_rock'); $iv = substr(md5('Metallica'),0,mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CFB)); $decrypted_value = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, base64_decode($encrypted_value), MCRYPT_MODE_CFB, $iv); //Now letís recreate the hash //We can extract the salt from the original hash $salt = substr($hashed_value, 0, 10); $new_hashed_value = $salt . substr(sha1($salt . $decrypted_value), -10); return $new_hashed_value; } function get_browser_value() { if (get_cfg_var('browscap')) { $browser = get_browser(null, true); //If available, use PHP native function } else { require_once("includes/php-local-browscap.php"); $browser=get_browser_local(null, true); } return $browser; } function get_location_ip() { $ip=$_SERVER['REMOTE_ADDR']; $url = "http://api.ipinfodb.com/v3/ip-city/?key=7f310bdbcd10d0aea3da474412c74636aa82afb413fb76f43bd90a887c0bf561&ip=$ip&format=json"; $d = file_get_contents($url); $browser_location = json_decode($d , true); return $browser_location; } function getExcerpt($str, $startPos=0, $maxLength=100) { if(strlen($str) > $maxLength) { $excerpt = substr($str, $startPos, $maxLength-3); $lastSpace = strrpos($excerpt, ' '); $excerpt = substr($excerpt, 0, $lastSpace); $excerpt .= '...'; } else { $excerpt = $str; } return $excerpt; } function getting_price($pr){ global $db; $both_value=explode("-",$pr); $TOTAL=$db->query("SELECT count(*) as total FROM ".TBL_PREFIX_NAME."modellisting ML, ".TBL_PREFIX_NAME."model M WHERE ML.attribute2 BETWEEN '".trim($both_value[0])."' AND '".trim($both_value[1])."' and ML.model_id=M.ModelID and ML.type=4 and ML.dispstatus='1' and M.member_area='0' group by ML.attribute2 order by ML.attribute2 ASC "); if($db->num($TOTAL)>0) { return $TOTAL; } } function getting_age($pr){ global $db; $both_value=explode("-",$pr); $TOTAL=$db->query("SELECT count(*) as total FROM ".TBL_PREFIX_NAME."model M, ".TBL_PREFIX_NAME."modellisting ML WHERE M.Age BETWEEN '".trim($both_value[0])."' AND '".trim($both_value[1])."' and ML.model_id=M.ModelID and ML.dispstatus='1' and M.member_area='0' group by M.Age order by M.Age ASC "); if($db->num($TOTAL)>0) { return $TOTAL; } } function AtributesName($atributeid,$type){ global $db; $gal_query="select attributes_name from ".TBL_PREFIX_NAME."attribute_listings where attributes_type = '".$type."' and attributes_display_status='1' and id='".$atributeid."'"; $rsq_gall1=$db->query($gal_query); $rs_gall1=$db->fetch($rsq_gall1); $name=$rs_gall1['attributes_name']; if($name!='') { return $name; } } function ModelImage($type,$ModelID){ global $db; $sql="select imgURL from ".TBL_PREFIX_NAME."modelimage where model_id='".$ModelID."' and imgType='".$type."' and status='1'"; $rs=$db->query($sql); if($db->num($rs)>0) { $rs2=$db->fetch($rs); return $rs2["imgURL"]; } } function ModelName($ModelID){ global $db; $sql="select ModelName from ".TBL_PREFIX_NAME."model where ModelID='".$ModelID."'"; $rs=$db->query($sql); if($db->num($rs)>0) { $rs2=$db->fetch($rs); return $rs2["ModelName"]; } } function get_nationality_name($ModelID) { global $db; $Nationality=SingleResult("SELECT key_id FROM ".TBL_PREFIX_NAME."modellisting where model_id='".$ModelID."' and type='3'"); return $nation=SingleResult("SELECT attributes_name FROM ".TBL_PREFIX_NAME."attribute_listings where id='".$Nationality."' and attributes_type='2'"); } function limit_text($text, $limit) { if (str_word_count($text, 0) > $limit) { $words = str_word_count($text, 2); $pos = array_keys($words); $text = substr($text, 0, $pos[$limit]) . '...'; } return $text; } function getEscortRate($escortID) { global $db; $rate_q = $db->query("select attribute2,attribute3 from ".TBL_PREFIX_NAME."modellisting a left join ".TBL_PREFIX_NAME."comman b on b.id= a.attribute1 where model_id='".$escortID."' and content='1 hour'"); $rate_data = $db->fetch($rate_q); if($rate_data['attribute2']!='' || $rate_data['attribute3']!='') { return (($rate_data['attribute2'])?'£'.$rate_data['attribute2']:'').(($rate_data['attribute3'])?'/£'.$rate_data['attribute3']:''); } return false; } /******** End Of Code ************/ ?>