<?php	require_once('../preheader1.php'); // <-- this include file MUST go first before any 

	#the code for the class
	include ('../ajaxCRUD.class.php'); // <-- this include file MUST go first before any HTML/output

    #this one line of code is how you implement the class
    ########################################################
    ##

    $tabla1 = new ajaxCRUD("Datos", "datos", "id_datos", "../");

    ##
    ########################################################

    ## all that follows is setup configuration for your fields....
    ## full API reference material for all functions can be found here - http://ajaxcrud.com/api/
    ## note: many functions below are commented out (with //). note which ones are and which are not

    #i can define a relationship to another table
    #the 1st field is the fk in the table, the 2nd is the second table, the 3rd is the pk in the second table, the 4th is field i want to retrieve as the dropdown value
    #http://ajaxcrud.com/api/index.php?id=defineRelationship
    //$tabla1->defineRelationship("fkID", "tabla1Relationship", "pkID", "fldName", "fldSort DESC"); //use your own table - this table (tabla1Relationship) not included in the installation script

	//$tabla1->defineRelationship("usuario","ingreso","user","doc");

	//$tabla1->addAjaxFilterBox('celular',11);

    #i don't want to visually show the primary key in the table
    
	//$tabla1->displayAddFormTop();
	
	//$tabla1->showCSVExportOption();
	
	$tabla1->omitPrimaryKey();

    #the table fields have prefixes; i want to give the heading titles something more meaningful

//	$tabla1->displayAs("descrip", "DESCRIP");

	
	#set the textarea height of the longer field (for editing/adding)
    #http://ajaxcrud.com/api/index.php?id=setTextareaHeight
    //$tabla1->setTextareaHeight('fldLongField', 150);

//   $tabla1->omitField("fecha");
  // $tabla1->omitField("hash");
  // $tabla1->disallowEdit('codigo'); 
   
$tabla1->emptyTableMessage = "No hay datos";
	//$tabla1->turnOffAjaxADD();

//$tabla1->orderFields("paciente,nombre,dni,telefono,celular,obra,email,ficha,usuario");

    #i could set a field to accept file uploads (the filename is stored) if wanted
    //$tabla1->setFileUpload("fldField2", "uploads/");

//$tabla1->addValueOnInsert("hora", "NOW()");
//$tabla1->addValueOnInsert("negocio", $negocio);

//$tabla1->setInitialAddFieldValue ("nacionalidad", "Argentina");

    #i can have a field automatically populate with a certain value (eg the current timestamp)
    //$tabla1->addValueOnInsert("fldField1", "NOW()");
	//$tabla1-> addWhereClause("WHERE (negocio = '$negocio' AND mesa != '999')");

	//$tabla1->turnOffAjaxEditing();

	
    #i can use a where field to better-filter my table
    #i can order my table by whatever i want
 
 
    #i can set certain fields to only allow certain values
    #http://ajaxcrud.com/api/index.php?id=defineAllowableValues
    
	//$allowableValues = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
    //$tabla1->defineAllowableValues("mozo", $allowableValues);
	
	//$tabla1->defineCheckbox("estado", 1, 0);
    //set field fldCheckbox to be a checkbox
    //$tabla1->defineCheckbox("fldCheckbox");

    #i can disallow deleting of rows from the table
    #http://ajaxcrud.com/api/index.php?id=disallowDelete
    
$tabla1->hover_color = "#E9E8DC";
    $tabla1->setLimit(110);

//$tabla1->addMessage = "Paciente agregado correctamente";

$numRows = $tabla1->getNumRows();
	

//$tabla1->displayAddFormTop();

    #i can disallow adding rows to the table
    #http://ajaxcrud.com/api/index.php?id=disallowAdd
    //if($clinica=='clinica_28'){echo $tabla1->disallowAdd();}

    #i can add a button that performs some action deleting of rows for the entire table
    #http://ajaxcrud.com/api/index.php?id=addButtonToRow
  //  $tabla1->addButtonToRow("OK", "negocio_0.php", "$id_avi");


    #set the number of rows to display (per page)

	#set a filter box at the top of the table
    //$tabla1->addAjaxFilterBox('fldField1');

    #if really desired, a filter box can be used for all fields

    #i can set the size of the filter box
    #i can set the size of the filter box
    //$tabla1->setAjaxFilterBoxSize('fldField1', 3);

	#i can format the data in cells however I want with formatFieldWithFunction
	#this is arguably one of the most important (visual) functions
