@@ -63,7 +63,7 @@ |
||
63 | 63 | unlink($tempZip); |
64 | 64 | unlink($fileSql); |
65 | 65 | |
66 | -}else { |
|
66 | +} else { |
|
67 | 67 | require 'includes/no_access.php'; |
68 | 68 | } |
69 | 69 |
@@ -27,6 +27,6 @@ |
||
27 | 27 | $etudes=Global_Data::getAllStudies($linkpdo, true); |
28 | 28 | require 'views/administrator/root_administrator_view.php'; |
29 | 29 | |
30 | -}else { |
|
30 | +} else { |
|
31 | 31 | require 'includes/no_access.php'; |
32 | 32 | } |
@@ -26,13 +26,13 @@ |
||
26 | 26 | //Get users data |
27 | 27 | if ($_SESSION['study'] == "All Studies") { |
28 | 28 | $usersObjects=Global_Data::getAllUsers($linkpdo); |
29 | - }else { |
|
29 | + } else { |
|
30 | 30 | $studyObject=new Study($_SESSION['study'], $linkpdo); |
31 | 31 | $usersObjects=$studyObject->getUsersWithRoleInStudy(); |
32 | 32 | } |
33 | 33 | |
34 | 34 | require 'views/administrator/user_table_view.php'; |
35 | 35 | |
36 | -}else { |
|
36 | +} else { |
|
37 | 37 | require 'includes/no_access.php'; |
38 | 38 | } |
39 | 39 | \ No newline at end of file |
@@ -26,6 +26,6 @@ |
||
26 | 26 | |
27 | 27 | require 'views/administrator/tracker_admin_view.php'; |
28 | 28 | |
29 | -}else { |
|
29 | +} else { |
|
30 | 30 | require 'includes/no_access.php'; |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | try { |
46 | 46 | Center::addCenter($linkpdo, $code, $details['name'], $details['country_code']); |
47 | - }catch (Exception $e1) { |
|
47 | + } catch (Exception $e1) { |
|
48 | 48 | error_log($e1); |
49 | 49 | echo(json_encode("Error")); |
50 | 50 | return; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $centerObject=new Center($linkpdo, $code); |
66 | 66 | $centerObject->updateCenter($centersInputArray[$code]['name'], $centersInputArray[$code]['country_code']); |
67 | 67 | $modified_centers[$code]=$centersInputArray[$code]; |
68 | - }catch (Exception $e1) { |
|
68 | + } catch (Exception $e1) { |
|
69 | 69 | error_log($e1); |
70 | 70 | echo(json_encode("Error")); |
71 | 71 | return; |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | |
83 | 83 | echo(json_encode("Success")); |
84 | 84 | |
85 | - }else { |
|
85 | + } else { |
|
86 | 86 | $countries=Global_Data::getAllcountries($linkpdo); |
87 | 87 | require 'views/administrator/modify_centers_view.php'; |
88 | 88 | |
89 | 89 | } |
90 | 90 | |
91 | -}else { |
|
91 | +} else { |
|
92 | 92 | require 'includes/no_access.php'; |
93 | 93 | } |
94 | 94 | \ No newline at end of file |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | if (!isset($_POST['profile'])) { |
42 | 42 | $role="@"; |
43 | - }else { |
|
43 | + } else { |
|
44 | 44 | $role=$_POST['profile']; //format nameRole@nameStudy |
45 | 45 | } |
46 | 46 | |
@@ -64,8 +64,7 @@ discard block |
||
64 | 64 | //Chech that data are complete and write to the database |
65 | 65 | if (empty($_POST['username']) || empty($_POST['last_name']) || empty($_POST['first_name']) || empty($_POST['email']) || !is_numeric($_POST['main_center'])) { |
66 | 66 | $answer="Form Uncomplete"; |
67 | - } |
|
68 | - else if (!preg_match('/^[a-z0-9\-_.]+@[a-z0-9\-_.]+\.[a-z]{2,4}$/i', $email)) { |
|
67 | + } else if (!preg_match('/^[a-z0-9\-_.]+@[a-z0-9\-_.]+\.[a-z]{2,4}$/i', $email)) { |
|
69 | 68 | $answer="Email Not Valid"; |
70 | 69 | } |
71 | 70 | |
@@ -166,7 +165,7 @@ discard block |
||
166 | 165 | //Output answer for Ajax |
167 | 166 | echo(json_encode($answer)); |
168 | 167 | |
169 | - }else { |
|
168 | + } else { |
|
170 | 169 | |
171 | 170 | $username=$_GET['username']; |
172 | 171 | |
@@ -188,7 +187,7 @@ discard block |
||
188 | 187 | } |
189 | 188 | |
190 | 189 | |
191 | -}else { |
|
190 | +} else { |
|
192 | 191 | require 'includes/no_access.php'; |
193 | 192 | } |
194 | 193 | |
@@ -206,7 +205,7 @@ discard block |
||
206 | 205 | $userObject->deleteRole($study, $role); |
207 | 206 | } |
208 | 207 | } |
209 | - }catch (Exception $e) { } |
|
208 | + } catch (Exception $e) { } |
|
210 | 209 | } |
211 | 210 | |
212 | 211 | |
@@ -223,5 +222,5 @@ discard block |
||
223 | 222 | $userObject->addRole($role, $study); |
224 | 223 | } |
225 | 224 | } |
226 | - }catch (Exception $e) { } |
|
225 | + } catch (Exception $e) { } |
|
227 | 226 | } |
@@ -26,10 +26,10 @@ |
||
26 | 26 | Global_Data::updatePlateformPreferences($_POST, $linkpdo); |
27 | 27 | echo(json_encode("Success")); |
28 | 28 | |
29 | - }else { |
|
29 | + } else { |
|
30 | 30 | require 'views/administrator/preferences_view.php'; |
31 | 31 | |
32 | 32 | } |
33 | -}else { |
|
33 | +} else { |
|
34 | 34 | require 'includes/no_access.php'; |
35 | 35 | } |
36 | 36 | \ No newline at end of file |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | // Check from completion |
55 | 55 | if (empty($_POST['username']) || empty($_POST['last_name']) || empty($_POST['first_name']) || empty($_POST['email']) || !is_numeric($_POST['center'])) { |
56 | 56 | $answer="Form uncomplete"; |
57 | - }else if (!preg_match('/^[a-z0-9\-_.]+@[a-z0-9\-_.]+\.[a-z]{2,4}$/i', $email)) { |
|
57 | + } else if (!preg_match('/^[a-z0-9\-_.]+@[a-z0-9\-_.]+\.[a-z]{2,4}$/i', $email)) { |
|
58 | 58 | $answer="Wrong Email"; |
59 | 59 | // If OK write in the user database |
60 | - }else { |
|
60 | + } else { |
|
61 | 61 | try { |
62 | 62 | $mdp=substr(uniqid(), 1, 10); |
63 | 63 | User::createUser($username, $last_name, $first_name, $email, |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $mails->sendNewAccountMessage($username, $mdp); |
104 | 104 | |
105 | 105 | $answer="Success"; |
106 | - }catch (exception $e1) { |
|
106 | + } catch (exception $e1) { |
|
107 | 107 | $answer=$e1->getMessage(); |
108 | 108 | } |
109 | 109 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | // Output answer for Ajax |
113 | 113 | echo (json_encode($answer)); |
114 | 114 | |
115 | - }else { |
|
115 | + } else { |
|
116 | 116 | |
117 | 117 | // Get all possible roles for active studies |
118 | 118 | $availableStudies=Global_Data::getAllStudies($linkpdo, true); |
@@ -124,6 +124,6 @@ discard block |
||
124 | 124 | require 'views/administrator/new_user_view.php'; |
125 | 125 | } |
126 | 126 | |
127 | -}else { |
|
127 | +} else { |
|
128 | 128 | require 'includes/no_access.php'; |
129 | 129 | } |
130 | 130 | \ No newline at end of file |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | if (empty($_POST)) { |
26 | 26 | // Include view script |
27 | 27 | require 'views/administrator/visit_builder_view.php'; |
28 | -}else { |
|
28 | +} else { |
|
29 | 29 | // Echo answer to the request |
30 | 30 | switch ($_POST['request']) { |
31 | 31 | case 'studies': |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | echo json_encode($visitTypes); |
52 | - }catch (Exception $e) { |
|
52 | + } catch (Exception $e) { |
|
53 | 53 | echo 'Could not retrieve visit types list'; |
54 | 54 | } |
55 | 55 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $response=[]; |
65 | 65 | $response['isEmpty']=Visit_Builder::isTableEmpty($visitType); |
66 | 66 | echo json_encode($response); |
67 | - }catch (Exception $e) { |
|
67 | + } catch (Exception $e) { |
|
68 | 68 | echo 'Could not check if table is empty'; |
69 | 69 | } |
70 | 70 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $dataType=Visit_Builder::formatDataType($type, $typeParam); |
105 | 105 | |
106 | 106 | Visit_Builder::alterColumn($visitType, $col, $col, $dataType); |
107 | - }else if (isset($_POST['changes'][$col]['typeParam'])) { |
|
107 | + } else if (isset($_POST['changes'][$col]['typeParam'])) { |
|
108 | 108 | // Change column data type parameters |
109 | 109 | $originalDataType=Visit_Builder::getColumnDataType($visitType, $col); |
110 | 110 | |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | Visit_Builder::addColumn($visitType, $columnName, $dataType); |
136 | 136 | } |
137 | 137 | } |
138 | - }else { |
|
138 | + } else { |
|
139 | 139 | throw new Exception('Null visit type'); |
140 | 140 | } |
141 | 141 | $response['success']=true; |
142 | 142 | echo json_encode($response); |
143 | - }catch (Exception $e) { |
|
143 | + } catch (Exception $e) { |
|
144 | 144 | $response['success']=false; |
145 | 145 | $response['error']=$e->getMessage(); |
146 | 146 | $response['message']=''; |