Exemplo n.º 1
0
Arquivo: admin.php Projeto: philum/cms
function edit_microsql($nod, $r = '')
{
    list($dir, $node) = node_decompil($nod);
    $defs = $r ? $r : msql_read_b($dir, $node, '');
    if ($defs) {
        $ret = draw_table($defs, $nod, 1);
    }
    return $ret;
}
Exemplo n.º 2
0
function msqdt_build($p, $o)
{
    req('msql');
    $ra['_menus_'] = explode(',', $o);
    $r = msql_read_b('', ses('msqdt'), '', '', $ra);
    $murl = sesm('murl', murl('users', '', ses('qb'), $p, ''));
    if ($r) {
        return draw_table($r, $murl, '');
    }
}
			<h2>Pagina PHP (dinamica)</h2>

<?php 
function draw_table($n)
{
    echo "\t\t\t<table>\n";
    for ($i = 1; $i <= $n; $i++) {
        echo "<tr>\n<th>" . ($n - $i + 1) . "</th>\n";
        for ($j = 1; $j <= $n; $j++) {
            if (($i + $j) % 2) {
                echo "<td class=\"nero\"><br></td>\n";
            } else {
                echo "<td class=\"bianco\"><br></td>\n";
            }
        }
        echo "</tr>";
    }
    echo "<th></th>\n";
    for ($j = 1; $j <= $n; $j++) {
        echo "<th>" . chr(ord('a') + $j - 1) . "</th>\n";
    }
    echo "\t\t</table>\n";
}
if (isset($_GET['n'])) {
    draw_table($_GET['n']);
}
?>
		</div>
	</body>
</html>
Exemplo n.º 4
0
<?php 
    draw_table($result);
    ?>
