<div class="page-content-wrapper">
                <div class="page-content">
                    <div class="page-bar">
                        <div class="page-title-breadcrumb">                            
                            <ol class="breadcrumb page-breadcrumb pull-right">
                                <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="index.php?page=home">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
                                </li>
                                <li><a class="parent-item" href="">Accounts</a>&nbsp;<i class="fa fa-angle-right"></i></li><li class="active">Profit & Loss</li>
                            </ol>
                        </div>
                    </div>
<div class="row">
                        <div class="col-md-12 col-sm-12">
                            <div class="card card-box">
                                <div class="card-head">
                                    <header>Profit and Loss of <?php echo(SITE_NAME); ?></header>       
                                </div>
                                <div class="card-body" id="bar-parent1">
                                
                                <form id="searchFrm" name="searchFrm" method="post" action="">	
                                    <div class="col-12 row">
                                      <div class="col-3">                                        
                                        <label class="col-md-12 control-label">From Date</label>
	                                            <div class="input-group date form_date col-12" data-date="<?php if(isset($_POST['from_date'])){ echo $_POST['from_date']; } ?>" data-date-format="dd-mm-yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
	                                                <input class="form-control" size="16" value="<?php if(isset($_POST['from_date'])){ echo $_POST['from_date']; }?>" type="text">
	                                                <span class="input-group-addon"><span class="fa fa-remove"></span></span>
	                                                <span class="input-group-addon"><span class="fa fa-calendar"></span></span>
	                                            </div>
	                                            <input name="from_date" id="dtp_input2" value="<?php if(isset($_POST['from_date'])){ echo $_POST['from_date']; }?>" type="hidden">
                                      </div>
                                      
                                      
                                      <div class="col-3">                                        
                                        <label class="col-md-6 control-label">To Date</label>
	                                            <div class="input-group date form_date col-12" data-date="<?php if(isset($_POST['date_to'])){ echo $_POST['date_to']; }?>" data-date-format="dd-mm-yyyy" data-link-field="dtp_input3" data-link-format="yyyy-mm-dd">
	                                                <input class="form-control" size="16" value="<?php if(isset($_POST['date_to'])){ echo $_POST['date_to']; }?>" type="text">
	                                                <span class="input-group-addon"><span class="fa fa-remove"></span></span>
	                                                <span class="input-group-addon"><span class="fa fa-calendar"></span></span>
	                                            </div>
	                                            <input name="date_to" id="dtp_input3" value="<?php if(isset($_POST['date_to'])){ echo $_POST['date_to']; }?>" type="hidden">
                                      </div>
                                      
                                      <div class="col-2">
                                        <div class="col-sm-12 pt-4 text-center">
                                             <button type="submit" name="search" class="btn btn-primary">Search</button>
                                        </div>				  	
                                      </div>	
                                      <div class="col-4">
                                        			  	
                                      </div>
                                      			  
                                    </div>		
                                    </form>
                                	
                                	<?php if(isset($error) && $error!='') { ?> 
                                	<div class="alert alert-danger mt-3"><?php echo $error; ?></div>
                                	<?php } else if(isset($pageMsg) && $pageMsg!='') { ?> 
                                	<div class="alert alert-danger mt-3"><?php echo $pageMsg; ?></div>
                                	<?php } ?>                                		
                                	
                                    <?php if(empty($pageMsg) && empty($error)){  ?> 
                                    <div class="col-12" >
                                    	<h3>Total Task Amount: <?php echo money_format('%!i', $totalTaskAmount); ?></h3>
										<h3>Total Task Commission: <?php echo money_format('%!i', $totalTaskCommission); ?></h3>
										<h3>Total Technician Fee: <?php echo money_format('%!i', $totalTechPaid); ?></h3>
										<h3>Total Shop Fee: <?php echo money_format('%!i', $totalShopPaid); ?></h3>
										
										<h3>Total Staff Salary: <?php echo money_format('%!i', $totalSalary); ?></h3>
										<h3>Total Credits to Technicians: <?php echo money_format('%!i', $totExtraCredits); ?></h3>
										<h3>Total Credits to Users: <?php echo money_format('%!i', $totExtraUserCredits); ?></h3>
										<h3>Other Expenses: <?php echo money_format('%!i', $otherExpenses); ?></h3>
										
										<?php if($totalBalance>0){ ?>
											<h3 style="color: green;">Profit: <?php echo money_format('%!i', $totalBalance); ?></h3>
										<?php } else { ?>
											<h3 style="color: red;">Loss: <?php echo money_format('%!i', abs($totalBalance)); ?></h3>
										<?php } ?>
                                    </div>
                                    <?php } ?>  
                                    
                                    
                                </div>
                            </div>
                        </div>
                    </div>
	</div>
</div>
