Example #1
0
function create_confirm($user, $team)
{
    page_head("Create Message Board");
    echo "\n\t\tYou may create a Message Board for use by {$team->name}.\n\t\t<ul>\n\t\t<li>Only team members will be able to post.</li>\n\t\t<li>At your option, only members will be able to read.</li>\n\t\t<li>You and your Team Admins will have moderator privileges.</li>\n\t\t</ul>\n\t";
    $tokens = url_tokens($user->authenticator);
    show_button("team_forum.php?teamid={$team->id}&amp;cmd=create{$tokens}", "Create Message Board", "Create a Message Board for {$team->name}");
    page_tail();
}
Example #2
0
function create_confirm($user, $team)
{
    page_head(tra("Create Message Board"));
    echo tra("You may create a message board for use by %1.", $team->name) . "\n        <ul>\n        <li>" . tra("Only team members will be able to post.") . "\n        <li>" . tra("At your option, only members will be able to read.") . "\n        <li>" . tra("You and your Team Admins will have moderator privileges.") . "\n        </ul>\n    ";
    $tokens = url_tokens($user->authenticator);
    show_button("team_forum.php?teamid={$team->id}&cmd=create{$tokens}", tra("Create Message Board"), tra("Create a message board for %1", $team->name));
    page_tail();
}
Example #3
0
function show_admin($user, $admin)
{
    $admin_user = BoincUser::lookup_id($admin->userid);
    $tokens = url_tokens($user->authenticator);
    $date = date_str($admin->create_time);
    echo "<tr>\n        <td>" . user_links($admin_user) . "</td>\n        <td>{$date}</td>\n        <td>\n    ";
    show_button("team_admins.php?teamid={$admin->teamid}&action=remove&userid={$admin_user->id}" . $tokens, tra("Remove"), tra("Remove Team Admin status from this member"));
    echo "</td></tr>\n    ";
}
function show_bossa_app($app, $i)
{
    $j = $i % 2;
    echo "<tr class=row{$j}>\n        <td>Name: {$app->name}<br>\n            Short name: {$app->short_name}<br>\n            Description: {$app->description}<br>\n            Created: " . date_str($app->create_time) . "\n        </td>\n        <td>\n    ";
    if ($app->hidden) {
        show_button("bossa_admin.php?action=unhide&app_id={$app->id}", "Unhide", "Unhide this app");
    } else {
        show_button("bossa_admin.php?action=hide&app_id={$app->id}", "Hide", "Hide this app");
    }
    echo "<br>";
    show_button("bossa_admin.php?action=show_batches&app_id={$app->id}", "Show batches", "Show batches");
}
Example #5
0
function show_course($course)
{
    $x = "<b>{$course->name}</b>\n\t\t\t<br>Description: {$course->description}\n\t\t\t<br>Created: " . date_str($course->create_time) . "\n\t";
    $y = "<a href=bolt_map.php?course_id={$course->id}>Map</a>\n\t\t<br><a href=bolt_compare.php?course_id={$course->id}>Experiments</a>\n\t\t<br>\n\t";
    row2_init($x, $y);
    if ($course->hidden) {
        show_button("bolt_admin.php?action=unhide&course_id={$course->id}", "Unhide", "Unhide this course");
    } else {
        show_button("bolt_admin.php?action=hide&course_id={$course->id}", "Hide", "Hide this course");
    }
    show_button("bolt_admin.php?action=clear_confirm&course_id={$course->id}", "Clear data", "Clear student data for this course");
    echo "</td></tr>";
}
function handle_list()
{
    page_head("Project-wide management functions");
    echo "<h3>User permissions and quotas</h3>\n        The following users are allowed to submit jobs.\n        <p>\n    ";
    show_button("manage_project.php?action=add_form", "Add user", "Allow a new user to submit jobs");
    $us = BoincUserSubmit::enum("");
    start_table();
    table_header("User", "Can submit jobs for", "Quota");
    foreach ($us as $u) {
        user_row($u);
    }
    end_table();
    page_tail();
}
Example #7
0
function handle_list()
{
    page_head("Job submission access control");
    echo "The following users are allowed to submit jobs.\n        <p>\n    ";
    $us = BoincUserSubmit::enum("");
    start_table();
    table_header("User<br><p class=\"text-muted\">Click to change permissions or quota</p>", "Can submit jobs for", "Quota", "Max jobs in progress<br><p class=\"text-muted\">0 means no limit</p>", "Current priority<br><p class=\"text-muted\">Later time = lower priority</p>");
    foreach ($us as $u) {
        user_row($u);
    }
    end_table();
    show_button("manage_project.php?action=add_form", "Add user", "Allow a new user to submit jobs");
    page_tail();
}
Example #8
0
function show_snap_form()
{
    global $course_id;
    admin_page_head("Data snapshot");
    $s = read_map_snapshot($course_id);
    if ($s) {
        $end = date_str($s->time);
        echo "\n\t\t\tA data snapshot exists for the {$s->dur} days prior to {$end}.\n\t\t";
        show_button("bolt_map.php?action=map&course_id={$course_id}", "Use this snapshot", "Use this snapshot");
    } else {
        echo "There is currently no snapshot.";
    }
    echo "\n\t\t<form action=bolt_map.php>\n\t\t<input type=hidden name=action value=snap_action>\n\t\t<input type=hidden name=course_id value={$course_id}>\n\t\tCreate a new snapshot using data from the last\n\t\t<input name=dur value=7> days.\n\t\t<input type=submit value=OK>\n\t\t</form>\n\t";
    admin_page_tail();
}
Example #9
0
function show_nav()
{
    $config = get_config();
    $master_url = parse_config($config, "<master_url>");
    $no_computing = parse_config($config, "<no_computing>");
    $no_web_account_creation = parse_bool($config, "no_web_account_creation");
    $disable_acct = parse_bool($config, "disable_account_creation");
    echo "<div class=\"mainnav\">\n        <h2 class=headline>About " . PROJECT . "</h2>\n    ";
    if ($no_computing) {
        echo "\n            XXX is a research project that uses volunteers\n            to do research in XXX.\n        ";
    } else {
        echo "\n            XXX is a research project that uses Internet-connected\n            computers to do research in XXX.\n            You can participate by downloading and running a free program\n            on your computer.\n        ";
    }
    echo "\n        <p>\n        XXX is based at \n        [describe your institution, with link to web page]\n        <ul>\n        <li> [Link to page describing your research in detail]\n        <li> [Link to page listing project personnel, and an email address]\n        </ul>\n        <h2 class=headline>Participate</h2>\n        <ul>\n    ";
    if ($no_computing) {
        if (!$no_web_account_creation && !$disable_acct) {
            echo "\n                <li> <a href=\"create_account_form.php\">Create an account</a>\n            ";
        } else {
            echo "<li> This project is not currently accepting new accounts.";
        }
    } else {
        echo "\n            <li><a href=\"info.php\">" . tra("Read our rules and policies") . "</a>\n        ";
        if (0) {
            echo "<li>";
            show_button("register.php", "Join", null, "btn btn-green");
        } else {
            echo "<li> <a href=http://boinc.berkeley.edu/download.php>Download</a> and run BOINC.\n                <li> Choose Add Project\n            ";
        }
        echo "\n            <li> If you have any problems,\n                <a target=\"_new\" href=\"http://boinc.berkeley.edu/wiki/BOINC_Help\">get help here</a>.\n        ";
    }
    echo "\n        </ul>\n\n        <h2 class=headline>Returning participants</h2>\n        <ul>\n        <li><a href=\"home.php\">Your account</a> - view stats, modify preferences\n    ";
    if (!$no_computing) {
        echo "\n            <li><a href=server_status.php>Server status</a>\n            <li><a href=\"cert1.php\">Certificate</a>\n            <li><a href=\"apps.php\">" . tra("Applications") . "</a>\n        ";
    }
    if (!DISABLE_TEAMS) {
        echo "\n            <li><a href=\"team.php\">Teams</a> - create or join a team\n        ";
    }
    echo "\n        </ul>\n        <h2 class=headline>" . tra("Community") . "</h2>\n        <ul>\n    ";
    if (!DISABLE_PROFILES) {
        echo "\n            <li><a href=\"profile_menu.php\">" . tra("Profiles") . "</a>\n        ";
    }
    echo "\n        <li><a href=\"user_search.php\">User search</a>\n        <li><a href=ffmail_form.php>Share</a>\n    ";
    if (!DISABLE_FORUMS) {
        echo "\n            <li><a href=\"forum_index.php\">" . tra("Message boards") . "</a>\n            <li><a href=\"forum_help_desk.php\">" . tra("Questions and Answers") . "</a>\n        ";
    }
    echo "\n        <li><a href=\"stats.php\">Statistics</a>\n        <li><a href=language_select.php>Languages</a>\n        </ul>\n        </div>\n    ";
}
Example #10
0
function do_inbox($logged_in_user)
{
    page_head(tra("Private messages") . ": " . tra("Inbox"));
    make_script();
    if (get_int("sent", true) == 1) {
        echo "<div class=\"notice\">" . tra("Your message has been sent.") . "</div>\n";
    }
    $options = get_output_options($logged_in_user);
    BoincNotify::delete_aux("userid={$logged_in_user->id} and type=" . NOTIFY_PM);
    $msgs = BoincPrivateMessage::enum("userid={$logged_in_user->id} ORDER BY date DESC");
    if (count($msgs) == 0) {
        echo tra("You have no private messages.");
    } else {
        echo "<form name=msg_list action=pm.php method=post>\n            <input type=hidden name=action value=delete_selected>\n        ";
        echo form_tokens($logged_in_user->authenticator);
        start_table();
        echo "<tr><th>" . tra("Subject") . "</th><th>" . tra("Sender and date") . "</th><th>" . tra("Message") . "</th></tr>\n";
        $i = 0;
        foreach ($msgs as $msg) {
            $sender = BoincUser::lookup_id($msg->senderid);
            if (!$sender) {
                $msg->delete();
                continue;
            }
            $i++;
            $class = $i % 2 ? "row0" : "row1";
            echo "<tr class={$class}>\n";
            $checkbox = "<input type=checkbox name=pm_select_{$msg->id}>";
            if (!$msg->opened) {
                $msg->update("opened=1");
            }
            echo "<td valign=top> {$checkbox} {$msg->subject} </td>\n";
            echo "<td valign=top>" . user_links($sender, BADGE_HEIGHT_SMALL);
            show_block_link($msg->senderid);
            echo "<br>" . time_str($msg->date) . "</td>\n";
            echo "<td valign=top>" . output_transform($msg->content, $options) . "<p>";
            $tokens = url_tokens($logged_in_user->authenticator);
            show_button("pm.php?action=new&amp;replyto={$msg->id}", tra("Reply"), tra("Reply to this message"));
            show_button("pm.php?action=delete&amp;id={$msg->id}&amp;{$tokens}", tra("Delete"), tra("Delete this message"));
            echo "</ul></td></tr>\n";
        }
        echo "\n            <tr><td>\n            <a href=\"javascript:set_all(1)\">" . tra("Select all") . "</a>\n            |\n            <a href=\"javascript:set_all(0)\">" . tra("Unselect all") . "</a>\n            </td>\n            <td colspan=2>\n            <input class=\"btn btn-danger\" type=submit value=\"" . tra("Delete selected messages") . "\">\n            </td></tr>\n        ";
        end_table();
        echo "</form>\n";
    }
    page_tail();
}
Example #11
0
function show_download_page()
{
    page_head("Download required software");
    $config = get_config();
    $need_vbox = parse_bool($config, "need_vbox");
    $mcv = parse_config($config, "<min_core_client_version>");
    $dlv = "BOINC";
    $dl = "BOINC";
    if ($mcv) {
        $dlv .= " version " . version_string_maj_min_rel($mcv) . " or later";
    }
    $verb = "this is";
    if ($need_vbox) {
        $dl .= " and VirtualBox";
        $dlv .= " and VirtualBox";
        $verb = "these are";
    }
    echo "To participate in " . PROJECT . ", {$dlv} must be installed.\n        <p>\n        If {$verb} already installed, <a href=download.php?action=installed>click here</a>.  Otherwise\n        <p>\n    ";
    show_button("download.php?action=download", "Download {$dl}");
    echo "<p>\n        When the download is finished,\n        open the downloaded file to install BOINC.\n    ";
    page_tail();
}
Example #12
0
						<?php 
    if ($v['paixu'] !== 0) {
        echo '否';
    } else {
        if ($v['info']['table_name'] != 'undefined') {
            echo $v['info']['table_name'];
        } elseif ($v['info']['qita'] != 'undefined') {
            echo $v['info']['qita'];
        }
    }
    ?>
					</td>
                    <td>
                        <?php 
    if ($v['paixu'] !== 0) {
        echo show_button(array('class' => 'but2 but2s but2r', 'onclick' => "del('" . $v['id'] . "')", 'text' => '删除', 'level' => 'E0801'));
    }
    ?>
                    </td>
                </tr>
                <?php 
}
?>
            </table>
            </form>
            <div class="pagebar clearfix">
				 <?php 
