Showcase_rtns_PHP

This PHP script contains the main routines for the Contacts page server side PHP program.

This page contains only the sections that pertain to the Contact page.

    1| <?php
    2| 
    3|     //The header for the Showcase site pages.
    4|     function pageHeader($strSpaces, $strTitle, $intShow, $GenericArray)
    5|     {
    6|         echo "<!DOCTYPE HTML PUBLIC\"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n";
    7|         echo "<html>\n";
    8|         echo "<head>\n";
    9|         echo "<!--[if gt IE 8]>\n";
  10|         echo "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE9\" >\n";
  11|         echo "<![endif]-->\n";
  12|         echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n";
  13|         echo "<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"".$strSpaces."images/favicon.ico\">\n";
  14|         echo "<meta name=\"author\" content=\"Keith Gallistel\">\n";
  15|         echo "<meta name=\"keywords\" content=\"Keith Gallistel, Northcentral Technical College, computer programming, programming, web design, NTC, University of Wisconsin, UW-Stout, Stout, resume, portfolio\">\n";
  16|         echo "<title>".$strTitle." - Keith Gallistel's Showcase Site</title>\n";
  17|         echo "<link rel=\"stylesheet\" media=\"screen\" type=\"text/css\" href=\"".$strSpaces."scripts/showcase_css.css\">\n";
  18|         echo "<!--[if lt IE 7]>\n";
  19|         echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$strSpaces."scripts/showcaseIESIX_css.css\" />\n";
  20|         echo "<![endif]-->\n";

  26|         //For handling Contact CSS. Please leave 0 for blank.
  27|         if($intShow ==2)
  28|         {
  29|             HeaderContactCSSSheet();
  30|         }
  31| 
  32|         //For handling Contact validation CSS. Please leave 0 for blank.
  33|         if($intShow ==2)
  34|         {
  35|             HeaderContactCSS($GenericArray);
  36|         }

  44|         echo "<link rel=\"stylesheet\" media=\"print\" type=\"text/css\" href=\"".$strSpaces."scripts/showcaseprint_css.css\">\n";

  52|         //For handling Contact validation JavaScript and Contact reset button switch JavaScript. Please leave 0 for blank.
  53|         if($intShow ==2)
  54|         {
  55|             HeaderJSValidate();
  56|             HeaderJSSwitch();
  57|         }

  72|         echo "<script type=\"text/javascript\" src=\"".$strSpaces."scripts/general_js.js\">\n";
  73|         echo "</script>\n";
  74| 
  75|         echo "</head>\n";
  76|         echo "<body>\n";

  88|         echo "<div id=\"container\">\n";
  89| 
  90|     }
  91| 
  92|     //****************************************************************************
  93|     //End of pageHeader Beginning of pageHeader Functions
  94|     //****************************************************************************

102|     //This is the JavaScript for validating Contact form.
103|     function HeaderJSValidate()
104|     {
105|         echo "<script type=\"text/javascript\" src=\"scripts/validate.js\">\n";
106|         echo "</script>\n";
107|     }
108| 
109|     //This is the JavaScript for hiding PHP Reset button and revealing JavaScript Reset button
110|     //when JavaScript is active in the browser.
111|     function HeaderJSSwitch()
112|     {
113|         echo "<script type=\"text/javascript\" src=\"scripts/JSSwitch.js\">\n";
114|         echo "</script>\n";
115|     }
116| 
117|     //This is the CSS for Contact form specific styles.
118|     function HeaderContactCSSSheet()
119|     {
120|         echo "<link rel=\"stylesheet\" media=\"screen\" type=\"text/css\" href=\"scripts/contact_css.css\">\n";
121|     }

136|     function HeaderJSBrowserVersion()
137|     {
138|         echo "<script type=\"text/javascript\" src=\"scripts/browserVersion_js.js\">\n";
139|         echo "</script>\n";
140|     }

