@extends ('layouts.patient')
@section('inner-content')
    <div class="">
        <div class="d-flex align-items-center pb-2">
            <h4 class="font-weight-bold m-0">SMS Messages</h4>
            <span class="mx-2 text-secondary">|</span>
            <div moe>
                <a start show class="">Send SMS</a>
                <form url="/api/clientSms/createOutgoing" class="mcp-theme-1">
                    <input type="hidden" name="uid" value="{{ $patient->uid }}">
                    <div class="mb-2">
                        <label for="" class="text-sm text-secondary mb-1">Cell Number</label>
                        <input type="text" class="form-control form-control-sm" name="cellNumber" value="{{$patient->cell_number}}">
                    </div>
                    <div class="mb-2">
                        <label for="" class="text-sm text-secondary mb-1">Message</label>
                        <textarea type="text" class="form-control form-control-sm" name="message"></textarea>
                    </div>
                    <div class="d-flex align-items-center">
                        <button class="btn btn-sm btn-primary mr-2" submit>Send</button>
                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
                    </div>
                </form>
            </div>
        </div>
        <table class="table table-striped table-sm table-bordered">
            <thead>
            <tr>
                <th class="px-2 text-secondary">Date &amp; Time</th>
                <th class="px-2 text-secondary w-25">Type</th>
                <th class="px-2 text-secondary w-25">From</th>
                <th class="px-2 text-secondary w-25">To</th>
                <th class="px-2 text-secondary w-50">Content</th>
            </tr>
            </thead>
            <tbody>
            @foreach($patient->smses as $sms)
                <tr>
                    <td class="px-2">{{ friendly_date_time($sms->created_at) }}</td>
                    <td class="px-2">{{ ucwords($sms->incoming_or_outgoing) }}</td>
                    <td class="px-2">{{ $sms->from_number }}</td>
                    <td class="px-2">{{ $sms->to_number }}</td>
                    <td class="px-2">{{ $sms->body }}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
@endsection
