
<div class="row">
    <div class="container">
        <div class="panel panel-default panel-m">
            <div class="panel-heading">

                <div class="caption"><i class="icon-comments"></i>اعدادات دليل الحسابات</div>
                <a href="{$youtubes[218]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>

            <div class="panel-body" >
                <form class="nameToBeChecked form-horizontal row" action="accountstree.php?do=set" method="post">
                    <div class="form-group col-4" style="float: right">
                        <div class="col-6">
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="calTreeNodes" value="1" {if $calTreeNodes == 1} checked {/if}>
                                    نعم </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="calTreeNodes" value="0" {if $calTreeNodes != 1} checked {/if}>
                                    لا </label>
                            </div>
                        </div>
                        <label class="col-6 control-label">حساب قيم النقط الرئيسيه</label>
                    </div>
                    <div class="form-group col-4" style="float: right">
                        <div class="col-6">
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="showClientsAtTree" value="1" {if $showClientsAtTree == 1} checked {/if}>
                                    نعم </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="showClientsAtTree" value="0" {if $showClientsAtTree != 1} checked {/if}>
                                    لا </label>
                            </div>
                        </div>
                        <label class="col-6 control-label">اظهار العملاء</label>
                    </div>
                    <div class="form-group col-4" style="float: right">
                        <div class="col-6">
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="showSuppliersAtTree" value="1" {if $showSuppliersAtTree == 1} checked {/if}>
                                    نعم </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="showSuppliersAtTree" value="0" {if $showSuppliersAtTree != 1} checked {/if}>
                                    لا </label>
                            </div>
                        </div>
                        <label class="col-6 control-label">اظهار الموردين</label>
                    </div>
                    <div class="clearfix"></div>
                    {assign var=i value=1}
                    {foreach $levelSetting as $setting}
                    <div class="form-group col-4" style="float: right">
                        <div class="col-6">
                            <input type="text" class="form-control positiveNo" id="level{$i}" name="level{$i}" value="{$setting->nooffields}"/>
                        </div>
                        <label class="col-6 control-label">عدد خانات المستوى{$i} </label>
                    </div>
                    {assign var=i value=$i+1}
                    {/foreach}
                    <div class="form-group col-12" align="center">
                        <button type="submit" class="btn btn-primary">حفظ</button>
                    </div>
                </form>
                <!---- portlet-body----->
            </div>
            <!---- panel-body----->
        </div>
        <div class="panel panel-default panel-m" style=" position: relative; ">
            <div class="load_maxtree" style="display: none">
                <img src="{$path}/assets/img/progress.gif" alt=""/>
            </div>
            <div class="panel-heading">
                <div class="caption"><i class="icon-comments"></i>دليل الحسابات</div>
                <div class="actions"> <!--a href="javascript:;" id="tree_expense_collapse" class="btn btn-success"> اغلاق الكل</a> <a href="javascript:;" id="tree_expense_expand" class="btn btn-warning"> فتح الكل</a-->
                    <a href="javascript:;" id="collapseAll" class="btn btn-default bg-black"> إغلاق الكل</a>
                    <a href="javascript:;" id="expandAll" class="btn btn-info"> فتح الكل</a>
                    <a href="javascript:;" id="accounts_tree_add" class="btn btn-success">اضافة عنصر</a>
                    <!--a href="javascript:;" id="accounts_tree_check" class="btn btn-info"> تحقق من الحسابات</a-->
                    <a href="javascript:;" id="redrawtree" class="btn btn-primary"> اعادة تحميل الشجرة</a>
                    {if $startGoods == 1}<a href="javascript:;" id="startGoods" class="btn btn-warning"> بضاعة اول المدة</a>{/if}


                    <a href="javascript:;" id="resetFromProg" class="btn btn-info">اعادة اسماء عناصر من البرنامج للأصل</a>
                    <a href="accountstree.php?do=exportAsExcel" class="btn excelicon" title="تصدير اكسل"></a>

                </div>
            </div>
            <div class="panel-body" style="overflow-x:auto;  overflow-y:auto; height:1000px;">
                <div id="part1" class="col-lg-6" style="width:98%">
                    <div class="maxtree">
                        <ul>
                            <li>
                                <span id="trunk" class="collapsed"><i class="icon-leaf"></i> دليل الحسابات</span>
                                <ul id="myTree">
                                    {$treeHTML}
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
                <div id="part2" class="col-lg-6">

                </div>
                <!---- portlet-body----->
            </div>
            <!---- panel-body----->
        </div>
        <!----panel----->
    </div>
    <!----panel----->
</div>