//	$tabla1->formatFieldWithFunction('codigo', 'makeBlue');

	//$tabla1->formatFieldWithFunctionAdvanced('codigo', 'makeBlue');
	

	//$tabla1->modifyFieldWithClass("fldField1", "zip required"); 	//for testing masked input functionality
	//$tabla1->modifyFieldWithClass("fldField2", "phone");			//for testing masked input functionality

	//$tabla1->onAddExecuteCallBackFunction("mycallbackfunction"); //uncomment this to try out an ADD ROW callback function

	$tabla1->deleteText = "Borrar";
	$tabla1->addText= "AGREGAR";
	$tabla1->setCSSFile('greysuit.css');

	//$tabla1->addButtonText = "Register Me for this Event";

	
	
		
?>
<!DOCTYPE HTML>
<html>
<head>
<!--<meta http-equiv="refresh" content="7" charset="UTF-8"> -->
<meta charset="UTF-8">
<title>PonderZone</title>
<link rel="icon" href="../../pondercode.jpg">

<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0" />

<?php require_once('../../inc/bootstrap.php');?>
	
</head>
<body style="background-color:#0D1749"/>
	
	<?php	// require_once('menu.php');?>
	<br>
	
		<!-- <div class="row" ><b>
<span style="border-image: initial; border: 2px solid white;">MESAS Y MOZOS</span>
</b><p>
		</div> -->
<b>
	<!--
	Para ver los codigos QR de las mesas el siguiente <a href='http://ponderzone.com/mesas_qr/<?php echo $negocio;?>/' target='_blank' style='color:orange'>link</a></b>
	-->
	<div class="container-fluid text-center">
		
		<div class="row text-white">
			<div class="col">
				<?php 
				if($_GET[id]){
					$id = $_GET[id];

					$q = "SELECT deuda_parc FROM pagos WHERE id LIKE '$id'";
					$rs = mysqli_query($odonto_connection,$q) or die(mysqli_error());
					$row = mysqli_fetch_assoc($rs);
					$deuda_parc = $row[deuda_parc];					
					echo "<h2><b>Vas a pagar: $".$deuda_parc."</b></h2>";
					echo "<h4>Medios de Pago:</h4>";
					echo "<div class=row>
							<div class=col>";
							echo "<h5><b>Transferencia Bancaria:</b></h5>";
							echo "<h5>Titular: Maximiliano Gustavo Piriz</h5><h5>CUIT/CUIL: 20-23049544-1</h5><h5>Banco Santander - Sucursal: 478 - ROSARIO PICHINCHA<h5>Cuenta: 478-002191/3</h5><h5>CBU: 0720478888000000219136</h5><h5>Alias: ARCON.ADOBO.TROTE</h5>
							<h5><b>Luego transferir informar pago a: mpiriz33@gmail.com</b></h5>";
							echo "</div>";
							echo "<div class=col>";
								echo "<h5><b>Tarjeta Débito o Crédito (MERCADOPAGO):</b></h5>";
								require_once '../../../../dental/ml/vendor/autoload.php';
								require_once('procesar-pago.php');
							echo "</div>
						</div>";
				}
				?>
			</div>
		</div>
		<?php 
		if($gracias) echo '
		<div class=row>
			<div class="col text-white">
				<h3>'.$gracias.'</h3>
			</div>
		</div>
		';	
		?>
		<hr style="background-color:white">
		
		<div class="row text-white">
			<div class="col">
				<?php 
				echo "todos los negocios de tabla mozo";
				?>
			</div>
		</div>
		<hr style="background-color:white">
		<div class="row">
			<div class="col">
			<?php $tabla1->showTable();?>
			</div>
		</div>
	</div>

<style>
.text {
  font-size:18px;
  font-family:helvetica;
  font-weight:bold;
  color:#71d90b;
  text-transform:uppercase;
}

button.mercadopago-button {
		background-color: #009ee6;
		font-weight:800;
		font-size:1.5rem;
		font-family:'Montserrat';
		color: <?php echo $modal_body?>;
		border: 1px solid #009ee6;
		border-radius: 0.5rem;
}
</style>

</body>
</html>


