如何从Laravel中的表单的输入字段中获取所有值?

时间:2016-06-09 21:23:47

标签: php laravel-5 laravel-5.1 laravel-5.2

我正在处理每行中都有用户列表的表单。所以我想要做的是通过单击复选框向每个用户添加一封电子邮件(该部分工作正常)。但是在点击“提交我”之后获取新页面(订单摘要页面)并仅显示分配了电子邮件的用户。到目前为止,我可以向用户添加电子邮件,点击提交按钮后,我会进入订单摘要页面并显示电子邮件,但我的问题是我不知道如何显示不仅是电子邮件,还有用户的姓名和电话号码以及电子邮件。

这是我的代码:

home.blade.php

@extends( 'template' )

@section( 'content' )

{!! Form::open(array('id' => 'activateForm')) !!}

{!! csrf_field() !!}
<div>
    <div style="padding-left: 135px; width:815px;">

        @if (count($errors) > 0)
            <div class="alert alert-danger">
                <ul class="login-error-messages" style="list-style-type:disc;">
                    @foreach ($errors->all() as $error)
                        <li>{!! $error !!}</li>
                    @endforeach
                </ul>
            </div>
        @endif
    </div>
    <div class="home-rounded-border  center-content" style="width:1040px;padding-left: 30px;float:left;font-family: 'proxima-nova', sans-serif;">
        <br/>
        <table style="padding: 20px;margin-left: -15px;margin-top:-38px;display: inline-block;">
            <div style="padding:10px;">
                <tr style="font-weight: bold">
                    <td align="center">Select All</td>
                    <td width="10"></td>
                    <td valign="bottom">Join</td>
                    <td width="440" align="center" valign="bottom">Name</td>
                    <td style="margin-right:20px;float: left;">Phone # / Extension</td>
                    {{--<td width="50"></td>--}}
                    <td style="padding-left: 100px;">Email</td>
                </tr>
                <?php $usersPhoneNumber = 0;?>
                @foreach($resultArray as $key => $value)

                    @foreach($value as $key2 => $value2)
                        @if(is_array($value2))
                            @foreach($value2 as $key3 => $value3)
                                <?php
                                if (isset($value3['phoneNumber']))
                                    $usersPhoneNumber = $value3['phoneNumber'];

                                else if (isset($value3['extension']))
                                   $usersPhoneNumber = $value3['extension'];
                                ?>
                                <tr>
                                    @if($key3 == 0)
                                        <td align="center"><input type="checkbox" id="checkAll" value = ""/></td>
                                    @else
                                        <td align="center"></td>
                                    @endif
                                    <td width="10"></td>
                                    <td align="center" >
                                        <input class="input_checkbox" type="checkbox" id="{{$key3}}customer-name-checkbox" name="{{$key3}} " value="">
                                    </td>
                                    <td width="420" style="">{{$value3['firstName']}}  {{$value3['lastName']}}</td>
                                    <td style="padding: 0px;" class = "usersPhoneNumber">{{$usersPhoneNumber}}</td>

                                    <td style=""><input style="margin-left:-35px;float: right;" type="email" class="styled-text  rounded" name="{{$key3}}" id="{{$key3}}customer-name-inputField" placeholder="" value=""/><br/><br/>
                                    </td>
                                </tr>
                            @endforeach
                        @endif
                    @endforeach
                @endforeach
            </div>
        </table>
        <input type="submit" class="sign-in-button" style="text-align: center;margin-left: 365px;" value="Submit"/>

        </br>
        <div id="statusMsg" style="margin: 0px 40px 0px 40px; background-color: #ffffff;"></div>
        <ul>
            <li class="logout" style="text-align: center;padding-top: 5px; padding-right: 30px"><a href="logout"><span>Logout</span></a>
            </li>
        </ul>
    </div>
    <br/><br/>
</div>
{!! Form::close() !!}

0 个答案:

没有答案