1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207 |
- <?php
- require_once('conn.php');
- checkLogin("信息管理");
- // 辅助函数
- function numFormat($str) {
- // 移除所有非数字字符
- $formatted = preg_replace('/[^0-9]/', '', $str);
- return $formatted;
- }
- // Initialize variables
- $urlStr = "";
- $act = $_GET['act'] ?? '';
- $output = '';
- // Process all actions that might need headers
- if ($act == "save") {
- $isEdit = false;
- $id = $_POST['id'] ?? '';
- if (!empty($id) && is_numeric($id)) {
- $isEdit = true;
- }
- // Main customer table fields
- $cs_code = textEncode($_POST['cs_code'] ?? '');
- $cs_company = textEncode($_POST['cs_company'] ?? '');
- $cs_belong = intval($_POST['cs_belong'] ?? 0);
- $cs_country = intval($_POST['cs_country'] ?? 0);
- $cs_from = intval($_POST['cs_from'] ?? 0);
- $cs_state = intval($_POST['cs_state'] ?? 0);
- $cs_deal = intval($_POST['cs_deal'] ?? 0);
- $no_content = htmlEncode($_POST['no_content'] ?? '');
- $cs_address = textEncode($_POST['cs_address'] ?? '');
- $allowedit = isset($_POST['allowedit']) ? 1 : 0;
- // Begin transaction for all database operations
- $conn->begin_transaction();
-
- try {
- if ($isEdit) {
- // Get existing chain info
- $sql = "SELECT cs_chain FROM customer WHERE id=$id";
- $result = $conn->query($sql);
-
- if ($row = $result->fetch_assoc()) {
- $cs_chain = $row['cs_chain'];
- $chain_array = explode(',', $cs_chain);
- $last_item = end($chain_array);
-
- if ($last_item != $cs_belong) {
- $cs_chain .= ",$cs_belong";
- }
-
- // Update customer table
- $sql = "UPDATE customer SET
- cs_code='$cs_code',
- cs_company='$cs_company',
- cs_belong=$cs_belong,
- cs_country=$cs_country,
- cs_from=$cs_from,
- cs_state=$cs_state,
- cs_deal=$cs_deal,
- cs_note='$no_content',
- cs_address='$cs_address',
- allowedit=$allowedit,
- cs_chain='$cs_chain',
- cs_updatetime=NOW()
- WHERE id=$id";
- $conn->query($sql);
- // Delete existing contacts to replace with new ones
- $sql = "DELETE FROM customer_contact WHERE customer_id=$id";
- $conn->query($sql);
- } else {
- throw new Exception('不存在该客户');
- }
- } else {
- // Insert new customer
- $sql = "INSERT INTO customer (
- cs_code, cs_company, cs_belong, cs_country, cs_from,
- cs_state, cs_deal, cs_note, cs_address,
- allowedit, cs_chain, cs_addtime, cs_updatetime
- ) VALUES (
- '$cs_code', '$cs_company', $cs_belong, $cs_country, $cs_from,
- $cs_state, $cs_deal, '$no_content', '$cs_address',
- $allowedit, '$cs_belong', NOW(), NOW()
- )";
-
- $conn->query($sql);
- $id = $conn->insert_id;
- }
- // Process contacts array
- if (isset($_POST['contact']) && is_array($_POST['contact'])) {
- foreach ($_POST['contact'] as $contact) {
- if (empty($contact['contact_name'])) continue;
- $contact_name = textEncode($contact['contact_name']);
-
- // Initialize arrays for contact methods
- $methods = ['tel', 'email', 'whatsapp', 'wechat', 'linkedin', 'facebook', 'alibaba'];
- $fields = ['customer_id', 'contact_name'];
- $values = [$id, "'$contact_name'"];
- // Process each contact method (up to 3 entries each)
- foreach ($methods as $method) {
- for ($i = 1; $i <= 3; $i++) {
- $field_base = $method . '_' . $i;
- $value = textEncode($contact[$field_base] ?? '');
- $fields[] = $field_base;
- $values[] = "'$value'";
- // Add format field for tel and whatsapp
- if ($method == 'tel' || $method == 'whatsapp') {
- $format_value = numFormat($value);
- $fields[] = $field_base . '_format';
- $values[] = "'$format_value'";
- }
- // Add backup field
- $bu_value = textEncode($contact[$field_base . '_bu'] ?? $value);
- $fields[] = $field_base . '_bu';
- $values[] = "'$bu_value'";
- }
- }
- // Create and execute insert statement for contact
- $sql = "INSERT INTO customer_contact (" . implode(', ', $fields) . ", created_at, updated_at)
- VALUES (" . implode(', ', $values) . ", NOW(), NOW())";
-
- $conn->query($sql);
- }
- }
- // Commit transaction
- $conn->commit();
-
- // Redirect after successful save
- $page = $_GET['Page'] ?? '';
- $keys = urlencode($_GET['Keys'] ?? '');
- header("Location: ?keys=$keys&Page=$page$urlStr");
- exit;
-
- } catch (Exception $e) {
- // Rollback on failure
- $conn->rollback();
- $output = "<script>alert('保存失败: " . $e->getMessage() . "');history.back();</script>";
- }
- }
- // If we have output from processing, we'll show it instead of the normal page
- if (!empty($output)) {
- echo $output;
- 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" />
- <script language="javascript" src="js/jquery-1.7.2.min.js"></script>
- <script type="text/javascript" src="js/js.js"></script>
- <script type="text/javascript" src="xheditor-1.1.9/xheditor-1.1.9-zh-cn.min.js"></script>
- <script>
- $(document).ready(function(){
- $('.txt2').xheditor({
- tools:'full',
- hoverExecDelay:-1,
- urlBase:'system/',
- upLinkUrl:"upload.php",
- upLinkExt:"zip,rar,txt,pdf",
- upImgUrl:"upload.php",
- upImgExt:"jpg,jpeg,gif,png",
- upFlashUrl:"upload.php",
- upFlashExt:"swf",
- upMediaUrl:"upload.php",
- upMediaExt:"wmv,avi,wma,mp3,mid"
- });
- // Remove contact
- $(document).on('click', '.remove-contact-btn', function() {
- var contactForm = $(this).closest('.contact-form');
- contactForm.remove();
-
- // Renumber remaining contacts
- $('#contacts-container .contact-form').each(function(index) {
- $(this).find('h3').text('联系人 #' + (index + 1));
- });
- });
-
- // Add contact form
- $('.add-contact-btn').click(function() {
- var contactsContainer = $('#contacts-container');
- var contactIndex = contactsContainer.children('.contact-form').length;
- var contactForm = `
- <div class="contact-form" id="contact-form-${contactIndex}">
- <div class="contact-header">
- <button type="button" class="remove-contact-btn" data-index="${contactIndex}">删除</button>
- <h3>联系人 #${contactIndex + 1}</h3>
- </div>
- <input type="hidden" name="contact[${contactIndex}][id]" value="">
- <table width="100%" border="0" cellpadding="3" cellspacing="1" class="contact-table">
- <tr>
- <th width="8%">联系人</th>
- <td><input type="text" name="contact[${contactIndex}][contact_name]" class="txt1" placeholder="联系人姓名"/></td>
- </tr>
- </table>
- <div class="contact-methods-container" id="contact-methods-${contactIndex}">
- <!-- Contact methods will be added here -->
- </div>
- <button type="button" class="add-method-btn" data-contact-index="${contactIndex}">添加联系方式</button>
- </div>
- `;
- contactsContainer.append(contactForm);
- });
-
- // Add contact method
- $(document).on('click', '.add-method-btn', function() {
- var contactIndex = $(this).data('contact-index');
- var methodsContainer = $('#contact-methods-' + contactIndex);
-
- // Count existing methods by type
- var methodCounts = {};
- methodsContainer.find('select.method-select').each(function() {
- var type = $(this).val();
- if (type) {
- methodCounts[type] = (methodCounts[type] || 0) + 1;
- }
- });
-
- var methodRow = `
- <div class="contact-method-row">
- <select class="method-select" onchange="updateMethodSelectAndPlaceholder(this)">
- <option value="">请选择联系方式</option>
- <option value="tel" ${(methodCounts.tel || 0) >= 3 ? 'disabled' : ''}>电话</option>
- <option value="wechat" ${(methodCounts.wechat || 0) >= 3 ? 'disabled' : ''}>微信</option>
- <option value="whatsapp" ${(methodCounts.whatsapp || 0) >= 3 ? 'disabled' : ''}>WhatsApp</option>
- <option value="email" ${(methodCounts.email || 0) >= 3 ? 'disabled' : ''}>邮箱</option>
- <option value="linkedin" ${(methodCounts.linkedin || 0) >= 3 ? 'disabled' : ''}>领英</option>
- <option value="facebook" ${(methodCounts.facebook || 0) >= 3 ? 'disabled' : ''}>Facebook</option>
- <option value="alibaba" ${(methodCounts.alibaba || 0) >= 3 ? 'disabled' : ''}>阿里巴巴</option>
- </select>
- <input type="text" class="txt1 method-input" style="width:60%;" placeholder="请选择联系方式类型">
- <button type="button" class="remove-method-btn">删除</button>
- </div>
- `;
-
- methodsContainer.append(methodRow);
- updateMethodFields(methodsContainer.find('.contact-method-row:last-child'));
- });
-
- // Remove contact method
- $(document).on('click', '.remove-method-btn', function() {
- var methodRow = $(this).closest('.contact-method-row');
- var contactIndex = methodRow.closest('.contact-form').attr('id').split('-')[2];
- var type = methodRow.find('select.method-select').val();
- methodRow.remove();
-
- // Update available options in other selects
- updateAvailableMethodTypes(contactIndex);
- });
- });
- // Update method fields based on selection
- function updateMethodFields(methodRow) {
- var select = methodRow.find('select.method-select');
- var input = methodRow.find('input.method-input');
- var contactForm = methodRow.closest('.contact-form');
- var contactIndex = contactForm.attr('id').split('-')[2];
- var type = select.val();
-
- if (!type) return;
-
- // Count existing methods of this type
- var count = 1;
- contactForm.find('select.method-select').each(function() {
- if ($(this).val() === type && $(this)[0] !== select[0]) {
- count++;
- }
- });
-
- // Update field names
- select.attr('name', `contact[${contactIndex}][${type}_${count}]`);
- input.attr('name', `contact[${contactIndex}][${type}_${count}]`);
-
- // Add format field for tel and whatsapp
- if (type === 'tel' || type === 'whatsapp') {
- if (!methodRow.find('.format-input').length) {
- input.after(`<input type="hidden" class="format-input" name="contact[${contactIndex}][${type}_${count}_format]">`);
- }
- }
-
- // Add backup field
- if (!methodRow.find('.backup-input').length) {
- methodRow.append(`<input type="hidden" class="backup-input" name="contact[${contactIndex}][${type}_${count}_bu]">`);
- }
- }
- // Update available method types for a contact
- function updateAvailableMethodTypes(contactIndex) {
- var methodsContainer = $('#contact-methods-' + contactIndex);
-
- // Count methods by type
- var methodCounts = {};
- methodsContainer.find('select.method-select').each(function() {
- var type = $(this).val();
- if (type) {
- methodCounts[type] = (methodCounts[type] || 0) + 1;
- }
- });
-
- // Update all selects in this contact
- methodsContainer.find('select.method-select').each(function() {
- var currentValue = $(this).val();
-
- $(this).find('option').each(function() {
- var optionValue = $(this).val();
- if (optionValue && optionValue !== currentValue) {
- $(this).prop('disabled', (methodCounts[optionValue] || 0) >= 3);
- }
- });
- });
- }
- // Update placeholder and handle method fields
- function updateMethodSelectAndPlaceholder(selectElement) {
- var methodRow = $(selectElement).closest('.contact-method-row');
- updateMethodPlaceholder(selectElement);
- updateMethodFields(methodRow);
-
- var contactIndex = methodRow.closest('.contact-form').attr('id').split('-')[2];
- updateAvailableMethodTypes(contactIndex);
- }
- function updateMethodPlaceholder(selectElement) {
- var placeholder = "";
- var value = $(selectElement).val();
-
- switch(value) {
- case "tel":
- placeholder = "电话格式:区号+号码 如:+86 15012345678";
- break;
- case "wechat":
- placeholder = "微信";
- break;
- case "whatsapp":
- placeholder = "Whatsapp 格式:区号+号码 如:+86 15012345678";
- break;
- case "email":
- placeholder = "邮件";
- break;
- case "linkedin":
- placeholder = "领英链接";
- break;
- case "facebook":
- placeholder = "Facebook";
- break;
- case "alibaba":
- placeholder = "阿里巴巴";
- break;
- default:
- placeholder = "请选择联系方式类型";
- }
-
- $(selectElement).next('.method-input').attr('placeholder', placeholder);
- }
- </script>
- <style>
- .contact-form {
- margin-bottom: 10px;
- padding: 8px;
- background-color: #FFFFFF;
- }
- .contact-header {
- display: flex;
- align-items: center;
- margin-bottom: 8px;
- gap: 10px;
- }
- .contact-header h3 {
- margin: 0;
- order: 2;
- flex-grow: 1;
- }
- .remove-contact-btn {
- background-color: #f44336;
- color: white;
- border: none;
- padding: 4px 8px;
- cursor: pointer;
- order: 1;
- }
- .add-contact-btn {
- background-color: #4CAF50;
- color: white;
- border: none;
- padding: 6px 12px;
- margin-bottom: 10px;
- cursor: pointer;
- }
- .contact-methods-container {
- margin-top: 8px;
- }
- .contact-method-row {
- margin-bottom: 6px;
- padding: 6px;
- border: 1px solid #eee;
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .add-method-btn {
- background-color: #2196F3;
- color: white;
- border: none;
- padding: 4px 8px;
- margin-top: 4px;
- cursor: pointer;
- }
- .remove-method-btn {
- background-color: #f44336;
- color: white;
- border: none;
- padding: 2px 4px;
- cursor: pointer;
- }
- .method-select {
- margin-right: 8px;
- padding: 3px;
- }
- .contact-table {
- margin-bottom: 6px;
- }
- .contact-table td, .contact-table th {
- padding: 4px 6px;
- }
- </style>
- </head>
- <body>
- <div id="man_zone">
- <?php
- // 编辑操作
- if ($act == "edit" || $act == "add") {
- $id = $_GET['id'] ?? '';
- $isEdit = false;
-
- // Initialize variables
- $cs_code = $cs_company = $cs_address = $cs_addtime = $cs_updatetime = $cs_note = '';
- $cs_belong = $cs_country = $cs_from = $cs_state = $cs_deal = $allowedit = $cs_type = $cs_belongclient = 0;
- $contacts = [];
- if (!empty($id) && is_numeric($id)) {
- $isEdit = true;
-
- // Join customer and customer_contact tables
- $sql = "SELECT c.*, cc.* FROM customer c
- LEFT JOIN customer_contact cc ON c.id = cc.customer_id
- WHERE c.id = $id";
- $result = $conn->query($sql);
-
- if ($row = $result->fetch_assoc()) {
- // Basic customer info
- $cs_code = textUncode($row['cs_code']);
- $cs_company = textUncode($row['cs_company']);
- $cs_country = $row['cs_country'];
- $cs_from = $row['cs_from'];
- $cs_address = textUncode($row['cs_address']);
- $cs_addtime = $row['cs_addtime'];
- $cs_updatetime = $row['cs_updatetime'];
- $cs_belong = $row['cs_belong'];
- $cs_state = $row['cs_state'];
- $cs_deal = $row['cs_deal'];
- $cs_note = htmlUncode($row['cs_note']);
- $allowedit = $row['allowedit'];
- $cs_type = $row['cs_type'];
- $cs_belongclient = $row['cs_belongclient'];
- // Get all contacts for this customer
- $contactSql = "SELECT * FROM customer_contact WHERE customer_id = $id";
- $contactResult = $conn->query($contactSql);
- while ($contactRow = $contactResult->fetch_assoc()) {
- $contact = [
- 'id' => $contactRow['id'],
- 'contact_name' => textUncode($contactRow['contact_name']),
- 'created_at' => $contactRow['created_at'],
- 'updated_at' => $contactRow['updated_at']
- ];
- // Process each contact method type (up to 3 entries each)
- $methodTypes = ['tel', 'email', 'whatsapp', 'wechat', 'linkedin', 'facebook', 'alibaba'];
- foreach ($methodTypes as $type) {
- for ($i = 1; $i <= 3; $i++) {
- $fieldBase = $type . '_' . $i;
- $contact[$fieldBase] = textUncode($contactRow[$fieldBase]);
- if ($type == 'tel' || $type == 'whatsapp') {
- $contact[$fieldBase . '_format'] = textUncode($contactRow[$fieldBase . '_format']);
- }
- $contact[$fieldBase . '_bu'] = textUncode($contactRow[$fieldBase . '_bu']);
- }
- }
-
- $contacts[] = $contact;
- }
- }
- }
- $page = $_GET['Page'] ?? '';
- $keys = urlencode($_GET['Keys'] ?? '');
- $ord = urlencode($_GET['Ord'] ?? '');
- $hrefstr = "?keys=$keys&Page=$page&Ord=$ord";
- ?>
- <form name="form1" method="post" action="<?php echo $hrefstr; ?>&act=save">
- <table width="100%" border="0" cellpadding="3" cellspacing="1" class="table1">
- <tbody>
- <tr>
- <th width="8%">客户编号</th>
- <td><input type="text" id="cs_code" name="cs_code" value="<?php echo $cs_code; ?>" class="txt1" />
- <input type="hidden" name="id" value="<?php echo $id; ?>" /></td>
- </tr>
- <tr>
- <th width="8%">公司名称</th>
- <td><input type="text" id="cs_company" name="cs_company" value="<?php echo $cs_company; ?>" class="txt1" /></td>
- </tr>
- <tr>
- <th width="8%">所属业务</th>
- <td>
- <select name="cs_belong">
- <option value="0">请选择</option>
- <?php
- $sql = "SELECT id,em_user FROM employee";
- $result = $conn->query($sql);
- while($row = $result->fetch_assoc()) {
- $selected = ($row['id'] == $cs_belong) ? ' selected="selected"' : '';
- echo "<option value=\"{$row['id']}\"$selected>{$row['em_user']}</option>";
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <th width="8%">国家</th>
- <td>
- <select name="cs_country">
- <option value="0">请选择</option>
- <?php
- $sql = "SELECT id,countryCode,countryName FROM country";
- $result = $conn->query($sql);
- while($row = $result->fetch_assoc()) {
- $selected = ($row['id'] == $cs_country) ? ' selected="selected"' : '';
- echo "<option value=\"{$row['id']}\"$selected>{$row['countryName']}</option>";
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <th width="8%">来源</th>
- <td>
- <select name="cs_from">
- <option value="0">请选择</option>
- <?php
- $sql = "SELECT id,ch_name FROM qudao";
- $result = $conn->query($sql);
- while($row = $result->fetch_assoc()) {
- $selected = ($row['id'] == $cs_from) ? ' selected="selected"' : '';
- echo "<option value=\"{$row['id']}\"$selected>{$row['ch_name']}</option>";
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <th width="8%">录入时间</th>
- <td><?php echo $cs_addtime; ?></td>
- </tr>
- <tr>
- <th width="8%">更新时间</th>
- <td><?php echo $cs_updatetime; ?></td>
- </tr>
- <tr>
- <th width="8%" valign="top">联系人信息</th>
- <td>
- <button type="button" class="add-contact-btn">添加联系人</button>
- <div id="contacts-container">
- <?php if (!empty($contacts)): ?>
- <?php foreach ($contacts as $index => $contact): ?>
- <div class="contact-form" id="contact-form-<?php echo $index; ?>">
- <div class="contact-header">
- <button type="button" class="remove-contact-btn" data-index="<?php echo $index; ?>">删除</button>
- <h3>联系人 #<?php echo $index + 1; ?></h3>
- </div>
- <input type="hidden" name="contact[<?php echo $index; ?>][id]" value="<?php echo $contact['id']; ?>">
- <table width="100%" border="0" cellpadding="3" cellspacing="1" class="contact-table">
- <tr>
- <th width="8%">联系人</th>
- <td><input type="text" name="contact[<?php echo $index; ?>][contact_name]" value="<?php echo htmlspecialchars($contact['contact_name']); ?>" class="txt1" placeholder="联系人姓名"/></td>
- </tr>
- </table>
- <div class="contact-methods-container" id="contact-methods-<?php echo $index; ?>">
- <?php
- $methodTypes = [
- 'tel' => '电话',
- 'wechat' => '微信',
- 'whatsapp' => 'WhatsApp',
- 'email' => '邮箱',
- 'linkedin' => '领英',
- 'facebook' => 'Facebook',
- 'alibaba' => '阿里巴巴'
- ];
-
- foreach ($methodTypes as $type => $label) {
- for ($i = 1; $i <= 3; $i++) {
- $fieldName = $type . '_' . $i;
- if (!empty($contact[$fieldName])) {
- echo '<div class="contact-method-row">';
- echo '<select class="method-select" name="contact[' . $index . '][' . $fieldName . ']" onchange="updateMethodSelectAndPlaceholder(this)">';
- echo '<option value="">请选择联系方式</option>';
-
- foreach ($methodTypes as $optionType => $optionLabel) {
- $selected = ($optionType === $type) ? 'selected' : '';
- echo '<option value="' . $optionType . '" ' . $selected . '>' . $optionLabel . '</option>';
- }
-
- echo '</select>';
- echo '<input type="text" class="txt1 method-input" style="width:60%;" name="contact[' . $index . '][' . $fieldName . ']" value="' . htmlspecialchars($contact[$fieldName]) . '">';
-
- if ($type === 'tel' || $type === 'whatsapp') {
- echo '<input type="hidden" class="format-input" name="contact[' . $index . '][' . $fieldName . '_format]" value="' . htmlspecialchars($contact[$fieldName . '_format']) . '">';
- }
-
- echo '<input type="hidden" class="backup-input" name="contact[' . $index . '][' . $fieldName . '_bu]" value="' . htmlspecialchars($contact[$fieldName . '_bu']) . '">';
- echo '</div>';
- }
- }
- }
- ?>
- </div>
- <button type="button" class="add-method-btn" data-contact-index="<?php echo $index; ?>">添加联系方式</button>
- </div>
- <?php endforeach; ?>
- <?php else: ?>
- <div class="contact-form" id="contact-form-0">
- <div class="contact-header">
- <button type="button" class="remove-contact-btn" data-index="0">删除</button>
- <h3>联系人 #1</h3>
- </div>
- <input type="hidden" name="contact[0][id]" value="">
- <table width="100%" border="0" cellpadding="3" cellspacing="1" class="contact-table">
- <tr>
- <th width="8%">联系人</th>
- <td><input type="text" name="contact[0][contact_name]" class="txt1" placeholder="联系人姓名"/></td>
- </tr>
- </table>
- <div class="contact-methods-container" id="contact-methods-0">
- <!-- Contact methods will be added here -->
- </div>
- <button type="button" class="add-method-btn" data-contact-index="0">添加联系方式</button>
- </div>
- <?php endif; ?>
- </div>
- </td>
- </tr>
- <tr>
- <th width="8%">地址</th>
- <td><input type="text" id="cs_address" name="cs_address" value="<?php echo $cs_address; ?>" class="txt1" /></td>
- </tr>
- <tr>
- <th width="8%">标签</th>
- <td>
- <?php
- if($isEdit) {
- $sql = "SELECT id,tagName FROM tagtable WHERE customerId = ?";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param("i", $id);
- $stmt->execute();
- $result = $stmt->get_result();
- while($row = $result->fetch_assoc()) {
- echo htmlspecialchars($row['tagName']) . ',';
- }
- $stmt->close();
- }
- ?>
- </td>
- </tr>
- <tr>
- <th width="8%">状态</th>
- <td>
- <label><input type="radio" name="cs_state" value="1" <?php if($cs_state==1) echo 'checked="checked"'; ?> />有效</label>
- <label><input type="radio" name="cs_state" value="0" <?php if($cs_state!=1) echo 'checked="checked"'; ?> />不再跟进</label>
- </td>
- </tr>
- <tr>
- <th width="8%">是否误报</th>
- <td>
- <label><input type="radio" name="allowedit" value="1" <?php if($allowedit==1) echo 'checked="checked"'; ?> />审核通过</label>
- <label><input type="radio" name="allowedit" value="0" <?php if($allowedit!=1) echo 'checked="checked"'; ?> />一般处理</label>
- </td>
- </tr>
- <tr>
- <th width="8%">是否成交</th>
- <td>
- <label><input type="radio" name="cs_deal" value="3" <?php if($cs_deal==3) echo 'checked="checked"'; ?> />成交</label>
- <label><input type="radio" name="cs_deal" value="2" <?php if($cs_deal==2) echo 'checked="checked"'; ?> />明确需求</label>
- <label><input type="radio" name="cs_deal" value="1" <?php if($cs_deal==1) echo 'checked="checked"'; ?> />背景调查</label>
- <label><input type="radio" name="cs_deal" value="0" <?php if($cs_deal==0) echo 'checked="checked"'; ?> />无响应</label>
- </td>
- </tr>
- <tr>
- <th>内容</th>
- <td><textarea id="no_content" name="no_content" class="txt2"><?php echo $cs_note; ?></textarea></td>
- </tr>
- <tr>
- <th></th>
- <td>
- <input type="submit" name="save" id="save" value="确定" class="btn1" />
- <input type="reset" name="save" id="save" value="重置" class="btn1" />
- <input type="button" value="返回" class="btn1" onClick="location.href='<?php echo $hrefstr; ?>'" />
- </td>
- </tr>
- </tbody>
- </table>
- </form>
- <?php
- exit;
- }
- // 批量操作
- if ($act == "postchk") {
- $keys = urlencode($_GET['Keys'] ?? '');
- $page = $_GET['Page'] ?? '';
- $chkact = $_POST['chkact'] ?? '';
-
- if (isset($_POST['chkbox']) && is_array($_POST['chkbox'])) {
- $ids = array_map('intval', $_POST['chkbox']);
- $idList = implode(',', $ids);
-
- if (!empty($idList)) {
- switch($chkact) {
- case "0":
- case "1":
- $sql = "UPDATE customer SET cs_state=$chkact WHERE id IN ($idList)";
- break;
- default:
- // In delete case, let's use transactions to ensure both tables are updated
- $conn->begin_transaction();
- try {
- // Delete from customer_contact first (due to foreign key constraint)
- $sql = "DELETE FROM customer_contact WHERE customer_id IN ($idList)";
- $conn->query($sql);
-
- // Then delete from customer table
- $sql = "DELETE FROM customer WHERE id IN ($idList)";
- $conn->query($sql);
-
- $conn->commit();
- } catch (Exception $e) {
- $conn->rollback();
- echo "<script>alert('删除失败: " . $e->getMessage() . "');</script>";
- }
- }
- if ($chkact == "0" || $chkact == "1") {
- $conn->query($sql);
- }
- }
- }
-
- header("Location: ?Keys=$keys&Page=$page");
- exit;
- }
- // 主列表页面
- $fliterQudao = $_GET['fliterQudao'] ?? '';
- $fliterDeal = $_GET['fliterDeal'] ?? '';
- $fliterTeam = $_GET['fliterTeam'] ?? '';
- $fliterContact = $_GET['fliterContact'] ?? '';
- $fliterEmployee = $_GET['fliterEmployee'] ?? '';
- $filterStr = "";
- $urlStr = "";
- if (!empty($fliterQudao)) {
- $filterStr .= " AND c.cs_from=" . intval($fliterQudao);
- $urlStr .= "&fliterQudao=$fliterQudao";
- }
- if (!empty($fliterDeal)) {
- $filterStr .= " AND c.cs_deal=" . intval($fliterDeal);
- $urlStr .= "&fliterDeal=$fliterDeal";
- }
- if (!empty($fliterTeam)) {
- $filterStr .= " AND (c.cs_belong=" . intval($fliterTeam) .
- " OR c.cs_belong IN (SELECT id FROM employee WHERE em_role=" . intval($fliterTeam) . "))";
- $urlStr .= "&fliterTeam=$fliterTeam";
- }
- if (!empty($fliterEmployee)) {
- $filterStr .= " AND c.cs_belong=" . intval($fliterEmployee);
- $urlStr .= "&fliterEmployee=$fliterEmployee";
- }
- if (!empty($fliterContact)) {
- switch($fliterContact) {
- case "1": $filterStr .= " AND (cc.tel_1 != '' OR cc.tel_2 != '' OR cc.tel_3 != '')"; break;
- case "2": $filterStr .= " AND (cc.wechat_1 != '' OR cc.wechat_2 != '' OR cc.wechat_3 != '')"; break;
- case "3": $filterStr .= " AND (cc.whatsapp_1 != '' OR cc.whatsapp_2 != '' OR cc.whatsapp_3 != '')"; break;
- case "4": $filterStr .= " AND (cc.email_1 != '' OR cc.email_2 != '' OR cc.email_3 != '')"; break;
- case "5": $filterStr .= " AND (cc.linkedin_1 != '' OR cc.linkedin_2 != '' OR cc.linkedin_3 != '')"; break;
- case "6": $filterStr .= " AND (cc.facebook_1 != '' OR cc.facebook_2 != '' OR cc.facebook_3 != '')"; break;
- default: $filterStr .= " AND (cc.alibaba_1 != '' OR cc.alibaba_2 != '' OR cc.alibaba_3 != '')";
- }
- $urlStr .= "&fliterContact=$fliterContact";
- }
- $keys = $_GET['Keys'] ?? '';
- $keyscode = textEncode($keys);
- $page = $_GET['Page'] ?? '';
- $ord = $_GET['Ord'] ?? '';
- $sql = "SELECT c.id, c.cs_code, c.cs_company, c.cs_country, c.cs_address,
- c.cs_from, c.cs_deal, c.cs_addtime, c.cs_updatetime, c.cs_belong, c.cs_note,
- c.cs_claimFrom, c.cs_chain, c.cs_dealdate,
- cc.contact_name as cs_name,
- cc.tel_1 as cs_tel, cc.email_1 as cs_email,
- cc.whatsapp_1 as cs_whatsapp, cc.wechat_1 as cs_wechat,
- cc.linkedin_1 as cs_linkedin, cc.facebook_1 as cs_facebook,
- cc.alibaba_1 as cs_alibaba
- FROM customer c
- LEFT JOIN customer_contact cc ON c.id = cc.customer_id
- WHERE (c.cs_code LIKE '%$keyscode%'
- OR cc.contact_name LIKE '%$keyscode%'
- OR cc.tel_1 LIKE '%$keyscode%'
- OR cc.tel_2 LIKE '%$keyscode%'
- OR cc.tel_3 LIKE '%$keyscode%'
- OR cc.wechat_1 LIKE '%$keyscode%'
- OR cc.wechat_2 LIKE '%$keyscode%'
- OR cc.wechat_3 LIKE '%$keyscode%'
- OR cc.alibaba_1 LIKE '%$keyscode%'
- OR cc.alibaba_2 LIKE '%$keyscode%'
- OR cc.alibaba_3 LIKE '%$keyscode%'
- OR cc.whatsapp_1_format LIKE '%$keyscode%'
- OR cc.whatsapp_2_format LIKE '%$keyscode%'
- OR cc.whatsapp_3_format LIKE '%$keyscode%'
- OR cc.email_1 LIKE '%$keyscode%'
- OR cc.email_2 LIKE '%$keyscode%'
- OR cc.email_3 LIKE '%$keyscode%')
- $filterStr
- ORDER BY c.cs_updatetime DESC";
- $result = $conn->query($sql);
- ?>
- <form id="form1" method="post" action="?act=postchk&Keys=<?php echo $keys; ?>&Page=<?php echo $page; ?>" onSubmit="return false">
- <div class="fastSelect clear">
- <H1>搜索条件</H1>
- <div class="selectItem">
- <label>来源渠道</label>
- <select name="fliterQudao" class="filterSearch">
- <option value="">请选择渠道</option>
- <?php
- $sql_temp = "SELECT id,ch_name FROM qudao";
- $qudaoResult = $conn->query($sql_temp);
- while($row = $qudaoResult->fetch_assoc()) {
- $selected = ($fliterQudao == $row['id']) ? ' selected="selected"' : '';
- echo "<option value=\"{$row['id']}\"$selected>{$row['ch_name']}</option>";
- }
- ?>
- </select>
- </div>
- <div class="selectItem">
- <label>是否成交</label>
- <select name="fliterDeal" class="filterSearch">
- <option value="">请选择</option>
- <option value="3" <?php if($fliterDeal=="3") echo 'selected="selected"'; ?>>已成交</option>
- <option value="2" <?php if($fliterDeal=="2") echo 'selected="selected"'; ?>>明确需求</option>
- <option value="1" <?php if($fliterDeal=="1") echo 'selected="selected"'; ?>>背景调查</option>
- <option value="0" <?php if($fliterDeal=="0") echo 'selected="selected"'; ?>>无响应</option>
- </select>
- </div>
- <div class="selectItem">
- <label>按组</label>
- <select name="fliterTeam" class="filterSearch">
- <option value="">请选择</option>
- <?php
- $sql_temp = "SELECT id,em_user FROM employee WHERE em_role=0";
- $teamResult = $conn->query($sql_temp);
- while($row = $teamResult->fetch_assoc()) {
- $selected = ($fliterTeam == $row['id']) ? ' selected="selected"' : '';
- echo "<option value=\"{$row['id']}\"$selected>{$row['em_user']}组</option>";
- }
- ?>
- </select>
- </div>
-
- <div class="selectItem">
- <label>业务</label>
- <select name="fliterEmployee" class="filterSearch">
- <option value="">请选择</option>
- <?php
- $sql_temp = "SELECT id,em_user FROM employee";
- $empResult = $conn->query($sql_temp);
- while($row = $empResult->fetch_assoc()) {
- $selected = ($fliterEmployee == $row['id']) ? ' selected="selected"' : '';
- echo "<option value=\"{$row['id']}\"$selected>{$row['em_user']}</option>";
- }
- ?>
- </select>
- </div>
-
- <div class="selectItem">
- <label>联系方式</label>
- <select name="fliterContact" class="filterSearch">
- <option value="">请选择</option>
- <option value="1" <?php if($fliterContact=="1") echo 'selected="selected"'; ?>>电话</option>
- <option value="2" <?php if($fliterContact=="2") echo 'selected="selected"'; ?>>微信</option>
- <option value="3" <?php if($fliterContact=="3") echo 'selected="selected"'; ?>>WhatsApp</option>
- <option value="4" <?php if($fliterContact=="4") echo 'selected="selected"'; ?>>邮箱</option>
- <option value="5" <?php if($fliterContact=="5") echo 'selected="selected"'; ?>>领英</option>
- <option value="6" <?php if($fliterContact=="6") echo 'selected="selected"'; ?>>Facebook</option>
- <option value="7" <?php if($fliterContact=="7") echo 'selected="selected"'; ?>>阿里巴巴</option>
- </select>
- </div>
- <div class="inputSearch">
- <input type="text" id="keys" class="inputTxt" value="<?php echo empty($keyscode) ? '请输入搜索关键词' : $keyscode; ?>"
- onFocus="if(this.value == '<?php echo empty($keyscode) ? '请输入搜索关键词' : $keyscode; ?>'){this.value='';}"
- onBlur="if(this.value == ''){this.value='<?php echo empty($keyscode) ? '请输入搜索关键词' : $keyscode; ?>';}"
- onKeyDown="if(event.keyCode==13){location.href='?Keys='+escape(document.getElementById('keys').value)+'<?php echo $urlStr; ?>'}" />
- <input type="button" id="searchgo" class="searchgo" value="go"
- onClick="location.href='?Keys='+escape(document.getElementById('keys').value)+'<?php echo $urlStr; ?>'" />
- </div>
- </div>
-
- <table width="100%" border="0" cellpadding="3" cellspacing="1" class="table1">
- <thead>
- <tr>
- <th width="4%"><input type="checkbox" name="chkall" id="chkall" onClick="chkboxall(this,'chkbox')" /></th>
- <th width="6%">序号</th>
- <th width="20%">客户编码</th>
- <th width="10%">联系人</th>
- <th width="10%">国家地区</th>
- <th width="7.5%">来源</th>
- <th width="7.5%">是否成交</th>
- <th width="10%">业务员</th>
- <th width="10%">操作</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if ($result->num_rows > 0) {
- $pageSize = 18;
- $totalPages = ceil($result->num_rows / $pageSize);
-
- if (empty($page)) $page = 1;
- if ($page == 'end') $page = $totalPages;
- if (!is_numeric($page) || $page < 1) $page = 1;
- $page = (int)$page;
- if ($page > $totalPages) $page = $totalPages;
-
- $offset = ($page - 1) * $pageSize;
- $sql .= " LIMIT $offset, $pageSize";
- $result = $conn->query($sql);
-
- $tempNum = $pageSize * ($page - 1);
-
- while ($row = $result->fetch_assoc()) {
- $tempNum++;
- ?>
- <tr onMouseOver="this.style.background='#F7FCFF'" onMouseOut="this.style.background='#FFFFFF'">
- <td align="center"><input type="checkbox" name="chkbox" value="<?php echo $row['id'] ?? ''; ?>" /></td>
- <td align="center"><?php echo $tempNum; ?></td>
- <td align="center" class="code" data-id="<?php echo $row['id'] ?? ''; ?>">
- <?php
- echo $row['cs_code'] ?? ''; ?>
- <?php if(($row['cs_claimFrom'] ?? 0) > 0): ?>
- <img src="../images/yijiao.png" class="handover">
- <?php endif; ?>
- </td>
- <td align="center"><?php echo $row['cs_name'] ?? ''; ?></td>
- <td align="center">
- <?php
- $countryId = intval($row['cs_country'] ?? 0);
- $sql = "SELECT countryName FROM country WHERE id = ?";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param("i", $countryId);
- $stmt->execute();
- $countryResult = $stmt->get_result();
- if ($countryRow = $countryResult->fetch_assoc()) {
- echo htmlspecialchars($countryRow['countryName']);
- } else {
- echo "未选择";
- }
- $stmt->close();
- ?>
- </td>
- <td align="center">
- <?php
- $fromId = intval($row['cs_from'] ?? 0);
- $sql = "SELECT ch_name FROM qudao WHERE id = ?";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param("i", $fromId);
- $stmt->execute();
- $qudaoResult = $stmt->get_result();
- if ($qudaoRow = $qudaoResult->fetch_assoc()) {
- echo htmlspecialchars($qudaoRow['ch_name']);
- } else {
- echo "未选择";
- }
- $stmt->close();
- ?>
- </td>
- <td align="center">
- <?php
- $cs_deal = intval($row['cs_deal'] ?? 0);
- if ($cs_deal == 3) {
- echo "<span style='color:red;font-size:10px;'>" . htmlspecialchars($row['cs_dealdate'] ?? '') . "成交</span>";
- } elseif ($cs_deal == 2) {
- echo "明确需求";
- } elseif ($cs_deal == 1) {
- echo "背景调查";
- } else {
- echo "无响应";
- }
- ?>
- </td>
- <td align="center">
- <?php
- $belongId = intval($row['cs_belong'] ?? 0);
- $sql = "SELECT em_user FROM employee WHERE id = ?";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param("i", $belongId);
- $stmt->execute();
- $empResult = $stmt->get_result();
- if ($empRow = $empResult->fetch_assoc()) {
- echo htmlspecialchars($empRow['em_user']);
- } else {
- echo "未选择";
- }
- $stmt->close();
- ?>
- </td>
- <td align="center">
- <a href="?Keys=<?php echo urlencode($keys ?? ''); ?>&Page=<?php echo urlencode($page ?? '') . $urlStr; ?>&act=edit&id=<?php echo $row['id'] ?? ''; ?>" class="ico_edit ico">修改</a>
- </td>
- </tr>
- <tr class="detail_panel code<?php echo $row['id'] ?? ''; ?>__panel">
- <td colspan="2"></td>
- <td colspan="7" class="cs_detail">
- <ul>
- <li class="cs_detail_addtime">录入时间:<?php echo htmlspecialchars($row['cs_addtime'] ?? ''); ?></li>
- <li class="cs_detail_addtime">更新时间:<?php echo htmlspecialchars($row['cs_updatetime'] ?? ''); ?></li>
- <li class="cs_detail_addtime">
- 流转记录:
- <?php
- $chain = $row['cs_chain'] ?? '';
- if(!empty($chain)) {
- $chain_array = explode(',', $chain);
- $chain_ids = array_filter(array_map('intval', $chain_array));
-
- if(!empty($chain_ids)) {
- $placeholders = str_repeat('?,', count($chain_ids) - 1) . '?';
- $sql = "SELECT em_user FROM employee WHERE id IN ($placeholders)";
- $stmt = $conn->prepare($sql);
- $stmt->bind_param(str_repeat('i', count($chain_ids)), ...$chain_ids);
- $stmt->execute();
- $chainResult = $stmt->get_result();
- $chain_users = [];
- while($chainRow = $chainResult->fetch_assoc()) {
- $chain_users[] = htmlspecialchars($chainRow['em_user']);
- }
- echo implode(' > ', $chain_users);
- $stmt->close();
- }
- }
- ?>
- </li>
- <?php if(!empty($row['cs_tel'] ?? '')): ?>
- <li class="tel"><?php echo htmlspecialchars($row['cs_tel']); ?></li>
- <?php endif; ?>
- <?php if(!empty($row['cs_email'] ?? '')): ?>
- <li class="mail"><?php echo htmlspecialchars($row['cs_email']); ?></li>
- <?php endif; ?>
- <?php if(!empty($row['cs_whatsapp'] ?? '')): ?>
- <li class="whatsapp"><?php echo htmlspecialchars($row['cs_whatsapp']); ?></li>
- <?php endif; ?>
- <?php if(!empty($row['cs_wechat'] ?? '')): ?>
- <li class="wechat"><?php echo htmlspecialchars($row['cs_wechat']); ?></li>
- <?php endif; ?>
- <?php if(!empty($row['cs_linkedin'] ?? '')): ?>
- <li class="linkedin"><?php echo htmlspecialchars($row['cs_linkedin']); ?></li>
- <?php endif; ?>
- <?php if(!empty($row['cs_facebook'] ?? '')): ?>
- <li class="facebook"><?php echo htmlspecialchars($row['cs_facebook']); ?></li>
- <?php endif; ?>
- <?php if(!empty($row['cs_alibaba'] ?? '')): ?>
- <li class="alibaba"><?php echo htmlspecialchars($row['cs_alibaba']); ?></li>
- <?php endif; ?>
- <?php if(!empty($row['cs_address'] ?? '')): ?>
- <li class="address"><?php echo htmlspecialchars($row['cs_address']); ?></li>
- <?php endif; ?>
- </ul>
- <div class="cs_detail_note"><?php echo htmlspecialchars($row['cs_note'] ?? ''); ?></div>
- </td>
- </tr>
- <?php
- }
- } else {
- if (empty($keys)) {
- ?>
- <tr>
- <td align="center" colspan="9">Sorry,当前暂无信息</td>
- </tr>
- <?php
- } else {
- ?>
- <tr>
- <td align="center" colspan="9"><a href="?">Sorry,没有找到"<?php echo $keyscode; ?>"相关的信息,点击返回</a></td>
- </tr>
- <?php
- }
- }
- ?>
- </tbody>
- <tfoot>
- <tr>
- <td colspan="9">
- <div class="showpagebox">
- <?php
- if ($totalPages > 1) {
- $pageName = "?Keys=$keys&Ord=$ord$urlStr&";
- $pageLen = 3;
-
- if ($page > 1) {
- echo "<a href=\"{$pageName}Page=1\">首页</a>";
- echo "<a href=\"{$pageName}Page=" . ($page-1) . "\">上一页</a>";
- }
-
- if ($pageLen * 2 + 1 >= $totalPages) {
- $startPage = 1;
- $endPage = $totalPages;
- } else {
- if ($page <= $pageLen + 1) {
- $startPage = 1;
- $endPage = $pageLen * 2 + 1;
- } else {
- $startPage = $page - $pageLen;
- $endPage = $page + $pageLen;
- }
- if ($page + $pageLen > $totalPages) {
- $startPage = $totalPages - $pageLen * 2;
- $endPage = $totalPages;
- }
- }
-
- for ($i = $startPage; $i <= $endPage; $i++) {
- if ($i == $page) {
- echo "<a class=\"current\">$i</a>";
- } else {
- echo "<a href=\"{$pageName}Page=$i\">$i</a>";
- }
- }
-
- if ($page < $totalPages) {
- if ($totalPages - $page > $pageLen) {
- echo "<a href=\"{$pageName}Page=$totalPages\">...$totalPages</a>";
- }
- echo "<a href=\"{$pageName}Page=" . ($page+1) . "\">下一页</a>";
- echo "<a href=\"{$pageName}Page=$totalPages\">尾页</a>";
- }
-
- echo "<input type=\"text\" id=\"Pagego\" value=\"$page\"
- onFocus=\"if(this.value == '$page'){this.value='';}\"
- onBlur=\"if(this.value == ''){this.value='$page';}\"
- onKeyUp=\"this.value=this.value.replace(/\D/g,'')\"
- onKeyDown=\"if(event.keyCode==13){location.href='{$pageName}Page='+document.getElementById('Pagego').value}\" />";
- }
- ?>
- </div>
- <div class="postchkbox">
- <select id="chkact" name="chkact">
- <option value="1">显示</option>
- <option value="0">隐藏</option>
- <option value="-1">删除</option>
- </select>
- <input type="button" value="执行" onClick="postchk(1)" class="btn1" />
- <input type="button" value="新增" onClick="location.href='?act=add'" class="btn1" />
- </div>
- </td>
- </tr>
- </tfoot>
- </table>
- </form>
- </div>
- </body>
- </html>
- <?php
- $conn->close();
- ?>
|