Laravel学生信息查询界面

一、效果图

1.查询特定学生信息
在这里插入图片描述
2.全部学生表
在这里插入图片描述

代码部分

1.info.blade.php(全部学生列表)

<body>
        <div class="col-md-8">
            <h3 style="text-align: center;">学生信息</h3>
        <table class="table table-hover table2_4 " style="text-align: center;" align="center"border=0; >
        <tr>
            <th>编号</th>
            <th>学号</th>
            <th>姓名</th>
            <th>专业</th>
            <th>班级</th>
            <th>性别</th>
        </tr>  
        
        @foreach ($students as $item)
        <!-- @if ($loop->index%2)
            <tr class="table-dark" align="center" >
        @else
            <tr align="center" >
        @endif -->
        <tr align="center" >
            <td>{{$item['id']}} </td>
            <td>{{$item['xh']}} </td>    
            <td><a href="{{route('ph.show',$item['xh'])}}">{{$item['xingming']}}</a></td>    
            <td>{{$item['zhuanye']}}</td>
            <td>{{$item['banji']}}</td>
            <td>{{$item['xingbie']}}</td>
            </tr> 
        @endforeach 
       
    </table>
        </div>
    
    
   <style type="text/css">
       .bgcolor{
           background-color:lightblue ;
       }
        .table2_4 table {
	        width:100%;
	        margin:15px 0
        }
        .table2_4 th {
            background-color:lightblue;
            color:white;
        }
        .table2_4,.table2_4 th,.table2_4 td
        {
            font-size:20px;
            text-align:center;
            padding:4px;
            border:1px solid #dcf1fc;
            border-collapse:collapse
        }
        /* odd 奇数 */
        .table2_4 tr:nth-child(odd){
            background-color:#ebf7fd;
        }
        /* 偶数 */
        .table2_4 tr:nth-child(even){
            background-color:#fdfdfd;
        }
   </style>


2.detail.blade.php(查看某位学生的详细信息)

<body>
    <div class="col-md-8">
         <h1 align="center" >学生详细信息</h1>

    <table class="table table-hover table2" >
        <caption>信息学院</caption>
        <tr>
            <th>学号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年级</th>
            <th>专业</th>
            <th>班级</th>
            <th>教育方式</th>
        </tr>
        <tr >
            @if (empty($stu))
             <h2 style="color: red;" align="center">!!!没有该学生信息</h2>
            @else

            <td >{{$stu['xh']}} </td>
            <td>{{$stu['xingming']}}</td>
            <td>{{$stu['xingbie']}}</td>
            <td>{{$stu['nianji']}}</td>
            <td>{{$stu['zhuanye']}}</td>
            <td>{{$stu['banji']}}</td>
            <td>{{$stu['xuexixingshi']}}</td>
            @endif
        </tr>
    </table>

    </div>
     <style type="text/css">
        .table2 th {
            background-color:lightblue;
            color:white;
        }
        .table2 td{
            background-color: #ebf7fd;
        }
       
   
    </style>

</body>

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值