@extends('admin.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 ">
                  <a href="">Bank Management</a>
                </li>
                <li class="breadcrumb-item active" aria-current="page">
                  Company Bank
                </li>
              </ol>
            </div>
            <!-- MAIN BODY CONTENT -->
            <h1>Company Bank</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

            <form class="search_filter_frm" method="post">
            {{csrf_field()}}
              <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 first_card_text">Total No. Of Test</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 id="all_count_test_package" class="first_card_data"></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 second_card_text">
                        Total No. Of Test
                      </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>
                        <ul class="list second_card_data">
                      </ul>
                      </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 third_card_text">
                        Total No. Of Test
                      </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>
                        <ul class="list third_card_data">
                      </ul>
                      </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>
              <!-- Filter box -->
            <div class="card" style="min-height: 0px">
              <div class="card-body">
                <div class="form-row filter-row">
                    
                    <div class="form-group col-md-8">
                      <div class="input-group search-filter">                        
                        <input type="text"  class="form-control input-sm name_search_filter" placeholder="Search by name..." id="name_filter" name="name_filter"/>
                        <span class="input-group-append">
                          <button class="btn main_filter" type="button">
                            <i class="fa fa-search search-icon"></i>
                          </button>
                        </span>
                      </div>
                    </div>
                    <div class="form-group col-md-4">
                      <span>View Type: </span>
                      <select  id="view_type" name="view_type" class="form-control input-sm" style="display: inline-block;width: 70%;">
                        <option value="1" >Package</option>
                        <option value="2" >Test</option>
                        <option value="3" >Question</option>
                      </select>
                    </div>
                  </div>
              </div>
            </div>

            <!-- Filter box -->
            <div class="card" style="min-height: 0px">
              <div class="card-body">
                <div class="form-row filter-row">
                    <span class="product_type_value" data-id=""></span>
                    <div class="form-group col-md-4">
                      <span>Product Type: </span>
                      <select  id="product_type_filter" name="product_type_filter" class="form-control input-sm" style="display: inline-block;width: 70%;">
                        <option value="1" >Test Series Package</option>
                        <option value="2" >Practice Set</option>
                        <option value="3" >Quiz</option>
                        <option value="4" >All Question</option>
                      </select>
                    </div>
                    <div class="form-group col-md-2">
                      <select class="form-control search_filter input-sm filters" id="examtype_filter" name="examtype_filter" data-id="exam_type">
                      @if(!$examType->isEmpty())
                        <option value="" selected>Exam Type</option>
                        @foreach($examType as $types)
                          <option value="{{$types->id}}" @if(request()->post('examtype_filter') == $types->id){{'selected'}}@endif>{{$types->exam_type}}</option>
                        @endforeach
                      @else
                        <option value="" selected>All Exam</option>
                      @endif
                    </select>
                    </div>
                    <div class="form-group col-md-2">
                      <select class="form-control search_filter input-sm" id="examname_filter" name="examname_filter">
                      <option value="" selected>Exam Name</option>
                    </select>
                    </div>
                    <div class="form-group col-md-4">
                      <select  id="select_package_filter" name="select_package_filter" class="form-control input-sm search_filter">
                        <option value="" selected>Select Package</option>
                      </select>
                    </div>
                  </div>
              </div>
            </div>

            <div class="card sub_lebel" style="min-height: 0px; display: none;">
              <div class="card-body">
                <div class="form-row filter-row">
                    <div class="form-group col-md-3 test_type">
                      <select class="form-control search_filter input-sm filters" id="testype_filter" name="testype_filter" data-id="test_type">
                      @if(!$testTypes->isEmpty())
                        <option value="" selected>Test Type</option>
                        @foreach($testTypes as $testtypes)
                          <option value="{{$testtypes->id}}">{{$testtypes->test_type_name}}</option>
                        @endforeach
                      @endif
                    </select>
                    </div>
                    <div class="form-group col-md-3">
                      <select  id="sub_lebel_filter" name="sub_lebel_filter" class="form-control input-sm search_filter">
                        <option value="" selected>Select Test</option>
                      </select>
                    </div>
                    
                    <div class="form-group col-md-3 typist" style="display: none;">
                      <select class="form-control search_filter input-sm" id="typist_filter" name="typist_filter">
                        <option value="" selected>Typist Name</option>
                        <option value="{{Auth::Guard('admin')->user()->username}}" >{{Auth::Guard('admin')->user()->username}}</option>
                      </select>
                    </div>
                    <div class="form-group col-md-3">
                      <select class="form-control search_filter input-sm" id="faculty_filter" name="faculty_filter">
                        @if(!$faculties->isEmpty())
                        <option value="" selected>Faculty Name</option>
                        @foreach($faculties as $faculty)
                          <option value="{{$faculty->id}}">{{$faculty->faculty_name}}</option>
                        @endforeach
                      @endif
                      </select>
                    </div>
                    <div class="form-group col-md-3">
                      <select  id="language_filter" name="language_filter" class="form-control input-sm search_filter">
                        <option value="" selected>Select Language</option>
                        <option value="" >Both</option>
                        <option value="1" >English</option>
                        <option value="2" >Hindi</option>
                      </select>
                    </div>
                  </div>
              </div>
            </div>

            <div class="card question_filter" style="display: none;">
              <div class="card-body">
                <div class="form-row filter-row">
                    <div class="form-group col-md-3">
                        <select class="form-control search_filter input-sm filters" id="ques_testype_filter" name="ques_testype_filter" data-id="test_type">
                        @if(!$testTypes->isEmpty())
                          <option value="" selected>Test Type</option>
                          @foreach($testTypes as $testtypes)
                            <option value="{{$testtypes->id}}">{{$testtypes->test_type_name}}</option>
                          @endforeach
                        @endif
                      </select>
                    </div>
                    <div class="form-group col-md-3">
                      <select  id="ques_sub_lebel_filter" name="ques_sub_lebel_filter" class="form-control input-sm search_filter">
                        <option value="" selected>Select Test</option>
                      </select>
                    </div>
                    
                    <div class="form-group col-md-3">
                      <select class="form-control search_filter input-sm" id="ques_faculty_filter" name="ques_faculty_filter">
                        @if(!$faculties->isEmpty())
                        <option value="" selected>Faculty Name</option>
                        @foreach($faculties as $faculty)
                          <option value="{{$faculty->id}}">{{$faculty->faculty_name}}</option>
                        @endforeach
                      @endif
                      </select>
                    </div>
                    <div class="form-group col-md-3">
                      <select class="form-control search_filter input-sm" id="ques_typist_filter" name="ques_typist_filter">
                        <option value="" selected>Typist Name</option>
                        <option value="{{Auth::Guard('admin')->user()->username}}" >{{Auth::Guard('admin')->user()->username}}</option>
                      </select>
                    </div>
                    <div class="form-group col-md-3">
                      <select  id="subject_filter" name="subject_filter"  data-id="subject" class="form-control input-sm search_filter filters">
                        @if(!$subjects->isEmpty())
                        <option value="" selected>Select Subject</option>
                        @foreach($subjects as $subject)
                          <option value="{{$subject->id}}">{{$subject->subject}}</option>
                        @endforeach
                      @endif
                      </select>
                    </div>
                    <div class="form-group col-md-3">
                      <select  id="chapter_filter" name="chapter_filter"  data-id="chapter" class="form-control input-sm search_filter filters">
                        <option value="" selected>Select Chapter</option>
                      </select>
                    </div>
                    <div class="form-group col-md-3">
                      <select  id="topic_filter" name="topic_filter" class="form-control input-sm search_filter">
                        <option value="" selected>Select Topic</option>
                      </select>
                    </div>
                    <div class="form-group col-md-3">
                      <select  id="ques_language_filter" name="ques_language_filter" class="form-control input-sm search_filter">
                        <option value="" selected>Select Language</option>
                        <option value="" >Both</option>
                        <option value="1" >English</option>
                        <option value="2" >Hindi</option>
                      </select>
                    </div>
                  </div>
              </div>
            </div>

              <!-- Table -->
              <div class="card">
                <div class="card-header pt-5">
                  <h2>Company Bank</h2>
                  <div class="filter-group">
                    <span class="add_btn"><a href="javascript:void()" onclick="addTestPackages(event)"><button class="btn btn-primary add-btn add-btn-sm"><i class="fa fa-plus-circle"></i>Add Test Package</button></a></span>

                    <button type="button" class="form-control copy" style="display: none;"><i class="fa fa-copy"></i> Duplicate</button>
                    <select  id="difficulty_level_filter" name="difficulty_level_filter" class="form-control input-sm search_filter" style="display: none;">
                        <option value="" selected>Select Difficulty Level</option>
                        <option value="1" >Easy</option>
                        <option value="2" >Medium</option>
                        <option value="3" >Hard</option>
                    </select>
                    <select  id="question_type_filter" name="question_type_filter" class="form-control input-sm search_filter" style="display: none;">
                        <option value="" selected>Select Question Type</option>
                        <option value="1" >Multiple Choice</option>
                        <option value="2" >Meltiple Response</option>
                        <option value="3" >True/False</option>
                        <option value="4" >Fill In The Blanks</option>
                        <option value="5" >Match Following</option>
                        <option value="6" >Match Matrix</option>
                        <option value="7" >Essay</option>
                        <option value="8" >Single Digit</option>
                        <option value="9" >Subjective</option>
                    </select>
                    <select class="form-control search_filter" id="attempt_filter" name="attempt_filter">
                    	<option value="1" >Highest Attempted</option>
                      <option value="2" >Most Rated</option>
                      <option value="3" >Popular</option>
                      <option value="4" >Trending</option>
                      <option value="5" >Most Time Spent</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"
                        style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 44px, 0px);">
                        <div class="custom-date-content">
                          <h6>Quick Dates</h6>
                          <ul>
                            <li data-id="1" style="cursor: pointer;" class="date_selector">Today</li>
                            <li data-id="2" style="cursor: pointer;" class="date_selector">Last 7 Days</li>
                            <li data-id="3" style="cursor: pointer;" class="date_selector">This Month</li>
                            <li data-id="4" style="cursor: pointer;" class="date_selector">This Year: {{date('Y')}}</li>
                            <li data-id="5" style="cursor: pointer;" class="date_selector">Last Year: {{date('Y')-1}}</li>
                            <li data-id="6" style="cursor: pointer;" class="date_selector all_time">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 input-sm all_from_date" name="all_from_date" placeholder="MM/DD/YYYY" type="text" id="dp1588836251070">
                            </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 input-sm all_to_date" name="all_to_date" placeholder="MM/DD/YYYY" type="text" id="dp1588836251072">
                            </div>
                          </div>
                          <input type="hidden" name="date_type" id="date_type">
                          <div class="btn-content">
                            <button type="button" class="btn btn-outline-primary btn-pill add-btn-sm btn-streach-md cancel_date">Cancel</button>
                            <button type="button" class="btn btn-primary add-btn-sm btn-streach-md apply">Apply</button>
                          </div>
                        </div>

                      </div>
                    </div>
                    <button type="button" class="form-control all_delete" style="display: none;"><i class="fa fa-trash"></i> Delete</button>
                  </div>
                </div>
                <div class="card-body pt-0">
                  <p class="text-right font-bold total_package">Total No. of Packages(s): 0</p>
                  <div class="table-responsive">
                    <table id="test-package-manager" class="table card-table dataTable table-vcenter text-nowrap">
                      <thead>
                        <tr>
                          <th width="25">Package Name</th>
                          <th>Exam Type</th>
                          <th>Test Type</th>
                          <th>No Of Test(s)</th>
                          <th>Validity</th>
                          <th>Price</th>
                          <th>Status</th> 
                          <th>Action</th>
                        </tr>
                      </thead>
    
                    </table>
                    <table id="test-manager" class="table card-table dataTable table-vcenter text-nowrap" style="display: none;">
                      <thead>
                        <tr>
                          <th></th>
                          <th>Test Name</th>
                          <th>Package Name</th>
                          <th>Subject Name</th>
                          <th>Duration Of Test</th>
                          <th>Status</th> 
                          <th>Action</th>
                        </tr>
                      </thead>
                    </table>
                    <table id="practice-set-manager" class="table card-table dataTable table-hover table-vcenter text-nowrap" style="display: none;">
                        <thead>
                          <tr>
                            <th width="25">Practice Sets</th>
                            <th>Exam Type</th>
                            <th>Total Subject(s)</th>
                            <th>Total Chapter(s)</th>
                            <th>Total Question(s)</th>
                            <th>Status</th>
                            <th>Action</th>
                          </tr>
                        </thead>
                      </table>
                      <table id="quiz-manager" class="table card-table dataTable table-hover table-vcenter text-nowrap" style="display: none;">
                        <thead>
                          <tr>
                            <th width="25">Quiz Name</th>
                            <th>Exam Type</th>
                            <th>No. Of Question(s)</th>
                            <th>Duration</th>
                            <th>Status</th>
                            <th>Action</th>
                          </tr>
                        </thead>
                      </table>
                      <table id="chapter-manager" class="table card-table dataTable table-hover table-vcenter text-nowrap" style="display: none;">
                        <thead>
                          <tr>
                            <th width="25">Chapter</th>
                            <th>Subject</th>
                            <th>No of Question(s)</th>
                            <th>Faculty Name</th>
                            <th>Status</th>
                            <th>Action</th>
                          </tr>
                        </thead>
                      </table>
                      <table id="question-manager" class="table double-line-header card-table dataTable table-hover table-vcenter text-nowrap" style="display: none;">
                    <thead>
                      <tr>
                        <th></th>
                        <th>Serial No</th>
                        <th>Q. ID</th>
                        <th>Question Details</th>
                        <th>Subject</th>
                        <th>Chapter</th>
                        <th>Question Type</th>
                        <th>Level</th>
                        <th>Status</th>
                        <th>Created Date</th>
                        <th>Action</th>
                      </tr>
                    </thead>
                  </table>
                  </div>
                </div>
              </div>
            </form>
            <!-- //Table -->
            <!--// MAIN BODY CONTENT -->
          </div>
        </div>
@endsection
@section('scripts')
<script type="text/javascript" src="{{asset('js/test_bank.js')}}"></script>
<link href="{{asset('admin/plugins/drag-drop-upload/drag-drop-upload.css?v='.time())}}" rel="stylesheet" />
@endsection
