prepare($query); $stmt->bind_param('i', $id); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { $relationshipData = $result->fetch_assoc(); $isEdit = true; // 检查权限:如果不是管理员,只能编辑自己创建的关系 $isAdmin = checkIfAdmin(); if (!$isAdmin && $relationshipData['employee_id'] != $_SESSION['employee_id']) { echo ""; exit; } } else { echo ""; exit; } } ?> <?= $isEdit ? '编辑' : '新增' ?>客户关系
源客户
prepare($sourceCustQuery); $stmt->bind_param('i', $relationshipData['source_customer_id']); $stmt->execute(); $result = $stmt->get_result(); if ($row = $result->fetch_assoc()) { $displayText = $row['cs_company']; if ($row['cs_code']) { $displayText = $row['cs_code'] . ' - ' . $displayText; } echo textDecode($displayText); } } ?>">prepare($sourceCustQuery); $stmt->bind_param('i', $relationshipData['source_customer_id']); $stmt->execute(); $result = $stmt->get_result(); if ($row = $result->fetch_assoc()) { $displayText = $row['cs_company']; if ($row['cs_code']) { $displayText = $row['cs_code'] . ' - ' . $displayText; } echo textDecode($displayText); } } ?>X
目标客户
prepare($targetCustQuery); $stmt->bind_param('i', $relationshipData['target_customer_id']); $stmt->execute(); $result = $stmt->get_result(); if ($row = $result->fetch_assoc()) { $displayText = $row['cs_company']; if ($row['cs_code']) { $displayText = $row['cs_code'] . ' - ' . $displayText; } echo textDecode($displayText); } } ?>">prepare($targetCustQuery); $stmt->bind_param('i', $relationshipData['target_customer_id']); $stmt->execute(); $result = $stmt->get_result(); if ($row = $result->fetch_assoc()) { $displayText = $row['cs_company']; if ($row['cs_code']) { $displayText = $row['cs_code'] . ' - ' . $displayText; } echo textDecode($displayText); } } ?>X
关系类型
关系状态
关系描述