<style type="text/css">
  .dataTables_length,
  .dataTables_info {
    width: 0px !important;
  }

  table,
  th,
  td {
    border: 1px solid black;
    border-collapse: collapse;
    text-align: center;
  }
</style>
<div class="row">
  <div class="container">
    <div class="panel-body">
      <ul class="nav nav-tabs">
        <li class="active">
          <a href="#studentaddsubjects" data-toggle="tab">تخصصات المتدربين والمجموعه</a>
        </li> {if $studentaddsubjectdetailid && $studentaddsubjectdetails} <li>
          <a href="#studentaddsubjectdetails" data-toggle="tab"> متدرب (ت ) </a>
        </li> {else if $studentaddsubjectdetails} <li>
          <a href="#studentaddsubjectdetails" data-toggle="tab">المتدربين </a>
        </li> {/if} {if $studentsexamid && $studentsexams} <li>
          <a href="#studentsexams" data-toggle="tab"> الاختبارات (ت ) </a>
        </li> {else if $studentsexams} <li>
          <a href="#studentsexams" data-toggle="tab"> الاختبارات </a>
        </li> {/if} 
        {if $studentspayid && $studentspays}
                 <li><a href="#studentspays" data-toggle="tab">الدفع   (ت   )</a></li>
                {else if $studentspays}
                <li><a href="#studentspays" data-toggle="tab"> الدفع </a></li>
                {/if}
                 {if $studentabsenceid && $studentabsences} <li>
          <a href="#studentabsences" data-toggle="tab">الغياب (ت ) </a>
        </li> {else if $studentabsences} <li>
          <a href="#studentabsences" data-toggle="tab">الغياب </a>
        </li> {/if}
      </ul>
      <div class="tab-content">
        <hr />
        <div class="tab-pane active" id="studentaddsubjects">
          <table class="table table-black border">
            <thead>
              <tr>
                <th>اسم </th>
                <th>المجموعه</th>
                <th>السعر</th>
                <th>عدد المتدربين</th>
                <th>عدد الاختبارات</th>
                <th>الدفع</th>
                <th>المستخدم</th>
                <th>التاريخ</th>
              </tr>
            </thead>
            <tbody> 
                <tr  {if $studentaddsubjects->del gt 1} style="background:#fb7777" {/if}>
                <td>{$studentaddsubjects->subjectname}</td>
                <td>{$studentaddsubjects->subjectgroupname}</td>
                <td>{$studentaddsubjects->subjectgroupprice}</td>
                <td>{count($studentaddsubjectdetails) - studentaddsubjectdetaildel}</td>
                <td>{count($studentsexams) - $studentsexamdel}</td>
                <td>{$payprice}</td>
                <td>{$studentaddsubjects->employeename}</td>
                <td>{$studentaddsubjects->addtoday}</td>
              </tr> 
              </tbody>
          </table>
          <br>
          <div class="clearfix"></div>
        </div>
        <div class="tab-pane " id="studentaddsubjectdetails"> {if $studentaddsubjectdetailid} <table class="table table-black border">
            <thead>
              <tr>
                <th>الاسم</th>
                <th>المستخدم</th>
                <th>التاريخ</th>
              </tr>
            </thead>
            <tbody>
                 <tr  {if $studentaddsubjectdetails->del gt 1} style="background:#fb7777" {/if}>
                <td>{$studentaddsubjectdetails->studentname}</td>
                <td>{$studentaddsubjectdetails->employeename}</td>
                <td>{$studentaddsubjectdetails->addtoday}</td>
              </tr> 
             </tbody>
          </table> {else} <table class="table table-black reportstable">
            <thead>
              <tr>
                <th>الاسم</th>
                <th>المستخدم</th>
                <th>التاريخ</th>
              </tr>
            </thead>
            <tbody> 
            {foreach $studentaddsubjectdetails as $data} 
               <tr  {if $data->del gt 1} style="background:#fb7777" {/if}>
                <td>{$data->studentname}</td>
                <td>{$data->employeename}</td>
                <td>{$data->addtoday}</td>
              </tr> 
              {/foreach} 
              </tbody>
          </table> {/if} <div class="clearfix"></div>
        </div>
        <div class="tab-pane " id="studentsexams"> {if $studentsexamid} <table class="table table-black border">
            <thead>
              <tr>
                  <th>الاسم</th>
                  <th>الدراجه</th>
                  <th>المستخدم</th>
                  <th>التاريخ</th>
              </tr>
            </thead>
            <tbody>
                 <tr  {if $studentsexams->del gt 1} style="background:#fb7777" {/if}>
                <td>{$studentsexams->examname}</td>
                <td>{$studentsexams->greatdegree}</td>
                <td>{$studentsexams->employeename}</td>
                <td>{$studentsexams->addtoday}</td>
              </tr> 
              </tbody>
          </table> {else}  <table class="table table-black reportstable">
                <thead>
                    <tr>
                        <th>الاسم</th>
                        <th>الدراجه</th>
                        <th>المستخدم</th>
                        <th>التاريخ</th>
                    </tr>
                </thead>
                <tbody>
                    {foreach $studentsexams as $data}
                     <tr  {if $data->del gt 1} style="background:#fb7777" {/if}>
                        <td>{$data->examname}</td>
                        <td>{$data->greatdegree}</td>
                        <td>{$data->employeename}</td>
                        <td>{$data->addtoday}</td>
                    </tr>
                    {/foreach}
                </tbody>
            </table> {/if} <div class="clearfix"></div>
        </div>
       <div class="tab-pane " id="studentspays">
                  {if $studentspayid}
                   <table class="table table-black border">
                    <thead>
                        <tr>
                             <th>النظام</th>
                            <th>عدد الشهور</th>
                            <th>تخصصات المتدربين</th>
                            <th>السعر</th>
                            <th>تاريخ البدايه</th>
                            <th>تاريخ  الانتهاء</th>
                            <th>المستخدم</th>
                            <th>التاريخ</th>
                        </tr>
                    </thead>
                    <tbody>
                         <tr  {if $studentspays->del gt 1} style="background:#fb7777" {/if}>
                            <td>{$studentspays->paytype}</td>
                            <td>{$studentspays->paymonths}</td>
                            <td>{$studentspays->subjectname}</td>
                            <td>{$studentspays->payprice}</td>
                            <td>{$studentspays->paystartdate}</td>
                            <td>{$studentspays->payenddate}</td>
                            <td>{$studentspays->employeename}</td>
                            <td>{$studentspays->addtoday}</td>
                        </tr>
                    </tbody>
                </table>
                 {else}    
                <table class="table table-black reportstable">
                    <thead>
                        <tr>
                            <th>النظام</th>
                            <th>عدد الشهور</th>
                            <th>تخصصات المتدربين</th>
                            <th>السعر</th>
                            <th>تاريخ البدايه</th>
                            <th>تاريخ  الانتهاء</th>
                            <th>المستخدم</th>
                            <th>التاريخ</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach $studentspays as $data}
                         <tr  {if $data->del gt 1} style="background:#fb7777" {/if}>
                            <td>{$data->paytype}</td>
                            <td>{$data->paymonths}</td>
                            <td>{$data->subjectname}</td>
                            <td>{$data->payprice}</td>
                            <td>{$data->paystartdate}</td>
                            <td>{$data->payenddate}</td>
                            <td>{$data->employeename}</td>
                            <td>{$data->addtoday}</td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
                {/if} <div class="clearfix"></div>
        </div>
        <div class="tab-pane " id="studentabsences"> {if $studentabsenceid} <table class="table table-black border">
            <thead>
              <tr>
                <th>المتدرب</th>
                <th>المستخدم</th>
                <th>التاريخ</th>
              </tr>
            </thead>
            <tbody>
                 <tr  {if $studentabsences->del gt 1} style="background:#fb7777" {/if}>
                <td>{$studentabsences->studentname}</td>
                <td>{$studentabsences->employeename}</td>
                <td>{$studentabsences->addtoday}</td>
              </tr>
              </tbody>
          </table> {else} <table class="table table-black reportstable">
            <thead>
              <tr>
                <th>المتدرب</th>
                <th>المستخدم</th>
                <th>التاريخ</th>
              </tr>
            </thead>
            <tbody> {foreach $studentabsences as $data} 
             <tr  {if $data->del gt 1} style="background:#fb7777" {/if}>
                <td>{$data->studentname}</td>
                <td>{$data->employeename}</td>
                <td>{$data->addtoday}</td>
              </tr> 
              {/foreach} </tbody>
          </table> {/if} <div class="clearfix"></div>
        </div>
      </div>
    </div>
  </div>
</div>