• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP phoromatic_webui_main函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中phoromatic_webui_main函数的典型用法代码示例。如果您正苦于以下问题:PHP phoromatic_webui_main函数的具体用法?PHP phoromatic_webui_main怎么用?PHP phoromatic_webui_main使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了phoromatic_webui_main函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: render_page_process

 public static function render_page_process($PATH)
 {
     echo phoromatic_webui_header_logged_in();
     $main = '<h1>Systems</h1>';
     $main .= '<p>Various system interaction vitals for the Phoronix Test Suite systems associated with this account.</p>';
     $stmt = phoromatic_server::$db->prepare('SELECT Title, SystemID, Hardware, Software, ClientVersion, LastIP, NetworkMAC, LastCommunication, CurrentTask, CoreVersion, NetworkWakeOnLAN, BlockPowerOffs FROM phoromatic_systems WHERE AccountID = :account_id AND State >= 0 ORDER BY LastCommunication DESC');
     $stmt->bindValue(':account_id', $_SESSION['AccountID']);
     $result = $stmt->execute();
     while ($row = $result->fetchArray()) {
         $stmt = phoromatic_server::$db->prepare('SELECT UploadTime FROM phoromatic_results WHERE AccountID = :account_id AND SystemID = :system_id ORDER BY UploadTime DESC LIMIT 1');
         $stmt->bindValue(':account_id', $_SESSION['AccountID']);
         $stmt->bindValue(':system_id', $row['SystemID']);
         $latest_result = $stmt->execute();
         $latest_result = $latest_result->fetchArray();
         $latest_result = $latest_result['UploadTime'];
         $components[$row['SystemID']]['Last Communication'] = date('H:i d F', strtotime($row['LastCommunication']));
         $components[$row['SystemID']]['Current Task'] = $row['CurrentTask'];
         $components[$row['SystemID']]['Last IP'] = $row['LastIP'];
         $components[$row['SystemID']]['Phoronix Test Suite'] = $row['ClientVersion'] . ' [' . $row['CoreVersion'] . ']';
         $components[$row['SystemID']]['MAC'] = $row['NetworkMAC'];
         $components[$row['SystemID']]['Wake-On-LAN'] = (empty($row['NetworkWakeOnLAN']) ? 'N/A' : $row['NetworkWakeOnLAN']) . ' - ' . ($row['BlockPowerOffs'] == 1 ? 'Blocked' : 'Permitted');
         $components[$row['SystemID']]['Latest Result Upload'] = $latest_result != null ? date('d F', strtotime($latest_result)) : 'N/A';
         $system_ids[$row['SystemID']] = $row['Title'];
     }
     $main .= '<div style="margin: 10px auto; overflow: auto;"><table width="100%">';
     $component_types = array('Last Communication', 'Current Task', 'Phoronix Test Suite', 'Last IP', 'MAC', 'Wake-On-LAN', 'Latest Result Upload');
     $main .= '<tr><th>&nbsp;</th>';
     foreach ($component_types as $type) {
         $main .= '<th>' . $type . '</th>';
     }
     foreach ($components as $system_id => $component_array) {
         $main .= '<tr>';
         $main .= '<th><a href="/?systems/' . $system_id . '">' . $system_ids[$system_id] . '</a></th>';
         foreach ($component_types as $type) {
             $c = isset($component_array[$type]) ? $component_array[$type] : 'N/A';
             if (($x = stripos($c, ' @ ')) !== false) {
                 $c = substr($c, 0, $x);
             }
             if (($x = stripos($c, ' (')) !== false) {
                 $c = substr($c, 0, $x);
             }
             $main .= '<td>' . $c . '</td>';
         }
         $main .= '</tr>';
     }
     $main .= '</table></div>';
     $right = null;
     echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in($right));
     echo phoromatic_webui_footer();
 }
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:50,代码来源:phoromatic_maintenance_table.php


示例2: render_page_process

    public static function render_page_process($PATH)
    {
        if (isset($_POST['register_password']) && isset($_POST['register_password_confirm']) && isset($_POST['old_password'])) {
            $matching_user = phoromatic_server::$db->querySingle('SELECT Password FROM phoromatic_users WHERE UserName = \'' . $_SESSION['UserName'] . '\' AND AccountID = \'' . $_SESSION['AccountID'] . '\'', true);
            if (!empty($matching_user)) {
                $hashed_password = $matching_user['Password'];
                $account_salt = phoromatic_server::$db->querySingle('SELECT Salt FROM phoromatic_accounts WHERE AccountID = \'' . $_SESSION['AccountID'] . '\'');
                if ($account_salt != null && hash('sha256', $account_salt . $_POST['old_password']) == $hashed_password) {
                    if (strlen($_POST['register_password']) < 6) {
                        phoromatic_error_page('Oops!', 'Please go back and ensure the supplied password is at least six characters long.');
                        return false;
                    }
                    if ($_POST['register_password'] != $_POST['register_password_confirm']) {
                        phoromatic_error_page('Oops!', 'Please go back and ensure the supplied password matches the password confirmation.');
                        return false;
                    }
                    $new_salted_password = hash('sha256', $account_salt . $_POST['register_password']);
                    phoromatic_server::$db->exec('UPDATE phoromatic_users SET Password = \'' . $new_salted_password . '\' WHERE UserName = "' . $_SESSION['UserName'] . '"');
                    echo '<h1>Password Updated!</h1>';
                } else {
                    phoromatic_error_page('Oops!', 'The original password does not match the records for this account.');
                    return false;
                }
            } else {
                phoromatic_error_page('Oops!', 'Problem fetching user information. Try again.');
                return false;
            }
        }
        echo phoromatic_webui_header_logged_in();
        $main = '<h1>Change Password</h1>
		<form name="reset_password" id="reset_password" action="?password" method="post" onsubmit="return phoromatic_password_reset(this);">
		<div style="clear: both;">
			<div style="float: left; font-weight: bold; padding-right: 10px;">
			<p style="height: 50px;">Password</p>
			<p style="height: 50px;">New Password</p>
			<p style="height: 50px;">Confirm New Password</p>
			</div>

			<div style="float: left;">
			<p style="height: 50px;"><input type="password" name="old_password" /></p>
			<p style="height: 50px;"><input type="password" name="register_password" /> <sup>1</sup></p>
			<p style="height: 50px;"><input type="password" name="register_password_confirm" /></p>
			<p style="height: 50px;"><input type="submit" value="Change Password" /></p>
			</div>
		</div>
		<p style="clear: both;"><sup>1</sup> Passwords shall be at least six characters long.</p>';
        echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in());
        echo phoromatic_webui_footer();
    }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:49,代码来源:phoromatic_password.php


示例3: render_page_process

 public static function render_page_process($PATH)
 {
     echo phoromatic_webui_header_logged_in();
     $main = '<h1>System Components</h1>';
     $main .= '<p>Detected hardware/software components via Phoronix Test Suite\'s Phodevi implementation on the Phoromatic client systems.</p>';
     $stmt = phoromatic_server::$db->prepare('SELECT Title, SystemID, Hardware, Software, ClientVersion, NetworkWakeOnLAN, NetworkMAC FROM phoromatic_systems WHERE AccountID = :account_id AND State >= 0 ORDER BY Title ASC');
     $stmt->bindValue(':account_id', $_SESSION['AccountID']);
     $result = $stmt->execute();
     while ($row = $result->fetchArray()) {
         $components[$row['SystemID']] = array_merge(pts_result_file_analyzer::system_component_string_to_array($row['Software'], array('OS', 'Kernel', 'OpenGL', 'File-System')), pts_result_file_analyzer::system_component_string_to_array($row['Hardware'], array('Processor', 'Motherboard', 'Memory', 'Disk', 'Graphics')));
         $components[$row['SystemID']]['Phoronix Test Suite'] = $row['ClientVersion'];
         $components[$row['SystemID']]['WoL Info'] = $row['NetworkWakeOnLAN'];
         $components[$row['SystemID']]['MAC'] = $row['NetworkMAC'];
         $system_ids[$row['SystemID']] = $row['Title'];
     }
     $main .= '<div style="margin: 10px auto; overflow: auto;"><table>';
     $component_types = array('MAC', 'Processor', 'Motherboard', 'Memory', 'Disk', 'Graphics', 'OS', 'Kernel', 'OpenGL', 'File-System', 'Phoronix Test Suite', 'WoL Info');
     $main .= '<tr><th>&nbsp;</th>';
     foreach ($component_types as $type) {
         $main .= '<th>' . $type . '</th>';
     }
     foreach ($components as $system_id => $component_array) {
         $main .= '<tr>';
         $main .= '<th><a href="/?systems/' . $system_id . '">' . $system_ids[$system_id] . '</a></th>';
         foreach ($component_types as $type) {
             $c = isset($component_array[$type]) ? $component_array[$type] : 'N/A';
             if (($x = stripos($c, ' @ ')) !== false) {
                 $c = substr($c, 0, $x);
             }
             if (($x = stripos($c, ' (')) !== false) {
                 $c = substr($c, 0, $x);
             }
             $main .= '<td>' . $c . '</td>';
         }
         $main .= '</tr>';
     }
     $main .= '</table></div>';
     $right = null;
     echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in($right));
     echo phoromatic_webui_footer();
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:41,代码来源:phoromatic_component_table.php


