simplesheet-commits Mailing List for Simple Sheet
Status: Inactive
Brought to you by:
ronaldmaas
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: <ron...@us...> - 2007-07-25 14:50:51
|
Revision: 10
http://simplesheet.svn.sourceforge.net/simplesheet/?rev=10&view=rev
Author: ronaldmaas
Date: 2007-07-25 07:50:48 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
Reports now open in the same window, rather than opening a separate browser.
Modified Paths:
--------------
trunk/activityreport.php
trunk/cashflowreport.php
trunk/revenuereport.php
Modified: trunk/activityreport.php
===================================================================
--- trunk/activityreport.php 2007-07-25 14:36:55 UTC (rev 9)
+++ trunk/activityreport.php 2007-07-25 14:50:48 UTC (rev 10)
@@ -23,7 +23,7 @@
<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">
+<form action="activityreport.php" method="post">
<input type="hidden" name="nextstep" value="2">
<select name="customerid">
<option value="">All Companies
Modified: trunk/cashflowreport.php
===================================================================
--- trunk/cashflowreport.php 2007-07-25 14:36:55 UTC (rev 9)
+++ trunk/cashflowreport.php 2007-07-25 14:50:48 UTC (rev 10)
@@ -23,7 +23,7 @@
<a href="reports.php">Reports Home</a><br><br>
Please select a company to report on.
-<form action="cashflowreport.php" method="post" target="reportwindow">
+<form action="cashflowreport.php" method="post">
<input type="hidden" name="nextstep" value="2">
<select name="customerid">
<option value="">All Companies
Modified: trunk/revenuereport.php
===================================================================
--- trunk/revenuereport.php 2007-07-25 14:36:55 UTC (rev 9)
+++ trunk/revenuereport.php 2007-07-25 14:50:48 UTC (rev 10)
@@ -23,7 +23,7 @@
<a href="reports.php">Reports Home</a><br><br>
Please select either a company to report on.
-<form action="revenuereport.php" method="post" target="reportwindow">
+<form action="revenuereport.php" method="post">
<input type="hidden" name="nextstep" value="2">
<select name="customerid">
<option value="">All Companies
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ron...@us...> - 2007-07-25 14:36:57
|
Revision: 9
http://simplesheet.svn.sourceforge.net/simplesheet/?rev=9&view=rev
Author: ronaldmaas
Date: 2007-07-25 07:36:55 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
Add quick navigate menu to the top of each page
Modified Paths:
--------------
trunk/header.php
Added Paths:
-----------
trunk/menu.php
Modified: trunk/header.php
===================================================================
--- trunk/header.php 2007-07-25 14:17:03 UTC (rev 8)
+++ trunk/header.php 2007-07-25 14:36:55 UTC (rev 9)
@@ -9,3 +9,8 @@
<title>NewCo Administration</title>
</head>
<body bgcolor="#ffffff">
+<?php
+if ($_SESSION["loggedin"] == "YEPPERS") {
+ include_once("menu.php");
+}
+?>
Added: trunk/menu.php
===================================================================
--- trunk/menu.php (rev 0)
+++ trunk/menu.php 2007-07-25 14:36:55 UTC (rev 9)
@@ -0,0 +1,6 @@
+<hr />
+<a href="admin/index.php">Administration</a> |
+<a href="billing.php">Billing</a> |
+<a href="ticketing.php">Ticketing</a> |
+<a href="reports.php">Reports</a>
+<hr />
Property changes on: trunk/menu.php
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ron...@us...> - 2007-07-25 14:17:06
|
Revision: 8
http://simplesheet.svn.sourceforge.net/simplesheet/?rev=8&view=rev
Author: ronaldmaas
Date: 2007-07-25 07:17:03 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
Correct the check for billable items
Modified Paths:
--------------
trunk/activityreport.php
trunk/listinvoice.php
Modified: trunk/activityreport.php
===================================================================
--- trunk/activityreport.php 2007-07-25 10:19:31 UTC (rev 7)
+++ trunk/activityreport.php 2007-07-25 14:17:03 UTC (rev 8)
@@ -327,7 +327,7 @@
</td>
<td bgcolor="<? echo $bgcolor;?>" valign=top align=right>
<?php
- if ($row["billable"] == "t") {
+ if ($row["billable"] == "Y") {
$moneytotal += $row["timespent"] * $row["rate"];
?>
$<?php echo number_format(($row["timespent"] * $row["rate"]),2); ?>
Modified: trunk/listinvoice.php
===================================================================
--- trunk/listinvoice.php 2007-07-25 10:19:31 UTC (rev 7)
+++ trunk/listinvoice.php 2007-07-25 14:17:03 UTC (rev 8)
@@ -339,7 +339,7 @@
</tr>
<?php
- $bfamt += $bfRow->amountdue;
+ $bfamt += $bfRow["amountdue"];
if ($bgcolor == "#FFFFFF") {
$bgcolor = "#DDDDDD";
} else {
@@ -544,7 +544,7 @@
</td>
<td bgcolor="<?php echo $bgcolor;?>" valign=top align=right>
<?php
- if ($detailrow["billable"] == "y") {
+ if ($ticketRow["billable"] == "Y") {
?>
$<?php printf ("%01.2f", ($ticketRow["timespent"] * $ticketRow["rate"])); ?>
<?php
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ron...@us...> - 2007-07-25 10:19:33
|
Revision: 7
http://simplesheet.svn.sourceforge.net/simplesheet/?rev=7&view=rev
Author: ronaldmaas
Date: 2007-07-25 03:19:31 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
Change the various reports to be in a runnable state, contents still needs to be checked
Modified Paths:
--------------
trunk/cashflowreport.php
trunk/oireport.php
trunk/revenuereport.php
Modified: trunk/cashflowreport.php
===================================================================
--- trunk/cashflowreport.php 2007-07-25 10:18:35 UTC (rev 6)
+++ trunk/cashflowreport.php 2007-07-25 10:19:31 UTC (rev 7)
@@ -87,13 +87,13 @@
<option value="31">31
</select>
<select name="year">
- <option value="2000">2006
- <option value="2001">2007
- <option value="2002">2008
- <option value="2003">2009
- <option value="2004">2010
- <option value="2005">2011
- <option value="2006">2012
+ <option value="2006">2006
+ <option value="2007">2007
+ <option value="2008">2008
+ <option value="2009">2009
+ <option value="2010">2010
+ <option value="2011">2011
+ <option value="2012">2012
</select></td></tr>
<tr><td>To:</td><td><select name="month2">
<option value="1">January
@@ -143,13 +143,13 @@
<option value="31">31
</select>
<select name="year2">
- <option value="2000">2006
- <option value="2001">2007
- <option value="2002">2008
- <option value="2003">2009
- <option value="2004">2010
- <option value="2005">2011
- <option value="2006">2012
+ <option value="2006">2006
+ <option value="2007">2007
+ <option value="2008">2008
+ <option value="2009">2009
+ <option value="2010">2010
+ <option value="2011">2011
+ <option value="2012">2012
</select>
</td></tr></table>
<br><br>
@@ -225,7 +225,7 @@
$grandtotal = 0;
$result2 = mysql_data_seek($result, 0);
while ($row = mysql_fetch_array($result)) {
- $grandtotal += $row->paymentamount;
+ $grandtotal += $row["paymentamount"];
?>
<tr>
<td bgcolor=#000000 width="1">
Modified: trunk/oireport.php
===================================================================
--- trunk/oireport.php 2007-07-25 10:18:35 UTC (rev 6)
+++ trunk/oireport.php 2007-07-25 10:19:31 UTC (rev 7)
@@ -55,7 +55,7 @@
$customerid_SQL = "AND invoicemaster.customerid = $customerid";
}
- $result = mysql_query("SELECT invoiceheader.company_name as invoicename, customer.company_name,invoicemaster.customerid, invoicemaster.invoicenumber, invoicemaster.grandtotal,invoicemaster.invoicedate,invoicemaster.grandtotal - (SELECT coalesce(sum(paymentamount),0) FROM payments WHERE invoicenumber = invoicemaster.invoicenumber) AS amountdue from customer,invoicemaster,invoiceheader where invoicemaster.paystatus = 'PEND' AND invoiceheader.headerid = invoicemaster.headerid $company_id_SQL AND customer.customerid = invoicemaster.customerid ORDER BY invoicenumber;");
+ $result = mysql_query("SELECT invoiceheader.company_name as invoicename, customer.company_name,invoicemaster.customerid, invoicemaster.invoicenumber, invoicemaster.grandtotal,invoicemaster.invoicedate,invoicemaster.grandtotal - (SELECT coalesce(sum(paymentamount),0) FROM payments WHERE invoicenumber = invoicemaster.invoicenumber) AS amountdue from customer,invoicemaster,invoiceheader where invoicemaster.paystatus = 'PEND' AND invoiceheader.headerid = invoicemaster.headerid $customerid_SQL AND customer.customerid = invoicemaster.customerid ORDER BY invoicenumber;");
if (!$result) {
echo "An Error Occurred.";
Modified: trunk/revenuereport.php
===================================================================
--- trunk/revenuereport.php 2007-07-25 10:18:35 UTC (rev 6)
+++ trunk/revenuereport.php 2007-07-25 10:19:31 UTC (rev 7)
@@ -173,9 +173,9 @@
if ($customerid != "") {
$companyWhere = " AND invoicemaster.customerid = $customerid ";
}
-
- $result = mysql_query("SELECT invoiceheader.company_name as invoicename, customer.company_name,invoicemaster.customerid, invoicemaster.paystatus, invoicemaster.invoicenumber, invoicemaster.grandtotal,invoicemaster.invoicedate from customer,invoicemaster where invoiceheader.headerid = invoicemaster.headerid $companyWhere AND customer.customerid = invoicemaster.customerid AND (invoicemaster.invoicedate BETWEEN '$month/$day/$year' AND '$month2/$day2/$year2 11:59:59 PM') ORDER BY invoicenumber;");
+ $result = mysql_query("SELECT invoiceheader.company_name as invoicename, customer.company_name,invoicemaster.customerid, invoicemaster.paystatus, invoicemaster.invoicenumber, invoicemaster.grandtotal,invoicemaster.invoicedate from customer,invoicemaster,invoiceheader where invoiceheader.headerid = invoicemaster.headerid $companyWhere AND customer.customerid = invoicemaster.customerid AND (invoicemaster.invoicedate BETWEEN '$year-$month-$day' AND '$year2-$month2-$day 23:59:59') ORDER BY invoicenumber;");
+
if (!$result) {
echo "An Error Occurred.";
exit;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ron...@us...> - 2007-07-25 10:18:36
|
Revision: 6
http://simplesheet.svn.sourceforge.net/simplesheet/?rev=6&view=rev
Author: ronaldmaas
Date: 2007-07-25 03:18:35 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
Correct header to new local setup
Modified Paths:
--------------
trunk/header.php
Modified: trunk/header.php
===================================================================
--- trunk/header.php 2007-07-25 10:17:29 UTC (rev 5)
+++ trunk/header.php 2007-07-25 10:18:35 UTC (rev 6)
@@ -1,6 +1,6 @@
<?php
- $ROOT_INCLUDE_DIR = "C:/work/tams/tams_cvs/tams/";
+ $ROOT_INCLUDE_DIR = "C:/work/simplesheet/";
require($ROOT_INCLUDE_DIR . "db.php");
require($ROOT_INCLUDE_DIR . "styles.php");
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ron...@us...> - 2007-07-25 10:17:32
|
Revision: 5
http://simplesheet.svn.sourceforge.net/simplesheet/?rev=5&view=rev
Author: ronaldmaas
Date: 2007-07-25 03:17:29 -0700 (Wed, 25 Jul 2007)
Log Message:
-----------
Rework the sql to be compatible with MySQL and make the script re-runnable
Modified Paths:
--------------
trunk/tickettrack.sql
Modified: trunk/tickettrack.sql
===================================================================
--- trunk/tickettrack.sql 2007-07-21 11:28:35 UTC (rev 4)
+++ trunk/tickettrack.sql 2007-07-25 10:17:29 UTC (rev 5)
@@ -1,4 +1,4 @@
--- Time Accounting Management Software (TAMS) SQL
+
-- Branden R. Williams
--
-- First off, you should really read through this before you blindly run
@@ -17,6 +17,37 @@
-- createlang pltclu tams
-- psql tams
+-- drop functions
+
+drop function groupEventFee;
+drop function getGroupHours;
+drop function singleEventFee;
+drop function getEventHours;
+drop function getHoursTotal;
+
+-- drop tables
+
+drop table access_levels;
+drop table agents;
+drop table billtypecontrol;
+drop table customer;
+drop table eventcontrol;
+drop table invoicedetail;
+drop table invoiceheader;
+drop table invoicemaster;
+drop table paymentinstrument;
+drop table payments;
+drop table prioritycontrol;
+drop table products;
+drop table projects;
+drop table security;
+drop table tempinvoice;
+drop table ticket;
+drop table ticketagentcontrol;
+drop table ticketevent;
+drop table ticketstatecontrol;
+drop table ticketstobill;
+
CREATE TABLE eventcontrol (
eventtype serial PRIMARY KEY NOT NULL,
description VARCHAR(100) NOT NULL,
@@ -270,7 +301,7 @@
-- Any initial agents you wish to add. Be sure to get the UNIX Crypt
-- of their password in order to make it work!!
-insert into agents (name,email,login,password) values ('Branden R. Williams','br...@fl...','brw','GQg84UkSX5kYI');
+insert into agents (name,email,login,password) values ('Ronald Maas','ro...@th...','rxm','G0dxEYlNUkIkA');
-- Initial defaults.
insert into billtypecontrol (description,billable) values ('Bid Project','Y');
@@ -353,7 +384,6 @@
delimiter |
-drop function groupEventFee|
create function groupEventFee(pi integer,si text) returns real
reads sql data
BEGIN
@@ -363,7 +393,6 @@
END|
-drop function getGroupHours|
create function getGroupHours(pi integer,si text) returns real
reads sql data
BEGIN
@@ -372,7 +401,6 @@
return result;
END|
-drop function singleEventFee|
create function singleEventFee(tn integer) returns real
reads sql data
BEGIN
@@ -382,7 +410,6 @@
END|
-drop function getEventHours|
create function getEventHours(tn integer) returns real
reads sql data
BEGIN
@@ -391,7 +418,6 @@
return result;
END|
-drop function getHoursTotal|
create function getHoursTotal(tn integer) returns real
reads sql data
BEGIN
@@ -400,6 +426,7 @@
return result;
END|
+/*
-- STORED PROCS FOR AUTOMATED EMAIL SYSTEM
drop function emailUpdate();
@@ -505,3 +532,5 @@
close $mySock
return 1'
language 'pltclu';
+
+*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ron...@us...> - 2007-07-21 11:28:38
|
Revision: 4
http://simplesheet.svn.sourceforge.net/simplesheet/?rev=4&view=rev
Author: ronaldmaas
Date: 2007-07-21 04:28:35 -0700 (Sat, 21 Jul 2007)
Log Message:
-----------
Intermediate commit. Work in progress to get a working copy suitable for demo purposes.
Modified Paths:
--------------
trunk/activityreport.php
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
Modified: trunk/activityreport.php
===================================================================
--- trunk/activityreport.php 2007-07-20 12:48:26 UTC (rev 3)
+++ trunk/activityreport.php 2007-07-21 11:28:35 UTC (rev 4)
@@ -1,358 +1,382 @@
-<?
- 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);
-}
-?>
+<?php
+
+ include("header.php");
+
+ $nextstep = $_REQUEST["nextstep"];
+
+ if ($nextstep == "") {
+ do_step1();
+ } elseif ($nextstep == "2") {
+ do_step2();
+ }
+
+ include("footer.php");
+
+ function do_step1 () {
+ $result = mysql_query( "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
+<?php
+ while($row = mysql_fetch_array($result)) {
+?>
+ <option value="<? echo $row["customerid"]; ?>"><? echo $row["company_name"]; ?>
+<?php
+ }
+?>
+
+</select>
+<br>
+<select name="agentid">
+<option value="">All Agents
+<?php
+ $result = mysql_query("SELECT agentid,name from agents order by name");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ while($row = mysql_fetch_array($result)) {
+?>
+ <option value="<? echo $row["agentid"]; ?>"><? echo $row["name"]; ?>
+<?php
+ }
+?>
+
+</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="2006">2006
+ <option value="2007">2007
+ <option value="2008">2008
+ <option value="2009">2009
+ <option value="2010">2010
+ <option value="2011">2011
+ <option value="2012">2012
+</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="2006">2006
+ <option value="2007">2007
+ <option value="2008">2008
+ <option value="2009">2009
+ <option value="2010">2010
+ <option value="2011">2011
+ <option value="2012">2012
+</select>
+</td></tr></table>
+<br><br>
+<input type="submit" value="Generate Report">
+</form>
+
+<?php
+
+ }
+
+ function do_step2 () {
+
+ $agentid = $_REQUEST["agentid"];
+ $month = $_REQUEST["month"];
+ $day = $_REQUEST["day"];
+ $year = $_REQUEST["year"];
+ $month2 = $_REQUEST["month2"];
+ $day2 = $_REQUEST["day2"];
+ $year2 = $_REQUEST["year2"];
+ $customerid = $_REQUEST["customerid"];
+
+ if ($agentid != "") {
+ $agentWhere = " AND ticketevent.agentid = $agentid ";
+ }
+ if ($customerid != "") {
+ $companyWhere = " AND customer.customerid = $customerid ";
+ }
+ $result = mysql_query( "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,agents 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 '$year-$month-$day' AND '$year2-$month2-$day2 23:59:59') AND ticketevent.ticketnumber = ticket.ticketnumber ORDER BY ticketevent.timestamp");
+
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+
+ if (mysql_num_rows($result) == 0) {
+ echo "There was no activity for that agent during that timeframe.";
+ exit;
+ }
+ $linecount = 0;
+?>
+
+<center>
+<!--<img src="latuslogo.jpg"><br>-->
+<?php
+ $row = mysql_fetch_array($result);
+ if ($customerid != "") {echo "<font size=+2><b>".$row["company_name"]."</b></font><br>";}
+ if ($agentid != "") {echo "<font size=+2><b>".$row["name"]."</b></font><br>";}
+?>
+<b>Activity Report</b><br>
+<?php
+ 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>
+<?php
+ $bgcolor = "#FFFFFF";
+ $moneytotal = 0;
+ $timetotal = 0;
+ $result2 = mysql_data_seek($result, 0);
+ while($row = mysql_fetch_array($result)) {
+ $timetotal += $row["timespent"];
+?>
+<tr>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<?php echo $bgcolor;?>" valign=top>
+
+<?php
+ 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="<?php echo $bgcolor;?>" valign=top align=middle>
+ <a href="showticket.php?ticketnumber=<?php echo $row["ticketnumber"]; ?>"><?php echo $row["ticketnumber"]; ?></a>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<?php echo $bgcolor;?>" width="5">
+ </td>
+ <td bgcolor="<?php echo $bgcolor;?>" valign=top>
+ <b>
+<?php
+ if ($agentid == "") {
+ echo $row["name"];
+ }?>
+ </b>
+<?php
+ 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><?php echo $row["taskdescription"];?>
+ </b> - <?php echo $row["customerdetail"];?>
+ </td>
+ <td bgcolor="<?php echo $bgcolor;?>" width="5">
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<?php echo $bgcolor;?>" valign=top align=middle>
+ <?php echo $row["timespent"]; ?>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td bgcolor="<? echo $bgcolor;?>" valign=top align=right>
+<?php
+ if ($row["billable"] == "t") {
+ $moneytotal += $row["timespent"] * $row["rate"];
+?>
+ $<?php echo number_format(($row["timespent"] * $row["rate"]),2); ?>
+<?php
+ } else {
+?>
+ N/A
+<?php
+ }
+?>
+ </td>
+</tr>
+<?php
+ 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><?php echo $timetotal;?></b>
+ </td>
+ <td bgcolor=#000000 width="1">
+ </td>
+ <td valign=right bgcolor="#ffffff" align=right>
+ <b>$<?php 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>
+
+<?php
+}
+?>
Modified: trunk/admin/accessgroupadmin.php
===================================================================
--- trunk/admin/accessgroupadmin.php 2007-07-20 12:48:26 UTC (rev 3)
+++ trunk/admin/accessgroupadmin.php 2007-07-21 11:28:35 UTC (rev 4)
@@ -1,171 +1,180 @@
-<?
- 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;
- }
-}
-
-?>
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ $action = $_REQUEST["action"];
+ $formaccess_level = $_REQUEST["formaccess_level"];
+ $description = $_REQUEST["description"];
+ $newaccess_level = $_REQUEST["newaccess_level"];
+ $access_level = $_REQUEST["access_level"];
+ 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 = mysql_query("SELECT * from access_levels order by access_level");
+ #$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 = mysql_fetch_array ($result)) {
+?>
+<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>
+<?
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $formaccess_level;
+ $result = mysql_query("SELECT * from access_levels where access_level = $formaccess_level");
+ #$result = pg_Exec($conn, "SELECT * from access_levels where access_level = $formaccess_level");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = mysql_fetch_array ($result);
+?>
+
+<form action="accessgroupadmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="access_level" 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, $access_level, $description, $newaccess_level;
+ $result = mysql_query("UPDATE access_levels SET description = '$description', access_level = '$newaccess_level' where access_level = $access_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 = mysql_query("INSERT INTO access_levels (access_level, description) VALUES ('$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 = mysql_query("DELETE FROM access_levels WHERE access_level = $formaccess_level;");
+ #$result = pg_Exec($conn, "DELETE FROM access_levels WHERE access_level = $formaccess_level;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Modified: trunk/admin/accessgroupfileadmin.php
===================================================================
--- trunk/admin/accessgroupfileadmin.php 2007-07-20 12:48:26 UTC (rev 3)
+++ trunk/admin/accessgroupfileadmin.php 2007-07-21 11:28:35 UTC (rev 4)
@@ -1,180 +1,187 @@
-<?
- 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;
- }
-}
-
-?>
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ $action = $_REQUEST["action"];
+ $formaccess_level = $_REQUEST["formaccess_level"];
+ $secureid = $_REQUEST["secureid"];
+ $access_level = $_SESSION["access_level"];
+ $scriptname = $_REQUEST["scriptname"];
+ 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 = mysql_query("SELECT * FROM access_levels WHERE access_level >= $access_level order by 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">
+<?
+ while ($row = mysql_fetch_array ($result)) {
+?>
+ <option value="<?=$row["access_level"]?>"> <?echo $row["description"];?>
+<?
+ }
+?>
+</select>
+<br><input type=submit value="View Projects">
+</form>
+<?
+
+}
+
+function do_step1 () {
+ global $conn, $formaccess_level;
+ $result = mysql_query("SELECT * from security WHERE access_level = $formaccess_level order by scriptname");
+ #$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>
+
+<?
+ while ($row = mysql_fetch_array ($result)) {
+?>
+<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>
+<?
+ }
+?>
+
+<?
+
+}
+
+function do_edit () {
+ global $conn, $formaccess_level, $secureid;
+ $result = mysql_query("SELECT * from security where secureid = $secureid");
+ #$result = pg_Exec($conn, "SELECT * from security where secureid = $secureid");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = mysql_fetch_array ($result);
+?>
+
+<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="scriptname" 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 = mysql_query("UPDATE security SET scriptname = '$scriptname' where secureid = $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 = mysql_query("INSERT INTO security (access_level, scriptname) VALUES ($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 = mysql_query("DELETE FROM security WHERE secureid = $secureid;");
+ #$result = pg_Exec($conn, "DELETE FROM security WHERE secureid = $secureid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Modified: trunk/admin/agentadmin.php
===================================================================
--- trunk/admin/agentadmin.php 2007-07-20 12:48:26 UTC (rev 3)
+++ trunk/admin/agentadmin.php 2007-07-21 11:28:35 UTC (rev 4)
@@ -1,323 +1,329 @@
-<?
- 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;
- }
-}
-
-?>
+<?
+ include("../header.php");
+?>
+<a href="index.php">Admin Home</a><br><br>
+<?
+ $action = $_REQUEST["action"];
+ $agentid = $_REQUEST["agentid"];
+ 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 ($_REQUEST["pass1"] == $_REQUEST["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 = mysql_query( "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>
+
+<?
+ while ($row = mysql_fetch_array ($result)) {
+?>
+<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>
+<?
+ }
+?>
+
+<?
+
+}
+
+function do_edit ($error) {
+ global $conn, $agentid;
+
+ if (strlen($error) > 3) {
+ echo "$error<br><br>";
+ }
+
+ $result = mysql_query( "SELECT * from agents where agentid = $agentid");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+ $row = mysql_fetch_array ($result);
+?>
+
+<form action="agentadmin.php" method="post">
+<input type="hidden" name="action" value="update">
+<input type="hidden" name="agentid" value="<?echo $row["agentid"];?>">
+<input type="hidden" name="oldlogin" value="<?php echo $row["login"]; ?>">
+<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="<?php print($_REQUEST["name"]);?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Email:
+ </td>
+ <td>
+ <input type=text name="email" size=50 maxlength=100 value="<?php print($_REQUEST["email"]);?>">
+ </td>
+</tr>
+<tr>
+ <td>
+ Login:
+ </td>
+ <td>
+ <input type=text name="login" size=50 maxlength=100 value="<?php print($_REQUEST["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 = mysql_query( "SELECT agentid from agents where login = '".$_POST['login']."';");
+ if (mysql_num_rows($result) != 0) {
+ do_edit("Duplicate Userid, retry.");
+ exit;
+ }
+ }
+ $result = mysql_query( "UPDATE agents SET name = '".$_REQUEST["name"]."', email = '".$_REQUEST["email"]."', login = '".$_REQUEST["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 = mysql_query( "SELECT agentid from agents where login = '".$_POST['login']."';");
+ if (mysql_num_rows($result) != 0) {
+ do_add("Duplicate Userid");
+ exit;
+ } else {
+ $result = mysql_query( "INSERT INTO agents (name, email, login, password) VALUES ('".$_REQUEST["name"]."', '".$_REQUEST["email"]."', '".$_REQUEST["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 = mysql_query( "UPDATE agents SET password = '$encpass' WHERE agentid = $agentid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+function do_able($able) {
+ global $conn, $agentid;
+ $result = mysql_query( "UPDATE agents SET visible = '$able' WHERE agentid = $agentid;");
+ if (!$result) {
+ echo "An Error Occurred.";
+ exit;
+ }
+}
+
+?>
Modified: trunk/admin/customeradmin.php
===================================================================
--- trunk/admin/customeradmin.php 2007-07-20 12:48:26 UTC (rev 3)
+++ trunk/admin/customeradmin.php 2007-07-21 11:28:35 UTC (rev 4)
@@ -1,479 +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>
- <...
[truncated message content] |
|
From: <ron...@us...> - 2007-07-20 12:48:33
|
Revision: 3
http://simplesheet.svn.sourceforge.net/simplesheet/?rev=3&view=rev
Author: ronaldmaas
Date: 2007-07-20 05:48:26 -0700 (Fri, 20 Jul 2007)
Log Message:
-----------
Tagging the starting point for simplesheet. This is based on the latest tams code from the tams CVS repository on SourceForge
Added Paths:
-----------
tag/simplesheet-base/
Copied: tag/simplesheet-base (from rev 2, trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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] |