Login   Register  
PHP Classes
elePHPant
Icontem

File: home.phtml

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Slava Ivanov  >  vCard Class  >  home.phtml  >  Download  
File: home.phtml
Role: Example script
Content type: text/plain
Description: example application
Class: vCard Class
Class to manipulate with vCard information
Author: By
Last change:
Date: 2003-03-25 18:09
Size: 5,650 bytes
 

Contents

Class file image Download
<?
Header
("Cache-Control: no-cache");
Header("Pragma: no-cache");
Header("Expires: Sat, Jan 01 2000 01:01:01 GMT");
session_name("SID");
session_start();

$SCRIPT_NAME "home.phtml";
$title "vCard";
$FORM_NAME "jform";
$act $_POST["act"];

if (
$act == "index" || $act == "personal" || $act == "business" || $act == "other" || $act == "saveit") {
    
$_SESSION["vCardinfo"]["homestreet"] = trim(stripslashes($_POST["homestreet"]));
    
$_SESSION["vCardinfo"]["homecity"] = trim(stripslashes($_POST["homecity"]));
    
$_SESSION["vCardinfo"]["homeprov"] = trim(stripslashes($_POST["homeprov"]));
    
$_SESSION["vCardinfo"]["homepostal"] = trim(stripslashes($_POST["homepostal"]));
    
$_SESSION["vCardinfo"]["homecountry"] = trim(stripslashes($_POST["homecountry"]));
    
$_SESSION["vCardinfo"]["homephone"] = trim(stripslashes($_POST["homephone"]));
    
$_SESSION["vCardinfo"]["homefax"] = trim(stripslashes($_POST["homefax"]));
    
$_SESSION["vCardinfo"]["cellphone"] = trim(stripslashes($_POST["cellphone"]));
    if (
$act == "saveit")
        exit(
header("Location: index.phtml?act=saveit"));
    else
        exit(
header("Location: ".$act.".phtml"));
}


include(
"template-header.phtml");
?>

<form method="post" action="<? echo $SCRIPT_NAME ?>" name="<? echo $FORM_NAME ?>">
<table cellspacing="1" cellpadding="0" border="0" width="485" align="center">
<? include("vmenu.phtml"); ?>
<tr>
<td colspan="8" valign="top">
    <table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="#bebebe">
    <tr>
    <td bgcolor="#eeeeee" width="1"><img src="../images/spacer.gif" width="1" height="300"></td>
    <td valign="top">
    <br>
    <!------------------------contents go here ---------------------------------------------------------->


    <table  cellspacing="0" cellpadding="0" border="0" width="100%">
    <tr>
    <td colspan="2">
        <table cellspacing="0" cellpadding="7" border="0">
        <tr>
        <td>&nbsp;Enter home-related information here.</td>
        </tr>
        </table>
    </td>
    </tr>
    <tr>
    <td valign="top">
        <table border=0>
        <tr>
        <td valign="top" class="medium">Street Address: </td>
        <td valign="top">
        <script language="javascript">
        <!--
        var browser_type=navigator.appName;
        var browser_version=parseInt(navigator.appVersion);
        if (browser_type=="Netscape" && browser_version < 5)
            document.write ('<textarea tabindex=5 cols="15" rows="2" name="homestreet">');
        else
            document.write ('<textarea tabindex=5 cols="20" rows="2" name="homestreet">');
        //-->
        </script><? echo htmlspecialchars($_SESSION["vCardinfo"]["homestreet"]); ?></textarea>
      </td>
        </tr>
        <tr>
        <td class="medium">City: </td><td><input type="text" size="20" maxlength="64" name="homecity" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["homecity"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">Province/State: </td><td><input type="text" size="20" maxlength="64" name="homeprov" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["homeprov"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">Postal Code/ZIP: </td><td><input type="text" size="20" maxlength="10" name="homepostal" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["homepostal"]); ?>"></td>
        </tr>
       <tr>
        <td class="medium">Country/Region: </td><td><input type="text" size="20" maxlength="128" name="homecountry" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["homecountry"]); ?>"></td>
        </tr>
    </table>
    </td>
    <td valign="top">
        <table>
        <tr>
        <td class="medium">Phone: </td><td><input type="text" size="20" maxlength="64" name="homephone" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["homephone"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">Fax: </td><td><input type="text" size="20" maxlength="64" name="homefax" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["homefax"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">Mobile: </td><td><input type="text" size="20" maxlength="64" name="cellphone" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["cellphone"]); ?>"></td>
        </tr>
        </table>
    </td>
    </tr>
     </table>


    <!---------------------------------------------------------------------------------->
   </td>
    <td bgcolor="black" width="1"><img src="../images/spacer.gif" width="1" height="1"></td>
    </tr>
    <tr>
    <td  bgcolor="black" colspan="3"><img src="../images/spacer.gif" width="1" height="1"></td>
    </tr>
    </table>
 </td>
</tr>
</table>

<table width="485" align="center" cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="3"><img src="../images/spacer.gif" width="1" height="2"></td>
</tr>
<tr  bgcolor="#e5e5e5">
<td  align="right"><input type="button" name="delete" value="Delete" onclick="javascript:dosubmit('deleteit',document.<? echo $FORM_NAME ?>);">&nbsp;<input type="button" name="cancel" value="Cancel" onclick="javascript:dosubmit('cancelit',document.<? echo $FORM_NAME ?>);">&nbsp;<input type="button" name="save" value=" Save " onclick="javascript:dosubmit('saveit',document.<? echo $FORM_NAME ?>);"></td>
</tr>
</table>

<input type="hidden" name="act" value="">
<input type="hidden" name="fname" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["fname"]); ?>">
<input type="hidden" name="lname" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["lname"]); ?>">
</form>

<? include("template-footer.phtml"); ?>