case 'registration':
     try {
         $register = new registration($_POST['name'], $_POST['email'], $_POST['last_name'], $_POST['first_name'], $_POST['password']);
         header("Location: index.php?p=login");
     } catch (Exception $e) {
         //put error message to the client
     }
     break;
 case 'post':
     if (!$_POST["post_id"]) {
         $post = new post();
         $post_id = $post->create_post($_POST["title"], $_POST["date"], htmlentities($_POST["content_code"]), $_POST["category"], $_POST["status"], $_POST["tag_list"], $_COOKIE['ea_user']);
         header('Location: index.php?p=edit_post&id=' . $post_id);
     } else {
         $post = new post();
         post::update_post($_POST["title"], $_POST["date"], htmlentities($_POST["content_code"]), $_POST["category"], $_POST["status"], $_POST["tag_list"], $_POST["post_id"]);
         //itt lehet majd bővíteni, kész a többi opció
         header('Location: index.php?p=edit_post&id=' . $_POST["post_id"]);
     }
     break;
 case 'category':
     if (!isset($_POST['cat_name'])) {
         category::update_category_list($_POST);
         header('Location: index.php?p=category');
     } else {
         $category = new category();
         $category->create_category($_POST['cat_name']);
         header('Location: index.php?p=category');
     }
     break;
 case 'page':
Example #2
0
                ?>
' />
                  <tr>
                    <td align='center' colspan='2'>
                      <input class='form-button' type='submit' value='+ CHANGE PASSW0RD +' onclick='return check_change_pass()' name='change_pass_admin' />
                    </td>
                  </tr>
                </table>
              </form>
            </div>
            <?php 
            }
        } elseif (isset($_GET['list-post'])) {
            if (isset($_GET['edit-post']) && !empty($_GET['edit-post'])) {
                if (isset($_POST['submit-edit-post']) && !empty($_POST['submit-edit-post']) && $admcl->check_key_from_id($db, $id, $_POST['auth_key'])) {
                    $ret = $post->update_post($db, $_GET['edit-post'], $_POST['edit_post_title'], $_POST['edit_post_content']);
                    if ($ret) {
                        if (isset($_GET['return']) && $_GET['return'] == 'main') {
                            $htmlinst->change_location('./index.php');
                        } elseif (isset($_GET['return']) && $_GET['return'] == 'mainid') {
                            $htmlinst->change_location('./index.php?id=' . htmlentities($_GET['edit-post']));
                        } else {
                            $htmlinst->admin_inform_ok_url(array('P0ST SUCCESSFULLY UPDATED!'), 'G0 BACK', '?list-post');
                        }
                    } else {
                        $htmlinst->error_admin_url(array('P0ST UPDATE FAiLED', 'TRY AGAiN'), 'G0 BACK', '?list-post');
                    }
                } else {
                    $r_post = $post->get_post_by_id($db, $_GET['edit-post']);
                    ?>
              <form method='post'>