From 7368a2297570a01331ed2c4c0f8cddf6403c4b01 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 25 Jan 2005 16:44:25 +0000 Subject: [PATCH] Add committee page and committees management make committee management fully XHTML compliant --- admin/committees.php | 445 +++++++++++++++++++++++++++++++++++++++++++ admin/index.php | 1 + committee.php | 109 +++++++++++ common.inc.php | 7 +- images/16/undo.gif | Bin 0 -> 516 bytes images/16/undo.png | Bin 0 -> 585 bytes 6 files changed, 559 insertions(+), 3 deletions(-) create mode 100644 admin/committees.php create mode 100644 committee.php create mode 100644 images/16/undo.gif create mode 100644 images/16/undo.png diff --git a/admin/committees.php b/admin/committees.php new file mode 100644 index 00000000..06b5d60a --- /dev/null +++ b/admin/committees.php @@ -0,0 +1,445 @@ + + Copyright (C) 2005 James Grant + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +?> + + + + +\n"; + } + */ + + //print_r($config); + + if($config['committees_executeonsave']) + { + echo happy(i18n("Executing:").$config['committees_executeonsave']); + system($config['committees_executeonsave']); + } + + echo happy(i18n("Committee member saved")); + +} + +if($_POST['action']=="edit") +{ + $edit=$_POST['committees_members_id']; +} + +if($_GET['edit'] || $edit) +{ + if($_GET['edit']) + $e=$_GET['edit']; + else + $e=$edit; + $q=mysql_query("SELECT * FROM committees_members WHERE id='$e'"); + $r=mysql_fetch_object($q); + echo "

Edit Committee Member

"; + echo "<< Back to Committees Editor\n"; + +// echo "
\n"; + echo "\n"; + echo "\n"; + + + echo ""; +// echo "\n"; + echo "\n"; + echo "
"; + +// echo ""; + + echo ""; + + $cq=mysql_query("SELECT committees.name, committees.id, committees_link.title, committees_link.ord FROM committees,committees_link WHERE committees_link.committees_id=committees.id AND committees_link.committees_members_id='$e' ORDER BY committees.name"); + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; +// echo "\n"; +// echo "
Name:name\">
Committees:"; + if(mysql_num_rows($cq)) + { + echo ""; + echo ""; + while($cr=mysql_fetch_object($cq)) + { + echo ""; + } + + echo "
CommitteeTitle in CommitteeOrder
$cr->nameid]\" value=\"$cr->title\" />id]\" value=\"$cr->ord\" size=3>
"; + } + else + echo "None"; + echo "
Organization:organization\" />
Email (Public):email\" />
Email (Private):emailprivate\" />
Display Emails:"; + if($r->displayemail=="N") $checked="checked=\"checked\""; else $checked=""; + echo "No"; + echo "     "; + if($r->displayemail=="Y") $checked="checked=\"checked\""; else $checked=""; + echo "Yes"; + + echo "
Phone (Home):phonehome\" />
Phone (Work):phonework\" />
Phone (Cell):phonecell\" />
Fax:fax\">
Picture:
"; + +// echo "
"; + +// if(file_exists($_SERVER['DOCUMENT_ROOT']."/board/".$r->id."-thumb.jpg")) +// echo "id."-thumb.jpg\" border=\"0\">"; +// else +// echo "No Picture"; + +// echo "
"; + echo "

"; + echo "\n"; + echo "
\n"; + + echo "
\n"; +} +else +{ + + echo ""; + echo ""; + echo "
"; + + echo "

Add Committee

\n"; + echo "
\n"; + echo "\n"; + echo ""; + echo " \n"; + echo "
Committee Name:
\n"; + echo "
\n"; + + echo "
 "; + + echo "

Add Committee Member

\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
Member Name: "; + echo "\n"; + echo "
\n"; + echo "
\n"; + + echo "
"; + + + echo "
"; + echo "

Committee Member Management

