⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 Internet Task Management System可以让用户分配和管理一个组织内的任务。ITMS可以发送任务管理通知
💻 PHP
字号:
<?php/* * ITMS ValleyData source file version 1.0 May 11, 2001 * * ITMS homepage, shows pending tasks assigned to the current user * as well as current tasks the current user has assigned * * * Internet Task Management System: An online system used for recording information about and assigning tasks and processes. * Copyright (C) 2001  ValleyData Programming Group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * * See file named "gpl.txt" included with source code or * visit http://www.gnu.org/copyleft/gpl.txt on the internet. */$title="Pending Tasks";include("header.php");print("<IMG SRC=\"images/pending_tasks.jpg\" WIDTH=\"400\" HEIGHT=\"41\" BORDER=\"0\" ALT=\"Welcome to ITMS $user\">");if($viewPending == "Show Details"){    $viewPending = "Hide";    $viewPendingNot = "Show";}else{    $viewPending = "Show";    $viewPendingNot = "Hide";}if($viewAssigned == "Show Details"){    $viewAssigned = "Hide";    $viewAssignedNot = "Show";}else{    $viewAssigned = "Show";    $viewAssignedNot = "Hide";}$PENDING_START = <<<PENDING_START<table><tr><td>    <B>Pending Tasks Currently Assigned to me:</B>    <table border="0">    <form name="pending_tasks" METHOD="POST" ACTION="index.php">    <tr class="table-header">        <td><a href="index.php?orderby=taskname">Task Name</a></td>        <td><a href="index.php?orderby=assigned">Assigned By</a></td>        <td><a href="index.php?orderby=priority">Priority</a></td>        <td><a href="index.php?orderby=duedate">Due Date</a></td>        <td>        <INPUT TYPE="hidden" name="viewAssigned" value="$viewAssignedNot Details">		<INPUT TYPE="submit" name="viewPending" value="$viewPending Details">        </td>    </tr>    </form>	<form name="save" METHOD="POST" ACTION="index.php">PENDING_START;$PENDING_END = <<<PENDING_END	<tr class="table-header">	    <td>&nbsp;</td>		<td>&nbsp;</td>		<td>&nbsp;</td>	    <td>&nbsp;</td>		<td>		<INPUT TYPE="hidden" name="save" value="save">		<INPUT TYPE="submit" value="Complete Selected Tasks" name="save">		</td>	</tr>	</form>    </table><br>PENDING_END;$ASSIGNED_START = <<<ASSIGNED_START    <br>    <B>Pending Tasks I have Assigned:</B>    <table border="0">    <form METHOD="POST" ACTION="index.php">    <tr class="table-header">        <td><a href="index.php?orderby=taskname">Task Name</a></td>        <td><a href="index.php?orderby=assigned">Assigned To</a></td>        <td><a href="index.php?orderby=priority">Priority</a></td>        <td><a href="index.php?orderby=duedate">Due Date</a></td>        <td colspan="2">            <INPUT TYPE="hidden" name="viewPending" value="$viewPendingNot Details">            <INPUT TYPE="submit" name="viewAssigned" value="$viewAssigned Details">        </td>    </tr>    </form>ASSIGNED_START;$ASSIGNED_START_ALL = <<<ASSIGNED_START_ALL    <br>    <B>Pending Tasks in the System:</B>    <table border="0">    <form METHOD="POST" ACTION="index.php">    <tr class="table-header">        <td><a href="index.php?orderby=taskname">Task Name</a></td>        <td><a href="index.php?orderby=assigned">Assigned To</a></td>        <td><a href="index.php?orderby=assigner">Assigned By</a></td>        <td><a href="index.php?orderby=priority">Priority</a></td>        <td><a href="index.php?orderby=duedate">Due Date</a></td>        <td colspan="2">            <INPUT TYPE="hidden" name="viewPending" value="$viewPendingNot Details">            <INPUT TYPE="submit" name="viewAssigned" value="$viewAssigned Details">        </td>    </tr>    </form>ASSIGNED_START_ALL;$ASSIGNED_END = <<<ASSIGNED_END    </table></td></tr></table>ASSIGNED_END;db_open();db_use();if($orderby == "taskname"){    $orderby = "title";}else if($orderby == "assigned"){    $orderby = "name";}else if($orderby == "assigner"){    $orderby = "assigned_by";}else if($orderby == "priority"){    $orderby = "priority DESC";}else if($orderby == "duedate"){    $orderby = "due_date";}else{    $orderby = "due_date";}$query = "SELECT tid, title, name, priority, to_char(due_date, 'YYYY-MM-DD HH24:MI:SS') DUE_DATE, ".		 "to_char(date_assigned, 'YYYY-MM-DD HH24:MI:SS') DATE_ASSIGNED, info FROM pending_tasks, users WHERE pending_tasks.user_id = '$user_id' ".		 "AND pending_tasks.assigner = users.user_id ORDER BY $orderby";$result = db_query($query); //get pending tasks assigned to current user$table_separator_string = "table-separator-even";$row_separator_num = 0;if($result){    print($PENDING_START);    while($row = db_fetch_row($result))    {        $row_separator_num++;        if($row_separator_num % 2 == 0)            $table_separator_string = "table-separator-even";        else            $table_separator_string = "table-separator-odd";		$priority = get_priority_string($row["PRIORITY"]);        print("<tr class=\"$table_separator_string\">\n");        print("    <td><a href=\"\"  onclick=\"javascript:window.open('task_show.php?task_id=".$row["TID"]."','mywindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=350,height=200')\">" . $row["TITLE"] . "</a></td>\n"); //Added Link to task_show.php Matt Palmerlee 5/16/2003         print("    <td>" . $row["NAME"] . "</td>\n");		print("    <td>" . $priority . "</td>\n");        print("    <td>" . convert_date($row["DUE_DATE"]) . "</td>\n");        print("<td><INPUT TYPE=\"checkbox\" NAME=\"done" . $row["TID"] . "\">Task Done</td>");        print("</tr>\n");        if($viewPending == "Hide")        {			$info = nl2br($row["INFO"]);            print("<tr class=\"$table_separator_string\">\n");            print("<td>&nbsp;</td>");            print("<td colspan=\"4\">Assigned On: " . convert_date($row["DATE_ASSIGNED"]) . "<br>\n$info</td>");            print("</tr>");        }    }	if($row_separator_num == 0) //they have no pending tasks	{		print("<tr class=\"$table_separator_string\">\n<td colspan=\"5\">No Current Pending Tasks</td></tr>\n");	}    print($PENDING_END);}if($ALLOW_ADMIN_VIEW_ALL_TASKS && $isAdmin){    $query = "SELECT tid, title, u1.name name, u2.name assigned_by, priority, to_char(due_date, 'YYYY-MM-DD HH24:MI:SS') DUE_DATE, ".		 "to_char(date_assigned, 'YYYY-MM-DD HH24:MI:SS') DATE_ASSIGNED, info FROM pending_tasks, users u1, users u2 WHERE pending_tasks.user_id = u1.user_id ".         "and pending_tasks.assigner = u2.user_id ORDER BY $orderby";	$info_colspan = 6;}else{    $query = "SELECT tid, title, name, priority, to_char(due_date, 'YYYY-MM-DD HH24:MI:SS') DUE_DATE, ".		 "to_char(date_assigned, 'YYYY-MM-DD HH24:MI:SS') DATE_ASSIGNED, info FROM pending_tasks, users WHERE pending_tasks.assigner = '$user_id' ".		 "AND pending_tasks.user_id = users.user_id ORDER BY $orderby";	$info_colspan = 5;}$result = db_query($query); //get pending tasks user has assigned$table_separator_string = "table-separator-even";$row_separator_num = 0;if($result){    if($ALLOW_ADMIN_VIEW_ALL_TASKS && $isAdmin)    {        print($ASSIGNED_START_ALL);    }    else    {        print($ASSIGNED_START);    }    while($row = db_fetch_row($result))    {        $row_separator_num++;        if($row_separator_num % 2 == 0)            $table_separator_string = "table-separator-even";        else            $table_separator_string = "table-separator-odd";		$priority = get_priority_string($row["PRIORITY"]);        print("<form name=\"unassign\" METHOD=\"POST\" ACTION=\"task_assigned_delete.php\">");        print("<tr class=\"$table_separator_string\">\n");        print("    <td><a href=\"\"  onclick=\"javascript:window.open('task_show.php?task_id=".$row["TID"]."','mywindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=350,height=200')\">" . $row["TITLE"] . "</a></td>\n"); //Added Link to task_show.php Matt Palmerlee 5/16/2003         print("    <td>" . $row["NAME"] . "</td>\n");        if($ALLOW_ADMIN_VIEW_ALL_TASKS && $isAdmin)        {            print("    <td>" . $row["ASSIGNED_BY"] . "</td>\n");        }		print("    <td>" . $priority . "</td>\n");        print("    <td>" . convert_date($row["DUE_DATE"]) . "</td>\n");        print("<td>\n<INPUT TYPE=\"hidden\" name=\"task_name\" value=\"" . $row["TITLE"] ."\">\n");        print("<INPUT TYPE=\"hidden\" name=\"tid\" value=\"" . $row["TID"] ."\">\n");        print("<INPUT TYPE=\"submit\" value=\"Unassign Task\" NAME=\"unassign" . $row["TID"] . "\">\n</td>");        print("</form>");        print("<form METHOD=\"POST\" ACTION=\"task_pending_edit.php\">\n");        print("<td>\n");        print("<INPUT TYPE=\"hidden\" name=\"edit_pending_name\" value=\"" . $row["TITLE"] . "\">\n");        print("<INPUT TYPE=\"hidden\" name=\"edit_pending\" value=\"" . $row["TID"] . "\">\n");        print("<INPUT TYPE=\"submit\" value=\"Edit This Task\">\n");        print("</td>\n");        print("</tr>\n");        print("</form>\n");        if($viewAssigned == "Hide")        {			$info = nl2br($row["INFO"]);            print("<tr class=\"$table_separator_string\">\n");            print("<td>&nbsp;</td>");            print("<td colspan=\"$info_colspan\">Assigned On: " . convert_date($row["DATE_ASSIGNED"]) . "<br>\n$info</td>");            print("</tr>");        }    }	if($row_separator_num == 0) //they have no assigned tasks	{		print("<tr class=\"$table_separator_string\">\n<td colspan=\"6\">No Current Assigned Tasks</td></tr>\n");	}    print($ASSIGNED_END);}db_close();include("footer.php"); ?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -