Exemple #1
0
/**
 * @return void
 * @desc Displays a table of the workers
 */
function display_workers()
{
    global $db;
    for ($i = 0, $n = count($db); $i < $n; $i++) {
        $worker_data = $db[$i];
        $worker_name = $worker_data[0];
        $worker_address = $worker_data[1];
        $worker_phone = $worker_data[2];
        print "<tr bgcolor=\"" . row_color($i) . "\">\n";
        print "<td>{$worker_name}</td>\n";
        print "<td>{$worker_address}</td>\n";
        print "<td>{$worker_phone}</td>\n";
        print "</tr>\n";
    }
}
Exemple #2
0
function getFiles()
{
    $OBJ =& get_instance();
    global $go;
    $s = '';
    $rs = $OBJ->db->fetchArray("SELECT * FROM " . PX . "media \n        WHERE media_ref_id = '0' \n        AND media_obj_type = '' \n        ORDER by media_uploaded DESC");
    if (!$rs) {
        $s = 'No files yet';
    } else {
        foreach ($rs as $a) {
            // fake 'mime', actually
            $mime = array_pop(explode('.', $a['media_file']));
            $use = span(filesManagerType($mime, $a['media_file'], $a['media_x'], $a['media_y'], $a['media_caption']), "class='p-action'");
            $edit = span(href("<img src='asset/img/files-edit.gif' />", "?a={$go['a']}&amp;q=editfile&amp;id={$a['media_id']}"), "class='p-action'");
            $url = BASEURL . '/files/' . $a['media_file'];
            $s .= div($use . $edit . span(href($a['media_file'], $url, "target='show'"), "class='p-name'"), row_color("class='row-color'"));
        }
    }
    return $s;
}
Exemple #3
0
 function page_hits()
 {
     global $go;
     // default/validate $_GET
     $go['page'] = getURI('page', 0, 'digit', 5);
     $this->template->location = $this->lang->word('main');
     // sub-locations
     $this->template->sub_location[] = array($this->lang->word('referrers'), "?a={$go['a']}&amp;q=refer");
     $this->template->sub_location[] = array($this->lang->word('main'), "?a={$go['a']}");
     load_module_helper('files', $go['a']);
     $today = convertToStamp(getNow());
     $day = substr($today, 6, 2);
     $mn = substr($today, 4, 2);
     $yr = substr($today, 0, 4);
     $thirtydays = date('Y-m-d', mktime('00', '00', '00', $mn - 1, $day, $yr));
     $rs = $this->db->fetchArray("SELECT hit_page, \n            COUNT(hit_page) AS 'total' \n            FROM " . PX . "stats \n            GROUP by hit_page \n            ORDER BY total DESC");
     // ++++++++++++++++++++++++++++++++++++++++++++++++++++
     // table for all our results
     $body = "<table cellpadding='0' cellspacing='0' border='0'>\n";
     $body .= "<tr class='top'>\n";
     $body .= "<th width='90%' class='toptext'><strong>" . $this->lang->word('page') . "</strong></th>\n";
     $body .= "<th width='10%' class='toptext'><strong>" . $this->lang->word('visits') . "</strong></th>\n";
     $body .= "</tr>\n";
     $body .= "</table>\n";
     // dynamic output for table
     $body .= "<table cellpadding='0' cellspacing='0' border='0'>\n";
     if (!$rs) {
         $body .= tr(td('No hits yet', "colspan='2'"));
     } else {
         foreach ($rs as $ar) {
             $body .= tr(td($ar['hit_page'], "width='90%' class='cell-doc'") . td($ar['total'], "width='10%' class='cell-mid'"), row_color(" class='color'"));
         }
     }
     // end dynamic rows output
     $body .= "</table>\n";
     $this->template->body = $body;
     return;
 }