@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - header ( 'Content-type: text/plain'); |
|
| 4 | - echo " |
|
| 3 | + header ( 'Content-type: text/plain'); |
|
| 4 | + echo " |
|
| 5 | 5 | Now see here, you will see the output of the param most |
| 6 | 6 | interesting to PHP. \$_POST. |
| 7 | 7 | |
@@ -13,4 +13,4 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | print_r(\$_POST); |
| 15 | 15 | "; |
| 16 | - print_r($_POST); |
|
| 17 | 16 | \ No newline at end of file |
| 17 | + print_r($_POST); |
|
| 18 | 18 | \ No newline at end of file |
@@ -155,9 +155,9 @@ |
||
| 155 | 155 | <table align="center" border="0" cellpadding="0" cellspacing="0"> |
| 156 | 156 | <tr><td> |
| 157 | 157 | <? |
| 158 | - if(isset($_REQUEST['issubmit'])){
|
|
| 159 | - echo "<strong>form is sumbitted</strong>"; |
|
| 160 | - } |
|
| 158 | + if(isset($_REQUEST['issubmit'])){
|
|
| 159 | + echo "<strong>form is sumbitted</strong>"; |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | 162 | ?> |
| 163 | 163 | |
@@ -1,26 +1,26 @@ discard block |
||
| 1 | 1 | <? |
| 2 | - $action = $_REQUEST["action"]; |
|
| 3 | - switch($action){
|
|
| 4 | - case "1": |
|
| 2 | + $action = $_REQUEST["action"]; |
|
| 3 | + switch($action){
|
|
| 4 | + case "1": |
|
| 5 | 5 | getContent(); |
| 6 | 6 | break; |
| 7 | - default: |
|
| 7 | + default: |
|
| 8 | 8 | break; |
| 9 | - } |
|
| 9 | + } |
|
| 10 | 10 | |
| 11 | - function getContent(){
|
|
| 12 | - //sleep(1); |
|
| 13 | - $step_number = $_REQUEST["step_number"]; |
|
| 14 | - $html = '<h2 class="StepTitle">Step '.$step_number.' Content</h2>'; |
|
| 15 | - if($step_number == 1){
|
|
| 16 | - $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
|
| 11 | + function getContent(){
|
|
| 12 | + //sleep(1); |
|
| 13 | + $step_number = $_REQUEST["step_number"]; |
|
| 14 | + $html = '<h2 class="StepTitle">Step '.$step_number.' Content</h2>'; |
|
| 15 | + if($step_number == 1){
|
|
| 16 | + $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
|
| 17 | 17 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, |
| 18 | 18 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
| 19 | 19 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
| 20 | 20 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
| 21 | 21 | </p>'; |
| 22 | - }elseif($step_number == 2){
|
|
| 23 | - $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
|
| 22 | + }elseif($step_number == 2){
|
|
| 23 | + $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
|
| 24 | 24 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, |
| 25 | 25 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
| 26 | 26 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
| 33 | 33 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
| 34 | 34 | </p>'; |
| 35 | - }elseif($step_number == 3){
|
|
| 36 | - $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
|
| 35 | + }elseif($step_number == 3){
|
|
| 36 | + $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
|
| 37 | 37 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, |
| 38 | 38 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
| 39 | 39 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
@@ -51,15 +51,15 @@ discard block |
||
| 51 | 51 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
| 52 | 52 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
| 53 | 53 | </p>'; |
| 54 | - }else{
|
|
| 55 | - $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
|
| 54 | + }else{
|
|
| 55 | + $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
|
| 56 | 56 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, |
| 57 | 57 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
| 58 | 58 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
| 59 | 59 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
| 60 | 60 | </p>'; |
| 61 | - } |
|
| 62 | - echo $html; |
|
| 63 | - } |
|
| 61 | + } |
|
| 62 | + echo $html; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | 65 | ?> |
| 66 | 66 | \ No newline at end of file |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
| 20 | 20 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
| 21 | 21 | </p>'; |
| 22 | - }elseif($step_number == 2){
|
|
| 22 | + } elseif($step_number == 2){
|
|
| 23 | 23 | $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
| 24 | 24 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, |
| 25 | 25 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
| 33 | 33 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
| 34 | 34 | </p>'; |
| 35 | - }elseif($step_number == 3){
|
|
| 35 | + } elseif($step_number == 3){
|
|
| 36 | 36 | $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
| 37 | 37 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, |
| 38 | 38 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. |
| 52 | 52 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
| 53 | 53 | </p>'; |
| 54 | - }else{
|
|
| 54 | + } else{
|
|
| 55 | 55 | $html .='<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, |
| 56 | 56 | sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, |
| 57 | 57 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. |
@@ -86,8 +86,7 @@ |
||
| 86 | 86 | $this->session->getStorage()->user = $this->adminUserService->loginUser($email, $password); |
| 87 | 87 | |
| 88 | 88 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin')); |
| 89 | - } |
|
| 90 | - catch(\Exception $e) { |
|
| 89 | + } catch(\Exception $e) { |
|
| 91 | 90 | return $this->login($e->getMessage()); |
| 92 | 91 | |
| 93 | 92 | //@todo set $e->getMessage() to flash messanger and print messages in next page |
@@ -85,17 +85,14 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | if($id){ |
| 87 | 87 | $this->categoryService->updateCategory($data, $id); |
| 88 | - } |
|
| 89 | - else{ |
|
| 88 | + } else{ |
|
| 90 | 89 | $this->categoryService->createCategory($data); |
| 91 | 90 | } |
| 92 | 91 | |
| 93 | 92 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.categories')); |
| 94 | - } |
|
| 95 | - catch(FilterException $fe){ |
|
| 93 | + } catch(FilterException $fe){ |
|
| 96 | 94 | return $this->edit($fe->getArrayMessages()); |
| 97 | - } |
|
| 98 | - catch(\Exception $e){ |
|
| 95 | + } catch(\Exception $e){ |
|
| 99 | 96 | throw $e; |
| 100 | 97 | } |
| 101 | 98 | } |
@@ -107,8 +104,7 @@ discard block |
||
| 107 | 104 | $this->categoryService->delete($id); |
| 108 | 105 | |
| 109 | 106 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.categories')); |
| 110 | - } |
|
| 111 | - catch(\Exception $e){ |
|
| 107 | + } catch(\Exception $e){ |
|
| 112 | 108 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.categories')); |
| 113 | 109 | } |
| 114 | 110 | } |
@@ -64,17 +64,14 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | if($id){ |
| 66 | 66 | $this->menuService->updateMenuItem($data, $id); |
| 67 | - } |
|
| 68 | - else{ |
|
| 67 | + } else{ |
|
| 69 | 68 | $this->menuService->addMenuItem($data); |
| 70 | 69 | } |
| 71 | 70 | |
| 72 | 71 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.menu')); |
| 73 | - } |
|
| 74 | - catch(FilterException $fe){ |
|
| 72 | + } catch(FilterException $fe){ |
|
| 75 | 73 | return $this->edit($fe->getArrayMessages()); |
| 76 | - } |
|
| 77 | - catch(\Exception $e){ |
|
| 74 | + } catch(\Exception $e){ |
|
| 78 | 75 | throw $e; |
| 79 | 76 | } |
| 80 | 77 | } |
@@ -86,8 +83,7 @@ discard block |
||
| 86 | 83 | $this->menuService->delete($id); |
| 87 | 84 | |
| 88 | 85 | return $this->response->withStatus(302)->withHeader('Location', $this->router->generateUri('admin.menu')); |
| 89 | - } |
|
| 90 | - catch(\Exception $e){ |
|
| 86 | + } catch(\Exception $e){ |
|
| 91 | 87 | throw $e; |
| 92 | 88 | } |
| 93 | 89 | } |
@@ -90,11 +90,9 @@ discard block |
||
| 90 | 90 | } else { |
| 91 | 91 | $this->discussionService->createArticle($user, $data); |
| 92 | 92 | } |
| 93 | - } |
|
| 94 | - catch(FilterException $fe) { |
|
| 93 | + } catch(FilterException $fe) { |
|
| 95 | 94 | return $this->edit($fe->getArrayMessages()); |
| 96 | - } |
|
| 97 | - catch(\Exception $e) { |
|
| 95 | + } catch(\Exception $e) { |
|
| 98 | 96 | throw $e; |
| 99 | 97 | } |
| 100 | 98 | |
@@ -105,8 +103,7 @@ discard block |
||
| 105 | 103 | { |
| 106 | 104 | try { |
| 107 | 105 | $this->discussionService->deleteArticle($this->request->getAttribute('id')); |
| 108 | - } |
|
| 109 | - catch(\Exception $e) { |
|
| 106 | + } catch(\Exception $e) { |
|
| 110 | 107 | throw $e; |
| 111 | 108 | } |
| 112 | 109 | |
@@ -112,15 +112,12 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | if($id){ |
| 114 | 114 | $this->postService->updateArticle($data, $id); |
| 115 | - } |
|
| 116 | - else{ |
|
| 115 | + } else{ |
|
| 117 | 116 | $this->postService->createArticle($user, $data); |
| 118 | 117 | } |
| 119 | - } |
|
| 120 | - catch(FilterException $fe){ |
|
| 118 | + } catch(FilterException $fe){ |
|
| 121 | 119 | return $this->edit($fe->getArrayMessages()); |
| 122 | - } |
|
| 123 | - catch(\Exception $e){ |
|
| 120 | + } catch(\Exception $e){ |
|
| 124 | 121 | throw $e; |
| 125 | 122 | } |
| 126 | 123 | |
@@ -137,8 +134,7 @@ discard block |
||
| 137 | 134 | { |
| 138 | 135 | try{ |
| 139 | 136 | $this->postService->deleteArticle($this->request->getAttribute('id')); |
| 140 | - } |
|
| 141 | - catch(\Exception $e){ |
|
| 137 | + } catch(\Exception $e){ |
|
| 142 | 138 | throw $e; |
| 143 | 139 | } |
| 144 | 140 | |
@@ -117,11 +117,9 @@ discard block |
||
| 117 | 117 | } else { |
| 118 | 118 | $this->videoService->createArticle($user, $data); |
| 119 | 119 | } |
| 120 | - } |
|
| 121 | - catch(FilterException $fe) { |
|
| 120 | + } catch(FilterException $fe) { |
|
| 122 | 121 | return $this->edit($fe->getArrayMessages()); |
| 123 | - } |
|
| 124 | - catch(\Exception $e) { |
|
| 122 | + } catch(\Exception $e) { |
|
| 125 | 123 | throw $e; |
| 126 | 124 | } |
| 127 | 125 | |
@@ -138,8 +136,7 @@ discard block |
||
| 138 | 136 | { |
| 139 | 137 | try { |
| 140 | 138 | $this->videoService->deleteArticle($this->request->getAttribute('id')); |
| 141 | - } |
|
| 142 | - catch(\Exception $e) { |
|
| 139 | + } catch(\Exception $e) { |
|
| 143 | 140 | throw $e; |
| 144 | 141 | } |
| 145 | 142 | |