Browse Source

kuaidi

master
ZLW-PC\Administrator 7 years ago
parent
commit
6e3a61620f
  1. 92
      app/Http/Controllers/Admin/BonusController.php
  2. 92
      app/Http/Controllers/Admin/KuaidiController.php
  3. 32
      app/Http/Controllers/Admin/UserController.php
  4. 12
      app/Http/Controllers/Admin/UserRankController.php
  5. 30
      app/Http/Model/Kuaidi.php
  6. 79
      resources/views/admin/bonus/add.blade.php
  7. 79
      resources/views/admin/bonus/edit.blade.php
  8. 36
      resources/views/admin/bonus/index.blade.php
  9. 79
      resources/views/admin/kuaidi/add.blade.php
  10. 79
      resources/views/admin/kuaidi/edit.blade.php
  11. 36
      resources/views/admin/kuaidi/index.blade.php
  12. 44
      resources/views/admin/user/add.blade.php
  13. 75
      resources/views/admin/userrank/add.blade.php
  14. 75
      resources/views/admin/userrank/edit.blade.php
  15. 13
      routes/web.php

92
app/Http/Controllers/Admin/BonusController.php

@ -0,0 +1,92 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
use App\Http\Model\Bonus;
use App\Common\Helper;
class BonusController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['posts'] = parent::pageList('bonus', '', [['status', 'asc'], ['listorder', 'asc']]);
if($data['posts'])
{
foreach($data['posts'] as $k=>$v)
{
$data['posts'][$k]->status_text = Bonus::getStatusText(array('status'=>$v->status));
}
}
return view('admin.bonus.index', $data);
}
public function add()
{
if(Helper::isPostRequest())
{
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if(DB::table('bonus')->insert(array_filter($_POST)))
{
success_jump('添加成功!', route('admin_bonus'));
}
else
{
error_jump('添加失败!请修改后重新添加');
}
}
return view('admin.bonus.add');
}
public function edit()
{
if(Helper::isPostRequest())
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if(DB::table('bonus')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_bonus'));
}
else
{
error_jump('修改失败!');
}
}
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";}
if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['id'] = $id;
$data['post'] = object_to_array(DB::table('bonus')->where('id', $id)->first(), 1);
return view('admin.bonus.edit', $data);
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table('bonus')->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump('删除失败!请重新提交');
}
}
}

92
app/Http/Controllers/Admin/KuaidiController.php

@ -0,0 +1,92 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Admin\CommonController;
use DB;
use App\Http\Model\Kuaidi;
use App\Common\Helper;
class KuaidiController extends CommonController
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['posts'] = parent::pageList('kuaidi', '', [['status', 'asc'], ['listorder', 'asc']]);
if($data['posts'])
{
foreach($data['posts'] as $k=>$v)
{
$data['posts'][$k]->status_text = Kuaidi::getStatusText(array('status'=>$v->status));
}
}
return view('admin.kuaidi.index', $data);
}
public function add()
{
if(Helper::isPostRequest())
{
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if(DB::table('kuaidi')->insert(array_filter($_POST)))
{
success_jump('添加成功!', route('admin_kuaidi'));
}
else
{
error_jump('添加失败!请修改后重新添加');
}
}
return view('admin.kuaidi.add');
}
public function edit()
{
if(Helper::isPostRequest())
{
if(!empty($_POST["id"])){$id = $_POST["id"];unset($_POST["id"]);}else{$id="";exit;}
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if(DB::table('kuaidi')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_kuaidi'));
}
else
{
error_jump('修改失败!');
}
}
if(!empty($_GET["id"])){$id = $_GET["id"];}else{$id="";}
if(preg_match('/[0-9]*/',$id)){}else{exit;}
$data['id'] = $id;
$data['post'] = object_to_array(DB::table('kuaidi')->where('id', $id)->first(), 1);
return view('admin.kuaidi.edit', $data);
}
public function del()
{
if(!empty($_GET["id"])){$id = $_GET["id"];}else{error_jump('删除失败!请重新提交');}
if(DB::table('kuaidi')->whereIn("id", explode(',', $id))->delete())
{
success_jump('删除成功');
}
else
{
error_jump('删除失败!请重新提交');
}
}
}

32
app/Http/Controllers/Admin/UserController.php

