34 lines
1.0 KiB
PHP
34 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace HermannTelser\Gutachten\DB\Delete;
|
|
|
|
use HermannTelser\Gutachten\DB\DbFunction;
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
|
|
class DeleteMerkmal
|
|
{
|
|
public static function delete()
|
|
{
|
|
// DbFunction::$debug = 1;
|
|
|
|
$id = GeneralUtility::_GP('id');
|
|
if(!$id){
|
|
exit;
|
|
}
|
|
|
|
$_merkmal = DbFunction::select('tx_gutachten_help',['pid','colid'], ['id' => $id]);
|
|
|
|
if($_merkmal){
|
|
$field = $_merkmal[0]['colid'];
|
|
$update_array[$field] = 0;
|
|
DbFunction::secureUpdate('tx_gutachten_raume_basis', $update_array, ['pid' => $_merkmal[0]['pid']]);
|
|
|
|
DbFunction::delete('tx_gutachten_help', ['id' => $id]);
|
|
DbFunction::query("Update tx_gutachten_raume_basis SET summe_az = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u where pid=" . $_merkmal[0]['pid']);
|
|
DbFunction::query("Update tx_gutachten_raume_basis SET bewertung = 100 - summe_az where pid=" . $_merkmal[0]['pid']);
|
|
echo 1;
|
|
exit;
|
|
}
|
|
}
|
|
}
|