<?php
############################################################
# \-\-\-\-\-\-\     AzDG  - S C R I P T S    /-/-/-/-/-/-/ #
############################################################
# AzDGDatingPlatinum      Version 1.8.0                    #
# Written by              AzDG (support@azdg.com)          #
# Created 03/01/03        Last Modified 05/01/03           #
# Scripts Home:           http://www.azdg.com              #
############################################################
# File name               install.php                      #
# File purpose            Installation script              #
# File created by         AzDG <support@azdg.com>          #
############################################################
/*
Purpose: Recreate addressbook to fix possible errors
Run: Copy to main directory and run

Please do not use this addon if it is not required!
*/


/*
Using Old HTTP_POST for detect variables
*/
if (isset($_POST)) {while(list($name,$value) = each($_POST)){$$name = $value;};};
if (isset($_GET)) {while(list($name,$value) = each($_GET)){$$name = $value;};};

/*
Detecting user language. Installation will continue with user
language or default language
*/
if(!isset($l)) $l = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2);
if(!file_exists('languages/'.$l.'/inst.php')) $l='default';
if(!file_exists('languages/'.$l.'/inst.php')) {echo "<h3>Install Error:<br>Please upload inst.php from AzDGDating package into languages/default/ directory</h1>";die;};
include_once 'languages/'.$l.'/inst.php';

/*
We like to work with short tags.
And we chaking that this parameter must be enable
*/
if(!(ini_get("short_open_tag"))) {echo $y[0];die;}

/*
Several variables for design and script name
*/
define('C_SNAME_','AzDGDatingPlatinum v 1.7.3');
define('COLOR1','#A0C0F0');
define('COLOR2','#73AED2');
define('COLOR3','#84B8D7');
define('COLOR4','#92C0DC');
define('COLORH','#73AED2');

$error='0';
if(!isset($step)) $step='1';

function check($var) {
	global $error,$y;
	if($var) {
		echo '<span class="ok">'.$y[1].'<span>';
	} else {
		echo '<span class="false">'.$y[2].'<span>';
		$error='1';
	}
}

include 'include/config.inc.php';

?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<html dir=<?=C_HTML_DIR?>>
<head>
<title><?=C_SNAME_?> <?=$y[3]?></title>
<meta http-equiv=Content-Type content="text/html; charset=<?=C_CHARSET?>">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<style>
<!--
a:link{text-decoration:none;font-size:11px;color:blue}
a:visited{text-decoration:none;font-size:11px;color:blue}
a:hover{text-decoration:none;font-size:11px;color:black}
body{font-family:"Verdana";font-size:12px;scrollbar-face-color: #73AED2;scrollbar-highlight-color:#BDD3F4;scrollbar-shadow-color: #73AED2;scrollbar-3dlight-color:#73AED2;scrollbar-arrow-color: #BDD3F4;scrollbar-track-color:#A0D8F8;scrollbar-darkshadow-color: black;}
.pass{font-family:"Verdana";font-size:12px;color: red;}
.mes{font-family:Verdana,tahoma;font-size:11px;color:black;font-weight:bold;test-align:justify;}
sup{font-family:Verdana,tahoma;font-size:12px;color:white;font-weight:normal;}
.desc{font-family:Verdana,tahoma;font-size:10px;color:black;font-weight:bold;}
.dat{font-family:Verdana,tahoma;font-size:12px;color:red;font-weight:bold;}
.ok{font-family:Verdana,tahoma;font-size:12px;color:lime;font-weight:bold;}
.false{font-family:Verdana,tahoma;font-size:12px;color:red;font-weight:bold;}
.head{font-family:Arial Black, Arial;font-size:20px;color:black;}
.error{font-family:Verdana,Helvetica;font-size:16px;color:red;font-weight:bold;}
.button{font-family:Verdana;font-weight:bold;font-size:11px;color:black;background:#A0C0F0;border: black 1px solid; width:140px;cursor:hand;}
.input,.textarea,.select{font-family:Verdana;font-size:12px;color:black;background:#C2FBFE;border: black;border-style: solid;border-top-width: 1px;border-right-width: 1px;border-bottom-width: 1px;border-left-width: 1px;width:250px}
.binput{font-family:Verdana;font-size:12px;color:black;background:#C2FBFE;border: black 1px solid;width:500px}
.sinput{font-family:Verdana;font-size:12px;color:black;background:#C2FBFE;border: black 1px solid;width:60px}
.msinput{font-family:Verdana;font-size:12px;color:black;background:#C2FBFE;border: black 1px solid;width:90px}
.minput{font-family:Verdana;font-size:12px;color:black;background:#A0D8F8;border: black 1px solid;width:120px}
-->
</style>

<script language="JavaScript">
<!--
function bc(b,bg){b.style.backgroundColor = bg;}
function open_win(win_file, win_title) {
	window.open(win_file, win_title, 'resizable=yes,width=400,height=300,toolbar=no,scrollbars=yes,location=no,menubar=no,status=no');
}
//-->
</script>
</head>
<body bgcolor="#C2FBFE">
<center><table width="80%"><tr><td>
<basefont size="4" color="navy" face="Verdana,Tahoma">
<center><span class=head><?=C_SNAME_?> <?=$y[3]?></span>
<hr color=navy size=2>
<?php
include_once 'include/options.inc.php';
include_once 'include/security.inc.php';
include_once 'include/functions.inc.php';

$sql = "CREATE TABLE ".C_MYSQL_ADDRESSBOOK." (
	myid int unsigned NOT NULL default '0',
  user int unsigned NOT NULL default '0',
  new_mes smallint unsigned NOT NULL default '0',
  total_mes mediumint unsigned NOT NULL default '0',  
  lastdate datetime NOT NULL default '0000-00-00 00:00:00',
  UNIQUE KEY ids (myid,user)
)";
mysql_query($sql);


CreateAddressBook();
echo 'Address book created';
?>
<?die;?>
