
<!-- [ Main Content ] start -->
<div class="pcoded-main-container">
    <div class="pcoded-content">
        <!-- [ breadcrumb ] start -->
        <div class="page-header">
            <div class="page-block">
                <div class="row align-items-center">
                    <div class="col-md-12">
                        <div class="page-header-title">
                            <h5 class="m-b-10">Muhasebe</h5>
                        </div>
                        <ul class="breadcrumb">
                            <li class="breadcrumb-item"><a href="<?php echo site_url('anasayfa');?>"><i class="feather icon-home"></i></a></li>
                            <li class="breadcrumb-item"><a href="#!">Muhasebe</a></li>
                           
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <!-- [ breadcrumb ] end -->
        <!-- [ Main Content ] start -->
        <div class="row">
            <div class="col-md-8">
               
					    <div class="card">
                            <div class="card-header">
                                <h5 class="mb-2">Genel muhasebe</h5>
								 <p class="text-muted mb-0">Alınan,verilen ve beklede olan ücretlerinizi Görebilirisiniz</p>
									<br>
									<div class="input-group">
										<input type="search" id="arama" placeholder="Arama...">
									</div>
									
							
							</div>
                            <div class="card-body">
					  
					 <?php if(count($CMsonuc)==0){ ?> 
					 <center><i>Bir Sonuç Bulunamadı</i></center>
					 <?php }else{ ?> 
					  
								
						<div class="table-responsive">
                            <table class="table table-hover mb-0">
                                <thead>
                                    <tr> 
                                        <th>Tür</th>
                                        <th>Tarih</th>
                                        <th>Açıklama</th>
                                        <th>Fiyat</th>
                                    </tr>
                                </thead>
                                <tbody>
								 <?php
										$sonucgelir=0;
										$sonucgider=0;
										$sonucbekleme=0;

								 foreach($CMsonuc as $yg){ ?>
									<tr>
										<td>
										<?php 
										
											if (is_numeric($yg['fiyat']))
											{
												
												if($yg['tur']==1){
												$sonucgelir = $sonucgelir + $yg['fiyat'];	
												};
												if($yg['tur']==2){
												$sonucgider = $sonucgider + $yg['fiyat'];	
												};
												if($yg['tur']==3){
													$sonucbekleme = $sonucbekleme + $yg['fiyat'];
												}
											};
										
										
										if($yg['tur']==1){echo "Verildi";};
										if($yg['tur']==2){echo "Alındı";};
										if($yg['tur']==3){echo "Beklemede";};?>
										</td>
										<td><?php echo tarihyazdir($yg['tarih']); ?></td>
										<td><?php echo substr($yg['aciklama'],0,50); ?></td>
										<td><?php echo $yg['fiyat']; ?></td>
										
									</tr>
									<?php } ?>
                                                                      
                                </tbody>
                            </table>
                        </div>
						
						
						
						
						
						
						
						
						
						
						
						
						
						

						
					 <?php } ?> 	
						</div>
                        </div>
					  
					
					  
               
			      
              
            </div>
            
			<?php if(isset($donencalisan)){ ?> 	
			<div class="col-md-4">
                <div class="card">
                    <div class="card-header">
                        <h5>
						
						<?php 
						
							echo isimogren('yapan', $donencalisan);
							
						?>
						
						
						</h5>
                    </div>
                    <ul class="list-group list-group-flush">
					<?php if($sonucgelir!=0){ ?> 	
                        <li class="list-group-item py-0">
						
						<div class="d-flex bd-highlight ">
							  <div class="p-2 flex-fill bd-highlight">Veriğiniz Ücretler</div>
							  <div class="p-2 flex-fill bd-highlight text-right"><?php echo $sonucgelir." TL";  ?></div>
							</div>
							
                        </li>
					<?php } ?> 	
                       <li class="list-group-item py-0">
							
							<div class="d-flex bd-highlight ">
							  <div class="p-2 flex-fill bd-highlight">Alınan Ücretler</div>
							  <div class="p-2 flex-fill bd-highlight text-right"><?php echo $sonucgider." TL";  ?></div>
							</div>
                        </li>
						<li class="list-group-item py-0">
							<div class="d-flex bd-highlight ">
							  <div class="p-2 flex-fill bd-highlight">Ödeme Bekleyen(Alınacak Ücret)</div>
							  <div class="p-2 flex-fill bd-highlight text-right"><?php echo $sonucbekleme." TL";  ?></div>
							</div>
                            
                        </li>
						<li class="list-group-item py-0">
							<div class="d-flex bd-highlight ">
							  <div class="p-2 flex-fill bd-highlight">Durum 
							  <?php 
							  if($sonucgider>$sonucbekleme){ echo " ( Borçlu )";}; 
							  if($sonucbekleme<$sonucgider){ echo " ( Alacaklı )";}; 
							  
							  ?>
							  </div>
							  <div class="p-2 flex-fill bd-highlight text-right">
							  <?php
								if($sonucgider>$sonucbekleme){ echo $sonucgider-$sonucbekleme." TL";};  
								if($sonucgider<$sonucbekleme){ echo $sonucbekleme-$sonucgider." TL";};  
							  ?>
							  </div>
							</div>
                        </li>
					</ul>
                   
                </div>
            </div>
        
			
           <?php } ?> 
		   
		   
			    
        </div>
        <!-- [ Main Content ] end -->
    </div>
</div>

<!-- [ Main Content ] end -->