示例4: render_page_process

    public static function render_page_process($PATH)
    {
        echo phoromatic_webui_header_logged_in();
        $main = '<h1>Cache Settings</h1>
				<h2>Test Profile Download Cache</h2>
				<p>Below are a list of files for verification/debugging purposes that are currently cached by the Phoromatic Server and available for Phoronix Test Suite client systems to download. These are files that are needed by various test profiles in the Phoronix Test Suite. To add more data to this Phoromatic Server cache, from the server run <strong>phoronix-test-suite make-download-cache</strong> while passing the names of any tests/suites you wish to have download and generate a cache for so they can be made available to the Phoronix Test Suite clients on your network.</p>';
        $dc = pts_strings::add_trailing_slash(pts_strings::parse_for_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/CacheDirectory', PTS_DOWNLOAD_CACHE_PATH)));
        $dc_exists = is_file($dc . 'pts-download-cache.json');
        if ($dc_exists) {
            $cache_json = file_get_contents($dc . 'pts-download-cache.json');
            $cache_json = json_decode($cache_json, true);
        }
        if (is_file($dc . 'pts-download-cache.json')) {
            if ($cache_json && isset($cache_json['phoronix-test-suite']['download-cache'])) {
                $total_file_size = 0;
                $main .= '<table style="margin: 0 auto;"><tr><th>File</th><th>Size</th></tr>';
                foreach ($cache_json['phoronix-test-suite']['download-cache'] as $file_name => $inf) {
                    $total_file_size += $cache_json['phoronix-test-suite']['download-cache'][$file_name]['file_size'];
                    $main .= '<tr><td>' . $file_name . '</td><td>' . round(max(0.1, $cache_json['phoronix-test-suite']['download-cache'][$file_name]['file_size'] / 1000000), 1) . 'MB</td></tr>';
                }
                $main .= '</table>';
                $main .= '<p><strong>' . count($cache_json['phoronix-test-suite']['download-cache']) . ' Files / ' . round($total_file_size / 1000000) . ' MB Cache Size</strong></p>';
            }
        } else {
            $main .= '<h3>No download cache file could be found; on the Phoromatic Server you should run <strong>phoronix-test-suite make-download-cache</strong>.</h3>';
            // TODO XXX implement from the GUI
        }
        $main .= '<hr /><h2>OpenBenchmarking.org Cache Data</h2>';
        $main .= '<p>Below is information pertaining to the OpenBenchmarking.org cache present on the Phoromatic Server. To update this cache, run <strong>phoronix-test-suite make-openbenchmarking-cache</strong> from the server.</p>';
        $index_files = pts_file_io::glob(PTS_OPENBENCHMARKING_SCRATCH_PATH . '*.index');
        $main .= '<table style="margin: 0 auto;"><tr><th>Repository</th><th>Last Updated</th></tr>';
        foreach ($index_files as $index_file) {
            $index_data = json_decode(file_get_contents($index_file), true);
            $main .= '<tr><td>' . basename($index_file, '.index') . '</td><td>' . date('d F Y H:i', $index_data['main']['generated']) . '</td></tr>';
        }
        $main .= '</table>';
        echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in());
        echo phoromatic_webui_footer();
    }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:39,代码来源:phoromatic_caches.php


示例5: render_page_process

 public static function render_page_process($PATH)
 {
     $main = null;
     if (isset($PATH[0])) {
         if ($PATH[0] == 'context' && isset($PATH[1])) {
             $attribs = explode(',', $PATH[1]);
             $stmt = phoromatic_server::$db->prepare('SELECT UserContextStep, UserContextLog FROM phoromatic_system_context_logs WHERE AccountID = :account_id AND ScheduleID = :schedule_id AND SystemID = :system_id AND TriggerID = :trigger_id ORDER BY UploadTime ASC');
             $stmt->bindValue(':account_id', $_SESSION['AccountID']);
             $stmt->bindValue(':system_id', $attribs[0]);
             $stmt->bindValue(':schedule_id', $attribs[1]);
             $stmt->bindValue(':trigger_id', base64_decode($attribs[2]));
             $result = $stmt->execute();
             while ($row = $result->fetchArray()) {
                 $main .= '<h2>' . $row['UserContextStep'] . '</h2><p>' . str_replace(PHP_EOL, '<br />', $row['UserContextLog']) . '</p><hr />';
             }
         } else {
             if ($PATH[0] == 'system' && isset($PATH[1])) {
                 $zip_file = phoromatic_server::phoromatic_account_result_path($_SESSION['AccountID'], $PATH[1]) . 'system-logs.zip';
                 if (is_file($zip_file)) {
                     $zip = new ZipArchive();
                     $res = $zip->open($zip_file);
                     if ($res === true) {
                         for ($i = 0; $i < $zip->numFiles; $i++) {
                             if ($zip->getFromIndex($i) != null) {
                                 $main .= '<h2>' . basename($zip->getNameIndex($i)) . '</h2><p>' . str_replace(PHP_EOL, '<br />', $zip->getFromIndex($i)) . '</p><hr />';
                             }
                         }
                         $zip->close();
                     }
                 }
             }
         }
     }
     echo phoromatic_webui_header_logged_in();
     echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in(null));
     echo phoromatic_webui_footer();
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:37,代码来源:phoromatic_logs.php


示例6: render_page_process


