<!-- BEGIN CONTENT -->
<script src="{$path}/_assets/global/plugins/jquery.min.js" type="text/javascript"></script>

<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" id="theform" class="form-horizontal" 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-4">
                                        <input type="text" class="form-control" placeholder="الرابط" name="link" id="link" value="{$returnedData->link}">
                                    </div>
                                    <span class="help-block help-block-error" id="showerrortitle" style="color: #F3565D"></span>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" style="text-align: right">نوع الرابط</label>
                                    <div class="col-sm-2">

                                        <label>
                                            <input type="radio" name="link_type" value="0" {if $returnedData->link_type eq 0} checked {/if}>داخلي
                                        </label>

                                    </div>

                                    <div class="col-sm-2">

                                        <label>
                                            <input type="radio" name="link_type" value="1" {if $returnedData->link_type eq 1} checked {/if}>خارجي
                                        </label>

                                    </div>
                                </div>


                                <div class="clearfix"></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 {$returnedData->image} eq "no image" OR {$returnedData->image} eq ""}
                                                <input type="hidden" id="imageurl" name="imageurl" value="no image"/>{else}
                                                <div class="thumb" style="height: 100%;">
                                                    <img src="{$hosturl}/../upload/{$controllname}/{$returnedData->image}" style="height: 100%; width: 100%; ">
                                                </div>
                                                <input type="hidden" id="imageurl" name="imageurl" value="{$returnedData->image}" />{/if}
                                            </div>
                                            <div>
                                                <span class="btn default btn-file">
                                                    <span class="fileinput-new">استعراض</span>
                                                    <span class="fileinput-exists">تغيير</span>
                                                    <input type="file" name="image"  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>
                            <div class="form-actions">
                                <div class="row">
                                    <div class="col-md-offset-3 col-md-4">
                                        <input type="hidden" name="id" value="{$returnedData->id}">

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