<!-- 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="عرض البيانات">
                                <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" 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="alert alert-warning display-hide" id="showerrorname">
                                    <button class="close" data-close="alert"></button>
                                    اختر اسم اخر لان هذا مستخدم من قبل
                                </div>


                                <!--                                <div class="form-group form-md-line-input has-info">
                                                                    <label>اسم الألبوم</label>
                                                                    <div class="input-group">
                                                                        <span class="input-group-addon">
                                                                            <i class="fa fa-users"></i>
                                                                        </span>
                                                                        <input type="text" class="form-control" placeholder="اسم الألبوم" value="{$product->name}" required="required" name="name">
                                                                    </div>
                                                                </div>-->

                                <!--                                <div class="form-group ">
                                                                    <label class="control-label">الصورة</label>
                                                                    <div>
                                                                        <div class="fileinput fileinput-new" data-provides="fileinput">
                                                                            <div class="fileinput-preview thumbnail" data-trigger="fileinput"
                                                                                 style="width: 200px; height: 150px;"></div>
                                                                            <div class=" thumbnail" data-trigger="fileinput"
                                                                                 style="width: 200px; height: 150px;">
                                                                                {if {$product->image} eq "no image" OR {$product->image} eq ""}
                                                                                <input type="hidden" name="imageurl" value="no image"/>{else}
                                                                                <div class="thumb" style="height: 100%;">
                                                                                    <img src="{$hosturl}/../upload/photo/{$product->image}"
                                                                                         style="height: 100%; width: 100%; ">
                                                                                </div>
                                                                                <input type="hidden" name="imageurl" value="{$product->image}"/>{/if}
                                                                            </div>
                                                                            <div>
                                                                                <span class="btn default btn-file">
                                                                                    <span class="fileinput-new">استعراض</span>
                                                                                    <span class="fileinput-exists">تغيير</span>
                                                                                    <input type="file" name="filee" class="img_cls" {if {$product->image} eq "no image" OR {$product->image} eq ""} required  {/if}>
                                                                                </span>
                                                                                <a href="#" class="btn red fileinput-exists" data-dismiss="fileinput">
                                                                                    حذف </a>
                                                                            </div>
                                                                        </div>
                                                                        <div class="clearfix margin-top-10 margin-bottom-10">
                                                                            <span class="label label-danger">ملاحظه!</span> يمكنك فقط رفع صور
                                                                        </div>
                                                                    </div>
                                                                </div>-->

                                <div class="form-group form-md-line-input has-info">
                                    <div class="input-group">
                                        <select class="form-control input-xlarge select2me input-sm select2-offscreen noborder" data-placeholder="اختر عنصر" name="albumId">
                                            <option value=""></option>
                                            <option value="1" {if $product->name eq 1}selected{/if}>معرض الأعمال</option>
                                            <option value="2" {if $product->name eq 2}selected{/if}>أعمالنا</option>
                                        </select>
                                        <label for="form_control_1">الفئة</label>
                                    </div>
                                </div>

                                <div class="col-md-12">
                                    <h3 class="pull-left">صور الألبوم</h3>
                                    <button type="button" class="btn blue-madison pull-right" id="addimageto">
                                        اضافة صورة جديده
                                    </button>
                                </div>
                                <div class="clearfix"></div>
                                <br/>


                                <ul class="list-group plusitemprop" id="plusitemimg">
                                    {assign var=count value=1}
                                    {foreach $productimages as $single}
                                    <li class="list-group-item row nomargin">

                                        <div class="form-group col-md-4">
                                            <label class="col-md-3 control-label">الاسم</label>
                                            <div class="col-md-8">
                                                <div class="input-icon right">
                                                    <i class="fa fa-font"></i>
                                                    <input type="text" class="form-control" placeholder="الاسم" name="image_name{$count}" value="{$single->title}" >
                                                    <input type="hidden" id="propid{$count}" name="propid{$count}" value="{$single->id}"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group col-md-4">
                                            <label class="control-label col-md-3">صورة</label>
                                            <div class="col-md-4">
                                                <div class="fileinput fileinput-new" data-provides="fileinput">
                                                    <div class="fileinput-preview thumbnail" data-trigger="fileinput"
                                                         style="width: 150px; height: 100px;"></div>
                                                    <div>
                                                        <span class="btn default btn-file">
                                                            <span class="fileinput-new">استعراض</span>
                                                            <span class="fileinput-exists">تغيير</span>
                                                            <input type="file" name="image_file{$count}" class="img_cls" {if {$single->image} eq "no image" OR {$single->image} eq ""} required  {/if}>
                                                        </span>
                                                        <a href="#" class="btn red fileinput-exists"
                                                           data-dismiss="fileinput">
                                                            حذف </a>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-4">
                                                <div class=" thumbnail" data-trigger="fileinput"
                                                     style="width: 150px; height: 100px;">
                                                    {if {$single->image} eq "no image" OR {$single->image} eq ""}
                                                    <input type="hidden" name="image_imageurl{$count}"
                                                           value="no image"/>{else}
                                                    <div class="thumb" style="height: 100%;">
                                                        <img src="{$hosturl}/../upload/photoimage/{$single->image}"
                                                             style="height: 100%; width: 100%; ">
                                                    </div>
                                                    <input type="hidden" name="image_imageurl{$count}"
                                                           value="{$single->image}"/>{/if}
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-1 pull-right">
                                            <button type="button" class="btn spinner-down red minsimage" data-edit="0"
                                                    data-id="{$single->id}">
                                                <i class="fa fa-minus"></i>
                                            </button>
                                        </div>
                                    </li>
                                    {capture assign=count}{$count+1}{/capture}
                                    {/foreach}
                                </ul>
                                <input type="hidden" id="imgitr" name="imgitr" value="{$productimages|@count}"/>




                                <input type="hidden" id="id" name="id" value="{$product->id}"/>
                                <input type="hidden" id="control_name" value="{$controllname}"/>


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


