PageRenderTime 54ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/kitchen/adhesion.php

https://gitlab.com/radicalcinema/AnarchistNewsroom
PHP | 369 lines | 342 code | 24 blank | 3 comment | 19 complexity | 4a669ecad3734b5ed9b6a6eeb925ec76 MD5 | raw file
  1. <?php
  2. $private="yes"; // accès réservé
  3. $private_rule="waiting"; // Page privée mais accessible aux statut user = waiting
  4. include("inc/variables.php");
  5. require("inc/login.php"); // Contrôle d'identité :-/
  6. if($lang=="fr"){
  7. $title_page="Adhesion";
  8. }else{
  9. $title_page="Subscription";
  10. }
  11. include("inc/template_top.php"); // template
  12. ?>
  13. <?php
  14. /////////////// Suppression de ligne
  15. if(isset($_GET['del'])) {
  16. $del=$_GET['del'];
  17. $sql = mysql_query("SELECT * FROM ".$prefix."cotisations WHERE id = '$del'");
  18. $nb_rep_request = mysql_num_rows($sql);
  19. if($nb_rep_request!=0)
  20. {
  21. mysql_query("DELETE FROM ".$prefix."cotisations WHERE id = '$del'");
  22. }
  23. }//ENDif(isset($_GET['del']))
  24. ?>
  25. <?php
  26. //on verifie si il est à jour de cotisation
  27. include("inc/token-cotisation.php");
  28. if($statut_user_online=="waiting"){
  29. ?>
  30. <?php
  31. if($token_cotisation=="outdated"){
  32. ?>
  33. <div class="alert alert-info" role="alert">
  34. Vous n'êtes plus à jour de cotisation..
  35. </div>
  36. <?php
  37. }elseif($token_cotisation=="none"){
  38. ?>
  39. <?php if($lang=="fr"){ ?>
  40. <div class="alert alert-info" role="alert">
  41. Votre compte n'est pas encore activé.
  42. <br />R&eacute;glez votre premi&egrave;re cotisation pour activer votre compte et acc&eacute;der &agrave; la <i>cuisine</i>.
  43. </div>
  44. <?php }else{ ?>
  45. <div class="alert alert-info" role="alert">
  46. Your account is not yet activated.
  47. <br />Set your first contribution to activate your account and access to the <i>kitchen</i>.
  48. </div>
  49. <?php } ?>
  50. <?php
  51. }elseif($token_cotisation=="waiting_ok"){
  52. ?>
  53. <?php if($lang=="fr"){ ?>
  54. <div class="alert alert-info" role="alert">
  55. <i class="fa fa-cogs fa-spin"></i> Votre première cotisation est en cours de traitement.
  56. </div>
  57. <?php }else{ ?>
  58. <div class="alert alert-info" role="alert">
  59. <i class="fa fa-cogs fa-spin"></i> Your first contribution is being processed.
  60. </div>
  61. <?php } ?>
  62. <?php
  63. }elseif($token_cotisation=="canceled"){
  64. ?>
  65. <?php if($lang=="fr"){ ?>
  66. <div class="alert alert-info" role="alert">
  67. Votre dernière cotisation a été rejetée.
  68. </div>
  69. <?php }else{ ?>
  70. <div class="alert alert-info" role="alert">
  71. Your last contribution was rejected.
  72. </div>
  73. <?php } ?>
  74. <?php
  75. }
  76. ?>
  77. <?php
  78. }//endif($statut_user_online=="waiting")
  79. ?>
  80. <div class="row no-gutters"><!-- row -->
  81. <div class="col-md-8"><!-- left -->
  82. <!-- INFOS USER -->
  83. <h4><?php echo $prenom_user_online." ".$nom_user_online; ?></h4>
  84. <?php
  85. $date_inscription=date("d M Y", strtotime($date_user_online));
  86. $heure_inscription=date("H:i", strtotime($date_user_online));
  87. ?>
  88. <?php if($lang=="fr"){ ?>
  89. <p class="" style="line-height:20px;">Vous êtes membre de <i>Radical Cinema</i> depuis le <span class=""><?php echo $date_inscription." à ".$heure_inscription; ?></span></p>
  90. <p class="">au sein du <span class=""><?php echo nomcollege($college_user_online,$lang); ?></span>
  91. <?php }else{ ?>
  92. <p class="" style="line-height:20px;">You're member of <i>Radical Cinema</i> since <span class=""><?php echo $date_inscription." at ".$heure_inscription; ?></span></p>
  93. <p class="">within the <span class=""><?php echo nomcollege($college_user_online,$lang); ?></span>
  94. <?php } ?>
  95. <?php
  96. if($solidaire_user_online=="oui"){ ?>
  97. <?php if($lang=="fr"){ ?>
  98. et du <span class="">Collège solidaire</span>
  99. <?php }else{ ?>
  100. and the <span class="">Solidarity College</span>
  101. <?php } ?>
  102. <?php } ?>
  103. </p>
  104. <?php if($statut_user_online=="admin"){ ?>
  105. <p class="cgrey4">Vous avez également le statut d'<span class="">administrateur technique</span>
  106. <?php if($tresorier==$id_user_online){ ?> et celui de <span class="">trésorier</span><?php } ?>.</p>
  107. <?php } ?>
  108. <?php
  109. // tarif de la cotisation
  110. if($tarif_user_online=="tarif_simple"){ $tarif=tarif_simple_college($college_user_online); }
  111. if($tarif_user_online=="tarif_reduit"){ $tarif=tarif_reduit_college($college_user_online); }
  112. if($tarif_user_online=="tarif_structure"){ $tarif=tarif_structure_college($college_user_online); }
  113. ?>
  114. <!-- # INFOS USER -->
  115. </div><!-- #left -->
  116. <div class="col-md-4"><!-- right -->
  117. <div class="blocadhesion"><!-- blocadhesion -->
  118. <?php
  119. if($token_cotisation=="ok")
  120. { ?>
  121. <?php if($lang=="fr"){ ?>
  122. <p class="txtcenter cgrey4">Vous êtes à jour de cotisation.</p>
  123. <div class="padd10"><a href="payer.php" class="btn-article-small"><i class="fa fa-credit-card"></i> &nbsp; Régler la prochaine échéance</a></div>
  124. <?php }else{ ?>
  125. <p class="txtcenter cgrey4">You are to date of contribution.</p>
  126. <div class="padd10"><a href="payer.php" class="btn-article-small"><i class="fa fa-credit-card"></i> &nbsp; Pay the next one</a></div>
  127. <?php } ?>
  128. <?php
  129. }elseif($token_cotisation=="outdated"){
  130. ?>
  131. <?php if($lang=="fr"){ ?>
  132. <p class="txtcenter cred"><i class="fa fa-exclamation-triangle"></i> Vous n'êtes plus à jour de cotisation.</p>
  133. <div class="padd10"><a href="payer.php" class="btn-article-small"><i class="fa fa-credit-card"></i> &nbsp; Régler</a></div>
  134. <?php }else{ ?>
  135. <p class="txtcenter cred"><i class="fa fa-exclamation-triangle"></i> You're not to date of contribution.</p>
  136. <div class="padd10"><a href="payer.php" class="btn-article-small"><i class="fa fa-credit-card"></i> &nbsp; Fix now</a></div>
  137. <?php } ?>
  138. <?php
  139. }elseif($token_cotisation=="none"){
  140. ?>
  141. <?php if($lang=="fr"){ ?>
  142. <p class="txtleft"><i class="fa fa-bookmark"></i> Pour terminer votre inscription vous êtes invité-e à régler votre première cotisation. </p>
  143. <div class="padd10"><a href="payer.php" class="btn-article-small"><i class="fa fa-credit-card"></i> &nbsp; Régler</a></div>
  144. <?php }else{ ?>
  145. <p class="txtleft"><i class="fa fa-bookmark"></i> To complete your registration you are asked to adjust your first contribution. </p>
  146. <div class="padd10"><a href="payer.php" class="btn-article-small"><i class="fa fa-credit-card"></i> &nbsp; Fix now</a></div>
  147. <?php } ?>
  148. <?php
  149. }elseif($token_cotisation=="waiting_ok"){
  150. ?>
  151. <?php if($lang=="fr"){ ?>
  152. <p class="txtleft"><i class="fa fa-cogs fa-spin"></i> Votre première cotisation est en cours de traitement</p>
  153. <div class="padd10"><a href="payer.php" class="btn-article-small"><i class="fa fa-eye"></i> &nbsp; Afficher</a></div>
  154. <?php }else{ ?>
  155. <p class="txtleft"><i class="fa fa-cogs fa-spin"></i> Your first contribution is being processed</p>
  156. <div class="padd10"><a href="payer.php" class="btn-article-small"><i class="fa fa-eye"></i> &nbsp; Display</a></div>
  157. <?php } ?>
  158. <?php
  159. }elseif($token_cotisation=="canceled"){
  160. ?>
  161. <?php if($lang=="fr"){ ?>
  162. <p class="txtleft"><i class="fa fa-exclamation-triangle"></i> Votre dernière cotisation a été rejetée. Vous pouvez la supprimer dans le tableau ci-dessous et recommencer la procédure.
  163. <br /> Si vous estimez qu'il s'agit d'une erreur, contactez le trésorier à l'adresse <b>adminstration@radicalcinema.org</b>
  164. </p>
  165. <?php }else{ ?>
  166. <p class="txtleft"><i class="fa fa-exclamation-triangle"></i> Your last contribution was rejected. You can remove in the table below and start again.
  167. <br />If you feel that this is an error, contact the treasurer at <b>adminstration@radicalcinema.org</b>
  168. </p>
  169. <?php } ?>
  170. <?php
  171. }elseif($token_cotisation=="honneur"){
  172. ?>
  173. <?php if($lang=="fr"){ ?>
  174. <p class="txtcenter cgrey4"><i class="fa fa-bookmark"></i> Vous êtes dispensé-e de cotisation car vous êtes membre d'honneur.</p>
  175. <?php }else{ ?>
  176. <p class="txtcenter cgrey4"><i class="fa fa-bookmark"></i> You are exempt contribution because you are honorary member.</p>
  177. <?php } ?>
  178. <?php
  179. }
  180. ?>
  181. </div><!-- #blocadhesion -->
  182. </div><!-- #right -->
  183. <div class="clear"></div>
  184. </div><!-- #row -->
  185. <!-- COTISATIONS -->
  186. <?php
  187. if($token_cotisation!="none" and $token_cotisation!="honneur"){
  188. ?>
  189. <h5 class="subheader">Vos cotisations</h5>
  190. <div class="table-responsive">
  191. <table class="table table-striped">
  192. <thead>
  193. <tr>
  194. <th style="width:140px;" class="cgrey4 small">Mode de paiement</th>
  195. <th style="width:130px;" class="cgrey4 small">Échéance</th>
  196. <th class="cgrey4 small">Montant</th>
  197. <th style="width:140px;" class="cgrey4 small">Statut</th>
  198. <th class="cgrey4 small">Ref</th>
  199. <th>&nbsp;</th>
  200. <th>&nbsp;</th>
  201. </tr>
  202. </thead>
  203. <tbody>
  204. <?php
  205. $sql_cotisations = mysql_query("SELECT * FROM ".$prefix."cotisations WHERE id_user = '$id_user_online' ORDER BY date_debut DESC");
  206. while($cotis = mysql_fetch_array($sql_cotisations)) {
  207. $id_cotisation=$cotis[id];
  208. $montant_cotisation=$cotis[montant];
  209. $paiement_cotisation=$cotis[paiement];
  210. $statut_cotisation=$cotis[statut];
  211. $ref_cotisation=$cotis[ref];
  212. $date_cotis=$cotis[date_debut];
  213. $date_cotisation=date("d M Y", strtotime($date_cotis));
  214. $heure_cotisation=date("H:i", strtotime($date_cotis));
  215. $depart_cotis=date("YmdHi", strtotime($date_cotis));
  216. $now_verif = date("YmdHi", time());
  217. $annee_limite=date("Y", strtotime($date_cotis))+1;
  218. $fin_cotis=$annee_limite.date("mdHi", strtotime($date_cotis));
  219. $display_date_limite=date("d M", strtotime($date_cotis))." ".$annee_limite;
  220. if($now_verif > $depart_cotis and $now_verif < $fin_cotis) { $tk_cotisation="present";}
  221. if($now_verif < $depart_cotis) { $tk_cotisation="futur";}
  222. if($now_verif > $fin_cotis) { $tk_cotisation="past";}
  223. ?>
  224. <tr style="background:white;">
  225. <td class="cgrey4 small"><?php
  226. if ($paiement_cotisation=="CB") { echo '<i class="fa fa-credit-card"></i> Carte bancaire '; }
  227. if ($paiement_cotisation=="CASH") { echo '<i class="fa fa-money"></i> Esp&egrave;ces'; }
  228. if ($paiement_cotisation=="PAYPAL") { echo '<i class="fa fa-paypal"></i> Paypal'; }
  229. if ($paiement_cotisation=="CHECK") { echo '<i class="fa fa-leaf"></i> Ch&egrave;que'; }
  230. if ($paiement_cotisation=="TRANSFER") { echo '<i class="fa fa-upload"></i> Virement'; }
  231. ?></td>
  232. <td class="cgrey4 small"><?php echo "<span class='cgrey4'>".$display_date_limite."</span> - ".$heure_cotisation; ?></td>
  233. <td class="cgrey4 small"><?php echo $montant_cotisation; ?> &euro;</td>
  234. <?php
  235. if ($statut_cotisation=="cashed" and $tk_cotisation=="present") { echo '<td class="cgreen small"><i class="fa fa-check-square"></i> En cours de validité. </td>'; }
  236. if ($statut_cotisation=="cashed" and $tk_cotisation=="futur") { echo '<td class="cgrey4 small"><i class="fa fa-calendar"></i> Active le '.$date_cotisation.'. </td>'; }
  237. if ($statut_cotisation=="cashed" and $tk_cotisation=="past") { echo '<td class="cgrey4 small"><i class="fa fa-archive"></i> Archivée. </td>'; }
  238. if ($statut_cotisation=="waiting") { echo '<td class="cgrey4 small"><i class="fa fa-cogs fa-spin"></i> En traitement. </td>'; }
  239. if ($statut_cotisation=="canceled") { echo '<td class="cgrey2 small"><i class="fa fa-ban"></i> Annul&eacute;e. </td>'; }
  240. ?>
  241. <td class="cgrey4 small"><a href="payer.php?id=<?php echo $id_cotisation; ?>" class="grey2link"><?php echo $ref_cotisation; ?></a></td>
  242. <td class="cgrey4 small"><?php
  243. if($statut_cotisation=="waiting" and ($paiement_cotisation=="CHECK" or $paiement_cotisation=="CASH"))
  244. {
  245. if($lang=="fr"){
  246. echo " <a href='payer.php' class='grey2link' title='Afficher'><i class='fa fa-eye'></i> Afficher</a>";
  247. }else{
  248. echo " <a href='payer.php' class='grey2link' title='Display'><i class='fa fa-eye'></i> Display</a>";
  249. }
  250. }
  251. ?></td>
  252. <td class="cgrey3 small"><?php
  253. if($statut_cotisation=="waiting" and ($paiement_cotisation=="CHECK" or $paiement_cotisation=="CASH"))
  254. {
  255. if($lang=="fr"){
  256. echo " <a href='adhesion.php?del=".$id_cotisation."' class='grey2link' title='Annuler'><i class='fa fa-ban'></i> Annuler</a>";
  257. }else{
  258. echo " <a href='adhesion.php?del=".$id_cotisation."' class='grey2link' title='Cancel'><i class='fa fa-ban'></i> Cancel</a>";
  259. }
  260. }elseif($statut_cotisation=="canceled") {
  261. if($lang=="fr"){
  262. echo " <a href='adhesion.php?del=".$id_cotisation."' class='grey2link' title='Supprimer'><i class='fa fa-times-circle'></i> Supprimer</a>";
  263. }else{
  264. echo " <a href='adhesion.php?del=".$id_cotisation."' class='grey2link' title='Delete'><i class='fa fa-times-circle'></i> Delete</a>";
  265. }
  266. }
  267. ?></td>
  268. </tr>
  269. <?php
  270. } // END while($cotis = mysql_fetch_array($sql_cotisations))
  271. ?>
  272. </tbody>
  273. </table>
  274. <?php
  275. }//ENDif($token_cotisation!="none")
  276. ?>
  277. <!-- # COTISATIONS -->
  278. <?php
  279. include("inc/template_bottom.php"); // insert bas de page
  280. ?>