0
I have a system for content display and I need that from a predetermined time my page .html
change to another content (another page) automatically.
NOTE:
The device to display the site will not contain input devices such as mouse, it is necessary that from page loading the function be executed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/x-icon" href="img/favicon.png"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>.:: Painel Cirurgias ::.</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.css"/>
<link rel="stylesheet" type="text/css" href="css/inside.css"/>
<link rel="stylesheet" type="text/css" href="css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.10.3.custom.css"/>
<link rel="stylesheet" type="text/css" href="css/select2.css "/>
<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/bootbox.js"></script>
<script type="text/javascript" src="js/select2.js"></script>
<script type="text/javascript" src="js/meio.mask.js"></script>
<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<!-- <link href="css/carousel.css" rel="stylesheet"> -->
</head>
<body class="gradient">
<div class="container">
<div class="row">
<center>
<br>
<a href="index.php"><img src="img/logo.png"></a>
</center>
</div>
<div class="row">
<?php
include_once('db_functions.php');
ini_set('default_charset','UTF-8');
$id = isset($_GET['id'])?$id=$_GET['id']: NULL;
$id = isset($_POST['id'])?$id=$_POST['id']: NULL;
$con = dbConnect();
?>
<div class="content well pull-left span12">
<div class="row">
<div class="span12">
<?php
include('paginator.php');
$page = isset($_GET['page'])?$_GET['page']:1;
$busca = isset($_GET['busca'])?$_GET['busca']:null;
$painels = findPainels($con,$busca);
$painelsPag = getPageElements($painels,$page,11);
?>
<?php if($painels):?>
<table class="table table-striped">
<thead>
<th>Id</th>
<th>Status</th>
<th>Data</th>
<th>Hora</th>
<th>Paciente</th>
<th>Tipo</th>
<th>Hospital</th>
<th>Médico</th>
<th>Convênio</th>
<th>Cliente</th>
<th>Intermediário</th>
<th></th>
</thead>
<tbody>
<?php foreach ($painelsPag as $painel):
if ($painel["Cliente"] === 'ORTHOSEVEN'){
$painel["Cliente"] = '<span style="background:orange">'.$painel["Cliente"].'</span>';
}
elseif ($painel["Cliente"] === 'BM9 IMPLANTES'){
$painel["Cliente"] = '<span style="background:#1E90FF">'.$painel["Cliente"].'</span>';
}
if ($painel["Intermediario"] === 'ORTHOSEVEN'){
$painel["Intermediario"] = '<span style="background:orange">'.$painel["Intermediario"].'</span>';
}
elseif ($painel["Intermediario"] === 'BM9 IMPLANTES'){
$painel["Intermediario"] = '<span style="background:#1E90FF">'.$painel["Intermediario"].'</span>';
}
else {
$cor = "#1E90FF";
}
?>
<tr bgcolor="<?=$cor="#66CDAA"?>" class="<?=$painel['id']?null:'muted'?>" data-id="<?=$painel['id']?>">
<tr bgcolor="<?=$cor?>" data-id="<?=$painel['id']?>">
<td data-title="id"><strong><?=$painel['id']?></td></strong>
<td data-title="Status"><strong><?=$painel['Status'];?></td></strong>
<td data-title="Data"><strong><?=date('d/m/Y',strtotime($painel['Data']))?></td></strong>
<td data-title="Hora"><strong><?=$painel['Hora']?></td></strong>
<td data-title="Paciente"><strong><?=$painel['Paciente']?></td></strong>
<td data-title="Tipo"><strong><?=$painel['Subtipo_Cirurgia']?></td></strong>
<td data-title="Hospital"><strong><?=$painel['Hospital']?></td></strong>
<td data-title="Medico"><strong><?=$painel['Medico']?></td></strong>
<td data-title="Convenio"><strong><?=$painel['Convenio']?></td></strong>
<td data-title="Cliente"><strong><?=$painel['Cliente']?></td></strong>
<td data-title="Intermediario"><strong><?=$painel['Intermediario']?></td></strong>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php printPaginator($painels,$page,11);?>
<?php else:?>
<?php endif;?>
</div>
</div>
</div>
<?php include("base.php"); ?>
<script type="text/javascript">
$(document).ready(function () {
setTimeout(function () {
window.location.reload(1);
}, 50000);
});
</script>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<?php include("base.php"); ?>
Instead of using
window.location.reload(1);
you make a Ubmit form. Ex.var form = $('<form method="get" action="apropriapagina.php"> <input type="hidden" name="page" value="2"> </form>) $('body').append( form) form.submit()
– adventistaam
@Bah this page change would have to occur from what event? For example: Click on the form’s Ubmit, while hovering somewhere, when the page is already loaded?
– user148754
Take a look at this file here http://twixar.me/wJ1n, It is possible to update the page without javascript
– adventistaam
@Bah answered your question, this is what I really wanted?
– user148754
Dude you want from time to time the page to be forwarded to another page, like refreshing with other content is this?
– hugocsl
@Bah my answer is correct for you? What was missing?
– user148754