Skip to content

Commit

Permalink
[25] Preparation to full restructure adding and viewing reports.
Browse files Browse the repository at this point in the history
Please, do not use this commit!
Stable commit: 24. Thanks.

Signed-off-by: Ivan <Dfyztimy@list.ru>
  • Loading branch information
Hantet committed Jul 9, 2010
1 parent 1ee8f45 commit ee3cf93
Show file tree
Hide file tree
Showing 8 changed files with 311 additions and 255 deletions.
2 changes: 1 addition & 1 deletion config.php
Expand Up @@ -40,7 +40,7 @@ function get($id)
"anim" => false,
"LinkAccount" => "http://localhost/admin/account.php?id=",
"LinkPlayer" => "http://localhost/admin/player.php?guid=",
"searchlimit" => 10,
"searchlimit" => 5,
"lang" => 8,
/*##################################################################################################
## Admin settings
Expand Down
6 changes: 5 additions & 1 deletion lib/classes.php
Expand Up @@ -15,6 +15,10 @@ function GetNewId();
function GetNameByGUID($guid);
function GetAccountNameById($id);
function GetSections();
function GetSubType($id);
function GetMap($id);
function GetZone($id);
function GetSectionById($id);
function GetPercent($id,$one=false);
function GetPriority($id,$one=false);
function GetStatus($id,$one=false);
Expand Down Expand Up @@ -44,7 +48,6 @@ interface html
function install();
function send();
function viewall($int);
function viewdate($int);
function progress($int);
function detail($int);
function view();
Expand All @@ -53,6 +56,7 @@ function htmlstart($title);
function header();
function end();
function block($text);
function blocknot($text);
function login();
function success();
function inc($content);
Expand Down
54 changes: 44 additions & 10 deletions lib/create.php
Expand Up @@ -55,7 +55,35 @@ public function GetSections($st=false)
$res = $sql->num_rows($sql->exe($cfg->get("realmd"),"SELECT 1 FROM `bt_message`".$order));
return ($res > "0") ? '<font color="red">'.$res.'</font>' : $res;
}

public function GetSectionById($id)
{
$cfg = new config;
$sql = new sql;
$name = $sql->res($cfg->get("realmd"),"SELECT `name` FROM `bt_section` WHERE `id` = '".$id."'");
return $name;
}
public function GetSubType($id)
{
$cfg = new config;
$sql = new sql;
$result = $sql->res($cfg->get("realmd"),"SELECT `name` FROM `bt_subtype` WHERE `id` = '".$id."'");
if(!$result)
$result = '--';
return $result;
}
public function GetMap($id)
{
$cfg = new config;
$sql = new sql;
$result = $sql->res($cfg->get("realmd"),"SELECT `name` FROM `bt_map_id` WHERE `id` = '".$id."'");
if(!$result)
$result = '--';
return $result;
}
public function GetZone($id)
{

}
public function GetPercent($all,$one=false)
{
$cfg = new config;
Expand Down Expand Up @@ -133,7 +161,7 @@ public function LoadZones()
$opt[0] = "";
$cur = 0;
$query = $sql->exe($cfg->get("realmd"),"SELECT * FROM `bt_zone_id` ORDER BY `map` ASC");
while($row = mysql_fetch_array($query))
while($row = $sql->fetch($query))
{
if(!isset($opt[$row['map']]))
{
Expand All @@ -146,7 +174,7 @@ public function LoadZones()
$query = $sql->exe($cfg->get("realmd"),"SELECT `map` FROM `bt_zone_id` ORDER BY `map` ASC");
$script = '<script type="text/javascript">var map = new Array();';
$curmap = '';
while($tow = mysql_fetch_array($query))
while($tow = $sql->fetch($query))
{
if($tow['map'] != $curmap)
{
Expand All @@ -163,10 +191,12 @@ public function LoadChar($acc)
$cfg = new config;
$sql = new sql;
$query = $sql->exe($cfg->get("characters"),"SELECT `guid`,`name` FROM `characters` WHERE `account` = '".$acc."'");
$text = '';
while($row=mysql_fetch_array($query))
{
echo '<option value="'.$row['guid'].'">'.$row['name'].'</option>';
$text.= '<option value="'.$row['guid'].'">'.$row['name'].'</option>';
}
return $text;
}

public function LoadStatus($id="0",$all="0")
Expand Down Expand Up @@ -203,11 +233,13 @@ public function LoadMap()
{
$cfg = new config;
$sql = new sql;
$text = '';
$query = $sql->exe($cfg->get("realmd"),"SELECT `id`,`name` FROM `bt_map_id` ORDER BY `id` ASC");
while($row=mysql_fetch_array($query))
{
echo '<option value="'.$row['id'].'">'.$row['name'].'</option>';
$text.='<option value="'.$row['id'].'">'.$row['name'].'</option>';
}
return $text;
}

public function login($login,$pass)
Expand Down Expand Up @@ -297,7 +329,7 @@ public function LoadSubType()
{
$cfg = new config;
$sql = new sql;
$query = $sql->exe($cfg->get("realmd"),"SELECT `id`,`name` FROM `bt_SubType` ORDER BY `id` ASC");
$query = $sql->exe($cfg->get("realmd"),"SELECT `id`,`name` FROM `bt_subtype` ORDER BY `id` ASC");
$txt="";
while($row=mysql_fetch_array($query))
{
Expand All @@ -312,17 +344,19 @@ public function LoadView($opt)
$sql = new sql;
global $user;
$u=0;
echo '<div id="link">';
$text = '';
$text.= '<div id="link">';
while($row=$sql->fetch($opt))
{
$name = $this->GetNameByGUID(intval($row['guid']));
if($user['gmlevel'] >= $cfg->get("mingm"))
$name = '<a href="'.$cfg->get("LinkPlayer").intval($row['guid']).'">'.$name.'</a>';
echo '<div id="unic'.$u.'"><a href="javascript:viewdiv('.$u.')"><span style="position:relative;top:2px;" title="Просмотр"><img src="img/lens.png"></a></span> ['.$name.'] <a target="_blank" href="'.$row['link'].'">'.$row['name'].'</a><br></div>';
echo '<div id="save'.$u.'" style="display:none;">'.$row['method'].'^'.$row['guid'].'^'.$row['type'].'^'.$row['subtype'].'^'.$row['map'].'^'.$row['zone'].'^'.$row['name'].'^'.$row['link'].'</div>';
$text.= '<div id="unic'.$u.'"><a href="javascript:viewdiv('.$u.')"><span style="position:relative;top:2px;" title="Просмотр"><img src="img/lens.png"></a></span> ['.$name.'] <a target="_blank" href="'.$row['link'].'">'.$row['name'].'</a><br></div>';
$text.= '<div id="save'.$u.'" style="display:none;">'.$row['method'].'^'.$row['guid'].'^'.$row['type'].'^'.$row['subtype'].'^'.$row['map'].'^'.$row['zone'].'^'.$row['name'].'^'.$row['link'].'</div>';
$u++;
}
echo '</div>';
$text.= '</div>';
return $text;
}

public function AccountRepass($acc,$code)
Expand Down

0 comments on commit ee3cf93

Please sign in to comment.