Login   Register  
PHP Classes
elePHPant
Icontem

File: business.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  >  business.phtml  >  Download  
File: business.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:07
Size: 6,878 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 "business.phtml";
$title "vCard";
$FORM_NAME "jform";
$act $_POST["act"];

if (
$act == "index" || $act == "personal" || $act == "home" || $act == "other" || $act == "saveit") {
    
$_SESSION["vCardinfo"]["orgname"] = trim(stripslashes($_POST["orgname"]));
    
$_SESSION["vCardinfo"]["workstreet"] = trim(stripslashes($_POST["workstreet"]));
    
$_SESSION["vCardinfo"]["workcity"] = trim(stripslashes($_POST["workcity"]));
    
$_SESSION["vCardinfo"]["workprov"] = trim(stripslashes($_POST["workprov"]));
    
$_SESSION["vCardinfo"]["workpostal"] = trim(stripslashes($_POST["workpostal"]));
    
$_SESSION["vCardinfo"]["workcountry"] = trim(stripslashes($_POST["workcountry"]));
    
$_SESSION["vCardinfo"]["weburl"] = trim(stripslashes($_POST["weburl"]));
    
$_SESSION["vCardinfo"]["jobtitle"] = trim(stripslashes($_POST["jobtitle"]));
    
$_SESSION["vCardinfo"]["orgunit"] = trim(stripslashes($_POST["orgunit"]));
    
$_SESSION["vCardinfo"]["workextended"] = trim(stripslashes($_POST["workextended"]));
    
$_SESSION["vCardinfo"]["workphone"] = trim(stripslashes($_POST["workphone"]));
    
$_SESSION["vCardinfo"]["workfax"] = trim(stripslashes($_POST["workfax"]));
    
$_SESSION["vCardinfo"]["workpager"] = trim(stripslashes($_POST["workpager"]));
    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 business-related information here.</td>
        </tr>
        </table>
    </td>
    </tr>
    <tr>
    <td valign="top">
        <table border=0 cellspacing="1" cellpadding="1">
        <tr>
        <td class="medium">Company: </td><td><input type="text" size="20" maxlength="128" name="orgname" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["orgname"]); ?>"></td>
        <td class="medium">Job Title: </td><td><input type="text" size="20" maxlength="128" name="jobtitle" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["jobtitle"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">Street Address: </td>
        <td><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="workstreet">');
        else
            document.write ('<textarea tabindex=5 cols="20" rows="2" name="workstreet">');
        //-->
        </script><? echo htmlspecialchars($_SESSION["vCardinfo"]["workstreet"]); ?></textarea></td>
        <td class="medium">Department: </td><td><input type="text" size="20" maxlength="128" name="orgunit" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["orgunit"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">City: </td><td><input type="text" size="20" maxlength="64" name="workcity" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["workcity"]); ?>"></td>
        <td class="medium">Office: </td><td><input type="text" size="20" maxlength="128" name="workextended" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["workextended"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">Province/State: </td><td><input type="text" size="20" maxlength="64" name="workprov" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["workprov"]); ?>"></td>
        <td class="medium">Phone: </td><td><input type="text" size="20" maxlength="64" name="workphone" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["workphone"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">Postal Code/ZIP: </td><td><input type="text" size="20" maxlength="10" name="workpostal" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["workpostal"]); ?>"></td>
        <td class="medium">Fax: </td><td><input type="text" size="20" maxlength="64" name="workfax" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["workfax"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">Country/Region: </td><td><input type="text" size="20" maxlength="128" name="workcountry" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["workcountry"]); ?>"></td>
        <td class="medium">Pager: </td><td><input type="text" size="20" maxlength="64" name="workpager" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["workpager"]); ?>"></td>
        </tr>
        <tr>
        <td class="medium">Web:  </td><td  colspan="3"><input type="text" size="53" maxlength="256" name="weburl" value="<? echo htmlspecialchars($_SESSION["vCardinfo"]["weburl"]); ?>"></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"); ?>