comparison _xampp/cds.php @ 0:b12c99b7c3f0

commit for previous development
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 19 Jan 2015 17:13:49 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b12c99b7c3f0
1 <?
2 if(@$_REQUEST['action']=="getpdf")
3 {
4 mysql_connect("localhost","root","");
5 mysql_select_db("cdcol");
6
7 include ('class.ezpdf.php');
8 $pdf = new Cezpdf();
9 $pdf->selectFont('/opt/lampp/lib/fonts/Helvetica.afm');
10
11 $pdf->ezText('CD Collection',14);
12 $pdf->ezText('© 2002-2009 Kai Seidler, oswald@apachefriends.org, GPL',10);
13 $pdf->ezText('',12);
14
15 $result=mysql_query("SELECT id,titel,interpret,jahr FROM cds ORDER BY interpret;");
16
17 $i=0;
18 while( $row=mysql_fetch_array($result) )
19 {
20 $data[$i]=array('interpret'=>$row['interpret'],'titel'=>$row['titel'],'jahr'=>$row['jahr']);
21 $i++;
22 }
23
24 $pdf->ezTable($data,"","",array('width'=>500));
25
26 $pdf->ezStream();
27 exit;
28 }
29 ?>
30 <? include("langsettings.php"); ?>
31 <html>
32 <head>
33 <title>apachefriends.org cd collection</title>
34 <link href="xampp.css" rel="stylesheet" type="text/css">
35 </head>
36
37 <body>
38
39 &nbsp;<p>
40 <h1><?=$TEXT['cds-head']?></h1>
41
42 <?=$TEXT['cds-text1']?><p>
43 <?=$TEXT['cds-text2']?><p>
44
45 <?
46
47 // Copyright (C) 2002/2003 Kai Seidler, oswald@apachefriends.org
48 //
49 // This program is free software; you can redistribute it and/or modify
50 // it under the terms of the GNU General Public License as published by
51 // the Free Software Foundation; either version 2 of the License, or
52 // (at your option) any later version.
53 //
54 // This program is distributed in the hope that it will be useful,
55 // but WITHOUT ANY WARRANTY; without even the implied warranty of
56 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57 // GNU General Public License for more details.
58 //
59 // You should have received a copy of the GNU General Public License
60 // along with this program; if not, write to the Free Software
61 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
62
63
64 if(!mysql_connect("localhost","root",""))
65 {
66 echo "<h2>".$TEXT['cds-error']."</h2>";
67 die();
68 }
69 mysql_select_db("cdcol");
70 ?>
71
72 <h2><?=$TEXT['cds-head1']?></h2>
73
74 <table border=0 cellpadding=0 cellspacing=0>
75 <tr bgcolor=#f87820>
76 <td><img src=img/blank.gif width=10 height=25></td>
77 <td class=tabhead><img src=img/blank.gif width=200 height=6><br><b><?=$TEXT['cds-attrib1']?></b></td>
78 <td class=tabhead><img src=img/blank.gif width=200 height=6><br><b><?=$TEXT['cds-attrib2']?></b></td>
79 <td class=tabhead><img src=img/blank.gif width=50 height=6><br><b><?=$TEXT['cds-attrib3']?></b></td>
80 <td class=tabhead><img src=img/blank.gif width=50 height=6><br><b><?=$TEXT['cds-attrib4']?></b></td>
81 <td><img src=img/blank.gif width=10 height=25></td>
82 </tr>
83
84
85 <?
86 if(@$_REQUEST['interpret']!="")
87 {
88 $titel=mysql_real_escape_string($_REQUEST['titel']);
89 $interpret=mysql_real_escape_string($_REQUEST['interpret']);
90 $jahr=mysql_real_escape_string($_REQUEST['jahr']);
91 if($jahr=="")$jahr="NULL";
92 mysql_query("INSERT INTO cds (titel,interpret,jahr) VALUES('$titel','$interpret',$jahr);");
93 }
94
95 if(@$_REQUEST['action']=="del")
96 {
97 mysql_query("DELETE FROM cds WHERE id=".round($_REQUEST['id']));
98 }
99
100 $result=mysql_query("SELECT id,titel,interpret,jahr FROM cds ORDER BY interpret;");
101
102 $i=0;
103 while( $row=mysql_fetch_array($result) )
104 {
105 if($i>0)
106 {
107 echo "<tr valign=bottom>";
108 echo "<td bgcolor=#ffffff background='img/strichel.gif' colspan=6><img src=img/blank.gif width=1 height=1></td>";
109 echo "</tr>";
110 }
111 echo "<tr valign=center>";
112 echo "<td class=tabval><img src=img/blank.gif width=10 height=20></td>";
113 echo "<td class=tabval><b>".htmlspecialchars($row['interpret'])."</b></td>";
114 echo "<td class=tabval>".htmlspecialchars($row['titel'])."&nbsp;</td>";
115 echo "<td class=tabval>".htmlspecialchars($row['jahr'])."&nbsp;</td>";
116
117 echo "<td class=tabval><a onclick=\"return confirm('".$TEXT['cds-sure']."');\" href=cds.php?action=del&id=".$row['id']."><span class=red>[".$TEXT['cds-button1']."]</span></a></td>";
118 echo "<td class=tabval></td>";
119 echo "</tr>";
120 $i++;
121
122 }
123
124 echo "<tr valign=bottom>";
125 echo "<td bgcolor=#fb7922 colspan=6><img src=img/blank.gif width=1 height=8></td>";
126 echo "</tr>";
127
128
129 ?>
130
131 </table>
132
133 <h2><?=$TEXT['cds-head2']?></h2>
134
135 <form action=cds.php method=get>
136 <table border=0 cellpadding=0 cellspacing=0>
137 <tr><td><?=$TEXT['cds-attrib1']?>:</td><td><input type=text size=30 name=interpret></td></tr>
138 <tr><td><?=$TEXT['cds-attrib2']?>:</td><td> <input type=text size=30 name=titel></td></tr>
139 <tr><td><?=$TEXT['cds-attrib3']?>:</td><td> <input type=text size=5 name=jahr></td></tr>
140 <tr><td></td><td><input type=submit border=0 value="<?=$TEXT['cds-button2']?>"></td></tr>
141 </table>
142 </form>
143 <? include("showcode.php"); ?>
144
145 </body>
146 </html>