[Simplesheet-commits] SF.net SVN: simplesheet: [2] trunk
Status: Inactive
Brought to you by:
ronaldmaas
|
From: <ron...@us...> - 2007-07-20 12:26:05
|
Revision: 2
http://simplesheet.svn.sourceforge.net/simplesheet/?rev=2&view=rev
Author: ronaldmaas
Date: 2007-07-20 05:25:58 -0700 (Fri, 20 Jul 2007)
Log Message:
-----------
Initial code from tams project
Added Paths:
-----------
trunk/activityreport.php
trunk/admin/
trunk/admin/accessgroupadmin.php
trunk/admin/accessgroupfileadmin.php
trunk/admin/agentadmin.php
trunk/admin/customeradmin.php
trunk/admin/eventtypeadmin.php
trunk/admin/ihadmin.php
trunk/admin/index.php
trunk/admin/payinstadmin.php
trunk/admin/projectadmin.php
trunk/admin/ticketprioradmin.php
trunk/admin/ticketstateadmin.php
trunk/billing.php
trunk/cashflowreport.php
trunk/createinvoice.php
trunk/db.php
trunk/footer.php
trunk/header.php
trunk/index.php
trunk/listinvoice.php
trunk/oireport.php
trunk/postpayment.php
trunk/reports.php
trunk/revenuereport.php
trunk/showticket.php
trunk/styles.php
trunk/ticketaction.php
trunk/ticketing.php
trunk/tickettrack.sql
Added: trunk/activityreport.php
===================================================================
--- trunk/activityreport.php (rev 0)
+++ trunk/activityreport.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,358 @@
+<?
+ include("header.php");
+
+ if ($nextstep == "") {
+ do_step1();
+ } elseif ($nextstep == "2") {
+ do_step2();
+ }
+
+ include("footer.php");
+
+function do_step1 () {
+ global $conn;
+
+ $result = pg_Exec($conn, "SELECT customerid,company_name from customer order by company_name");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+<p>Available Functions</p>
+<a href="reports.php">Reports Home</a><br><br>
+
+Please select either a company to report on, an agent to report on, or both to generate an Activity Report.
+<form action="activityreport.php" method="post" target="reportwindow">
+<input type="hidden" name="nextstep" value="2">
+<select name="customerid">
+<option value="">All Companies
+<?
+ $x = 0;
+ while($row = @pg_fetch_object($result,$x)) {
+ $x++;
+?>
+ <option value="<? echo $row->customerid; ?>"><? echo $row->company_name; ?>
+<?
+ }
+?>
+
+</select>
+<br>
+<select name="agentid">
+<option value="">All Agents
+<?
+ $result = pg_Exec($conn, "SELECT agentid,name from agents order by name");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $x = 0;
+ while($row = @pg_fetch_object($result,$x)) {
+ $x++;
+?>
+ <option value="<? echo $row->agentid; ?>"><? echo $row->name; ?>
+<?
+ }
+?>
+
+</select><br>
+<Br>
+<table border=0>
+<tr><td>From: </td><td>
+ <SELECT NAME="month">
+ <OPTION VALUE="1">January
+ <OPTION VALUE="2">February
+ <OPTION VALUE="3">March
+ <OPTION VALUE="4">April
+ <OPTION VALUE="5">May
+ <OPTION VALUE="6">June
+ <OPTION VALUE="7">July
+ <OPTION VALUE="8">August
+ <OPTION VALUE="9">September
+ <OPTION VALUE="10">October
+ <OPTION VALUE="11">November
+ <OPTION VALUE="12">December
+ </SELECT>
+ <SELECT NAME="day">
+ <OPTION VALUE="1">1
+ <OPTION VALUE="2">2
+ <OPTION VALUE="3">3
+ <OPTION VALUE="4">4
+ <OPTION VALUE="5">5
+ <OPTION VALUE="6">6
+ <OPTION VALUE="7">7
+ <OPTION VALUE="8">8
+ <OPTION VALUE="9">9
+ <OPTION VALUE="10">10
+ <OPTION VALUE="11">11
+ <OPTION VALUE="12">12
+ <OPTION VALUE="13">13
+ <OPTION VALUE="14">14
+ <OPTION VALUE="15">15
+ <OPTION VALUE="16">16
+ <OPTION VALUE="17">17
+ <OPTION VALUE="18">18
+ <OPTION VALUE="19">19
+ <OPTION VALUE="20">20
+ <OPTION VALUE="21">21
+ <OPTION VALUE="22">22
+ <OPTION VALUE="23">23
+ <OPTION VALUE="24">24
+ <OPTION VALUE="25">25
+ <OPTION VALUE="26">26
+ <OPTION VALUE="27">27
+ <OPTION VALUE="28">28
+ <OPTION VALUE="29">29
+ <OPTION VALUE="30">30
+ <OPTION VALUE="31">31
+ </SELECT>
+ <SELECT NAME="year">
+ <OPTION VALUE="2000">2000
+ <OPTION VALUE="2001">2001
+ <OPTION VALUE="2002">2002
+ <OPTION VALUE="2003">2003
+ <OPTION VALUE="2004">2004
+ <OPTION VALUE="2005">2005
+ <OPTION VALUE="2006">2006
+ </SELECT></td></tr>
+<tr><td>To:</td><td><SELECT NAME="month2">
+ <OPTION VALUE="1">January
+ <OPTION VALUE="2">February
+ <OPTION VALUE="3">March
+ <OPTION VALUE="4">April
+ <OPTION VALUE="5">May
+ <OPTION VALUE="6">June
+ <OPTION VALUE="7">July
+ <OPTION VALUE="8">August
+ <OPTION VALUE="9">September
+ <OPTION VALUE="10">October
+ <OPTION VALUE="11">November
+ <OPTION VALUE="12">December
+ </SELECT>
+ <SELECT NAME="day2">
+ <OPTION VALUE="1">1
+ <OPTION VALUE="2">2
+ <OPTION VALUE="3">3
+ <OPTION VALUE="4">4
+ <OPTION VALUE="5">5
+ <OPTION VALUE="6">6
+ <OPTION VALUE="7">7
+ <OPTION VALUE="8">8
+ <OPTION VALUE="9">9
+ <OPTION VALUE="10">10
+ <OPTION VALUE="11">11
+ <OPTION VALUE="12">12
+ <OPTION VALUE="13">13
+ <OPTION VALUE="14">14
+ <OPTION VALUE="15">15
+ <OPTION VALUE="16">16
+ <OPTION VALUE="17">17
+ <OPTION VALUE="18">18
+ <OPTION VALUE="19">19
+ <OPTION VALUE="20">20
+ <OPTION VALUE="21">21
+ <OPTION VALUE="22">22
+ <OPTION VALUE="23">23
+ <OPTION VALUE="24">24
+ <OPTION VALUE="25">25
+ <OPTION VALUE="26">26
+ <OPTION VALUE="27">27
+ <OPTION VALUE="28">28
+ <OPTION VALUE="29">29
+ <OPTION VALUE="30">30
+ <OPTION VALUE="31">31
+ </SELECT>
+ <SELECT NAME="year2">
+ <OPTION VALUE="2000">2000
+ <OPTION VALUE="2001">2001
+ <OPTION VALUE="2002">2002
+ <OPTION VALUE="2003">2003
+ <OPTION VALUE="2004">2004
+ <OPTION VALUE="2005">2005
+ <OPTION VALUE="2006">2006
+ </SELECT>
+</td></tr></table>
+<br><br>
+<input type="submit" value="Generate Report">
+</form>
+
+<? pg_close($conn);
+
+}
+
+function do_step2 () {
+ global $conn, $agentid, $month, $day, $year, $month2, $day2, $year2, $customerid;
+
+ if ($agentid != "") {
+ $agentWhere = " AND ticketevent.agentid = $agentid ";
+ }
+ if ($customerid != "") {
+ $companyWhere = " AND customer.customerid = $customerid ";
+ }
+
+ $result = pg_Exec($conn, "SELECT agents.name, customer.company_name, projects.name as projectname, ticket.ticketnumber, ticket.taskdescription, ticketevent.timespent, ticketevent.billable, ticketevent.rate, ticketevent.timestamp, ticketevent.customerdetail from ticket,ticketevent,projects,customer WHERE ticketevent.agentid = agents.agentid AND customer.customerid = projects.customerid AND projects.projectid = ticket.projectid $companyWhere $agentWhere AND ticketevent.invoicenumber <> 0 AND (ticketevent.timestamp BETWEEN '$month/$day/$year' AND '$month2/$day2/$year2 11:59:59 PM') AND ticketevent.ticketnumber = ticket.ticketnumber ORDER BY ticketevent.timestamp");
+
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+
+ if (pg_numrows($result) == 0) {
+ echo "There was no activity for that agent during that timeframe.";
+ exit;
+ }
+ $linecount = 0;
+?>
+
+<center>
+<!--<img src="latuslogo.jpg"><br>-->
+<? if ($customerid != "") {echo "<font size=+2><b>".pg_Result($result, 0, "company_name")."</b></font><br>";} ?>
+<? if ($agentid != "") {echo "<font size=+2><b>".pg_Result($result, 0, "name")."</b></font><br>";} ?>
+<b>Activity Report</b><br>
+<? echo $month."/".$day."/".$year." - ".$month2."/".$day2."/".$year2;?><br>
+<br>
+
+<table border=0 cellpadding=0 cellspacing=0 width="85%"bgcolor=#000000>
+<tr>
+ <th bgcolor=#000000 width="1">
+ </th>
+ <th bgcolor=#000000 width="120">
+ <font color="#ffffff">Date</font>
+ </th>
+ <th bgcolor=#000000 width="1">
+ </th>
+ <th bgcolor=#000000 width="45">
+ <font color="#ffffff">Ticket #</font>
+ </th>
+ <th bgcolor=#000000 width="1">
+ </th>
+ <th bgcolor=#000000 width="5">
+ </th>
+ <th bgcolor=#000000>
+ <font color="#ffffff">Agent / Company</font>
+ </th>
+ <th bgcolor=#000000 width="1">
+ </th>
+ <th bgcolor=#000000 width="5">
+ </th>
+ <th bgcolor=#000000>
+ <font color="#ffffff">Description</font>
+ </th>
+ <th bgcolor=#000000 width="5">
+ </th>
+ <th bgcolor=#000000 width="1">
+ </th>
+ <th bgcolor=#000000 width="45">
+ <font color="#ffffff">Time</font>
+ </th>
+ <th bgcolor=#000000 width="1">
+ </th>
+ <th bgcolor=#000000 width="85">
+ <font color="#ffffff">Amount Billed</font>
+ </th>
+ <th bgcolor=#000000 width="1">
+ </th>
+</tr>
+<?
+ $bgcolor = "#FFFFFF";
+ $moneytotal = 0;
+ $timetotal = 0;
+ $x = 0;
+ while($row = @pg_fetch_object($result,$x)) {
+ $x++;
+ $timetotal += $row->timespent;
+?>
+<tr>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" valign=top>
+ <?
+ list($myDate,$junk) = split(' ',$row->timestamp);
+ list($myYear,$myMonth,$myDay) = split ('-', $myDate);
+ echo date("F j, Y", mktime(1,0,0,$myMonth,$myDay,$myYear));
+ ?>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" valign=top align=middle>
+ <a href="showticket.php?ticketnumber=<? echo $row->ticketnumber; ?>"><? echo $row->ticketnumber; ?></a>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" width="5">
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" valign=top>
+ <b><? if ($agentid == "") {echo $row->name;}?></b><? if ($agentid == "" && $customerid == "") {echo " / ";} if ($customerid == "") {echo $row->company_name.":";} ?> <? echo $row->projectname;?>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" width="5">
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" valign=top>
+ <b><? echo $row->taskdescription; ?></b> - <? echo $row->customerdetail; ?>
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" width="5">
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" valign=top align=middle>
+ <? echo $row->timespent; ?>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" valign=top align=right>
+ <?
+ if ($row->billable == "t") {
+ $moneytotal += $row->timespent * $row->rate;
+ ?>
+ $<? echo number_format(($row->timespent * $row->rate),2); ?>
+ <?
+ } else {
+ ?>
+ N/A
+ <?
+ }
+ ?>
+ </td>
+</tr>
+<?
+ if ($bgcolor == "#FFFFFF") {
+ $bgcolor = "#DDDDDD";
+ } else {
+ $bgcolor = "#FFFFFF";
+ }
+ }
+?>
+<tr>
+ <td height=1 colspan=11>
+ </td>
+</tr>
+<tr>
+ <td colspan=11 align=right bgcolor="#ffffff">
+ <b>Totals:</b>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td valign=right bgcolor="#ffffff" align=middle>
+ <b><?echo $timetotal;?></b>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td valign=right bgcolor="#ffffff" align=right>
+ <b>$<? echo number_format($moneytotal,2); ?></b>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+</tr>
+<tr>
+ <td height=1 colspan=11 bgcolor="#ffffff">
+ </td>
+ <td height=1 colspan=3>
+ </td>
+</tr>
+</table>
+
+<?
+pg_close($conn);
+}
+?>
Added: trunk/admin/accessgroupadmin.php
===================================================================
--- trunk/admin/accessgroupadmin.php (rev 0)
+++ trunk/admin/accessgroupadmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,171 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ do_step1();
+ } elseif ($action == "edit") {
+ do_edit();
+ } elseif ($action == "add") {
+ do_add();
+ } elseif ($action == "insert") {
+ do_insert();
+ do_step1();
+ } elseif ($action == "update") {
+ do_update();
+ do_step1();
+ } elseif ($action == "delete") {
+ do_delete();
+ do_step1();
+ }
+
+ include("../footer.php");
+?>
+
+<?
+function do_step1 () {
+ global $conn;
+ $result = pg_Exec($conn, "SELECT * from access_levels order by access_level");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+ <a href="accessgroupadmin.php?action=add">New Acess Level</a><br>
+
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+<table border=1 cellpadding=3>
+<tr>
+ <td>
+ Level Name:
+ </td>
+ <td>
+ <?echo $row->description;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Access Level:
+ </td>
+ <td>
+ <?echo $row->access_level;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Functions:
+ </td>
+ <td>
+ <a href="accessgroupadmin.php?action=edit&formaccess_level=<?echo $row->access_level;?>">Edit this access level</a><br>
+ <a href="accessgroupadmin.php?action=delete&formaccess_level=<?echo $row->access_level;?>">Delete this access level</a>
+ </td>
+</tr>
+</table>
+<?
+ $x++;
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $formaccess_level;
+ $result = pg_Exec($conn, "SELECT * from access_levels where access_level = $formaccess_level");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = pg_fetch_object ($result, 0);
+?>
+
+<form action="accessgroupadmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="agentid" value="<?echo $row->access_level;?>">
+<table border=0>
+<tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ <input type=text name="description" size=50 maxlength=100 value="<?echo $row->description;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Access Level:
+ </td>
+ <td>
+ <input type=text name="newaccess_level" size=3 maxlength=3 value="<?echo $row->access_level;?>">
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_add () {
+?>
+
+<form action="accessgroupadmin.php" method="post">
+<input type="hidden" name="action" value="insert">
+<table border=0>
+<tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ <input type=text name="description" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ Access Level:
+ </td>
+ <td>
+ <input type=text name="formaccess_level" size=3 maxlength=3>
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_update() {
+ global $conn, $formaccess_level, $description, $newaccess_level;
+ $result = pg_Exec($conn, "UPDATE access_levels SET description = '$description', access_level = '$newaccess_level' where access_level = $formaccess_level;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_insert() {
+ global $conn, $formaccess_level, $description;
+
+ $result = pg_Exec($conn, "INSERT INTO access_levels (access_level, description) VALUES ('$formaccess_level', '$description');");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_delete() {
+ global $conn, $formaccess_level;
+ $result = pg_Exec($conn, "DELETE FROM access_levels WHERE access_level = $formaccess_level;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Added: trunk/admin/accessgroupfileadmin.php
===================================================================
--- trunk/admin/accessgroupfileadmin.php (rev 0)
+++ trunk/admin/accessgroupfileadmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,180 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ if ($formaccess_level == "") {
+ do_choose_level();
+ } else {
+ do_step1();
+ }
+ } elseif ($action == "edit") {
+ do_edit();
+ } elseif ($action == "add") {
+ do_add();
+ } elseif ($action == "update") {
+ do_update();
+ do_step1();
+ } elseif ($action == "insert") {
+ do_insert();
+ do_step1();
+ } elseif ($action == "delete") {
+ do_delete();
+ do_step1();
+ }
+
+ include("../footer.php");
+?>
+
+<?
+function do_choose_level () {
+ global $conn, $access_level;
+ $result = pg_Exec($conn, "SELECT * FROM access_levels WHERE access_level >= $access_level order by access_level");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+<form action="accessgroupfileadmin.php" method=post>
+Choose the access level to manage files under:<br><br>
+<select name="formaccess_level">
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+ <option value="<?=$row->access_level?>"> <?echo $row->description;?>
+<?
+ $x++;
+ }
+?>
+</select>
+<br><input type=submit value="View Projects">
+</form>
+<?
+
+}
+
+function do_step1 () {
+ global $conn, $formaccess_level;
+ $result = pg_Exec($conn, "SELECT * from security WHERE access_level = $formaccess_level order by scriptname");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+ <a href="accessgroupfileadmin.php">Change Access Level</a><br>
+ <a href="accessgroupfileadmin.php?action=add&formaccess_level=<?=$formaccess_level?>">New File</a><br>
+
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+<table border=1 cellpadding=3>
+<tr>
+ <td>
+ Script Name:
+ </td>
+ <td>
+ <?echo $row->scriptname;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Functions:
+ </td>
+ <td>
+ <a href="accessgroupfileadmin.php?action=edit&formaccess_level=<?echo $formaccess_level;?>&secureid=<?echo $row->secureid;?>">Edit this file name</a><br>
+ <a href="accessgroupfileadmin.php?action=delete&formaccess_level=<?echo $formaccess_level;?>&secureid=<?echo $row->secureid;?>">Delete this file name</a>
+ </td>
+</tr>
+</table>
+<?
+ $x++;
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $formaccess_level, $secureid;
+ $result = pg_Exec($conn, "SELECT * from security where secureid = $secureid");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = pg_fetch_object ($result, 0);
+?>
+
+<form action="accessgroupfileadmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="formaccess_level" value="<?echo $formaccess_level;?>">
+<input type="hidden" name="secureid" value="<?echo $row->secureid;?>">
+<table border=0>
+<tr>
+ <td>
+ Script Name:
+ </td>
+ <td>
+ <input type=text name="script_name" size=50 maxlength=100 value="<?echo $row->scriptname;?>">
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+function do_add () {
+global $formaccess_level;
+?>
+
+<form action="accessgroupfileadmin.php" method="post">
+<input type="hidden" name="action" value="insert">
+<input type="hidden" name="formaccess_level" value="<?echo $formaccess_level;?>">
+<table border=0>
+<tr>
+ <td>
+ Script Name:
+ </td>
+ <td>
+ <input type=text name="scriptname" size=50 maxlength=100>
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_update() {
+ global $conn, $formaccess_level, $scriptname, $secureid;
+ $result = pg_Exec($conn, "UPDATE security SET scriptname = '$scriptname' where secureid = $secureid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_insert() {
+ global $conn, $formaccess_level, $scriptname;
+ $result = pg_Exec($conn, "INSERT INTO security (access_level, scriptname) VALUES ($formaccess_level, '$scriptname');");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_delete() {
+ global $conn, $secureid;
+ $result = pg_Exec($conn, "DELETE FROM security WHERE secureid = $secureid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Added: trunk/admin/agentadmin.php
===================================================================
--- trunk/admin/agentadmin.php (rev 0)
+++ trunk/admin/agentadmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,323 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ do_step1();
+ } elseif ($action == "edit") {
+ do_edit();
+ } elseif ($action == "add") {
+ do_add(" ");
+ } elseif ($action == "chpass") {
+ do_chpass(" ");
+ } elseif ($action == "insert") {
+ if ($pass1 == $pass2) {
+ do_insert();
+ do_step1();
+ } else {
+ do_add("Passwords did not match");
+ }
+ } elseif ($action == "chpass_commit") {
+ if ($pass1 == $pass2) {
+ do_chpass_commit();
+ do_step1();
+ } else {
+ do_chpass("Passwords did not match");
+ }
+ } elseif ($action == "update") {
+ do_update();
+ do_step1();
+ } elseif ($action == "disable") {
+ do_able("N");
+ do_step1();
+ } elseif ($action == "enable") {
+ do_able("Y");
+ do_step1();
+ }
+
+ include("../footer.php");
+?>
+
+<?
+function do_step1 () {
+ global $conn;
+ $result = pg_Exec($conn, "SELECT * from agents order by visible desc, name");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+ <a href="agentadmin.php?action=add">New Agent</a><br>
+
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+<table border=1 cellpadding=3>
+<?
+if ($row->visible == "N") {
+?>
+<tr>
+ <td>
+ Status:
+ </td>
+ <td>
+ <font color="red">This agent is disabled</font>
+ </td>
+</tr>
+<?
+}
+?>
+<tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ <?echo $row->name;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Email:
+ </td>
+ <td>
+ <?echo $row->email;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Login:
+ </td>
+ <td>
+ <?echo $row->login;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Functions:
+ </td>
+ <td>
+ <a href="agentadmin.php?action=edit&agentid=<?echo $row->agentid;?>">Edit this agent</a><br>
+ <a href="agentadmin.php?action=chpass&agentid=<?echo $row->agentid;?>">Change this agent's password</a><br>
+ <?
+ if ($row->visible == "Y") {
+ ?>
+ <a href="agentadmin.php?action=disable&agentid=<?echo $row->agentid;?>">Disable this agent</a>
+ <?
+ } else {
+ ?>
+ <a href="agentadmin.php?action=enable&agentid=<?echo $row->agentid;?>">Enable this agent</a>
+ <?
+ }
+ ?>
+
+ </td>
+</tr>
+</table>
+<?
+ $x++;
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $agentid;
+ $result = pg_Exec($conn, "SELECT * from agents where agentid = $agentid");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = pg_fetch_object ($result, 0);
+?>
+
+<form action="agentadmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="agentid" value="<?echo $row->agentid;?>">
+<table border=0>
+<tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ <input type=text name="name" size=50 maxlength=100 value="<?echo $row->name;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Email:
+ </td>
+ <td>
+ <input type=text name="email" size=50 maxlength=100 value="<?echo $row->email;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Login:
+ </td>
+ <td>
+ <input type=text name="login" size=50 maxlength=100 value="<?echo $row->login;?>">
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_chpass($error) {
+ global $conn, $agentid;
+ if (strlen($error) > 3) {
+ echo "$error<br><br>";
+ }
+?>
+
+<form action="agentadmin.php" method="post">
+<input type="hidden" name="action" value="chpass_commit">
+<input type="hidden" name="agentid" value="<?echo $agentid;?>">
+<input type="hidden" name="oldlogin" value="<?echo $oldlogin;?>">
+<table border=0>
+<tr>
+ <td>
+ New Password:
+ </td>
+ <td>
+ <input type=password name="pass1" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ Password (again):
+ </td>
+ <td>
+ <input type=password name="pass2" size=50 maxlength=100>
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+
+function do_add ($error) {
+global $name, $email, $login;
+ if (strlen($error) > 3) {
+ echo "$error<br><br>";
+ }
+?>
+
+<form action="agentadmin.php" method="post">
+<input type="hidden" name="action" value="insert">
+<table border=0>
+<tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ <input type=text name="name" size=50 maxlength=100 value="<?=$name?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Email:
+ </td>
+ <td>
+ <input type=text name="email" size=50 maxlength=100 value="<?=$email?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Login:
+ </td>
+ <td>
+ <input type=text name="login" size=50 maxlength=100 value="<?=$login?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Password:
+ </td>
+ <td>
+ <input type=password name="pass1" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ Password (again):
+ </td>
+ <td>
+ <input type=password name="pass2" size=50 maxlength=100>
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_update() {
+ global $conn, $agentid, $name, $email, $login;
+
+ if ($_REQUEST['login'] != $_REQUEST['oldlogin']) {
+ $result = pg_Exec($conn, "SELECT agentid from agents where login = '".$_POST['login']."';");
+ if (pg_num_rows($result) != 0) {
+ do_edit("Duplicate Userid, retry.");
+ exit;
+ }
+ }
+ $result = pg_Exec($conn, "UPDATE agents SET name = '$name', email = '$email', login = '$login' where agentid = $agentid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_insert() {
+ global $conn, $name, $login, $email, $pass1;
+
+ $saltgen = substr(crypt($_POST['pass1']), -2);
+ $encpass = crypt($_POST['pass1'], $saltgen);
+
+ $result = pg_Exec($conn, "SELECT agentid from agents where login = '".$_POST['login']."';");
+ if (pg_num_rows($result) != 0) {
+ do_add("Duplicate Userid");
+ exit;
+ } else {
+ $result = pg_Exec($conn, "INSERT INTO agents (name, email, login, password) VALUES ('$name', '$email', '$login', '$encpass');");
+ }
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_chpass_commit() {
+ global $conn, $agentid, $pass1;
+
+ $saltgen = substr(crypt($_POST['pass1']), -2);
+ $encpass = crypt($_POST['pass1'], $saltgen);
+
+ $result = pg_Exec($conn, "UPDATE agents SET password = '$encpass' WHERE agentid = $agentid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_able($able) {
+ global $conn, $agentid;
+ $result = pg_Exec($conn, "UPDATE agents SET visible = '$able' WHERE agentid = $agentid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Added: trunk/admin/customeradmin.php
===================================================================
--- trunk/admin/customeradmin.php (rev 0)
+++ trunk/admin/customeradmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,479 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ do_step1();
+ } elseif ($action == "edit") {
+ do_edit();
+ } elseif ($action == "add") {
+ do_add();
+ } elseif ($action == "update") {
+ do_update();
+ do_step1();
+ } elseif ($action == "insert") {
+ do_insert();
+ do_step1();
+ } elseif ($action == "disable") {
+ do_able("N");
+ do_step1();
+ } elseif ($action == "enable") {
+ do_able("Y");
+ do_step1();
+ }
+
+ include("../footer.php");
+?>
+
+<?
+function do_step1 () {
+ global $conn;
+ $result = pg_Exec($conn, "SELECT * from customer order by visible desc, company_name");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+ <a href="customeradmin.php?action=add">New Customer</a><br>
+
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+<table border=1 cellpadding=3>
+<?
+if ($row->visible == "N") {
+?>
+<tr>
+ <td>
+ Status:
+ </td>
+ <td>
+ <font color="red">This customer is disabled</font>
+ </td>
+</tr>
+<?
+}
+?>
+<tr>
+ <td>
+ Company Name:
+ </td>
+ <td>
+ <?echo $row->company_name;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Address 1:
+ </td>
+ <td>
+ <?echo $row->address1;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Address 2:
+ </td>
+ <td>
+ <?echo $row->address2;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ City:
+ </td>
+ <td>
+ <?echo $row->city;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ State:
+ </td>
+ <td>
+ <?echo $row->state;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Zip:
+ </td>
+ <td>
+ <?echo $row->zip;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Phone:
+ </td>
+ <td>
+ <?echo $row->phone;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Fax:
+ </td>
+ <td>
+ <?echo $row->fax;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Email:
+ </td>
+ <td>
+ <?echo $row->email;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Functions:
+ </td>
+ <td>
+ <a href="customeradmin.php?action=edit&customerid=<?echo $row->customerid;?>">Edit this customer</a><br>
+ <?
+ if ($row->visible == "Y") {
+ ?>
+ <a href="customeradmin.php?action=disable&customerid=<?echo $row->customerid;?>">Disable this customer</a>
+ <?
+ } else {
+ ?>
+ <a href="customeradmin.php?action=enable&customerid=<?echo $row->customerid;?>">Enable this customer</a>
+ <?
+ }
+ ?>
+ </td>
+</tr>
+</table>
+<?
+ $x++;
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $customerid;
+ $result = pg_Exec($conn, "SELECT * from customer where customerid = $customerid");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = pg_fetch_object ($result, 0);
+?>
+
+<form action="customeradmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="customerid" value="<?echo $row->customerid;?>">
+<table border=0>
+<tr>
+ <td>
+ Company Name:
+ </td>
+ <td>
+ <input type=text name="company_name" size=50 maxlength=100 value="<?echo $row->company_name;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Address 1:
+ </td>
+ <td>
+ <input type=text name="address1" size=50 maxlength=100 value="<?echo $row->address1;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Address 2:
+ </td>
+ <td>
+ <input type=text name="address2" size=50 maxlength=100 value="<?echo $row->address2;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ City:
+ </td>
+ <td>
+ <input type=text name="city" size=50 maxlength=100 value="<?echo $row->city;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ State:
+ </td>
+ <td>
+ <select name="state">
+ <option value="<?echo $row->state;?>" selected><?echo $row->state;?></option>
+ <option value="AL">Alabama</option>
+ <option value="AK">Alaska</option>
+ <option value="AZ">Arizona</option>
+ <option value="AR">Arkansas</option>
+ <option value="CA">California</option>
+ <option value="CO">Colorado</option>
+ <option value="CT">Connecticut</option>
+ <option value="DE">Delaware</option>
+ <option value="DC">District of Columbia</option>
+ <option value="FL">Florida</option>
+ <option value="GA">Georgia</option>
+ <option value="HI">Hawaii</option>
+ <option value="ID">Idaho</option>
+ <option value="IL">Illinois</option>
+ <option value="IN">Indiana</option>
+ <option value="IA">Iowa</option>
+ <option value="KS">Kansas</option>
+ <option value="KY">Kentucky</option>
+ <option value="LA">Louisana</option>
+ <option value="ME">Maine</option>
+ <option value="MD">Maryland</option>
+ <option value="MA">Massachusetts</option>
+ <option value="MI">Michigan</option>
+ <option value="MN">Minnesota</option>
+ <option value="MS">Mississippi</option>
+ <option value="MO">Missouri</option>
+ <option value="MT">Montana</option>
+ <option value="NE">Nebraska</option>
+ <option value="NV">Nevada</option>
+ <option value="NH">New Hampshire</option>
+ <option value="NJ">New Jersey</option>
+ <option value="NM">New Mexico</option>
+ <option value="NY">New York</option>
+ <option value="NC">North Carolina</option>
+ <option value="ND">North Dakota</option>
+ <option value="OH">Ohio</option>
+ <option value="OK">Oklahoma</option>
+ <option value="OR">Oregon</option>
+ <option value="PA">Pennsylvania</option>
+ <option value="RI">Rhode Island</option>
+ <option value="SC">South Carolina</option>
+ <option value="SD">South Dakota</option>
+ <option value="TN">Tennessee</option>
+ <option value="TX">Texas</option>
+ <option value="UT">Utah</option>
+ <option value="VT">Vermont</option>
+ <option value="VA">Virginia</option>
+ <option value="WA">Washington</option>
+ <option value="WV">West Virginia</option>
+ <option value="WI">Wisconsin</option>
+ <option value="WY">Wyoming</option>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td>
+ Zip:
+ </td>
+ <td>
+ <input type=text name="zip" size=10 maxlength=10 value="<?echo $row->zip;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Phone:
+ </td>
+ <td>
+ <input type=text name="phone" size=12 maxlength=50 value="<?echo $row->phone;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Fax:
+ </td>
+ <td>
+ <input type=text name="fax" size=12 maxlength=50 value="<?echo $row->fax;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Email:
+ </td>
+ <td>
+ <input type=text name="email" size=20 maxlength=50 value="<?echo $row->email;?>">
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+function do_add () {
+?>
+
+<form action="customeradmin.php" method="post">
+<input type="hidden" name="action" value="insert">
+<table border=0>
+<tr>
+ <td>
+ Company Name:
+ </td>
+ <td>
+ <input type=text name="company_name" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ Address 1:
+ </td>
+ <td>
+ <input type=text name="address1" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ Address 2:
+ </td>
+ <td>
+ <input type=text name="address2" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ City:
+ </td>
+ <td>
+ <input type=text name="city" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ State:
+ </td>
+ <td>
+ <select name="state">
+ <option value="">Choose a state</option>
+ <option value="AL">Alabama</option>
+ <option value="AK">Alaska</option>
+ <option value="AZ">Arizona</option>
+ <option value="AR">Arkansas</option>
+ <option value="CA">California</option>
+ <option value="CO">Colorado</option>
+ <option value="CT">Connecticut</option>
+ <option value="DE">Delaware</option>
+ <option value="DC">District of Columbia</option>
+ <option value="FL">Florida</option>
+ <option value="GA">Georgia</option>
+ <option value="HI">Hawaii</option>
+ <option value="ID">Idaho</option>
+ <option value="IL">Illinois</option>
+ <option value="IN">Indiana</option>
+ <option value="IA">Iowa</option>
+ <option value="KS">Kansas</option>
+ <option value="KY">Kentucky</option>
+ <option value="LA">Louisana</option>
+ <option value="ME">Maine</option>
+ <option value="MD">Maryland</option>
+ <option value="MA">Massachusetts</option>
+ <option value="MI">Michigan</option>
+ <option value="MN">Minnesota</option>
+ <option value="MS">Mississippi</option>
+ <option value="MO">Missouri</option>
+ <option value="MT">Montana</option>
+ <option value="NE">Nebraska</option>
+ <option value="NV">Nevada</option>
+ <option value="NH">New Hampshire</option>
+ <option value="NJ">New Jersey</option>
+ <option value="NM">New Mexico</option>
+ <option value="NY">New York</option>
+ <option value="NC">North Carolina</option>
+ <option value="ND">North Dakota</option>
+ <option value="OH">Ohio</option>
+ <option value="OK">Oklahoma</option>
+ <option value="OR">Oregon</option>
+ <option value="PA">Pennsylvania</option>
+ <option value="RI">Rhode Island</option>
+ <option value="SC">South Carolina</option>
+ <option value="SD">South Dakota</option>
+ <option value="TN">Tennessee</option>
+ <option value="TX">Texas</option>
+ <option value="UT">Utah</option>
+ <option value="VT">Vermont</option>
+ <option value="VA">Virginia</option>
+ <option value="WA">Washington</option>
+ <option value="WV">West Virginia</option>
+ <option value="WI">Wisconsin</option>
+ <option value="WY">Wyoming</option>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td>
+ Zip:
+ </td>
+ <td>
+ <input type=text name="zip" size=10 maxlength=10>
+ </td>
+</tr>
+<tr>
+ <td>
+ Phone:
+ </td>
+ <td>
+ <input type=text name="phone" size=12 maxlength=50>
+ </td>
+</tr>
+<tr>
+ <td>
+ Fax:
+ </td>
+ <td>
+ <input type=text name="fax" size=12 maxlength=50>
+ </td>
+</tr>
+<tr>
+ <td>
+ Email:
+ </td>
+ <td>
+ <input type=text name="email" size=20 maxlength=50>
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_update() {
+ global $conn, $customerid, $company_name, $address1, $address2, $city, $state, $zip, $phone, $fax, $email;
+ $result = pg_Exec($conn, "UPDATE customer SET company_name = '$company_name', address1 = '$address1', address2 = '$address2', city = '$city', state = '$state', zip = '$zip', email = '$email', phone = '$phone', fax = '$fax' where customerid = $customerid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_insert() {
+ global $conn, $company_name, $address1, $address2, $city, $state, $zip, $phone, $fax, $email;
+ $result = pg_Exec($conn, "INSERT INTO customer (company_name,address1,address2,city,state,zip,phone,fax,email) VALUES ('$company_name','$address1','$address2','$city','$state','$zip','$phone','$fax','$email');");
+
+ $result = pg_Exec ($conn, "SELECT currval('customer_customerid_seq');");
+ if (!$result) {
+ echo "An error occured.\n";
+ exit;
+ }
+ $customerid = pg_Result($result, 0, "currval");
+
+ $result = pg_Exec($conn, "INSERT INTO projects (customerid,name) VALUES ($customerid,'General Company Work');");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_able($able) {
+ global $conn, $customerid;
+ $result = pg_Exec($conn, "UPDATE customer SET visible = '$able' WHERE customerid = $customerid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Added: trunk/admin/eventtypeadmin.php
===================================================================
--- trunk/admin/eventtypeadmin.php (rev 0)
+++ trunk/admin/eventtypeadmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,172 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ do_step1();
+ } elseif ($action == "edit") {
+ do_edit();
+ } elseif ($action == "add") {
+ do_add();
+ } elseif ($action == "update") {
+ do_update();
+ do_step1();
+ } elseif ($action == "insert") {
+ do_insert();
+ do_step1();
+ } elseif ($action == "disable") {
+ do_able("N");
+ do_step1();
+ } elseif ($action == "enable") {
+ do_able("Y");
+ do_step1();
+ }
+
+ include("../footer.php");
+?>
+
+<?
+function do_step1 () {
+ global $conn;
+ $result = pg_Exec($conn, "SELECT * from eventcontrol order by visible desc, description");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+ <a href="eventtypeadmin.php?action=add">New Event Type</a><br>
+
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+<table border=1 cellpadding=3>
+<?
+if ($row->visible == "N") {
+?>
+<tr>
+ <td>
+ Status:
+ </td>
+ <td>
+ <font color="red">This ticket type is disabled</font>
+ </td>
+</tr>
+<?
+}
+?>
+<tr>
+ <td>
+ Ticket Type:
+ </td>
+ <td>
+ <?echo $row->description;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Functions:
+ </td>
+ <td>
+ <a href="eventtypeadmin.php?action=edit&eventtype=<?echo $row->eventtype;?>">Edit this ticket type</a><br>
+ <?
+ if ($row->visible == "Y") {
+ ?>
+ <a href="eventtypeadmin.php?action=disable&eventtype=<?echo $row->eventtype;?>">Disable this ticket type</a>
+ <?
+ } else {
+ ?>
+ <a href="eventtypeadmin.php?action=enable&eventtype=<?echo $row->eventtype;?>">Enable this ticket type</a>
+ <?
+ }
+ ?>
+ </td>
+</tr>
+</table>
+<?
+ $x++;
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $eventtype;
+ $result = pg_Exec($conn, "SELECT * from eventcontrol where eventtype = $eventtype");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = pg_fetch_object ($result, 0);
+?>
+
+<form action="eventtypeadmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="eventtype" value="<?echo $row->eventtype;?>">
+<table border=0>
+<tr>
+ <td>
+ Ticket Type:
+ </td>
+ <td>
+ <input type=text name="description" size=50 maxlength=100 value="<?echo $row->description;?>">
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+function do_add () {
+?>
+
+<form action="eventtypeadmin.php" method="post">
+<input type="hidden" name="action" value="insert">
+<table border=0>
+<tr>
+ <td>
+ Ticket Type:
+ </td>
+ <td>
+ <input type=text name="description" size=50 maxlength=100>
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_update() {
+ global $conn, $eventtype, $description;
+ $result = pg_Exec($conn, "UPDATE eventcontrol SET description = '$description' where eventtype = $eventtype;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_insert() {
+ global $conn, $description;
+ $result = pg_Exec($conn, "INSERT INTO eventcontrol (description) VALUES ('$description');");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_able($able) {
+ global $conn, $eventtype;
+ $result = pg_Exec($conn, "UPDATE eventcontrol SET visible = '$able' WHERE eventtype = $eventtype;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Added: trunk/admin/ihadmin.php
===================================================================
--- trunk/admin/ihadmin.php (rev 0)
+++ trunk/admin/ihadmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,160 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ do_edit();
+ } elseif ($action == "update") {
+ do_update();
+ do_edit();
+ }
+
+ include("../footer.php");
+
+function do_edit () {
+ global $conn, $customerid;
+ $result = pg_Exec($conn, "SELECT * from invoiceheader");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = pg_fetch_object ($result, 0);
+?>
+<form action="ihadmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<table border=0>
+<tr>
+ <td>
+ Company Name:
+ </td>
+ <td>
+ <input type=text name="company_name" size=50 maxlength=100 value="<?echo $row->company_name;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Tagline/Business description:
+ </td>
+ <td>
+ <input type=text name="coline2" size=50 maxlength=100 value="<?echo $row->coline2;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Address 1:
+ </td>
+ <td>
+ <input type=text name="address1" size=50 maxlength=100 value="<?echo $row->address1;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Address 2:
+ </td>
+ <td>
+ <input type=text name="address2" size=50 maxlength=100 value="<?echo $row->address2;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ City:
+ </td>
+ <td>
+ <input type=text name="city" size=50 maxlength=100 value="<?echo $row->city;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ State:
+ </td>
+ <td>
+ <select name="state">
+ <option value="<?echo $row->state;?>" selected><?echo $row->state;?></option>
+ <option value="AL">Alabama</option>
+ <option value="AK">Alaska</option>
+ <option value="AZ">Arizona</option>
+ <option value="AR">Arkansas</option>
+ <option value="CA">California</option>
+ <option value="CO">Colorado</option>
+ <option value="CT">Connecticut</option>
+ <option value="DE">Delaware</option>
+ <option value="DC">District of Columbia</option>
+ <option value="FL">Florida</option>
+ <option value="GA">Georgia</option>
+ <option value="HI">Hawaii</option>
+ <option value="ID">Idaho</option>
+ <option value="IL">Illinois</option>
+ <option value="IN">Indiana</option>
+ <option value="IA">Iowa</option>
+ <option value="KS">Kansas</option>
+ <option value="KY">Kentucky</option>
+ <option value="LA">Louisana</option>
+ <option value="ME">Maine</option>
+ <option value="MD">Maryland</option>
+ <option value="MA">Massachusetts</option>
+ <option value="MI">Michigan</option>
+ <option value="MN">Minnesota</option>
+ <option value="MS">Mississippi</option>
+ <option value="MO">Missouri</option>
+ <option value="MT">Montana</option>
+ <option value="NE">Nebraska</option>
+ <option value="NV">Nevada</option>
+ <option value="NH">New Hampshire</option>
+ <option value="NJ">New Jersey</option>
+ <option value="NM">New Mexico</option>
+ <option value="NY">New York</option>
+ <option value="NC">North Carolina</option>
+ <option value="ND">North Dakota</option>
+ <option value="OH">Ohio</option>
+ <option value="OK">Oklahoma</option>
+ <option value="OR">Oregon</option>
+ <option value="PA">Pennsylvania</option>
+ <option value="RI">Rhode Island</option>
+ <option value="SC">South Carolina</option>
+ <option value="SD">South Dakota</option>
+ <option value="TN">Tennessee</option>
+ <option value="TX">Texas</option>
+ <option value="UT">Utah</option>
+ <option value="VT">Vermont</option>
+ <option value="VA">Virginia</option>
+ <option value="WA">Washington</option>
+ <option value="WV">West Virginia</option>
+ <option value="WI">Wisconsin</option>
+ <option value="WY">Wyoming</option>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td>
+ Zip:
+ </td>
+ <td>
+ <input type=text name="zip" size=10 maxlength=10 value="<?echo $row->zip;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Phone:
+ </td>
+ <td>
+ <input type=text name="phone" size=12 maxlength=50 value="<?echo $row->phone;?>">
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_update() {
+ global $conn, $coline2, $company_name, $address1, $address2, $city, $state, $zip, $phone;
+ $result = pg_Exec($conn, "UPDATE invoiceheader SET company_name = '$company_name', coline2 = '$coline2', address1 = '$address1', address2 = '$address2', city = '$city', state = '$state', zip = '$zip', phone = '$phone';");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Added: trunk/admin/index.php
===================================================================
--- trunk/admin/index.php (rev 0)
+++ trunk/admin/index.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,25 @@
+<?
+ include("../header.php");
+?>
+<center>
+<h2>NewCo Administration</h2>
+</center>
+
+<p>Available Functions</p>
+
+<ul>
+<li> <a href="../index.php">Main Menu</a> - Back to the Main Menu.<br><br>
+<li> <a href="ihadmin.php">Invoice Header Configuration</a> - Edit the main Invoice Header.<br>
+<li> <a href="customeradmin.php">Administer Customers</a> - Add/Edit/Activate customer information.<br>
+<li> <a href="agentadmin.php">Administer Agents</a> - Add/Edit/Activate agent information.<br>
+<li> <a href="projectadmin.php">Administer Projects</a> - Add/Edit/Activate project information.<br>
+<li> <a href="payinstadmin.php">Administer Payment Instruments</a> - Add/Edit/Activate payment instruments.<br>
+<li> <a href="eventtypeadmin.php">Administer Event Types</a> - Add/Edit/Activate event types.<br>
+<li> <a href="ticketprioradmin.php">Administer Ticket Priorities</a> - Add/Edit/Activate ticket priorities.<br>
+<li> <a href="ticketstateadmin.php">Administer Ticket States</a> - Add/Edit/Activate ticket states.<br><br>
+<li> <a href="accessgroupadmin.php">Administer Access Groups/Levels</a> - Add/Edit/Delete access groups and levels.<br>
+<li> <a href="accessgroupfileadmin.php">Administer Access Level Files</a> - Add/Edit/Delete files belonging to various access levels.<br>
+</ul>
+<?
+ include("../footer.php");
+?>
\ No newline at end of file
Added: trunk/admin/payinstadmin.php
===================================================================
--- trunk/admin/payinstadmin.php (rev 0)
+++ trunk/admin/payinstadmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,172 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ do_step1();
+ } elseif ($action == "edit") {
+ do_edit();
+ } elseif ($action == "add") {
+ do_add();
+ } elseif ($action == "update") {
+ do_update();
+ do_step1();
+ } elseif ($action == "insert") {
+ do_insert();
+ do_step1();
+ } elseif ($action == "disable") {
+ do_able("N");
+ do_step1();
+ } elseif ($action == "enable") {
+ do_able("Y");
+ do_step1();
+ }
+
+ include("../footer.php");
+?>
+
+<?
+function do_step1 () {
+ global $conn;
+ $result = pg_Exec($conn, "SELECT * from paymentinstrument order by visible desc, description");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+ <a href="payinstadmin.php?action=add">New Payment Instrument</a><br>
+
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+<table border=1 cellpadding=3>
+<?
+if ($row->visible == "N") {
+?>
+<tr>
+ <td>
+ Status:
+ </td>
+ <td>
+ <font color="red">This payment instrument is disabled</font>
+ </td>
+</tr>
+<?
+}
+?>
+<tr>
+ <td>
+ Payment Instrument:
+ </td>
+ <td>
+ <?echo $row->description;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Functions:
+ </td>
+ <td>
+ <a href="payinstadmin.php?action=edit&paymentinstrument=<?echo $row->paymentinstrument;?>">Edit this Payment Instrument</a><br>
+ <?
+ if ($row->visible == "Y") {
+ ?>
+ <a href="payinstadmin.php?action=disable&paymentinstrument=<?echo $row->paymentinstrument;?>">Disable this Payment Instrument</a>
+ <?
+ } else {
+ ?>
+ <a href="payinstadmin.php?action=enable&paymentinstrument=<?echo $row->paymentinstrument;?>">Enable this Payment Instrument</a>
+ <?
+ }
+ ?>
+ </td>
+</tr>
+</table>
+<?
+ $x++;
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $paymentinstrument;
+ $result = pg_Exec($conn, "SELECT * from paymentinstrument where paymentinstrument = $paymentinstrument");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = pg_fetch_object ($result, 0);
+?>
+
+<form action="payinstadmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="paymentinstrument" value="<?echo $row->paymentinstrument;?>">
+<table border=0>
+<tr>
+ <td>
+ Description:
+ </td>
+ <td>
+ <input type=text name="description" size=50 maxlength=100 value="<?echo $row->description;?>">
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+function do_add () {
+?>
+
+<form action="payinstadmin.php" method="post">
+<input type="hidden" name="action" value="insert">
+<table border=0>
+<tr>
+ <td>
+ Description:
+ </td>
+ <td>
+ <input type=text name="description" size=50 maxlength=100>
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_update() {
+ global $conn, $paymentinstrument, $description;
+ $result = pg_Exec($conn, "UPDATE paymentinstrument SET description = '$description' where paymentinstrument = $paymentinstrument;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_insert() {
+ global $conn, $description;
+ $result = pg_Exec($conn, "INSERT INTO paymentinstrument (description) VALUES ('$description');");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_able($able) {
+ global $conn, $paymentinstrument;
+ $result = pg_Exec($conn, "UPDATE paymentinstrument SET visible = '$able' WHERE paymentinstrument = $paymentinstrument;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Added: trunk/admin/projectadmin.php
===================================================================
--- trunk/admin/projectadmin.php (rev 0)
+++ trunk/admin/projectadmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,279 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ if ($customerid == "") {
+ do_choose_customer();
+ } else {
+ do_step1();
+ }
+ } elseif ($action == "edit") {
+ do_edit();
+ } elseif ($action == "add") {
+ do_add();
+ } elseif ($action == "update") {
+ do_update();
+ do_step1();
+ } elseif ($action == "insert") {
+ do_insert();
+ do_step1();
+ } elseif ($action == "disable") {
+ do_able("N");
+ do_step1();
+ } elseif ($action == "enable") {
+ do_able("Y");
+ do_step1();
+ }
+
+ include("../footer.php");
+?>
+
+<?
+function do_choose_customer () {
+ global $conn;
+ $result = pg_Exec($conn, "SELECT customerid,company_name FROM customer WHERE visible = 'Y' order by company_name");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+<form action="projectadmin.php" method=post>
+Choose the customer to manage projects under:<br><br>
+<select name="customerid">
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+ <option value="<?=$row->customerid?>"> <?echo $row->company_name;?>
+<?
+ $x++;
+ }
+?>
+</select>
+<br><input type=submit value="View Projects">
+</form>
+<?
+
+}
+
+function do_step1 () {
+ global $conn, $customerid;
+ $result = pg_Exec($conn, "SELECT * from projects where customerid = $customerid order by visible desc, name");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+ <a href="projectadmin.php">Change Customer</a><br>
+ <a href="projectadmin.php?action=add&customerid=<?=$customerid?>">New Project</a><br>
+
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+<table border=1 cellpadding=3>
+<?
+if ($row->visible == "N") {
+?>
+<tr>
+ <td>
+ Status:
+ </td>
+ <td>
+ <font color="red">This project is disabled</font>
+ </td>
+</tr>
+<?
+}
+?>
+<tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ <?echo $row->name;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Contact Name:
+ </td>
+ <td>
+ <?echo $row->contactname;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Contact Phone:
+ </td>
+ <td>
+ <?echo $row->contactphone;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Contact Email:
+ </td>
+ <td>
+ <?echo $row->contactemail;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Functions:
+ </td>
+ <td>
+ <a href="projectadmin.php?action=edit&customerid=<?echo $row->customerid;?>&projectid=<?echo $row->projectid;?>">Edit this project</a><br>
+ <?
+ if ($row->visible == "Y") {
+ ?>
+ <a href="projectadmin.php?action=disable&customerid=<?echo $row->customerid;?>&projectid=<?echo $row->projectid;?>">Disable this project</a>
+ <?
+ } else {
+ ?>
+ <a href="projectadmin.php?action=enable&customerid=<?echo $row->customerid;?>&projectid=<?echo $row->projectid;?>">Enable this project</a>
+ <?
+ }
+ ?>
+ </td>
+</tr>
+</table>
+<?
+ $x++;
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $customerid, $projectid;
+ $result = pg_Exec($conn, "SELECT * from projects where projectid = $projectid");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = pg_fetch_object ($result, 0);
+?>
+
+<form action="projectadmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="customerid" value="<?echo $customerid;?>">
+<input type="hidden" name="projectid" value="<?echo $row->projectid;?>">
+<table border=0>
+<tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ <input type=text name="name" size=50 maxlength=100 value="<?echo $row->name;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Contact Name:
+ </td>
+ <td>
+ <input type=text name="contactname" size=50 maxlength=100 value="<?echo $row->contactname;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Contact Phone:
+ </td>
+ <td>
+ <input type=text name="contactphone" size=50 maxlength=100 value="<?echo $row->contactphone;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Contact Email:
+ </td>
+ <td>
+ <input type=text name="contactemail" size=50 maxlength=100 value="<?echo $row->contactemail;?>">
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+function do_add () {
+global $customerid;
+?>
+
+<form action="projectadmin.php" method="post">
+<input type="hidden" name="action" value="insert">
+<input type="hidden" name="customerid" value="<?echo $customerid;?>">
+<table border=0>
+<tr>
+ <td>
+ Name:
+ </td>
+ <td>
+ <input type=text name="name" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ Contact Name:
+ </td>
+ <td>
+ <input type=text name="contactname" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ Contact Phone:
+ </td>
+ <td>
+ <input type=text name="contactphone" size=50 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ Contact Email:
+ </td>
+ <td>
+ <input type=text name="contactemail" size=50 maxlength=100>
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_update() {
+ global $conn, $projectid, $name, $contactname, $contactphone, $contactemail;
+ $result = pg_Exec($conn, "UPDATE projects SET name = '$name', contactname = '$contactname', contactphone = '$contactphone', contactemail = '$contactemail' where projectid = $projectid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_insert() {
+ global $conn, $customerid, $name, $contactname, $contactphone, $contactemail;
+ $result = pg_Exec($conn, "INSERT INTO projects (customerid, name, contactname, contactphone, contactemail) VALUES ($customerid, '$name', '$contactname', '$contactphone', '$contactemail');");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_able($able) {
+ global $conn, $projectid;
+ $result = pg_Exec($conn, "UPDATE projects SET visible = '$able' WHERE projectid = $projectid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Added: trunk/admin/ticketprioradmin.php
===================================================================
--- trunk/admin/ticketprioradmin.php (rev 0)
+++ trunk/admin/ticketprioradmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,196 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ do_step1();
+ } elseif ($action == "edit") {
+ do_edit();
+ } elseif ($action == "add") {
+ do_add();
+ } elseif ($action == "update") {
+ do_update();
+ do_step1();
+ } elseif ($action == "insert") {
+ do_insert();
+ do_step1();
+ } elseif ($action == "disable") {
+ do_able("N");
+ do_step1();
+ } elseif ($action == "enable") {
+ do_able("Y");
+ do_step1();
+ }
+
+ include("../footer.php");
+?>
+
+<?
+function do_step1 () {
+ global $conn;
+ $result = pg_Exec($conn, "SELECT * from prioritycontrol order by visible desc, priority");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+?>
+ <a href="ticketprioradmin.php?action=add">New Ticket Priority</a><br>
+
+<?
+ $x = 0;
+ while ($row = @pg_fetch_object ($result, $x)) {
+?>
+<table border=1 cellpadding=3>
+<?
+if ($row->visible == "N") {
+?>
+<tr>
+ <td>
+ Status:
+ </td>
+ <td>
+ <font color="red">This priority is disabled</font>
+ </td>
+</tr>
+<?
+}
+?>
+<tr>
+ <td>
+ Priority:
+ </td>
+ <td>
+ <?echo $row->priority;?>
+ </td>
+</tr>
+<tr>
+ <td>
+ Description:
+ </td>
+ <td>
+ <?echo $row->description;?>
+ </td>
+</tr>
+<tr>
+ <td valign=top>
+ Functions:
+ </td>
+ <td>
+ <a href="ticketprioradmin.php?action=edit&priority=<?echo $row->priority;?>">Edit this priority</a><br>
+ <?
+ if ($row->visible == "Y") {
+ ?>
+ <a href="ticketprioradmin.php?action=disable&priority=<?echo $row->priority;?>">Disable this priority</a>
+ <?
+ } else {
+ ?>
+ <a href="ticketprioradmin.php?action=enable&priority=<?echo $row->priority;?>">Enable this priority</a>
+ <?
+ }
+ ?>
+ </td>
+</tr>
+</table>
+<?
+ $x++;
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $priority;
+ $result = pg_Exec($conn, "SELECT * from prioritycontrol where priority = $priority");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = pg_fetch_object ($result, 0);
+?>
+
+<form action="ticketprioradmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="priority" value="<?echo $row->priority;?>">
+<table border=0>
+<tr>
+ <td>
+ Priority Number:
+ </td>
+ <td>
+ <input type=text name="newprior" size=3 maxlength=100 value="<?echo $row->priority;?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Description:
+ </td>
+ <td>
+ <input type=text name="description" size=50 maxlength=100 value="<?echo $row->description;?>">
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+function do_add () {
+?>
+
+<form action="ticketprioradmin.php" method="post">
+<input type="hidden" name="action" value="insert">
+<table border=0>
+<tr>
+ <td>
+ Priority Number:
+ </td>
+ <td>
+ <input type=text name="priority" size=3 maxlength=100>
+ </td>
+</tr>
+<tr>
+ <td>
+ Description:
+ </td>
+ <td>
+ <input type=text name="description" size=50 maxlength=100>
+ </td>
+</tr>
+</table>
+<input type="submit" value="Save Changes">
+</form>
+
+<?
+}
+
+function do_update() {
+ global $conn, $priority, $description, $newprior;
+ $result = pg_Exec($conn, "UPDATE prioritycontrol SET description = '$description', priority = '$newprior' where priority = $priority;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_insert() {
+ global $conn, $priority, $description;
+ $result = pg_Exec($conn, "INSERT INTO prioritycontrol (priority,description) VALUES ($priority, '$description');");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_able($able) {
+ global $conn, $priority;
+ $result = pg_Exec($conn, "UPDATE prioritycontrol SET visible = '$able' WHERE priority = $priority;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Added: trunk/admin/ticketstateadmin.php
===================================================================
--- trunk/admin/ticketstateadmin.php (rev 0)
+++ trunk/admin/ticketstateadmin.php 2007-07-20 12:25:58 UTC (rev 2)
@@ -0,0 +1,202 @@
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ if ($action == "") {
+ do_step1();
+ } elseif ($action == "edit") {
+ do_edit();
+ } elseif ($action == "add") {
+ do_add();
+ } e...
[truncated message content] |