| 1 |
lars |
1 |
<?
|
|
|
2 |
$self=basename($PHP_SELF);
|
|
|
3 |
$tab="gutscheine";
|
|
|
4 |
define ("modul_name", "online_shop");
|
|
|
5 |
define ("tool_name", "tester");
|
|
|
6 |
|
|
|
7 |
require_once "../connect2.php";
|
|
|
8 |
require_once "../../includes/system/gutscheinGenerator.php";
|
|
|
9 |
|
|
|
10 |
if ($action=="update")
|
|
|
11 |
{
|
|
|
12 |
$sql = "UPDATE $tab SET
|
|
|
13 |
name = '".$_POST['name']."', vorname = '".$_POST['vorname']."', anschrift = '".$_POST['anschrift']."',
|
|
|
14 |
plz = '".$_POST['plz']."', ort = '".$_POST['ort']."', email = '".$_POST['email']."',
|
|
|
15 |
nennwert = '".$_POST['nennwert']."', letzteAenderungVon = NOW()
|
|
|
16 |
WHERE ID = ".$_POST['ID'];
|
|
|
17 |
$query = mysql_query($sql) or die (mysql_errno().": ".mysql_error());
|
|
|
18 |
|
|
|
19 |
if($query)
|
|
|
20 |
header("Location: ".$self);
|
|
|
21 |
else
|
|
|
22 |
echo "Ein Fehler ist aufgetreten, bitte Informieren Sie die Webagentur Niewerth";
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
if ($action=="insert")
|
|
|
26 |
{
|
|
|
27 |
$gcode = generate();
|
|
|
28 |
|
|
|
29 |
$sql =
|
|
|
30 |
"
|
|
|
31 |
INSERT INTO gutscheine
|
|
|
32 |
(
|
|
|
33 |
code, name, vorname, anschrift,
|
|
|
34 |
plz, ort, email, nennwert,
|
|
|
35 |
erstelltAm, erstelltVon, letzteAenderungVon
|
|
|
36 |
)
|
|
|
37 |
values
|
|
|
38 |
(
|
|
|
39 |
'".$gcode."', '".$_POST['name']."', '".$_POST['vorname']."', '".$_POST['anschrift']."',
|
|
|
40 |
'".$_POST['plz']."', '".$_POST['ort']."', '".$_POST['email']."', '".$_POST['nennwert']."', NOW(),
|
|
|
41 |
'".$PHP_AUTH_USER."', '".$PHP_AUTH_USER."'
|
|
|
42 |
)
|
|
|
43 |
";
|
|
|
44 |
$query = mysql_query($sql) or die (mysql_errno().": ".mysql_error());
|
|
|
45 |
|
|
|
46 |
if( $query )
|
|
|
47 |
$created = true;
|
|
|
48 |
else
|
|
|
49 |
$created = false;
|
|
|
50 |
|
|
|
51 |
$ID = mysql_insert_id();
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
if ($action=="delete")
|
|
|
55 |
{
|
|
|
56 |
if(is_array($_POST['ID']))
|
|
|
57 |
{
|
|
|
58 |
$cond = implode(" OR ID=", $_POST['ID']);
|
|
|
59 |
$sql = "DELETE FROM $tab WHERE ID = $cond";
|
|
|
60 |
$query = mysql_query($sql) or die (mysql_errno().": ".mysql_error());
|
|
|
61 |
|
|
|
62 |
if($query)
|
|
|
63 |
header("Location: ".$self);
|
|
|
64 |
else
|
|
|
65 |
echo "Ein Fehler ist aufgetreten, bitte Informieren Sie die Webagentur Niewerth";
|
|
|
66 |
}
|
|
|
67 |
}
|
|
|
68 |
if (!$action)
|
|
|
69 |
{
|
|
|
70 |
$action="select_edit";
|
|
|
71 |
}
|
|
|
72 |
?>
|
|
|
73 |
<html>
|
|
|
74 |
<head>
|
|
|
75 |
<title>Gutscheinmodul</title>
|
|
|
76 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
77 |
<link rel=stylesheet type="text/css" href="../../buttons.css">
|
|
|
78 |
<script language="javascript" src="../../checkDate.js"></script>
|
|
|
79 |
<script language="JavaScript">
|
|
|
80 |
<!--
|
|
|
81 |
function MM_swapImgRestore() { //v3.0
|
|
|
82 |
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
|
|
|
83 |
}
|
|
|
84 |
|
|
|
85 |
function MM_preloadImages() { //v3.0
|
|
|
86 |
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
|
|
|
87 |
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
|
|
|
88 |
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
function MM_findObj(n, d) { //v4.01
|
|
|
92 |
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
|
|
|
93 |
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
|
|
|
94 |
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
|
|
|
95 |
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
|
|
|
96 |
if(!x && d.getElementById) x=d.getElementById(n); return x;
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
function MM_swapImage() { //v3.0
|
|
|
100 |
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
|
|
|
101 |
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
|
|
|
102 |
}
|
|
|
103 |
//-->
|
|
|
104 |
</script>
|
|
|
105 |
<script language="JavaScript" src="../../checkDate.js"></script>
|
|
|
106 |
<meta name="description" content="Redaktionssystem">
|
|
|
107 |
<meta name="author" content="Webagentur Niewerth">
|
|
|
108 |
<meta name="robots" content="noindex">
|
|
|
109 |
<style type="text/css">
|
|
|
110 |
<!--
|
|
|
111 |
a { color: #<? echo $webs[font_color_rechts] ?> }
|
|
|
112 |
@media print {
|
|
|
113 |
p{
|
|
|
114 |
font-family: Arial, Helvetica, sans-serif;
|
|
|
115 |
font-size: 13px;
|
|
|
116 |
font-weight: bold;
|
|
|
117 |
}
|
|
|
118 |
tr{
|
|
|
119 |
font-family: Arial, Helvetica, sans-serif;
|
|
|
120 |
font-size: 13px;
|
|
|
121 |
font-weight: bold;
|
|
|
122 |
}
|
|
|
123 |
td{
|
|
|
124 |
font-family: Arial, Helvetica, sans-serif;
|
|
|
125 |
font-size: 13px;
|
|
|
126 |
font-weight: bold;
|
|
|
127 |
}
|
|
|
128 |
p.screen {
|
|
|
129 |
display: none;
|
|
|
130 |
}
|
|
|
131 |
tr.screen{
|
|
|
132 |
display: none;
|
|
|
133 |
}
|
|
|
134 |
tr.screen{
|
|
|
135 |
display: none;
|
|
|
136 |
}
|
|
|
137 |
}
|
|
|
138 |
|
|
|
139 |
@media screen {
|
|
|
140 |
p{
|
|
|
141 |
font-family: Arial, Helvetica, sans-serif;
|
|
|
142 |
font-size: 13px;
|
|
|
143 |
font-weight: bold;
|
|
|
144 |
}
|
|
|
145 |
tr{
|
|
|
146 |
font-family: Arial, Helvetica, sans-serif;
|
|
|
147 |
font-size: 13px;
|
|
|
148 |
font-weight: bold;
|
|
|
149 |
}
|
|
|
150 |
td{
|
|
|
151 |
font-family: Arial, Helvetica, sans-serif;
|
|
|
152 |
font-size: 13px;
|
|
|
153 |
font-weight: bold;
|
|
|
154 |
}
|
|
|
155 |
}
|
|
|
156 |
-->
|
|
|
157 |
</style>
|
|
|
158 |
</head>
|
|
|
159 |
<body bgcolor="#<?= $webs[bgcolor_seite]; ?>" leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" onLoad="MM_preloadImages('../../images/navigation/bt_neu_f2.gif','../../images/navigation/bt_delete_f2.gif','../../images/navigation/bt_bearbeiten_f2.gif')" text="#<? echo $webs[font_color_seite]; ?>">
|
|
|
160 |
<form method="post" action="<?= $PHP_SELF ?>" name="formname" enctype="multipart/form-data">
|
|
|
161 |
<table width="662" border="0" cellspacing="0" cellpadding="0">
|
|
|
162 |
<tr valign="top">
|
|
|
163 |
<td width="585">
|
|
|
164 |
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
165 |
<?
|
|
|
166 |
// Gutschein erstellt
|
|
|
167 |
if($created == true)
|
|
|
168 |
{
|
|
|
169 |
?>
|
|
|
170 |
<tr align="left">
|
|
|
171 |
<td colspan="2" bgcolor="#<?= $webs[bgcolor_links] ?>"><strong>Der
|
|
|
172 |
Gutschein über:
|
|
|
173 |
<?= $_POST['nennwert'] ?>
|
|
|
174 |
€ wurde
|
|
|
175 |
erfolgreich angelegt.<br>
|
|
|
176 |
Der Gutscheincode lautet:
|
|
|
177 |
<?= $gcode ?>
|
|
|
178 |
<br>
|
|
|
179 |
<br>
|
|
|
180 |
Sie können den Code nun per <a href="<?= $self?>?action=send&ID=<?= $ID ?>">Email</a> verschicken, <br>
|
|
|
181 |
oder einen <a href="<?= $self?>?action=print&ID=<?= $ID ?>">Ausdruck</a> tätigen
|
|
|
182 |
und per Post verschicken. </strong></td>
|
|
|
183 |
</tr>
|
|
|
184 |
<?
|
|
|
185 |
}
|
|
|
186 |
?>
|
|
|
187 |
<?
|
|
|
188 |
// Gutschein verschicken
|
|
|
189 |
if($action == "send" || $action == "print")
|
|
|
190 |
{
|
|
|
191 |
$query="SELECT * FROM $tab WHERE ID = $ID";
|
|
|
192 |
// $query=$query."order by $sort";
|
|
|
193 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error());
|
|
|
194 |
if (mysql_num_rows($result) > 0)
|
|
|
195 |
{
|
|
|
196 |
$zeile = mysql_fetch_array($result,MYSQL_ASSOC);
|
|
|
197 |
$mailtext="Sehr geehrte(r) ".$zeile['vorname']." ".$zeile['name'].",\n\n"
|
|
|
198 |
."die folgende Gutscheinkombination bewahren sie bitte gut auf. \n"
|
|
|
199 |
."Speichern Sie diese Email, oder drucken "
|
|
|
200 |
."Sie diese gegebenenfalls aus.\n\n\n"
|
|
|
201 |
."Gutschein-Code: ".$zeile['code']."\n\n\n"
|
|
|
202 |
."Im Wert von: EUR "
|
|
|
203 |
.sprintf("%0.2f",$zeile['nennwert'])."\n\n\n";
|
|
|
204 |
$greetings="\n\nMit freundlichen Grüßen\nIhr Firmen Team\n";
|
|
|
205 |
if($action == "send")
|
|
|
206 |
{
|
|
|
207 |
?>
|
|
|
208 |
<tr align="left">
|
|
|
209 |
<td colspan="2" bgcolor="#<?= $webs[bgcolor_links] ?>">
|
|
|
210 |
<p class="screen">
|
|
|
211 |
Folgenden Text hat
|
|
|
212 |
Ihre Email:
|
|
|
213 |
<br>
|
|
|
214 |
<br>
|
|
|
215 |
</p>
|
|
|
216 |
<p class="print">
|
|
|
217 |
<?= nl2br($mailtext) ?>
|
|
|
218 |
</p>
|
|
|
219 |
<br>
|
|
|
220 |
</td>
|
|
|
221 |
</tr>
|
|
|
222 |
<tr align="left">
|
|
|
223 |
<td width="19%" align="left" valign="top" bgcolor="#<?= $webs[bgcolor_links] ?>">
|
|
|
224 |
<strong>Zusatztext Mail:</strong>
|
|
|
225 |
</td>
|
|
|
226 |
<td width="81%" bgcolor="#<?= $webs[bgcolor_links] ?>">
|
|
|
227 |
<textarea name="zusatztext" cols="60" rows="5"></textarea>
|
|
|
228 |
</td>
|
|
|
229 |
</tr>
|
|
|
230 |
<tr align="left" class="print">
|
|
|
231 |
<td colspan="2" align="left" valign="top" bgcolor="#<?= $webs[bgcolor_links] ?>"><br>
|
|
|
232 |
<p class="print"><strong><?= nl2br($greetings) ?></strong></p></td>
|
|
|
233 |
</tr>
|
|
|
234 |
<tr align="left">
|
|
|
235 |
<td colspan="2" align="left" valign="top" bgcolor="#<?= $webs[bgcolor_links] ?>">
|
|
|
236 |
<input name="submit" type="submit" value=" OK ">
|
|
|
237 |
<input name="button2" type="button" onClick="parent.location='<?= $self?>?action=print&ID=<?= $ID ?>'" value="Druck">
|
|
|
238 |
<input type="hidden" name="action" value="send">
|
|
|
239 |
<input type="hidden" name="sub" value="post">
|
|
|
240 |
<input type="hidden" name="ID" value="<?= $ID ?>">
|
|
|
241 |
<?
|
|
|
242 |
if($sub=="post")
|
|
|
243 |
{
|
|
|
244 |
$mailtext = $mailtext."\n\n----------------------------------------------\n".$_POST['zusatztext']
|
|
|
245 |
."\n----------------------------------------------\n\n\n".$greetings;
|
|
|
246 |
// $zeile['email'] = "mail@mail.de";
|
|
|
247 |
$mailStatus=mail($zeile['email'], "Gutscheinmail Mediaran.de", $mailtext);
|
|
|
248 |
if($mailStatus==false)
|
|
|
249 |
echo "Achtung die Email wurde nicht verschickt<br>";
|
|
|
250 |
else
|
|
|
251 |
{
|
|
|
252 |
$sql = "UPDATE $tab set status=1 WHERE ID = $ID";
|
|
|
253 |
$result = mysql_query ($sql) or die (mysql_errno().": ".mysql_error());
|
|
|
254 |
echo "Die Email wurde erfolgreich an ".$zeile['email']." verschickt<br>";
|
|
|
255 |
|
|
|
256 |
}
|
|
|
257 |
}
|
|
|
258 |
?>
|
|
|
259 |
</td>
|
|
|
260 |
</tr>
|
|
|
261 |
</table>
|
|
|
262 |
<?
|
|
|
263 |
}elseif($action=="print")
|
|
|
264 |
{
|
|
|
265 |
echo "</table>"; // <-- nicht wegmachen!!!!
|
|
|
266 |
?>
|
|
|
267 |
<p class="print">
|
|
|
268 |
<?= nl2br($mailtext) ?>
|
|
|
269 |
</p>
|
|
|
270 |
<strong><?= nl2br($greetings) ?></strong>
|
|
|
271 |
<p class="screen">
|
|
|
272 |
<script type="text/javascript">
|
|
|
273 |
<!--
|
|
|
274 |
function ImagePop() {
|
|
|
275 |
F = window.open("imgTTFbBox.php?scr=ground.jpg&wd=395&hg=200&ft=14&fs=12&cr[0]=Gutschein-Code:%20%20%20%20%20<?= $zeile['code'] ?>&cr[1]=%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20______________________________&cr[2]=&cr[3]=Im Wert von:%20%20%20%20%20%20%20%20%20%20%20%20%20EUR%20<?= $zeile['nennwert'] ?>&cr[4]=&cr[5]=&cr[6]=Von","Popup","width=420,height=230");
|
|
|
276 |
}
|
|
|
277 |
// -->
|
|
|
278 |
</script>
|
|
|
279 |
<input name="button1" type="button" onClick="self.window.print()" value="Druck">
|
|
|
280 |
<input name="button2" type="button" onClick="parent.location='<?= $self?>?action=send&ID=<?= $ID ?>'" value="abbrechen">
|
|
|
281 |
<input name="button3" type="button" onClick="ImagePop()" value="Bild anzeigen">
|
|
|
282 |
</p>
|
|
|
283 |
|
|
|
284 |
<?
|
|
|
285 |
}
|
|
|
286 |
}
|
|
|
287 |
}
|
|
|
288 |
?>
|
|
|
289 |
|
|
|
290 |
<!-- Auswahl Löschen START -->
|
|
|
291 |
<?
|
|
|
292 |
if ($action=="delete")
|
|
|
293 |
{
|
|
|
294 |
$query="SELECT * FROM $tab ";
|
|
|
295 |
// $query=$query."order by $sort";
|
|
|
296 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error());
|
|
|
297 |
if (mysql_num_rows($result) == 0)
|
|
|
298 |
{
|
|
|
299 |
?>
|
|
|
300 |
<p class="error"><font color="#<?= $webs['font_color_seite'] ?>">Es
|
|
|
301 |
sind keine Daten eingetragen !</font></p>
|
|
|
302 |
<p></p>
|
|
|
303 |
<?
|
|
|
304 |
}
|
|
|
305 |
else
|
|
|
306 |
{
|
|
|
307 |
?>
|
|
|
308 |
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
309 |
<tr>
|
|
|
310 |
<td colspan="4" class="headline" bgcolor="#<?= $webs['bgcolor_links'] ?>"><font color="#<?= $webs['font_color_links'] ?>">Gutscheine:
|
|
|
311 |
Löschen</font></td>
|
|
|
312 |
</tr>
|
|
|
313 |
<?
|
|
|
314 |
while ($zeile=mysql_fetch_array($result))
|
|
|
315 |
{
|
|
|
316 |
?>
|
|
|
317 |
<tr>
|
|
|
318 |
<td width="38%" bgcolor="#<?= $webs['bgcolor_rechts'] ?>"><a href="../<?= $self?>?action=edit&ID=<?= $zeile['ID']; ?>">
|
|
|
319 |
</a><a href="<?= $self ?>?action=edit&ID=<?= $zeile['ID']; ?>">
|
|
|
320 |
<?= $zeile['name'] ?>
|
|
|
321 |
|
|
|
322 |
<?= $zeile['vorname'] ?>
|
|
|
323 |
</a><font color="#<?= $webs['font_color_rechts'] ?>"> </font> </td>
|
|
|
324 |
<td width="45%" bgcolor="#<?= $webs['bgcolor_rechts'] ?>"><a href="<?= $self?>?action=edit&ID=<?= $zeile['ID']; ?>">
|
|
|
325 |
<?= $zeile['code'] ?>
|
|
|
326 |
</a></td>
|
|
|
327 |
<td width="12%" bgcolor="#<?= $webs['bgcolor_rechts'] ?>"><a href="<?= $self?>?action=edit&ID=<?= $zeile['ID']; ?>">
|
|
|
328 |
<?= $zeile['nennwert'] ?>
|
|
|
329 |
</a> € </td>
|
|
|
330 |
<td width="5%" align="center" bgcolor="#<?= $webs['bgcolor_rechts'] ?>">
|
|
|
331 |
<input type="checkbox" name="ID[]" value="<?= $zeile['ID'] ?>">
|
|
|
332 |
</td>
|
|
|
333 |
</tr>
|
|
|
334 |
<?
|
|
|
335 |
}
|
|
|
336 |
?>
|
|
|
337 |
<tr>
|
|
|
338 |
<td height="29" colspan="4" align="right" bgcolor="#<?= $webs['bgcolor_links'] ?>">
|
|
|
339 |
<a href="../<?= $self ?>?action=edit&ID=<?= $zeile['ID']; ?>">
|
|
|
340 |
<?= $zeile['Vorname']?>
|
|
|
341 |
</a>
|
|
|
342 |
<input type="hidden" name="action" value='delete'>
|
|
|
343 |
<input type="submit" value="LÖSCHEN">
|
|
|
344 |
<input type="button" name="Button2" value="Abbrechen" onClick="parent.location='<?= $self?>'">
|
|
|
345 |
</td>
|
|
|
346 |
</tr>
|
|
|
347 |
</table>
|
|
|
348 |
<?
|
|
|
349 |
}
|
|
|
350 |
|
|
|
351 |
}
|
|
|
352 |
?>
|
|
|
353 |
<!-- Auswahl Löschen ENDE -->
|
|
|
354 |
<!-- Auswahl SELECT_EDIT START -->
|
|
|
355 |
<?
|
|
|
356 |
|
|
|
357 |
if ($action=="select_edit")
|
|
|
358 |
{
|
|
|
359 |
$query="SELECT * FROM $tab ";
|
|
|
360 |
// $query=$query."order by $sort";
|
|
|
361 |
|
|
|
362 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error());
|
|
|
363 |
if (mysql_num_rows($result) == 0)
|
|
|
364 |
{
|
|
|
365 |
?>
|
|
|
366 |
<p class="error"><font color="#<?= $webs['font_color_seite'] ?>">Es
|
|
|
367 |
sind keine Daten eingetragen !</font></p>
|
|
|
368 |
<p></p>
|
|
|
369 |
<?
|
|
|
370 |
}
|
|
|
371 |
else
|
|
|
372 |
{
|
|
|
373 |
?>
|
|
|
374 |
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
375 |
<tr bgcolor="#<?= $webs['bgcolor_links'] ?>">
|
|
|
376 |
<td colspan="4" bgcolor="#<?= $webs['bgcolor_links'] ?>" class="headline"><font color="#<?= $webs['font_color_links'] ?>">Gutscheine:
|
|
|
377 |
Bearbeiten</font></td>
|
|
|
378 |
</tr>
|
|
|
379 |
<?
|
|
|
380 |
while ($zeile=mysql_fetch_array($result))
|
|
|
381 |
{
|
|
|
382 |
?>
|
|
|
383 |
<tr>
|
|
|
384 |
<td width="38%" bgcolor="#<?= $webs['bgcolor_rechts'] ?>"><a href="<?= $self ?>?action=edit&ID=<?= $zeile['ID']; ?>">
|
|
|
385 |
<?= $zeile['name'] ?> <?= $zeile['vorname'] ?>
|
|
|
386 |
</a><font color="#<?= $webs['font_color_rechts'] ?>"> </font></td>
|
|
|
387 |
<td width="45%" bgcolor="#<?= $webs['bgcolor_rechts'] ?>"><a href="<?= $self?>?action=edit&ID=<?= $zeile['ID']; ?>">
|
|
|
388 |
<?= $zeile['code'] ?>
|
|
|
389 |
</a></td>
|
|
|
390 |
<td width="10%" bgcolor="#<?= $webs['bgcolor_rechts'] ?>"><a href="<?= $self?>?action=edit&ID=<?= $zeile['ID']; ?>">
|
|
|
391 |
<?= $zeile['nennwert'] ?>
|
|
|
392 |
</a> € </td>
|
|
|
393 |
|
|
|
394 |
<td width="7%" bgcolor="#<?= $webs['bgcolor_rechts'] ?>"><? if($zeile['status']==0){ ?>*<? }else{ ?>OK<? } ?></td>
|
|
|
395 |
|
|
|
396 |
<? if (isset($user_rechte[modul_name][tool_name][kategorie]))
|
|
|
397 |
{
|
|
|
398 |
?>
|
|
|
399 |
<?
|
|
|
400 |
}
|
|
|
401 |
?>
|
|
|
402 |
</tr>
|
|
|
403 |
<?
|
|
|
404 |
}
|
|
|
405 |
?>
|
|
|
406 |
<tr bgcolor="#<?= $webs['bgcolor_links'] ?>">
|
|
|
407 |
<td height="22" colspan="4">
|
|
|
408 |
<div align="right">* erfordert Aktion </div>
|
|
|
409 |
</td>
|
|
|
410 |
</tr>
|
|
|
411 |
</table>
|
|
|
412 |
<?
|
|
|
413 |
}
|
|
|
414 |
|
|
|
415 |
}
|
|
|
416 |
?>
|
|
|
417 |
<!-- Auswahl SELECT_EDIT ENDE -->
|
|
|
418 |
<?
|
|
|
419 |
if ($action=="edit")
|
|
|
420 |
{
|
|
|
421 |
if ($ID)
|
|
|
422 |
{
|
|
|
423 |
$result = mysql_query ("SELECT * FROM $tab where ID = '$ID'") or die (mysql_errno().": ".mysql_error());
|
|
|
424 |
$zeile=mysql_fetch_array($result);
|
|
|
425 |
}
|
|
|
426 |
$zeile['gueltig_von']=date2human($zeile['gueltig_von']);
|
|
|
427 |
$zeile['gueltig_bis']=date2human($zeile['gueltig_bis']);
|
|
|
428 |
?>
|
|
|
429 |
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
430 |
<tr>
|
|
|
431 |
<td colspan="2" class="headline" bgcolor="#<?= $webs['bgcolor_links'] ?>"><font color="#<?= $webs['font_color_links'] ?>">Gutscheine:
|
|
|
432 |
<?
|
|
|
433 |
if ($ID)
|
|
|
434 |
{
|
|
|
435 |
?>
|
|
|
436 |
Bearbeiten
|
|
|
437 |
<?
|
|
|
438 |
}
|
|
|
439 |
else
|
|
|
440 |
{
|
|
|
441 |
?>
|
|
|
442 |
Neueintrag
|
|
|
443 |
<?
|
|
|
444 |
}
|
|
|
445 |
?>
|
|
|
446 |
</font> </td>
|
|
|
447 |
</tr>
|
|
|
448 |
<?
|
|
|
449 |
$Feld="Name";
|
|
|
450 |
if (isset($user_rechte[modul_name][tool_name][$Feld]))
|
|
|
451 |
{
|
|
|
452 |
?>
|
|
|
453 |
<tr>
|
|
|
454 |
<td bgcolor="#<?= $webs['bgcolor_links'] ?>" class="headline" width="21%"><font color="#<?= $webs['font_color_links'] ?>"><b>
|
|
|
455 |
<?
|
|
|
456 |
if ($web_rechte[modul_name][tool_name][$Feld])
|
|
|
457 |
{
|
|
|
458 |
echo $web_rechte[modul_name][tool_name][$Feld];
|
|
|
459 |
}
|
|
|
460 |
else
|
|
|
461 |
{
|
|
|
462 |
?>
|
|
|
463 |
E-Mail:
|
|
|
464 |
<?
|
|
|
465 |
}
|
|
|
466 |
?>
|
|
|
467 |
</b></font></td>
|
|
|
468 |
<td width="79%" bgcolor="#<?= $webs['bgcolor_rechts'] ?>">
|
|
|
469 |
<input name="email" type="text" id="email" value="<?= htmlentities($zeile['email']) ?>" size="40" maxlength="255">
|
|
|
470 |
</td>
|
|
|
471 |
</tr>
|
|
|
472 |
<?
|
|
|
473 |
}
|
|
|
474 |
?>
|
|
|
475 |
<?
|
|
|
476 |
$Feld="Link";
|
|
|
477 |
if (isset($user_rechte[modul_name][tool_name][$Feld]))
|
|
|
478 |
{
|
|
|
479 |
?>
|
|
|
480 |
<tr>
|
|
|
481 |
<td bgcolor="#<?= $webs['bgcolor_links'] ?>" class="headline" width="21%"><font color="#<?= $webs['font_color_links'] ?>"><b>
|
|
|
482 |
<?
|
|
|
483 |
if ($web_rechte[modul_name][tool_name][$Feld])
|
|
|
484 |
{
|
|
|
485 |
echo $web_rechte[modul_name][tool_name][$Feld];
|
|
|
486 |
}
|
|
|
487 |
else
|
|
|
488 |
{
|
|
|
489 |
?>
|
|
|
490 |
Vorname:
|
|
|
491 |
<?
|
|
|
492 |
}
|
|
|
493 |
?>
|
|
|
494 |
</b></font></td>
|
|
|
495 |
<td bgcolor="#<?= $webs['bgcolor_rechts'] ?>">
|
|
|
496 |
<input name="vorname" type="text" id="vorname" value="<?= htmlentities($zeile['vorname']) ?>" size="40" maxlength="255">
|
|
|
497 |
</td>
|
|
|
498 |
</tr>
|
|
|
499 |
<tr>
|
|
|
500 |
<td bgcolor="#<?= $webs['bgcolor_links'] ?>" class="headline"><font color="#<?= $webs['font_color_links'] ?>"><b>
|
|
|
501 |
<?
|
|
|
502 |
if ($web_rechte[modul_name][tool_name][$Feld])
|
|
|
503 |
{
|
|
|
504 |
echo $web_rechte[modul_name][tool_name][$Feld];
|
|
|
505 |
}
|
|
|
506 |
else
|
|
|
507 |
{
|
|
|
508 |
?>
|
|
|
509 |
Name:
|
|
|
510 |
<?
|
|
|
511 |
}
|
|
|
512 |
?>
|
|
|
513 |
</b></font></td>
|
|
|
514 |
<td bgcolor="#<?= $webs['bgcolor_rechts'] ?>">
|
|
|
515 |
<input name="name" type="text" id="name" value="<?= htmlentities($zeile['name']) ?>" size="40" maxlength="255">
|
|
|
516 |
</td>
|
|
|
517 |
</tr>
|
|
|
518 |
<tr>
|
|
|
519 |
<td bgcolor="#<?= $webs['bgcolor_links'] ?>" class="headline"><font color="#<?= $webs['font_color_links'] ?>"><b>
|
|
|
520 |
<?
|
|
|
521 |
if ($web_rechte[modul_name][tool_name][$Feld])
|
|
|
522 |
{
|
|
|
523 |
echo $web_rechte[modul_name][tool_name][$Feld];
|
|
|
524 |
}
|
|
|
525 |
else
|
|
|
526 |
{
|
|
|
527 |
?>
|
|
|
528 |
Anschrift:
|
|
|
529 |
<?
|
|
|
530 |
}
|
|
|
531 |
?>
|
|
|
532 |
</b></font></td>
|
|
|
533 |
<td bgcolor="#<?= $webs['bgcolor_rechts'] ?>">
|
|
|
534 |
<input name="anschrift" type="text" id="anschrift" value="<?= htmlentities($zeile['anschrift']) ?>" size="40" maxlength="255">
|
|
|
535 |
</td>
|
|
|
536 |
</tr>
|
|
|
537 |
<tr>
|
|
|
538 |
<td bgcolor="#<?= $webs[bgcolor_links] ?>" class="headline"><font color="#<?= $webs[font_color_links] ?>"><b>
|
|
|
539 |
<?
|
|
|
540 |
if ($web_rechte[modul_name][tool_name][$Feld])
|
|
|
541 |
{
|
|
|
542 |
echo $web_rechte[modul_name][tool_name][$Feld];
|
|
|
543 |
}
|
|
|
544 |
else
|
|
|
545 |
{
|
|
|
546 |
?>
|
|
|
547 |
PLZ/Ort:
|
|
|
548 |
<?
|
|
|
549 |
}
|
|
|
550 |
?>
|
|
|
551 |
</b></font></td>
|
|
|
552 |
<td bgcolor="#<?= $webs[bgcolor_rechts] ?>">
|
|
|
553 |
<input name="plz" type="text" id="plz" value="<?= htmlentities($zeile['plz']) ?>" size="9" maxlength="255">
|
|
|
554 |
<input name="ort" type="text" id="ort" value="<?= htmlentities($zeile['ort']) ?>" size="24" maxlength="255">
|
|
|
555 |
</td>
|
|
|
556 |
</tr>
|
|
|
557 |
<tr>
|
|
|
558 |
<td bgcolor="#<?=$webs[bgcolor_links] ?>" class="headline"><font color="#<?= $webs[font_color_links] ?>"><b>
|
|
|
559 |
<?
|
|
|
560 |
if ($web_rechte[modul_name][tool_name][$Feld])
|
|
|
561 |
{
|
|
|
562 |
echo $web_rechte[modul_name][tool_name][$Feld];
|
|
|
563 |
}
|
|
|
564 |
else
|
|
|
565 |
{
|
|
|
566 |
?>
|
|
|
567 |
Betrag:
|
|
|
568 |
<?
|
|
|
569 |
}
|
|
|
570 |
?>
|
|
|
571 |
</b></font>
|
|
|
572 |
</td>
|
|
|
573 |
<td bgcolor="#<?= $webs[bgcolor_rechts] ?>">
|
|
|
574 |
<input name="nennwert" type="text" id="nennwert" value="<?= htmlentities($zeile['nennwert']) ?>" size="10" maxlength="255">
|
|
|
575 |
€
|
|
|
576 |
</td>
|
|
|
577 |
</tr>
|
|
|
578 |
<?
|
|
|
579 |
}
|
|
|
580 |
|
|
|
581 |
for ($bild_nr = 1; $bild_nr < 2 ; $bild_nr++)
|
|
|
582 |
{
|
|
|
583 |
$Feld="Logo$bild_nr";
|
|
|
584 |
if (isset($user_rechte[modul_name][tool_name][$Feld]))
|
|
|
585 |
{
|
|
|
586 |
|
|
|
587 |
}
|
|
|
588 |
}
|
|
|
589 |
?>
|
|
|
590 |
<?
|
|
|
591 |
if ($ID)
|
|
|
592 |
{
|
|
|
593 |
?>
|
|
|
594 |
<tr>
|
|
|
595 |
<td class="headline" width="21%" bgcolor="#<?= $webs[bgcolor_links] ?>"><font color="#<?= $webs[font_color_links] ?>"><b>
|
|
|
596 |
erstellt am:
|
|
|
597 |
</b></font>
|
|
|
598 |
</td>
|
|
|
599 |
<? $erstelltAm=datetime2human($zeile[erstelltAm]); ?>
|
|
|
600 |
<td class="headline" bgcolor="#<?= $webs[bgcolor_rechts] ?>"><font color="#<?= $webs[font_color_rechts] ?>">am:
|
|
|
601 |
<?= $erstelltAm[Datum] ?>
|
|
|
602 |
um:
|
|
|
603 |
<?= $erstelltAm[Zeit] ?>
|
|
|
604 |
von:
|
|
|
605 |
<?= $zeile[erstelltVon] ?>
|
|
|
606 |
</font>
|
|
|
607 |
</td>
|
|
|
608 |
</tr>
|
|
|
609 |
<tr>
|
|
|
610 |
<td class="headline" width="21%" bgcolor="#<?= $webs[bgcolor_links] ?>"><font color="#<?= $webs[font_color_links] ?>"><b>
|
|
|
611 |
letzte Änderung:
|
|
|
612 |
</b></font></td>
|
|
|
613 |
<? $letzteAenderungAm=timestamp2human($zeile[letzteAenderungAm]) ?>
|
|
|
614 |
<td class="headline" bgcolor="#<?= $webs[bgcolor_rechts] ?>"><font color="#<?= $webs[font_color_rechts] ?>">am:
|
|
|
615 |
<?= $letzteAenderungAm[Datum] ?>
|
|
|
616 |
um:
|
|
|
617 |
<?= $letzteAenderungAm[Zeit] ?>
|
|
|
618 |
von:
|
|
|
619 |
<?= $zeile[letzteAenderungVon] ?>
|
|
|
620 |
</font>
|
|
|
621 |
</td>
|
|
|
622 |
</tr>
|
|
|
623 |
<? } ?>
|
|
|
624 |
<tr>
|
|
|
625 |
<td align="right" colspan="2" bgcolor="#<?= $webs[bgcolor_links] ?>">
|
|
|
626 |
<input type="hidden" name="ID" value="<?= $ID ?>">
|
|
|
627 |
<input type="hidden" name="action" value="<? if(!$ID) { echo "insert"; }else{ echo "update"; } ?>">
|
|
|
628 |
<input type="submit" value=" OK ">
|
|
|
629 |
<input type="button" name="Button" value="Abbrechen" onClick="parent.location='<?= $self?>'">
|
|
|
630 |
<? if($ID){ ?>
|
|
|
631 |
<input name="button" type="button" onClick="parent.location='<?= $self?>?action=send&ID=<?= $ID ?>'" value="Mail">
|
|
|
632 |
<? } ?>
|
|
|
633 |
</td>
|
|
|
634 |
</tr>
|
|
|
635 |
<?
|
|
|
636 |
if($ID)
|
|
|
637 |
{
|
|
|
638 |
// Kurzstatistik über Gutschein Differenzen
|
|
|
639 |
$sql ="SELECT gutscheine.*, gutscheineDifferenz.*, DATE_FORMAT(gutscheineDifferenz.geaendertAm,'%Y-%m-%d / %T') AS zeit FROM gutscheine,gutscheineDifferenz WHERE gutscheineDifferenz.gutscheinID=$ID AND gutscheine.ID=$ID";
|
|
|
640 |
$result = mysql_query ($sql) or die (mysql_errno().": ".mysql_error());
|
|
|
641 |
$rows=mysql_num_rows($result);
|
|
|
642 |
if($rows > 0)
|
|
|
643 |
{
|
|
|
644 |
$i=1;
|
|
|
645 |
$gesamt=0;
|
|
|
646 |
while($zeileDiff=mysql_fetch_array($result, MYSQL_ASSOC))
|
|
|
647 |
{
|
|
|
648 |
?>
|
|
|
649 |
<tr>
|
|
|
650 |
<td align="left" colspan="2" bgcolor="#<?= $webs[bgcolor_links] ?>" class="screen" >
|
|
|
651 |
<?
|
|
|
652 |
$gesamt+=$zeileDiff['wert'];
|
|
|
653 |
echo "Nr.:".$i.") - EUR ".$zeileDiff['wert']." - Einkauf vom: ". $zeileDiff['zeit']. "<br>";
|
|
|
654 |
if($i==$rows)
|
|
|
655 |
{
|
|
|
656 |
echo "<br>Gesamt: EUR ".$gesamt." - Restwert: EUR ".(($zeile['nennwert'])-$gesamt)."<br>";
|
|
|
657 |
}
|
|
|
658 |
$i++;
|
|
|
659 |
}
|
|
|
660 |
?>
|
|
|
661 |
</td>
|
|
|
662 |
</tr>
|
|
|
663 |
<?
|
|
|
664 |
}
|
|
|
665 |
}
|
|
|
666 |
?>
|
|
|
667 |
</table>
|
|
|
668 |
<?
|
|
|
669 |
}
|
|
|
670 |
?>
|
|
|
671 |
</td>
|
|
|
672 |
<td width="77" align="right">
|
|
|
673 |
<?
|
|
|
674 |
if($action!="print")
|
|
|
675 |
{
|
|
|
676 |
?>
|
|
|
677 |
<table width="67" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
678 |
<tr>
|
|
|
679 |
<td><a href="<?= $self ?>?action=edit" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('new','','../../images/navigation/bt_neu_f2.gif',1)"><img name="new" border="0" src="../../images/navigation/bt_neu.gif" width="67" height="40" alt="Neueintrag"></a></td>
|
|
|
680 |
</tr>
|
|
|
681 |
<tr>
|
|
|
682 |
<td><a href="<?= $self ?>?action=select_edit" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('edit','','../../images/navigation/bt_bearbeiten_f2.gif',1)"><img name="edit" border="0" src="../../images/navigation/bt_bearbeiten.gif" width="67" height="40" alt="Eintrag bearbeiten"></a></td>
|
|
|
683 |
</tr>
|
|
|
684 |
<tr>
|
|
|
685 |
<td><a href="<?= $self ?>?action=delete" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('delete','','../../images/navigation/bt_delete_f2.gif',1)"><img name="delete" border="0" src="../../images/navigation/bt_delete.gif" width="67" height="40" alt="Eintrag löschen"></a></td>
|
|
|
686 |
</tr>
|
|
|
687 |
</table>
|
|
|
688 |
<?
|
|
|
689 |
}
|
|
|
690 |
?>
|
|
|
691 |
</td>
|
|
|
692 |
</tr>
|
|
|
693 |
</table>
|
|
|
694 |
</form>
|
|
|
695 |
</body>
|