Esempio n. 1
0
<?php

include_once "common/base.php";
$pageTitle = "Closet";
include_once "common/header.php";
?>
				<div class="full" id="main">
					<noscript>This site just doesn't work, period, without JavaScript</noscript>
 <?php 
if (isset($_SESSION['LoggedIn']) && isset($_SESSION['Username'])) {
    echo "<table class=\"table table-hover\" id=\"list\">";
    echo "<tr>\n \t\t\t\t\t\t<td><b>Name</b></td>\n \t\t\t\t\t\t<td><b>Type</b></td>\n\t\t\t\t\t\t<td><b>Action</b></td>\n \t\t\t\t\t</tr>";
    include_once 'inc/class.items.inc.php';
    include_once 'inc/class.users.inc.php';
    $items = new FocusItems($db);
    $users = new FocusUsers($db);
    list($userID, $v) = $users->retrieveAccountInfo();
    $items->loadItemsByUser();
    echo "</table>";
    ?>

					 </br>
					 <div id="form-content" class="modal fade" tabindex="-1" role="dialog">
						 <div class="modal-dialog" role="document">
    			 		<div class="modal-content">
								<form class="form-horizontal" role="form"  id="add-new" method="post" action="db-interaction/items.php">
								 <div class="modal-header">
									 <a class="close" data-dismiss="modal">×</a>
								 </div>
								 <div class="modal-body">
									 	<div class="form-group">
Esempio n. 2
0
<?php

session_start();
include_once "../inc/constants.inc.php";
include_once "../inc/class.items.inc.php";
if (!empty($_POST['action']) && isset($_SESSION['LoggedIn']) && $_SESSION['LoggedIn'] == 1) {
    $listObj = new FocusItems();
    switch ($_POST['action']) {
        case 'add':
            echo $listObj->addItem();
            break;
            // case 'update':
            //     $listObj->updateItem();
            //     break;
            // case 'sort':
            //     $listObj->changeListItemPosition();
            //     break;
        // case 'update':
        //     $listObj->updateItem();
        //     break;
        // case 'sort':
        //     $listObj->changeListItemPosition();
        //     break;
        case 'delete':
            echo $listObj->deleteItem();
            break;
        default:
            header("Location: /");
            break;
    }
} else {