<?
// Start de session
session_start();
if( !isset($_SESSION['timer']) )
{
// Timer bestaat niet, aanmaken:
$_SESSION['timer'] = time();
}
else
{
// Timer bestaat : controleer of we nog binnen de 5 minuten zitten:
if( time() < ($_SESSION['timer']+60) )
{
// Nog binnen de geldige tijd
}
else
{
// Niet meer binnen de geldige tijd :
$_SERVER['PHP_AUTH_USER'] = "";
$_SERVER['PHP_AUTH_PW'] = "";
header('location:logout.php');
}
}
// Als er een 'mijntijd' in de session staat, bereken dan het verschil tussen toen en nu
if (isset($_SESSION['mijntijd']))
{
echo 'Uw vorige bezoek was :'.(time()-$_SESSION['mijntijd']).' seconden geleden.<BR>';
}
else
{
echo 'Dit is uw eerste bezoek want er staat geen tijd in de session';
}
// Zet de huidige tijd in de session
$_SESSION['mijntijd']=time();
// Laat alle errors zien
error_reporting(E_ALL);
// Definities benodigt voor ADO-connectie
define('adCmdStoredProc', 4);
define('adOpenStatic', 3);
define('adUseClient', 3);
define('adLockOptimistic', 3);
define('adLockreadOnly', 1);
define('adOpenForwardOnly',0);
// Database initialiseren
$conn = new COM('ADODB.Connection');
$db = 'debiteur.mdb';
$conn->CursorType = adOpenForwardOnly;
$conn->CursorLocation = 3;
$conn->LockType = 1;
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)};Persist Security info=false; DBQ=$db");
?>
<style type="text/css">
<!--
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.style3 {font-size: 10px}
.style4 {font-family: Verdana, Arial, Helvetica, sans-serif}
a:link {
color: #0000FF;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
color: #666666;
}
a:hover {
text-decoration: none;
color: #FF0000;
}
a:active {
text-decoration: underline;
}
body,td,th {
color: #666666;
}
.style5 {color: #0000FF}
.style6 {font-size: 10}
.style8 {
font-size: 10px;
font-weight: bold;
color: #FFFFFF;
}
-->
</style>
<title>Bedrijf BV</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW ||
innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue = true;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if
((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style;
v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
<div id="Loading" style="position:absolute; left:25%; top:90%;
width:50%; height:10%; z-index:1; visibility: hidden;">
<div align="center" class="style1">
<blockquote>
<table width="150" border="0">
<tr>
<td bgcolor="#666666"><div align="center"><span
class="style8">L o a d i n g . . . </span></div></td>
</tr>
</table>
</blockquote>
</div>
</div>
<p align="center" class="style4 style5"><span
class="style6"></span><img src="Logo%203D.jpg"></p>
<form action="debiteur.php" method="post" class="style1">
<center>
<table>
<tr>
<td width="69"><span class="style3">Zoek op </span></td>
<td width="144"><select name="veld">
<option value="veld9" selected>Debiteurnummer</option>
<option value="veld15">Naam</option>
<option value="veld35">Woonplaats</option>
</select>
</td>
</tr>
<tr>
<td><span class="style3">Zoekcriteria </span></td>
<td><input type="text" name="trefwoord"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit"
onClick="MM_displayStatusMsg('Loading...');MM_showHideLayers('Loading','','show');return
document.MM_returnValue" value="Zoeken"></td>
</tr>
</table>
</form>
<div align="center"><span class="style1"><a href="index.html" onMouseOver="MM_displayStatusMsg('');return document.MM_returnValue"> Hoofdmenu</a> <a href="debiteur.php" onMouseOver="MM_displayStatusMsg('');return document.MM_returnValue">Refresh</a>
</center>
<br>
<?
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$file="log debiteur.txt";
$h=fopen($file,"a+");
if($h===false)
{
echo "File : ".$file." <br>";
}
else
{
$nline = date('d/m/Y H:i:s')."\t".$_POST['trefwoord']."\t";
$res=fwrite($h,$nline);
if($res===false)
{
echo "<br>";
}
else
{
echo "<br>";
}
}
// Bouw query op met gekozen zoekveld en trefwoord
$qry = "SELECT * FROM qryUnion WHERE ".$_POST['veld']." LIKE '%".$_POST['trefwoord']."%'";
}
// Als er is gepost
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
// Bouw query op met gekozen zoekveld en trefwoord
$qry = "SELECT * FROM qryUnion WHERE ".$_POST['veld']." LIKE '%".$_POST['trefwoord']."%'";
// Voer de query uit op de database
$rs = $conn->Execute($qry);
// Bepaal aantal records
$aantal_records = $rs->RecordCount;
// Als er nul records zijn gevonden, geef melding.
if( $aantal_records == 0 )
{
echo 'Zoek actie voltooid, geen gegevens gevonden';
}
if (strlen($_POST["trefwoord"]) < 4)
{
echo 'U dient minimaal 4 karakters in te vullen.';
}
else
{
// Ga resultaten weergeven
while( !$rs->EOF)
{
?>
</span></div>
<tr>
<table bgcolor="#FFFFFF" align="center">
<tr>
<table width="240" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="30"><div align="left"><span class="style3"><span
class="style3"><span class="style4"></span></span></span></div></td>
</tr>
<td class="style1"><a
href="debiteur_details.php?veld9=<?=urlencode($rs->Fields['veld9']->value);?>"><?=$rs->Fields['veld9']->value;?>
<div align="left"></div></td><td width="184"><div
align="left" class="style1"></div>
<span class="style1">
<?=$rs->Fields['veld15']->value;?>
</span>
<td width="127" class="style1" align="right"><span class="style1">
<?=$rs->Fields['veld35']->value;?>
</span></td>
</tr>
</table>
<?
$rs->MoveNext();
}
}
echo '</table>';
}
?>