Files
code-cegled/_include/include_delete_school.php
Ricsi 5a78b09a38 20161230
sql delete replaced by delete flag
log list (simple), log categories
minor bug fixes in css
2016-12-30 18:00:05 +01:00

21 lines
705 B
PHP

<?php
if ($this->is_id()) {
//$delete_query = "DELETE FROM school WHERE sc_id = " . $this->get_id() . ";";
//$sql->execute_query($delete_query);
//akiknek ez a school_id van beállítva, azoknál null-ra állítjuk
$school_query = "SELECT uk_id FROM user_kid WHERE uk_school_sc_id = " . $this->get_id();
$school_assoc_array = $sql->assoc_array($school_query);
foreach ($school_assoc_array as $uk_id) {
$sql->update_table('user_kid', array('uk_school_sc_id' => 'null'), array('uk_id' => $uk_id['uk_id']));
}
$sql->update_table('school', array('sc_deleted' => 1), array('sc_id' => $this->get_id()));
log::register('delete_school', $this->get_id());
header("Location: /admin/schools");
}
?>