-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSurveyFormController.php
More file actions
28 lines (24 loc) · 1.12 KB
/
Copy pathSurveyFormController.php
File metadata and controls
28 lines (24 loc) · 1.12 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
<?php
require_once 'surveyFormModel.php';
include_once 'DbController.php';
class SurveyFormController {
public function setFormInfo (surveyFormModel $dataReceived): bool
{
$db = new DBController();
$name = $dataReceived->get_name();
$email = $dataReceived->get_email();
$age = $dataReceived->get_age();
$CurrentRole = $dataReceived->get_currentRole();
$FriendFreeCodeCamp = $dataReceived->get_friendFreeCodeCamp();
$FeatureOfFreeCodeCamp = $dataReceived->get_featureOfFreecodecamp();
$ImproveField = $dataReceived->get_improveField();
$Suggestions = $dataReceived->get_suggestions();
if ($db->OpenConnection()) {
$query = "insert into userdata (UserName,UserEmail,UserAge,CurrentRole,FriendFreeCodeCamp,FeatureOfFreeCodeCamp,ImproveField,Suggestions) values ('$name','$email','$age','$CurrentRole','$FriendFreeCodeCamp','$FeatureOfFreeCodeCamp','$ImproveField','$Suggestions')";
return $db->insert($query);
}
else {
echo "there is something went wrong ...";
}
}
}