
<style>
    tr ,th , td{
            text-align: center;
    }
</style>

<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">نظام المتدربين</a></li>
            <li><a href="studentsExamsController.php?do=show">عرض   الاختبارات</a></li>
              {if $studentsexams->del lt 2}
            <li class="active">تعديل  </li> 
            {else}
            <li class="active">تفاصيل  </li> 
            {/if}
        </ol>
        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                  {if $studentsexams->del lt 2}
                <h3 class="panel-title">تعديل  </h3>
                 {else}
            <h3 class="panel-title">تفاصيل  </h3> 
            {/if}
            </div>
            <div class="panel-body">


                {literal}
                <form class="form-horizontal"  action="studentsExamsController.php"  id="studentformajax" method="post"  enctype="multipart/form-data" data-dosave="?do=savedata">

                    {/literal}

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">اسم الاختبار</label>
                        <div class="col-lg-4">
                            <input    required="required"    type="text" name="examname" class="form-control checkcolumn"  placeholder="اسم الاختبار"  
                            data-table="studentsexams" data-tablecol="examname" data-tableid="{$studentsexams->id}" data-parentid="" data-parentcol="" value="{$studentsexams->examname}" />
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الدرجه العظمى</label>
                        <div class="col-lg-4">
                             <input    required="required"    type="text" name="greatdegree" class="form-control floats" placeholder="الدرجه العظمى"  value="{$studentsexams->greatdegree}" id="greatdegree" />
                            
                        </div>
                    </div>
                    <div class="form-group"  >
                         <label for="txtName" class="col-lg-2 control-label">تخصصات المتدربين</label>
                        <div class="col-lg-8">
                           <input id="studentaddsubjects" type="text" name="studentaddsubjectid" class="searchdata getselectjoin"  data-placeholder="اختر  تخصص المتدرب"
                           data-table="studentaddsubjects" 
                            data-join=" LEFT JOIN studentsubjects ON studentaddsubjects.studentsubjectid = studentsubjects.id "  
                            data-filter=" and studentaddsubjects.del < 2  and studentsubjects.del < 2 GROUP BY studentsubjectid "
                            data-parent="" data-itr=""  data-search="subjectname,'/',subjectprice"/>                              
                             <input type="hidden" data-table="studentaddsubjects" data-id="{$studentsexams->studentaddsubjectid}" data-text="{$studentsexams->studentsubjects}" 
                                class="selectedit" />
                        </div>
                    </div>
                    <div class="form-group"  >
                         <label class="col-lg-2 control-label"> اضافة المتدرب</label>
                        <div class="col-lg-8">
                            <input type="text"   name="studentid" class="wdt100 getstudentnotexam"  data-placeholder="اختر  المتدرب "  id="getallstudenttime" 
                            data-search="studentname,'/',studentphone" 
                            data-table="students" />
                        </div>
                    </div>
                    
                     <div class="form-group">
                        <div class="col-md-12">
                            <div class="container" style='margin: 0px 19px;'>
                            <table class="table table-bordered">
                                  <thead>
                                    <tr>
                                      <th scope="col">المتدرب</th>
                                      <th scope="col">الدرجه</th>
                                      <th scope="col">الحضور</th>
                                      <th scope="col">حذف</th>
                                    </tr>
                                  </thead>
                                  <tbody id="getallstudenttimeli">
                                    {assign var=itr value=1}
                                    {foreach $studentsexamsval as $studentsexamsva}
                                    <tr class="studentsexamsval1{$studentsexamsva->id}" >
                                      <td>{$studentsexamsva->student}</td>
                                      <td><input type="text"  data-examsstudentid="{$studentsexamsva->id}" 
                                         class="form-control examsstudent floats" id="examsvalue{$studentsexamsva->id}" 
                                         value="{$studentsexamsva->examsvalue}">
                                      </td>
                                      <td><input type="checkbox"    class="form-control  examsstudent" style="width: 23px;margin: 0px 0 0;" value="1" 
                                         id="examspresence{$studentsexamsva->id}" data-examsstudentid="{$studentsexamsva->id}"
                                         {if $studentsexamsva->examspresence  eq 1} checked="" {/if}>
                                      </td>
                                      <td>
                                      <a href="javascript:;"  data-id="{$studentsexamsva->id}" data-edit="1" data-container="studentsexamsval" class="btn btn-xs red  newremoveclass"> x
                                            </a>
                                       </td>
                                    </tr>
                                    {capture assign=itr}{$itr+1}{/capture}
                                    {/foreach}
                                  </tbody>
                                </table>
                                </div>
                           </div>
                    </div>


                    <!--<div class="form-group">-->
                    <!--    <div class="col-md-12">-->
                    <!--          <div style="text-align: center;color: blue;"><h2>المتدربين</h2></div>-->
                    <!--          <ul  >-->
                    <!--            <li  style="list-style-type: none;" id="getallstudenttimeli">-->
                    <!--                  <div class="col-lg-7">-->
                    <!--                    <label>المتدرب</label>-->
                    <!--                  </div>-->
                    <!--                  <div class="col-lg-3">-->
                    <!--                     <label>الدرجه</label>-->
                    <!--                  </div>-->
                    <!--                  <div class="col-lg-1">-->
                    <!--                    <label>الحضور</label>-->
                    <!--                  </div>-->
                    <!--                   <div class="col-lg-1">-->
                    <!--                    <label>جذف</label>-->
                    <!--                  </div>-->
                    <!--            </li> -->
                    <!--            {foreach $studentsexamsval as $studentsexamsva}-->
                    <!--            <li  style="list-style-type: none;" -->
                    <!--            class="studentsexamsval1{$studentsexamsva->id}">-->
                    <!--                  <div class="col-lg-7">-->
                    <!--                     <input type="text" name="" class="form-control" readonly=""-->
                    <!--                     value="{$studentsexamsva->student}" style="background: #fff;">-->
                    <!--                  </div>-->
                    <!--                  <div class="col-lg-3">-->
                    <!--                     <input type="text"  data-examsstudentid="{$studentsexamsva->id}" -->
                    <!--                     class="form-control examsstudent floats" id="examsvalue{$studentsexamsva->id}" -->
                    <!--                     value="{$studentsexamsva->examsvalue}">-->
                    <!--                  </div>-->
                    <!--                  <div class="col-lg-1">-->
                    <!--                     <input type="checkbox"    class="form-control  examsstudent" style="width: 23px;margin: 0px 0 0;" value="1" -->
                    <!--                     id="examspresence{$studentsexamsva->id}" data-examsstudentid="{$studentsexamsva->id}"-->
                    <!--                     {if $studentsexamsva->examspresence  eq 1} checked="" {/if}>-->
                    <!--                  </div>-->
                    <!--                   <div class="col-lg-1 ">-->
                    <!--                        <a href="javascript:;"  data-id="{$studentsexamsva->id}" data-edit="1" data-container="studentsexamsval" class="btn btn-xs red pull-right newremoveclass"> x-->
                    <!--                        </a>-->
                    <!--                    </div>-->
                    <!--            </li> -->
                    <!--            {/foreach}    -->
                    <!--          </ul>-->
                    <!--       </div>-->
                    <!--</div>-->

                 

                 
                    <input type="hidden" name="studentsexamid" id="studentsexamid" value="{$studentsexams->id}" />
                    <input type="hidden"  id="studentaddsubjectid" value="{$studentsexams->studentaddsubjectid}" />







                    <input type="hidden" class="deldata" value="{$studentsexams->del}" />


                   {if $studentsexams->del lt 2}
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                             <button type="button" class="btn btn-primary pull-left studentformajax" >تعديل الامر</button>
                        </div>
                    </div>
                    {/if}




                </form>
            </div>
        </div>




    </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {
    selectedit2();
    deldata();
     });
</script>


