PHP generated schedule table
up vote
-1
down vote
favorite
I'm making a schedule table using PHP to select a teacher's availability
I would like to make each cell selectable and track which one was selected in order to store in database.
PHP code :
$timestamps = ['11:00','11:40','12:20','13:00','13:40','14:20','15:00','15:40','16:20','17:00','17:40','18:20','19:00','19:40','20:20','21:00','21:40','22:20'];
$table = "";
for($i = 0; $i < 18; $i++)
$table .= "
<tr>
<th>".$timestamps[$i]."</th>";
for($k = 0; $k < 7; $k++)
$table .= "<td>".$i." - ".$k."</td>";
$table .= "</tr>";
HTML code:
<table class="table table-bordered" id="teacher-schedule">
<thead>
<tr>
<th></th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
<th>Sunday</th>
</tr>
</thead>
<?php echo $table; ?>
</table>
php mysql html-table schedule
add a comment |
up vote
-1
down vote
favorite
I'm making a schedule table using PHP to select a teacher's availability
I would like to make each cell selectable and track which one was selected in order to store in database.
PHP code :
$timestamps = ['11:00','11:40','12:20','13:00','13:40','14:20','15:00','15:40','16:20','17:00','17:40','18:20','19:00','19:40','20:20','21:00','21:40','22:20'];
$table = "";
for($i = 0; $i < 18; $i++)
$table .= "
<tr>
<th>".$timestamps[$i]."</th>";
for($k = 0; $k < 7; $k++)
$table .= "<td>".$i." - ".$k."</td>";
$table .= "</tr>";
HTML code:
<table class="table table-bordered" id="teacher-schedule">
<thead>
<tr>
<th></th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
<th>Sunday</th>
</tr>
</thead>
<?php echo $table; ?>
</table>
php mysql html-table schedule
1
Your going to need to write some javascript. In the javascript code you will sign each cell with a unique id and then use ajax to do the required work server side.
– Joseph_J
Nov 11 at 2:17
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I'm making a schedule table using PHP to select a teacher's availability
I would like to make each cell selectable and track which one was selected in order to store in database.
PHP code :
$timestamps = ['11:00','11:40','12:20','13:00','13:40','14:20','15:00','15:40','16:20','17:00','17:40','18:20','19:00','19:40','20:20','21:00','21:40','22:20'];
$table = "";
for($i = 0; $i < 18; $i++)
$table .= "
<tr>
<th>".$timestamps[$i]."</th>";
for($k = 0; $k < 7; $k++)
$table .= "<td>".$i." - ".$k."</td>";
$table .= "</tr>";
HTML code:
<table class="table table-bordered" id="teacher-schedule">
<thead>
<tr>
<th></th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
<th>Sunday</th>
</tr>
</thead>
<?php echo $table; ?>
</table>
php mysql html-table schedule
I'm making a schedule table using PHP to select a teacher's availability
I would like to make each cell selectable and track which one was selected in order to store in database.
PHP code :
$timestamps = ['11:00','11:40','12:20','13:00','13:40','14:20','15:00','15:40','16:20','17:00','17:40','18:20','19:00','19:40','20:20','21:00','21:40','22:20'];
$table = "";
for($i = 0; $i < 18; $i++)
$table .= "
<tr>
<th>".$timestamps[$i]."</th>";
for($k = 0; $k < 7; $k++)
$table .= "<td>".$i." - ".$k."</td>";
$table .= "</tr>";
HTML code:
<table class="table table-bordered" id="teacher-schedule">
<thead>
<tr>
<th></th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
<th>Sunday</th>
</tr>
</thead>
<?php echo $table; ?>
</table>
php mysql html-table schedule
php mysql html-table schedule
edited Nov 11 at 9:13
Brian Tompsett - 汤莱恩
4,153133699
4,153133699
asked Nov 11 at 1:58
Dominique Abou Samah
144
144
1
Your going to need to write some javascript. In the javascript code you will sign each cell with a unique id and then use ajax to do the required work server side.
– Joseph_J
Nov 11 at 2:17
add a comment |
1
Your going to need to write some javascript. In the javascript code you will sign each cell with a unique id and then use ajax to do the required work server side.
– Joseph_J
Nov 11 at 2:17
1
1
Your going to need to write some javascript. In the javascript code you will sign each cell with a unique id and then use ajax to do the required work server side.
– Joseph_J
Nov 11 at 2:17
Your going to need to write some javascript. In the javascript code you will sign each cell with a unique id and then use ajax to do the required work server side.
– Joseph_J
Nov 11 at 2:17
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245198%2fphp-generated-schedule-table%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Your going to need to write some javascript. In the javascript code you will sign each cell with a unique id and then use ajax to do the required work server side.
– Joseph_J
Nov 11 at 2:17