echo $resource_list['pagebar']['pagecode'];
?>
            </div>
        </div>
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/boinc_db.inc";
require_once "../inc/util.inc";
require_once "../inc/profile.inc";
$user = get_logged_in_user();
$cmd = get_str("cmd", true);
if ($cmd == "delete") {
    $result = delete_profile($user);
    if (!$result) {
        error_page(tra("couldn't delete profile - please try again later"));
    }
    delete_user_pictures($user->id);
    page_head(tra("Delete Confirmation"));
    $user->update("has_profile=0");
    echo tra("Your profile has been deleted.") . "<br>";
    page_tail();
    exit;
}
page_head(tra("Profile delete confirmation"));
echo "\n    <h2>" . tra("Are you sure?") . "</h2><p>\n    " . tra("Deleted profiles are gone forever and cannot be recovered --\nyou will have to start from scratch\nif you want another profile in the future.") . "\n    <p>\n    " . tra("If you're sure, click 'Yes'\nto remove your profile from our database.") . "\n    <p>\n";
show_button("delete_profile.php?cmd=delete", tra("Yes"), tra("Delete my profile"));
show_button("index.php", tra("No"), tra("Do not delete my profile"));
page_tail();
Example #14
0
    echo $v;
    ?>
">没有还原数据库文件</span>
						</div>
						<?php 
}
?>
						<div style="clear:both;"></div>
						<div style=" text-align:center;">
							
							<input type="radio" name="RadioGroup2" id='dblistchkAll' onclick="C.form.check_all('.dblist');">
							<label for="dblistchkAll">全选</label>
							<input type="radio" name="RadioGroup2" id="dblistchkallno"  onclick="C.form.check_all('.dblist');" checked>
							<label for="dblistchkallno">不选</label>&nbsp;&nbsp;
						<?php 
