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

📄 task_pending_edit.php

📁 Internet Task Management System可以让用户分配和管理一个组织内的任务。ITMS可以发送任务管理通知
💻 PHP
字号:
<?php/* * ITMS ValleyData source file version 1.0 May 11, 2001 * * This is editing a pending task that 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="Edit Pending Task";include("header.php");print("<h2>Edit Pending Task: $edit_pending_name</h2>\n");$done_button_text = "Cancel";if($edit_now == "true") // If they have hit the 'save changes' button{    $done_button_text = "Finished";	$notify = isset($notify) ? "1" : "0";	if($hour == 12) //Special Noon/Midnight Logic	{		$hour = ($am_pm == "1") ? 12: 0;	}    else if($am_pm == "1")    {        $hour += 12;    }	$task_due_date = "$year-$month-$day $hour:$min:00";	$edit_pending_name = trim(make_clean($edit_pending_name));    $task_info = trim(make_clean($task_info));	$repeat_amt = (int)$repeat_amt;	$cc = trim($cc);    	if($edit_pending_name != "")	{		db_open();		db_use();		$query2 = "SELECT original_id FROM pending_tasks WHERE tid='$edit_pending'";		$row = db_fetch_row(db_query($query2));		$original = $row["ORIGINAL_ID"];		//message_box("SELECT original_id FROM pending_tasks WHERE tid='$edit_pending'");				db_open();		db_use();		$query = "UPDATE pending_tasks SET title='$edit_pending_name', user_id='$assign_to', info='$task_info', " .				 "due_date=to_date('$task_due_date', 'YYYY-MM-DD HH24:MI:SS'), notify='$notify', priority='$priority', period='$repeat_amt', " . 				 "period_unit='$repeat_unit' WHERE tid='$edit_pending'";		$default_user = "UPDATE task_types SET default_user='$assign_to' WHERE ttid='$original'";		$assigner_name = get_user_name($user_id);		$assigner_email = get_user_email($user_id);		$email_to = get_user_email($assign_to);		$priority = get_priority_string($priority);		if(db_query($query) && db_query($default_user)) // Update pending task details and reset default user		{			message_box("Task Modified Successfully<br>\n");			notifyUpdate($task_name, $email_to, $assigner_name, $assigner_email, $task_info, $task_due_date, $priority);		}		else		{			message_box("Task Modification Unsuccessful<br>\n", "warning");		}	}    else    {        message_box("Name cannot be blank.  Pending task not changed.<br>\n", "error");    }}db_open();db_use();$query = "SELECT pt.TID, pt.USER_ID, pt.TITLE, pt.INFO, pt.NOTIFY, pt.PRIORITY, " .		 "to_char(pt.DUE_DATE, 'YYYY-MM-DD HH24:MI:SS') DUE_DATE, pt.PERIOD, pt.PERIOD_UNIT " .         "FROM pending_tasks pt WHERE tid='$edit_pending'";$query_task_type = "SELECT tt.OWNER, tt.GROUP_OWNED FROM pending_tasks pt, task_types tt  WHERE tid='$edit_pending' AND ttid=original_id";//Get Task Types attached to the task we are edditing$row_task_type = db_fetch_row(db_query($query_task_type)); // Get all task type info from the pending task ID$row = db_fetch_row(db_query($query)); // Get all pending task info from pending task ID$info = $row["INFO"];$notify = "";if($row["NOTIFY"] == "1")    $notify = "checked";$priority = $row["PRIORITY"];$period = $row["PERIOD"];$period_unit = $row["PERIOD_UNIT"];$assigned_to = $row["USER_ID"];$assigned_to_name = get_user_name($assigned_to);print("Currently assigned to: $assigned_to_name");$due_date = $row["DUE_DATE"];//sample: 2001-03-11 18:59:56 $curr_year = substr($due_date, 0, 4);$curr_month = substr($due_date, 5, 2);$curr_day = substr($due_date, 8, 2);$curr_hour = substr($due_date, 11, 2);$curr_minute = substr($due_date, 14, 2);$am_select = "selected";$pm_select = "";if($curr_hour == 0) //12 AM (Midnight){	$curr_hour = 12; }else if($curr_hour == 12) //12 PM (Noon){	$am_select = "";	$pm_select = "selected";}else if($curr_hour > 12){	$am_select = "";	$pm_select = "selected";	$curr_hour = $curr_hour - 12;	if($curr_hour < 10)		$curr_hour = "0" . $curr_hour;}?><FORM METHOD=POST ACTION="task_pending_edit.php" name="tpe_form">    <table>    <tr>        <td>Name:<INPUT TYPE="text" NAME="edit_pending_name" value="<?php print($edit_pending_name); ?>"></td>    </tr>    <tr>        <td>        <TEXTAREA NAME="task_info" ROWS="10" COLS="30"><?php print($info); ?></TEXTAREA>        </td>    </tr>    <tr>    	<td>    	    Assign to: <SELECT NAME="assign_to">            <?php                if($row_task_type["GROUP_OWNED"] == "1")                {                    $groupnum = $row_task_type["OWNER"];                    $users = get_users_in_group($groupnum);                }                else                {                    $users = get_users_in_groups($user_id);                }                $i = 0;                foreach($users as $u) // Show all relevant users in list box                {                    $i++;                    $assigned_to == $u["USER_ID"] ? $selected = "selected" : $selected = "";                    print("<option $selected value=\"" . $u["USER_ID"] . "\">" . $u["NAME"] . "</option>\n");                }                if($i == 0)                {                    print("<option value=\"" . $user_id . "\">" . $user . "</option>\n");                }                //db_close();            ?>            </SELECT>    	</td>    </tr>    <tr>        <td>    	    Priority:             <SELECT NAME="priority">            <option <?php if($priority == "0")print("selected"); ?> value="0">Low</option>            <option <?php if($priority == "1")print("selected"); ?> value="1">Medium</option>            <option <?php if($priority == "2")print("selected"); ?> value="2">High</option>            <option <?php if($priority == "3")print("selected"); ?> value="3">ASAP!!!</option>            </SELECT>    	</td>    </tr>    <tr>    	<td>    		Date: <INPUT TYPE="text" NAME="month" value="<?php print($curr_month); ?>" size="2" onblur="verify_int(this); verify_date(this, document.tpe_form.year.value, document.tpe_form.month.value, document.tpe_form.day.value, document.tpe_form.hour.value, document.tpe_form.min.value)">/<INPUT TYPE="text" NAME="day" value="<?php print($curr_day); ?>" size="2" onblur="verify_int(this); verify_date(this, document.tpe_form.year.value, document.tpe_form.month.value, document.tpe_form.day.value, document.tpe_form.hour.value, document.tpe_form.min.value)">/<INPUT TYPE="text" NAME="year" value="<?php print($curr_year); ?>" size="4" onblur="verify_int(this); verify_date(this, document.tpe_form.year.value, document.tpe_form.month.value, document.tpe_form.day.value, document.tpe_form.hour.value, document.tpe_form.min.value)">    	    Time: <INPUT TYPE="text" NAME="hour" value="<?php print($curr_hour); ?>" size="2" onblur="verify_int(this); verify_date(this, document.tpe_form.year.value, document.tpe_form.month.value, document.tpe_form.day.value, document.tpe_form.hour.value, document.tpe_form.min.value)">:<INPUT TYPE="text" NAME="min" value="<?php print($curr_minute); ?>" size="2" onblur="verify_int(this); verify_date(this, document.tpe_form.year.value, document.tpe_form.month.value, document.tpe_form.day.value, document.tpe_form.hour.value, document.tpe_form.min.value)"><SELECT NAME="am_pm"><option value="0" <?php print($am_select); ?>>AM</option><option value="1" <?php print($pm_select); ?>>PM</option></SELECT>    	</td>    </tr>    <tr>        <td>	        <INPUT TYPE="checkbox" NAME="notify" <?php print($notify); ?>>Notify me when task is completed	    </td>    </tr>    <TR>        <TD>Repeat every:        <INPUT TYPE="text" NAME="repeat_amt" size="4" value="<?php print($period); ?>" onblur="verify_int(this)">        <SELECT NAME="repeat_unit">        <option value="0" <?php if($period_unit == "0")print("selected"); ?>>days</option>        <option value="1" <?php if($period_unit == "1")print("selected"); ?>>weeks</option>        <option value="2" <?php if($period_unit == "2")print("selected"); ?>>months</option>        </SELECT>        </TD>    </TR>    <tr>    	<td colspan="2">            <INPUT TYPE="hidden" name="edit_pending" value="<?php print($edit_pending); ?>">            <INPUT TYPE="hidden" name="edit_now" value="true">    		<INPUT TYPE="submit" value="Save Changes">            <INPUT TYPE="button" value="<?php print($done_button_text); ?>" onClick="location='index.php'">    	</td>    </tr>    </table></FORM><?php include("footer.php"); ?>

⌨️ 快捷键说明

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