<!-- ======================= accountstree Modal Box =========== -->
<!-- Modal -->
<div class="modal fade" id="accountsTreeModal" tabindex="-1" role="dialog" aria-labelledby="accountsTreeModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content bg-modal">
            <div class="modal-header">
                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">
                    <label> اضافه عنصر</label>
                </h4>
            </div>
            <div class="modal-body">
                <form id="accountsTreeInfo" action="#" method="post" class="form-horizontal">
                    <input type="hidden" id="itemIdModal" name="itemIdModal" value=""/>
                    <div class="form-group">
                        <label class="col-lg-3 control-label">اسم العنصر</label>
                        <div class="col-lg-8">
                            <input name="elementName" type="text" id="elementName"  class="form-control"/>
                        </div>
                    </div>
                    <!------------------------------>

                    <div class="form-group">
                        <label class="col-lg-3 control-label">والد العنصر</label>
                        <div class="col-lg-8">{*for $foo=0 to $to max={$element->notes}}- {/for*}
                            <select id="parent" name="parent" data-placeholder="اختر" class="select2 wdt100">
                                <option value="0"> لا يوجد</option>
                                {foreach $accountsTreeOrdered as $element}
                                <option value="{$element->id}">{$element->notes}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <!------------------------------>
                    <div class="form-group">
                        <label class="col-lg-3 control-label">نوع العنصر</label>
                        <div class="col-lg-8">
                            <select id="itemtype2" name="itemtype2" data-placeholder="اختر" class="select2 wdt100">
                                <option value="0">والد</option>
                                <option value="1">عنصر نهائى</option>
                            </select>
                        </div>
                    </div>
                    <!------------------------------>
                    <div class="form-group">
                        <label class="col-lg-3 control-label">طبيعة العنصر</label>
                        <div class="col-lg-8">
                            <select id="accountNature" name="accountNature" data-placeholder="اختر" class="select2 wdt100">
                                <option value="0">مدين</option>
                                <option value="1">دائن</option>
                            </select>
                        </div>
                    </div>
                    <!------------------------------>
                    <div class="form-group" id="theValueDiv">
                        <label class="col-lg-3 control-label">الرصيد الافتتاحى</label>
                        <div class="col-lg-8">
                            <input name="theValue" type="text" id="theValue"  class="form-control"/>
                        </div>
                    </div>
                    <!------------------------------>
                    <div class="form-group">
                        <label class="col-lg-3 control-label">النوع</label>
                        <div class="col-lg-8">
                            <select id="itemtype" name="itemtype" data-placeholder="اختر" class="select2 wdt100">
                                <option value="3">اصول</option>
                                <option value="1">خصوم او التزامات</option>
                                <option value="4">حقوق ملكية</option>
                                <option value="2">ايرادات</option>
                                <option value="5">تكلفة النشاط</option>
                                <option value="0">مصروفات</option>

                            </select>
                        </div>
                    </div>
                    <!------------------------------>
                    <div class="form-group" id="reportidDiv" style="display: none">
                        <label class="col-lg-3 control-label">فى تقرير</label>
                        <div class="col-lg-8">
                            <select id="reportid" name="reportid" data-placeholder="اختر" class="select2 wdt100">
                                <option value="0">لا يوجد</option>
                                <option value="1">متاجرة</option>
                                <option value="2">ارباح و خسائر "الدخل"</option>
                            </select>
                        </div>
                    </div>
                    <!------------------------------>
                    <div class="form-group" id="listidDiv">
                        <label class="col-lg-3 control-label">القائمة</label>
                        <div class="col-lg-8">
                            <select id="listid" name="listid" data-placeholder="اختر" class="select2 wdt100">
                                <option value="0">لا يوجد</option>
                                <option value="1">ميزانية</option>
                                <option value="2">قائمة الدخل</option>
                            </select>
                        </div>
                    </div>
                    <!------------------------------>

                    <!--div class="form-group">
                        <label class="col-lg-3 control-label">حاليا</label>
                        <div class="col-lg-4">
                            <select id="itemfrom" name="itemfrom" data-placeholder="اختر" class="select2 wdt100">
                                <option value="0">من البرنامج</option>
                                <option value="1">مضاف من الشجرة</option>
                            </select>
                        </div>
                    </div-->
                    <!------------------------------>
                    <div class="form-group">
                        <label class="col-lg-3 control-label">ملاحظات</label>
                        <div class="col-lg-8">
                            <textarea name="notes" id="notes" rows="3"  class="form-control"></textarea>
                        </div>
                    </div>
                    <!------------------------------>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default closeAccountsTreeForm" id="cancel">اغلاق</button>
                <button type="button" id="insert" class="btn btn-primary insertAccountsTree">حفظ</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ============================================= -->


<!-- ======================= account detail Modal Box =========== -->
<!-- Modal -->
<div class="modal fade" id="accountDetailModal" tabindex="-1" role="dialog" aria-labelledby="accountDetailModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                <span class="modal-title color-black">دفتر الأستاذ</span>
            </div>
            <div class="modal-body" id="accountDetailDiv">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default closeAccountDetailForm" id="cancel">اغلاق</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ============================================= -->


<!-- ======================= start goods val Modal Box =========== -->
<!-- Modal -->
<div class="modal fade" id="startgoodsvalModal" tabindex="-1" role="dialog" aria-labelledby="accountDetailModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                <span class="modal-title color-black"> بضاعة اول المدة</span>
            </div>
            <div class="modal-body">
                <p><span style="color: red">ملحوظة:</span><span>يمكنك التعديل فى قيمة بضاعة اول المده طالما لم تعمل بفاتورة بيع</span></p>
                <p>
                    اجمالى قيمة البضاعة فى المخزن = <span id="startgoodsvalDiv"></span>
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default closestartgoodsvalModal" id="cancel">اغلاق</button>
                <button type="button" id="insert" class="btn btn-primary approveasstartgoods">تصديق على القيمة</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ============================================= -->


<!-- ======================= confirm del =========== -->
<!-- Modal -->
<div class="modal fade" id="confirm" tabindex="-1" role="dialog" aria-labelledby="confirmdelModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                <span class="modal-title color-black">رسالة تاكيد</span>
            </div>
            <div class="modal-body">
                هل انت متأكد؟
            </div>
            <div class="modal-footer">
                <button type="button" data-dismiss="modal" class="btn btn-primary" id="myDelete">حذف</button>
                <button type="button" data-dismiss="modal" class="btn" id="myCancel">الغاء</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ============================================= -->
