From 26751d260d70a53187b8c564c0d35052bfb8ff7a Mon Sep 17 00:00:00 2001 From: mac Date: Mon, 22 Jun 2026 14:01:56 +0300 Subject: [PATCH] fix object events --- ajax/getLogForEvents.php | 102 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 4 deletions(-) diff --git a/ajax/getLogForEvents.php b/ajax/getLogForEvents.php index 03b5618..6c55050 100644 --- a/ajax/getLogForEvents.php +++ b/ajax/getLogForEvents.php @@ -984,9 +984,10 @@ if ($_SESSION['id'] && $_GET['object_id'] && is_numeric($_GET['object_id'])) { if ($event['type'] == 'deal') { $date = date("d.m.Y", strtotime($event['schedule_date'])); list($d, $m, $y) = explode(".", $date); + $deal_id_for_edit = !empty($event['deal_id']) ? intval($event['deal_id']) : null; ?>
-
+
">
-
+
+
@@ -1018,11 +1020,103 @@ if ($_SESSION['id'] && $_GET['object_id'] && is_numeric($_GET['object_id'])) {
+
Сделка
Запланирована сделка на в
- -
Сумма сделки: p
+ + +
+ +
Сумма в договоре: руб.
+ + +
Комиссия агента: руб.
+ +
+ Стороны сделки:
+ 0) { + $row_req1 = mysql_fetch_assoc($rez_req1); + $side1_text .= ': Заявка «' . htmlspecialchars($row_req1['name']) . '»'; + if (!empty($row_req1['client_id'])) { + $sql_cl1 = "SELECT id, fio FROM clients WHERE id = " . intval($row_req1['client_id']) . " LIMIT 1"; + $rez_cl1 = mysql_query($sql_cl1); + if ($rez_cl1 && mysql_num_rows($rez_cl1) > 0) { + $row_cl1 = mysql_fetch_assoc($rez_cl1); + $side1_text .= ' — ' . htmlspecialchars($row_cl1['fio']) . ''; + } + } + } + } + echo '' . $side1_text . '
'; + + $side2_text = htmlspecialchars($deal_data['side_two']); + if (!empty($deal_data['side_two_requisition_id'])) { + $sql_req2 = "SELECT name, client_id FROM requisitions WHERE id = " . intval($deal_data['side_two_requisition_id']) . " LIMIT 1"; + $rez_req2 = mysql_query($sql_req2); + if ($rez_req2 && mysql_num_rows($rez_req2) > 0) { + $row_req2 = mysql_fetch_assoc($rez_req2); + $side2_text .= ': Заявка «' . htmlspecialchars($row_req2['name']) . '»'; + if (!empty($row_req2['client_id'])) { + $sql_cl2 = "SELECT id, fio FROM clients WHERE id = " . intval($row_req2['client_id']) . " LIMIT 1"; + $rez_cl2 = mysql_query($sql_cl2); + if ($rez_cl2 && mysql_num_rows($rez_cl2) > 0) { + $row_cl2 = mysql_fetch_assoc($rez_cl2); + $side2_text .= ' — ' . htmlspecialchars($row_cl2['fio']) . ''; + } + } + } + } + echo '' . $side2_text . ''; + ?> +
+ 0) { + echo '
Объекты:
'; + while ($obj_row = mysql_fetch_assoc($rez_objs)) { + echo '' . htmlspecialchars($obj_row['nazv']) . ' (' . htmlspecialchars($obj_row['adres']) . ')
'; + } + echo '
'; + } + } + $sql_inner_docs = "SELECT d.id, d.name FROM inner_docs d JOIN deal_inner_doc did ON did.inner_doc_id = d.id WHERE did.deal_id = " . intval($deal_id_for_edit); + $rez_inner_docs = mysql_query($sql_inner_docs); + if ($rez_inner_docs && mysql_num_rows($rez_inner_docs) > 0) { + echo '
Документы:
'; + while ($doc_row = mysql_fetch_assoc($rez_inner_docs)) { + echo '' . htmlspecialchars($doc_row['name']) . '
'; + } + echo '
'; + } + ?> + +
+ + Подробнее + +
+ + + +
Сумма сделки: p
+
Комментарий: