- Joined
- Oct 9, 2012
- Messages
- 226
- Reaction score
- 76
Hi,
This is script which can upload service images to world ranking tables, its simple to edit so i guess everybody can use it.
Before run script you have to open
atum2_db_account.dbo.td_wrk_selfServiceInfo
and
atum2_db_account.dbo.td_wrk_allServiceInfo
and insert data to following columns:
ServiceUID (if you set it up by admin tool put 2000)
ServiceName (in selfServiceInfo put ServerGroup name and in allServiceinfo put country)
Then run script
You can upload BMP, JPG and PNG which is not supported by AdminTool
Cheers
This is script which can upload service images to world ranking tables, its simple to edit so i guess everybody can use it.
Before run script you have to open
atum2_db_account.dbo.td_wrk_selfServiceInfo
and
atum2_db_account.dbo.td_wrk_allServiceInfo
and insert data to following columns:
ServiceUID (if you set it up by admin tool put 2000)
ServiceName (in selfServiceInfo put ServerGroup name and in allServiceinfo put country)
Then run script
Code:
<?php
$db_host = ''; //MSSQL server name
$db_user = ''; //MSSQL user
$db_pass = ''; //MSSQL pass
$conn = @mssql_connect($db_host,$db_user,$db_pass) or die('conn Err 1');
$db = @mssql_select_db('atum2_db_account',$conn) or die('db con Err 2');
if(isset($_POST) && !empty($_POST)){
$fileName = @$_FILES['userfile']['name'];
$tmpName = @$_FILES['userfile']['tmp_name'];
$fileSize = @$_FILES['userfile']['size'];
$fileType = @$_FILES['userfile']['type'];
$datastring= @file_get_contents($tmpName);
$data=unpack("H*hex", $datastring);
$SQL="UPDATE atum2_db_account.dbo.td_wrk_allServiceInfo SET ServiceSymbolImage = 0x".$data['hex']." , SymbolImageSize = '$fileSize' where ServiceUID = '2000'";
$SQL2="UPDATE atum2_db_account.dbo.td_wrk_SelfServiceInfo SET ServiceSymbolImage = 0x".$data['hex']." , SymbolImageSize = '$fileSize' where ServiceUID = '2000'";
echo $SQL;
echo "<br><br>";
echo $fileType;
mssql_query($SQL) or die('Error, query failed');
mssql_query($SQL2) or die('Error, query 2 failed');
}
?>
<form action="#" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="userfile" id="userfile"><br>
<input type="submit" name="submit" value="Submit">
</form>
You can upload BMP, JPG and PNG which is not supported by AdminTool
Cheers