|
|
|
|
|
if($_REQUEST['gender']) {
$qry = "SELECT * FROM (SELECT my_school.seq_num as seq_num,my_school.year_f as year_f,my_school.year_t as year_t,school.s_no as s_no,school.name as school_name,school.org as school_org,school.country_no as country_no,school.state_no as state_no,school.city_no as city_no,school.town_no as town_no FROM my_school LEFT OUTER JOIN school USING(s_no)) as my_school LEFT OUTER JOIN member USING(seq_num) WHERE member.gender=\"$_REQUEST['gender']\"";
if($_REQUEST[town]) {
$qry .= " AND my_school.town_no=\"$_REQUEST[town]\"";
} else if($_REQUEST[city]) {
$qry .= " AND my_school.city_no=\"$_REQUEST[city]\"";
} else if($_REQUEST[state]) {
$qry .= " AND my_school.state_no=\"$_REQUEST[state]\"";
} else if($_REQUEST[country]) {
$qry .= " AND my_school.country_no=\"$_REQUEST[country]\"";
}
if($_REQUEST[org]) {
$qry .= " AND my_school.school_org=\"$_REQUEST[org]\"";
}
if($_REQUEST[year_f] && $_REQUEST[year_t]) {
$qry .= " AND ((my_school.year_f >= $_REQUEST[year_f] OR my_school.year_t >= $_REQUEST[year_f]) AND (my_school.year_f <= $_REQUEST[year_t] OR my_school.year_t <= $_REQUEST[year_t]))";
} else if($_REQUEST[year_f]) {
$qry .= " AND (my_school.year_f >= $_REQUEST[year_f] OR my_school.year_t >= $_REQUEST[year_f])";
} else if($_REQUEST[year_t]) {
$qry .= " AND (my_school.year_f <= $_REQUEST[year_t] OR my_school.year_t <= $_REQUEST[year_t])";
}
if($_REQUEST[age_f] && $_REQUEST[age_t]) {
$from = date("Y") - $_REQUEST[age_f];
$from_date = $from."1231";
$to = date("Y") - $_REQUEST[age_t];
$to_date = $to."0101";
$qry .= " AND (member.dob BETWEEN $to_date AND $from_date)";
} else if($_REQUEST[age_f]) {
$from = (date("Y") - $_REQUEST[age_f]) + 1;
$from_date = $from."0101";
$qry .= " AND (member.dob < $from_date)";
} else if($_REQUEST[age_t]) {
$to = date("Y") - $_REQUEST[age_t];
$to_date = $to."0101";
$qry .= " AND (member.dob >= $to_date)";
}
if($_REQUEST[user_name]) {
$formatted_name = strtoupper($_REQUEST[user_name]);
$name_array = explode(" ",$formatted_name);
$qry .= " AND ( ";
for($na=0;$na= $total)
$limit=$total;
$scale1 = $limit - $cline;
$qry = $qry." LIMIT $cline,$scale1;";
$result = mysqli_query($connect, $qry,$connect);
?>
}
?>
|
|
|
|
|
|