query("select id from sites_urls where link = '".$website."'"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $id = $dbConn->getField("id"); } } return $id; } function getAge( $p_strDate ) { list($Y,$m,$d) = explode("-",$p_strDate); return( date("md") < $m.$d ? date("Y")-$Y-1 : date("Y")-$Y ); } function get_fp_photos(){ mysql_connect('localhost','escort','k4r4ch1'); mysql_select_db('inpulse'); $result2 = mysql_query("select distinct g_stats.w_name from g_stats,g_setup,photo2 where g_setup.id = g_stats.id and g_stats.id = photo2.gid and g_setup.archive = 0 and g_stats.galHeading = 'NEW' and photo2.thumb NOT LIKE '%default%' order by rand()") or die (mysql_error()); while (list($pic_name)=mysql_fetch_row($result2)){ $getPic = mysql_query("SELECT g_stats.id, photo2.thumb, g_stats.galHeading, g_stats.dob, g_stats.bust, g_stats.dress, g_stats.galCaption FROM g_stats,photo2,g_setup where g_stats.w_name = '$pic_name' and g_stats.id = photo2.gid and g_setup.id = g_stats.id and g_setup.archive=0 and photo2.thumb NOT LIKE '%default%' order by photo2.main desc") or die (mysql_error()); list($grlID,$gthm,$heading,$dob,$bust,$dress,$caption)=mysql_fetch_row($getPic); if(preg_match('/default/i',$gthm)){ $path="default"; } else { $path="thumbs"; } $image_path = '/photo/'.$path.'/'; $_feat[]= array('gid' => $grlID,'age' => getAge($dob),'bust' => $bust, 'dress' => $dress, 'gthm' => $gthm, 'wname' => strtolower($pic_name), 'image_path' => $image_path, 'path' => $path, 'heading' => $heading, 'caption' => strtolower($caption)); } return $_feat; } function get_ft_photos(){ mysql_connect('localhost','escort','k4r4ch1'); mysql_select_db('inpulse'); $result2 = mysql_query("select distinct g_stats.w_name from g_stats,g_setup,photo2 where g_setup.id = g_stats.id and g_stats.id = photo2.gid and g_setup.archive = 0 and g_stats.galHeading = 'NEW' and photo2.thumb NOT LIKE '%default%' order by rand() limit 0,6") or die (mysql_error()); while (list($pic_name)=mysql_fetch_row($result2)){ $getPic = mysql_query("SELECT g_stats.id, photo2.thumb, g_stats.galHeading, g_stats.dob, g_stats.bust, g_stats.dress, g_stats.galCaption FROM g_stats,photo2,g_setup where g_stats.w_name = '$pic_name' and g_stats.id = photo2.gid and g_setup.id = g_stats.id and g_setup.archive=0 and photo2.thumb NOT LIKE '%default%' order by photo2.main desc") or die (mysql_error()); list($grlID,$gthm,$heading,$dob,$bust,$dress,$caption)=mysql_fetch_row($getPic); if(preg_match('/default/i',$gthm)){ $path="default"; } else { $path="thumbs"; } $image_path = '/photo/'.$path.'/'; $_feat[]= array('gid' => $grlID,'age' => getAge($dob),'bust' => $bust, 'dress' => $dress, 'gthm' => $gthm, 'wname' => strtolower($pic_name), 'image_path' => $image_path, 'path' => $path, 'heading' => $heading, 'caption' => strtolower($caption)); } return $_feat; } function gallery(){ $dbConn = new database(); $dbConn->query("select distinct g_stats.w_name from g_stats,g_setup,photo2 where g_setup.id = g_stats.id and g_stats.id = photo2.gid and g_setup.archive = 0 and photo2.thumb NOT LIKE '%default%' order by RAND()"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $pic_name = $dbConn->getField("w_name"); $getImg = new database(); $getImg->query("SELECT g_stats.id, photo2.thumb, g_stats.galHeading, g_stats.dob, g_stats.bust,g_stats.profile, g_stats.dress, g_stats.galCaption FROM g_stats,photo2,g_setup where g_stats.w_name = '$pic_name' and g_stats.id = photo2.gid and g_setup.id = g_stats.id and g_setup.archive=0 and photo2.thumb NOT LIKE '%default%' order by photo2.main desc limit 0,1"); if($getImg->num_rows()>0){ while($getImg->moveNext()){ if(preg_match('/default/i',$getImg->getField("thumb"))){ $path="default"; } else { $path="thumbs"; } $image_path = '/photo/'.$path.'/'; $_data[]= array('gid' => $getImg->getField("id"), 'age' => getAge($getImg->getField("dob")), 'bust' => $getImg->getField("bust"), 'prof' => $getImg->getField("profile"), 'dress' => $getImg->getField("dress"), 'caption' => strtolower($getImg->getField("galCaption")), 'gthm' => $getImg->getField("thumb"), 'wname' => strtolower($pic_name), 'image_path' => $image_path, 'main_img_path' => '/photo/pics/', 'main_img' => str_replace('t_', 'a', $getImg->getField("thumb")), 'path' => $path, 'heading' => $getImg->getField("galHeading")); } } } } return $_data; } function tgallery(){ $dbConn = new database(); $dbConn->query("select distinct g_stats.w_name from g_stats,g_setup,photo2 where g_setup.id = g_stats.id and g_stats.id = photo2.gid and g_setup.archive = 0 and photo2.thumb NOT LIKE '%default%' order by RAND() limit 0,24"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $pic_name = $dbConn->getField("w_name"); $getImg = new database(); $getImg->query("SELECT g_stats.id, photo2.thumb, g_stats.galHeading, g_stats.dob, g_stats.bust,g_stats.profile, g_stats.dress, g_stats.galCaption FROM g_stats,photo2,g_setup where g_stats.w_name = '$pic_name' and g_stats.id = photo2.gid and g_setup.id = g_stats.id and g_setup.archive=0 and photo2.thumb NOT LIKE '%default%' order by photo2.main desc limit 0,1"); if($getImg->num_rows()>0){ while($getImg->moveNext()){ if(preg_match('/default/i',$getImg->getField("thumb"))){ $path="default"; } else { $path="thumbs"; } $image_path = '/photo/'.$path.'/'; $_data[]= array('gid' => $getImg->getField("id"), 'age' => getAge($getImg->getField("dob")), 'bust' => $getImg->getField("bust"), 'prof' => $getImg->getField("profile"), 'dress' => $getImg->getField("dress"), 'caption' => strtolower($getImg->getField("galCaption")), 'gthm' => $getImg->getField("thumb"), 'wname' => strtolower($pic_name), 'image_path' => $image_path, 'main_img_path' => '/photo/pics/', 'main_img' => str_replace('t_', 'a', $getImg->getField("thumb")), 'path' => $path, 'heading' => $getImg->getField("galHeading")); } } } } return $_data; } function working(){ $dbConn = new database(); $dbConn->query("select distinct g_stats.w_name from g_stats,g_setup,photo2 where g_setup.id = g_stats.id and g_stats.id = photo2.gid and g_setup.archive = 0 and photo2.thumb NOT LIKE '%default%' and g_setup.online = 1 order by RAND()"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $pic_name = $dbConn->getField("w_name"); $getImg = new database(); $getImg->query("SELECT g_stats.id, photo2.thumb, g_stats.galHeading, g_stats.dob, g_stats.bust,g_stats.profile, g_stats.dress, g_stats.galCaption FROM g_stats,photo2,g_setup where g_stats.w_name = '$pic_name' and g_stats.id = photo2.gid and g_setup.id = g_stats.id and g_setup.archive=0 and photo2.thumb NOT LIKE '%default%' order by photo2.main desc limit 0,1"); if($getImg->num_rows()>0){ while($getImg->moveNext()){ if(preg_match('/default/i',$getImg->getField("thumb"))){ $path="default"; } else { $path="thumbs"; } $image_path = '/photo/'.$path.'/'; $_data[]= array('gid' => $getImg->getField("id"), 'age' => getAge($getImg->getField("dob")), 'bust' => $getImg->getField("bust"), 'prof' => $getImg->getField("profile"), 'dress' => $getImg->getField("dress"), 'caption' => strtolower($getImg->getField("galCaption")), 'gthm' => $getImg->getField("thumb"), 'wname' => strtolower($pic_name), 'image_path' => $image_path, 'main_img_path' => '/photo/pics/', 'main_img' => str_replace('t_', 'a', $getImg->getField("thumb")), 'path' => $path, 'heading' => $getImg->getField("galHeading")); } } } } return $_data; } function get_latest_blog($siteid) { $dbConn = new database(); $dbConn->query("select title, news, post_date, url from sites_blog where site_id = '".$siteid."' order by post_date DESC limit 0,3"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $_data[] = array('title' => $dbConn->getField("title"), 'news' => str_replace("../", "/", $dbConn->getField("news")), 'post_date' => $dbConn->getField("post_date"), 'url' => $dbConn->getField("url"),); } } return $_data; } function get_blog($blg) { $blg=str_replace("/", "", $blg); $dbConn = new database(); $dbConn->query("select title, news, post_date from sites_blog where url = '".$blg."'"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $_data = array('title' => $dbConn->getField("title"), 'news' => str_replace("../", "/", $dbConn->getField("news")), 'post_date' => $dbConn->getField("post_date")); } } return $_data; } function get_towns($sitename){ global $sitename; $dbConn = new database(); $dbConn->query("select townName from town_content where sitename = '".$sitename."' order by townName"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $_town[] = array('town' => $dbConn->getField("townName")); } } return $_town; } function get_town_data($town){ global $sitename; $dbConn = new database(); $dbConn->query("select * from town_content where sitename = '".$sitename."' and townName = '".$town."'"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $_data = array('townname' => $dbConn->getField("townName"), 'content' => $dbConn->getField("content"), 'title' => $dbConn->getField("title"), 'keywords' => $dbConn->getField("keywords"), 'description' => $dbConn->getField("description"), ); } } return $_data; } function get_essex($sitename){ global $sitename; $dbConn = new database(); $dbConn->query("select * from town_content where sitename = '".$sitename."'"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $_data[] = array('townname' => $dbConn->getField("townName"), 'content' => $dbConn->getField("content"), 'title' => $dbConn->getField("title") ); } } return $_data; } function escort_data($escort){ $dbConn = new database(); $dbConn->query("select g_stats.id, g_stats.galCaption, g_setup.online from g_stats,g_setup where g_stats.w_name = '".$escort."' and g_setup.id = g_stats.id and g_setup.archive=0"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $gid = $dbConn->getField("id"); $caption = $dbConn->getField("galCaption"); $online = $dbConn->getField("online"); } } if($gid!=0){ $girlData = new database(); $girlData->query("select w_name,age_1,dob,hair,hair_type,eyes,height,dress,bust,nationality,couples,orientation,availability,profile from g_stats where id = '".$gid."'"); if($girlData->num_rows()>0){ while($girlData->moveNext()){ $_girl = array('gid' => $gid, 'caption' => strtolower($caption), 'online' => $online, 'work_name' => ucfirst(strtolower($girlData->getField("w_name"))), 'age' => getAge($girlData->getField("dob")), 'dob' => $girlData->getField("w_name"), 'hair_color' => $girlData->getField("hair"), 'hair_type' => $girlData->getField("hair_type"), 'eye_color' => $girlData->getField("eyes"), 'height' => $girlData->getField("height"), 'dress_size' => $girlData->getField("dress"), 'bust_size' => $girlData->getField("bust"), 'nationality' => ucfirst(strtolower($girlData->getField("nationality"))), 'couples' => $girlData->getField("couples"), 'orientation' => $girlData->getField("orientation"), 'availability' => $girlData->getField("availability"), 'prof' => $girlData->getField("profile")); } } return $_girl; } else { return "1"; } } function get_photos($gid){ $dbConn = new database(); $dbConn->query("select pid,pic,thumb,main from photo2 where gid = '".$gid."' order by main"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $path = 'pics'; $image_path = '/photo/'.$path.'/'; $_pix[] = array('id' => $dbConn->getField("pid"), 'main' => $dbConn->getField("pic"), 'image_path' => $image_path, 'thumb' => $dbConn->getField("thumb"), 'a' => $dbConn->getField("main")); } } krsort($_pix); return $_pix; } function get_reviews($gid){ mysql_connect('localhost','escort','k4r4ch1'); mysql_select_db('inpulse');; $_query = "select sql_calc_found_rows punter_name, punter_area, punter_comment, com_date from g_reviews where gid = '".$gid."' and live = 1 order by com_date DESC"; $_result = mysql_query($_query) or die (mysql_error()); while ($_row = mysql_fetch_array($_result, MYSQL_ASSOC)) { // collect each record into $_data $_data[] = array('p_name' => $_row["punter_name"], 'p_area' => $_row["punter_area"], 'p_comment' => $_row["punter_comment"], 'p_date' => $_row["com_date"]); } if(mysql_num_rows($_result)==0){ $_data=0; } return $_data; } function get_work($gid){ mysql_connect('localhost','escort','k4r4ch1'); mysql_select_db('inpulse'); $nsd = date("N")-1; $sdate = mktime(0, 0, 0, date("m") , date("d")-$nsd, date("Y")); $rd = date("Y-m-j",$sdate); $getDays = mysql_query("select mon_day, tue_day, wed_day, thu_day, fri_day, sat_day, sun_day from caller_rota where wid = '$gid' and work = 1 and rotaDate = '$rd'") or die (mysql_error()); $rowsDay = mysql_num_rows($getDays); $getNights = mysql_query("select mon_day, tue_day, wed_day, thu_day, fri_day, sat_day, sun_day from caller_rota where wid = '$gid' and work = 2 and rotaDate = '$rd'"); $rowsNights = mysql_num_rows($getNights); $showWrk = ($rowsDay + $rowsNights); list($mon,$tue,$wed,$thu,$fri,$sat,$sun)=mysql_fetch_row($getDays); list($nmon,$ntue,$nwed,$nthu,$nfri,$nsat,$nsun)=mysql_fetch_row($getNights); $_rota = array('days' => array('mon' => str_replace(NULL,' ',$mon), 'tue' => str_replace(NULL,' ',$tue), 'wed' => str_replace(NULL,' ',$wed), 'thu' => str_replace(NULL,' ',$thu), 'fri' => str_replace(NULL,' ',$fri), 'sat' => str_replace(NULL,' ',$sat), 'sun' => str_replace(NULL,' ',$sun)), 'nights' => array('mon' => str_replace(NULL,' ',$nmon), 'tue' => str_replace(NULL,' ',$ntue), 'wed' => str_replace(NULL,' ',$nwed), 'thu' => str_replace(NULL,' ',$nthu), 'fri' => str_replace(NULL,' ',$nfri), 'sat' => str_replace(NULL,' ',$nsat), 'sun' => str_replace(NULL,' ',$nsun))); return $_rota; } function get_blog_list($siteid){ $dbConn = new database(); $dbConn->query("select title, news, post_date, url from sites_blog where site_id = '".$siteid."' and MONTH(post_date) = ".date("n")." order by post_date DESC"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ preg_match('/.+)[\'"].*>/i', $dbConn->getField("news"), $image); $_data[] = array('title' => $dbConn->getField("title"), 'news' => str_replace("../", "/", $dbConn->getField("news")), 'post_date' => $dbConn->getField("post_date"), 'url' => $dbConn->getField("url"), 'image' => $image); } } else { $dbConn->query("select title, news, post_date, url from sites_blog where site_id = '".$siteid."' and MONTH(post_date) = '".date("n", mktime(0, 0, 0, date("n")-1, date("j"), date("y")))."' order by post_date DESC"); while($dbConn->moveNext()){ preg_match('/.+)[\'"].*>/i', $dbConn->getField("news"), $image); $_data[] = array('title' => $dbConn->getField("title"), 'news' => str_replace("../", "/", $dbConn->getField("news")), 'post_date' => $dbConn->getField("post_date"), 'url' => $dbConn->getField("url"), 'image' => $image); } } return $_data; } function get_archive($siteid){ $dbConn = new database(); $dbConn->query("select distinct YEAR(`post_date`) as year from sites_blog where site_id = '".$siteid."' order by `post_date` DESC"); if($dbConn->num_rows()>0){ while($dbConn->moveNext()){ $_year[] = array('year' => $dbConn->getField("year")); } } $get_months = new database(); $get_months->query("select distinct MONTH(`post_date`) as month, YEAR(`post_date`) as year from sites_blog where site_id = '".$siteid."' order by id DESC"); if($get_months->num_rows()>0){ while($get_months->moveNext()){ $mth = date("F",strtotime($get_months->getField("month")."-".$get_months->getField("month")."-1")); $_month[] = array('month' => strtolower($mth)); } } $dbConn2 = new database(); $dbConn2->query("select id, title, url, MONTH(`post_date`) as month, YEAR(`post_date`) as year from sites_blog where site_id = '".$siteid."' order by `post_date` DESC"); if($dbConn2->num_rows()>0){ while($dbConn2->moveNext()){ $_news[] = array('id' => $dbConn2->getField("id"), 'title' => $dbConn2->getField("title"), 'month' => $dbConn2->getField("month"), 'year' => $dbConn2->getField("year"), 'url' => $dbConn2->getField("url")); } } $_data = array('year' => $_year, 'month' => $_month, 'news' => $_news); return $_data; }