</div>
<?php 
}
$result = execute_query($query3);
//echo mysql_error();
$num2 = mysql_num_rows($result);
if ($num2 > 0) {
    echo "<hr><P>Υπάρχουν <b>{$num2}</b> καταχωρημένοι ασθενείς για τους οποίους <b>δεν έχει γίνει ενημέρωση των κλινικών επισκέψεων εδώ και 1 χρόνο</b> <i>(πιθανοί \"Lost to Follow Up\")</i><BR>";
    echo "Παρακαλώ <b><font color='red'>ενημερώστε</font> την τελευταία κατάστασή</b> τους</p>";
    echo "Κάντε click <a href='#' onclick='show2();'>εδώ</a> για να τους δείτε</P>";
    ?>
 <div id=data2 style="display: none"> <?php 
    draw_table($result);
}
?>
</div>
<?php 
$result = execute_query($query4);
$num3 = mysql_num_rows($result);
?>
<hr>
<?php 
if ($num3 > 0) {
    ?>
<p>Οι παρακάτω ασθενείς:</p>
<?php 
    draw2_table($result);
    ?>
    accessforbidden();
}
$langs->load('mandarin@mandarin');
$userid = GETPOST('userid');
if ($userid != 0) {
    $userdefault = $userid;
} elseif (user_est_responsable_hierarchique()) {
    $userid = $user->id;
}
// Begin of page
llxHeader('', $langs->trans('linkMenuProjectByUserReport'), '');
print dol_get_fiche_head('linkMenuProjectByUserReport');
print_fiche_titre($langs->trans('linkMenuProjectByUserReport'));
print_form_filter($userid);
$TData = get_data_tab($userid);
draw_table($TData, get_list_id_user($TData), get_tab_label_statut_opportunite());
print '<br />';
draw_graphique($TData, get_tab_label_statut_opportunite());
llxFooter();
function print_form_filter($userid)
{
    global $db, $langs;
    $langs->load('users');
    $form = new Form($db);
    print '<form name="filter" methode="GET" action="' . $_SERVER['PHP_SELF'] . '">';
    print $langs->trans('HierarchicalResponsible');
    print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', '', 1);
    print '<br /><br />';
    $date_deb = explode('/', $_REQUEST['date_deb']);
    $date_deb = implode('/', array_reverse($date_deb));
    $date_fin = explode('/', $_REQUEST['date_fin']);
Exemplo n.º 6
0
    function analyse_result($original, $target)
    {
        $return = analyse($original, $target);
        $table1 = draw_table($return[0], 1, 'org_');
        $table2 = draw_table($return[1], 0, 'tar_');
        $table1_fix = $table2[2] > $table1[2] ? $table2[2] - $table1[2] : 0;
        $table2_fix = $table1[2] > $table2[2] ? $table1[2] - $table2[2] : 0;
        $str = '<style>
		.compare{
			width:480px;
			float:left;
			table-layout:fixed;
			overflow:auto;
			height:430px;
			float:left;
		}
	
		.code{
			width:40%;
			word-break:keep-all;
			white-space:nowrap;
			overflow:hidden;
			text-overflow:ellipsis;
		}
	
		.fix
		{
			background-color:#EADAEB;
		}
	
		.notsame
		{
			background-color:#DD5C67;
		}
	
		.span_diff
		{
			background-color:#DD5C67;
		}
	
		.span_same
		{
			background:transparent;
		}
	
		.blank
		{
			background-color:#FFFFFF;
		}
	
		.hover
		{
			background-color:#ffffce;
		}
		</style>
		<script>
			$(document).ready(
			function(){
				jQuery("tr").each(
					function(){
						$(this).mouseover(
							function(){
								var id = this.id.substr(4);
								$("#org_" + id).addClass("hover");
								$("#tar_" + id).addClass("hover");
							}
						);
						$(this).mouseout(
							function(){
								var id = this.id.substr(4);
								$("#org_" + id).removeClass("hover");
								$("#tar_" + id).removeClass("hover");
							}
						);
					}
				);
				jQuery(".compare").each(
					function(){
						$(this).scroll(
							function(){
								var id = this.id.substr(4);
								$("#org_" + id).scrollTop($(this).scrollTop());
								$("#tar_" + id).scrollTop($(this).scrollTop());
								$("#org_" + id).scrollLeft($(this).scrollLeft());
								$("#tar_" + id).scrollLeft($(this).scrollLeft());
							}
						);
					}
				);
			}
			);
		</script>';
        $str_1 = '<div style="float:left;"><div class="comp-head"><div class="comp-thead">原模板内容</div><div class="comp-thead">新模板内容</div></div>';
        $str1 = $str . $str_1 . '<div class="compare" id="org_container" ><table border="0" cellspacing="0" cellpadding="0" class="">';
        $str1 .= $table1[0];
        $str3 = '';
        for ($i = 1; $i <= $table1_fix; $i++) {
            $str1 . '<tr class="fix" id="org_' . $table1[2] . '"><td colspan="2">' . ($i + $table1[1]) . '</td></tr>';
            $table1[2]++;
        }
        $str1 .= '</table></div>';
        $str2 = $str . '<div class="compare" id="tar_container"><table border="0" cellspacing="0" cellpadding="0" class="">';
        $str2 .= $table2[0];
        $str3 .= $table2[0];
        for ($i = 1; $i <= $table2_fix; $i++) {
            $str2 .= '<tr class="fix" id="tar_' . $table2[2] . '"><td colspan="2">&nbsp;</td></tr>';
            $table2[2]++;
        }
        $str2 .= '</table></div></div>';
        $table = array($str1, $str2, $target);
        return $table;
    }
 * Tokens definition.
 */
$tokens = ['\\*' => 'T_MUL', '\\+' => 'T_PLS', '\\-' => 'T_SUB', '\\/' => 'T_DIV', 'sqrt' => 'T_SQRT', '[0-9]+' => 'T_NUM', '\\(' => 'T_LP', '\\)' => 'T_RP', '\\s+|\\n+|\\t+' => ''];
/**
 * Startup the parser.
 */
$lexer = new Lexer($tokens);
$grammar = new Grammar($productions);
$parser = new Parser($lexer, $grammar);
/**
 * The expression to parse.
 */
$exp = '50 + (20 * 2) + 1 - (1 / 2) + sqrt(90)';
/**
 * Run the parser.
 */
$parser->run($exp);
/**
 * Print some debug information.
 */
echo "<code><p><b>{$exp}</b> = {$RESULT}</p></code><hr/>";
echo "<h2>Paser trace:</h2>";
debug($parser->trace());
echo "<h2>First set:</h2>";
debug($grammar->rules()->first());
echo "<h2>Follow set:</h2>";
debug($grammar->rules()->follow());
echo "<h2>Parsing table:</h2>";
debug(draw_table($grammar->transitionTable()->toArray()));
echo "<h2>Syntax Tree:</h2>";
debug($parser->treeAsString());
Exemplo n.º 8
0
         echo "selected='selected'";
     }
     echo ">Thất bại</option>\r\n" . "</select>" . "\t<input type='submit' value='Lọc'>" . "\t</center>" . "</form>\r\n";
     include "make_list.inc.php";
     $arrField = array('title' => "Tên bài báo", 'date_request' => "Ngày yêu cầu", 'field' => "Chuyên ngành", 'requester' => "Người yêu cầu", 'supplier' => "Người cung cấp");
     if ($_POST['status'] == '-1') {
         $strCondition = " WHERE (status=-1) ";
     } elseif ($_POST['status'] == '-2') {
         $strCondition = " WHERE (status=-2) ";
     } else {
         $strCondition = " WHERE (status>-1) ";
     }
     if ($_POST['field'] > 0) {
         $strCondition .= "AND (field='" . $arrFieldList[$_POST['field']] . "') ";
     }
     draw_table('Request', $arrField, $_GET['orderBy'] . " " . $_GET['order'], $_POST['offset'], 'account.php?type=handle_request', $strCondition);
 } elseif ($_GET['action'] == "view_detail") {
     if (!isset($_GET['type'])) {
         $_GET['type'] = "";
     }
     if ($_GET['type'] == "user") {
         $strMysqlQuery = "SELECT * FROM {$strTableUserName} WHERE (id='" . $_POST['UserID'] . "')";
         $result = mysql_query($strMysqlQuery);
         $arrUserDetail = mysql_fetch_array($result) or die(mysql_error());
         echo "<div class='title' align='center'> Thong tin chi tiet cua <span style='color:#FF0000'>" . $arrUserDetail['username'] . "</span></div>\r\n";
     } else {
         die("<script language='javascript'>window.location='admin.php';</script>");
     }
 } elseif ($_GET['action'] == "all_supplier") {
     $strMysqlQuery = "SELECT * FROM {$strTableUserName} WHERE supplier=1 and field='" . $arrUserData['field'] . "'";
     $result = mysql_query($strMysqlQuery) or die(mysql_error());
Exemplo n.º 9
0
Arquivo: msql.php Projeto: philum/cms
function msql_adm($msql = '')
{
    //echo br();
    $root = sesm('root', 'msql/');
    $auth = $_SESSION['auth'];
    $ath = 6;
    //auth_level_mini
    $wsz = define_s('wsz', 700);
    $msql = $msql ? $msql : $_GET['msql'];
    $_SESSION['page'] = $_GET['page'] ? $_GET['page'] : 1;
    #boot
    if ($msql && $msql != '=') {
        $url = sesm('url', '/msql/');
        $ra = msql_boot($msql);
        $_SESSION['msql_boot'] = $ra;
        list($bases, $base, $dirs, $dir, $prefixes, $prefix, $files, $table, $version, $folder, $node) = $ra;
        //build url
        $murl = sesm('murl', murl($base, $dir, $prefix, $table, $version));
        //b/d/p_t_v
        $basename = $root . $folder . $node;
        $is_file = is_file($basename . '.php');
        $lk = sesm('lk', $url . $folder . $node . gpage());
        $folder = $root . $folder;
        //conformity
        msql_adm_head($lk, $base, $prefix, $table, $version);
    }
    $def = ajx($_POST['def'] ? $_POST['def'] : $_GET['def'], 1);
    if ($_GET['see']) {
        $ret[] = verbose($ra, 'dirs');
    }
    //auth
    if ($base == 'users' && $prefix == $_SESSION['USE']) {
        $_SESSION['ex_atz'] = 1;
    }
    if ($auth >= $ath && $_SESSION['ex_atz'] or $auth >= 6) {
        $authorized = true;
    }
    $lkb = $lk . '&';
    #load
    //reqp('msql'); $msq=new msql($base,$node); if($is_file)$defs=$msq->load();
    if (get('repair')) {
        msql_repair($folder, $node);
    }
    //old
    if ($is_file) {
        $defs = read_vars($folder, $node, $defsb);
    }
    //if(!$defs)$ret[]=verbose($ra,'');
    if ($defs['_menus_']) {
        $defsb['_menus_'] = $defs['_menus_'];
    }
    //save
    if ($def && !$defs[$def]) {
        $_POST['add'] = $def;
    }
    if (($_POST['def'] or $_POST['add']) && $authorized) {
        list($defs, $def) = save_defs($folder, $node, $defs, $def, $base);
    }
    //savb
    if ($_GET['sav']) {
        save_vars($folder, $node . '_sav', $defs, 1);
    }
    //create
    if ($_GET['create'] && $authorized) {
        $prefix = normaliz_c($_POST['prfx']);
        $table = normaliz_c($_POST['hbname']);
        if ($_POST['hbnb'] && $_POST['hbnb'] != 'version') {
            $version = $_POST['hbnb'];
        }
        if (!$_POST['hbnb']) {
            $version = '';
        }
        if (is_numeric($_POST['nbc'])) {
            $defsb['_menus_'] = '';
            $nbc = $_POST['nbc'];
            $nbc = $nbc > 1 ? $nbc : 1;
            for ($i = 1; $i <= $nbc; $i++) {
                $defsb['_menus_'][] = 'col_' . $i;
            }
        } elseif ($defs['_menus_']) {
            $defsb['_menus_'] = $defs['_menus_'];
        } else {
            $defsb['_menus_'] = array('');
        }
        $node = mnod($prefix, $table, $version);
        if ($folder && $prefix) {
            read_vars($folder, $node, $defsb);
        }
        relod(sesm('url') . murl_build('', '', $prefix, $table, $version));
    }
    #modifs
    //save_modif
    $do = find_command();
    if ($do && $auth >= $ath) {
        $defs = msql_modifs($defs, $defsb, $folder, $prefix . '_' . $table, $node, $basename, $do);
    }
    #render
    $lh = sesmk('msqlang');
    #-menus
    if (!$_GET['def']) {
        $ret['menus'] = msql_menus($ra);
    }
    //auth(3) &&
    if (!$_GET['def']) {
        //called
        #-files
        //add
        if (auth(4)) {
            $ret['fls'] = lkc('txtblc', $lkb . 'new==', pictxt('add', $lh[9][0])) . ' ';
        }
        if ($table && $authorized && $prefix && $is_file) {
            //$defs &&
            $ret['fls'] .= lkc('txtx', $lkb . 'sav==', $lh[2][0]) . ' ';
            if (is_file($basename . '_sav.php')) {
                $ret['fls'] .= lkc('txtx', $lkb . 'restore==', $lh[3][0]) . ' ';
            }
            $ret['fls'] .= lj_goto('import_defs', 5);
            //$ret['fls'].=lj_goto('import_old','');
            $ret['fls'] .= lj_goto('import_keys', 17);
            $ret['fls'] .= lj_goto('merge_defs', 6);
            $ret['fls'] .= lj_goto('append_update', 7);
            $ret['fls'] .= lj_goto('append_values', 8);
        } else {
            $ret['fls'] .= $bckp;
        }
        if ($files[$prefix] && ($auth > $ath or $prefix == $_SESSION['USE'])) {
            if ($auth >= $ath && $table && $prefix && $is_file) {
                $ret['fls'] .= lkc('txtx', $lkb . 'del_table==', $lh[10][0]) . ' ';
                $ret['fls'] .= ljb('txtblc', 'delfile', $lkb . 'del_file==', $lh[11][0]) . ' ';
                //$ret['fls'].=lkc('txtyl',$lkb.'del_file==',$lh[11][0]).' ';
                if (!$defs or isset($defs[0])) {
                    $ret['fls'] .= lkc('txtyl', $lkb . 'repair==', $lh[12][0]) . ' ';
                }
            }
        }
        if ($ret['fls']) {
            $ret['fls'] .= br();
        }
        //$ret['fls']=divc('menu',$ret['fls']);
        //new
        if ($_GET['new']) {
            $ret['fls'] .= newbase($base, $prefix, $table, $version);
        }
        #-util
        if ($table && $authorized && $prefix && $is_file) {
            $ret['utl'] .= lkc('txtblc', $lkb . 'def=_menus_', $lh[1][0]) . ' ';
            $ret['utl'] .= lkc('txtx', $lkb . 'reset_menus==', $lh[22][0]) . ' ';
            $ret['utl'] .= lkc('txtx', $lkb . 'del_menus==', $lh[23][0]) . ' ';
            $ret['utl'] .= lkc('txtx', $lkb . 'add_keys==', $lh[24][0]) . ' ';
            $ret['utl'] .= lkc('txtx', $lkb . 'del_keys==', $lh[25][0]) . ' ';
            $ret['utl'] .= lkc('txtx', $lkb . 'def=_menus_&add_col==', $lh[14][0]) . ' ';
            $ret['utl'] .= lj_goto('del_col', 15);
            if ($is_file) {
                $ret['utl'] .= lkc('txtx" title="' . $lh[13][1], $lkb . 'repair_cols==', $lh[13][0]) . br();
            }
            if ($base != 'system' && is_file(sesm('root') . 'system/' . $node . '.php')) {
                $ret['utl'] .= lkc('txtblc', $lkb . 'update==', $lh[26][0]) . ' ';
            }
            $ret['utl'] .= lj_goto('sort_table', 19);
            if ($table != 'restrictions' && $table != 'params') {
                $ret['utl'] .= lkc('txtx', $lkb . 'reorder==', $lh[20][0]) . ' ';
            }
            $ret['utl'] .= lj_goto('permut', 21);
            $ret['utl'] .= lkc('txtx', $lkb . 'edit_conn==', $lh[16][0]) . ' ';
            $ret['utl'] .= lkc('txtx" title="' . $lh[6][1], $lkb . 'inject_defs==', $lh[18][0]) . ' ';
            $ret['utl'] .= lkc('txtx', $lkb . 'edit_csv==', 'csv') . ' ';
            $ret['utl'] .= lkc('txtx', $lkb . 'json==', 'json') . ' ';
            if (auth(6)) {
                $ret['utl'] .= lkc('txtx', $lkb . 'export_mysql==', 'sql') . ' ';
            }
            if (auth(6)) {
                $ret['utl'] .= lkc('txtx', $lkb . 'create_mysql==', 'create mysql') . ' ';
            }
            $ret['utl'] .= lj('txtx', 'popup_msql___lang_helps_msql', '?');
        }
        #-fieldset
        if ($ret['fls'] . $ret['utl']) {
            $ret['utils'] = divc('menu', $ret['fls'] . $ret['utl']);
        }
        $ret['fls'] = $ret['utl'] = '';
        //if($ret['nfo'])$ret['nfo'].=br();
    }
    //called
    #-infos
    if ($table && $is_file) {
        $ret['nfo'] = lkc('popsav', $lk, $murl) . ' ';
        $wurl = $_SERVER['HTTP_HOST'] . '/msql/' . $murl;
        $ret['nfo'] .= lj('popbt', 'popup_text___' . ajx($wurl) . '_weburl_console', pictit('link', 'web url'));
        $wcon = '[' . $murl . $kdef . ($def ? ':' . $def : '') . ':microsql]';
        $ret['nfo'] .= lj('popbt', 'popup_text___' . ajx($wcon) . '_connector_console', pictit('conn', 'connector'));
        $ret['nfo'] .= lkt('popbt', '/plug/microxml.php?table=' . $murl, pictit('rss', 'xml')) . ' - ';
        $ret['nfo'] .= btn('txtsmall2', count($defs) . ' ' . plurial(count($defs), 116)) . ' - ';
        if ($is_file) {
            $ret['nfo'] .= btn('txtsmall2', fsize($basename . '.php')) . ' - ';
        }
        $ret['nfo'] .= btn('txtsmall2', ftime($basename . '.php')) . ' ';
        $ret['nfo'] .= msq_search($murl);
    }
    if ($ret['nfo']) {
        $ret['nfo'] = divc('menu', $ret['nfo']);
    }
    //entries
    //if($defs)$ret['edt'].=slctmenuder($defs,$def?$def:'_menus_');
    //add
    if ($is_file && $authorized && !$_GET['called'] && $defs && !$_GET['def']) {
        $ret['edt'] .= divc('menu', f_inp_add($defs, $defsb, $def)) . br();
    }
    //edit
    //echo verbose($ra,'');
    if ($def && $defs[$def]) {
        $ret['edt'] .= f_inp_m($defs, $defsb['_menus_'], $def);
    }
    //edit_conn
    if ($_GET['edit_conn'] == '=') {
        if ($defs) {
            foreach ($defs as $k => $v) {
                $v = str_replace(array('|', '¬'), array(':BAR:', ':LINE:'), $v);
                $edittable .= implode('|', $v) . '¬' . "\n";
            }
        }
        //(!is_numeric($k)?$k.'|':'')
        $ret[] = divc('', 'paste a table as created by transductor from html table :: use "|" for cells and "¬" for lines of cells') . form($lkb . 'def=' . $def, txarea('import_conn', $edittable, 60, 14) . br() . checkbox('aid', 'ok', 'auto_increment', '1') . input2('submit', 'save', 'import', 'txtbox')) . hr() . br();
    }
    //array
    if ($_GET['inject_defs'] == '=') {
        $datas = str_replace(array('<' . '?php', '?' . '>'), '', read_file($basename . '.php'));
        $ret[] = divc('', 'paste $r[1]=array(1,2,3)') . form($lkb, txarea('inject_defs', $datas, 60, 14) . br() . input2('submit', 'replace', 'replace', 'txtbox') . input2('submit', 'inject', 'inject', 'txtbox') . checkbox('mono', '1', 'key=>value', '') . checkbox('sql', '1', 'mysql', '')) . hr() . br();
    }
    //export_mysql
    if ($_GET['create_mysql'] == '=' && auth(6)) {
        $ok = plugin_func('mysql', 'import_msql', $defs, $node);
        $ret[] = divc('txtalert', 'create table ' . $node . ': ' . $ok);
    }
    if ($_GET['export_mysql'] == '=' && auth(6)) {
        $ret[] = txarea('', mysqlrb($defs), 60, 40);
    }
    //csv
    if ($_GET['edit_csv'] == '=') {
        foreach ($defs as $k => $v) {
            if ($v) {
                $edittable .= $k . ':' . (is_array($v) ? implode(',', $v) : htmlentities($v)) . "\n";
            }
        }
        $ret[] = divc('', 'paste csv using "," for cells and lines for rows') . form($lkb . 'def=' . $def, txarea('edit_csv', $edittable, 60, 14) . br() . checkbox('aid', 'ok', 'auto_increment', '1') . input2('submit', 'save', 'import', 'txtbox')) . hr() . br();
    }
    //csv
    if ($_GET['json'] == '=') {
        foreach ($defs as $k => $v) {
            if ($v) {
                $edittable .= '"' . $k . '":' . (is_array($v) ? '["' . implode('","', $v) . '"]' : '"' . htmlentities($v[0])) . '",';
            }
        }
        $ret[] = txarea('edit_csv', '{' . $edittable, 60, 14) . '}' . br();
    }
    //see_table
    if ($defs && !$_GET['def']) {
        // && (!$def or $_POST['save'])//called
        $out = divd('editmsql', draw_table($defs, $murl, ''));
        $ret[] = $out . br();
    } else {
        $ret[] = divd('editmsql', '');
    }
    if ($auth > 6) {
        $ret[] = lkc('txtx', $lkb . 'backup_msql==', 'backup') . ' ';
    }
    if ($_GET['backup_msql']) {
        $ret[] = backup_msql();
    }
    return divd('content', implode('', $ret));
}
Exemplo n.º 10
0
function search_bugs($pattern, $search_options)
{
    #	A poor-man's (*very* poor!) full text search.  Not terribly efficient, but at most, we're scanning 2-3MBs...
    global $debug_g, $xml_array_g;
    #	Sanitize search string & block cross-site scripting
    $pattern = trim(eregi_replace('([^ .#&$=0-9a-z_-]+)', ' ', $pattern));
    $pattern = eregi_replace('[ ]+', ' ', $pattern);
    if (!$pattern) {
        die('<br /><br /><center><h3>No search terms were supplied. Enter a keyword or phrase, e.g., "blue screen".');
    }
    if (!$search_options) {
        die("<br /><br /><center><h3>No search fields specified.  You must choose at least one field (i.e., Summaries).");
    }
    parse_xml_file(CT_XML_BUGS_FILE, CT_DROP_HISTORY, "ID", CT_ASCENDING);
    # Alias for generic data array by reference for speed, so do not call not parse_xml again
    $bug_array =& $xml_array_g;
    if ($search_options['phrase']) {
        $needles[] = $pattern;
        $title = "Issues Containing: &nbsp;<em>&quot;{$pattern}&quot;</em>";
    } else {
        $needles = explode(" ", $pattern);
        $title = "Issues Containing: ";
        for ($j = 0; $j < sizeof($needles); $j++) {
            if ($j) {
                $title .= " or <em>&quot;{$needles[$j]}&quot;</em>";
            } else {
                $title .= "<em>&quot;{$needles[$j]}&quot;</em>";
            }
        }
    }
    $title .= " &nbsp;(Detailed View Below)";
    $hits = array();
    $max_ceiling_hit = FALSE;
    foreach ($bug_array as $bug) {
        if (isset($bug["Delete_Bug"])) {
            continue;
        }
        $haystack = '';
        if (isset($search_options['summary'])) {
            $haystack = $bug["Summary"];
        }
        if (isset($search_options['description'])) {
            $haystack .= " " . $bug["Description"];
        }
        if (isset($search_options['comment'])) {
            $haystack .= " " . $bug["Developer_Comment"];
        }
        $haystack = trim($haystack);
        foreach ($needles as $needle) {
            if (stristr($haystack, $needle)) {
                $hits[] = $bug;
                break;
            }
        }
        if (sizeof($hits) == CT_MAX_SEARCH_RESULTS) {
            $max_ceiling_hit = TRUE;
            $title .= "<br /><em>Note: Too many hits for this search term. Showing first " . CT_MAX_SEARCH_RESULTS . " results.</em>";
            break;
        }
    }
    if ($hits) {
        #	Sort hits by ID
        usort($hits, create_function('$a,$b', 'return strcasecmp($a["ID"],$b["ID"]);'));
        draw_table($hits, $title, '', $project_table);
        print "<center><span class='txtSmall'>Reports</span></center><hr class='hrBlack' width='80%'><br />\n";
        foreach ($hits as $hit) {
            draw_read_only_table($hit);
            print "<br /> __________________________________________ <br /><br />\n";
        }
    } else {
        print "<br /><br /><center><span class='txtSmall'>Search Results: <em>No matches found</em></span></center>\n";
    }
}
Exemplo n.º 11
0
<?php

$main_array = array(array('Name' => 'Trixie', 'Color' => 'Green', 'Element' => 'Earth', 'Likes' => 'Flowers'), array('Name' => 'Tinkerbell', 'Element' => 'Air', 'Likes' => 'Singing', 'Color' => 'Blue'), array('Element' => 'Water', 'Likes' => 'Dancing', 'Name' => 'Blum', 'Color' => 'Pink'));
?>
<style>

</style>

<h1>Задание 4: PHP</h1>
<div class="php container">
<?php 
draw_table($main_array);
?>
</div>
Exemplo n.º 12
0
// Break up projects into those I can modify and those I cannot.
$my_projects = array();
$other_projects = array();
foreach ($projects as $proj) {
    $proj_id = $proj[PA_PROJECT_TABLE_FIELDNAME::PROJECT_ID];
    if ($user->isAllowed(PA_Action::UPDATE_PROJECT, CS_CONTEXT_TYPE::PROJECT, $proj_id)) {
        $my_projects[] = $proj;
    } else {
        $other_projects[] = $proj;
    }
}
// error_log("MINE = " . print_r($my_projects, true));
// error_log("OTHERS = " . print_r($other_projects, true));
echo "<h2>Projects You Manage</h2>";
if (count($my_projects) == 0) {
    echo "You have no projects of which you are lead or admin.<br>";
} else {
    echo "This table shows all projects of which you are a lead or admin.<br>";
    echo "If a project has not been enabled for wireless access, the <b>Enable project</b> button will enable it.<br>";
    echo "If a project has already been enabled for wireless access, the <b>Disable project</b> button will disable it.<br>";
    echo "Wireless-enabled projects allow for synchronizing GENI and Wireless project and member state with the <b>Sync Project</b> button.<br>";
}
draw_table($my_projects, $lead_names, $attribs_by_project, true);
if (count($other_projects) > 0) {
    echo "<h2>Projects Others Manage</h2>";
    echo "This table shows all projects to which you belong but do not have management privileges.<br>";
    echo "The projects with a 'Wireless Group' indicated are already wireless-enabled.<br>";
    echo "Contact the project lead if you would like to modify wireless settings for a given project.<br>";
    draw_table($other_projects, $lead_names, $attribs_by_project, false);
}
include "footer.php";
    accessforbidden();
}
$langs->load('mandarin@mandarin');
$userid = GETPOST('userid');
if ($userid != 0) {
    $userdefault = $userid;
} elseif (user_est_responsable_hierarchique()) {
    $userid = $user->id;
}
// Begin of page
llxHeader('', $langs->trans('mandarinTitleGraphEventByUser'), '');
print dol_get_fiche_head('RapportEvenementsParCommerciaux');
print_fiche_titre($langs->trans('RapportEvenementsParCommerciaux'));
print_form_filter($userid);
$TData = get_data_tab($userid);
draw_table($TData, get_list_id_user($TData), get_tab_label_action_comm());
print '<br />';
draw_graphique($TData, get_tab_label_action_comm());
llxFooter();
function print_form_filter($userid)
{
    global $db, $langs;
    $langs->load('users');
    $form = new Form($db);
    print '<form name="filter" methode="GET" action="' . $_SERVER['PHP_SELF'] . '">';
    print $langs->trans('HierarchicalResponsible');
    print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', '', 1);
    print '<br /><br />';
    $date_deb = explode('/', $_REQUEST['date_deb']);
    $date_deb = implode('/', array_reverse($date_deb));
    $date_fin = explode('/', $_REQUEST['date_fin']);
Exemplo n.º 14
0
    if ($i > $year_end) {
        echo " ";
    }
}
echo " ]</div>";
// Output games year-by-year
$cur_year = date_parse($games[0]['date'])['year'];
$start_index = 0;
for ($i = 0; $i < $num_games; $i++) {
    $year = date_parse($games[$i]['date'])['year'];
    if ($year != $cur_year) {
        echo "<div class='block_year'><h3><a class='anchor' name='anchor_" . $cur_year . "'>" . $cur_year . " год</a></h3><br>";
        draw_table($start_index, $i - 1);
        $start_index = $i;
        $cur_year = $year;
        echo "<br></div>";
    } else {
        if ($i == $num_games - 1) {
            echo "<div class='block_year'><h3><a class='anchor' name='anchor_" . $cur_year . "'>" . $cur_year . " год</a></h3><br>";
            draw_table($start_index, $i);
            $start_index = $i;
            $cur_year = $year;
            echo "<br></div>";
        }
    }
}
?>
		
	</body>
</html>