<h1>Base de datos Automóviles</h1> <b>Introduce el modelo de tu coche:</b><br/> <form method="post" action="#"> <input type="text" id="texto" name="texto"> <br/> <button type="submit" name="buscar">Buscar</button> </form> <div> <?php include_once "MySQLDataSource.php"; include_once "auto.php"; if (isset($_POST['buscar']) && $_POST['texto'] != "") { $modelo = $_POST['texto']; $funciones = new MySQLDataSource(); $conn = $funciones->conectar(); if (!$conn) { echo "error de conexión"; $funciones->mensajeError(); } $sql = "SELECT * FROM automoviles WHERE modelo like '%" . $modelo . "%'"; $consulta = $funciones->ejecutar_consulta($sql); if (!$consulta) { echo "<br/>" . "Error de consulta"; } echo "<b>" . "Coincidencias encontradas: " . "</b>" . mysqli_num_rows($consulta); $row = $funciones->siguiente(); $total = null; $id = 1; while ($row) {
$project = mysqli_query($connection, "SELECT * FROM " . "Project WHERE ProjectName = '{$token}'"); $projectInfo = mysqli_fetch_array($project); $ProjectID = $projectInfo['ProjectID']; $ProjectName = $projectInfo['ProjectName']; $DateCreated = $projectInfo['DateCreated']; $DateCompleted = $projectInfo['DateCompleted']; $Creator = $projectInfo['Creator']; $CurrentSprint = $projectInfo['CurrentSprint']; $SprintDuration = $projectInfo['SprintDuration']; $dataSource = new MySQLDataSource('2013teamb', '2013teamb', '29G8l!06J82ofpPw', 'devdb.fulgentcorp.com'); $dataSource->setSQLSource("Sprint"); $sprintRange = new ChartComponent(); $sprintRange->setCaption("Sprint Metrics"); $sprintRange->setDataSource($dataSource); $sprintRange->addCondition("Sprint.ProjectID", "==", "{$ProjectID}"); //$sprintRange->setLabelExpression("Sprint", "Sprint.SprintNum"); $sprintRange->setLabelExpression("Day", "Sprint.FinishTime", array('timestampRange' => 'time', 'timeUnit' => 'day', 'customTimeUnitPath' => array('year', 'month', 'day'), 'autoDrill' => true)); //$sprintRange->setYAxis("Day"); $sprintRange->addSeries("Day", "SprintNum"); //$sprintRange->setOption('limit', 10); Dashboard::addComponent($sprintRange); $itemSource = new MySQLDataSource('2013teamb', '2013teamb', '29G8l!06J82ofpPw', 'devdb.fulgentcorp.com'); $itemSource->setSQLSource("Item"); $itemRange = new ChartComponent(); $itemRange->setCaption("Item Metrics"); $itemRange->setDataSource($itemSource); $itemRange->addCondition("Item.ProjectID", "==", "{$ProjectID}"); $itemRange->setLabelExpression("Name", "Item.ItemName"); $itemRange->addSeries("Item", "Item.Priority"); Dashboard::addComponent($itemRange); Dashboard::Render();
} </style> </head> <body> <h1> Buscador de marcas de coches </h1> <form method="POST"> <input type="text" name="texto" class="input"> <input type="submit" name="enviar" value="Enviar"> </form> <?php require_once "MySQLDataSource.php"; require_once "Auto.php"; @($busqueda = $_POST["texto"]); $instancia = new MySQLDataSource(); $instancia->conectar(); if (isset($_POST["enviar"]) && !empty($_POST["texto"])) { $incr = 0; $consulta = "SELECT * FROM `automoviles` WHERE Modelo like'%" . $_POST["texto"] . "%'"; $instancia->ejecutar_consulta($consulta); $cocheNuevo = null; $prueba = $instancia->siguiente(); $contador = 0; while ($prueba) { $prueba = $instancia->siguiente(); $contador += 1; } echo "<br>"; $total = $contador; echo "<p class='coincidencia'>Numero de coincidencias: <strong>" . $total . "</strong></p>";
<?php require_once "rf/razorflow.php"; require_once "models/config.php"; if (!securePage($_SERVER['PHP_SELF'])) { die; } require_once "models/header.php"; //Left Nav bar echo "\r\n<body>\r\n<div id='wrapper'>\r\n<div id='top'><div id='logo'></div></div>\r\n<div id='content'>\r\n\r\n<div id='left-nav'>"; include "left-nav.php"; //Main Content echo "\r\n</div>\r\n<div id='main'>\r\n"; $dataSource = new MySQLDataSource('2013teamb', '2013teamb', '29G8l!06J82ofpPw', 'devdb.fulgentcorp.com'); $dataSource->setSQLSource('Item'); // Create a chart to show aggregated sales by genre $itemPriority = new ChartComponent(); $itemPriority->setCaption("Item Priority"); $itemPriority->setDataSource($dataSource); $itemPriority->setLabelExpression("Name", "Item.ItemName"); $itemPriority->addSeries("Priority", "Item.Priority"); $itemPriority->setOption('limit', 10); Dashboard::addComponent($itemPriority); Dashboard::Render(); echo "\r\n</div>\r\n\r\n\r\n<div id='bottom'></div>\r\n</div>\r\n</body>\r\n</html>";
<div id="delete"><span id="x">x</span></div> <input id="submit" name="submit" type="submit" value="Search"/> </form> </div> <?php include_once 'MySQLDataSource.php'; include_once 'Auto.php'; if (isset($_POST['submit'])) { echo '<div style="margin-left: 50px">'; if ($_POST['field'] == "") { echo '<p style="color: red;">El campo de búsqueda no puede estar vacío</p>'; } else { $busqueda = $_POST['field']; $mysql = new MySQLDataSource(); if (!$mysql->conectar()) { $mysql->mensajeError(); die; } $consulta = "SELECT * FROM automoviles WHERE modelo like '%" . $busqueda . "%'"; $result = $mysql->ejecutar_consulta($consulta); if (!$result) { $mysql->mensajeError(); die; } $num_resultados = mysqli_num_rows($result); echo "{$num_resultados} resultados."; $array_coches = array(); echo '<ul>'; while ($row = $mysql->siguiente()) {