I dont have problem with html and css, i will fix them, but in my screen they dont display the content of the database, but lines of code
Connecting to database:
mysql_connect("sth.gr", "sth", "sth123")or die("cannot connect");
mysql_select_db("sth");
mysql_query("set names 'utf8'");
$today=date("Y-m-d");
SQL query
$sql = "SELECT FLINES.FLINES,
LMAST.NAME,
FDOC.FDOC,
FLINES.COMMENTS AS FLCOMMENTS,
FLINES.QTY1,
SUBSTRING(FDOC.TRNDATE,1,10) AS TRNDATE,
FLINES.SE1_START,
TIMESTAMPDIFF(MINUTE,SE1_START,SE1_END) AS DIFERENCE
FROM FLINES
INNER JOIN FDOC ON FDOC.FDOC=FLINES.FDOC
INNER JOIN LMAST ON LMAST.LMAST=FDOC.LMAST
INNER JOIN SMAST ON SMAST.SMAST=FLINES.SMAST
WHERE TRNDATE >= '$today'
AND SMAST.U_SE1='true'
AND FLINES.SE1_END IS NULL
ORDER BY TRNDATE,
FDOC,
FLINES
";
I put the query in a variable in order to fetch every row above
$stmt = mysql_query( $sql );
if ($stmt->connect_error) {
die("Connection failed: " . $stmt->connect_error);
}
The results from above i'm going to style with html and css, i will create a table with all these
while($row = mysql_fetch_array($stmt)) {
if ($temp_FDOC!=$row[FDOC]) {
echo $row[NAME];
$j=0;
}
echo $j=$j+1;
echo $row[FLCOMMENTS];
echo $row[QTY1];
Here are some buttons
if($row[SE1_START]==NULL) {
echo '<button name="flines_id_start" value="<? echo $row[FLINES];?>" type="submit">ΞΕΚΙΝΑΩ</button>';
} else {
echo '<button name="flines_id_end" value="<? echo $row[FLINES];?>" type="submit">ΕΤΟΙΜΟ</button>';
echo '<button name="flines_id_again" value="<? echo $row[FLINES];?>" type="submit">ΕΠΑΝΕΚΚΗΝΙΣΗ</button>';
}
$temp_FDOC=$row[FDOC];
};
mysql_free_result( $stmt);