diff --git a/inv_control.h b/inv_control.h index cb4ee30..0127d11 100644 --- a/inv_control.h +++ b/inv_control.h @@ -15,7 +15,7 @@ void inv_control(){ "List(allow all operation include add)", "Add item(shortcut to add item)" }; - choice = choices_selecter(items,2,NULL); + choice = choices_selecter(items,2,"><\nInventory control\n"); switch (choice){ case 1:;//list //add a new element with product name new item diff --git a/normal_user.h b/normal_user.h index dc01536..26094cf 100644 --- a/normal_user.h +++ b/normal_user.h @@ -31,7 +31,7 @@ void normal_menu(){ "Search item", "Self help sale system" }; - choice = choices_selecter(items,3,"><\nNormal User Menu"); + choice = choices_selecter(items,3,"><\nNormal User Menu\n"); switch (choice) { case 1://List items @@ -86,7 +86,7 @@ void search_item(){ char * items[] = { "search" }; - breakout = choices_selecter(items,1,"><"); + breakout = choices_selecter(items,1,"><\n"); if(breakout == 2){ break; } @@ -160,7 +160,7 @@ void self_help_sale_system(){ "scan barcode", "cart/checkout" }; - choice = choices_selecter(items,2,"><"); + choice = choices_selecter(items,2,"><\n"); switch (choice) { case 1: diff --git a/role_control.h b/role_control.h index 1ac701d..858608b 100644 --- a/role_control.h +++ b/role_control.h @@ -13,7 +13,7 @@ void role_control(){ "add admin role", "list role" }; - choice = choices_selecter(items,2,"><\nRole control"); + choice = choices_selecter(items,2,"><\nRole control\n"); switch (choice){ case 3: break; diff --git a/tran_control.h b/tran_control.h index f7ca6ae..06624b4 100644 --- a/tran_control.h +++ b/tran_control.h @@ -12,7 +12,7 @@ void tran_control(){ "List transaction", "new transaction" }; - choice = choices_selecter(items,2,"><\nTransaction control"); + choice = choices_selecter(items,2,"><\nTransaction control\n"); switch(choice){ case 1: char * SortItems[] = { diff --git a/user_control.h b/user_control.h index ec97eda..18f2dc3 100644 --- a/user_control.h +++ b/user_control.h @@ -10,13 +10,10 @@ void user_control(){ int choice = 0; while(choice != 3){ Cls(); - printf("User Control\n"); - printf("1. Add User(shortcut)\n"); - printf("2. List User\n"); - printf("3. Exit\n"); - printf("Please input your choice\n>"); - fflush_stdin(); - scanf("%d",&choice); + choice = choices_selecter((char*[]){ + "Add user", + "List user", + },3,"><\nUser control\n"); switch(choice){ case 1: db = add_user(db);