

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

        <ol class="breadcrumb">
            <li><a href="#">نظام المتدربين</a></li>
            <li><a href="studentSubjectsController.php?do=show"> تعديل تخصصات المتدربين   </a></li>
            {if $subjects->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 $subjects->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="studentSubjectsController.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="subjectname" 
                            class="form-control checkcolumn"   placeholder="* اسم  تخصص المتدرب "  
                            data-table="studentsubjects" data-tablecol="subjectname" data-tableid="{$subjects->id}" data-parentid="" data-parentcol="" 
                            value="{$subjects->subjectname}" />
                        </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="subjectprice"   class="form-control floats" placeholder=" سعر تخصص المتدرب  "  value="{$subjects->subjectprice}" />
                            
                        </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="deviceid" class="form-control checkcolumn numbers"  placeholder="*سعر الماده  "   data-table="studentsubjects" data-tablecol="deviceid" data-tableid="{$subjects->id}"
                            data-parentid="" data-parentcol="" value="{$subjects->deviceid}"  />
                            
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">  ip       </label>
                        <div class="col-lg-4">
                            <input    required="required"    type="text" name="ipaddress" class="form-control checkcolumn "  placeholder="*ip  "   data-table="studentsubjects" data-tablecol="ipaddress" data-tableid="{$subjects->id}"
                            data-parentid="" data-parentcol="" value="{$subjects->ipaddress}"  />
                            
                        </div>
                    </div>
                    <input type="hidden" name="subjectid" value="{$subjects->id}">
                    <div class="form-group">
                        <div class="col-md-12">
                             {if $subjects->del lt 2}
                              <div>
                                 <button type="button" class="btn green-meadow btn-sm pull-left addappend" data-container="studentsubjectgroups" data-itr=''  style="font-size: 10px;background: #ccc">اضافة مجموعه</button>
                                  <input type="hidden" id="studentsubjectgroupsitr" name="studentsubjectgroupsitr" value="{1 + $groupsappend|@count}" />
                              </div>
                              {/if}
                              <div class="clearfix"></div>
                              <ul class="studentsubjectgroupscontainer" >
                                {assign var=it1r value=1}
                                {foreach $groupsappend as $groupappend}
                                 <input type="hidden"  name="subjectgroupid{$it1r}" value="{$groupappend->id}" />
                                 <li  id="studentsubjectgroupsremove1{$groupappend->id}" style="list-style-type: none;">
                                       <div class="col-lg-8">
                                        <input  required="required"    type="text" name="subjectgroupname{$it1r}" class="form-control checkcolumn" placeholder="* اسم  المجموعه " data-table="studentsubjectgroups" data-tablecol="subjectgroupname" data-tableid="{$groupappend->id}" data-parentid="{$subjects->id}" data-parentcol="studentsubjectid" value="{$groupappend->subjectgroupname}" />
                                       </div>
                                       <div class="col-lg-2">
                                         <input      type="text" name="subjectgroupprice{$it1r}" class="form-control  floats" placeholder="السعر   المجموعه  " data-table="studentsubjectgroups" data-tablecol="subjectgroupprice" data-tableid="" data-parentid="" data-parentcol="" value="{$groupappend->subjectgroupprice}"/>
                                       </div>
                                        {if $subjects->del lt 2}
                                       <div class="col-lg-1">
                                          <button type="button" class="btn green-meadow btn-sm pull-left addappend" data-container="studentsubjectgroupdays" data-itr='{$it1r}' style="font-size: 10px;background: #ef8080">اضافة الايام </button>
                                           <input type="hidden" id="studentsubjectgroupdaysitr{$it1r}" name="studentsubjectgroupdaysitr{$it1r}" value="{1 + $groupappend->daysappend|@count}"  />

                                       </div> 
                                        {/if} 
                                       {if $it1r != 1 && $subjects->del lt 2}
                                       <div class="col-lg-1 pull-right">
                                          <a href="javascript:;"  data-id="{$groupappend->id}" data-edit="1" data-container="studentsubjectgroups"  class="btn btn-xs red pull-right removeappend"> x
                                          </a>
                                       </div>
                                       {/if} 
                                       <ul class="studentsubjectgroupdayscontainer{$it1r}" >
                                        {assign var=it2r value=1}
                                        {foreach $groupappend->daysappend  as $dayappend}
                                         <input type="hidden"  name="subjectgroupdayid{$it1r}{$it2r}" value="{$dayappend->id}" />
                                         <li  id="studentsubjectgroupdaysremove1{$dayappend->id}" style="list-style-type: none;">
                                              <div class="col-lg-6">
                                                 <select class="selectnew" data-placeholder="اختر  اليوم " name="day{$it1r}{$it2r}"  required=""   >
                                                    <option value="" ></option>
                                                    <option value="1" {if $dayappend->day eq 1} selected="" {/if}>السبت</option>
                                                    <option value="2" {if $dayappend->day eq 2} selected="" {/if}>الأحد</option>
                                                    <option value="3" {if $dayappend->day eq 3} selected="" {/if}>الاثنين</option>
                                                    <option value="4" {if $dayappend->day eq 4} selected="" {/if}>الثلاثاء</option>
                                                    <option value="5" {if $dayappend->day eq 5} selected="" {/if}>الاربعاء</option>
                                                    <option value="6" {if $dayappend->day eq 6} selected="" {/if}>الخميس</option>
                                                    <option value="7" {if $dayappend->day eq 7} selected="" {/if}>الجمعة</option>
                                                </select>
                                              </div>
                                              <div class="col-lg-2">
                                                    <input type="time" name="timeform{$it1r}{$it2r}"  class="form-control " required="" placeholder="* الوقت من  "  step='1'   value="{$dayappend->timeform}">
                                              </div>                
                                              <div class="col-lg-2">
                                                    <input type="time" name="timeto{$it1r}{$it2r}" class="form-control"  step='1'  required="" placeholder="* الوقت الى  "  value="{$dayappend->timeto}" >
                                              </div>
                                              {if $it2r != 1 && $subjects->del lt 2}
                                              <div class="col-lg-1 pull-right">
                                                 <a href="javascript:;"  data-id="{$dayappend->id}" data-edit="1" data-container="studentsubjectgroupdays" class="btn btn-xs red pull-right removeappend"> x
                                                 </a>
                                              </div> 
                                              {/if}
                                              
                                               
                                        </li>
                                         {capture assign=it2r}{$it2r+1}{/capture}
                                         {/foreach}
                                      </ul>
                                      
                                 </li>
                                 {capture assign=it1r}{$it1r+1}{/capture}
                                 {/foreach}
                              </ul>
                             
                           </div>
                    </div>
                  



                   <input type="hidden" class="deldata" value="{$subjects->del}" />
                   <input type="hidden"  name="incometype" value="{$subjects->incometypeid}" />


                   {if $subjects->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 () {
    deldata();
     });
</script>