19 lines
974 B
PHP
19 lines
974 B
PHP
<?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']);
|
|
};
|
|
?>
|