Example #1
0
function render_item_tooltip(&$Row)
{
    // БД
    global $DB;
    // Строковые константы
    global $resz, $resz_desc, $bag_typez, $bond, $slot, $armor_type, $weapon_type, $projectile_type;
    // Зеленый текст
    global $green;
    // Столбцы для извлечения
    global $itemset_col;
    $green = array();
    $x = '';
    // Начальный тег таблицы
    $x .= '<table><tr><td>';
    // Название и цвет названия
    $x .= '<b class="q' . $Row['quality'] . '">' . localizedName($Row) . '</b><br />';
    // Проверяем героическая ли вещь, и если да, то отображаем это в тултипе
    $ilvlarray = array("284", "277", "271", "258");
    if (in_array($Row['ItemLevel'], $ilvlarray, true) and $Row['entry'] != "49623") {
        $x .= '<font color="limegreen">' . LOCALE_ITEM_HEROIC . '</font><br>';
    }
    // Уровень вещи
    if ($Row['ItemLevel'] != 0) {
        $x .= '<font color="gold">' . LOCALE_ITEM_LEVEL . ' ' . $Row['ItemLevel'] . '</font>';
    }
    // Биндинг вещи
    $x .= $bond[$Row['bonding']];
    // Уникальность вещи
    if ($Row['maxcount'] == 1) {
        $x .= '<br />' . LOCALE_UNIQUE;
    }
    if ($Row['maxcount'] > 1) {
        $x .= ' (' . $Row['maxcount'] . ')';
    }
    if ($Row['startquest']) {
        $x .= '<br /><a class="q1" href="?quest=' . $Row['startquest'] . '">' . LOCALE_START_QUEST . '</a>';
    }
    // Локация, для которой предназначен этот предмет
    if ($Row['Map']) {
        $x .= '<br />' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_zones WHERE mapid=?d LIMIT 1', $Row['Map']);
    }
    // Теперь в зависимости от типа предмета
    if ($Row['ContainerSlots'] > 1) {
        $x .= '<br />' . $Row['ContainerSlots'] . LOCALE_SLOT . $bag_typez[$Row['BagFamily']];
    }
    if (in_array($Row['class'], array(4, 2, 6, 7))) {
        // Броня (4), Оружие(2), Патроны(6)
        // Начало таблицы св-в брони
        $x .= '<table width="100%">';
        $x .= '<tr>';
        // Слот
        $x .= '<td>' . $slot[$Row['InventoryType']] . '</td>';
        // Тип брони
        if ($Row['class'] == 4) {
            $x .= '<th>' . $armor_type[$Row['subclass']] . '</th>';
        } elseif ($Row['class'] == 2) {
            $x .= '<th>' . $weapon_type[$Row['subclass']] . '</th>';
        } elseif ($Row['class'] == 6) {
            $x .= '<th>' . $projectile_type[$Row['subclass']] . '</th>';
        }
        $x .= '</tr></table>';
    } else {
        $x .= '<br />';
    }
    // Урон
    $dps = 0;
    for ($j = 1; $j <= 2; $j++) {
        $d_type = $Row['dmg_type' . $j];
        $d_min = $Row['dmg_min' . $j];
        $d_max = $Row['dmg_max' . $j];
        if ($d_max > 0 and $Row['class'] != 6) {
            $delay = $Row['delay'] / 1000;
            if ($delay > 0) {
                $dps = $dps + round(($d_max + $d_min) / (2 * $delay), 1);
            }
            if ($j > 1) {
                $delay = 0;
            }
            $x .= inv_dmg($d_min, $d_max, $delay, $d_type);
        } elseif ($d_max > 0 and $Row['class'] == 6) {
            $x .= LOCALE_DPS_ADDS . ' ' . number_format(($d_max + $d_min) / 2, 1) . ' ' . LOCALE_DPS2 . '<br />';
        }
    }
    if ($dps > 0) {
        $x .= '(' . number_format($dps, 1) . ' ' . LOCALE_DPS . ')<br />';
    }
    // Кол-во брони
    if ($Row['armor']) {
        $x .= $Row['armor'] . ' ' . LOCALE_ARMOR . '<br />';
    }
    if ($Row['block']) {
        $x .= $Row['block'] . ' ' . LOCALE_BLOCK . '<br />';
    }
    if ($Row['GemProperties']) {
        $x .= $DB->selectCell('SELECT ?_itemenchantmet.text_loc' . $_SESSION['locale'] . ' FROM ?_itemenchantmet, ?_gemproperties WHERE (?_gemproperties.gempropertiesID=?d and ?_itemenchantmet.itemenchantmetID=?_gemproperties.itemenchantmetID)', $Row['GemProperties']) . '<br />';
    }
    // Различные бонусы
    for ($j = 1; $j <= 10; $j++) {
        if ($Row['stat_type' . $j] != 0 and $Row['stat_value' . $j] != 0) {
            $x .= b_type($Row['stat_type' . $j], $Row['stat_value' . $j], $Row['RequiredLevel']);
        }
    }
    // Бонусы к сопротивлениям магий
    foreach ($resz as $j => $RowName) {
        if ($Row[$RowName] != 0) {
            $x .= '+' . $Row[$RowName] . ' ' . $resz_desc[$j] . '<br />';
        }
    }
    // Случайные бонусы
    if ($Row['RandomProperty'] or $Row['RandomSuffix']) {
        $green[] = 'Random Bonuses';
    }
    // Сокеты
    for ($j = 1; $j <= 3; $j++) {
        if ($Row['socketColor_' . $j] != 0) {
            $x .= socket_type($Row['socketColor_' . $j]) . '<br />';
        }
    }
    if ($Row['socketBonus']) {
        $x .= '<span class="q0">' . LOCALE_SOCKET_BONUS . ': ' . socket_bonus($Row['socketBonus']) . '</span><br />';
    }
    // Состояние
    if ($Row['MaxDurability']) {
        $x .= LOCALE_DURABILITY . ' ' . $Row['MaxDurability'] . ' / ' . $Row['MaxDurability'] . '<br />';
    }
    // Требуемые классы
    if (classes($Row['AllowableClass'])) {
        // Распределяем вещи
        if ($Row['class'] == 4 and $Row['subclass'] == 1) {
            if ($Row['AllowableClass'] == 16) {
                $x .= LOCALE_CLASSES . ': ' . classes('16') . '<br />';
            } elseif ($Row['AllowableClass'] == 128) {
                $x .= LOCALE_CLASSES . ': ' . classes('128') . '<br />';
            } elseif ($Row['AllowableClass'] == 256) {
                $x .= LOCALE_CLASSES . ': ' . classes('256') . '<br />';
            } else {
                $x .= LOCALE_CLASSES . ': ' . classes('400') . '<br />';
            }
        } elseif ($Row['class'] == 4 and $Row['subclass'] == 2) {
            if ($Row['AllowableClass'] == 8) {
                $x .= LOCALE_CLASSES . ': ' . classes('8') . '<br />';
            } elseif ($Row['AllowableClass'] == 1024) {
                $x .= LOCALE_CLASSES . ': ' . classes('1024') . '<br />';
            } else {
                $x .= LOCALE_CLASSES . ': ' . classes('1032') . '<br />';
            }
        } elseif ($Row['class'] == 4 and $Row['subclass'] == 3) {
            if ($Row['AllowableClass'] == 4) {
                $x .= LOCALE_CLASSES . ': ' . classes('4') . '<br />';
            } elseif ($Row['AllowableClass'] == 64) {
                $x .= LOCALE_CLASSES . ': ' . classes('64') . '<br />';
            } else {
                $x .= LOCALE_CLASSES . ': ' . classes('68') . '<br />';
            }
        } elseif ($Row['class'] == 4 and $Row['subclass'] == 4) {
            if ($Row['AllowableClass'] == 1) {
                $x .= LOCALE_CLASSES . ': ' . classes('1') . '<br />';
            } elseif ($Row['AllowableClass'] == 2) {
                $x .= LOCALE_CLASSES . ': ' . classes('2') . '<br />';
            } elseif ($Row['AllowableClass'] == 32) {
                $x .= LOCALE_CLASSES . ': ' . classes('32') . '<br />';
            } else {
                $x .= LOCALE_CLASSES . ': ' . classes('35') . '<br />';
            }
        } else {
            $x .= LOCALE_CLASSES . ': ' . classes($Row['AllowableClass']) . '<br />';
        }
    }
    // Требуемый уровень
    if ($Row['RequiredLevel'] > 1) {
        $x .= LOCALE_REQUIRES_LEVEL . ' ' . $Row['RequiredLevel'] . '<br />';
    }
    // Требуемый скилл (755 - Jewecrafting)
    if ($Row['RequiredSkill'] and $Row['RequiredSkill'] != 755) {
        $x .= LOCALE_REQUIRES . ' ' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_skill WHERE skillID=?d LIMIT 1', $Row['RequiredSkill']);
        if ($Row['RequiredSkillRank']) {
            $x .= ' (' . $Row['RequiredSkillRank'] . ')';
        }
        $x .= '<br />';
    }
    // Требуемый спелл
    if ($Row['requiredspell']) {
        $x .= LOCALE_REQUIRES . ' ' . req_spell($Row['requiredspell']) . '<br />';
    }
    // Требуемая репутация
    if ($Row['RequiredReputationFaction']) {
        require_once 'includes/game.php';
        global $rep_levels;
        $row = factioninfo($Row['RequiredReputationFaction']);
        $x .= LOCALE_REQUIRES . ' ' . $row['name'] . ' - ' . $rep_levels[$Row['RequiredReputationRank']];
    }
    if ($Row['SellPrice'] > 0) {
        $sellgold = floor($Row['SellPrice'] / 10000);
        $sellsilver = floor($Row['SellPrice'] % 10000 / 100);
        $sellcopper = floor($Row['SellPrice'] % 100);
        $x .= LOCALE_SELLPRICE . ' ';
        if ($sellgold > 0) {
            $x .= '<span class="moneygold">' . $sellgold . '</span> ';
        }
        if ($sellsilver > 0) {
            $x .= '<span class="moneysilver">' . $sellsilver . '</span> ';
        }
        if ($sellcopper > 0) {
            $x .= '<span class="moneycopper">' . $sellcopper . '</span> <br />';
        }
    }
    $x .= '</td></tr></table>';
    // Спеллы
    for ($j = 1; $j <= 5; $j++) {
        if ($Row['spellid_' . $j]) {
            $green[] = spell_to_bonus($Row['spellid_' . $j], $Row['spelltrigger_' . $j], $Row['spellcharges_' . $j], $Row['spellppmRate_' . $j], $Row['spellcooldown_' . $j], $Row['spellcategorycooldown_' . $j]);
        }
    }
    // Перебираем все "зеленые" бонусы
    $x .= '<table><tr><td>';
    if ($green) {
        foreach ($green as $j => $bonus) {
            if ($bonus) {
                $x .= '<span class="q2">' . $bonus . '</span><br />';
            }
        }
    }
    if ($Row['description']) {
        if ($Row['spelltrigger_2'] == 6) {
            $x .= '<span class="q2">' . LOCALE_GBONUS_USE . ' <a href="?spell=' . $Row['spellid_2'] . '">' . localizedName($Row, 'description') . '</a></span>';
        } else {
            $x .= '<span class="q">"' . localizedName($Row, 'description') . '"</span>';
        }
    }
    if ($Row['PageText']) {
        $x .= '<br /><span class="q2">&lt;Click derecho para leer&gt;</span>';
    }
    // TODO: locale
    // Item Set
    // Временное хранилище всех вещей;
    $x_tmp = '';
    $row = $DB->selectRow('SELECT ?# FROM ?_itemset WHERE itemsetID=?d LIMIT 1', $itemset_col[1], $Row['itemset']);
    if (!$row) {
        $row = $DB->selectRow('SELECT ?# FROM ?_itemset WHERE (item1=?d or item2=?d or item3=?d or item4=?d or item5=?d or item6=?d or item7=?d or item8=?d or item9=?d or item10=?d) LIMIT 1', $itemset_col[1], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry']);
    }
    if ($row) {
        //$x .= '<br />';
        $num = 0;
        // Кол-во вещей в наборе
        for ($i = 1; $i <= 10; $i++) {
            if ($row['item' . $i] > 0) {
                $num++;
                $name = getitemname($row['item' . $i]);
                $x_tmp .= '<span><a href="?item=' . $row['item' . $i] . '">' . $name . '</a></span><br />';
            }
        }
        $x .= '<br /><span class="q"><a href="?itemset=' . $row['itemsetID'] . '" class="q">' . $row['name_loc' . $_SESSION['locale']] . '</a> (0/' . $num . ')</span>';
        // Если требуется скилл
        if ($row['skillID']) {
            $x .= '<br />';
            $name = $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_skill WHERE skillID=?d LIMIT 1', $row['skillID']);
            $x .= LOCALE_REQUIRES . ' <a href="?spells=11.' . $row['skillID'] . '" class="q1">' . $name . '</a>';
            if ($row['skilllevel']) {
                $x .= ' (' . $row['skilllevel'] . ')';
            }
            $x .= '<br />';
        }
        // Перечисление всех составляющих набора
        $x .= '<div class="q0 indent">' . $x_tmp . '</div><br />';
        // Перечисление всех бонусов набора
        $x .= '<span class="q0">';
        $num = 0;
        for ($j = 1; $j <= 8; $j++) {
            if ($row['spell' . $j]) {
                $itemset['spells'][$num]['entry'] = $row['spell' . $j];
                $itemset['spells'][$num]['tooltip'] = spell_desc($row['spell' . $j]);
                $itemset['spells'][$num]['bonus'] = $row['bonus' . $j];
                $num++;
            }
        }
        // Сортировка бонусов
        $x .= '<span class="q0">';
        for ($i = 0; $i < $num; $i++) {
            for ($j = $i; $j <= $num - 1; $j++) {
                if ($itemset['spells'][$j]['bonus'] < $itemset['spells'][$i]['bonus']) {
                    unset($tmp);
                    $tmp = $itemset['spells'][$i];
                    $itemset['spells'][$i] = $itemset['spells'][$j];
                    $itemset['spells'][$j] = $tmp;
                }
            }
            $x .= '<span>(' . $itemset['spells'][$i]['bonus'] . ') Set: <a href="?spell=' . $itemset['spells'][$i]['entry'] . '">' . $itemset['spells'][$i]['tooltip'] . '</a></span><br />';
        }
        $x .= '</span></span>';
    }
    $x .= '</td></tr></table>';
    return $x;
}
Example #2
0
{
    public $flask;
    public function serialize()
    {
        return serialize($this);
    }
}
function classes()
{
    $lab = new lab();
    $lab->flask = "erlenmeyer";
    $save = $lab->serialize();
    $newlab = unserialize($save);
    echo $newlab->flask;
}
classes();
//show the last timelog entry for each person:
function lastlog($db)
{
    $sql = "SELECT MIN(logdate) AS mindate FROM " . $db->prefix . "b00_timelog;";
    $stmt = $db->query($sql);
    $row = $stmt->fetchObject();
    $logdate = new DateTime($row->mindate);
    echo "Min date = " . $row->mindate . "<br>\n";
    $stmt->closeCursor();
    $IDs = array();
    $sql = "SELECT person_id, lastname, firstname FROM " . $db->prefix . "c00_person\n\t\t\tORDER BY lastname;";
    $stmt = $db->query($sql);
    while ($row = $stmt->fetchObject()) {
        $IDs[strval($row->person_id)] = $row->lastname . ", " . $row->firstname;
    }
Example #3
0
function editPromo()
{
    $oldShortcut = mysql_real_escape_string($_POST['oldShortcut']);
    $newName = mysql_real_escape_string($_POST['newName']);
    $newShortcut = mysql_real_escape_string($_POST['newShortcut']);
    //Si on modifie la clé primaire on commence par vérifier si le newlibelleShort existe (clé primaire) si il existe on quitte
    if (strcmp($newShortcut, $oldShortcut) != 0) {
        $query = "SELECT shortcut FROM promo";
        $result = mysql_query($query) or die(mysql_error());
        while ($data = mysql_fetch_array($result)) {
            if ($data['shortcut'] == $newShortcut) {
                $_SESSION['classError'] = true;
                return classes();
                //Il y a déjà une promos avec comme shortcut $newLibelleShort
            }
        }
    }
    //Ensuite on regarde si l'ancien existe libelleShort (clé primaire) si oui on le modifie
    $query = "SELECT shortcut FROM promo";
    $result = mysql_query($query) or die(mysql_error());
    while ($data = mysql_fetch_array($result)) {
        if ($data['shortcut'] == $oldShortcut) {
            //Si le shortcut existe on modifie
            $query = 'UPDATE promo
					  SET name = "' . $newName . '", shortcut = "' . $newShortcut . '"
					  WHERE shortcut = "' . $oldShortcut . '"';
            $result = mysql_query($query) or die(mysql_error());
            return classes();
            //OK
        }
    }
    //Si on arrive ici c'est que le libelleShort (la clé primaire) n'existe pas
    return classes();
    //oldLibelleShort n'existe pas
}
function browse_students($title)
{
    if (!check_login()) {
        header('location:login.php');
    } else {
        include 'config/globals.php';
        $cls_page = $_SERVER['QUERY_STRING'];
        $cp = explode('/', $cls_page);
        $len = count($cp);
        if ($len == 2 or $len == 3 and $cp[2] == null) {
            $class = '/^' . $globalbranch . '[1-' . $classno . ']{1}$/';
            $page = '/^[1-9]{1}$/';
            if (preg_match($class, $cp[0]) and preg_match($page, $cp[1])) {
                include 'config/db.php';
                include 'config/settings.php';
                $dbname = $branchyear . '_Users';
                $table = $branchyear . '_Students';
                //if(!mysql_select_db($dbname)){die(mysql_error());}
                echo "<!DOCTYPE html>\n<html>\n";
                display_headers($title);
                echo "\n<body>";
                menu();
                echo <<<browse
\t\t\t\t\t<div class="container" style="margin-top:-15px;height:450px;"><br>
\t\t\t\t\t\t<div class="row">
\t\t\t\t\t\t\t<div class="span9">
\t\t\t\t\t\t\t\t<div class="well well-large" style="background:#FFF;">
\t\t\t\t\t\t\t\t\t<div class="row">
\t\t\t\t\t\t\t\t\t\t<div id="step1" class="span4">     
\t\t\t\t\t\t\t\t\t\t\t<h5>Students @ {$cp['0']} </h5>
\t\t\t\t\t\t\t\t\t\t\t<h6> &emsp;&emsp;&emsp; - &emsp; Listing all students in {$cp['0']} </h6>
\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t<div id="page1" class="span4">
\t\t\t\t\t\t\t\t\t\t\t<a class="pull-right"><h6>Page {$cp['1']}  </h6></a>
\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t<div id={$cp['0']} >
\t\t\t\t\t\t\t\t\t\t<table class="table  table-hover table-bordered "  style="padding:0px;">
\t\t\t\t\t\t\t\t\t\t\t<thead>
\t\t\t\t\t\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t\t\t\t\t\t<th style="text-align:center;" class="span1">RNo</th> 
\t\t\t\t\t\t\t\t\t\t\t\t\t<th style="text-align:center;" class="span1">ID #</th>
\t\t\t\t\t\t\t\t\t\t\t\t\t<th style="text-align:center;" class="span3">Name</th> 
\t\t\t\t\t\t\t\t\t\t\t\t\t<th style="text-align:center;" class="span1">Gender</th>
\t\t\t\t\t\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t\t\t\t\t\t</thead>
\t\t\t\t\t\t\t\t\t\t\t<tbody>
browse;
                $page = $cp[1];
                $prev = $page - 1;
                $next = $page + 1;
                $per_page = 10;
                $slimit = ($page - 1) * 10;
                $branch = substr($cp[0], 0, strlen($cp[0]) - 1);
                $class = substr($cp[0], -1);
                $query1 = mysql_query("SELECT Id From " . $table . " WHERE Branch = '{$branch}' and Class = '{$class}';");
                $strength = mysql_num_rows($query1);
                $query = "SELECT Id,Name,Gender,RNo From " . $table . " WHERE Branch='{$branch}' and Class='{$class}' LIMIT {$slimit},{$per_page};";
                $exe = mysql_query($query) or die(mysql_error());
                $lastpage = ceil($strength / $per_page);
                for ($i = 0; $i < mysql_num_rows($exe); $i++) {
                    $det = mysql_fetch_array($exe);
                    $lnk = "./students.php?" . $det[0] . "/sub";
                    $nm = ucwords(strtolower($det[1]));
                    echo <<<student
\t\t\t\t\t<tr onclick="document.location.href='{$lnk}';" style='cursor:pointer;'>  
\t\t\t\t\t\t<td style="text-align:center;">{$det['3']}</td> 
\t\t\t\t\t\t<td style="text-align:center;">{$det['0']}</td> 
\t\t\t\t\t\t<td>{$nm}</td>
\t\t\t\t\t\t<td style="text-align:center;" >{$det['2']}</td>   
\t\t\t\t\t</tr>
student;
                }
                echo <<<next
\t\t\t\t</tbody>
\t\t\t\t</table>\t\t\t
\t\t\t\t</div>
\t\t\t\t<div class="pagination pagination-centered">
\t\t\t\t<ul>
next;
                if ($page == 1 and $strength > 0) {
                    echo "<li class='disabled'><a>&larr;Prev</a></li>";
                    for ($i = 1; $i <= $lastpage; $i++) {
                        echo "<li><a href='?{$cp['0']}/{$i}/'>{$i}</a></li>";
                    }
                    echo "<li><a href='?{$cp['0']}/{$next}/'>Next&rarr;</a></li>";
                } elseif ($page > 1 and $page < $lastpage) {
                    echo "<li><a href='?{$cp['0']}/{$prev}/'>&larr;Prev</a></li>";
                    for ($i = 1; $i <= $lastpage; $i++) {
                        echo "<li><a href='?{$cp['0']}/{$i}/'>{$i}</a></li>";
                    }
                    echo "<li><a href='?{$cp['0']}/{$next}/'>Next&rarr;</a></li>";
                } elseif ($page == $lastpage) {
                    echo "<li><a href='?{$cp['0']}/{$prev}/'>&larr;Prev</a></li>";
                    for ($i = 1; $i <= $lastpage; $i++) {
                        echo "<li><a href='?{$cp['0']}/{$i}/'>{$i}</a></li>";
                    }
                    echo "<li class='disabled'><a>Next&rarr;</a></li>";
                } else {
                    echo "No records found.";
                }
                echo <<<next
\t\t\t\t\t\t</ul>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t<div class="span3">
next;
                go_home();
                classes($classno, $globalbranch);
                echo "</div></div>";
                display_footer();
                echo "\n</div></body>\n</html>";
            } else {
                echo "Error :  Invalid syntax in URL.<br>";
            }
        } else {
            echo "Error :  Invalid syntax in URL.<br>";
        }
    }
}
Example #5
0
function send_notice($title)
{
    if (!check('BA') || !check('BA')) {
        header('location:./?sub');
    } else {
        include 'config/globals.php';
        $to = $_SERVER['QUERY_STRING'];
        $reg = "/^all|allcrs|" . $globalbranch . "[1-" . $classno . "]{1}\$/";
        if (preg_match($reg, $to)) {
            include 'config/db.php';
            include 'config/settings.php';
            $dbname = $branchyear . '_Logs';
            $table = $branchyear . '_Notifications';
            //if(!mysql_select_db($dbname)) die(mysql_error());
            echo "<!DOCTYPE html>\n<html>\n";
            display_headers($title);
            echo <<<js
\t\t\t\t<script type='text/javascript'>
\t\t\t\t\tfunction Preview(id,val){
\t\t\t\t\t\tdocument.getElementById(id).innerHTML=val;
\t\t\t\t\t}
\t\t\t\t</script>
js;
            echo "\n<body>";
            menu();
            echo <<<a
\t\t\t\t<div class="container" style="margin-top:-15px;">
\t\t\t\t\t<br>
\t\t\t\t\t<div id="error"></div>
\t\t\t\t\t<div class="row">
\t\t\t\t\t\t<div class="span9">
\t\t\t\t\t\t\t<div class="well well-large" style="background:#FFF;">
\t\t\t\t\t\t\t\t<div id="stpe2_P1">
\t\t\t\t\t\t\t\t\t<h5>Send Notice @ {$to} :</h5>
\t\t\t\t\t\t\t\t\t<h6> &emsp;&emsp;&emsp; - &emsp; Fill out below details  </h6>
\t\t\t\t\t\t\t\t\t<!--<h5>Period 1 : </h5>-->
\t\t\t\t\t\t\t\t\t<form enctype="multipart/form-data" method="POST" action="" onSubmit="return send_notice();">
a;
            if ($to != "all" and $to != "allcrs") {
                echo <<<to
\t\t\t\t\t\t<h6 > To :</h6>
\t\t\t\t\t\t<label class="radio inline">
\t\t\t\t\t\t<input type="radio" id='CRs' value="CRs" name="to" onclick="Preview(this.name,this.value);"> CRs 
\t\t\t\t\t</label>
\t\t\t\t\t<label class="radio inline">
\t\t\t\t\t\t<input type="radio" id='Students' value="Students" name="to" onclick="Preview(this.name,this.value);"> Students
\t\t\t\t\t</label><br><br>
to;
            } else {
                echo "<br>";
            }
            echo <<<a
\t\t\t\t<h6> Subject :</h6>
\t\t\t\t<input type="text" class="span8" placeholder="Subject" id='subject' name='sub' onkeyup="Preview(this.name,this.value);"><br>
\t\t\t\t<h6> Message :</h6>
\t\t\t\t<textarea class="span8" id='message' name='mes' style="resize:vertical;height:90px;" onkeyup="Preview(this.name,this.value);" placeholder="Type your message here"></textarea>
\t\t\t\t<br>
\t\t\t\t<h6> Attachment (Max : 100 MB):</h6>
\t\t\t\t<input type="file" class="span8" placeholder="Attach a File Here" name='attachment'><br>\t\t\t\t
\t\t\t</div>
\t\t\t<div id="stpe3">
\t\t\t\t<a><h5>Preview : </h5></a><br>
\t\t\t\t<!--<h6> &emsp;&emsp;&emsp; - &emsp; Confirm Your Notice </h6>-->
\t\t\t\t<div class="row">
\t\t\t\t\t<div class="span8">
\t\t\t\t\t\t<table class="table  table-hover table-bordered" >
\t\t\t\t\t\t\t<tbody>
\t\t\t\t\t\t\t\t<tr> <th class="span2"  > To  </th>
a;
            if ($to == "all") {
                echo "<td class='span6' id='to'> ALL </td>  </tr>";
            } else {
                if ($to == "allcrs") {
                    echo "<td class='span6' id='to'> ALL CR's</td>  </tr>";
                } else {
                    echo "<td class='span6' id='to'> To address  </td>  </tr>";
                }
            }
            echo <<<a
\t\t\t\t\t\t\t<tr> <th class="span2"  > Suject </th> <td class="span6" id='sub'> Notification subject  </td>  </tr>
\t\t\t\t\t\t\t<tr> <th class="span2" > Message  </th> <td class="span6" id='mes'> Messasge  </td>  </tr>
\t\t\t\t\t\t</tbody>
\t\t\t\t\t</table>
\t\t\t\t</div>
\t\t\t</div><br>
\t\t\t<input type="submit" class="btn btn-primary" value="Confirm & Send &rarr;" name="send" />
\t\t\t</form>
\t\t</div>
\t\t<br>
\t</div>
</div>
<div class="span3">
a;
            classes($classno, $globalbranch);
            echo "</div></div></div>";
            display_footer();
            echo "\n</body>\n</html>";
        } else {
            echo "<script type='text/javascript'>document.location.href='404.php';</script>";
        }
    }
}
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
      <div class="user-content">
        <?php 
        the_content();
        ?>
      </div>
    <?php 
    }
}
?>

    <?php 
