delphi
<?php require("../mod_configuracion/conexion.php"); require("../temas/encabezado.php"); ?> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Servicios Medicos</title> <link rel="stylesheet" type="text/css" href="tcal.css" /> <script type="text/javascript" src="tcal.js"></script> <center><form action="Index.php" method="get"> From : <input type="text" name="d1" class="tcal" value="" /> To: <input type="text" name="d2" class="tcal" value="" /> <input type="submit" value="Buscar"> </form></center> <br><br><br> <center><table id="resultTable" data-responsive="table" style="text-align: left; width: 400px;" border="1" cellspacing="0" cellpadding="4"> <thead> <tr> <th> Nombre </th> <th> Fecha </th> <th> Prueba </th> </tr> </thead> </center> <tbody> <?php include('connect.php'); /*mysql_query("SET NAMES 'utf8'"); mysql_set_charset('utf8');*/ if (isset($_GET["d1"])) { $d1 = $_GET["d1"]; } else { $d1=0; }; if (isset($_GET["d2"])) { $d2 = $_GET["d2"]; } else { $d2=0; }; $result = $db->prepare("SELECT * FROM consulta WHERE fecha BETWEEN :a AND :b"); $result->bindParam(':a', $d1); $result->bindParam(':b', $d2); $result->execute(); for($i=0; $row = $result->fetch(); $i++){ ?> <tr class="record"> <td><?php echo $row['NombrePaciente']; ?></td> <td><?php echo $row['Fecha']; ?></td> <td><?php echo $row['PruebaRealizada']; ?></td> </tr> <?php $start_ts = strtotime($d1); // start time stamp $end_ts = strtotime($d2); // end time stamp $day_sec = 86400; $interval = ($end_ts – $start_ts)/$day_sec; // number of days echo "el rango es de $interval días\n”; $count = 0; $working_ts = $start_ts; while ($working_ts < $end_ts) { // loop through each day to find saturdays $day = date('Sa', $working_ts); if ($day == 7) { // this is a saturday $count++; } $working_ts = $working_ts + $day_sec; } echo "Hay $count Sabados en este intervalo\n”; $querys= mysql_query(“select count(*) from consulta where fecha between $start_ts AND $end_ts”); $total = mysql_num_rows($querys); echo ($total); } ?> <?php if (isset($_POST["d1"])) { $d1 = $_POST["d1"]; } else { $d1=0; }; if (isset($_POST["d2"])) { $d2 = $_POST["d2"]; } else { $d2=0; }; $result = $db->prepare("SELECT count(fecha) FROM consulta WHERE fecha BETWEEN :a AND :b Group by fecha"); $result->bindParam(':a', $d1); $result->bindParam(':b', $d2); $result->execute(); $numero = mysql_num_rows($result); // obtenemos el número de filas echo 'El Total de registros de la tabla es: '.$numero.''; // imprimos en pantalla el número generado $query = mysql_query("select * from consulta"); $no_rows = mysql_num_rows($query); echo 'El número de registros es: '.$no_rows.''; $query1="select count(fecha) from consulta where fecha between :a AND :b"; $total_count = mysql_num_rows($query1); echo $total_count; ?>