Cod: Selectaţi tot
<?php
include_once('header.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
error_reporting(0);
include("Configurare/PCD.php");
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<center>
<div id="div_print">
</head>
<center>
<br />
<br />
<form id="form1" name="form1" method="post" action="listaclienti.php">
<label for="from">Data Plecarii</label>
<input name="from" type="text" id="from" size="10" value="<?php echo $_REQUEST["from"]; ?>" />
<label>Locul Si Ora Plecarii</label>
<select name="Ora_Plecare">
<option value="">------------------------</option>
<?php
$sql = "SELECT * FROM ".$SETTINGS["data_table"]." GROUP BY Ora_Plecare ORDER BY Ora_Plecare";
$sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
while ($row = mysql_fetch_assoc($sql_result)) {
echo "<option value='".$row["Ora_Plecare"]."'".($row["Ora_Plecare"]==$_REQUEST["Ora_Plecare"] ? " selected" : "").">".$row["Ora_Plecare"]."</option>";
}
?>
</select>
<input type="submit" name="button" id="button" value="Cautare" />
</label>
<a href="listaclienti.php">
Resetare</a>
</form>
</center>
<table width="800" border="1" cellspacing="0" cellpadding="4">
<tr>
<td width="90" bgcolor="#CCCCCC"><strong>Data Plecarii</strong></td>
<td width="130" bgcolor="#CCCCCC"><strong>Locul Si Ora Plecarii</strong></td>
<td width="120" bgcolor="#CCCCCC"><strong>Nume Pasager</strong></td>
<td width="113" bgcolor="#CCCCCC"><strong>Telefon Pasager</strong></td>
<td width="130" bgcolor="#CCCCCC"><strong>Ora Dec./Ater. Avion</strong></td>
<td width="113" bgcolor="#CCCCCC"><strong>Observatii</strong></td>
<td width="113" bgcolor="#CCCCCC"><strong>Rest de Plata</strong></td>
</tr>
<?php
if ($_REQUEST["Ora_Plecare"]<>'') {
$search_city = " AND Ora_Plecare='".mysql_real_escape_string($_REQUEST["Ora_Plecare"])."'";
}
if ($_REQUEST["from"]<>'') {
$sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE Data_Plecarii >= '".mysql_real_escape_string($_REQUEST["from"])."' AND Data_Plecarii <= '".mysql_real_escape_string($_REQUEST["from"])."'".$search_string.$search_city;
} else if ($_REQUEST["from"]<>'') {
$sql = "SELECT * FROM ".$SETTINGS["data_table"]." Data_Plecarii >= '".mysql_real_escape_string($_REQUEST["from"])."'".$search_string.$search_city;
} else if ($_REQUEST["from"]<>'') {
$sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE Data_Plecarii <= '".mysql_real_escape_string($_REQUEST["from"])."'".$search_string.$search_city;
} else {
$sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE id>0".$search_string.$search_city;
}
$sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
if (mysql_num_rows($sql_result)>0) {
while ($row = mysql_fetch_assoc($sql_result))
{
?>
<td><center><?php echo $row["Data_Plecarii"]; ?></center></td>
<td><center><?php echo $row["Ora_Plecare"]; ?></center></td>
<td><center><?php echo $row["Nume_Client"]; ?></center></td>
<td><center><?php echo $row["Telefon_Client"]; ?></center></td>
<td><center><?php echo $row["Ora_Decolare_Avion"]; ?></center></td>
<td><center><?php echo $row["Observarii_Client"]; ?></td>
<td><center><?php echo $row["Rest_Plata"]; ?> Lei</center></td>
</tr>
<?php
}
} else {
?>
<tr><td colspan="5">Nici Un Pasager Gasit</td>
<?php
}
?>
</table>
<script>
$(function() {
var dates = $( "#from, #to" ).datepicker({
defaultDate: "",
changeMonth: false,
numberOfMonths: 1,
dateFormat: 'dd-mm-yy',
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
});
});
</script>
</body>
</html>
</div>
<p align="center">
<script language="javascript">
function printdiv(printpage)
{
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
</script>
<br />
<input name="b_print" type="button" class="ipt" onClick="printdiv('div_print');" value=" Printeaza Raport "></p></td>
</tr>
</tr>
</center>
</body>
<br />
<br />
<br />
<br />
</html>
Nu reusesc sub nici o forma sa numeretoz randurile atunci cand sunt afisate inregistrarile.Ma puteti ajuta?