diff --git a/_class/class_login.php b/_class/class_login.php index f540a8a..e1e99d0 100755 --- a/_class/class_login.php +++ b/_class/class_login.php @@ -58,7 +58,7 @@ class login { (ua_name = '" . $_user_name . "' AND ua_password = '" . md5($_user_password ) . "')"; - echo $check_query; + //echo $check_query; if ($sql->num_of_rows($check_query)) return $sql->single_variable($check_query); diff --git a/_class/class_page.php b/_class/class_page.php index ff9dee5..f2f1770 100755 --- a/_class/class_page.php +++ b/_class/class_page.php @@ -113,6 +113,10 @@ class page { $tpl = "presence"; include('include_presence.php'); break; + case 'schools': + # ISKOLÁK + include('include_schools.php'); + break; case 'training_types': # EDZÉS TÍPUSOK include('include_training_types.php'); @@ -145,6 +149,10 @@ class page { # KÖRZET TÖRLÉS include('include_delete_region.php'); break; + case 'delete_school': + # ISKOLA TÖRLÉS + include('include_delete_school.php'); + break; case 'logout': # kijelentkezés $from = "coach"; diff --git a/_image/addbutton.png b/_image/addbutton.png deleted file mode 100644 index 08f9769..0000000 Binary files a/_image/addbutton.png and /dev/null differ diff --git a/_image/coach.png b/_image/coach.png deleted file mode 100644 index 1d397b8..0000000 Binary files a/_image/coach.png and /dev/null differ diff --git a/_image/letszam.png b/_image/letszam.png deleted file mode 100644 index 2eecf1c..0000000 Binary files a/_image/letszam.png and /dev/null differ diff --git a/_image/shirt.png b/_image/shirt.png deleted file mode 100644 index 5d1dc9f..0000000 Binary files a/_image/shirt.png and /dev/null differ diff --git a/_image/shuttlecock.png b/_image/shuttlecock.png deleted file mode 100644 index e07500b..0000000 Binary files a/_image/shuttlecock.png and /dev/null differ diff --git a/_image/time.png b/_image/time.png deleted file mode 100644 index ba32593..0000000 Binary files a/_image/time.png and /dev/null differ diff --git a/_image/tipus.png b/_image/tipus.png deleted file mode 100644 index d648b54..0000000 Binary files a/_image/tipus.png and /dev/null differ diff --git a/_image/training.png b/_image/training.png deleted file mode 100644 index e7e73ed..0000000 Binary files a/_image/training.png and /dev/null differ diff --git a/_include/include_create.php b/_include/include_create.php index 0671102..a709afe 100755 --- a/_include/include_create.php +++ b/_include/include_create.php @@ -72,9 +72,13 @@ switch ($this->get_id()) { $smarty->display('city_create.tpl'); break; case 'region': - # CITY létrehozása + # REGION létrehozása $smarty->display('region_create.tpl'); break; + case 'school': + # SCHOOL létrehozása + $smarty->display('school_create.tpl'); + break; default: # code... break; diff --git a/_include/include_delete_school.php b/_include/include_delete_school.php new file mode 100644 index 0000000..a630d74 --- /dev/null +++ b/_include/include_delete_school.php @@ -0,0 +1,10 @@ +is_id()) { + $delete_query = "DELETE FROM school WHERE sc_id = " . $this->get_id() . ";"; + $sql->execute_query($delete_query); + header("Location: /admin/schools"); +} + + +?> \ No newline at end of file diff --git a/_include/include_members.php b/_include/include_members.php index 6aad309..cedd69a 100755 --- a/_include/include_members.php +++ b/_include/include_members.php @@ -11,16 +11,16 @@ if ($this->is_id()) { $shirt_size_query = "SELECT * FROM shirt;"; $shirt_size_assoc_array = $sql->assoc_array($shirt_size_query); //szülő array - $parent_query = "SELECT * FROM user_parent;"; + $parent_query = "SELECT * FROM user_parent ORDER BY up_name ASC;"; $parent_assoc_array = $sql->assoc_array($parent_query); //SCHOOL ARRAY - $school_query = "SELECT * FROM school;"; + $school_query = "SELECT * FROM school ORDER BY sc_name ASC;"; $school_assoc_array = $sql->assoc_array($school_query); //SCHOOL CITY ARRAY - $school_city_query = "SELECT * FROM school_city;"; + $school_city_query = "SELECT * FROM school_city ORDER BY scc_city ASC;"; $school_city_assoc_array = $sql->assoc_array($school_city_query); //REGION ARRAY - $region_query = "SELECT * FROM region;"; + $region_query = "SELECT * FROM region ORDER BY reg_name ASC;"; $region_assoc_array = $sql->assoc_array($region_query); //smarty thingz $smarty->assign('school_assoc_array', $school_assoc_array); diff --git a/_include/include_schools.php b/_include/include_schools.php new file mode 100644 index 0000000..80bea88 --- /dev/null +++ b/_include/include_schools.php @@ -0,0 +1,30 @@ +is_id()) { + + # ISKOLA SZERKESZTÉSE + + +} + +else { + + # ISKOLA LISTA + + $tr_type_query = "SELECT * FROM school ORDER BY sc_name ASC"; + $tr_type_assoc_array = $sql->assoc_array($tr_type_query); + + $smarty->assign('school_assoc_array',$tr_type_assoc_array); + $smarty->display('school_list.tpl'); + + +} + + + + + +?> \ No newline at end of file diff --git a/event_handler.php b/event_handler.php index 2b825c2..5adf9ae 100755 --- a/event_handler.php +++ b/event_handler.php @@ -211,6 +211,25 @@ if (isset($_POST['action'])) { header("Location: /admin/regions"); } break; + case 'school_create': + # iskola létrehozása + //todo: iskola object + $sql->insert_into('school', array( + 'sc_name' => $_POST['sc_name'], + ) + ); + header("Location: /admin/schools"); + break; + case 'school_update': + # school lista updatelése AB-ba + 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)); + header("Location: /admin/schools"); + } + break; default: # code... break; diff --git a/template/templates/school_create.tpl b/template/templates/school_create.tpl new file mode 100644 index 0000000..beee860 --- /dev/null +++ b/template/templates/school_create.tpl @@ -0,0 +1,18 @@ +