gpt4 book ai didi

javascript - 创建新用户时,仪表板上没有任何显示

转载 作者:行者123 更新时间:2023-11-29 16:00:49 25 4
gpt4 key购买 nike

在管理面板中创建一个用户,它显示总商店、总产品等。

Image1

当我创建新用户登录时,仪表板面板上没有任何显示。没有总商店,没有总产品等等...

Image2

  <!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Dashboard
<small>Control panel</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Dashboard</li>
</ol>
</section>

<!-- Main content -->
<section class="content">
<!-- Small boxes (Stat box) -->
<?php if($is_admin == true): ?>

<div class="row">
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3><?php echo $total_products ?></h3>

<p>Total Products</p>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
<a href="<?php echo base_url('products/') ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3><?php echo $total_paid_orders ?></h3>

<p>Total Paid Orders</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
<a href="<?php echo base_url('orders/') ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3><?php echo $total_users; ?></h3>

<p>Total Users</p>
</div>
<div class="icon">
<i class="ion ion-android-people"></i>
</div>
<a href="<?php echo base_url('users/') ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3><?php echo $total_stores ?></h3>

<p>Total Stores</p>
</div>
<div class="icon">
<i class="ion ion-android-home"></i>
</div>
<a href="<?php echo base_url('stores/') ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<!-- ./col -->
</div>
<!-- /.row -->
<?php endif; ?>


</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->

<script type="text/javascript">
$(document).ready(function() {
$("#dashboardMainMenu").addClass('active');
});
</script>

这是仪表板cpanel的代码...

<小时/>

此代码用于创建新用户

  <!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Manage
<small>Users</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Users</li>
</ol>
</section>

<!-- Main content -->
<section class="content">
<!-- Small boxes (Stat box) -->
<div class="row">
<div class="col-md-12 col-xs-12">

<?php if($this->session->flashdata('success')): ?>
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<?php echo $this->session->flashdata('success'); ?>
</div>
<?php elseif($this->session->flashdata('error')): ?>
<div class="alert alert-error alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php endif; ?>

<div class="box">
<div class="box-header">
<h3 class="box-title">Add User</h3>
</div>
<form role="form" action="<?php base_url('users/create') ?>" method="post">
<div class="box-body">

<?php echo validation_errors(); ?>

<div class="form-group">
<label for="groups">Groups</label>
<select class="form-control" id="groups" name="groups">
<option value="">Select Groups</option>
<?php foreach ($group_data as $k => $v): ?>
<option value="<?php echo $v['id'] ?>"><?php echo $v['group_name'] ?></option>
<?php endforeach ?>
</select>
</div>

<div class="form-group">
<label for="username">Username</label>
<input type="text" class="form-control" id="username" name="username" placeholder="Username" autocomplete="off">
</div>

<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" id="email" name="email" placeholder="Email" autocomplete="off">
</div>

<div class="form-group">
<label for="password">Password</label>
<input type="text" class="form-control" id="password" name="password" placeholder="Password" autocomplete="off">
</div>

<div class="form-group">
<label for="cpassword">Confirm password</label>
<input type="password" class="form-control" id="cpassword" name="cpassword" placeholder="Confirm Password" autocomplete="off">
</div>

<div class="form-group">
<label for="fname">First name</label>
<input type="text" class="form-control" id="fname" name="fname" placeholder="First name" autocomplete="off">
</div>

<div class="form-group">
<label for="lname">Last name</label>
<input type="text" class="form-control" id="lname" name="lname" placeholder="Last name" autocomplete="off">
</div>

<div class="form-group">
<label for="phone">Phone</label>
<input type="text" class="form-control" id="phone" name="phone" placeholder="Phone" autocomplete="off">
</div>

<div class="form-group">
<label for="gender">Gender</label>
<div class="radio">
<label>
<input type="radio" name="gender" id="male" value="1">
Male
</label>
<label>
<input type="radio" name="gender" id="female" value="2">
Female
</label>
</div>
</div>

</div>
<!-- /.box-body -->

<div class="box-footer">
<button type="submit" class="btn btn-primary">Save Changes</button>
<a href="<?php echo base_url('users/') ?>" class="btn btn-warning">Back</a>
</div>
</form>
</div>
<!-- /.box -->
</div>
<!-- col-md-12 -->
</div>
<!-- /.row -->


</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->

<script type="text/javascript">
$(document).ready(function() {
$("#groups").select2();

$("#mainUserNav").addClass('active');
$("#createUserNav").addClass('active');

});
</script>

有人可以帮助我并告诉我问题是什么吗?

最佳答案

解决方案是删除对 <?php if($is_admin == true): ?> 的检查这将显示您想要查看的内容。

继续您在评论中所说的内容:

@RotimiBest the code is not mine, and im not to good with php thats why i asked for help... I dont know why is there is_admin

我问你这个问题是为了了解它为何存在。我猜代码的作者试图阻止那些非管理员查看商店总数、产品总数等。如果您不需要它,那么您应该删除该检查。

注意:在某些情况下,您可能需要对非管理员隐藏应用程序的某些部分,在这种情况下,if 语句会很好。要在数据库中实现此功能,您应该有一个名为 is_admin 的字段你应该将其设为 Boolean意思是 true 或 false,您可以手动设置,然后当用户登录时,您应该在从用户表返回该特定用户的整个字段时检查该字段。

如果你不熟悉php和mysql,这个解释可能没有意义,我建议你看这个tutorial 。它确实涵盖了轻松理解该语言的基础知识。

我希望这有帮助)

@rotimi_best

关于javascript - 创建新用户时,仪表板上没有任何显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56218395/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com