Passed
Push — master ( 317711...bba805 )
by Yannick
10:56
created

getCourse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Functions.
4
 *
5
 * @package chamilo.plugin.sepe
6
 */
7
$tableSepeCenter = Database::get_main_table(SepePlugin::TABLE_SEPE_CENTER);
8
$tableSepeActions = Database::get_main_table(SepePlugin::TABLE_SEPE_ACTIONS);
9
$tableSepeSpecialty = Database::get_main_table(SepePlugin::TABLE_SEPE_SPECIALTY);
10
$tableSepeSpecialtyClassroom = Database::get_main_table(SepePlugin::TABLE_SEPE_SPECIALTY_CLASSROOM);
11
$tableSepeSpecialtyTutors = Database::get_main_table(SepePlugin::TABLE_SEPE_SPECIALTY_TUTORS);
12
$tableSepeTutors = Database::get_main_table(SepePlugin::TABLE_SEPE_TUTORS);
13
$tableSepeParticipants = Database::get_main_table(SepePlugin::TABLE_SEPE_PARTICIPANTS);
14
$tableSepeParticipantsSpecialty = Database::get_main_table(SepePlugin::TABLE_SEPE_PARTICIPANTS_SPECIALTY);
15
$tableSepeParticipantsSpecialtyTutorials = Database::get_main_table(SepePlugin::TABLE_SEPE_PARTICIPANTS_SPECIALTY_TUTORIALS);
16
$tableSepeCourseActions = Database::get_main_table(SepePlugin::TABLE_SEPE_COURSE_ACTIONS);
17
$tableCourse = Database::get_main_table(TABLE_MAIN_COURSE);
18
$tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
19
$tableUser = Database::get_main_table(TABLE_MAIN_USER);
20
$tableCenters = Database::get_main_table(SepePlugin::TABLE_SEPE_CENTERS);
21
$tableTutorCompany = Database::get_main_table(SepePlugin::TABLE_SEPE_TUTORS_COMPANY);
22
$tableSepeCourseActions = Database::get_main_table(SepePlugin::TABLE_SEPE_COURSE_ACTIONS);
23
$tableSepeLogParticipant = Database::get_main_table(SepePlugin::TABLE_SEPE_LOG_PARTICIPANT);
24
$tableSepeLogChangeParticipant = Database::get_main_table(SepePlugin::TABLE_SEPE_LOG_MOD_PARTICIPANT);
25
26
function getInfoIdentificationData()
27
{
28
    global $tableSepeCenter;
29
    $sql = "SELECT * FROM $tableSepeCenter;";
30
    $res = Database::query($sql);
31
    if (Database::num_rows($res) > 0) {
32
        $row = Database::fetch_assoc($res);
33
        $row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
34
        $row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
35
        $row['center_name'] = Security::remove_XSS(stripslashes($row['center_name']));
36
        $row['url'] = Security::remove_XSS(stripslashes($row['url']));
37
        $row['tracking_url'] = Security::remove_XSS(stripslashes($row['tracking_url']));
38
        $row['phone'] = Security::remove_XSS(stripslashes($row['phone']));
39
        $row['mail'] = Security::remove_XSS(stripslashes($row['mail']));
40
    } else {
41
        $row = false;
42
    }
43
44
    return $row;
45
}
46
47
function checkIdentificationData()
48
{
49
    global $tableSepeCenter;
50
    $sql = "SELECT 1 FROM $tableSepeCenter;";
51
    $result = Database::query($sql);
52
    if (Database::affected_rows($result) > 0) {
53
        return true;
54
    } else {
55
        return false;
56
    }
57
}
58
59
function getActionId($courseId)
60
{
61
    global $tableSepeCourseActions;
62
    $sql = "SELECT action_id FROM $tableSepeCourseActions WHERE course_id = $courseId";
63
    $rs = Database::query($sql);
64
    $aux = Database::fetch_assoc($rs);
65
66
    return $aux['action_id'];
67
}
68
69
function getCourse($actionId)
70
{
71
    global $tableSepeCourseActions;
72
    $sql = "SELECT course_id FROM $tableSepeCourseActions WHERE action_id = $actionId";
73
    $rs = Database::query($sql);
74
    $aux = Database::fetch_assoc($rs);
75
76
    return $aux['course_id'];
77
}
78
function getCourseCode($actionId)
79
{
80
    global $tableCourse;
81
    $courseId = getCourse($actionId);
82
    $sql = "SELECT code FROM $tableCourse WHERE id = $courseId";
83
    $rs = Database::query($sql);
84
    $aux = Database::fetch_assoc($rs);
85
86
    return $aux['code'];
87
}
88
89
function getActionInfo($id)
90
{
91
    global $tableSepeActions;
92
    $sql = "SELECT * FROM $tableSepeActions WHERE id = $id";
93
    $res = Database::query($sql);
94
    $row = false;
95
    if (Database::num_rows($res) > 0) {
96
        $row['action_origin'] = Security::remove_XSS(stripslashes($row['action_origin']));
97
        $row['action_code'] = Security::remove_XSS(stripslashes($row['action_code']));
98
        $row['situation'] = Security::remove_XSS(stripslashes($row['situation']));
99
        $row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
100
        $row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
101
        $row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
102
        $row['full_itinerary_indicator'] = Security::remove_XSS(stripslashes($row['full_itinerary_indicator']));
103
        $row['financing_type'] = Security::remove_XSS(stripslashes($row['financing_type']));
104
        $row['action_name'] = Security::remove_XSS(stripslashes($row['action_name']));
105
        $row['global_info'] = Security::remove_XSS(stripslashes($row['global_info']));
106
        $row['schedule'] = Security::remove_XSS(stripslashes($row['schedule']));
107
        $row['requirements'] = Security::remove_XSS(stripslashes($row['requirements']));
108
        $row['contact_action'] = Security::remove_XSS(stripslashes($row['contact_action']));
109
        $row = Database::fetch_assoc($res);
110
    }
111
112
    return $row;
113
}
114
115
function getSpecialtActionInfo($specialtyId)
116
{
117
    global $tableSepeSpecialty;
118
    $sql = "SELECT * FROM $tableSepeSpecialty WHERE id = $specialtyId";
119
    $res = Database::query($sql);
120
    $row = false;
121
    if (Database::num_rows($res) > 0) {
122
        $row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
123
        $row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
124
        $row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
125
        $row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
126
        $row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
127
        $row['modality_impartition'] = Security::remove_XSS(stripslashes($row['modality_impartition']));
128
        $row = Database::fetch_assoc($res);
129
    }
130
131
    return $row;
132
}
133
134
function getInfoSpecialtyClassroom($classroomId)
135
{
136
    global $tableSepeSpecialtyClassroom;
137
    global $tableCenters;
138
    $sql = "SELECT a.*, center_origin, center_code 
139
            FROM $tableSepeSpecialtyClassroom a LEFT JOIN $tableCenters b ON a.center_id = b.id 
140
            WHERE a.id = $classroomId";
141
    $res = Database::query($sql);
142
    $row = false;
143
    if (Database::num_rows($res) > 0) {
144
        $row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
145
        $row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
146
        $row = Database::fetch_assoc($res);
147
    }
148
149
    return $row;
150
}
151
152
function getInfoSpecialtyTutorial($tutorialId)
153
{
154
    global $tableSepeParticipantsSpecialtyTutorials;
155
    $sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE id = $tutorialId";
156
    $res = Database::query($sql);
157
    $aux = [];
158
    if (Database::num_rows($res) > 0) {
159
        $row = Database::fetch_assoc($res);
160
    } else {
161
        $row = false;
162
    }
163
164
    return $row;
165
}
166
167
function list_tutor($specialtyId)
168
{
169
    global $tableSepeSpecialtyTutors;
170
    $sql = "SELECT * FROM $tableSepeSpecialtyTutors WHERE specialty_id = $specialtyId";
171
    $res = Database::query($sql);
172
    if (Database::num_rows($res) > 0) {
173
        $row = Database::fetch_assoc($res);
174
    } else {
175
        $row = false;
176
    }
177
178
    return $row;
179
}
180
181
function getCentersList()
182
{
183
    global $tableCenters;
184
    $sql = "SELECT * FROM $tableCenters;";
185
    $res = Database::query($sql);
186
    $aux = [];
187
    while ($row = Database::fetch_assoc($res)) {
188
        $aux[] = $row;
189
    }
190
191
    return $aux;
192
}
193
194
function listTutorType($condition)
195
{
196
    global $tableTutorCompany;
197
    $sql = "SELECT * FROM $tableTutorCompany WHERE ".$condition." ORDER BY alias ASC, document_number ASC;";
198
    $res = Database::query($sql);
199
    $aux = [];
200
    while ($row = Database::fetch_assoc($res)) {
201
        $tmp = [];
202
        $tmp['id'] = $row['id'];
203
        if (trim($row['alias']) != '') {
204
            $tmp['alias'] = $row['alias'].' - '.$row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
205
        } else {
206
            $tmp['alias'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
207
        }
208
        $aux[] = $tmp;
209
    }
210
211
    return $aux;
212
}
213
214
function getTutorsSpecialty($specialtyId)
215
{
216
    global $tableSepeSpecialtyTutors;
217
    global $tableSepeTutors;
218
    global $tableUser;
219
    $sql = "SELECT tutor_id FROM $tableSepeSpecialtyTutors WHERE specialty_id = $specialtyId";
220
    $rs = Database::query($sql);
221
    $tutorsList = [];
222
    while ($tmp = Database::fetch_assoc($rs)) {
223
        $tutorsList[] = $tmp['tutor_id'];
224
    }
225
    $sql = "SELECT a.*, b.firstname AS firstname, b.lastname AS lastname 
226
            FROM $tableSepeTutors AS a LEFT JOIN $tableUser AS b ON a.platform_user_id=b.user_id;";
227
    $res = Database::query($sql);
228
    $aux = [];
229
    while ($row = Database::fetch_assoc($res)) {
230
        if (!in_array($row['id'], $tutorsList)) {
231
            $tutor = [];
232
            $tutor['id'] = $row['id'];
233
            if (trim($row['firstname']) != '' || trim($row['lastname']) != '') {
234
                $tutor['data'] = $row['firstname'].' '.$row['lastname'].' ('.$row['document_type'].' '.$row['document_number'].' '.$row['document_letter'].' )';
235
            } else {
236
                $tutor['data'] = $row['document_type'].' '.$row['document_number'].' '.$row['document_letter'];
237
            }
238
            $aux[] = $tutor;
239
        }
240
    }
241
242
    return $aux;
243
}
244
245
function getInfoSpecialtyTutor($tutorId)
246
{
247
    global $tableSepeSpecialtyTutors;
248
    global $tableSepeTutors;
249
    $sql = "SELECT a.*,platform_user_id,document_type, document_number,document_letter 
250
            FROM $tableSepeSpecialtyTutors a
251
            INNER JOIN $tableSepeTutors b ON a.tutor_id=b.id 
252
            WHERE a.id = $tutorId;";
253
    $res = Database::query($sql);
254
    $aux = [];
255
    if (Database::num_rows($res) > 0) {
256
        $row['tutor_accreditation'] = Security::remove_XSS(stripslashes($row['tutor_accreditation']));
0 ignored issues
show
Comprehensibility Best Practice introduced by
$row was never initialized. Although not strictly required by PHP, it is generally a good practice to add $row = array(); before regardless.
Loading history...
Comprehensibility Best Practice introduced by
The variable $row seems to be never defined.
Loading history...
257
        $row['teaching_competence'] = Security::remove_XSS(stripslashes($row['teaching_competence']));
258
        $row['training_teleforming'] = Security::remove_XSS(stripslashes($row['training_teleforming']));
259
        $row = Database::fetch_assoc($res);
260
    } else {
261
        $row = false;
262
    }
263
264
    return $row;
265
}
266
267
function freeTeacherList($teacherList, $specialtyId, $platform_user_id)
268
{
269
    global $tableSepeSpecialtyTutors;
270
    global $tableSepeTutors;
271
    $sql = "SELECT tutor_id FROM $tableSepeSpecialtyTutors WHERE specialty_id = $specialtyId";
272
    $rs = Database::query($sql);
273
    if (Database::num_rows($rs) > 0) {
274
        while ($aux = Database::fetch_assoc($rs)) {
275
            $sql = "SELECT platform_user_id FROM $tableSepeTutors WHERE id='".$aux['tutor_id']."';";
276
            $res = Database::query($sql);
277
            if (Database::num_rows($res) > 0) {
278
                $tmp = Database::fetch_assoc($res);
279
                if ($tmp['platform_user_id'] != 0 && $tmp['platform_user_id'] != $platform_user_id) {
280
                    foreach ($teacherList as $key => $value) {
281
                        if ($value['id'] == $tmp['platform_user_id']) {
282
                            unset($teacherList[$key]);
283
                            break;
284
                        }
285
                    }
286
                }
287
            }
288
        }
289
    }
290
291
    return $teacherList;
292
}
293
294
function getInfoParticipantAction($participantId)
295
{
296
    global $tableSepeParticipants;
297
    $sql = "SELECT * FROM $tableSepeParticipants WHERE id = $participantId";
298
    $res = Database::query($sql);
299
    $aux = [];
300
    if (Database::num_rows($res) > 0) {
301
        $row = Database::fetch_assoc($res);
302
        $result = [];
303
        $result['id'] = $row[''];
304
        $result['action_id'] = $row['action_id'];
305
        $result['company_tutor_id'] = $row['company_tutor_id'];
306
        $result['training_tutor_id'] = $row['training_tutor_id'];
307
        $result['platform_user_id'] = $row['platform_user_id'];
308
        $result['document_type'] = Security::remove_XSS(stripslashes($row['document_type']));
309
        $result['document_number'] = Security::remove_XSS(stripslashes($row['document_number']));
310
        $result['document_letter'] = Security::remove_XSS(stripslashes($row['document_letter']));
311
        $result['key_competence'] = Security::remove_XSS(stripslashes($row['key_competence']));
312
        $result['contract_id'] = Security::remove_XSS(stripslashes($row['contract_id']));
313
        $result['company_fiscal_number'] = Security::remove_XSS(stripslashes($row['company_fiscal_number']));
314
    } else {
315
        $result = false;
316
    }
317
318
    return $result;
319
}
320
321
function getParticipantId($id)
322
{
323
    global $tableSepeParticipantsSpecialty;
324
    $sql = "SELECT participant_id FROM  $tableSepeParticipantsSpecialty WHERE id = $id";
325
    $rs = Database::query($sql);
326
    $aux = Database::fetch_assoc($rs);
327
328
    return $aux['participant_id'];
329
}
330
331
function getInfoSpecialtyParticipant($specialtyId)
332
{
333
    global $tableSepeParticipantsSpecialty;
334
    $sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE id = $specialtyId";
335
    $res = Database::query($sql);
336
    $aux = [];
337
    if (Database::num_rows($res) > 0) {
338
        $row = Database::fetch_assoc($res);
339
        $row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
340
        $row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
341
        $row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
342
        $row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
343
        $row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
344
        $row['final_result'] = Security::remove_XSS(stripslashes($row['final_result']));
345
        $row['final_qualification'] = Security::remove_XSS(stripslashes($row['final_qualification']));
346
        $row['final_score'] = Security::remove_XSS(stripslashes($row['final_score']));
347
    } else {
348
        $row = false;
349
    }
350
351
    return $row;
352
}
353
354
function specialtyList($actionId)
355
{
356
    global $tableSepeSpecialty;
357
    $sql = "SELECT id, specialty_origin, professional_area, specialty_code
358
            FROM $tableSepeSpecialty
359
            WHERE action_id = $actionId";
360
    $res = Database::query($sql);
361
    $aux = [];
362
    while ($row = Database::fetch_assoc($res)) {
363
        $aux[] = $row;
364
    }
365
366
    return $aux;
367
}
368
369
function participantList($actionId)
370
{
371
    global $tableSepeParticipants;
372
    global $tableUser;
373
    $sql = "SELECT $tableSepeParticipants.id AS id, document_type, document_number, document_letter, firstname, lastname
374
            FROM $tableSepeParticipants LEFT JOIN $tableUser ON $tableSepeParticipants.platform_user_id=$tableUser.user_id
375
            WHERE action_id = $actionId";
376
    $res = Database::query($sql);
377
    $aux = [];
378
    while ($row = Database::fetch_assoc($res)) {
379
        $aux[] = $row;
380
    }
381
382
    return $aux;
383
}
384
385
function listParticipantSpecialty($participantId)
386
{
387
    global $tableSepeParticipantsSpecialty;
388
    $sql = "SELECT * FROM $tableSepeParticipantsSpecialty WHERE participant_id = $participantId";
389
    $res = Database::query($sql);
390
    $aux = [];
391
    while ($row = Database::fetch_assoc($res)) {
392
        $row['specialty_origin'] = Security::remove_XSS(stripslashes($row['specialty_origin']));
393
        $row['professional_area'] = Security::remove_XSS(stripslashes($row['professional_area']));
394
        $row['specialty_code'] = Security::remove_XSS(stripslashes($row['specialty_code']));
395
        $row['center_origin'] = Security::remove_XSS(stripslashes($row['center_origin']));
396
        $row['center_code'] = Security::remove_XSS(stripslashes($row['center_code']));
397
        $row['final_result'] = Security::remove_XSS(stripslashes($row['final_result']));
398
        $row['final_qualification'] = Security::remove_XSS(stripslashes($row['final_qualification']));
399
        $row['final_score'] = Security::remove_XSS(stripslashes($row['final_score']));
400
        $aux[] = $row;
401
    }
402
403
    return $aux;
404
}
405
406
function classroomList($specialtyId)
407
{
408
    global $tableSepeSpecialtyClassroom;
409
    global $tableCenters;
410
    $sql = "SELECT a.*, center_origin, center_code
411
            FROM $tableSepeSpecialtyClassroom a LEFT JOIN $tableCenters b ON a.center_id=b.id 
412
            WHERE specialty_id = $specialtyId";
413
    $res = Database::query($sql);
414
    $aux = [];
415
    while ($row = Database::fetch_assoc($res)) {
416
        $aux[] = $row;
417
    }
418
419
    return $aux;
420
}
421
422
function tutorsList($specialtyId)
423
{
424
    global $tableSepeSpecialtyTutors;
425
    global $tableSepeTutors;
426
    global $tableUser;
427
    $aux = [];
428
    $sql = "SELECT a.*,document_type,document_number,document_letter, firstname, lastname FROM $tableSepeSpecialtyTutors a 
429
            INNER JOIN $tableSepeTutors b ON a.tutor_id=b.id 
430
            LEFT JOIN $tableUser c ON b.platform_user_id=c.user_id 
431
            WHERE a.specialty_id = $specialtyId";
432
    $res = Database::query($sql);
433
    while ($row = Database::fetch_assoc($res)) {
434
        $aux[] = $row;
435
    }
436
437
    return $aux;
438
}
439
440
function getListSpecialtyTutorial($specialtyId)
441
{
442
    global $tableSepeParticipantsSpecialtyTutorials;
443
    $sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE participant_specialty_id = $specialtyId";
444
    $res = Database::query($sql);
445
    $aux = [];
446
    while ($row = Database::fetch_assoc($res)) {
447
        $row['tutor_accreditation'] = Security::remove_XSS(stripslashes($row['tutor_accreditation']));
448
        $row['teaching_competence'] = Security::remove_XSS(stripslashes($row['teaching_competence']));
449
        $row['training_teleforming'] = Security::remove_XSS(stripslashes($row['training_teleforming']));
450
        $aux[] = $row;
451
    }
452
453
    return $aux;
454
}
455
456
function listCourseAction()
457
{
458
    global $tableSepeActions;
459
    global $tableSepeCourseActions;
460
    $sql = "SELECT $tableSepeCourseActions.*, course.title AS title, $tableSepeActions.action_origin AS action_origin, $tableSepeActions.action_code AS action_code 
461
            FROM $tableSepeCourseActions, course, $tableSepeActions 
462
            WHERE $tableSepeCourseActions.course_id=course.id 
463
            AND $tableSepeActions.id=$tableSepeCourseActions.action_id";
464
    $res = Database::query($sql);
465
    $aux = [];
466
    while ($row = Database::fetch_assoc($res)) {
467
        $aux[] = $row;
468
    }
469
470
    return $aux;
471
}
472
473
function listCourseFree()
474
{
475
    global $tableCourse;
476
    global $tableSepeCourseActions;
477
    $sql = "SELECT id, title FROM $tableCourse
478
            WHERE NOT EXISTS (
479
                SELECT * FROM $tableSepeCourseActions WHERE $tableCourse.id = $tableSepeCourseActions.course_id)
480
            ;";
481
    $res = Database::query($sql);
482
    while ($row = Database::fetch_assoc($res)) {
483
        $aux[] = $row;
484
    }
485
486
    return $aux;
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $aux does not seem to be defined for all execution paths leading up to this point.
Loading history...
487
}
488
489
function listActionFree()
490
{
491
    global $tableSepeActions;
492
    global $tableSepeCourseActions;
493
    $sql = "SELECT id, action_origin, action_code FROM $tableSepeActions
494
            WHERE NOT EXISTS (
495
                SELECT * FROM $tableSepeCourseActions WHERE $tableSepeActions.id = $tableSepeCourseActions.action_id)
496
            ;";
497
    $res = Database::query($sql);
498
    $aux = [];
499
    while ($row = Database::fetch_assoc($res)) {
500
        $row['action_origin'] = Security::remove_XSS(stripslashes($row['action_origin']));
501
        $row['action_code'] = Security::remove_XSS(stripslashes($row['action_code']));
502
        $aux[] = $row;
503
    }
504
505
    return $aux;
506
}
507
508
function getSpecialtyTutorId($specialtyId, $tutorId)
509
{
510
    global $tableSepeSpecialtyTutors;
511
    $sql = "SELECT id 
512
            FROM $tableSepeSpecialtyTutors 
513
            WHERE specialty_id = $specialtyId AND tutor_id = $tutorId";
514
    $res = Database::query($sql);
515
    $row = Database::fetch_assoc($res);
516
517
    return $row['id'];
518
}
519
520
function checkInsertNewLog($platformUserId, $actionId)
521
{
522
    global $tableSepeLogParticipant;
523
    $sql = "SELECT * FROM $tableSepeLogParticipant WHERE platform_user_id = $platformUserId AND action_id = $actionId";
524
    $res = Database::query($sql);
525
    if (Database::num_rows($res) > 0) {
526
        return false;
527
    } else {
528
        return true;
529
    }
530
}
531
532
function getUserPlatformFromParticipant($participantId)
533
{
534
    global $tableSepeParticipants;
535
    $sql = "SELECT * FROM $tableSepeParticipants WHERE id = $participantId";
536
    $res = Database::query($sql);
537
    $row = Database::fetch_assoc($res);
538
    if ($row['platform_user_id'] == 0 || $row['platform_user_id'] == '') {
539
        return false;
540
    } else {
541
        return $row['platform_user_id'];
542
    }
543
}
544