【发布时间】:2012-12-07 15:20:30
【问题描述】:
HTML
<table class="" id="schedule">
<thead>
<tr>
<th><input value="Time" type="text"></th>
<th><input value="Monday" type="text"></th>
<th><input value="Tuesday" type="text"></th>
<th><input value="Wednesday" type="text"></th>
<th><input value="Thursday" type="text"></th>
<th><input value="Friday" type="text"></th>
</tr>
</thead>
<tbody>
<tr>
<th><input value="9:00am" type="text"></th>
<td class=""></td>
<td class=""></td>
<td class=""></td>
<td class=""></td>
<td class=""></td>
</tr></tbody></table>
我的问题是如何动态生成包含今天小时数的表格,而无需在 html 中硬编码? 我需要这张表包含一天中每个小时(24 小时)的 tr。
我的目标:我正在为我的诊所网站创建一个预订页面,我对该诊所的所有访问都存储在 mysql 中,格式为“visit,name_patient,date,time,clinic_num”,
我从 db 获取今天的所有记录,我想将其显示在表格中。
问题
所以有人可以告诉我生成的最简单的逻辑流程是什么 这样的表?
如何使用今天的时间“9am,10am,11am”生成行
注意: http://apps.zarjay.net/scheduler/ 这看起来像我想要的,但时间仍然是硬编码的。大多数其他日历插件真的很复杂,而且对于我想要的 wt 来说太过分了
etc ?
【问题讨论】:
-
即使你硬编码,我也想不出少于 24 小时的一天,所有需要动态的肯定是日期输入
-
只需使用 JQuery UI。他们已经发明了那个轮子。 jqueryui.com
标签: php jquery codeigniter calendar