-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.php
More file actions
116 lines (82 loc) · 2.73 KB
/
test.php
File metadata and controls
116 lines (82 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
require_once 'config.php';
require_once BUSINESS_DIR_USER . 'UserManager.php';
require_once BUSINESS_DIR_LOCATION . 'LocationManager.php';
require_once BUSINESS_DIR_LANG_PROF. 'LanguageProfManager.php';
$allworks = false;
$userManager = new UserManager();
$User = new User();
$random_text="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@.()";
$substr = substr(str_shuffle($random_text),0,10);
//This will contain the user Information
$user_info = isset($_POST['json'])?$_POST['json']:"";
//{fname: fname, mlname : lname,
// userid : uid, emailid : email, mylanguage : arrLang, proficient : arrPrf, dob : yearsel+"-"+monthsel+"-"+daysel};
//user Information
$userid = $user_info['userid'];
$userfname = $user_info['fname'];
$userlname = $user_info['mlname'];
$dob = $user_info['dob'];
$emailid = $user_info['emailid'];
$pass = $user_info['password'];
$user_insert_id = "";
//contains the city Ids
//$cityid = $userManager->getuserLocation();
$cityid='1';
/*$usid = '1';
$langid='1';
$prof='Perfect';*/
//Inserting into the profecient Table;;
$LProfManager = new LanguageProfManager();
/*if($LProfManager->AddProficient($lprof)){
echo "Inserted";
}
else {echo "not Inserted";}*/
$User->setFirstName($userfname);
$User->setLastName($userlname);
$User->setLogin($userid);
$User->setEmail($emailid);
$User->setDOB($dob);
$User->setLocation($cityid);
$User->setRegistration_date(date("Y-m-d"));
$User->setUserType(4);
$user_insert_id =$userManager->addUser($User);
//*********************************************
/*$userid = "Afghan123";
$userfname = "Habib";
$userlname = "Zahoori";
$dob = "2001-02-02";
$emailid = "aaa@aa.com";
$pass = "iloveyou";*/
//contains the city Ids
//$cityid = $userManager->getuserLocation();
//*******************************************
$cityid='4';
$languages = "";
$prof = [];
/*//$lprof->setLanguageId($langid);
$lprof->setUserId($usid);
$lprof->setProf($prof);*/
$count_prof = count($user_info['mylanguage']);
$i = 0;
if(count($count_prof)>0){
for($i=0;$i<$count_prof;$i++){
$lprof[] = new LanguageProf();
echo $user_info['mylanguage'][$i].",";
$lprof[$i]->setLanguageId($user_info['mylanguage'][$i]);
$lprof[$i]->setProf($user_info['proficient'][$i]);
$lprof[$i]->setUserId($user_insert_id);
if($LProfManager->AddProficient($lprof[$i])){
$allworks=true;
}
}
}
/* if($userManager->addUser($User)){
echo "data inserted";
}
else{
echo "Cannot Insert";
}*/
//$User->setUserLanguage();
//$User->setEmailSub();
?>