Beispiel #1
0
//TODO: fix file paths to current structure
//Includes - config
include "config/config.inc.php";
//Master generic class
include "classes/vyda.generic.class.php";
//Includes - classes
include "classes/vyda.mysql.php";
include "classes/vyda.webrequest.php";
include "classes/vyda.twilio.php";
//Includes - MultiPING stuff
include "classes/multiping.people.php";
include "classes/multiping.events.php";
include "classes/multiping.messages.php";
include "classes/multiping.communication.php";
//Instantiate the MySQL
$MySQL_Control = new VYDA_MySQL($wpi_db_host, $wpi_db_name, $wpi_db_user, $wpi_db_pass);
//Instantiate the Twilio Object
$Twilio_Control = new VYDA_Twilio($MySQL_Control);
//Instantiate the MultiPING People Class
$MultiPING_People = new MultiPing_People($MySQL_Control);
//Instantiate the MultiPING Event Class
$MultiPING_Events = new MultiPING_Events($MySQL_Control);
//Instantiate the MultiPING Messages Class
$MultiPING_Messages = new MultiPING_Messages($MySQL_Control);
//Instantiate the MultiPING_Communication
$MultiPING_Communication = new MultiPING_Communication($MySQL_Control);
//Define the requested funcitonality
$get_func = $_GET['func'];
//Database test
$full_users = $MySQL_Control->FullAssocReturn("SELECT * FROM `people`");
//Array of files
<html>
<head></head>
<body>
<?php 
//Includes - config
include "../config/config.inc.php";
//Master generic class
include "../classes/vyda.generic.class.php";
//Includes - classes
include "../classes/vyda.mysql.php";
//Instantiate the MySQL
$MySQL_Control = new VYDA_MySQL($wpi_db_host, $wpi_db_name, $wpi_db_user, $wpi_db_pass);
/* 
 *  Display All twilio_text_responses as RESPONSES
 */
echo "<span class='form_header'>Messages</span>\n\t\t<br/>\n\t\t<br/>";
//List of all responses
$sql_field_selection = "`twilio_text_responses`.`id` AS `id`, `twilio_text_responses`.`Body` AS `Body`, `twilio_text_responses`.`From` AS `From`, `people`.`firstname` AS `person_firstname`, `people`.`lastname` AS `person_lastname`";
$response_list = $MySQL_Control->FullAssocReturn("SELECT {$sql_field_selection} FROM `twilio_text_responses` LEFT JOIN `people` ON (`twilio_text_responses`.`person_id` = `people`.`id`) WHERE status='0';");
if ($response_list) {
    echo "<table class='data_table'>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>id</th>\n\t\t\t\t\t<th>body</th>\n\t\t\t\t\t<th>person</th>\n\t\t\t\t\t<th>Phone number</th>\n\t\t\t\t</tr>";
    foreach ($response_list as $random => $response) {
        echo "<tr>\n\t\t\t\t\t<td>{$response['id']}</td>\n\t\t\t\t\t<td>{$response['Body']}</td>\n\t\t\t\t\t<td>{$response['person_firstname']} {$response['person_lastname']}</td>\n\t\t\t\t\t<td>{$response['From']}</td>\n\t\t\t\t</tr>";
    }
    echo "</table>";
} else {
    echo "no responses yet.";
}
?>
</body>
</html>