@ -93,20 +93,28 @@ class UserController extends CommonController
public function add()
{
return view('admin.user.add');
}
public function doadd()
{
unset($_POST["_token"]);
if(DB::table('user')->insert($_POST))
if(Helper::isPostRequest())
{
success_jump('添加成功!', route('admin_user'));
unset($_POST["_token"]);
if(DB::table('user')->where('user_name', $_POST["user_name"])->first()){error_jump('用户名已经存在');}
if(DB::table('user')->where('mobile', $_POST["mobile"])->first()){error_jump('手机号已经存在');}
$_POST['password'] = md5($_POST['password']);
$_POST['add_time'] = time();
if(DB::table('user')->insert($_POST))
{
success_jump('添加成功!', route('admin_user'));
}
else
{
error_jump('添加失败!请修改后重新添加');
}
}
else
{
error_jump('添加失败!请修改后重新添加');
}
$data['user_rank'] = DB::table('user_rank')->orderBy('rank', 'asc')->get();
return view('admin.user.add',$data);
}
public function edit()

12
app/Http/Controllers/Admin/UserRankController.php

@ -35,9 +35,12 @@ class UserRankController extends CommonController
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if(DB::table('user_rank')->where('rank', $_POST["rank"])->first()){error_jump('等级已经存在');}
if(DB::table('user_rank')->where('title', $_POST["title"])->first()){error_jump('等级名称已经存在');}
if(DB::table('user_rank')->insert(array_filter($_POST)))
{
success_jump('添加成功!', route('admin_slide'));
success_jump('添加成功!', route('admin_userrank'));
}
else
{
@ -57,9 +60,12 @@ class UserRankController extends CommonController
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if(DB::table('user_rank')->where('id', $id)->update($_POST))
if(DB::table('user_rank')->where(['rank'=>$_POST["rank"],'id'=>['<>',$id]])->first()){error_jump('等级已经存在');}
if(DB::table('user_rank')->where(['title'=>$_POST["title"],'id'=>['<>',$id]])->first()){error_jump('等级名称已经存在');}
if(DB::table('user_rank')->where('id', $id)->update($_POST) !== false)
{
success_jump('修改成功!', route('admin_slide'));
success_jump('修改成功!', route('admin_userrank'));
}
else
{

30
app/Http/Model/Kuaidi.php

@ -0,0 +1,30 @@
<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
use DB;
class Kuaidi extends Model
{
//轮播图
protected $table = 'kuaidi';
public $timestamps = false;
protected $guarded = []; //$guarded包含你不想被赋值的字段数组。
//获取是否显示文字:0显示,1不显示
public static function getStatusText($where)
{
$res = '';
if($where['status'] === 0)
{
$res = '显示';
}
elseif($where['status'] === 1)
{
$res = '不显示';
}
return $res;
}
}

79
resources/views/admin/bonus/add.blade.php

@ -0,0 +1,79 @@
@extends('admin.layouts.app')
@section('title', '快递添加')
@section('content')
<h5 class="sub-header"><a href="<?php echo route('admin_kuaidi'); ?>">快递列表</a> > 添加快递</h5>
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right" width="150px">快递名称:</td>
<td><input name="name" type="text" id="name" value="" class="required" style="width:30%" placeholder="在此输入关键词"></td>
</tr>
<tr>
<td align="right">编码:</td>
<td><input name="code" type="text" id="code" value="" size="15" class="required"></td>
</tr>
<tr>
<td align="right">金额:</td>
<td><input name="money" type="text" id="money" value="0" size="10"></td>
</tr>
<tr>
<td align="right">说明:</td>
<td><input name="des" type="text" id="des" value="" style="width:60%"></td>
</tr>
<tr>
<td align="right">电话:</td>
<td><input name="tel" type="text" id="tel" value="" size="15"></td>
</tr>
<tr>
<td align="right">官网:</td>
<td><input name="website" type="text" id="website" value="" size="30"></td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td>
<input type="radio" value='0' name="status" checked />&nbsp;&nbsp;&nbsp;
<input type="radio" value='1' name="status" />&nbsp;
</td>
</tr>
<tr>
<td align="right">排序:</td>
<td>
<input name="listorder" type="text" id="listorder" value="50" size="3" />
</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
</tr>
</tbody></table></form><!-- 表单结束 -->
<script>
$(function(){
$(".required").blur(function(){
var $parent = $(this).parent();
$parent.find(".formtips").remove();
if(this.value=="")
{
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
});
//重置
$('#addarc input[type="reset"]').click(function(){
$(".formtips").remove();
});
$("#addarc").submit(function(){
$(".required").trigger('blur');
var numError = $('#addarc .onError').length;
if(numError){return false;}
});
});
</script>
@endsection

79
resources/views/admin/bonus/edit.blade.php

@ -0,0 +1,79 @@
@extends('admin.layouts.app')
@section('title', '快递修改')
@section('content')
<h5 class="sub-header"><a href="<?php echo route('admin_kuaidi'); ?>">快递列表</a> > 快递修改</h5>
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right" width="150px">快递名称:</td>
<td><input name="name" type="text" id="name" value="<?php echo $post['name']; ?>" class="required" style="width:30%" placeholder="在此输入关键词"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td align="right">编码:</td>
<td><input name="code" type="text" id="code" value="<?php echo $post['code']; ?>" size="15" class="required"></td>
</tr>
<tr>
<td align="right">金额:</td>
<td><input name="money" type="text" id="money" value="<?php echo $post['money']; ?>" size="10"></td>
</tr>
<tr>
<td align="right">说明:</td>
<td><input name="des" type="text" id="des" value="<?php echo $post['des']; ?>" style="width:60%"></td>
</tr>
<tr>
<td align="right">电话:</td>
<td><input name="tel" type="text" id="tel" value="<?php echo $post['tel']; ?>" size="15"></td>
</tr>
<tr>
<td align="right">官网:</td>
<td><input name="website" type="text" id="website" value="<?php echo $post['website']; ?>" size="30"></td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td>
<input type="radio" value='0' name="status" <?php if(isset($post['status']) && $post['status']==0){echo 'checked';} ?> />&nbsp;是&nbsp;&nbsp;
<input type="radio" value='1' name="status" <?php if(isset($post['status']) && $post['status']==1){echo 'checked';} ?> />&nbsp;否
</td>
</tr>
<tr>
<td align="right">排序:</td>
<td>
<input name="listorder" type="text" id="listorder" value="<?php echo $post['listorder']; ?>" size="3" />
</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
</tr>
</tbody></table></form><!-- 表单结束 -->
<script>
$(function(){
$(".required").blur(function(){
var $parent = $(this).parent();
$parent.find(".formtips").remove();
if(this.value=="")
{
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
});
//重置
$('#addarc input[type="reset"]').click(function(){
$(".formtips").remove();
});
$("#addarc").submit(function(){
$(".required").trigger('blur');
var numError = $('#addarc .onError').length;
if(numError){return false;}
});
});
</script>
@endsection

36
resources/views/admin/bonus/index.blade.php

@ -0,0 +1,36 @@
@extends('admin.layouts.app')
@section('title', '快递列表')
@section('content')
<h2 class="sub-header">快递管理</h2>[ <a href="<?php echo route('admin_kuaidi_add'); ?>">添加快递</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-hover">
<thead><tr class="info">
<th>ID</th>
<th>快递名称</th>
<th>编码</th>
<th>金额</th>
<th>说明</th>
<th>电话</th>
<th>官网</th>
<th>排序</th>
<th>是否显示</th>
<th>管理</th>
</tr></thead>
<tbody>
<?php if($posts){foreach($posts as $row){ ?><tr>
<td><?php echo $row->id; ?></td>
<td><?php echo $row->name; ?></td>
<td><?php echo $row->code; ?></td>
<td><?php echo $row->money; ?></td>
<td><?php echo $row->des; ?></td>
<td><?php echo $row->tel; ?></td>
<td><?php echo $row->website; ?></td>
<td><?php echo $row->listorder; ?></td>
<td><?php if($row->status==0){echo "";}else{echo "<font color=red>否</font>";} ?></td>
<td><a href="<?php echo route('admin_kuaidi_edit',array('id'=>$row->id)); ?>">修改</a> | <a onclick="delconfirm('<?php echo route('admin_kuaidi_del',array('id'=>$row->id)); ?>')" href="javascript:;">删除</a></td>
</tr><?php }} ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
<nav aria-label="Page navigation">{{ $posts->links() }}</nav>
@endsection

79
resources/views/admin/kuaidi/add.blade.php

@ -0,0 +1,79 @@
@extends('admin.layouts.app')
@section('title', '快递添加')
@section('content')
<h5 class="sub-header"><a href="<?php echo route('admin_kuaidi'); ?>">快递列表</a> > 添加快递</h5>
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right" width="150px">快递名称:</td>
<td><input name="name" type="text" id="name" value="" class="required" style="width:30%" placeholder="在此输入关键词"></td>
</tr>
<tr>
<td align="right">编码:</td>
<td><input name="code" type="text" id="code" value="" size="15" class="required"></td>
</tr>
<tr>
<td align="right">金额:</td>
<td><input name="money" type="text" id="money" value="0" size="10"></td>
</tr>
<tr>
<td align="right">说明:</td>
<td><input name="des" type="text" id="des" value="" style="width:60%"></td>
</tr>
<tr>
<td align="right">电话:</td>
<td><input name="tel" type="text" id="tel" value="" size="15"></td>
</tr>
<tr>
<td align="right">官网:</td>
<td><input name="website" type="text" id="website" value="" size="30"></td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td>
<input type="radio" value='0' name="status" checked />&nbsp;&nbsp;&nbsp;
<input type="radio" value='1' name="status" />&nbsp;
</td>
</tr>
<tr>
<td align="right">排序:</td>
<td>
<input name="listorder" type="text" id="listorder" value="50" size="3" />
</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
</tr>
</tbody></table></form><!-- 表单结束 -->
<script>
$(function(){
$(".required").blur(function(){
var $parent = $(this).parent();
$parent.find(".formtips").remove();
if(this.value=="")
{
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
});
//重置
$('#addarc input[type="reset"]').click(function(){
$(".formtips").remove();
});
$("#addarc").submit(function(){
$(".required").trigger('blur');
var numError = $('#addarc .onError').length;
if(numError){return false;}
});
});
</script>
@endsection

79
resources/views/admin/kuaidi/edit.blade.php

@ -0,0 +1,79 @@
@extends('admin.layouts.app')
@section('title', '快递修改')
@section('content')
<h5 class="sub-header"><a href="<?php echo route('admin_kuaidi'); ?>">快递列表</a> > 快递修改</h5>
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right" width="150px">快递名称:</td>
<td><input name="name" type="text" id="name" value="<?php echo $post['name']; ?>" class="required" style="width:30%" placeholder="在此输入关键词"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td align="right">编码:</td>
<td><input name="code" type="text" id="code" value="<?php echo $post['code']; ?>" size="15" class="required"></td>
</tr>
<tr>
<td align="right">金额:</td>
<td><input name="money" type="text" id="money" value="<?php echo $post['money']; ?>" size="10"></td>
</tr>
<tr>
<td align="right">说明:</td>
<td><input name="des" type="text" id="des" value="<?php echo $post['des']; ?>" style="width:60%"></td>
</tr>
<tr>
<td align="right">电话:</td>
<td><input name="tel" type="text" id="tel" value="<?php echo $post['tel']; ?>" size="15"></td>
</tr>
<tr>
<td align="right">官网:</td>
<td><input name="website" type="text" id="website" value="<?php echo $post['website']; ?>" size="30"></td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td>
<input type="radio" value='0' name="status" <?php if(isset($post['status']) && $post['status']==0){echo 'checked';} ?> />&nbsp;是&nbsp;&nbsp;
<input type="radio" value='1' name="status" <?php if(isset($post['status']) && $post['status']==1){echo 'checked';} ?> />&nbsp;否
</td>
</tr>
<tr>
<td align="right">排序:</td>
<td>
<input name="listorder" type="text" id="listorder" value="<?php echo $post['listorder']; ?>" size="3" />
</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
</tr>
</tbody></table></form><!-- 表单结束 -->
<script>
$(function(){
$(".required").blur(function(){
var $parent = $(this).parent();
$parent.find(".formtips").remove();
if(this.value=="")
{
$parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
}
else
{
$parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
}
});
//重置
$('#addarc input[type="reset"]').click(function(){
$(".formtips").remove();
});
$("#addarc").submit(function(){
$(".required").trigger('blur');
var numError = $('#addarc .onError').length;
if(numError){return false;}
});
});
</script>
@endsection

36
resources/views/admin/kuaidi/index.blade.php

@ -0,0 +1,36 @@
@extends('admin.layouts.app')
@section('title', '快递列表')
@section('content')
<h2 class="sub-header">快递管理</h2>[ <a href="<?php echo route('admin_kuaidi_add'); ?>">添加快递</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-hover">
<thead><tr class="info">
<th>ID</th>
<th>快递名称</th>
<th>编码</th>
<th>金额</th>
<th>说明</th>
<th>电话</th>
<th>官网</th>
<th>排序</th>
<th>是否显示</th>
<th>管理</th>
</tr></thead>
<tbody>
<?php if($posts){foreach($posts as $row){ ?><tr>
<td><?php echo $row->id; ?></td>
<td><?php echo $row->name; ?></td>
<td><?php echo $row->code; ?></td>
<td><?php echo $row->money; ?></td>
<td><?php echo $row->des; ?></td>
<td><?php echo $row->tel; ?></td>
<td><?php echo $row->website; ?></td>
<td><?php echo $row->listorder; ?></td>
<td><?php if($row->status==0){echo "";}else{echo "<font color=red>否</font>";} ?></td>
<td><a href="<?php echo route('admin_kuaidi_edit',array('id'=>$row->id)); ?>">修改</a> | <a onclick="delconfirm('<?php echo route('admin_kuaidi_del',array('id'=>$row->id)); ?>')" href="javascript:;">删除</a></td>
</tr><?php }} ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->
<nav aria-label="Page navigation">{{ $posts->links() }}</nav>
@endsection

44
resources/views/admin/user/add.blade.php

@ -1,34 +1,52 @@
@extends('admin.layouts.app')
@section('title', '管理员添加')
@section('title', '员添加')
@section('content')
<h5 class="sub-header"><a href="<?php echo route('admin_admin'); ?>">管理员列表</a> > 管理员添加</h5>
<h5 class="sub-header"><a href="<?php echo route('admin_user'); ?>">员列表</a> > 员添加</h5>
<form id="addarc" method="post" action="<?php echo route('admin_admin_doadd'); ?>" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">用户名:</td>
<td><input name="username" type="text" id="username" value="" class="required" style="width:30%" placeholder="在此输入用户名"></td>
<td align="right" width="150px">用户名:</td>
<td><input name="user_name" type="text" id="user_name" value="" class="required" size="15" placeholder="在此输入用户名"></td>
</tr>
<tr>
<td align="right">手机号:</td>
<td><input name="mobile" type="text" id="mobile" value="" class="required" size="15" placeholder="在此输入手机号"></td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input name="pwd" type="password" id="pwd" value="" class="required" style="width:60%"></td>
<td><input name="password" type="password" id="password" value="" class="required" size="30"></td>
</tr>
<tr>
<td align="right">邮箱:</td>
<td><input name="email" type="text" id="email" value="" style="width:60%"></td>
<td align="right">金额</td>
<td><input name="money" type="text" id="money" value="0" size="6"></td>
</tr>
<tr>
<td align="right">角色</td>
<td align="right">性别</td>
<td>
<select name="role_id" id="role_id">
<?php if($rolelist){foreach($rolelist as $row){ ?>
<option value="<?php echo $row["id"]; ?>"><?php echo $row["name"]; ?></option>
<?php }} ?>
<select name="sex" id="sex">
<option selected value="1"></option>
<option value="2"></option>
</select>
</td>
</tr>
<tr>
<td align="right">会员等级:</td>
<td>
<select name="user_rank" id="user_rank">
<option selected value="0">请选择</option>
<?php if($user_rank){foreach($user_rank as $k=>$v){ ?>
<option value="<?php echo $v->rank; ?>"><?php echo $v->title; ?></option>
<?php }} ?>
</select>
</td>
</tr>
<tr>
<td align="right">父级id</td>
<td><input name="parent_id" type="text" id="parent_id" value="0" size="3"></td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td>
</tr>

75
resources/views/admin/userrank/add.blade.php

@ -1,42 +1,19 @@
@extends('admin.layouts.app')
@section('title', '轮播图添加')
@section('title', '会员等级添加')
@section('content')
<h5 class="sub-header"><a href="/fladmin/slide">轮播图列表</a> > 添加轮播图</h5>
<h5 class="sub-header"><a href="<?php echo route('admin_userrank'); ?>">会员等级列表</a> > 添加会员等级</h5>
<form id="addarc" method="post" action="/fladmin/slide/doadd" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">标题</td>
<td align="right">等级名称</td>
<td><input name="title" type="text" id="title" value="" class="required" style="width:30%" placeholder="在此输入关键词"></td>
</tr>
<tr>
<td align="right">链接网址:</td>
<td><input name="url" type="text" id="url" value="http://" style="width:60%" class="required"> (请用绝对地址)</td>
</tr>
<tr>
<td align="right">跳转方式:</td>
<td>
<input type="radio" value='0' name="target" checked />&nbsp;_blank&nbsp;&nbsp;
<input type="radio" value='1' name="target" />&nbsp;_self
</td>
</tr>
<tr>
<td align="right">显示平台:</td>
<td>
<input type="radio" value='0' name="type" checked />&nbsp;pc&nbsp;&nbsp;
<input type="radio" value='1' name="type" />&nbsp;weixin&nbsp;&nbsp;
<input type="radio" value='2' name="type" />&nbsp;app&nbsp;&nbsp;
<input type="radio" value='3' name="type" />&nbsp;wap
</td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td>
<input type="radio" value='0' name="is_show" checked />&nbsp;&nbsp;&nbsp;
<input type="radio" value='1' name="is_show" />&nbsp;
</td>
<td align="right">等级:</td>
<td><input name="rank" type="text" id="rank" value="" size="3" class="required"></td>
</tr>
<tr>
<td align="right">排序:</td>
@ -44,46 +21,6 @@
<input name="listorder" type="text" id="listorder" value="50" size="3" />
</td>
</tr>
<tr>
<td align="right">所属的组:</td>
<td>
<input name="group_id" type="text" id="group_id" value="0" size="3" />
</td>
</tr>
<tr>
<td style="vertical-align:middle;" align="right">图片:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input class="required" name="pic" type="text" id="pic" value="" style="width:40%"> <img style="margin-left:20px;display:none;" src="" width="120" height="80" id="picview"></td>
</tr>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#pic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
</tr>

75
resources/views/admin/userrank/edit.blade.php

@ -1,42 +1,19 @@
@extends('admin.layouts.app')
@section('title', '轮播图修改')
@section('title', '会员等级修改')
@section('content')
<h5 class="sub-header"><a href="/fladmin/slide">轮播图列表</a> > 轮播图修改</h5>
<h5 class="sub-header"><a href="<?php echo route('admin_userrank'); ?>">会员等级列表</a> > 会员等级修改</h5>
<form id="addarc" method="post" action="/fladmin/slide/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right">标题</td>
<td align="right" width="150px;">等级名称</td>
<td><input name="title" type="text" id="title" value="<?php echo $post['title']; ?>" class="required" style="width:30%" placeholder="在此输入关键词"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td align="right">链接网址:</td>
<td><input name="url" type="text" id="url" value="<?php echo $post['url']; ?>" style="width:60%" class="required"> (请用绝对地址)</td>
</tr>
<tr>
<td align="right">跳转方式:</td>
<td>
<input type="radio" value='0' name="target" <?php if(isset($post['target']) && $post['target']==0){echo 'checked';} ?> />&nbsp;_blank&nbsp;&nbsp;
<input type="radio" value='1' name="target" <?php if(isset($post['target']) && $post['target']==1){echo 'checked';} ?> />&nbsp;_self
</td>
</tr>
<tr>
<td align="right">显示平台:</td>
<td>
<input type="radio" value='0' name="type" <?php if(isset($post['type']) && $post['type']==0){echo 'checked';} ?> />&nbsp;pc&nbsp;&nbsp;
<input type="radio" value='1' name="type" <?php if(isset($post['type']) && $post['type']==1){echo 'checked';} ?> />&nbsp;weixin&nbsp;&nbsp;
<input type="radio" value='2' name="type" <?php if(isset($post['type']) && $post['type']==2){echo 'checked';} ?> />&nbsp;app&nbsp;&nbsp;
<input type="radio" value='3' name="type" <?php if(isset($post['type']) && $post['type']==3){echo 'checked';} ?> />&nbsp;wap
</td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td>
<input type="radio" value='0' name="is_show" <?php if(isset($post['is_show']) && $post['is_show']==0){echo 'checked';} ?> />&nbsp;是&nbsp;&nbsp;
<input type="radio" value='1' name="is_show" <?php if(isset($post['is_show']) && $post['is_show']==1){echo 'checked';} ?> />&nbsp;否
</td>
<td align="right">等级:</td>
<td><input name="rank" type="text" id="rank" value="<?php echo $post['rank']; ?>" size="3" class="required"></td>
</tr>
<tr>
<td align="right">排序:</td>
@ -44,46 +21,6 @@
<input name="listorder" type="text" id="listorder" value="<?php echo $post['listorder']; ?>" size="3" />
</td>
</tr>
<tr>
<td align="right">所属的组:</td>
<td>
<input name="group_id" type="text" id="group_id" value="<?php echo $post['group_id']; ?>" size="3" />
</td>
</tr>
<tr>
<td style="vertical-align:middle;" align="right">图片:</td>
<td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="pic" type="text" id="pic" value="<?php echo $post['pic']; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["pic"]) || !imgmatch($post["pic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["pic"])){echo $post["pic"];} ?>" width="120" height="80" id="picview"></td>
</tr>
<!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.js"></script>
<script type="text/javascript">
var _editor;
$(function() {
//重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
_editor = UE.getEditor('ueditorimg');
_editor.ready(function () {
//设置编辑器不可用
_editor.setDisabled('insertimage');
//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
_editor.hide();
//侦听图片上传
_editor.addListener('beforeInsertImage', function (t, arg) {
//将地址赋值给相应的input,只取第一张图片的路径
$('#pic').val(arg[0].src);
//图片预览
$('#picview').attr("src",arg[0].src).css("display","inline-block");
})
});
});
//弹出图片上传的对话框
function upImage()
{
var myImage = _editor.getDialog("insertimage");
myImage.render();
myImage.open();
}
</script>
<script type="text/plain" id="ueditorimg"></script>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
</tr>

13
routes/web.php

@ -301,6 +301,16 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w
Route::get('/order/edit', 'OrderController@edit')->name('admin_order_edit');
Route::post('/order/doedit', 'OrderController@doedit')->name('admin_order_doedit');
Route::get('/order/del', 'OrderController@del')->name('admin_order_del');
//快递管理
Route::get('/kuaidi', 'KuaidiController@index')->name('admin_kuaidi');
Route::any('/kuaidi/add', 'KuaidiController@add')->name('admin_kuaidi_add');
Route::any('/kuaidi/edit', 'KuaidiController@edit')->name('admin_kuaidi_edit');
Route::get('/kuaidi/del', 'KuaidiController@del')->name('admin_kuaidi_del');
//优惠券管理
Route::get('/bonus', 'BonusController@index')->name('admin_bonus');
Route::any('/bonus/add', 'BonusController@add')->name('admin_bonus_add');
Route::any('/bonus/edit', 'BonusController@edit')->name('admin_bonus_edit');
Route::get('/bonus/del', 'BonusController@del')->name('admin_bonus_del');
//商品品牌
Route::get('/goodsbrand', 'GoodsBrandController@index')->name('admin_goodsbrand');
Route::get('/goodsbrand/add', 'GoodsBrandController@add')->name('admin_goodsbrand_add');
@ -355,8 +365,7 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w
Route::get('/feedback/del', 'FeedbackController@del')->name('admin_feedback_del');
//会员管理
Route::get('/user', 'UserController@index')->name('admin_user');
Route::get('/user/add', 'UserController@add')->name('admin_user_add');
Route::post('/user/doadd', 'UserController@doadd')->name('admin_user_doadd');
Route::any('/user/add', 'UserController@add')->name('admin_user_add');
Route::any('/user/edit', 'UserController@edit')->name('admin_user_edit');
Route::get('/user/del', 'UserController@del')->name('admin_user_del');
Route::get('/user/money', 'UserController@money')->name('admin_user_money'); //会员账户记录

Loading…
Cancel
Save