customers.php 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990
  1. <?php
  2. require_once 'conn.php';
  3. checkLogin();
  4. // 辅助函数
  5. $act = $_GET['act'] ?? '';
  6. $urlStr = '';
  7. // 处理保存操作
  8. if ($act == "save") {
  9. $isedit = false;
  10. $id = $_POST['id'] ?? '';
  11. if (!empty($id) && is_numeric($id)) {
  12. $isedit = true;
  13. }
  14. // 获取表单数据 - 客户基本信息
  15. $cs_code = textEncode($_POST['cs_code']);
  16. $cs_company = textEncode($_POST['cs_company']);
  17. $cs_belong = $_POST['cs_belong'];
  18. $cs_country = $_POST['cs_country'];
  19. $cs_from = $_POST['cs_from'];
  20. $cs_state = $_POST['cs_state'];
  21. $cs_deal = $_POST['cs_deal'];
  22. $cs_type = $_POST['cs_type'] ?? 5;
  23. $cs_belongclient = $_POST['cs_belongclient'] ?? 0;
  24. $no_content = htmlEncode($_POST['no_content']);
  25. $allowedit = isset($_POST['allowedit']) ? 1 : 0;
  26. $cs_address = textEncode($_POST['cs_address'] ?? '');
  27. $mytag = textEncode($_POST['mytag'] ?? '');
  28. $mytag = str_replace(['&#60;&#47;span&#62;&#60;span&#62;', '&#60;&#47;span&#62;', '&#60;span&#62;'], [',', '', ''], $mytag);
  29. $mytag = explode(',', $mytag);
  30. // 获取联系人信息
  31. $contacts = $_POST['contact'] ?? [];
  32. // 验证必填字段
  33. if (empty($cs_code)) {
  34. echo "<script>alert('客户编码不能为空');history.back();</script>";
  35. exit;
  36. }
  37. if ($cs_country == 0) {
  38. echo "<script>alert('这是哪个国家的客户?');history.back();</script>";
  39. exit;
  40. }
  41. if ($cs_from == "0") {
  42. echo "<script>alert('请填写客户来源!');history.back();</script>";
  43. exit;
  44. }
  45. // 自动检测来源
  46. if (strpos($cs_code, ';1688') !== false) {
  47. $cs_from = 1; // 1688
  48. }
  49. if (strpos($cs_code, ';阿里') !== false) {
  50. $cs_from = 2; // International station
  51. }
  52. if (strpos($cs_code, '官网') !== false) {
  53. $cs_from = 3; // Website
  54. }
  55. // 验证联系方式
  56. $primary_contact = !empty($contacts) ? current($contacts) : [];
  57. if ($allowedit != 1) {
  58. // 阿里巴巴验证
  59. if (($cs_from == 1 || $cs_from == 2) && empty($primary_contact['alibaba_1'])) {
  60. echo "<script>alert('阿里旺旺为必填项');history.back();</script>";
  61. exit;
  62. }
  63. // 官网来源验证
  64. if ($cs_from == 3) {
  65. $has_required = false;
  66. for ($i = 1; $i <= 3; $i++) {
  67. if (!empty($primary_contact['tel_' . $i]) ||
  68. !empty($primary_contact['whatsapp_' . $i]) ||
  69. !empty($primary_contact['wechat_' . $i])) {
  70. $has_required = true;
  71. break;
  72. }
  73. }
  74. if (!$has_required) {
  75. echo "<script>alert('电话和WhatsApp为必填项');history.back();</script>";
  76. exit;
  77. }
  78. }
  79. // 市场客户验证
  80. if ($cs_from == 8) {
  81. $has_wechat = false;
  82. for ($i = 1; $i <= 3; $i++) {
  83. if (!empty($primary_contact['wechat_' . $i])) {
  84. $has_wechat = true;
  85. break;
  86. }
  87. }
  88. if (!$has_wechat) {
  89. echo "<script>alert('微信为必填项');history.back();</script>";
  90. exit;
  91. }
  92. }
  93. // Facebook验证
  94. if ($cs_from == 12) {
  95. $has_facebook = false;
  96. for ($i = 1; $i <= 3; $i++) {
  97. if (!empty($primary_contact['facebook_' . $i])) {
  98. $has_facebook = true;
  99. break;
  100. }
  101. }
  102. if (!$has_facebook) {
  103. echo "<script>alert('Facebook为必填项');history.back();</script>";
  104. exit;
  105. }
  106. }
  107. }
  108. if ($isedit) {
  109. // 验证客户所有权
  110. $sql = "SELECT cs_chain FROM customer WHERE id = $id";
  111. $result = mysqli_query($conn, $sql);
  112. if ($row = mysqli_fetch_assoc($result)) {
  113. $cs_chain = $row['cs_chain'];
  114. $chain_array = explode(',', $cs_chain);
  115. $last_item = end($chain_array);
  116. if ($last_item != $cs_belong) {
  117. $cs_chain .= ",$cs_belong";
  118. }
  119. // 更新客户基本信息
  120. $sql = "UPDATE customer SET
  121. cs_code = '$cs_code',
  122. cs_company = '$cs_company',
  123. cs_belong = '$cs_belong',
  124. cs_country = '$cs_country',
  125. cs_address = '$cs_address',
  126. cs_from = '$cs_from',
  127. cs_state = '$cs_state',
  128. cs_deal = '$cs_deal',
  129. cs_type = '$cs_type',
  130. cs_belongclient = '$cs_belongclient',
  131. cs_note = '$no_content',
  132. allowedit = $allowedit,
  133. cs_chain = '$cs_chain',
  134. cs_updatetime = NOW()";
  135. // 处理cs_dealdate
  136. if ($cs_deal == 3) {
  137. $sql .= ", cs_dealdate = CASE WHEN cs_dealdate IS NULL THEN NOW() ELSE cs_dealdate END";
  138. }
  139. $sql .= " WHERE id = $id";
  140. mysqli_query($conn, $sql);
  141. // 处理联系人信息
  142. $existingContactIds = [];
  143. foreach ($contacts as $contact) {
  144. if (!empty($contact['id'])) {
  145. $existingContactIds[] = (int)$contact['id'];
  146. }
  147. }
  148. // 删除不再使用的联系人记录
  149. if (!empty($existingContactIds)) {
  150. $idsToKeep = implode(',', $existingContactIds);
  151. $deleteContactsSql = "DELETE FROM customer_contact WHERE customer_id = $id AND id NOT IN ($idsToKeep)";
  152. } else {
  153. $deleteContactsSql = "DELETE FROM customer_contact WHERE customer_id = $id";
  154. }
  155. mysqli_query($conn, $deleteContactsSql);
  156. // 更新或添加联系人信息
  157. foreach ($contacts as $contact) {
  158. $contact_id = !empty($contact['id']) ? (int)$contact['id'] : 0;
  159. $contact_name = textEncode($contact['contact_name'] ?? '');
  160. // 准备SQL字段和值
  161. $fields = ['contact_name'];
  162. $values = ["'" . mysqli_real_escape_string($conn, $contact_name) . "'"];
  163. $updates = ["contact_name = '" . mysqli_real_escape_string($conn, $contact_name) . "'"];
  164. // 处理所有联系方式类型
  165. $methodTypes = ['tel', 'email', 'whatsapp', 'wechat', 'linkedin', 'facebook', 'alibaba'];
  166. foreach ($methodTypes as $type) {
  167. for ($i = 1; $i <= 3; $i++) {
  168. $field = $type . '_' . $i;
  169. $format_field = $field . '_format';
  170. $bu_field = $field . '_bu';
  171. $value = textEncode($contact[$field] ?? '');
  172. $format_value = ($type == 'tel' || $type == 'whatsapp') ? numFormat($value) : '';
  173. $bu_value = textEncode($contact[$bu_field] ?? $value);
  174. // 添加字段名
  175. $fields[] = $field;
  176. $fields[] = $bu_field;
  177. if ($type == 'tel' || $type == 'whatsapp') {
  178. $fields[] = $format_field;
  179. }
  180. // 添加值
  181. $values[] = "'" . mysqli_real_escape_string($conn, $value) . "'";
  182. $values[] = "'" . mysqli_real_escape_string($conn, $bu_value) . "'";
  183. if ($type == 'tel' || $type == 'whatsapp') {
  184. $values[] = "'" . mysqli_real_escape_string($conn, $format_value) . "'";
  185. }
  186. // 添加更新语句
  187. $updates[] = $field . " = '" . mysqli_real_escape_string($conn, $value) . "'";
  188. $updates[] = $bu_field . " = '" . mysqli_real_escape_string($conn, $bu_value) . "'";
  189. if ($type == 'tel' || $type == 'whatsapp') {
  190. $updates[] = $format_field . " = '" . mysqli_real_escape_string($conn, $format_value) . "'";
  191. }
  192. }
  193. }
  194. if ($contact_id > 0) {
  195. // 更新已有联系人
  196. $updateContactSql = "UPDATE customer_contact SET " .
  197. implode(", ", $updates) . ", updated_at = NOW() " .
  198. "WHERE id = $contact_id AND customer_id = $id";
  199. mysqli_query($conn, $updateContactSql);
  200. } else {
  201. // 添加新联系人
  202. $insertContactSql = "INSERT INTO customer_contact (" .
  203. implode(", ", $fields) . ", customer_id, created_at, updated_at) VALUES (" .
  204. implode(", ", $values) . ", $id, NOW(), NOW())";
  205. mysqli_query($conn, $insertContactSql);
  206. }
  207. }
  208. // 更新标签
  209. mysqli_query($conn, "DELETE FROM tagtable WHERE customerId = $id");
  210. foreach ($mytag as $tag) {
  211. if (!empty(trim($tag))) {
  212. $tagSql = "INSERT INTO tagtable (tagName, employeeId, customerId) VALUES ('" .
  213. mysqli_real_escape_string($conn, $tag) . "', " .
  214. $_SESSION['employee_id'] . ", $id)";
  215. mysqli_query($conn, $tagSql);
  216. }
  217. }
  218. $page = $_GET['Page'] ?? '';
  219. $keys = urlencode($_GET['Keys'] ?? '');
  220. header("Location: ?keys=$keys&Page=$page$urlStr");
  221. exit;
  222. }
  223. } else {
  224. // 创建新记录
  225. // 插入客户基本信息
  226. $sql = "INSERT INTO customer (
  227. cs_code, cs_company, cs_country, cs_address, cs_from,
  228. cs_belong, cs_state, cs_deal, cs_type, cs_belongclient,
  229. cs_note, allowedit, cs_chain, cs_addtime, cs_updatetime,
  230. is_silent, cs_dealdate
  231. ) VALUES (
  232. '$cs_code', '$cs_company', '$cs_country', '$cs_address', '$cs_from',
  233. '$cs_belong', '$cs_state', '$cs_deal', '$cs_type', '$cs_belongclient',
  234. '$no_content', $allowedit, '$cs_belong', NOW(), NOW(),
  235. 0, " . ($cs_deal == 3 ? "NOW()" : "NULL") . "
  236. )";
  237. mysqli_query($conn, $sql);
  238. $new_customer_id = mysqli_insert_id($conn);
  239. // 插入联系人信息
  240. if ($new_customer_id > 0) {
  241. foreach ($contacts as $contact) {
  242. $contact_name = textEncode($contact['contact_name'] ?? '');
  243. // 准备SQL字段和值
  244. $fields = ['contact_name'];
  245. $values = ["'" . mysqli_real_escape_string($conn, $contact_name) . "'"];
  246. // 处理所有联系方式类型
  247. $methodTypes = ['tel', 'email', 'whatsapp', 'wechat', 'linkedin', 'facebook', 'alibaba'];
  248. foreach ($methodTypes as $type) {
  249. for ($i = 1; $i <= 3; $i++) {
  250. $field = $type . '_' . $i;
  251. $format_field = $field . '_format';
  252. $bu_field = $field . '_bu';
  253. $value = textEncode($contact[$field] ?? '');
  254. $format_value = ($type == 'tel' || $type == 'whatsapp') ? numFormat($value) : '';
  255. $bu_value = textEncode($contact[$bu_field] ?? $value);
  256. // 添加字段名
  257. $fields[] = $field;
  258. $fields[] = $bu_field;
  259. if ($type == 'tel' || $type == 'whatsapp') {
  260. $fields[] = $format_field;
  261. }
  262. // 添加值
  263. $values[] = "'" . mysqli_real_escape_string($conn, $value) . "'";
  264. $values[] = "'" . mysqli_real_escape_string($conn, $bu_value) . "'";
  265. if ($type == 'tel' || $type == 'whatsapp') {
  266. $values[] = "'" . mysqli_real_escape_string($conn, $format_value) . "'";
  267. }
  268. }
  269. }
  270. // 添加新联系人
  271. $insertContactSql = "INSERT INTO customer_contact (" .
  272. implode(", ", $fields) . ", customer_id, created_at, updated_at) VALUES (" .
  273. implode(", ", $values) . ", $new_customer_id, NOW(), NOW())";
  274. mysqli_query($conn, $insertContactSql);
  275. }
  276. // 保存标签
  277. foreach ($mytag as $tag) {
  278. if (!empty(trim($tag))) {
  279. $tagSql = "INSERT INTO tagtable (tagName, employeeId, customerId) VALUES ('" .
  280. mysqli_real_escape_string($conn, $tag) . "', " .
  281. $_SESSION['employee_id'] . ", $new_customer_id)";
  282. mysqli_query($conn, $tagSql);
  283. }
  284. }
  285. $page = $_GET['Page'] ?? '';
  286. $keys = urlencode($_GET['Keys'] ?? '');
  287. header("Location: ?keys=$keys&Page=$page$urlStr");
  288. exit;
  289. }
  290. }
  291. }
  292. // 处理编辑操作
  293. if ($act == "edit") {
  294. $id = $_GET['id'] ?? '';
  295. $isedit = false;
  296. if (!empty($id) && is_numeric($id)) {
  297. $isedit = true;
  298. }
  299. if ($isedit) {
  300. // 联合查询客户基本信息和联系人信息
  301. $sql = "SELECT c.*,
  302. cc.id as contact_id, cc.contact_name,
  303. cc.tel_1, cc.tel_1_format, cc.tel_1_bu,
  304. cc.tel_2, cc.tel_2_format, cc.tel_2_bu,
  305. cc.tel_3, cc.tel_3_format, cc.tel_3_bu,
  306. cc.email_1, cc.email_1_bu,
  307. cc.email_2, cc.email_2_bu,
  308. cc.email_3, cc.email_3_bu,
  309. cc.whatsapp_1, cc.whatsapp_1_format, cc.whatsapp_1_bu,
  310. cc.whatsapp_2, cc.whatsapp_2_format, cc.whatsapp_2_bu,
  311. cc.whatsapp_3, cc.whatsapp_3_format, cc.whatsapp_3_bu,
  312. cc.wechat_1, cc.wechat_1_bu,
  313. cc.wechat_2, cc.wechat_2_bu,
  314. cc.wechat_3, cc.wechat_3_bu,
  315. cc.linkedin_1, cc.linkedin_1_bu,
  316. cc.linkedin_2, cc.linkedin_2_bu,
  317. cc.linkedin_3, cc.linkedin_3_bu,
  318. cc.facebook_1, cc.facebook_1_bu,
  319. cc.facebook_2, cc.facebook_2_bu,
  320. cc.facebook_3, cc.facebook_3_bu,
  321. cc.alibaba_1, cc.alibaba_1_bu,
  322. cc.alibaba_2, cc.alibaba_2_bu,
  323. cc.alibaba_3, cc.alibaba_3_bu
  324. FROM customer c
  325. LEFT JOIN customer_contact cc ON c.id = cc.customer_id
  326. WHERE c.id = $id";
  327. $result = mysqli_query($conn, $sql);
  328. if ($row = mysqli_fetch_assoc($result)) {
  329. $cs_code = textDecode($row['cs_code']);
  330. $cs_company = textDecode($row['cs_company']);
  331. $cs_name = textDecode($row['contact_name']);
  332. $cs_country = $row['cs_country'];
  333. $cs_from = $row['cs_from'];
  334. $cs_tel = textDecode($row['tel_1']);
  335. $cs_telBu = textDecode($row['tel_1_bu']);
  336. $cs_email = textDecode($row['email_1']);
  337. $cs_emailBu = textDecode($row['email_1_bu']);
  338. $cs_whatsapp = textDecode($row['whatsapp_1']);
  339. $cs_whatsappBu = textDecode($row['whatsapp_1_bu']);
  340. $cs_wechat = textDecode($row['wechat_1']);
  341. $cs_wechatBu = textDecode($row['wechat_1_bu']);
  342. $cs_linkedin = textDecode($row['linkedin_1']);
  343. $cs_linkedinBu = textDecode($row['linkedin_1_bu']);
  344. $cs_facebook = textDecode($row['facebook_1']);
  345. $cs_facebookBu = textDecode($row['facebook_1_bu']);
  346. $cs_alibaba = textDecode($row['alibaba_1']);
  347. $cs_alibabaBu = textDecode($row['alibaba_1_bu']);
  348. $cs_address = textDecode($row['cs_address']);
  349. $cs_addtime = $row['cs_addtime'];
  350. $cs_updatetime = $row['cs_updatetime'];
  351. $cs_belong = $row['cs_belong'];
  352. $cs_state = $row['cs_state'];
  353. $cs_deal = $row['cs_deal'];
  354. $cs_note = htmlDecode($row['cs_note']);
  355. $allowedit = $row['allowedit'];
  356. }
  357. }
  358. }
  359. // 处理批量操作
  360. if ($act == "postchk") {
  361. if (isset($_POST['chkbox']) && isset($_POST['chkact'])) {
  362. $chkact = $_POST['chkact'];
  363. $ids = implode(',', array_map('intval', $_POST['chkbox']));
  364. switch($chkact) {
  365. case "0":
  366. case "1":
  367. $sql = "UPDATE customer SET cs_state = $chkact WHERE id IN ($ids)";
  368. break;
  369. case "-1":
  370. // 删除客户记录和联系人记录(依靠外键级联删除)
  371. $sql = "DELETE FROM customer WHERE id IN ($ids)";
  372. break;
  373. }
  374. if (isset($sql)) {
  375. mysqli_query($conn, $sql);
  376. }
  377. $keys = urlencode($_GET['Keys'] ?? '');
  378. $page = $_GET['Page'] ?? '';
  379. header("Location: ?keys=$keys&Page=$page$urlStr");
  380. exit;
  381. }
  382. }
  383. // 处理筛选条件
  384. $fliterQudao = $_GET['fliterQudao'] ?? '';
  385. $fliterDeal = $_GET['fliterDeal'] ?? '';
  386. $fliterTeam = $_GET['fliterTeam'] ?? '';
  387. $fliterContact = $_GET['fliterContact'] ?? '';
  388. $fliterEmployee = $_GET['fliterEmployee'] ?? '';
  389. $fliterStr = "";
  390. if (!empty($fliterQudao)) {
  391. $fliterStr .= " AND c.cs_from = " . intval($fliterQudao);
  392. $urlStr .= "&fliterQudao=" . $fliterQudao;
  393. }
  394. if (!empty($fliterDeal)) {
  395. $fliterStr .= " AND c.cs_deal = " . intval($fliterDeal);
  396. $urlStr .= "&fliterDeal=" . $fliterDeal;
  397. }
  398. if (!empty($fliterTeam)) {
  399. $fliterStr .= " AND (c.cs_belong = " . intval($fliterTeam) .
  400. " OR c.cs_belong IN (SELECT id FROM employee WHERE em_role = " . intval($fliterTeam) . "))";
  401. $urlStr .= "&fliterTeam=" . $fliterTeam;
  402. }
  403. if (!empty($fliterEmployee)) {
  404. $fliterStr .= " AND c.cs_belong = " . intval($fliterEmployee);
  405. $urlStr .= "&fliterEmployee=" . $fliterEmployee;
  406. }
  407. if (!empty($fliterContact)) {
  408. switch ($fliterContact) {
  409. case "1": $fliterStr .= " AND (cc.tel_1 != '' OR cc.tel_2 != '' OR cc.tel_3 != '')"; break;
  410. case "2": $fliterStr .= " AND (cc.wechat_1 != '' OR cc.wechat_2 != '' OR cc.wechat_3 != '')"; break;
  411. case "3": $fliterStr .= " AND (cc.whatsapp_1 != '' OR cc.whatsapp_2 != '' OR cc.whatsapp_3 != '')"; break;
  412. case "4": $fliterStr .= " AND (cc.email_1 != '' OR cc.email_2 != '' OR cc.email_3 != '')"; break;
  413. case "5": $fliterStr .= " AND (cc.linkedin_1 != '' OR cc.linkedin_2 != '' OR cc.linkedin_3 != '')"; break;
  414. case "6": $fliterStr .= " AND (cc.facebook_1 != '' OR cc.facebook_2 != '' OR cc.facebook_3 != '')"; break;
  415. case "7": $fliterStr .= " AND (cc.alibaba_1 != '' OR cc.alibaba_2 != '' OR cc.alibaba_3 != '')"; break;
  416. }
  417. $urlStr .= "&fliterContact=" . $fliterContact;
  418. }
  419. // 搜索和排序
  420. $keys = $_GET['Keys'] ?? '';
  421. $keyscode = textEncode($keys);
  422. $page = $_GET['Page'] ?? 1;
  423. $ord = $_GET['Ord'] ?? '';
  424. $ordStr = !empty($ord) ? "$ord," : "";
  425. // 构建查询SQL - 修改为联合查询
  426. $sqlStr = "SELECT c.id, c.cs_code, c.cs_company, c.cs_country, c.cs_address, c.cs_from,
  427. c.cs_deal, c.cs_addtime, c.cs_updatetime, c.cs_belong, c.cs_note, c.cs_claimFrom,
  428. c.cs_chain, c.cs_dealdate, c.cs_type, c.cs_belongclient, c.allowedit,
  429. cc.id as contact_id, cc.contact_name,
  430. cc.tel_1, cc.tel_1_format, cc.tel_1_bu,
  431. cc.tel_2, cc.tel_2_format, cc.tel_2_bu,
  432. cc.tel_3, cc.tel_3_format, cc.tel_3_bu,
  433. cc.email_1, cc.email_1_bu,
  434. cc.email_2, cc.email_2_bu,
  435. cc.email_3, cc.email_3_bu,
  436. cc.whatsapp_1, cc.whatsapp_1_format, cc.whatsapp_1_bu,
  437. cc.whatsapp_2, cc.whatsapp_2_format, cc.whatsapp_2_bu,
  438. cc.whatsapp_3, cc.whatsapp_3_format, cc.whatsapp_3_bu,
  439. cc.wechat_1, cc.wechat_1_bu,
  440. cc.wechat_2, cc.wechat_2_bu,
  441. cc.wechat_3, cc.wechat_3_bu,
  442. cc.linkedin_1, cc.linkedin_1_bu,
  443. cc.linkedin_2, cc.linkedin_2_bu,
  444. cc.linkedin_3, cc.linkedin_3_bu,
  445. cc.facebook_1, cc.facebook_1_bu,
  446. cc.facebook_2, cc.facebook_2_bu,
  447. cc.facebook_3, cc.facebook_3_bu,
  448. cc.alibaba_1, cc.alibaba_1_bu,
  449. cc.alibaba_2, cc.alibaba_2_bu,
  450. cc.alibaba_3, cc.alibaba_3_bu
  451. FROM customer c
  452. LEFT JOIN customer_contact cc ON c.id = cc.customer_id
  453. WHERE 1=1";
  454. if (!empty($keyscode)) {
  455. $sqlStr .= " AND (c.cs_code LIKE '%$keyscode%'
  456. OR cc.contact_name LIKE '%$keyscode%'
  457. OR cc.tel_1 LIKE '%$keyscode%'
  458. OR cc.tel_2 LIKE '%$keyscode%'
  459. OR cc.tel_3 LIKE '%$keyscode%'
  460. OR cc.email_1 LIKE '%$keyscode%'
  461. OR cc.email_2 LIKE '%$keyscode%'
  462. OR cc.email_3 LIKE '%$keyscode%'
  463. OR cc.wechat_1 LIKE '%$keyscode%'
  464. OR cc.wechat_2 LIKE '%$keyscode%'
  465. OR cc.wechat_3 LIKE '%$keyscode%'
  466. OR cc.whatsapp_1_format LIKE '%$keyscode%'
  467. OR cc.whatsapp_2_format LIKE '%$keyscode%'
  468. OR cc.whatsapp_3_format LIKE '%$keyscode%'
  469. OR cc.linkedin_1 LIKE '%$keyscode%'
  470. OR cc.linkedin_2 LIKE '%$keyscode%'
  471. OR cc.linkedin_3 LIKE '%$keyscode%'
  472. OR cc.facebook_1 LIKE '%$keyscode%'
  473. OR cc.facebook_2 LIKE '%$keyscode%'
  474. OR cc.facebook_3 LIKE '%$keyscode%'
  475. OR cc.alibaba_1 LIKE '%$keyscode%'
  476. OR cc.alibaba_2 LIKE '%$keyscode%'
  477. OR cc.alibaba_3 LIKE '%$keyscode%')";
  478. }
  479. $sqlStr .= " $fliterStr ORDER BY {$ordStr}c.cs_updatetime DESC";
  480. ?>
  481. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  482. <html xmlns="http://www.w3.org/1999/xhtml">
  483. <head>
  484. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  485. <title>客户列表</title>
  486. <link rel="stylesheet" href="css/common.css" type="text/css" />
  487. <link rel="stylesheet" href="css/alert.css" type="text/css" />
  488. <script src="js/jquery-1.7.2.min.js"></script>
  489. <script src="js/js.js"></script>
  490. <style>
  491. body {
  492. margin: 0;
  493. padding: 20px;
  494. background: #fff;
  495. }
  496. #man_zone {
  497. margin-left: 0;
  498. }
  499. </style>
  500. </head>
  501. <body>
  502. <div id="man_zone">
  503. <?php
  504. $keys = $_GET['Keys'] ?? '';
  505. $keys = str_replace([" ", "+"], "", $keys);
  506. $keyscode = textEncode($keys);
  507. $page = $_GET['Page'] ?? 1;
  508. $filters = [
  509. 'Country' => $_GET['fliterCountry'] ?? '',
  510. 'Qudao' => $_GET['fliterQudao'] ?? '',
  511. 'Deal' => $_GET['fliterDeal'] ?? '',
  512. 'Business' => $_GET['fliterBusiness'] ?? '',
  513. 'Contact' => $_GET['fliterContact'] ?? ''
  514. ];
  515. $filterStr = "";
  516. $urlStr = "";
  517. // Build filter conditions
  518. if (!empty($filters['Country'])) {
  519. $filterStr .= " AND c.cs_country=" . (int)$filters['Country'];
  520. $urlStr .= "&fliterCountry=" . $filters['Country'];
  521. }
  522. if (!empty($filters['Qudao'])) {
  523. $filterStr .= " AND c.cs_from=" . (int)$filters['Qudao'];
  524. $urlStr .= "&fliterQudao=" . $filters['Qudao'];
  525. }
  526. if (!empty($filters['Deal'])) {
  527. $filterStr .= " AND c.cs_deal=" . (int)$filters['Deal'];
  528. $urlStr .= "&fliterDeal=" . $filters['Deal'];
  529. }
  530. if (!empty($filters['Business'])) {
  531. $filterStr .= " AND c.cs_type=" . (int)$filters['Business'];
  532. $urlStr .= "&fliterBusiness=" . $filters['Business'];
  533. }
  534. if (!empty($filters['Contact'])) {
  535. switch ($filters['Contact']) {
  536. case "1": $filterStr .= " AND (cc.tel_1 != '' OR cc.tel_2 != '' OR cc.tel_3 != '')"; break;
  537. case "2": $filterStr .= " AND (cc.wechat_1 != '' OR cc.wechat_2 != '' OR cc.wechat_3 != '')"; break;
  538. case "3": $filterStr .= " AND (cc.whatsapp_1 != '' OR cc.whatsapp_2 != '' OR cc.whatsapp_3 != '')"; break;
  539. case "4": $filterStr .= " AND (cc.email_1 != '' OR cc.email_2 != '' OR cc.email_3 != '')"; break;
  540. case "5": $filterStr .= " AND (cc.linkedin_1 != '' OR cc.linkedin_2 != '' OR cc.linkedin_3 != '')"; break;
  541. case "6": $filterStr .= " AND (cc.facebook_1 != '' OR cc.facebook_2 != '' OR cc.facebook_3 != '')"; break;
  542. case "7": $filterStr .= " AND (cc.alibaba_1 != '' OR cc.alibaba_2 != '' OR cc.alibaba_3 != '')"; break;
  543. }
  544. $urlStr .= "&fliterContact=" . $filters['Contact'];
  545. }
  546. $keys = urlencode($keys);
  547. $hrefstr = "?keys=" . $keys;
  548. ?>
  549. <form id="form1" method="post" action="?act=postchk&Keys=<?= $keys ?>&Page=<?= $page ?>" onSubmit="return false">
  550. <div class="fastSelect clear">
  551. <H1>搜索条件</H1>
  552. <div class="selectItem">
  553. <label>区域</label>
  554. <select name="fliterCountry" class="filterSearch">
  555. <option value="">请选择国家地区</option>
  556. <?php
  557. $result = $conn->query("SELECT id, countryName FROM country");
  558. while ($row = $result->fetch_assoc()) {
  559. $selected = ($filters['Country'] == $row['id']) ? ' selected' : '';
  560. echo "<option value=\"{$row['id']}\"$selected>{$row['countryName']}</option>";
  561. }
  562. ?>
  563. </select>
  564. </div>
  565. <div class="selectItem">
  566. <label>来源渠道</label>
  567. <select name="fliterQudao" class="filterSearch">
  568. <option value="">请选择渠道</option>
  569. <?php
  570. $result = $conn->query("SELECT id, ch_name FROM qudao");
  571. while ($row = $result->fetch_assoc()) {
  572. $selected = ($filters['Qudao'] == $row['id']) ? ' selected' : '';
  573. echo "<option value=\"{$row['id']}\"$selected>{$row['ch_name']}</option>";
  574. }
  575. ?>
  576. </select>
  577. </div>
  578. <div class="selectItem">
  579. <label>跟进阶段</label>
  580. <select name="fliterDeal" class="filterSearch">
  581. <option value="">请选择</option>
  582. <option value="1"<?= ($filters['Deal'] == "1") ? ' selected' : '' ?>>背景调查</option>
  583. <option value="2"<?= ($filters['Deal'] == "2") ? ' selected' : '' ?>>明确需求</option>
  584. <option value="3"<?= ($filters['Deal'] == "3") ? ' selected' : '' ?>>已成交</option>
  585. </select>
  586. </div>
  587. <div class="selectItem">
  588. <label>客户类型</label>
  589. <select name="fliterBusiness" class="filterSearch">
  590. <option value="">请选择</option>
  591. <?php
  592. $result = $conn->query("SELECT id, businessType FROM clienttype");
  593. while ($row = $result->fetch_assoc()) {
  594. $selected = ($filters['Business'] == $row['id']) ? ' selected' : '';
  595. echo "<option value=\"{$row['id']}\"$selected>{$row['businessType']}</option>";
  596. }
  597. ?>
  598. </select>
  599. </div>
  600. <div class="selectItem">
  601. <label>联系方式</label>
  602. <select name="fliterContact" class="filterSearch">
  603. <option value="">请选择</option>
  604. <option value="1"<?= ($filters['Contact'] == "1") ? ' selected' : '' ?>>电话</option>
  605. <option value="2"<?= ($filters['Contact'] == "2") ? ' selected' : '' ?>>微信</option>
  606. <option value="3"<?= ($filters['Contact'] == "3") ? ' selected' : '' ?>>WhatsApp</option>
  607. <option value="4"<?= ($filters['Contact'] == "4") ? ' selected' : '' ?>>邮箱</option>
  608. <option value="5"<?= ($filters['Contact'] == "5") ? ' selected' : '' ?>>领英</option>
  609. <option value="6"<?= ($filters['Contact'] == "6") ? ' selected' : '' ?>>Facebook</option>
  610. <option value="7"<?= ($filters['Contact'] == "7") ? ' selected' : '' ?>>阿里巴巴</option>
  611. </select>
  612. </div>
  613. <div class="inputSearch">
  614. <input type="text" id="keys" class="inputTxt"
  615. value="<?= empty($keyscode) ? '请输入搜索关键词' : $keyscode ?>"
  616. onFocus="if(this.value == '<?= empty($keyscode) ? '请输入搜索关键词' : $keyscode ?>'){this.value='';}"
  617. onBlur="if(this.value == ''){this.value='<?= empty($keyscode) ? '请输入搜索关键词' : $keyscode ?>';}"
  618. onKeyDown="if(event.keyCode==13){location.href='?Keys='+encodeURIComponent(document.getElementById('keys').value)}" />
  619. <input type="button" id="searchgo" class="searchgo" value="go"
  620. onClick="location.href='?Keys='+encodeURIComponent(document.getElementById('keys').value)" />
  621. </div>
  622. </div>
  623. <div class="table2 em<?= $_SESSION['employee_id'] ?>">
  624. <div class="theader">
  625. <div class="col1"><input type="checkbox" name="chkall" id="chkall" onClick="chkboxall(this,'chkbox')" /></div>
  626. <div class="col2">序号</div>
  627. <div class="col3">客户编号</div>
  628. <div class="col4">渠道来源</div>
  629. <div class="col5">区域</div>
  630. <div class="col6">客户类型</div>
  631. <div class="col6">跟进阶段</div>
  632. <div class="colmark">颜色标记</div>
  633. <div class="col6">录入时间</div>
  634. <div class="col9">操作</div>
  635. </div>
  636. <?php
  637. $sql = "SELECT c.id, c.cs_code, c.cs_company, c.cs_country, c.cs_address, c.cs_from,
  638. c.cs_deal, c.cs_addtime, c.cs_updatetime, c.cs_belong, c.cs_note, c.cs_claimFrom,
  639. c.cs_chain, c.cs_dealdate, c.cs_type, c.cs_belongclient, c.allowedit,c.colortag,
  640. cc.id as contact_id, cc.contact_name,
  641. cc.tel_1, cc.tel_1_format, cc.tel_1_bu,
  642. cc.tel_2, cc.tel_2_format, cc.tel_2_bu,
  643. cc.tel_3, cc.tel_3_format, cc.tel_3_bu,
  644. cc.email_1, cc.email_1_bu,
  645. cc.email_2, cc.email_2_bu,
  646. cc.email_3, cc.email_3_bu,
  647. cc.whatsapp_1, cc.whatsapp_1_format, cc.whatsapp_1_bu,
  648. cc.whatsapp_2, cc.whatsapp_2_format, cc.whatsapp_2_bu,
  649. cc.whatsapp_3, cc.whatsapp_3_format, cc.whatsapp_3_bu,
  650. cc.wechat_1, cc.wechat_1_bu,
  651. cc.wechat_2, cc.wechat_2_bu,
  652. cc.wechat_3, cc.wechat_3_bu,
  653. cc.linkedin_1, cc.linkedin_1_bu,
  654. cc.linkedin_2, cc.linkedin_2_bu,
  655. cc.linkedin_3, cc.linkedin_3_bu,
  656. cc.facebook_1, cc.facebook_1_bu,
  657. cc.facebook_2, cc.facebook_2_bu,
  658. cc.facebook_3, cc.facebook_3_bu,
  659. cc.alibaba_1, cc.alibaba_1_bu,
  660. cc.alibaba_2, cc.alibaba_2_bu,
  661. cc.alibaba_3, cc.alibaba_3_bu
  662. FROM customer c
  663. LEFT JOIN customer_contact cc ON c.id = cc.customer_id
  664. WHERE c.is_silent=0 AND c.cs_deal>0 AND c.cs_belong=" . (int)$_SESSION['employee_id'];
  665. $searchPattern = mysqli_real_escape_string($conn, $keyscode);
  666. if(!empty($searchPattern)) {
  667. $sql .= " AND (c.cs_code LIKE '%$searchPattern%'
  668. OR cc.contact_name LIKE '%$searchPattern%'
  669. OR cc.tel_1 LIKE '%$searchPattern%'
  670. OR cc.tel_2 LIKE '%$searchPattern%'
  671. OR cc.tel_3 LIKE '%$searchPattern%'
  672. OR cc.email_1 LIKE '%$searchPattern%'
  673. OR cc.email_2 LIKE '%$searchPattern%'
  674. OR cc.email_3 LIKE '%$searchPattern%'
  675. OR cc.wechat_1 LIKE '%$searchPattern%'
  676. OR cc.wechat_2 LIKE '%$searchPattern%'
  677. OR cc.wechat_3 LIKE '%$searchPattern%'
  678. OR cc.whatsapp_1_format LIKE '%$searchPattern%'
  679. OR cc.whatsapp_2_format LIKE '%$searchPattern%'
  680. OR cc.whatsapp_3_format LIKE '%$searchPattern%'
  681. OR cc.linkedin_1 LIKE '%$searchPattern%'
  682. OR cc.linkedin_2 LIKE '%$searchPattern%'
  683. OR cc.linkedin_3 LIKE '%$searchPattern%'
  684. OR cc.facebook_1 LIKE '%$searchPattern%'
  685. OR cc.facebook_2 LIKE '%$searchPattern%'
  686. OR cc.facebook_3 LIKE '%$searchPattern%'
  687. OR cc.alibaba_1 LIKE '%$searchPattern%'
  688. OR cc.alibaba_2 LIKE '%$searchPattern%'
  689. OR cc.alibaba_3 LIKE '%$searchPattern%')";
  690. }
  691. $sql .= " $filterStr ORDER BY c.colortag DESC, c.id DESC";
  692. $result = mysqli_query($conn, $sql);
  693. // Pagination logic
  694. $perPage = 20;
  695. $totalRecords = mysqli_num_rows($result);
  696. $totalPages = max(1, ceil($totalRecords / $perPage));
  697. $page = max(1, min((int)$page, $totalPages));
  698. $offset = max(0, ($page - 1) * $perPage);
  699. // Add pagination to query
  700. $sql .= " LIMIT $offset, $perPage";
  701. $result = mysqli_query($conn, $sql);
  702. if (mysqli_num_rows($result) > 0) {
  703. $tempNum = $offset;
  704. while ($row = mysqli_fetch_assoc($result)) {
  705. $tempNum++;
  706. ?>
  707. <div class="tline color<?= $row['colortag'] ?>">
  708. <div class="col1" align="center"><input type="checkbox" name="chkbox" value="<?= $row['id'] ?>" /></div>
  709. <div class="col2"><?= $tempNum ?></div>
  710. <div class="col3 slidepanel"><?= $row['cs_code'] ?>
  711. <?php if ($row['cs_claimFrom'] > 0): ?>
  712. <img src="../images/yijiao.png" class="handover" title="来自认领">
  713. <?php endif; ?>
  714. </div>
  715. <div class="col4">
  716. <?php
  717. $qudao = $conn->query("SELECT ch_name FROM qudao WHERE id=" . (int)$row['cs_from']);
  718. echo $qudao->num_rows > 0 ? $qudao->fetch_assoc()['ch_name'] : '未填写';
  719. ?>
  720. </div>
  721. <div class="col5">
  722. <?php
  723. $country = $conn->query("SELECT countryName FROM country WHERE id=" . (int)$row['cs_country']);
  724. echo $country->num_rows > 0 ? $country->fetch_assoc()['countryName'] : '未填写';
  725. ?>
  726. </div>
  727. <div class="col6">
  728. <?php
  729. $clientType = $conn->query("SELECT businessType FROM clienttype WHERE id=" . (int)$row['cs_type']);
  730. echo $clientType->num_rows > 0 ? $clientType->fetch_assoc()['businessType'] : '未填写';
  731. ?>
  732. </div>
  733. <div class="col6">
  734. <?php
  735. switch ($row['cs_deal']) {
  736. case 3: echo '<span style="color:red;">成交</span>'; break;
  737. case 2: echo '明确需求'; break;
  738. case 1: echo '背景调查'; break;
  739. default: echo '无响应';
  740. }
  741. ?>
  742. </div>
  743. <div class="colmark colormark">
  744. <ul class="colorlist" data-id="<?= $row['id'] ?>">
  745. <li value="1" class="color1"></li>
  746. <li value="2" class="color2"></li>
  747. <li value="3" class="color3"></li>
  748. <li value="4" class="color4"></li>
  749. <li value="0" class="color0"></li>
  750. </ul>
  751. </div>
  752. <div class="col6"><?= $row['cs_addtime'] ?></div>
  753. <div class="col9">
  754. <a href="customerEdit.php?Keys=<?= $keys ?>&fliterDeal=<?= $filters['Deal'] ?>&fliterBusiness=<?= $filters['Business'] ?>&Page=<?= $page ?>&act=edit&id=<?= $row['id'] ?>" class="ico_edit ico">修改</a>
  755. <a href="order_add.php?customer_id=<?= $row['id'] ?>" class="ico_add ico">添加订单</a>
  756. </div>
  757. </div>
  758. <div class="notepanel clear">
  759. <div class="noteItem">联系方式</div>
  760. <div class="lx">
  761. <div class="tel">
  762. <?php if(!empty($row['tel_1'])): ?>
  763. <div><?= $row['tel_1'] ?></div>
  764. <?php endif; ?>
  765. <?php if(!empty($row['tel_2'])): ?>
  766. <div><?= $row['tel_2'] ?></div>
  767. <?php endif; ?>
  768. <?php if(!empty($row['tel_3'])): ?>
  769. <div><?= $row['tel_3'] ?></div>
  770. <?php endif; ?>
  771. </div>
  772. <div class="mail">
  773. <?php if(!empty($row['email_1'])): ?>
  774. <div><a href="mailto:<?= $row['email_1'] ?>"><?= $row['email_1'] ?></a></div>
  775. <?php endif; ?>
  776. <?php if(!empty($row['email_2'])): ?>
  777. <div><a href="mailto:<?= $row['email_2'] ?>"><?= $row['email_2'] ?></a></div>
  778. <?php endif; ?>
  779. <?php if(!empty($row['email_3'])): ?>
  780. <div><a href="mailto:<?= $row['email_3'] ?>"><?= $row['email_3'] ?></a></div>
  781. <?php endif; ?>
  782. </div>
  783. <div class="whatsapp">
  784. <?php if(!empty($row['whatsapp_1'])): ?>
  785. <div><?= $row['whatsapp_1'] ?></div>
  786. <?php endif; ?>
  787. <?php if(!empty($row['whatsapp_2'])): ?>
  788. <div><?= $row['whatsapp_2'] ?></div>
  789. <?php endif; ?>
  790. <?php if(!empty($row['whatsapp_3'])): ?>
  791. <div><?= $row['whatsapp_3'] ?></div>
  792. <?php endif; ?>
  793. </div>
  794. <div class="wechat">
  795. <?php if(!empty($row['wechat_1'])): ?>
  796. <div><?= $row['wechat_1'] ?></div>
  797. <?php endif; ?>
  798. <?php if(!empty($row['wechat_2'])): ?>
  799. <div><?= $row['wechat_2'] ?></div>
  800. <?php endif; ?>
  801. <?php if(!empty($row['wechat_3'])): ?>
  802. <div><?= $row['wechat_3'] ?></div>
  803. <?php endif; ?>
  804. </div>
  805. <div class="linkedin">
  806. <?php if(!empty($row['linkedin_1'])): ?>
  807. <div><?= $row['linkedin_1'] ?></div>
  808. <?php endif; ?>
  809. <?php if(!empty($row['linkedin_2'])): ?>
  810. <div><?= $row['linkedin_2'] ?></div>
  811. <?php endif; ?>
  812. <?php if(!empty($row['linkedin_3'])): ?>
  813. <div><?= $row['linkedin_3'] ?></div>
  814. <?php endif; ?>
  815. </div>
  816. <div class="facebook">
  817. <?php if(!empty($row['facebook_1'])): ?>
  818. <div><?= $row['facebook_1'] ?></div>
  819. <?php endif; ?>
  820. <?php if(!empty($row['facebook_2'])): ?>
  821. <div><?= $row['facebook_2'] ?></div>
  822. <?php endif; ?>
  823. <?php if(!empty($row['facebook_3'])): ?>
  824. <div><?= $row['facebook_3'] ?></div>
  825. <?php endif; ?>
  826. </div>
  827. <div class="alibaba">
  828. <?php if(!empty($row['alibaba_1'])): ?>
  829. <div><?= $row['alibaba_1'] ?></div>
  830. <?php endif; ?>
  831. <?php if(!empty($row['alibaba_2'])): ?>
  832. <div><?= $row['alibaba_2'] ?></div>
  833. <?php endif; ?>
  834. <?php if(!empty($row['alibaba_3'])): ?>
  835. <div><?= $row['alibaba_3'] ?></div>
  836. <?php endif; ?>
  837. </div>
  838. </div>
  839. <div class="noteItem2">备注</div>
  840. <div class="notecontent"><?= htmlUnCode($row['cs_note']) ?></div>
  841. </div>
  842. <?php
  843. }
  844. } else {
  845. if (empty($keys)) {
  846. echo '<tr><div align="center" colspan="9">Sorry,当前暂无信息</div></tr>';
  847. } else {
  848. echo '<tr><div align="center" colspan="9"><a href="?">Sorry,没有找到"' .
  849. htmlspecialcharsFix($keyscode) . '"相关的信息,点击返回</a></div></tr>';
  850. }
  851. }
  852. ?>
  853. <div colspan="9">
  854. <div class="showpagebox">
  855. <?php
  856. if ($totalPages > 1) {
  857. $pageName = "?Keys=$keys$urlStr&";
  858. $pageLen = 3;
  859. if ($page > 1) {
  860. echo "<a href=\"{$pageName}Page=1\">首页</a>";
  861. echo "<a href=\"{$pageName}Page=" . ($page - 1) . "\">上一页</a>";
  862. }
  863. if ($pageLen * 2 + 1 >= $totalPages) {
  864. $startPage = 1;
  865. $endPage = $totalPages;
  866. } else {
  867. if ($page <= $pageLen + 1) {
  868. $startPage = 1;
  869. $endPage = $pageLen * 2 + 1;
  870. } else {
  871. $startPage = $page - $pageLen;
  872. $endPage = $page + $pageLen;
  873. }
  874. if ($page + $pageLen > $totalPages) {
  875. $startPage = $totalPages - $pageLen * 2;
  876. $endPage = $totalPages;
  877. }
  878. }
  879. for ($i = $startPage; $i <= $endPage; $i++) {
  880. if ($i == $page) {
  881. echo "<a class=\"current\">$i</a>";
  882. } else {
  883. echo "<a href=\"{$pageName}Page=$i\">$i</a>";
  884. }
  885. }
  886. if ($page < $totalPages) {
  887. if ($totalPages - $page > $pageLen) {
  888. echo "<a href=\"{$pageName}Page=$totalPages\">...$totalPages</a>";
  889. }
  890. echo "<a href=\"{$pageName}Page=" . ($page + 1) . "\">下一页</a>";
  891. echo "<a href=\"{$pageName}Page=$totalPages\">尾页</a>";
  892. }
  893. }
  894. ?>
  895. </div>
  896. <?php require_once 'postchkbox.php'; ?>
  897. </div>
  898. </div>
  899. </form>
  900. </div>
  901. </body>
  902. </html>