function GetFriends($var, $gm) { global $tbl_role_all_detail; echo "<h1>{$tbl_role_all_detail['16']}</h1>\n"; ReturnAndBack(); Reload(); $role_id = ArgRoleId(); echo "<table class='list_table'>\n"; echo sprintf("<tr><td>{$tbl_role_all_detail['18']}</td></tr>\n", ArgRoleName() . "(" . $role_id . ")"); echo "</table>\n"; global $tbl_role_friends, $tbl_camp, $tbl_class, $tbl_sex, $tbl_sys_msg; $serverid = $var["serverid"]; if (!$role_id) { return true; } echo "<h1>" . $tbl_role_friends[0] . "</h1>\n"; echo "<table class='list_table'>\n"; printf("<tr><th>%s</th><th>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th></tr>\n", $tbl_role_friends[1][0], $tbl_role_friends[1][1], $tbl_role_friends[1][2], $tbl_role_friends[1][3], $tbl_role_friends[1][4], $tbl_role_friends[1][5]); $rs = MySQLQuery("select c.c_sName, cs.cs_uCamp, cs.cs_uClass, cb.cb_uLevel, cs.cs_uSex, fc.fc_sName from tbl_player_friends pf, tbl_friends_class fc, tbl_char c, tbl_char_basic cb, tbl_char_static cs where pf.fc_uId = fc.fc_uId and pf.cs_uId = fc.cs_uId and pf.pf_uFriendId = c.cs_uId and fc.fc_uId<>2 and pf.cs_uId='{$role_id}' and cb.cs_uId = c.cs_uId and cs.cs_uId = c.cs_uId", "Game", $serverid); while ($row = mysql_fetch_row($rs)) { if ($row[5] == UTF82Local($tbl_role_friends[1][6])) { $row[5] = $tbl_role_friends[1][6]; } printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $row[5], $row[0], $tbl_camp[$row[1]], $tbl_class[$row[2]], $row[3], $tbl_sex[$row[4]]); } echo "</table>\n"; echo "<h1>" . $tbl_role_friends[2] . "</h1>\n"; echo "<table class='list_table'>\n"; printf("<tr><th>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th><th style='width:100px;'>%s</th></tr>\n", $tbl_role_friends[3][0], $tbl_role_friends[3][1], $tbl_role_friends[3][2], $tbl_role_friends[3][3], $tbl_role_friends[3][4]); $rs = MySQLQuery("select c.c_sName, cs.cs_uCamp, cs.cs_uClass, cb.cb_uLevel, cs.cs_uSex from tbl_player_friends pf, tbl_char c, tbl_char_basic cb, tbl_char_static cs where pf.pf_uFriendId = c.cs_uId and pf.cs_uId='{$role_id}' and pf.fc_uId=2 and cb.cs_uId = c.cs_uId and cs.cs_uId = c.cs_uId", "Game", $serverid); while ($row = mysql_fetch_row($rs)) { printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $row[0], $tbl_camp[$row[1]], $tbl_class[$row[2]], $row[3], $tbl_sex[$row[4]]); } echo "</table>\n"; echo "<h1>" . $tbl_role_friends[4] . "</h1>\n"; echo "<table class='list_table'>\n"; printf("<tr><th>%s</th><th>%s</th><th>%s</th></tr>\n", $tbl_role_friends[5][0], $tbl_role_friends[5][1], $tbl_role_friends[5][2]); $rs = MySQLQuery("select fg.fg_sName,gm1.gm_uIdentity,count(*) from tbl_group_manager gm1,tbl_group_manager gm2,tbl_friends_group fg where gm1.cs_uId='{$role_id}' and gm1.fg_uId = gm2.fg_uId and gm1.fg_uId = fg.fg_uId group by gm2.fg_uId", "Game", $serverid); while ($row = mysql_fetch_row($rs)) { printf("<tr><td>%s</td><td>%s</td><td>%d</td></tr>\n", $row[0], $tbl_role_friends[5][3][intval($row[1])], $row[2]); } echo "</table>\n"; echo "<h1>" . $tbl_role_friends[6] . "</h1>\n"; echo "<table class='list_table'>\n"; printf("<tr><th>%s</th><th>%s</th><th>%s</th></tr>\n", $tbl_role_friends[7][0], $tbl_role_friends[7][1], $tbl_role_friends[7][2]); $rs = MySQLQuery("select t.t_sName, mt1.mt_sPosition, count(*) from tbl_member_tong mt1, tbl_tong t, tbl_member_tong mt2 where mt1.t_uId = t.t_uId and t.t_uId = mt2.t_uId and mt1.cs_uId = '{$role_id}' group by t.t_uId", "Game", $serverid); while ($row = mysql_fetch_row($rs)) { global $tbl_tong_pos; printf("<tr><td>%s</td><td>%s</td><td>%d</td></tr>\n", $row[0], $tbl_tong_pos[intval($row[1])], $row[2]); } echo "</table>\n"; return true; }
function GetFinishedTask($var, $gm) { $role_name = ArgRoleName(); get_task_info($role_name, 3, "q_tFinishTime", $var); return true; }
function GetRoleAllDetail($var, $gm) { global $tbl_role_all_detail, $tbl_sys_msg; $serverid = $var["serverid"]; $js_str = <<<_js_str <script type="text/javascript"> function toItem(){ \tdocument.form1.action_name.value = "201"; \tdocument.form1.submit(); } function toFriend(){ \tdocument.form1.action_name.value = "199"; \tdocument.form1.submit(); } function toRealTime(){ \tdocument.form1.action_name.value = "204"; \tdocument.form1.submit(); } </script> _js_str; echo $js_str . "\n"; echo "<h1>{$tbl_role_all_detail['10']}</h1>\n"; ReturnAndBack(); Reload(); form($var, $gm); $role_id = ArgRoleId(); echo "<input type='hidden' name='role_str' value='" . $var["role_str"] . "'/>"; echo "<input type='hidden' name='role_item' value='" . $var["role_item"] . "'/>"; echo "<table class='list_table'>\n"; echo sprintf("<tr><td>{$tbl_role_all_detail['0']}</td></tr>\n", ArgRoleName() . "(" . $role_id . ")"); echo "<tr><td><a href='#' onclick='toItem()'>{$tbl_role_all_detail['15']}</a></td></tr>\n"; echo "<tr><td><a href='#' onclick='toFriend()'>{$tbl_role_all_detail['16']}</a></td></tr>\n"; echo "</table>\n"; echo "</form>\n"; echo "<h2>{$tbl_role_all_detail['1']}</h2>\n" . GetRoleDetail($role_id, $serverid); echo "<h2>{$tbl_role_all_detail['19']}</h2>\n" . GetRoleLogin($role_id, $serverid); echo "<h2>{$tbl_role_all_detail['2']}</h2>\n" . GetRoleLocation($role_id, $serverid); echo "<h2>{$tbl_role_all_detail['11']}</h2>\n" . GetRoleSort($role_id, $serverid); echo "<h2>{$tbl_role_all_detail['12']}</h2>\n" . GetRoleAppellation($role_id, $serverid); echo "<h2>{$tbl_role_all_detail['6']}</h2>\n" . GetRoleSkill($role_id, $serverid); return true; }
function RoleSearch($var, $gm) { global $tbl_role_search, $tbl_class, $tbl_camp, $tbl_sys_msg, $page_main; if ($var["serverindex"] == "") { echo "<script type=\"text/javascript\" src=\"/js/checkbox.js\" ></script>\n"; echo "<script type=\"text/javascript\" src=\"/js/page.js\" ></script>\n"; $js_str = <<<_js_str <script type="text/javascript"> function OnClick(role_name,obj){ \tdocument.form1.target = "_self"; \tdocument.form1.serverid.value = \$(obj).parents(".panel").attr("id").substring(4); \tdocument.form1.action_name.value = '97'; \tdocument.form1.role_name.value = role_name; \tdocument.form1.submit(); } </script> _js_str; echo $js_str; form($var, $gm); echo "<input type='hidden' name='role_name' />\n"; echo "<h1>" . $tbl_role_search[0] . "</h1>\n"; checkbox(false, true); ReturnAndBack(); $ret = eachServerFrame($var, $gm); ReturnAndBack(); echo "</form>\n"; return $ret; } $role_name = ArgRoleName(); $serv_id = $var["serverindex"]; $query = "select c.c_sName, us.us_sName, cb.cb_uLevel, ifnull(co_uOnServerId,0), cs.cs_uClass, cs.cs_uCamp, cs.cs_dtCreateDate, co.co_dtLastLoginTime from tbl_char c, tbl_char_static cs, tbl_user_static us, tbl_char_basic cb, tbl_char_onlinetime co left join tbl_char_online con on con.cs_uId = co.cs_uId where c.cs_uId = cs.cs_uId and cs.us_uId = us.us_uId and cs.cs_uId = cb.cs_uId and cs.cs_uId = co.cs_uId and c.c_sName like '%{$role_name}%'"; page($var, $query, 193, "Game", $serv_id, $result, $page, $desc); echo $desc; echo "<table class='list_table'>\n"; echo "<tr><th style=\"text-align:left;\"><input type=\"checkbox\" onclick=\"checkboxAll(this,'role')\" />" . $page_main["role_name"] . "</th>\n<th style=\"text-align:left;\"><input type=\"checkbox\" onclick=\"checkboxAll(this,'user')\" />" . $page_main["user_name"] . "</th>\n<th>" . $page_main["level"] . "</th>\n<th>" . $tbl_sys_msg["online"] . "/" . $tbl_sys_msg["offline"] . "</th>\n<th>" . $tbl_sys_msg["class"] . "</th>\n<th>" . $page_main["camp"] . "</th><th>" . $tbl_sys_msg["CreateTime"] . "</th><th>" . $tbl_sys_msg["LastLoginTime"] . "</th></tr>\n"; while ($row = mysql_fetch_row($result)) { printf("<tr><td><input type=\"checkbox\" onclick=\"Checkbox(this)\" flag=\"role\" value='%s' /><a href='#' onclick='OnClick(\"%s\",this)'>%s</a></td><td><input type=\"checkbox\" onclick=\"Checkbox(this)\" flag=\"user\" value='%s' />%s</td><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", $row[0], $row[0], $row[0], $row[1], $row[1], $row[2], $row[3] != 0 ? $tbl_sys_msg["online"] : $tbl_sys_msg["offline"], $tbl_class[$row[4]], $tbl_camp[$row[5]], $row[6], $row[7]); } echo $page; echo "</table>\n"; return true; }
function TalkWithRole($var, $gm) { $role_name = ArgRoleName(); $serverid = $var["serverid"]; global $tbl_talk; $result = MySQLQuery("select last_update from tbl_talk_log where role_name='" . $role_name . "' and serverid=" . $serverid, "GMS"); $last_update = mysql_fetch_row($result); $last_update = $last_update[0]; if ($last_update == "") { $last_update = 0; } echo '<style>' . "\n"; echo '#win table {width: 100% !important;}' . "\n"; echo '</style>' . "\n"; echo '<script>' . "\n"; echo '$(function(){more_new();setInterval("more_new()",30000);});' . "\n"; echo 'function more_new(){' . "\n"; echo ' $.ajax({' . "\n"; echo ' type:"get",' . "\n"; echo ' url:"/cgi-bin/gm_tools/FrameWork.php?rand="+new Date().getTime(),' . "\n"; echo ' data:encodeURI("UID=' . $var["UID"] . '&gameId=' . $var["gameId"] . '&action_name=160&role_name=' . $role_name . '&serverid=' . $serverid . '&date="+$("#new_date").val()+"&type=next&c="+$("#ce").val()),' . "\n"; echo ' success:function(msg){' . "\n"; echo ' var bb = msg.indexOf("<|");' . "\n"; echo ' var be = msg.indexOf("|>");' . "\n"; echo ' var cb = msg.indexOf("<||");' . "\n"; echo ' var ce = msg.indexOf("||>");' . "\n"; echo ' $("#new_date").val(msg.substring(bb+2,be));' . "\n"; echo ' $("#win").append(msg.substring(be+2,cb));' . "\n"; echo ' $("#ce").val(msg.substring(cb+3,ce));' . "\n"; echo ' }' . "\n"; echo ' });' . "\n"; echo '}' . "\n"; echo 'function more_older(){' . "\n"; echo ' $.ajax({' . "\n"; echo ' type:"get",' . "\n"; echo ' url:"/cgi-bin/gm_tools/FrameWork.php?rand="+new Date().getTime(),' . "\n"; echo ' data:encodeURI("UID=' . $var["UID"] . '&gameId=' . $var["gameId"] . '&action_name=160&role_name=' . $role_name . '&serverid=' . $serverid . '&date="+$("#old_date").val()+"&type=prev&c="+$("#cb").val()),' . "\n"; echo ' success:function(msg){' . "\n"; echo ' var bb = msg.indexOf("<|");' . "\n"; echo ' var be = msg.indexOf("|>");' . "\n"; echo ' var cb = msg.indexOf("<||");' . "\n"; echo ' var ce = msg.indexOf("||>");' . "\n"; echo ' $("#old_date").val(msg.substring(bb+2,be));' . "\n"; echo ' $("#win").html(msg.substring(be+2,cb)+$("#win").html());' . "\n"; echo ' $("#cb").val(msg.substring(cb+3,ce));' . "\n"; echo ' }' . "\n"; echo ' });' . "\n"; echo '}' . "\n"; echo 'function send(){' . "\n"; echo ' $.ajax({' . "\n"; echo ' type:"post",' . "\n"; echo ' url:"/cgi-bin/gm_tools/FrameWork.php?rand="+new Date().getTime(),' . "\n"; echo ' data:encodeURI("UID=' . $var["UID"] . '&gameId=' . $var["gameId"] . '&action_name=30&role_name=' . $role_name . '&serverid=' . $serverid . '&warning="+$("textarea").val()+"&reason=' . $tbl_talk["reason"] . '"),' . "\n"; echo ' success:function(msg){' . "\n"; echo ' more_new();' . "\n"; echo ' }' . "\n"; echo ' });' . "\n"; echo '}' . "\n"; echo '</script>' . "\n"; echo '<input type="hidden" id="old_date" value="' . $last_update . '" />' . "\n"; echo '<input type="hidden" id="new_date" value="' . $last_update . '" />' . "\n"; echo '<input type="hidden" id="cb" value="0" />' . "\n"; echo '<input type="hidden" id="ce" value="1" />' . "\n"; echo '<div id="win" style="border:1px solid #ccc; width:703px; height:300px; overflow: scroll;"></div>' . "\n"; echo '<table style="width:705; border:1px solid #ccc; border-top:0px;">' . "\n"; echo ' <tr>' . "\n"; echo ' <td><textarea style="width:100%; height:100%;"></textarea></td>' . "\n"; echo ' <td style="width:150px;">' . "\n"; echo ' <button style="width:150px;" onclick="send()">' . $tbl_talk["send"] . '</button>' . "\n"; echo ' <button style="width:150px;" onclick="more_new()">' . $tbl_talk["reflesh"] . '</button>' . "\n"; echo ' <button style="width:150px;" onclick="more_older()">' . $tbl_talk["older"] . '</button>' . "\n"; echo ' </td>' . "\n"; echo ' </tr>' . "\n"; echo '</table>' . "\n"; return true; }