如何将值分配给图像,并在分配后,其他的不能分配在同一图像上

时间:2017-10-04 01:13:53

标签: php html mysqli

由于我真的是系统开发的初学者,虽然我已经在搜索它,但我对如何做到这一点没有任何线索。

我开发了一个系统,急诊室能够在接纳病人之前查看病房内是否有空床。 现在,我只能把床的形象,但我不知道如何将床分配给病人,当分配时,病床将无法给其他病人。

enter image description here

这里是我的源代码

      <!-- Counts Section -->
      <section class="dashboard-counts section-padding">
        <div class="container-fluid">
          <div class="row">
            <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">1</div>
                </div>
              </div>
            </div>
            <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">2</div>
                </div>
              </div>
            </div> 

            <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">3</div>
                </div>
              </div>
            </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">4</div>
                </div>
              </div>
            </div>

            <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">5</div>
                </div>
              </div>
            </div>

            <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">6</div>
                </div>
              </div>
            </div>


            <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">7</div>
                </div>
              </div>
            </div>


            <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">8</div>
                </div>
              </div>
           </div>
           <p>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">9</div>
                </div>
              </div>
           </div>
           <p>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">10</div>
                </div>
              </div>
           </div>
           <p>
           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">11</div>
                </div>
              </div>
           </div>
           <p>
           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">12</div>
                </div>
              </div>
           </div>
           <p>
           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">13</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">14</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">15</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">16</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">17</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">18</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">19</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">20</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">21</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">22</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">23</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">24</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">25</div>
                </div>
              </div>
           </div>

          <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">24</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">25</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">26</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">27</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">28</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">29</div>
                </div>
              </div>
           </div>

           <div class="col-xl-2 col-md-4 col-6">
              <div class="wrapper count-title d-flex">
                <div class="icon"><i class="icon-user"></i></div>
                <div class="img"><img src="malebed.png" width="100" height="100"  alt=""/>
                  <div class="name">30</div>
                </div>
              </div>
           </div>

任何建议都将不胜感激。谢谢。

2 个答案:

答案 0 :(得分:0)

我假设您的数据库中已有床位和病人的表格。此外,我假设您的数据库中的每个床位记录都有patient_id列(或类似的东西)

因此,当您加载此页面时,请从数据库加载床并通过foreach将其插入您的页面。如果床是空的,那么将此图像链接到某种形式的链接,其中人员可以写出关于患者或类似事物的数据。如果其他患者已经卧床,则只显示没有加号的病床图像。

我准备以更精确的建议扩展我的问题,但我需要查看您的服务器端代码,数据库结构以及可能是患者注册的过程

答案 1 :(得分:0)

在您的链接中,您可以尝试在此链接中添加操作

echo '<li><a href="?action=selected&id={$someID}">Wad 1</a></li>';

之后您可以使用get方法更改床的状态。

if(isset($_GET['id'] && $_GET['action'] == "selected"){
ward_table_selected() // function that changes the status of the table to selected
}

注意:将$selected=false;作为默认设置并使用该功能进行选择。

我希望这能让你了解如何做到这一点。