<style>
    @media print{
        .table-black{
            border : 1px solid black;
        }
        td ,th {
            border: 1px solid #000 !important;
        }
    }
</style>

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

        <ol class="breadcrumb">
            <li><a href="#">المخازن</a></li>
            <li><a href="storeController.php?do=show">المخازن</a></li>
            <li class="active">عرض المخازن</li>
        </ol>

        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">عرض المخازن
                <a href="{$youtubes[117]->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">
                <div id="outputString" class="alert alert-block alert-success fade in" style="display:none">
                    <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">&times;</button>
                    <p id="outputStringValue">{$outputString}</p>
                    <div class="clearfix"></div>
                </div>
            </div>
            <!-- Table -->
            <div style="width: 100%; overflow-x: scroll;">
                <table class="table table-black">
                    <thead>
                        <tr>
                            <th>المخزن</th>
                            <th colspan="3" style="text-align: center">عدد القطع</th>
                            <th colspan="3" style="text-align: center">سعر الشراء</th>
                            <th colspan="3" style="text-align: center">اخر سعر شراء</th>
                            <th colspan="3" style="text-align: center">اخر سعر شراء بعد الخصم</th>
                            <th colspan="3" style="text-align: center">متوسط سعر الشراء</th>
                            <th colspan="3" style="text-align: center">متوسط سعر الشراء بعد الخصم</th>
                            <th colspan="3" style="text-align: center">سعر بيع الجملة</th>
                            <th colspan="3" style="text-align: center">سعر نص الجملة</th>
                            <th colspan="3" style="text-align: center">سعر القطاعى</th>
                        </tr>
                        <tr>
                            <th></th>
                            <th>موجب</th>
                            <th>سالب</th>
                            <th style="background-color: #bbdefb">اجمالى</th>

                            <th>موجب</th>
                            <th>سالب</th>
                            <th style="background-color: #bbdefb">اجمالى</th>

                            <th>موجب</th>
                            <th>سالب</th>
                            <th style="background-color: #bbdefb">اجمالى</th>

                            <th>موجب</th>
                            <th>سالب</th>
                            <th style="background-color: #bbdefb">اجمالى</th>

                            <th>موجب</th>
                            <th>سالب</th>
                            <th style="background-color: #bbdefb">اجمالى</th>

                            <th>موجب</th>
                            <th>سالب</th>
                            <th style="background-color: #bbdefb">اجمالى</th>

                            <th>موجب</th>
                            <th>سالب</th>
                            <th style="background-color: #bbdefb">اجمالى</th>

                            <th>موجب</th>
                            <th>سالب</th>
                            <th style="background-color: #bbdefb">اجمالى</th>

                            <th>موجب</th>
                            <th>سالب</th>
                            <th style="background-color: #bbdefb">اجمالى</th>
                        </tr>
                    </thead>
                    <tbody>
                        {assign var=totQty value=0}
                        {assign var=totQty_n value=0}
                        {assign var=tot_productBuyPrice value=0}
                        {assign var=tot_productBuyPrice_n value=0}
                        {assign var=tot_productSellAllPrice value=0}
                        {assign var=tot_productSellAllPrice_n value=0}
                        {assign var=tot_productSellUnitPrice value=0}
                        {assign var=tot_productSellUnitPrice_n value=0}
                        {assign var=tot_productSellHalfPrice value=0}
                        {assign var=tot_productSellHalfPrice_n value=0}
                        {assign var=tot_lastbuyprice value=0}
                        {assign var=tot_lastbuyprice_n value=0}
                        {assign var=tot_lastbuyprice_withDiscount value=0}
                        {assign var=tot_lastbuyprice_withDiscount_n value=0}
                        {assign var=tot_meanbuyprice value=0}
                        {assign var=tot_meanbuyprice_n value=0}
                        {assign var=tot_meanbuyprice_withDiscount value=0}
                        {assign var=tot_meanbuyprice_withDiscount_n value=0}
                        {foreach $storeData as $store}
                        {if {$store->conditions} eq 1}
                        <tr class="danger">
                            {elseif {$store->conditions} eq 0}
                        <tr>
                            {/if}

                            <td style="background-color: #72b2e6">{$store->storeName}</td>
                            <td>{$store->totQty}{assign var=totQty value=$totQty + $store->totQty}</td>
                            <td>{$store->totQty_n}{assign var=totQty_n value=$totQty_n + $store->totQty_n}</td>
                            <td style="background-color: #bbdefb">{$store->totQty+$store->totQty_n}</td>

                            <td>{$store->tot_productBuyPrice}{assign var=tot_productBuyPrice value=$tot_productBuyPrice + $store->tot_productBuyPrice}</td>
                            <td>{$store->tot_productBuyPrice_n}{assign var=tot_productBuyPrice_n value=$tot_productBuyPrice_n + $store->tot_productBuyPrice_n}</td>
                            <td style="background-color: #bbdefb">{$store->tot_productBuyPrice+$store->tot_productBuyPrice_n}</td>

                            <td>{$store->tot_lastbuyprice}{assign var=tot_lastbuyprice value=$tot_lastbuyprice + $store->tot_lastbuyprice}</td>
                            <td>{$store->tot_lastbuyprice_n}{assign var=tot_lastbuyprice_n value=$tot_lastbuyprice_n + $store->tot_lastbuyprice_n}</td>
                            <td style="background-color: #bbdefb">{$store->tot_lastbuyprice+$store->tot_lastbuyprice_n}</td>

                            <td>{$store->tot_lastbuyprice_withDiscount}{assign var=tot_lastbuyprice_withDiscount value=$tot_lastbuyprice_withDiscount + $store->tot_lastbuyprice_withDiscount}</td>
                            <td>{$store->tot_lastbuyprice_withDiscount_n}{assign var=tot_lastbuyprice_withDiscount_n value=$tot_lastbuyprice_withDiscount_n + $store->tot_lastbuyprice_withDiscount_n}</td>
                            <td style="background-color: #bbdefb">{$store->tot_lastbuyprice_withDiscount+$store->tot_lastbuyprice_withDiscount_n}</td>

                            <td>{$store->tot_meanbuyprice}{assign var=tot_meanbuyprice value=$tot_meanbuyprice + $store->tot_meanbuyprice}</td>
                            <td>{$store->tot_meanbuyprice_n}{assign var=tot_meanbuyprice_n value=$tot_meanbuyprice_n + $store->tot_meanbuyprice_n}</td>
                            <td style="background-color: #bbdefb">{$store->tot_meanbuyprice+$store->tot_meanbuyprice_n}</td>

                            <td>{$store->tot_meanbuyprice_withDiscount}{assign var=tot_meanbuyprice_withDiscount value=$tot_meanbuyprice_withDiscount + $store->tot_meanbuyprice_withDiscount}</td>
                            <td>{$store->tot_meanbuyprice_withDiscount_n}{assign var=tot_meanbuyprice_withDiscount_n value=$tot_meanbuyprice_withDiscount_n + $store->tot_meanbuyprice_withDiscount_n}</td>
                            <td style="background-color: #bbdefb">{$store->tot_meanbuyprice_withDiscount+$store->tot_meanbuyprice_withDiscount_n}</td>

                            <td>{$store->tot_productSellAllPrice}{assign var=tot_productSellAllPrice value=$tot_productSellAllPrice + $store->tot_productSellAllPrice}</td>
                            <td>{$store->tot_productSellAllPrice_n}{assign var=tot_productSellAllPrice_n value=$tot_productSellAllPrice_n + $store->tot_productSellAllPrice_n}</td>
                            <td style="background-color: #bbdefb">{$store->tot_productSellAllPrice+$store->tot_productSellAllPrice_n}</td>

                            <td>{$store->tot_productSellHalfPrice}{assign var=tot_productSellHalfPrice value=$tot_productSellHalfPrice + $store->tot_productSellHalfPrice}</td>
                            <td>{$store->tot_productSellHalfPrice_n}{assign var=tot_productSellHalfPrice_n value=$tot_productSellHalfPrice_n + $store->tot_productSellHalfPrice_n}</td>
                            <td style="background-color: #bbdefb">{$store->tot_productSellHalfPrice+$store->tot_productSellHalfPrice_n}</td>

                            <td>{$store->tot_productSellUnitPrice}{assign var=tot_productSellUnitPrice value=$tot_productSellUnitPrice + $store->tot_productSellUnitPrice}</td>
                            <td>{$store->tot_productSellUnitPrice_n}{assign var=tot_productSellUnitPrice_n value=$tot_productSellUnitPrice_n + $store->tot_productSellUnitPrice_n}</td>
                            <td style="background-color: #bbdefb">{$store->tot_productSellUnitPrice+$store->tot_productSellUnitPrice_n}</td>

                        </tr>
                        {/foreach}


                        <tr style="background-color:#bbdefb;">
                            <td style="background-color:#72b2e6;font-weight: bold">الاجمالى</td>
                            <td>{$totQty}</td>
                            <td>{$totQty_n}</td>
                            <td style="background-color:#72b2e6;font-weight: bold">{$totQty+$totQty_n}</td>

                            <td>{$tot_productBuyPrice}</td>
                            <td>{$tot_productBuyPrice_n}</td>
                            <td style="background-color:#72b2e6;font-weight: bold">{$tot_productBuyPrice+$tot_productBuyPrice_n}</td>

                            <td>{$tot_lastbuyprice}</td>
                            <td>{$tot_lastbuyprice_n}</td>
                            <td style="background-color:#72b2e6;font-weight: bold">{$tot_lastbuyprice+$tot_lastbuyprice_n}</td>

                            <td>{$tot_lastbuyprice_withDiscount}</td>
                            <td>{$tot_lastbuyprice_withDiscount_n}</td>
                            <td style="background-color:#72b2e6;font-weight: bold">{$tot_lastbuyprice_withDiscount+$tot_lastbuyprice_withDiscount_n}</td>

                            <td>{$tot_meanbuyprice}</td>
                            <td>{$tot_meanbuyprice_n}</td>
                            <td style="background-color:#72b2e6;font-weight: bold">{$tot_meanbuyprice+$tot_meanbuyprice_n}</td>

                            <td>{$tot_meanbuyprice_withDiscount}</td>
                            <td>{$tot_meanbuyprice_withDiscount_n}</td>
                            <td style="background-color:#72b2e6;font-weight: bold">{$tot_meanbuyprice_withDiscount+$tot_meanbuyprice_withDiscount_n}</td>

                            <td>{$tot_productSellAllPrice}</td>
                            <td>{$tot_productSellAllPrice_n}</td>
                            <td style="background-color:#72b2e6;font-weight: bold">{$tot_productSellAllPrice+$tot_productSellAllPrice_n}</td>

                            <td>{$tot_productSellHalfPrice}</td>
                            <td>{$tot_productSellHalfPrice_n}</td>
                            <td style="background-color:#72b2e6;font-weight: bold">{$tot_productSellHalfPrice+$tot_productSellHalfPrice_n}</td>

                            <td>{$tot_productSellUnitPrice}</td>
                            <td>{$tot_productSellUnitPrice_n}</td>
                            <td style="background-color:#72b2e6;font-weight: bold">{$tot_productSellUnitPrice+$tot_productSellUnitPrice_n}</td>
                        </tr>

                    </tbody>
                </table>
            </div>

            <!--            <div class=" col-lg-4">
                            <div class="well well-sm">
                                <h4 class="text-center">اجمالى العدد : {$totQty}</h4>
                            </div>
                        </div>
                        <div class=" col-lg-4">
                            <div class="well well-sm">
                                <h4 class="text-center">اجمالى السعر : {$tot_productBuyPrice}</h4>
                            </div>
                        </div>-->


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

        </div>


