@@ -68,10 +68,11 @@ discard block |
||
68 | 68 | public static function createStudentGuardian($student,$guardian,$user){ |
69 | 69 | |
70 | 70 | $exist = true; |
71 | - if(!is_null($guardian)) |
|
72 | - $exist = self::where('student_id', $student->student_id) |
|
71 | + if(!is_null($guardian)) { |
|
72 | + $exist = self::where('student_id', $student->student_id) |
|
73 | 73 | ->where('guardian_relation_id', $guardian->guardian_relation_id) |
74 | 74 | ->exists(); |
75 | + } |
|
75 | 76 | |
76 | 77 | $totalGuardians = self::where('student_id',$student->student_id)->count(); |
77 | 78 | |
@@ -84,7 +85,7 @@ discard block |
||
84 | 85 | if(!$exist){ |
85 | 86 | $data['created'] = now(); |
86 | 87 | self::create($data); |
87 | - }else{ |
|
88 | + } else{ |
|
88 | 89 | $data['modified'] = now(); |
89 | 90 | self::where('student_id' , $student->student_id) |
90 | 91 | ->where('guardian_relation_id',$guardian->guardian_relation_id) |
@@ -71,7 +71,7 @@ |
||
71 | 71 | // dd($data); |
72 | 72 | if($count == 0){ |
73 | 73 | self::create($data); |
74 | - }else{ |
|
74 | + } else{ |
|
75 | 75 | self::where('security_user_id',$studentId) |
76 | 76 | ->update($data); |
77 | 77 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $Initials = $Initials . '' . mb_substr($names[$i], 0, 1, "UTF-8"); |
17 | 17 | } |
18 | 18 | $nameWithInitials = $Initials . ' ' . $names[$length - 1]; |
19 | - }else{ |
|
19 | + } else{ |
|
20 | 20 | $nameWithInitials = $fullname; |
21 | 21 | } |
22 | 22 | return $nameWithInitials; |
@@ -38,8 +38,9 @@ discard block |
||
38 | 38 | function getMatchingKeys($array){ |
39 | 39 | $keys = []; |
40 | 40 | foreach ($array as $key => $value){ |
41 | - if(strstr($key , 'option')) |
|
42 | - $keys[] = $key; |
|
41 | + if(strstr($key , 'option')) { |
|
42 | + $keys[] = $key; |
|
43 | + } |
|
43 | 44 | } |
44 | 45 | return $keys; |
45 | 46 | } |
@@ -54,7 +55,9 @@ discard block |
||
54 | 55 | |
55 | 56 | function isEmptyRow($row) { |
56 | 57 | foreach($row as $cell){ |
57 | - if (null !== $cell) return false; |
|
58 | + if (null !== $cell) { |
|
59 | + return false; |
|
60 | + } |
|
58 | 61 | } |
59 | 62 | return true; |
60 | 63 | } |
@@ -95,7 +98,9 @@ discard block |
||
95 | 98 | function array_value_recursive($key, array $arr){ |
96 | 99 | $val = array(); |
97 | 100 | array_walk_recursive($arr, function($v, $k) use($key, &$val){ |
98 | - if($k == $key) array_push($val, $v); |
|
101 | + if($k == $key) { |
|
102 | + array_push($val, $v); |
|
103 | + } |
|
99 | 104 | }); |
100 | 105 | return count($val) > 1 ? $val : array_pop($val); |
101 | 106 | } |
@@ -228,25 +228,25 @@ |
||
228 | 228 | if(!is_null($father) && is_null($mother) && is_null($guardian)){ |
229 | 229 | Security_user::where('id',$student['student_id']) |
230 | 230 | ->update(['address_area_id' => $father->address_area_id]); |
231 | - }elseif(!is_null($mother) && (is_null($father) && is_null($guardian))){ |
|
231 | + } elseif(!is_null($mother) && (is_null($father) && is_null($guardian))){ |
|
232 | 232 | Security_user::where('id',$student['student_id']) |
233 | 233 | ->update(['address_area_id' => $mother->address_area_id]); |
234 | - }elseif(!is_null($guardian) && is_null($father) && is_null($mother)){ |
|
234 | + } elseif(!is_null($guardian) && is_null($father) && is_null($mother)){ |
|
235 | 235 | Security_user::where('id',$student['student_id']) |
236 | 236 | ->update(['address_area_id' => $guardian->address_area_id]); |
237 | - }elseif(!is_null($mother) && !is_null($father) && ($father->address_area_id == $mother->address_area_id)){ |
|
237 | + } elseif(!is_null($mother) && !is_null($father) && ($father->address_area_id == $mother->address_area_id)){ |
|
238 | 238 | Security_user::where('id',$student['student_id']) |
239 | 239 | ->update(['address_area_id' => $mother->address_area_id]); |
240 | - }elseif(!is_null($mother) && !is_null($father) && ($father->address_area_id !== $mother->address_area_id) && !is_null($guardian)){ |
|
240 | + } elseif(!is_null($mother) && !is_null($father) && ($father->address_area_id !== $mother->address_area_id) && !is_null($guardian)){ |
|
241 | 241 | Security_user::where('id',$student['student_id']) |
242 | 242 | ->update(['address_area_id' => $guardian->address_area_id]); |
243 | - }elseif(!is_null($father) && $father->address == $student['address']){ |
|
243 | + } elseif(!is_null($father) && $father->address == $student['address']){ |
|
244 | 244 | Security_user::where('id',$student['student_id']) |
245 | 245 | ->update(['address_area_id' => $father->address_area_id]); |
246 | - }elseif(!is_null($mother) && $mother->address == $student['address']){ |
|
246 | + } elseif(!is_null($mother) && $mother->address == $student['address']){ |
|
247 | 247 | Security_user::where('id',$student['student_id']) |
248 | 248 | ->update(['address_area_id' => $mother->address_area_id]); |
249 | - }elseif(!is_null($guardian) && $guardian->address == $student['address']){ |
|
249 | + } elseif(!is_null($guardian) && $guardian->address == $student['address']){ |
|
250 | 250 | Security_user::where('id',$student['student_id']) |
251 | 251 | ->update(['address_area_id' => $guardian->address_area_id]); |
252 | 252 | } |