예제 #1
0
파일: user.php 프로젝트: arh922/ain
 function get_all_users($cid = 1)
 {
     $db_functions_obj = new DbFunctions();
     $helper_obj = new Helper();
     global $user;
     $uid = $user['id'];
     $users = $db_functions_obj->get_all_users($uid, $cid);
     $output = "<table id='add_user_table' class='table table-hover table-nomargin table-bordered'>\n                      <tr>\n                        <th>" . $helper_obj->t("ID") . "</th>\n                        <th>" . $helper_obj->t("Username") . "</th>\n                        <th>" . $helper_obj->t("Your email") . "</th>\n                        <th>" . $helper_obj->t("Phone") . "</th>\n                        <th>" . $helper_obj->t("Role") . "</th>\n                        <th>" . $helper_obj->t("Country") . "</th>\n                        <th>" . $helper_obj->t("Operator") . "</th>\n                        <th>" . $helper_obj->t("Client") . "</th>\n                        <th>" . $helper_obj->t("Status") . "</th>\n                        <th>" . $helper_obj->t("Date Added") . "</th>   \n                        <th>" . $helper_obj->t("Edit") . "</th>\n                        <th>" . $helper_obj->t("Delete") . "</th>\n                      </tr>";
     foreach ($users as $key => $value) {
         $class = $helper_obj->table_row_class($i);
         $output .= "<tr class='{$class}' id='user_{$value['id']}'>\n                          <td>" . $value['id'] . "</td>\n                          <td>" . $value['username'] . "</td>\n                          <td>" . $value['email'] . "</td>\n                          <td>" . $value['phone'] . "</td>\n                          <td>" . $value['role_name'] . "</td>\n                          <td>" . $value['country_name'] . "</td>\n                          <td>" . $value['operator_name'] . "</td>\n                          <td>" . $value['client_name'] . "</td>\n                          <td><div id='user_status_{$value['id']}'>" . ($value['status'] == 1 ? $helper_obj->t("Active") : $helper_obj->t("Deactive")) . "</div></td>\n                          <td>" . date(DATE_FORMAT, $value['date_added']) . "</td> \n                          <td><a href='javascript:void(0);' onclick='openEditUserPopup({$value['id']})'>" . $helper_obj->t("Edit") . "</a></td>\n                          <td><a href='javascript:void(0);' onclick='activeDeactiveUser({$value['id']})'>\n                                <div id='deactive_{$value['id']}'>" . ($value['status'] == 1 ? $helper_obj->t("Deactivate") : $helper_obj->t("Activate")) . "</div>\n                              </a>\n                          </td>\n                       </tr>";
     }
     $output .= "</table>";
     return $output;
 }