123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <?php
- require_once 'conn.php';
- checkLogin();
- // 获取URL参数
- $tagName = $_GET['tagName'] ?? '';
- $employeeId = $_GET['employeeId'] ?? 0;
- if (empty($employeeId) || !is_numeric($employeeId)) {
- $employeeId = 0;
- }
- if (empty($tagName)) {
- header('Location: customers.php');
- exit;
- }
- ?>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>管理区域</title>
- <link rel="stylesheet" href="css/common.css" type="text/css" />
- <link rel="stylesheet" href="css/alert.css" type="text/css" />
- <script src="system/js/jquery-1.7.2.min.js"></script>
- <script src="js/js.js"></script>
- <style>
- body {
- margin: 0;
- padding: 20px;
- background: #fff;
- }
- #man_zone {
- margin-left: 0;
- }
- </style>
- </head>
- <body class="clear">
- <?php // require_once 'panel.php'; ?>
- <div id="man_zone">
- <div class="fastSelect clear">
- <h1>标签:<?= htmlspecialcharsFix($tagName) ?></h1>
- </div>
- <div width="100%" border="0" cellpadding="3" cellspacing="1" class="table2">
- <div class="theader">
- <div class="col2">序号</div>
- <div class="col3">客户编号</div>
- <div class="col4">渠道来源</div>
- <div class="col5">区域</div>
- <div class="col6">客户类型</div>
- <div class="col7">跟进阶段</div>
- <div class="col8">录入时间</div>
- <div class="col10">操作</div>
- </div>
- <?php
- // 组合查询SQL,使用LEFT JOIN获取联系人信息
- $sqlStr = "SELECT c.id, c.cs_code, c.cs_from, c.cs_country, c.cs_type, c.cs_deal, c.cs_addtime, c.cs_note,
- cc.id as contact_id, cc.contact_name,
- cc.tel_1, cc.tel_1_format, cc.tel_1_bu,
- cc.tel_2, cc.tel_2_format, cc.tel_2_bu,
- cc.tel_3, cc.tel_3_format, cc.tel_3_bu,
- cc.email_1, cc.email_1_bu,
- cc.email_2, cc.email_2_bu,
- cc.email_3, cc.email_3_bu,
- cc.whatsapp_1, cc.whatsapp_1_format, cc.whatsapp_1_bu,
- cc.whatsapp_2, cc.whatsapp_2_format, cc.whatsapp_2_bu,
- cc.whatsapp_3, cc.whatsapp_3_format, cc.whatsapp_3_bu,
- cc.wechat_1, cc.wechat_1_bu,
- cc.wechat_2, cc.wechat_2_bu,
- cc.wechat_3, cc.wechat_3_bu,
- cc.linkedin_1, cc.linkedin_1_bu,
- cc.linkedin_2, cc.linkedin_2_bu,
- cc.linkedin_3, cc.linkedin_3_bu,
- cc.facebook_1, cc.facebook_1_bu,
- cc.facebook_2, cc.facebook_2_bu,
- cc.facebook_3, cc.facebook_3_bu,
- cc.alibaba_1, cc.alibaba_1_bu,
- cc.alibaba_2, cc.alibaba_2_bu,
- cc.alibaba_3, cc.alibaba_3_bu
- FROM customer c
- LEFT JOIN customer_contact cc ON c.id = cc.customer_id
- WHERE c.cs_belong=" . (int)$employeeId . "
- AND c.id IN (SELECT customerId FROM tagtable WHERE tagName='" . $conn->real_escape_string($tagName) . "')";
- $result = $conn->query($sqlStr);
- $tempNum = 0;
- if ($result && $result->num_rows > 0) {
- while ($row = $result->fetch_assoc()) {
- $tempNum++;
- ?>
- <div class="tline">
- <div class="col2"><?= $tempNum ?></div>
- <div class="col3 slidepanel"><?= htmlspecialcharsFix($row['cs_code']) ?></div>
- <div class="col4">
- <?php
- $qudaoResult = $conn->query("SELECT ch_name FROM qudao WHERE id=" . (int)$row['cs_from']);
- echo ($qudaoRow = $qudaoResult->fetch_assoc()) ? htmlspecialcharsFix($qudaoRow['ch_name']) : '未填写';
- ?>
- </div>
- <div class="col5">
- <?php
- $countryResult = $conn->query("SELECT countryName FROM country WHERE id=" . (int)$row['cs_country']);
- echo ($countryRow = $countryResult->fetch_assoc()) ? htmlspecialcharsFix($countryRow['countryName']) : '未填写';
- ?>
- </div>
- <div class="col6">
- <?php
- $typeResult = $conn->query("SELECT businessType FROM clienttype WHERE id=" . (int)$row['cs_type']);
- echo ($typeRow = $typeResult->fetch_assoc()) ? htmlspecialcharsFix($typeRow['businessType']) : '未填写';
- ?>
- </div>
- <div class="col7">
- <?php
- if ($row['cs_deal'] == 3) {
- echo "<span style='color:red;'>成交</span>";
- } elseif ($row['cs_deal'] == 2) {
- echo "明确需求";
- } elseif ($row['cs_deal'] == 1) {
- echo "背景调查";
- } else {
- echo "无响应";
- }
- ?>
- </div>
- <div class="col8"><?= $row['cs_addtime'] ?></div>
- <div class="col10"><a href="customerEdit.php?id=<?= $row['id'] ?>" class="ico_edit ico">修改</a></div>
- </div>
- <div class="notepanel clear">
- <div class="noteItem">联系方式</div>
- <div class="lx">
- <div class="tel">
- <?php if(!empty($row['tel_1'])): ?>
- <div><?= htmlspecialcharsFix($row['tel_1']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['tel_2'])): ?>
- <div><?= htmlspecialcharsFix($row['tel_2']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['tel_3'])): ?>
- <div><?= htmlspecialcharsFix($row['tel_3']) ?></div>
- <?php endif; ?>
- </div>
- <div class="mail">
- <?php if(!empty($row['email_1'])): ?>
- <div><a href="mailto:<?= htmlspecialcharsFix($row['email_1']) ?>"><?= htmlspecialcharsFix($row['email_1']) ?></a></div>
- <?php endif; ?>
- <?php if(!empty($row['email_2'])): ?>
- <div><a href="mailto:<?= htmlspecialcharsFix($row['email_2']) ?>"><?= htmlspecialcharsFix($row['email_2']) ?></a></div>
- <?php endif; ?>
- <?php if(!empty($row['email_3'])): ?>
- <div><a href="mailto:<?= htmlspecialcharsFix($row['email_3']) ?>"><?= htmlspecialcharsFix($row['email_3']) ?></a></div>
- <?php endif; ?>
- </div>
- <div class="whatsapp">
- <?php if(!empty($row['whatsapp_1'])): ?>
- <div><?= htmlspecialcharsFix($row['whatsapp_1']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['whatsapp_2'])): ?>
- <div><?= htmlspecialcharsFix($row['whatsapp_2']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['whatsapp_3'])): ?>
- <div><?= htmlspecialcharsFix($row['whatsapp_3']) ?></div>
- <?php endif; ?>
- </div>
- <div class="wechat">
- <?php if(!empty($row['wechat_1'])): ?>
- <div><?= htmlspecialcharsFix($row['wechat_1']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['wechat_2'])): ?>
- <div><?= htmlspecialcharsFix($row['wechat_2']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['wechat_3'])): ?>
- <div><?= htmlspecialcharsFix($row['wechat_3']) ?></div>
- <?php endif; ?>
- </div>
- <div class="linkedin">
- <?php if(!empty($row['linkedin_1'])): ?>
- <div><?= htmlspecialcharsFix($row['linkedin_1']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['linkedin_2'])): ?>
- <div><?= htmlspecialcharsFix($row['linkedin_2']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['linkedin_3'])): ?>
- <div><?= htmlspecialcharsFix($row['linkedin_3']) ?></div>
- <?php endif; ?>
- </div>
- <div class="facebook">
- <?php if(!empty($row['facebook_1'])): ?>
- <div><?= htmlspecialcharsFix($row['facebook_1']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['facebook_2'])): ?>
- <div><?= htmlspecialcharsFix($row['facebook_2']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['facebook_3'])): ?>
- <div><?= htmlspecialcharsFix($row['facebook_3']) ?></div>
- <?php endif; ?>
- </div>
- <div class="alibaba">
- <?php if(!empty($row['alibaba_1'])): ?>
- <div><?= htmlspecialcharsFix($row['alibaba_1']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['alibaba_2'])): ?>
- <div><?= htmlspecialcharsFix($row['alibaba_2']) ?></div>
- <?php endif; ?>
- <?php if(!empty($row['alibaba_3'])): ?>
- <div><?= htmlspecialcharsFix($row['alibaba_3']) ?></div>
- <?php endif; ?>
- </div>
- </div>
- <div class="noteItem2">备注</div>
- <div class="notecontent"><?= htmlUnCode($row['cs_note']) ?></div>
- </div>
- <?php
- }
- }
- ?>
- </div>
- </div>
- </body>
- </html>
|