Commit 5d921e6b authored by remy's avatar remy
Browse files

update to map private repo

parent cfb7d36a
...@@ -15,9 +15,11 @@ require_once '../dao/CReaderQuery.php'; ...@@ -15,9 +15,11 @@ require_once '../dao/CReaderQuery.php';
require_once '../dao/CReaderPanelQuery.php'; require_once '../dao/CReaderPanelQuery.php';
require_once "../model/CReader.php"; require_once "../model/CReader.php";
require_once "../model/CReaderPanel.php"; require_once "../model/CReaderPanel.php";
require_once JSR_PATH.'/dao/LogDBQuery.php'; if(!JSONREADER2_STANDALONE) {
require_once JSR_PATH.'/model/Message.php'; require_once JSR_PATH.'/dao/LogDBQuery.php';
require_once JSR_PATH.'/model/Log.php'; require_once JSR_PATH.'/model/Message.php';
require_once JSR_PATH.'/model/Log.php';
}
$db = new DBquery(); $db = new DBquery();
...@@ -67,12 +69,10 @@ if($action == "save") { ...@@ -67,12 +69,10 @@ if($action == "save") {
if(isset($_POST['CReaderID'])) { if(isset($_POST['CReaderID'])) {
$ID = $_POST['CReaderID']; $ID = $_POST['CReaderID'];
} elseif(isset($_GET['CReaderID'])) {
$ID = $_GET['CReaderID'];
} else { } else {
if(isset($_GET['CReaderID'])) { $ID = -1;
$ID = $_GET['CReaderID'];
} else {
$ID = -1;
}
} }
if(isset($_POST['ckey'])) { if(isset($_POST['ckey'])) {
$ckey = $_POST['ckey']; $ckey = $_POST['ckey'];
...@@ -85,16 +85,16 @@ if($action == "save") { ...@@ -85,16 +85,16 @@ if($action == "save") {
} }
if(isset($_POST['color'])) { if(isset($_POST['color'])) {
$color = $_POST['color']; $color = $_POST['color'];
} else { } elseif(isset($_POST['DEFAULT_COLOR'])) {
if(isset($_POST['DEFAULT_COLOR'])) { $color = $_POST['DEFAULT_COLOR'];
$color = $_POST['DEFAULT_COLOR']; } elseif(isset($_POST['colorpicker-regularfont-DEFAULT_COLOR'])) {
} elseif(isset($_POST['colorpicker-regularfont-DEFAULT_COLOR'])) { $color = $_POST['colorpicker-regularfont-DEFAULT_COLOR'];
$color = $_POST['colorpicker-regularfont-DEFAULT_COLOR']; } else { $color = "#3498db"; }
} else { $color = "#3498db"; }
}
if(isset($_POST['Cpanel'])) { if(isset($_POST['Cpanel'])) {
$CpanelTitle = $_POST['Cpanel']; $CpanelTitle = $_POST['Cpanel'];
} }
$creader = new CReader($ID, $ckey, $cvalue, $FieldType, $color); $creader = new CReader($ID, $ckey, $cvalue, $FieldType, $color);
if($action == "create") { if($action == "create") {
......
...@@ -15,9 +15,11 @@ require_once '../dao/CReaderPanelQuery.php'; ...@@ -15,9 +15,11 @@ require_once '../dao/CReaderPanelQuery.php';
require_once '../dao/CReaderQuery.php'; require_once '../dao/CReaderQuery.php';
require_once "../model/CReaderPanel.php"; require_once "../model/CReaderPanel.php";
require_once "../model/CReader.php"; require_once "../model/CReader.php";
require_once JSR_PATH.'/dao/LogDBQuery.php'; if(!JSONREADER2_STANDALONE) {
require_once JSR_PATH.'/model/Message.php'; require_once JSR_PATH.'/dao/LogDBQuery.php';
require_once JSR_PATH.'/model/Log.php'; require_once JSR_PATH.'/model/Message.php';
require_once JSR_PATH.'/model/Log.php';
}
$db = new DBquery(); $db = new DBquery();
......
...@@ -13,8 +13,11 @@ if(!JSONREADER2_STANDALONE) { ...@@ -13,8 +13,11 @@ if(!JSONREADER2_STANDALONE) {
require_once JSR_PATH.'/dao/DBquery.php'; require_once JSR_PATH.'/dao/DBquery.php';
require_once JSR_PATH.'/dao/ReaderTableDBQuery.php'; require_once JSR_PATH.'/dao/ReaderTableDBQuery.php';
require_once "../model/ReaderTable.php"; require_once "../model/ReaderTable.php";
require_once JSR_PATH.'/dao/LogDBQuery.php'; if(!JSONREADER2_STANDALONE) {
require_once JSR_PATH.'/model/Message.php'; require_once JSR_PATH.'/dao/LogDBQuery.php';
require_once JSR_PATH.'/model/Message.php';
require_once JSR_PATH.'/model/Log.php';
}
$db = new DBquery(); $db = new DBquery();
......
<?php <?php
require_once(__DIR__.'/../config/Conf.php'); require_once(__DIR__.'/../config/Conf.php');
require_once(__DIR__.'/../config/Plugin.php');
require_once(__DIR__ .'/../model/Option.php');
/* plugins */ /* plugins */
require_once(__DIR__ .'/../model/ReaderTable.php'); require_once(__DIR__ .'/../model/ReaderTable.php');
require_once(__DIR__ .'/../model/CReader.php'); require_once(__DIR__ .'/../model/CReader.php');
...@@ -73,11 +75,14 @@ class DBquery { ...@@ -73,11 +75,14 @@ class DBquery {
* @return Message * @return Message
*/ */
public function create($object) { public function create($object) {
$message = new Message("create", $object->getMessage("create")); if(!JSONREADER2_STANDALONE) {
$message = new Message("create", $object->getMessage("create"));
}
$result = mysqli_query($this->dbh, $object->getInsert()); $result = mysqli_query($this->dbh, $object->getInsert());
var_dump($object->getInsert());
if($result) { if($result) {
return $message; if(isset($message)) {
return $message;
} else { return ""; }
} else { } else {
var_dump(mysqli_error($this->dbh)); var_dump(mysqli_error($this->dbh));
die(); die();
...@@ -92,10 +97,14 @@ class DBquery { ...@@ -92,10 +97,14 @@ class DBquery {
* @return Message * @return Message
*/ */
public function update($object) { public function update($object) {
$message = new Message("update", $object->getMessage("update")); if(!JSONREADER2_STANDALONE) {
$message = new Message("update", $object->getMessage("update"));
}
$result = mysqli_query($this->dbh, $object->getUpdate()); $result = mysqli_query($this->dbh, $object->getUpdate());
if($result) { if($result) {
return $message; if(isset($message)) {
return $message;
} else { return ""; }
} else { } else {
var_dump(mysqli_error($this->dbh)); var_dump(mysqli_error($this->dbh));
die(); die();
...@@ -110,10 +119,14 @@ class DBquery { ...@@ -110,10 +119,14 @@ class DBquery {
* @return Message * @return Message
*/ */
public function delete($object) { public function delete($object) {
$message = new Message("delete", $object->getMessage("delete")); if(!JSONREADER2_STANDALONE) {
$message = new Message("delete", $object->getMessage("delete"));
}
$result = mysqli_query($this->dbh, $object->getDelete()); $result = mysqli_query($this->dbh, $object->getDelete());
if($result) { if($result) {
return $message; if(isset($message)) {
return $message;
} else { return ""; }
} else { } else {
var_dump(mysqli_error($this->dbh)); var_dump(mysqli_error($this->dbh));
die(); die();
......
...@@ -16,6 +16,7 @@ require_once "../dao/CReaderQuery.php"; ...@@ -16,6 +16,7 @@ require_once "../dao/CReaderQuery.php";
require_once "../include/toolReader.php"; require_once "../include/toolReader.php";
require_once "../dao/ReaderTableDBQuery.php"; require_once "../dao/ReaderTableDBQuery.php";
require_once "../model/SuperReader.php"; require_once "../model/SuperReader.php";
require_once JSR_PATH."/include/tools.php";
$db = new DBquery(); $db = new DBquery();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment