# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
1 China * 84,737 44 0.05% 1,335 25 4,634 79,342 83,976 761 90,410,000 5.469% 5.518% 1,439,323,776 0.006% 6.3%
2 India * 2,376,700 61,252 2.70% 27 48,295 46,779 835 1.84% 38 591 1,677,583 1,724,362 652,338 26,015,297 1.968% 2.713% 1,380,004,385 0.172% 0.047% 0.003% 1.9%
3 USA * 5,327,650 61,656 1.18% 60 33,838 168,394 1,339 0.81% 87 1,099 2,778,438 2,946,832 2,380,818 67,237,309 3.161% 5.714% 331,002,651 1.610% 0.719% 0.051% 20.3%
4 Indonesia * 130,718 1,693 1.33% 53 1,942 5,903 59 1.02% 69 79 85,798 91,701 39,017 1,783,673 4.516% 6.437% 273,523,615 0.048% 0.014% 0.002% 0.7%
5 Pakistan * 285,921 531 0.19% 372 730 6,129 15 0.25% 283 17 263,193 269,322 16,599 2,186,442 2.144% 2.276% 220,892,340 0.129% 0.008% 0.003% 1.0%
6 Brazil * 3,123,109 28,789 0.95% 74 54,971 103,421 765 0.76% 93 1,387 2,243,124 2,346,545 776,564 13,231,548 3.311% 4.407% 212,559,417 1.469% 0.365% 0.049% 6.2%
7 Nigeria * 47,290 290 0.62% 112 423 956 5 0.53% 132 6 33,609 34,565 12,725 319,851 2.022% 2.766% 206,139,589 0.023% 0.006% 0.2%
8 Bangladesh * 266,498 2,996 1.15% 61 2,995 3,513 33 0.96% 73 42 153,089 156,602 109,896 1,302,739 1.318% 2.243% 164,689,383 0.162% 0.067% 0.002% 0.8%
9 Russia * 902,701 4,945 0.55% 126 5,102 15,260 130 0.87% 81 129 710,298 725,558 177,143 31,307,764 1.690% 2.103% 145,934,462 0.619% 0.121% 0.010% 21.5%
10 Mexico * 492,522 5,558 1.16% 61 6,686 53,929 705 1.35% 52 926 332,800 386,729 105,793 1,112,114 10.950% 13.945% 128,932,753 0.382% 0.082% 0.042% 0.9%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
11 Japan * 48,928 1,207 2.58% 28 938 1,052 7 0.67% 104 5 33,975 35,027 13,901 1,024,235 2.150% 3.003% 126,476,461 0.039% 0.011% 0.001% 0.8%
12 Ethiopia * 25,118 584 2.48% 29 943 463 20 4.76% 15 23 11,034 11,497 13,621 535,431 1.843% 4.027% 114,963,588 0.022% 0.012% 0.5%
13 Philippines 143,749 2,900 2.12% 34 4,211 2,404 18 0.78% 89 92 68,997 71,401 72,348 1,853,010 1.672% 3.367% 109,581,078 0.131% 0.066% 0.002% 1.7%
14 Egypt * 95,834 174 0.18% 381 168 5,059 26 0.52% 134 24 54,888 59,947 35,887 135,000 5.279% 8.439% 102,334,404 0.094% 0.035% 0.005% 0.1%
15 Vietnam * 880 16 1.89% 38 17 17 1 6.67% 11 1 403 420 460 621,823 1.932% 4.048% 97,338,579 0.001% 0.6%
16 DRC * 9,538 10 0.11% 659 39 225 1 0.45% 156 8,421 8,646 892 2.359% 2.602% 89,561,403 0.011% 0.001%
17 Turkey * 243,180 1,183 0.49% 143 5,873 15 0.26% 272 226,155 232,028 11,152 5,387,751 2.415% 2.531% 84,339,067 0.288% 0.013% 0.007% 6.4%
18 Iran * 333,699 2,345 0.71% 98 2,510 18,988 184 0.99% 71 188 290,244 309,232 24,467 2,763,225 5.690% 6.140% 83,992,949 0.397% 0.029% 0.023% 3.3%
19 Germany * 219,648 1,031 0.47% 148 118 9,269 3 0.03% 2,142 1 199,900 209,169 10,479 8,586,648 4.220% 4.431% 83,783,942 0.262% 0.013% 0.011% 10.2%
20 Thailand * 3,356 5 58 3,169 3,227 129 749,213 1.728% 1.797% 69,799,978 0.005% 1.1%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
21 UK * 313,798 1,148 0.37% 189 1,009 46,706 180 46,706 267,092 18,868,566 14.884% 100.000% 67,886,011 0.462% 0.393% 0.069% 27.8%
22 France * 206,696 1,397 0.69% 101 2,524 30,371 14 0.05% 1,503 17 83,237 113,608 93,088 5,500,000 14.694% 26.733% 65,273,511 0.317% 0.143% 0.047% 8.4%
23 Italy * 251,713 412 0.16% 423 476 35,225 6 0.02% 4,068 10 202,697 237,922 13,791 7,369,576 13.994% 14.805% 60,461,826 0.416% 0.023% 0.058% 12.2%
24 Tanzania * 509 21 183 204 305 4.126% 10.294% 59,734,218 0.001% 0.001%
25 South Africa * 566,109 6,250 1.12% 63 10,751 343 3.30% 22 426,125 436,876 129,233 3,278,977 1.899% 2.461% 59,308,690 0.955% 0.218% 0.018% 5.5%
26 Myanmar * 361 1 6 318 324 37 127,726 1.662% 1.852% 54,409,800 0.001% 0.2%
27 Kenya * 28,104 497 1.85% 38 679 456 15 3.55% 20 18 14,610 15,066 13,038 362,501 1.623% 3.027% 53,771,296 0.052% 0.024% 0.001% 0.7%
28 S. Korea * 14,714 34 0.23% 299 54 305 13,786 14,091 623 1,646,652 2.073% 2.165% 51,269,185 0.029% 0.001% 0.001% 3.2%
29 Colombia * 410,453 10,142 2.62% 27 12,830 13,475 312 2.43% 29 321 230,427 243,902 166,551 1,982,831 3.283% 5.525% 50,882,891 0.807% 0.327% 0.026% 3.9%
30 Spain * 373,692 3,632 0.98% 71 28,581 5 0.02% 3,962 28,581 345,111 7,472,031 7.648% 100.000% 46,754,778 0.799% 0.738% 0.061% 16.0%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
31 Uganda * 1,332 16 1.23% 57 19 9 1,139 1,148 184 304,485 0.676% 0.784% 45,741,007 0.003% 0.7%
32 Argentina * 260,911 7,369 2.99% 24 7,043 5,088 151 3.26% 22 303 187,283 192,371 68,540 891,817 1.950% 2.645% 45,195,774 0.577% 0.152% 0.011% 2.0%
33 Algeria * 36,699 492 1.38% 51 495 1,333 10 0.76% 92 11 25,627 26,960 9,739 3.632% 4.944% 43,851,044 0.084% 0.022% 0.003%
34 Sudan * 12,033 77 0.64% 108 786 5 0.64% 109 6,282 7,068 4,965 401 6.532% 11.121% 43,849,260 0.027% 0.011% 0.002%
35 Ukraine * 84,548 1,158 1.41% 50 1,433 1,970 29 1.51% 47 19 45,686 47,656 36,892 1,214,941 2.330% 4.134% 43,733,762 0.193% 0.084% 0.005% 2.8%
36 Iraq * 160,436 3,396 2.21% 32 3,441 5,588 67 1.23% 57 57 114,541 120,129 40,307 1,203,883 3.483% 4.652% 40,222,493 0.399% 0.100% 0.014% 3.0%
37 Afghanistan * 37,345 107 0.29% 242 76 1,354 16 1.20% 58 10 26,694 28,048 9,297 97,199 3.626% 4.827% 38,928,346 0.096% 0.024% 0.003% 0.2%
38 Poland * 53,676 551 1.05% 67 715 1,830 12 0.66% 105 9 37,611 39,441 14,235 2,257,525 3.409% 4.640% 37,846,611 0.142% 0.038% 0.005% 6.0%
39 Canada * 120,617 512 0.43% 163 361 9,004 6 0.07% 1,038 16 107,015 116,019 4,598 4,541,747 7.465% 7.761% 37,742,154 0.320% 0.012% 0.024% 12.0%
40 Morocco * 36,694 1,132 3.32% 22 1,499 556 17 3.29% 22 23 25,677 26,233 10,461 1,516,402 1.515% 2.119% 36,910,560 0.099% 0.028% 0.002% 4.1%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
41 Saudi Arabia * 293,037 1,521 0.52% 133 1,569 3,269 34 1.06% 66 36 257,269 260,538 32,499 3,933,427 1.116% 1.255% 34,813,871 0.842% 0.093% 0.009% 11.3%
42 Uzbekistan * 32,465 679 2.19% 33 718 210 6 3.03% 24 6 25,106 25,316 7,149 1,377,915 0.647% 0.830% 33,469,203 0.097% 0.021% 0.001% 4.1%
43 Peru * 489,680 5,109 1.07% 66 6,547 21,501 204 0.97% 72 225 335,756 357,257 132,423 2,612,599 4.391% 6.018% 32,971,854 1.485% 0.402% 0.065% 7.9%
44 Angola * 1,735 56 80 2 575 655 1,080 64,747 4.611% 12.214% 32,866,272 0.005% 0.003% 0.2%
45 Malaysia * 9,114 9 0.10% 701 11 125 8,817 8,942 172 1,074,020 1.372% 1.398% 32,365,999 0.028% 0.001% 3.3%
46 Mozambique * 2,559 148 19 3 951 970 1,589 72,461 0.742% 1.959% 31,255,435 0.008% 0.005% 0.2%
47 Ghana * 41,572 192 0.47% 150 168 223 8 39,320 39,543 2,029 416,988 0.536% 0.564% 31,072,940 0.134% 0.007% 0.001% 1.3%
48 Yemen * 1,831 6 0.33% 212 -1 523 5 0.97% 73 919 1,442 389 120 28.564% 36.269% 29,825,964 0.006% 0.001% 0.002%
49 Nepal * 24,432 638 2.74% 26 484 91 4 5.06% 15 8 16,728 16,819 7,613 785,581 0.372% 0.541% 29,136,808 0.084% 0.026% 2.7%
50 Venezuela * 27,938 995 3.86% 19 1,138 238 6 2.69% 27 9 19,706 19,944 7,994 1,603,217 0.852% 1.193% 28,435,940 0.098% 0.028% 0.001% 5.6%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
51 Madagascar * 13,397 115 0.87% 80 80 156 1 0.66% 106 4 11,529 11,685 1,712 49,957 1.164% 1.335% 27,691,018 0.048% 0.006% 0.001% 0.2%
52 Cameroon * 18,213 171 398 3 15,320 15,718 2,495 149,000 2.185% 2.532% 26,545,863 0.069% 0.009% 0.001% 0.6%
53 Ivory Coast * 16,847 132 0.79% 89 105 13,321 13,426 3,421 110,359 0.623% 0.782% 26,378,274 0.064% 0.013% 0.4%
54 Australia * 22,127 306 1.43% 49 414 352 17 5.41% 14 21 12,393 12,745 9,382 5,030,086 1.591% 2.762% 25,499,884 0.087% 0.037% 0.001% 19.7%
55 Niger * 1,158 69 1,065 1,134 24 9,052 5.959% 6.085% 24,206,644 0.005%
56 Taiwan * 481 1 7 450 457 24 83,828 1.455% 1.532% 23,816,775 0.002% 0.4%
57 Sri Lanka * 2,881 10 0.35% 200 1 11 2,638 2,649 232 166,737 0.382% 0.415% 21,413,249 0.013% 0.001% 0.8%
58 Burkina Faso * 1,213 7 0.58% 120 2 54 995 1,049 164 4.452% 5.148% 20,903,273 0.006% 0.001%
59 Mali * 2,577 4 0.16% 447 125 1,973 2,098 479 28,652 4.851% 5.958% 20,250,833 0.013% 0.002% 0.001% 0.1%
60 Romania * 65,177 1,215 1.94% 37 1,415 2,807 35 1.28% 55 43 31,048 33,855 31,322 1,427,626 4.307% 8.291% 19,237,691 0.339% 0.163% 0.015% 7.4%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
61 Malawi * 4,714 16 0.34% 203 40 152 6 2,477 2,629 2,085 35,337 3.224% 5.782% 19,129,952 0.025% 0.011% 0.001% 0.2%
62 Chile * 378,168 1,572 0.42% 166 1,552 10,205 39 0.38% 181 27 351,419 361,624 16,544 1,908,964 2.699% 2.822% 19,116,201 1.978% 0.087% 0.053% 10.0%
63 Kazakhstan * 100,855 722 0.73% 96 691 1,269 211 19.94% 4 74,677 75,946 24,909 2,183,308 1.258% 1.671% 18,776,707 0.537% 0.133% 0.007% 11.6%
64 Zambia * 8,275 65 0.79% 88 241 7,004 7,245 1,030 94,811 2.912% 3.326% 18,383,955 0.045% 0.006% 0.001% 0.5%
65 Guatemala * 57,966 382 0.67% 104 979 2,233 11 0.50% 140 11 46,442 48,675 9,291 185,374 3.852% 4.588% 17,915,568 0.324% 0.052% 0.012% 1.0%
66 Ecuador * 95,563 862 0.91% 77 5,951 19 0.32% 217 78,610 84,561 11,002 268,726 6.227% 7.038% 17,643,054 0.542% 0.062% 0.034% 1.5%
67 Syria * 1,327 72 5.74% 13 53 1 1.92% 37 385 438 889 3.994% 12.100% 17,500,658 0.008% 0.005%
68 Netherlands * 60,627 779 1.32% 54 654 6,161 2 0.03% 2,135 2 6,161 54,466 1,195,475 10.162% 100.000% 17,134,872 0.354% 0.318% 0.036% 7.0%
69 Senegal * 11,587 68 0.60% 116 207 242 2 0.85% 83 4 7,523 7,765 3,822 123,824 2.089% 3.117% 16,743,927 0.069% 0.023% 0.001% 0.7%
70 Cambodia * 268 15 5.98% 12 2 220 220 48 75,034 16,718,965 0.002% 0.4%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
71 Chad * 946 1 76 859 935 11 8.034% 8.128% 16,425,864 0.006%
72 Somalia * 3,227 93 1,728 1,821 1,406 2.882% 5.107% 15,893,222 0.020% 0.009% 0.001%
73 Zimbabwe * 4,818 70 1.47% 48 104 1,544 1,648 3,170 149,748 2.159% 6.311% 14,862,924 0.032% 0.021% 0.001% 1.0%
74 Guinea * 8,018 88 50 7,020 7,070 948 14,407 0.624% 0.707% 13,132,795 0.061% 0.007% 0.1%
75 Rwanda * 2,171 19 0.88% 79 7 1,478 1,485 686 309,653 0.322% 0.471% 12,952,218 0.017% 0.005% 2.4%
76 Benin * 2,001 65 3.36% 21 38 1,681 1,719 282 101,987 1.899% 2.211% 12,123,200 0.017% 0.002% 0.8%
77 Burundi * 408 1 315 316 92 17,306 0.245% 0.316% 11,890,784 0.003% 0.001% 0.1%
78 Tunisia * 1,738 21 1.22% 58 52 1 1.96% 36 1,272 1,324 414 106,332 2.992% 3.927% 11,818,619 0.015% 0.004% 0.9%
79 Bolivia * 93,328 1,636 1.82% 39 1,693 3,761 72 1.98% 36 49 31,753 35,514 57,814 198,178 4.030% 10.590% 11,673,021 0.800% 0.495% 0.032% 1.7%
80 Belgium * 75,008 468 0.63% 111 388 9,885 7 0.07% 978 6 17,841 27,726 47,282 1,888,690 13.179% 35.652% 11,589,623 0.647% 0.408% 0.085% 16.3%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
81 Haiti * 7,649 15 0.20% 354 183 4,982 5,165 2,484 18,933 2.392% 3.543% 11,402,528 0.067% 0.022% 0.002% 0.2%
82 Cuba * 3,093 47 1.54% 46 88 2,472 2,560 533 305,652 2.845% 3.438% 11,326,616 0.027% 0.005% 0.001% 2.7%
83 South Sudan * 2,472 2 47 1,175 1,222 1,250 12,044 1.901% 3.846% 11,193,725 0.022% 0.011% 0.1%
84 Dominican... * 82,224 595 0.74% 95 1,130 1,371 18 1.36% 52 25 47,095 48,466 33,758 304,501 1.667% 2.829% 10,847,910 0.758% 0.311% 0.013% 2.8%
85 Czechia * 18,984 224 1.21% 58 306 391 1 0.26% 271 13,407 13,798 5,186 767,598 2.060% 2.834% 10,708,981 0.177% 0.048% 0.004% 7.2%
86 Greece * 5,942 193 3.36% 21 214 1 0.47% 148 3,804 4,018 1,924 668,739 3.601% 5.326% 10,423,054 0.057% 0.018% 0.002% 6.4%
87 Jordan * 1,303 15 1.18% 59 20 11 1,215 1,226 77 665,653 0.844% 0.897% 10,203,134 0.013% 0.001% 6.5%
88 Portugal * 53,223 120 0.23% 306 278 1,764 2 0.11% 610 3 38,940 40,704 12,519 1,766,454 3.314% 4.334% 10,196,709 0.522% 0.123% 0.017% 17.3%
89 Azerbaijan * 33,824 84 0.25% 278 93 497 3 0.61% 115 2 31,058 31,555 2,269 804,513 1.469% 1.575% 10,139,177 0.334% 0.022% 0.005% 7.9%
90 Sweden * 83,455 154 0.19% 374 329 5,774 4 0.07% 1,000 4 5,774 77,681 917,036 6.919% 100.000% 10,099,265 0.826% 0.769% 0.057% 9.1%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
91 Honduras * 48,403 418 0.88% 80 531 1,515 11 0.74% 95 9 6,805 8,320 40,083 118,409 3.130% 18.209% 9,904,607 0.489% 0.405% 0.015% 1.2%
92 UAE * 63,212 262 0.42% 167 246 358 1 0.28% 248 57,193 57,551 5,661 5,700,145 0.566% 0.622% 9,890,402 0.639% 0.057% 0.004% 57.6%
93 Hungary * 4,768 15 0.32% 219 22 605 3,529 4,134 634 366,356 12.689% 14.635% 9,660,351 0.049% 0.007% 0.006% 3.8%
94 Tajikistan * 7,912 44 0.56% 124 41 63 1 1.61% 44 6,696 6,759 1,153 0.796% 0.932% 9,537,645 0.083% 0.012% 0.001%
95 Belarus * 69,102 58 0.08% 825 97 595 3 0.51% 137 3 65,893 66,488 2,614 1,384,026 0.861% 0.895% 9,449,323 0.731% 0.028% 0.006% 14.6%
96 Austria * 22,439 139 0.63% 111 194 724 1 20,268 20,992 1,447 983,018 3.227% 3.449% 9,006,398 0.249% 0.016% 0.008% 10.9%
97 Papua New... * 214 3 71 74 140 11,439 1.402% 4.054% 8,947,024 0.002% 0.002% 0.1%
98 Serbia * 28,751 235 0.83% 84 254 658 6 0.93% 75 6 18,965 19,623 9,128 770,997 2.289% 3.353% 8,737,371 0.329% 0.104% 0.008% 8.8%
99 Israel 87,878 1,425 1.68% 42 1,731 639 9 1.47% 48 17 61,625 62,264 25,614 1,996,966 0.727% 1.026% 8,655,535 1.015% 0.296% 0.007% 23.1%
100 Switzerland * 37,169 187 0.51% 137 274 1,991 3 0.15% 460 1 32,700 34,691 2,478 854,885 5.357% 5.739% 8,654,622 0.429% 0.029% 0.023% 9.9%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
101 Togo * 1,070 10 0.94% 74 26 3 13.04% 6 752 778 292 49,390 2.430% 3.342% 8,278,724 0.013% 0.004% 0.6%
102 Sierra Leone * 1,932 15 0.78% 89 69 1,478 1,547 385 3.571% 4.460% 7,976,983 0.024% 0.005% 0.001%
103 Hong Kong * 4,244 33 0.80% 88 62 63 3 5.45% 14 5 3,189 3,252 992 692,430 1.484% 1.937% 7,496,981 0.057% 0.013% 0.001% 9.2%
104 Laos * 20 19 19 1 32,114 7,275,560 0.4%
105 Paraguay * 7,519 327 4.73% 15 285 86 7 9.33% 8 4 5,326 5,412 2,107 142,394 1.144% 1.589% 7,132,538 0.105% 0.030% 0.001% 2.0%
106 Bulgaria * 13,722 116 0.87% 81 210 471 12 2.68% 27 12 8,154 8,625 5,097 313,866 3.432% 5.461% 6,948,445 0.197% 0.073% 0.007% 4.5%
107 Libya * 6,302 478 8.77% 9 373 132 6 5.04% 15 7 740 872 5,430 68,201 2.095% 15.138% 6,871,292 0.092% 0.079% 0.002% 1.0%
108 Lebanon * 7,121 309 4.54% 16 87 7 8.75% 9 2,377 2,464 4,657 377,221 1.222% 3.531% 6,825,445 0.104% 0.068% 0.001% 5.5%
109 Nicaragua * 4,115 213 128 5 2,913 3,041 1,074 3.111% 4.209% 6,624,554 0.062% 0.016% 0.002%
110 Kyrgyzstan * 40,759 370 0.92% 76 304 1,484 4 0.27% 256 6 32,997 34,481 6,278 267,718 3.641% 4.304% 6,524,195 0.625% 0.096% 0.023% 4.1%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
111 El Salvador * 21,644 397 1.90% 37 375 577 7 1.24% 57 7 10,056 10,633 11,011 268,539 2.666% 5.427% 6,486,205 0.334% 0.170% 0.009% 4.1%
112 Singapore * 55,395 61 0.11% 629 42 27 50,520 50,547 4,848 1,610,906 0.049% 0.053% 5,850,342 0.947% 0.083% 27.5%
113 Denmark * 15,070 144 0.97% 72 111 621 1 0.16% 431 13,066 13,687 1,383 1,804,613 4.121% 4.537% 5,792,202 0.260% 0.024% 0.011% 31.2%
114 Finland * 7,642 22 0.29% 240 19 333 7,050 7,383 259 431,318 4.357% 4.510% 5,540,720 0.138% 0.005% 0.006% 7.8%
115 Congo * 3,745 81 60 2 1,625 1,685 2,060 1.602% 3.561% 5,518,087 0.068% 0.037% 0.001%
116 Slovakia * 2,690 16 0.62% 113 75 31 1,884 1,915 775 284,111 1.152% 1.619% 5,459,642 0.049% 0.014% 0.001% 5.2%
117 Norway * 9,772 51 0.53% 132 60 256 8,857 9,113 659 508,770 2.620% 2.809% 5,421,241 0.180% 0.012% 0.005% 9.4%
118 Oman * 82,299 263 0.32% 216 249 539 12 2.30% 31 6 77,072 77,611 4,688 309,212 0.655% 0.694% 5,106,626 1.612% 0.092% 0.011% 6.1%
119 Palestine * 15,184 365 2.52% 28 309 104 4 4.00% 18 8,369 8,473 6,711 214,862 0.685% 1.227% 5,101,414 0.298% 0.132% 0.002% 4.2%
120 Costa Rica * 24,508 636 2.66% 27 255 11 4.51% 16 7,971 8,226 16,282 108,819 1.040% 3.100% 5,094,118 0.481% 0.320% 0.005% 2.1%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
121 Liberia * 1,250 10 0.81% 87 81 2 2.53% 28 736 817 433 6.480% 9.914% 5,057,681 0.025% 0.009% 0.002%
122 Ireland * 26,801 33 0.12% 563 1,773 1 0.06% 1,229 23,364 25,137 1,664 680,602 6.615% 7.053% 4,937,786 0.543% 0.034% 0.036% 13.8%
123 CAR * 4,645 4 0.09% 805 61 1 1.67% 42 1,723 1,784 2,861 29,817 1.313% 3.419% 4,829,767 0.096% 0.059% 0.001% 0.6%
124 New Zealand * 1,579 1 0.06% 1,088 9 22 1,531 1,553 26 498,480 1.393% 1.417% 4,822,233 0.033% 0.001% 10.3%
125 Mauritania * 6,598 32 0.49% 142 43 157 5,704 5,861 737 57,604 2.380% 2.679% 4,649,658 0.142% 0.016% 0.003% 1.2%
126 Panama * 76,464 902 1.21% 58 1,070 1,680 25 1.53% 46 16 50,665 52,345 24,119 255,418 2.197% 3.209% 4,314,767 1.772% 0.559% 0.039% 5.9%
127 Kuwait * 73,785 668 0.92% 76 717 489 4 0.83% 84 3 65,451 65,940 7,845 543,858 0.663% 0.742% 4,270,571 1.728% 0.184% 0.011% 12.7%
128 Croatia * 5,870 91 1.61% 44 130 160 2 1.27% 56 5,024 5,184 686 132,292 2.726% 3.086% 4,105,267 0.143% 0.017% 0.004% 3.2%
129 Moldova * 28,697 382 1.37% 51 474 863 7 0.82% 85 6 19,998 20,861 7,836 128,076 3.007% 4.137% 4,033,963 0.711% 0.194% 0.021% 3.2%
130 Georgia * 1,278 14 1.12% 63 14 17 1,058 1,075 203 258,525 1.330% 1.581% 3,989,167 0.032% 0.005% 6.5%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
131 Eritrea * 285 248 248 37 3,546,421 0.008% 0.001%
132 Uruguay * 1,385 11 0.81% 86 21 37 1,157 1,194 191 135,429 2.671% 3.099% 3,473,730 0.040% 0.005% 0.001% 3.9%
133 Bosnia... * 14,961 210 1.45% 49 253 453 22 5.18% 14 6 8,827 9,280 5,681 156,047 3.028% 4.881% 3,280,819 0.456% 0.173% 0.014% 4.8%
134 Mongolia * 293 269 269 24 41,584 3,278,290 0.009% 0.001% 1.3%
135 Armenia * 40,794 160 0.40% 176 201 806 7 0.88% 80 3 33,492 34,298 6,496 179,032 1.976% 2.350% 2,963,243 1.377% 0.219% 0.027% 6.0%
136 Jamaica * 1,047 8 0.78% 89 16 14 753 767 280 44,371 1.337% 1.825% 2,961,167 0.035% 0.009% 1.5%
137 Qatar * 113,938 384 0.34% 205 292 190 2 110,627 110,817 3,121 533,995 0.167% 0.171% 2,881,053 3.955% 0.108% 0.007% 18.5%
138 Albania * 6,817 140 2.14% 33 141 208 5 2.50% 29 3 3,552 3,760 3,057 42,854 3.051% 5.532% 2,877,797 0.237% 0.106% 0.007% 1.5%
139 Lithuania * 2,309 18 0.79% 88 26 81 1,683 1,764 545 561,555 3.508% 4.592% 2,722,289 0.085% 0.020% 0.003% 20.6%
140 Namibia * 3,229 128 4.13% 18 19 715 734 2,495 36,287 0.588% 2.589% 2,540,905 0.127% 0.098% 0.001% 1.4%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
141 Gambia * 1,477 111 8.99% 9 131 33 9 39.13% 3 1 247 280 1,197 5,834 2.234% 11.786% 2,416,668 0.061% 0.050% 0.001% 0.2%
142 Botswana * 1,066 262 32.59% 3 2 80 82 984 80,163 0.188% 2.439% 2,351,627 0.045% 0.042% 3.4%
143 Gabon * 8,006 83 1.05% 67 51 5,823 5,874 2,132 91,767 0.637% 0.868% 2,225,734 0.360% 0.096% 0.002% 4.1%
144 Lesotho * 781 39 5.26% 14 24 1 4.35% 17 175 199 582 8,771 3.073% 12.060% 2,142,249 0.036% 0.027% 0.001% 0.4%
145 North... * 12,217 141 1.18% 60 134 530 1 0.19% 367 1 8,487 9,017 3,200 119,102 4.338% 5.878% 2,083,374 0.586% 0.154% 0.025% 5.7%
146 Slovenia * 2,272 17 0.75% 93 129 1 0.78% 90 1,960 2,089 183 137,845 5.678% 6.175% 2,078,938 0.109% 0.009% 0.006% 6.6%
147 Guinea-Bi... * 2,088 36 1.75% 40 29 1,015 1,044 1,044 1,500 1.389% 2.778% 1,968,001 0.106% 0.053% 0.001% 0.1%
148 Latvia * 1,303 3 0.23% 299 10 32 1,078 1,110 193 218,756 2.456% 2.883% 1,886,198 0.069% 0.010% 0.002% 11.6%
149 Bahrain * 44,804 386 0.88% 80 407 165 2 1.23% 57 41,504 41,669 3,135 923,342 0.368% 0.396% 1,701,575 2.633% 0.184% 0.010% 54.3%
150 Equatoria... * 4,821 83 2,182 2,265 2,556 44,356 1.722% 3.664% 1,402,985 0.344% 0.182% 0.006% 3.2%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
151 Trinidad... * 308 15 5.36% 14 13 8 139 147 161 11,710 2.597% 5.442% 1,399,488 0.022% 0.012% 0.001% 0.8%
152 Estonia * 2,174 9 0.42% 167 7 63 1,975 2,038 136 129,633 2.898% 3.091% 1,326,535 0.164% 0.010% 0.005% 9.8%
153 Timor-Leste * 25 24 24 1 4,238 1,318,445 0.002% 0.3%
154 Mauritius * 344 10 334 344 205,285 2.907% 2.907% 1,271,768 0.027% 0.001% 16.1%
155 Cyprus * 1,277 25 2.00% 36 20 1 5.26% 14 870 890 387 239,630 1.566% 2.247% 1,207,359 0.106% 0.032% 0.002% 19.8%
156 Eswatini * 3,410 174 5.38% 14 63 5 8.62% 9 1,720 1,783 1,627 27,837 1.848% 3.533% 1,160,164 0.294% 0.140% 0.005% 2.4%
157 Djibouti * 5,348 1 0.02% 3,707 59 5,133 5,192 156 61,199 1.103% 1.136% 988,000 0.541% 0.016% 0.006% 6.2%
158 Fiji * 27 1 18 19 8 6,693 3.704% 5.263% 896,445 0.003% 0.001% 0.7%
159 Ré... * 702 3 0.44% 160 12 5 631 636 66 35,419 0.712% 0.786% 895,312 0.078% 0.007% 0.001% 4.0%
160 Comoros * 399 7 379 386 13 1.754% 1.813% 869,601 0.046% 0.001% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
161 Guyana * 602 34 22 189 211 391 5,366 3.654% 10.427% 786,552 0.077% 0.050% 0.003% 0.7%
162 Bhutan * 113 3 2.73% 26 97 97 16 56,130 771,608 0.015% 0.002% 7.3%
163 Macao * 46 46 46 4,071 649,335 0.007% 0.6%
164 Montenegro * 3,748 78 2.16% 33 52 71 4 6.25% 12 3 2,558 2,629 1,119 40,408 1.894% 2.701% 628,066 0.597% 0.178% 0.011% 6.4%
165 Luxembourg * 7,242 26 0.36% 193 122 1 0.83% 85 6,222 6,344 898 653,707 1.685% 1.923% 625,978 1.157% 0.143% 0.019% 104.4%
166 Western... * 10 1 8 9 1 10.000% 11.111% 597,339 0.002%
167 Suriname * 2,559 98 4.10% 18 70 39 1 3.45% 21 9 1,712 1,751 808 4,060 1.524% 2.227% 586,632 0.436% 0.138% 0.007% 0.7%
168 Cabo Verde * 2,920 62 2.17% 33 33 1 3.13% 23 2,148 2,181 739 61,633 1.130% 1.513% 555,987 0.525% 0.133% 0.006% 11.1%
169 Maldives * 5,223 66 21 1 5.26% 14 1 2,849 2,870 2,353 90,704 0.402% 0.732% 540,544 0.966% 0.435% 0.004% 16.8%
170 Malta * 1,190 29 2.61% 27 49 9 695 704 486 147,411 0.756% 1.278% 441,543 0.270% 0.110% 0.002% 33.4%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
171 Brunei * 142 3 138 141 1 43,312 2.113% 2.128% 437,479 0.032% 0.001% 9.9%
172 Guadeloupe * 317 14 186 200 117 20,305 4.416% 7.000% 400,124 0.079% 0.029% 0.003% 5.1%
173 Belize * 210 23 14.94% 5 33 2 32 34 176 4,259 0.952% 5.882% 397,628 0.053% 0.044% 0.001% 1.1%
174 Bahamas * 989 47 5.23% 14 44 15 116 131 858 6,938 1.517% 11.450% 393,244 0.251% 0.218% 0.004% 1.8%
175 Martinique * 336 16 98 114 222 12,227 4.762% 14.035% 375,265 0.090% 0.059% 0.004% 3.3%
176 Iceland * 1,972 6 0.31% 228 4 10 1,847 1,857 115 168,233 0.507% 0.539% 341,243 0.578% 0.034% 0.003% 49.3%
177 French... * 8,360 57 0.69% 101 36 49 1 2.08% 34 7,632 7,681 679 43,127 0.586% 0.638% 298,682 2.799% 0.227% 0.016% 14.4%
178 Barbados * 143 1 0.70% 99 7 112 119 24 13,313 4.895% 5.882% 287,375 0.050% 0.008% 0.002% 4.6%
179 New... * 23 22 22 1 11,265 285,498 0.008% 3.9%
180 French... * 112 43 62.32% 2 62 62 50 6,525 280,908 0.040% 0.018% 2.3%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
181 Mayotte * 3,091 23 39 2,835 2,874 217 13,000 1.262% 1.357% 272,815 1.133% 0.080% 0.014% 4.8%
182 Sao Tome... * 881 3 15 804 819 62 3,160 1.703% 1.832% 219,159 0.402% 0.028% 0.007% 1.4%
183 Saint Lucia * 25 25 25 4,274 183,627 0.014% 2.3%
184 Channel... * 599 2 0.34% 208 47 545 592 7 52,055 7.846% 7.939% 173,863 0.345% 0.004% 0.027% 29.9%
185 Cura&cced... * 32 1 3.23% 22 1 30 31 1 1,080 3.125% 3.226% 164,093 0.020% 0.001% 0.001% 0.7%
186 Grenada * 24 23 23 1 6,252 112,523 0.021% 0.001% 5.6%
187 St.... * 57 52 52 5 2,529 110,940 0.051% 0.005% 2.3%
188 Aruba * 717 154 27.35% 3 3 114 117 600 14,047 0.418% 2.564% 106,766 0.672% 0.562% 0.003% 13.2%
189 Seychelles * 127 1 0.79% 88 126 126 1 98,347 0.129% 0.001%
190 Antigua... * 92 3 76 79 13 1,500 3.261% 3.797% 97,929 0.094% 0.013% 0.003% 1.5%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
191 Isle of Man * 336 24 312 336 8,898 7.143% 7.143% 85,033 0.395% 0.028% 10.5%
192 Andorra * 963 52 855 907 56 3,750 5.400% 5.733% 77,265 1.246% 0.072% 0.067% 4.9%
193 Dominica * 18 18 18 1,005 71,986 0.025% 1.4%
194 Cayman... * 203 1 202 203 31,881 0.493% 0.493% 65,722 0.309% 0.002% 48.5%
195 Bermuda * 159 1 0.63% 110 9 145 154 5 29,481 5.660% 5.844% 62,278 0.255% 0.008% 0.014% 47.3%
196 Greenland * 14 14 14 6,137 56,770 0.025% 10.8%
197 Saint... * 17 17 17 1,294 53,199 0.032% 2.4%
198 Faeroe... * 335 12 3.92% 19 17 225 225 110 63,847 48,863 0.686% 0.225% 130.7%
199 Sint Maarten * 219 16 8.47% 9 14 17 102 119 100 1,502 7.763% 14.286% 42,876 0.511% 0.233% 0.040% 3.5%
200 Monaco * 138 5 3.76% 19 4 113 117 21 38,209 2.899% 3.419% 39,242 0.352% 0.054% 0.010% 97.4%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
201 Turks and... * 224 8 2 39 41 183 1,520 0.893% 4.878% 38,717 0.579% 0.473% 0.005% 3.9%
202 Saint Martin * 84 6 7.69% 10 4 1 44 48 36 1,899 4.762% 8.333% 38,666 0.217% 0.093% 0.010% 4.9%
203 Liechtens... * 89 1 87 88 1 900 1.124% 1.136% 38,128 0.233% 0.003% 0.003% 2.4%
204 San Marino * 699 42 657 699 6,068 6.009% 6.009% 33,931 2.060% 0.124% 17.9%
205 Gibraltar * 203 1 0.50% 140 1 187 187 16 25,570 33,691 0.603% 0.047% 75.9%
206 British... * 9 1 7 8 1 1,522 11.111% 12.500% 30,231 0.030% 0.003% 0.003% 5.0%
207 Caribbean... * 13 7 7 6 424 26,223 0.050% 0.023% 1.6%
208 Anguilla * 3 3 3 537 15,003 0.020% 3.6%
209 St. Barth * 13 6 6 7 1,612 9,877 0.132% 0.071% 16.3%
210 Saint... * 4 1 1 3 5,794 0.069% 0.052%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 20,649,711 246,312 1.22% 58 228,719 748,658 6,091 0.83% 85 6,257 13,341,312 14,089,970 6,559,741 377,343,877 3.626% 5.313% 7,800,000,000 0.265% 0.084% 0.010% 4.8%
211 Montserrat * 13 1 12 13 61 7.692% 7.692% 4,992 0.260% 0.020% 1.2%
212 Diamond... * 712 13 651 664 48 1.826% 1.958% 3,711 19.186% 1.293% 0.350%
213 Falkland... * 13 13 13 2,256 3,480 0.374% 64.8%
214 MS Zaandam * 9 2 2 7 22.222% 100.000% 1,243 0.724% 0.563% 0.161%
215 Vatican City * 12 12 12 825 1.455%
Running Time: 48.595 milliseconds, this hour: 12.


