num_rows==0) return 'unknown'; // mysqli seek to the row of the given dataset $result->data_seek($row); // mysqli assign the rows data to an array $row_result=$result->fetch_assoc(); // assign field of the row to the return variable $field_result=$row_result[$field]; // done, return result return $field_result; } // End Function Definitions //====================================================== //====================================================== // Host Determination Section // test for the existance of a small text file to determine whether // or not your on the local machine (where the file IS), or on the // remote site (where the file IS NOT). This test chooses the correct // database login info file. $info_test_file ="../../../php/info_test.txt" ; // set indiicator for whether we are on local or remote machine $in_local_dir = 0 ; if (file_exists($info_test_file)) { include("../../../php/dbinfo_dbf.inc.php"); $in_local_dir = 1 ; //echo "File test does exist" ; //echo "

" ; } else { include("../../../php/dbinfo_addr.inc.php"); $in_local_dir = 0 ; //echo "File test does NOT exist" ; } ; // End Host Determination Section //============================================= //============================================= // Database MySqli Connection Section // this database connection needs to be copied $db_eatc7402 = new mysqli($DBHost, $DBUser, $DBPass); if($db_eatc7402->connect_errno > 0){ die(' Unable to connect to MYSQLI database [' . $db_eatc7402->connect_error . ']

'); } else { if ($DEBUG3 == "on") echo "Connected to MYSQLI server successfully

" ; } // end if connect error /* change db to eatc7402 db */ if($db_eatc7402->select_db($DBName) > 0){ if ($DEBUG3 == "on") echo " Connected to MYSQLI database name successfully

" ; } else { die(' Unable to connect to MYSQLI database name [' . $db_eatc7402->connect_error . ']

'); } // end if debug // End Database Connection Section //=========================================================== //=========================================================== // Run Query Section // // NOTE; DO NOT TEST FOR 'True' or 'False' flagd, use 0 or 1 // true or false wil work on local server but will FAIL // when used on the ADDR unix machine!!! USE 1 or 0 // determine the directory we are operating in to // determine the query to run and many other location // sopecific variables in the code // get the current directory $working_dir = getcwd() ; //echo $working_dir ; //echo "
" ; // set var to null to initiate $directory_in_use = "" ; // determine which dir are in and set $directory_in_use to indicate if ($in_local_dir) { if ($pos = strripos($working_dir, 'station_templates')) { //echo "We found the last ('station_templates') in ($working_dir) at position ($pos)"; //echo "
" ; $directory_in_use = "station_templates" ; } if ($pos = strripos($working_dir, 'st_paul\active')) { //echo "We found the last ('st_paul\active') in ($working_dir) at position ($pos)"; //echo "
" ; $directory_in_use = "st_paul_active" ; } if ($pos = strripos($working_dir, 'st_paul\former')) { //echo "We found the last ('st_paul\former') in ($working_dir) at position ($pos)"; //echo "
" ; $directory_in_use = "st_paul_former" ; } if ($pos = strripos($working_dir, 'minneapolis\active')) { // echo "We found the last ('minneapolis\active') in ($working_dir) at position ($pos)"; //echo "
" ; $directory_in_use = "minneapolis_active" ; } if ($pos = strripos($working_dir, 'minneapolis\former')) { //echo "We found the last ('minneapolis\former') in ($working_dir) at position ($pos)"; //echo "
" ; $directory_in_use = "minneapolis_former" ; } } else { if ($pos = strripos($working_dir, 'station_templates')) { //echo "We found the last ('station_templates') in ($working_dir) at position ($pos)"; //echo "
" ; $directory_in_use = "station_templates" ; } if ($pos = strripos($working_dir, 'St_Paul/active')) { //echo "We found the last ('St_paul/active') in ($working_dir) at position ($pos)"; //echo "
" ; $directory_in_use = "st_paul_active" ; } if ($pos = strripos($working_dir, 'St_paul/former')) { //echo "We found the last ('St_paul/former') in ($working_dir) at position ($pos)"; //echo "
" ; $directory_in_use = "st_paul_former" ; } if ($pos = strripos($working_dir, 'Minneapolis/active')) { // echo "We found the last ('Minneapolis/active') in ($working_dir) at position ($pos)"; //echo "
" ; $directory_in_use = "minneapolis_active" ; } if ($pos = strripos($working_dir, 'Minneapolis/former')) { // echo "We found the last ('Minneapolis/former') in ($working_dir) at position ($pos)"; // echo "
" ; $directory_in_use = "minneapolis_former" ; } } // for debug //echo "Directory in use is $directory_in_use " ; //echo "

