include "header.php"; ?>
Участникиinclude "inc.php"; $let=$_GET['l']; $m_id=@$_GET['mid']+0; $all=$_GET['all']; if(isset($_GET['c']))$cit=$_GET['c']; if (isset($all)){ /* $sql="SELECT doklad.doklad_cenzored, doklad.doklad_id, depend .* , member.* FROM doklad, depend, member WHERE doklad.doklad_cenzored='1' AND depend.depend_doklad_id = doklad.doklad_id AND member.member_id = depend.depend_member_id ORDER BY member.member_last_name,member.member_first_name, member.member_middle_name"; */ $sql="SELECT distinct(member.member_id),member.* FROM doklad, depend, member WHERE doklad.doklad_cenzored='1' AND depend.depend_doklad_id = doklad.doklad_id AND member.member_id = depend.depend_member_id ORDER BY member.member_last_name,member.member_first_name, member.member_middle_name"; $result=mysql_query($sql) or Die(mysql_error()); for ($i=0;$i"; } } if (isset($let)){ $let+=0; $chr=chr($let); /*$sql="SELECT doklad.doklad_cenzored, doklad.doklad_id, depend .* , member.* FROM doklad, depend, member WHERE doklad.doklad_cenzored='1' AND depend.depend_doklad_id = doklad.doklad_id AND member.member_id = depend.depend_member_id AND LEFT(member.member_last_name,1)='$chr' ORDER BY member.member_last_name,member.member_first_name, member.member_middle_name"; */ $sql="SELECT distinct(member.member_id),member.* FROM doklad, depend, member WHERE doklad.doklad_cenzored='1' AND depend.depend_doklad_id = doklad.doklad_id AND member.member_id = depend.depend_member_id AND LEFT(member.member_last_name,1)='$chr' ORDER BY member.member_last_name,member.member_first_name, member.member_middle_name"; $result=mysql_query($sql) or Die(mysql_error()); for ($i=0;$i "; } }else if ($m_id){ $sql="select * from member where member_id='$m_id'"; $result=mysql_query($sql) or Die(mysql_error()); if (mysql_num_rows($result)==1){ $record=mysql_fetch_row($result); print ""; print "".$record[5]." ".$record[6]." ".$record[7]." "; print $record[2]." "; print $record[3]." "; print $record[8]; $sql="select depend_doklad_id from depend where depend_member_id='$m_id'"; //Die($sql); $result=mysql_query($sql); $count=mysql_num_rows($result); if ($count>0){ print " Доклады: "; for ($i=0;$i<$count;$i++){ $record=mysql_fetch_row($result); $sql="select doklad_title from doklad where doklad_id=".$record[0]." AND doklad_cenzored=1"; $temp=mysql_query($sql) or Die(mysql_error()); if (mysql_num_rows($temp)==0)continue; $temp=mysql_fetch_row($temp); print "$temp[0] "; } } print ""; } }else if (isset($cit)){ if (!get_magic_quotes_gpc())$cit = addslashes($cit); /*$sql="SELECT doklad.*, depend .* , member.* FROM doklad, depend, member WHERE doklad.doklad_cenzored='1' AND depend.depend_doklad_id = doklad.doklad_id AND member.member_id = depend.depend_member_id AND member.member_city='$cit' ORDER BY member.member_last_name,member.member_first_name, member.member_middle_name";*/ //Die($sql); $sql="SELECT distinct(member.member_id),member.* FROM doklad, depend, member WHERE doklad.doklad_cenzored='1' AND depend.depend_doklad_id = doklad.doklad_id AND member.member_id = depend.depend_member_id AND member.member_city='$cit' ORDER BY member.member_last_name,member.member_first_name, member.member_middle_name"; $result=mysql_query($sql) or Die(mysql_error()); if (mysql_num_rows($result)>0)print "".$cit." "; for ($i=0;$i "; } } print" "; if (!isset($all))print"Весь список" ?> По фамилиям: $a=ord('А'); $z=ord('Я'); for ($i=$a;$i<=$z;$i++){ $chr=chr($i); $sql="SELECT doklad.doklad_cenzored, doklad.doklad_id, depend .* , member.member_last_name, member.member_id FROM doklad, depend, member WHERE doklad.doklad_cenzored='1' AND depend.depend_doklad_id = doklad.doklad_id AND member.member_id = depend.depend_member_id AND LEFT(member.member_last_name,1)='$chr'"; $result=mysql_query($sql) or Die (mysql_error()); if (mysql_num_rows($result)>0)print "$chr "; } ?> По городам: $sql="SELECT doklad.doklad_cenzored, doklad.doklad_id, depend .* , member.member_city, member.member_id FROM doklad, depend, member WHERE doklad.doklad_cenzored='1' AND depend.depend_doklad_id = doklad.doklad_id AND member.member_id = depend.depend_member_id GROUP BY member.member_city ORDER BY member.member_city"; $result=mysql_query($sql) or Die (mysql_error()); for ($i=0;$i "; }; ?> |