<?php /* Smarty version Smarty-3.1.11, created on 2023-10-15 19:48:18
         compiled from "../views/default/clientReportsview/clientShow.html" */ ?>
<?php /*%%SmartyHeaderCode:1093001686652c17d2c85738-50991796%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '8f2ed45a15cda459ebe95d4e3d98deba5c5b34d4' => 
    array (
      0 => '../views/default/clientReportsview/clientShow.html',
      1 => 1696081268,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1093001686652c17d2c85738-50991796',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'message' => 0,
    'youtubes' => 0,
    'programsettingsdata' => 0,
    'path' => 0,
    'shownData' => 0,
    'data' => 0,
    'j' => 0,
    'k' => 0,
    'searchDate' => 0,
    'burex' => 0,
    'clientid' => 0,
    'total' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_652c17d3245d84_79556102',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_652c17d3245d84_79556102')) {function content_652c17d3245d84_79556102($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include '/home/gt4it/public_html/napoly/public/libs/plugins/modifier.date_format.php';
?><style type="text/css">
    @media print {
        #div1,#div2,#div3{
            width: 33% !important;
            float: left !important;
        }
        #div1{
            text-align: left !important;
        }
        #div2{
            text-align: center!important;
        }
        #div1{
            text-align: right!important;
        }
        thead{
            font-size: 10px !important;
            background-color: #ccc !important;
        }
        thead tr{
            font-size: 10px !important;
            background-color: #ccc !important;
        }
        tbody{
            font-size: 10px !important;
        }
        .well{
            width: 154px  !important;

        }

        .well h4{
            width: 154px  !important;
            padding: 3px !important;
            margin: 3px !important;
            font-size: 13px !important;
        }

    }
</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 -->
            <div class="panel-heading">تقرير العملاء<br />
                <?php if ($_smarty_tpl->tpl_vars['message']->value!=''){?>
                <?php echo $_smarty_tpl->tpl_vars['message']->value;?>

                <?php }?>
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[266]->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="form-inline hidden-print" action="clientReportsController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">العميل</label>
                        <input type="hidden" id="clientid" name="clientid" class="wdt100 select2-offscreen" data-placeholder="اختر عميل " tabindex="-1" style="display: inline-block;" value="1"/>
                    </div>

                    <div class="form-group">
                        <label class="sr-only"> الترتيب بـ</label>
                        <select class="select2 wdt100" name="order" id="order">
                            <option value="0">id  تنازلي </option>
                            <option value="1">   id تصاعدي</option>
                            <option value="2">التاريخ   تنازلي </option>
                            <option value="3">   التاريخ   تصاعدي</option>
                        </select>
                    </div>


                    <div class="form-group">
                        <label class="sr-only">رصيد صافي</label>
                        <input name="bure" type="checkbox" id="bure"  value="1" />
                        <label for="bure"></label>
                    </div>
                    <br/>

                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">تقرير مختصر</label>
                        <input type="checkbox" class="form-control" id="summaryreport" value="1">
                    </div>


                    <!--                    <div class="form-group" style="padding-right: 20px;">
                                            <label class="sr-only">تاريخ البحث</label><br>
                                            <label>  <input value="sysDate" name="searchDate" type="radio" checked>
                                                تاريخ السيستم</label>
                                            <label>  <input value="userSelectedDate" name="searchDate" type="radio" >
                                                تاريخ المستخدم</label>
                                        </div>-->
                    <button type="submit" class="btn btn-primary">بحث</button>

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

            <div  class=" container  visible-print"  style="width: 100% !important;">
                <div id="div1" >
                    <br>
                    <?php echo $_smarty_tpl->tpl_vars['programsettingsdata']->value->companyname;?>

                </div>
                <div id="div2">
                    <img src="<?php echo $_smarty_tpl->tpl_vars['path']->value;?>
/images/upload/<?php echo $_smarty_tpl->tpl_vars['programsettingsdata']->value->logo;?>
" width="80px" height="80px">
                </div>

                <div id="div3">
                    <br>
                    <?php echo $_smarty_tpl->tpl_vars['programsettingsdata']->value->phone;?>

                </div>
            </div>
            <table class="table billtable table-bordered table-black summaryreporthide" >
                <thead>
                    <tr>
                        <th>وصف العمليه</th>
                        <th>تاريخ العملية</th>
                        <th>اسم العميل</th>

                        <th>إجمالي مبلغ العملية</th>
                        <th>المدفوع</th>
                                
                        <th>المديونيه قبل</th>
                        
                        <!--<th><table   class="table" border="1" width="100%"  style="text-align:center" >
                        <tr ><td colspan="2" > متغير المديونية</td></tr>
                           <tr><td>اضافه</td><td>خصم</td></tr>

                        </table>  </th>-->
                        <th>متغير المديونية
                            <table class="table billtable table-bordered">
                                <tr>
                                    <td style="color:black!important;" class="color-black"> إضافة</td>
                                    <td style="color:black!important;" class="color-black"> خصم</td>
                                </tr>
                            </table>
                        </th>
                          
                        <th>المديونيه بعد</th> 
                        
                    </tr>
                </thead>
                <tbody>
                    <?php $_smarty_tpl->tpl_vars['j'] = new Smarty_variable(0, null, 0);?>
                    <?php $_smarty_tpl->tpl_vars['k'] = new Smarty_variable(0, null, 0);?>
                    <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['shownData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>

                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeid;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1>0){?>


                    <?php if ($_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype==1){?>
                    <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'j', null); ob_start(); ?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>
<?php $_tmp2=ob_get_clean();?><?php echo $_smarty_tpl->tpl_vars['j']->value+$_tmp2;?>
<?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 }else{ ?>
                    <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'k', null); ob_start(); ?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>
<?php $_tmp3=ob_get_clean();?><?php echo $_smarty_tpl->tpl_vars['k']->value+$_tmp3;?>
<?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 }?>


                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==1){?>
                    <tr class="danger"> <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==0){?>
                    <tr>
                        <?php }}?>

                        <td>

                            <?php if ($_smarty_tpl->tpl_vars['data']->value->tablename=="rb_kashf.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="sellbillandruternController.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="sellbillController.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="bills.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="billsreturn.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="returnsellbillController.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="clientPayedDeptController.php"){?>
                            ( <?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangemodelid;?>
)
                            <?php }?>

                            <a class=" hidden-print" href="<?php echo $_smarty_tpl->tpl_vars['data']->value->link;?>
"><?php echo $_smarty_tpl->tpl_vars['data']->value->processname;?>
<?php if ($_smarty_tpl->tpl_vars['data']->value->processname=="ايداع شيك"){?>(<?php echo $_smarty_tpl->tpl_vars['data']->value->bankname;?>
)/(<?php echo $_smarty_tpl->tpl_vars['data']->value->accountname;?>
)<?php }?>



                             
                                
                              
                                <?php if ($_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype==1&&$_smarty_tpl->tpl_vars['data']->value->tablename=="datedCheckedController.php"&&$_smarty_tpl->tpl_vars['data']->value->datedCheckeddone==1){?>
                                شيك محصل

                                <?php }elseif($_smarty_tpl->tpl_vars['data']->value->datedCheckeddone==3&&$_smarty_tpl->tpl_vars['data']->value->tablename=="datedCheckedController.php"){?>
           تم تظهير الشيك  (<?php echo $_smarty_tpl->tpl_vars['data']->value->suppliername;?>
)
                                <?php }elseif($_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype==1&&$_smarty_tpl->tpl_vars['data']->value->tablename=="datedCheckedController.php"){?>

                                  شيك غير محصل

                                <?php }?>

                            </a>
                            <div class="visible-print">
                                <?php echo $_smarty_tpl->tpl_vars['data']->value->processname;?>

                            </div>

                        </td>
                        <td>
                            <?php if ($_smarty_tpl->tpl_vars['searchDate']->value=="sysDate"){?>
                            <?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangedate;?>

                            <?php }elseif($_smarty_tpl->tpl_vars['searchDate']->value=="userSelectedDate"){?>
                            <?php echo $_smarty_tpl->tpl_vars['data']->value->userSelectedDate;?>

                            <?php }?>
                        </td>
                        <td><?php echo $_smarty_tpl->tpl_vars['data']->value->clientname;?>
</td>


                        <?php if ($_smarty_tpl->tpl_vars['data']->value->tablename=="rb_kashf.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="sellbillandruternController.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="sellbillController.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="returnsellbillController.php"){?>


                        <td><?php echo $_smarty_tpl->tpl_vars['data']->value->totalOperationCost;?>
</td>

                        <td>
                            <?php if ($_smarty_tpl->tpl_vars['data']->value->totalOperationCost==0){?>
                            0
                            <?php }else{ ?>
                            <?php if ($_smarty_tpl->tpl_vars['data']->value->tablename=="sellbillController.php"){?>
                            <?php ob_start();?><?php echo abs($_smarty_tpl->tpl_vars['data']->value->totalOperationCost);?>
<?php $_tmp6=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>
<?php $_tmp7=ob_get_clean();?><?php echo $_tmp6-$_tmp7;?>

                            <?php }else{ ?>
                            <?php ob_start();?><?php echo abs($_smarty_tpl->tpl_vars['data']->value->totalOperationCost);?>
<?php $_tmp8=ob_get_clean();?><?php ob_start();?><?php echo abs($_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount);?>
<?php $_tmp9=ob_get_clean();?><?php echo $_tmp8-$_tmp9;?>

                            <?php }?>
                            <!-- old one -->
                            
                            <?php }?>


                        </td>


                        
                        <td><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangebefore;?>
</td>
                        
                        <td>
                            <div <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype;?>
<?php $_tmp10=ob_get_clean();?><?php if ($_tmp10==1){?> style="float:left;  margin: 10px 10px 10px 10px;"  <?php }else{ ?> style="float:right; margin: 10px 10px 10px 10px;"  <?php }?> >
                                <?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>

                            </div>
                        </td>

                        <?php }else{ ?>



                        <td><?php echo $_smarty_tpl->tpl_vars['data']->value->totalOperationCost;?>
</td>
                        <td>
                            <?php if ($_smarty_tpl->tpl_vars['data']->value->totalOperationCost==0){?>
                            0
                            <?php }else{ ?>


                            <?php if ($_smarty_tpl->tpl_vars['data']->value->tablename=="clientPayedDeptSellBillsController.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="clientPayedDeptReturnSellBillsController.php"){?>
                            <?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>

                            <?php }else{ ?>
                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->totalOperationCost;?>
<?php $_tmp11=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>
<?php $_tmp12=ob_get_clean();?><?php echo $_tmp11-$_tmp12;?>

                            <?php }?>



                            <?php }?>


                        </td>


                        
                        <td>
                            <?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangebefore;?>

                        </td>
                        



                        <td>

                            <div
                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype;?>
<?php $_tmp13=ob_get_clean();?><?php if ($_tmp13==1){?>
                                style="float:left;  margin: 10px 10px 10px 10px;"
                                <?php }else{ ?>
                                style="float:right; margin: 10px 10px 10px 10px;"
                                <?php }?>
                                >
                                <?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>

                            </div>

                        </td>
                        <?php }?>
                              	 
                        <td><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeafter;?>
</td>
                        
                    </tr>


                    <?php }?>
                    <?php } ?>
                    <!--<tr>
                   <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?>
                     <td></td>
                  <td></td>
                     <td></td>
                  <td></td>
                  <td></td>
                  <?php }else{ ?>
                     <td></td>
                       <td></td>
                     <td></td>
                  <td></td>
                  <?php }?>
                  <td> <table border="1" width="100%"  style="text-align:center" >
                         <tr><td width="50%">  <?php echo $_smarty_tpl->tpl_vars['k']->value;?>
</td><td width="50%"><?php echo $_smarty_tpl->tpl_vars['j']->value;?>
</td></tr>

                      </table>
                    </td>


                  </tr>-->
                </tbody>

            </table>

            <table class="table billtable table-bordered table-black summaryreportshow" style="display:none">
                <thead>
                    <tr>
                        <th>التاريخ</th>
                        <th>التفاصيل</th>
                        <?php if ($_smarty_tpl->tpl_vars['clientid']->value<1){?>
                        <th> العميل</th>
                        <?php }?>
                        <th>دائن
                        </th>
                        <th>مدين
                        </th>
                        <th>الرصيد
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <?php $_smarty_tpl->tpl_vars['j'] = new Smarty_variable(0, null, 0);?>
                    <?php $_smarty_tpl->tpl_vars['k'] = new Smarty_variable(0, null, 0);?>
                    <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['shownData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>

                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeid;?>
<?php $_tmp14=ob_get_clean();?><?php if ($_tmp14>0){?>


                    <?php if ($_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype==1){?>
                    <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'j', null); ob_start(); ?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>
<?php $_tmp15=ob_get_clean();?><?php echo $_smarty_tpl->tpl_vars['j']->value+$_tmp15;?>
<?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 }else{ ?>
                    <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'k', null); ob_start(); ?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>
<?php $_tmp16=ob_get_clean();?><?php echo $_smarty_tpl->tpl_vars['k']->value+$_tmp16;?>
<?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 }?>


                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype;?>
<?php $_tmp17=ob_get_clean();?><?php if ($_tmp17==1){?>
                    <tr class="danger"> <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype;?>
<?php $_tmp18=ob_get_clean();?><?php if ($_tmp18==0){?>
                    <tr>
                        <?php }}?>
                        <td>
                            <?php if ($_smarty_tpl->tpl_vars['searchDate']->value=="sysDate"){?>
                            <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['data']->value->clientdebtchangedate,'%Y-%m-%d');?>

                            <?php }elseif($_smarty_tpl->tpl_vars['searchDate']->value=="userSelectedDate"){?>
                            <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['data']->value->userSelectedDate,'%Y-%m-%d');?>

                            <?php }?>


                        </td>

                        <td>

                            <?php if ($_smarty_tpl->tpl_vars['data']->value->tablename=="rb_kashf.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="sellbillandruternController.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="sellbillController.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="bills.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="billsreturn.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="returnsellbillController.php"||$_smarty_tpl->tpl_vars['data']->value->tablename=="clientPayedDeptController.php"){?>
                            ( <?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangemodelid;?>
)
                            <?php }?>

                            <a class=" hidden-print" href="<?php echo $_smarty_tpl->tpl_vars['data']->value->link;?>
"><?php echo $_smarty_tpl->tpl_vars['data']->value->processname;?>
<?php if ($_smarty_tpl->tpl_vars['data']->value->processname=="ايداع شيك"){?>(<?php echo $_smarty_tpl->tpl_vars['data']->value->bankname;?>
)/(<?php echo $_smarty_tpl->tpl_vars['data']->value->accountname;?>
)<?php }?>


                                 
                                <?php if ($_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype==1&&$_smarty_tpl->tpl_vars['data']->value->tablename=="datedCheckedController.php"&&$_smarty_tpl->tpl_vars['data']->value->datedCheckeddone==1){?>
                                شيك محصل

                                <?php }elseif($_smarty_tpl->tpl_vars['data']->value->datedCheckeddone==3&&$_smarty_tpl->tpl_vars['data']->value->tablename=="datedCheckedController.php"){?>
           تم تظهير الشيك  (<?php echo $_smarty_tpl->tpl_vars['data']->value->suppliername;?>
)
                                <?php }elseif($_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype==1&&$_smarty_tpl->tpl_vars['data']->value->tablename=="datedCheckedController.php"){?>

                                  شيك غير محصل

                                <?php }?>

                           </a>
                            <div class="visible-print">
                                <?php echo $_smarty_tpl->tpl_vars['data']->value->processname;?>

                            </div>

                        </td>
                        <?php if ($_smarty_tpl->tpl_vars['clientid']->value<1){?>

                        <td><?php echo $_smarty_tpl->tpl_vars['data']->value->clientname;?>
</td>
                        <?php }?>






                        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangetype;?>
<?php $_tmp19=ob_get_clean();?><?php if ($_tmp19==1){?>
                        <td>

                            <?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>

                        </td>
                        <td>
                        </td>
                        <?php }else{ ?>
                        <td>
                        </td>
                        <td>

                            <?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeamount;?>


                        </td>
                        <?php }?>
                        <td><?php echo $_smarty_tpl->tpl_vars['data']->value->clientdebtchangeafter;?>
</td>
                    </tr>


                    <?php }?>
                    <?php } ?>
                    <!--<tr>
                   <?php if ($_smarty_tpl->tpl_vars['burex']->value!=1){?>
                     <td></td>
                  <td></td>
                     <td></td>
                  <td></td>
                  <td></td>
                  <?php }else{ ?>
                     <td></td>
                       <td></td>
                     <td></td>
                  <td></td>
                  <?php }?>
                  <td> <table border="1" width="100%"  style="text-align:center" >
                         <tr><td width="50%">  <?php echo $_smarty_tpl->tpl_vars['k']->value;?>
</td><td width="50%"><?php echo $_smarty_tpl->tpl_vars['j']->value;?>
</td></tr>

                      </table>
                    </td>


                  </tr>-->
                </tbody>

            </table>
            <div class="col-lg-offset-8 col-lg-4">
                <div class="well well-sm">
                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['k']->value;?>
<?php $_tmp20=ob_get_clean();?><?php if ($_tmp20==0){?>
                    <h4 class="text-center"> اجمالى المبلغ    <?php echo $_smarty_tpl->tpl_vars['total']->value;?>
</h4>
                    <?php }else{ ?>

                    <h4 class="text-center"> اجمالى المبلغ    <?php echo $_smarty_tpl->tpl_vars['total']->value;?>
</h4>
                    <?php }?>
                </div>
            </div>
            <div class="clearfix"></div>
            <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>
    $(document).ready(function () {

        $('#summaryreport').click(function () {
            var summaryreport = $('#summaryreport').prop("checked") ? 1 : 0;
            if (summaryreport == 1) {
                $(".summaryreportshow").show();
                $(".summaryreporthide").hide();
            } else {
                $(".summaryreporthide").show();
                $(".summaryreportshow").hide();
            }

        });




        var searchvalue = $('#searchvalue').val();

        $("#clientid").select2({
            placeholder: "اختر عميل ",
            minimumInputLength: 0,
            //  minimumInputLength: 3,
            multiple: false,
            quietMillis: 100,
            //width: '120%',
            ajax: {
                url: "billsajax.php?do=getclients&noadd=1",
                dataType: 'json',
                data: function (term, page) {
                    //  alert(term);
                    return {
                        term: term, //search term
                        page_limit: 10, // page size
                    };
                },
                results: function (data) {

                    // alert(term);
                    return {results: data};
                }
            },
            initSelection: function (element, callback) {
                var item = element.val().split(':');
                var data = {id: item[0], text: item[1]};
                callback(data);
            }
        });
        $("#clientid").select2("data", {id: "-1", text: "اختر عميل"});
    });

</script>
<?php }} ?>