56 lines
2.7 KiB
PHP
56 lines
2.7 KiB
PHP
<?php
|
|
$activeMenu = 'customer';
|
|
include APP_PATH . 'app/views/layouts/admin_header.php';
|
|
?>
|
|
|
|
<div class="box">
|
|
<div class="box-header with-border">
|
|
<h3 class="box-title"><i class="fa fa-list"></i> 客户列表</h3>
|
|
<div class="box-tools">
|
|
<a href="<?php echo BASE_URL; ?>/Admin/customerAdd" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> 添加客户</a>
|
|
</div>
|
|
</div>
|
|
<div class="box-body table-responsive no-padding">
|
|
<table class="table table-hover table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th style="width:60px">序号</th>
|
|
<th>公司名称</th>
|
|
<th>联系人1</th>
|
|
<th>联系方式1</th>
|
|
<th>联系人2</th>
|
|
<th>联系方式2</th>
|
|
<th>操作人</th>
|
|
<th style="width:150px">操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if (!empty($customers)): ?>
|
|
<?php foreach ($customers as $cust): ?>
|
|
<tr>
|
|
<td><?php echo $cust['id']; ?></td>
|
|
<td><strong><?php echo htmlspecialchars($cust['company_name']); ?></strong></td>
|
|
<td><?php echo htmlspecialchars($cust['contact1'] ?? '-'); ?></td>
|
|
<td><?php echo htmlspecialchars($cust['phone1'] ?? '-'); ?></td>
|
|
<td><?php echo htmlspecialchars($cust['contact2'] ?? '-'); ?></td>
|
|
<td><?php echo htmlspecialchars($cust['phone2'] ?? '-'); ?></td>
|
|
<td><?php echo htmlspecialchars($cust['created_by'] ?? '-'); ?></td>
|
|
<td>
|
|
<a href="<?php echo BASE_URL; ?>/Admin/customerEdit/<?php echo $cust['id']; ?>" class="btn btn-xs btn-info"><i class="fa fa-edit"></i> 编辑</a>
|
|
<form method="post" action="<?php echo BASE_URL; ?>/Admin/customerDelete/<?php echo $cust['id']; ?>" style="display:inline;" onsubmit="return confirm('确定删除该客户?')">
|
|
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrfToken); ?>">
|
|
<button type="submit" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> 删除</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php else: ?>
|
|
<tr><td colspan="8" class="text-center text-muted">暂无客户数据</td></tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<?php include APP_PATH . 'app/views/layouts/admin_footer.php'; ?>
|