Tax Information

“;
print ““;

$q=$_GET[“q”];

$username = “root”;
$password = “idkfa”;
$hostname = “localhost”;

//connection to the database
$dbhandle = mysql_connect($hostname, $username,$password)
or die(“Unable to connect to MySQL”);
//echo “Connected to MySQL
“;

//select a database to work with
$selected = mysql_select_db(“url_database”,$dbhandle)
or die(“Could not select bookmarks”);

//execute the SQL query and return records
$result = mysql_query(“SELECT distinct subject2 from url_database where subject1 = ‘$q’ order by subject2;”);

$i = “0”;

print “

“;

while($row = mysql_fetch_assoc($result))
{

$a=array(“”.$row{“subject2″}.””);

foreach ($a as $b) {

$i++;

if( $i%2)
{
print “

“;
}
else
{
echo “

“;
}
}

$array[] = $row;

}

print “

$b $b

“;

array2table($array,700);

function array2table($arr,$width)
{

$count2 = “0”;
$count = count($arr);
if($count > 0){
reset($arr);
$num = count(current($arr));
echo “

“;
echo “
\n”;
foreach(current($arr) as $key => $value){
//echo “

\n”;
}
echo “

\n”;
while ($curr_row = current($arr)) {
echo “

\n”;
$col = 1;
while (false !== ($curr_field = current($curr_row))) {
//echo “

\n”;
next($curr_row);
$col++;
}
while($col <= $num){ echo "

\n”;
$col++;
}
echo “

\n”;
next($arr);
}

echo “

“;
//echo “ke”. “$key”.” “;
//echo “
“;

$count2++;

echo “

“;
$result2 = mysql_query(“SELECT distinct name,url,description,notes,subject1,subject2 from url_database where subject1 = ‘Tax Information’ and subject2 = ‘$curr_field’ order by name;”);

//fetch tha data from the database

while ($row2 = mysql_fetch_array($result2)) {

$name = “”.$row2{‘name’}.””;

$name = preg_replace(‘/[\x00-\x1F\x80-\xFF]/’, ”, $name);

$subject1 = “”.$row2{‘subject1’}.””;
$subject2 = “”.$row2{‘subject2’}.””;
$notes = “”.$row2{‘notes’}.””;

$url = “”.$row2{‘url’}.””;

if (preg_match(‘/https/’,$url))
{
$toggle = “1”;
//print “https”;
}
else
{
$toggle = “0”;
}

$url2 = explode(“//”,$url);

//print “here $url2[1]”;

print “

$name“;

$description = “”.$row2{‘description’}.””;
$description = preg_replace(‘/[\x00-\x1F\xFF]/’, ”, $description);

if (empty($description))
{
print “

“;
}
else
{

print ”  [ View Description ]$description

“;
}
}
echo “

 

\n”;
}
}

mysql_close($con);

//print “

“;
//get_footer();
// print “

“;
?>

ELKHART PUBLIC LIBRARY
300 SOUTH SECOND STREET
ELKHART, IN 46516
(574) 522-5669
ADDITIONAL RESOURCES
ADMINISTRATION
EPL/GPL CONSORTIUM
FINANCIAL REPORT
FRIENDS OF EPL
GIFT PROGRAM
LIBRARY CARDS
LIBRARY FEES & POLICIES
STRATEGIC PLAN