<?php include '../library/fiprotect.php'; ?>
<?php include "../include/global.php"; ?>

<?PHP
$domain = $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI];
$file = "http://www.idevspot.com/connect.php?domain=$domain&script=$script_title";
$data = @file_get_contents($file);
?>

<html>
<head>
<script language="javascript" type="text/javascript">
function removeSpaces(string) {
 return string.split(' ').join('');
}
</script>
<title>iDevSpot Script Installer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../include/stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="center" class="head_link"><a href="#"> <br>
<?php echo $install1; ?>
</a></div>
<br><br>
<table border="0" cellspacing="0" cellpadding="0" width="600" align="CENTER">
<tr> 
<td height="4"><img src="../images/ltl.png" width="6" height="6"></td>
<td background="../images/lt.png"></td>
<td height="4"><img src="../images/ltr.png" width="6" height="6"></td>
</tr>
<tr> 
<td background="../images/sf-l.jpg"></td>
<td class="td2" width="100%" bgcolor="#FFFFFF">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr> 
<td class="td3" colspan="2"><b> Installation</b></td>
</tr>
<tr> 
<td class="td4" valign="top"> 
<p><img src="../images/Help.png" width="64" height="64"></p>
</td>
<td class="td4" width="100%"> All files/directories stated below need to be made writeable. CHMOD to 777 (or 755 on some servers) read/write/execute permissions. If you are unable to change permissions on your server, 
follow the instructions provided within /include/mysql.php</td>
</tr>
</table>
<br>
<table  width="100%" cellpadding="0" cellspacing="0" border="0">
<tr> 
<td class="td3"><b> Pre-Install Testing</b></td>
</tr>
</table>
<table  width="100%" cellpadding="0" cellspacing="0" border="0">
<tr> 
<td class="td4"  width="50%"> <b>Directory</b></td>
<td align=center class="td4"  width="50%"> <b>Is writable:</b></td>
</tr>
<?php
$filename = '../product_images';
if (file_exists($filename)) {
?>
<tr> 
<td class="td4"  width="50%">product_images</td>
<td align=center class="td4"  width="50%"> 
<?php
$filename = '../product_images';
if (is_writable($filename)) {
    echo 'Yes';
} else {
    echo 'No';
}
?>
</td>
</tr>
<tr> 
<td class="td4"  width="50%">product_images/large</td>
<td align=center class="td4"  width="50%"> 
<?php
$filename = '../product_images/large';
if (is_writable($filename)) {
    echo 'Yes';
} else {
    echo 'No';
}
?>
</td>
</tr>
<tr> 
<td class="td4"  width="50%">product_images/tmp</td>
<td align=center class="td4"  width="50%"> 
<?php
$filename = '../product_images/tmp';
if (is_writable($filename)) {
    echo 'Yes';
} else {
    echo 'No';
}
?>
</td>
</tr>
<tr> 
<td class="td4"  width="50%">product_images/thumb</td>
<td align=center class="td4"  width="50%"> 
<?php
$filename = '../product_images/thumb';
if (is_writable($filename)) {
    echo 'Yes';
} else {
    echo 'No';
}
?>
</td>
</tr>
<?PHP } ?>
<tr> 
<td class="td4"  width="50%">include/mysql.php</td>
<td align=center class="td4"  width="50%"> 
<?php
$filename = '../include/mysql.php';
if (is_writable($filename)) {
    echo 'Yes';
} else {
    echo 'No';
}
?>
</td>
</tr>
</table>
<br>
<form name="form1" method="post" action="doinstall.php">
<table  width="100%" cellpadding="0" cellspacing="0" border="0">
<tr> 
<td class="td3"><b> Database Connection</b></td>
</tr>
</table>
<table  width="100%" cellpadding="0" cellspacing="0" border="0">
<tr> 
<td  nowrap class="td4"  width="50%"> Database Host</td>
<td class="td4"  width="50%"> 
<input type="text" name="host" class="textarea100" value="<?php if (empty($_POST[host])) echo localhost; else echo $_POST[host]; ?>">
</td>
</tr>
<tr> 
<td  nowrap class="td4"  width="50%"> Database Name</td>
<td class="td4"  width="50%"> 
<input type="text" name="dbname" class="textarea100"  value="<?php echo $_POST[dbname]; ?>">
</td>
</tr>
<tr> 
<td  nowrap class="td4"  width="50%"> Database Username</td>
<td class="td4"  width="50%"> 
<input type="text" name="dbusername" class="textarea100"  value="<?php echo $_POST[dbusername]; ?>">
</td>
</tr>
<tr> 
<td  nowrap height="42" class="td4"  width="50%"> Database Password</td>
<td  height="42" class="td4"  width="50%"> 
<input type="text" name="dbpassword" class="textarea100"  value="<?php echo $_POST[dbpassword]; ?>">
</td>
</tr>
</table>
<br>
<table  width="100%" cellpadding="0" cellspacing="0" border="0">
<tr> 
<td class="td3" colspan="2"><b> Create Admin Account</b></td>
</tr>
<tr> 
<td  nowrap class="td4"  width="50%"> Username</td>
<td class="td4"  width="50%"> 
<input type="text" name="USERNAME" class="textarea100"  value="<?php echo $_POST[USERNAME]; ?>" onBlur="this.value=removeSpaces(this.value);">
</td>
</tr>
<tr> 
<td  nowrap class="td4"  width="50%"> Password</td>
<td class="td4"  width="50%"> 
<input type="text" name="PASSWORD" class="textarea100"  value="<?php echo $_POST[PASSWORD]; ?>" onBlur="this.value=removeSpaces(this.value);">
</td>
</tr>
<tr> 
<td class="td4" colspan="2"> 
<div align="right"> 
<input type="submit" name="Submit" value="Install Now">
</div>
</td>
</tr>
</table>
</form>
</td>
<td background="../images/lr.png"></td>
</tr>
<tr> 
<td><img src="../images/lbl.png" width="6" height="6"></td>
<td background="../images/lb.png"></td>
<td><img src="../images/lbr.png" width="6" height="6"></td>
</tr>
</table>
<br>
<br>
<br>
<br>
</body>
</html>
