I'm doing a sales recording for my own small shop using the combination of html and php.
I want to have a time selecting input (something like March 2014, April 2014 when selecting)
Here is my index.php
<?php
$con=mysqli_connect("192.168.1.248","a","a","services");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM pcsales");
echo "<h3><marquee><b>====PC Sales====</b></marquee></h3>";
echo "<button type='button' name='add' onClick='add()'>Add</button>";
echo "<script type='text/javascript'>
function add()
{
window.location='./edit';
}
</script>";
echo "<button type='button' name='edit' onClick='edit()'>Edit</button>";
echo "<script type='text/javascript'>
function edit()
{
window.location='./edit/edit.html';
}
</script>";
echo "<table border='1'>
<tr>
<th>ID</th>
<th>Type</th>
<th>If Others</th>
<th>Brand</th>
<th>Description</th>
<th>Date Sold</th>
<th>Serial No.</th>
</tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td><p style='font-size:12px'>" . $row['ID'] . "</p></td>";
echo "<td>" . $row['Type'] . "</td>";
echo "<td>" . $row['Types'] . "</td>";
echo "<td>" . $row['Brand'] . "</td>";
echo "<td><p style='font-size:12px'>" . $row['Description'] . "</p></td>";
echo "<td><p style='font-size:12px'>" . $row['Selldate'] . "</p></td>";
echo "<td><p style='font-size:12px'>" . $row['Serial'] . "</p></td>";
echo "</tr>";
}
echo "</table>";
echo "<h3><marquee direction=right><b>====PC Sales====</b></marquee></h3>";
mysqli_close($con);
?>
I'm using TIMESTAMP in mysql. Here is the output
ID Type If Others Brand Description Date Sold Serial No. 1 Notebook Acer E1 Add 2GB DDR3 1600 RAM 2014-06-25 11:57:58 123456789 2 Others AIO Asus N/A 2014-07-25 12:52:12 987654321 3 Desktop Trendsonic Full spec listed. 2014-07-30 09:55:10 N/A
When I put a range on a textbox (more expedient if selectable) Example:
July 2014
Then the output shall be
ID Type If Others Brand Description Date Sold Serial No. 2 Others AIO Asus N/A 2014-07-25 12:52:12 987654321 3 Desktop Trendsonic Full spec listed. 2014-07-30 09:55:10 N/A
If only
2014is inserted, then it shall output everything from Year 2014 Is it possible to do that?
Note: I don't care about exploits, as it is used internally.