init
This commit is contained in:
19
modules/Documents/accept.php
Normal file
19
modules/Documents/accept.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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']);
|
||||
};
|
||||
?>
|
||||
Reference in New Issue
Block a user