12345678910111213141516171819202122232425262728293031323334353637 |
- <!---
-
- Developer: Coralys Cubero Rivera
- Fall 2018
-
- This script deletes a selected row from the 'questionnaires table and then returns
- the user to the questionnaires main page.
-
-
-
- Updated by: Víctor A. Hernández
- Summer 2019
-
- --->
-
- <?php
-
- require_once 'processes/config.php';
- require_once 'processes/dbh.inc.php';
-
- // IF USER ENTERS PAGE AFTER YES BUTTON HAS BEEN PRESSED (FROM confirmDeleteQuestionnaire.php), DELETE QUESTIONNAIRE FROM DATABASE
- // ELSE DO NOTHING
- if(isset($_GET['del'])) {
- $query = "DELETE FROM `questionnair` WHERE `id`='".$_GET['del']."';";
- if(!mysqli_query($connection, $query)) die("Error: ".mysqli_error($connection));
-
- // HAY QUE BORRAR CADA ASOCIACIÓN CUESTIONARIO-PREGUNTA (sería con un while()? o se 'seleccionan' todos y se borran a la vez?)
- /*
- $query = "DELETE FROM `questionnair_question` WHERE `id_questionnair`='".$_GET['del']."';";
- if(!mysqli_query($connection, $query)) die("Error: ".mysqli_error($connection));
- */
-
- // WHY NOT USE header INSTEAD OF window.top.location?
- //header('Location: http://emaapp.online/admin_nuevo/questionnaires.php');
- //exit();
- echo "<script>window.top.location='http://emaapp.online/admin_nuevo/questionnaires.php'</script>";
- }
|