<?php # page to search and display gbps pages session_cache_limiter('public');session_start();if(!isset($_SESSION['YOB'])) $_SESSION['YOB']=$_GET['YOB'];ini_set("display_errors","1");$page_title='eBudget Search';$firstTime = true;			  //$host='localhost'; //$port = '3306'; //$user ='ebudget';// $password = 'tegdube'; //$dbNam="ebudget"; $pass=$_SERVER['PHP_SELF']; $pit="p"; $msg = ''; if (strpos($_SERVER['PHP_SELF'] , 'Enacted')) $pit = 'e'; if (strpos($_SERVER['PHP_SELF'] , 'Revised')) $pit = 'm';//if ($pit=="p") $rel = 'php/';//else $rel = '../php/';include ('php/gui.php');	include ('php/sql.php');	include ('php/rowDisplay.php');	include ('php/config.php');//echo getDbConnection();//echo getConfigValuesForKey('user');$showForm = true;	$cookieAlow=1;if (!isset($_COOKIE["PHPSESSID"])) {$cookieAlow=0;}if (isset($_REQUEST['btnAdvanced']) || isset($_REQUEST['btnBasic'])) {	if ($cookieAlow == 0) {	$showForm = true;	$firstTime = false;	}	else 	{		$_SESSION['MatchStr']='';		$nbr= getRecCount( $pit);		if ($nbr == 0 ){				$showForm = true;				} 		else{	 		$showForm = false;	 		makeHiliteArr();	 		include ('searchHeaderNoRNav.php');			// echo  $_SESSION['MatchStr'];			$rt= buildResultPage( $pit,  1, $nbr);			foreach ($rt as $val) {					echo $val ;			}		//echo 'number=' .$nbr . '$resultsPerPage=' .$resultsPerPage . 'pages=' .$pages ;  	}   	}}else{	if (isset($_REQUEST['page']) ) {		$showForm = false;		include ('searchHeaderNoRNav.php');// echo 'go by page: page=' . $_REQUEST['page'] ;		$rt= buildResultPage( $pit, $_REQUEST['page'], $_REQUEST['recs']   );		foreach ($rt as $val) {			echo $val ;		} 	}}if ($showForm) {    include ('searchHeader.php');    resetSession();    if ($cookieAlow == 0) {    if (!$firstTime)     	 echo '<span class="redLink">  Cookies must be enabled</span>';} else if (isset($_REQUEST['btnAdvanced']) || isset($_REQUEST['btnBasic'])) 	echo '<span class="redLink">  Your search did not match any documents</span>';?><script language="javascript" >    function setBD(){    var a = document.forms.a.checkClicked.value='Y';	document.forms.a.submit();	}	</script><form action="<?php echo $_SERVER['PHP_SELF'] ?>" name="a" method="post"> <input name="checkClicked" type="hidden" value="" /> <span class="levelUpTitle"></span>            <span class="sectionTitle">Basic Search</span><br> <table width="60%" border="0" cellspacing="0" cellpadding="0">  <tr class="content">    <td>Basic Search Text:</td>    <td><input name="basicTxt" type="text" value="<?php echo raw_param('basicTxt') ?>" size="30" maxlength="250" /></td>  </tr>  <tr class="content">  <td>&nbsp;</td>    <td  >   <input name="btnBasic" type="submit" value="Search" onclick="document.forms.a.checkClicked.value='N'" /></td>  </tr>  </table><hr /> <BR><span class="levelUpTitle"></span>            <span class="sectionTitle">Advanced Search</span><br> 			<span class="content"> Advanced Search Text and Criteria:</span>	<table width="90%" border="0" cellspacing="0" cellpadding="0">  <tr class="content">    <td>All Words:</td>    <td><input name="allTxt" type="text" value="<?php echo raw_param('allTxt') ?>" size="30" maxlength="300" /></td>  </tr>  <tr class="content">    <td>Exact Phrase:</td>    <td><input name="exactTxt" type="text" value="<?php echo raw_param('exactTxt') ?>" size="30" maxlength="300" /></td>  </tr>  <tr class="content">    <td>At Least One Word:</td>    <td><input name="oneTxt" type="text" value="<?php echo raw_param('oneTxt') ?>" size="30" maxlength="300" /></td>  </tr>  <tr class="content">    <td>Without the Word:</td>    <td><input name="noneTxt" type="text" value="<?php echo raw_param('noneTxt') ?>" size="30" maxlength="300" /></td>  </tr>  <tr class="content">    <td>File Type</td>    <td> <select name="fileType" >	<option value="typeHtml" 	<?php if (isset($_POST['fileType']) && $_POST['fileType'] == 'typeHtml')  echo ' selected '; ?> >HTML</option>	<option value="typePdf" 	<?php if (isset($_POST['fileType']) && $_POST['fileType'] == 'typePdf')  echo ' selected '; ?> >PDF</option>	<option value="typeAll"	<?php if (isset($_POST['fileType']) && $_POST['fileType'] == 'typeAll')  echo ' selected '; ?> >ALL</option>	</select></td>  </tr>  <tr class="content">    <td>Search In:</td>    <td>&nbsp;</td>  </tr>  <tr class="content">    <td> <input name="budgetDetail" type="checkbox" value="bd"  onClick="setBD()" <?php  echo isChecked('1')   ?> /> Budget Detail		</td>    <td><?php echo pulldown( $pit, "1") ?></td>  </tr>  <tr class="content">    <td><input name="budgetSummary" type="checkbox" value="bs" onClick="setBD()" <?php  echo isChecked('2')   ?> /> Budget Summary</td>    <td><?php echo pulldown( $pit, "2") ?></td>  </tr>   <tr class="content">  <td>&nbsp;</td>    <td  >   <input name="btnAdvanced" type="submit" value="Search"   onclick="document.forms.a.checkClicked.value='N'"/></td>  </tr></table>	</form>		<?php }include ('searchFooter.php');?>