0
点赞
收藏
分享

微信扫一扫

学生信息表及详细信息

谷中百合517 2022-04-03 阅读 64

在这里插入图片描述
在这里插入图片描述

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body>
	<h2>详细信息</h2>
	@if(empty($item))
	没有信息
	@else

	<div>
		{{$item['xh']}}
		{{$item['xingming']}}
		{{$item['zhuanye']}}
		{{$item['banji']}}
		{{$item['xingbie']}}
	</div>
	@endif
</body>
</html>
    <div class="container">
    <div class="row">
         
     
    <table  class="table table-striped table-hover">
        <caption>学生名单</caption>
 	    <thead>
        <tr>
            <td>编号</td><td>学号</td><td>姓名</td><td>专业</td><td>班级</td><td>性别</td>
        </tr>
    </thead>
    <tbody>

    
 @foreach($student as $item)
        
        <!-- @if ($loop->index%2)
        <tr class="bgcolor">
        @else
        <tr>
        @endif -->
        
            <tr>
            <td>{{$item['id']}}</td>
            <td>{{$item['xh']}}</td>
            <td>
            <!-- href="http://www.zz.com/user/{{$item['xh']}}" 
            href="{{url('user/'.$item['xh'])}}"-->
            <a href="{{route('user.show',$item['xh'])}}" >
            {{$item['xingming']}}
            </a>
            </td>
            <td>{{$item['zhuanye']}} </td>
            <td>{{$item['banji']}} </td>
            <td>{{$item['xingbie']}}</td>
        </tr>
        
        
 			

 @endforeach 

        </tbody>
        </table> 
        </div>
 </div>
    <style type="text/css">
        .bgcolor{
          background-color:lightgreen;  
        }
    </style>
</body>
$student=Student::$stu;
        $item=null;
        foreach($student as $value){
            if ($id==$value['xh']) {
                // code...
                $item=$value;
举报

相关推荐

0 条评论