<!-- responsive -->
<div id="responsive" class="modal fade" tabindex="-1" data-width="380">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h4 class="modal-title">{$smarty.const.productAddProductTitle}</h4>
    </div>
    <div class="modal-body">
        <div class="row">
            <div class="col-md-12">
                <h4>{$smarty.const.productAddProductCodeTitle}</h4>
                <p>
                    <input class="form-control" type="text" required="required" name="product_code" id="product_code"
                           digits="true"></p>
                <p id="relateproduct">
                    {$smarty.const.productAddProductProductNameTitle}</p>

                <input type="hidden" id="product_relate_id">
                <input type="hidden" id="product_relate_name">
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" data-dismiss="modal" class="btn btn-outline dark">{$smarty.const.productAddProductCloseButton}</button>
            <button type="button" class="btn green" id="addrelate">{$smarty.const.productAddProductAddButton}</button>
        </div>
    </div>
</div>

<div id="cont_properties" style="display: none;">
    {foreach $propertys as $single}
    <option value="{$single->prop_id}">{$single->name}</option>
    {/foreach}
</div>


<div style="display: none;">
    <div id="uploadChooseuttonTitle">{$smarty.const.uploadChooseuttonTitle}</div>
    <div id="uploadChangeButtonTitle">{$smarty.const.uploadChangeButtonTitle}</div>
    <div id="uploadDeleteButtonTitle">{$smarty.const.uploadDeleteButtonTitle}</div>
    <div id="productImageImageTitle">{$smarty.const.productImageImageTitle}</div>
    <div id="productImageEnglishNameTitle">{$smarty.const.productImageEnglishNameTitle}</div>
    <div id="productImageArabicNameTitle">{$smarty.const.productImageArabicNameTitle}</div>
    <div id="productAddProductProductNameTitle">{$smarty.const.productAddProductProductNameTitle}</div>
    <div id="productAddProductNumberNotify">{$smarty.const.productAddProductNumberNotify}</div>
    <div id="productChooseOneTitle">{$smarty.const.productChooseOneTitle}</div>
    <div id="productPropertyArabicValueTitle">{$smarty.const.productPropertyArabicValueTitle}</div>
    <div id="productPropertyEnglishValueTitle">{$smarty.const.productPropertyEnglishValueTitle}</div>
    <div id="productPropertyPropertyTitle">{$smarty.const.productPropertyPropertyTitle}</div>
</div>