Documentation is available at command.php
- <?php
- /**
- * Command menu of the web interface
- *
- * Executes commands selected by the user and displays a confirmation
- * if successful or an error if not.
- * @package Phone2Dev
- * @author Stanislav Miroshnikov
- * @todo add an associative array that maps SIP error codes to
- * their descriptions.
- * @todo add template support
- */
- ?>
- <html>
- <head>
- <title>Phone2Dev: Command Menu</title>
- </head>
- <body>
- <?php
- // start the session
- session_start();
- // check for required session and GET variables
- if(isset($_SESSION['intUserId'])
- && isset($_SESSION['intMainMenuId'])
- && isset($_GET['commandId'])
- && isset($_GET['menuId'])
- && isset($_GET['deviceId'])){
- /**
- * Requires Phone2Dev Class for database access
- */
- require 'phone2dev.php';
- $objP2D = &new Phone2Dev;
- $objP2D->dbConnect();
- // output the page header
- print "<h1>Phone2Dev</h1>";
- print "<p>You are logged in as: ".$_SESSION['strUsername']."</p>";
- // activate the command
- $intStatus = $objP2D->executeCommand($_GET['commandId'],
- $_GET['deviceId'],
- $_SESSION['intUserId']);
- // check if the message send was successful
- if($intStatus == 200) {
- print "<h3>Success</h3>";
- } else {
- print "<h3>Error: ".$intStatus."</h3>";
- }
- if($_GET['menuId'] == $_SESSION['intMainMenuId']) {
- // this is command was activated from main menu
- // so it can only return to main menu
- print "<p>Return to <a href=\"menu.php?menuId="
- .$_SESSION['intMainMenuId']."\">Main Menu<a\></p>";
- } else {
- // give option to return to parent or main menus
- print "<p>Return to <a href=\"menu.php?menuId="
- .$_GET['menuId']."\">Previous Menu<a\></p>";
- print "<p>Return to <a href=\"menu.php?menuId="
- .$_SESSION['intMainMenuId']."\">Main Menu<a\></p>";
- }
- // give option to log out
- print "<p>Click here to<a href=\"logout.php\">logout</a>.</p>";
- // disconnect from the database
- $objP2D->dbDisconnect();
- } else {
- print "<h1>Phone2Dev Command Error</h1>";
- print "<p>You are not properly logged in "
- ."or you are not entering a command.</p>";
- print "<p>You can login <a href=\"login.html\">here</a>.</p>";
- }
- ?>
- </body>
- </html>
Documentation generated on Tue, 4 Jan 2005 13:47:58 -0500 by phpDocumentor 1.3.0RC3