<?php /* Smarty version Smarty-3.1.11, created on 2024-03-23 01:07:10
         compiled from "../views/default/productserailreportview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:203663318765fe0f1e7323f2-10839079%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '0a639e03ba99286c02c89ea729479c3cc5336b6a' => 
    array (
      0 => '../views/default/productserailreportview/show.html',
      1 => 1693253994,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '203663318765fe0f1e7323f2-10839079',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'message' => 0,
    'youtubes' => 0,
    'allproductserail' => 0,
    'myallproductserail' => 0,
    'productdata' => 0,
    'product' => 0,
    'i' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_65fe0f1e944632_40784093',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_65fe0f1e944632_40784093')) {function content_65fe0f1e944632_40784093($_smarty_tpl) {?><style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
    @media print {
        p,h4,h3,h2,h1,span,label,td,th,div.dataTables_info,a,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
        div.dataTables_wrapper div.dataTables_info, tr.odd td.sorting_1,
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{
            color:#000!important
        }
        .table thead>tr>th, .table tbody>tr>th, .table tfoot>tr>th, .table thead>tr>td, .table tbody>tr>td, .table tfoot>tr>td{
            text-align: center
        }
    }
</style>

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">التقارير</a></li>
            <li class="active">تقرير منتج بالباركود</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <?php if ($_smarty_tpl->tpl_vars['message']->value!=''){?>
            <div class="panel-heading"><?php echo $_smarty_tpl->tpl_vars['message']->value;?>

                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[69]->url;?>
" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>

            <?php }else{ ?>
            <div class="panel-heading">تقرير منتج بالباركود
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[69]->url;?>
" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>
            <?php }?>
            <div class="panel-body">
                <form class="form-inline hidden-print" action="productserailreportController.php?do=show" method="post">
                    <div class="form-group"><span id="spryselect1">
                            <label class="sr-only">الباركود
                                <select class="select2 wdt300"  name="productserailid" id="productserailid" >
                                    <option value="-1">اختر الباركود</option>





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






                                    <option value="<?php echo $_smarty_tpl->tpl_vars['myallproductserail']->value->productserailid;?>
"><?php echo $_smarty_tpl->tpl_vars['myallproductserail']->value->serialnumber;?>
__<?php echo $_smarty_tpl->tpl_vars['myallproductserail']->value->productName;?>
 </option>





                                    <?php } ?>





                                </select>
                            </label>
                            <span class="selectInvalidMsg">اختر منتج.</span></span></div>
                    <br/>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <?php ob_start();?><?php echo count($_smarty_tpl->tpl_vars['productdata']->value);?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1>0){?>
            <hr/>
            <table class="table table-black">
                <thead>
                    <tr>
                        <th>اسم المنتج</th>
                        <th>السريال</th>
                        <th>الكميه</th>
                        <th>تاريخ البدايه</th>
                        <th>تاريخ النهايه</th>
                        <th>الايام المتبقية</th>
                        <th class="hidden-print">فاتوره الشراء</th>
                        <th class="hidden-print">فاتوره البيع</th>
                        <th class="hidden-print">حذف</th>
                    </tr>
                </thead>
                <tbody>

                    <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                    <?php  $_smarty_tpl->tpl_vars['product'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['product']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['productdata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['product']->key => $_smarty_tpl->tpl_vars['product']->value){
$_smarty_tpl->tpl_vars['product']->_loop = true;
?>

                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['product']->value->del;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2==1){?>
                    <tr class="danger"> <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['product']->value->del;?>
<?php $_tmp3=ob_get_clean();?><?php if ($_tmp3==0){?>

                    <tr> <?php }}?>
                        <td><?php echo $_smarty_tpl->tpl_vars['product']->value->productName;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['product']->value->serialnumber;?>
</td>
                        <td>
                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['product']->value->soldsellbillid;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4>0){?>
                            <?php echo $_smarty_tpl->tpl_vars['product']->value->quantity;?>

                            <?php }else{ ?>
                            <?php echo $_smarty_tpl->tpl_vars['product']->value->don;?>

                            <?php }?></td>
                        <td><?php echo $_smarty_tpl->tpl_vars['product']->value->startdate;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['product']->value->enddate;?>
</td>
                        <td <?php if ($_smarty_tpl->tpl_vars['product']->value->diff<=0){?>style="background-color: #f97c7c"<?php }?>><?php echo $_smarty_tpl->tpl_vars['product']->value->diff;?>
</td>
                        <td class="hidden-print"> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['product']->value->type;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==0){?> <a href="buyBillController.php?do=details&id=<?php echo $_smarty_tpl->tpl_vars['product']->value->billid;?>
" type="button" class="btn btn-default btn-lg editicon"></a> <?php }else{ ?> <a href="buyAndReturnBillController.php?do=details&id=<?php echo $_smarty_tpl->tpl_vars['product']->value->billid;?>
" type="button" class="btn btn-default btn-lg editicon"></a> <?php }?> </td>
                        <td class="hidden-print"> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['product']->value->soldsellbillid;?>
<?php $_tmp6=ob_get_clean();?><?php if ($_tmp6>0){?>

                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['product']->value->sellbilltype;?>
<?php $_tmp7=ob_get_clean();?><?php if ($_tmp7==0){?>
                            <a href="sellbillController.php?do=showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['product']->value->soldsellbillid;?>
" type="button" class="btn btn-default btn-lg editicon" target="_blank"></a>
                            <?php }else{ ?>
                            <a href="sellbillandruternController.php?do=showDetail&sellbillid=<?php echo $_smarty_tpl->tpl_vars['product']->value->soldsellbillid;?>
" type="button" class="btn btn-default btn-lg editicon"  target="_blank"></a>
                            <?php }?>
                            <?php }else{ ?>
                            لم يتم بيعه
                            <?php }?> </td>
                        <td  class="hidden-print"> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['product']->value->del;?>
<?php $_tmp8=ob_get_clean();?><?php if ($_tmp8==0){?> <a href="productserailreportController.php?do=tempdelete&id=<?php echo $_smarty_tpl->tpl_vars['product']->value->productserailid;?>
&del=1"  type="button" class="btn btn-default btn-lg removeicon"> </a> <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['product']->value->del;?>
<?php $_tmp9=ob_get_clean();?><?php if ($_tmp9==1){?> <a href="productserailreportController.php?do=tempdelete&id=<?php echo $_smarty_tpl->tpl_vars['product']->value->productserailid;?>
&del=0"  type="button" class="btn btn-default btn-lg removeicon"> </a> <?php }}?> </td>
                    </tr>
                    <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'i', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['i']->value+1;?>
<?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
if (!empty($_capture_buffer)) {
 if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());
 if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());
 Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();
} else $_smarty_tpl->capture_error();?>
                    <?php } ?>

                </tbody>

            </table>
            <?php if ($_smarty_tpl->tpl_vars['i']->value>1){?>
            <div class="col-lg-4 ">
                <div class="well well-sm">
                    <h4 class="text-center">الكمية فى المخزن:  <?php echo $_smarty_tpl->tpl_vars['productdata']->value[0]->don;?>
</h4>
                </div>
            </div>
            <?php }?>
            <?php }?>
            <div class="clearfix"></div>
            <hr />
            <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 class="clearfix"></div>
        </div>
    </div>
</div>

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