Exemplo n.º 1
0
             if ($titleFound) {
                 $editRequest = $titleFound->registro->mfn;
                 $_GET["edit"] = $editRequest;
             } else {
                 $_GET["edit"] = "";
                 $_GET["action"] = "new";
             }
         }
         $smarty->assign("formRequest", $listRequest);
         if ($listRequest == "mask" || $listRequest == "facic") {
             $smarty->assign("collectionMask", $dataModel->getAllNameMask());
         }
         $smarty->assign("dataRecord", $dataModel->getRecordByMFN($editRequest));
         break;
     case 'export':
         $openExportedFile = displayExport();
         if ($openExportedFile == "no content") {
             //user_error($openExportedFile, E_USER_ERROR);
         } else {
             header("Location: " . $openExportedFile);
         }
         break;
 }
 // Add a Title in $titleCode - to use in Issues and TitlePlus
 if (isset($_GET["title"]) && !preg_match("=/=", $_GET["title"])) {
     $smarty->assign("titleCode", $_GET["title"]);
 }
 switch ($listRequest) {
     case "users":
         //After save own profile, user redirect to homepage
         if ($_SESSION["role"] != "Administrator" && $smartyTemplate == "list") {
Exemplo n.º 2
0
function displayAdminPanel()
{
    include_once "../../includes/sql.inc.php";
    ?>
    <h1>Administration Panel</h1>
    <table border="0" style="text-align:center;">
        <tbody>
            <tr>
                <td><a href="#admin" onClick="viewImport()">Invite Guests</td>
                <td><a href="#admin" onClick="viewInvited()">Guests Invited</a></td>
                <td><a href="#admin" onClick="viewAttending()">Guests Attending</a></td>
                <td><a href="#admin" onClick="viewRequests()">Songs Requested</a></td>
                <td><a href="#admin" onClick="viewExport()">Export Data</a></td>
                <td><a href="#" onClick="logout()">Logout</a></td>
            </tr>
        </tbody>
    </table>
    <br />

    <div id="attending-content">
    	<?php 
    displayAttending();
    ?>
    </div>
    <div id="invited-content">
		<?php 
    displayInvited();
    ?>
    </div>
    <div id="requests-content">
		<?php 
    displayRequests();
    ?>
    </div>
    <div id="export-content">
		<?php 
    displayExport();
    ?>
    </div>
    <div id="import-content">
    	<?php 
    displayImport();
    ?>
    </div>
    <script>
	function hideAll() {
		$("#attending-content").hide();
		$("#invited-content").hide();
		$("#requests-content").hide();
		$("#export-content").hide();
		$("#import-content").hide();		
	}
	function viewAttending() {
		hideAll();
		$("#attending-content").fadeIn("fast");
	}
	function viewInvited() {
		hideAll();
		$("#invited-content").fadeIn("fast");
	}
	function viewRequests() {
		hideAll();
		$("#requests-content").fadeIn("fast");
	}
	function viewExport() {
		hideAll();
		$("#export-content").fadeIn("fast");
	}
	function viewImport() {
		hideAll();
		$("#import-content").fadeIn("fast");
	}
	function logout() {
		setCookie('McCownUser', '', -1);
		setCookie('McCownPass', '', -1);
		switchPage('home_page.html');
	}
	hideAll();
	</script>
    <br />
    <?php 
}