1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
|
if (((month[0] - 48) >= (timePtr->tm_mon + 1)) && (validity <= current_year))
{
while(y++, y <= count)
{
member.getline(name,25,'|');
member.getline(icno,25,'|');
member.getline(email,40,'|');
member.getline(phone_number,25, '|');
member.getline(acc_num,25, '|');
member.getline(password,25,'|' );
member.getline(month,25,'|' );
member.getline(validity,25);
if(y == (i + 1))
{
int validity1 = validity[3] - 48 + extend ;
temp << name << '|' << icno << '|' << email << '|' << phone_number << '|' << acc_num << '|' << password << '|' << month << '|' << validity[0] << validity[1] << validity[2] << validity1 << '\n';
}
else
{
temp << name << '|' << icno << '|' << email << '|' << phone_number << '|' << acc_num << '|' << password << '|' << month << '|' << validity << '\n';
}
}
}
if ((validity <= current_year) && (((month[0] - 48) < (timePtr->tm_mon + 1))))
{
while(y++, y <= count)
{
member.getline(name,25,'|');
member.getline(icno,25,'|');
member.getline(email,40,'|');
member.getline(phone_number,25, '|');
member.getline(acc_num,25, '|');
member.getline(password,25,'|' );
member.getline(month,25,'|' );
member.getline(validity,25);
if(y == (i + 1))
{
int current_year1 = current_year[3] - 48 + extend ;
temp << name << '|' << icno << '|' << email << '|' << phone_number << '|' << acc_num << '|' << password << '|' << timePtr->tm_mon + 1 << '|' << current_year[0] << current_year[1] << current_year[2] << current_year1 << '\n';
}
else
{
temp << name << '|' << icno << '|' << email << '|' << phone_number << '|' << acc_num << '|' << password << '|' << month << '|' << validity << '\n';
}
}
}
member.close();
temp.close();
cout << endl;
cout << " Do you want to change the years to be extended [Y/N]: ";
cin >> resp;
if (resp == 'Y' || resp == 'y')
{
goto renew_membership1;
}
if (extend == 1)
{
pay_amount = 10;
}
if (extend == 3)
{
pay_amount = 20;
}
if (extend == 5)
{
pay_amount = 30;
}
cout << endl;
cout << " Your payment upon renewing your membership is RM " << pay_amount << endl;
cout << " Select the payment method: " << endl;
cout << " (A) CASH " << endl;
cout << " (B) DEBIT CARD " << endl;
cout << " (C) CREDIT CARD " << endl << endl;
cout << " Your option [A, B, C] : ";
cin >> resp;
while((resp != 'A') && (resp != 'a') && (resp != 'B') && (resp != 'b') && (resp != 'C') && (resp != 'c') )
{
cout << " Please select a correct option [ a, b, c] : ";
cin >> resp;
}
system("ClS");
title();
if (resp == 'A' || resp == 'a')
{
cout << " You have selected to pay on cash" << endl;
acc_renew = rand() % 9999999999 + 10000000000;
cout << " -------------------------------------- " << endl;
cout << " | " << acc_renew << " |" << endl;
cout << " --------------------------------------" << endl << endl;
cout << " This is your ticket number !!! " << endl;
cout << " Please show this ticket number to the employee " << endl;
cout << " Thank you !!!" << endl;
}
if (resp == 'B' || resp == 'b')
{
int debit_card, ccv;
cout << "You have selected debit card to pay !!" << endl << endl;
cout << "Enter your debit card number: " ;
cin >> debit_card;
cout << endl;
cout << "Enter your CCV : " ;
cin >> ccv;
temp.open("temp.txt",ios::in);
member.open("Membership.txt",ios::out);
y = 0;
while(y++, y <= count)
{
temp.getline(name,25,'|');
temp.getline(icno,25,'|');
temp.getline(email,40,'|');
temp.getline(phone_number,25, '|');
temp.getline(acc_num,25, '|');
temp.getline(password,25,'|' );
temp.getline(month,25,'|' );
temp.getline(validity,25);
member << name << '|' << icno << '|' << email << '|' << phone_number << '|' << acc_num << '|' << password << '|' << month << '|' << validity << '\n';
}
remove ("temp.txt");
cout << " You are done our beloved customer !!!";
}
if (resp == 'C' || resp == 'c')
{
int credit_card, ccv;
cout << "You have selected credit card to pay !!" << endl << endl;
cout << "Enter your credit card number: " ;
cin >> credit_card;
cout << endl;
cout << "Enter your CCV : " ;
cin >> ccv;
temp.open("temp.txt",ios::in);
member.open("Membership.txt",ios::out);
y = 0;
while(y++, y <= count)
{
temp.getline(name,25,'|');
temp.getline(icno,25,'|');
temp.getline(email,40,'|');
temp.getline(phone_number,25, '|');
temp.getline(acc_num,25, '|');
temp.getline(password,25,'|' );
temp.getline(month,25,'|' );
temp.getline(validity,25);
member << name << '|' << icno << '|' << email << '|' << phone_number << '|' << acc_num << '|' << password << '|' << month << '|' << validity << '\n';
}
remove ("temp.txt");
cout << " You are done our beloved customer !!!";
}
}
else
{
fstream member;
member.open("Membership.txt",ios::in);
int login_attempt = 0, count = 0 , account;
string pass_input, line, accno_input1, acc_num1, password1, accno_input, icno1;
char resp,dummy, current_year[25], name[25], icno[25], email [40], phone_number[25], acc_num[25], password[25], month[25], year[25], validity[25] ;
member_info:
system("CLS");
title();
cout << " MEMBER INFORMATION " << endl;
cout << " -------------------- " << endl << endl;
cout << " Enter your account number : ";
cin >> accno_input;
|