<?php

    include("../src/config.php");
	$id = $_POST["id"];
	
	$datos = array(); 
	$tr = "<table class='table table-hover table-condensed'><thead>
	<th>Id</th><th>Monto</th><th>Fecha</th><th>Tipo</th><th>Concepto</th><th>Editar</th></thead>";
	$a = mysql_query("select * from movimiento_cuenta where id_cuenta = '$id' order by id_movimiento DESC") or die(mysql_error());
	$tr.="<tbody>";
	$tr.="<div id='pagination'>";
	while($row = mysql_fetch_array($a)){
		$id = $row["id_cuenta"];
		$c++;
		$tr.="<tr>";
		$tr.="<td>".$row["id_movimiento"]."</td>";
		$tr.="<td>".$row["monto"]."</td>";
		$tr.="<td>".$row["fecha"]."</td>";
		$tr.="<td>".$row["tipo"]."</td>";
		$tr.="<td>".$row["concepto"]."</td>";
		$tr.="<td><a  class='btn btn-success btn-sm' href='javascript:void(0)' onclick='datos($id)'> Editar </a></td>";
		
		$tr.="</tr>";
	}
	$tr.="</div>";
	$tr.="</tbody>";
	$tr.="<tfoot>";
	$tr.="<th>Rgtros:</th>";
	$tr.="<td class='text-primary'>".$c."</td>";
	$tr.="</tfoot>";
	$tr.="</table>";
	$datos["tabla"] = $tr;

	echo json_encode($datos);


?>