" ; // for debug //$directory_in_use = "station_templates" ; //$directory_in_use = "st_paul_former" ; //$directory_in_use = "st_paul_active" ; //$directory_in_use = "minneapolis_active" ; //$directory_in_use = "minneapolis_former" ; //============================================ switch ($directory_in_use) { case "station_templates" : $query= "SELECT * FROM stp_stations_w_app_addr stp_stations_w_app_addr WHERE (stp_stations_w_app_addr.LinkValue LIKE '%04_c') ORDER BY stp_stations_w_app_addr.`City Name` ASC, stp_stations_w_app_addr.Status_Station ASC, stp_stations_w_app_addr.SortOrder ASC, stp_stations_w_app_addr.`Sort Picture By` ASC" ; echo "
" ; // do not comment out this break!!! break ; case "st_paul_active" : $query= "SELECT * FROM stp_stations_w_app_addr stp_stations_w_app_addr WHERE (stp_stations_w_app_addr.LinkValue LIKE '%04_c') ORDER BY stp_stations_w_app_addr.`City Name` ASC, stp_stations_w_app_addr.Status_Station ASC, stp_stations_w_app_addr.SortOrder ASC, stp_stations_w_app_addr.`Sort Picture By` ASC" ; echo "
" ; // do not comment out this break!!! break ; case "st_paul_former" : $query= "SELECT * FROM stp_stations_w_app_addr stp_stations_w_app_addr WHERE (stp_stations_w_app_addr.LinkValue LIKE '%01_a') ORDER BY stp_stations_w_app_addr.`City Name` ASC, stp_stations_w_app_addr.Status_Station ASC, stp_stations_w_app_addr.SortOrder ASC, stp_stations_w_app_addr.`Sort Picture By` ASC" ; echo "
" ; // do not comment out this break!!! break ; case "minneapolis_active" : $query= "SELECT * FROM mfd_stations_w_app_addr mfd_stations_w_app_addr WHERE (mfd_stations_w_app_addr.LinkValue LIKE '%01_b') ORDER BY mfd_stations_w_app_addr.`City Name` ASC, mfd_stations_w_app_addr.Status_Station ASC, mfd_stations_w_app_addr.SortOrder ASC, mfd_stations_w_app_addr.`Sort Picture By` ASC" ; echo "
" ; // do not comment out this break!!! break ; case "minneapolis_former" : $query= "SELECT * FROM mfd_stations_w_app_addr mfd_stations_w_app_addr WHERE (mfd_stations_w_app_addr.LinkValue LIKE '%27_b') ORDER BY mfd_stations_w_app_addr.`City Name` ASC, mfd_stations_w_app_addr.Status_Station ASC, mfd_stations_w_app_addr.SortOrder ASC, mfd_stations_w_app_addr.`Sort Picture By` ASC" ; echo "
" ; // do not comment out this break!!! break ; } //================================================ //echo "The query you generated:
$query
" ; //echo "

" ; // run the query ==========++++++++++ // ------------------------------------------------------- /* Select queries return a resultset */ if ($result = $db_eatc7402->query($query)) { $num_of_rows = $result->num_rows ; if ($DEBUG3 == 'on') { echo "Select MYSQLI query returned $num_of_rows rows.

" ; } } // Check result // This shows the actual query sent to MySQL, and the error. Useful for debugging. if ($DEBUG3 == 'on') { if (!$result) { $message = 'Invalid query!!:
' . mysqli_error($db_eatc7402) . '
'; $message .= 'Whole query: ' . $query; die($message); } } $num = $num_of_rows ; // phpinfo() ; if (is_null($num)) { $num = "0"; } ; //echo "Your query returned $num rows"; //echo "

