Ejemplo n.º 1
0
function tools()
{
    // does a second check to ensure you still are an admin and got to this page some how.
    if (checkadmin()) {
        //add admin
        if (isset($_POST['addAdmin'])) {
            // if the add admin button is selected do the add admin function
            addAdmin();
        }
        //add location
        if (isset($_POST['addLocation'])) {
            // same thing as the add admin but for locations
            addLocation();
        }
        //add professor
        if (isset($_POST['addProfessor'])) {
            // now for professors
            addProfessor();
        }
        //add class
        if (isset($_POST['addClass'])) {
            // finally for classes
            addClass();
        }
    } else {
        header("Location:../index.php");
        // if you fail the check go back to index.php and does give the user an error.
    }
}
Ejemplo n.º 2
0
     }
 } else {
     if ($_GET['action'] == addLocationType && $_SESSION['access'] >= 50) {
         $locationType = new LocationType();
         //if the user is adding the room, then add it
         if (isset($_POST['addLocationType'])) {
             addLocationType($locationType);
         } else {
             addLocationTypeForm();
         }
     } else {
         if ($_GET['action'] == addLocation && $_SESSION['access'] >= 50) {
             $location = new Location();
             //if the user is adding the room, then add it
             if (isset($_POST['addLocation'])) {
                 addLocation($location);
             } else {
                 addLocationForm();
             }
         } else {
             if ($_GET['action'] == addRoomType && $_SESSION['access'] >= 50) {
                 //if the user is adding the room, then add it
                 if (isset($_POST['addRoomType'])) {
                     $roomType = new RoomType();
                     addRoomType($roomType);
                 } else {
                     addRoomTypeForm();
                 }
             } else {
                 if ($_GET['action'] == addRoom && $_SESSION['access'] >= 50) {
                     $room = new Room();
Ejemplo n.º 3
0
function updatePosting($user)
{
    $title = $_POST["title"];
    $url = urldecode($_POST["url"]);
    $companyName = $_POST["company"];
    $locationName = $_POST["location"];
    # string value needs to be converted to int
    $source = $_POST["source"];
    $id = $_POST["sid"];
    // if location doesn't exist in locations table yet, add it
    if (locationExists($locationName) != true) {
        addLocation($locationName);
    }
    $locationId = getLocationId($locationName);
    // if location doesn't exist yet for user, add it
    if (companyIdExists($companyName) != true) {
        addCompany($companyName);
    }
    $companyId = getCompanyId($companyName);
    $query = "update postings ";
    $query .= "set title=\"{$title}\", ";
    $query .= "source=\"{$source}\", ";
    $query .= "location={$locationId}, ";
    $query .= "company={$companyId}, ";
    $query .= "url=\"{$url}\" ";
    $query .= "where id = {$id} ";
    //echo $query;
    if (booleanReturn($query)) {
        echo json_encode(true);
    } else {
        echo "failed to add posting";
    }
}
Ejemplo n.º 4
0
header('');
$strVenueName = isset($_REQUEST['vn']) ? db_escape($_REQUEST['vn']) : "";
$strVenueAddress = isset($_REQUEST['va']) ? db_escape($_REQUEST['va']) : "";
$strAPIId = isset($_REQUEST['id']) ? db_escape($_REQUEST['id']) : "";
$strLatitude = isset($_REQUEST['la']) ? db_escape($_REQUEST['la']) : "";
$strLongitude = isset($_REQUEST['ln']) ? db_escape($_REQUEST['ln']) : "";
$strUserId = isset($_REQUEST['ud']) ? db_escape($_REQUEST['ud']) : "";
$strLocationId = isset($_REQUEST['vd']) ? db_escape($_REQUEST['vd']) : "";
$action = isset($_REQUEST['a']) ? db_escape($_REQUEST['a']) : "";
switch ($action) {
    case "addLocation":
        $addLoc = addLocation();
        $outputArray = array("success" => true, "result" => $addLoc);
        echo json_encode($outputArray);
        break;
    case "addCheckin":
        $addCheck = addCheckin();
        $outputArray = array("success" => true, "result" => $addCheck);
        echo json_encode($outputArray);
        break;
    case "LocationAndCheckin":
        $addLoc = addLocation();
        $addCheck = addCheckin();
        $outputArray = array("success" => true, "Location" => $addLoc, "Checkin" => $addCheck);
        echo json_encode($outputArray);
        break;
    default:
        $outputArray = array("success" => false, "result" => -999);
        echo json_encode($outputArray);
        break;
}
Ejemplo n.º 5
0
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/base/computers/localSidebar.php";
require "graph/navbar.inc.php";
require_once "modules/pulse2/includes/locations_xmlrpc.inc.php";
// Receiving form data
if (isset($_POST['name'], $_POST['parent'], $_POST['description'])) {
    if (empty($_GET['id'])) {
        addLocation($_POST['name'], $_POST['parent'], $_POST['description']);
        if (!isXMLRPCError()) {
            new NotifyWidgetSuccess(_T("The location has been added successfully.", "glpi"));
        }
    } else {
        editLocation($_GET['id'], $_POST['name'], $_POST['parent'], $_POST['description']);
        if (!isXMLRPCError()) {
            new NotifyWidgetSuccess(_T("The location has been edited successfully.", "glpi"));
        }
    }
}
$page_title = _T("Add location", 'glpi');
// Init form vars
$location_name = '';
$parent = 1;
$description = '';
Ejemplo n.º 6
0
@($id_guest = $_REQUEST['id_guest']);
@($id_host = $_REQUEST['id_host']);
@($album_id = $_REQUEST['album_id']);
@($img_path = $_REQUEST['img_path']);
if ($act == "register") {
    $mes = register();
} elseif ($act == "addInfo") {
    $mes = addInfo();
} elseif ($act == "addLanguage") {
    $mes = addLanguage();
} elseif ($act == "addAcco") {
    $mes = addAcco();
} elseif ($act == "addAllAcco") {
    $mes = addAllAcco();
} elseif ($act == "addLocation") {
    $mes = addLocation();
} elseif ($act == "addCalendar") {
    $mes = addCalendar();
} elseif ($act == "addFromDate") {
    $mes = addFromDate();
} elseif ($act == "addMinDays") {
    $mes = addMinDays();
} elseif ($act == "addPrice") {
    $mes = addPrice();
} elseif ($act == "addPhotos") {
    $mes = addPhotos();
} elseif ($act == "addPic") {
    $mes = addPic();
} elseif ($act == "addGuestPic") {
    $mes = addGuestPic;
} elseif ($act == "addAmen") {
Ejemplo n.º 7
0
        updateDepartment();
        break;
    case "deleteDepartment":
        deleteDepartment();
        break;
    case "insertEmployee":
        addEmployee();
        break;
    case "updateEmployee":
        updateEmployee();
        break;
    case "deleteEmployee":
        deleteEmployee();
        break;
    case "insertLocation":
        addLocation();
        break;
    case "updateLocation":
        updateLocation();
        break;
    case "deleteLocation":
        deleteLocation();
        break;
}
displayHeader();
// Show HTML header
displayNavigation();
// Show Navigation
// Functions that generate content to browser
switch (getCurrentAction()) {
    case "jobs":