<?php
/**
 * converted to mysqli Mar 27,2020
 */

$user = get_current_user();

include "/home/$user/.php/bootstrap.php";

header("Location: https://www.permitsplus.com/tempsNew/temporary_permits.php"); /* Redirect browser */
exit;

include ("/home/permits/secure_html/php.includes/session.php");
//echo $sid;
$java .= "
<script language=\"JavaScript\">
<!-- hide from JavaScript-challenged browsers

function openWindow(url) {

// width & height
w = 425;
h= 325;

var winX = 0;
var winY = 0;

bVer = parseInt(navigator.appVersion);
if(bVer >= 4) {
winX = screen.width - w -400;
winY = 150;
}

popupWin = window.open(url,
'name','scrollbars,resizable,width=' + w + ',height='
+ h + ',left=' + winX + ',top=' + winY);
if(bVer >= 4)
popupWin.focus();
}

// done hiding -->
</script>";
if (isset($again)) $link = "x=true&";
$java .= "
<script>
var xmlHttp

function getPermits(str)
{
        if (str.length==0){
                document.getElementById(\"txtHint\").innerHTML=\"<br>Select A State\"
                return
        }
        xmlHttp=GetXmlHttpObject()

        if (xmlHttp==null)
        {
                alert (\"Browser does not support HTTP Request\")
                return
        }

        var url=\"showPermits.php?$link\"
        url=url+\"q=\"+str
        xmlHttp.onreadystatechange=stateChanged
        xmlHttp.open(\"GET\",url,true)
        xmlHttp.send(null)
}

function stateChanged()
{
        if (xmlHttp.readyState==4 || xmlHttp.readyState==\"complete\"){
                document.getElementById(\"txtHint\").innerHTML=xmlHttp.responseText
        }
}

function GetXmlHttpObject()
{
        var objXMLHttp=null
        if (window.XMLHttpRequest){
                objXMLHttp=new XMLHttpRequest()
        }
        else if (window.ActiveXObject){
                objXMLHttp=new ActiveXObject(\"Microsoft.XMLHTTP\")
        }
        return objXMLHttp
}
</script>";

$title .= "TEMPORARY FUEL AND TRIP PERMITS";

if (!isset($again)) {
$info .= "IMPORTANT!!!&nbsp; &nbsp;Temporary Permit Orders will only be <BR><B>processed</B> during the hours of
<BR><B>8am-3:45pm</B> EST <BR><B>Monday through Friday.</B> All orders received after 3:45pm EST will be processed starting at
8:00am ESTthe next business day. There will not be any temporary permit orders processed on weekends or <a 
href=\"javascript:openWindow('http://permitsplus.com/holidays2.htm')\">holidays.</A>
<br><font color=red><b>Our offices will be closing at 1 pm EST on Friday April 10, 2009</b></font><br>";
}
else 
	$info .= "Please select a state from below for your next permit.";

//include ("../.php/beta.inc");

$block .= "<option value=''>Select State And Permits Will Appear Below";
$result = mysqli_query($primary_db,"SELECT distinct state
                       FROM tempPrice order by state asc");
        while ($row = mysqli_fetch_array($result,MYSQLI_ASSOC))
        {
              $state = $row{"state"};
              $block .= "<option value='$state''>$state";
        }
$block .= "</select>";
$mainoutput .= "<table class=form>
			<tr><td valign=top>
			<select name=q id=\"txt1\" onchange=\"getPermits(this.value)\">";

$mainoutput .= "$block";
$mainoutput .= "<span id=\"txtHint\"></span></td>
		<td bgcolor=white valign=top>
		<font color=red>
		Improved Temporary Permit System!
		</font>
		<br>
		The system now accepts an unlimited number of temp orders, allows you to
		select previously entered data to save time, and allows you to edit or delete 
		your permits for faster ordering of multiple permits.
		</td>
		</tr>
		</table>";


include ("includes/page.inc");

?>

