<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
    .nodata{
        background-color: #72B4EC;
        color: white;
        border-radius: 13px;
        margin: 14px;
        font-size: 24px;
        text-align: center;
        padding: 5px;
    }
    .bg-full{
        direction: ltr
    }

    .select2-container .select2-choice .select2-arrow {

        left: auto!important;
        right: 0!important;
    }
    .select2-container .select2-choice > .select2-chosen {
        margin-right: 26px!important;
        margin-left: auto!important
    }

</style>

<div class="row bg-full">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">Reports</a></li>
            <li><a href="savedailyController.php?do=show">Daily Report</a></li>
            <li class="active">Report Show </li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">  Daily Report
                <a href="{$youtubes[118]->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="savedailyController.php?do=show&lang=en" method="post">

                    {if $searchinonesave eq 0}
                    <div class="form-group">

                        <label class="sr-only">The Safe</label>
                        <select class="select2 wdt300"  name="saveId" id="saveid" >
                            <option value="-1"> Select Safe</option>


                            {foreach $saveData as $save}


                            <option value="{$save->saveid}">{$save->savename}</option>


                            {/foreach}


                        </select>

                    </div>
                    {/if}
                    <div class="form-group">

                        <label class="sr-only">Operation Name </label>
                        <select class="select2 wdt300"  name="processid" id="processid" >
                            <option value="-1">  Select Operation  </option>


                            {foreach $allprocess as $process}


                            <option value="{$process->processname}">{$process->processname}</option>


                            {/foreach}


                        </select>

                    </div>
                    <div class="form-group">
                        <input type="checkbox" name="bure" checked="checked" id="bure" value="1" />
                        <label class="sr-only"> Net balance</label>

                        <label for="bure"></label>
                    </div>
                    <br/>

                    {if $savedailydate eq 1}
                    <div class="form-group">
                        <label class="sr-only">Date from: </label>
                        <div  class="input-group date form_datetime col-md-5" data-date="" data-date-format="yyyy-mm-dd  H:i:s" data-link-field="dtp_input1">
                            <input class="form-control" size="16" type="text" value="" name="from" id="from" readonly="" >
                            <span class="input-group-addon " style="width: 0%;"><span class=" glyphicon glyphicon-remove col-lg-4"></span></span>
                            <span class="input-group-addon"  style="width: 0%;"><span class="glyphicon glyphicon-th col-lg-4"></span></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="sr-only"> Date to:</label>
                        <div  class="input-group date form_datetime col-md-5" data-date="" data-date-format="yyyy-mm-dd  H:i:s" data-link-field="dtp_input1">
                            <input class="form-control" size="16" type="text" value="" name="to" id="to" readonly="" >
                            <span class="input-group-addon " style="width: 0%;"><span class=" glyphicon glyphicon-remove col-lg-4"></span></span>
                            <span class="input-group-addon" style="width: 0%;"><span class="glyphicon glyphicon-th col-lg-4"></span></span>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                    <button type="submit" class="btn btn-primary">Search </button>
                </form>
                {/if}
            </div>

            <div class="clearfix"></div>
            <hr/>
            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading">{$message}</div>
                {if count($savedailyData)>0}
                <div class="panel-body"> {if {count($savedailyData)} > 0}
                    <div class="col-lg-offset-8 col-lg-4">
                        {if $savedailydate eq 1}
                        <div class="well well-sm">
                            <h4 class="text-center">Total {$sumValue} {$currency}</h4>
                        </div>

                        {/if}
                    </div>

                    <div class="col-lg-offset-8 col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center">
                                Value of change {$changeAmountSum} {$currency}</h4>
                        </div>
                    </div>
                    {/if}
                    <div class="clearfix"></div>
                    <table class="table table-black" >
                        <thead >
                            <tr style="text-align:center">
                                <th>Name of Treasury </th>
                                <th>Operation Name </th>
                                <th>Date</th>
                                {if $burex <> 1}       <th> money before </th>{/if}
                                <th>
                        <table   class="table table-black" border="1" width="100%"  style="text-align:center" >
                            <tr ><td colspan="2" class="color-black">
                                    Value of change </td></tr>
                            <tr class="color-black">
                                <td>import</td>
                                <td>Export</td></tr>

                        </table>

                        </th>
                        {if $burex <> 1}        <th> money after</th>{/if}
                        <th class="hidden-print ">Detail </th>
                        <th class="hidden-print ">operation Detail with Safe  </th>
                        </tr>
                        </thead>
                        <tbody>
                            {assign var=j value=0}
                            {assign var=k value=0}
                            {foreach $savedailyData as $savedaily}


                            {if {$savedaily->savedailyid} > 0}
                            {if {$savedaily->savedailychangetype} eq 0}
                            {capture assign=j}{$j+{$savedaily->savedailychangeamount}}{/capture}
                            {elseif {$savedaily->savedailychangetype} eq 1 }
                            {capture assign=k}{$k-{$savedaily->savedailychangeamount}}{/capture}

                            {/if}
                            {if {$savedaily->savedailychangetype} eq 1}
                            <tr class="danger"> {elseif {$savedaily->savedailychangetype} eq 0}
                                {else}
                            <tr>
                                {/if}
                                <td>{$savedaily->savename}</td>
                                <td>
                                    {$savedaily->processname}
                                    {if $savedaily->personName <> '0' && $savedaily->personName <> '' }
                                    -- ({$savedaily->personName})
                                    {/if}
                                </td>
                                <td nowrap="nowrap">{$savedaily->savedailydate}</td>
                                {if $burex <> 1}     <td>{$savedaily->savedailysavebefore}</td>{/if}
                                <td>
                                    <table border="1" width="100%"  style="text-align:center" class="table-black">

                                        <tr><td width="50%">   {if {$savedaily->savedailychangetype} eq 0}{$savedaily->savedailychangeamount}{/if}</td><td width="50%">{if {$savedaily->savedailychangetype} eq 1}{$savedaily->savedailychangeamount}{/if}</td></tr>

                                    </table>

                                </td>
                                {if $burex <> 1}
                                <td>{$savedaily->savedailysaveafter}</td>
                                {/if}
                                <td class="hidden-print ">

                                    {if {$savedaily->tablename} eq "buyBillController.php" || {$savedaily->tablename} eq "returnBuyBillController.php"  || {$savedaily->tablename} eq "buyAndReturnBillController.php"}
                                    <a href="{$savedaily->tablename}?do=details&id={$savedaily->savedailymodelid}" type="button" class="btn btn-default btn-lg editicon"></a>


                                    {elseif {$savedaily->tablename} eq "sellbillController.php" || {$savedaily->tablename} eq "sellbillandruternController.php"}

                                    <a href="{$savedaily->tablename}?do=showDetail&sellbillid={$savedaily->savedailymodelid}" type="button" class="btn btn-default btn-lg editicon"></a>


                                    {elseif {$savedaily->tablename} eq "returnsellbillController.php"}

                                    <a href="{$savedaily->tablename}?do=showDetail&returnsellbillid={$savedaily->savedailymodelid}" type="button" class="btn btn-default btn-lg editicon"></a>
                                    {elseif {$savedaily->tablename} eq "bills.php" || {$savedaily->tablename} eq "billsreturn.php"}

                                    <a href="{$savedaily->tablename}?do=details&id={$savedaily->savedailymodelid}" type="button" class="btn btn-default btn-lg editicon"></a>
                                    {else}
                                    <a href="{$savedaily->tablename}?do=editprint&id={$savedaily->savedailymodelid}" type="button" class="btn btn-default btn-lg editicon"></a>
                                    {/if}
                                </td>
                                <td class="hidden-print "> <a href="savedailyController.php?do=showDetail&savedailyid={$savedaily->savedailyid}" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                            </tr>

                            {/if}
                            {/foreach}
                            <tr>
                                {if $burex <> 1}
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                {else}
                                <td></td>
                                <td></td>
                                <td></td>
                                {/if}
                                <td> <table border="1" width="100%"  style="text-align:center" class="table-black">
                                        <tr><td width="50%">  {$j}</td><td width="50%">{$k}</td></tr>

                                    </table>
                                </td>
                                {if $burex <> 1}
                                <td></td>
                                {/if}
                                <td></td>
                                <td></td>
                            </tr>

                        </tbody>

                    </table>
                    <div class="col-lg-offset-8 col-lg-4">
                        {if $savedailydate eq 1}
                        <div class="well well-sm">

                            <h4 class="text-center">Total {$sumValue} {$currency}</h4>

                        </div>
                        {/if}
                    </div>
                    <div class="col-lg-offset-8 col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center"> Value of change
                                {$changeAmountSum} {$currency}</h4>
                        </div>
                    </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">Print</button>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    {else}
                    <div class="nodata"> Sorry, no results found  </div>
                    {/if}
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
