function display_cart($cart) { $cell_colour = "#DDFFFF"; table_start(); table_row_start(); table_cell('<b>Product</b>', $cell_colour); table_cell('<b>Quantity</b>', $cell_colour); table_cell('<b>Price</b>', $cell_colour); table_row_end(); $total = 0; foreach ($cart->item as $value) { table_row_start(); table_cell($value->description); table_cell($value->quantity); table_cell($value->price * $value->quantity); $total += $value->price * $value->quantity; table_row_end(); } table_row_start(); table_cell(''); table_cell('<b> Total </b>', $cell_colour); table_cell("<b>{$total}<b>", $cell_colour); table_row_end(); table_end(); }
function display_orders($status) { $warehouse = SCA::getService('../WarehouseService/WarehouseService.php'); $orders = $warehouse->getOrdersByStatus($status); if (count($orders->order) == 0) { echo "None\n"; return; } include_once "./table.php"; table_start(); table_row_start(); table_cell('<b>Order ID</b>', '#DDDDFF'); table_cell('<b>Name</b>', '#DDDDFF'); table_cell('<b>Status</b>', '#DDDDFF'); table_row_end(); $odd = false; foreach ($orders->order as $order) { table_row_start(); if (!$odd) { table_cell("<a href=\"./order_details.php?orderId=" . $order->orderId . "\">" . $order->orderId . "</a>"); table_cell(isset($order->customer->name) ? $order->customer->name : 'no name supplied'); table_cell($order->status); } else { table_cell("<a href=\"./order_details.php?orderId=" . $order->orderId . "\">" . $order->orderId . "</a>", '#DDFFFF'); table_cell(isset($order->customer->name) ? $order->customer->name : 'no name supplied', '#DDFFFF'); table_cell($order->status, '#DDFFFF'); } $odd = !$odd; table_row_end(); } table_end(); }
function overview() { global $uid; $sth = mysql_query("select b.prod_id,b.count,b.side,p.name,p.typ,b.initiative,b.agility,b.hull,b.weaponpower,b.shield,b.ecm,b.target1,b.sensor,b.weaponskill,b.special,b.armor,b.num_attacks,s.initiative,s.agility,s.hull,s.weaponpower,s.shield,s.ecm,s.target1,s.sensor,s.weaponskill,s.special,s.armor,s.num_attacks from battle_" . $uid . " b, production p, shipvalues s where b.prod_id=p.prod_id and b.prod_id=s.prod_id order by side"); echo "<form action=\"" . $_SERVER["PHP_SELF"] . "\" method=\"POST\">"; table_start("center", "700"); table_head_text(array("Battlesimulator"), 20); if (!$sth || mysql_num_rows($sth) == 0) { table_text(array("No ships"), "", "", "", "text"); } else { table_head_text(array("Side", "Name", "Type", "count", "initiative", "agility", "hull", "power", "shield", "ecm", "target1", "sensors", "skill", "special", "armor", "num_attacks", "mail")); while (list($prod_id, $count, $side, $name, $typ, $cur_ini, $cur_agi, $cur_hull, $cur_pow, $cur_shield, $cur_ecm, $cur_tar1, $cur_sen, $cur_skill, $cur_spec, $cur_arm, $cur_num, $ini, $agi, $hull, $pow, $shield, $ecm, $tar1, $sen, $skill, $spec, $arm, $num) = mysql_fetch_row($sth)) { table_text(array($side, $name, $typ, "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][count]\" size=\"4\" value=\"" . $count . "\">", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][initiative]\" size=\"3\" value=\"" . $cur_ini . "\"> (" . $ini . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][agility]\" size=\"3\" value=\"" . $cur_agi . "\"> (" . $agi . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][hull]\" size=\"3\" value=\"" . $cur_hull . "\"> (" . $hull . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][weaponpower]\" size=\"3\" value=\"" . $cur_pow . "\"> (" . $pow . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][shield]\" size=\"3\" value=\"" . $cur_shield . "\"> (" . $shield . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][ecm]\" size=\"3\" value=\"" . $cur_ecm . "\"> (" . $ecm . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][target1]\" size=\"3\" value=\"" . $cur_tar1 . "\"> (" . $tar1 . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][sensor]\" size=\"3\" value=\"" . $cur_sen . "\"> (" . $sen . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][weaponskill]\" size=\"3\" value=\"" . $cur_skill . "\"> (" . $skill . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][special]\" size=\"3\" value=\"" . $cur_spec . "\"> (" . $spec . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][armor]\" size=\"3\" value=\"" . $cur_arm . "\"> (" . $arm . ")", "<input type=\"text\" name=\"battle[" . $side . "][" . $prod_id . "][num_attacks]\" size=\"3\" value=\"" . $cur_num . "\"> (" . $num . ")", "<a href=\"" . $_SERVER["PHP_SELF"] . "?act=suggest&side=" . $side . "&prod_id=" . $prod_id . "\">suggest change</a>"), "", "", "", "text"); } } table_form_submit("Change", "proc_change_values"); table_end(); echo "</form>"; $sth = mysql_query("select prod_id,name from production where typ in ('L','M','H','I') \norder by name"); if (!$sth) { show_error("database failersdfiosd"); return false; } echo "<form action=\"" . $_SERVER["PHP_SELF"] . "\" method=\"POST\">"; table_start("center", "500"); table_head_text(array("Add ships"), "2"); while (list($prod_id, $name) = mysql_fetch_row($sth)) { $select[$name] = $prod_id; } table_form_select("Ship", "prod_id", $select, "2", "text", "text"); table_form_select("Side", "side", array(1 => 1, 2 => 2), "2", "text", "text"); table_form_text("Count", "count"); table_form_submit("Add ships", "proc_add_ships"); table_end(); echo "</form>"; echo "<br>"; echo "<form action=\"" . $_SERVER["PHP_SELF"] . "\" method=\"POST\">"; table_start("center", "500"); table_head_text(array("Config"), "2"); table_form_select("Combat rounds", "rounds", array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 10 => 10), "1", "text", "text"); table_form_select("Fraction limit", "fraction", array(100 => 100, 250 => 250, 500 => 500, 1000 => 1000, 2000 => 2000, "no limit" => 0), "250", "text", "text"); table_form_select("Orbital Dig-In factor (Side 1)", "digino", array("no dig-in" => 0, 20 => 20, 40 => 40, 60 => 60, 65 => 65, 70 => 70, 75 => 75, 80 => 80, 85 => 85, 90 => 90, 95 => 95, 99 => 99), "0", "text", "text"); table_form_select("Orbital Dig-In bonus (Side 1)", "diginob", array("no bonus" => 0, 5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 55 => 55), "0", "text", "text"); table_form_select("Planetary Dig-In factor (Side 1)", "diginp", array("no dig-in" => 0, 20 => 20, 40 => 40, 60 => 60, 65 => 65, 70 => 70, 75 => 75, 80 => 80, 85 => 85, 90 => 90, 95 => 95, 99 => 99), "70", "text", "text"); table_form_select("Planetary Dig-In bonus (Side 1)", "diginpb", array("no bonus" => 0, 5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 55 => 55), "20", "text", "text"); table_form_select("Overall combat boost", "boost", array("no boost" => 1, 2 => 2, 3 => 3, 5 => 5), "1", "text", "text"); table_form_select("Verbosity", "verbosity", array("Results only" => 0, "Overview" => 1, "Full details" => 2), "1", "text", "text"); table_form_submit("Execute battle", "execute_battle"); table_end(); echo "</form>"; //print "<a href=\"".$_SERVER["PHP_SELF"]."?act=execute_battle\">Execute battle</a>"; }
function display_customer_form() { $customer_labels = array('Name'); $address_labels = array('Street', 'City', 'State', 'Zip'); $payment_labels = array('Bank', 'Account', 'SecurityCode'); echo '</br><b>Enter your details:</b></br></br>'; echo '<form method=POST action="submit_order.php">'; table_start(); display_form($customer_labels); display_form($address_labels); display_form($payment_labels); table_end(); echo '<input type=submit name="Order" value="Submit Order"/></br>'; echo '</form>'; }
function display_catalog($catalog) { table_start(); table_row_start(); table_cell('Product'); table_cell('Price'); table_row_end(); foreach ($catalog->item as $value) { table_row_start(); table_cell('<a href="view_product.php?product_code=' . $value->itemId . '">' . $value->description . '</a>'); table_cell($value->price); table_row_end(); } table_end(); }
function display_events($events) { include_once "table.php"; table_start(); table_row_start(); table_cell('<b>Date</b>', '#DDDDFF'); table_cell('<b>Status</b>', '#DDDDFF'); table_cell('<b>Description</b>', '#DDDDFF'); table_row_end(); foreach ($events->event as $event) { table_row_start(); table_cell($event->timeStamp); table_cell($event->status); table_cell($event->description); table_row_end(); } table_end(); }
function newaiinit($fields, $mode) { global $common_html, $html_etc; global $return_sql_line, $db; global $action_add, $action_model; global $_POST, $_GET, $ROWS_PAGE, $mark; global $merge, $childnums, $childsums, $child_filter; global $SYSTEM_ADD_SQL; $fields = newaiinit_value($fields); if ($merge) { $fields = newai_merge($fields, $merge); } if ($childnums) { $fields = newai_childnums($fields, $childnums); } if ($childsums) { $fields = newai_childsums($fields, $childsums); } global $tablewidth; $tablewidth = $tablewidth != "" ? $tablewidth : 450; //增加对高级搜索支持 if ($_GET['actionadv'] == "exportadv_default") { newai_search($fields); } table_begin($tablewidth); show_search_element($mark); //“新建”按钮查询按钮的控制函数,此函数在newai.php中定义 newaiinit_view($fields); UserDefineFunction(); UserSumFunction($fields); //print_R($_REQUEST); if ($_GET['action'] == "") { $_GET['action'] = "init_default"; } if ($_REQUEST['action'] != "") { $_GET['action'] = $_REQUEST['action']; } //print_R($_GET); newaiinit_bottommemo(); newaiinit_bottom($fields['other']['rc'], $fields['other']['pageid'], $fields['other']['pagenums'], $ROWS_PAGE, $add = 'action', $add_var = $_GET['action']); table_end(); }
function print_table_end() { table_end(); }
function show_stock_ticker() { global $uid; $sth = mysql_query("SELECT time, message FROM stockmarket_ticker WHERE uid=" . $uid . " ORDER BY time"); if (!$sth) { show_error("ERROR::GET TRADE TICKER"); return false; } if (mysql_num_rows($sth) == 0) { table_start("center", 500); table_text(array("Trade Ticker"), "", "", "", "head"); table_text(array("No transactions"), "", "", "", "text"); table_end(); } else { table_start("center", 500); table_text(array("Trade Ticker"), "", "", "2", "head"); while ($ticker = mysql_fetch_row($sth)) { table_text(array($ticker[0], $ticker[1]), "", "", "", "text"); } table_end(); echo "<br />\n"; $sth = mysql_query("DELETE FROM stockmarket_ticker WHERE uid=" . $uid); if (!$sth) { show_error("ERROR::GET DELETE TICKER"); return false; } } }
function print_actorresults($results) { table_start('Actor Results'); foreach ($results as $actor) { echo ' <li>', filter_var($actor->getName(), FILTER_SANITIZE_STRING), ' (<a href="https://www.themoviedb.org/person/', $actor->getID(), '">', $actor->getID(), '</a>)</li>'; print "\n"; } table_end(); }
function show_menu() { global $PHP_SELF; global $skin; center_headline("Communications"); table_start("center", "500"); table_text_open("", "center"); table_text_design("<a href=\"communication.php?act=show_alliance\"><img src=\"skins/" . $skin . "_alliance.jpg\" border=\"0\" width=\"50\" height=\"50\" alt=\"Alliance Menu\"></A>", "163", "center"); table_text_design("<a href=\"database.php\"><img src=\"skins/" . $skin . "_database.jpg\" border=\"0\" width=\"50\" height=\"50\" alt=\"Galactic Database\"></A>", "163", "center"); table_text_design("<a href=\"communication.php?act=show_journal\"><img src=\"skins/" . $skin . "_notebook.jpg\" border=\"0\" width=\"50\" height=\"50\" alt=\"Personal journal\"></A>", "163", "center"); table_text_design("<a href=\"mail.php\"><img src=\"skins/" . $skin . "_mail.jpg\" border=\"0\" width=\"50\" height=\"50\" alt=\"Mailbox\"></A>", "164", "center"); table_text_close(); table_text_open(""); table_text_design("Alliance Menu", "", "center"); table_text_design("Galactic Database", "", "center"); table_text_design("Journal", "", "center"); table_text_design("Mailbox", "", "center"); table_text_close(); table_end(); echo "<br><br>\n"; }
function BaseStatistics($showlistfieldlist1Array, $action_model_2) { global $html_etc, $common_html, $tablename, $tabletitle; global $db, $columns; global $_POST, $_GET, $primarykey_index; //获取系统显示的色彩信息 $ColorArray = returnColorArray(); //初始化信息 $USER_Field = $showlistfieldlist1Array[0]; $DEPT_Field = $showlistfieldlist1Array[1]; $DATE_Field = $showlistfieldlist1Array[2]; $FIELD_Field = $showlistfieldlist1Array[3]; $FIELD_LIST = explode(':', $FIELD_Field); $Action_Model = $FIELD_LIST[0]; switch ($Action_Model) { case 'NUM': //array_shift($FIELD_LIST); $SQL_Text = "Count({$FIELD_LIST['1']}) AS Number"; break; case 'SUM': break; } $_GET['Year'] == "" ? $_GET['Year'] = Date("Y") : ''; $Year = $_GET['Year']; if ($DATE_Field == "BaoBeiDate") { $SQL_ADD1 = "IsFor AS IsFor,"; $SQL_ADD2 = ",IsFor"; $SQL_ADD3 = " and IsFor = 'on' "; $SQL_ADD4 = ""; } else { $SQL_ADD1 = ""; $SQL_ADD2 = ""; $SQL_ADD3 = ""; $SQL_ADD4 = ""; } $sql = "select Date_Format({$DATE_Field},'%Y-%c') AS Date,\n\t\tDate_Format({$DATE_Field},'%Y') AS Year,\n\t\t\t{$SQL_ADD1}\n\t\t\t{$SQL_Text},\n\t\t\t{$USER_Field} AS USER_Field,\n\t\t\t{$DEPT_Field} AS DEPT_Field\n\t\t\tfrom {$tablename}\n\t\t\tgroup by {$DATE_Field},{$USER_Field},{$DEPT_Field} {$SQL_ADD2}\n\t\t\thaving Year='{$Year}' {$SQL_ADD3}\n\t\t\torder by DEPT_Field\n\t\t\t"; // having CommunicationNeeds_SureDate != null //$SQL = "select Date_Format($fieldName,'%c') AS $fieldName,Sum($sum_index) as sum,Count($fieldName) as num from $tablename group by $fieldName"; //print $sql; $rs = $db->CacheExecute(150, $sql); $rs_a = $rs->GetArray(); for ($i = 0; $i < sizeof($rs_a); $i++) { $list = $rs_a[$i]; $DateValue = $list['Date']; $UserValue = $list['USER_Field']; $DeptValue = $list['DEPT_Field']; $NewArray['USER'][$UserValue][$DateValue] += $list['Number']; $NewArray['DEPT'][$DeptValue][$DateValue] += $list['Number']; $NewArray['DEPT_YEAR'][$DeptValue][$Year] += $list['Number']; $NewArray['USER_YEAR'][$UserValue][$Year] += $list['Number']; $NewArray['USER_DEPT'][$UserValue] = $DeptValue; } //print_R($NewArray['DEPT']); table_begin("900"); $Title_URL .= "<font color=white title='客户信息统计:" . $Year . "年'>客户信息统计:" . $Year . "年</font> "; $Title_URL .= " \n\t\t\t\t<a href=\"?Year=" . ($Year - 1) . "&action_model={$action_model_2}\" title=\"点击此按钮,来确定不同的年份进行统计\"><img src=\"../../Framework/images/arrow_l.gif\" border></a>\n\t\t\t\t<a href=\"?Year=" . ($Year + 1) . "&action_model={$action_model_2}\" title=\"点击此按钮,来确定不同的年份进行统计\"><img src=\"../../Framework/images/arrow_r.gif\" border></a>\n\t\t\t\t"; print_title("<font color=white title='按 \"" . $html_etc[$tablename][$DATE_Field . "_STS"] . "\" 进行信息统计'>[" . $html_etc[$tablename][$DATE_Field . "_STS"] . "]</font>" . $Title_URL, 15); //标题栏--用户区域 print "<TR class=TableContent>\n"; print "<TD nowrap title='用户列表'>用户列表</TD>\n"; for ($i = 1; $i <= 12; $i++) { $HeaderName = Date("Y-n", mktime(0, 0, 0, $i, Date("d"), $Year)); print "<TD nowrap title='显示" . $HeaderName . "月份数据统计信息'>{$HeaderName}</TD>\n"; } print "<TD nowrap>" . $Year . "年</TD>\n"; print "</TR>\n"; //数据区域--用户区域 $USER_LIST = @array_keys($NewArray['USER']); for ($i = 0; $i < sizeof($USER_LIST); $i++) { $USER_TEXT = $USER_LIST[$i]; $DEPT_TEXT = $NewArray['USER_DEPT'][$USER_TEXT]; $USER_TEXT_NAME = returntablefield("user", "USER_NAME", $USER_TEXT, "NICK_NAME"); $DEPT_TEXT_NAME = returntablefield("department", "DEPT_ID", $DEPT_TEXT, "DEPT_NAME"); print "<TR class=TableContent>\n"; print "<TD nowrap class=TableData><font color=black title=\"" . $USER_TEXT_NAME . "一年统计数量:" . $NewArray['USER_YEAR'][$USER_TEXT][$Year] . "\">" . $USER_TEXT_NAME . "[" . $DEPT_TEXT_NAME . "]</font> </TD>\n"; for ($k = 1; $k <= 12; $k++) { $HeaderName = Date("Y-n", mktime(0, 0, 0, $k, Date("d"), $Year)); $HeaderName2 = Date("Y-m", mktime(0, 0, 0, $k, Date("d"), $Year)); if ($NewArray['USER'][$USER_TEXT][$HeaderName] != "") { $base64_string = "action=init_default_search&searchvalue={$HeaderName2}&searchfield={$DATE_Field}&{$USER_Field}={$USER_TEXT}"; $base64_url = base64_encode($base64_string); $Element = "<a href=\"crm_customer_newai.php?{$base64_url}\" target=_blank>" . $NewArray['USER'][$USER_TEXT][$HeaderName] . "</a>"; } else { $Element = ""; } print "<TD nowrap class=TableData>" . $Element . " </TD>\n"; } if ($NewArray['USER_YEAR'][$USER_TEXT][$Year] != "") { $base64_string = "action=init_default_search&searchvalue={$Year}&searchfield={$DATE_Field}&{$USER_Field}={$USER_TEXT}"; $base64_url = base64_encode($base64_string); $Element = "<a href=\"crm_customer_newai.php?{$base64_url}\" target=_blank>" . $NewArray['USER_YEAR'][$USER_TEXT][$Year] . "</a>"; } else { $Element = ""; } print "<TD nowrap class=TableData><font color=black title='" . $USER_TEXT_NAME . "用户" . $Year . "年客户数量:" . $NewArray['USER_YEAR'][$USER_TEXT][$Year] . "'>" . $Element . "</font> </TD>\n"; print "</TR>\n"; } //标题栏--部门区域 print "<TR class=TableContent>\n"; print "<TD nowrap title='部门列表'>部门列表</TD>\n"; for ($i = 1; $i <= 12; $i++) { $HeaderName = Date("Y-n", mktime(0, 0, 0, $i, Date("d"), $Year)); print "<TD nowrap title='显示" . $HeaderName . "月份数据统计信息'>{$HeaderName}</TD>\n"; } print "<TD nowrap>" . $Year . "年</TD>\n"; print "</TR>\n"; //数据区域--部门区域 $DEPT_LIST = @array_keys($NewArray['DEPT']); for ($i = 0; $i < sizeof($DEPT_LIST); $i++) { $DEPT_TEXT = $DEPT_LIST[$i]; $DEPT_TEXT_NAME = returntablefield("department", "DEPT_ID", $DEPT_TEXT, "DEPT_NAME"); print "<TR class=TableContent>\n"; print "<TD nowrap class=TableData><font color=black title=\"" . $DEPT_TEXT_NAME . "一年统计数量:" . $NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] . "\">" . $DEPT_TEXT_NAME . "[" . $NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] . "]</font> </TD>\n"; for ($k = 1; $k <= 12; $k++) { $HeaderName = Date("Y-n", mktime(0, 0, 0, $k, Date("d"), $Year)); $HeaderName2 = Date("Y-m", mktime(0, 0, 0, $k, Date("d"), $Year)); if ($NewArray['DEPT'][$DEPT_TEXT][$HeaderName] != "") { $base64_string = "action=init_default_search&searchvalue={$HeaderName2}&searchfield={$DATE_Field}&{$DEPT_Field}={$DEPT_TEXT}"; $base64_url = base64_encode($base64_string); $Element = "<a href=\"crm_customer_newai.php?{$base64_url}\" target=_blank>" . $NewArray['DEPT'][$DEPT_TEXT][$HeaderName] . "</a>"; } else { $Element = ""; } print "<TD nowrap class=TableData>" . $Element . " </TD>\n"; } if ($NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] != "") { $base64_string = "action=init_default_search&searchvalue={$Year}&searchfield={$DATE_Field}&{$DEPT_Field}={$DEPT_TEXT}"; $base64_url = base64_encode($base64_string); $Element = "<a href=\"crm_customer_newai.php?{$base64_url}\" target=_blank>" . $NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] . "</a>"; } else { $Element = ""; } print "<TD nowrap class=TableData><font color=black title='" . $DEPT_TEXT_NAME . $Year . "年客户数量:" . $NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] . "'>" . $Element . "</font> </TD>\n"; print "</TR>\n"; } //合并说明 print "<TR class=TableContent>\n"; print "<TD nowrap colspan=15 title='如果使用浏览器打印不是太方便的话,可以复制表格数据区到MS EXCEL,然后进行排版打印' class=TableData>报表说明:点击标题栏两个黑色三角箭头,即可实现年份之间的切换 </TD>\n"; print "</TR>\n"; //报表统计主体部分开始 for ($k = 0; $k < sizeof($showlistfieldlistArray); $k++) { $fieldIndex = $showlistfieldlistArray[$k]; $fieldName = $columns[$fieldIndex]; $fieldText = $html_etc[$tablename][$fieldName]; $mode = $showlistfieldfilterArray[$k]; $modeArray = explode(':', $mode); //$rs=$db->CacheExecute(150,$SQL); //$rs_array=$rs->GetArray();//print_R($rs_array); //父表结构部分 //本表操作部分--数据处理部分 --形成FLASH要处理的数据类型 //本表操作部分--FALSH图表显示部分--显示FLASH图表的结果 //本文信息显示部分 //print_title($html_etc[$tablename][$tabletitle]."<font color=green>[".$html_etc[$tablename][$fieldName]."]</font>",40); print "<TR class=TableData>"; print "<TD width=30%>名称</TD>"; print "<TD width=30%>数目</TD>"; print "<TD width=30%>百分比</TD>"; print "<TD width=30%>总记录</TD>"; print "</TR>"; for ($i = 0; $i < sizeof($rs_array); $i++) { $ResultNumber = $rs_array[$i][num]; $ResultSum = $rs_array[$i][sum]; $ResultFieldCode = $rs_array[$i][$fieldName]; $ResultFieldName = returntablefield($tablenameIndex, $WhatIndex, $ResultFieldCode, $ReturnIndex); if ($sum_index != "") { print "<TD noWrap width=15%>统计额度 </TD>"; print "<TD noWrap width=10%><font color=red>" . $ResultSum . " " . $UserUnitFunctionIndex . "</font></TD>"; } print "<TR class=TableData>"; print "<TD >{$ResultFieldName}</TD>"; print "<TD >{$ResultNumber}</TD>"; //print "<TD >".number_format($ResultNumber/$TotalNumberIndex,2,'.','')."</TD>"; print "<TD >" . $TotalNumberIndex . "</TD>"; print "</TR>"; } print "<TR class=TableData>"; print "<TD noWrap colspan = 40>\n"; print " "; print "</TD>"; print "</TR>"; table_end(); print "<BR>"; break; } }
function show_tasks() { page_head("File transfers"); table_start(); table_header(array("ID", "Created", "File", "Local", "Remote", "Status", "Last error")); $tasks = task_enum(); foreach ($tasks as $task) { $store = store_lookup_id($task->local_store_id); table_row(array($task->id, time_str($task->create_time), $task->file_name, $store->name, $task->remote_site . ': ' . $task->remote_store, task_status($task), $task->last_error . ' (' . time_str($task->last_error_time) . ')')); } table_end(); if (count($tasks) == 0) { echo "No tasks"; } page_tail(); }
function newaiCharts() { global $html_etc, $tablename, $common_html, $custom_type; global $db, $return_sql_line, $columns; global $_POST, $_GET, $returnmodel, $primarykey_index; global $action_submit, $merge, $form_attribute; global $tabletitle; global $showlistfieldlist, $showlistfieldfilter, $showlistfieldtype; $showlistfieldlistArray = explode(',', $showlistfieldlist); $showlistfieldfilterArray = explode(',', $showlistfieldfilter); $showlistfieldtypeArray = explode(',', $showlistfieldtype); //获取系统显示的色彩信息 $ColorArray = returnColorArray(); //获取系统求和字段信息 global $sum_index, $UserUnitFunctionIndex; if ($sum_index != "") { $sum_sql_index = " ,sum({$sum_index}) as sum "; } else { $sum_sql_index = ""; } //报表统计主体部分开始 for ($k = 0; $k < sizeof($showlistfieldlistArray); $k++) { $fieldIndex = $showlistfieldlistArray[$k]; $fieldName = $columns[$fieldIndex]; $fieldText = $html_etc[$tablename][$fieldName]; $mode = $showlistfieldfilterArray[$k]; $modeArray = explode(':', $mode); //print_R($modeArray); $modeIndex = $modeArray[0]; $Mode = ""; switch ($modeIndex) { case '': break; case 'tablefilter': case 'tablefiltercolor': case 'radiofilter': case 'radiofiltercolor': if ($modeArray[1] == "month" && $modeArray[2] == "") { $Mode = "Month"; $SQL = "select Date_Format({$fieldName},'%c') AS {$fieldName},Sum({$sum_index}) as sum,Count({$fieldName}) as num from {$tablename} group by {$fieldName}"; } else { if ($modeArray[1] == "year" && $modeArray[2] == "") { $Mode = "Year"; $SQL = "select Date_Format({$fieldName},'%Y') AS {$fieldName},Sum({$sum_index}) as sum,Count({$fieldName}) as num from {$tablename} group by {$fieldName}"; } else { $Mode = ""; $SQL = "select {$fieldName},Count({$fieldName}) as num {$sum_sql_index} from {$tablename} group by {$fieldName}"; } } $rs = $db->CacheExecute(150, $SQL); $rs_array = $rs->GetArray(); //print_R($rs_array); //父表结构部分 $tablenameIndex = $modeArray[1]; $ColumnsIndex = returntablecolumn($tablenameIndex); $html_etcIndex = returnsystemlang($tablenameIndex, $tablenameIndex); $WhatIndex = $ColumnsIndex[(string) $modeArray[2]]; $ReturnIndex = $ColumnsIndex[(string) $modeArray[3]]; //本表操作部分--数据处理部分 --形成FLASH要处理的数据类型 $TotalNumberIndex = 0; $TotalSumIndex = 0; $Array = array(); for ($i = 0; $i < sizeof($rs_array); $i++) { $ResultNumber = $rs_array[$i]['num']; $ResultSum = $rs_array[$i]['sum']; $ResultFieldCode = $rs_array[$i][$fieldName]; switch ($Mode) { case 'Month': $ResultFieldName = $ResultFieldCode . "" . $common_html['common_html']['month']; break; case 'Year': $ResultFieldName = $ResultFieldCode . "" . $common_html['common_html']['year']; break; default: $ResultFieldName = returntablefield($tablenameIndex, $WhatIndex, $ResultFieldCode, $ReturnIndex); if ($ResultFieldName == "") { $ResultFieldName = $ResultFieldCode; } break; } $TotalNumberIndex += $ResultNumber; $TotalSumIndex += $ResultSum; $Array_Statistic_Value = $sum_index != "" ? $ResultSum : $ResultNumber; $Array['XData'][$i]['Name'] = $ResultFieldName; $Array['XData'][$i]['Value'] = $Array_Statistic_Value; $Array['XData'][$i]['Dir'] = $ResultFieldName; $Array['XData'][$i]['AltText'] = $ResultFieldName; //$Array['XData'][$i]['Url'] = "?action=init_customer&$fieldName=$ResultFieldCode"; $ColorArray[$i] == "" ? $ColorArray[$i] = "0xCC0000" : ''; $Array['XData'][$i]['Color'] = $ColorArray[$i]; $Array['Dir'][$i]['Name'] = $ResultFieldName; $Array['Dir'][$i]['Color'] = $ColorArray[$i]; $Array['YData']['AltText'] = "移动查看详细信息"; $Array['YData']['Value'] < $Array_Statistic_Value ? $Array['YData']['Value'] = $Array_Statistic_Value : ''; } $Array['title'] = $html_etc[$tablename][$tabletitle] . "[" . $html_etc[$tablename][$fieldName] . "]"; $array_graphInfo = $Array['title'] . "[" . date("Y-m-d H:i:s") . "] " . $common_html['common_html']['totalrecords'] . ": " . $TotalNumberIndex; if ($sum_index != "") { $array_graphInfo .= " " . $common_html['common_html']['allnumbers'] . ": " . $TotalSumIndex . " " . $UserUnitFunctionIndex . "\n"; } $Array['graphInfo'] = $array_graphInfo; //print_R($FlashFileName); //本表操作部分--FALSH图表显示部分--显示FLASH图表的结果 table_begin("650"); $ChartMode = $showlistfieldtypeArray[$k]; //采用的图表类型选择 //print $tablename; switch ($ChartMode) { case 'vBarF': $FlashFileName = WriteXmlFilevBarF($Array, $tablename, $k); //Flash XML 数据写入文件区 $create_chart = create_chart("vBarF", $FlashFileName); //FLASH 图表读入XML数据处理以后的显示区 break; case 'hBarF': $FlashFileName = WriteXmlFilehBarF($Array, $tablename, $k); //Flash XML 数据写入文件区 $create_chart = create_chart("hBarF", $FlashFileName); //FLASH 图表读入XML数据处理以后的显示区 break; case 'pieF': $FlashFileName = WriteXmlFilePieF($Array, $tablename, $k); //Flash XML 数据写入文件区 $create_chart = create_chart("pieF", $FlashFileName); //FLASH 图表读入XML数据处理以后的显示区 break; default: $FlashFileName = WriteXmlFilevBarF($Array, $tablename, $k); //Flash XML 数据写入文件区 $create_chart = create_chart("vBarF", $FlashFileName); //FLASH 图表读入XML数据处理以后的显示区 break; } //HTML文体显示部分 print "<TR class=TableData>"; print "<TD noWrap width=100% align=center colspan=40>"; print "{$create_chart} </TD>"; print "</TR>"; //本文信息显示部分 //print_title($html_etc[$tablename][$tabletitle]."<font color=green>[".$html_etc[$tablename][$fieldName]."]</font>",40); print_title($html_etc[$tablename][$tabletitle] . "[" . $html_etc[$tablename][$fieldName] . "]", 6); for ($i = 0; $i < sizeof($rs_array); $i++) { $ResultNumber = $rs_array[$i][num]; $ResultSum = $rs_array[$i][sum]; $ResultFieldCode = $rs_array[$i][$fieldName]; $ResultFieldName = returntablefield($tablenameIndex, $WhatIndex, $ResultFieldCode, $ReturnIndex); if ($ResultFieldName == "") { $ResultFieldName = $ResultFieldCode; } print "<TR class=TableData>"; print "<TD noWrap width=15%>统计类别名称 </TD>"; print "<TD width=35%>" . $ResultFieldName . " </TD>"; if ($sum_index != "") { print "<TD noWrap width=15%>统计额度 </TD>"; print "<TD noWrap width=10%><font color=red>" . $ResultSum . " " . $UserUnitFunctionIndex . "</font></TD>"; } else { //print "<TD noWrap width=15%>统计类别代码 </TD>"; //print "<TD noWrap width=10%>".$ResultFieldCode." </TD>"; } print "<TD width=15%>统计记录数 </TD>"; print "<TD noWrap width=10%><font color=red>" . $ResultNumber . " 条</font></TD>"; print "</TR>"; } print "<TR class=TableData>"; print "<TD noWrap colspan = 40>\n"; print $common_html['common_html']['totalrecords'] . ": <font color=red>{$TotalNumberIndex} 条</font>\n"; if ($sum_index != "") { print $common_html['common_html']['allnumbers'] . ": <font color=red>{$TotalSumIndex} " . $UserUnitFunctionIndex . "</font>\n"; } print "</TD>"; print "</TR>"; table_end(); print "<BR>"; break; } } }
function show_info() { global $uid; global $pid; $sth = mysql_query("select * from planets p,popgain g where p.id={$pid} and p.uid={$uid} and p.id=g.pid"); if (!$sth || mysql_num_rows($sth) == 0) { show_error("Jailhouse rock!"); return 0; } center_headline("Information Screen"); $planet = mysql_fetch_assoc($sth); table_border_start("center", "", "#302859", "#100666", "#D2CCF9"); echo "<tr>\n"; echo " <td rowspan=\"14\">\n"; echo " <img src=\"arts/" . $planet["type"] . ".jpg\">\n"; echo " <td>\n"; echo "</tr>\n"; table_head_text(array("Information"), "2"); table_text_open(); table_text_design("Owner", "", "center", "1", "head"); $sth = mysql_query("select u.name,ifnull(a.name,'none') as aname from users u left join alliance a on a.id=u.alliance where u.id=" . $planet["uid"]); if (!$sth || mysql_num_rows($sth) == 0) { show_error("Database failure!"); return 0; } $owner = mysql_fetch_assoc($sth); table_text_design($owner["name"], "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("System", "", "center", "1", "head"); table_text_design(get_systemname($planet["sid"]), "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("Alliance", "", "center", "1", "head"); table_text_design($owner["aname"], "", "center", "1", "text"); table_text_close(); if ($planet["gain"] > 0) { $gain = "<span style=\"color: lime\">+" . $planet["gain"] * 100 . "%</span>"; } else { $gain = "+/-0%"; } table_text_open(); table_text_design("Population", "", "center", "1", "head"); table_text_design(get_poplevel_by_pop($planet["population"]) . " " . $gain . " (" . $planet["max_poplevel"] . ")", "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("Planettype", "", "center", "1", "head"); switch ($planet["type"]) { case "O": $type = "Origin Class"; break; case "M": $type = "Mars Class"; break; case "A": $type = "Ancient Class"; break; case "D": $type = "Desert Class"; break; case "E": $type = "Eden Class"; break; case "G": $type = "Gas Giant Class"; break; case "H": $type = "Heavy Grav Class"; break; case "I": $type = "Ice Class"; break; case "R": $type = "Rock Class"; break; case "T": $type = "Toxic Class"; break; } define("planet_raw_metal", "8.5"); define("planet_raw_energy", "8.5"); define("planet_raw_mopgas", "8.5"); define("planet_raw_erkunum", "8.5"); define("planet_raw_gortium", "8.5"); define("planet_raw_susebloom", "8.5"); define("planet_no_upgrade_factor", "1"); $sth = mysql_query("select * from planets where id={$pid}"); $population_factor = log10($planet["population"] / 1000) + 3; $sth = mysql_query("select * from final_prod_factors where pid=" . $pid); if (!$sth) { show_error("ERR::GET PROD_FACTORS"); return false; } if (mysql_num_rows($sth) == 1) { $factors = mysql_fetch_assoc($sth); } else { $factors = false; } $metal_plus = round($factors["metal"] * ($planet["metal"] / 100) * (planet_raw_metal * $population_factor)); $energy_plus = round($factors["energy"] * ($planet["energy"] / 100) * planet_raw_energy * $population_factor); $mopgas_plus = round($factors["mopgas"] * ($planet["mopgas"] / 100) * planet_raw_mopgas * $population_factor); $erkunum_plus = round($factors["erkunum"] * ($planet["erkunum"] / 100) * planet_raw_erkunum * $population_factor); $gortium_plus = round($factors["gortium"] * ($planet["gortium"] / 100) * planet_raw_gortium * $population_factor); $susebloom_plus = round($factors["susebloom"] * ($planet["susebloom"] / 100) * planet_raw_susebloom * $population_factor); table_text_design($type, "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("Production factor", "", "center", "1", "head"); table_text_design($planet["production_factor"] * 100 . "%", "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("<img src='arts/metal.gif' title='Metal' alt='Metal'>", "", "center", "1", "head"); table_text_design($metal_plus, "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("<img src='arts/energy.gif' title='Energy' alt='Energy'>", "", "center", "1", "head"); table_text_design($energy_plus, "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("<img src='arts/mopgas.gif' title='Mopgas' alt='Mopgas'>", "", "center", "1", "head"); table_text_design($mopgas_plus, "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("<img src='arts/erkunum.gif' title='Erkunum' alt='Erkunum'>", "", "center", "1", "head"); table_text_design($erkunum_plus, "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("<img src='arts/gortium.gif' title='Gortium' alt='Gortium'>", "", "center", "1", "head"); table_text_design($gortium_plus, "", "center", "1", "text"); table_text_close(); table_text_open(); table_text_design("<img src='arts/susebloom.gif' title='Susebloom' alt='Susebloom'>", "", "center", "1", "head"); table_text_design($susebloom_plus, "", "center", "1", "text"); table_text_close(); table_end(); echo "<br><br>\n"; echo "<center>\n"; // echo("<a href=\"planet.php?pid=".$planet["id"]."\" target=\"anzeige_frame\">fleet orders</a>\n"); echo "</center>\n"; echo "<br>\n"; $query = mysql_query("SELECT ps.*, p.pic, p.description, p.name FROM planetary_shields ps \nINNER JOIN production p USING (prod_id) WHERE pid={$pid}") or die(mysql_error()); if (mysql_num_rows($query) > 0) { table_start("center", "500"); table_head_text(array("Shield generators installed on {$planet['name']}"), "5"); table_text_open("head"); table_text_design(" ", "50px", "", "", "head"); table_text_design("Building", "300", "", "", "head"); table_text_design("Max", "50", "center", "", "head"); table_text_design("Power", "50", "center", "", "head"); table_text_design("Load", "50", "center", "", "head"); while ($result = mysql_fetch_assoc($query)) { table_text_open("text", "center"); table_text_design("<a href='" . $_SERVER["PHP_SELF"] . "?act=print_building_info&prod_id=" . $result["prod_id"] . "'><img src='arts/" . $result["pic"] . "' alt='" . $result["description"] . "' border='0' width=\"50px\" height=\"50px\" /></a>", "50px", "", "", "text", "2"); table_text_design($result["name"], "300", "", "", "text", "2"); table_text_design($result["max_value"], "50", "", "", "text", "2"); table_text_design($result["value"], "50", "", "", "text", "2"); table_text_design($result["regeneration"] + $result["regeneration_bonus"], "50", "", "", "text", "2"); table_text_close(); } table_end(); } echo "<br>\n"; table_start("center", "500"); table_head_text(array("Units stationed on " . $planet["name"]), "5"); table_text(array(" ", " ", " ", " ", " "), "center", "100", "", "text"); table_text_open("head"); table_text_design("Infantry", "200", "center", "2", "head"); table_text_design(" ", "100", "", "", "head"); table_text_design("Fleet", "200", "center", "2", "head"); table_text_close(); $sth = mysql_query("select sum(count) from infantery as i,production as p where i.pid=" . $pid . " and i.prod_id=p.prod_id\n and p.typ='I'"); if (!$sth) { show_error("Database failure!"); return 0; } $inf = mysql_fetch_row($sth); if ($inf[0] == "") { $inf[0] = "No troops"; } table_text_open("text", "center"); table_text_design("Infantry", "", "", "", "text"); table_text_design($inf[0], "", "", "", "text"); table_text_design(" ", "100", "", "", "none"); table_text_design("Europa Class", "", "", "", "text"); table_text_design(get_fcount_by_type($uid, "L", $pid), "", "", "", "text"); table_text_close(); $sth = mysql_query("select sum(count) from infantery as i,production as p where i.pid=" . $pid . " and i.prod_id=p.prod_id and p.typ='T'"); if (!$sth) { show_error("Database failure!"); return 0; } $inf = mysql_fetch_row($sth); if ($inf[0] == "") { $inf[0] = "No Vehicles"; } table_text_open("text", "center"); table_text_design("Vehicles", "", "", "", "text"); table_text_design($inf[0], "", "", "", "text"); table_text_design(" ", "100", "", "", "none"); table_text_design("Zeus Class", "", "", "", "text"); table_text_design(get_fcount_by_type($uid, "M", $pid), "", "", "", "text"); table_text_close(); table_text_open("text", "center"); table_text_design(" "); table_text_design(" "); table_text_design(" ", "100", "", "", "none"); table_text_design("Olymp Class", "", "", "", "text"); table_text_design(get_fcount_by_type($uid, "H", $pid), "", "", "", "text"); table_text_close(); table_end(); }
function viewChildTableList($subtable, $parent_value) { global $db; $maintable_key = $subtable['maintable_key']; $table_title = $subtable['subtable_title']; $tablename2 = $subtable['subtable_name']; $childkey2 = $subtable['subtable_key']; $where2 = $subtable['subtable_where']; $where2 = str_replace("(", "(", $where2); $where2 = str_replace(")", ")", $where2); $showlistfieldlist2 = $subtable['subtable_showlistfieldlist']; $columns2 = returntablecolumn($tablename2); $html_etc2 = returnsystemlang($tablename2); $showlistfieldlistArray2 = explode(",", $showlistfieldlist2); $iniFilename = "Model/" . $tablename2 . "_newai.ini"; if (!file_exists($iniFilename)) { $iniFilename = "../JXC/Model/" . $tablename2 . "_newai.ini"; } if (!file_exists($iniFilename)) { $iniFilename = "../CRM/Model/" . $tablename2 . "_newai.ini"; } if (!file_exists($iniFilename)) { $iniFilename = "../Framework/Model/" . $tablename2 . "_newai.ini"; } $file_ini2 = parse_ini_file($iniFilename, true); $org_showlistfieldlist = explode(",", $file_ini2['view_default']['showlistfieldlist']); $org_showlistfieldfilter = explode(",", $file_ini2['view_default']['showlistfieldfilter']); $showlistfieldfilterArray2 = array(); for ($i = 0; $i < sizeof($org_showlistfieldlist); $i++) { if (in_array($org_showlistfieldlist[$i], $showlistfieldlistArray2)) { $showlistfieldfilterArray2[$org_showlistfieldlist[$i]] = $org_showlistfieldfilter[$i]; } } //构建SQL语句 $SQLText = ""; for ($i = 0; $i < sizeof($showlistfieldlistArray2); $i++) { $listIndex = $showlistfieldlistArray2[$i]; $listIndexName = $columns2[$listIndex]; if ($SQLText != "") { $SQLText .= ","; } $SQLText .= $listIndexName; } if (is_array($parent_value)) { $childkey2Array = explode(",", $childkey2); $mainkey2Array = explode(",", $maintable_key); $SQL_Select = "select {$SQLText} from {$tablename2} where 1=1 "; $i = 0; foreach ($mainkey2Array as $row) { $SQL_Select = $SQL_Select . "and " . $childkey2Array[$i] . "='" . $parent_value[$row] . "' "; $i++; } } else { $SQL_Select = "select {$SQLText} from {$tablename2} where {$childkey2} = '" . $parent_value . "'"; } if ($where2 != '') { $where2 = str_replace(":", "=", $where2); $where2 = str_replace("\\", "", $where2); $SQL_Select .= " and " . $where2; } $rs = $db->Execute($SQL_Select); $rs_a = $rs->GetArray(); //print_R($rs_a);print_R($showlistfieldlistArray2); print "<tr ><td colspan=6 nowrap width=100%>\n"; table_begin("100%"); //标题显示部分 if ($table_title != "") { $url_filename = $tablename2 . "_newai.php"; if (file_exists("../JXC/" . $url_filename)) { $url_filename = "../JXC/" . $url_filename; } else { if (file_exists("../CRM/" . $url_filename)) { $url_filename = "../CRM/" . $url_filename; } else { $url_filename = ""; } } if ($url_filename != '') { $table_title = "<a href='{$url_filename}' target='_blank'>{$table_title}</a>"; } print "<tr><td class=TableHeader align=center colspan=" . sizeof($showlistfieldlistArray2) . ">{$table_title}</td></tr>"; } print "<tr class=TableContent>\n"; for ($i = 0; $i < sizeof($showlistfieldlistArray2); $i++) { $listIndex = $showlistfieldlistArray2[$i]; $listIndexName = $columns2[$listIndex]; $listFilter = $showlistfieldfilterArray2[$listIndex]; $listFilterArray = explode(":", $listFilter); if (stristr($listFilterArray[0], "tablefilter") && $listFilterArray[1] == $tablename2) { $TempColumns = returntablecolumn($listFilterArray[1]); $showText = $html_etc2[$tablename2][$TempColumns[$listFilterArray[3]]]; } else { $showText = $html_etc2[$tablename2][$listIndexName]; } print "<td nowrap>" . $showText . "</td>"; } print "</tr>"; $allnum = array(); $allmoney = array(); //数据窗口部分 for ($j = 0; $j < sizeof($rs_a); $j++) { print "<tr class=TableData>\n"; for ($i = 0; $i < sizeof($showlistfieldlistArray2); $i++) { $listIndex = $showlistfieldlistArray2[$i]; $listIndexName = $columns2[$listIndex]; $listFilter = $showlistfieldfilterArray2[$listIndex]; //数据过滤区 $listFilterArray = explode(":", $listFilter); if (stristr($listFilterArray[0], 'color')) { $hascolor = true; } else { $hascolor = false; } $nowrap = ""; if (strlen($rs_a[$j][$listIndexName]) < 20) { $nowrap = "nowrap"; } switch ($listFilterArray[0]) { case 'tablefilter': case 'tablefiltercolor': $TempColumns = returntablecolumn($listFilterArray[1]); $DataElement = returntablefieldColorFilterGray($listFilterArray[1], $TempColumns[(string) $listFilterArray[2]], $rs_a[$j][$listIndexName], $TempColumns[(string) $listFilterArray[3]], '', '', '', $hascolor); break; case 'radiofilter': $TempColumns = returntablecolumn($listFilterArray[1]); $DataElement = returntablefield($listFilterArray[1], $TempColumns[(string) $listFilterArray[2]], $rs_a[$j][$listIndexName], $TempColumns[(string) $listFilterArray[3]]); break; case 'radiofiltergroup': $TempColumns = returntablecolumn($listFilterArray[1]); $DataElement = returntablefield($listFilterArray[1], $TempColumns[(string) $listFilterArray[2]], $rs_a[$j][$listIndexName], $TempColumns[(string) $listFilterArray[3]]); break; case 'select_sex': $DataElement = returnsex($rs_a[$j][$listIndexName]); break; case 'boolean': $DataElement = returnboolean($rs_a[$j][$listIndexName]); break; case 'datetime': if ($rs_a[$j][$listIndexName] == '0000-00-00 00:00:00') { $DataElement = ''; } else { $DataElement = $rs_a[$j][$listIndexName]; } break; /* case 'input': $DataElement=cutStr($rs_a[$j][$listIndexName],15); if($DataElement!=$rs_a[$j][$listIndexName]) $DataElement="<span title='".$rs_a[$j][$listIndexName]."'>".$DataElement."..</span>"; else $DataElement = $rs_a[$j][$listIndexName]; break; case 'textarea': if(cutStr($rs_a[$j][$listIndexName],30)!=$rs_a[$j][$listIndexName]) $DataElement = "<div title='".$rs_a[$j][$listIndexName]."'>".cutStr($rs_a[$j][$listIndexName],30)."...</div>"; else $DataElement = $rs_a[$j][$listIndexName]; break; */ /* case 'input': $DataElement=cutStr($rs_a[$j][$listIndexName],15); if($DataElement!=$rs_a[$j][$listIndexName]) $DataElement="<span title='".$rs_a[$j][$listIndexName]."'>".$DataElement."..</span>"; else $DataElement = $rs_a[$j][$listIndexName]; break; case 'textarea': if(cutStr($rs_a[$j][$listIndexName],30)!=$rs_a[$j][$listIndexName]) $DataElement = "<div title='".$rs_a[$j][$listIndexName]."'>".cutStr($rs_a[$j][$listIndexName],30)."...</div>"; else $DataElement = $rs_a[$j][$listIndexName]; break; */ case 'qq': $DataElement = !empty($rs_a[$j][$listIndexName]) ? "<a target=\"_blank\" href=\"http://wpa.qq.com/msgrd?v=3&uin=" . $rs_a[$j][$listIndexName] . "&site=qq&menu=yes\"><img border=\"0\" src=\"http://wpa.qq.com/pa?p=2:" . $rs_a[$j][$listIndexName] . ":45\" onerror=\"this.src='" . ROOT_DIR . "general/ERP/Framework/images/help3.gif';this.title='此QQ号码可能不存在'\" title=\"点击这里发消息\">" . $rs_a[$j][$listIndexName] . "</a>" : ''; break; case 'mobile': $addicon = "<img src='" . ROOT_DIR . "general/ERP/Framework/images/menu/gif-0348.gif' title='点击号码发送短信'>"; if ($rs_a[$j][$listIndexName] != '') { $DataElement = "<a href='../JXC/sms_sendlist_newai.php?" . base64_encode("action=add_default&sendlist=" . $rs_a[$j][$listIndexName]) . "' target='_blank'>" . $addicon . $rs_a[$j][$listIndexName] . "</a>"; } else { $DataElement = $rs_a[$j][$listIndexName]; } break; case 'email': $linkman = ''; $fromsrc = ''; if ($tablename2 == 'linkman') { $fromsrc = 'customer'; $linkman = gettablefield($tablename2, 'email', 'rowid', $rs_a[$j][$listIndexName]); } else { if ($tablename2 == 'supplylinkman') { $fromsrc = 'supply'; $linkman = gettablefield($tablename2, 'email', 'rowid', $rs_a[$j][$listIndexName]); } else { $linkman = $rs_a[$j][$listIndexName]; $fromsrc = ''; } } $addicon = "<img src='" . ROOT_DIR . "general/ERP/Framework/images/menu/gif-0037.gif' title='点击链接发送邮件'>"; if ($rs_a[$j][$listIndexName] != '') { $DataElement = "<a href='../CRM/email_newai.php?" . base64_encode("action=add_default&sendlist=" . $linkman . "&fromsrc=" . $fromsrc) . "' target='_blank' >" . $addicon . $rs_a[$j][$listIndexName] . "</a>"; } break; case 'picturefile': global $ifincludemaginfier; $PicturePath = $rs_a[$j][$listIndexName]; if ($PicturePath != "" && strlen($PicturePath) > 10) { if (!$ifincludemaginfier) { print "<script type=\"text/javascript\" language=\"javascript\" src=\"" . ROOT_DIR . "general/ERP/Enginee/jquery/jquery.js\"></script>"; print "<script type=\"text/javascript\" language=\"javascript\" src=\"" . ROOT_DIR . "general/ERP/Enginee/jquery/jquery.magnifier.js\"></script>"; $ifincludemaginfier = true; } $DataElement = "<img src='" . $PicturePath . "' width=32 class=\"magnify\" data-magnifyto=\"500\" onmouseover=\"this.style.cursor='pointer';this.style.cursor='hand'\" onmouseout=\"this.style.cursor='default'\">"; //$file_path="<a href='$PicturePath'><img src='".$PicturePath."' border=0 width=120></a>"; } else { $DataElement = ""; } break; case 'userdefine': $functionName = trim($listFilterArray[1]); $fileName = $functionName . ".php"; $fileName0 = "userdefine/{$fileName}"; $fileName = "../../Enginee/userdefine/{$fileName}"; if (file_exists($fileName0)) { require_once $fileName0; $functionName = $functionName . "_value"; if (function_exists($functionName)) { $DataElement = $functionName($rs_a[$j][$listIndexName], $rs_a, $j); } } else { $DataElement = $rs_a[$j][$listIndexName]; } break; case 'tdoafile': require_once 'lib/utility_file.php'; //形成通达OA下载文件所需要的变量格式 $var_value_array = explode('||', $rs_a[$j][$listIndexName]); $ATTACHMENT_ID = $var_value_array[1]; $ATTACHMENT_NAME = $var_value_array[0]; if (strlen($rs_a[$j][$listIndexName]) < 3) { $file_path = "无附件"; } else { $file_path = attach_link($ATTACHMENT_ID, $ATTACHMENT_NAME, 1, 1, 1, 0, 0, 1, 1, 0); } //print_R($ATTACHMENT_NAME);exit; print "<script src=\"../../Enginee/lib/attach.js\"></script>"; print "\n\t\t\t\t\t<input type=\"hidden\" name=\"ATTACHMENT_ID_OLD\" value=\"{$ATTACHMENT_ID}\">\n\t\t\t\t\t<input type=\"hidden\" name=\"ATTACHMENT_NAME_OLD\" value=\"{$ATTACHMENT_NAME}\">"; $DataElement = $file_path; break; default: $DataElement = $rs_a[$j][$listIndexName]; break; } if ($listIndexName == 'zhekou') { $DataElement = $DataElement * 100 . "%"; } $tip = ''; if ((stristr($tablename2, "detail") || $tablename2 == "store_product") && $listIndexName == 'num') { $tablename3 = $tablename2 . "_color"; if ($tablename2 == "store_product") { $tablename3 = "store_color"; } $sql = "SELECT COUNT(*) as allnum FROM information_schema.TABLES WHERE TABLE_NAME='{$tablename3}'"; $rs = $db->Execute($sql); if ($rs->fields['allnum'] == 1) { $sql = "select id,{$SQLText} from {$tablename2} where {$childkey2} = '" . $parent_value . "'"; $rs = $db->Execute($sql); $rs_id = $rs->GetArray(); $id = $rs_id[$j][id]; $sql = "select a.num,b.name from {$tablename3} a inner join productcolor b on a.color=b.id where a.id={$id}"; $rs = $db->Execute($sql); $rs_color = $rs->GetArray(); foreach ($rs_color as $row) { $tip .= $row[name] . ":" . $row[num] . "\r\n"; } if ($tip != '') { $tip = " <span title='{$tip}'><img src='" . ROOT_DIR . "general/ERP/Framework/images/sepan.gif'></span>"; } } } print "<td {$nowrap}>" . $DataElement . $tip . "</td>"; if (stristr($html_etc2[$tablename2][$listIndexName], "数量")) { $allnum[$html_etc2[$tablename2][$listIndexName]] = $allnum[$html_etc2[$tablename2][$listIndexName]] + $rs_a[$j][$listIndexName]; } else { if (stristr($html_etc2[$tablename2][$listIndexName], "金额")) { $allmoney[$html_etc2[$tablename2][$listIndexName]] = $allmoney[$html_etc2[$tablename2][$listIndexName]] + $rs_a[$j][$listIndexName]; } } } print "</tr>"; } if (sizeof($allnum) > 0 || sizeof($allmoney) > 0) { print "<tr class=TableData><td align=center><b>合计</b></td>"; for ($i = 1; $i < sizeof($showlistfieldlistArray2); $i++) { $listIndex = $showlistfieldlistArray2[$i]; $listIndexName = $columns2[$listIndex]; if (array_key_exists($html_etc2[$tablename2][$listIndexName], $allnum)) { print "<td nowrap>" . $allnum[$html_etc2[$tablename2][$listIndexName]] . "</td>"; } else { if (array_key_exists($html_etc2[$tablename2][$listIndexName], $allmoney)) { print "<td nowrap>" . $allmoney[$html_etc2[$tablename2][$listIndexName]] . "</td>"; } else { print "<td nowrap></td>"; } } } print "</tr>"; } if (sizeof($rs_a) == 0) { print "<tr class=TableData><td align=center nowrap colspan=" . sizeof($showlistfieldlistArray2) . "><font color=gray>无此项记录</font></td>"; print "</tr>"; } table_end(); print "</td></tr>"; }
function newaiReportSearch($fields, $list) { global $html_etc, $tablename, $common_html; global $db, $return_sql_line, $columns; global $_POST, $_GET, $returnmodel, $primarykey_index; global $action_submit, $merge, $form_attribute; global $showlistfieldlistSearch, $showlistfieldfilterSearch, $showlistfieldfilter2Search; global $totalnumber; $totalnumber == "" ? $totalnumber = 30 : ''; $showlistfieldlistArray = explode(',', $showlistfieldlistSearch); $showlistfieldfilterArray = explode(',', $showlistfieldfilterSearch); print_date_js(); form_begin($fields['form']['name'], "action", 'GET'); table_begin("450"); global $tabletitle; print_hidden($_GET['action'] . "_data", "action"); print_title($html_etc[$tablename][$tabletitle]); //print_title("<font color=green>".$common_html['common_html']['totalNumber'].":".$totalnumber."</font>"); print_title($common_html['common_html']['totalNumber'] . ":" . $totalnumber); for ($i = 0; $i < sizeof($showlistfieldlistArray); $i++) { $fieldIndex = $showlistfieldlistArray[$i]; $fieldName = $columns[$fieldIndex]; $fieldText = $html_etc[$tablename][$fieldName]; $mode = $showlistfieldfilterArray[$i]; switch ($mode) { case '': break; case 'input': print_tr($fieldText . ":", $fieldName, '', $fields['other']['inputsize'], $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1); break; case 'date': print_report_date($fieldText . ":", $fieldName, '', $fields['other']['inputsize'], $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1); break; } } print_submit($common_html['common_html']['reportsearch'], 3, ""); print "<TR><TD class=TableControl noWrap align=middle colspan=\"3\">\n"; print "<div align=\"center\">\n<INPUT class=SmallButton title=" . $common_html['common_html']['reportsearch'] . " type=submit value=\"" . $common_html['common_html']['reportsearch'] . "\" name=button>\n "; print "</TD></TR>\n"; table_end(); form_end(); }
function _query($sql, $inputarr = false) { //global $ADODB_COUNTRECS; //if($ADODB_COUNTRECS) ////print $sql."<BR>"; $sql_VALUE = $sql; ######################################################################################################### //在此处进行SQL语句操作日志的记录工作,必须在该条SQL语句执行之前进行判断日志 ######################################################################################################### $sqlTEXT2010 = $sql; $sqlTEXT2010InsertInto = substr($sqlTEXT2010, 0, strlen("insert into")); $sqlTEXT2010InsertInto = trim(strtolower($sqlTEXT2010InsertInto)); if ($sqlTEXT2010InsertInto == "insert into") { $sqlTEXT2010Array = explode(' ', $sqlTEXT2010); $临时表名称 = trim($sqlTEXT2010Array[2]); $临时表名称Array = explode('(', $临时表名称); $临时表名称 = trim($临时表名称Array[0]); if ($临时表名称 != "system_log") { $LOGINACTION = "insertinto" . $临时表名称; } } $sqlTEXT2010InsertInto = substr($sqlTEXT2010, 0, strlen("update ")); $sqlTEXT2010InsertInto = trim(strtolower($sqlTEXT2010InsertInto)); if ($sqlTEXT2010InsertInto == "update") { $sqlTEXT2010Array = explode(' ', $sqlTEXT2010); $临时表名称 = trim($sqlTEXT2010Array[1]); if ($临时表名称 != "system_log") { $LOGINACTION = "update" . $临时表名称; } } $sqlTEXT2010InsertInto = substr($sqlTEXT2010, 0, strlen("delete from ")); $sqlTEXT2010InsertInto = trim(strtolower($sqlTEXT2010InsertInto)); if ($sqlTEXT2010InsertInto == "delete from") { $sqlTEXT2010Array = explode(' ', $sqlTEXT2010); $临时表名称 = $sqlTEXT2010Array[2]; if ($临时表名称 != "system_log") { $LOGINACTION = "deletefrom" . $临时表名称; } //print $sqlTEXT2010;exit; $sqlTEXT2010Array[0] = "select *"; $sqlX = @join(' ', $sqlTEXT2010Array); $result = mysql_query($sqlX, $this->_connectionID); $SQLTEXT = ''; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $rowKEYS = @array_keys($row); for ($i = 0; $i < sizeof($rowKEYS); $i++) { $KEY = $rowKEYS[$i]; $SQLTEXT .= "{$KEY}:" . $row[$KEY] . " "; } } //print $SQLTEXT;exit; $sqlTEXT2010 = $sqlTEXT2010 . "<BR>" . $SQLTEXT; } if ($LOGINACTION != "" && $临时表名称 != "system_log") { //print $sqlTEXT2010;exit; $DATETIME = date("Y-m-d H:i:s"); $REMOTE_ADDR = $_SERVER['REMOTE_ADDR']; $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; $QUERY_STRING = $_SERVER['QUERY_STRING']; $SCRIPT_NAME = $_SERVER['SCRIPT_NAME']; $LOGIN_USER_ID = $_SESSION['LOGIN_USER_ID']; if ($_GET['USER_ID'] != "") { $LOGIN_USER_ID = $_GET['USER_ID']; } $sqlTEXT2010 = ereg_replace("'", "'", $sqlTEXT2010); $sql = "insert into system_log(loginaction,DATE,REMOTE_ADDR,HTTP_USER_AGENT,QUERY_STRING,SCRIPT_NAME,USERID,SQLTEXT)\n\t\t\t\t\tvalues('{$LOGINACTION}','{$DATETIME}','{$REMOTE_ADDR}','{$HTTP_USER_AGENT}','{$QUERY_STRING}','{$SCRIPT_NAME}','{$LOGIN_USER_ID}','{$sqlTEXT2010}');"; //print $sql;exit; mysql_query($sql, $this->_connectionID); } //对MYSQL系统进行性能监控 2010-9-30 15:09 $sql = $sql_VALUE; $sqlTEXT2010 = $sql; $开始时间 = time(); $mysql_query = mysql_query($sql, $this->_connectionID); $mysql_error = mysql_error(); $mysql_errno = mysql_errno(); //print $mysql_error; if (function_exists("iconv")) { $mysql_error = iconv('UTF-8', 'GB2312', $mysql_error); } //print $mysql_error; if (!$mysql_error) { //放到最下面进行执行 } else { $sql = trim($sql); global $SYSTEM_DEBUG_SQL; if (strlen($sql) > 6 && $SYSTEM_DEBUG_SQL == 1 && !$rez) { $mysql_error = ereg_replace("Table", "数据表:", $mysql_error); $mysql_error = ereg_replace("doesn't exist", "不存在.", $mysql_error); $mysql_error = ereg_replace("Duplicate entry", "以下数据要求是唯一性的,但发生重复,该字段的值为:", $mysql_error); $mysql_error = ereg_replace("for key", "重复次数:", $mysql_error); $mysql_error = ereg_replace("Unknown column", "不存在的列", $mysql_error); $mysql_error = ereg_replace("in 'where clause'", "在WHERE判断语句中.", $mysql_error); //$mysql_error = ereg_replace("Table","数据表",$mysql_error); //$mysql_error = ereg_replace("Table","数据表",$mysql_error); $mysql_error = "错误代码:" . $mysql_errno . " 解释:" . $mysql_error; $fileVersion = @file(ROOT_DIR . "/general/EDU/Interface/EDU/version.ini"); $fileVersionNumber = $fileVersion[0]; $errorsql = "insert into systemerrorsql values('','" . $_SERVER['REQUEST_URI'] . "','" . ereg_replace("'", "'", $sqlTEXT2010) . "','" . ereg_replace("'", "'", $mysql_error) . "','" . $_SERVER['SERVER_NAME'] . "_" . $fileVersionNumber . "','" . date("Y-m-d H:i:s") . "');"; //print $errorsql; mysql_query($errorsql, $this->_connectionID); page_css("向软件开发商报告错误"); table_begin("600"); print_title("警告:发生SQL语句错误信息!点击按钮向软件开发商报告错误"); print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> 报告时间</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> " . date("Y-m-d H:i:s") . "</TD>\n\t\t\t\t\t\t</TR>"; print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> 错误类型</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> SQL语句出现错误</TD>\n\t\t\t\t\t\t</TR>"; print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> 文件地址</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> " . $_SERVER['PHP_SELF'] . "</TD>\n\t\t\t\t\t\t</TR>"; print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> SQL语句</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> " . $sql . "</TD>\n\t\t\t\t\t\t</TR>"; print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> 错误信息</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> " . $mysql_error . "</TD>\n\t\t\t\t\t\t</TR>"; //$sqlTEXT2010 = ereg_replace("'","____",$sqlTEXT2010); $sqlTEXT2010 = ereg_replace("=", "+", $sqlTEXT2010); $sqlTEXT2010 = ereg_replace("=", "+", $sqlTEXT2010); //$mysql_error = ereg_replace("'","____",$mysql_error); $mysql_error = ereg_replace("=", "+", $mysql_error); $mysql_error = ereg_replace("=", "+", $mysql_error); $FILE_PATH = $_SERVER['REQUEST_URI']; $FILE_PATH = ereg_replace("=", "+", $FILE_PATH); $FILE_PATH = ereg_replace("=", "+", $FILE_PATH); print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=center colSpan=3> <input type=button name=ButtonName class=SmallButton value='向软件开发商报告错误' OnClick=\"location='http://www.dandian.net/tryout/SunshineOACRM/errorsql.php?" . base64_encode("fffffff=xxxxxxxx&SDDDD=XXXX&FILE_PATH=" . $FILE_PATH . "&SERVER_NAME=" . $_SERVER['SERVER_NAME'] . "_" . $fileVersionNumber . "&SQL_CONTENT={$sqlTEXT2010}&ERROR_INFOR={$mysql_error}&DATE_TIME=" . date("Y-m-d H:i:s") . "&fffffff=xxxxxxxx") . "'\"></TD>\n\t\t\t\t\t\t</TR>"; table_end(); //print_R($_SERVER); exit; } } ######################################################################################################### //SQL语句解析函数_应用于消息中心($sql,$操作记录编号); ######################################################################################################### //对MYSQL系统进行性能监控 2010-9-30 15:09 $结束时间 = time(); $执行时间 = $结束时间 - $开始时间; if ($sql != "show status" && $sql != "set names gbk" && $执行时间 > 2) { $sqlTEXT = "show status"; $result = mysql_query($sqlTEXT, $this->_connectionID); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $KEYNAME = $row['Variable_name']; $Element2[$KEYNAME] = $row['Value']; } //exit; //print_R($Element2); $Element['编号'] = ""; $Element['当前时间'] = date("Y-m-d H:i:s"); $Element['执行时间'] = $执行时间; $Element['SQL语句'] = ereg_replace("'", "'", $sqlTEXT2010); $Element['Slow_launch_threads'] = $Element2['Slow_launch_threads']; $Element['Threads_cached'] = $Element2['Threads_cached']; $Element['Threads_connected'] = $Element2['Threads_connected']; $Element['Threads_created'] = $Element2['Threads_created']; $Element['Threads_running'] = $Element2['Threads_running']; $Element['Qcache_free_blocks'] = $Element2['Qcache_free_blocks']; $Element['Qcache_free_memory'] = $Element2['Qcache_free_memory']; $Element['Qcache_hits'] = $Element2['Qcache_hits']; $Element['Qcache_inserts'] = $Element2['Qcache_inserts']; $Element['Qcache_lowmem_prunes'] = $Element2['Qcache_lowmem_prunes']; $Element['Qcache_not_cached'] = $Element2['Qcache_not_cached']; $Element['Qcache_queries_in_cache'] = $Element2['Qcache_queries_in_cache']; $Element['Qcache_total_blocks'] = $Element2['Qcache_total_blocks']; $Element['SQL语句'] .= " |||| " . $_SERVER['SCRIPT_NAME']; $KEYS = array_keys($Element); $VALUES = array_values($Element); $KEYSTEXT = join(",", $KEYS); $VALUESTEXT = join("','", $VALUES); $sql = "insert into system_logall({$KEYSTEXT}) values('{$VALUESTEXT}');"; mysql_query($sql, $this->_connectionID); //print $sql; } //返回结果 return $mysql_query; //else return @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6 }
function status() { global $uid; $sth = mysql_query("select * from researching where uid={$uid}"); if (!$sth) { show_message("Database Failure!"); return 0; } $status = mysql_fetch_array($sth); table_start("center", "500"); table_head_text(array("Current research"), "5"); table_text(array(" "), "", "", "5", "text"); if ($status != "") { $sth2 = mysql_query("select * from tech where t_id=" . $status["t_id"] . ""); $tech = mysql_fetch_array($sth2); table_text(array("<br><strong>" . $tech["name"] . "</strong>"), "center", "", "5", "head"); table_text(array("<img src='arts/t" . $tech["t_id"] . "big.jpg' width='100' height='100' alt='" . $tech["name"] . "' align='left'>\n <br>" . $tech["description"] . "\n <br><a href='manual/tech" . $tech["t_id"] . ".html'>learn more</a>"), "center", "", "5", "text"); table_text_open(); table_text_design("Time left:", "100", "center", "3", "head"); table_text_design($status["time"], "400", "center", "2", "text"); table_text_close(); print_advancements($status["t_id"]); table_end(); } else { table_text(array("<br><strong>No Research established</strong>"), "center", "", "5", "head"); table_end(); } echo "<br><br>\n"; // mop: research_queue holen $queue = get_research_queue($uid); table_start("center", "500"); table_head_text(array("Research queue"), sizeof($queue)); table_text(array(" "), "", "", sizeof($queue), "text"); if (sizeof($queue) == 0) { table_text(array("<br><strong>Research queue is empty</strong>"), "center", "", sizeof($queue), "head"); } else { $output_arr = array(); $option_arr = array(); for ($i = 0; $i < sizeof($queue); $i++) { $t_id = $queue[$i]; $sth2 = mysql_query("select * from tech where t_id=" . $t_id); $tech = mysql_fetch_assoc($sth2); $output_arr[] = "<img src='arts/t" . $t_id . ".jpg' alt='" . $tech["name"] . "' align='center'>"; // mop: optionen dazu bauen $options = ""; if ($i != 0) { $options .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?act=qmove&direction=l&tid=" . $t_id . "\"><</a>"; } $options .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?act=qremove&tid=" . $t_id . "\">x</a>"; if ($i != sizeof($queue) - 1) { $options .= "<a href=\"" . $_SERVER["PHP_SELF"] . "?act=qmove&direction=r&tid=" . $t_id . "\">></a>"; } $option_arr[] = $options; } table_text($output_arr, "center"); table_text($option_arr, "center"); } table_end(); echo "<br><br>\n"; }
function start_mission() { global $id; global $uid; global $PHP_SELF; global $imperium; global $pid; $sth = mysql_query("select sum(population) from planets where uid={$uid}"); if (!$sth) { show_error("Database error!"); return 0; } $pop = mysql_fetch_row($sth); $spies = floor($pop[0] / 1000); $sth = mysql_query("select sum(count) from covertops where uid={$uid}"); if (!$sth) { show_error("Database failure!"); return 0; } $count = mysql_fetch_row($sth); if ($count[0] == NULL) { $count[0] = 0; } if ($count[0] == 0 and $spies == 0) { show_message("You don't have enough population to do any covertops!"); return 0; } $sth = mysql_query("select * from covertopsmissions as c , research as r where c.techdepend=r.t_id and r.uid={$uid} and c.id={$id}"); if (!$sth) { show_error("Database error!"); return 0; } if (mysql_num_rows($sth) == 0) { show_message("bbbblllllllllllll"); return 0; } $covertops = mysql_fetch_array($sth); if ($spies - $count[0] < $covertops["count"]) { show_message("You don't have enough free spies!"); return 0; } $sth = mysql_query("select c.id from covertopsmissions as c,ressources as r where c.metal<=r.metal and c.energy<=r.energy and c.mopgas<=r.mopgas and c.erkunum<=r.erkunum and c.gortium<=r.gortium and c.susebloom<=r.susebloom and r.uid={$uid} and c.id={$id}"); if (!$sth) { show_error("Database failure!"); return 0; } if (mysql_num_rows($sth) == 0) { show_error("You don't have enough ressources to start this mission!"); show_status(); return 0; } if ($imperium != "") { //$sth=mysql_query("select id from users where imperium='".addslashes($imperium)."' and id!=$uid"); $sth = mysql_query("select id from users where imperium='" . $imperium . "' and id!={$uid}"); if (!$sth) { show_error("Database error!"); return 0; } if (mysql_num_rows($sth) == 0) { show_message("Hund! 1"); return 0; } if ($covertops["targettype"] == "P" && $pid == "") { $sth = mysql_query("select id from users where imperium='{$imperium}'"); if (!$sth) { show_error("Database failure13!"); return 0; } $uid_target = mysql_fetch_array($sth); $sth = mysql_query("select id,name from planets where uid=" . $uid_target["id"] . " order by name"); if (!$sth) { show_error("Database failure!12"); return 0; } while ($planets = mysql_fetch_array($sth)) { if ($planets["name"] == "Unnamed") { $planets["name"] = get_planetname($planets["id"]); } $select[$planets["name"]] = $planets["id"]; } echo "<form action=\"" . $PHP_SELF . "\" method=post>"; table_start("center", "500"); table_head_text(array("Mission: " . $covertops["descr"]), "2"); table_text(array(" "), "", "", "2", "center", "head"); table_text_open("text", "center"); table_text_design("<img src='arts/idnummer.jpg' width='75' height='50' alt='" . $covertops["descr"] . "'>", "75"); table_text_design($covertops["descr"], "425"); table_text_close(); table_text_open("text", "center"); table_text_design("Target empire", "75"); table_text_design($imperium, "425"); table_text_close(); table_text_open("text", "center"); table_text_design("Time", "75"); table_text_design($covertops["time"], "425"); table_text_close(); table_text_open("text", "center"); table_text_design("Special Info", "75"); table_text_design("dummy", "425"); table_text_close(); table_form_select("Select the targetplanet", "pid", $select, "2", "text", "text"); table_form_submit("Start", "start_mission", "2", "text"); table_end(); form_hidden("imperium", $imperium); form_hidden("id", $id); echo "</form>"; table_end(); } elseif ($covertops["targettype"] == "P") { $sth = mysql_query("select id from planets where id={$pid} and uid!={$uid} and uid!=0"); if (!$sth) { show_error("Database failure!1"); return 0; } if (mysql_num_rows($sth) == 0) { show_error("Hund! 2"); return 0; } proc_start_mission($covertops["id"], $uid, $pid); show_status(); } else { $sth = mysql_query("select id from users where id!={$uid} and imperium='{$imperium}'"); if (!$sth) { show_error("Database failure1!"); return 0; } if (mysql_num_rows($sth) == 0) { show_message("Du Klobrillenvergewaltiger!"); return 0; } $target_uid = mysql_fetch_array($sth); proc_start_mission($covertops["id"], $uid, $target_uid["id"]); show_status(); } } else { $sth = mysql_query("select imperium from users where id!={$uid} order by imperium"); if (!$sth) { show_error("Database failure!"); return 0; } while ($imperiums = mysql_fetch_array($sth)) { $select[$imperiums["imperium"]] = $imperiums["imperium"]; } echo "<form action=\"" . $PHP_SELF . "\" method=post>"; table_start("center", "500"); table_head_text(array("Mission: " . $covertops["descr"]), "2"); table_text(array(" "), "", "", "2", "head"); table_text_open("text", "center"); table_text_design("<img src='arts/o" . $covertops["id"] . ".jpg' width='75' height='50' alt='" . $covertops["descr"] . "'>", "75"); table_text_design($covertops["descr"], "425"); table_text_close(); table_text_open("text", "center"); table_text_design("Time", "75"); table_text_design($covertops["time"], "425", "head"); table_text_close(); table_text_open("text", "center"); table_text_design("Special Info", "75"); table_text_design("dummy", "425", "head"); table_text_close(); table_form_select("Select the target empire", "imperium", $select, "", "text", "text"); table_form_submit("Start", "start_mission", "2", "text"); table_end(); form_hidden("id", $id); echo "</form>"; } }
function _query($sql, $inputarr) { global $ADODB_COUNTRECS; // Move to the next recordset, or return false if there is none. In a stored proc // call, mysqli_next_result returns true for the last "recordset", but mysqli_store_result // returns false. I think this is because the last "recordset" is actually just the // return value of the stored proc (ie the number of rows affected). // Commented out for reasons of performance. You should retrieve every recordset yourself. // if (!mysqli_next_result($this->connection->_connectionID)) return false; if (is_array($sql)) { // Prepare() not supported because mysqli_stmt_execute does not return a recordset, but // returns as bound variables. $stmt = $sql[1]; $a = ''; foreach ($inputarr as $k => $v) { if (is_string($v)) { $a .= 's'; } else { if (is_integer($v)) { $a .= 'i'; } else { $a .= 'd'; } } } $fnarr = array_merge(array($stmt, $a), $inputarr); $ret = call_user_func_array('mysqli_stmt_bind_param', $fnarr); $ret = mysqli_stmt_execute($stmt); return $ret; } /* if (!$mysql_res = mysqli_query($this->_connectionID, $sql, ($ADODB_COUNTRECS) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT)) { if ($this->debug) ADOConnection::outp("Query: " . $sql . " failed. " . $this->ErrorMsg()); return false; } return $mysql_res; */ if ($this->multiQuery) { $rs = mysqli_multi_query($this->_connectionID, $sql . ';'); if ($rs) { $rs = $ADODB_COUNTRECS ? @mysqli_store_result($this->_connectionID) : @mysqli_use_result($this->_connectionID); return $rs ? $rs : true; // mysqli_more_results( $this->_connectionID ) } } else { $rs = mysqli_query($this->_connectionID, $sql, $ADODB_COUNTRECS ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT); if ($rs) { return $rs; } else { $sql = trim($sql); //print_R($rs); global $SYSTEM_DEBUG_SQL; if (strlen($sql) > 6 && $SYSTEM_DEBUG_SQL == 1 && !$rs) { page_css("向软件开发商报告错误"); table_begin("600"); print_title("警告:发生SQL语句错误信息!"); print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> 报告时间</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> " . date("Y-m-d H:i:s") . "</TD>\n\t\t\t\t\t\t\t</TR>"; print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> 错误类型</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> SQL语句出现错误</TD>\n\t\t\t\t\t\t\t</TR>"; print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> 文件地址</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> " . $_SERVER['PHP_SELF'] . "</TD>\n\t\t\t\t\t\t\t</TR>"; print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> SQL语句</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> " . $sql . "</TD>\n\t\t\t\t\t\t\t</TR>"; print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%> 错误信息</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2> " . $this->ErrorMsg() . "</TD>\n\t\t\t\t\t\t\t</TR>"; //$sqlTEXT2010 = ereg_replace("'","____",$sqlTEXT2010); $sqlTEXT2010 = ereg_replace("=", "+", $sqlTEXT2010); $sqlTEXT2010 = ereg_replace("=", "+", $sqlTEXT2010); //$mysql_error = ereg_replace("'","____",$mysql_error); $mysql_error = ereg_replace("=", "+", $mysql_error); $mysql_error = ereg_replace("=", "+", $mysql_error); $FILE_PATH = $_SERVER['REQUEST_URI']; $FILE_PATH = ereg_replace("=", "+", $FILE_PATH); $FILE_PATH = ereg_replace("=", "+", $FILE_PATH); table_end(); //print_R($_SERVER); exit; } } } if ($this->debug) { ADOConnection::outp("Query: " . $sql . " failed. " . $this->ErrorMsg()); } return false; }
function show_battlereports() { table_start("center", "500"); table_head_text(array("Battlereports"), "1"); table_text(array("<a href=\"battlereport.php?act=show_own\">Battlereports</a>"), "", "", "", "text"); table_text_open("head"); table_text_close(); table_end(); echo "<br><br>"; }
function newai_import($fields, $mode = 'table') { global $common_html, $html_etc; global $return_sql_line, $db; global $columns; //print_R($columns); global $showlistfieldlist, $showlistfieldlist_key; global $foreignkey, $uniquekey, $primarykey; $tablename = $fields['table']['name']; $SQL = $fields['sql']['SQL']; $init = explode('_', $_GET['action']); $mark = $init[1]; if ($uniquekey == '') { $uniquekey = $primarykey; } //print $uniquekey; print "<FORM name=form1 action=\"?action=import_" . $mark . "_data\" method=post encType=multipart/form-data>\n"; print "<input type=hidden name=hidden_str value=''>\n"; print "<script >"; print "\nfunction temp_function()\n{\n\n\tvar selectid_str=\"\";\n\t/*\n\tfor(i=0;i<document.all(\"selectid\").length;i++)\n\t\t{\n\n\t\tel=document.all(\"selectid\").item(i);\n\t\tif(el.checked)\n\t\t{ val=el.value;\n selectid_str+=val + \",\";\n\t\t}\n\t}*/\n\tform1.hidden_str.value=selectid_str;\n\tform1.submit();\n\tvar sbtn=document.getElementsByName('submitbtn');\n\tfor(i=0;i<sbtn.length;i++)\n\t{\n\t\tsbtn[i].value='提交中';\n\t\tsbtn[i].disabled=true;\n\t}\n}\n"; print "</script>"; global $tablewidth, $primarykey, $primarykey_index; $tablewidth = $tablewidth != "" ? $tablewidth : 450; table_begin($tablewidth); print_title("数据导入操作,唯一索引限制,多个表示不能同时重复", 3); //print_R($common_html['common_html']['contentimport']); if ($foreignkey != "") { $foreignkey_array = explode(':', $foreignkey); $columns_parent = returntablecolumn($foreignkey_array[1]); print_R($columns_parent); print_select('选择考试名称', $columns[(string) $foreignkey_array[3]], $value, $foreignkey_array[1], $columns_parent[(string) $foreignkey_array[3]], $columns_parent[(string) $foreignkey_array[2]], $colspan = 3, $columns_parent[(string) $foreignkey_array[4]]); print_hidden($columns[(string) $foreignkey_array[3]], 'foreignkey'); } print "<TR class=TableData>\n"; print "<TD noWrap align=middle width=50>唯一索引:</TD>\n"; print "<TD colspan=2>"; $uniquekey_array = explode(',', $uniquekey); $FieldList = array(); for ($i = 0; $i < sizeof($uniquekey_array); $i++) { $uniquekey_KEY = $uniquekey_array[$i]; if ($uniquekey_KEY != "") { $uniquekey_KEY_ADD = explode(':', $uniquekey_KEY); if ($uniquekey_KEY_ADD[1] == "userid") { $FieldList[] = $columns["" . $uniquekey_KEY_ADD[0] . ""] . "(自动生成)"; } else { if ($uniquekey_KEY_ADD[1] == "username") { $FieldList[] = $columns["" . $uniquekey_KEY_ADD[0] . ""] . "(自动生成)"; } else { if ($uniquekey_KEY_ADD[1] == "datetime") { $FieldList[] = $columns["" . $uniquekey_KEY_ADD[0] . ""] . "(自动生成)"; } else { $tablenamelang = returnsystemlang($tablename); $FieldList[] = $tablenamelang[$tablename][$columns["" . $uniquekey_KEY_ADD[0] . ""]]; } } } } } //print_R($uniquekey_array); //输出不较验主键时的选择列表 $唯一字段显示文本 = join(',', $FieldList); print $唯一字段显示文本; print "</TD>\n"; print "</TR>\n"; global $importgroup; if ($importgroup != "") { //print $importgroup; print_title('选择要导入的组', 3); $importgroupArray = explode(':', $importgroup); $showfieldIndex = $importgroupArray[0]; $showFieldName = $columns[$showfieldIndex]; $showfieldTableName = $importgroupArray[1]; $showfieldColumns = returntablecolumn($showfieldTableName); $showfieldIndexValue = $importgroupArray[2]; $showfieldIndexName = $importgroupArray[3]; $showfieldIndexValue = $showfieldColumns[$showfieldIndexName]; $showfieldIndexName = $showfieldColumns[$showfieldIndexName]; print_select('选择要导入的组:', $showFieldName, $value = '', $showfieldTableName, $showfieldIndexValue, $showfieldIndexName, $colspan = 2, $setfieldname = '', $setfieldvalue = '', $setfieldboolean = ''); } /* if($tablename == 'customer'){ print_title('请您先<a style="color:red;" href="xls_template/客户信息模板.xls">下载模板</a>,编辑完成再进行导入。',3); }elseif($tablename == 'supply'){ print_title('请您先<a style="color:red;" href="xls_template/供应商信息模板.xls">下载模板</a>,编辑完成再进行导入。',3); }elseif($tablename == 'product'){ print_title('请您先<a style="color:red;" href="xls_template/商品信息模板.xls">下载模板</a>,编辑完成再进行导入。',3); }else{ print_title('导入EXCEL格式数据文件,请您直接从导出功能模块下载导入模板',3); } */ print_title('导入EXCEL格式数据文件,请您直接从导出功能模块下载导入模板', 3); print "<TR class=TableData height=50>\n"; print "<TD noWrap align=middle >EXCEL格式文件</TD>\n"; print "<TD colspan=2><input name='uploadfileXLS' type=file size=25 class=SmallInput></TD>\n"; print "</TR>\n"; //print_title('导入CSV格式数据文件',3); //print "<TR class=TableData height=50>\n"; //print "<TD noWrap align=middle >MS CSV文件</TD>\n"; //print "<TD colspan=2><input name='uploadfile' type=file size=25 class=SmallInput></TD>\n"; //print "</TR>\n"; print "<tr align=\"center\" class=\"TableControl\">\n<td colspan=\"3\">\n<div align=\"center\"><input type=\"button\" name='submitbtn' value=\"" . $common_html['common_html']['import'] . "\" class=\"SmallButton\" onClick=\"temp_function();\"> <input type=\"button\" value=\"" . $common_html['common_html']['return'] . "\" class=\"SmallButton\" onClick=\"history.back();\"></div>\n</td></tr>\n"; table_end(); form_end(); print "<BR>"; table_begin($tablewidth); print_title("EXCEL格式数据正确但导入失败时,请按以下方法进行:"); print "<TR class=TableData height=50>\n"; print "<TD colspan=3><font color=green>\n\t如何过滤EXCEL里面的格式,转化为纯净的EXCEL数据格式文件:<BR>\n\n\t 1 准备好原始格式数据文件<BR>\n\t 2 新建一个EXCEL文件,即空白文件<BR>\n\t 3 工具栏选择数据->导入外部数据->导入数据,弹出的对话框里面,选择第一步准备好的原始文件<BR>\n\t 4 其它不要动,一切按默认的方法进行操作<BR>\n\t 5 即可得到纯净的EXCEL数据格式文件,把这个文件进行导入即可<BR>\n\t 注意:这种方法只用于解决,数据列数及列名正确,但软件无法识别的情况<BR>\n\t</font>\n\t\n"; print "</TD></TR>\n"; table_end(); form_end(); }
function building_edit() { global $uid; global $id; global $PHP_SELF; $sth = mysql_query("select admin,name from users where id={$uid}"); if (!$sth) { show_message("Databse Failure"); return 0; } if (mysql_num_rows($sth) == 0) { show_message("Forbidden"); return 0; } $admin = mysql_fetch_array($sth); if ($admin["admin"] == "") { show_message("Forbidden"); return 0; } else { if ($id == 'new') { echo "<a href=\"" . $PHP_SELF . "?act=buildings&order=name\">back</a>"; $sth = mysql_query("insert into production (typ,tech,name,description) values ('P','999','new','no description')"); if (!$sth) { show_message("Databse Failure : creating new building step 1"); return 0; } /* $sth=mysql_query("select prod_id from production where tech=999 and name='new' and description='no description' and typ='P'"); if (!$sth) { show_message("Databse Failure : creating new building step 2"); return 0; } $newid = mysql_fetch_array($sth); $sth=mysql_query("insert into shipvalues (prod_id,special) values ('".$newid["prod_id"]."','NULL')"); if (!$sth) { show_message("Databse Failure : creating new ship step 3"); return 0; } */ show_message("Empty Buildingslot created, plz edit at least Description,tech or name before creaating a new ship or ERRORS may accure!"); } else { $sth = mysql_query("select * from production where prod_id='{$id}'"); if (!$sth) { show_message("Databse Failure"); return 0; } $building = mysql_fetch_array($sth); $sth = mysql_query("select name,t_id from tech"); if (!$sth) { show_message("Databse Failuret"); return 0; } $sth1 = mysql_query("select name, prod_id from production where not (prod_id='{$id}')"); if (!$sth1) { show_message("Databse Failurep"); return 0; } echo "<a href=\"" . $PHP_SELF . "?act=buildings&order=name\">back</a>"; table_start("center", "500"); table_head_text(array("Editing building " . $building["name"]), "3"); table_text(array(" "), "", "", "3", "text"); table_text(array("variable", "old", "new"), "", "", "", "head"); echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=name&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Name", $building["name"], "<input type=\"Text\" name=\"new\" value=\"" . $building["name"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=prod_id&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Id", $building["prod_id"], "<input type=\"Text\" name=\"new\" value=\"" . $building["prod_id"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=typ&tid=" . $building["prod_id"] . "\" method=post>"; table_text_open(); table_text_design("Type", "", "", "", "text"); table_text_design($building["typ"], "", "", "", "text"); table_text_design("<select name=\"new\"> \n <option value=\"P\" selected>P \n <option value=\"O\">O \n </select><input type=\"Submit\" name=\"f1\" value=\"set\">\n</form>\n", "", "", "", "text"); table_text_close(); echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=com_time&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Time", $building["com_time"], "<input type=\"Text\" name=\"new\" value=\"" . $building["com_time"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=tech&tid=" . $building["prod_id"] . "\" method=post>"; table_text_open(); table_text_design("Tech", "", "", "text"); table_text_design($building["tech"], "", "", "text"); echo "<td><select name=\"new\">"; while ($techs = mysql_fetch_array($sth)) { if ($techs["t_id"] == $building["tech"]) { echo "<option value=\"" . $techs[t_id] . "\" selected>" . $techs["name"] . "\n"; } else { echo "<option value=\"" . $techs[t_id] . "\">" . $techs["name"] . "\n"; } } echo "</select><input type=\"Submit\" name=\"f1\" value=\"set\">\n</td>\n</form>\n"; table_text_close(); echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=p_depend&tid=" . $building["prod_id"] . "\" method=post>"; table_text_open(); table_text_design("Production_depend", "", "", "text"); table_text_design($building["p_depend"], "", "", "text"); echo "<td><select name=\"new\">"; while ($productions = mysql_fetch_array($sth1)) { if ($productions["prod_id"] == $building["p_depend"]) { echo "<option value=\"" . $productions[prod_id] . "\" selected>" . $productions["name"] . "\n"; } else { echo "<option value=\"" . $productions[prod_id] . "\">" . $productions["name"] . "\n"; } } echo "</select><input type=\"Submit\" name=\"f1\" value=\"set\">\n</td>\n</form>\n"; table_text_close(); echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=special&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Special", $building["special"], "<input type=\"Text\" name=\"new\" value=\"" . $building["special"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=metal&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Metal", $building["metal"], "<input type=\"Text\" name=\"new\" value=\"" . $building["metal"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=energy&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Energy", $building["energy"], "<input type=\"Text\" name=\"new\" value=\"" . $building["energy"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=mopgas&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Mopgas", $building["mopgas"], "<input type=\"Text\" name=\"new\" value=\"" . $building["mopgas"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=erkunum&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Erkunum", $building["erkunum"], "<input type=\"Text\" name=\"new\" value=\"" . $building["erkunum"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=gortium&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Gortium", $building["gortium"], "<input type=\"Text\" name=\"new\" value=\"" . $building["gortium"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=susebloom&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Susebloom", $building["susebloom"], "<input type=\"Text\" name=\"new\" value=\"" . $building["susebloom"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=edit&table=production&var=description&tid=" . $building["prod_id"] . "\" method=post>"; table_text(array("Description", $building["description"], "<input type=\"Text\" name=\"new\" value=\"" . $building["description"] . "\"><input type=\"Submit\" name=\"f1\" value=\"set\">"), "", "", "", "text"); echo "</form>\n"; echo "<form action=\"" . $PHP_SELF . "?act=del_building&id=" . $building["prod_id"] . "\" method=post>"; echo "<input type=\"Submit\" name=\"f1\" value=\"Delete building - all active buildings of this type will be deleted too\" disabled>"; echo "</form>\n"; table_end(); } } }
function act_code() { global $PHP_SELF; global $name; global $act_code; global $password; if ($act_code != "") { $sth = mysql_query("select ac.code from users as u,activationcodes as ac where u.id=ac.uid and u.name='{$name}'"); $code = mysql_fetch_array($sth); if ($code["code"] == $act_code) { mysql_query("update users set active=1 where name='{$name}'"); return 1; } else { return 0; } } else { echo "<body bgcolor=\"black\"><center><font color=\"white\">"; echo "<form action=\"" . $PHP_SELF . "\" method=post>"; table_start(); echo "<p>Please enter your Activation Code</p>"; table_form_text("", "act_code", ""); table_end(); form_hidden("name", $name); form_hidden("password", $password); form_submit("Submit"); echo "</form></center></font>"; echo "</body>"; table_end(); return 0; } }
function show_diplomacy() { global $uid; global $start; global $PHP_SELF; if (has_alliance_lock($uid)) { show_message("You can't use any alliance options due to an alliance lock!"); return false; } $aid = get_alliance($uid); $is_leader = is_leader($uid, $aid); $sth = mysql_query("select a.name, d.alliance2, d.status, if(status = 0, 0,(if(status=1, 2, 1))) as my_order from diplomacy d, alliance a where d.alliance1='" . $aid . "' and a.id = d.alliance2 order by my_order, a.name"); if (!$sth) { echo "ERR::DIPLOMACY, could not get relationships"; return false; } table_start("center", "500"); table_head_text(array("Galactic diplomacy status"), 2); table_text_open("head", "center"); table_text_design(" ", "27", "left", "", "head"); table_text_design(" ", "", "left", "", "head"); table_text_close(); if (mysql_num_rows($sth) > 0) { while ($diplomacy = mysql_fetch_assoc($sth)) { if ($diplomacy["status"] == 0) { $dip_image = "arts/alliance_enemy.gif"; $alt = "Enemy"; } elseif ($diplomacy["status"] == 2) { $dip_image = "arts/alliance_friend.gif"; $alt = "Enemy"; } else { $dip_image = false; $alt = false; } table_text_open("head", "center"); table_text_design("<img src=\"" . $dip_image . "\" width=\"25\" height=\"25\" alt=\"" . $alt . "\" border=\"0\" />", "27", "center", "", "text"); table_text_design("<a href=\"database.php?act=info_alliance&aid=" . $diplomacy["alliance2"] . "\">" . $diplomacy["name"] . "</a>", "", "left", "", "text"); table_text_close(); } } else { table_text(array("no relations to other alliances"), "center", "", "2", "text"); } table_end(); //***********************+ $alliances = get_alliances($aid, true); table_start("center", "500"); table_head_text(array("Status"), 2); table_text(array(" "), "", "", 2, "head"); if (sizeof($alliances) == 0) { table_text(array("No alliances so far"), "", "", 2, "text"); } else { for ($i = 0; $i < sizeof($alliances); $i++) { table_text(array(get_alliance_name($alliances[$i]), get_diplomatic_status_text(get_diplomatic_status($aid, $alliances[$i]))), "", "", "", "text"); if (is_leader($uid, $aid)) { $pending_status = get_pending_diplomacy_change($aid, $alliances[$i]); $f_pending_status = get_pending_diplomacy_change($alliances[$i], $aid); if ($pending_status) { table_text(array(" ", get_diplomatic_status_text($pending_status) . " status pending <a href=\"" . $PHP_SELF . "?act=drop_pending&aid2=" . $alliances[$i] . "&aid1=" . $aid . "\">Drop</a>"), "", "", "", "head"); } elseif ($f_pending_status) { table_text(array(" ", get_diplomatic_status_text($f_pending_status) . " status awaiting your approval <a href=\"" . $PHP_SELF . "?act=drop_pending&aid1=" . $alliances[$i] . "&aid2=" . $aid . "\">Drop</a> <a href=\"" . $PHP_SELF . "?act=accept_pending&faid=" . $alliances[$i] . "\">Accept</a>"), "", "", "", "head"); } else { table_text(array(" ", "<a href=\"" . $PHP_SELF . "?act=change_diplomacy&faid=" . $alliances[$i] . "&new_status=0\" onclick=\"javascript:return confirm('Are you sure you want to declare war?');\">Change to <span style=\"color: #FF0000\">Enemy</span></a> | <a href=\"" . $PHP_SELF . "?act=change_diplomacy&faid=" . $alliances[$i] . "&new_status=1\">Change to <span style=\"color: #FFFF00\">Neutral</span></a> | <a href=\"" . $PHP_SELF . "?act=change_diplomacy&faid=" . $alliances[$i] . "&new_status=2\">Change to <span style=\"color: #00FF00\">Friend</span></a>"), "", "", "", "head"); } } } } table_text(array(" "), "", "", 2, "head"); table_end(); }
function newai_export($fields, $mode = 'table') { global $common_html, $html_etc; global $return_sql_line, $db; global $columns; //print_R($_GET); global $showlistfieldlist, $group_filter; $tablename = $fields['table']['name']; $SQL = $fields['sql']['SQL']; $init = explode('_', $_GET['action']); $mark = $init[1]; global $tablewidth; $tablewidth = $tablewidth != "" ? $tablewidth : 450; if ($group_filter != "") { $group_filter_Array = explode(':', $group_filter); $TableFieldIndex = $group_filter_Array[0]; $KeyName = $columns[$TableFieldIndex]; $ChildTableName = $group_filter_Array[1]; $ChildTableFieldValueIndex = $group_filter_Array[2]; $ChildTableFieldNameIndex = $group_filter_Array[3]; $ChildColumns = returntablecolumn($ChildTableName); $ChildTableFieldValue = $ChildColumns[$ChildTableFieldValueIndex]; $ChildTableFieldName = $ChildColumns[$ChildTableFieldNameIndex]; $Childhtml_etc = returnsystemlang($ChildTableName, $SYTEM_CONFIG_TABLE); //print_R($Childhtml_etc); $ChildTableFieldHTMLValue = $Childhtml_etc[$ChildTableName][$ChildTableFieldValue]; $ChildTableFieldHTMLName = $Childhtml_etc[$ChildTableName][$ChildTableFieldName]; } else { $KeyName = "说明"; } print "<script>\n\t//CSV\n\tfunction selectid_str_init_CSV(mark)\n\t{\n\tselectid_str = \"\";\n\tfor(i=0;i<document.all(\"selectid\").length-1;i++)\n\t\t{\n\n\t\tel = document.all(\"selectid\").item(i);\n\t\tif(el.checked)\n\t\t{\tval = el.value;\n\t\t\tif(val !=\"\")\t{\n\t\t\t\tselectid_str += val + \",\";\n\t\t\t}\n\t\t}\n\t}\n\n\tell = document.all(\"selectid\").item(document.all(\"selectid\").length-1);\n\tif(ell.checked)\n\t{\tval = ell.value;\n\t\tif(val !=\"\")\t{\n\t\t\tselectid_str += val ;\n\t\t}\n\t}\n\n\ttablename_\t\t=\tdocument.form1.tablename.value;\n\tsearchfield_\t=\tdocument.form1.searchfield.value;\n\tsearchvalue_\t=\tdocument.form1.searchvalue.value;\n\tAdvanceSearch_\t=\tdocument.form1.AdvanceSearch.value;\n\texportfield= selectid_str;\n\n\n\t"; if ($_GET['actionadv'] == "exportadv_default") { //不用显示或得到SELECTID的值 print "\turl=\"?action=export_\"+mark+\"_data&method=CSV&actionadv=exportadv_default&exportfield=\"+exportfield+\"&tablename=\"+tablename_+\"&searchfield=\"+searchfield_+\"&searchvalue=\"+searchvalue_+AdvanceSearch_"; } else { print "\tvar " . $KeyName . "SelectValue = document.form1." . $KeyName . ".options[document.form1." . $KeyName . ".selectedIndex].value;\n\t\t"; print "\turl=\"?action=export_\"+mark+\"_data&method=CSV&exportfield=\"+exportfield+\"&tablename=\"+tablename_+\"&searchfield=\"+searchfield_+\"&searchvalue=\"+searchvalue_+\"&" . $KeyName . "=\"+" . $KeyName . "SelectValue+AdvanceSearch_"; } print "\n\t//alert(url);\n\tlocation=url;\n\t}\n\t//XLS\n\tfunction selectid_str_init_XLS(mark)\n\t{\n\tselectid_str = \"\";\n\tfor(i=0;i<document.all(\"selectid\").length-1;i++)\n\t\t{\n\n\t\tel = document.all(\"selectid\").item(i);\n\t\tif(el.checked)\n\t\t{\tval = el.value;\n\t\t\tif(val !=\"\")\t{\n\t\t\t\tselectid_str += val + \",\";\n\t\t\t}\n\t\t}\n\t}\n\n\tell = document.all(\"selectid\").item(document.all(\"selectid\").length-1);\n\tif(ell.checked)\n\t{\tval = ell.value;\n\t\tif(val !=\"\")\t{\n\t\t\tselectid_str += val ;\n\t\t}\n\t}\n\n\ttablename_\t\t=\tdocument.form1.tablename.value;\n\tsearchfield_\t=\tdocument.form1.searchfield.value;\n\tsearchvalue_\t=\tdocument.form1.searchvalue.value;\n\tAdvanceSearch_\t=\tdocument.form1.AdvanceSearch.value;\n\texportfield= selectid_str;\n\t"; if ($_GET['actionadv'] == "exportadv_default") { //不用显示或得到SELECTID的值 print "\turl=\"?action=export_\"+mark+\"_data&actionadv=exportadv_default&exportfield=\"+exportfield+\"&tablename=\"+tablename_+\"&searchfield=\"+searchfield_+\"&searchvalue=\"+searchvalue_+AdvanceSearch_"; } else { print "\tvar " . $KeyName . "SelectValue = document.form1." . $KeyName . ".options[document.form1." . $KeyName . ".selectedIndex].value;\n\t\t"; print "\turl=\"?action=export_\"+mark+\"_data&exportfield=\"+exportfield+\"&tablename=\"+tablename_+\"&searchfield=\"+searchfield_+\"&searchvalue=\"+searchvalue_+\"&" . $KeyName . "=\"+" . $KeyName . "SelectValue+AdvanceSearch_"; } print "\n\t//url\n\t//alert(url);\n\tlocation=url;\n\t}\n\t</script>"; form_begin("form1"); table_begin($tablewidth); switch ($mode) { case 'table': print_title($common_html['common_html']['tableexport'], 3); print "<TR class=TableData>\n"; print "<TD noWrap align=middle>选择</TD>\n"; print "<TD width=200>字段描述</TD>\n"; print "<TD width=200>字段名称</TD>\n"; print "</TR>\n"; for ($i = 0; $i < sizeof($columns); $i++) { $list = $columns[$i]; print "<TR class=TableData>\n"; print "<TD noWrap align=middle width=20><input type=\"checkbox\" checked name=\"selectfield\" value=\"{$list}\"></TD>\n"; print "<TD>" . $html_etc[$tablename][$list] . "</TD>\n"; print "<TD>{$list}</TD>\n"; print "</TR>\n"; $temp_function = 'selectfield_str'; } break; case 'content': print_title($common_html['common_html']['contentexport'], 3); print "<TR class=TableData>\n"; print "<TD noWrap align=center width=30>选择</TD>\n"; print "<TD width=100>字段描述</TD>\n"; print "<TD width=150>字段名称</TD>\n"; print "</TR>\n"; //附加组数据导出--开始 //print_R($group_filter_Array); if ($group_filter != "" && $_GET['actionadv'] != "exportadv_default") { //如果强制GET变量已经进行过预定义,那么沿用预定义内容进行 2010-9-2 $TableFieldIndex = $group_filter_Array[0]; $KeyName = $columns[$TableFieldIndex]; $PHP_SELF_ARRAY = explode('/', $_SERVER['PHP_SELF']); $FILE_SELF_NAME = array_pop($PHP_SELF_ARRAY); $FileDirName = array_pop($PHP_SELF_ARRAY); //用于PGSQL下面不进行数据较验 //print $_SESSION['LOGIN_USER_ID']; //如果强制GET变量已经进行过预定义,那么沿用预定义内容进行 2010-9-2 //&&$FileDirName=="Teacher" 只有在Teacher目录下面使用 2010-9-25 正常使用 if ($_GET[$KeyName] != "") { //$ChildTableName = $group_filter_Array[1]; //$ChildTableFieldValueIndex = $group_filter_Array[2]; //$ChildTableFieldNameIndex = $group_filter_Array[3]; //print $KeyName; $附加判断条件Array = explode(',', $_GET[$KeyName]); $附加判断条件 = "'" . join("','", $附加判断条件Array) . "'"; $sql = "\n\t\t\t\t\tselect {$ChildTableFieldValue},{$ChildTableFieldName}\n\t\t\t\t\tfrom {$ChildTableName}\n\t\t\t\t\twhere ( {$ChildTableFieldValue} in ({$附加判断条件})\n\t\t\t\t\t\t\tor\n\t\t\t\t\t\t\t{$ChildTableFieldName} in ({$附加判断条件})\n\t\t\t\t\t\t\t)\n\t\t\t\t\torder by {$ChildTableFieldName}"; // } else { $sql = "select {$ChildTableFieldValue},{$ChildTableFieldName} from {$ChildTableName} order by {$ChildTableFieldName}"; } //print $sql; //print $index_name;print_R($_GET); $rs = $db->CacheExecute(150, $sql); $rs_a = $rs->GetArray(); if ($Childhtml_etc[$ChildTableName][$ChildTableFieldName] != "") { $ShowText = "按" . $html_etc[$tablename][$KeyName] . "过滤"; //$ShowText = "按".$Childhtml_etc[$ChildTableName][$ChildTableFieldName]."过滤"; } else { $ShowText = "按" . $html_etc[$tablename][$KeyName] . "过滤"; } print "<TR class=TableData>\n"; print "<TD noWrap align=middle><input type=\"checkbox\" checked name=\"selectidtemp\" disabled value=\"{$index}\"></TD>\n"; print "<TD width=120 nowrap>" . $ShowText . "</TD>\n"; print "<TD width=150 nowrap>"; //print_R($_GET); //print $KeyName; //如果隐藏的话就显示为只读 if ($group_filter_Array[4] == "hidden") { //如果隐藏的话就显示为只读 $显示名称 = returntablefield($ChildTableName, $ChildTableFieldValue, $_GET[$KeyName], $ChildTableFieldName); print "<select class=\"SmallSelect\" name=\"" . $KeyName . "\">\n"; print "<option value=\"" . $_GET[$KeyName] . "\" >" . $显示名称 . "[" . $_GET[$KeyName] . "]</option>\n"; print "</select>\n"; } else { //显示成为列表 print "<select class=\"SmallSelect\" name=\"" . $KeyName . "\" >\n"; //print "<option value=\"\" >".$common_html['common_html']['allrecords']."</option>\n"; print "<option value=\"\" >" . $html_etc[$tablename][$list['index_name']] . "[" . $common_html['common_html']['allrecords'] . "]</option>\n"; //2009-12-24加入对列表组的过滤 for ($i = 0; $i < sizeof($rs_a); $i++) { if ($_GET[$KeyName] == $rs_a[$i][$ChildTableFieldValue]) { $CheckedX = "selected"; } else { $CheckedX = ""; } print "<option value=\"" . $rs_a[$i][$ChildTableFieldValue] . "\" {$CheckedX} >" . $rs_a[$i][$ChildTableFieldName] . "[" . $rs_a[$i][$ChildTableFieldValue] . "]</option>\n"; } print "</select>\n"; } //2009-12-24加入对搜索属性的支持 print "<input type=hidden name='searchfield' value='" . $_GET['searchfield'] . "'>\n"; print "<input type=hidden name='searchvalue' value='" . $_GET['searchvalue'] . "'>\n"; print "<input type=hidden name='tablename' value='{$tablename}'>\n"; print "<input type=hidden name='AdvanceSearch' value='{$ADD_SEARCH_VALUE}'>\n"; print "</TD></TR>\n"; } else { //高级搜索时出现的隐藏变量 if ($_GET['actionadv'] == "exportadv_default") { print "<TR class=TableData>\n"; print "<TD noWrap align=middle><input type=\"checkbox\" checked name=\"selectidtemp\" disabled value=\"{$index}\"></TD>\n"; print "<TD width=90% colspan=2>高级搜索:\n"; //print "<select class=\"SmallSelect\" name=\"".$KeyName."\" disabled>\n"; //print "<option value=\"\" >".$common_html['common_html']['allrecords']."</option>\n"; //print "<option value=\"\" >".$html_etc[$tablename][$list['index_name']]."[".$common_html['common_html']['allrecords']."]</option>\n"; //print "</select>\n"; $showlistfieldlist_array = explode(',', $showlistfieldlist); //print_R($showlistfieldlist_array); for ($i = 0; $i < sizeof($showlistfieldlist_array); $i++) { $index = $showlistfieldlist_array[$i]; $list = $columns[$index]; if ($_GET[$list] != "") { $ADD_SEARCH_VALUE .= "&{$list}=" . $_GET[$list]; $ADD_SEARCH_TEXT .= " {$list}:" . $_GET[$list]; } else { if ($_GET[$list . "_最小值"] != "" && $_GET[$list . "_最大值"] != "") { $ADD_SEARCH_VALUE .= "&" . $list . "_最小值=" . $_GET[$list . "_最小值"] . "&" . $list . "_最大值=" . $_GET[$list . "_最大值"] . ""; $ADD_SEARCH_TEXT .= " " . $list . "最小值:" . $_GET[$list . "_最小值"] . " " . $list . "最大值:" . $_GET[$list . "_最大值"] . ""; } else { if ($_GET[$list . "_开始时间"] != "" && $_GET[$list . "_结束时间"] != "") { $ADD_SEARCH_VALUE .= "&" . $list . "_开始时间=" . $_GET[$list . "_开始时间"] . "&" . $list . "_结束时间=" . $_GET[$list . "_结束时间"] . ""; $ADD_SEARCH_TEXT .= " " . $list . "开始时间:" . $_GET[$list . "_开始时间"] . " " . $list . "结束时间:" . $_GET[$list . "_结束时间"] . ""; } } } } print $ADD_SEARCH_TEXT; //print $ADD_SEARCH_VALUE; print "<input type=hidden name='{$KeyName}' value='" . $_GET['searchfield'] . "'>\n"; print "<input type=hidden name='searchfield' value='" . $_GET['searchfield'] . "'>\n"; print "<input type=hidden name='searchvalue' value='" . $_GET['searchvalue'] . "'>\n"; print "<input type=hidden name='tablename' value='{$tablename}'>\n"; print "<input type=hidden name='AdvanceSearch' value='{$ADD_SEARCH_VALUE}'>\n"; print "</TD></TR>\n"; } else { print "<TR class=TableData>\n"; print "<TD noWrap align=middle><input type=\"checkbox\" checked name=\"selectidtemp\" disabled value=\"{$index}\"></TD>\n"; print "<TD width=120 disabled>数据过滤</TD>\n"; print "<TD width=150 nowrap>"; print "<select class=\"SmallSelect\" name=\"" . $KeyName . "\" disabled>\n"; //print "<option value=\"\" >".$common_html['common_html']['allrecords']."</option>\n"; print "<option value=\"\" >" . $html_etc[$tablename][$list['index_name']] . "[" . $common_html['common_html']['allrecords'] . "]</option>\n"; print "</select>\n"; print "<input type=hidden name='searchfield' value='" . $_GET['searchfield'] . "'>\n"; print "<input type=hidden name='searchvalue' value='" . $_GET['searchvalue'] . "'>\n"; print "<input type=hidden name='tablename' value='{$tablename}'>\n"; print "<input type=hidden name='AdvanceSearch' value='{$ADD_SEARCH_VALUE}'>\n"; print "</TD></TR>\n"; } } //附加组数据导出--结束 $showlistfieldlist_array = explode(',', $showlistfieldlist); //print_R($showlistfieldlist_array); for ($i = 0; $i < sizeof($showlistfieldlist_array); $i++) { $index = $showlistfieldlist_array[$i]; $list = $columns[$index]; print "<TR class=TableData>\n"; print "<TD noWrap align=middle><input type=\"checkbox\" checked name=\"selectid\" value=\"{$index}\"></TD>\n"; print "<TD >" . $html_etc[$tablename][$list] . "</TD>\n"; print "<TD >{$list}</TD>\n"; print "</TR>\n"; $temp_function = 'selectid_str_init'; } break; } global $returnmodel; $returnmodelArray = explode(',', $returnmodel); if ($returnmodelArray[1] != "") { $returnmodelURL = $returnmodelArray[1]; } else { $returnmodelURL = "?"; } print "<tr align=\"center\" class=\"TableControl\">\n<td colspan=\"3\" nowrap>\n<div align=\"center\">\n\n\t<input type=\"button\" value=\"" . $common_html['common_html']['export'] . "CSV\" accesskey='v' title=\"" . $common_html['common_html']['accesskey'] . ":ALT+V\" class=\"SmallButton\" onClick=\"selectid_str_init_CSV('{$mark}');\">\n\t<input type=\"button\" value=\" " . $common_html['common_html']['export'] . "EXCEL \" accesskey='x' title=\"" . $common_html['common_html']['accesskey'] . ":ALT+X\" class=\"SmallButton\" onClick=\"selectid_str_init_XLS('{$mark}');\">\n\t<input type=\"button\" accesskey='c' title=\"" . $common_html['common_html']['accesskey'] . ":ALT+C\" value=\"" . $common_html['common_html']['cancel'] . "\" class=\"SmallButton\" onClick=\"location='{$returnmodelURL}'\"></div>\n</td></tr>\n"; table_end(); form_end(); print "<BR>"; }
function show_preferences() { global $uid; global $skin; global $PHP_SELF; $sth = mysql_query("select * from skins"); while ($skins = mysql_fetch_array($sth)) { $options[$skins["name"]] = $skins["id"]; } $sth = mysql_query("select admin from users where id={$uid}"); if (!$sth) { show_error("Database failuer!"); return 0; } $admin = mysql_fetch_array($sth); if ($admin["admin"] != "") { show_message("<a href='adminarea.php'>Enter Admin Area</a>"); } $map_info = new map_info($uid); if ($map_info->has_map_anims() == 1) { $checked = "checked"; } echo "<form method=POST action=\"" . $PHP_SELF . "\">"; table_start("center", "400"); table_head_text(array("Appearence"), "2"); table_text(array(" "), "", "", "2", "head"); table_form_select("Skin", "skin_new", $options, $skin, "head", "text"); table_form_submit("Change", "change_skin", "", "text"); table_end(); echo "</form>\n"; //runelord: map_sizes $sth = mysql_query("select map_size from options where uid=" . $uid); if (!$sth || !mysql_num_rows($sth)) { show_error("oops, DB Failure"); return 0; } list($current_map_size) = mysql_fetch_row($sth); $map_sizes_output = "<select name=\"map_size\" size=\"1\">"; $sth = mysql_query("SELECT * FROM map_sizes ORDER BY width ASC"); if (!$sth || !mysql_num_rows($sth)) { show_error("Database Failureeeeerrerererererere"); return 0; } while ($map_sizes = mysql_fetch_array($sth)) { if ($current_map_size == $map_sizes["id"]) { $map_sizes_output .= "<option selected value=\"" . $map_sizes["id"] . "\">" . $map_sizes["width"] . " : " . $map_sizes["height"] . "</option>"; } else { $map_sizes_output .= "<option value=\"" . $map_sizes["id"] . "\">" . $map_sizes["width"] . " : " . $map_sizes["height"] . "</option>"; } } $map_sizes_output .= "</select>"; echo "<form method=POST action=\"" . $PHP_SELF . "\">"; table_start("center", "400"); table_head_text(array("Map Settings"), "2"); table_text(array(" "), "", "", "2", "head"); table_text(array("Map Size"), "", "", "2", "head"); table_text(array($map_sizes_output), "", "", "2", "text"); table_form_submit("Change", "change_map_size", "", "text"); echo "</form>\n"; echo "<form method=POST action=\"" . $PHP_SELF . "\">"; table_text(array(" "), "", "", "2", "head"); table_text(array("Animations (KSVG needs disabled animations)", "<input type=\"checkbox\" name=\"animations\" value=\"1\" {$checked}>"), "", "", "", "head"); table_form_submit("Change", "change_anims", "", "text"); table_end(); echo "</form>\n"; table_start("center", "400"); echo "<form method=POST action=\"" . $PHP_SELF . "\">"; table_text(array("Change Password", " "), "", "", "", "head"); table_text_open(); table_text_design("Old Password", "300", "left", "", "text"); table_text_design("<input type=\"password\" align=\"right\" name=\"old\">", "100", "right", "", "text"); table_text_close(); table_text_open(); table_text_design("New Password", "300", "left", "", "text"); table_text_design("<input type=\"password\" align=\"right\" name=\"new1\">", "100", "right", "", "text"); table_text_close(); table_text_open(); table_text_design("Re-type new Password", "300", "left", "", "text"); table_text_design("<input type=\"password\" align=\"right\" name=\"new2\">", "100", "right", "", "text"); table_text_close(); table_form_submit("Set", "change_pw", "", "text"); table_end(); echo "</form>"; }
ini_set('display_errors', 1); ini_set('error_reporting', E_ALL); error_reporting(E_WARNING | E_ERROR); require_once 'lib.inc.php'; $GLOBAL_SESSION = returnsession(); page_css("MYSQL 性能监控"); //自动清除七天以前的历史记录 $sql = "delete from system_logall where datediff(now(),当前时间)>=7"; $db->Execute($sql); $sql = "select DATE_FORMAT(当前时间,'%Y-%m-%d') AS 当前时间\n\t\tfrom system_logall\n\t\tgroup by DATE_FORMAT(当前时间,'%Y-%m-%d')\n\t\torder by 当前时间 desc\n\t\t"; $rs = $db->CacheExecute(5, $sql); $rs_a = $rs->GetArray(); for ($i = 0; $i < sizeof($rs_a); $i++) { $当前时间TEXT .= "<a href='?" . base64_encode("XX=XX&&当前时间=" . $rs_a[$i]['当前时间'] . "&&XX=XX") . "'>" . $rs_a[$i]['当前时间'] . "</a> "; } if ($_GET['当前时间'] != '') { $统计时间 = $_GET['当前时间']; } else { $统计时间 = $rs_a[0]['当前时间']; } table_begin("100%"); print "<tr class=TableData ><td>MYSQL 运行情况监控 时间:" . $统计时间 . " {$当前时间TEXT}\n\t<input type=\"button\" class=\"SmallButton\" value=\"返回\" onclick=\"location='database_setting.php'\">\n\t<input type=\"button\" class=\"SmallButton\" value=\"明细\" onclick=\"location='system_logall_newai.php'\">\n\t</td></tr>"; table_end(); print "<BR>"; table_begin("780"); print_title("MYSQL 线程运行情况监控[以小时为单位统计] <a href=\"system_logall_mysqlthreads.php?" . base64_encode("XX=XX&&统计时间=" . $统计时间 . "&统计单位=秒&XX=XX") . "\" target=_blank>查看以秒为单位的统计图</a>"); print "<tr class=TableData ><td><img src='system_logall_mysqlthreads.php?" . base64_encode("XX=XX&&统计时间=" . $统计时间 . "&&XX=XX") . "' width=100% border=0></td></tr>"; print_title("MYSQL 查询缓存运行情况监控[以小时为单位统计] <a href=\"system_logall_querycache.php?" . base64_encode("XX=XX&&统计时间=" . $统计时间 . "&统计单位=秒&XX=XX") . "\" target=_blank>查看以秒为单位的统计图</a>"); print "<tr class=TableData ><td><img src='system_logall_querycache.php?" . base64_encode("XX=XX&&统计时间=" . $统计时间 . "&&XX=XX") . "' width=100% border=0></td></tr>"; table_end();
function print_ship_info($prod_id) { if ($info = get_ship_info($prod_id)) { table_start("center", "500"); table_head_text(array("Ships info for " . $info["name"]), "6"); table_text_open("head"); table_text_design(" ", "500", "", "2", "head"); table_text_close(); $info["p_depend"] = get_name_by_prod_id($info["p_depend"]); switch ($info["target1"]) { case "L": $info["target1"] = "Europe Class"; break; case "M": $info["target1"] = "Zeus Class"; break; case "H": $info["target1"] = "Olymp Class"; break; } switch ($info["special"]) { case "E": $info["special"] = "Freezes enemy ships"; break; case "R": $info["special"] = "Capable of stealing ships"; break; case "S": $info["special"] = "Detects cloaked ships"; break; case "C": $info["special"] = "Cloaked"; break; default: $info["special"] = "Nothing"; } foreach (array("name" => "Name", "metal" => "Metal", "energy" => "Energy", "mopgas" => "Mopgas", "erkunum" => "Erkunum", "gortium" => "Gortium", "susebloom" => "Susebloom", "rname" => "Needs tech", "p_depend" => "Needs building", "initiative" => "Initiative", "agility" => "Agility", "warpreload" => "Reload time", "hull" => "Hull", "tonnage" => "Tonnage", "weaponpower" => "Weaponpower", "shield" => "Shield", "ecm" => "ECM", "sensor" => "Sensor", "weaponskill" => "Weaponskill", "target1" => "Attacks", "special" => "Special abilities", "num_attacks" => "Number of attacks") as $key => $show) { table_text_open("text"); table_text_design($show, "250", "", "", "text"); table_text_design($info[$key], "250", "", "", "text"); table_text_close(); } table_end(); } else { show_error("Can't get ship info!"); return 0; } }