echo show_button(array('class' => 'but2', 'onclick' => "backin('dbbak.php?m=backin')", 'text' => '导入数据', 'level' => 'E0902'));
?>
                       </div>
                    </div>

                </form> 
            </div>
			<div style="width:600px; margin:0 auto; padding:30px 0; text-align:center; overflow:hidden;font-size:12px;line-height:22px;height:22px;">
            <iframe id="autobackiframe" name="autobackiframe" src="about:blank"  width="100%" height="230" scrolling=""  frameborder="0" style="overflow-x: hidden; overflow-y: auto; font-size:10px; "></iframe>
			</div>
        </div>
    </div><!-- 右侧主体内容结束 -->
    <?php 
require_once dirname(__FILE__) . "/inc_footer.php";
?>
Example #15
0
        $team = BoincTeam::lookup_id($forum->category);
        page_head('Team message board for <a href="team_display.php?teamid=$team->id">$team->name</a>');
        show_forum_header($user);
        show_team_forum_title($forum);
        break;
}
?>
<form action="forum_forum.php" method="get">
<?php 
echo start_table("noborder");
?>
<table width="100%">
	<tr valign="top">
	<td colspan="2">
		<?php 
show_button("forum_post.php?id={$id}", "New thread", "Add a new thread to this forum");
?>
	</td>
	<td class="right">
		<input type="hidden" name="id" value="<?php 
echo $forum->id;
?>
">
		<?php 
echo select_from_array("sort", $forum_sort_styles, $sort_style);
?>
		<input type="submit" value="Sort">
	</td>
	</tr>
</table>
</form>
Example #16
0
function tpl__list()
{
    global $page;
    ?>
        <div class="mt10">
            <table class="tb" >
                <tr>
                    <th width="80"><a href="javascript:void(0);" onClick="C.form.check_all('.infoff');">全选/反选</a></th>
					<th align='center' width="50"> 排序</th>
                    <th align='center' width="200" >ID</th>
                    <th align='center' width="200" >关键字</th>
					<th align='center' width="200" >关键字分组</th>
                    <th>搜索次数</th>
                    <th width="100"></th>
                </tr>
                
               <?php 
    foreach ($page['list'] as $k => $v) {
        ?>
                <tr>   
                    <td><input type="checkbox" class="cklist infoff" value="<?php 
        echo $v['keyword_id'];
        ?>
" /></td>
                    <td><input type="text" size="2" value="<?php 
        echo $v['qorder'];
        ?>
" class="porder" pid="<?php 
        echo $v['keyword_id'];
        ?>
" /></td>
                    <td><?php 
        echo $v['keyword_id'];
        ?>
</td>
                    <td><?php 
        echo $v['keyword'];
        ?>
</td>
					<td><?php 
        echo $v['qgroup'];
        ?>
</td>
                    <td><?php 
        echo $v['qnum'];
        ?>
</td>
                    <td align="center" width="100">
                    <?php 
        echo show_button(array('class' => 'but2 but2s  but2r', 'onclick' => "tags_del('" . $v['keyword_id'] . "');", 'text' => "删除", 'level' => 'H0702'));
        echo show_button(array('class' => 'but2 but2s', 'href' => "tags.php?m=add&kid=" . $v['keyword_id'], 'text' => "编辑", 'level' => 'H0701'));
        ?>
                    </td>
				</tr>
               <?php 
    }
    ?>
 
            </table>
            <div class="pagebar clearfix"><?php 
    echo $page['pagebar']['pagecode'];
    ?>
</div>
        </div>
        <?php 
}
Example #17
0
 public function html_cate_list($tree = array(), $i = 0)
 {
     global $c_obj;
     $i++;
     foreach ($tree as $k => $t) {
         //验证权限
         //if(!check_admin_level($t['cate_id'])) continue;
         $flag = '';
         for ($j = 1; $j < $i; $j++) {
             $flag .= '  ';
         }
         // 分类类型
         $ctype = '<font color=red>目录分类</font>';
         if ($c_obj->cate_last($t['cate_id']) == 0) {
             $ctype = '<font color=#888>终极分类</font>';
         }
         if ($c_obj->cate_last($t['cate_id']) == 0 && $t['cdata'] > 0) {
             $ctype = '<font color=green>文档分类</font>';
         }
         // 前缀图标
         if (count($t['son']) > 0) {
             $onclick = ' onclick="show_hidden_2(' . $t['cate_id'] . ',this)" style="cursor:pointer;" title="点击展开子分类"';
             $flag .= '<img src="/css/back/pc/img/folder.png"' . $onclick . '> ';
         } else {
             $onclick = '';
             if ($ctype == '<font color=#888>终极分类</font>') {
                 $flag .= '<img src="/css/back/pc/img/file.png"> ';
             } else {
                 $flag .= '<img src="/css/back/pc/img/www_link.png"> ';
             }
         }
         echo '<table class="tb tbcate"><tr>';
         echo '<td class="col1"><input class="corder" pid="' . $t['cate_id'] . '" type="text" size="3" value="' . $t['corder'] . '"></td>';
         echo '<td class="col2">' . $t['cate_id'] . '</td>';
         echo '<td class="col3">' . "扩展模型" . '</td>';
         echo '<td class="col4"><div style="float:left">' . $flag . '<b style="color:#666;"><a href="info.php?state=0&cate_id=' . $t['cate_id'] . '">' . $t['cname'] . '</a></b> ' . $ctype . ' ' . ($t['nav_show'] == 1 ? '导航显示' : '') . ' <font color=#ccc>' . ($t['go_url'] == '' ? $t['cname_py'] : $t['go_url']) . '</font> <font color=deeppink>' . (count($t['son']) > 0 ? count($t['son']) : '') . '</font></div></td>';
         echo '<td class="col5">' . $t['tpl_index'] . '</td>';
         echo '<td class="col5">' . $t['tpl_listvar'] . '</td>';
         echo '<td class="col6">' . $t['tpl_content'] . '</td>';
         echo '<td class="col7">' . $t['cdata'] . '</td>';
         echo '<td class="col8">';
         if ($c_obj->cate_last($t['cate_id']) == 1 && $c_obj->categories[$t['cate_id']]['cdata'] > 0) {
             echo show_button(array('class' => 'but2 but2s', 'onclick' => 'javascript:void(0);', 'other' => 'style="background:#ccc;border-color:#ccc;color:#888;cursor:default;"', 'text' => '移动', 'level' => 'C0405'));
         } else {
             echo show_button(array('class' => 'but2 but2s', 'onclick' => "cate_move_show('{$t['cate_id']}','{$t['cname']}');", 'text' => '移动', 'level' => 'C0405'));
         }
         if ($t['cdata'] == 0) {
             echo show_button(array('class' => 'but2 but2s but2r', 'onclick' => "cate_del('{$t['cate_id']}');", 'text' => '删除', 'level' => 'C0402'));
         } else {
             echo show_button(array('class' => 'but2 but2s', 'onclick' => "javascript:void(0);", 'text' => '删除', 'level' => 'C0402', 'other' => 'style="background:#ccc;border-color:#ccc;color:#888;cursor:default;"'));
         }
         echo show_button(array('class' => 'but2 but2s', 'href' => "category.php?m=clist&cid={$t['cate_id']}", 'text' => '修改', 'level' => 'C0401'));
         if ($t['cdata'] == 0 || $this->cate_last($t['cate_id']) == 1) {
             echo show_button(array('class' => 'but2 but2s but2o', 'href' => "category.php?m=clist&cid={$t['cate_id']}&act=add_son", 'text' => '添加子类', 'level' => 'C0401'));
         } else {
             echo show_button(array('class' => 'but2 but2s', 'onclick' => "javascript:void(0);", 'text' => '添加子类', 'level' => 'C0401', 'other' => 'style="background:#ccc;border-color:#ccc;color:#888;cursor:default;"'));
         }
         echo '</td>';
         echo '</tr></table>' . chr(10);
         if (is_array($t['son']) && count($t['son']) > 0) {
             echo chr(10) . '<div id="cate_body_' . $t['cate_id'] . '" >' . chr(10);
             $this->html_cate_list($t['son'], $i);
             echo chr(10) . '</div>' . chr(10);
         }
     }
 }
