

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

        <ol class="breadcrumb">
            <li><a href="#">نظام المتدربين</a></li>
            <li><a href="studentsPay.php?do=show">عرض دفع المتدربين </a></li>
            <li class="active">اضافة  </li>
        </ol>


        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">اضافة  </h3>
            </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}
                    
                     <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} checked {/if}>
                            <label for="client"> دفع بالتخصص </label>
                            {/if}
                             {if $studentsetting->paymentsystems2}
                            <input type="radio" class="paykind"  name="paykind" value="2" {if !$studentsetting->paymentsystems1 && $studentsetting->paymentsystems2} checked {/if}>
                            <label for="supplier">دفع بالنظام </label>
                             {/if}
                             {if $studentsetting->paymentsystems3}
                             <input type="radio" class="paykind"  name="paykind" value="3" {if !$studentsetting->paymentsystems1 && !$studentsetting->paymentsystems2 && $studentsetting->paymentsystems3} 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"/>-->
                    <!--        {if $studentaddsubjects->del lt 2 && $studentsetting->studentaddsubjectid gt 0 }-->
                    <!--          <input type="hidden" data-table="studentaddsubjectid" data-id="{$studentsetting->studentaddsubjectid}" -->
                    <!--            data-text="{$subjectgroups}"-->
                    <!--        class="selectedit" />-->
                    <!--        {/if}-->
                    <!--    </div>-->
                    <!--</div>-->
                    <div class="form-group paymentsystems" {if $studentsetting->paymentsystems1 || 
                        !$studentsetting->paymentsystems2} 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"/>
                        </div>
                    </div>

                    <div class="form-group" >
                         <label for="txtName" class="col-lg-2 control-label"> المتدربين</label>
                        <div class="col-lg-4">
                            <input id="" 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/>
                        </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="{$lastday}"  required>
                        <input type="hidden" id="payenddateold"  value="{$lastday}">
                       </div>
                    </div>
                    <!--<div class="form-group countmonth"  {if $studentsetting->paymentsystems1 || $studentsetting->paymentsystems2 || !$studentsetting->paymentsystems3}  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}">{$foo} شهر  </option>-->
                    <!--        {/for}-->
                    <!--    </select>-->
                    <!--    </div>-->
                    <!--</div>-->
                    
                    <div class="form-group countmonth"  {if $studentsetting->paymentsystems1 || $studentsetting->paymentsystems2 || !$studentsetting->paymentsystems3}  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}"  data-countmonth="{$studentsettingpay->countmonths}" data-name="{$studentsettingpay->name}"  data-price="{$studentsettingpay->price}" >{$studentsettingpay->name}  / {$studentsettingpay->price} </option>
                            {/foreach}
                        </select>
                        </div>
                    </div>
                     <div class="form-group newprice" {if $studentsetting->paymentsystems1 || $studentsetting->paymentsystems2 || !$studentsetting->paymentsystems3}  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" >
                       </div>
                    </div>
                    
                     <div class="form-group newprice" {if $studentsetting->paymentsystems1 || $studentsetting->paymentsystems2 || !$studentsetting->paymentsystems3}  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" >
                       </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" id="commentpay" rows="2"  placeholder="تعليق الدفع"></textarea>
                       </div>
                    </div>
                    
                    {if $searchinonesave eq 0}
                     <div class="form-group"  >
                        <label  class="col-lg-2 control-label">الخزنه </label>
                        <div class="col-lg-4">
                            <select name="save_id"   data-placeholder="اختر " class="selectnew">
                                <option value=""></option>
                               {foreach $saveusers as $single}
                                <option value="{$single.saveid}" {if $saveid eq $single.saveid}selected{/if}>{$single.savename} </option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    {else}
                     <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 "  readonly  value="{$saveuser.savename}" >
                        <input type="hidden" class="form-control "  name="save_id"  value="{$saveid}" >
                       </div>
                    </div>
                    {/if}
                    
                   



                   
                    <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>




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




    </div>
</div>
<!-- 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();
     });
</script>

