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';
require_once '../dao/CReaderPanelQuery.php';
require_once "../model/CReader.php";
require_once "../model/CReaderPanel.php";
require_once JSR_PATH.'/dao/LogDBQuery.php';
require_once JSR_PATH.'/model/Message.php';
require_once JSR_PATH.'/model/Log.php';
if(!JSONREADER2_STANDALONE) {
require_once JSR_PATH.'/dao/LogDBQuery.php';
require_once JSR_PATH.'/model/Message.php';
require_once JSR_PATH.'/model/Log.php';
}
$db = new DBquery();
......@@ -67,13 +69,11 @@ if($action == "save") {
if(isset($_POST['CReaderID'])) {
$ID = $_POST['CReaderID'];
} else {
if(isset($_GET['CReaderID'])) {
} elseif(isset($_GET['CReaderID'])) {
$ID = $_GET['CReaderID'];
} else {
$ID = -1;
}
}
if(isset($_POST['ckey'])) {
$ckey = $_POST['ckey'];
}
......@@ -85,16 +85,16 @@ if($action == "save") {
}
if(isset($_POST['color'])) {
$color = $_POST['color'];
} else {
if(isset($_POST['DEFAULT_COLOR'])) {
} elseif(isset($_POST['DEFAULT_COLOR'])) {
$color = $_POST['DEFAULT_COLOR'];
} elseif(isset($_POST['colorpicker-regularfont-DEFAULT_COLOR'])) {
$color = $_POST['colorpicker-regularfont-DEFAULT_COLOR'];
} else { $color = "#3498db"; }
}
if(isset($_POST['Cpanel'])) {
$CpanelTitle = $_POST['Cpanel'];
}
$creader = new CReader($ID, $ckey, $cvalue, $FieldType, $color);
if($action == "create") {
......
......@@ -15,9 +15,11 @@ require_once '../dao/CReaderPanelQuery.php';
require_once '../dao/CReaderQuery.php';
require_once "../model/CReaderPanel.php";
require_once "../model/CReader.php";
require_once JSR_PATH.'/dao/LogDBQuery.php';
require_once JSR_PATH.'/model/Message.php';
require_once JSR_PATH.'/model/Log.php';
if(!JSONREADER2_STANDALONE) {
require_once JSR_PATH.'/dao/LogDBQuery.php';
require_once JSR_PATH.'/model/Message.php';
require_once JSR_PATH.'/model/Log.php';
}
$db = new DBquery();
......
......@@ -13,8 +13,11 @@ if(!JSONREADER2_STANDALONE) {
require_once JSR_PATH.'/dao/DBquery.php';
require_once JSR_PATH.'/dao/ReaderTableDBQuery.php';
require_once "../model/ReaderTable.php";
require_once JSR_PATH.'/dao/LogDBQuery.php';
require_once JSR_PATH.'/model/Message.php';
if(!JSONREADER2_STANDALONE) {
require_once JSR_PATH.'/dao/LogDBQuery.php';
require_once JSR_PATH.'/model/Message.php';
require_once JSR_PATH.'/model/Log.php';
}
$db = new DBquery();
......
<?php
require_once(__DIR__.'/../config/Conf.php');
require_once(__DIR__.'/../config/Plugin.php');
require_once(__DIR__ .'/../model/Option.php');
/* plugins */
require_once(__DIR__ .'/../model/ReaderTable.php');
require_once(__DIR__ .'/../model/CReader.php');
......@@ -73,11 +75,14 @@ class DBquery {
* @return Message
*/
public function create($object) {
if(!JSONREADER2_STANDALONE) {
$message = new Message("create", $object->getMessage("create"));
}
$result = mysqli_query($this->dbh, $object->getInsert());
var_dump($object->getInsert());
if($result) {
if(isset($message)) {
return $message;
} else { return ""; }
} else {
var_dump(mysqli_error($this->dbh));
die();
......@@ -92,10 +97,14 @@ class DBquery {
* @return Message
*/
public function update($object) {
if(!JSONREADER2_STANDALONE) {
$message = new Message("update", $object->getMessage("update"));
}
$result = mysqli_query($this->dbh, $object->getUpdate());
if($result) {
if(isset($message)) {
return $message;
} else { return ""; }
} else {
var_dump(mysqli_error($this->dbh));
die();
......@@ -110,10 +119,14 @@ class DBquery {
* @return Message
*/
public function delete($object) {
if(!JSONREADER2_STANDALONE) {
$message = new Message("delete", $object->getMessage("delete"));
}
$result = mysqli_query($this->dbh, $object->getDelete());
if($result) {
if(isset($message)) {
return $message;
} else { return ""; }
} else {
var_dump(mysqli_error($this->dbh));
die();
......
......@@ -16,6 +16,7 @@ require_once "../dao/CReaderQuery.php";
require_once "../include/toolReader.php";
require_once "../dao/ReaderTableDBQuery.php";
require_once "../model/SuperReader.php";
require_once JSR_PATH."/include/tools.php";
$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