Example #18
0
                        <td width="100">Q  Q:</td>
                        <td class="alignleft"><input class="ipt" id="qq" style="width:200px;" value="">&nbsp;*&nbsp;QQ号必须填写正确</td>
                    </tr>
                    <tr>
                        <td width="100">电  话:</td>
                        <td><input type="text" id="tel" class="ipt" value="" style="width:200px;">&nbsp;&nbsp;联系人电话</td>
                    </tr>
                    <tr>
                        <td width="100">邮  箱:</td>
                        <td><input type="text" id="email" class="ipt" value="" style="width:200px;">&nbsp;联系人邮箱</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>
                        <?php 
    echo show_button(array('class' => 'but2 ml5', 'onclick' => "getauth();", 'text' => '我要申请', 'level' => 'A0501'));
    ?>
                        </td>
                    </tr>
                </table>
            <?php 
}
?>
		</div>
    </div>
	<!-- 右侧主体内容结束 -->
    <?php 
require_once dirname(__FILE__) . "/inc_footer.php";
?>

</div><!-- 右侧区域结束 -->
Example #19
0
            echo $vv;
            ?>
</td>
						<?php 
            $i++;
        }
        ?>
                        <td>
                        <?php 
        echo show_button(array('class' => 'but2 but2s but2r', 'onclick' => "del('{$alone_id}','{$table}');", 'text' => '删除', 'level' => $table . "_02"));
        if ($action == '通过') {
            echo show_button(array('class' => 'but2 but2s but2o', 'onclick' => "edit_state('{$alone_id}','{$table}','1')", 'text' => '屏蔽', 'level' => $table . "_03"));
        } else {
            echo show_button(array('class' => 'but2 but2s but2o', 'onclick' => "edit_state('{$alone_id}','{$table}','0')", 'text' => '通过', 'level' => $table . "_03"));
        }
        echo show_button(array('class' => 'but2 but2s', 'onclick' => "edit('{$alone_id}','{$alone_field}','{$extern_id}','edit')", 'text' => '编辑', 'level' => $table . "_01"));
        ?>
						</td>
                    </tr>
                   <?php 
    }
}
?>
                </table>
            </form>
            <?php 