"; // End Run Query Section //========================================================= //============================================================ // the loop for processing the query results $i=0; $City_Name=db_result($result,$i,"City Name"); $Status_Station=db_result($result,$i,"Status_Station"); $SortOrder=db_result($result,$i,"SortOrder"); $Sort_Picture_By=db_result($result,$i,"Sort Picture By"); $Station_ID_Text=db_result($result,$i,"Station_ID_Text"); $LinkValue=db_result($result,$i,"LinkValue"); $Location=db_result($result,$i,"Location"); $Facing_Direction=db_result($result,$i,"Facing_Direction"); $Graphics_Dir_name=db_result($result,$i,"Graphics_Dir_name"); $Thumb_Picture_File_Name=db_result($result,$i,"Thumb_Picture_File_Name"); $Full_size_piture_filename=db_result($result,$i,"Full_size_piture_filename"); $Main_Pic_Source=db_result($result,$i,"Main Pic Source"); $MainStation_LinkFile=db_result($result,$i,"MainStation_LinkFile"); $BlockText_HTLM=db_result($result,$i,"BlockText_HTLM"); $Current_usage=db_result($result,$i,"Current_usage"); $Full_Size_filename_HTM=db_result($result,$i,"Full_Size_filename_HTM"); $AdditionalText_1=db_result($result,$i,"AdditionalText_1"); $AdditionalText_2=db_result($result,$i,"AdditionalText_2"); $BorderPic=db_result($result,$i,"BorderPic"); $ForwardLink=db_result($result,$i,"ForwardLink"); $BackwardLink=db_result($result,$i,"BackwardLink"); $ForwardLink_Text=db_result($result,$i,"ForwardLink_Text"); $BackwardLink_Text=db_result($result,$i,"BackwardLink_Text"); $ForwardLinkFlag=db_result($result,$i,"ForwardLinkFlag"); $Station_Name=db_result($result,$i,"Station Name"); $GraphicsDir=db_result($result,$i,"GraphicsDir"); $AddnlPictureFileName=db_result($result,$i,"AddnlPictureFileName"); $AddnlPicBlockText=db_result($result,$i,"AddnlPicBlockText"); $Assinged_To=db_result($result,$i,"Assinged_To"); $Title_body=db_result($result,$i,"Title_body"); $Title_exten1=db_result($result,$i,"Title_exten1"); $AddnlPictureTille=db_result($result,$i,"AddnlPictureTille"); $PictureAuthor=db_result($result,$i,"PictureAuthor"); $BorderAddnlPic=db_result($result,$i,"BorderAddnlPic"); $c_f_flag=db_result($result,$i,"c_f_flag"); $ID_pic=db_result($result,$i,"ID_pic"); $ID_pic2=db_result($result,$i,"ID_pic2"); $ID_pic3=db_result($result,$i,"ID_pic3"); $m_flag=db_result($result,$i,"m_flag"); $adnl_index=db_result($result,$i,"adnl_index"); $Unique_Pic_Num=db_result($result,$i,"Unique_Pic_Num"); $RigViz=db_result($result,$i,"RigViz"); $City_Name_st_paul = str_replace("St_Paul", "St. Paul", $City_Name) ; ?> <?echo Nz($City_Name_st_paul," ");?> Former Fire Station_ <?echo Nz($Station_ID_Text," ");?> and Apparatus <?echo Nz($City_Name_st_paul," ");?> Fire Station_ <?echo Nz($Station_ID_Text," ");?> and Apparatus <?echo Nz($City_Name," ");?> Former Fire Station_ <?echo Nz($Station_ID_Text," ");?> and Apparatus <?echo Nz($City_Name," ");?> Fire Station_ <?echo Nz($Station_ID_Text," ");?> and Apparatus
    

">
 
 

Former Station
and Apparatus (if available)

Station
and Apparatus (if available)

Station
and Apparatus (if available)

Station
and Apparatus (if available)

 


" alt="" border="0" /> " alt="" border="2" />


No picture author data

Photo source: 

 
 

 

Station has been
Station faces

 


" ; ?>

Current apparatus assigned to Station below



Images of former station views and/or former apparatus will be found below

">


#PIC_ID" alt="" border="0" />


#PIC_ID" alt="" border="2" />

Photo source:


Photo source: Unknown

 



Valid XHTML 1.0 Transitional


      

Copyright © 1996- The Extra Alarm Association
of The Twin Cities, Inc.
All Rights Reserved
Last Modified
Edited and maintained by D.B. Freedman
mailto: eaatc.web@gmail.com

      

-- [HOME] --