doutuan4361 2017-01-04 10:24
浏览 32

如何从收件箱菜单中消失符号?

In this project doctors will be informed through message if any appointments are taken by patient.

Controller

function message_view()
  {
    if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] === true && $_SESSION['role'] === '2' && $_SESSION['role_des'] === 'doctor') 
        {
          $this->session->all_userdata();
          $id = $this->session->userdata('user_id');
          $data['count']=$this->appoint_model->get_msg_count($id);
          $data['msg']=$this->appoint_model->get_doctor_appoin($id);
          //var_dump($data['msg']);die();
          $this->load->view('doctor/header', $data);
          $this->load->view('doctor/modal_message',$data);
        }    
  }

Model

public function get_msg_count($id)
    {
      $this->db->select('*');
      $this->db->from('tbl_appointment');
      $this->db->where('status','1');
      $this->db->where('dr_id',$id);
      $q = $this->db->get();
      return $q->num_rows();
    }
    <div class="modal fade" id="myModal" style="z-index:10000;" role="dialog">
    <div class="modal-dialog modal-xs">
        <div class="modal-content">
          <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4 class="modal-title">Message</h4>
            </div>

            <div class="modal-body" >
              <div class="row">
                <div class="col-md-8 col-md-offset-2"> 
    <?php 
    foreach ($msg->result() as $row) {?>
    <center><h4>You have an appointment on <?php echo $row->appoint_date;?> at <?php echo $row->time;?>. Patient Name: <?php echo $row->ap_name;?></h4>
    </center>
    <?php }
    ?>       
    </div>

                </div>
            </div>


          <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
    </div>
       </div>
       </div>

In this screenshot a red color round in the menu Message, this red round must be disappear after the doctor reading the message.

enter image description here

  • 写回答

1条回答 默认 最新

  • doq70020 2017-01-04 11:53
    关注

    As I cannot comment because of 50 rep limit I'm posting an answer.

    You can add a Boolean field(tinyint) like 'is_read' to your table and you can update its status to 1 on view of the message by the doctor through ajax or simple post method.

    You can simply show the counts when the doctor has some unread messages (ie) No is_read field have value 1

    评论

报告相同问题?

悬赏问题

  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?