<!-- <style type="text/css">
.breadcrumb>li>a, .breadcrumb>.active {
    color: #224e8f;
    font-size: 13px;
}
</style> -->

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">نظام المتدربين</a></li>
            <li><a href="studentsPay.php?do=show">عرض دفع المتدربين </a></li>
            {if $studentspaydata->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 $studentspaydata->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="studentsPay.php"  id="studentformajax" method="post"  enctype="multipart/form-data" data-dosave="?do=savedata">

                    {/literal}
                    <input type="hidden"  name="studentspayid" value="{$studentspaydata->id}" />
                    
                     <div class="form-group" >
                        <label class="col-lg-2 control-label">اختر  طريقة الدفع </label>
                        <div class="col-lg-4">
                            {if $studentsetting->paymentsystems1}
                            <input type="radio" class="paykind" name="paykind" value="1" {if $studentsetting->paymentsystems1 && $studentspaydata->paykind eq 1} checked {/if}>
                            <label for="client"> دفع بالتخصص </label>
                            {/if}
                             {if $studentsetting->paymentsystems2}
                            <input type="radio" class="paykind"  name="paykind" value="2" {if $studentsetting->paymentsystems2 && $studentspaydata->paykind eq 2} checked {/if}>
                            <label for="supplier">دفع بالنظام </label>
                             {/if}
                             {if $studentsetting->paymentsystems3}
                             <input type="radio" class="paykind"  name="paykind" value="3" {if $studentsetting->paymentsystems3 && $studentspaydata->paykind eq 3} checked {/if}>
                            <label for="supplier">دفع خاص</label>
                             {/if}
                        </div>
                    </div>
                     <input id="studentaddsubjectid" type="hidden" name="studentaddsubjectid" value="{$studentsetting->studentaddsubjectid}"/>
                    <!--<div class="form-group"  >-->
                    <!--     <label for="txtName" class="col-lg-2 control-label">  تخصصات المتدربين </label>-->
                    <!--    <div class="col-lg-4">-->
                    <!--       <input id="studentaddsubjectid" type="text" name="studentaddsubjectid" class="getselectjoin"  data-placeholder=" تخصص المتدرب "   data-table="studentaddsubjects" -->
                    <!--        data-join=" LEFT JOIN studentsubjects ON studentaddsubjects.studentsubjectid = studentsubjects.id -->
                    <!--         LEFT JOIN studentsubjectgroups ON studentaddsubjects.studentsubjectgroupid = studentsubjectgroups.id "  -->
                    <!--        data-filter=" and studentaddsubjects.del < 2  and studentsubjects.del < 2 and studentsubjectgroups.del < 2 "-->
                    <!--        data-parent="" data-itr=""  data-search="subjectname,'/',subjectgroupname,'/',subjectgroupprice"/>-->

                    <!--        <input type="hidden" data-table="studentaddsubjectid" data-id="{$studentspaydata->studentaddsubjectid}" data-text="{$studentspaydata->studentsubjects}"-->
                    <!--        class="selectedit" />-->
                    <!--    </div>-->
                    <!--</div>-->
                    <div class="form-group paymentsystems" {if  $studentspaydata->paykind neq 2} style="display: none"{/if}>
                         <label for="txtName" class="col-lg-2 control-label">  انظمة  الدفع </label>
                        <div class="col-lg-4">
                             <input id="studentspaymentsystemid" type="text" name="studentspaymentsystemid" class=" getselectjoin"  data-placeholder="اختر  النظام " data-table="studentspaymentsystems" data-join=""   data-filter=" and studentspaymentsystems.del < 2 " data-parent="studentaddsubjectid" data-itr=""  data-search="paymentname,'/',paymentprice"/>
                            <input type="hidden" data-table="studentspaymentsystemid" 
                            data-id="{$studentspaydata->studentspaymentsystemid}"
                             data-text="{$studentspaydata->studentspaymentsystems}"
                            class="selectedit" />
                        </div>
                    </div>

                    <div class="form-group" >
                         <label for="txtName" class="col-lg-2 control-label"> المتدربين</label>
                        <div class="col-lg-4">
                            <input id="studentaddsubjectdetails" type="text" name="studentaddsubjectdetailid"  class="studentpay getselectjoin"  data-placeholder="اختر  المتدرب  " data-table="studentaddsubjectdetails
                            " data-join=" LEFT JOIN students ON studentaddsubjectdetails.studentid = students.id "   data-filter=" and studentaddsubjectdetails.del < 2 and students.del < 2 " data-parent="studentaddsubjectid" 
                            data-itr=""  data-search="studentname,'/',studentphone" required/>
                            <input type="hidden" data-table="studentaddsubjectdetails" data-id="{$studentspaydata->studentaddsubjectdetailid}" data-text="{$studentspaydata->students}"
                            class="selectedit" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">تاريخ البدايه</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control " disabled="" value="{$studentspaydata->paystartdate}" >
                       </div>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">تاريخ  نهاية الدفع</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control awdatepicker payenddate" autocomplete="off"   data-date-format="yyyy-mm-dd" name="payenddate" placeholder="yyyy-mm-dd" 
                         value="{$studentspaydata->payenddate}"  required>
                         <input type="hidden" id="payenddateold"  value="{$studentspaydata->payenddate}">
                       </div>
                    </div>
                   
                   {if $studentspaydata->studentsettingpayid}
                   <div class="form-group countmonth" {if $studentspaydata->paykind neq 3}   style="display: none" {/if}>
                        <label for="txtName" class="col-lg-2 control-label"> نظام الاشتراك</label>
                        <div class="col-lg-4">
                            <select class="selectnew countmonths" data-placeholder="اختر   "   name="countmonths"  id="month">
                            <option value=""></option>
                            {foreach $studentsettingpays as $studentsettingpay}
                            <option value="{$studentsettingpay->id}" {if $studentspaydata->studentsettingpayid eq $studentsettingpay->id} selected="" {/if} data-countmonth="{$studentsettingpay->countmonths}" data-name="{$studentsettingpay->name}"  data-price="{$studentsettingpay->price}" >{$studentsettingpay->name}  / {$studentsettingpay->price} </option>
                            {/foreach}
                        </select>
                        </div>
                    </div>
                    {else}
                    <div class="form-group countmonth" {if $studentspaydata->paykind neq 3}   style="display: none" {/if}>
                        <label for="txtName" class="col-lg-2 control-label">عدد الشهور</label>
                        <div class="col-lg-4">
                            <select class="selectnew countmonths" data-placeholder="اختر   " name="countmonths"   id="month">
                            <option value=""></option>
                            {for $foo=1 to 12}
                            <option value="{$foo}" {if $studentspaydata->countmonths eq $foo} selected="" {/if}>{$foo} شهر  </option>
                            {/for}
                        </select>
                        </div>
                    </div>
                    {/if}
                    
                     <div class="form-group newprice" {if  $studentspaydata->paykind neq 3}  style="display: none" {/if}>
                        <label for="txtName" class="col-lg-2 control-label">سعر  خاص      </label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control floats" id="countmonths" placeholder="سعر  خاص    "    digits="true"  name="newprice"  value="{$studentspaydata->newprice}">
                       </div>
                    </div>
                    
                     <div class="form-group newprice"  {if  $studentspaydata->paykind neq 3}  style="display: none" {/if}>
                        <label for="txtName" class="col-lg-2 control-label">نوع الدفع      </label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control floats" id="namepay"  placeholder=" نوع الدفع"   name="namepay"  value="{$studentspaydata->namepay}">
                       </div>
                    </div>
                    
                     <div class="form-group ">
                        <label for="txtName" class="col-lg-2 control-label">تعليق الدفع</label>
                        <div class="col-lg-4">
                         <textarea  class="form-control" name="commentpay" rows="2"  id="commentpay" placeholder="تعليق الدفع">  {$studentspaydata->commentpay} </textarea>
                       </div>
                    </div>

                   

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


                   {if $studentspaydata->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>
<!-- Button trigger modal -->


<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-body modalbody" style="    text-align: center;">
                <a href="javascript:;" data-id="" type="button" class="btn btn-default btn-lg studentspaysend2"  id="studentspaysend" >       نسخ  الكود   </a>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
    selectedit();
    deldata();
     });
</script>

