diff --git a/Admin.h b/Admin.h index 5baf4cb..6ffe518 100644 --- a/Admin.h +++ b/Admin.h @@ -36,7 +36,7 @@ public: ss.str(username); int id; ss >> id; - for (int i = 0; i < db_st_list.size; i++) { + for (size_t i = 0; i < db_st_list.size; i++) { if (db_st_list.list[i].st_number == id) { db_st_list.removeFromList(i); return 1; @@ -44,7 +44,7 @@ public: } } else { - for (int i = 0; i < db_tc_list.size; i++) { + for (size_t i = 0; i < db_tc_list.size; i++) { if (db_tc_list.list[i].tc_identify == username) { db_tc_list.removeFromList(i); return 1; diff --git a/Process.cpp b/Process.cpp index 2c958de..5cc9dfb 100644 --- a/Process.cpp +++ b/Process.cpp @@ -476,7 +476,7 @@ bool teacherProcess(Teacher& tc, UserList& user_list, StudentCourseList& db_st_c #pragma region Tien void to_upper(string &s) { - for (int i = 0; i < s.length(); i++) { + for (size_t i = 0; i < s.length(); i++) { s[i] = toupper(s[i]); } } @@ -562,7 +562,7 @@ bool adminProcess(Admin& ad, UserList& user_list, StudentList& db_st_list, Teach else if (agvList.list[0] == "ss") { if (agvList.size > 1) { agvList.removeFromList(0); - for (int i = 0; i < agvList.size; i++) { + for (size_t i = 0; i < agvList.size; i++) { to_upper(agvList.list[i]); } StudentList sList = db_st_list.findStudentByNameKeyWord(agvList.list, agvList.size); @@ -606,7 +606,7 @@ bool adminProcess(Admin& ad, UserList& user_list, StudentList& db_st_list, Teach else if (agvList.list[0] == "st") { if (agvList.size > 1) { agvList.removeFromList(0); - for (int i = 0; i < agvList.size; i++) { + for (size_t i = 0; i < agvList.size; i++) { to_upper(agvList.list[i]); } TeacherList tList = db_tc_list.findTeacherByNameKeyword(agvList.list, agvList.size); @@ -664,7 +664,7 @@ bool adminProcess(Admin& ad, UserList& user_list, StudentList& db_st_list, Teach else removeList.addToList(username); } while (true); arrayList remove_unsuccess; - for (int i = 1; i < removeList.size; i++) { + for (size_t i = 1; i < removeList.size; i++) { if (ad.removeUser(removeList.list[i], user_list, db_st_list, db_tc_list) == 1) { } @@ -677,7 +677,7 @@ bool adminProcess(Admin& ad, UserList& user_list, StudentList& db_st_list, Teach } else { cout << "Some user remove unsuccessful! That is:" << endl; - for (int j = 0; j < remove_unsuccess.size; j++) { + for (size_t j = 0; j < remove_unsuccess.size; j++) { cout << j + 1 << ".\t" << remove_unsuccess.list[j] << endl; } cout << "Other user remove successful!" << endl; @@ -687,7 +687,7 @@ bool adminProcess(Admin& ad, UserList& user_list, StudentList& db_st_list, Teach else { arrayList remove_unsuccess; - for (int i = 1; i < agvList.size; i++) { + for (size_t i = 1; i < agvList.size; i++) { if (ad.removeUser(agvList.list[i], user_list, db_st_list, db_tc_list) == 1) { } @@ -700,7 +700,7 @@ bool adminProcess(Admin& ad, UserList& user_list, StudentList& db_st_list, Teach } else { cout << "Some user remove unsuccessful! That is:" << endl; - for (int j = 0; j < remove_unsuccess.size; j++) { + for (size_t j = 0; j < remove_unsuccess.size; j++) { cout << j + 1 << ".\t" << remove_unsuccess.list[j] << endl; } cout << "Other user remove successful!" << endl; @@ -723,7 +723,7 @@ bool adminProcess(Admin& ad, UserList& user_list, StudentList& db_st_list, Teach cout << setw(40) << setfill(' ') << left << "Add Student" << "[as]" << endl; cout << "Input then input student's informations." << endl << endl; cout << setw(40) << setfill(' ') << left << "Remove User" << "[ru]" << endl; - cout << "Input then input list of usernames. Or input then input list of usernames. Or input ." << endl << endl; cout << setw(40) << setfill(' ') << left << "Search Teacher by name" << "[st]" << endl; cout << "Input to search. Or input then input ." << endl; cout << "Input as this format (separate by comma):" << endl << endl; diff --git a/user.csv b/user.csv index 28c16c4..d3cfdc7 100644 --- a/user.csv +++ b/user.csv @@ -78,4 +78,4 @@ S0997,S0997,teacher S0998,S0998,teacher S0999,S0999,teacher S1000,S1000,teacher -admin,a,admin \ No newline at end of file +admin,a,admin