//.........这里部分代码省略.........
            if (!empty($row)) {
                $right .= '<h3><a href="?schedules/' . $row['ScheduleID'] . '">' . $row['Title'] . '</a></h3>';
                if (!empty($row['ActiveOn'])) {
                    $right .= '<p align="center"><strong>' . phoromatic_schedule_activeon_string($row['ActiveOn'], $row['RunAt']) . '</strong></p>';
                }
                $right .= '<p>Compare this result file to the latest results from the past: ';
                $right .= '<select name="view_results_from_past" id="view_results_from_past" onchange="phoromatic_jump_to_results_from(\'' . $row['ScheduleID'] . '\', \'view_results_from_past\', \'' . $PATH[0] . ',\');">';
                $oldest_upload_time = strtotime(phoromatic_oldest_result_for_schedule(self::$schedule_id));
                $opts = array('Week' => 7, 'Three Weeks' => 21, 'Month' => 30, 'Quarter' => 90, 'Six Months' => 180, 'Year' => 365);
                foreach ($opts as $str_name => $time_offset) {
                    if ($oldest_upload_time > time() - 86400 * $time_offset) {
                        break;
                    }
                    $right .= '<option value="' . $time_offset . '">' . $str_name . '</option>';
                }
                $right .= '<option value="all">All Results</option>';
                $right .= '</select>';
                $right .= '</p>';
            }
        }
        if (true) {
            $compare_results = array();
            $hash_matches = 0;
            $ticket_matches = 0;
            $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results WHERE AccountID = :account_id AND ComparisonHash = :comparison_hash AND PPRID NOT IN (:pprid) ORDER BY UploadTime DESC LIMIT 12');
            $stmt->bindValue(':account_id', $_SESSION['AccountID']);
            $stmt->bindValue(':comparison_hash', $result_file->get_contained_tests_hash(false));
            $stmt->bindValue(':pprid', implode(',', $upload_ids));
            $result = $stmt->execute();
            while ($row = $result->fetchArray()) {
                $compare_results[$row['PPRID']] = $row;
                $hash_matches++;
            }
            foreach ($benchmark_tickets as $ticket_id) {
                $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results WHERE AccountID = :account_id AND BenchmarkTicketID = :ticket_id AND PPRID NOT IN (:pprid) ORDER BY UploadTime DESC LIMIT 12');
                $stmt->bindValue(':account_id', $_SESSION['AccountID']);
                $stmt->bindValue(':ticket_id', $ticket_id);
                $stmt->bindValue(':pprid', implode(',', $upload_ids));
                $result = $stmt->execute();
                while ($row = $result->fetchArray()) {
                    $compare_results[$row['PPRID']] = $row;
                    $ticket_matches++;
                }
            }
            if (!empty($compare_results)) {
                $right .= '<hr /><h3>Compare Results</h3><form name="compare_similar_results" onsubmit="return false;">
						<input type="hidden" value="' . implode(',', $upload_ids) . '" id="compare_similar_results_this" />';
                foreach ($compare_results as &$row) {
                    $right .= '<p><input type="checkbox" value="' . $row['PPRID'] . '" name="compare_results" /> ' . $row['Title'] . '<br /><em>' . phoromatic_system_id_to_name($row['SystemID'], $row['AccountID']) . '</em></p>';
                }
                $right .= '<p><input type="submit" value="Compare Results" id="compare_results_submit" onclick="javascript:phoromatic_do_custom_compare_results(this); return false;" /></p></form>';
                if ($ticket_matches > 3) {
                    $right .= '<p><a href="/results/ticket/' . $ticket_id . '">Find All Matching Results</a>';
                } else {
                    if ($hash_matches > 3) {
                        $right .= '<p><a href="/results/hash/' . $result_file->get_contained_tests_hash(false) . '">Find All Matching Results</a>';
                    }
                }
            }
        }
        if (count($upload_ids) > 1) {
            $checkbox_options = array('normalize_results' => 'Normalize Results', 'sort_by_performance' => 'Sort Results By Performance', 'sort_by_name' => 'Reverse Result By Identifier', 'sort_by_reverse' => 'Reverse Result Order', 'show_only_changed_results' => 'Show Only Results With Result Variation', 'force_line_graph' => 'Force Line Graph');
            if ($result_file->is_multi_way_comparison()) {
                $checkbox_options['condense_comparison'] = 'Condense Comparison';
                $checkbox_options['transpose_comparison'] = 'Transpose Comparison';
            }
            $right .= '<form action="' . $_SERVER['REQUEST_URI'] . '" name="update_result_view" method="post"><hr /><h3>Result Analysis Options</h3><p align="left">' . PHP_EOL;
            foreach ($checkbox_options as $val => $name) {
                $right .= '<input type="checkbox" name="' . $val . '" value="1" ' . (isset($_POST[$val]) ? 'checked="checked" ' : null) . '/> ' . $name . '<br />';
            }
            $right .= '<br /><input type="submit" value="Refresh Results"></p></form>';
        }
        if (self::$schedule_id && !empty(self::$schedule_id) && $system_types[0] && $trigger_types[0]) {
            $stmt = phoromatic_server::$db->prepare('SELECT UserContextStep FROM phoromatic_system_context_logs WHERE AccountID = :account_id AND ScheduleID = :schedule_id AND SystemID = :system_id AND TriggerID = :trigger_id');
            $stmt->bindValue(':account_id', $_SESSION['AccountID']);
            $stmt->bindValue(':system_id', $system_types[0]);
            $stmt->bindValue(':schedule_id', self::$schedule_id);
            $stmt->bindValue(':trigger_id', $trigger_types[0]);
            $result = $stmt->execute();
            if ($row = $result->fetchArray()) {
                $right .= '<hr /><h3>User Context Logs</h3>';
                do {
                    $right .= '<p><a href="?logs/context/' . $system_types[0] . ',' . self::$schedule_id . ',' . base64_encode($trigger_types[0]) . '">' . $row['UserContextStep'] . '</a></p>';
                } while ($row = $result->fetchArray());
            }
        }
        $right .= '<hr /><h3>Result Export</h3>';
        $right .= '<p><a href="/public.php?t=result&ut=' . implode(',', $upload_ids) . $url_append . '">Public Viewer</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&download=pdf' . $url_append . '">Download As PDF</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&download=csv">Download As CSV</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&download=xml">Download As XML</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&download=txt">Download As TEXT</a></p>';
        $right .= '<p><a href="?' . $_SERVER['QUERY_STRING'] . '/&upload_to_openbenchmarking">Upload To OpenBenchmarking.org</a></p>';
        if (is_file(phoromatic_server::phoromatic_account_result_path($_SESSION['AccountID'], $row['UploadID']) . 'system-logs.zip')) {
            $right .= '<hr /><p><a href="?logs/system/' . $row['UploadID'] . '">View System Logs</a></p>';
        }
        echo phoromatic_webui_header_logged_in();
        echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in($right));
        echo phoromatic_webui_footer();
    }
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:101,代码来源:phoromatic_result.php


示例7: render_page_process