if (isset($table_list['pagebar'])) {
    ?>
            <!--分页码-->
            <div class="pagebar clearfix">
                <?php 
Example #20
0
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
// reset user's preferences to the defaults
require_once "../inc/util.inc";
require_once "../inc/prefs.inc";
$confirmed = get_int("confirmed", true);
$user = get_logged_in_user();
if (!$confirmed) {
    page_head("Confirm reset preferences");
    echo "\n        You have requested restoring your computing preferences\n        to the default settings.\n        Your current preferences will be discarded.\n        Do you really want to do this?\n        <br>\n    ";
    show_button("prefs_default.php?confirmed=1", "Yes", "Restore default preferences");
    show_button("prefs.php", "No", "Keep current preferences");
    page_tail();
} else {
    $prefs = default_prefs_global();
    $retval = global_prefs_update($user, $prefs);
    if ($retval) {
        error_page("Couldn't restore default preferences.");
    } else {
        Header("Location: prefs.php?subset=global&defaults=1{$c}");
    }
}
Example #21
0
switch ($action) {
    case 'start':
        if (info_incomplete($user)) {
            request_info($user, $course);
            exit;
        }
        if ($refresh) {
            start_refresh();
            exit;
        }
        $e = BoltEnrollment::lookup($user->id, $course_id);
        if ($e) {
            page_header();
            echo "You are already enrolled in {$course->name}.\n            <p>\n            Are you sure you want to start over from the beginning?\n            <p>\n        ";
            show_button("bolt_sched.php?action=start_confirm&{$url_args}", "Yes", "Start this course from the beginning");
            show_button("bolt_sched.php?action=resume&{$url_args}", "Resume", "Resume course from current position");
            page_footer();
            exit;
        }
        // fall through
    // fall through
    case 'start_confirm':
        start_course();
        break;
    case 'update_info':
        update_info();
        start_course();
        break;
    case 'prev':
        $view = finalize_view($view_id, BOLT_ACTION_PREV);
        debug_show_state(unserialize($view->state), "Initial");
Example #22
0
function show_scenario()
{
    $name = get_str("name");
    $d = "scenarios/{$name}";
    if (!is_dir($d)) {
        error_page("No such scenario");
    }
    page_head("Scenario {$name}");
    $desc = file_get_contents("scenarios/{$name}/description");
    $userid = (int) file_get_contents("scenarios/{$name}/userid");
    $user = BoincUser::lookup_id($userid);
    $date = date_str(filemtime("scenarios/{$name}"));
    start_table();
    row2("Creator", $user->name);
    row2("When", $date);
    row2("Description", $desc);
    $x = "<a href={$d}/client_state.xml>client_state.xml</a>";
    if (file_exists("{$d}/global_prefs.xml")) {
        $x .= "<br><a href={$d}/global_prefs.xml>global_prefs.xml</a>\n";
    }
    if (file_exists("{$d}/global_prefs_override.xml")) {
        $x .= "<br><a href={$d}/global_prefs_override.xml>global_prefs_override.xml</a>\n";
    }
    if (file_exists("{$d}/cc_config.xml")) {
        $x .= "<br><a href={$d}/cc_config.xml>cc_config.xml</a>\n";
    }
    row2("Input files", $x);
    end_table();
    show_button("sim_web.php?action=simulation_form_short&scen={$name}", "Do new simulation", "Do new simulation");
    echo "<h3>Simulations</h3>";
    start_table();
    echo "<tr>\n            <th>ID<br><span class=note>Click for details</span></th>\n            <th>Who</th>\n            <th>When</th>\n            <th>Parameters</th>\n            <th>Results</th>\n            <th>Comments</th>\n        </tr>\n    ";
    $s = opendir("{$d}/simulations");
    while (false !== ($f = readdir($s))) {
        if (!is_numeric($f)) {
            continue;
        }
        show_simulation_summary($name, $f);
    }
    end_table();
    page_tail();
}
Example #23
0
include_once "../inc/prefs.inc";
include_once "../inc/prefs_project.inc";
check_get_args(array("subset", "venue", "confirmed", "cols", "tnow", "ttok"));
$user = get_logged_in_user();
check_tokens($user->authenticator);
$subset = get_str("subset");
$venue = get_str("venue");
$confirmed = get_str("confirmed", true);
$columns = get_int("cols", true);
$c = $columns ? "&cols={$columns}" : "";
if ($confirmed) {
    if ($subset == "global") {
        $main_prefs = prefs_parse_global($user->global_prefs);
        $main_prefs->{$venue} = null;
        global_prefs_update($user, $main_prefs);
    } else {
        $main_prefs = prefs_parse_project($user->project_prefs);
        $main_prefs->{$venue} = null;
        project_prefs_update($user, $main_prefs);
    }
    Header("Location: prefs.php?subset={$subset}{$c}");
} else {
    page_head(tra("Confirm delete preferences"));
    $tokens = url_tokens($user->authenticator);
    echo "<p>" . tra("Are you sure you want to delete your separate %1 preferences for %2?", subset_name($subset), $venue) . "</p><br><br>\n";
    show_button("prefs_remove.php?subset={$subset}&venue={$venue}&confirmed=yes{$c}{$tokens}", tra("Yes"), tra("Remove preferences"));
    show_button("prefs.php?subset={$subset}{$c}", tra("Cancel"), tra("Cancel"));
    page_tail();
}
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit
function handle_retire_batch_confirm()
{
    $batch_id = get_int('batch_id');
    page_head("Confirm retire batch");
    echo "\n        Retiring a batch will remove all of its output files.\n        Are you sure you want to do this?\n        <p>\n    ";
    show_button("submit_example.php?action=retire_batch&batch_id={$batch_id}", "Yes - retire batch");
    echo "<p><a href=submit_example.php>Return to job control page</a>\n";
    page_tail();
}
Example #25
0
function prepare_batch($user)
{
    $structure_file_path = get_file_path($user, 'structure_file');
    $command_file_path = get_file_path($user, 'lammps_script');
    $cmdline_file_path = get_file_path($user, 'cmdline_file');
    $pot_files_path = get_file_path($user, 'zip');
    $info = new StdClass();
    $info->structure_file_path = $structure_file_path;
    $info->command_file_path = $command_file_path;
    $info->cmdline_file_path = $cmdline_file_path;
    $info->pot_files_path = $pot_files_path;
    $info->area = get_str("area");
    // get the directory in which to run the test,
    // clear it out,
    // and set up links to the input files
    //
    $test_dir = "../../lammps_test/{$user->id}";
    //echo "test_dir is ".$test_dir;
    if (!is_dir($test_dir)) {
        mkdir($test_dir);
    }
    $old_dir = getcwd();
    if (!chdir($test_dir)) {
        error_page("Can't chdir");
    }
    system("rm *");
    symlink($structure_file_path, "structure_file");
    symlink($command_file_path, "lammps_script");
    symlink($cmdline_file_path, "cmd_variables");
    symlink($pot_files_path, "pot_files");
    list($error, $est_cpu_time, $disk) = lammps_est();
    if ($GLOBALS["debug"]) {
        print "est_cpu_time is " . $est_cpu_time . "<br>";
    }
    if ($error == 0) {
        $err_msgs = file("output");
        $err = "Your test job <strong>failed</strong>\n            <br>Please refer to the following Error Message:<br><p>\n        ";
        foreach ($err_msgs as $line) {
            $err = $err . $line . "<br>";
        }
        $err = $err . " <p>\n            <a href=sandbox.php><strong> File_Sandbox </strong></a>\n        ";
        error_page($err);
    }
    system("rm *");
    $info->rsc_fpops_est = $est_cpu_time * 1500000000.0;
    $info->rsc_fpops_bound = $info->rsc_fpops_est * 20;
    if ($disk == 0) {
        $info->rsc_disk_bound = 1000000;
    } else {
        $info->rsc_disk_bound = $disk;
    }
    $tmpfile = tempnam("/tmp", "lammps_");
    file_put_contents($tmpfile, serialize($info));
    // get the # of jobs
    //
    $njobs = count(file($cmdline_file_path));
    $secs_est = estimated_makespan($njobs, $info->rsc_fpops_est);
    if ($GLOBALS["debug"]) {
        echo "secs_est is {$secs_est}\n";
    }
    //assume the server's flops is 1.5G and the average client's flops is 1G
    $hrs_est = number_format($secs_est * 1.5 / 60, 2);
    //$hrs_est = number_format($secs_est, 2);
    $client_mb = number_format($info->rsc_disk_bound / 1000000.0, 1);
    $server_mb = number_format($njobs * $info->rsc_disk_bound / 1000000.0, 1);
    chdir($old_dir);
    page_head("Batch prepared");
    echo "\n        Your batch has {$njobs} jobs.\n        <p>\n        Estimated time to completion: {$hrs_est} Minutes.\n        <p>\n        Estimated client disk usage: {$client_mb} MB\n        <p>\n        Estimated server disk usage: {$server_mb} MB\n        <p>\n    ";
    show_button("lammps.php?action=submit&tmpfile={$tmpfile}", "Submit Batch");
    page_tail();
}
Example #26
0
            <td><input type="text" id="aemail" class="ipt" value="" style="width:200px;"></td>
        </tr>
		<tr>
            <td class="alignright">手机:</td>
            <td><input type="text" id="aphone" class="ipt" value="" style="width:200px;"></td>
        </tr>
		<tr>
            <td class="alignright">管理组:</td>
            <td>
			<select id="group_id">
                <option value="0">请选择管理组</option>
			<?php 
foreach ($page['admin_group'] as $k => $v) {
    echo '<option value="' . $v['group_id'] . '">' . $v['g_name'] . '</option>';
}
?>
			</select>
			</td>
        </tr>
        <tr>
            <td width="100">&nbsp;</td>
            <td>
			<?php 
echo show_button(array('class' => 'but2 ml5', 'onclick' => "user_edit();", 'text' => '确 定', 'level' => 'B0202'));
?>
			</td>
        </tr>
    </table>
</div>
</body>
</html>
Example #27
0
function tpl__list()
{
    global $page;
    ?>
        <div>
            <form action="" name="form_order" method="post">
            <table class="tb mt10">
                <tr>
                    <th width="80"><a href="javascript:void(0);" onclick="C.form.check_all('.cklist');">全选/反选</a></th>
                    <th width="100">ID</th>
                    <?php 
    if ($_GET['type'] == '2') {
        echo '<th width="50">排序</th>';
    }
    ?>
                    <th width="150">标题</th>
                    <th>备注</th>
                    <th width="80">数量</th>
                    <th width="200"></th>
                </tr>
                <?php 
    foreach ($page['list'] as $k => $v) {
        $count = 0;
        if (strlen(trim($v['id_list'])) > 0) {
            $count = count(explode(",", $v['id_list']));
        }
        ?>
                <tr>
                    <td><input type="checkbox" class="cklist" value="<?php 
        echo $v['area_id'];
        ?>
" /></td>
                    <td><?php 
        echo $v['area_id'];
        ?>
</td>
                    <?php 
        if ($_GET['type'] == '2') {
            echo '<td><input type="text" size=2 class="order" area_id="' . $v['area_id'] . '" value="' . $v['area_order'] . '" /></td>';
        }
        ?>
                    <td><?php 
        echo $v['title'];
        ?>
</td>
                    <td><?php 
        echo $v['area_remarks'];
        ?>
</td>
                    <td><?php 
        echo $count;
        ?>
</td>
                    <td>
                    <?php 
        if ($_GET['type'] == 2) {
            echo show_button(array('class' => 'but2 but2s but2r', 'onclick' => "area_del('{$v['area_id']}','{$_GET['type']}');", 'text' => '删除', 'level' => 'E0502'));
            echo show_button(array('class' => 'but2 but2s', 'href' => "area.php?type=2&m=add&area_id={$v['area_id']}", 'text' => '编辑', 'level' => 'E0501'));
            echo show_button(array('class' => 'but2 but2s but2o', 'href' => "area.php?type=2&m=add", 'text' => '添加文档', 'level' => 'H0504'));
        }
        if ($_GET['type'] == 1) {
            echo show_button(array('class' => 'but2 but2s but2r', 'onclick' => "area_del('{$v['area_id']}','{$_GET['type']}');", 'text' => '删除', 'level' => 'E0602'));
            echo show_button(array('class' => 'but2 but2s', 'href' => "area.php?type=1&m=add&area_id={$v['area_id']}", 'text' => '编辑', 'level' => 'H0401'));
            echo show_button(array('class' => 'but2 but2s but2o', 'href' => "area.php?type=1&m=add", 'text' => '添加文档', 'level' => 'H0403'));
        }
        ?>
                    </td>
                </tr>
                <?php 
    }
    ?>
            </table>
            </form>

            <div class="pagebar clearfix"><?php 
    echo $page['pagebar']['pagecode'];
    ?>
</div>
        </div>
        <?php 
}
Example #28
0
require_once dirname(__FILE__) . "/inc_menu.php";
?>
<!-- 右侧区域开始 -->
<div class="right_body"> 
    <!-- 当前位置开始 -->
    <div class="snav">您的位置:<a href="frame.php">管理首页</a> » 自定义菜单管理  </div><!-- 当前位置结束 -->
    
    <!-- 右侧主体内容开始 -->
    <div class="mbody">
        <div class="mt10"><b>功能说明</b>:微信自定义菜单只支持2级,添加或编辑一个子菜单都需要单独保存,<font color=red>事件型的菜单需要定制开发,请勿选择</font></div>
		
        <div class="mt10" style="height:28px;"> 
            <div class="l"> 
                <a href="wx_menu.php" class="but2">查看全部</a>
				 <?php 
echo show_button(array('href' => 'javascript:void(0);', 'class' => 'but2 but2g', 'text' => '同步到微信菜单', 'onclick' => "menu_sync();", 'level' => 'W0103'));
?>
            </div> 
        </div>
		
        <div class="mt10" id="cnt_list">
		
            <table class="tb" >
			  <tr>
					<th width="120">菜单排序</th>
					<th class="alignleft">菜单名称</th>
					<th>菜单类型</th>
					<th>链接地址/事件名称</th>
					<th></th>
				</tr>
			<?php 
Example #29
0
                <tr>
                    <td class="alignleft">&nbsp;&nbsp;&nbsp;&nbsp;<?php 
    echo $vurl['url_title'];
    ?>
</td>
                    <td class="alignleft"><?php 
    echo $vurl['url_rule'];
    ?>
</td>
                    <td class="alignleft"><?php 
    echo $vurl['url_true'];
    ?>
</td>
                    <td>
                    <?php 
    echo show_button(array('class' => 'but2 but2s', 'onclick' => "url_show({$vurl['url_id']});", 'text' => '编辑', 'level' => 'A0301'));
    ?>
                    </td>
                </tr>
                <?php 
}
?>
            </table>
        </div>
        <!-- 列表结束-->
    </div>
    <!-- 右侧主体内容结束 -->
    <!-- 底部版权开始 -->
    <?php 
include 'inc_foot.php';
?>
Example #30
0
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
require_once "../inc/util.inc";
require_once "../inc/prefs.inc";
require_once "../inc/prefs_project.inc";
$user = get_logged_in_user();
$subset = get_str("subset");
$columns = get_int("cols", true);
$updated = get_int("updated", true);
$defaults = get_int("defaults", true);
page_head(tra("%1 preferences", subset_name($subset)));
if (isset($updated)) {
    echo "<p style='color: red'>\n        " . tra("Your preferences have been updated, and\n          will take effect when your computer communicates with %1\n          or you issue the %2Update%3 command from the BOINC Manager.", PROJECT, "<strong>", "</strong>") . "\n        </p>\n    ";
}
if (isset($defaults)) {
    echo "<p style='color: red'>\n        " . tra("Your preferences have been reset to the defaults, and\n          will take effect when your computer communicates with %1\n          or you issue the %2Update%3 command from the BOINC Manager.", PROJECT, "<strong>", "</strong>") . "\n        </p>\n    ";
}
if ($subset == "global") {
    print_prefs_display_global($user, $columns);
    if (!$defaults) {
        show_button("prefs_default.php", "Restore defaults", "Restore default preferences");
    }
} else {
    print_prefs_display_project($user, $columns);
}
page_tail();
$cvs_version_tracker[] = "\$Id\$";
//Generated automatically - do not edit