Browse Source

黑名单编辑

shenzhipeng 2 years ago
parent
commit
96478751e0

+ 30 - 0
application/module/ctrl/Sms_customer_list_adminAction.class.php

@@ -263,6 +263,36 @@ class Sms_customer_list_adminAction extends Action{
 		$this->display('edit.html');
 	}
 
+	//编辑黑名单客户
+	public function editBlack(){
+		$admin = new AdvertAdminAction();
+		$id = $_REQUEST['id'];
+
+		$one_info = $admin->selectOneSmsCustomer($id);
+
+		if($_POST['tel']){
+			$id = $_POST['id'];
+			$data['uname'] = $_POST['username'];
+			$data['group_name'] = trim($_POST['group_name']);
+			$data['country'] = trim($_POST['country']);
+			$data['tel'] = trim($_POST['tel']);
+			$update = $admin->updateSmsCustomer($data,$id);
+
+			if($update){
+				$info = "编辑客户资料成功";
+				header("Location:/?a=sms_customer_list_admin&m=index&info=$info");
+				exit();
+			}else{
+				$info = "编辑客户资料失败";
+				$this->assign('info',$info);
+			}
+		}
+
+		$this->assign('id',$id);
+		$this->assign('one_info',$one_info);
+		$this->display('editBlack.html');
+	}
+
 	//删除客户
 	public function delete(){
 		$admin = new AdvertAdminAction();

+ 1 - 1
application/module/view/sms_customer_list_admin/blacklist.html

@@ -75,7 +75,7 @@
 							<td><{$item.tel}></td>
 
 							<td>
-								<a href="/?a=sms_customer_list_admin&m=edit&id=<{$item.id}>">编辑</a>
+								<a href="/?a=sms_customer_list_admin&m=editBlack&id=<{$item.id}>">编辑</a>
 								<a onclick="to_confirm('<{$item.id}>','<{$item.tel}>')" style="float:right;margin-right:15px;cursor:pointer;">删除</a>
 							</td>
 						</tr>

+ 102 - 0
application/module/view/sms_customer_list_admin/editBlack.html

@@ -0,0 +1,102 @@
+<{include file='../public/admin_header.html'}>
+<{include file='../public/admin_navi.html'}>
+<!-- Right side column. Contains the navbar and content of the page -->
+<aside class="right-side">
+	<!-- Content Header (Page header) -->
+	<section class="content-header">
+		<h1>
+			编辑黑名单客户信息
+			<small>Control panel</small>
+		</h1>
+		<ol class="breadcrumb">
+			<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
+			<li class="active">Blank page</li>
+		</ol>
+	</section>
+
+	<!-- Main content -->
+	<section class="content">
+
+		<div class="span9">
+
+			<{if $info}>
+			<div   class="alert alert-danger alert-dismissable"><{$info}></div>
+			<{/if}>
+
+			<div id='main' class="form-actions">
+
+				<form method="post" action="" id="update_customer">
+
+					<input type="hidden" name="id" value="<{$id}>" />
+					<table class="table table-bordered" style="margin-top:15px;">
+
+						<tr>
+
+							<td>客户名</td>
+							<td>
+								<input type="text" name="username" class="form-control" style="width:450px;" value="<{$one_info.uname}>" />
+							</td>
+
+						</tr>
+
+						<tr>
+							<td>手机号</td>
+							<td>
+								<input type="text" name="tel" id="tel" class="form-control" style="width:450px;" value="<{$one_info.tel}>" />
+							</td>
+						</tr>
+
+
+						<tr>
+							<td>国家</td>
+							<td>
+								<input type="text" name="country" class="form-control" style="width:450px;" value="<{$one_info.country}>" />
+							</td>
+						</tr>
+
+						<tr>
+							<td>&nbsp;</td>
+							<td >
+								<input onclick="to_submit();" type="button" value="提交" class="btn btn-info" style="width:120px;" />
+							</td>
+						</tr>
+
+					</table>
+					<input type="hidden" name="group_name" value="<{$one_info.group_name}>">
+				</form>
+
+
+			</div>
+
+		</div>
+
+	</section><!-- /.content -->
+</aside><!-- /.right-side -->
+</div><!-- ./wrapper -->
+
+<style>
+	select{height:30px;}
+	.form-actions li{list-style:none;width:25px;float:left;padding-bottom:8px;padding-right:5px;}
+</style>
+<script>
+	$('#treeview9').addClass('active');
+	$(".customer_list_left").addClass('active');
+
+	function to_submit(){
+		var tel = $('#tel').val();
+		if(tel==''){
+			alert("手机号为必填项");
+		}else{
+			$('#update_customer').submit();
+		}
+	}
+
+</script>
+
+
+</body>
+</html>
+
+
+
+