-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmethods.php
64 lines (53 loc) · 2.01 KB
/
methods.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
<?php
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php' );
require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/wp-db.php' );
global $wpdb;
// $message = "a";
// echo $message;
if (isset($_POST['action'])) {
switch ($_POST['action']) {
// case 'contactUsForm':
// $name = $_POST['name'];
// $email = $_POST['email'];
// $phone = $_POST['phone'];
// $message = $_POST['message'];
// if($wpdb -> insert('contactus', array(
// 'name' => $name, 'email' => $email,
// 'phone' => $phone, 'message' => $message)) == false){
// $message ='Database Insertion Failed';
// wp_die();
// }
// else $message = 'Database insertion successful';
// break;
default: echo "Error: Invalid action data being passed in AJAX (CHECK JS)";
break;
}
echo $message;
} else if (isset($_GET['action'])) {
switch ($_GET['action']) {
// case 'browseCasePicLoadMore':
// $result = $wpdb->get_results ( "SELECT * FROM casedetails ".
// "WHERE status = 'unsolved' ORDER BY id ".
// "LIMIT ".$_GET['currentIndex'].", 8", ARRAY_A);
// $htmlSnippet = "";
// $currentIndex = $_GET['currentIndex'];
// foreach($result as $row){
// $src = "http://wordpress.local/wordpress/5-specific-case?caseNumber={$row['id']}";
// $currentIndex += 1;
// $htmlSnippet .=
// '<div class="col-sm-3 offset-sm-1 pic-div">
// <a href = "'.$src.'">
// <img class="img-responsive" src="../wp-content/themes/missingPersons/images/icon.png">
// <p id="nameloc" class="maintext">'.$row['fName'].' '.$row['lName'].', '.
// $row['lastlocation'].'</p>
// <p id="date" class="subtext">Last seen: '.$row['lastseen'].'</p>
// </a>
// </div>';
// }
// echo $htmlSnippet.";".$currentIndex;
// break;
default: echo "Error: Invalid action data being passed in AJAX (CHECK JS)";
break;
}
}
?>