[go: up one dir, main page]

Menu

[r99]: / tags / 1.3 / search.php  Maximize  Restore  History

Download this file

155 lines (143 with data), 5.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
# $Id: search.php 86 2010-10-05 12:19:27Z rediculum $
#
# Includes
####################################################################
include("includes/session.inc.php");
include("includes/layout.inc.php");
include("includes/functions.inc.php");
include("includes/db.inc.php");
include("includes/variables.inc.php");
# Main
#####################################################################?>
<html>
<head>
<?php echo "$headtitle $head";?>
</head>
<body>
<div id=menu>
<?php include("includes/menu.inc.php");?>
</div>
<div id=mainframe>
<b><?php echo "$search $entries:";?></b><p>
<table border=0 cellpadding=4 cellspacing=1>
<tr valign=bottom><td>
<table bgcolor="#EEEEEE">
<?php echo "$entrytext:";?>
<tr>
<td valign=top>&nbsp;</td></tr>
<tr>
<form method="post" action=<?php $PHP_SELF;?>>
<td valign=bottom><input type=text name=suchtext></td>
<td valign=bottom><input type=submit class=button_click name=textsearch value="<?php echo $search;?>"></td>
</form>
</tr></table>
</td><td>
<table bgcolor=#EEEEEE>
<?php echo "$date:";?>
<tr>
<form method="post" action=<?php $PHP_SELF;?>>
<td valign=top>Start:
<?php if ($_POST[starttag])
echo "<input type=text name=\"starttag\" size=\"2\" maxlenght=\"2\" value=$_POST[starttag]>";
else
echo "<input type=text name=\"starttag\" size=\"2\" maxlenght=\"2\">";?>
</td><td valign=top>
<select size=1 name="startmonat" required=yes>
<?php foreach (range(1,12) as $month)
{
if ($_POST[startmonat] == $month)
echo "<option selected value=$month>$month</option>";
elseif ($month == $activemonth)
echo "<option selected value=$month>$month</option>";
else
echo "<option value=$month>$month</option>";
}?>
</select>
</td><td valign=top>
</td></tr><tr>
<td valign=top>End: &nbsp;
<?php if ($_POST[endtag])
echo "<input type=text name=\"endtag\" size=\"2\" maxlenght=\"2\" value=$_POST[endtag]>";
else
echo "<input type=text name=\"endtag\" size=\"2\" maxlenght=\"2\">"; ?>
</td><td valign=top>
<select size=1 name="endmonat" required=yes>
<?php foreach (range(1,12) as $month)
{
if ($_POST[endmonat] == $month)
echo "<option selected value=$month>$month</option>";
elseif ($month == $activemonth)
echo "<option selected value=$month>$month</option>";
else
echo "<option value=$month>$month</option>";
}?>
</select>
</td><td valign=top>
<select size=1 name="jahr">
<?php if ($_POST[jahr])
echo "<option selected value=$_POST[jahr]>$_POST[jahr]</option>";
else {
echo "<option value=$activeyear>$activeyear</option>";
echo "<option value=" . ($activeyear-1) . ">" . ($activeyear-1) . "</option>";
}?>
</select>
<input type=submit class=button_click name=datesearch value="<?php echo $search;?>"></td>
</form>
</tr></table>
</td><td>
<table bgcolor="#EEEEEE">
<?php echo "$amount:";?>
<tr>
<td valign=top>&nbsp;</td></tr>
<tr>
<form method="post" action=<?php $PHP_SELF;?>>
<td valign=top><?php echo $currency;?> <input type=text size=6 name=betrag></td>
<td valign=top><input type=submit class=button_click name=amountsearch value="<?php echo $search;?>"></td>
</form>
</tr></table>
</td><td>
</td></tr></table>
<?php if (isset($_POST[textsearch])) {
if ($_POST['suchtext'] == '') {
echo "<font color=red>$searchfield $may_not_empty";
} else {
echo "$search <i>" . $_POST['suchtext'] . "</i>";
$result = mysql_query("SELECT $queryentriesjoin WHERE text LIKE '%" . $_POST['suchtext'] . "%' AND username='$activeuser' ORDER BY jahr,monat,tag ASC");
echo "<table><tr><td>";
tabelleVerbuchungen($result);
echo "</td></tr>";
# echo "<tr><td valign=top align=right>";
# eintragEditieren();
}
} elseif (isset($_POST[datesearch])) {
if ($_POST['starttag'] == '' || $_POST['endtag'] == '') {
echo "<font color=red>$day $may_not_empty";
} else {
echo "$search $date $from <i>" . $_POST['starttag'] . "." . $_POST['startmonat'] . "." . $_POST['jahr'] . " $to " . $_POST['endtag'] . "." . $_POST['endmonat'] . "." . $_POST['jahr'] . "</i>";
$result = mysql_query("SELECT $queryentriesjoin WHERE tag >= $_POST[starttag] AND tag <= $_POST[endtag] AND monat >= $_POST[startmonat] AND monat <= $_POST[endmonat] AND jahr = $_POST[jahr] AND username='$activeuser' ORDER BY jahr,monat,tag ASC");
echo "<table><tr><td>";
tabelleVerbuchungen($result);
echo "</td></tr>";
# echo "<tr><td valign=top align=right>";
# eintragEditieren();
}
} elseif (isset($_POST[amountsearch])) {
if ($_POST['betrag'] == '') {
echo "<font color=red>$amount $may_not_empty";
} else {
echo "$search $amount $currency <i>" . $_POST['betrag'] . "</i>";
$result = mysql_query("SELECT $queryentriesjoin WHERE betrag='$_POST[betrag]' AND username='$activeuser' ORDER BY jahr,monat,tag ASC");
tabelleVerbuchungen($result);
echo "</td></tr>";
# echo "<tr><td valign=top align=right>";
# eintragEditieren();
}
}?>
</td></tr>
</table>
</td>
</table>
</div>
</body>
</html>