\n"; + echo "
\n"; + echo ""; + echo ""; + + echo "
"; + echo ""; + + echo ""; + $q=mysql_query("SELECT * FROM committees_members ORDER BY name"); + echo ""; + + echo ""; + + + //The Assign Div + echo "
"; + echo "To Committee: "; + $q=mysql_query("SELECT * FROM committees ORDER BY ord,name"); + echo ""; + echo "
"; + + + //The Edit or Remove Div + + echo "
"; + echo "
"; + + echo ""; + echo "
"; + + + $q=mysql_query("SELECT * FROM committees ORDER BY ord,name"); + if(mysql_num_rows($q)) + { + echo "

Committees

"; + echo "
\n"; + echo ""; + while($r=mysql_fetch_object($q)) + { + echo ""; + echo "\n"; + echo mysql_error(); + while($r2=mysql_fetch_object($q2)) + { + echo ""; + echo "\n"; + } + echo "\n"; + } + echo "\n"; + echo "
"; + echo "id\" />"; + echo "ord\" />"; + echo "  $r->name"; + + $q2=mysql_query("SELECT ". + "committees_members.id,". + "committees_members.name,". + "committees_members.email,". + "committees_members.emailprivate,". + "committees_link.title, ". + "committees_link.ord ". + "FROM committees_members, committees_link ". + "WHERE committees_link.committees_members_id=committees_members.id ". + " AND committees_link.committees_id='$r->id'". + " ORDER BY ord,name"); + if(mysql_num_rows($q2)==0) + { + echo "   "; + echo "id\">\"Remove"; + } + + echo "
    "; + echo "id\">\"Edit\""; + echo " "; + echo "id&unlinkcommittee=$r->id\">\"Unlink\""; + echo ""; + echo " $r2->name"; + + if($r2->title) echo " - $r2->title    "; + + echo ""; + + if($r2->email) + { + list($b,$a)=split("@",$r2->email); + echo ""; + } + + if($r2->emailprivate) + { + if($r2->email) echo " / "; + list($b,$a)=split("@",$r2->emailprivate); + echo ""; + } + + echo "
 
"; + echo "
\n"; + } +} + +send_footer(); +?> + diff --git a/admin/index.php b/admin/index.php index 15791f5d..2320fb5a 100644 --- a/admin/index.php +++ b/admin/index.php @@ -28,6 +28,7 @@ echo "Participant Registration
"; echo "Printable Reports
"; + echo "Committee Management
"; send_footer(); ?> diff --git a/committee.php b/committee.php new file mode 100644 index 00000000..39a1a373 --- /dev/null +++ b/committee.php @@ -0,0 +1,109 @@ + + Copyright (C) 2005 James Grant + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +?> +id'". + " ORDER BY ord,name"); + + + //if there's nobody in this committee, then just skip it and go on to the next one. + if(mysql_num_rows($q2)==0) + continue; + + echo ""; + echo "

$r->name

"; + echo "\n"; + + echo mysql_error(); + while($r2=mysql_fetch_object($q2)) + { + $output=$config['committee_publiclayout']; + + $output=str_replace("name",$r2->name,$output); + $output=str_replace("title",$r2->title,$output); + + //make sure we do emailprivate before email so we dont match the wrong thing + if($r2->emailprivate && $r2->displayemail=='Y') + { + list($b,$a)=split("@",$r2->emailprivate); + $output=str_replace("emailprivate","",$output); + } + else + $output=str_replace("emailprivate","",$output); + + if($r2->email && $r2->displayemail=='Y') + { + list($b,$a)=split("@",$r2->email); + $output=str_replace("email","",$output); + } + else + $output=str_replace("email","",$output); + + $output=str_replace("phonehome",$r2->phonehome,$output); + $output=str_replace("phonework",$r2->phonework,$output); + $output=str_replace("phonecell",$r2->phonecell,$output); + $output=str_replace("fax",$r2->fax,$output); + + echo $output; + + + /* + echo ""; + echo "    $r2->name"; + echo ""; + if($r2->title) echo "    $r2->title"; + else echo " "; + echo ""; + if($r2->email) + { + echo "     "; + list($b,$a)=split("@",$r2->email); + echo ""; + } + else + echo " "; + + echo "\n"; + */ + } + echo " \n"; + } + echo ""; + + send_footer(); +?> diff --git a/common.inc.php b/common.inc.php index 375b51d4..74251a73 100644 --- a/common.inc.php +++ b/common.inc.php @@ -185,6 +185,7 @@ function send_header($title="")