File: index.php

package info (click to toggle)
opendb 0.81p18-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,716 kB
  • ctags: 6,787
  • sloc: php: 50,213; sql: 3,098; sh: 272; makefile: 54; xml: 48
file content (53 lines) | stat: -rw-r--r-- 1,878 bytes parent folder | download
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
<?php
/* 	OpenDb - Open Media Lending Database
	Copyright (C) 2001,2002 by Jason Pell

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

if($CONFIG_VARS['patch.enable']===TRUE)
{
	if($HTTP_VARS['op'] == "menu")
	{
		echo("<p>
			Each of these sql scripts will configure OpenDb for the particular country
			indicated.  This patch is only valid for ENGLISH language configurations.
			You can rerun any of these patches as many times as required.
		</p>");
		
		echo("<DIV ALIGN=\"CENTER\">");
		$files = get_patch_file_list($HTTP_VARS['from'],"sql");
		echo("<FORM action=\"$PHP_SELF\" method=\"get\" target=\"main\">");
		while (list(,$file) = each($files))
		{
			print_button("sqlfile", "$file", FALSE);
			echo("&nbsp;");
		}
		echo("<br>");
		echo("Preview SQL only<INPUT TYPE=\"checkbox\" name=\"preview\" value=\"true\">");
		echo("<INPUT TYPE=\"hidden\" name=\"op\" value=\"result\">");
		echo("<INPUT TYPE=\"hidden\" name=\"from\" value=\"".$HTTP_VARS['from']."\">");
		echo("</FORM>");
		echo("</DIV>");
	}
	else
	{
		if($HTTP_VARS['preview'] == "true")
			print_sql_file($HTTP_VARS['from'], $HTTP_VARS['sqlfile']);
		else if(isset($HTTP_VARS['sqlfile']))
			exec_sql_file($HTTP_VARS['from'], $HTTP_VARS['sqlfile']);
	}
}
?>