Files
crm.e5.pl/modules/Documents/accept.php

19 lines
992 B
PHP
Raw Permalink Normal View History

2024-04-27 09:23:34 +02:00
<?php
global $current_user;
if ($_REQUEST['user_id'] == $current_user->id) {
//$GLOBALS['db']->query("UPDATE documents_user SET accepted='".$_REQUEST['status']."', date_accepted=NOW(), accepted_description='".$_REQUEST['des']."' WHERE id='".$_REQUEST['record']."'");
$sqlSelect = "SELECT accepted_description FROM documents_user WHERE id='" . $_REQUEST['record'] . "'";
$stary = $GLOBALS['db']->getOne($sqlSelect);
$tekst = '';
if ($stary == NULL) {
$tekst = date('d.m.Y H.i:s').' - '. $_REQUEST['des'];
} else {
$tekst = date('d.m.Y H.i:s').' - '. $_REQUEST['des'].'XVZC'. $stary;
}
$sqlUpdate = "UPDATE documents_user SET accepted='" . $_REQUEST['status'] . "', date_accepted=NOW(), accepted_description='" . $tekst . "' WHERE id='" . $_REQUEST['record'] . "'";
echo $sqlUpdate;
$GLOBALS['db']->query($sqlUpdate);
header('Location: index.php?module=Documents&action=DetailView&record='.$_REQUEST['doc_id']);
};
?>