45 lines
972 B
PHP
45 lines
972 B
PHP
<?php
|
|
|
|
namespace HermannTelser\Gutachten\DB\Insert;
|
|
|
|
use HermannTelser\Gutachten\DB\DbFunction;
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
|
|
/***
|
|
*
|
|
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
|
*
|
|
* For the full copyright and license information, please read the
|
|
* LICENSE.txt file that was distributed with this source code.
|
|
*
|
|
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
|
*
|
|
***/
|
|
|
|
class AddToTable
|
|
{
|
|
public static function create()
|
|
{
|
|
// DbFunction::$debug = 1;
|
|
|
|
$table = GeneralUtility::_GP('table');
|
|
if (!$table) {
|
|
exit;
|
|
}
|
|
|
|
$field = GeneralUtility::_GP('field');
|
|
$value = GeneralUtility::_GP('value');
|
|
|
|
if($field and $value){
|
|
$insert_array = [];
|
|
$insert_array[$field] = $value;
|
|
DbFunction::secureInsert($table, $insert_array);
|
|
}
|
|
else {
|
|
DbFunction::secureInsert($table);
|
|
}
|
|
echo 1;
|
|
exit;
|
|
}
|
|
}
|