Completed
Push — master ( 6abae4...8c7895 )
by Megh
02:56
created
src/app/views/contest/mun.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2
-$text_input = function ($name, $large_text=false) use ($errors) {
2
+$text_input = function($name, $large_text = false) use ($errors) {
3 3
 ?>
4 4
     <?php if ($large_text): ?>
5 5
         <textarea name="<?= $name ?>" class="pure-input-1" required=""><?= isset($_POST[$name]) ? $_POST[$name] : '' ?></textarea>
6
-    <?php else: ?>
6
+    <?php else : ?>
7 7
         <input
8 8
             name="<?= $name ?>"
9 9
             value="<?= isset($_POST[$name]) ? $_POST[$name] : '' ?>"
Please login to merge, or discard this patch.
src/app/controllers/mun.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
         $purpose    = $payment_cfg['mun']['purpose'];
24 24
         $amount     = $payment_cfg['mun']['amount'] * $team_size;
25 25
         if ($needs_accomodation)
26
-            $amount    = $amount + $payment_cfg['mun']['accomodation_amount'] * $team_size;
27
-        $redirect_url    = $payment_cfg['mun']['redirect_url'];
28
-        $webhook    = $payment_cfg['mun']['webhook'];
26
+            $amount = $amount + $payment_cfg['mun']['accomodation_amount'] * $team_size;
27
+        $redirect_url = $payment_cfg['mun']['redirect_url'];
28
+        $webhook = $payment_cfg['mun']['webhook'];
29 29
 
30 30
         $ch = curl_init();
31 31
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $errors = [];
62 62
         if ($_SERVER['REQUEST_METHOD'] === 'POST' && !$user_details) {
63 63
             required_post_params(['contact_number', 'institute', 'team_size'], $errors);
64
-            if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number']) ) {
64
+            if (!empty($_POST['contact_number']) && !is_valid_phone_number($_POST['contact_number'])) {
65 65
                 $errors['contact_number'] = 'Please enter a valid phone number';
66 66
             }
67 67
             if (!ctype_digit($_POST['team_size'])) {
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
                 if ($this->model->register_for_mun($user_details)) {
83 83
                     $redirect_url = $this->get_mun_payment_url($user_nick, $_POST['contact_number'], $team_size, $needs_accomodation);
84 84
                     $this->load_library('http_lib', 'http');
85
-                    $this->http->redirect( $redirect_url );
85
+                    $this->http->redirect($redirect_url);
86 86
                 } else {
87 87
                     $errors['common'] = __('Some unexpected error occurred');
88 88
                 }
89 89
             }
90 90
         }
91 91
         $this->load_view('skeleton_template/header', [
92
-            'title'             => __('Register').' · '.__('MUN'),
92
+            'title'             => __('Register') . ' · ' . __('MUN'),
93 93
             'is_authenticated'  => true,
94 94
             'user_nick'         => $user_nick,
95 95
         ]);
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
     public function success() {
122 122
         $this->load_library('http_lib', 'http');
123 123
         if (!isset($_GET['payment_id'])) {
124
-            $this->http->response_code( 400 );
124
+            $this->http->response_code(400);
125 125
             exit();
126 126
         }
127 127
         global $payment_cfg;
128 128
         $proxy = 'http://proxy.iiit.ac.in:8080';
129 129
 
130
-        $nick      = $this->auth->get_user();
130
+        $nick = $this->auth->get_user();
131 131
         $id             = urlencode($_GET['payment_request_id']);
132 132
         $payment_id     = urlencode($_GET['payment_id']);
133 133
         $url            = $payment_cfg['mun']['api_url'] . $id . '/' . $payment_id . '/';
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
             $payment_data = $response;
152 152
             $this->model->mun_payment_success($payment_id, $nick, $status == 'Credit' ? 'success' : 'failed', $payment_data);
153 153
         } else {
154
-            if ( is_array( $response_array ) ) {
155
-                $this->model->mun_dump_data('unknown', 'callback', json_encode( [ '$_GET' => $_GET, 'response' => $response_array ] ));
154
+            if (is_array($response_array)) {
155
+                $this->model->mun_dump_data('unknown', 'callback', json_encode(['$_GET' => $_GET, 'response' => $response_array]));
156 156
             } else {
157 157
                 $this->model->mun_dump_data('unknown', 'callback', json_encode($_GET));
158 158
             }
Please login to merge, or discard this patch.