leela Posted June 26, 2007 Share Posted June 26, 2007 // for hair if(count($_POST['hair_arr'])>0) { if($_POST['hair_arr'][0]!="any") { for($i=0;$i<count($_POST['hair_arr']);$i++) { if($qry_hair == "") $qry_hair .= " '".$_POST['hair_arr'][$i]."' "; else $qry_hair .= ", '".$_POST['hair_arr'][$i]."' "; } } else if($_POST['hair_arr'][0]=="any") { $sel_hair="select hair_color from master_fields where hair_color != ''"; $rs_hair=$db->select_data($sel_hair); $qry_hair = ""; for($i=0;$i<count($rs_hair);$i++) { if($qry_hair == "") $qry_hair .= " '".$rs_hair[$i][hair_color]."' "; else $qry_hair .= ", '".$rs_hair[$i][hair_color]."' "; } } if($qry_hair!="") $query12.= " AND u.hair in ($qry_hair) "; } //end hair //for Ethinicity if(count($_POST['ethinicity_arr'])>0) { if($_POST['ethinicity_arr'][0]!="any") { for($i=0;$i<count($_POST['ethinicity_arr']);$i++) { if($qry_ethinicity == "") $qry_ethinicity .= " '".$_POST['ethinicity_arr'][$i]."' "; else $qry_ethinicity .= ", '".$_POST['ethinicity_arr'][$i]."' "; } } else if($_POST['ethinicity_arr'][0]=="any") { $sel_ethinicity="select ethinicity from master_fields where ethinicity != ''"; $rs_ethinicity=$db->select_data($sel_ethinicity); $qry_ethinicity = ""; for($i=0;$i<count($rs_ethinicity);$i++) { if($qry_ethinicity == "") $qry_ethinicity .= " '".$rs_ethinicity[$i][ethinicity]."' "; else $qry_ethinicity .= ", '".$rs_ethinicity[$i][ethinicity]."' "; } } if($qry_ethinicity!="") $query12.= " AND u.ethinicity in ($qry_ethinicity) "; } //end ethinicity if($_POST['gender']!='') { $sel_gender="select id,gender from master_fields where gender != '' and id = $_POST[gender]"; $rs_gender=$db->select_data($sel_gender); $query12.=" and u.gender = '".$rs_gender[0][1]."'"; } // for occupation if($_POST['occupation']!='') { $sel_occupation="select id,occupation from master_fields where occupation != '' and id = $_POST[occupation]"; $rs_occupation=$db->select_data($sel_occupation); $query12.=" and u.occupation = '".$rs_occupation[0][1]."'"; } // for viewby if($_POST['city']!='') { $query12.=" and u.city='".$_POST['city']."' "; } else { $query12.=" and u.city='".$_SESSION[c]."' "; } if($_POST[txt_memname1] !="") { $search_str=$_POST[txt_memname1] ; $query12.=" and ( u.date_of_birth like '%$search_str%' or u.gender like '%$search_str%' or u.height like '%$search_str%' or u.kids like '%$search_str%' or u.state like '%$search_str%' or u.city like '%$search_str%' or u.eye like '%$search_str%' or u.hair like '%$search_str%' or u.body like '%$search_str%' or u.ethinicity like '%$search_str%' or u.education like '%$search_str%' or u.occupation like '%$search_str%' or u.annual_income like '%$search_str%' or u.reg_time like '%$search_str%' or u.login_time like '%$search_str%' or u.logout_time like '%$search_str%' or u.pt like '%$search_str%' or u.activation_flag='1' AND u.pro_visibility_flag='1' ) "; } } // for search ends if($acts=="online") { $query12.=" and login_flag=1"; } if($gender=="Male") { $sex2="selected"; } elseif($gender=="Female") { $sex3="selected"; } else { $sex1="selected"; } $view="login_time"; if(isset($_POST['view'])) { $view=$_POST['view']; } elseif(isset($_GET['view'])) { $view=$_GET['view']; } $tpl->adddata("#(view)#",$view); if($view=="login_time") { $view1="Selected"; } elseif($view=="id") { $view2="Selected"; } else { $view3="Selected"; } $tpl->adddata("#(view1)#",$view1); $tpl->adddata("#(view2)#",$view2); $tpl->adddata("#(view3)#",$view3); $tpl->adddata("#(sex1)#",$sex1); $tpl->adddata("#(sex2)#",$sex2); $tpl->adddata("#(sex3)#",$sex3); if(isset($_SESSION['query1112']) && $acts=="searched" && (!isset($_POST['searching']) && !isset($_POST['searching2']))) { $query12=$_SESSION['query1112']; } if($acts=="searched") { $_SESSION['query1112']=$query12; } $result12=mysql_query($query12) or die("QUERY12 ".mysql_error()); $num11=mysql_num_rows($result12); Link to comment https://forums.phpfreaks.com/topic/47406-posting-comments/page/2/#findComment-282733 Share on other sites More sharing options...
leela Posted June 26, 2007 Share Posted June 26, 2007 if((isset($_POST['distance']) && $_POST['distance']!=-1) || (isset($_GET['distance']) && $_GET['distance']!='' && $_GET['distance']!=-1)) { //calculating distance $sql_measure ="select latitude,longitude from mwm_mas_city c,user u where c.zip=u.zipcode and u.userid=$_SESSION[s_userid]"; $res_measure = mysql_query($sql_measure) or die(mysql_error()); $fetch_measure = mysql_fetch_assoc($res_measure); $lat2=$fetch_measure['latitude']; $lon2=$fetch_measure['longitude']; if($_POST['distance']!='') $distance = $_POST['distance']; else $distance = $_GET['distance']; $ids = ''; $miles=array(); $array_result=array(); for($i=0;$i<$num11;$i++) { $res = mysql_fetch_array($result12,MYSQL_ASSOC); $mile = $ob->calculate_mileage($res['latitude'], $lat2, $res['longitude'],$lon2); if($mile< $_POST['distance'] ||$mile< $_GET['distance'] ) { array_push($miles,$mile); if($res['userid']!='') { if($ids=='') $ids=$res['userid']; else $ids.=','.$res['userid']; } } } $a=count($array_result); if($ids =='') $ids =0; if($acts == "latest" ) { if(($_POST['showphoto'] != '' && isset($_POST['showphoto'])) || (isset($_GET['showphoto']) && $_GET['showphoto']==1)) { $query12="SELECT u.*,pThum as photo_path, c.latitude, c.longitude FROM user u LEFT JOIN userphoto p ON u.userid = p.userid and p.pMain='1' LEFT JOIN mwm_mas_city c ON u.zipcode = c.zip WHERE u.activation_flag = '1' AND u.pro_visibility_flag = '1' "; } else { $query12="SELECT u.*,pThum as photo_path, c.latitude, c.longitude FROM user u LEFT JOIN userphoto p ON u.userid = p.userid and p.pMain='1' LEFT JOIN mwm_mas_city c ON u.zipcode = c.zip WHERE u.activation_flag = '1' AND u.pro_visibility_flag = '1' "; } } else if($acts=="fav") { $query12="SELECT u.*,p.pThum as photo_path FROM user u LEFT JOIN favorite_members f ON u.userid=f.fav_userid LEFT JOIN userphoto p ON u.userid = p.userid and p.pMain=1 WHERE f.userid=$sessid AND u.pro_visibility_flag='1' "; } else if($acts=="searched" && isset($_POST['showphoto'])) { $query12="SELECT u.*,p.pThum as photo_path,c.latitude,c.longitude FROM user u,userphoto p,mwm_mas_city c WHERE u.userid = p.userid and p.pMain=1 and u.zipcode=c.zip and u.activation_flag='1' AND u.pro_visibility_flag='1' "; } else if($acts=="online") { if(!isset($_POST['sort'])) $query12.=" and login_flag=1"; else $query12.=" and login_flag=1 and u.userid in ($ids) "; } else { $query12="SELECT u.* FROM user u LEFT JOIN favorite_members f ON(u.userid=f.fav_userid) WHERE f.userid=$sessid AND u.pro_visibility_flag='1' "; } $query12 .=" and u.userid in ($ids) "; } else { $sql_measure ="select latitude,longitude from mwm_mas_city c,user u where c.zip=u.zipcode and u.userid=$_SESSION[s_userid]"; $res_measure = mysql_query($sql_measure) or die(mysql_error()); $fetch_measure = mysql_fetch_assoc($res_measure); $lat2=$fetch_measure['latitude']; $lon2=$fetch_measure['longitude']; if($_POST['distance']!='') $distance = $_POST['distance']; else $distance = $_GET['distance']; $ids = ''; $miles=array(); $array_result=array(); for($i=0;$i<$num11;$i++) { $res = mysql_fetch_array($result12,MYSQL_ASSOC); $mile = $ob->calculate_mileage($res['latitude'], $lat2, $res['longitude'],$lon2); array_push($miles,$mile); array_push($array_result,$res); if($res['userid']!='') { if($ids=='') $ids=$res['userid']; else $ids.=','.$res['userid']; } } if($ids=="") $ids = 0; if($acts == "latest") { $query12="SELECT u.*,pThum as photo_path, c.latitude, c.longitude FROM user u LEFT JOIN userphoto p ON u.userid = p.userid and p.pMain='1' LEFT JOIN mwm_mas_city c ON u.zipcode = c.zip WHERE u.activation_flag = '1' AND u.pro_visibility_flag = '1' "; } else if($acts=="fav") { $query12="SELECT u.*,p.pThum as photo_path FROM user u LEFT JOIN favorite_members f ON u.userid=f.fav_userid LEFT JOIN userphoto p ON u.userid = p.userid and p.pMain=1 WHERE f.userid=$sessid AND u.pro_visibility_flag='1' "; } else if($acts=="searched" && isset($_POST['showphoto']) ) { $query12="SELECT u.*,p.pThum as photo_path,c.latitude,c.longitude FROM user u,userphoto p,mwm_mas_city c WHERE u.userid = p.userid and p.pMain=1 and u.zipcode=c.zip and u.pro_visibility_flag='1' AND u.activation_flag='1' "; } else if($acts=="online") { if(!isset($_POST['sort'])) $query12.=" and login_flag=1"; else $query12.=" and login_flag=1 and u.userid in ($ids) "; } else { $query12="SELECT u.* FROM user u LEFT JOIN favorite_members f ON(u.userid=f.fav_userid) WHERE f.userid=$sessid AND u.pro_visibility_flag='1' "; } $query12 .=" and u.userid in ($ids) "; } // if ( 5,50,100.miles )-----else (all) distance ends here if( ($acts=="fav" || $acts=="latest" || $acts=="online" || $acts=="search" || $acts=="searched") && (isset($_REQUEST['sort']) || isset($_REQUEST['searching']) || isset($_REQUEST['viewby'])) ) { if(isset($_REQUEST['viewby'])) { $viewby_arr = $_REQUEST['viewby']; if($viewby_arr == "order" && $acts=="latest") { $query12.=" ORDER BY u.id DESC "; $view11 ="selected"; $tpl->adddata("#(view11)#",$view11); } if($viewby_arr == "date") { $query12.=" order by u.reg_time" ; $view21 ="selected"; $tpl->adddata("#(view21)#",$view21); } else if($viewby_arr == "new") { $view4 ="selected"; $tpl->adddata("#(view4)#",$view4); $query12.=" ORDER BY u.id DESC "; } else if($viewby_arr=="age") { $view31 ="selected"; $tpl->adddata("#(view31)#",$view31); $query12.=" ORDER BY u.date_of_birth DESC"; } else if($viewby_arr=="distance") { // $query12." ORDER BY u.distance DESC LIMIT $offset, $limit"; $view5 ="selected"; $tpl->adddata("#(view5)#",$view5); } $viewby= $viewby_arr; if($viewby_arr=="order") { $view1 ="selected"; $tpl->adddata("#(view1)#",$view1); } if($viewby_arr=="date") { $view2 ="selected"; $tpl->adddata("#(view2)#",$view2); } if($viewby_arr=="age") { $view3 ="selected"; $tpl->adddata("#(view3)#",$view3); } if($viewby_arr=="new") { $view4 ="selected"; $tpl->adddata("#(view4)#",$view4); } if($viewby_arr=="distance") { $view5 ="selected"; $tpl->adddata("#(view5)#",$view5); } // $tpl->adddata("#($viewby_arr)#",$viewby_arr); } } else if($acts=='latest') { $query12.=" ORDER BY u.id DESC "; } if(isset($_POST['sort'])) { $tpl->adddata("#(sort_disp)#","block"); } else { $tpl->adddata("#(sort_disp)#","none"); } $result12=mysql_query($query12) or die("QUERY12 ".mysql_error()); $num12=mysql_num_rows($result12); $loop=0; $page=1; $limit = 10; if(isset($_GET )) $page = $_GET['page']; $total = $num12; $pager = Pager::getPagerData($total, $limit, $page); $offset = $pager->offset; $limit = $pager->limit; $page = $pager->page; ob_start(); //START NAVIGATION CODE $PageURL = "profile.php?"; $PageURL.="view=".$view; if($_POST['distance']!='') { $distance = $_POST['distance']; $PageURL.="&distance=".$distance; } else if($_GET['distance']!='') { $distance = $_GET['distance']; $PageURL.="&distance=".$distance; } if($viewby !='') $PageURL.="&viewby=".$viewby; $PageURL.="&showphoto=".$pho; if(isset($_POST['gender']) && ($_POST['gender']=="Male" || $_POST['gender']=="Female")) { $PageURL.="&gender=".$_POST['gender']; } elseif(isset($_GET['gender']) && ($_GET['gender']=="Male" || $_GET['gender']=="Female")) { $PageURL.="&gender=".$_GET['gender']; } Pager::getPageingLine_pagenum($PageURL,$page,$pager->numPages,$pager->limit); $navigation=ob_get_contents(); ob_end_clean(); $tpl->adddata("#(paging)#",$navigation); $tpl->adddata("#(acts)#",$acts); $tpl->adddata("#(viewby_arr)#",$viewby); if($page>1) { $page1=$page-1; $jaco="profile.php?action=".$acts; if($view!='') $jaco.="&view=".$view; if($viewby!='') $jaco.="&viewby=".$viewby; if($distance!='') $jaco.="&distance=".$distance; $jaco.="&showphoto=".$pho."&page=".$page1; if(isset($gender)) { $jaco.="&gender=".$gender; } }// if else $jaco="#"; $tpl->adddata("#(jaco)#",$jaco); if($num12>$limit && $page<(ceil($num12/$limit))) { $page1=$page+1; $jaco2="profile.php?action=".$acts; if($view!='') $jaco2.="&view=".$view; if($viewby!='') $jaco2.="&viewby=".$viewby; if($distance!='') $jaco2.="&distance=".$distance; $jaco2.="&showphoto=".$pho."&page=".$page1; if(isset($gender)) { $jaco2.="&gender=".$gender; } } else $jaco2="#"; $tpl->adddata("#(jaco2)#",$jaco2); $jaco3="page "; $t_page=ceil($num12/$limit); //echo $t_page; for($ii=1; $ii<=$t_page; $ii++) { if($ii==$page) { $jaco3.="<font class=\"red_bold\">$ii</font>"; } else { $jaco3.="<a href=\"profile.php?action=".$acts; if($view!='') $jaco3.="&view=".$view; if($viewby!='') $jaco3.="&viewby=".$viewby; if($distance!='') $jaco3.="&distance=".$distance; $jaco3.="&showphoto=".$pho."&page=".$ii; if(isset($gender)) { $jaco3.="&gender=".$gender; } $jaco3.="\">".$ii."</a>"; }// else $jaco3.=" "; }// for $jaco3.=">>"; $tpl->adddata("#(jaco3)#",$jaco3); $tpl->adddata("#(page)#",$page); Link to comment https://forums.phpfreaks.com/topic/47406-posting-comments/page/2/#findComment-282734 Share on other sites More sharing options...
leela Posted December 16, 2008 Share Posted December 16, 2008 Hai All, I am unable to find the solution.. Can anyone please help me My Requirement is :: My url is www.chekhra.com After logging in ..it is showing like Chekhra/modules/user/index.php?ch=viewUserAdmin Here ?ch=viewUserAdmin is the keyword where the page is redirected to that page where the code for this key will be in index.php What i need is .... My Url should show """"Chekhra/modules/user/index.php"" and onclick of menu..it shud not show any thing like Chekhra/modules/user/index.php?ch=viewUserAdmin ....means is there any Algorithm to show only index.php page and can redirect to whatever page we want... Please help me out.. THanks,Leela Link to comment https://forums.phpfreaks.com/topic/47406-posting-comments/page/2/#findComment-716455 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.