//.........这里部分代码省略.........
                if ($test_result_row) {
                    $main .= '<div class="pts_phoromatic_info_box_area" style="margin: 0 10%;">';
                    $main .= '<ul><li><h1>Recent Test Results For This Schedule</h1></li>';
                    $results = 0;
                    do {
                        $oldest_upload_time = $test_result_row['UploadTime'];
                        if ($results > 100) {
                            continue;
                        }
                        $main .= '<a href="?result/' . $test_result_row['PPRID'] . '"><li>' . $test_result_row['Title'] . '<br /><table><tr><td>' . phoromatic_system_id_to_name($test_result_row['SystemID']) . '</td><td>' . phoromatic_user_friendly_timedate($test_result_row['UploadTime']) . '</td></tr></table></li></a>';
                        $results++;
                    } while ($test_result_row = $test_result_result->fetchArray());
                    $main .= '</ul>';
                    $main .= '</div>';
                }
                $num_results = phoromatic_results_for_schedule($PATH[0]);
                if ($num_results > 1) {
                    $main .= '<p>Jump to the latest results from the past: ';
                    $main .= '<select name="view_results_from_past" id="view_results_from_past" onchange="phoromatic_jump_to_results_from(\'' . $PATH[0] . '\', \'view_results_from_past\');">';
                    $oldest_upload_time = strtotime($oldest_upload_time);
                    $opts = array('Week' => 7, 'Three Weeks' => 21, 'Month' => 30, 'Quarter' => 90, 'Six Months' => 180, 'Year' => 365);
                    foreach ($opts as $str_name => $time_offset) {
                        if ($oldest_upload_time > time() - 86400 * $time_offset) {
                            break;
                        }
                        $main .= '<option value="' . $time_offset . '">' . $str_name . '</option>';
                    }
                    $main .= '<option value="all">All Results</option>';
                    $main .= '</select>';
                    $main .= '</p><hr />';
                }
                $main .= '<p><strong>' . $num_results . ' Test Results Available For This Schedule.</strong></p>';
            }
            echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in());
            echo phoromatic_webui_footer();
            return;
        }
        $main = '<h1>Test Schedules</h1>
			<p>Test schedules are used for tests that are intended to be run on a recurring basis -- either daily or other defined time period -- or whenever a trigger/event occurs, like a new Git commit to a software repository being tracked. Test schedules can be run on any given system(s)/group(s) and can be later edited.</p>';
        if (!PHOROMATIC_USER_IS_VIEWER) {
            $main .= '
				<hr />
				<h2>Create A Schedule</h2>
				<p><a href="?sched">Create a schedule</a> followed by adding tests/suites to run for that schedule on the selected systems.</p>';
        }
        $main .= '<hr /><h2>Current Schedules</h2>';
        $main .= '<div class="pts_phoromatic_info_box_area">
					<ul>
						<li><h1>Active Test Schedules</h1></li>';
        $stmt = phoromatic_server::$db->prepare('SELECT Title, ScheduleID, Description, RunTargetSystems, RunTargetGroups, RunAt, ActiveOn FROM phoromatic_schedules WHERE AccountID = :account_id AND State >= 1 ORDER BY Title ASC');
        $stmt->bindValue(':account_id', $_SESSION['AccountID']);
        $result = $stmt->execute();
        $row = $result->fetchArray();
        if ($row == false) {
            $main .= '<li class="light" style="text-align: center;">No Schedules Found</li>';
        } else {
            do {
                $stmt_tests = phoromatic_server::$db->prepare('SELECT COUNT(*) AS TestCount FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = :schedule_id ORDER BY TestProfile ASC');
                $stmt_tests->bindValue(':account_id', $_SESSION['AccountID']);
                $stmt_tests->bindValue(':schedule_id', $row['ScheduleID']);
                $result_tests = $stmt_tests->execute();
                $row_tests = $result_tests->fetchArray();
                $test_count = !empty($row_tests) ? $row_tests['TestCount'] : 0;
                $group_count = empty($row['RunTargetGroups']) ? 0 : count(explode(',', $row['RunTargetGroups']));
                $main .= '<a href="?schedules/' . $row['ScheduleID'] . '"><li>' . $row['Title'] . '<br /><table><tr><td>' . pts_strings::plural_handler(count(phoromatic_server::systems_associated_with_schedule($_SESSION['AccountID'], $row['ScheduleID'])), 'System') . '</td><td>' . pts_strings::plural_handler($group_count, 'Group') . '</td><td>' . pts_strings::plural_handler($test_count, 'Test') . '</td><td>' . pts_strings::plural_handler(phoromatic_results_for_schedule($row['ScheduleID']), 'Result') . ' Total</td><td>' . pts_strings::plural_handler(phoromatic_results_for_schedule($row['ScheduleID'], 'TODAY'), 'Result') . ' Today</td><td><strong>' . phoromatic_schedule_activeon_string($row['ActiveOn'], $row['RunAt']) . '</strong></td></tr></table></li></a>';
            } while ($row = $result->fetchArray());
开发者ID:rkingsbury,项目名称:phoronix-test-suite,代码行数:67,代码来源:phoromatic_schedules.php


示例8: render_page_process

 public static function render_page_process($PATH)
 {
     $search_query = $_REQUEST['search'];
     $main = null;
     if (strlen($search_query) < 4) {
         $main = '<h1>Search Failed</h1>';
         $main .= '<p>Search Queries Must Be At Least Four Characters.</p>';
     } else {
         $main .= '<h1>Search Results For: ' . $search_query . '</h1>';
         $category_matches = 0;
         $tests = self::search_test_profiles($search_query);
         if ($tests != null) {
             $category_matches++;
             $main .= '<h2>Test Profile Matches</h2>' . $tests . '<hr />';
         }
         $local_suites = self::search_local_test_suites($search_query);
         if ($local_suites != null) {
             $category_matches++;
             $main .= '<h2>Local Test Suite Matches</h2>' . $local_suites . '<hr />';
         }
         $test_schedules = self::search_test_schedules($search_query);
         if ($test_schedules != null) {
             $category_matches++;
             $main .= '<h2>Test Schedule Matches</h2>' . $test_schedules . '<hr />';
         }
         $test_results = self::search_test_results($search_query);
         if ($test_results != null) {
             $category_matches++;
             $main .= '<h2>Test Result Matches</h2>' . $test_results . '<hr />';
         }
         $test_systems = self::search_test_systems($search_query);
         if ($test_systems != null) {
             $category_matches++;
             $main .= '<h2>Test System Matches</h2>' . $test_systems . '<hr />';
         }
         if ($category_matches == 0) {
             $main .= '<h2>No Matches Found</h2>';
         }
     }
     echo phoromatic_webui_header_logged_in();
     echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in());
     echo phoromatic_webui_footer();
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:43,代码来源:phoromatic_search.php


示例9: render_page_process


//.........这里部分代码省略.........
        if ($results == 0) {
            $main .= '<li class="light" style="text-align: center;">No Results Found</li>';
        }
        $main .= '</ul></div>';
        $main .= '</div>';
        $main .= '<hr /><h1>Schedules</h1>';
        $main .= '<h2>Active Test Schedules</h2>';
        $main .= '<div class="pts_phoromatic_info_box_area">
				<ul>
					<li><h1>Active Test Schedules</h1></li>';
        $stmt = phoromatic_server::$db->prepare('SELECT Title, ScheduleID, Description, RunTargetSystems, RunTargetGroups, RunAt, ActiveOn, AccountID FROM phoromatic_schedules WHERE State >= 1 ORDER BY Title ASC');
        $result = $stmt->execute();
        $row = $result->fetchArray();
        if ($row == false) {
            $main .= '<li class="light" style="text-align: center;">No Schedules Found</li>';
        } else {
            do {
                $main .= '<a onclick=""><li>' . $row['Title'] . '<br /><table><tr><td>' . phoromatic_account_id_to_group_name($row['AccountID']) . '</td><td>' . pts_strings::plural_handler(count(phoromatic_server::systems_associated_with_schedule($row['AccountID'], $row['ScheduleID'])), 'System') . '</td><td><strong>' . phoromatic_schedule_activeon_string($row['ActiveOn'], $row['RunAt']) . '</strong></td><td><a onclick="return confirm(\'Permanently remove this schedule?\');" href="/?admin_data/delete/schedule/' . $row['AccountID'] . '/' . $row['ScheduleID'] . '">Permanently Remove</a></td></tr></table></li></a>';
            } while ($row = $result->fetchArray());
        }
        $main .= '</ul></div>';
        $main .= '<hr /><h2>Inactive Test Schedules</h2>';
        $main .= '<div class="pts_phoromatic_info_box_area">
				<ul>
					<li><h1>Active Test Schedules</h1></li>';
        $stmt = phoromatic_server::$db->prepare('SELECT Title, ScheduleID, Description, RunTargetSystems, RunTargetGroups, RunAt, ActiveOn, AccountID FROM phoromatic_schedules WHERE State < 1 ORDER BY Title ASC');
        $result = $stmt->execute();
        $row = $result->fetchArray();
        if ($row == false) {
            $main .= '<li class="light" style="text-align: center;">No Schedules Found</li>';
        } else {
            do {
                $main .= '<a onclick=""><li>' . $row['Title'] . '<br /><table><tr><td>' . phoromatic_account_id_to_group_name($row['AccountID']) . '</td><td>' . pts_strings::plural_handler(count(phoromatic_server::systems_associated_with_schedule($row['AccountID'], $row['ScheduleID'])), 'System') . '</td><td><strong>' . phoromatic_schedule_activeon_string($row['ActiveOn'], $row['RunAt']) . '</strong></td><td><a onclick="return confirm(\'Permanently remove this schedule?\');" href="/?admin_data/delete/schedule/' . $row['AccountID'] . '/' . $row['ScheduleID'] . '">Permanently Remove</a></td></tr></table></li></a>';
            } while ($row = $result->fetchArray());
        }
        $main .= '</ul></div>';
        $main .= '<hr /><h2>Schedule Triggers</h2>';
        $main .= '<div class="pts_phoromatic_info_box_area">
				<ul>
					<li><h1>Triggers</h1></li>';
        $stmt = phoromatic_server::$db->prepare('SELECT Trigger, TriggeredOn, AccountID, ScheduleID FROM phoromatic_schedules_triggers ORDER BY TriggeredOn DESC');
        $result = $stmt->execute();
        $row = $result->fetchArray();
        if ($row == false) {
            $main .= '<li class="light" style="text-align: center;">No Triggers Found</li>';
        } else {
            do {
                $main .= '<a onclick=""><li>' . $row['Trigger'] . '<br /><table><tr><td>' . $row['TriggeredOn'] . '</td><td>' . phoromatic_account_id_to_group_name($row['AccountID']) . '</td><td><a onclick="return confirm(\'Permanently remove this trigger?\');" href="/?admin_data/delete/trigger/' . $row['AccountID'] . '/' . $row['ScheduleID'] . '/' . $row['Trigger'] . '">Permanently Remove</a></td></tr></table></li></a>';
            } while ($row = $result->fetchArray());
        }
        $main .= '</ul></div>';
        $main .= '<hr /><h1>Systems</h1>
			<h2>Active Systems</h2>
			<div class="pts_phoromatic_info_box_area">

					<ul>
						<li><h1>Active Systems</h1></li>';
        $stmt = phoromatic_server::$db->prepare('SELECT Title, SystemID, LocalIP, CurrentTask, LastCommunication, EstimatedTimeForTask, TaskPercentComplete, AccountID FROM phoromatic_systems WHERE State >= 0 ORDER BY LastCommunication DESC');
        $result = $stmt->execute();
        $row = $result->fetchArray();
        $active_system_count = 0;
        if ($row == false) {
            $main .= '<li class="light" style="text-align: center;">No Systems Found</li>';
        } else {
            do {
                $main .= '<a onclick=""><li>' . $row['Title'] . '<br /><table><tr><td>' . phoromatic_account_id_to_group_name($row['AccountID']) . '</td><td>' . $row['LocalIP'] . '</td><td><strong>' . $row['CurrentTask'] . '</strong></td><td><strong>Last Communication:</strong> ' . date('j F Y H:i', strtotime($row['LastCommunication'])) . '</td><td><a onclick="return confirm(\'Permanently remove this system?\');" href="/?admin_data/delete/system/' . $row['AccountID'] . '/' . $row['SystemID'] . '">Permanently Remove</a></td></tr></table></li></a>';
                $active_system_count++;
            } while ($row = $result->fetchArray());
        }
        $main .= '</ul></div>';
        $main .= '<h2>Inactive Systems</h2>
			<div class="pts_phoromatic_info_box_area">

					<ul>
						<li><h1>Inactive Systems</h1></li>';
        $stmt = phoromatic_server::$db->prepare('SELECT Title, SystemID, LocalIP, CurrentTask, LastCommunication, EstimatedTimeForTask, TaskPercentComplete, AccountID FROM phoromatic_systems WHERE State < 0 ORDER BY LastCommunication DESC');
        $result = $stmt->execute();
        $row = $result->fetchArray();
        $active_system_count = 0;
        if ($row == false) {
            $main .= '<li class="light" style="text-align: center;">No Systems Found</li>';
        } else {
            do {
                $main .= '<a onclick=""><li>' . $row['Title'] . '<br /><table><tr><td>' . phoromatic_account_id_to_group_name($row['AccountID']) . '</td><td>' . $row['LocalIP'] . '</td><td><strong>' . $row['CurrentTask'] . '</strong></td><td><strong>Last Communication:</strong> ' . date('j F Y H:i', strtotime($row['LastCommunication'])) . '</td><td><a onclick="return confirm(\'Permanently remove this system?\');" href="/?admin_data/delete/system/' . $row['AccountID'] . '/' . $row['SystemID'] . '">Permanently Remove</a></td></tr></table></li></a>';
                $active_system_count++;
            } while ($row = $result->fetchArray());
        }
        $main .= '</ul></div>';
        $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_benchmark_tickets ORDER BY TicketIssueTime DESC');
        $result = $stmt->execute();
        $main .= '<hr /><h1>Benchmark Tickets</h1>
			<div class="pts_phoromatic_info_box_area"><ul><li><h1>Tickets</h1></li>';
        while ($result && ($row = $result->fetchArray())) {
            $main .= '<a onclick=""><li>' . $row['Title'] . '<br /><table><tr><td><a onclick="return confirm(\'Permanently remove this system?\');" href="/?admin_data/delete/ticket/' . $row['AccountID'] . '/' . $row['TicketID'] . '">Permanently Remove</a></td></tr></table></li></a>';
        }
        $main .= '</ul></div>';
        echo phoromatic_webui_header_logged_in();
        echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in());
        echo phoromatic_webui_footer();
    }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:101,代码来源:phoromatic_admin_data.php