$workshops = classes();
?>

    <?php 
if (count($workshops) > 0) {
    ?>
      <?php 
    foreach ($workshops as $post) {
        _loop::load($post);
        ?>

        <section class="workshop" id="workshop_<?php 
        the_ID();
        ?>
">
          <div class="meta">
/**
 *
 * @param type $Row
 * @return string 
 */
function render_item_tooltip(&$Row)
{
    // БД
    global $DB;
    // Строковые константы
    global $resz, $resz_desc, $bag_typez, $bond, $slot, $armor_type, $weapon_type, $projectile_type;
    // Зеленый текст
    global $green;
    // Столбцы для извлечения
    global $itemset_col;
    $green = array();
    $x = '';
    // Начальный тег таблицы
    $x .= '<table><tr><td>';
    // Название и цвет названия
    $x .= '<b class="q' . $Row['quality'] . '">' . (!empty($Row['name_loc']) ? $Row['name_loc'] : $Row['name']) . '</b>';
    // Биндинг вещи
    $x .= $bond[$Row['bonding']];
    // Уникальность вещи
    if ($Row['maxcount'] == 1) {
        $x .= '<br />' . LOCALE_UNIQUE;
    }
    if ($Row['maxcount'] > 1) {
        $x .= ' (' . $Row['maxcount'] . ')';
    }
    if ($Row['startquest']) {
        $x .= '<br /><a class="q1" href="?quest=' . $Row['startquest'] . '">' . LOCALE_START_QUEST . '</a>';
    }
    // Локация, для которой предназначен этот предмет
    if ($Row['Map']) {
        $x .= '<br />' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_aowow_zones WHERE mapid=?d LIMIT 1', $Row['Map']);
    }
    // Теперь в зависимости от типа предмета
    if ($Row['ContainerSlots'] > 1) {
        $x .= '<br />' . $Row['ContainerSlots'] . LOCALE_SLOT . $bag_typez[$Row['BagFamily']];
    }
    if ($Row['class'] == 4 or $Row['class'] == 2 or $Row['class'] == 6 or $Row['class'] == 7) {
        // Броня (4), Оружие(2), Патроны(6)
        // Начало таблицы св-в брони
        $x .= '<table width="100%">';
        $x .= '<tr>';
        // Слот
        $x .= '<td>' . $slot[$Row['InventoryType']] . '</td>';
        // Тип брони
        if ($Row['class'] == 4) {
            $x .= '<th>' . $armor_type[$Row['subclass']] . '</th>';
        } elseif ($Row['class'] == 2) {
            $x .= '<th>' . $weapon_type[$Row['subclass']] . '</th>';
        } elseif ($Row['class'] == 6) {
            $x .= '<th>' . $projectile_type[$Row['subclass']] . '</th>';
        }
        $x .= '</tr></table>';
    } else {
        $x .= '<br />';
    }
    // Урон
    $dps = 0;
    for ($j = 1; $j <= 5; $j++) {
        $d_type = $Row['dmg_type' . $j];
        $d_min = $Row['dmg_min' . $j];
        $d_max = $Row['dmg_max' . $j];
        if ($d_max > 0 and $Row['class'] != 6) {
            $delay = $Row['delay'] / 1000;
            if ($delay > 0) {
                $dps = $dps + round(($d_max + $d_min) / (2 * $delay), 1);
            }
            if ($j > 1) {
                $delay = 0;
            }
            $x .= inv_dmg($d_min, $d_max, $delay, $d_type);
        } elseif ($d_max > 0 and $Row['class'] == 6) {
            $x .= LOCALE_DPS_ADDS . ' ' . number_format(($d_max + $d_min) / 2, 1) . ' ' . LOCALE_DPS2 . '<br />';
        }
    }
    if ($dps > 0) {
        $x .= '(' . number_format($dps, 1) . ' ' . LOCALE_DPS . ')<br />';
    }
    // Кол-во брони
    if ($Row['armor']) {
        $x .= $Row['armor'] . ' ' . LOCALE_ARMOR . '<br />';
    }
    if ($Row['block']) {
        $x .= $Row['block'] . ' ' . LOCALE_BLOCK . '<br />';
    }
    // Различные бонусы
    for ($j = 1; $j <= 10; $j++) {
        if ($Row['stat_type' . $j] != 0 and $Row['stat_value' . $j] != 0) {
            $x .= b_type($Row['stat_type' . $j], $Row['stat_value' . $j]);
        }
    }
    // Бонусы к сопротивлениям магий
    foreach ($resz as $j => $RowName) {
        if ($Row[$RowName] != 0) {
            $x .= '+' . $Row[$RowName] . ' ' . $resz_desc[$j] . '<br />';
        }
    }
    // Случайные бонусы
    if ($Row['RandomProperty']) {
        $green[] = 'Random Bonuses';
    }
    // Состояние
    if ($Row['MaxDurability']) {
        $x .= LOCALE_DURABILITY . ' ' . $Row['MaxDurability'] . ' / ' . $Row['MaxDurability'] . '<br />';
    }
    // Требуемые классы
    if (classes($Row['AllowableClass'])) {
        $x .= LOCALE_CLASSES . ': ' . classes($Row['AllowableClass']) . '<br />';
    }
    // Требуемый уровень
    if ($Row['RequiredLevel'] > 1) {
        $x .= LOCALE_REQUIRES_LEVEL . ' ' . $Row['RequiredLevel'] . '<br />';
    }
    // Требуемый скилл (755 - Jewecrafting)
    if ($Row['RequiredSkill'] and $Row['RequiredSkill'] != 755) {
        $x .= LOCALE_REQUIRES . ' ' . $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_aowow_skill WHERE skillID=?d LIMIT 1', $Row['RequiredSkill']);
        if ($Row['RequiredSkillRank']) {
            $x .= ' (' . $Row['RequiredSkillRank'] . ')';
        }
        $x .= '<br />';
    }
    // Требуемый спелл
    if ($Row['requiredspell']) {
        $x .= LOCALE_REQUIRES . ' ' . req_spell($Row['requiredspell']) . '<br />';
    }
    // Требуемая репутация
    if ($Row['RequiredReputationFaction']) {
        require_once 'includes/game.php';
        global $rep_levels;
        $row = factioninfo($Row['RequiredReputationFaction']);
        $x .= LOCALE_REQUIRES . ' ' . $row['name'] . ' - ' . $rep_levels[$Row['RequiredReputationRank']];
    }
    $x .= '</td></tr></table>';
    // Спеллы
    for ($j = 1; $j <= 5; $j++) {
        if ($Row['spellid_' . $j]) {
            $green[] = spell_to_bonus($Row['spellid_' . $j], $Row['spelltrigger_' . $j]);
        }
    }
    // Перебираем все "зеленые" бонусы
    $x .= '<table><tr><td>';
    if ($green) {
        foreach ($green as $j => $bonus) {
            if ($bonus) {
                $x .= '<span class="q2">' . $bonus . '</span><br />';
            }
        }
    }
    if ($Row['description']) {
        if ($Row['spelltrigger_2'] == 6) {
            $x .= '<span class="q2">' . LOCALE_GBONUS_USE . ' <a href="?spell=' . $Row['spellid_2'] . '">' . (!empty($Row['description_loc']) ? $Row['description_loc'] : $Row['description']) . '</a></span>';
        } else {
            $x .= '<span class="q">"' . (!empty($Row['description_loc']) ? $Row['description_loc'] : $Row['description']) . '"</span>';
        }
    }
    if ($Row['PageText']) {
        $x .= '<br /><span class="q2">&lt;Right Click To Read&gt;</span>';
    }
    // TODO: locale
    // Item Set
    // Временное хранилище всех вещей;
    $x_tmp = '';
    $row = $DB->selectRow('SELECT ?# FROM ?_aowow_itemset WHERE (item1=?d or item2=?d or item3=?d or item4=?d or item5=?d or item6=?d or item7=?d or item8=?d or item9=?d or item10=?d) LIMIT 1', $itemset_col[1], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry'], $Row['entry']);
    if ($row) {
        $num = 0;
        // Кол-во вещей в наборе
        for ($i = 1; $i <= 10; $i++) {
            if ($row['item' . $i] > 0) {
                $num++;
                $name = getitemname($row['item' . $i]);
                $x_tmp .= '<span><a href="?item=' . $row['item' . $i] . '">' . $name . '</a></span><br />';
            }
        }
        $x .= '<span class="q"><a href="?itemset=' . $row['itemsetID'] . '" class="q">' . $row['name_loc' . $_SESSION['locale']] . '</a> (0/' . $num . ')</span>';
        // Если требуется скилл
        if ($row['skillID']) {
            $name = $DB->selectCell('SELECT name_loc' . $_SESSION['locale'] . ' FROM ?_aowow_skill WHERE skillID=?d LIMIT 1', $row['skillID']);
            $x .= LOCALE_REQUIRES . ' <a href="?spells=11.' . $row['skillID'] . '" class="q1">' . $name . '</a>';
            if ($row['skilllevel']) {
                $x .= ' (' . $row['skilllevel'] . ')';
            }
            $x .= '<br />';
        }
        // Перечисление всех составляющих набора
        $x .= '<div class="q0 indent">' . $x_tmp . '</div>';
        // Перечисление всех бонусов набора
        $x .= '<span class="q0">';
        $num = 0;
        for ($j = 1; $j <= 8; $j++) {
            if ($row['spell' . $j]) {
                $itemset['spells'][$num]['entry'] = $row['spell' . $j];
                $itemset['spells'][$num]['tooltip'] = spell_desc($row['spell' . $j]);
                $itemset['spells'][$num]['bonus'] = $row['bonus' . $j];
                $num++;
            }
        }
        // Сортировка бонусов
        $x .= '<span class="q0">';
        for ($i = 0; $i < $num; $i++) {
            for ($j = $i; $j <= $num - 1; $j++) {
                if ($itemset['spells'][$j]['bonus'] < $itemset['spells'][$i]['bonus']) {
                    unset($tmp);
                    $tmp = $itemset['spells'][$i];
                    $itemset['spells'][$i] = $itemset['spells'][$j];
                    $itemset['spells'][$j] = $tmp;
                }
            }
            $x .= '<span>(' . $itemset['spells'][$i]['bonus'] . ') Set: <a href="?spell=' . $itemset['spells'][$i]['entry'] . '">' . $itemset['spells'][$i]['tooltip'] . '</a></span><br />';
        }
        $x .= '</span></span>';
    }
    $x .= '</td></tr></table>';
    return $x;
}
Example #8
0
function classes_et_methodes($projet)
{
    static $projets = array();
    if (isset($projets[$projet])) {
        $retour = $projets[$projet];
    } else {
        $retour = array();
        $code = file_get_contents(root . "projets/" . $projet . ".php");
        $code = preg_replace('#class ([a-z0-9_]*)#i', 'class ' . $projet . '_$1', $code);
        $code = str_replace(array('<?php', '?>'), "", $code);
        eval($code);
        $classes = classes($projet);
        foreach ($classes as $c) {
            $retour[$c] = array();
            $classe = $projet . "_" . $c;
            $methodes = $classe::methodes_visibles();
            foreach ($methodes['statique'] as $m) {
                array_push($retour[$c], $m);
            }
            foreach ($methodes['instance'] as $m) {
                array_push($retour[$c], $m);
            }
        }
        $projets[$projet] = $retour;
    }
    return $retour;
}