-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
454 lines (377 loc) · 20.5 KB
/
index.php
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
<?php
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
+ Iyi programme yakozwe na kirogodye Cony umu programmer wi Burundi yayikoze muri php ariko atesta les +
+ conditions yisunze ussd application. kuyikoresha no kuyi modifiant nikuri gusa ntirihishwa +
+ +
+ Facebook: Kirogodye +
+ Instagram: Kirogodye +
+ x: Kirogodye +
+ Github: Kirogodye +
+ Reddit: Kirogodye +
+ Email: [email protected] +
/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
+ +
+ Ce programme est develope par Kirogodye cony Le26-08-2022 pour test la condition +
+ switch en php. Trouvez-moi sur les liens ci-hauts +
+ +
/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +/
+ +
+ This program develop by Kirogodye cony as a programmer from Burundi to test switch condition using +
+ the ussd application model. You can get to these links. +
+ +
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++***/
echo "Welcome here to tech coilbit technology\n\n";
echo "Ururimi/Langue/language\n";
echo "1. Ikirundi\n";
echo "2. Francais\n";
echo "3. English\n";
$lang=(int)readline(" \n");
switch ($lang) {
case '1':
echo "Mwahisemwo neza ikirundi\n";
//menu kirundi
echo "1. Iyandikishe\n";
echo "2. kuraba ubuntunzi\n";
echo "3. Kubikura\n";
echo "4. Kurungika\n";
echo "5. Gusaba ingurane\n";
echo "6. Menya abo turi\n";
$menu=(int)readline(" \n");
switch ($menu) {
case '1':
//kwugurura ikonte
$creator="kirogodye";
$name=(string)readline("Andika izina: \n");
if ($name===$creator) {
echo "Ntiwemerewe gukoresha iryo zina\n";
return 0;
}
$uname=(string)readline("Andika iritazirano: \n");
$date=(int)readline("Umwaka w'amavuko: \n");
$hill=(string)readline("umutumba w'amavuko: \n");
$com=(string)readline("Ikomine y'amavuko: \n");
$pro=(string)readline("Intara y'amavuko: \n");
$cni=(string)readline("Nomero ya karangamuntu: \n");
//numero kabanga uhabwa
$pass=($date*15-2);
echo "Mwaronse kabanga yanyu nayo ni: $pass \n";
$code=(int)readline("Andika code muhejeje guhabwa: \n\n");
//mugihe code ariyo
if ($code===$pass) {
echo "---------------------------------------------------------------------------------------------------------------------\n";
echo "|Izina |iritazirano |umwaka |umutumba |ikomine |provensi |Karangamuntu |\n";
echo "|$name |$uname |$date |$hill |$com |$pro |$cni |\n";
echo "---------------------------------------------------------------------------------------------------------------------\n\n";
}
else {
echo "kabanga yanyu siyo. musabwa gusubiramwo. Murakoze\n";
}
break;
case '2':
//kuraba ubutunzi
$bonus=500;
echo "Ntimurashiramwo ubutunzi ariko murafise bonus mwahawe ya $bonus Fbu\n";
break;
case '3':
//kubikura amafaranga
$withdraw=(int)readline("Andika ayo mubikuye: \n");
//mugihe ari musi ya 500
if ($withdraw<500) {
echo "Ntimushobora kubikura ayari musi y'amajana atanu.";
return 0;
}
else {
$code=$withdraw-50;
$confirm=(int)readline("emezayo ico giharuro $code: \n");
//mugihe code ariyo
if ($code===$confirm) {
echo "Mwabikuye neza amafaranga $withdraw Fbu kuri compte yanyu. Bandanya mukoresha service zacu.\n";
}
else {
echo "Igiharuro mwasizeyo sico. Musabwa gusubiramwo!";
return 0;
}
}
break;
case '4':
//kurungikira umugenzi
$number=(int)readline("Andika inomero: \n");
$amount=(int)readline("shiramwo amafaranga: \n");
//mugihe ari musi ya 500Fbu
if ($amount<500) {
echo "Ntimushobora kurungika amafaranga ari musi ya 500Fbu\n";
return 0;
}
else {
$code=$number-61220022;
$sent=(int)readline("shiramwo ico giharuro $code: \n");
//mugihe code ariyo
if ($sent===$sent) {
echo "Mwarungikiye $number amafaranga ashika $amount Fbu. Bandanya mukoresha service zacu!\n";
}
else {
echo "Igiharuro mwashizeyo sico. Musabwe kugerageza.\n";
return 0;
}
}
break;
case '5':
$credit=(int)readline("shiramwo ayo musavye: \n");
$number=(int)readline("shiramwo nomero yanyu: \n");
$code=$number-$credit-61002200;
$expiryDate=Date('d/m/Y', strtotime('+31 days'));
$expiryTime=Date("H:i");
$confirm=(int)readline("shiramwo ico giharuro $code: \n");
//mugihe ayo usavye ari hejuru ya 500Fbu no mugihe code winjije ariyo
if ($code===$confirm && $credit>500) {
echo "Mwaronse ideni rya $credit Fbu kuri $number muzokoresha gushika $expiryTime $expiryDate . Murakoze\n";
} else {
echo "amahera ari musi ya 500Fbu canke igiharuro mwashizemwo sico. subiramwo\n";
return 0;
}
break;
case '6':
//menya ibitwerekeye
echo "Coilbit n'igisata kibafasha kubika, kubikura no kurungikira amafaranga ku mugenzi mu buryo bwihuse kandi bukingiy. Mufise ico mubaza twandikire kuri 71812038.\n\n";
break;
default:
//mugihe igiharuro wahisemwo kitari muvyo twatanze
echo "Ntivyakunze subira mugerageze!!";
return 0;
break;
}
break;
//Fin kirundi /*Debut Francais */
case '2':
echo "Bien choisi le francais\n";
//menu kirundi
echo "1. Inscription\n";
echo "2. Compte\n";
echo "3. Retrait\n";
echo "4. Envoyer\n";
echo "5. Credit\n";
echo "6. Informations\n";
$menu=(int)readline(" \n");
switch ($menu) {
case '1':
//ouvrir un compte
$creator="kirogodye";
$name=(string)readline("Votre nom: \n");
if ($name===$creator) {
echo "Impossible d'utiliser ce nom\n";
return 0;
}
$uname=(string)readline("votre prenom: \n");
$date=(int)readline("Annee de naissance: \n");
$hill=(string)readline("Colline de naissance: \n");
$com=(string)readline("Commune de naissance: \n");
$pro=(string)readline("Province de naissance: \n");
$cni=(string)readline("Numero de CNI: \n");
//mot de passe par defaut
$pass=($date*15-2);
echo "Mot de passe par defaut est: $pass \n";
$code=(int)readline("Entrer ce mot de passe: \n\n");
//si le mot de passe est correcte
if ($code===$pass) {
echo "---------------------------------------------------------------------------------------------------------------------\n";
echo "|Nom |Prenom |Annee |colline |Commune |Province |CNI |\n";
echo "|$name |$uname |$date |$hill |$com |$pro |$cni |\n";
echo "---------------------------------------------------------------------------------------------------------------------\n\n";
}
else {
echo "Votre mot de passe est incorrecte. Veuillez retaper encore\n";
}
break;
case '2':
//verifier le solde
$bonus=500;
echo "Vous avez seulement $bonus Fbu de bonus parceque aucun depot fait sur votre compte\n";
break;
case '3':
//retirer de l'argent
$withdraw=(int)readline("Entrer le solde: \n");
//si le solde est moins de 500Fbu
if ($withdraw<500) {
echo "Impossible de retirer moins de 500Fbu. Merci\n";
return 0;
}
else {
$code=$withdraw-50;
$confirm=(int)readline("ENtrer $code: \n");
//si le code=code tape
if ($code===$confirm) {
echo "Le retrait de $withdraw est fait sur votre compte. Merci!\n";
}
else {
echo "Le code est incorrecte!";
return 0;
}
}
break;
case '4':
//Envoyer de l'argent
$number=(int)readline("Entrer le numero: \n");
$amount=(int)readline("Entrer le solde: \n");
//si le solde est moins de 500Fbu
if ($amount<500) {
echo "Impossible d'envoyer moins de 500Fbu\n";
return 0;
}
else {
$code=$number-61220022;
$sent=(int)readline("Entrer ce code $code: \n");
//si le code est correcte
if ($sent===$code) {
echo "Le solde de $amount est envoye a ce numero $number avec succes! Merci\n";
}
else {
echo "Le code est incorrecte.\n";
return 0;
}
}
break;
case '5':
$credit=(int)readline("Entrer le credit: \n");
$number=(int)readline("votre numero: \n");
$code=$number-$credit-61002200;
$confirm=(int)readline("Entrer ce code $code: \n");
//si le solde est >=500 et le code est correcte
if ($code===$confirm && $credit>500) {
echo "Votre compte de numero $number est credite $credit. Merci\n";
} else {
echo "Invalid code ou bien le solde est moins de 500FBu\n";
return 0;
}
break;
case '6':
//Informations sur nous
echo "Coilbit est un service qui facilite les peuples burundais de faire de retrait, de depot, d'envoyer facilement l'argent en une seconde est en securite. Pour plus d'informations veuillez nous appeller sur ce numero 71812038\n\n";
break;
default:
//invalid
echo "Introuvable!!";
return 0;
break;
}
break;
//End of french /** Begin of ENglish */
case '3':
echo "You are choose English\n";
//menu kirundi
echo "1. Sign up\n";
echo "2. Account\n";
echo "3. Withdraw\n";
echo "4. Send\n";
echo "5. Credit\n";
echo "6. Informations of us\n";
$menu=(int)readline(" \n");
switch ($menu) {
case '1':
//sign up for news account
$creator="kirogodye";
$name=(string)readline("Your name: \n");
if ($name===$creator) {
echo "Impossible to us this name\n";
return 0;
}
$uname=(string)readline("Username: \n");
$date=(int)readline("year of birth: \n");
$hill=(string)readline("Hill of birth: \n");
$com=(string)readline("Commune of birth: \n");
$pro=(string)readline("Province of birth: \n");
$cni=(string)readline("Number of National Card: \n");
//default password
$pass=($date*15-2);
echo "Your default password is $pass \n";
$code=(int)readline("Enter password you got: \n\n");
//if the password is true
if ($code===$pass) {
echo "---------------------------------------------------------------------------------------------------------------------\n";
echo "|Name |Username |Year |Hill |Commune |Province |National card |\n";
echo "|$name |$uname |$date |$hill |$com |$pro |$cni |\n";
echo "---------------------------------------------------------------------------------------------------------------------\n\n";
}
else {
echo "worng password. Try again\n";
}
break;
case '2':
//See amount
$bonus=500;
echo "Any depot has been effect to your account but you have a bonus of $bonusFbu. Thanks!\n";
break;
case '3':
//Withdraw money
$withdraw=(int)readline("Enter amount: \n");
//mugihe ari musi ya 500
if ($withdraw<500) {
echo "You cannot withdraw money inferior of 500Fbu.";
return 0;
}
else {
$code=$withdraw-50;
$confirm=(int)readline("Enter this code $code: \n");
//if code is good or correct
if ($code===$confirm) {
echo "You have been withdraw $withdraw Fbu to your account continue to use our service. Thanks\n";
}
else {
echo "Wrong password, please try again!";
return 0;
}
}
break;
case '4':
//send to your freinds
$number=(int)readline("His/her number: \n");
$amount=(int)readline("Amount to send: \n");
//if is inferior of 500Fbu
if ($amount<500) {
echo "You cannot send that amount\n";
return 0;
}
else {
$code=$number-61220022;
$sent=(int)readline("Enter this code $code: \n");
//if code is true
if ($sent===$sent) {
echo "Amount of $amount just sent to $number. Continue to use ours services!\n";
}
else {
echo "Wrong password.\n";
return 0;
}
}
break;
case '5':
//ask credit
$credit=(int)readline("Amount of credit: \n");
$number=(int)readline("Enter your number: \n");
$code=$number-$credit-61002200;
$confirm=(int)readline("Enter this code $code: \n");
//if code is true and amount are high or equals 500Fbu
if ($code===$confirm && $credit>500) {
echo "Your account has been credited $credit to your number $number. Continue to use ours services!\n";
} else {
echo "Wrong password or amount is invalid\n";
return 0;
}
break;
case '6':
//know us
echo "Coilbit is a service that help mores burundians to send, depot, withdraw money to theirs accounts in few munites and in security. For mores informations call us to this number 71812038.\n\n";
break;
default:
//invalid choose
echo "Invalid!!";
return 0;
break;
}
break;
// invalid language
default:
echo 'Invalid!';
return 0;
break;
}
?>