reSIProcate/repro  9694
addresource.php
Go to the documentation of this file.
00001 <?php
00002 require('reprofunctions.php');
00003 dbgSquirt("============= Add Resource ===============");
00004 
00005 $result = checkCookies($forceLogin,$error,FALSE);
00006 if (!($result) || $forceLogin) {
00007   // we got an error back that occurred while checkCookies was being run, 
00008   // or authentication failed.  Either way, bounce them back to the login screen
00009   header("Location: http://" . $_SERVER['HTTP_HOST'] . 
00010          dirname($_SERVER['PHP_SELF']) . 
00011          "/index.php?error=$error");
00012   exit;
00013  }
00014 $username = $_COOKIE['user'];
00015 ?>
00016 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00017 
00018 <!--
00019 System:  Repro
00020 File:    addresource.php
00021 Purpose: Allows an authenticated user to add additional resources to their
00022          profile
00023 Author:  S. Chanin
00024 -->
00025 <html>
00026 <head>
00027 <link rel="stylesheet" type="text/css" href="repro_style.css" />
00028 <title>Add Resource</title>
00029 <script type="text/javascript">
00030 <!--
00031 function disableForward() {
00032   document.resourceForm.forward.value = ""
00033   document.resourceForm.forward.disabled = true
00034 }
00035 
00036 function enableForward() {
00037   document.resourceForm.forward.disabled = false
00038 }
00039 //-->
00040 </script>
00041 </head>
00042 
00043 <body>
00044 <h1 class="title">Repro</h1>
00045 <h1>Add Resource</h1>
00046 <hr />
00047 
00048 <?php
00049 // if we've looped back due to an error, show the message
00050 if (isset($_GET["error"]) && !empty($_GET['error'])) {
00051     echo '<p class="error">' . $_GET["error"] . "</p>\n";
00052 }
00053 ?>
00054 <form method="POST" action="savenewresource.php" name="resourceForm" id="resourceForm">
00055 <table>
00056 <tr>
00057 <td>Address</td>
00058 <td><input type="text" name="aor" id="aor" value="<?php echo $_GET['aor']; ?>"/></td>
00059 </tr>
00060 <tr>
00061 <td>Forward</td>
00062     <td><input type="radio" name="forwardType" id="forwardType" value="Yes" 
00063     onclick="enableForward()" 
00064     <?php if (!isset($_GET['forwardType']) || $_GET['forwardType'] == "Yes")
00065            echo 'checked="checked"'; ?>
00066     >Yes</td>
00067 </tr>
00068 <tr><td>&nbsp</td>
00069 <td><input type="radio" name="forwardType" id="forwardType" value="No" 
00070        onclick="disableForward()"
00071        <?php if ($_GET['forwardType'] == "No") echo 'checked="checked"'; ?>
00072        >No</td></tr>
00073 <tr><td>Forward Address</td>
00074 <td><input type="text" name="forward" id="forward" value="<?php echo $_GET['forward']; ?>"/>
00075 </td>
00076 </tr>
00077 <tr>
00078 <td>Voicemail</td>
00079 <td><input type="text" name="voicemail" id="voicemail" value="<?php echo $_GET['voicemail']; ?>"/></td>
00080 </tr>
00081 <tr>
00082 <td>&nbsp</td>
00083 <td>
00084 <input type="submit" name="submit" id="submit" value="Save" />
00085 <input type="submit" name="submit" id="submit" value="Cancel" />
00086 </td>
00087 </tr>
00088 </table>
00089 </form>
00090 
00091 <br /><hr />
00092 <a href="userhome.php">Return to User Home</a><br />
00093 <a href="logout.php">Logout</a><br />
00094 </body>
00095 </html>