') ; exit(); }}else{ if (strlen(trim($key))<3) { print('') ; exit(); } } $str0="SELECT TELNO,concat_ws(',',name,door_no,build_nm,street_nm,cross_no,main_no,stage,phase,block,locality,concat('','560 ',pin)) from "; if ($loc_select < 100) { $str1='cdq_ind where pin='."'".$loc_select."'".' and '; } elseif($loc_select > 100 && $loc_select < 600000) { $str1='cdq_rural where pin='."'".$loc_select."'".' and '; } elseif ($loc_select == 100) { $str1='cdq_ind where '; } else { $str1='cdq_rural where '; } switch ($R1){ case 'N': switch ($match){ case 'S': $str2='NAME like '."'".$key."%'"; break; case 'E'; $str2='NAME like '."'%".$key."'"; break; case 'A'; $str2='NAME like '."'%".$key."%'"; break; case 'X'; $str2='NAME='."'".$key."'"; break; } break; case 'A': switch($match){ case 'S': $str2='DOOR_NO like '."'".$key.'%'."'"; break; case 'E'; $str2='PIN like '."'%".$key."'"; break; case 'A'; $str2='DOOR_NO like '."'%".$key."%'".' or STREET_NM like '."'%".$key."%'".' or LOCALITY like '."'%".$key."%'".' or PIN like '."'%".$key."%'"; break; case 'X'; $str2='DOOR_NO+STREET_NM+LOCALITY+PIN='."'".$key."'"; break; } break; case 'T': switch($match){ case 'S': $str2='TELNO like '."'".$key.'%'."'"; break; case 'E'; $str2='TELNO like '."'%".$key."'"; break; case 'A'; $str2='TELNO like '."'%".$key.'%'."'"; break; case 'X'; $str2='TELNO='."'".$key."'"; break; } break; } $str3=' order by NAME'; $myquery=$str0.$str1.$str2.$str3; print('
'); $link = mysql_connect('localhost', 'directory','enquiry999') or die('Server error. Please try later');; mysql_select_db('bgtd') or die('Could not Connect to database. Please try later'); $result=mysql_query($myquery) or die ('Could not perform query. Please try later'); $rowsreturned=mysql_affected_rows($link); ?>
'); print(''); }else{ print(''); } ?> '); print('

 

'); print('

 

'); print('
Sorry !
'); print('
'); print('
'); print('
'); print('
No Matching Records Found !
'); print ('

 

'); print(''); print('

Try Again

'); print('

 

'); exit(); } ?>

Karnataka Telecom Circle

Directory Enquiry Search Results for : ');print(strtoupper($district));print('');?>

'); print('Matching Records Found : '); print($rowsreturned); print('
'); $alternate=!$alternate; foreach ($line as $col_value) { if ($alternate){ print '\n"; } print "\n"; } print "
Phone No Name and Address
'; }else{ print ''; } print(''); print (' '); print(trim($col_value)); print(''); print"
\n"; mysql_free_result($result); mysql_close($link); ?>