<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="studentsAddSubject.php?do=show">عرض المتدربين للتخصصات</a></li>
             {if $studentaddsubjectdata->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 $studentaddsubjectdata->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="studentsAddSubject.php"  id="studentformajax" method="post"  enctype="multipart/form-data" data-dosave="?do=savedata2">

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

                    <div class="form-group"  >
                         <label for="txtName" class="col-lg-1 control-label">التخصصات </label>
                        <div class="col-lg-4">
                             <input id="studentsubjectid" type="text" name="subjectid" class=" getselect"  data-placeholder="اختر  تخصص المتدرب "  data-table="studentsubjects" 
                            data-del="1"  data-filter=" and useit = 0 " data-parent="" disabled="" data-itr=""  
                            data-search="subjectname,'/',subjectprice"/>
                            <input type="hidden" data-table="studentsubjectid" data-id="{$studentaddsubjectdata->studentsubjectid}" data-text="{$studentaddsubjectdata->studentsubjects}" 
                            class="selectedit" />
                        </div>
                    </div>

                    <div class="form-group"  >
                         <label for="txtName" class="col-lg-1 control-label"> المجموعات</label>
                        <div class="col-lg-4">
                            <input id="studentsubjectgroupid" type="text" disabled="" name="subjectgroupid" class=" getselect"  data-placeholder="اختر  المجموعه "  data-table="studentsubjectgroups" 
                            data-del="1"  data-filter=" and useit = 0 " data-parent="studentsubjectid" data-itr=""  data-search="subjectgroupname,'/',subjectgroupprice"/>
                            <input type="hidden" data-table="studentsubjectgroupid" data-id="{$studentaddsubjectdata->studentsubjectgroupid}" data-text="{$studentaddsubjectdata->studentsubjectgroups}" 
                            class="selectedit" />
                        </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>
                                    </tr>
                                  </thead>
                                  <tbody>
                                    {assign var=itr value=1}
                                    {foreach $studentaddsubjectdetails as $studentaddsubjectdetail}
                                    <tr id="removesubjectsstudent{$studentaddsubjectdetail->id}">
                                      <td>{$studentaddsubjectdetail->student}</td>
                                      <td>
                                      {if $studentaddsubjectdata->del lt 2}
                                          <a href="javascript:;"  data-id="{$studentaddsubjectdetail->id}"  class="btn btn-xs red removesubjectsstudent"> x
                                          </a>
                                       {/if}
                                       </td>
                                    </tr>
                                    {capture assign=itr}{$itr+1}{/capture}
                                    {/foreach}
                                  </tbody>
                                </table>
                                </div>
                           </div>
                    </div>


                    <div class="form-group"  >
                        <label for="txtName" class="col-lg-1 control-label">  المتدربين   </label>
                        <div class="col-lg-11">
                            <input type="text" multiple=""   name="studentid"  class="wdt100 getselectmultiple"  data-placeholder="اختر المتدربين "  required=""  data-parent="" id="studentid" 
                            data-search="studentname,'/',studentphone" data-del="del" 
                            data-table="students"  />
                        </div>
                    </div>
                   


                  <input type="hidden" class="deldata" value="{$studentaddsubjectdata->del}" />
                   {if $studentaddsubjectdata->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>


