<!--BEGIN CONTENT -->
<div class="page-content-wrapper">
    <div class="page-content">
        <!-- BEGIN PAGE HEADER-->
        <h3 class="page-title">
            {$shcontrollname}
        </h3>
        <div class="page-bar">
            <ul class="page-breadcrumb">
                {$breadcrumbs}
            </ul>
        </div>
        <!-- END PAGE HEADER-->
        <!-- BEGIN PAGE CONTENT-->
        <div class="row">
            <div class="col-md-12">
                <div class="portlet light bg-inverse">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="icon-equalizer font-red-sunglo"></i>
                            <span class="caption-subject font-red-sunglo bold uppercase">تعديل في {$shcontrollname}</span>
                        </div>
                        <div class="actions">
                            <a class="btn default btn-xs blue tooltips" href="{$hosturl}/{$controllname}/show" data-container="body" data-placement="top" data-original-title="Show">
                                <i class="icon-list"></i>
                                عرض البيانات
                            </a>
                        </div>
                    </div>
                    <div class="portlet-body form">
                        <!-- BEGIN FORM-->
                        <form action="{$hosturl}/{$controllname}/updateit" method="post" class="form-horizontal editForm" id="subjects_form" data-link="{$controllname}" enctype="multipart/form-data">
                            <div class="form-body">
                                <div class="alert alert-danger display-hide">
                                    <button class="close" data-close="alert"></button>
                                    لديك خطأ في إدخال البيانات, حاول مرة أخرى.
                                </div>
                                <div class="alert alert-success display-hide">
                                    <button class="close" data-close="alert"></button>
                                    لقد أدخلت بيانات صحيحة.
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right">الاسم</label>
                                    <div class="col-md-8">
                                        <input type="text" class="form-control" placeholder="الاسم" name="title" id="title" value="{$course->title}" maxlength="50" minlength="2" required>
                                    </div>
                                    <span class="help-block help-block-error" id="showerrortitle" style="color: #F3565D"></span>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right">الاسم بالانجليزي</label>
                                    <div class="col-md-8">
                                        <input type="text" class="form-control" placeholder="الاسم بالانجليزي" name="title_en" id="title_en" maxlength="50" minlength="2" value="{$course->title_en}" required>
                                    </div>
                                    <span class="help-block help-block-error" id="showerrortitle" style="color: #F3565D"></span>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right">التخصص </label>
                                    <div class="col-md-8">
                                        <select class="form-control" name="sepcialityid" id="sepcialityid" required>
                                            <option value="">اختر التخصص</option>
                                            {foreach $allSpeciality as $sp}
                                            <option value="{$sp->id}" {if $course->sepcialityid eq $sp->id}selected{/if}>{$sp->title}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right">السعر</label>
                                    <div class="col-md-8">
                                        <input type="number" min="0" class="form-control" placeholder="السعر" name="price" value="{$course->price}" id="price" required>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right">المدينة</label>
                                    <div class="col-md-8">
                                        <input type="text" class="form-control" placeholder="المدينة" name="city" id="city" value="{$course->city}" maxlength="50" minlength="2" required>
                                    </div>
                                    <span class="help-block help-block-error" id="showerrortitle" style="color: #F3565D"></span>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right">المدينة بالانجليزي</label>
                                    <div class="col-md-8">
                                        <input type="text" class="form-control" placeholder="المدينة بالانجليزي" name="city_en" id="city_en" value="{$course->city_en}" maxlength="50" minlength="2" required>
                                    </div>
                                    <span class="help-block help-block-error" id="showerrortitle" style="color: #F3565D"></span>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right">المدة(بالساعات)</label>
                                    <div class="col-md-8">
                                        <input type="number" min="0" class="form-control" placeholder="المدة(بالساعات)" name="duration" id="duration" value="{$course->duration}" required>
                                    </div>
                                    <span class="help-block help-block-error" id="showerrortitle" style="color: #F3565D"></span>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right"> صورة</label>
                                    <div class="col-md-8">
                                        <div class="clearfix"></div>
                                        <div class="fileinput fileinput-new" data-provides="fileinput">
                                            <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;">
                                                {if {$course->image} eq "no image" OR {$course->image} eq ""}
                                                <input type="hidden" id="imageurl" name="imageurl" value="no image"/>{else}
                                                <div class="thumb" style="height: 100%;">
                                                    <img src="{$hosturl}/../upload/{$controllname}/{$course->image}" style="height: 100%; width: 100%; ">
                                                </div>
                                                <input type="hidden" id="imageurl" name="imageurl" value="{$course->image}" />{/if}
                                            </div>
                                            <div>
                                                <span class="btn default btn-file">
                                                    <span class="fileinput-new">استعراض</span>
                                                    <span class="fileinput-exists">تغيير</span>
                                                    <input type="file" name="course"  accept="image/jpg, image/jpeg, image/png" class="img_cls">
                                                </span>
                                                <!-- <a href="#" class="btn red fileinput-exists" data-dismiss="fileinput">
                                                        حذف </a> -->
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right">التفاصيل</label>
                                    <div class="col-md-8">
                                        <textarea name="details" id="details" rows="7" class="form-control ckeditor">{$course->details}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label" style="text-align: right">Details</label>
                                    <div class="col-md-8">
                                        <textarea name="details_en" id="details_en" rows="7" class="form-control ckeditor">{$course->details_en}</textarea>
                                    </div>
                                </div>


                                <input type="hidden" id="id" name="id" value="{$course->id}" />
                            </div>
                            <div class="form-actions">
                                <div class="row">
                                    <div class="col-md-offset-3 col-md-4">
                                        <button type="submit" class="btn green">حفظ</button>
                                        <button type="button" class="btn default rtnshow" data-controll="{$controllname}">إلغاء</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <!-- END FORM-->
                    </div>
                </div>
            </div>
        </div>
        <!-- END PAGE CONTENT-->
    </div>
</div>
<!-- END CONTENT-->
<script src="{$path}/_assets/custom/image_validation.js"></script>