@extends('layouts.admin')

@section('styles')
@endsection

@section('content')
<!-- ============================================================== -->
<!-- Start right Content here -->
<!-- ============================================================== -->
<div class="content-page">
    <!-- Start content -->
    <div class="content">
        <div class="container-fluid">
          <div class="row">
              <div class="col-sm-12">
                  <div class="page-title-box">
                      <div class="row align-items-center">
                          <div class="col-md-8">
                              <h4 class="page-title mb-0">Settings</h4>
                              <ol class="breadcrumb m-0">
                                  <li class="breadcrumb-item"><a href="#">Settings</a></li>
                              </ol>
                          </div>

                      </div>

                  </div>
              </div>
          </div>
          <!-- end row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="mt-0 header-title">All Teacher List</h4>
                            <div class="table-responsive mt-4">
                                <table class="table table-hover mb-0">
                                    <thead>
                                        <tr>
                                            <th scope="col">(#)</th>
                                            <th scope="col">Student Time in minutes</th>
                                            <th scope="col">Teacher time  in minutes</th>
                                            <th scope="col" colspan="2">Actions</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                      <form action="{{ route('admin.add_settings')}}" method="post">
                                        <tr>
                                            <th scope="row">#</th>

                                            <td><input class="form-control" type="number" name="student" value="{{$setting->student_time}}" /></td>
                                            <td><input class="form-control" type="number" name="teacher" value="{{$setting->teacher_time}}" /></td>

                                            <td>
                                                <div>
                                                    <input type="submit"  class="btn btn-primary btn-sm" value="Save">
                                                </div>
                                            </td>
                                        </tr>
                                        {{ csrf_field()}}
                                      </form>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- end row -->

        </div> <!-- container-fluid -->

    </div> <!-- content -->

    <footer class="footer">
        © 2020 - 2021  The Educators Academy
    </footer>
</div>

<div id="addteacher" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title mt-0" id="myModalLabel">Add Teacher</h5>
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            </div>
            <div class="modal-body">
              <form action="{{ route('admin.add_teachers')}}" method="post">
                <div class="row">

									<div class="col-md-12">
										<label>Teacher Name</label>
										<input type="text" class="form-control" name="name" required />
									</div>

									<div class="col-md-12">
										<label>Teacher Email</label>
										<input type="email" class="form-control" name="email" required />
									</div>

									<div class="col-md-12">
										<label>Teacher Password</label>
										<input type="text" class="form-control" name="password" required />
									</div>

									<div class="col-md-12">
										<label>Teacher Gender</label>
										<select name="gender" class="form-control" required>
											<option>Male</option>
												<option>Female</option>
										</select>
									</div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button>
                <button type="submit" class="btn btn-primary waves-effect waves-light" >Add</button>
            </div>
            {{ csrf_field()}}
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
<!-- ============================================================== -->
<!-- End Right content here -->
<!-- ============================================================== -->

@endsection

@section('scripts')
<script>
function setregid(id)
{
  $("#reg_id").val(id);
}
</script>
@endsection
