Example #1
0
<?php

require '../../classes/Database.php';
require '../../classes/Validator.php';
require '../../classes/ErrorHandler.php';
require '../../classes/AdminGui.php';
require '../../functions/security.php';
$errorHandler = new ErrorHandler();
$db = new Database();
$gui = new AdminGui($db);
$projects_records = $gui->select('projects');
$project_types_records = $gui->rightJoin('type', 'project_types', 'given_name');
$categories_records = $gui->joinThree('projects', 'categories_for_projects', 'categories', 'category', 'project_id', 'category_id');
$companies_records = $gui->joinThree('projects', 'companies_for_projects', 'companies', 'company', 'project_id', 'company_id');
$techniques_records = $gui->joinThree('projects', 'techniques_for_projects', 'techniques', 'technique', 'project_id', 'technique_id');
$technologies_records = $gui->joinThree('projects', 'technologies_for_projects', 'technologies', 'technology', 'project_id', 'technology_id');
$places_records = $gui->joinThree('projects', 'places_for_projects', 'places', 'city', 'project_id', 'place_id');
$media_records = $gui->joinThree('projects', 'media_for_projects', 'media', 'media_title', 'project_id', 'media_id');
$works_records = $gui->joinThree('projects', 'works_for_projects', 'works', 'work_title', 'project_id', 'work_id');
$functions_records = $gui->joinThree('projects', 'functions_for_projects', 'functions', 'function', 'project_id', 'function_id');
$people_authors_records = $gui->joinThree('projects', 'people_for_projects_author', 'people', 'name', 'project_id', 'person_id');
$people_collaborators_records = $gui->joinThree('projects', 'people_for_projects_collaboration', 'people', 'name', 'project_id', 'person_id');
$exhibitions_records = $gui->joinThree('projects', 'exhibitions_for_projects', 'exhibitions', 'exhibition', 'project_id', 'exhibition_id');
$prizes_records = $gui->joinThree('projects', 'prizes_for_projects', 'prizes', 'name', 'project_id', 'prize_id');
$collections_records = $gui->joinThree('projects', 'collections_for_projects', 'collections', 'collection', 'project_id', 'collection_id');
if (!empty($_POST)) {
    $db->table('projects');
    if ($db->delete($_POST['id'])) {
        $db->table('categories_for_projects');
        $db->deleteWhich($_POST['id'], 'project_id');
        $db->table('companies_for_projects');
Example #2
0
<?php

require '../../classes/Database.php';
require '../../classes/Validator.php';
require '../../classes/ErrorHandler.php';
require '../../classes/AdminGui.php';
require '../../functions/security.php';
$errorHandler = new ErrorHandler();
$db = new Database();
$gui = new AdminGui($db);
$collections_records = $gui->select('collections');
$collection_types_records = $gui->rightJoin('type', 'collection_types', 'collection_type');
$places_records = $gui->joinThree('collections', 'places_for_collections', 'places', 'city', 'collection_id', 'place_id');
$institutions_records = $gui->joinThree('collections', 'institutions_for_collections', 'institutions', 'institution', 'collection_id', 'institution_id');
if (!empty($_POST)) {
    $post_collections = array_slice($_POST, 0, 3);
    $db->table('collections');
    $validator = new Validator($db, $errorHandler);
    $validation = $validator->check($post_collections, ['type' => ['required' => false], 'collection' => ['required' => true], 'year' => ['required' => false]]);
    if ($validation->fails()) {
        echo '<pre>', print_r($validation->errors()->all()), '</pre>';
    } else {
        if ($db->insert($post_collections)) {
            $last_id = $db->lastID();
            if ($_POST['place']) {
                $post_place = $_POST['place'];
                for ($m = 0; $m < count($post_place); $m++) {
                    $insert_place = ['place_id' => $post_place[$m], 'collection_id' => $last_id];
                    $db->table('places_for_collections')->insert($insert_place);
                }
            }
Example #3
0
<?php

require '../../classes/Database.php';
require '../../classes/Validator.php';
require '../../classes/ErrorHandler.php';
require '../../classes/AdminGui.php';
require '../../functions/security.php';
$errorHandler = new ErrorHandler();
$db = new Database();
$gui = new AdminGui($db);
$exhibitions_records = $gui->select('exhibitions');
$exhibition_types_records = $gui->rightJoin('type', 'exhibition_types', 'exhibition_type');
$exhibition_kinds_records = $gui->rightJoin('kind', 'exhibition_kinds', 'exhibition_kind');
$events_records = $gui->joinThree('exhibitions', 'events_for_exhibitions', 'events', 'event', 'exhibition_id', 'event_id');
$spaces_records = $gui->joinThree('exhibitions', 'spaces_for_exhibitions', 'spaces', 'space', 'exhibition_id', 'space_id');
$places_records = $gui->joinThree('exhibitions', 'places_for_exhibitions', 'places', 'city', 'exhibition_id', 'place_id');
$projects_records = $gui->joinThree('exhibitions', 'exhibitions_for_projects', 'projects', 'project', 'exhibition_id', 'project_id');
$institutions_records = $gui->joinThree('exhibitions', 'institutions_for_exhibitions', 'institutions', 'institution', 'exhibition_id', 'institution_id');
$people_org_records = $gui->joinThree('exhibitions', 'people_for_exhibitions_org', 'people', 'name', 'exhibition_id', 'person_id');
$people_curatorship_records = $gui->joinThree('exhibitions', 'people_for_exhibitions_curatorship', 'people', 'name', 'exhibition_id', 'person_id');
$people_participants_records = $gui->joinThree('exhibitions', 'people_for_exhibitions_participants', 'people', 'name', 'exhibition_id', 'person_id');
if (!empty($_POST)) {
    $db->table('exhibitions');
    if ($db->delete($_POST['id'])) {
        $db->table('events_for_exhibitions');
        $db->deleteWhich($_POST['id'], 'exhibition_id');
        $db->table('spaces_for_exhibitions');
        $db->deleteWhich($_POST['id'], 'exhibition_id');
        $db->table('places_for_exhibitions');
        $db->deleteWhich($_POST['id'], 'exhibition_id');
        $db->table('projects_for_exhibitions');
Example #4
0
<?php

require '../../classes/Database.php';
require '../../classes/Validator.php';
require '../../classes/ErrorHandler.php';
require '../../classes/AdminGui.php';
require '../../functions/security.php';
$errorHandler = new ErrorHandler();
$db = new Database();
$gui = new AdminGui($db);
$prizes_records = $gui->select('prizes');
$prize_types_records = $gui->rightJoin('type', 'prize_types', 'prize_type');
$places_records = $gui->joinThree('prizes', 'places_for_prizes', 'places', 'city', 'prize_id', 'place_id');
$institutions_records = $gui->joinThree('prizes', 'institutions_for_prizes', 'institutions', 'institution', 'prize_id', 'institution_id');
if (!empty($_POST)) {
    $db->table('prizes');
    if ($db->delete($_POST['id'])) {
        $db->table('places_for_prizes');
        $db->deleteWhich($_POST['id'], 'prize_id');
        $db->table('institutions_for_prizes');
        $db->deleteWhich($_POST['id'], 'prize_id');
        $db->table('prizes_for_projects');
        $db->deleteWhich($_POST['id'], 'prize_id');
        header('Location: delete_prizes.php');
        die;
    }
}
?>

<!doctype html>
	<html>