2017-02-25 10 views
0

マウスを離したときにデータベースからテーブルを取得して表示する必要があります(下の図を参照)。私がしたいマウスオーバー時に他のデータを表示する方法

if (count($located) > 0) { 
    echo '<table>'; 

    foreach($located as $locate){ 
     echo "<tr><td>".$locate['computer_number']."</td><td>".$locate['name']."</td><"</td><td><img src=". base_url()."inc/images/confirm.png width='45' height='30' border='0' class='computer_number' data-id='".$locate['computer_number']."'/></td></tr>"; 
    } 
    echo '</table>'; 
} 

- :ここ

モデル

public function teacher_with_subject(){ 
    $this->db->select('*') 
    ->from('teacher AS t') 
    ->join('teacher_subject ts','t.computer_number=ts.computer_number', 'left') 
    ->where('t.date_of_termination','0000-00-00') 
    ->where('ts.date_of_end','0000-00-00'); 
    $query = $this->db->get(); return $query->result_array(); 
} 

コントローラ

$located=$this->select_model->teacher_with_subject(); 

ビューありますマウスは名前

+1

なぜJavaのタグを?? – yashpandey

+0

申し訳ありませんが、JavaScriptはJavaではありません –

答えて

0

title属性使用上にあるときに住所やメールアドレスを表示します。

echo "<tr>"; 
echo "<td>".$locate['computer_number']."</td>"; 
echo "<td title='".$locate["email"]."<br />".$locate["address"]."'>".$locate['name']."</td>"; 
echo "<td><img src=". base_url()."inc/images/confirm.png width='45' height='30' border='0' class='computer_number' data-id='".$locate['computer_number']."'/></td>"; 
echo "</tr>"; 
関連する問題