<?php /* Smarty version Smarty-3.1.11, created on 2025-02-12 19:44:07
         compiled from "../views/default/productview/addproductbuybill.html" */ ?>
<?php /*%%SmartyHeaderCode:149071065367acdde7629496-30669784%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '3441bde38bcdaf5d8860c601e3bc4c9b1afd4456' => 
    array (
      0 => '../views/default/productview/addproductbuybill.html',
      1 => 1672089200,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '149071065367acdde7629496-30669784',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'allproduct' => 0,
    'myallproduct' => 0,
    'Programsettingdata' => 0,
    'countall' => 0,
    'companyname' => 0,
    'allproductbuy' => 0,
    'i' => 0,
    'all' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_67acdde77d41f4_10855764',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_67acdde77d41f4_10855764')) {function content_67acdde77d41f4_10855764($_smarty_tpl) {?>

<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">المنتجات</a></li>
            <li><a href="productController.php?do=show">عرض المنتجات</a></li>
            <li class="active">طباعه باركود</li>
        </ol>


        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title"> طباعه الباركود</h3>
            </div>
            <div class="panel-body">

                <div id="productdiv" style="display:none">
                    <?php  $_smarty_tpl->tpl_vars['myallproduct'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['myallproduct']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allproduct']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['myallproduct']->key => $_smarty_tpl->tpl_vars['myallproduct']->value){
$_smarty_tpl->tpl_vars['myallproduct']->_loop = true;
?>
                    <option value="<?php echo $_smarty_tpl->tpl_vars['myallproduct']->value->productId;?>
"><?php echo $_smarty_tpl->tpl_vars['myallproduct']->value->productName;?>
</option>
                    <?php } ?>
                </div>
                
                <form class="nameToBeChecked form-horizontal" role="form" action="printparcode.php" method="post" id="printParcodeForm">

                    

                    <input type="hidden" name="searchvalue" id="searchvalue" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->searchvalue;?>
"/>

                    <input name="itr" id="itr" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['countall']->value;?>
">


                    <div class="table-responsive">
                        <table class="table table-black table-barcode" id="producttabel">
                            <tr>
                                <td colspan="1">   <!--button type="button"  class="btn" onClick="addproduct();">اضافه منتج</button--></td>
                                <td colspan="4"> <p>
                                        <label for=""></label>
                                        <input name="name" type="text" id="name" value="<?php echo $_smarty_tpl->tpl_vars['companyname']->value;?>
" />
                                        <input name="size" type="text" id="size" value="14" />
                                        <input name="currency" type="text" id="currency" value="L.E" />
                                    </p>
                                    <p>
                                        <label class='color-black'>
                                            <input value="0" class="noradioR parcodeTypeToPrint" name="parcodeTypeToPrint" id="parcodeTypeToPrint0" type="radio" onchange="changeParcode2(0);"/>
                                            استخدام الباركود </label>
                                        <label class='color-black'>
                                            <input value="1" class="noradioR parcodeTypeToPrint" name="parcodeTypeToPrint" id="parcodeTypeToPrint1" type="radio" onchange="changeParcode2(1);"/>
                                            استخدام الباركود المتخصص </label>
                                    </p>
                                    <!--p>طباعه السعر التجزئة
                                      <input name="pricOption" type="checkbox" value="1" />
                                      <br>
                                      طباعه السعر الجمله <input name="pricOption1" type="checkbox" value="1" />
                                  </p--></td>
                            </tr>
                            <tr>
                                <th class="color-white" style="color:#fff">المنتج</th>
                                <th class="color-white">السعر</th>
                                <th class="color-white">الباركود</th>
                                <th class="color-white">عدد مرات الطباعه</th>
                                <th class="color-white">حذف</th>

                            </tr>
                            <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                            <?php  $_smarty_tpl->tpl_vars['all'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['all']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allproductbuy']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['all']->key => $_smarty_tpl->tpl_vars['all']->value){
$_smarty_tpl->tpl_vars['all']->_loop = true;
?>
                            <tr>
                                <td>
                                    <div class="form-group">

                                        <input type="text" name="productname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"  value="<?php echo $_smarty_tpl->tpl_vars['all']->value->productname;?>
"/>

                                    </div>
                                    </div>


                                </td>
                                <td>
                                    <div class="form-group">

                                        <input name="price<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"  id="price<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="text"  value="<?php echo $_smarty_tpl->tpl_vars['all']->value->defultprice;?>
">

                                    </div>
                                    </div>


                                </td>

                                <td><input name="productbarcode<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"  id="productbarcode<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="text" value="<?php echo $_smarty_tpl->tpl_vars['all']->value->parcode;?>
">
                                    <input name="catname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"  id="catname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden"  value="<?php echo $_smarty_tpl->tpl_vars['all']->value->productCatName;?>
">
                                    <input name="pricen<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"  id="pricen<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden"  value="<?php echo $_smarty_tpl->tpl_vars['all']->value->buybilldetailtotalprice;?>
">
                                    <input name="pricenen<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"  id="pricenen<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" type="hidden"  value="<?php echo $_smarty_tpl->tpl_vars['all']->value->buybilldetailtotalprice;?>
">
                                    <div id="updatebarcod<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
">
                                    </div>
                                </td>
                                <td><input name="productnum<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"  value="<?php echo $_smarty_tpl->tpl_vars['all']->value->buybilldetailquantity;?>
"  type="text"></td>

                                <td><a onClick="javascript:removebarcodProduct(<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
)" type="button" class="btn btn-default btn-lg removeicon"></a></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 } ?>
                        </table>


                    </div>

                    <!-- =================================================   -->






                    <div class="modal fade" id="myModa_barcode" 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>
                                    <h4 class="modal-title">تعديل الباركود</h4>
                                </div>
                                <div class="modal-body">


                                    <div class="input-group">
                                        <input type="text" class="form-control" id="newbarcod">

                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">اغلاق</button>
                                    <button type="button" class="btn btn-primary savemodel_barcode">حفظ البيانات</button>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->
                    </div>


                    <!-- =================================================   -->

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <p>
                                <input name="showComp" type="checkbox" id="showComp" value="1" onchange="localStorage.setItem('showComp', $(this).is(':checked'))"/>
                                <label for="">إظهار اسم الشركة</label>
                            </p>
                            <p>
                                <input name="cat" type="checkbox" id="cat" value="1" onchange="localStorage.setItem('cat', $(this).is(':checked'))"/>
                                <label for="">طباعة التصنيف</label>
                            </p>
                            <p>
                                <input name="pricOption" type="radio" id="pricOption" value="0" onchange="localStorage.setItem('pricOption', this.value)"/>
                                <label for="">طباعه بدون سعر</label>
                                <br />
                            <p>
                                <input name="pricOption" type="radio" id="pricOption1" value="1" onchange="localStorage.setItem('pricOption', this.value)"/>
                                <label for="speparcode"> طباعه السعر الجمله</label>
                                <br />
                            <p>
                                <input name="pricOption" type="radio" id="pricOption1" value="2" onchange="localStorage.setItem('pricOption', this.value)"/>
                                <label for="speparcode"> طباعه السعر نصف الجملة </label>
                                <br />
                            <p>
                                <input name="pricOption" type="radio" id="pricOption" value="3" onchange="localStorage.setItem('pricOption', this.value)"/>
                                <label for="">طباعه السعر التجزئة</label>
                                <br />
                            <p>
                                <input name="speparcode" type="checkbox" id="speparcode" value="1" onchange="localStorage.setItem('speparcode', $(this).is(':checked'))"/>
                                <label for="speparcode">طابعة باركود متخصصه</label>
                                <br />
                                <input name="double" type="checkbox" id="double" value="1" onchange="localStorage.setItem('double', $(this).is(':checked'))"/>
                                <label for="double">طباعة زوجية</label>
                            </p>
                            <button type="submit"  class="btn btn-primary pull-left">طباعه </button>
                        </div>
                    </div>


                </form>
            </div>
        </div>




    </div>
</div>




<script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");

    $('.parcodeTypeToPrint').removeAttr('checked');
    if (localStorage.getItem("parcodeTypeToPrint") == 1) {
        $('#parcodeTypeToPrint1').attr('checked', 'checked');
    } else {
        $('#parcodeTypeToPrint0').attr('checked', 'checked');
    }
    //
    if (localStorage.getItem("showComp") == "true") {
        $('#showComp').attr('checked', 'checked');
    } else {
        $('#showComp').removeAttr('checked', 'checked');
    }
    if (localStorage.getItem("cat") == "true") {
        $('#cat').attr('checked', 'checked');
    } else {
        $('#cat').removeAttr('checked', 'checked');
    }
    if (localStorage.getItem("speparcode") == "true") {
        $('#speparcode').attr('checked', 'checked');
    } else {
        $('#speparcode').removeAttr('checked', 'checked');
    }
    if (localStorage.getItem("double") == "true") {
        $('#double').attr('checked', 'checked');
    } else {
        $('#double').removeAttr('checked', 'checked');
    }

    //
    for (var i = 0; i < 4; i++) {
        if (localStorage.getItem("pricOption") == i.toString()) {
            $('#pricOption' + i).attr('checked', 'checked');
        } else {
            $('#pricOption' + i).removeAttr('checked', 'checked');
        }
    }

    function changeParcode2(val) {
        localStorage.setItem('parcodeTypeToPrint', val);
        $.ajax({
            type: "POST",
            url: 'productControllerAjax.php?do=setSession',
            data: {name: 'parcodeTypeToPrint', value: val},
            async: false,
            success: function (data) {
                window.location.reload();
            }
        });
    }
</script>


<?php }} ?>