<div class="page-content">
	<div class="page-header position-relative">
		<h1>
			Payments Lists <small> <i class="icon-double-angle-right"></i> With
				Total Expense &amp; Total Income
			</small>

		</h1>

	</div>

	<!--/.page-header-->
	<div class="row-fluid">
		<div class="span7" id="8">
			<form class="form-horizontal" method="post" action="">
				<div class="control-group">
					<label class="control-label">Date Range:</label>
					<div class="controls">
						<div class="row-fluid input-prepend">

							<input class="span6" type="text" name="date[final]"
								id="id-date-range-picker-1"
								placeholder="<?php echo $paymentdate['final']; ?>" /> <span
								class="add-on"> <i class="icon-calendar big"></i>
							</span> <input type="hidden" name="check" value="date">
							<button class="btn btn-small btn-purple" name="submit">Show</button>

						</div>
						<!-- .row-fluid input-prepend -->


					</div>
					<!-- /controls -->
				</div>
				<!-- /control-group -->
			</form>
		</div>
	</div>
	<!-- /control-group -->


	<div class="row-fluid">

		<div class="span4">
			<div class="control-group">
				<div class="controls">
									<?php $settingchck= $db->get_col("setting", array('id'=>1), 'currency');?>
									<h3>
										Total Expense:&nbsp
										<?php
										if ($t_exp != '') {
											if ($settingchck [0] != '') {
												echo CURRENCY . '&nbsp';
											}
											echo $t_exp;
										} else {
											echo "No Expense";
										}
										?>
									</h3>

				</div>
				<!-- /controls -->
			</div>
			<!-- /control-group -->
		</div>
		<div class="span4">
			<div class="control-group">
				<div class="controls">
					<h3>
										Total Income:&nbsp
										<?php
										if ($t_inc != '') {
											if ($settingchck [0] != '') {
												echo CURRENCY . '&nbsp';
											}
											echo $t_inc;
										} else {
											echo "No Income";
										}
										?>
									</h3>

				</div>
				<!-- /controls -->
			</div>
			<!-- /control-group -->
		</div>
	</div>

	<div class="hr hr32 hr-dotted"></div>
	<div class="row-fluid">

		<div class="span12">
			<!--PAGE CONTENT BEGINS-->

			<table id="example-table"
				class="table-bhangi table table-striped table-bordered table-hover no-margin-bottom no-border-top">
				<thead>
					<tr>
						<th>S.No.</th>
						<th>Amount</th>
						<th>Description</th>
						<th>Date</th>
						<th>Types</th>
						<th>Files</th>
						<th></th>
					</tr>
				</thead>

				<tbody>
										<?php
										$a = 1;
										
										foreach ( $query as $row ) {
											?>
										<tr>
						<td> <?php echo $a; ?> </td>
						<td> <?php echo CURRENCY.'&nbsp;'.$row['amount'];?> </td>
						<td> <?php echo $row['description'];?></td>
						<td> <?php echo $row['date'];?> </td>
						<td> <?php echo $row['payment'];?> </td>
						                    
						                   	<?php
											
											$b = $row ['files'];
											$ftotal = explode ( ",", $b );
											?>
						                   	 
						                   	 
						                   	<td> <?php
											
											foreach ( $ftotal as $key ) {
												$sfile = explode ( "___", $key );
												if ($sfile ['1'] != "")
													echo "<label class='label label-small label-warning'>" . $sfile ['1'] . " </label>";
												echo '&nbsp';
											}
											?>
						                   	</td>
						<td class="td-actions">
							<div class="hidden-phone visible-desktop action-buttons">


								<a class="green"
									href="<?php echo $link->link('edit_paymentdetails', Admin, '?id='.$row[id]);?>">
									<i class="icon-pencil bigger-130"></i>
								</a> <a class="red"
									href="<?php echo $link->link('payment_details', Admin, '?id='.$row[id]);?>">
									<i class="icon-trash bigger-130"></i>
								</a>

							</div>

							<div class="hidden-desktop visible-phone">
								<div class="inline position-relative">
									<button class="btn btn-minier btn-yellow dropdown-toggle"
										data-toggle="dropdown">
										<i class="icon-caret-down icon-only bigger-120"></i>
									</button>

									<ul
										class="dropdown-menu dropdown-icon-only dropdown-yellow pull-right dropdown-caret dropdown-close">


										<li><a
											href="<?php echo $link->link('edit_paymentdetails', Admin, '?id='.$row[id]);?>"
											class="tooltip-success" data-rel="tooltip" title="Edit"> <span
												class="green"> <i class="icon-edit bigger-120"></i>
											</span>
										</a></li>

										<li><a
											href="<?php echo $link->link('payment_details', Admin, '?id='.$row[id]);?>"
											class="tooltip-error" data-rel="tooltip" title="Delete"> <span
												class="red"> <i class="icon-trash bigger-120"></i>
											</span>
										</a></li>
									</ul>
								</div>
							</div>
						</td>
					</tr>
										  <?php
											$a ++;
										}
										?>       
										

										
										</tbody>
			</table>

			<!--PAGE CONTENT ENDS-->
		</div>
		<!--/.span-->
	</div>
	<!--/.row-fluid-->
</div>
<!--/.page-content-->


</div>
<!--/.main-content-->