示例10: render_page_process

 public static function render_page_process($PATH)
 {
     $main = '<h1>Recent Account Activity</h1>';
     $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_activity_stream WHERE AccountID = :account_id ORDER BY ActivityTime DESC');
     $stmt->bindValue(':account_id', $_SESSION['AccountID']);
     $result = $stmt->execute();
     $row = $result->fetchArray();
     $prev_date = null;
     do {
         if ($prev_date != substr($row['ActivityTime'], 0, 10)) {
             if ($prev_date != null) {
                 $main .= '</p><hr />';
             }
             $prev_date = substr($row['ActivityTime'], 0, 10);
             $new_date = strtotime($row['ActivityTime']);
             if (date('Y-m-d') == $prev_date) {
                 $main .= '<h2>Today</h2>';
             } else {
                 if ($new_date > time() - 60 * 60 * 24 * 6) {
                     $main .= '<h2>' . date('l', $new_date) . '</h2>';
                 } else {
                     $main .= '<h2>' . date('j F Y', $new_date) . '</h2>';
                 }
             }
             $main .= '<p>';
         }
         $id_link_format = $row['ActivityEventID'];
         switch ($row['ActivityEvent']) {
             case 'settings':
                 $event_link_format = '<a href="?settings">settings</a>';
                 break;
             case 'users':
                 $event_link_format = '<a href="?users">a user</a>';
                 break;
             case 'schedule':
                 $event_link_format = '<a href="?schedules">schedule</a>';
                 $stmt1 = phoromatic_server::$db->prepare('SELECT Title FROM phoromatic_schedules WHERE AccountID = :account_id AND ScheduleID = :schedule_id');
                 $stmt1->bindValue(':account_id', $_SESSION['AccountID']);
                 $stmt1->bindValue(':schedule_id', $row['ActivityEventID']);
                 $result1 = $stmt1->execute();
                 $row1 = $result1->fetchArray();
                 $id_link_format = '<a href="?schedules/' . $row['ActivityEventID'] . '">' . $row1['Title'] . '</a>';
                 break;
             case 'tests_for_schedule':
                 $event_link_format = 'a test for a schedule';
                 $stmt1 = phoromatic_server::$db->prepare('SELECT Title FROM phoromatic_schedules WHERE AccountID = :account_id AND ScheduleID = :schedule_id');
                 $stmt1->bindValue(':account_id', $_SESSION['AccountID']);
                 $stmt1->bindValue(':schedule_id', $row['ActivityEventID']);
                 $result1 = $stmt1->execute();
                 $row1 = $result1->fetchArray();
                 $id_link_format = '<a href="?schedules/' . $row['ActivityEventID'] . '">' . $row1['Title'] . '</a>';
                 break;
             case 'groups':
                 $event_link_format = '<a href="?systems#group_edit">a group</a>';
                 break;
             default:
                 $event_link_format = $row['ActivityEvent'];
                 break;
         }
         if ($row['ActivityCreatorType'] == 'USER') {
             $main .= '<em>' . date('H:i', strtotime($row['ActivityTime'])) . '</em> &nbsp; <strong>' . $row['ActivityCreator'] . '</strong> <strong> ' . $row['ActivityEventType'] . '</strong> <strong>' . $event_link_format . '</strong>';
             if ($id_link_format != null) {
                 $main .= ': ' . $id_link_format;
             }
             $main .= '<br />' . PHP_EOL;
         }
         //$main .= '<p>' .  $row['ActivityCreator'] . ' ' . $row['ActivityCreatorType'] . ' ' . $row['ActivityEvent'] . ' ' . $row['ActivityEventID'] . ' ' . $row['ActivityEventType'] . '</p>';
     } while ($row = $result->fetchArray());
     if ($prev_date != null) {
         $main .= '</p>';
     }
     echo phoromatic_webui_header_logged_in();
     echo phoromatic_webui_main($main);
     echo phoromatic_webui_footer();
 }
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:75,代码来源:phoromatic_account_activity.php


