diff --git a/modules/PRB_FileControl/PRB_FileControl.php b/modules/PRB_FileControl/PRB_FileControl.php
index 2ef5ce9..081e12d 100644
--- a/modules/PRB_FileControl/PRB_FileControl.php
+++ b/modules/PRB_FileControl/PRB_FileControl.php
@@ -14,6 +14,7 @@ trait PRB_FileControl
0,
'$name',
'$filePATH',
+ '',
'".$params['data']['item']['uploadIP']."',
'".$params['data']['date']." $time')";
insert($query);
@@ -24,6 +25,7 @@ trait PRB_FileControl
[isCompleted]
,[file_name]
,[file_path]
+ ,[comment]
,convert(varchar, [upload_date],104)+' - '+convert(varchar, [upload_date],108) as [Дата загрузки]
,[id]
FROM [Production].[dbo].[PRB_FileControl]
@@ -39,6 +41,15 @@ trait PRB_FileControl
WHERE id=".$params['data']['id']."";
update($query);
}
+
+ public function setComment($params)
+ {
+ $query = "UPDATE [Production].[dbo].[PRB_FileControl]
+ SET comment='".$params['data']['comment']."'
+ WHERE id=".$params['data']['id']."";
+ update($query);
+ }
+
public function setHistory($params)
{
$query = "INSERT INTO [Production].[dbo].[PRB_FileLog] VALUES (
diff --git a/modules/PRB_FileControl/redirect/index.php b/modules/PRB_FileControl/redirect/index.php
new file mode 100644
index 0000000..3372065
--- /dev/null
+++ b/modules/PRB_FileControl/redirect/index.php
@@ -0,0 +1,204 @@
+ $Database, 'UID' => $UID, 'PWD' => $PWD);
+ $conn = sqlsrv_connect($serverName, $connectionInfo);
+ if ($conn) {
+ header('Content-Type:text/html; charset=UTF-8', true, 200);
+ } else {
+ header('Content-Type:text/html; charset=UTF-8', true, 301);
+ if (($errors = sqlsrv_errors()) != null) {
+ foreach ($errors as $error) {
+ echo "SQLSTATE: " . $error['SQLSTATE'] . "
";
+ echo "code: " . $error['code'] . "
";
+ echo "message: " . iconv('windows-1251', 'UTF-8', $error['message']) . "
";
+ }
+ }
+ }
+
+ // Получаем текущую дату в формате YYYY-MM-DD
+ $today = date('Y-m-d');
+
+ // Обработка выбранной даты из формы
+ $selected_date = isset($_POST['selected_date']) ? $_POST['selected_date'] : $today;
+
+ // Формируем SQL‑запрос с учётом выбранной даты
+ if ($selected_date) {
+ $sql = "SELECT
+ [isCompleted],
+ [file_name],
+ [comment],
+ [file_path],
+ CONVERT(varchar, [upload_date], 104) + ' - ' + CONVERT(varchar, [upload_date], 108) AS [upload_date],
+ [id]
+ FROM [Production].[dbo].[PRB_FileControl]
+ WHERE CONVERT(date, [upload_date]) = CONVERT(date, ?)
+ AND [isCompleted] = 1
+ ORDER BY upload_date DESC";
+ $params = array($selected_date);
+ } else {
+ // Если дата не выбрана, показываем данные за последний день
+ $sql = "SELECT
+ [isCompleted],
+ [file_name],
+ [comment],
+ [file_path],
+ CONVERT(varchar, [upload_date], 104) + ' - ' + CONVERT(varchar, [upload_date], 108) AS [upload_date],
+ [id]
+ FROM [Production].[dbo].[PRB_FileControl]
+ WHERE DATEDIFF(day, [upload_date], GETDATE()) <= 0
+ AND [isCompleted] = 1
+ ORDER BY upload_date DESC";
+ $params = array();
+ }
+
+ $stmt = sqlsrv_query($conn, $sql, $params);
+ if ($stmt === false) {
+ die(print_r(sqlsrv_errors(), true));
+ }
+
+ // Проверяем, есть ли данные
+ $has_rows = sqlsrv_has_rows($stmt);
+?>
+
+
+
+