

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

        <ol class="breadcrumb">
            <li><a href="#">المشروعات </a></li>
            <li><a href="projectsaccountreport.php">  تقرير حساب المشروعات </a></li>
            <li class="active">عرض   </li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
           <!--  <div class="panel-heading" style="padding:5px 15px 15px">
                <h3 class="panel-title" style="display: inline-block;"> عرض       </h3>
                <a href="{$youtubes[198]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
                <a href="projectstagesController.php" class="hidden-print"><input type="button"  id="submit" style="margin-left: 12px" class="btn btn-primary pull-left " value="إضافة جديد"/></a>
            </div> -->
            
            <!-- <hr/> -->

            <form class="form-inline hidden-print" method="post" action="projectsaccountreport.php">
                    
                   
                        
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker getprojectdatareport" autocomplete="off"   data-date-format="yyyy-mm-dd"  name="start_date" value="{$date}">
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker getprojectdatareport" autocomplete="off"   data-date-format="yyyy-mm-dd"  name="end_date" value="{$date}">
                    </div>
                     
                     <div class="form-group"  >
                        <label class="sr-only">المشروعات</label>
                        <div style="width: 400px;">
                            <input type="text"  class=" getselectjoin getprojectdatareport" name="projectid" id="projectid"  data-placeholder="اختر  "   data-table="project"   
                            data-search="name"/> 
                        </div> 
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>

                    
                   
            </form>
            <hr/>


            {if $projectid}
            <div class="row">
                <div class="col-lg-6" >
                    <div class="col-lg-12 text-center"  style="color: red;font-size: 20px">المصروفات </div>
                    <table class="col-lg-12 text-center table table-bordered">
                        <thead style="background: #ccc;font-size: 20px">
                            <tr>
                                <td width="40%">نوع المصروف</td>
                                <td width="20%">المصروف</td>
                                <td width="40%"> الاشراف
                                    <!--<table class="table billtable table-bordered">-->
                                    <!--    <tr>-->
                                    <!--        <td style="color:black!important;width: 50%" class="color-black"> النوع</td>-->
                                    <!--        <td style="color:black!important;width: 50%" class="color-black"> القيمه</td>-->
                                    <!--    </tr>-->
                                    <!--</table>-->
                                </td>

                            </tr>
                        </thead>
                        <tbody>
                             {foreach $allexpensestype as $expensestype}
                            <tr>
                                <td>{$expensestype.expensestypename}</td>
                                <td>{$expensestype.totals}</td>
                                <td>{$expensestype.finalsupervisions}</td>
                                
                                
                                <!--<td><span style="float: right;padding-right: 30px">{$expensestype.finalsupervisions}</span> <span style="float: left;padding-left: 30px">{$expensestype.amount}</span></td>-->
                            </tr>
                            {/foreach}
                             <tr style="background: #9effb0">
                                <td>الاجمالى</td>
                                <td>{$alltotals}</td>
                                <td style="text-align: center;">{$alltotalvalues}</td>
                            </tr>
                        </tbody>
                    </table>


                </div>
                <div class="col-lg-1" >

                </div>
                <div class="col-lg-5" >
                    <div class="col-lg-12 text-center" style="color: red;font-size: 20px">التحصيل </div>
                    <table class="col-lg-12 text-center table table-bordered">
                        <thead style="background: #ccc;font-size: 20px">
                            <tr>
                                <td width="50%">التاريخ</td>
                                <td width="50%">القيمه</td>
                            </tr>
                        </thead>
                        <tbody>
                              {assign var=totalchange value=0}
                            {foreach $clientdebtchanges as $clientdebtchange}
                            <tr>
                                <td>{$clientdebtchange.clientdebtchangedate}</td>
                                <td>{$clientdebtchange.clientdebtchangeamount}</td>
                            </tr>
                            {capture assign=totalchange}{$totalchange+$clientdebtchange.clientdebtchangeamount}{/capture}
                            {/foreach}
                             <tr style="background: #9effb0">
                                <td>الاجمالى</td>
                                <td>{$totalchange}</td>
                            </tr>
                        </tbody>
                    </table>
                    
                    
                     <div class="col-lg-12 text-center" style="color: red;font-size: 20px">الايرادات </div>
                    <table class="col-lg-12 text-center table table-bordered">
                        <thead style="background: #ccc;font-size: 20px">
                            <tr>
                                <td width="50%">التاريخ</td>
                                <td width="50%">القيمه</td>
                            </tr>
                        </thead>
                        <tbody>
                              {assign var=incometotalchange value=0}
                            {foreach $incomes as $income}
                            <tr>
                                <td><span style="font-weight: 600;">{$income.incomeName}</span>  / {$income.incomeDate}</td>
                                <td>{$income.incomeValue}</td>
                            </tr>
                            {capture assign=incometotalchange}{$incometotalchange+$income.incomeValue}{/capture}
                            {/foreach}
                             <tr style="background: #9effb0">
                                <td>الاجمالى</td>
                                <td>{$incometotalchange}</td>
                            </tr>
                        </tbody>
                    </table>

                </div>
            </div>
            <div class="container">
                <table class="col-lg-12 text-center table table-bordered">
                    <thead style="background: #ccc;font-size: 20px">
                        <tr>
                            <td width="40%">اجمالى المصروفات </td>
                            <td width="30%">الاشراف</td>
                            <td width="40%">ايراد</td>
                        </tr>
                    </thead>
                    <tbody>
                        
                        <tr>
                             <td>{$alltotals}</td>
                            <td>{$alltotalvalues}</td>
                           <td>{$totalchange + $incometotalchange}</td>
                        </tr>
                      
                    </tbody>
                </table>
            </div>
            <div class="row">
                <div class="col-lg-12 text-center" style="font-size: 30px"> المطلوب </div>
                <div class="col-lg-12 text-center" > <h2>{($alltotals + $alltotalvalues) - ($totalchange + $incometotalchange)}  </h2> </div>
            </div>
            {/if}
            <div class="clearfix"></div>
        </div>

    </div>

</div>



