<?php /* Smarty version Smarty-3.1.11, created on 2025-01-19 17:32:58
         compiled from "../views/default/assetsview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:523429739678d1b2a294472-64526659%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '56e58d676b688a8c150231c2debde99401259a70' => 
    array (
      0 => '../views/default/assetsview/show.html',
      1 => 1698610734,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '523429739678d1b2a294472-64526659',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'message' => 0,
    'youtubes' => 0,
    'outputString' => 0,
    'allassetdata' => 0,
    'assetsearch' => 0,
    'usergroupname' => 0,
    'assetData' => 0,
    'asset' => 0,
    'i' => 0,
    'assetId' => 0,
    'sumValue' => 0,
    'paginate' => 0,
    'clientdata' => 0,
    'client' => 0,
    'savedata' => 0,
    'save' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_678d1b2a478949_67953355',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_678d1b2a478949_67953355')) {function content_678d1b2a478949_67953355($_smarty_tpl) {?><?php if (!is_callable('smarty_function_paginate_prev')) include '/home/gt4it/public_html/muritrade/public/libs/plugins/function.paginate_prev.php';
if (!is_callable('smarty_function_paginate_middle')) include '/home/gt4it/public_html/muritrade/public/libs/plugins/function.paginate_middle.php';
if (!is_callable('smarty_function_paginate_next')) include '/home/gt4it/public_html/muritrade/public/libs/plugins/function.paginate_next.php';
?><div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="#">الأصول</a></li>
            <li class="active">عرض الأصول</li>
        </ol>
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading" style="padding:5px 15px 15px">
                <h3 class="panel-title" style="display: inline-block;">عرض الأصول <br />
                    <?php if ($_smarty_tpl->tpl_vars['message']->value!=''){?>
                    <?php echo $_smarty_tpl->tpl_vars['message']->value;?>

                    <?php }?></h3>
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[7]->url;?>
" target="_blank" class="hidden-print"><img
                        src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube"
                        style="width: 2%;"></a>
                <a href="assetController.php" class="hidden-print"><input type="button" style="margin-left: 12px"
                        id="submit" class="btn btn-primary pull-left " value="إضافة جديد" /></a>
            </div>

            <div class="panel-body">

                <!---------- start outputString alert ----------->
                <div id="outputString" class="alert alert-block alert-success fade in  hidden-print"
                    style="display:none">
                    <button type="button" class="close pull-left" data-dismiss="alert"
                        aria-hidden="true">&times;</button>
                    <p id="outputStringValue"><?php echo $_smarty_tpl->tpl_vars['outputString']->value;?>
</p>
                    <div class="clearfix"></div>
                </div>
                <!---------  end outputString alert ------------>

                <form class="form-inline  hidden-print" method="post" action="assetController.php?do=show">
                    <div class="form-group">
                        <label class="sr-only">اسم الاصل</label>
                        <select data-placeholder="اختر اصل" class="select2 wdt100" name="assetId" id="assetId"
                            onChange=" getResult();">
                            <option value="-1"> اختر اصل </option>





                            <?php  $_smarty_tpl->tpl_vars['assetsearch'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['assetsearch']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allassetdata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['assetsearch']->key => $_smarty_tpl->tpl_vars['assetsearch']->value){
$_smarty_tpl->tpl_vars['assetsearch']->_loop = true;
?>





                            <option value="<?php echo $_smarty_tpl->tpl_vars['assetsearch']->value->assetId;?>
"><?php echo $_smarty_tpl->tpl_vars['assetsearch']->value->assetsName;?>
</option>





                            <?php } ?>





                        </select>
                        <input type="hidden" name="usergroupname" id="usergroupname" value="<?php echo $_smarty_tpl->tpl_vars['usergroupname']->value;?>
" />
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
                <hr />
                
                <form id="form1" name="form1" method="post" action="assetController.php?do=executeOperation" onsubmit="if (Spry.Widget.Form.validate(this)) {
                            return countChoosenProducts('assetController');
                        } else {
                            return false;
                        }
                      " enctype="multipart/form-data">
                    
                    <!-- Table -->
                    <table class="table">
                        <thead>
                            <tr>
                                <th class="hidden-print">
                                    <label>
                                        <input type="checkbox" name="checkAll" id="checkAll" />
                                    </label>
                                </th>
                                <th>اسم الاصل</th>
                                <th>سعر الاصل</th>
                                <th>النوع</th>
                                <th class="hidden-print">تعديل</th>
                                <th class="hidden-print">بيع</th>
                                <th class="hidden-print">الغاء</th>
                                <th class="hidden-print">طباعة</th>
                                <th class="hidden-print">قيد اليومية</th>
                            </tr>
                        </thead>
                        <tbody>

                            <?php  $_smarty_tpl->tpl_vars['asset'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['asset']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['assetData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['asset']->key => $_smarty_tpl->tpl_vars['asset']->value){
$_smarty_tpl->tpl_vars['asset']->_loop = true;
?>
                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['asset']->value->conditions;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==1){?>
                            <tr class="danger"> <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['asset']->value->conditions;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2==0){?>

                            <tr> <?php }}?>
                                <td class="hidden-print">
                                    <label>
                                        <input type="checkbox" name="choosedItem[]" id="checked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="choosenItem"
                                            value="<?php echo $_smarty_tpl->tpl_vars['asset']->value->assetId;?>
" />
                                    </label>
                                </td>
                                <td><?php echo $_smarty_tpl->tpl_vars['asset']->value->assetsName;?>
</td>
                                <td id="assetsValue0<?php echo $_smarty_tpl->tpl_vars['asset']->value->assetId;?>
"><?php echo $_smarty_tpl->tpl_vars['asset']->value->assetsValue;?>
</td>
                                <td>
                                    <?php if ($_smarty_tpl->tpl_vars['asset']->value->type==1){?>
                                        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['asset']->value->paytype;?>
<?php $_tmp3=ob_get_clean();?><?php if ($_tmp3==0){?>
                                        اصل جديد خزينه
                                        <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['asset']->value->paytype;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==1){?>
                                        اصل جديد شيك
                                        <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['asset']->value->paytype;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==2){?>
                                        اصل جديد مورد
                                        <?php }}}?>
                                    <?php }else{ ?>
                                    اصل قديم
                                    <?php }?> </td>
                                <td class="hidden-print"><a
                                        href="assetController.php?do=edit&assetId=<?php echo $_smarty_tpl->tpl_vars['asset']->value->assetId;?>
&type=<?php echo $_smarty_tpl->tpl_vars['asset']->value->type;?>
"
                                        type="button" class="btn btn-default btn-lg editicon"> </a></td>

                                <td>
                                    <?php if ($_smarty_tpl->tpl_vars['asset']->value->assetssaleid<1){?> <button type="button"
                                        class="btn btn-primary exampleModals" data-toggle="modal"
                                        data-target="#exampleModal" id="bottommodel<?php echo $_smarty_tpl->tpl_vars['asset']->value->assetId;?>
"
                                        data-id="<?php echo $_smarty_tpl->tpl_vars['asset']->value->assetId;?>
"> البيع</button>
                                        <?php }else{ ?>
                                        <button type="button" class="btn btn-primary exampleModals" data-toggle="modal"
                                            data-target="#exampleModal" id="bottommodel<?php echo $_smarty_tpl->tpl_vars['asset']->value->assetId;?>
"
                                            data-id="<?php echo $_smarty_tpl->tpl_vars['asset']->value->assetId;?>
" style="background-color: red;"> تفاصيل</button>
                                        <?php }?>

                                </td>
                                <td class="hidden-print"> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['asset']->value->conditions;?>
<?php $_tmp6=ob_get_clean();?><?php if ($_tmp6==0){?> <a href="javascript:;"
                                        data-go="assetController.php?do=delete&assetId=<?php echo $_smarty_tpl->tpl_vars['asset']->value->assetId;?>
&type=<?php echo $_smarty_tpl->tpl_vars['asset']->value->type;?>
&action=<?php echo $_smarty_tpl->tpl_vars['asset']->value->dailyentryid;?>
"
                                        type="button" class="btn btn-default btn-lg removeicon delthis"> </a> <?php }else{ ?>
                                    تم الغاءه من قبل
                                    <?php }?>
                                    <!--a onclick="getValue(<?php echo $_smarty_tpl->tpl_vars['assetId']->value->assetId;?>
,<?php echo $_smarty_tpl->tpl_vars['asset']->value->type;?>
)" name="dd" class="deletefinal button with_icon16_notext"-->
                                </td>
                                <td class="hidden-print"><a
                                        href="assetController.php?do=editprint&id=<?php echo $_smarty_tpl->tpl_vars['asset']->value->assetId;?>
&type=<?php echo $_smarty_tpl->tpl_vars['asset']->value->type;?>
"
                                        type="button" class="btn btn-default btn-lg printicon"> </a></td>
                                <td class="hidden-print"><a href="dailyentry.php?id=<?php echo $_smarty_tpl->tpl_vars['asset']->value->dailyentryid;?>
"
                                        target="_blank" type="button" class="btn btn-default btn-lg editicon"> </a></td>
                            </tr>
                            <?php } ?>

                        </tbody>

                    </table>
                    <div class="clearfix"></div>
                    <hr />
                    <div class="hidden-print">
                        <div class="col-lg-12">
                            <div class="well well-sm">
                                <div class="form-group">
                                    <div class="col-lg-4">
                                        <label for="operation"></label>
                                        <span id="spryselect1">
                                            <select name="operation" id="operation" data-placeholder="اختر العملية"
                                                class="select2 wdt100">
                                                <option value="-1"></option>
                                                <option value="1">الغاء</option>
                                            </select>
                                            <span class="selectRequiredMsg">اختر العملية</span></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-lg-4">
                                        <input name="" class="hidden-print btn btn-primary" type="submit"
                                            value="تنفيذ" />
                                    </div>
                                </div>

                                <!-----------  start noElementsError alert ------------->
                                <div class="clearfix"></div>
                                <div id="noElementsError" class="alert alert-danger fade in  hidden-print"
                                    style="display:none;">
                                    <button type="button" class="close pull-left" data-dismiss="alert"
                                        aria-hidden="true">×</button>
                                    <p>يجب اختيار العناصر أولاً</p>
                                    <div class="clearfix"></div>
                                </div>
                                <!----------  end noElementsError alert -------------->

                                <div class="clearfix"></div>
                            </div>
                        </div>

                        <!-- <div class="col-lg-offset-8 col-lg-4">
                            <div class="well well-sm"><h4 class="text-center">اجمالى الاصول:  <?php echo $_smarty_tpl->tpl_vars['sumValue']->value;?>
</h4></div>
                    </div>
                        -->
                        <div class="clearfix"></div>
                    </div>
                </form>
                <div class="hidden-print">
                    <div class="dataTables_info" id="datatable_2_info"> هناك
                        &nbsp;[<?php echo $_smarty_tpl->tpl_vars['paginate']->value['first'];?>
-<?php echo $_smarty_tpl->tpl_vars['paginate']->value['last'];?>
]&nbsp; عنصر من &nbsp; &nbsp; [<?php echo $_smarty_tpl->tpl_vars['paginate']->value['total'];?>
]</div>
                    <div class="dataTables_paginate paging_full_numbers" id="datatable_2_paginate"> <?php ob_start();?><?php echo smarty_function_paginate_prev(array(),$_smarty_tpl);?>
<?php $_tmp7=ob_get_clean();?><?php if ($_tmp7==''){?>
                        <?php }else{ ?> <span class="next paginate_button" id="datatable_2_next"><?php echo smarty_function_paginate_prev(array(),$_smarty_tpl);?>
</span> <?php }?>
                        <span> <?php ob_start();?><?php echo smarty_function_paginate_middle(array(),$_smarty_tpl);?>
<?php $_tmp8=ob_get_clean();?><?php if ($_tmp8==''){?>
                            <?php }else{ ?> <span class="paginate_button"><?php echo smarty_function_paginate_middle(array('format'=>"page"),$_smarty_tpl);?>
</span> <?php }?> </span>
                        <?php ob_start();?><?php echo smarty_function_paginate_next(array(),$_smarty_tpl);?>
<?php $_tmp9=ob_get_clean();?><?php if ($_tmp9==''){?>
                        <?php }else{ ?> <span class="last paginate_button" id="datatable_2_last"><?php echo smarty_function_paginate_next(array(),$_smarty_tpl);?>
</span> <?php }?>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="hidden-print">
                    <div class="col-lg-12">
                        <div class="form-group">
                            <div class="col-lg-4">
                                <button type="button" onclick="print_Custom('mycustomheader');"
                                    class="btn btn-success pull-right">طباعة</button>
                            </div>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">اضافه بيع</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"
                    style="margin-top: -18px; float:left">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <form method="post" id="submitForm">
                <div class="modal-body">
                    <div class="form-group mg-bt5">
                        <label class="col-lg-4 control-label">العميل</label>
                        <div class="col-lg-8">
                            <select class="select2 wdt100 clientstore" name="assetssaleclient" id="clientid">
                                <?php  $_smarty_tpl->tpl_vars['client'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['client']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['clientdata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['client']->key => $_smarty_tpl->tpl_vars['client']->value){
$_smarty_tpl->tpl_vars['client']->_loop = true;
?>
                                <option value="<?php echo $_smarty_tpl->tpl_vars['client']->value->clientid;?>
"><?php echo $_smarty_tpl->tpl_vars['client']->value->clientname;?>
</option>

                                <?php } ?>
                            </select>
                        </div>
                    </div>
                    <div class="form-group mg-bt5">
                        <label class="col-lg-4 control-label">الخزنة</label>
                        <div class="col-lg-8">
                            <select class="select2 wdt100 clientstore" name="assetssalesave" id="saveid">
                                <?php  $_smarty_tpl->tpl_vars['save'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['save']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['savedata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['save']->key => $_smarty_tpl->tpl_vars['save']->value){
$_smarty_tpl->tpl_vars['save']->_loop = true;
?>
                                <option value="<?php echo $_smarty_tpl->tpl_vars['save']->value->saveid;?>
"><?php echo $_smarty_tpl->tpl_vars['save']->value->savename;?>
</option>

                                <?php } ?>
                            </select>
                        </div>
                    </div>
                    <div class="form-group mg-bt5">
                        <label class="col-lg-4 control-label"> التاريخ </label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control awdatepicker " data-date-format="yyyy-mm-dd"
                                id="searchDateFrom" name="assetssaledate">
                        </div>
                    </div>
                    <div class="form-group mg-bt5">
                        <label class="col-lg-4 control-label">المبلغ</label>
                        <div class="col-lg-8">
                            <input type="number" class="form-control" name="assetssaleval" id="assetssaleval">
                        </div>
                    </div>
                    <div class="form-group mg-bt5">
                        <label class="col-lg-4 control-label">التعليق</label>
                        <div class="col-lg-8">
                            <textarea class="form-control" name="assetssalecomment" rows="2"
                                id="assetssalecomment"></textarea>
                        </div>
                    </div>
                    <input type="hidden" class="form-control" name="assetsidm" id="assetidm">
                    <input type="hidden" class="form-control" name="assetssaleoldid" id="assetssaleoldid">

                </div>
                <div style="clear:both"></div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">اغلاق</button>
                    <button type="submit" class="btn btn-primary" id="assetsalesave">حفظ</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="hidden-print">
    <div class="modal fade " id="confirmThis" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
        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>
                    <div class="modal-title">تأكيد حذف العنصر</div>
                </div>
                <div class="modal-body"> هل تريد حذف هذا العنصر؟ </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">لا</button>
                    <button type="button" class="btn btn-primary" id="delThisBtn" data-go="">نعم</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
</div>
<!-- /.modal -->

<script type="text/javascript">
    $(document).ready(function () {
        $("body").on("click", ".exampleModals", function () {
            var assetsid = Number($(this).attr("data-id"));
            $.post("ajaxnew.php?do=assetsalecheck", { assetsid: assetsid }, function (result) {
                data = JSON.parse(result);
                if (data != null) {
                    $("#clientid").val(data.assetssaleclient).trigger("change");
                    $("#saveid").val(data.assetssalesave).trigger("change");
                    $("#searchDateFrom").val(data.assetssaledate);
                    $('#assetssaleval').val(data.assetssaleval);
                    $('#assetssalecomment').val(data.assetssalecomment);
                    $('#assetsValue0' + assetsid).text('0.00');
                    $('#bottommodel' + assetsid).text("تفاصيل");
                    $('#bottommodel' + assetsid).css("background-color", "red");
                    $('#assetsalesave').remove();

                } else {
                    $("#clientid").val(0).trigger("change");
                    $("#saveid").val(0).trigger("change");
                    $("#searchDateFrom").val('');
                    $('#assetssaleval').val('');
                    $('#assetssalecomment').val('');
                }

            });
            $('#assetidm').val(assetsid);
        });
        $('form#submitForm').submit(function (e) {
            var assetsid = $('#assetidm').val();
            e.preventDefault();
            var formData = new FormData(this);
            $.ajax({
                url: 'assetController.php?do=assetsaleadd',
                type: 'POST',
                data: formData,
                success: function (data) {
                    $("#submitForm")[0].reset()
                    $('#exampleModal').modal('toggle');
                    $('#assetsValue0' + assetsid).text('0.00');
                    $('#bottommodel' + assetsid).text("تفاصيل");
                    $('#bottommodel' + assetsid).css("background-color", "red");


                },
                cache: false,
                contentType: false,
                processData: false
            });

        });
    });
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", { invalidValue: "-1" });
</script>
<?php }} ?>