function db_connect_ex($dbase) { global $mysql_server, $mysql_login, $mysql_passwd, $try_again; $link = mysql_connect($mysql_server, $mysql_login, $mysql_passwd); $db = mysql_select_db($dbase, $link); if ($db == NULL) { show_head(); echo "<H1>Warning!</H1>\n <P>\n <FONT COLOR=#FF0000>can't connect to MySQL or select database! Check rights on tables!</FONT>\n </P>\n <FORM>\n <INPUT TYPE=button CLASS=\"inputsubmit\" VALUE=\"{$try_again}\" OnClick=\"window.location='index.php'\">\n </FORM>\n"; show_tail(); @mysql_close($link); } mysql_query("set character_set_results= koi8r;", $link); mysql_query("set character_set_connection= koi8r;", $link); mysql_query("set character_set_client= koi8r;", $link); mysql_query("set character_set_database = koi8r;", $link); return $link; }
function show_byday2($tmin, $tmax, $link) { $result = mysql_query("select distinct u.login as uname, d.id as id, count(d.size) as _count, sum(d.size) as _ssize from detail d, users u where d.u_id=u.id and utime<{$tmax} and utime>{$tmin} group by u_id order by _ssize desc;", $link); $mod_name = "day stat, daily leve2"; show_head(); show_help(); // echo "select distinct u.login as uname, sum(d.size) as _ssize from detail d, users u where d.u_id=u.id and utime<$tmax and utime>$tmin group by u_id;"; echo "<br>" . strftime("%d %B, %T", (int) $tmin) . "-" . strftime("%d, %B %T", (int) $tmax) . " "; echo "<HR NOSHADE COLOR=#000000 SIZE=1>\n<BR>\n"; echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n <TR><TD BGCOLOR=#93BEE2>\n <TABLE BORDER=0 CELLPADDING=1 CELLSPACING=1>\n <TR VALIGN=TOP ALIGN=CENTER>\n <TD HEIGHT=15>login</TD>\n <TD><B>count</B></TD>\n <TD><B>bytes</B></TD>\n </TR>"; $max = mysql_num_rows($result); for ($i = 0; $i < $max; $i++) { $login = @mysql_result($result, $i, "uname"); $uid = @mysql_result($result, $i, "id"); $size = @mysql_result($result, $i, "_ssize"); $count = @mysql_result($result, $i, "_count"); echo "<TR BGCOLOR=#FFF7E5 ALIGN=RIGHT>\n\t<td>{$login}</td>\n\t<td>" . dotize($count) . "</a></td>\n\t<td>" . dotize($size) . "</a></td>\n\t</tr>"; } }
$error = "?error=" . urlencode($error); } header("Location: " . $_POST['redirect'] . $error); } else { header("Location: " . $_POST['redirect']); } exit; } } $title = "Task Management"; $editor = true; if ($_GET['work']) { $editor = false; } if (!$_GET['sid']) { show_head($title, false, $extra, $editor); } if ($_GET['error']) { $error = $_GET['error']; } //echo "<h1 class=\"error\">Alena is working on this, don't mind the display</h1>"; if ($error) { echo "<p>" . str_replace('\\"', '', $error) . "</p>"; } if ($_GET['work']) { $prog = $slave->select("SELECT Progress,Task_Name,IF (T.User_ID>0, T.User_ID, Department_ID) as Old_Assigned, Request_User_ID, First_Name, Last_Name FROM Tasks as T, Users as U WHERE T.Request_User_ID=U.User_ID AND Task_ID=" . $_GET['work']); $old_assigned = $prog[0]['Old_Assigned']; echo "<h1>Log Work for {$task_id}, " . $prog[0]['Task_Name'] . "</h1>"; ?> <script language="javascript" type="text/javascript"> <!--
list($month, $year) = get_month_year(); // echo "1. Введено: $PHP_AUTH_USER : $PHP_AUTH_PW <br>"; // echo "2. Введено: $ulogin : $passwd "; echo "<H1>{$web_client_your_stat} {$month} {$year}</H1>\n"; $result = mysql_query("SELECT id FROM users where login='******'", $link); $id = mysql_result($result, 0, "id"); show_info($link, $id); echo "<HR NOSHADE COLOR=#000000 SIZE=1>\n<BR>\n"; show_stat($link, $id); echo "<HR NOSHADE COLOR=#000000 SIZE=1>\n"; if (!isset($no_mail)) { show_mailstat($link, $PHP_AUTH_USER); } echo "<HR NOSHADE COLOR=#000000 SIZE=1>\n"; // show_form(); show_tail(); @mysql_close($link); } } else { Header("WWW-Authenticate: Basic realm=\"{$web_client_auth_realm}\""); Header("HTTP/1.0 401 Unauthorized"); show_head(); echo "1. Введено: {$PHP_AUTH_USER} : {$PHP_AUTH_PW} <br>"; echo "{$msg} {$msg2}"; show_help(); echo "<P><FONT COLOR=#FF0000>{$web_client_auth_wrong}</FONT></P>"; show_tail(); @mysql_close($link); exit; } }
<?php include_once 'linkstart.php'; if (!is_login()) { header("location: login.php?action=err&mes=你需要登录才能查看用户信息!"); exit; } show_head('状态信息'); echo '<!-- 导航条 -->'; show_bar(); echo '<!-- 导航条结束 --> <!-- 主体部分 -->'; //print_r($user); ?> <?php echo '<div class="container">'; show_alert(); echo '</div>'; global $message; if (!@$_GET['messageid']) { header("location: messagelist.php?action=err&mes=信息不存在!"); exit; } $message = get_message_by_id($_GET['messageid']); show_message($message); ?>
<?php include_once 'linkstart.php'; if (!is_login()) { header("location: login.php?action=err&mes=你需要登录才能查看用户信息!"); exit; } show_head('用户信息'); echo '<!-- 导航条 -->'; show_bar(); echo '<!-- 导航条结束 --> <!-- 主体部分 -->'; if (@$_GET['userid']) { $userid = $_GET['userid']; } else { $userid = $_SESSION['userid']; } global $user; $user = get_user_by_id($userid); //print_r($user); ?> <div class="container"> <?php if (!$user) { header("location: userdetails.php?action=err&mes=用户不存在!"); } show_alert(); ?> <table class="table">
include $theme_content_folder . '/_footer.php'; $body_content['footer'] = ob_get_contents(); ob_end_clean(); } // get aside content /* $body_content['aside'] = insert_aside($aside_content); */ if (file_exists($theme_content_folder . '/_aside.php')) { ob_start(); include $theme_content_folder . '/_aside.php'; $body_content['aside'] = ob_get_contents(); ob_end_clean(); } // buffer main content and insert into a variable ob_start(); include $content_partial; $body_content['main'] = ob_get_contents(); ob_end_clean(); /* with a builder file we can use a different html structure */ if (file_exists($theme_content_folder . '/builder.php')) { include $theme_content_folder . '/builder.php'; } else { // output default head section $head_content = ''; show_head($head_content, $config); // output default body section show_body($body_content, $config); } } // end checking for $_GET['page_name']
$_POST['newRight'] = $_SESSION['user_id']; } foreach (explode(",", $_POST['newRight']) as $tu) { if (substr($tu, 0, 1) == "d") { $pdata['Department_ID'] = substr($tu, 1); } else { $pdata['User_ID'] = $tu; } $insert = $db->insert("Project_Users", $pdata); } } if (isset($_GET['project_id'])) { $extra = '<script language="JavaScript" src="' . CDN . 'js/option_transfer.js"></script>'; } $title = "Project Management"; show_head($title, false, $extra, true); if ($error) { echo "<p>{$error}</p>"; } if (isset($project_id)) { if ($project_id == "new") { $do_action = "Add Project"; } else { $do_action = "Modify Project"; } echo "<h1>{$do_action}</h1>"; ?> <form name="return_reasons" id="form" method="post" action="projects.php" enctype="multipart/form-data"> <table> <tr> <td class="label">Name</td>
<?php /** * Created by PhpStorm. * User: Pal * Date: 2015/11/13 * Time: 19:04 */ include_once 'linkstart.php'; if (is_login()) { show_head('所有状态'); } else { show_head('最新状态(登录后查看所有内容)'); } show_bar(2); echo '<div class="container">'; show_alert(); echo ' </div>'; //show_send_message(); if (is_login()) { show_message_list(get_message_list()); } else { show_message_list(get_message_list(10)); } show_foot();
if ($_GET['user_id'] == "all") { foreach ($department as $d) { $where .= " OR User_ID=" . $d['User_ID']; $forud = " AND IT Users"; } } $where .= ")"; $forud = " for " . $department[0]['Department_Name'] . $forud; } } $where .= ")"; if ($where == "AND ()") { $where = ""; } } show_head($title); echo "<h1>{$title}</h1>\n"; echo "<table><tr>"; echo "<td>User <select name=\"user_id\" onChange=\"MM_jumpMenu('parent',this,0)\">\n"; echo "<option value=\"" . $_SERVER['PHP_SELF'] . ($_GET['department_id'] ? "?department_id=" . $_GET['department_id'] : "") . "\">No Users</option>\n"; echo "<option value=\"" . $_SERVER['PHP_SELF'] . "?" . ($_GET['department_id'] ? "department_id=" . $_GET['department_id'] . "&" : "") . "user_id=all\">All Users</option>\n"; //current $ddu = $slave->select("SELECT User_ID, CONCAT(First_Name, ' ', Last_Name) as User, User_Status_ID FROM Users WHERE User_Status_ID=1 ORDER BY First_Name"); if ($ddu) { foreach ($ddu as $u) { echo "<option value=\"" . $_SERVER['PHP_SELF'] . "?" . ($_GET['department_id'] ? "department_id=" . $_GET['department_id'] . "&" : "") . "user_id=" . $u['User_ID'] . "\""; if ($_GET['user_id'] == $u['User_ID']) { echo "SELECTED"; } echo ">" . $u['User'] . "</option>\n"; }
$access = $_SESSION['access']; $extra = '<style type="text/css"> table.calendar { border-left:1px solid #999; } tr.calendar-row { } td.calendar-day { min-height:80px; font-size:11px; position:relative; } * html div.calendar-day { height:80px; } td.calendar-day:hover { background:#eceff5; } td.calendar-day-np { background:#eee; min-height:80px; } * html div.calendar-day-np { height:80px; } td.calendar-day-head { background:#ccc; font-weight:bold; text-align:center; width:120px; padding:5px; border-bottom:1px solid #999; border-top:1px solid #999; border-right:1px solid #999; } div.day-number { background:#999; padding:5px; color:#fff; font-weight:bold; float:right; margin:-5px -5px 0 0; width:20px; text-align:center; } /* shared */ td.calendar-day, td.calendar-day-np { width:120px; padding:5px; border-bottom:1px solid #999; border-right:1px solid #999; } </style> '; $title = "Task Calendar"; if (!$_GET['sid']) { show_head($title, false, $extra); } /* draws a calendar */ function draw_calendar($month, $year) { /* draw table */ $calendar = '<table cellpadding="0" cellspacing="0" class="calendar">'; /* table headings */ $headings = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); $calendar .= '<tr class="calendar-row"><td class="calendar-day-head">' . implode('</td><td class="calendar-day-head">', $headings) . '</td></tr>'; /* days and weeks vars now ... */ $running_day = date('w', mktime(0, 0, 0, $month, 1, $year)); $days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); $days_in_this_week = 1; $day_counter = 0; $dates_array = array();
<?php /** * Created by PhpStorm. * User: Pal * Date: 2015/11/12 * Time: 16:12 */ include_once 'linkstart.php'; if (!is_login()) { header("location: login.php?action=err&mes=你需要登录才能查看用户信息!"); exit; } show_head('热门'); show_bar(1); //show_send_message(); show_message_list(get_message_praise_hot_list()); show_foot();