183|     //This is the CSS for the Contact form error messages that both the PHP and JavaScript manipulate.
184|     function HeaderContactCSS($GenericArray)
185|     {
186|         echo "<style type=\"text/css\">\n";
187| 
188|         if(null == $GenericArray)
189|         {
190|             $CSS = "#FName{\n\tdisplay:none;\n\tvisibility:hidden;\n\tcolor:red}\n\n";
191|             $CSS .= "#LName{\n\tdisplay:none;\n\tvisibility:hidden;\n\tcolor:red}\n\n";
192|             $CSS .= "#EmailBlank{\n\tdisplay:none;\n\tvisibility:hidden;\n\tcolor:red}\n\n";
193|             $CSS .= "#EmailFormat{\n\tdisplay:none;\n\tvisibility:hidden;\n\tcolor:red}\n\n";
194|             $CSS .= "#SubjectDefault{\n\tdisplay:none;\n\tvisibility:hidden;\n\tcolor:red}\n\n";
195|             $CSS .= "#MsgBlank{\n\tdisplay:none;\n\tvisibility:hidden;\n\tcolor:red}\n\n";
196|             $CSS .= "#CaptchaBlank{\n\tdisplay:none;\n\tvisibility:hidden;\n\tcolor:red}\n\n";
197|             $CSS .= "#CaptchaNum{\n\tdisplay:none;\n\tvisibility:hidden;\n\tcolor:red}\n\n";
198|             $CSS .= "#CaptchaWrong{\n\tdisplay:none;\n\tvisibility:hidden;\n\tcolor:red}\n\n";
199|             echo $CSS;
200|         }
201|         else
202|         {
203|             $CSS = "#FName{\n\tdisplay:".$GenericArray[0].";\n\tvisibility:".$GenericArray[1].";\n\tcolor:red}\n\n";
204|             $CSS .= "#LName{\n\tdisplay:".$GenericArray[2].";\n\tvisibility:".$GenericArray[3].";\n\tcolor:red}\n\n";
205|             $CSS .= "#EmailBlank{\n\tdisplay:".$GenericArray[4].";\n\tvisibility:".$GenericArray[5].";\n\tcolor:red}\n\n";
206|             $CSS .= "#EmailFormat{\n\tdisplay:".$GenericArray[6].";\n\tvisibility:".$GenericArray[7].";\n\tcolor:red}\n\n";
207|             $CSS .= "#SubjectDefault{\n\tdisplay:".$GenericArray[8].";\n\tvisibility:".$GenericArray[9].";\n\tcolor:red}\n\n";
208|             $CSS .= "#MsgBlank{\n\tdisplay:".$GenericArray[10].";\n\tvisibility:".$GenericArray[11].";\n\tcolor:red}\n\n";
209|             $CSS .= "#CaptchaBlank{\n\tdisplay:".$GenericArray[12].";\n\tvisibility:".$GenericArray[13].";\n\tcolor:red}\n\n";
210|             $CSS .= "#CaptchaNum{\n\tdisplay:".$GenericArray[14].";\n\tvisibility:".$GenericArray[15].";\n\tcolor:red}\n\n";
211|             $CSS .= "#CaptchaWrong{\n\tdisplay:".$GenericArray[16].";\n\tvisibility:".$GenericArray[17].";\n\tcolor:red}\n\n";
212|             echo $CSS;
213|         }
214| 
215|         echo "</style>\n";
216|     }
217| 
218|     //****************************************************************************
219|     //End of pageHeader Functions Beginning of Everything Else
220|     //****************************************************************************
221| 
222|     //This is the function that generates the main navigation menu.
223|     function master($intSelect)
224|     {
225|         $arrClassTag = array('GNDN', 'home', 'resume', 'portfolio', 'contacts', 'about');
226| 
227|         if(4 == $intSelect)
228|         {
229|             $arrHrefTag = array('GNDN', '../showcase/index.php', '../showcase/resume.php', '../showcase/portfolio_intro.php', 'contact.php', '../showcase/about.php');
230|         }
231|         else
232|         {
233|             $arrHrefTag = array('GNDN', 'index.php', 'resume.php', 'portfolio_intro.php', '../contact/contact.php', 'about.php');
234|         }
235| 
236|         $strCurrent = '_on';
237| 
238|         echo "<div id=\"masterhead\">\n";
239|         echo "<h1 class=\"center\">Keith Gallistel's Showcase Site</h1>\n";
240|         echo "</div>\n";
241|         echo "<div id=\"navigation\">\n";
242|         echo "<div id=\"menuWrap\">\n";
243| 
244|         for($intKey = 1; $intKey < 6; $intKey++)
245|         {
246|             $strClassName = $arrClassTag[$intKey];
247| 
248|             if($intKey == $intSelect)
249|             {
250|                 $strClassName .= $strCurrent;
251|             }
252| 
253|             echo "<a class=\"".$strClassName."\" href=\"".$arrHrefTag[$intKey]."\"> <span class=\"hide\">".$arrClassTag[$intKey]."</span></a>\n";
254|         }
255| 
256|         echo "</div>\n";
257|         echo "</div>\n";
258|     }

315|     //This is the function that contains the footer for the Showcase site.
316|     function pageEnding($strSpaces)
317|     {
318|         echo "<div id=\"footer\">\n";
319|         echo "<div class=\"CopyRight\"><div class=\"SubSiteLink\"><a href=\"".$strSpaces."../index.htm\"><img src=\"".$strSpaces."images/KGLogo.jpg\" width=\"285\" height=\"80\" border=\"0\" alt=\"Keith Gallistel Logo\"></a></div><p>Keith Gallistel ©2010-".date(Y)."<br><a href=\"".$strSpaces."sitemap.php\">Site Map</a></p></div>\n";
320|         echo "</div>\n";
321|         echo "</div>\n";
322|         echo "<script src=\"http://www.google-analytics.com/urchin.js\" type=\"text/javascript\">";
323|         echo "</script>";
324|         echo "<script type=\"text/javascript\">";
325|         echo "_uacct = \"UA-2274966-1\";";
326|         echo "urchinTracker();";
327|         echo "</script>";
328|         echo "</body>\n";
329|         echo "</html>\n";
330|     }
331| 
332| ?>