<!--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="{$city->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="{$city->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 select2me" name="country" id="country" required>
                                            <option value="">اختر </option>
                                            {foreach $allcountry as $data}
                                            <option value="{$data.id}" {if $data.id == $city_governorate->country_id}selected{/if}>{$data.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="hidden" name="gov_id_h" id="gov_id_h" value="{$city_governorate->id}">
                                        <input type="hidden" name="gov_title_h" id="gov_title_h" value="{$city_governorate->title}">
                                        <input type="text" style="width: 100%" class="select2governorate" name="governorate" id="governorate" required/>
                                    </div>
                                </div>


                                <div class="col-md-12">
                                    <h5 class="pull-left">المناطق</h5>
                                    <button type="button" class="btn blue-madison pull-right myplusbtn" id="region_btn">اضافه منطقة</button>
                                </div>
                                <div class="clearfix"></div>
                                <br/>


                                <ul class="list-group plusitemprop" id="plusitemprop">
                                    {assign var=count value=1}
                                    {foreach $cityregions as $single}
                                    <li class="list-group-item row nomargin">
                                        <div class="form-group col-md-5">
                                            <label class="col-md-1 control-label">الاسم</label>
                                            <div class="col-md-11">
                                                <div class="input-icon right" style="margin-right: 10px;">
                                                    <i class="fa fa-font"></i>
                                                    <input type="hidden" id="regid{$count}" name="regid{$count}" value="{$single->id}" />
                                                    <input type="text" class="form-control" placeholder="اسم المنطقة" name="region{$count}" required value="{$single->title}">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group col-md-5">
                                            <label class="col-md-1 control-label">Name</label>
                                            <div class="col-md-11">
                                                <div class="input-icon right" style="margin-right: 23px;">
                                                    <i class="fa fa-font"></i>
                                                    <input type="text" class="form-control" placeholder="region name" name="region_en{$count}" required value="{$single->title_en}">
                                                </div>
                                            </div>
                                        </div>
                                        {if $count neq 1}
                                        <div class="col-md-1 pull-right">
                                            <button type="button" class="btn spinner-down red minsregion" data-edit="0" data-id="{$single->id}">
                                                <i class="fa fa-minus"></i>
                                            </button>
                                        </div>
                                        {/if}

                                    </li>
                                    {capture assign=count}{$count+1}{/capture}
                                    {/foreach}
                                </ul>
                                <input type="hidden" id="itr" name="itr" value="{$count}" />



                                <input type="hidden" id="id" name="id" value="{$city->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>