0'); $pageLimitClause = " LIMIT ".($pageNumber-1)*$numberPerPage.", ".$pageNumber*$numberPerPage; if ( isset( $_GET['order'] ) ) { $query_Tour_Date = "SELECT * FROM license ORDER BY " . $_GET['order']; $result = mysql_query( $query_Tour_Date ) or die( mysql_error() ); $Tour_Date = mysql_query( $query_Tour_Date.$pageLimitClause, $ghostlicense ) or die( mysql_error() ); $row_Tour_Date = mysql_fetch_assoc( $Tour_Date ); } else { $query_Tour_Date = "SELECT * FROM license ORDER BY Last_Name"; $result = mysql_query( $query_Tour_Date ) or die( mysql_error() ); $Tour_Date = mysql_query( $query_Tour_Date.$pageLimitClause, $ghostlicense ) or die( mysql_error() ); $row_Tour_Date = mysql_fetch_assoc( $Tour_Date ); $num_rows = mysql_num_rows( $result ); } if ( isset( $_REQUEST['fGhost_Hunt'] ) ) { if ( $fGhost_Hunt == 'all' ) { $filter_Tour_Date = "SELECT * FROM license ORDER BY Last_Name"; $result = mysql_query( $filter_Tour_Date ) or die( mysql_error() ); $Tour_Date = mysql_query( $filter_Tour_Date.$pageLimitClause, $ghostlicense ) or die( mysql_error() ); $row_Tour_Date = mysql_fetch_assoc( $Tour_Date ); $num_rows = mysql_num_rows( $result ); } else { $filter_Tour_Date = "SELECT * FROM license WHERE Ghost_Hunt = '$fGhost_Hunt' ORDER BY Last_Name"; $result = mysql_query( $filter_Tour_Date ) or die( mysql_error() ); $Tour_Date = mysql_query( $filter_Tour_Date.$pageLimitClause, $ghostlicense ) or die( mysql_error() ); $row_Tour_Date = mysql_fetch_assoc( $Tour_Date ); $num_rows = mysql_num_rows( $result ); } } if ( $_POST['export'] ) { if ( $fGhost_Hunt == 'all' ) { $query_Tour_Date = "SELECT * FROM license ORDER BY Last_Name"; }else{ $query_Tour_Date = "SELECT * FROM license WHERE Ghost_Hunt ='".$fGhost_Hunt."' ORDER BY Last_Name"; } $result = mysql_query( $query_Tour_Date ) or die( mysql_error() ); function xlsBOF() { echo pack( "ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0 ); return; } function xlsEOF() { echo pack( "ss", 0x0A, 0x00 ); return; } function xlsWriteNumber( $Row, $Col, $Value ) { echo pack( "sssss", 0x203, 14, $Row, $Col, 0x0 ); echo pack( "d", $Value ); return; } function xlsWriteLabel( $Row, $Col, $Value ) { $L = strlen( $Value ); echo pack( "ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L ); echo $Value; return; } $file_name = 'ghost_license.xls'; header( "Pragma: public" ); header( "Expires: 0" ); header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" ); header( "Content-Type: application/force-download" ); header( "Content-Type: application/octet-stream" ); header( "Content-Type: application/download" ); header( 'Content-Disposition: attachment; filename="' . $file_name . '"' ); header( "Content-Transfer-Encoding: binary " ); // XLS Data Cell xlsBOF(); xlsWriteLabel( 0, 0, "First Name" ); xlsWriteLabel( 0, 1, "Last Name" ); xlsWriteLabel( 0, 2, "Address" ); xlsWriteLabel( 0, 3, "City" ); xlsWriteLabel( 0, 4, "State" ); xlsWriteLabel( 0, 5, "Zip Code" ); $xlsRow = 1; while ( list( $ID, $First_Name, $Last_Name, $Address, $City, $State, $Zip_Code ) = mysql_fetch_row( $result ) ) { $string1 = "'"; $string2 = "/"; ++$i; xlsWriteLabel( $xlsRow, 0, strtoupper("$First_Name")); xlsWriteLabel( $xlsRow, 1, strtoupper("$Last_Name")); xlsWriteLabel( $xlsRow, 2, strtoupper("$Address") ); xlsWriteLabel( $xlsRow, 3, strtoupper("$City") ); xlsWriteLabel( $xlsRow, 4, strtoupper("$State") ); xlsWriteLabel( $xlsRow, 5, "$Zip_Code" ); $xlsRow++; } xlsEOF(); exit(); // print($expData); // exit; } ?>



">
Total Records = 1, 'Previous'=>($pageNumber == 1 ? 1 : $pageNumber-1), 'Next'=>($pageNumber == $numberOfPages ? $numberOfPages : $pageNumber+1), 'Last'=> $numberOfPages); foreach($traverseLinks as $name => $page) { print ''.$name.' '; } ?>  
ID Last_Name First_Name AddressCity State Zip_Code Phone EMail Date Ghost_Hunt Comments People Attending