Tutorial
Typ your db name and a path to where the .BAK must be located and press the button:)
Tutorial how to install it
Replace the panel.php that is located under this line with the original or replace the code in panel.php with the code right below the link.
Link updated 9-6-2010
http://www.mediafire.com/?j2dzmjzwqzy
Ok and here is a little screenPHP Code:<?php
if( !ereg("index.php", $_SERVER['PHP_SELF']) )
{
header("Location: index.php");
die();
}
?>
<p align="left"><b><font face="Arial" size="4"><?php echo $_STR[Home0]; ?></font></b></p>
<p align="left"><font face="Arial"><?php echo $_STR[Home1]; ?> <a href="http://forum.ragezone.com/f245/emisands-gunz-admin-panel-v3-481443/">http://forum.ragezone.com/f245/emisands-gunz-admin-panel-v3-481443/</a></font></p>
<table border="0" width="80%" id="table1" cellspacing="1" style="border-collapse: collapse">
<tr>
<td style="border-style: solid; border-width: 2px; padding-left: 4px; padding-right: 4px" bordercolor="#FF9933">
<p align="left"><font face="Arial"><em><strong><?php echo $_STR[Home2]; ?></strong></em></font></td>
</tr>
<tr>
<td style="border-style: solid; border-width: 2px; padding-left: 4px; padding-right: 4px" bordercolor="#FF9933">
<p align="left"><font face="Arial" style="font-size: 11pt"><?php echo $_STR[Home3]; ?><strong>
<?php
$query = odbc_exec($connection, "SELECT COUNT(*) FROM {$_CONFIG[AccountTable]}(nolock)");
odbc_fetch_row($query);
echo odbc_result($query, 1);
?>
</strong><?php echo $_STR[Home4]; ?><strong>
<?php
$query = odbc_exec($connection, "SELECT COUNT(*) FROM {$_CONFIG[CharTable]}(nolock)");
odbc_fetch_row($query);
echo odbc_result($query, 1);
?>
</strong><?php echo $_STR[Home5]; ?><strong>
<?php
$query = odbc_exec($connection, "SELECT CurrPlayer FROM ServerStatus(nolock) WHERE Opened != 0");
$count = 0;
while( odbc_fetch_row($query) )
{
$count = $count + odbc_result($query, 1);
}
echo $count;
?>
</strong></font></font></p>
<p align="left"><font face="Arial" style="font-size: 11pt"><strong><?php echo $_STR[Home6]; ?><br />
<?php
$query = odbc_exec($connection, "SELECT * FROM ServerStatus(nolock) WHERE Opened != 0");
while( $data = odbc_fetch_object($query) )
{
$ip = $data->IP;
$port = $data->Port;
$name = $data->ServerName;
$fp = @fsockopen($ip, $port, $errno, $errstr, 1);
if (!$fp)
{
echo "{$_STR[Home7]}: $name - <font style='color: #FF3300'><B>Offline</B></font><br />";
}
else
{
echo "{$_STR[Home7]}: $name - <font style='color: #009933'><B>Online</B></font><br />";
fclose($fp);
}
}
?>
</strong></font></font></p>
<hr /><div align="center"><form action="<?=$_SERVER['PHP_SELF'];?>" method="post">
Insert Database name default is GunzDB <input type="text" name="db" value="GunzDB" /><br />
Create a realistic path <input type="text" name="path" value="C:\nlgunz" /><br />
<input type="submit" name="bak" value="Create Back-up now" />
</form>
<?php
$query = "DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
SET @path = '{$_POST['path']}'
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)
DECLARE db_cursor CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
WHERE name = '{$_POST['db']}'
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name
WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @path + 'GunZ' + '_' + @fileDate + '.BAK'
BACKUP DATABASE @name TO DISK = @fileName
FETCH NEXT FROM db_cursor INTO @name
END
CLOSE db_cursor
DEALLOCATE db_cursor";
if(isset($_POST['bak'])){
if(!file_exists($_POST['path'])){
echo "The path you have given isn't correct..";
}else{
$insert = odbc_prepare($connection,$query);
if(!@odbc_execute($insert)){
echo 'Something went wrong O.o A good solution for fixing this problem: Throw your computer out of your window:)';
}else{
echo 'Database has been saved to '.$_POST['path'].' on the hosting pc.';
}
}
}
#dbautobackup by Eele Ā© 2009, yea I wanted some credits for this shitty google'ed query lal.
?>
</div>
</td>
</tr>
</table>
![]()



Reply With Quote


