Files
streamline-emr/docker/_streamline-src/resources/views/sms/send_sms.blade.php
T

199 lines
8.2 KiB
PHP
Executable File

@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">Send SMS</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li><a class="active"> SMS</a></li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['route' => 'sms.send_sms']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
{{ Form::label("sms_option", "SMS Option") }}
{{ Form::select("sms_option", $sms_group, '', ['class' => 'form-control', 'id' => 'sms_option']) }}
</div>
</div>
<div class="col-md-3" id="option_grouping" style="display: none">
<div class="form-group">
{{ Form::label("option_grouping", "Option Grouping") }}
{{ Form::select("patient_groups", $patient_groups, '', ['class' => 'form-control', 'id' => 'patient_groups', 'style' => 'display:none']) }}
{{ Form::select("user_groups", $user_groups, '', ['class' => 'form-control', 'id' => 'user_groups', 'style' => 'display:none']) }}
</div>
</div>
<div class="col-md-3" id="option_search" style="display: none">
<div class="form-group">
{{ Form::label("option_search", "Option Search") }}
{{ Form::select("patient_groups_search", $patient_categories, '', ['class' => 'form-control', 'id' => 'patient_groups_search', 'style' => 'display:none']) }}
{{ Form::select("user_position_search", $user_positions, '', ['class' => 'form-control', 'id' => 'user_position_search', 'style' => 'display:none']) }}
</div>
</div>
<div class="col-md-3">
<br>
{{ Form::submit('Submit', ['class' => 'btn btn-success']) }}
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
<h3><span class="label label-info">{{ $search_text }}</span></h3>
{{ Form::open(['route' => 'sms.process_sms']) }}
{{ Form::hidden('selected_send_option', $selected_send_option) }}
@if($selected_send_option == 1 || $selected_send_option == 2)
{{ Form::hidden('valid_patients', json_encode($valid_patients)) }}
{{ Form::hidden('category_position_id', $category_position_id) }}
<div class="row">
<div class="col-md-6">
<table class="table table-bordered">
<tr>
<td><b>Total number of patients</b></td>
<td>{{ $total_patients_no }}</td>
</tr>
</table>
</div>
<div class="col-md-6">
<table class="table table-bordered">
<tr>
<td><b>Number of patients with valid contacts</b></td>
<td>{{ count($valid_patients) }}</td>
</tr>
</table>
</div>
</div>
<br>
@if(count($valid_patients) > 0)
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('sms_message', 'SMS Message') }}
{{ Form::textarea('sms_message', '', ['class' => 'form-control', 'rows' => '3', 'required']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('comment', 'Comment') }}
{{ Form::textarea('comment', '', ['class' => 'form-control', 'rows' => '3']) }}
</div>
</div>
</div>
@endif
@endif
@if($selected_send_option == 3 || $selected_send_option == 4)
{{ Form::hidden('valid_users', json_encode($valid_users)) }}
{{ Form::hidden('category_position_id', $category_position_id) }}
<div class="row">
<div class="col-md-6">
<table class="table table-bordered">
<tr>
<td><b>Total number of staff</b></td>
<td>{{ $total_users_no }}</td>
</tr>
</table>
</div>
<div class="col-md-6">
<table class="table table-bordered">
<tr>
<td><b>Number of staff with valid contacts</b></td>
<td>{{ count($valid_users) }}</td>
</tr>
</table>
</div>
</div>
<br>
@if(count($valid_users) > 0)
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('sms_message', 'SMS Message') }}
{{ Form::textarea('sms_message', '', ['class' => 'form-control', 'rows' => '3', 'required']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('comment', 'Comment') }}
{{ Form::textarea('comment', '', ['class' => 'form-control', 'rows' => '3']) }}
</div>
</div>
</div>
@endif
@endif
@if($selected_send_option != 0 && (count($valid_patients) > 0 || count($valid_users) > 0))
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
@endif
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
$(function() {
$('#sms_option').change(function (e) {
$('#patient_groups_search').hide();
$('#user_position_search').hide();
$('#option_search').hide();
if (this.value == 1) {
$('#option_grouping').show();
$('#user_groups').hide();
$('#patient_groups').show();
} else if (this.value == 2) {
$('#option_grouping').show();
$('#patient_groups').hide();
$('#user_groups').show();
} else if (this.value == 3) {
$('#option_grouping').hide();
$('#patient_groups').hide();
$('#user_groups').hide();
}
});
$('#user_groups').change(function (e) {
if (this.value == 2) {
$('#option_search').show();
$('#user_position_search').show();
} else {
$('#option_search').hide();
$('#user_position_search').hide();
}
});
$('#patient_groups').change(function (e) {
if (this.value == 2) {
$('#option_search').show();
$('#patient_groups_search').show();
} else {
$('#option_search').hide();
$('#patient_groups_search').hide();
}
});
});
</script>
@endpush