Beispiel #1
0
function umwords_build($p, $o)
{
    $ratio = 50;
    $min = $p * $ratio;
    $limit = $min . ', ' . ($min + $ratio);
    $r = sql_inner('pub_art.id,msg', 'qda', 'qdm', 'id', 'kv', 'where nod="ummo" limit ' . $limit);
    if ($r) {
        foreach ($r as $k => $v) {
            $v = str_replace("'", ' ', $v);
            //$v=str_replace('-',' ',$v);
            $rb = str_word_count($v, 2);
            if ($rb) {
                foreach ($rb as $ka => $va) {
                    if ($va == strtoupper($va) && !umwords_dicos($va) && strlen($va) > 1) {
                        $rd[] = array($k, $va, $ka, soundex($va));
                        //idart,voc,pos,sound
                        $rc[$va] = array($k, $va, $ka, soundex($va));
                    }
                }
            }
        }
    }
    //if(auth(6))umwords_sav($rc);
    return $rd;
    $ret = count($rc);
    $ret .= make_table($rc);
    return $ret;
}
Beispiel #2
0
function udc_build($p)
{
    if ($p == '1' && auth(6)) {
        $r = udc_source();
    }
    $r = msql_read('users', 'ummo_umvoc_1', '', 1);
    if ($r) {
        foreach ($r as $k => $v) {
            $ra[$v[0]] = $v;
        }
    }
    ksort($ra);
    if ($ra) {
        foreach ($ra as $k => $v) {
            //if(strpos($v[3],'Eyaoloowa')!==false){}
            //$rb[$k][]=divc('title',$k);
            $rb[$k][] = lj('', 'popup_plup___umvoc_ud*glossary_' . ajx($k), $k) . ' ';
            $f = 'users/ummo/glyphes/' . strtoupper($k) . '.png';
            $rb[$k][] = is_file($f) ? udc_imz($f, 6) : '';
            //$rb[$k][]=is_file($f)?image('/'.$f,'',''):'';
            $rb[$k][] = stripslashes($v[1]);
            $rb[$k][] = lj('', 'popup_search___' . ajx($k), picto('search', 16));
            $rb[$k][] = $v[3];
        }
    }
    return make_table($rb);
}
Beispiel #3
0
function create_tracking_table($substatus, $textstat)
{
    global $status, $login_id;
    $action = "";
    $issue['id'] = "Bug ID";
    $issue['title'] = "Bug Title";
    $issue['status'] = "Status";
    $issue['login_id'] = "Submitted By";
    $issue['action'] = "Action(s)";
    $out = make_table($issue, "WIDTH=55%");
    $counter = 0;
    db("SELECT id, title, login_id FROM server_issuetracking WHERE status= " . $status . $substatus);
    while ($issues = dbr(1)) {
        $action = "<a href='{$_SERVER['PHP_SELF']}?status={$status}&id={$issues['id']}&action=view'>View</a>";
        if ($login_id == OWNER_ID) {
            //server admin only
            if ($status == 1) {
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=forward'>Outstanding</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=resolve'>Close</a>";
            } elseif ($status == 2) {
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=forward'>Close</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=up'>Up</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=down'>Down</a>";
            } elseif ($status == 3) {
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=reopen'>Reopen</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=up'>Up</a>";
                $action .= " - <a href='{$_SERVER['PHP_SELF']}?&status={$status}&id={$issues['id']}&action=down'>Down</a>";
            }
        }
        //end of admin only.
        $issue['id'] = $issues['id'];
        $issue['title'] = $issues['title'];
        $issue['status'] = $textstat;
        db2("select login_name from user_accounts where login_id = '{$issues['login_id']}'");
        $temp_store = dbr2(1);
        $issue['login_id'] = $temp_store['login_name'];
        $issue['action'] = $action;
        $out .= make_row($issue);
        $counter++;
    }
    if ($counter == 0) {
        //if no bugs
        $issue['id'] = "NONE";
        $issue['title'] = "";
        $issue['status'] = "";
        $issue['login_id'] = "";
        $issue['action'] = "";
        $out .= make_row($issue);
    }
    $out .= "</table>";
    return " - {$counter} Entries<br />" . $out;
}
Beispiel #4
0
function mform_read($id)
{
    reqp('msql');
    $msq = new msql('', ses('mform'));
    $msq->read('i');
    //p($msq->ret);
    //if(auth(6))$ret.=lj('','mfr'.$id.'_plug___microform_mform*read_'.$id,picto('reload'));
    if (auth(6)) {
        $ret .= lj('', ses('mformj'), picto('reload'));
    }
    $ret .= make_table($msq->ret, 'txtcadr', '') . br();
    return $ret;
}
Beispiel #5
0
function mq_cols($p, $o, $res = '')
{
    list($p, $o) = ajxp($res, $p, $o);
    //echo $p."-".$o;
    $r = sql_b('select column_name,data_type,character_maximum_length from information_schema.columns where table_name="' . $p . '" and table_schema="' . $o . '";', '');
    //p($r);
    if ($r) {
        foreach ($r as $v) {
            //p($v);
            $ret[] = array(lj('txtx', 'popup_plup___mysqm_mq*edit_' . $v[0], $v[0]), $v[1], $v[2]);
        }
    }
    return make_table($ret);
}
Beispiel #6
0
function plug_msqads($p, $o)
{
    $rid = 'plg' . randid();
    $p = $p ? $p : 'msqads';
    reqp('msql');
    $msq = new msql('', $p);
    //table
    $rb = array('day', 'quest', 'resp');
    $msq->create($rb);
    $ret .= input(1, $rb[0], $rb[0], '', 1) . br() . txarea($rb[1], '', 40, 4) . txarea($rb[2], '', 40, 4);
    $ret .= lj('txtbox', $rid . '_plug___msqads_msqads*j_' . $p . '__' . implode('|', $rb), 'save') . ' ';
    $ret .= msqlink('users', ses('qb') . '_' . $p);
    $msq->read('i');
    return $ret . divd($rid, make_table($msq->ret, 'txtblc', 'txtx'));
}
Beispiel #7
0
function statsee_j($p, $o, $res = '')
{
    if (!$p) {
        $p = 0;
    }
    //$r=sql('iq,qb,page,time','qdv','','id>'.$p.' order by id desc');
    $r = sql_inner('ip,qb,page,DATE_FORMAT(' . qd('live') . '.time,\'%H:%i:%s\')', 'qdp', 'qdv', 'iq', '', 'where ' . qd('live') . '.id>' . $p . ' order by ' . qd('live') . '.id desc limit 50');
    //p($r);
    if ($r) {
        foreach ($r as $k => $v) {
            $ret[] = array($k, $v[3], $v[0], $v[2]);
        }
    }
    return make_table($ret, 'txtx', 'txtx');
}
Beispiel #8
0
function atomic_build($p, $o)
{
    $r = msql_read('', 'public_atomic', '');
    $rb['-'] = $r['_menus_'];
    if (is_numeric($p)) {
        $rb[] = msql_read('', 'public_atomic', $p);
    } elseif ($p) {
        foreach ($r as $k => $v) {
            if (strtolower($v[0]) == strtolower($p)) {
                $rb[$k] = $v;
            }
        }
    }
    //p($rb);
    return make_table($rb);
}
Beispiel #9
0
function plug_model($p, $o)
{
    $rid = 'plg' . randid();
    $p = $p ? $p : 'model';
    reqp('msql');
    $msq = new msql('', $p);
    //table
    $rb = array('title', 'text');
    $msq->create($rb);
    //cols
    $ret .= input(1, $rb[0], '', '', 20);
    $ret .= lj('txtbox', $rid . '_plug___model_model*j_' . $p . '__' . implode('|', $rb), 'save') . br();
    $ret .= txarea($rb[1], '', 40, 4);
    $ret .= msqlink('users', ses('qb') . '_' . $p);
    $msq->read('i');
    return $ret . divd($rid, make_table($msq->ret, 'txtblc', 'txtx'));
}
Beispiel #10
0
function msqmerge_build($p, $o)
{
    req('pop,spe,tri');
    $r = explode(',', $p);
    $ra = array();
    if ($r && $p) {
        foreach ($r as $k => $v) {
            //echo $v;
            $r = msql_read('', $v);
            //pr($r);
            if ($r) {
                $ra += msqmerge($r, $v);
            }
        }
    }
    ksort($ra);
    return make_table($ra);
}
Beispiel #11
0
function plug_cart()
{
    if ($_GET["del"]) {
        unset($_SESSION['cart'][$_GET["del"]]);
    }
    $ar[] = array("", "réf", "titre", "prix", "qté", "sub_total", "x");
    //"ancien prix","remise",
    if ($_SESSION['cart']) {
        foreach ($_SESSION['cart'] as $k => $v) {
            $save .= $k . '=' . $v . ';' . "\r";
            list($day, $frm, $tit, $amg, $nod, $tag, $lu, $re, $host, $mail, $ib) = pecho_arts($k);
            list($prx, $ref, $stock) = prod_from_art($k);
            //,$reduc,$descript
            $tit = lkc("txtcadr", good_url($k, 'read'), $tit) . '' . br();
            $img = minimg($amg, 1) . br();
            //if($reduc){$oldprice=$prix;$prx=round($prix*($reduc/100));}
            //else{$oldprice="";$prx=$prix;}//prix
            $qte = qtes($k, $v);
            $erz = lkc('', '?plug=cart&del=' . $k, 'x');
            $ar[] = array($img, $ref, $tit, $prx, $qte, $prx * $qte, $erz);
            //$oldprice,$reduc,
            $total += $prx * $qte;
        }
        $_SESSION["prixtotal"] = $total;
        $ar[] = array("", "", "", "", "total", $total);
        //"","",
        $tb = make_table($ar, 'txtred', '');
        //$tb=str_replace("table",'table width="100%"',$tb);
        $tb = str_replace("td", 'td class="txtblc" align="center"', $tb);
        //$_SESSION["commande"]=$tb;
        $ret = $tb . br();
        $ret .= ljb('txtbox', 'jumpval', 'ref5_command::' . $save, $_SESSION['nms'][27]) . br() . br();
        $ret .= nl2br(make_form_fromstring('::Name=input::Adress=input::city=input::Email=input::Message=text', ''));
    } else {
        $ret = btn("txtred", "empty_cart");
    }
    return $ret;
}
Beispiel #12
0
function msqt_read($nod, $p)
{
    $r = read_vars('msql/users/', $nod, '');
    if (isset($r['_menus_'])) {
        $mnu = $r['_menus_'];
        unset($r['_menus_']);
    }
    if (substr($p, 0, 1) == 'x') {
        $p = substr($p, 1);
    } else {
        $o = 'x';
    }
    $rb = array_keys_r($r, $p);
    if ($o) {
        arsort($rb);
    } else {
        asort($rb);
    }
    $r = conform_order($r, $rb);
    foreach ($mnu as $k => $v) {
        $pb = ajx($o . $v, 0);
        $tts[] = lj('', 'msqt_plug___msqtemplate_msqt*read_' . ajx($nod, 0) . '_' . $o . $k, $v);
    }
    foreach ($r as $k => $v) {
        if ($v) {
            foreach ($v as $ka => $va) {
                if ($mnu[$ka] == 'date') {
                    $va = date('d/m/Y', $va);
                }
                $r[$k][$ka] = $va;
            }
        }
    }
    array_unshift($r, $tts);
    return make_table($r, 'txtred', 'txtx');
}
Beispiel #13
0
<?php

require_once "user.inc.php";
$filename = 'options.php';
$error_str = "";
// change player options
if (isset($_GET['player_op']) && $_GET['player_op'] == 1) {
    $error_str .= $st[925];
    $error_str .= make_table(array("", ""));
    $error_str .= "<form method='post' action='options.php'>";
    if ($user['login_id'] != 1 && $user['login_id'] != OWNER_ID) {
        #admins can't alter icq etc.
        $error_str .= quick_row("<br />" . $st[926] . ":", " <input type='text' name='aim' value='{$p_user['aim']}' />");
        $error_str .= quick_row("<br />" . $st[927] . " #:", " <input type='text' name='icq' value='{$p_user['icq']}' />");
        $error_str .= quick_row("<br />" . $st[928] . ":", " <input type='text' name='yim' value='{$p_user['yim']}' />");
        $error_str .= quick_row("<br />" . $st[929] . ":", " <input type='text' name='msn' value='{$p_user['msn']}' />");
    } else {
        $error_str .= "<br />" . $st[930] . "<br />";
    }
    $error_str .= quick_row($st[931], "<p />" . $cw['note'] . ": <b class='b1'>" . $st[932] . "<br /><textarea name=sig cols=25 rows=10>" . stripslashes($user['sig']) . "</textarea>");
    $error_str .= "</table><input type='hidden' name='player_op' value='2' /><br /><br />";
    $error_str .= "<input type='submit' name='submit' /></form><br /><br />";
    print_page($st[933], $error_str);
} elseif (isset($_POST['player_op']) && $_POST['player_op'] == 2) {
    if ($user['login_id'] != 1) {
        #admins can't alter icq etc
        dbn("update user_accounts set aim = '" . mysql_escape_string(strip_tags((string) $_POST['aim'])) . "', icq = '" . (int) $_POST['icq'] . "', yim = '" . mysql_escape_string(strip_tags((string) $_POST['yim'])) . "', msn = '" . mysql_escape_string(strip_tags((string) $_POST['msn'])) . "' where login_id = '{$user['login_id']}'");
    }
    dbn("update {$db_name}_users set sig = '" . mysql_escape_string(strip_tags((string) $_POST['sig'])) . "' where login_id = '{$user['login_id']}'");
    $error_str .= $st[934];
}
Beispiel #14
0
function adm_apps($id, $cnd, $sys = '')
{
    //id=dir;cnd=;sys=;
    $rid = 'mp' . randid();
    //echo $id.'-'.$sys; p($_GET);
    $m = 'apps';
    $j = 'sbm_submds___';
    $top .= lj('', $j . '_' . $id . '_' . $sys . '__', picto('reload')) . '';
    $top .= lj('txtx', $j . '_' . $id . '_' . $sys, 'root') . '';
    $r = explode('/', $id);
    foreach ($r as $k => $v) {
        $idb[] = $v;
        //echo $v;
        if ($v) {
            $top .= lj('txtx', $j . '_' . implode('/', $idb), $v) . '';
        }
    }
    $top .= ' ' . admhlp('grey', $m, 'help') . ' ';
    foreach (array('menu', 'desk', 'boot', 'home', 'user') as $v) {
        //,'favs'
        $top .= lj($cnd == $v ? 'txtaa' : 'txtab', $j . '_' . $id . '__' . $v, $v) . ' ';
    }
    $top .= lj('" title="' . nms(103), 'popup_submds____' . $id . '_add', picto('plus')) . ' ';
    $top .= msqlink('', ses('qb') . '_' . $m) . ' ';
    if (rstr(61) && $m == 'apps') {
        $top .= hlpbt('apps', 'alert');
    }
    $top .= msqlink('system', 'default_apps') . ' ';
    $top .= lj('txtsmall2', 'popup_admin___apps_1', 'sys') . ' ';
    if ($sys) {
        $r = msql_read_b('system', 'default_apps', '', 1);
    } else {
        $r = msql_read('', ses('qb') . '_' . $m, '', 1);
    }
    $ar[] = array('', 'icon', nms(71), 'root', 'type', 'condition', nms(105));
    if (!$r) {
        $r = submod_revert('_users');
    }
    foreach ($r as $k => $v) {
        if ($cnd && strpos($v[5], $cnd) !== false or !$cnd) {
            $prv = $v[9] ? picto('lock') : '';
            $jp = 'popup_submds___' . $k . '_' . $id . '_';
            $up = lj('', $jp . 'pos', picto('ktop§10')) . ' ';
            $bt = lj($v[8] ? 'grey' : '', $jp . 'edit_' . $cnd, $v[0]);
            $pt = lj($v[8] ? 'grey' : '', $jp . 'edit_' . $cnd, picto($v[7]));
            $cd = strpos($v[5], 'menu') !== false ? picto('admin') : '';
            $cd .= strpos($v[5], 'desk') !== false ? picto('desktop') : '';
            $cd .= strpos($v[5], 'boot') !== false ? picto('get') : '';
            $cd .= strpos($v[5], 'home') !== false ? picto('home') : '';
            $cd .= strpos($v[5], 'user') !== false ? picto('user') : '';
            $dir = $v[6] ? lj('txtx', $j . '_' . $v[6] . '_' . $cnd . '_' . $sys, $v[6]) : '';
            if (substr($v[6], 0, strlen($id)) == $id or !$id) {
                $ar[$k] = array($up, $pt, $bt, $dir, $v[1], $cd, $prv);
            }
        }
    }
    //,$v[2],$v[5]
    $ret .= make_table($ar, '') . hidden('', $id, '');
    return divd('sbm', $top . $ret);
}
Beispiel #15
0
function config_list($details, $lookup = -1)
{
    //empty config, so return nothing.
    if ($lookup == "") {
        return $cw['None'];
    }
    $temp_where = "";
    //list selected $lookup configs, rather than all
    if ($lookup != -1) {
        $temp_where = " where ";
        //loop through all entries in lookup and add them to the where
        foreach (explode(",", $lookup) as $val) {
            $temp_where .= "config_id = '{$val}' || ";
        }
        $temp_where = preg_replace("/\\|\\| \$/", "", $temp_where);
    }
    $ret_str = "";
    db("select * from se_config_list {$temp_where}");
    //showing only title of configs.
    if ($details == 0) {
        while ($list_conf = dbr(1)) {
            $ret_str .= $list_conf['short_for'] . "<br />";
        }
        //showing all info about the configs.
    } else {
        //make tables with all information for all of resultaint configs.
        while ($list_conf = dbr(1)) {
            $ret_str .= make_table(array("", ""), "WIDTH=95%");
            $ret_str .= quick_row($st[1142], $list_conf['config_id']);
            $ret_str .= quick_row($st[1143], $list_conf['short_for']);
            $ret_str .= quick_row($st[1144], $list_conf['type']);
            $ret_str .= quick_row($st[1145], $list_conf['description']);
            $ret_str .= quick_row($st[1146], $list_conf['does_to_ship']);
            $ret_str .= "</table><br />";
        }
    }
    return $ret_str;
}
Beispiel #16
0
function pet_read($r, $nba, $page)
{
    $limit = ($page - 1) * $nba;
    $nbr = pet_count_valid($r);
    $ret = str_replace('_NB', $nbr, pet_hlp('actually')) . br() . br();
    $head = $r['_menus_'];
    unset($r['_menus_']);
    krsort($r);
    $id = $_SESSION['read'];
    //$head=explode(',',pet_hlp('entries'));
    $datas[] = array('date', $head[0], $head[3], $head[4]);
    foreach ($r as $k => $v) {
        if ($v[6] == 1) {
            $i++;
            if ($v[2]) {
                $name = lkt('', $v[2], $v[0]);
            } else {
                $name = $v[0];
            }
            if ($i > $limit && $i <= $limit + $nba) {
                $datas[] = array(mkday($k), $name, $v[3], $v[4]);
            }
        }
    }
    if ($nbr > $nba) {
        $nbp = ceil($nbr / $nba);
        if ($nbp > 1) {
            for ($i = 1; $i <= $nbp; $i++) {
                $aff[$i] = $i;
            }
        }
        $pages = slctmenusj($aff, 'pet' . $id . '_plug___petition_pet*j_' . $nba . '|' . $id . '|', $page, ' ');
    }
    if ($_GET['read'] == $id && $id) {
        $ret .= make_table($datas, 'popbt', '') . br() . $pages . br() . br();
    }
    return $ret;
}
Beispiel #17
0
                    $buy_many_link = "";
                    //had a brob before, so this one costs more.
                    if ($user['one_brob'] > 0) {
                        $ship_stats['cost'] = $ship_stats['cost'] * $user['one_brob'];
                    }
                }
            }
            $ship_stats['cost'] = nombre($ship_stats['cost'], 0, ',', ' ');
            $array_ships[$type] .= "\n" . make_row(array("<a href='ship_build.php?ship_type={$type_id}'>{$ship_stats['name']}</a>", "{$ship_stats['class_abbr']}", "<b>{$ship_stats['cost']}</b>", "<a href='ship_build.php?ship_type={$type_id}'>" . $cw['buy_one'] . "</a>", $buy_many_link, popup_help("help.php?popup=1&ship_info={$type_id}&db_name={$db_name}", 300, 600) . "<b></b></a>"));
        }
    }
    foreach ($array_ships as $type => $content) {
        if ($type == 'Bataille' || $type == 'Transport') {
            $out .= " Vaisseaux de <b class='b1'>{$type}</b>" . make_table(array($cw['ship_name'], $cw['abbrv'], $cw['cost']));
        } else {
            $out .= " Vaisseaux <b class='b1'>{$type}</b>" . make_table(array($cw['ship_name'], $cw['abbrv'], $cw['cost']));
        }
        $out .= $content . "</table><p />";
    }
    $out .= "<p /><a href='help.php?ship_info=-1' target='_blank'>" . $st[1891] . "</a>";
    //load the default earth page
} else {
    if ($user_options['show_pics']) {
        //$out .= " <img src='$directories[images]/places/earth.jpg' alt='A Picture of Earth' /><br />";
    }
    //$out .= "<b>EARTH</b> - <b class='b1'>E</b>normous <b class='b1'>A</b>nd <b class='b1'>R</b>ound <b class='b1'>T</b>erran <b class='b1'>H</b>omeworld<p />";
    $out .= "<div><div style='float:left;padding:6px;'><a href='{$_SERVER['PHP_SELF']}?ship_shop=1'><img src='images/interface/ship_shop.jpg' border=0></a><br>";
    $out .= "<a href='{$_SERVER['PHP_SELF']}?ship_shop=1'>" . $cw['seatogu'] . "</a>";
    if ($user['ship_id'] != 1) {
        $out .= " - <a href='ship_build.php?duplicate=1'>" . $cw['ship_duplicator'] . "</a>";
    }
Beispiel #18
0
            send_message($target['login_id'], sprintf($st[749], $transfer_counter, $user[login_name]));
            insert_history($user['login_id'], sprintf($st[750], $transfer_counter, $target[login_name]));
        }
    }
    print_page($cw['transfer_ship'], $text);
}
$text .= sprintf($st[751], $target[login_name]) . "<br /><br />";
$text .= "<b class='b1'>" . $st[752] . "<br />";
$text .= "<form action=send_ship.php method=POST name=transfer_ships><table>";
db("select ship_name, class_name, location, fighters, max_fighters, shields, max_shields, armour, max_armour, config, ship_id from {$db_name}_ships where login_id = '{$user['login_id']}' && ship_id != '{$user['ship_id']}' order by class_name");
$ships = dbr(1);
if (!isset($ships)) {
    #ensure there are some ships to display
    $text .= $st[753];
} else {
    $text .= make_table(array("Nom du vaisseau", "Type de vaisseau", "Emplacement", "Chasseurs", "Boucliers", "Coques", "Configuration"));
    while ($ships) {
        $ships['fighters'] = $ships['fighters'] . " / " . $ships['max_fighters'];
        $ships['shields'] = $ships['shields'] . " / " . $ships['max_shields'];
        $ships['armour'] = $ships['armour'] . " / " . $ships['max_armour'];
        #remove the un-necassaries from the array. As well as their numerical counterparts (it's a multi-indexed array).
        unset($ships['max_fighters']);
        unset($ships['max_shields']);
        unset($ships['max_armour']);
        $ships['ship_id'] = "<input type=checkbox name=do_ship[{$ships['ship_id']}] value={$ships['ship_id']} /> - <a href='send_ship.php?target={$target['login_id']}&do_ship[{$ships['ship_id']}]={$ships['ship_id']}'>" . $cw['sign_over'] . "</a>";
        $text .= make_row($ships);
        $ships = dbr(1);
    }
}
$text .= "</table><br /><input type=hidden name=target value={$target['login_id']} /><input type='submit' name='submit' value='Envoyer les vaisseaux' /> - <a href=javascript:TickAll(\"transfer_ships\")>" . $st[754] . "</a><br /></form>";
$text .= "<br /><a href='send_ship.php?target={$target['login_id']}'>" . $st[755] . "</a>";
Beispiel #19
0
}
/* SHOW FULL LIST OF USER SHIPS */
if ($user['show_user_ships'] == 1) {
    db2("select * from {$db_name}_ships where login_id = '{$user['login_id']}' && location = '{$user['location']}' && ship_id > 1 order by fleet_id asc, fighters desc, ship_name asc");
    $ships = dbr2(1);
    if ($ships == "") {
        $error_str .= $st[55];
    } else {
        //$error_str .= "\n<p />".$cw['show_all_ships']."<!-- - <A HREF='location.php?show_user_ships=2'>".$cw['show_ship_summary']."</A>--> - <A HREF='location.php?show_user_ships=3'>".$cw['show_fleet_summary']."</A><p />";
        $last_fleet = '';
        if ($user['clan_id'] > 0 && $GAME_VARS['clan_fleet_attacking'] == 1) {
            $table_head_array = array($cw['name'], $cw['class'], $cw['fighters'], $cw['cargo'], $cw['can_fleet'], $cw['fleet'], $cw['command'], "&nbsp;");
        } else {
            $table_head_array = array($cw['name'], $cw['class'], $cw['fighters'], $cw['cargo'], $cw['fleet'], $cw['command'], "&nbsp;");
        }
        $error_str .= make_table($table_head_array);
        #Loop through all of a players ships in the system.
        while ($ships) {
            $cloak_str_start = "";
            $cloak_str_end = "";
            $ships['ship_name'] = stripslashes($ships['ship_name']);
            $rowspan = array(1, 1, 1, 1, 1, 1, 1);
            #ship is cloaked.
            if (config_check("ls", $ships) || config_check("hs", $ships)) {
                $cloak_str_start = "<b class='cloak'>";
                $cloak_str_end = "</b>";
            }
            if ($last_fleet != $ships['fleet_id']) {
                //calcul du nombre de vaisseaux dans la flotte actuelle
                db("select count(ship_id) from {$db_name}_ships where login_id = " . $user['login_id'] . " AND fleet_id = " . $ships['fleet_id'] . " AND location = " . $ships['location']);
                $rowspan_count = dbr();
Beispiel #20
0
<script type="text/javascript">
  $(document).ready(function () {
    $('#pms').DataTable();
    $('#pms_wrapper').css({"padding":"10px"});
  });
</script>

<?php 
$table = div(div(par("Sent Messages"), "panel-heading"), "panel panel-info");
$table["children"][] = make_table($pms, ["receiver", "subject", "msg", "time"], "table", "pms");
echo to_html($table);
Beispiel #21
0
<script type="text/javascript">
  $(document).ready(function () {
    $('#umsocs').DataTable();
    $('#ussocs').DataTable();
    $('#umsocs_wrapper').css({"padding":"10px"});
    $('#ussocs_wrapper').css({"padding":"10px"});
  });
</script>

<?php 
$table = div(div(par("Societies you moderate"), "panel-heading"), "panel panel-primary");
$table["children"][] = make_table($msubs, ["society", "mod since"], "table", "umsocs", [], [0]);
echo to_html($table);
$table = div(div(par("Subscribed societies"), "panel-heading"), "panel panel-primary");
$table["children"][] = make_table($subs, ["society", "subbed since"], "table", "ussocs", [], [0]);
echo to_html($table);
Beispiel #22
0
<script>
	$(document).ready(function() {
		$('#user_bans').DataTable();
		$('#user_bans_wrapper').css({"padding":"10px"});
	} );
</script>

<?php 
// ban form
$fdiv = div(div(par("Ban a user"), "panel-heading"), "panel panel-danger");
$form = make_form("admin_panel.php?view=bans", "post", "form-inline");
$form = add_field($form, "user_to_ban", "Username", true, "form-control");
$form = add_field($form, "ban_reason", "Reason for ban", true, "form-control");
$form = add_button($form, "Ban", "btn btn-default");
$fdiv["children"][] = div(div($form, "form-group"), "panel-body");
echo to_html($fdiv);
// unban form
$fdiv = div(div(par("Unban a user"), "panel-heading"), "panel panel-success");
$form = make_form("admin_panel.php?view=bans", "post", "form-inline");
$form = add_field($form, "user_to_unban", "Username", true, "form-control");
$form = add_field($form, "unban_reason", "Reason for unbanning", true, "form-control");
$form = add_button($form, "Unban", "btn btn-default");
$fdiv["children"][] = div(div($form, "form-group"), "panel-body");
echo to_html($fdiv);
// banned users list
$table = div(div(par("Banned Users"), "panel-heading"), "panel panel-info");
$table["children"][] = make_table($bans, ["username", "banned by", "time", "reason"], "table", "user_bans", [0, 1]);
echo to_html($table);
Beispiel #23
0
function troc_read_obj($id, $o)
{
    //echo $id;
    list($rid, $bck) = explode('-', $o);
    $ra = sql('user,obj,type,txt', 'obj', 'a', 'id=' . $id);
    //p($ra);
    foreach ($ra as $k => $v) {
        $ret .= divc('', btn('txtx', $k) . btn('popbt', $v)) . br();
    }
    $r = sql('id,prop,attr', 'prop', 'kvv', 'ib="' . $id . '');
    //p($r);
    $ret .= make_table($r);
    $ret .= lj('popbt', $rid . '_plug___troc_troc*' . $bck, pictxt('left', 'Retour à la liste')) . ' ' . lj('popbt', $rid . '_plug___troc_troc*read*obj_' . $id . '_' . $o, pictxt('reload', 'Rafraîchir'));
    return $ret;
}
Beispiel #24
0
<script type="text/javascript">
  $(document).ready(function () {
    $('#pms').DataTable();
    $('#pms_wrapper').css({"padding":"10px"});
  });
</script>

<?php 
$table = div(div(par("Received Messages"), "panel-heading"), "panel panel-info");
$table["children"][] = make_table($pms, ["sender", "subject", "msg", "time"], "table", "pms", [0]);
echo to_html($table);
 /**
  * @desc Prints the question. Calls question_webwork_derived, and prints out the html associated with derivedid.
  * @param $question object The question object to print.
  * @param $state object The state of the responses for the question.
  * @param $cmoptions object Options containing course ID.
  * @param $options object
  */
 function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options)
 {
     global $CFG, $USER;
     //find webworkquestion object
     $wwquestion = $question->webwork;
     if (!isset($question->webwork)) {
         print_error('error_no_wwquestion', 'qtype_webwork');
         return false;
     }
     //find seed
     if (!isset($state->responses['seed'])) {
         print_error('error_no_seed', 'qtype_webwork');
         return false;
     }
     //find answers
     if (isset($state->responses['answers'])) {
         $answers = $state->responses['answers'];
     } else {
         $answers = array();
     }
     $seed = $state->responses['seed'];
     $event = $state->event;
     $questionhtml = $wwquestion->render($seed, $answers, $event);
     $showPartiallyCorrectAnswers = $wwquestion->getGrading();
     $qid = $wwquestion->getQuestion();
     //Answer Table construction
     if ($state->event == QUESTION_EVENTGRADE) {
         $answertable = new stdClass();
         $answertable->head = array();
         if ($showPartiallyCorrectAnswers == 1) {
             array_push($answertable->head, 'Result');
         }
         array_push($answertable->head, 'Answer', 'Preview', 'Evaluated', 'Errors');
         $answertable->width = "100%";
         $answertabledata = array();
         foreach ($answers as $answer) {
             $answertablerow = array();
             if ($showPartiallyCorrectAnswers == 1) {
                 $firstfield = '';
                 $firstfield .= question_get_feedback_image($answer->score);
                 if ($answer->score == 1) {
                     $firstfield .= "Correct";
                 } else {
                     $firstfield .= "Incorrect";
                 }
                 array_push($answertablerow, $firstfield);
             }
             array_push($answertablerow, $answer->answer, $answer->preview, $answer->evaluated, $answer->answer_msg);
             array_push($answertabledata, $answertablerow);
         }
         $answertable->data = $answertabledata;
         $answertable = make_table($answertable);
     } else {
         $answertable = "";
     }
     include "{$CFG->dirroot}/question/type/webwork/display.html";
     flush();
 }
Beispiel #26
0
function addf_read($r)
{
    $n = count($r) - 1;
    if ($n > 0) {
        $ret = lj('txtbox', 'cbk_plug___addfonts_addf*inject', 'add ' . $n . ' typos') . br() . br();
    }
    //xd
    return $ret . make_table($r, 'txtblc', 'txtx');
}
Beispiel #27
0
        db("select type_id from se_ship_types where type_id > 2 && auction = 0");
        while ($list_ships = dbr(1)) {
            if (!isset($add_ship[$list_ships['type_id']])) {
                //admin has turned ship off.
                dbn("update se_admin_ships set {$db_name}_ship_status = 0 where ship_type_id = '{$list_ships['type_id']}'");
            } else {
                //ship is turned on.
                dbn("update se_admin_ships set {$db_name}_ship_status = 1 where ship_type_id = '{$list_ships['type_id']}'");
            }
        }
        $out .= "Selected ships have now been made available to the players. The rest of the ships are un-available.";
    } else {
        $out .= "Select the ships that you would like users to be able to use within the game:";
        $out .= "\n<form name='select_ships' action='{$_SERVER['PHP_SELF']}' method='POST'>";
        $out .= "\n<input type='hidden' name='admin_choose' value='1' />";
        $out .= make_table(array("<b class='b1'>Ship Name</b>", "Available"));
        db("select s.type_id,s.name,a.{$db_name}_ship_status as status from se_ship_types s, se_admin_ships a where s.type_id > 2 && a.ship_type_id = s.type_id && s.auction = 0");
        while ($list_ships = dbr(1)) {
            if ($list_ships['status'] == 1) {
                $out .= "\n" . quick_row("{$list_ships['name']}", "<input type='checkbox' name='add_ship[{$list_ships['type_id']}]' value='{$list_ships['type_id']}' checked='checked' />");
            } else {
                $out .= "\n" . quick_row("{$list_ships['name']}", "<input type='checkbox' name='add_ship[{$list_ships['type_id']}]' value='{$list_ships['type_id']}' />");
            }
        }
        $out .= "\n</table>";
        $out .= "\n<br /><a href='javascript:TickAll(\"select_ships\")'>Invert Ship Selection</a>";
        $out .= "\n<p /><input type='submit' value='Submit' /></form>";
    }
    print_page("Ship Types", $out);
    insert_history($user['login_id'], "Ships available in game changed.");
}
Beispiel #28
0
function styls($d, $edit)
{
    $qb = $_SESSION['qb'];
    $base = 'msql/design/';
    $ndd = $_SESSION['desgn'] ? $_SESSION['desgn'] : $_SESSION['prmd'];
    $ndc = $_SESSION['clrset'] ? $_SESSION['clrset'] : $_SESSION['prmd'];
    $nod = $qb . '_design_' . $ndd;
    $ndc = $qb . '_clrset_' . $ndc;
    if ($d == "select" or $d == "herit") {
        $ret = popup('select design', charge_sets($d), 340);
    }
    if ($d == "edit") {
        $rb = read_vars('msql/design/', $nod, '');
        $ret = f_inp_facilities($rb, $edit);
    }
    //if($d=="css1")$ret=nl2br(read_file('css/'.$qb.'_design_'.$_SESSION['cond'][0].'.css'));
    if ($d == "css2") {
        $ret = nl2br(read_file('css/' . $nod . '.css'));
    }
    if ($d == "clr") {
        $r = msql_read_b('design', $ndc);
    }
    if ($r) {
        $ret = popup('colors', make_table($r, 'txtblc', 'txtx'), 340);
    }
    return $ret;
}
Beispiel #29
0
function create_movie_stats($params)
{
    $res = '';
    $p_viewerId = get_my_id();
    $query = sprintf('SELECT COUNT(*) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\'', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies views (non distinct)');
    $query = sprintf('SELECT COUNT(DISTINCT TbWkWork.id) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\'', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies views (distinct)');
    $query = sprintf('SELECT COUNT(*) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWorkView.endViewDate IS NOT NULL', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies views with date (non distinct)');
    $query = sprintf('SELECT COUNT(*) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType,TbWkWorkReview WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWorkReview.workId=TbWkWork.id', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies views with reviews (non distinct)');
    $query = sprintf('SELECT COUNT(*) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType,TbWkWorkExternal,TbExternalType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbExternalType.name=\'imdb_title_id\' AND TbWkWorkExternal.workId=TbWkWork.id AND TbWkWorkExternal.externalId=TbExternalType.id', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies views with imdbid (non distinct)');
    $query = sprintf('SELECT COUNT(DISTINCT TbWkWork.id) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType,TbExternalType,TbWkWorkExternal WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbExternalType.name=\'imdb_title_id\' AND TbWkWorkExternal.workId=TbWkWork.id AND TbWkWorkExternal.externalId=TbExternalType.id', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies views with imdbid (distinct)');
    $query = sprintf('SELECT COUNT(*) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType,TbWkWorkReview WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWorkReview.workId=TbWkWork.id AND TbWkWorkView.endViewDate IS NOT NULL', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies views with date,review (non distinct)');
    $query = sprintf('SELECT COUNT(*) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType,TbWkWorkReview,TbWkWorkExternal,TbExternalType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWorkReview.workId=TbWkWork.id AND TbExternalType.name=\'imdb_title_id\' AND TbWkWorkExternal.workId=TbWkWork.id AND TbWkWorkExternal.externalId=TbExternalType.id', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies views with review,imdbid (non distinct)');
    $query = sprintf('SELECT COUNT(*) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType,TbWkWorkReview,TbWkWorkExternal,TbExternalType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWorkReview.workId=TbWkWork.id AND TbWkWorkView.endViewDate IS NOT NULL AND TbExternalType.name=\'imdb_title_id\' AND TbWkWorkExternal.workId=TbWkWork.id AND TbWkWorkExternal.externalId=TbExternalType.id', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies views with date,review,imdbid (non distinct)');
    $query = sprintf('SELECT COUNT(*) FROM TbWkWork,TbWkWorkType WHERE TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\'');
    $res .= make_stat($query, null, 'number of distinct movies in the database');
    $query = sprintf('SELECT COUNT(*)/COUNT(DISTINCT TbWkWork.id) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\'', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'average views per distinct movie');
    $query = sprintf('SELECT MIN(mytbl.mycnt) FROM (select COUNT(*) AS mycnt FROM TbWkWorkViewPerson, TbWkWorkView,TbWkWork, TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' GROUP BY TbWkWork.id) AS mytbl', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'minimum views per distinct movie');
    $query = sprintf('SELECT MAX(mytbl.mycnt) FROM (select COUNT(*) AS mycnt FROM TbWkWorkViewPerson, TbWkWorkView,TbWkWork, TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' GROUP BY TbWkWork.id) AS mytbl', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'maximum views per distinct movie');
    $query = sprintf('SELECT COUNT(*) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWork.length IS NULL', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies seen without length');
    $query = sprintf('SELECT COUNT(DISTINCT TbWkWork.id) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWork.length IS NULL', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of distinct movies seen without length');
    $query = sprintf('SELECT COUNT(*) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWork.length IS NOT NULL', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of movies seen that have length');
    $query = sprintf('SELECT SUM(TbWkWork.length) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWork.length IS NOT NULL', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, formatTimeperiod, 'total length of all movies seen that have length');
    $query = sprintf('SELECT AVG(TbWkWork.length) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWork.length IS NOT NULL', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, formatTimeperiod, 'average length of all movies seen that have length');
    $query = sprintf('SELECT MIN(TbWkWork.length) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWork.length IS NOT NULL', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, formatTimeperiod, 'minimum length of all movies seen that have length');
    $query = sprintf('SELECT MAX(TbWkWork.length) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWork.length IS NOT NULL', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, formatTimeperiod, 'maximum length of all movies seen that have length');
    $query = sprintf('SELECT COUNT(DISTINCT TbWkWork.id) FROM TbWkWorkReview,TbWkWork,TbWkWorkType WHERE TbWkWorkReview.reviewerId=%s AND TbWkWorkReview.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\'', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of distinct movies reviewed which is the same as number of reviews since each movie can be reviewed at most once');
    $query = sprintf('SELECT AVG(TbRating.value) FROM TbRating, TbWkWorkReview, TbWkWork, TbWkWorkType WHERE TbWkWorkReview.reviewerId=%s AND TbWkWorkReview.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWorkReview.ratingId=TbRating.id', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'average rating of all reviews');
    $query = sprintf('SELECT MIN(TbRating.value) FROM TbRating, TbWkWorkReview, TbWkWork, TbWkWorkType WHERE TbWkWorkReview.reviewerId=%s AND TbWkWorkReview.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWorkReview.ratingId=TbRating.id', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'minimum rating of all reviews');
    $query = sprintf('SELECT MAX(TbRating.value) FROM TbRating, TbWkWorkReview, TbWkWork, TbWkWorkType WHERE TbWkWorkReview.reviewerId=%s AND TbWkWorkReview.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWorkReview.ratingId=TbRating.id', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'maximum rating of all reviews');
    $query = sprintf('SELECT COUNT(DISTINCT TbRating.id) FROM TbRating, TbWkWorkReview, TbWkWork, TbWkWorkType WHERE TbWkWorkReview.reviewerId=%s AND TbWkWorkReview.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbWkWorkReview.ratingId=TbRating.id', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of distinct ratings of all movies reviewed');
    $query = sprintf('SELECT COUNT(DISTINCT TbWkWorkView.deviceId) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\'', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of distinct devices used to watch them');
    $query = sprintf('SELECT TbDevice.name,COUNT(TbDevice.name) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType,TbDevice WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbDevice.id=TbWkWorkView.deviceId GROUP BY TbDevice.name', my_mysql_real_escape_string($p_viewerId));
    $res .= make_table($query, 'number of views per device');
    $query = sprintf('SELECT COUNT(DISTINCT TbWkWorkView.locationId) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\'', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'number of distinct locations used to watch them');
    /*
     * Remarked for privacy 3/13
    $query=sprintf('SELECT TbLocation.name,COUNT(TbLocation.name) FROM TbWkWorkViewPerson,TbWkWorkView,TbWkWork,TbWkWorkType,TbLocation WHERE TbWkWorkViewPerson.viewerId=%s AND TbWkWorkViewPerson.viewId=TbWkWorkView.id AND TbWkWorkView.workId=TbWkWork.id AND TbWkWork.typeId=TbWkWorkType.id AND TbWkWorkType.name=\'video movie\' AND TbLocation.id=TbWkWorkView.locationId GROUP BY TbLocation.name',
    	my_mysql_real_escape_string($p_viewerId)
    );
    $res.=make_table($query,'number of views per location');
    */
    $query = sprintf('SELECT AVG(mytab.mycnt) FROM (SELECT COUNT(*) AS mycnt FROM TbWkWorkViewPerson WHERE TbWkWorkViewPerson.viewId IN (SELECT TbWkWorkView.id FROM TbWkWorkType, TbWkWork, TbWkWorkView WHERE TbWkWork.id=TbWkWorkView.workId AND TbWkWorkType.id=TbWkWork.typeId AND TbWkWorkType.name=\'video movie\') GROUP BY TbWkWorkViewPerson.viewId) AS mytab;', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'average number of viewers per view');
    $query = sprintf('SELECT MIN(mytab.mycnt) FROM (SELECT COUNT(*) AS mycnt FROM TbWkWorkViewPerson WHERE TbWkWorkViewPerson.viewId IN (SELECT TbWkWorkView.id FROM TbWkWorkType, TbWkWork, TbWkWorkView WHERE TbWkWork.id=TbWkWorkView.workId AND TbWkWorkType.id=TbWkWork.typeId AND TbWkWorkType.name=\'video movie\') GROUP BY TbWkWorkViewPerson.viewId) AS mytab;', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'minimum number of viewers per view');
    $query = sprintf('SELECT MAX(mytab.mycnt) FROM (SELECT COUNT(*) AS mycnt FROM TbWkWorkViewPerson WHERE TbWkWorkViewPerson.viewId IN (SELECT TbWkWorkView.id FROM TbWkWorkType, TbWkWork, TbWkWorkView WHERE TbWkWork.id=TbWkWorkView.workId AND TbWkWorkType.id=TbWkWork.typeId AND TbWkWorkType.name=\'video movie\') GROUP BY TbWkWorkViewPerson.viewId) AS mytab;', my_mysql_real_escape_string($p_viewerId));
    $res .= make_stat($query, null, 'miximum number of viewers per view');
    return $res;
}
Beispiel #30
0
"><?php 
            echo $type;
            ?>
</option>
									<?php 
        }
    }
}
?>
									
							</select>
						</p>
					</div>
					<div id="table">
						<?php 
echo make_table($results);
?>
			
					</div>
				</div>
			</div>
		</section>
		<script src="js/main.js"></script>
	</body>
</html>

<?php 
function make_table($results)
{
    if (!empty($results)) {
        ?>