diff --git a/DATABASE.sql b/DATABASE.sql new file mode 100644 index 0000000..40b05b1 --- /dev/null +++ b/DATABASE.sql @@ -0,0 +1,3 @@ +INSERT INTO `badminton_coach`.`setting` (`set_name`, `set_setting_type_st_id`) VALUES ('E-mail küldés log', '3'); + +INSERT INTO `badminton_coach`.`setting_value` (`setv_id`, `setv_set_date`, `setv_setting_set_id`, `setv_varchar`) VALUES (NULL, '2017-03-14 00:00:00', '7', 'emails'); diff --git a/_class/class_email_log.php b/_class/class_email_log.php index 9764e55..0d078c7 100644 --- a/_class/class_email_log.php +++ b/_class/class_email_log.php @@ -4,23 +4,45 @@ class email_log { private $el_id; private $el_message; private $el_subject; - private $el_from_name; - private $el_from_email; + private $el_to_name; + private $el_to_email; private $el_sent_date; private $el_exception; private $el_email_template_et_id; - public function set_et_data_by_id($_id) { + public function set_el_data_by_id($_id) { global $sql; - $et_data_assoc_array = $sql->assoc_array("select * from email_template where et_id = " . $_id); - $et_data_array = $et_data_assoc_array[0]; - foreach ($et_data_array as $field => $value) { + $el_data_assoc_array = $sql->assoc_array("select * from email_log where el_id = " . $_id); + $el_data_array = $el_data_assoc_array[0]; + foreach ($el_data_array as $field => $value) { $function_name = "set_" . $field; $this->$function_name($value); + if ('el_email_template_et_id' == $field) { + $new_et = new email_template(); + $new_et->set_et_data_by_id($value); + $this->set_el_email_template_et_id($new_et); + } } } + public static function create_email_log($_message, $_subject, $_name, $_email, $_et, $_exc = 'null', $_date = null) + { + global $sql; + if (null === $_date) { + $_date = date('Y-m-d H:i:s'); + } + + return $sql->insert_into('email_log', array( + 'el_message' => $_message, + 'el_subject' => $_subject, + 'el_to_name' => $_name, + 'el_to_email' => $_email, + 'el_email_template_et_id' => $_et, + 'el_exception' => $_exc, + 'el_sent_date' => $_date + )); + } /** * @return mixed @@ -85,19 +107,19 @@ class email_log { /** * @return mixed */ - public function get_el_from_name() + public function get_el_to_name() { - return $this->el_from_name; + return $this->el_to_name; } /** - * @param mixed $el_from_name + * @param mixed $el_to_name * * @return self */ - public function set_el_from_name($el_from_name) + public function set_el_to_name($el_to_name) { - $this->el_from_name = $el_from_name; + $this->el_to_name = $el_to_name; return $this; } @@ -105,19 +127,19 @@ class email_log { /** * @return mixed */ - public function get_el_from_email() + public function get_el_to_email() { - return $this->el_from_email; + return $this->el_to_email; } /** - * @param mixed $el_from_email + * @param mixed $el_to_email * * @return self */ - public function set_el_from_email($el_from_email) + public function set_el_to_email($el_to_email) { - $this->el_from_email = $el_from_email; + $this->el_to_email = $el_to_email; return $this; } diff --git a/_class/class_email_template.php b/_class/class_email_template.php index f7c3ce3..fc93831 100644 --- a/_class/class_email_template.php +++ b/_class/class_email_template.php @@ -184,7 +184,7 @@ class email_template { { $matches = null; preg_match_all('/{\$([a-z0-9\_]+)}/', $_raw, $matches); - print_r($matches); + //print_r($matches); //[0] {$variable} //[1] variable diff --git a/_class/class_page.php b/_class/class_page.php index daee6e7..29f7d11 100644 --- a/_class/class_page.php +++ b/_class/class_page.php @@ -247,6 +247,14 @@ class page { # smtp teszt include('include_smtp_test.php'); break; + case 'emails': + # email log + include('include_emails.php'); + break; + case 'email': + # email log details + include('include_email.php'); + break; case 'delete_training_type': # EDZÉS TÍPUS TÖRLÉS include('include_delete_training_type.php'); diff --git a/_class/class_sql.php b/_class/class_sql.php index 17f0207..23fd381 100644 --- a/_class/class_sql.php +++ b/_class/class_sql.php @@ -50,7 +50,7 @@ class sql extends mysqli { $i++; } $this->_query = 'insert into ' . $table . ' (' . $fields . ') values (' . $values . ');'; - //var_dump($this->_query); + var_dump($this->_query); self::query($this->_query); return $this->insert_id; } diff --git a/_css/default.css b/_css/default.css index c9a7e48..60a9fb2 100644 --- a/_css/default.css +++ b/_css/default.css @@ -6,50 +6,50 @@ } html { - + } body { - margin: 0px; - min-height: 100%; - background-color: #aaaaaa; - word-wrap: break-word; + margin: 0px; + min-height: 100%; + background-color: #aaaaaa; + word-wrap: break-word; } #pageContainer { - margin: 0px; - padding: 0px; - position: relative; - min-height: 100vh; - height: 100vh; + margin: 0px; + padding: 0px; + position: relative; + min-height: 100vh; + height: 100vh; } main { - width: 100%; - background-color: #aaaaaa; - min-height: 100vh; + width: 100%; + background-color: #aaaaaa; + min-height: 100vh; } main #main_content { - width: 100%; - min-height: 100vh; - background-color: #fff; - padding: 30px 10px 10px 10px; + width: 100%; + min-height: 100vh; + background-color: #fff; + padding: 30px 10px 10px 10px; + - } main #loading { - width: 100%; - min-height: 100vh; - background-color: #fff; - padding: 30px 10px 10px 10px; + width: 100%; + min-height: 100vh; + background-color: #fff; + padding: 30px 10px 10px 10px; + + - - z-index: 100; background-image: url("/_image/spinner.gif"); @@ -57,75 +57,79 @@ main #loading { background-position: center; } +.left { + text-align: left; +} + .center { - text-align: center; + text-align: center; } .italic { - font-style: italic; + font-style: italic; } .bold { - font-weight: bold; + font-weight: bold; } .right { - text-align: right; + text-align: right; } .float_right { - float: right; + float: right; } .float_left { - float: left; + float: left; } .shuttle_block { - height: 25px; + height: 25px; } .z10 { - z-index: 10; + z-index: 10; } .danger { background-color: #ffdddd; border-left: 6px solid #002E4C; padding: 6px 10px; - margin-top: 16px; - margin-bottom: 16px; - width: 100%; - font-weight: bold; + margin-top: 16px; + margin-bottom: 16px; + width: 100%; + font-weight: bold; } . .checkbox_label { - position: relative; + position: relative; top: 3px; left: 5px; } .error_msg { - color: #ff0000; - font-style: italic; + color: #ff0000; + font-style: italic; } .success_msg { - color: #00ff00; - font-style: italic; + color: #00ff00; + font-style: italic; } ul.topnav span { - color: #f2f2f2; + color: #f2f2f2; } .user_filter { - width: 100%; - clear: both; - margin: 15px 0px; + width: 100%; + clear: both; + margin: 15px 0px; } .user_filter input { @@ -133,279 +137,279 @@ ul.topnav span { } .user_filter select, .user_filter input { - height: 40px; - width: 100%; - border-top: 1px solid #ccc; - border-left: 1px solid #ccc; - border-right: 1px solid #eee; - border-bottom: 1px solid #eee; - margin: 0px 0px 10px 0px; + height: 40px; + width: 100%; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + border-right: 1px solid #eee; + border-bottom: 1px solid #eee; + margin: 0px 0px 10px 0px; } .user_filter select:focus, .user_filter input:focus { - outline: 0; - color: #333; - border-color: rgba(41, 92, 161, 0.4); - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset, 0 0 8px rgba(41, 92, 161, 0.6); + outline: 0; + color: #333; + border-color: rgba(41, 92, 161, 0.4); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset, 0 0 8px rgba(41, 92, 161, 0.6); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset, 0 0 8px rgba(41, 92, 161, 0.6); -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset, 0 0 8px rgba(41, 92, 161, 0.6); - outline: 0 none; + outline: 0 none; } .list .list_item .size20 { - font-size: 20px; + font-size: 20px; } a:link { - text-decoration: none; + text-decoration: none; } a:hover { - text-decoration: underline; + text-decoration: underline; } td.create { - padding: 15px 0px; + padding: 15px 0px; } td.create a { - line-height: 18px; - font-size: 18px; + line-height: 18px; + font-size: 18px; } .list_item table.money { - width: 100%; - padding: 0px; - text-align: left; + width: 100%; + padding: 0px; + text-align: left; } .list_item table.money td.icon { - width: 25px; - padding: 0px; + width: 25px; + padding: 0px; } .list_item table.money td.icon img{ - width: 25px; - height: 25px; + width: 25px; + height: 25px; } .list_item table.money td.sum { - width: 1%; - text-align: right; - white-space: nowrap; - min-width: 90px; + width: 1%; + text-align: right; + white-space: nowrap; + min-width: 90px; } .list_item table.money td.date { - text-align: right; - padding-right: 25px; + text-align: right; + padding-right: 25px; } .list_item table.money td.no_mobile_show { - display: none; + display: none; } .list .name_tag { - text-align: left; - padding: 10px 0px 10px 10px; - margin: 5px 5px 5px 0px; - background-color: #e2edff; - cursor: pointer; + text-align: left; + padding: 10px 0px 10px 10px; + margin: 5px 5px 5px 0px; + background-color: #e2edff; + cursor: pointer; - vertical-align: middle; - width: 100%; - font-size: 18px; - font-family: Arial; - border-left: 2px solid #000; + vertical-align: middle; + width: 100%; + font-size: 18px; + font-family: Arial; + border-left: 2px solid #000; } .name_tag_checked { - width: 100%; - text-align: left; - padding: 10px 0px 10px 10px; - margin: 5px 5px 5px 0px; - background-color: #1eea0b; - cursor: pointer; - border-left: 2px solid #000; - font-size: 18px; - font-family: Arial; + width: 100%; + text-align: left; + padding: 10px 0px 10px 10px; + margin: 5px 5px 5px 0px; + background-color: #1eea0b; + cursor: pointer; + border-left: 2px solid #000; + font-size: 18px; + font-family: Arial; } .user_mod_form { - width: 20px; - float: right; + width: 20px; + float: right; } .list { - clear: both; + clear: both; } .list .list_item { - margin: 4px 0px; - vertical-align: middle; - width: 100%; - padding: 10px 5px; - background-color: #e6e6e6; - font-size: 18px; - font-family: Arial; - border-left: 2px solid #aaa; - min-height: 40px; + margin: 4px 0px; + vertical-align: middle; + width: 100%; + padding: 10px 5px; + background-color: #e6e6e6; + font-size: 18px; + font-family: Arial; + border-left: 2px solid #aaa; + min-height: 40px; } .list .list_item:hover { - background-color: #B7B7B7; - border-left: 2px solid #000; + background-color: #B7B7B7; + border-left: 2px solid #000; } .side_block:hover { - background-color: #B7B7B7; + background-color: #B7B7B7; } .list .list_item img, .list .name_tag img, .list .name_tag_checked img, .active_kid img, .active_coach img{ - width: 20px; - height: 20px; - float: left; - margin-right: 5px; + width: 20px; + height: 20px; + float: left; + margin-right: 5px; } .list .add_deposit { - position: relative; - top: -30px; - right: 3px; - cursor: pointer; - padding: 0px !important; - margin: 0px !important; + position: relative; + top: -30px; + right: 3px; + cursor: pointer; + padding: 0px !important; + margin: 0px !important; } .list .add_deposit img { - width: 22px; + width: 22px; } .list a { - color: #473C3C; - font-family: Arial; - font-weight: bold; + color: #473C3C; + font-family: Arial; + font-weight: bold; } .list a:hover { - text-decoration: none; + text-decoration: none; } .list .date_separator { - font-size: 20px; - width: 100%; - display: inline-block; - font-weight: bold; - background-color: #333; - color: #f2f2f2; - padding: 3px 0px 2px 5px; - margin-bottom: 5px; + font-size: 20px; + width: 100%; + display: inline-block; + font-weight: bold; + background-color: #333; + color: #f2f2f2; + padding: 3px 0px 2px 5px; + margin-bottom: 5px; } .list_item label { - font-weight: bold; + font-weight: bold; } .bigger_space { - margin: 10px 0px !important; + margin: 10px 0px !important; } .balance { - clear: both; - text-align: center; - margin: 10px 0px 15px 0px; - font-size: 20px; - font-weight: bold; - padding: 0px 5px; - border-bottom: 2px solid; - width: 100%; + clear: both; + text-align: center; + margin: 10px 0px 15px 0px; + font-size: 20px; + font-weight: bold; + padding: 0px 5px; + border-bottom: 2px solid; + width: 100%; } .transp { - opacity: 0.5; + opacity: 0.5; } .line_height14 { - line-height: 1.4; + line-height: 1.4; } .list .width70 { - width: 70%; + width: 70%; } table.log { - width: 100%; - border-collapse: collapse; + width: 100%; + border-collapse: collapse; } -table.log td { - padding: 4px; +table.log td, table.log th { + padding: 4px; } table.log img { - width: 15px; - height: 15px; + width: 15px; + height: 15px; } table.log tr.login { - background-color: #e4d7d7; + background-color: #e4d7d7; } table.log tr.lock, table.log tr.edit { - background-color: #fbff68; + background-color: #fbff68; } table.log tr.tick { - background-color: #91ff68; + background-color: #91ff68; } table.log tr.delete { - background-color: #ff9797; + background-color: #ff9797; } table.log tr.login:hover { - background-color: #aaa; + background-color: #aaa; } table.log tr.lock:hover, table.log tr.edit:hover { - background-color: #ff0; + background-color: #ff0; } table.log tr.tick:hover { - background-color: #36ae09; + background-color: #36ae09; } table.log tr.delete:hover { - background-color: #f02a2a; + background-color: #f02a2a; } .date_separator img { - width: 20px; - float: right; - margin-top: 4px; - margin-right: 10px; - border: 0; - cursor: pointer; + width: 20px; + float: right; + margin-top: 4px; + margin-right: 10px; + border: 0; + cursor: pointer; } .list .date_separator:hover { - background-color: #120909; + background-color: #120909; } #main_content { - display: none; + display: none; } .clickable { - cursor: pointer; + cursor: pointer; } .diary_header .balance_text { - display: none; + display: none; } @@ -416,100 +420,100 @@ table.log tr.delete:hover { .kid_menu, .coach_menu { - display: none; - background-color: #B7B7B7; - border-left: 2px solid #000; - position: relative; - top: -4px; + display: none; + background-color: #B7B7B7; + border-left: 2px solid #000; + position: relative; + top: -4px; } .active_kid, .active_coach { - background-color: #333; - color: #fff; - font-weight: bold; - border-left: 2px solid #000; - vertical-align: middle; - font-size: 18px; - font-family: Arial; - margin: 4px 0px; - padding: 10px 5px; + background-color: #333; + color: #fff; + font-weight: bold; + border-left: 2px solid #000; + vertical-align: middle; + font-size: 18px; + font-family: Arial; + margin: 4px 0px; + padding: 10px 5px; } .kid_menu .kid_submenu, .coach_menu .coach_submenu { - text-align: center; - cursor: pointer; - border-bottom: 1px dotted black; - padding: 6px 0px; + text-align: center; + cursor: pointer; + border-bottom: 1px dotted black; + padding: 6px 0px; } .kid_menu .kid_submenu:hover, .coach_menu .coach_submenu:hover { - background-color: #7b7575; + background-color: #7b7575; } .kid_menu .kid_submenu:hover span, .coach_menu .coach_submenu:hover span { - color: #e9e2e1; + color: #e9e2e1; } .kid_menu .add_money_deposit, .coach_menu .add_money_deposit { - width: 46%; - text-align: center; - display: inline-block; - position: relative; + width: 46%; + text-align: center; + display: inline-block; + position: relative; } .kid_menu .view_parent_view, .coach_menu .view_parent_view { - width: 48%; - text-align: center; - display: inline-block; - position: relative; - border-left: 1px solid; + width: 48%; + text-align: center; + display: inline-block; + position: relative; + border-left: 1px solid; } .kid_menu img, .coach_menu img { - width: 20px; - height: 20px; - position: relative; - top: 2px; + width: 20px; + height: 20px; + position: relative; + top: 2px; } .kid_menu span, .coach_menu span { - position: relative; - top: -1px; - color: #473C3C; - font-family: Arial; - font-weight: bold; + position: relative; + top: -1px; + color: #473C3C; + font-family: Arial; + font-weight: bold; } .kid_menu a:link, .coach_menu a:link { - color: #000; + color: #000; } .kid_menu span:hover, .coach_menu span:hover { - text-decoration: underline; + text-decoration: underline; } .kid_menu:hover, .coach_menu:hover { - cursor: pointer; + cursor: pointer; } .navigator { - display: block; - text-align: center; - margin: 10px 0px; + display: block; + text-align: center; + margin: 10px 0px; } .navigator img { - width: 40px; + width: 40px; } .navigator div { - width: 100px; - display: inline-block; + width: 100px; + display: inline-block; } .navigator .previous img { - -moz-transform: scaleX(-1); + -moz-transform: scaleX(-1); -o-transform: scaleX(-1); -webkit-transform: scaleX(-1); transform: scaleX(-1); @@ -518,309 +522,309 @@ table.log tr.delete:hover { } .grayscale { - opacity: 0.3; + opacity: 0.3; filter: alpha(opacity=30); /* For IE8 and earlier */ } .apply_table { - width: 100%; - text-align: center; - min-width: 800px; - border-collapse: collapse; - margin: 0px 0px 20px 0px; + width: 100%; + text-align: center; + min-width: 800px; + border-collapse: collapse; + margin: 0px 0px 20px 0px; } .smaller { - min-width: 588px; - width: 50%; + min-width: 588px; + width: 50%; } .apply_table th { - background-color: #000; - color: #fff; - padding: 5px; + background-color: #000; + color: #fff; + padding: 5px; } .apply_table td { - padding: 5px; + padding: 5px; } .apply_table tr:hover td{ - background: #eeeeee; + background: #eeeeee; } .apply_table img { - width: 25px; + width: 25px; } .pending { - float: right; + float: right; } h1.apply { - text-align: center; + text-align: center; } .outer { - overflow-x: scroll; - width: 80%; - display: block; - margin: 30px auto 50px auto; + overflow-x: scroll; + width: 80%; + display: block; + margin: 30px auto 50px auto; } #footer_control { - position: fixed; - bottom: 0; - left: 0; - height: 50px; - background: #3d3d3d; - display: block; - width: 100%; - overflow: auto; + position: fixed; + bottom: 0; + left: 0; + height: 50px; + background: #3d3d3d; + display: block; + width: 100%; + overflow: auto; } .list .member { - background-color: #20b495; - border-left: 3px solid black; + background-color: #20b495; + border-left: 3px solid black; } .list .member:hover { - background-color: #93e9ac; - border-left: 3px solid black; + background-color: #93e9ac; + border-left: 3px solid black; } .toggle { - width: 50px; - height: 120px; - position: relative; - right: -5px; - top: -10px; - background-color: #edfc5a; - float: right; - border-right: 3px solid; - cursor: pointer; + width: 50px; + height: 120px; + position: relative; + right: -5px; + top: -10px; + background-color: #edfc5a; + float: right; + border-right: 3px solid; + cursor: pointer; } .list .list_item .toggle img { - position: relative; - left: 12px; - top: 45px; - width: 25px; - height: 25px; + position: relative; + left: 12px; + top: 45px; + width: 25px; + height: 25px; } .nested { - position: relative; - right: 25px; - height: 28px; - border-radius: 0px 10px 7px 0px; - top: 1px; - width: 35px; + position: relative; + right: 25px; + height: 28px; + border-radius: 0px 10px 7px 0px; + top: 1px; + width: 35px; } #footer_toggle { - width: 60px; - height: 50px; - background: #e0e0e0; - float: right; - cursor: pointer; - position: fixed; - bottom: 0; - right: 0; + width: 60px; + height: 50px; + background: #e0e0e0; + float: right; + cursor: pointer; + position: fixed; + bottom: 0; + right: 0; } #footer_toggle img { - width: 50px; + width: 50px; } .category_list { - width: 70%; - display: block; - margin: 5px 2% 5px 8%; + width: 70%; + display: block; + margin: 5px 2% 5px 8%; } .add_category { - width: 50%; - margin: 5px 2% 0px 15%; + width: 50%; + margin: 5px 2% 0px 15%; } .name_span { - margin: 5px auto; - display: block; - text-align: center; + margin: 5px auto; + display: block; + text-align: center; } .bigger_padding { - padding: 20px 0px 50px 0px; + padding: 20px 0px 50px 0px; } form#auto_filters > div > label { - padding-top: 0px; + padding-top: 0px; } .category_tab { - padding: 3px; - border: 1px solid; - border-radius: 3px; - margin-right: 5px; + padding: 3px; + border: 1px solid; + border-radius: 3px; + margin-right: 5px; } .categories { - display: inline-block; - padding: 10px 45px 10px 45px; - margin: 0; - width: 100%; - text-align: center; + display: inline-block; + padding: 10px 45px 10px 45px; + margin: 0; + width: 100%; + text-align: center; } #categories { - display: inline; + display: inline; } @media (min-width: 680px) { .categories { - width: unset; - text-align: left; - margin: 0px 0px 0px 45px; - padding: 0; + width: unset; + text-align: left; + margin: 0px 0px 0px 45px; + padding: 0; } .toggle { - width: 50px; - height: 50px; - position: relative; - right: -5px; - top: -10px; - background-color: #edfc5a; - float: right; - border-right: 3px solid; - cursor: pointer; + width: 50px; + height: 50px; + position: relative; + right: -5px; + top: -10px; + background-color: #edfc5a; + float: right; + border-right: 3px solid; + cursor: pointer; } .list .list_item .toggle img { - position: relative; - left: 12px; - top: 10px; - width: 25px; - height: 25px; + position: relative; + left: 12px; + top: 10px; + width: 25px; + height: 25px; } .name_span { - min-width: 200px; - display: inline-block; - margin: 0; + min-width: 200px; + display: inline-block; + margin: 0; } .category_list { - width: 25%; - margin: 0; - display: inline; + width: 25%; + margin: 0; + display: inline; } .add_category { - width: 25%; - margin: 0; + width: 25%; + margin: 0; } .list .date_separator { - width: 100%; + width: 100%; } .balance { - clear: both; - text-align: left; - margin: 10px 0px 15px 0px; - font-size: 20px; - font-weight: bold; - padding-left: 5px; - border-bottom: 2px solid; - width: 30%; + clear: both; + text-align: left; + margin: 10px 0px 15px 0px; + font-size: 20px; + font-weight: bold; + padding-left: 5px; + border-bottom: 2px solid; + width: 30%; } .list_item table.money td.no_mobile_show { - display: table-cell; + display: table-cell; } .list_item table.money td.sum { - width: 1%; - white-space: nowrap; + width: 1%; + white-space: nowrap; } .list_item table.money td.quarter_width { - width: 25%; - min-width: 100px; - text-align: left; + width: 25%; + min-width: 100px; + text-align: left; } } -@media (min-width: 1250px) { - .half_width { - width: 50% !important; - } +@media (min-width: 1250px) { + .half_width { + width: 50% !important; + } - .full_width { - width: 90% !important; - } + .full_width { + width: 90% !important; + } - .list_item label { - float: left; - padding-right: 5px; - text-align: right; + .list_item label { + float: left; + padding-right: 5px; + text-align: right; - } + } - .danger { - width: 90%; - } + .danger { + width: 90%; + } - .wide { - width: 80% !important; - } + .wide { + width: 80% !important; + } - .user_filter { - width: 90%; - } + .user_filter { + width: 90%; + } - .user_filter select { - width: 40%; - max-width: 200px; - } + .user_filter select { + width: 40%; + max-width: 200px; + } - .user_filter input { - width: 40%; - float: left; - margin: 0px 10px 0px 0px; - } + .user_filter input { + width: 40%; + float: left; + margin: 0px 10px 0px 0px; + } - main #main_content, main #loading { - width: 100%; - margin: 0px auto; - } + main #main_content, main #loading { + width: 100%; + margin: 0px auto; + } - .list { - width: 40%; - min-width: 400px; - } + .list { + width: 40%; + min-width: 400px; + } - .list .list_item, .list .name_tag, .list .name_tag_checked { - width: 100%; - } + .list .list_item, .list .name_tag, .list .name_tag_checked { + width: 100%; + } - .info { - margin: 20px; - } + .info { + margin: 20px; + } - .diary_header { - width: 35%; - } + .diary_header { + width: 35%; + } - .diary_header .balance_text { - - } - + .diary_header .balance_text { -} \ No newline at end of file + } + + +} diff --git a/_include/include_email.php b/_include/include_email.php new file mode 100644 index 0000000..abe2113 --- /dev/null +++ b/_include/include_email.php @@ -0,0 +1,17 @@ +is_id()) { + + # EMAIL LOG RÉSZLETEK + + $email_log = new email_log(); + $email_log->set_el_data_by_id($this->get_id()); + + $smarty->assign('email_log', $email_log); + $smarty->display('email.tpl'); +} +else { + +} + +?> diff --git a/_include/include_emails.php b/_include/include_emails.php new file mode 100644 index 0000000..2566b59 --- /dev/null +++ b/_include/include_emails.php @@ -0,0 +1,37 @@ +is_id()) { + + # EMAIL LISTA (50 / oldal) + + $all_emails_query = "SELECT count(DISTINCT el_id) FROM email_log"; + $emails_query = "SELECT * FROM email_log LIMIT ".($this->is_id()?($this->get_id()-1) * 50:"0").",50"; + $el_assoc_array = $sql->assoc_array($emails_query); + $el_count = $sql->single_variable($all_emails_query); + $next_link = true; + + $el_array = array(); + foreach ($el_assoc_array as $key => $el) { + $new_el = new email_log(); + $new_el->set_el_data_by_id($el['el_id']); + $el_array[] = $new_el; + } + + $fold = $el_count > 50; + + if ($el_count <= $this->get_id()*50) { + $next_link = false; + } + + $smarty->assign('el_array', $el_array); + $smarty->assign('fold', $fold); + $smarty->assign('next_id', $next_link?$this->get_id()+1:false); + $smarty->assign('previous_id', ($this->get_id()>1?$this->get_id()-1:false)); + + $smarty->display('emails.tpl'); +} +else { + header("Location: /admin/emails/1"); +} + +?> diff --git a/_include/include_lock_training.php b/_include/include_lock_training.php index 929bff1..c030cd8 100644 --- a/_include/include_lock_training.php +++ b/_include/include_lock_training.php @@ -67,6 +67,7 @@ if ($this->is_id()) { $raw_subject = $emailTemplate->get_et_subject(); $raw_message = $emailTemplate->get_et_message(); + //var_dump($kid_array); foreach ($kid_array as $kid) { $personalizedSubject = $emailTemplate->personalize($raw_subject, array( 'uk_name' => $kid->get_uk_name(), @@ -94,7 +95,7 @@ if ($this->is_id()) { //Recipients $mail->setFrom($emailTemplate->get_et_from_email(), $emailTemplate->get_et_from_name()); $mail->addBCC('tricsusz@gmail.com', 'Tóth Richárd'); // TEST - $mail->addBCC($kid->get_uk_notify_email(), $kid->get_uk_notify_name()); + //$mail->addBCC($kid->get_uk_notify_email(), $kid->get_uk_notify_name()); //Content @@ -105,8 +106,26 @@ if ($this->is_id()) { //$mail->send(); //LOG SUCCESS + email_log::create_email_log( + $personalizedMessage, + $personalizedSubject, + $kid->get_uk_notify_name(), + $kid->get_uk_notify_email(), + $emailTemplate->get_et_id() + ); + + //TODO: Update kids last noti date + } catch (Exception $e) { //LOG ERROR + email_log::create_email_log( + $personalizedMessage, + $personalizedSubject, + $kid->get_uk_notify_name(), + $kid->get_uk_notify_email(), + $emailTemplate->get_et_id(), + $e + ); } } diff --git a/_include/include_log.php b/_include/include_log.php index aa706c6..a237872 100644 --- a/_include/include_log.php +++ b/_include/include_log.php @@ -17,69 +17,69 @@ $fold = true; //ha nem a gyerek belépéseit kérjük le ÉS létezik postolt logcategory és (nem létezik a cookie VAGY létezik de nem egyenlő az eddigivel) $selected = ""; if (!isset($_REQUEST['login_kid']) && isset($_REQUEST['log_category']) && (!isset($_COOKIE['log_category']) || (isset($_COOKIE['log_category']) && $_COOKIE['log_category'] != $_REQUEST['log_category']))) { - if ($_REQUEST['log_category'] != 'null') $condition = "WHERE log_log_category_logc_id = " . $_REQUEST['log_category']; - //beállítjuk a cookie-t, rövid élettartammal - setcookie("log_category", $_REQUEST['log_category'], time()+60*60, '/'); - $selected = $_REQUEST['log_category']; - $update = true; + if ($_REQUEST['log_category'] != 'null') $condition = "WHERE log_log_category_logc_id = " . $_REQUEST['log_category']; + //beállítjuk a cookie-t, rövid élettartammal + setcookie("log_category", $_REQUEST['log_category'], time()+60*60, '/'); + $selected = $_REQUEST['log_category']; + $update = true; } elseif (isset($_REQUEST['login_kid'])) { - //lekérjük a gyerek befizetéseit + hideoljuk a lapozót - $condition = "WHERE log_log_category_logc_id = 3 and log_user_id = " . $_REQUEST['login_kid']; - $fold = false; + //lekérjük a gyerek befizetéseit + hideoljuk a lapozót + $condition = "WHERE log_log_category_logc_id = 3 and log_user_id = " . $_REQUEST['login_kid']; + $fold = false; } //COOKIE HANDLER - igazából ide kell a condition leírása if (isset($_COOKIE['log_category']) && $_COOKIE['log_category'] != 'null' && !$update && !isset($_REQUEST['login_kid'])) { - $condition = "WHERE log_log_category_logc_id = " . $_COOKIE['log_category']; - $selected = $_COOKIE['log_category']; + $condition = "WHERE log_log_category_logc_id = " . $_COOKIE['log_category']; + $selected = $_COOKIE['log_category']; } foreach ($logc_assoc_array as $logc_array) { - $new_logc = new log_category(); - $new_logc->set_logc_data_by_id($logc_array['logc_id']); - $log_categories[] = $new_logc; + $new_logc = new log_category(); + $new_logc->set_logc_data_by_id($logc_array['logc_id']); + $log_categories[] = $new_logc; } if ($this->is_id()) { - # LOG LIST FILTERED - //50esével megyünk - $from = ($this->get_id() - 1) * 50; - $log_query = "SELECT * FROM log " . (isset($condition)?$condition:"") . " ORDER BY log_date DESC " . ($fold?"LIMIT ".$from.",50;":""); - $log_count = $sql->num_of_rows("SELECT * FROM log ".(isset($condition)?$condition:"")." ORDER BY log_date DESC;"); - //echo $log_count; - if ($log_count <= $this->get_id()*50) { - $next_link = false; - } - $smarty->assign('next_id', ($next_link?$this->get_id()+1:false)); - $smarty->assign('previous_id', ($this->get_id()>1?$this->get_id()-1:false)); + # LOG LIST FILTERED + //50esével megyünk + $from = ($this->get_id() - 1) * 50; + $log_query = "SELECT * FROM log " . (isset($condition)?$condition:"") . " ORDER BY log_date DESC " . ($fold?"LIMIT ".$from.",50;":""); + $log_count = $sql->num_of_rows("SELECT * FROM log ".(isset($condition)?$condition:"")." ORDER BY log_date DESC;"); + //echo $log_count; + if ($log_count <= $this->get_id()*50) { + $next_link = false; + } + $smarty->assign('next_id', ($next_link?$this->get_id()+1:false)); + $smarty->assign('previous_id', ($this->get_id()>1?$this->get_id()-1:false)); - $log_assoc_array = $sql->assoc_array($log_query); - $log_array = array(); - foreach ($log_assoc_array as $log_list_array) { - $current_log = new log(); - $current_log->set_log_data_by_id($log_list_array['log_id']); - $log_array[] = $current_log; - } + $log_assoc_array = $sql->assoc_array($log_query); + $log_array = array(); + foreach ($log_assoc_array as $log_list_array) { + $current_log = new log(); + $current_log->set_log_data_by_id($log_list_array['log_id']); + $log_array[] = $current_log; + } - $smarty->assign('selected', $selected); - $smarty->assign('fold', $fold); - $smarty->assign('logc_array', $log_categories); - $smarty->assign('log_array', $log_array); - $smarty->display('log.tpl'); + $smarty->assign('selected', $selected); + $smarty->assign('fold', $fold); + $smarty->assign('logc_array', $log_categories); + $smarty->assign('log_array', $log_array); + $smarty->display('log.tpl'); } else { - # LOG LIST - header("Location: /admin/log/1"); - /* - $log_query = "SELECT * FROM log ORDER BY log_date DESC LIMIT 50;"; - $previous_link = false; - $smarty->assign('next_id', '2'); - */ + # LOG LIST + header("Location: /admin/log/1"); + /* + $log_query = "SELECT * FROM log ORDER BY log_date DESC LIMIT 50;"; + $previous_link = false; + $smarty->assign('next_id', '2'); + */ } -?> \ No newline at end of file +?> diff --git a/template/templates/emails.tpl b/template/templates/emails.tpl new file mode 100644 index 0000000..df8b298 --- /dev/null +++ b/template/templates/emails.tpl @@ -0,0 +1,69 @@ +{if $fold} + + + +{/if} + +
+ + + + + + + + + + {foreach $el_array as $log} + + + + + + + + + {/foreach} +
#IDCímzettKiküldés dátumaTárgyÜzenetHibaüzenet
+ +
+ +