-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
208 lines (187 loc) · 8.21 KB
/
index.php
File metadata and controls
208 lines (187 loc) · 8.21 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?php
#Include config file
session_start();
include_once("includes/config.inc.php");
//$NBCONFIG->simple_cache->setCacheTemplate("austintpl","sdkjsdhjkshkjshd");
$tmp_params = nb_get_all_params();
$do_action = (isset($tmp_params['func']) && $tmp_params['func']) ? $tmp_params['func']:"home";
$web_path = nb_get_conf("web_path");
$viewfile_content = '';
$ADD_INCL_FILE = '';
$DEF_META_DESC = nb_get_conf("sitename")." - Meta Info";
$DEF_META_KEYWORDS = "Meta words";
switch($do_action){
case "sitemap":
{
$ADD_KEYWORDS = "Sitemap";
$ADD_INCL_FILE = $web_path."includes/sitemap.form.inc.php";
$id = "sitemap";
$db = nb_get_conf("db");
$sql = "SELECT atitle,ashortdesc,adesc,aimg,amedia, ametadesc, ametakeywords FROM tbl_articles where asefurl = '$id' and astatus = 1";
$tmp_data= $db->query($sql);
if($tmp_data['num_rows'] > 0){
$tmp_postdata = $tmp_data["allrows"][0];
$viewfile_content = html_entity_decode($tmp_postdata["adesc"]);
$DEF_META_DESC = html_entity_decode($tmp_postdata["ametadesc"]);
$DEF_META_KEYWORDS = html_entity_decode($tmp_postdata["ametakeywords"]);
}
$tmp_sitemap_postdata = array();
$sql = "SELECT atitle,ashortdesc,asefurl FROM tbl_articles where asefurl != '$id' and asefurl != 'welcome-to-us' and asefurl != 'thank-you' and astatus = 1";
$tmp_data= $db->query($sql);
if($tmp_data['num_rows'] > 0){
$tmp_sitemap_postdata = $tmp_data["allrows"];
}
break;
}
case "contact-us":
{
$ADD_KEYWORDS = "Contact us";
$ADD_INCL_FILE = $web_path."includes/contact.form.inc.php";
#---------------------------------------------------------------------
$err_msg = '';
$contact_us_flag = 0;
if($_POST['btnSub']){
$ses_ts = $_SESSION['st'];
$txtFName = nb_clean('txtFName');
$txtEmail = nb_clean('txtEmail');
$txtTel = nb_clean('txtTel');
$txtCity = nb_clean('txtCity');
$txtState = nb_clean('txtState');
$txtLName = nb_clean('txtLName');
$txtMobile = nb_clean('txtMobile');
$txtAddr = nb_clean('txtAddr');
$txtPostcode = nb_clean('txtPostcode');
$txtCountry = nb_clean('txtCountry');
$txtEduSsc = nb_clean('txtEduSsc');
$txtEduSscYrt = nb_clean('txtEduSscYr');
$txtEduGradFld = nb_clean('txtEduGradFld');
$txtEduOtherFld = nb_clean('txtEduOtherFld');
$txtEduHsc = nb_clean('txtEduHsc');
$txtEduHscYr = nb_clean('txtEduHscYr');
$txtEduGrad = nb_clean('txtEduGrad');
$txtEduGradYr = nb_clean('txtEduGradYr');
$txtEduOther = nb_clean('txtEduOther');
$txtEduOtherYr = nb_clean('txtEduOtherYr');
$selCategory = nb_clean('selCategory');
$selGenExamt = nb_clean('selGenExam');
$txtExperience = nb_clean('txtExperience');
$selHeardAbt = nb_clean('selHeardAbt');
$txtComment = nb_clean('txtComment');
$txtCrInt = nb_clean('txtCrInt');
$sub_post_dt = $_POST;
unset($sub_post_dt['ct']);
unset($sub_post_dt['cm']);
unset($sub_post_dt['mode']);
unset($sub_post_dt['btnSub']);
$ct = nb_clean('ct');
if($ct != $ses_ts){
$err_msg = "» Please re-enter your details.";
}else{
if(empty ($txtFName) || strlen($txtFName) < 2){
$err_msg .= "» Please enter valid first name.<br/>";
}
if(empty ($txtEmail) || strlen($txtEmail) < 5){
$err_msg .= "» Please enter valid email id.<br/>";
}
if(empty ($txtMobile) || strlen($txtMobile) < 7){
$err_msg .= "» Please enter valid mobile no.<br/>";
}
if($err_msg){
$err_msg = substr($err_msg, 0, -5);
}else{
$message = "Hello Candidate,<br/><br/>
Welcome to ".nb_get_conf("sitename").", one of our representatives will get back to you shortly.<br/><br/>
In the mean while please visit our website for new updates: <a href='". nb_site_url()."'>".nb_site_url()."</a>";
send_email($txtEmail,"Welcome to ".nb_get_conf("sitename"), $message);
$message = "Hello Admin,<br/><br/>
A new candidate has submitted a request, Please check:<br/><br/>
";
$message .= "<ol>";
foreach ($sub_post_dt as $key => $value) {
$message .= "<li>".strtoupper($key) . " => ". nb_clean($key) . "</li>" ;
}
$message .= "</ol>";
#insert in DB
$db = nb_get_conf("db");
$update_arr = array();
$update_arr['cto'] = $txtEmail;
$update_arr['csubject'] = "Contact Us - Admin ".nb_get_conf("sitename");
$update_arr['cmailbody'] = htmlentities($message);
$update_arr['created'] = date("Y-m-d H:i:s");
$update_arr['cstatus '] = 1;
$sql_ins_val = $db->_bulk_insert(array($update_arr));
$qry = "INSERT INTO tbl_contacts $sql_ins_val";
$last_id = $db->insert($qry,1);
send_email(nb_get_conf("sitemail"),"Contact Us - Admin ".nb_get_conf("sitename"). " - ".$last_id, $message);
$contact_us_flag = 1;
$url = "thank-you";
header("Location:".$url);die(0);
}
}
}
$ts = (rand() * time());
$_SESSION['st'] = $ts;
#---------------------------------------------------------------------
$id = "contact-us";
$db = nb_get_conf("db");
$sql = "SELECT atitle,ashortdesc,adesc,aimg,amedia, ametadesc, ametakeywords FROM tbl_articles where asefurl = '$id' and astatus = 1";
$tmp_data= $db->query($sql);
if($tmp_data['num_rows'] > 0){
$tmp_postdata = $tmp_data["allrows"][0];
$viewfile_content = html_entity_decode($tmp_postdata["adesc"]);
$DEF_META_DESC = html_entity_decode($tmp_postdata["ametadesc"]);
$DEF_META_KEYWORDS = html_entity_decode($tmp_postdata["ametakeywords"]);
}
break;
}
case "thank-you":
{
$ADD_KEYWORDS = "Contact us";
$id = "thank-you";
$db = nb_get_conf("db");
$sql = "SELECT atitle,ashortdesc,adesc,aimg,amedia, ametadesc, ametakeywords FROM tbl_articles where asefurl = '$id' and astatus = 1";
$tmp_data= $db->query($sql);
if($tmp_data['num_rows'] > 0){
$tmp_postdata = $tmp_data["allrows"][0];
$viewfile_content = html_entity_decode($tmp_postdata["adesc"]);
$DEF_META_DESC = html_entity_decode($tmp_postdata["ametadesc"]);
$DEF_META_KEYWORDS = html_entity_decode($tmp_postdata["ametakeywords"]);
}
break;
}
case "about-us":
{
$ADD_KEYWORDS = "About us";
$id = "about-us";
$db = nb_get_conf("db");
$sql = "SELECT atitle,ashortdesc,adesc,aimg,amedia, ametadesc, ametakeywords FROM tbl_articles where asefurl = '$id' and astatus = 1";
$tmp_data= $db->query($sql);
if($tmp_data['num_rows'] > 0){
$tmp_postdata = $tmp_data["allrows"][0];
$viewfile_content = html_entity_decode($tmp_postdata["adesc"]);
$DEF_META_DESC = html_entity_decode($tmp_postdata["ametadesc"]);
$DEF_META_KEYWORDS = html_entity_decode($tmp_postdata["ametakeywords"]);
}
break;
}
case "home":
default:
{
$ADD_KEYWORDS = "International Education";
$id = "welcome-to-us";
$db = nb_get_conf("db");
$sql = "SELECT atitle,ashortdesc,adesc,aimg,amedia, ametadesc, ametakeywords FROM tbl_articles where asefurl = '$id' and astatus = 1";
$tmp_data= $db->query($sql);
if($tmp_data['num_rows'] > 0){
$tmp_postdata = $tmp_data["allrows"][0];
$viewfile_content = html_entity_decode($tmp_postdata["adesc"]);
$DEF_META_DESC = html_entity_decode($tmp_postdata["ametadesc"]);
$DEF_META_KEYWORDS = html_entity_decode($tmp_postdata["ametakeywords"]);
}
break;
}
}
include_once($web_path."views/web_header.php");
include_once($web_path."includes/content.inc.php");
include_once($web_path."views/web_footer.php");
?>