PHP Source Code


<?php
/*------------------------------------------------------------*/
class Corona extends Mcontroller {
    
/*------------------------------------------------------------*/
    
protected $coronaUtils;
    protected 
$Mmemcache;
    
/*------------------------------*/
    
private $startTime;
    private 
$ttl;
    
/*------------------------------------------------------------*/
    
public function __construct() {
        
parent::__construct();
        
$this->coronaUtils = new CoronaUtils;
        
$this->Mmemcache = new Mmemcache;
        
$this->ttl 300;
    }
    
/*------------------------------------------------------------*/
    /*------------------------------------------------------------*/
    
protected function before() {
        
$this->startTime microtime(true);
        
ini_set('max_execution_time'10);
        
ini_set("memory_limit""30M");

        
$this->coronaUtils->prior($this->controller$this->action);
        
$this->cacheQps();
        
$this->Mview->assign(array(
            
'controller' => $this->controller,
            
'action' => $this->action,
        ));
        
$this->Mview->showTpl("head.tpl");
        
$this->Mview->showTpl("header.tpl");
    }
    
/*------------------------------*/
    
protected function after() {
        
$endTime microtime(true);
        
$time $endTime $this->startTime ;
        
$millis $time 1000;
        
$millis round($millis3);
        
$qpsString $this->qpsString();

        
$this->Mview->msg("Running Time: $millis milliseconds$qpsString.");
        
$a '<br /><br /><a name="viewSource"><h4>PHP Source Code</h4></a><br />';
        
$this->Mview->pushOutput($a);
        
$src highlight_file(__FILE__true);
        
$this->Mview->pushOutput($src);
        
$this->Mview->showTpl("footer.tpl");
        
$this->Mview->showTpl("foot.tpl");
    }
    
/*------------------------------------------------------------*/
    /*------------------------------------------------------------*/
    
public function index() {
        
$this->showBy();
    }
    
/*------------------------------------------------------------*/
    
public function showBy() {
        
$by = @$_REQUEST['by'];
        if ( ! 
$by )
            
$by "cases";
        
$rows $this->getRows();
        if ( ! 
$rows ) {
            
$this->Mview->msg("No Rows");
            return;
        }
        
$ucfirst ucfirst($by);
        
usort($rows, array($this"by$ucfirst"));
        
$totals = array(
            
'country' => "World",
            
'cases' => Mutils::arraySum($rows"cases"),
            
'dbyCases' => Mutils::arraySum($rows"dbyCases"),
            
'yesterday' => Mutils::arraySum($rows"yesterday"),
            
'today' => Mutils::arraySum($rows"today"),
            
'deaths' => Mutils::arraySum($rows"deaths"),
            
'dbyDeaths' => Mutils::arraySum($rows"dbyDeaths"),
            
'deathsYesterday' => Mutils::arraySum($rows"deathsYesterday"),
            
'testsYesterday' => Mutils::arraySum($rows"testsYesterday"),
            
'deathsToday' => Mutils::arraySum($rows"deathsToday"),
            
'recovered' => Mutils::arraySum($rows"recovered"),
            
'tests' => Mutils::arraySum($rows"tests"),
            
'yActive' => Mutils::arraySum($rows"yActive"),
            
'activeDelta' => Mutils::arraySum($rows"activeDelta"),
        );
        
$this->ammendRow($totals);
        
$totals['growth'] = ($totals['yesterday']/$totals['dbyCases']) * 100;
        
$totals['doubles'] = $this->doubles($totals['growth']);
        
$totals['deathsGrowth'] = ($totals['deathsYesterday']/$totals['dbyDeaths']) * 100;
        
$totals['deathsDoubles'] = $this->doubles($totals['deathsGrowth']);
        
$this->Mview->showTpl("corona.tpl", array(
            
'rows' => $rows,
            
'totals' => $totals,
            
'by' => $by,
            
'myCountry' => @$_COOKIE['myCountry'],
        ));
    }
    
/*------------------------------------------------------------*/
    
public function legend() {
        
$this->Mview->showTpl("legend.tpl");
    }
    
/*------------------------------------------------------------*/
    
public function myCountry() {
        
$country $_REQUEST['country'];
        
$this->Mview->setCookie("myCountry"$country);
        
$this->redirect("/");
    }
    
/*------------------------------------------------------------*/
    /*------------------------------------------------------------*/
    
private function getRows() {
        
$date date("Y-m-d");
        
$mkey "getRows-$date";
        
$rows $this->Mmemcache->get($mkey);
        if ( 
$rows )
            return(
$rows);
        
$sql "select * from covid19 where date = '$date'";
        
$rows $this->Mmodel->getRows($sql$this->ttl);
        
/*    $rows = $this->Mmodel->getRows($sql);    */
        
if ( ! $rows ) {
            return(
null);
        }
        
$this->ammendRows($rows);
        
$this->Mmemcache->set($mkey$rows$this->ttl);
        return(
$rows);
    }
    
/*------------------------------------------------------------*/
    
private function ammendRows(&$rows) {
        foreach ( 
$rows as $key => $row )
            
$this->ammendRow($rows[$key]);
    }
    
/*------------------------------*/
    
private function ammendRow(&$row) {
        
$dby date("Y-m-d"time() - 2*24*3600);
        
$yesterday date("Y-m-d"time() - 24*3600);
        
$country $row['country'];
        if ( 
$country != 'World' ) {
            
$row['dbyCases'] = $this->metric($country$dby'cases');
            
$row['yCases'] = $this->metric($country$yesterday'cases');
            
$row['yRecovered'] = $this->metric($country$yesterday'recovered');
            
$row['dbyRecovered'] = $this->metric($country$dby'recovered');
            
$row['dbyDeaths'] = $this->metric($country$dby'deaths');
            
$row['yDeaths']  = $this->metric($country$yesterday'deaths');
            
$row['yClosed'] = $row['yRecovered'] + $row['yDeaths'];
            
$row['dbyClosed'] = $row['dbyRecovered'] + $row['dbyDeaths'];
            
$row['dbyTests'] = $this->metric($country$dby'tests');
            
$row['yTests'] = $this->metric($country$yesterday'tests');

            
$row['yesterday'] = $row['yCases'] - $row['dbyCases'];
            
$row['growth'] = $row['dbyCases'] ? ($row['yesterday']/$row['dbyCases']) * 100 0;
            
$row['doubles'] = $this->doubles($row['growth']);
            
$row['today'] = $row['cases'] - $row['yCases'];
            
$row['closed'] = $row['recovered'] + $row['deaths'];
            
$row['active'] = $row['cases'] - $row['closed'];
            
$row['dbyActive'] = $row['dbyCases'] - $row['dbyClosed'];
            
$row['yActive'] = $row['yCases'] - $row['yClosed'];
            
$row['activeDelta'] = $row['yActive'] - $row['dbyActive'];
            
$row['deathsYesterday'] = $row['yDeaths']- $row['dbyDeaths'];
            
$row['testsYesterday'] = $row['yTests'] - $row['dbyTests'];
            
$row['deathsGrowth'] = $row['dbyDeaths'] ? ($row['deathsYesterday']/$row['dbyDeaths']) * 100 0;
            
$row['deathsDoubles'] = $this->doubles($row['deathsGrowth']);
            
$row['deathsToday'] = $row['deaths'] - $row['yDeaths'];
            
/*    Mview::print_r($row, "row", basename(__FILE__), __LINE__, null, false);    */
        
}

        
$row['closed'] = $row['recovered'] + $row['deaths'];
        
$row['active'] = $row['cases'] - $row['closed'];
        
$row['casesDeathRate'] =
            
$row['cases'] ?
                ( 
$row['deaths'] / $row['cases'] ) * 100
                
0;
        
$row['closedDeathRate'] =
            
$row['closed'] ?
                ( 
$row['deaths'] / $row['closed'] ) * 100
                
0;
        
$population $this->population($row['country']);
        if ( 
$population ) {
            
$row['population'] = $population ;
            
$row['casesRate'] = 
                ( 
$row['cases'] / $population ) * 100 ;
            
$row['activeRate'] = 
                ( 
$row['active'] / $population ) * 100 ;
            
$row['populationDeathRate'] =
                ( 
$row['deaths'] / $population ) * 100 ;
            
$row['testRate'] = 
                ( 
$row['tests'] / $population ) * 100 ;
        } else {
            
$row['population'] = ;
            
$row['populationDeathRate'] = 0;
            
$row['casesRate'] = 0;
            
$row['activeRate'] = 0;
            
$row['testRate'] = 0;
        }
    }
    
/*------------------------------------------------------------*/
    // sort functions = /showBy?by=funcName
    /*------------------------------*/
    
private function cmp($a$b) {
        return(
$a $b : ( $a $b ? -) );
    }
    
/*------------------------------*/
    /*------------------------------*/
    
private function byCountry($b$a) {
        return(
strcmp($a['country'], $b['country']));
    }
    
/*------------------------------*/
    
private function byCases($b$a) {
        return(
$this->cmp($a['cases'], $b['cases']));
    }
    
/*------------------------------*/
    
private function byYesterday($b$a) {
        return(
$this->cmp($a['yesterday'], $b['yesterday']));
    }
    
/*------------------------------*/
    
private function byGrowth($b$a) {
        return(
$this->cmp($a['growth'], $b['growth']));
    }
    
/*------------------------------*/
    
private function byToday($b$a) {
        return(
$this->cmp($a['today'], $b['today']));
    }
    
/*------------------------------*/
    
private function byDeaths($b$a) {
        return(
$this->cmp($a['deaths'], $b['deaths']));
    }
    
/*------------------------------*/
    
private function byDeathsYesterday($b$a) {
        return(
$this->cmp($a['deathsYesterday'], $b['deathsYesterday']));
    }
    
/*------------------------------*/
    
private function byTestsYesterday($b$a) {
        return(
$this->cmp($a['testsYesterday'], $b['testsYesterday']));
    }
    
/*------------------------------*/
    
private function byDeathsGrowth($b$a) {
        return(
$this->cmp($a['deathsGrowth'], $b['deathsGrowth']));
    }
    
/*------------------------------*/
    
private function byDeathsToday($b$a) {
        return(
$this->cmp($a['deathsToday'], $b['deathsToday']));
    }
    
/*------------------------------*/
    
private function byRecovered($b$a) {
        return(
$this->cmp($a['recovered'], $b['recovered']));
    }
    
/*------------------------------*/
    
private function byActive($b$a) {
        return(
$this->cmp($a['active'], $b['active']));
    }
    
/*------------------------------*/
    
private function byActiveDelta($b$a) {
        return(
$this->cmp($a['activeDelta'], $b['activeDelta']));
    }
    
/*------------------------------*/
    
private function byYactive($b$a) {
        return(
$this->cmp($a['yActive'], $b['yActive']));
    }
    
/*------------------------------*/
    
private function byCasesRate($b$a) {
        return(
$this->cmp($a['casesRate'], $b['casesRate']));
    }
    
/*------------------------------*/
    
private function byActiveRate($b$a) {
        return(
$this->cmp($a['activeRate'], $b['activeRate']));
    }
    
/*------------------------------*/
    
private function byClosed($b$a) {
        return(
$this->cmp($a['closed'], $b['closed']));
    }
    
/*------------------------------*/
    
private function byPopulation($b$a) {
        return(
$this->cmp($a['population'], $b['population']));
    }
    
/*------------------------------*/
    
private function byCasesDeathRate($b$a) {
        return(
$this->cmp($a['casesDeathRate'], $b['casesDeathRate']));
    }
    
/*------------------------------*/
    
private function byClosedDeathRate($b$a) {
        return(
$this->cmp($a['closedDeathRate'], $b['closedDeathRate']));
    }
    
/*------------------------------*/
    
private function byTestRate($b$a) {
        return(
$this->cmp($a['testRate'], $b['testRate']));
    }
    
/*------------------------------*/
    
private function byTests($b$a) {
        return(
$this->cmp($a['tests'], $b['tests']));
    }
    
/*------------------------------*/
    
private function byPopulationDeathRate($b$a) {
        return(
$this->cmp($a['populationDeathRate'], $b['populationDeathRate']));
    }
    
/*------------------------------------------------------------*/
    
private function population($country) {
        if ( 
$country == 'World' )
            return(
$this->worldPopulation());
        
$sql "select population from populations where country = '$country'";
        
$population $this->Mmodel->getInt($sql$this->ttl);
        if ( ! 
$population ) {
            
error_log("population: missing: $country");
            return(
null);
        }
        return(
$population);
    }
    
/*------------------------------------------------------------*/
    
private function qpsKeys() {
        return(array(
            array(
                
'title' => 'this second',
                
'key' => "qps-".date("Y-m-d H:i:s"),
                
'ttl' => 3,
            ),
            array(
                
'title' => 'this minute',
                
'key' => "qpm-".date("Y-m-d H:i"),
                
'ttl' => 70,
            ),
            array(
                
'title' => 'this hour',
                
'key' => "qph-".date("Y-m-d H"),
                
'ttl' => 3700,
            ),
            array(
                
'title' => 'today',
                
'key' => "qpd-".date("Y-m-d"),
                
'ttl' => 25*3600,
            ),
        ));
    }
    
/*------------------------------*/
    
private function cacheQps() {
        foreach ( 
$this->qpsKeys() as $key )
            
$this->Mmemcache->increment($key['key'], $key['ttl']);
    }
    
/*------------------------------*/
    
private function qpsString() {
        
$min 3;
        foreach ( 
$this->qpsKeys() as $key ) {
            
$cnt $this->Mmemcache->rawGet($key['key']);
            if ( 
$cnt $min ) {
                
$title $key['title'];
                return(
", $title$cnt");
            }
        }
        return(
"");
    }
    
/*------------------------------------------------------------*/
    
private function worldPopulation() {
        
$key "worldPopulation";
        
$worldPopulation $this->Mmemcache->get($key);
        if ( 
$worldPopulation )
            return(
$worldPopulation);
        
$worldPopulation $this->scrapeWorldPopulation();
        
$this->Mmemcache->set($key$worldPopulation900);
        return(
$worldPopulation);
    }
    
/*------------------------------------------------------------*/
    
private function scrapeWorldPopulation() {
        return(
7.8*1000*1000*1000);
    }
    
/*------------------------------------------------------------*/
    
private function metric($country$date$metric) {
        static 
$cache = array();
        if ( ! @
$cache[$date] ) {
            
$sql "select * from covid19 where date = '$date'";
            
$rows $this->Mmodel->getRows($sql$this->ttl);
            
$indexed Mutils::reindexBy($rows'country');
            
$cache[$date] = $indexed;
        }
        
$metric = @$cache[$date][$country][$metric];
        if ( ! 
$metric ) {
            
/*    error_log("metric($country, $date, $metric) - missing");    */
            
return(0);
        }
        return(
$metric);
    }
    
/*------------------------------------------------------------*/
    
private function doubles($growth) {
        if ( 
$growth == )
            return(
0);
        if ( 
$growth 100 )
            return(
0);
        
$base $growth/100;
        if ( 
$base <= 1.0 )
            return(
0);
        
$numdays 1;
        
$double $base;
        while ( 
$double ) {
            
$double $double $base;
            
$numdays++;
        }
        return(
$numdays);
    }
    
/*------------------------------------------------------------*/
}


© Ohad Aloni 2020