示例11: render_page_process


//.........这里部分代码省略.........
     $main = null;
     if (!PHOROMATIC_USER_IS_VIEWER && isset($PATH[0]) && $PATH[0] == 'delete') {
         $pprids = explode(',', $PATH[1]);
         foreach ($pprids as $pprid) {
             $stmt = phoromatic_server::$db->prepare('DELETE FROM phoromatic_results WHERE AccountID = :account_id AND PPRID = :pprid');
             $stmt->bindValue(':account_id', $_SESSION['AccountID']);
             $stmt->bindValue(':pprid', $pprid);
             $result = $stmt->execute();
             // TODO XXX fix below
             //$upload_dir = phoromatic_server::phoromatic_account_result_path($_SESSION['AccountID'], $upload_id);
             //pts_file_io::delete($upload_dir);
         }
     }
     if ($main == null) {
         $time_limit = false;
         $time_str = false;
         if (isset($_POST['time'])) {
             $time_str = $_POST['time'];
             $time_limit = strtotime('- ' . $time_str);
         }
         if ($time_limit == false) {
             $time_str = '1 month';
             $time_limit = strtotime('- ' . $time_str);
         }
         $result_limit = isset($_POST['result_limit']) && is_numeric($_POST['result_limit']) && $_POST['result_limit'] > 9 ? $_POST['result_limit'] : 50;
         $main .= '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post"><div style="text-align: left; font-weight: bold;">Show Results For <select id="result_time_limit" name="time">';
         $results_for_length = array('24 hours' => '24 Hours', '3 days' => '3 Days', '1 week' => 'Week', '2 week' => '2 Weeks', '1 month' => 'Month', '2 months' => '2 Months', '3 months' => 'Quarter', '6 months' => '6 Months', '1 year' => 'Year', '2 year' => 'Two Years');
         foreach ($results_for_length as $val => $str) {
             $main .= '<option value="' . $val . '"' . ($time_str == $val ? ' selected="selected"' : null) . '>Past ' . $str . '</option>';
         }
         $main .= '</select> Search For <input type="text" name="search" value="' . (isset($_POST['search']) ? $_POST['search'] : null) . '" /> &nbsp; Limit Results To <select id="result_limit" name="result_limit">';
         for ($i = 25; $i <= 150; $i += 25) {
             $main .= '<option value="' . $i . '"' . ($result_limit == $i ? ' selected="selected"' : null) . '>' . $i . '</option>';
         }
         $main .= '</select> &nbsp; <input type="submit" value="Update" /></div></form>';
         $main .= '<h1>Account Test Results</h1>';
         $main .= '<div class="pts_phoromatic_info_box_area">';
         $search_for = !isset( 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP phorum_admin_build_url函数代码示例发布时间:2022-05-15
下一篇:
PHP phoromatic_webui_header_logged_in函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap