<?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); $institutions_records = $gui->select('institutions'); $places_records = $gui->joinThree('institutions', 'places_for_institutions', 'places', 'city', 'institution_id', 'place_id'); if (!empty($_POST)) { $db->table('institutions'); if ($db->delete($_POST['id'])) { $db->table('places_for_institutions'); $db->deleteWhich($_POST['id'], 'institution_id'); $db->table('institutions_for_collections'); $db->deleteWhich($_POST['id'], 'institution_id'); $db->table('institutions_for_exhibitions'); $db->deleteWhich($_POST['id'], 'institution_id'); $db->table('institutions_for_prizes'); $db->deleteWhich($_POST['id'], 'institution_id'); header('Location: delete_institutions.php'); die; } } ?> <!doctype html> <html>
<?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');
<?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); $works_records = $gui->select('works'); $media_records = $gui->joinThree('works', 'media_for_works', 'media', 'media_title', 'work_id', 'media_id'); $categories_records = $gui->joinThree('works', 'categories_for_works', 'categories', 'category', 'work_id', 'category_id'); $techniques_records = $gui->joinThree('works', 'techniques_for_works', 'techniques', 'technique', 'work_id', 'technique_id'); $technologies_records = $gui->joinThree('works', 'technologies_for_works', 'technologies', 'technology', 'work_id', 'technology_id'); if (!empty($_POST)) { $post_works = array_slice($_POST, 0, 2); $db->table('works'); $validator = new Validator($db, $errorHandler); $validation = $validator->check($post_works, ['work_title' => ['required' => true], 'work_description' => ['required' => false]]); if ($validation->fails()) { echo '<pre>', print_r($validation->errors()->all()), '</pre>'; } else { if ($db->insert($post_works)) { $last_id = $db->lastID(); if ($_POST['media']) { $post_media = $_POST['media']; for ($m = 0; $m < count($post_media); $m++) { $insert_media = ['media_id' => $post_media[$m], 'work_id' => $last_id]; $db->table('media_for_works')->insert($insert_media); }
<?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); $spaces_records = $gui->select('spaces'); $places_records = $gui->joinThree('spaces', 'places_for_spaces', 'places', 'city', 'space_id', 'place_id'); if (!empty($_POST)) { $post_space = $_POST['space']; $db->table('spaces'); $validator = new Validator($db, $errorHandler); $validation = $validator->check($_POST, ['space' => ['required' => true]]); if ($validation->fails()) { echo '<pre>', print_r($validation->errors()->all()), '</pre>'; } else { $insert_space = ['space' => $post_space]; if ($db->insert($insert_space)) { $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], 'space_id' => $last_id]; $db->table('places_for_spaces')->insert($insert_place); } } header('Location: create_spaces.php');
<?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');
<?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); } }
<?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); $events_records = $gui->select('events'); $places_records = $gui->joinThree('events', 'places_for_events', 'places', 'city', 'event_id', 'place_id'); if (!empty($_POST)) { $db->table('events'); if ($db->delete($_POST['id'])) { $db->table('places_for_events'); $db->deleteWhich($_POST['id'], 'event_id'); $db->table('events_for_exhibitions'); $db->deleteWhich($_POST['id'], 'event_id'); header('Location: delete_events.php'); die; } } ?> <!doctype html> <html> <head> <title>Delete events</title> <link rel="stylesheet" type="text/css" href="../../public/front/css/admin.css"> </head>
<?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>