jeudi 2 juin 2016

Using laravel to display information meant for a particluar user on his dashboard

i have an application that has administrator and users account( e.g nurse, doctor) e.t.c. if a nurse books an appointment for a a particular doctor i want it to display a list of all the appointments in the doctor dashboard anytime the doctor logs into his account using laravel. i have no idea of how to go about it and the nurse and the doctor both have their different dashboards.

The appointment database contains the doctor_id, patient_id and appointment_date as below

  <form method="POST" action="">

                            <input type="hidden" name="_token" value="">

                            <div class="row">
                            <div class="form-group ">
                                <label for="lastname" class="col-md-3 control-label">Select a Patient</label>
                                <select class="form-control" name="patient_id"  >
                                    <option value="">Select </option>

                                    @if(isset($patients))
                                        @foreach($patients as $pat)
                                            <option value=" @if (request('pat') == $pat->name) selected='selected' @endif ">-  </option>
                                        @endforeach
                                    @endif
                                </select>
                                @if ($errors->has('patient_id'))
                                    <span class="help-block">
                                    <strong></strong>
                                </span>
                                @endif
                            </div>
                            </div>

                            <div class="form-group ">
                                <br>
                                <label for="lastname" class="col-md-3 control-label">Select a Doctor</label>
                            <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
                                <thead >
                                <tr >
                                    
                                        
                                    
                                    <th>
                                        Picture
                                    </th>

                                    <th style="text-align: center;">
                                        Name
                                    </th>

                                    <th style="text-align: center;">
                                        Specialization
                                    </th>

                                    <th  style="text-align: center;">
                                        Phone Number
                                    </th>

                                    <th  style="text-align: center;">
                                        Status
                                    </th>


                                    <th style="text-align: center;">
                                        Book
                                    </th>
                                    
                                    
                                    

                                </tr>
                                </thead>
                                <tbody>
                                <?php $c=0;?>
                                @foreach($doctors as $dr)
                                    <tr style="padding: 10px; text-align: center;">
                                        </td>--}}
                                        <td>
                                            <img src='' style="height:40px; width:40px;" class="img-circle">
                                        </td>
                                        <td style="padding: 20px;"></td>
                                        <td style="padding: 20px; "></td>
                                        <td style="padding: 20px;"></td>
                                        <td style="padding: 20px;" >
                                              --}}
                                            <span class=" alert- lg "></span>
                                        </td>
                                        <td style="padding: 20px;" class="">
                                            <input type="radio" name="doctor_id" value="">

                                            " class=" btn-warning  ">Book</a>--}}
                                            " class="btn btn-danger xs">Delete</a>--}}
                                        </td>
                                        
                                    </tr>
                                @endforeach


                                </tbody>
                            </table>
                            </div>


                            <div class="row">
                                <div class="form-group ">
                                    <label for="lastname" class="col-md-2 control-label">Birth Date</label>
                                    <input type="date" class="form-control" name="appointment_date" value="" placeholder="Birth Date" >
                                    @if ($errors->has('appointment_date'))
                                        <span class="help-block">
                                    <strong></strong>
                                </span>
                                    @endif
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-12">
                            <div class="form-group">
                                <button type="submit" class="btn btn-primary">Book a Doctor</button>
                            </div>
                                </div>
                            </div>
                        </form>

it works properly but i don't know how to collect the specific's doctors id and put the appointment infirmation on his dashboard so once he logs in he will see it



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire