From aed4b385ddf316b7b5e6e4e27abe66b4ebbed39d Mon Sep 17 00:00:00 2001 From: antux18 Date: Fri, 1 Sep 2023 19:00:27 -0400 Subject: [PATCH] Suppression des codes QR. Ajout de commentaires. Corrections mineures du code. --- answer.php | 2 +- article.php | 8 ++++++-- data/teams.db | Bin 28672 -> 45056 bytes images/qr/qr1.gif | Bin 740 -> 0 bytes images/qr/qr10.gif | Bin 740 -> 0 bytes images/qr/qr11.gif | Bin 755 -> 0 bytes images/qr/qr12.gif | Bin 731 -> 0 bytes images/qr/qr13.gif | Bin 737 -> 0 bytes images/qr/qr2.gif | Bin 738 -> 0 bytes images/qr/qr3.gif | Bin 750 -> 0 bytes images/qr/qr4.gif | Bin 751 -> 0 bytes images/qr/qr5.gif | Bin 735 -> 0 bytes images/qr/qr6.gif | Bin 741 -> 0 bytes images/qr/qr7.gif | Bin 747 -> 0 bytes images/qr/qr8.gif | Bin 743 -> 0 bytes images/qr/qr9.gif | Bin 745 -> 0 bytes index.php | 13 ++++++++----- puzzles.php | 4 +++- require/base.php | 1 + require/database.php | 30 ++++++++++++++++++++---------- 20 files changed, 39 insertions(+), 19 deletions(-) delete mode 100644 images/qr/qr1.gif delete mode 100644 images/qr/qr10.gif delete mode 100644 images/qr/qr11.gif delete mode 100644 images/qr/qr12.gif delete mode 100644 images/qr/qr13.gif delete mode 100644 images/qr/qr2.gif delete mode 100644 images/qr/qr3.gif delete mode 100644 images/qr/qr4.gif delete mode 100644 images/qr/qr5.gif delete mode 100644 images/qr/qr6.gif delete mode 100644 images/qr/qr7.gif delete mode 100644 images/qr/qr8.gif delete mode 100644 images/qr/qr9.gif diff --git a/answer.php b/answer.php index 86a4263..00aab09 100644 --- a/answer.php +++ b/answer.php @@ -16,7 +16,7 @@ $stmt->execute(); // Vérification de l'existence du groupe : - if (!empty($stmt->fetchAll())) { + if (!empty($stmt->fetch())) { $art_id = htmlspecialchars($_GET["id"]); // Recherche de l'énigme avec son code : diff --git a/article.php b/article.php index b680f0e..f1c9ba6 100644 --- a/article.php +++ b/article.php @@ -11,22 +11,26 @@ if (isset($_GET["id"]) && isset($_GET["team"])) { $art_id = htmlspecialchars($_GET["id"]); $team_id = htmlspecialchars($_GET["team"]); + + // Recherche de l'énigme indiquée dans la base : $stmt = $database->pdo_article->prepare("SELECT * FROM puzzles WHERE id == :id"); $stmt->bindValue(":id", $art_id); $stmt->execute(); $article = $stmt->fetch(); - // Vérification de l'existence du groupe et de l'énigme : + // Recherche de l'équipe dans la base : $stmt = $database->pdo_teams->prepare("SELECT * FROM teams WHERE id == :id"); $stmt->bindValue(":id", $team_id); $stmt->execute(); - if (empty($article) || empty($stmt->fetchAll())) { + // Vérification de l'existence du groupe et de l'énigme : + if (empty($article) || empty($stmt->fetch())) { header("Location: index.php"); die(); } else { + // On vérifie si l'énigme est résolue : $stmt = $database->pdo_teams->prepare("SELECT * FROM solved WHERE (team_id == :team_id AND puzzle_id == :puzzle_id)"); $stmt->bindValue(":team_id", $team_id); $stmt->bindValue(":puzzle_id", $art_id); diff --git a/data/teams.db b/data/teams.db index 2f2a624a99664b289dae6fe71f9c318032e6cf68..82b9f181c0e6401eda49c800c67b2070289ea4ce 100644 GIT binary patch literal 45056 zcmeI4dyFK-eaB~}=h0RD+P&SqWx3bv9(T9PvG<01T3Ljhr}=g-m2Sv4WM5IFSem!IGVa z^R3={gbM*Fa{j=oJhb&i>Qhy}s_NEld|Pn*{9^Uk>9Z#fpRaDu4dn9q+<|H} zm&Io-y-{`nFSM%U90b&fy(HL6?wVg z{NW=f7EdmoJhFK9+@&v47n~)$ny^~Hs}q-UC#sW_Oq@D=a&dwr{9sZIBYe^zxCzE}s?)a&r ziw~W<{{*hIhYnvje>#&7WxYAHHTx>h8s*WA8}q#kz@@6^7Vp2Xc65fFIyRPSo-~Y>( z3+r;;tKN6L7rn1}U-mxdead^<`>^+jch)=Z9r9wY>Fx2Ry>V~EqwasYuemR~FS>u? z{*L>b?$hpv-ACLr?h!Y28}4rRMz`uNbBoUF&MV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C2r{L&`HIqNKf!F1wnx28~q&`D)x4RXY;|4EO;{ZA?h3 zZVKvV1?{FU)|n3Q!S2GQijB#|($=PmbtysB9)zHa-FfE#LI0TualDxh8A8BHV!|D! zmKu@UbRe(H z)G&_(Yb)JU{r&&7?)5qEpS+iG|NkTJ3*M)_U-h2!9`nw4i(cya-mTsyZ?)%m1@{g2 z@7?dZfA0Q)`+4_S_bK=1-3Q(K+&kUd+ym}5cRkeTA5B0L&;&FAO+XXS1T+CnKoige zG=X;=0n(qs^>P81+NeePlSud2T)ME<>TkehcRs+=gidt5+h32n_`Hv2!?f=HnF{T%RC=<~G1^~oMZnv~>#qnQ?T=j%dS?GR+|lQv zR#0~Pqp&u|7OGA4gfHFi^q1r50bV*Jc diff --git a/images/qr/qr1.gif b/images/qr/qr1.gif deleted file mode 100644 index ce94f54665d2b867090c00850d04631de52bcffe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 740 zcmV9>f*4(%3eC(Q|bg{*=G7a<5;1<&r137IjAj z=T=B~_s1B)=CcKOxQJ&tsgrr>5NTM)3A%~6=@?3CX^L8@;HiljnE0vK*k}7F2|I>6 zO9|>K%lpa-d7CpjLlTOq&2ck6$b;e?N|F!QQh$p{}*tb;@1BPQDDXi^Gp$#C-+-Z6ipq3cZK_`ZRiZ z<1t=6V<9IZDoM^9$&wjas(dFdBnv+4X4>>u^QO*^I&bo{*-<3UWBmX^OgVDmIf?`O z1y%Yf-B6lHIW~;i4XVjlNJ!ZGnL(r1t2s4@9r2Y8hqEHmmOZ+Z?bNIl-=6FRrD-d& z8$sf2qId3Iy9(o032ZbQ#*1_nH!ibva8;>b6Bm7aumLcEj1ex*{H$_krf7v4hM9Eo zho?kS8`ams^xxOABZsZs+A3<@3sY>yZ5i~6-@9RtWGUu5yWl;?+~^(i(eK^WuBI-rch~b{Z6iK!inCex+2t3taopBQ>tL5$ zf$qg;opO97n4o@wK{KFG+~tQAg7^Vf-G$dx*dK$Vi8hai0SSm6Uk*}8n1%UBNFQAW z+Lz&q(6t!fi`&HrVTl`R<)3X1PH0hxINrzHgQr=upn60aIU9`+F8SkeN=hl&iTo`Y zSd>DlxE^G6-MD3kUQ&gnlVw)vl8g%a$RT+iiO3s!TIML%k~W!La`GuI~L zXU1drMyHn-2bYMrK-d>3`C!@en90YPuu0kJ7$F+N_z9?5x`x~; zTDyD6ItT3AC=5#L8vHs;yK6j3Oqv=^olG73jQToF$erssh}+w}T`s+Rta}S*O@97f z{SB+BepesPe(zjd2aavNMIS&X^RkF5Xi6YFf=~`N^tY~yHhAu8NmOX@BCn1A-ZWzL zSTQ6>h^#zz$9GQJaLT znnjv@L2S%t}cN@KDpk#jqSe}KjN$B1^xFP4*f}ZU(qF^P;10ZA~ z#>5(hsXf@6Y3Rv#7-%_a$liw;{`R7PXD#RBbNoTqn2HLrSmS?9>gXhW^AR~3j6-=C zC6CihmLHT8&KMn!yj@8pnf_fi*M`6qnIf8jsR^Qky|{QDoIeuSA$#1}w`OnZ9S3Nj Wf(}Y(p@trcXrhWP%4nbk002AFgk^aE diff --git a/images/qr/qr11.gif b/images/qr/qr11.gif deleted file mode 100644 index 3b0f756acd37ed9cc583058876d88e4b481652c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 755 zcmVDo()i`se%45|FI__}n>$>~dr6!Oi!9pA{d^tzYv|3q{fI6rZQk{r z{^~%D92m_9Exg;kFWw(Mtr{44g0L9_ly4jcb?pw~8^>x6L3axY($i+p-zqNu!4$6J zcy1m@eefWT%vkWGKxr32Zai5MqfC|mShSqTV#H09Idvv{*R#aVnkz0^`v;DWQHS@y z9TgRmA;6~Fo|gM4btx^NTO&T4i4!3gipQ$ByZ3U+f}u{!N1K1+0 zX|O1zY)(v?tVqIN^_I5%dUS4!Rrz^+9aHw#xU*xgRsH*FSJfz7A8#Ex=<>apJ@YK8 z`8m?)(w&RlZk_0Nnvsc1zAl(1>-ECl`p#Q6a_|r8`^MJ}oU-_o`5kA(PhSyj0h*=X zfc?Sd9bo&l$J~3BSz=XVtHJeIVNAsXU3dw~$4`W)-8UUM<28uaY1NUoA&9Vf=#_ab zR=6T)v}skFT21l1@r#rIucbX-@?J06VumbKU>| diff --git a/images/qr/qr12.gif b/images/qr/qr12.gif deleted file mode 100644 index e407b361c97c25e72f4639837485a3578f0a0a31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 731 zcmV<10wn!MNk%w1VPpVg0FeLy00030|Nj6000000A^8LW00062EC2ui0Av7U00092 zjE||y?GK}zwAzca-n{z{hT=$;=82~23Igs6$MQ_U%#7#ur1v!cy7`8#8gXbWE{;eb zQwKzsn@d|wcn$Xqt8I-vow~dlZp^LgogMAQJvsX3 zZacmmNzX|xYlxp`am*fW>RtnX1NGS>*3Tfig!O!B<7bZww0ZF)ek*8kV#RX*85=U| zhzcP^kOY5a6uFV4Ko%&Kv0ULu;mZ;+J>FUXIsG#J>mH5NzkEg4 zy>lr|pwOT^!AVtja3~;ZPi`ZT-t9L}^?)%IlC#3?~} zVpH;^8_S$st8p~~jw)Cu)uv+;BNe8suUx{#%t{`dlp|xdQ6WNfe0MM0hqWSC9Sbz8 z2)B7N<0UGN1M8o6VISREw>50rP&LfPx;u1lmaKy>etnZPWxc0w7O$<gVt1)MBQ{SqgxKrv4Nq*5-ujsJ`Q7iV+YjG-Uq7*r4B|jD~m(euA@#f8(I$7}SSudrxhcgAvJ4aC?z@n-o zvTO=-qeY_;`Pr=cawt|;R;TXE>g%e~qaQ*tBMbGc2(w|mj(z8WZCbR*)P|5owJu$P zeC0T^Yga78zgz{oZMfxU1-x^&!u`mN13Iu@fyN{pl&N0Jljn)mO0#ojhd7fWek}Lx zV$(@Mr~XWovT9yYPp=m086j=iuy;nzosuz7#UX|FB+mMn<;<@`nUT4aBW>e}S4Owj zRXI`U+p%B7oR51|>AIcA_Ulnf-?eT5S62pJa{Ig{CuVFhzj63o@i&mN$9)-q{n$4J zSM>=vSa1Z2mQYLG0QVqs3!3NHfEgjD;Dt*d1)oz9?w8?*9GXHGbpfi>UxnyQci4pY z8R(#GCR&K%iHZP{rC z8kJFEnOASBY1v~%Qo>l}bJjt~<9i}@=MtK3j+Y{2ZI1RPh-<<*Cy`7#soipZ{t0NH Tf(}Y(p@trcXrhV^S^xk$m;_~W diff --git a/images/qr/qr2.gif b/images/qr/qr2.gif deleted file mode 100644 index 641a951d8b10cad04ca29306c85d7db77ad903e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 738 zcmV<80v-KFNk%w1VPpVg0FeLy00030|Nj6000000A^8LW00062EC2ui0Av7U00092 zjE||y?GK}zwAzca-n{z{hT=$;=82~23Igs6$MOu#F=FRBK<)nh@Zo;M9`RS(4UftR zQy6R-p3(>mb3J4&+e$a-!oHTg%hx$Zht26}+xs@IC1?7(ZjGzU_IUv6<_888$oE%; z$Iu0MC>SL}MrISaCrP8F=P-%s$C$XVh?v>1S!fB#X*hUF*r*D6sSv6|*=OiE%BpxL z>Zr*}n>vU$n^T+D+50LRn^0WpDtD`_3!8jxEL@oi{XAOC3cg*~4cvO{jcPjXT8>R@ z9v;swy{jIr&6R7tjNI=&&6mG=Yy<*4M$ncRgU!V06KIc0!+Gn-N&Lj@;ys7|_$+Gd z7x5!Dbml~Yhy z8C|8cV8E$Oi()*=@aDsySz!+SnF3zdt5sc!Fz$FYO~eBzw)%ICE9M{Uc-IK);&CxQN+oCml6)F^RZ9IK=CrcyLm0;uZ8^<4Q)7N zGp3iVuKpm|=~cOJVOL>ITJ~!Xv0XDpni=P4tbk8z7Je2tWZ}ez)9uXMsq)#PQMP2) zJ8|u=DY4(iT;1-)gxb?)SN)NE_VdRTKGthG1Lx-N=Z1%qx_w^z`L|lLhAv)7_o+t> zc#CBd;C9OySX_AkJ@{R22{!l{gQd;a7;s0FcHw;)A~qa)k?oe$gk_yrnT1kuD4l*Y zIXIwh!59Z1WFLa%T!D6l=wgc!!iZRKPxVOSf+osn9$!lKx8ICSCiz>GIQm$kkye66 zPnI?E_#=5<5;6ZzpxbO*iioa(64mB1d z=#d;ddmbN!9Jw)GNnjyGawMsdMK*GuWS)Qt(WVES7BN%d^wgkzdkgNji7%zP>MqMln=w=iok*uN$4zCt2gSWlOis z8>((wEo*Pzi<>DG*O0%`3qRY5_u*G_LXS!Q@$>V?m51dD+-m*#i}k0!1Lnf5VuSASSCxl30(B#b4K+Ajbu@}-;fz`F$liVd`3D|?GG-^>i$EH= zqn+&w)o_c;xV?On*XWRQjlTF7ebzJ+Sz7) g@WmKsme(DMXrhWP%4nmGJ_>21l1@r#2L%8CJ5=d&3IG5A diff --git a/images/qr/qr4.gif b/images/qr/qr4.gif deleted file mode 100644 index 8b08ce48b4a2fce0cb9ba2698706a3bb3786869a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 751 zcmVGSzi)?eIE=ou9rFnL-MGgsb?knP*BA9CNQVcZ zw{zttvk0d)HK>Ld$o1$K<5*VNBbn9&b;+3NS^5~d`A11;nK~(%s2M3Lk%(%0XzB`@ zwcEwoN$Xk{3)@?mfZM2xD$A*;y9(K={3={sT>E^Rd)@7Odi;&ayDaRi%1k{zT26Yd zp6(qCZnrHiUr&5*UN8N{E?hrkuS zw#1f{TfUu(K9M*pPpgqzovvI$H>cdT z$fO?0>vm{ev_&1heQA;AU3y#(o6SI#Fk-_nC-WH`Q7=WujrH}yv^KL+(VZjj9es6i z;DSv1&MoVAtY@!}L&~;m1*U4W{;=Z=xAUT2&YB7u|vZx~JiBT8&5&dLcF^-i8cjs10o_ z38$ZnpPfigee*>%V~dLURbg@}u4Wg71f~d;WItdbP56Re)kgYK} z<&te#Ih$(zb(p1nv~9Ltlgo{Hq>g5q8Cr$dskwoa21l1@r#rI8i@06R)OYJ~s* diff --git a/images/qr/qr5.gif b/images/qr/qr5.gif deleted file mode 100644 index 091b18e4090e98e498d4d6edefce185cb7446844..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 735 zcmV<50wDcINk%w1VPpVg0FeLy00030|Nj6000000A^8LW00062EC2ui0Av7U00092 zjE||y?GK}zwAzca-n{z{hT=$;=82~23Igs6$MTHKK>afI&filHjNxQMpCX7fMv}oI ztf*u5DAMV{23=Hn)ZFEH^%}rqae!PwL)1Sr`t3G%U2|nUTc(Hgd3&3`B=@HT2UzGQ z!RBy?wTF0Sbri?tc<0#I7ey&)7zqiuHo1eB0HjIiso20sQ>o=iYU-LOiusA!3Hq8l zIvdDqdq{ff)S5Y1Oyn#4z^Z&q3v7HFE69o43;l~7Y)$Q3z4;x@J*~=ooh$_2Tx;%) zUh4ilzO5b~{^-1}9jZ%C?2;%9ssdU#HxC;@ZwAxAOE?Uf#Dfo|@mlzA)s}Am7ng0E z=I>*?ks|qRE2+?<#gBDR=F8`j#V#o_S8S}Q;wDZMI(KU0m`$EIgexue*+(>JQgude zA+4wsD$|Kh6D9@P&{oTL8DYW_C~hmgf-0NLltpnU!?I|FnoS$EE8DL}>1qr+GbGtX zQU__x+m2q-hCBGuvu~y%z`yT4c+$M zO|Xt{u9F?-0XRA3?sTdDtW%+wMpXJY3u_{g$8qWuR`-+aHCnq+ga;{Q;Pq zN$#CRU4aKOr`C1+wN)Hrs=?>bXxc4U4}{%SmS9z-NqC`t3?>%fdKLCZl6tVocjAO8 zjkr{F{vqaKeFeTZV16s5_+p05E!Sd*6!JI~dpe>hqK`xVh#`(xl?Y>B8Z>F#YQljC z(2?Tp<{FmvXnEd>8v?oIe_?V-=9v#}0i2pAq}QXF&ZXC;k<*b^Cz{CZ$!DK_{t0NH Rf(}Y(p@trcs0IZ906XlWWySyi diff --git a/images/qr/qr6.gif b/images/qr/qr6.gif deleted file mode 100644 index ccbf6f33c6e99fb0e59f45366445d165f2f3f08d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 741 zcmVOr(sw%3CMW(Nx8Af7wUQ0nI?m2843E>*ZP_ny2+Y|ig+ri zs~U3)JXs2xKq_bIYnzHVOxtzaEQ{+pEgdb|MtvRJ+l|b8Ow3&yPCc#+zPhYf&FPK) z9iJOtiOqgx4!Ky5zyG)HiJv}u0=)%%AkJ66b_=6WQTHxix`+OFn!XqkMZgl5T1(TR8X3~r(Z5*^?1&cXbnKLAU_Q7Gc6mNHr|IF;rP%X9Btd&K_A9lQ&p(WvF@dZaQnYhSh`Aq#eD(s5Uck>4s^%#QPA33ZcJ_^NHP zX^|b*oJ@@swY9@eWvBdnm9OU0uV=^Zt-JNjre<@et*JV5@Zpkwvt`ZP^IYYKN1;q^ zJn%%o*9imHyPbA;%eaw(f64v2bk?QMOF#S6E3Xd6iO0X@eqckmcdH+N=)ray zeFWNuU}MYGHXn4^;YDC#^7*z}gAp>g)`I3KSRH8xYV_V?!u@w2hod!DV2B=42#<<$ z6(-(v!k7r)W`4z}Tv_pfHdu=%8ulEBBKlb4fI%KPqJ_KVNaK$7^(bVK@bNe!lKZ)~ z8;lTAhFO>8p=jHcyk&XgmZnv9QHL_3b>WKYRp}j<8!ic_XcMi6-JNlb1Sg)(X&7Cg Xf(}Y(p@trcXrhWP%4nk?6aWA_J0xq5 diff --git a/images/qr/qr7.gif b/images/qr/qr7.gif deleted file mode 100644 index 8fdbcda559f8a09c220a3e595058f258f237b78b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 747 zcmVmb3J4gwk7YfwZ5=pZJA3myU1(jxe^Y0<8NbIB6r^d`Dxm}XZMBo1_d~n z(4~e*r{g6!_s3Va*vME|)z@IDc*xK>xyLD~`HAVcXe#rVT1iUjFuK|r3!8YF!%8Tc zX{)=53tGA$3*;FUNF4l{T+54k?2M>-2^~6(T%AjMEsPsE8!h&{EpB-Idp?Xt?%mF; z4Q`CCr|oVJpWfRH%%8-6?-!(cY_J`&B#@v&3z`CQ8@S8hIEfC$L7Ye>96fXY%QE^> z=20U;ZXqT8EBTFN$B=?h##8yOB#VOUX0iZfGp8$mI#=M#Ig%s5DkrHG)JKlmPiaQM zq!db#Xtt&dpKiP=uVzAvPK$ty%9CqEno`AL{d%-360~fYswHb}>sfXZi`H|g^R!i4`$}8-c(P`waOVj=Y8$(KriL06PDa)mE6bC6k_m0kF!3c-t9xfT(3NBN6mAvaesb_LRv*n_Hxm|bqv z5t!kJ%MtdXirG;JmW3l`R#kCaBa%0=I3$p~9l0WWR-J~TEu_I% zV~_&2IG=o6R;i_qUrzLyc>mc*q?c*Bccx)xdXyYzY$6CIOTER}TwK|>gr|uBVsxII dg626KbA}#@XrhWP%4nmGJ_>21k~UfZ06X=Ba5n$| diff --git a/images/qr/qr8.gif b/images/qr/qr8.gif deleted file mode 100644 index 6c4c54ac00fb7118524391bd925a19890237e944..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 743 zcmVANk%w1VPpVg0FeLy00030|Nj6000000A^8LW00062EC2ui0Av7U00092 zjE||y?GK}zwAzca-n{z{hT=$;=82~23Igs6$MTH8HNDLGZcqG=GxUVP1n~HxAdxp$ zGsajRmD1nyIW$&zROcmo^(DV!30Uk^oE_^(J6f)^-??}faL3H;4?3IwmlgmNrd9+e zNO<6(+PD_O^rOiaBB40ihD0I%^Ny4W@pe2N^B1+Gq$0gsG zO>Dpj=9Z?GSmM<8FJl#|B%eOa%5Un@s#r^=b4igbO0;H=vaPqX=Gm31*ml%vZs9(- zHoa1di|=GMqbR@D{dke2-CvAVCMGO*pt+Hc1qaqR88O7Y8#06R3-)f?gKs&frRl*l z>ay!Xa!~zLw9IXN$4X}UK}uoUq@8xgeL3Y%-MN8_v0W#=da1bgN%YF}9mR)$1g=biX?!>0qc~Bw8;aVC-h+T*h z-ZtW33c5&Efz+LrpMfl{rs9O+Ef?C0G{OjE2U5A!7>^Z(aO8zf&iI= Z+6_u*p@trcXrhWP%4nmGK3Zr206QZfWc2_5 diff --git a/images/qr/qr9.gif b/images/qr/qr9.gif deleted file mode 100644 index 0f00f56fa90d6cb87448c2e12bb35c7ce7d1f7a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 745 zcmV1rT6sW!}*2)9&sqlC6CGp zGYIT0pE9Eh14Cq^S8nmLm4qwfvG$e3qMd6?xt%Z{LY|px0#J=OuWy zGY9A(XoL7wSEaZY07bai(D-vn`6tNKSS&+8MZ+dO8Yf<(dd<2zN;8NE-W? zOUuW43)EEvs)|y80gekKZ{r&Ag}ycLJx_mLE-;nn-V>Kba;) z8eQs4BU7SE^C6vy)MM48HVt}}%FkuFuUw<5Oqfz=CT&;9#c44hKKg+(TI`Tf#w%hi}O?5Xkn73EYq#gRE%j2Afw#La^vh(NYqPw0x zIbu;0HT_yo4!!rw%W;QGyS@!&cHw`|6IW0E9{B2uM=z}=cSGgJjoanA*RbDSIN{YE zfX$V4pFIC%Al7!41&2|3=+PA6gA@X{nRF0h_?vtj@@Ch74tB^MatAh87=Om;W}k$m zX_z5n0dA;WTkpwu;CC3R=pKuyc~~QRuOS#>edw5IV_-$1=HiGTTF4_}O2&vJZd=V$ z*^E#M=p$rOwMgBP7HUc6U|2dBWte1`$!3aN+7*+CvvoHioh3Ti-Hjp1iDRDP?Rg}g bHDO0+p@trcXrhWP%4nmGJ__kj1poj$dmd@k diff --git a/index.php b/index.php index ba05edf..6d78f9c 100644 --- a/index.php +++ b/index.php @@ -1,16 +1,19 @@ pdo_teams->prepare("SELECT * FROM teams"); - $stmt->execute(); - $teams = $stmt->fetchAll(); + // Sinon, on affiche la liste des équipes : + else { + $database = new Database(); + $stmt = $database->pdo_teams->prepare("SELECT * FROM teams"); + $stmt->execute(); + $teams = $stmt->fetchAll(); + } ?> diff --git a/puzzles.php b/puzzles.php index d17ec2e..e572353 100644 --- a/puzzles.php +++ b/puzzles.php @@ -18,6 +18,7 @@ header("Location: index.php"); die(); } + else { // On crée un cookie pour enregistrer l'équipe sélectionnée si ce n'est pas fait : if (!isset($_COOKIE["team"])) { @@ -37,11 +38,12 @@ $stmt->bindValue(":id", $team_id); $stmt->execute(); - // Si c'est le cas, on affiche toutes les énigmes, sinon, on cache la bonus : + // Si c'est le cas, on affiche toutes les énigmes : if ($stmt->fetchAll()[0][1] == 1) { $stmt = $database->pdo_article->prepare("SELECT * FROM puzzles"); } + // Sinon, on cache la bonus : else { $stmt = $database->pdo_article->prepare("SELECT * FROM puzzles WHERE id <> 13"); } diff --git a/require/base.php b/require/base.php index fe654d5..7c2d9d7 100644 --- a/require/base.php +++ b/require/base.php @@ -10,6 +10,7 @@ $lg = "en"; } } + else { if (isset($_COOKIE["language"])) { if (htmlspecialchars($_COOKIE["language"]) == "en") { diff --git a/require/database.php b/require/database.php index 24ab06c..7c1d848 100644 --- a/require/database.php +++ b/require/database.php @@ -6,20 +6,25 @@ public function __construct() { $data_path = "/../data/"; try { + // Création des bases de données + // Base des énigmes : $this->pdo_article = new PDO("sqlite:" . dirname(__FILE__) . $data_path . "article.db"); $this->pdo_article->query('CREATE TABLE IF NOT EXISTS "puzzles" ( "id" INTEGER NOT NULL UNIQUE, + "title" TEXT NOT NULL, "text" TEXT NOT NULL, "hint" TEXT, - "infos" TEXT NOT NULL, - "place" TEXT NOT NULL, + "answer" TEXT NOT NULL, + "location" TEXT NOT NULL, "code" TEXT NOT NULL, PRIMARY KEY("id" AUTOINCREMENT) )'); + // Base des équipes : $this->pdo_teams = new PDO("sqlite:" . dirname(__FILE__) . $data_path . "teams.db"); $this->pdo_teams->query('CREATE TABLE IF NOT EXISTS "teams" ( "id" INTEGER NOT NULL UNIQUE, + "bonus" INTEGER NOT NULL, PRIMARY KEY("id" AUTOINCREMENT) )'); @@ -27,6 +32,11 @@ "puzzle_id" INTEGER NOT NULL, "team_id" INTEGER NOT NULL )'); + + $this->pdo_teams->query('CREATE TABLE IF NOT EXISTS "members" ( + "name" TEXT NOT NULL, + "team_id" INTEGER NOT NULL + )'); } catch (PDOException $exception) { @@ -35,14 +45,14 @@ } } - public function getArticleNb() { - $query = $this->pdo_article->query("SELECT COUNT(*) FROM puzzles"); - return $query->fetch()["COUNT(*)"]; - } + // public function getArticleNb() { + // $query = $this->pdo_article->query("SELECT COUNT(*) FROM puzzles"); + // return $query->fetch()["COUNT(*)"]; + // } - public function getTeamsNb() { - $query = $this->pdo_teams->query("SELECT COUNT(*) FROM teams"); - return $query->fetch()["COUNT(*)"]; - } + // public function getTeamsNb() { + // $query = $this->pdo_teams->query("SELECT COUNT(*) FROM teams"); + // return $query->fetch()["COUNT(*)"]; + // } } ?> \ No newline at end of file