<?php
$edit_id = $link->hrefquery ();
$getid = $edit_id [1];
$query = $db->get_row ( 'payment', array ('id' => $getid ) );
?>
<div class="page-content">
	<div class="page-header position-relative"></div>
	<!--/.page-header-->

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

			<div class="row-fluid">
				<div class="span7">
					<div class="widget-box">
						<div class="widget-header widget-header-blue widget-header-flat">
							<h4 class="lighter">Edit Your Account</h4>


						</div>

						<div class="widget-body">
							<div class="widget-main">
								<div class="row-fluid">


									<div class="step-content row-fluid position-relative"
										id="step-container">
										<div class="step-pane active">

											<form class="form-horizontal" method="post" action=""
												enctype="multipart/form-data">

												<div class="control-group">
													<label class="control-label" for="amount">Amount</label>
													<div class="controls">
														<input type="text" name="edit[amount]" class="span9"
															required="required"
															value="<?php echo $query['amount'];?>">
													</div>
													<!-- /controls -->
												</div>
												<!-- /control-group -->

												<div class="control-group">
													<label class="control-label" for="form-field-11">Description</label>

													<div class="controls">
														<textarea id="form-field-11"
															class="autosize-transition span9"
															name="edit[description]"><?php echo $query['description'];?></textarea>
													</div>
												</div>

												<div class="control-group">
													<div class="controls">
														<div class="span3">
															<label> <input name="edit[radio]" value="expense"
																type="radio"
																<?php if($query['payment'] == 'expense') { echo 'checked';}?>>
																<span class="lbl">Expense</span>
															</label> <label></label>
														</div>
														<div class="span3">
															<input name="edit[radio]" value="income" type="radio"
																<?php if($query['payment'] == 'income') { echo 'checked';}?>>
															<span class="lbl">Income</span>

														</div>
													</div>
												</div>



												<div class="control-group">
													<div class="controls">
														<p>
															<input type="file" size="32" name="my_field[]" value="" />
														</p>
														<p>
															<input type="file" size="32" name="my_field[]" value="" />
														</p>
														<p>
															<input type="file" size="32" name="my_field[]" value="" />
														</p>
													</div>
												</div>


												<div class="control-group">
													<label class="control-label">Date:</label>

													<div class="controls">
														<div class="span12">
															<input class="span4 date-picker" id="id-date-picker-1"
																type="text" data-date-format="dd-mm-yyyy"
																name="edit[date]" required="required"
																value="<?php echo $query['date']; ?>" /> <span
																class="add-on"> <i class="icon-calendar"></i>
															</span>
														</div>
													</div>
												</div>

												<div class="control-group">

													<div class="controls">
														<span class="span12"> <input type="hidden" name="action"
															value="multiple" /> <input type="hidden" name="id"
															value="<?php echo $query['id']; ?>"> <input type="hidden"
															name="check" value="edit">
															<button type="submit" name="submit"
																class="btn btn-small btn-primary">Save</button>
														</span>
													</div>
												</div>

											</form>
										</div>

									</div>



								</div>
								<!-- row fluid -->
							</div>
							<!--/widget-main-->
						</div>
						<!--/widget-body-->
					</div>
				</div>
				<!-- span7 -->

				<div class="span4">
					<div class="widget-box">
						<div class="widget-header widget-header-blue widget-header-flat">
							<h4 class="lighter">Show Payment Files</h4>
						</div>

						<div class="widget-body">
							<div class="widget-main">
								<div class="row-fluid">
									<table class="table table-striped table-bordered table-hover">

										<tbody>
										                <?php
																										$space = explode ( ',', $query ['files'] );
																										
																										?>
										                  
										                  <?php
																												foreach ( $space as $row ) {
																													$name = explode ( '___', $row );
																													
																													if ($name [1] != "")
																														echo '<tr><td><a href="' . $link->link ( 'downloads', Admin, '?load=' . $row . '&path=' . 'uploads/files' . '/' ) . ' ">' . $name [1] . '</a></td>
										                  	<td><div class="hidden-phone visible-desktop action-buttons">
																	<a class="red" href="' . $link->link ( 'edit_paymentdetails', Admin, '?name=' . $query ['id'] . '___' . $row ) . '">
																		<i class="icon-trash bigger-130"></i>
																	</a>
																</div>
										                  	</td></tr>';
																												}
																												?>            
										               </tbody>

									</table>
								</div>
								<!-- row fluid -->
							</div>
							<!--/widget-main-->
						</div>
						<!--/widget-body-->
					</div>
				</div>
			</div>
			<!-- row fluid -->

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


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