| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <?php return array (
- 'resourceClass' => 'modDocument',
- 'resource' =>
- array (
- 'id' => 102,
- 'type' => 'document',
- 'contentType' => 'text/html',
- 'pagetitle' => 'mg',
- 'longtitle' => '',
- 'description' => '',
- 'alias' => 'mg',
- 'alias_visible' => 1,
- 'link_attributes' => '',
- 'published' => 1,
- 'pub_date' => 0,
- 'unpub_date' => 0,
- 'parent' => 101,
- 'isfolder' => 0,
- 'introtext' => '',
- 'content' => '[[!moistureGraph]]',
- 'richtext' => 0,
- 'template' => 0,
- 'menuindex' => 0,
- 'searchable' => 1,
- 'cacheable' => 1,
- 'createdby' => 1,
- 'createdon' => 1568246340,
- 'editedby' => 1,
- 'editedon' => 1568594431,
- 'deleted' => 0,
- 'deletedon' => 0,
- 'deletedby' => 0,
- 'publishedon' => 1568246340,
- 'publishedby' => 1,
- 'menutitle' => '',
- 'donthit' => 0,
- 'privateweb' => 0,
- 'privatemgr' => 0,
- 'content_dispo' => 0,
- 'hidemenu' => 1,
- 'class_key' => 'modDocument',
- 'context_key' => 'web',
- 'content_type' => 1,
- 'uri' => 'mg.html',
- 'uri_override' => 0,
- 'hide_children_in_tree' => 0,
- 'show_in_tree' => 1,
- 'properties' => NULL,
- '_content' => '[[!moistureGraph]]',
- '_isForward' => false,
- ),
- 'contentType' =>
- array (
- 'id' => 1,
- 'name' => 'HTML',
- 'description' => 'HTML content',
- 'mime_type' => 'text/html',
- 'file_extensions' => '.html',
- 'headers' => NULL,
- 'binary' => 0,
- ),
- 'policyCache' =>
- array (
- ),
- 'sourceCache' =>
- array (
- 'modChunk' =>
- array (
- ),
- 'modSnippet' =>
- array (
- 'moistureGraph' =>
- array (
- 'fields' =>
- array (
- 'id' => 134,
- 'source' => 0,
- 'property_preprocess' => false,
- 'name' => 'moistureGraph',
- 'description' => 'https://jsfiddle.net/canvasjs/1ypqwbLz/',
- 'editor_type' => 0,
- 'category' => 50,
- 'cache_type' => 0,
- 'snippet' => 'error_reporting(E_ALL);
- ini_set(\'display_errors\', 1);
-
- header(\'Content-Type: application/json\');
-
- $client_id = ""; // Client ID
- $client_serial = $_GET[\'client_serial\']; //serial number of clients device
- $date_start = $_GET[\'date_start\']; //start date of graph
- $date_end = $_GET[\'date_end\']; // end date of graph
-
- if ( isset($_GET[\'client_serial\']) ) {
- $sensor_filter = " `sensor_id` = \'". $client_serial ."\' AND ";
- } else {
- $sensor_filter = " ";
- }
-
- //Database connection
- $con = mysqli_connect("localhost", "root", "R3M0T31", "cropmonitor");
-
- // Check connection
- if (mysqli_connect_errno()) {
- echo "Failed to connect to MySQL: " . mysqli_connect_error();
- }
-
- $sqlQuery = "SELECT `id`, `sensor_id`, `DATEUTC` AS `cur_date`, `value` FROM `field_sensors` WHERE ". $sensor_filter ." (`DATEUTC` BETWEEN \'" . $date_start . "\' AND \'" . $date_end . "\') ORDER BY `DATEUTC`";
- //
-
- $result = mysqli_query($con,$sqlQuery);
-
- $data = array();
- foreach ($result as $row) {
- $data[] = $row;
- }
-
- mysqli_close($con);
-
- echo json_encode($data);',
- 'locked' => false,
- 'properties' =>
- array (
- ),
- 'moduleguid' => '',
- 'static' => false,
- 'static_file' => '',
- 'content' => 'error_reporting(E_ALL);
- ini_set(\'display_errors\', 1);
-
- header(\'Content-Type: application/json\');
-
- $client_id = ""; // Client ID
- $client_serial = $_GET[\'client_serial\']; //serial number of clients device
- $date_start = $_GET[\'date_start\']; //start date of graph
- $date_end = $_GET[\'date_end\']; // end date of graph
-
- if ( isset($_GET[\'client_serial\']) ) {
- $sensor_filter = " `sensor_id` = \'". $client_serial ."\' AND ";
- } else {
- $sensor_filter = " ";
- }
-
- //Database connection
- $con = mysqli_connect("localhost", "root", "R3M0T31", "cropmonitor");
-
- // Check connection
- if (mysqli_connect_errno()) {
- echo "Failed to connect to MySQL: " . mysqli_connect_error();
- }
-
- $sqlQuery = "SELECT `id`, `sensor_id`, `DATEUTC` AS `cur_date`, `value` FROM `field_sensors` WHERE ". $sensor_filter ." (`DATEUTC` BETWEEN \'" . $date_start . "\' AND \'" . $date_end . "\') ORDER BY `DATEUTC`";
- //
-
- $result = mysqli_query($con,$sqlQuery);
-
- $data = array();
- foreach ($result as $row) {
- $data[] = $row;
- }
-
- mysqli_close($con);
-
- echo json_encode($data);',
- ),
- 'policies' =>
- array (
- ),
- 'source' =>
- array (
- ),
- ),
- ),
- 'modTemplateVar' =>
- array (
- ),
- ),
- );
|