예제 #1
0
 function get_emergency()
 {
     $db_functions_obj = new DbFunctions();
     $emergencys = $db_functions_obj->get_all_emergencys();
     $helper_obj = new Helper();
     $output = "<table id='add_emergency_table' class='table table-hover table-nomargin table-bordered'>\n                  <tr>\n                    <th>" . $helper_obj->t("ID") . "</th>\n                    <th>" . $helper_obj->t("name") . "</th>\n                    <th>" . $helper_obj->t("phone") . "</th>  \n                    <th>" . $helper_obj->t("country") . "</th>  \n                    <th>" . $helper_obj->t("Edit") . "</th>\n                    <th>" . $helper_obj->t("Delete") . "</th>\n                  </tr>";
     foreach ($emergencys as $key => $emergency) {
         $class = $helper_obj->table_row_class($i);
         $output .= "<tr class='{$class}' id='emergency_{$emergency->id}'>\n                          <td>" . $emergency->id . "</td>\n                          <td>" . $emergency->name . "</td>\n                          <td>" . $emergency->phone . "</td>\n                          <td>" . $emergency->country_name . "</td>\n                          <td><a href='javascript:void(0);' onclick='openEditEmergencyPopup({$emergency->id})'>" . $helper_obj->t("Edit") . "</a></td>\n                          <td><a href='javascript:void(0);' onclick='deleteEmergency({$emergency->id})'>\n                                " . $helper_obj->t("Delete") . "</div>\n                              </a>\n                          </td>\n                       </tr>";
     }
     $output .= "</table>";
     return $output;
 }