'; print ''; print '
'; print '  '; print 'SIA Member Firms Listing

'; print '  Company Names :
   [   '; for ($i=65; $i<91; $i++) // A-Z { $j = chr($i); print ''.chr($i).'  '; } $i = 48; //zero digit in ascii $j = chr($i); print '0-9  '; print ' ]   '; print '

'; print '
'; print '   '; print '    '; print '

'; print '   '; print ' Company Name / Previous Name'; print '             '; print ' Director\'s Name'; print '


'; footer(); print ''; } /*------------------------------------------------------------------------------------------ Function Name : mfirm_listing Accepts : $str_alpha Returns : none Description : Prints a whole list of firms starting with the alphabet passed to it. Eg. if A is passed in, prints a whole list of companys starting with A ------------------------------------------------------------------------------------------*/ function mfirm_listing($str_alpha) { print '
'; print '
'; print '  '; print 'SIA Member Firms Listing

'; print '
'; print '
Companies begining with : [ '.$str_alpha.' ]

'; $query = 'select num, name from sia_mfirm where name like "'.$str_alpha.'%" order by name'; if ($str_alpha == "0") { $query = 'select num, name from sia_mfirm where (name like "0%") or (name like "1%") or (name like "2%") or (name like "3%") or (name like "4%") or (name like "5%") or (name like "6%") or (name like "7%") or (name like "8%") or (name like "9%") order by name'; } //print $query; $i=0; $color_array = array('F5F9FF','FFFCF4'); $result = mysql_query($query); if (mysql_num_rows($result) != 0) { print '
'; print ''; while ($name_array = mysql_fetch_array($result)) { $num = $name_array[0]; $name = $name_array[1]; print ''; print ''; print ''; $i++; if ($i > 1) { $i=0; } } } else { //no records found print '
'.$name.'
'; print "
"; } print '

Sorry! No records found.

'; print "

"; print '
'; print '

'; footer(); } /*------------------------------------------------------------------------------------------ Function Name : mfirm_detail Accepts : $str_num Returns : none Description : Based on the firm number that is passed in, search db for records, pulls them out, and prints the details. ------------------------------------------------------------------------------------------*/ function mfirm_detail($str_num, $ip_add) { print '
'; print '
'; print '  '; print 'SIA Member Firms Listing

'; $menu = 0; $query = 'select * from sia_mfirm where num = "'.$str_num.'"'; $result = mysql_query($query); if (mysql_num_rows($result) != 0) { $detail_array = mysql_fetch_array($result); for ($i=0; $i<=20; $i++) { if ($detail_array[$i] == "") { $detail_array[$i] = " "; } } $num = $detail_array[0]; $name = $detail_array[1]; $prev_name= $detail_array[2]; $address = $detail_array[3]; $address2 = $detail_array[4]; $postal = $detail_array[5]; $tel_1 = $detail_array[6]; $tel_2 = $detail_array[7]; $fax_1 = $detail_array[8]; $fax_2 = $detail_array[9]; $email = $detail_array[10]; $website = $detail_array[11]; $remark = $detail_array[12]; $direct_1 = $detail_array[13]; $direct_2 = $detail_array[14]; $direct_3 = $detail_array[15]; $direct_4 = $detail_array[16]; $direct_5 = $detail_array[17]; $direct_6 = $detail_array[18]; $direct_7 = $detail_array[19]; $direct_8 = $detail_array[20]; print '
'; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; if ($website == " ") { print ''; } else { print ''; } print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
Company Name '.$name.'
Prev Name'.$prev_name.'
Address'.$address.'
 '.$address2.'
Postal'.$postal.'
Phone 1'.$tel_1.'
Phone 2'.$tel_2.'
Fax 1'.$fax_1.'
Fax 2'.$fax_2.'
Email'.$email.'
Website 
http://'.$website.'
Director 1'.$direct_1.'
Director 2'.$direct_2.'
Director 3'.$direct_3.'
Director 4'.$direct_4.'
Director 5'.$direct_5.'
Director 6'.$direct_6.'
Director 7'.$direct_7.'
Director 8'.$direct_8.'
'; } else { print "
"; } print "

"; print '
'; print '

'; footer(); print '
'; } /*------------------------------------------------------------------------------------------ Function Name : mfirm_search Accepts : $str_name , $search_choice Returns : none Description : Based on the string that is passed in, search the whole db for any company names that matches the string. Sorts the list, and prints ------------------------------------------------------------------------------------------*/ function mfirm_search($str_name, $search_choice) { print '

Sorry! No records found.

'; print '
'; print '  '; print 'SIA Member Firms Listing

'; print '
'; $menu =0; if ($search_choice == "com_name") //search for company name { print '
Companies with names containing : [ '.$str_name.' ]

'; $query = 'select num, name from sia_mfirm where name like "%'.$str_name.'%" or prev_name like "%'.$str_name.'%" order by name'; } else { // search for director names print '
Companies with Directors, whose names containing : [ '.$str_name.' ]

'; $query = 'select num, name from sia_mfirm where dir1 like "%'.$str_name.'%" or dir2 like "%'.$str_name.'%" or dir3 like "%'.$str_name.'%" or dir4 like "%'.$str_name.'%" or dir5 like "%'.$str_name.'%" or dir6 like "%'.$str_name.'%" or dir7 like "%'.$str_name.'%" or dir8 like "%'.$str_name.'%" order by name'; } $result = mysql_query($query); if (mysql_num_rows($result) != 0) { $i=0; $color_array = array('F5F9FF','FFFCF4'); print '
'; print ''; while ($name_array = mysql_fetch_array($result)) { $num = $name_array[0]; $name = $name_array[1]; print ''; print ''; print ''; $i++; //alternate colors if ($i > 1) { $i=0; } } } else { //no records found print '
   '.$name.'
'; print "
"; } print '

Sorry! No records found.

'; print "

"; print '
'; print '

'; footer(); print '

'; } /*------------------------------------------------------------------------------------------ Function Name : footer Accepts : none Returns : none Description : prints a copyright notice at the bottom. ------------------------------------------------------------------------------------------*/ function footer() { $yr_current = date("Y"); print '

'; print '
'; print 'Copyright © 2002 - '.$yr_current.',   Singapore Institute of Architects
'; print 'All rights reserved.   Legal Notice

'; print '79 Neil Road, Singapore 088904
  Tel: (+65) 6226-2668    Fax: (+65) 6226-2663

'; print 'Programmed by   Henry Wong'; print '
'; } ?>