@extends('coaching.layout.master')

@section('content')

<div class="app-content  my-3 my-md-5">
				<div class="side-app">
					<div class="page-header">
						<ol class="breadcrumb">
							<li class="breadcrumb-item" aria-current="page">Result Management</li>
							<li class="breadcrumb-item active" aria-current="page"></li>
						</ol>
					</div>
					<!-- MAIN BODY CONTENT -->
		            <h1>Result</h1>
		            @if(Session::has('error'))
						<div class="alert alert-danger" style="background: none; border: none;">
							<p style="color: #f00">{{ Session::get('error') }}</p>
						</div>
					@endif
		            <div class="row ">
		              <div class="col-xl-4 col-lg-6 col-md-12">
		                <div class="card">
		                  <div class="card-body small-card">
		                    <h5 class="font-medium">Total No of Test Attempted Today</h5>
		                    <div class="counter">
		                      <svg
		                        id="small-card-icon"
		                        class="red"
		                        xmlns="http://www.w3.org/2000/svg"
		                        width="24"
		                        height="24"
		                        viewBox="0 0 24 24"
		                      >
		                        <g transform="translate(21090 -1397)">
		                          <rect
		                            width="24"
		                            height="24"
		                            transform="translate(-21090 1397)"
		                            fill="none"
		                          />
		                          <path
		                            d="M14.222,18H1.778A1.791,1.791,0,0,1,0,16.2V3.6A1.792,1.792,0,0,1,1.778,1.8H5.494a2.646,2.646,0,0,1,5.014,0h3.715A1.791,1.791,0,0,1,16,3.6V16.2A1.791,1.791,0,0,1,14.222,18ZM4.445,12.6a.9.9,0,0,0,0,1.8H8.89a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8ZM8,1.8a.9.9,0,1,0,.889.9A.9.9,0,0,0,8,1.8Z"
		                            transform="translate(-21086 1400)"
		                            fill=""
		                          />
		                        </g>
		                      </svg>
		                      <span class="maintotalSet">{{$today_tot_test_attempted}}</span>
		                    </div>
		                    <svg
		                      id="small-card-bg-icon"
		                      class="red"
		                      xmlns="http://www.w3.org/2000/svg"
		                      width="24"
		                      height="24"
		                      viewBox="0 0 24 24"
		                    >
		                      <g transform="translate(21090 -1397)">
		                        <rect
		                          width="24"
		                          height="24"
		                          transform="translate(-21090 1397)"
		                          fill="none"
		                        />
		                        <path
		                          d="M14.222,18H1.778A1.791,1.791,0,0,1,0,16.2V3.6A1.792,1.792,0,0,1,1.778,1.8H5.494a2.646,2.646,0,0,1,5.014,0h3.715A1.791,1.791,0,0,1,16,3.6V16.2A1.791,1.791,0,0,1,14.222,18ZM4.445,12.6a.9.9,0,0,0,0,1.8H8.89a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8ZM8,1.8a.9.9,0,1,0,.889.9A.9.9,0,0,0,8,1.8Z"
		                          transform="translate(-21086 1400)"
		                          fill=""
		                        />
		                      </g>
		                    </svg>
		                  </div>
		                </div>
		              </div>

		              <div class="col-xl-4 col-lg-6 col-md-12">
		                <div class="card">
		                  <div class="card-body small-card">
		                    <h5 class="font-medium">
		                      Total No of Test Attempted In Last 30 Days
		                    </h5>
		                    <div class="counter">
		                      <svg
		                        id="small-card-icon"
		                        class="orange"
		                        xmlns="http://www.w3.org/2000/svg"
		                        width="24"
		                        height="24"
		                        viewBox="0 0 24 24"
		                      >
		                        <g transform="translate(21090 -1397)">
		                          <rect
		                            width="24"
		                            height="24"
		                            transform="translate(-21090 1397)"
		                            fill="none"
		                          />
		                          <path
		                            d="M14.222,18H1.778A1.791,1.791,0,0,1,0,16.2V3.6A1.792,1.792,0,0,1,1.778,1.8H5.494a2.646,2.646,0,0,1,5.014,0h3.715A1.791,1.791,0,0,1,16,3.6V16.2A1.791,1.791,0,0,1,14.222,18ZM4.445,12.6a.9.9,0,0,0,0,1.8H8.89a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8ZM8,1.8a.9.9,0,1,0,.889.9A.9.9,0,0,0,8,1.8Z"
		                            transform="translate(-21086 1400)"
		                            fill=""
		                          />
		                        </g>
		                      </svg>
		                      <span>{{$tot_test_attempted_30d}}</span>
		                    </div>
		                    <svg
		                      id="small-card-bg-icon"
		                      class="orange"
		                      xmlns="http://www.w3.org/2000/svg"
		                      width="24"
		                      height="24"
		                      viewBox="0 0 24 24"
		                    >
		                      <g transform="translate(21090 -1397)">
		                        <rect
		                          width="24"
		                          height="24"
		                          transform="translate(-21090 1397)"
		                          fill="none"
		                        />
		                        <path
		                          d="M14.222,18H1.778A1.791,1.791,0,0,1,0,16.2V3.6A1.792,1.792,0,0,1,1.778,1.8H5.494a2.646,2.646,0,0,1,5.014,0h3.715A1.791,1.791,0,0,1,16,3.6V16.2A1.791,1.791,0,0,1,14.222,18ZM4.445,12.6a.9.9,0,0,0,0,1.8H8.89a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8ZM8,1.8a.9.9,0,1,0,.889.9A.9.9,0,0,0,8,1.8Z"
		                          transform="translate(-21086 1400)"
		                          fill=""
		                        />
		                      </g>
		                    </svg>
		                  </div>
		                </div>
		              </div>

		              <div class="col-xl-4 col-lg-6 col-md-12">
		                <div class="card">
		                  <div class="card-body small-card">
		                    <h5 class="font-medium">
		                      Total No of Test Attempted Till Now
		                    </h5>
		                    <div class="counter">
		                      <svg
		                        id="small-card-icon"
		                        class="blue"
		                        xmlns="http://www.w3.org/2000/svg"
		                        width="24"
		                        height="24"
		                        viewBox="0 0 24 24"
		                      >
		                        <g transform="translate(21090 -1397)">
		                          <rect
		                            width="24"
		                            height="24"
		                            transform="translate(-21090 1397)"
		                            fill="none"
		                          />
		                          <path
		                            d="M14.222,18H1.778A1.791,1.791,0,0,1,0,16.2V3.6A1.792,1.792,0,0,1,1.778,1.8H5.494a2.646,2.646,0,0,1,5.014,0h3.715A1.791,1.791,0,0,1,16,3.6V16.2A1.791,1.791,0,0,1,14.222,18ZM4.445,12.6a.9.9,0,0,0,0,1.8H8.89a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8ZM8,1.8a.9.9,0,1,0,.889.9A.9.9,0,0,0,8,1.8Z"
		                            transform="translate(-21086 1400)"
		                            fill=""
		                          />
		                        </g>
		                      </svg>
		                      <span>{{$tot_test_attempted}}</span>
		                    </div>
		                    <svg
		                      id="small-card-bg-icon"
		                      class="blue"
		                      xmlns="http://www.w3.org/2000/svg"
		                      width="24"
		                      height="24"
		                      viewBox="0 0 24 24"
		                    >
		                      <g transform="translate(21090 -1397)">
		                        <rect
		                          width="24"
		                          height="24"
		                          transform="translate(-21090 1397)"
		                          fill="none"
		                        />
		                        <path
		                          d="M14.222,18H1.778A1.791,1.791,0,0,1,0,16.2V3.6A1.792,1.792,0,0,1,1.778,1.8H5.494a2.646,2.646,0,0,1,5.014,0h3.715A1.791,1.791,0,0,1,16,3.6V16.2A1.791,1.791,0,0,1,14.222,18ZM4.445,12.6a.9.9,0,0,0,0,1.8H8.89a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8Zm0-3.6a.9.9,0,0,0,0,1.8h7.111a.9.9,0,0,0,0-1.8ZM8,1.8a.9.9,0,1,0,.889.9A.9.9,0,0,0,8,1.8Z"
		                          transform="translate(-21086 1400)"
		                          fill=""
		                        />
		                      </g>
		                    </svg>
		                  </div>
		                </div>
		              </div>
		            </div>

				    <div class="card" style="min-height: 85px !important;">
		              <div class="card-body">
		                  <div class="form-row filter-row">
		                    <div class="form-group mb-1 col-md-2">
		                      <select class="form-control input-sm " id="examtype_filter" name="examtype_filter">
			                    <option value="">Exam Type</option>
			                    @if($examTypes)
		                    		@foreach($examTypes as $types)
		                    		    <option value="{{$types->id}}"  @if(request()->post('examtype_filter') == $types->id){{'selected'}}@endif>{{$types->exam_type}}</option>
		                    		@endforeach
			                    @endif
			                  </select>
		                    </div>
		                    <div class="form-group mb-1 col-md-2">
		                      <select class="form-control input-sm " id="package_filter" name="package_filter">
			                    <option value="">Package</option>
			                  </select>
		                    </div>
		                    <div class="form-group mb-1 col-md-2">
		                      <select class="form-control input-sm " id="testtype_filter" name="testtype_filter">
			                    <option value="">Test Type</option>
			                  </select>
		                    </div>
		                    <div class="form-group mb-1 col-md-2">
		                      <select class="form-control input-sm " id="test_filter" name="test_filter">
			                    <option value="">Test</option>
			                  </select>
		                    </div>
		                    <div class="form-group mb-1 col-md-4">
		                      <div class="input-group search-filter">
		                        <input type="text" class="form-control input-sm name_search_filter" id="search_key" name="search_key" placeholder="Search Test & Package">
		                        <span class="input-group-append">
		                          <button class="btn main_filter" type="button" id="search_btn">
		                            <i class="fa fa-search search-icon" style="color:#ff8819;"></i>
		                          </button>
		                        </span>
		                      </div>
		                    </div>
		                  </div>
		              </div>
		            </div>
		           
		            <!-- Table -->
		            <div class="card">
		              <div class="card-header pt-5">
		                <h2>Results</h2>
		                <div class="filter-group">
		                  <select class="form-control search_filter" id="published_filter" name="published_filter">
		                  	<option value="">Publish Status</option>
		                    <option value="1"  @if(request()->post('published_filter') == 1){{'selected'}}@endif>Auto</option>
		                    <option value="2"  @if(request()->post('published_filter') == 2){{'selected'}}@endif>Manual</option>
		                    <option value="3" @if(request()->post('published_filter') == 3){{'selected'}}@endif>Dated</option>
		                  </select>
		                  <select class="form-control search_filter" id="orderby_filter" name="orderby_filter">
		                  	<option value="">Sort By</option>
		                    <option value="ASC"  @if(request()->post('orderby_filter') == 1){{'selected'}}@endif>Latest Attempt Asc</option>
		                    <option value="DESC" @if(request()->post('orderby_filter') == 2){{'selected'}}@endif>Latest Attempt Desc</option>
		                  </select>
				         <div class="dropdown custom-date">
                  <button class="btn btn-custom-toggle dropdown-toggle btn-block" type="button" id="dropdownMenuButton"
                    data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    Custom Date
                  </button>
                  <div class="dropdown-menu custom-dropdown-menu right-move" aria-labelledby="dropdownMenuButton"
                    x-placement="bottom-start">
                    <div class="custom-date-content">
                      <h6>Quick Dates</h6>
                      <ul id="date_ul">
                        <li value="1" class="custom_date" style="cursor:pointer;">Today</li>
                        <li value="2" class="custom_date" style="cursor:pointer;">Last 7 Days</li>
                        <li value="3" class="custom_date" style="cursor:pointer;">This Month</li>
                        <li value="4" class="custom_date" style="cursor:pointer;">This Year: {{ date('Y') }} </li>
                        <li value="5" class="custom_date" style="cursor:pointer;">Last Year: {{ date('Y')-1 }}</li>
                        <li value="6" class="custom_date" style="cursor:pointer;">All Time</li>
                      </ul>
                      <h6>Quick Dates</h6>
                      <div class="date-group">
                        <div class="input-group">
                          <div class="input-group-prepend">
                            <div class="input-group-text">
                              <i class="fa fa-calendar tx-16 lh-0 op-6"></i>
                            </div>
                          </div>
                          <input class="form-control fc-datepicker input-sm" placeholder="YYYY-MM-DD"
                            type="text" name="from_date" id="from_date">
                        </div>
                        <span>To</span>
                        <div class="input-group">
                          <div class="input-group-prepend">
                            <div class="input-group-text">
                              <i class="fa fa-calendar tx-16 lh-0 op-6"></i>
                            </div>
                          </div>
                          <input class="form-control fc-datepicker input-sm" placeholder="YYYY-MM-DD"
                            type="text" name="to_date" id="to_date">
                        </div>
                      </div>
                      <div class="btn-content">
                        <button class="btn btn-outline-primary btn-pill add-btn-sm btn-streach-md" id="date_cancel">
                          Cancel
                        </button>
                        <button class="btn btn-primary add-btn-sm btn-streach-md" id="date_apply">
                          Apply
                        </button>
                      </div>
                    </div>

                  </div>
                </div>
		                </div>
		              </div>
		              <div class="card-body pt-0">
		                <p class="text-right font-bold total_test">Total No of Test: {{$tot_test}}</p>
		                <div class="table-responsive">
		                  <table id="quiz-manager" class="table card-table dataTable table-hover table-vcenter text-nowrap">
		                    <thead>
		                      <tr>
		                        <th width="25">Test Name</th>
		                        <th>Test Type</th>
		                        <th>Subject</th>
		                        <th>T.Question</th>
		                        <th>Max Marks</th>
		                        <th>Time</th>
		                        <th>Faculty</th>
		                        <th>Attempted By</th>
		                        <th>Action</th>
		                      </tr>
		                    </thead>
		                  </table>
		                </div>
		              </div>
		            </div>
		            <!-- //Table -->
				</div>
			</div>
@endsection
@section('scripts')
<script type="text/javascript" src="{{asset('js/coaching/result.js?v='.time())}}"></script>
@endsection
