コード例 #1
0
ファイル: db.php プロジェクト: Anna-Sentyakova/runningcat
    mysql_select_db($conf['dbase']) or die(mysql_error());
    $results = array();
    $res = mysql_query("select id,deleted,firstname,lastname from mdl_user where id>25 and deleted=0 order by lastname,firstname");
    // from some group!!
    while ($row = mysql_fetch_assoc($res)) {
        $usersubmissions = osv_row($row['id'], $row['lastname'], $row['firstname'], $results[$row['id']]);
        $result[$row['id']] = $usersubmissions;
    }
    return array('text' => $result, 'results' => $results);
}
/*if (!$_REQUEST['from']) {
	$_REQUEST['from']='2009.01.01';
}
if (!$_REQUEST['to']) {
	$_REQUEST['to']='2011.01.01';
}*/
?>
<body>
<!--p>Выберите расчетный период</p-->
<form action='db.php'>
<!--input type='text' id='s-from' name='from' value='<!?print $_REQUEST['from']?>'></input-->
<!--input type='text' id='s-to' name='to' value='<!?print $_REQUEST['to']?>'></input-->
<!--input type='submit'></input-->
<!--p><strong>Оборотно-сальдовая ведомость</strong></p-->
</form>
<?php 
print format_table(osv());
?>
</body>
</html>
コード例 #2
0
ファイル: dashboard.php プロジェクト: clstrfcuk/VVV-Dashboard
                echo vvv_dash_error('Error: That theme already exists!');
            } else {
                $cmd = 'wp scaffold child-theme ' . $child . ' --theme_name="' . $_POST['theme_name'] . '" --parent_theme=' . $_POST['item'] . ' --path=' . $host_path . ' --debug';
                $new_theme = shell_exec($cmd);
                if ($new_theme) {
                    $purge_status = $cache->purge('-themes');
                    echo vvv_dash_notice($purge_status . ' files were purged from cache!');
                    echo vvv_dash_notice($new_theme);
                } else {
                    echo vvv_dash_error('<strong>Error:</strong> Something went wrong!');
                }
            }
        }
        $host_info = $vvv_dash->set_host_info($_GET['host']);
        $themes = $vvv_dash->get_themes_data($host_info['host'], $host_info['path']);
        echo format_table($themes, $_GET['host'], 'themes');
    }
}
if ($debug_log_path && file_exists($debug_log_path) && !empty($debug_log_lines)) {
    if (isset($_GET['host'])) {
        ?>
<h4>Debug Log for
					<span class="red"><?php 
        echo $_GET['host'];
        ?>
</span> <?php 
        echo $close;
        ?>
</h4><?php 
        ?>
					<div class="wp-debug-log">
コード例 #3
0
ファイル: php_tokens.php プロジェクト: nevernet/goblin-emacs
    $view = array();
    $last = null;
    foreach ($results as $token) {
        if ($last && (!$token->isMember && $last->isMember || in_array($token->type, array(T_INTERFACE, T_CLASS)))) {
            $view[] = array('', '', '', '', '');
        }
        $last = $token;
        $view[] = array($token->line, $token->isMember ? $token->access : '', strtolower(str_replace('T_', '', token_name($token->type))), $token->name, docblock_excerpt($token->docblock));
    }
    return $view;
}
function format_table($map)
{
    $out = array();
    $column_widths = array_fill(0, count($map[0]), 0);
    foreach ($map as $row) {
        foreach ($row as $num => $col) {
            $column_widths[$num] = max($column_widths[$num], strlen($col));
        }
    }
    foreach ($map as $row) {
        $line = '';
        foreach ($row as $num => $col) {
            $line .= str_pad($col, $column_widths[$num] + 2);
        }
        $out[] = trim($line);
    }
    return implode("\n", $out);
}
print format_table(list_to_table(transform_tokens_to_list(token_get_all_improved(file_get_contents(isset($argv[1]) ? $argv[1] : 'php://stdin'))))) . "\n";