-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathheader.php
488 lines (377 loc) · 16.1 KB
/
header.php
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
<?php
// Start the session
session_start();
?>
<?php
if ($_SERVER['HTTP_HOST'] == "capitalcuonline.com")
{
$url = "https://www." . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location: $url");
}
?>
<!--
Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
cfsghjdf.com-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Capital Credit Union Online</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="E-Banking Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, Sony Ericsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- Custom Theme files -->
<link href="css/bootstrap.css" type="text/css" rel="stylesheet" media="all">
<link href="css/style.css" type="text/css" rel="stylesheet" media="all">
<link href="css/font-awesome.css" rel="stylesheet"> <!-- font-awesome icons -->
<!-- //Custom Theme files -->
<!-- js -->
<script src="js/jquery-2.2.3.min.js"></script>
<!-- web-fonts -->
<link href="//fonts.googleapis.com/css?family=Secular+One" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Raleway:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> -->
<!-- //web-fonts -->
<!-- for modal from register page -->
</head>
<?php
if (isset($successm)){
echo $successm;
}
?>
<?php
$servername = "localhost";
$username = "capitalc_001";
$password = "An0therrichard3303";
$dbname = "capitalc_001";
$date = date('d-m-Y H:m:s');
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($_POST['email'])){
$name = $_POST['name'];
$email = $_POST['email'];
$occupation = $_POST['occupation'];
$phone = $_POST['phone'];
$accounttype = $_POST['accounttype'];
$address = $_POST['address'];
$usernamet = $_POST['usernamer'];
$country = $_POST['country'];
$gender = $_POST['gender'];
$sql = "SELECT * FROM register WHERE username = '$usernamet'";
$result = $conn->query($sql);
if ($result->num_rows > 0 ) {
$fail='<div class="alert alert-danger">Sorry. username is already taken</div>';
}else{
//upload photo
$target_dir = "Dashboard/appzia/assets/images/users/";
$dpi = "assets/images/users/";
$target_file = $target_dir . basename($_FILES["photo"]["name"]);
$dpshow = $dpi . basename($_FILES["photo"]["name"]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["photo"]["tmp_name"]);
if($check !== false) {
// echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}
}
// Check if file already exists
if (file_exists($target_file)) {
$fail='<div class="alert alert-danger">Sorry rename photo and try again.</div>';
$uploadOk = 0;
}
// Check file size
if ($_FILES["photo"]["size"] > 500000) {
$fail='<div class="alert alert-danger">Sorry, your file is too large.</div>';
$uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
$fail='<div class="alert alert-danger">Sorry, only JPG, JPEG, PNG & GIF files are allowed.</div>';
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
// $fail='<div class="alert alert-danger">Photo name exists rename the photo. and kindly try again.</div>';
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["photo"]["tmp_name"], $target_file)) {
$characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
$pass = '';
$max = strlen($characters) - 1;
for ($i = 0; $i < 7; $i++) {
$pass .= $characters[mt_rand(0, $max)];
}
$charactersacn = '0123456789';
$accountnumber = '';
$max = strlen($charactersacn) - 1;
for ($i = 0; $i < 10; $i++) {
$accountnumber .= $charactersacn[mt_rand(0, $max)];
}
$sql = "INSERT INTO register (name, account_number, email, a, phone, account_type, account_balance, account_status, username, password, c, e, gender, address)
VALUES ('$name', '$accountnumber', '$email', '$occupation', '$phone', '$accounttype', '0.00', '3', '$usernamet', '$pass', '$country', '$dpshow', '$gender', '$address')";
if ($conn->query($sql) === TRUE) {
$phonetext = substr($phone, 1);
//mailing client his/her bank details to email
$to = ''.$email.'';
$subject = 'Bank Account Information';
$headers = 'From: Capital C.U Online <noreply@capitalcuonline.com>' . PHP_EOL .
'Reply-To: Jack Sparrow <noreply@capitalcuonline.com>' . PHP_EOL .
'X-Mailer: PHP/' . phpversion();
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$message = '<p><strong><div align=center><font color=#555bc6>Welcome To Capital Credit Union Online</div></font></strong><br> Hello '.$name.',<br> below are your online bank account details.<br>
Account Name:'.$name.'<br>
Account Number:'.$accountnumber.'<br><br>
<strong>Username: '.$usernamet.'<br>
Password: '.$pass.'<br><br></strong>
You have been assigned an account officer to help you in any where you find it difficult to run your account. below are your account officer details
<br>
Name: Mr Bob R. Roberts.<br>
Phoen:+12134213247<br>
Email: bobroberts@capitalcuonline.com<br><br>
<font color="#8688a0" size=2>This is an automated email from Capital C.U Online please do not reply</font>
</p>';
mail($to, $subject, $message, $headers);
//sending welcome sms
// // send sms.
// // Account details
//txtlocal.co.uk
// $apiKey = urlencode('3MmebfWUE0M-eSqlfNfDYFRB9TU6nBKk687kT8YVWF');
// $customised="Good day,$name. Welcome to CCU Online. Thank you for choosing us.";
// // Message details
// $numbers = array($phonetext);
// $sender = urlencode('ccu');
// $message = rawurlencode($customised);
// $numbers = implode(',', $numbers);
// // Prepare data for POST request
// $data = array('apikey' => $apiKey, 'numbers' => $numbers, "sender" => $sender, "message" => $message);
// // Send the POST request with cURL
// $ch = curl_init('https://api.txtlocal.com/send/');
// curl_setopt($ch, CURLOPT_POST, true);
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// $response = curl_exec($ch);
// curl_close($ch);
//sending welcom sms ebulksms.com
$json_url = "http://api.ebulksms.com:8080/sendsms.json";
$xml_url = "http://api.ebulksms.com:8080/sendsms.xml";
$http_get_url = "http://api.ebulksms.com:8080/sendsms";
$username = '';
$apikey = '';
//Function to connect to SMS sending server using HTTP POST
function doPostRequest($url, $arr_params, $headers = array('Content-Type: application/x-www-form-urlencoded')) {
$response = array();
$final_url_data = $arr_params;
if (is_array($arr_params)) {
$final_url_data = http_build_query($arr_params, '', '&');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $final_url_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$response['body'] = curl_exec($ch);
$response['code'] = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return $response['body'];
}
function useJSON($url, $username, $apikey, $flash, $sendername, $messagetext, $recipients) {
$gsm = array();
$country_code = '234';
$arr_recipient = explode(',', $recipients);
foreach ($arr_recipient as $recipient) {
$mobilenumber = trim($recipient);
if (substr($mobilenumber, 0, 1) == '0'){
$mobilenumber = $country_code . substr($mobilenumber, 1);
}
elseif (substr($mobilenumber, 0, 1) == '+'){
$mobilenumber = substr($mobilenumber, 1);
}
$generated_id = uniqid('int_', false);
$gsm['gsm'][] = array('msidn' => $mobilenumber, 'msgid' => $generated_id);
}
$message = array(
'sender' => $sendername,
'messagetext' => $messagetext,
'flash' => "{$flash}",
);
$request = array('SMS' => array(
'auth' => array(
'username' => $username,
'apikey' => $apikey
),
'message' => $message,
'recipients' => $gsm
));
$json_data = json_encode($request);
if ($json_data) {
$response = doPostRequest($url, $json_data, array('Content-Type: application/json'));
$result = json_decode($response);
return $result->response->status;
} else {
return false;
}
}
if (isset($_POST['email'])) {
$username = "nwudoebuka@gmail.com";
$apikey = "0b4bd019a7292ff97d7b626335afe0176d2a2855";
$sendername = substr($_POST['sender_name'], 0, 11);
$recipients = $phone;
$message = "Good day,$name. your Online details are Accnumber:$accountnumber Username: $usernamet Paswd: $pass Thank you for choosing us.";
$flash = 0;
if (get_magic_quotes_gpc()) {
$message = stripslashes($message);
}
$message = substr($message, 0, 160);
#Use the next line for HTTP POST with JSON
$result = useJSON($json_url, $username, $apikey, $flash, $sendername, $message, $recipients);
// echo $result;
#Uncomment the next line and comment the one above if you want to use HTTP POST with XML
//$result = useXML($xml_url, $username, $apikey, $flash, $sendername, $message, $recipients);
#Uncomment the next line and comment the ones above if you want to use simple HTTP GET
//$result = useHTTPGet($http_get_url, $username, $apikey, $flash, $sendername, $message, $recipients);
}
function useXML($url, $username, $apikey, $flash, $sendername, $messagetext, $recipients) {
$country_code = '234';
$arr_recipient = explode(',', $recipients);
$count = count($arr_recipient);
$msg_ids = array();
$recipients = '';
$xml = new SimpleXMLElement('<SMS></SMS>');
$auth = $xml->addChild('auth');
$auth->addChild('username', $username);
$auth->addChild('apikey', $apikey);
$msg = $xml->addChild('message');
$msg->addChild('sender', $sendername);
$msg->addChild('messagetext', $messagetext);
$msg->addChild('flash', $flash);
$rcpt = $xml->addChild('recipients');
for ($i = 0; $i < $count; $i++) {
$generated_id = uniqid('int_', false);
$generated_id = substr($generated_id, 0, 30);
$mobilenumber = trim($arr_recipient[$i]);
if (substr($mobilenumber, 0, 1) == '0') {
$mobilenumber = $country_code . substr($mobilenumber, 1);
} elseif (substr($mobilenumber, 0, 1) == '+') {
$mobilenumber = substr($mobilenumber, 1);
}
$gsm = $rcpt->addChild('gsm');
$gsm->addchild('msidn', $mobilenumber);
$gsm->addchild('msgid', $generated_id);
}
$xmlrequest = $xml->asXML();
if ($xmlrequest) {
$result = doPostRequest($url, $xmlrequest, array('Content-Type: application/xml'));
$xmlresponse = new SimpleXMLElement($result);
return $xmlresponse->status;
}
return false;
}
function useHTTPGet($url, $username, $apikey, $flash, $sendername, $messagetext, $recipients) {
$query_str = http_build_query(array('username' => $username, 'apikey' => $apikey, 'sender' => $sendername, 'messagetext' => $messagetext, 'flash' => $flash, 'recipients' => $recipients));
return file_get_contents("{$url}?{$query_str}");
}
//welcom sms ends here
$success='<div class="alert alert-success">Succesful, check your mail box(' .$email. ') or Phone for registeration details. check junk/spam if not found in inbox.</div>';
}else{
$fail='<div class="alert alert-danger">Registeration Failed...Try again</div>';
}
} else {
$fail='<div class="alert alert-danger">there was an error uploading photo(photo size may be too large). Kindly try again.</div>';
}
}
//upload photo
}
}
?>
<body>
<!-- header -->
<div class="headerw3-agile">
<div class="header-w3mdl"><!-- header-two -->
<div class="container">
<div class="agileits-logo navbar-left">
<h1><a href="index.php"><img src="images/capital.jpg" width=180px height=120px alt="logo"/></a></h1>
</div>
<div class="agileits-hdright nav navbar-nav">
<div class="header-w3top"><!-- header-top -->
<ul class="w3l-nav-top">
<li><i class="fa fa-phone"></i><span> +12134213247 </span></li>
<li>Select Language<br><div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script></li>
</ul>
<div class="clearfix"> </div>
</div>
<div class="agile_social_banner">
<ul class="agileits_social_list">
<li><a href="#" class="w3_agile_facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
<li><a href="#" class="agile_twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
<li><a href="#" class="w3_agile_dribble"><i class="fa fa-dribbble" aria-hidden="true"></i></a></li>
<li><a href="#" class="w3_agile_vimeo"><i class="fa fa-vimeo" aria-hidden="true"></i></a></li>
</ul>
</div>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
<?php
if (isset($successm)){
echo $successm;
}
?>
<!-- //header -->
<!-- banner -->
<div class="banner">
<div class="header-nav"><!-- header-three -->
<nav class="navbar navbar-default">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
Menu
</button>
</div>
<!-- top-nav -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="index.php" class="<?php if(isset($home)){echo $home;}else{echo "scroll";}?>">Home</a></li>
<li><a href="about.php" class=" <?php if(isset($about)){echo $about;}else{echo "scroll";}?>">About</a></li>
<li><a href="services.php" class=" <?php if(isset($services)){echo $services;}else{echo "scroll";}?>">services</a></li>
<li><a href="gallery.php" class="<?php if(isset($products)){echo $products;}else{echo "scroll";}?>">Products</a></li>
<li><a href="index.php" data-toggle="dropdown">Login/Open Account<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#" data-toggle="modal" data-target="#myModal1">Login</a></li>
<li><a href="#myModal" id="createaccount" data-toggle="modal">Open an account</a></li>
</ul>
</li>
<li><a href="contact.php" class="<?php if(isset($contact)){echo $contact;}else{echo "scroll";}?>">Contact Us</a></li>
</ul>
<div class="clearfix"> </div>
</div>
</nav>
</div>
<!-- banner-text -->