school and school_city class

user edit with parent edit included (ajax)
city and school connected
overview updated
This commit is contained in:
Ricsi
2017-01-12 22:59:36 +01:00
parent 9c7f678e74
commit 20781a0847
20 changed files with 617 additions and 184 deletions

View File

@@ -188,11 +188,7 @@ if (isset($_POST['action'])) {
break;
case 'city_create':
# település létrehozása
//todo: település object
$new_city_id = $sql->insert_into('school_city', array(
'scc_city' => $_POST['scc_city'],
)
);
$new_city_id = school_city::create_school_city($_POST['scc_city']);
log::register('new_city', $new_city_id);
header("Location: /admin/cities");
break;
@@ -202,7 +198,12 @@ if (isset($_POST['action'])) {
foreach ($_POST as $key => $value) {
$key_parts = explode('_', $key);
$scc_id = $key_parts[1];
$sql->update_table('school_city', array('scc_city' => $value), array('scc_id' => $scc_id));
if ($key_parts[0] != "order") {
$sql->update_table('school_city', array('scc_city' => $value), array('scc_id' => $scc_id));
}
else {
$sql->update_table('school_city', array('scc_order' => ($value==0?'null':$value)), array('scc_id' => $scc_id));
}
}
log::register('update_city', 'update all');
header("Location: /admin/cities");
@@ -228,25 +229,17 @@ if (isset($_POST['action'])) {
log::register('update_region', 'update all');
header("Location: /admin/regions");
break;
case 'school_create':
case 'school_data_create':
# iskola létrehozása
//todo: iskola object
$new_school_id = $sql->insert_into('school', array(
'sc_name' => $_POST['sc_name'],
)
);
$new_school_id = school::create_school($_POST['sc_name'], $_POST['sc_school_city_scc_id']);
log::register('new_school', $new_school_id);
header("Location: /admin/schools");
break;
case 'school_update':
# school lista updatelése AB-ba
case 'school_data_edit':
# iskola módosítása
unset($_POST['action']);
foreach ($_POST as $key => $value) {
$key_parts = explode('_', $key);
$sc_id = $key_parts[1];
$sql->update_table('school', array('sc_name' => $value), array('sc_id' => $sc_id));
}
log::register('update_school', 'update all');
school::update_school($_POST['sc_id'], $_POST['sc_name'], $_POST['sc_school_city_scc_id']);
log::register('update_school', $_POST['sc_id']);
header("Location: /admin/schools");
break;
default: