Browse Source

Restructuration

Baptiste Marty 3 years ago
parent
commit
beb0513aea
87 changed files with 21048 additions and 0 deletions
  1. 126
    0
      Site-Proximo-v1/LICENSE
  2. 3
    0
      Site-Proximo-v1/README.md
  3. 6
    0
      Site-Proximo-v1/admin/articles.php
  4. 6
    0
      Site-Proximo-v1/admin/categories.php
  5. 7
    0
      Site-Proximo-v1/admin/form_ajax.php
  6. 73
    0
      Site-Proximo-v1/admin/index.php
  7. 10
    0
      Site-Proximo-v1/admin/json_ajax.php
  8. 7
    0
      Site-Proximo-v1/admin/stock.php
  9. 70
    0
      Site-Proximo-v1/admin/template.php
  10. 7
    0
      Site-Proximo-v1/admin/write_json.php
  11. 10
    0
      Site-Proximo-v1/ajax/zapette.php
  12. 9
    0
      Site-Proximo-v1/assets/css/admin.css
  13. 104
    0
      Site-Proximo-v1/assets/css/bootstrapOverwrite.css
  14. 202
    0
      Site-Proximo-v1/assets/css/fonts/Open_Sans/LICENSE.txt
  15. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-Bold.ttf
  16. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-BoldItalic.ttf
  17. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-ExtraBold.ttf
  18. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-ExtraBoldItalic.ttf
  19. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-Italic.ttf
  20. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-Light.ttf
  21. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-LightItalic.ttf
  22. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-Regular.ttf
  23. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-SemiBold.ttf
  24. BIN
      Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-SemiBoldItalic.ttf
  25. 202
    0
      Site-Proximo-v1/assets/css/fonts/Roboto/LICENSE.txt
  26. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Black.ttf
  27. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-BlackItalic.ttf
  28. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Bold.ttf
  29. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-BoldItalic.ttf
  30. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Italic.ttf
  31. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Light.ttf
  32. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-LightItalic.ttf
  33. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Medium.ttf
  34. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-MediumItalic.ttf
  35. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Regular.ttf
  36. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Thin.ttf
  37. BIN
      Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-ThinItalic.ttf
  38. BIN
      Site-Proximo-v1/assets/css/fonts/materialdesignicons-webfont.ttf
  39. BIN
      Site-Proximo-v1/assets/css/fonts/materialdesignicons-webfont.woff
  40. BIN
      Site-Proximo-v1/assets/css/fonts/materialdesignicons-webfont.woff2
  41. 239
    0
      Site-Proximo-v1/assets/css/general.css
  42. 69
    0
      Site-Proximo-v1/assets/css/hamburger.css
  43. 0
    0
      Site-Proximo-v1/assets/css/index.css
  44. 3625
    0
      Site-Proximo-v1/assets/css/libs/animatecss.css
  45. 7
    0
      Site-Proximo-v1/assets/css/libs/bootstrap.min.css
  46. 9
    0
      Site-Proximo-v1/assets/css/libs/jquery-confirm.min.css
  47. 3
    0
      Site-Proximo-v1/assets/css/libs/materialdesignicons.min.css
  48. 77
    0
      Site-Proximo-v1/assets/css/list.css
  49. 37
    0
      Site-Proximo-v1/assets/css/sidenav.css
  50. 52
    0
      Site-Proximo-v1/assets/css/stock.css
  51. BIN
      Site-Proximo-v1/assets/images/favicon.png
  52. BIN
      Site-Proximo-v1/assets/images/proximo.png
  53. 101
    0
      Site-Proximo-v1/assets/js/ajaxManager.js
  54. 37
    0
      Site-Proximo-v1/assets/js/articles.js
  55. 17
    0
      Site-Proximo-v1/assets/js/categories.js
  56. 55
    0
      Site-Proximo-v1/assets/js/index.js
  57. 72
    0
      Site-Proximo-v1/assets/js/init.js
  58. 73
    0
      Site-Proximo-v1/assets/js/jquery-confirm-defaults.js
  59. 7
    0
      Site-Proximo-v1/assets/js/libs/bootstrap.min.js
  60. 10
    0
      Site-Proximo-v1/assets/js/libs/jquery-confirm.min.js
  61. 2
    0
      Site-Proximo-v1/assets/js/libs/jquery.min.js
  62. 2
    0
      Site-Proximo-v1/assets/js/libs/sortable.min.js
  63. 346
    0
      Site-Proximo-v1/assets/js/listManager.js
  64. 61
    0
      Site-Proximo-v1/assets/js/sidenav.js
  65. 120
    0
      Site-Proximo-v1/assets/js/stock.js
  66. 169
    0
      Site-Proximo-v1/classes/dao.php
  67. 258
    0
      Site-Proximo-v1/classes/postHandler.php
  68. 121
    0
      Site-Proximo-v1/classes/zapetteHandler.php
  69. 1
    0
      Site-Proximo-v1/includes/.htpassadmin
  70. 31
    0
      Site-Proximo-v1/includes/footer.php
  71. 55
    0
      Site-Proximo-v1/includes/navbar.php
  72. 49
    0
      Site-Proximo-v1/includes/sidenav.php
  73. 66
    0
      Site-Proximo-v1/includes/template.php
  74. 25
    0
      Site-Proximo-v1/index.php
  75. 174
    0
      Site-Proximo-v1/zapette.py
  76. 23
    0
      Site-Proximo-v2/.gitignore
  77. 68
    0
      Site-Proximo-v2/README.md
  78. 13923
    0
      Site-Proximo-v2/package-lock.json
  79. 34
    0
      Site-Proximo-v2/package.json
  80. BIN
      Site-Proximo-v2/public/favicon.ico
  81. 43
    0
      Site-Proximo-v2/public/index.html
  82. BIN
      Site-Proximo-v2/public/logo192.png
  83. BIN
      Site-Proximo-v2/public/logo512.png
  84. 25
    0
      Site-Proximo-v2/public/manifest.json
  85. 3
    0
      Site-Proximo-v2/public/robots.txt
  86. 50
    0
      Site-Proximo-v2/src/index.css
  87. 67
    0
      Site-Proximo-v2/src/index.js

+ 126
- 0
Site-Proximo-v1/LICENSE View File

@@ -0,0 +1,126 @@
1
+GNU GENERAL PUBLIC LICENSE
2
+Version 3, 29 June 2007
3
+Copyright © 2007 Free Software Foundation, Inc. <http s ://fsf.org/>
4
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
5
+Preamble
6
+The GNU General Public License is a free, copyleft license for software and other kinds of works.
7
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
8
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
9
+To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
10
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
11
+Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
12
+For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
13
+Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
14
+Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
15
+The precise terms and conditions for copying, distribution and modification follow.
16
+TERMS AND CONDITIONS
17
+   0. Definitions.
18
+   "This License" refers to version 3 of the GNU General Public License.
19
+   "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
20
+   "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
21
+   To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
22
+   A "covered work" means either the unmodified Program or a work based on the Program.
23
+   To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
24
+   To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
25
+   An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
26
+   1. Source Code.
27
+   The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
28
+   A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
29
+   The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
30
+   The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
31
+   The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
32
+   The Corresponding Source for a work in source code form is that same work.
33
+   2. Basic Permissions.
34
+   All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
35
+   You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
36
+   Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
37
+   3. Protecting Users' Legal Rights From Anti-Circumvention Law.
38
+   No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
39
+   When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
40
+   4. Conveying Verbatim Copies.
41
+   You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
42
+   You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
43
+   5. Conveying Modified Source Versions.
44
+   You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
45
+      a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
46
+      b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
47
+      c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
48
+      d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
49
+   A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
50
+   6. Conveying Non-Source Forms.
51
+   You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
52
+      a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
53
+      b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
54
+      c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
55
+      d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
56
+      e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
57
+   A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
58
+   A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
59
+   "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
60
+   If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
61
+   The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
62
+   Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
63
+   7. Additional Terms.
64
+   "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
65
+   When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
66
+   Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
67
+      a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
68
+      b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
69
+      c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
70
+      d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
71
+      e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
72
+      f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
73
+   All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
74
+   If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
75
+   Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
76
+   8. Termination.
77
+   You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
78
+   However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
79
+   Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
80
+   Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
81
+   9. Acceptance Not Required for Having Copies.
82
+   You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
83
+   10. Automatic Licensing of Downstream Recipients.
84
+   Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
85
+   An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
86
+   You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
87
+   11. Patents.
88
+   A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
89
+   A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
90
+   Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
91
+   In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
92
+   If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
93
+   If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
94
+   A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
95
+   Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
96
+   12. No Surrender of Others' Freedom.
97
+   If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
98
+   13. Use with the GNU Affero General Public License.
99
+   Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
100
+   14. Revised Versions of this License.
101
+   The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
102
+   Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
103
+   If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
104
+   Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
105
+   15. Disclaimer of Warranty.
106
+   THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
107
+   16. Limitation of Liability.
108
+   IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
109
+   17. Interpretation of Sections 15 and 16.
110
+   If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS
111
+How to Apply These Terms to Your New Programs
112
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
113
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
114
+<one line to give the program's name and a brief idea of what it does.>
115
+Copyright (C) <year> <name of author>
116
+This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
117
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
118
+You should have received a copy of the GNU General Public License along with this program. If not, see <http s ://www.gnu.org/licenses/>.
119
+Also add information on how to contact you by electronic and paper mail.
120
+If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
121
+<program> Copyright (C) <year> <name of author>
122
+This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
123
+This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
124
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box".
125
+You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http s ://www.gnu.org/licenses/>.
126
+The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http s ://www.gnu.org/philosophy/why-not-lgpl.html>.

+ 3
- 0
Site-Proximo-v1/README.md View File

@@ -0,0 +1,3 @@
1
+# site-proximo
2
+
3
+Site du proximo, utilisé pour gérer le stock.

+ 6
- 0
Site-Proximo-v1/admin/articles.php View File

@@ -0,0 +1,6 @@
1
+<?php
2
+$relativePath = "../";
3
+
4
+$pageTitle = "Gestion des articles";
5
+$script = "<script type=\"text/javascript\" src=\"" . $relativePath . "assets/js/articles.js\"></script>";
6
+include("template.php");

+ 6
- 0
Site-Proximo-v1/admin/categories.php View File

@@ -0,0 +1,6 @@
1
+<?php
2
+$relativePath = "../";
3
+
4
+$pageTitle = "Gestion des catégories";
5
+$script = "<script type=\"text/javascript\" src=\"" . $relativePath . "assets/js/categories.js\"></script>";
6
+include("template.php");

+ 7
- 0
Site-Proximo-v1/admin/form_ajax.php View File

@@ -0,0 +1,7 @@
1
+<?php
2
+$relativePath = "../";
3
+require_once $relativePath.'classes/postHandler.php';
4
+
5
+$handler = new PostHandler($_POST, $_FILES);
6
+
7
+echo json_encode($handler->do_action());

+ 73
- 0
Site-Proximo-v1/admin/index.php View File

@@ -0,0 +1,73 @@
1
+<?php
2
+$relativePath = "../";
3
+ob_start();
4
+?>
5
+<div class="admin-container" style="display: flex">
6
+    <div class="my-5" style="margin: auto">
7
+        <div class="border p-2">
8
+            <p style="text-align: center">Modifier la quantité disponible de chaque article en stock</p>
9
+            <div style="display: flex">
10
+                <a href="stock.php" style="margin: auto">
11
+                    <button class="btn btn-success btn-lg">Gestion du stocks</button>
12
+                </a>
13
+            </div>
14
+        </div>
15
+
16
+        <div class="border p-2 mt-2">
17
+            <p style="text-align: center">
18
+                Créer des articles et des catégories d'articles.
19
+                <br/>
20
+                C'est ici que tu peux choisir le nom, la description, l'image le code et autre pour chaque article.
21
+            </p>
22
+            <div style="display: flex">
23
+                <div style="margin: auto">
24
+                    <a href="articles.php" style="margin: auto" class="mx-1">
25
+                        <button class="btn btn-primary btn-lg">Créer/Éditer des articles</button>
26
+                    </a>
27
+                    <a href="categories.php" style="margin: auto" class="mx-1">
28
+                        <button class="btn btn-primary btn-lg">Créer/Éditer des catégories</button>
29
+                    </a>
30
+                </div>
31
+
32
+            </div>
33
+        </div>
34
+        <div class="border p-2 mt-2">
35
+            <p style="text-align: center">
36
+                Rendre l'inventaire publique.
37
+                <br/>
38
+                Mettre en ligne l'inventaire permet aux étudiants d'y avoir accès en utilisant l'appli Campus.
39
+            </p>
40
+            <div style="display: flex">
41
+                <button id="uploadButton" class="btn btn-warning btn-lg" style="margin: auto">Mettre l'inventaire en ligne
42
+                </button>
43
+            </div>
44
+        </div>
45
+        <div class="border p-2 mt-2">
46
+            <p style="text-align: center">
47
+                <strong>Un problème ?</strong>
48
+                <br/>
49
+                Tu peux contacter le développeur de ce site si jamais tu rencontres des problèmes.
50
+            </p>
51
+            <div style="display: flex">
52
+                <button id="errorButton" class="btn btn-danger btn-lg" style="margin: auto">
53
+                    Contacter le développeur
54
+                </button>
55
+            </div>
56
+        </div>
57
+    </div>
58
+</div>
59
+
60
+<link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/admin.css" media="screen,projection"/>
61
+
62
+<?php
63
+$pageContent = ob_get_clean();
64
+$pageTitle = "Admin";
65
+$pageScripts =
66
+    "
67
+    <script type=\"text/javascript\" src=\"" . $relativePath . "assets/js/jquery-confirm-defaults.js\"></script>
68
+    <script type=\"text/javascript\" src=\"" . $relativePath . "assets/js/index.js\"></script>
69
+    ";
70
+
71
+
72
+include($relativePath . "includes/template.php");
73
+?>

+ 10
- 0
Site-Proximo-v1/admin/json_ajax.php View File

@@ -0,0 +1,10 @@
1
+<?php
2
+$relativePath = "../";
3
+require_once $relativePath.'classes/postHandler.php';
4
+
5
+$rest_json = file_get_contents("php://input");
6
+$_POST = json_decode($rest_json, true);
7
+
8
+$handler = new PostHandler($_POST, $_FILES);
9
+
10
+echo json_encode($handler->do_action());

+ 7
- 0
Site-Proximo-v1/admin/stock.php View File

@@ -0,0 +1,7 @@
1
+<?php
2
+$relativePath = "../";
3
+
4
+$isStock = true;
5
+$pageTitle = "Gestion des stocks";
6
+$script = "<script type=\"text/javascript\" src=\"" . $relativePath . "assets/js/stock.js\"></script>";
7
+include("template.php");

+ 70
- 0
Site-Proximo-v1/admin/template.php View File

@@ -0,0 +1,70 @@
1
+<?php
2
+$relativePath = "../";
3
+
4
+if (!isset($isStock))
5
+    $isStock = false;
6
+
7
+ob_start();
8
+?>
9
+<div class="admin-container">
10
+
11
+    <a href="index.php">
12
+        <button class="btn btn-primary btn-large">
13
+            <span class="mdi mdi-chevron-left"></span>
14
+            Retour
15
+        </button>
16
+    </a>
17
+
18
+    <h1 class="text-center"><?= $pageTitle ?></h1>
19
+
20
+    <?php if (!$isStock): ?>
21
+        <div style="display: flex">
22
+            <button class="btn btn-success" style="margin: auto" onclick="listManager.showEditPopup(-1)">
23
+                <i class="mdi mdi-plus"></i>
24
+            </button>
25
+        </div>
26
+        <div id="listContainer">
27
+            <ul id="dataList">
28
+
29
+            </ul>
30
+        </div>
31
+    <?php else: ?>
32
+        <div>
33
+            <h3 class="text-center">Mode</h3>
34
+            <div class="button-container">
35
+                <button id="buyButton" class="btn mr-0">Achat</button>
36
+                <button id="sellButton" class="btn ml-0">Vente</button>
37
+            </div>
38
+        </div>
39
+        <div id="dataList">
40
+
41
+        </div>
42
+        <div style="display: flex">
43
+            <button id="saveButton" style="margin: auto" class="btn btn-lg my-2">Sauvegarder</button>
44
+        </div>
45
+    <?php endif; ?>
46
+
47
+</div>
48
+
49
+
50
+<link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/libs/materialdesignicons.min.css"
51
+      media="screen,projection"/>
52
+<link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/admin.css" media="screen,projection"/>
53
+
54
+<?php if (!$isStock): ?>
55
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/list.css" media="screen,projection"/>
56
+<?php else: ?>
57
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/stock.css" media="screen,projection"/>
58
+<?php endif; ?>
59
+
60
+<?php
61
+$pageContent = ob_get_clean();
62
+$pageScripts =
63
+    "
64
+    <script type=\"text/javascript\" src=\"" . $relativePath . "assets/js/jquery-confirm-defaults.js\"></script>
65
+    <script type=\"text/javascript\" src=\"" . $relativePath . "assets/js/ajaxManager.js\"></script>
66
+    <script type=\"text/javascript\" src=\"" . $relativePath . "assets/js/listManager.js\"></script>
67
+    ";
68
+$pageScripts .= $script;
69
+include($relativePath . "includes/template.php");
70
+?>

+ 7
- 0
Site-Proximo-v1/admin/write_json.php View File

@@ -0,0 +1,7 @@
1
+<?php
2
+$relativePath = "../";
3
+require_once $relativePath.'classes/postHandler.php';
4
+
5
+$handler = new PostHandler(null, null);
6
+
7
+echo json_encode($handler->write_json());

+ 10
- 0
Site-Proximo-v1/ajax/zapette.php View File

@@ -0,0 +1,10 @@
1
+<?php
2
+$relativePath = "../";
3
+require_once $relativePath.'classes/zapetteHandler.php';
4
+
5
+$rest_json = file_get_contents("php://input");
6
+$_POST = json_decode($rest_json, true);
7
+
8
+$handler = new ZapetteHandler($_POST);
9
+
10
+echo json_encode($handler->do_action());

+ 9
- 0
Site-Proximo-v1/assets/css/admin.css View File

@@ -0,0 +1,9 @@
1
+.admin-container {
2
+    width: 90%;
3
+    margin: 50px auto auto auto;
4
+}
5
+
6
+table {
7
+    width: 100%;
8
+    margin-bottom: 20px;
9
+}

+ 104
- 0
Site-Proximo-v1/assets/css/bootstrapOverwrite.css View File

@@ -0,0 +1,104 @@
1
+@font-face {
2
+    font-family: 'Open Sans';
3
+    src: url('fonts/Open_Sans/OpenSans-Regular.ttf');
4
+}
5
+
6
+@font-face {
7
+    font-family: 'Roboto';
8
+    src: url('fonts/Roboto/Roboto-Regular.ttf');
9
+}
10
+
11
+html, body {
12
+    font-family: 'Open Sans', sans-serif;
13
+    height: 100%;
14
+    padding: 0;
15
+    margin: 0;
16
+}
17
+
18
+h1, h2, h3, h4, h5, h6 {
19
+    font-family: 'Roboto', sans-serif;
20
+}
21
+
22
+a {
23
+    color: #FB5F03;
24
+    transition: 0.2s;
25
+}
26
+
27
+a:hover {
28
+    text-decoration: none;
29
+    color: #7a2e01;
30
+}
31
+
32
+footer {
33
+    background-color: #dedede;
34
+    position: absolute;
35
+    width: 100%;
36
+    bottom: 0;
37
+    height: 250px;
38
+    font-size: 0.9rem;
39
+}
40
+
41
+footer h5 {
42
+    font-size: 1.1rem;
43
+}
44
+
45
+.navbar {
46
+    width: 100%;
47
+    padding: 0 20px;
48
+    background-color: #dedede;
49
+    margin-top: -64px; /* make the navbar visible on the main jumbotron */
50
+}
51
+
52
+.nav-item a {
53
+    font-size: 1.2rem;
54
+}
55
+
56
+.navbar-nav {
57
+    width: 100%;
58
+    display: inline-flex;
59
+}
60
+
61
+.nav-item {
62
+    margin: auto;
63
+    position: relative;
64
+    overflow: hidden;
65
+}
66
+
67
+.nav-link:hover  {
68
+    color: #FB5F03 !important;
69
+    cursor: pointer;
70
+}
71
+
72
+.navbar, .navbar-nav, .nav-link {
73
+    height: 64px;
74
+}
75
+
76
+.nav-link {
77
+    height: 64px;
78
+    line-height: 64px;
79
+    padding: 0 10px;
80
+    position: relative;
81
+    color: black;
82
+}
83
+
84
+.navbar {
85
+    padding: auto;
86
+}
87
+
88
+.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c .jconfirm-title {
89
+    line-height: 30px;
90
+    color: #FB5F03;
91
+}
92
+
93
+.btn-danger {
94
+    background-color: #FB5F03;
95
+    border-color: #FB5F03;
96
+}
97
+
98
+@media
99
+only screen and (max-width: 575px) {
100
+    footer {
101
+        height: 300px;
102
+        font-size: 0.8rem;
103
+    }
104
+}

+ 202
- 0
Site-Proximo-v1/assets/css/fonts/Open_Sans/LICENSE.txt View File

@@ -0,0 +1,202 @@
1
+
2
+                                 Apache License
3
+                           Version 2.0, January 2004
4
+                        http://www.apache.org/licenses/
5
+
6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+   1. Definitions.
9
+
10
+      "License" shall mean the terms and conditions for use, reproduction,
11
+      and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+      "Licensor" shall mean the copyright owner or entity authorized by
14
+      the copyright owner that is granting the License.
15
+
16
+      "Legal Entity" shall mean the union of the acting entity and all
17
+      other entities that control, are controlled by, or are under common
18
+      control with that entity. For the purposes of this definition,
19
+      "control" means (i) the power, direct or indirect, to cause the
20
+      direction or management of such entity, whether by contract or
21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+      outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+      "You" (or "Your") shall mean an individual or Legal Entity
25
+      exercising permissions granted by this License.
26
+
27
+      "Source" form shall mean the preferred form for making modifications,
28
+      including but not limited to software source code, documentation
29
+      source, and configuration files.
30
+
31
+      "Object" form shall mean any form resulting from mechanical
32
+      transformation or translation of a Source form, including but
33
+      not limited to compiled object code, generated documentation,
34
+      and conversions to other media types.
35
+
36
+      "Work" shall mean the work of authorship, whether in Source or
37
+      Object form, made available under the License, as indicated by a
38
+      copyright notice that is included in or attached to the work
39
+      (an example is provided in the Appendix below).
40
+
41
+      "Derivative Works" shall mean any work, whether in Source or Object
42
+      form, that is based on (or derived from) the Work and for which the
43
+      editorial revisions, annotations, elaborations, or other modifications
44
+      represent, as a whole, an original work of authorship. For the purposes
45
+      of this License, Derivative Works shall not include works that remain
46
+      separable from, or merely link (or bind by name) to the interfaces of,
47
+      the Work and Derivative Works thereof.
48
+
49
+      "Contribution" shall mean any work of authorship, including
50
+      the original version of the Work and any modifications or additions
51
+      to that Work or Derivative Works thereof, that is intentionally
52
+      submitted to Licensor for inclusion in the Work by the copyright owner
53
+      or by an individual or Legal Entity authorized to submit on behalf of
54
+      the copyright owner. For the purposes of this definition, "submitted"
55
+      means any form of electronic, verbal, or written communication sent
56
+      to the Licensor or its representatives, including but not limited to
57
+      communication on electronic mailing lists, source code control systems,
58
+      and issue tracking systems that are managed by, or on behalf of, the
59
+      Licensor for the purpose of discussing and improving the Work, but
60
+      excluding communication that is conspicuously marked or otherwise
61
+      designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
64
+      on behalf of whom a Contribution has been received by Licensor and
65
+      subsequently incorporated within the Work.
66
+
67
+   2. Grant of Copyright License. Subject to the terms and conditions of
68
+      this License, each Contributor hereby grants to You a perpetual,
69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+      copyright license to reproduce, prepare Derivative Works of,
71
+      publicly display, publicly perform, sublicense, and distribute the
72
+      Work and such Derivative Works in Source or Object form.
73
+
74
+   3. Grant of Patent License. Subject to the terms and conditions of
75
+      this License, each Contributor hereby grants to You a perpetual,
76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+      (except as stated in this section) patent license to make, have made,
78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
79
+      where such license applies only to those patent claims licensable
80
+      by such Contributor that are necessarily infringed by their
81
+      Contribution(s) alone or by combination of their Contribution(s)
82
+      with the Work to which such Contribution(s) was submitted. If You
83
+      institute patent litigation against any entity (including a
84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+      or a Contribution incorporated within the Work constitutes direct
86
+      or contributory patent infringement, then any patent licenses
87
+      granted to You under this License for that Work shall terminate
88
+      as of the date such litigation is filed.
89
+
90
+   4. Redistribution. You may reproduce and distribute copies of the
91
+      Work or Derivative Works thereof in any medium, with or without
92
+      modifications, and in Source or Object form, provided that You
93
+      meet the following conditions:
94
+
95
+      (a) You must give any other recipients of the Work or
96
+          Derivative Works a copy of this License; and
97
+
98
+      (b) You must cause any modified files to carry prominent notices
99
+          stating that You changed the files; and
100
+
101
+      (c) You must retain, in the Source form of any Derivative Works
102
+          that You distribute, all copyright, patent, trademark, and
103
+          attribution notices from the Source form of the Work,
104
+          excluding those notices that do not pertain to any part of
105
+          the Derivative Works; and
106
+
107
+      (d) If the Work includes a "NOTICE" text file as part of its
108
+          distribution, then any Derivative Works that You distribute must
109
+          include a readable copy of the attribution notices contained
110
+          within such NOTICE file, excluding those notices that do not
111
+          pertain to any part of the Derivative Works, in at least one
112
+          of the following places: within a NOTICE text file distributed
113
+          as part of the Derivative Works; within the Source form or
114
+          documentation, if provided along with the Derivative Works; or,
115
+          within a display generated by the Derivative Works, if and
116
+          wherever such third-party notices normally appear. The contents
117
+          of the NOTICE file are for informational purposes only and
118
+          do not modify the License. You may add Your own attribution
119
+          notices within Derivative Works that You distribute, alongside
120
+          or as an addendum to the NOTICE text from the Work, provided
121
+          that such additional attribution notices cannot be construed
122
+          as modifying the License.
123
+
124
+      You may add Your own copyright statement to Your modifications and
125
+      may provide additional or different license terms and conditions
126
+      for use, reproduction, or distribution of Your modifications, or
127
+      for any such Derivative Works as a whole, provided Your use,
128
+      reproduction, and distribution of the Work otherwise complies with
129
+      the conditions stated in this License.
130
+
131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
132
+      any Contribution intentionally submitted for inclusion in the Work
133
+      by You to the Licensor shall be under the terms and conditions of
134
+      this License, without any additional terms or conditions.
135
+      Notwithstanding the above, nothing herein shall supersede or modify
136
+      the terms of any separate license agreement you may have executed
137
+      with Licensor regarding such Contributions.
138
+
139
+   6. Trademarks. This License does not grant permission to use the trade
140
+      names, trademarks, service marks, or product names of the Licensor,
141
+      except as required for reasonable and customary use in describing the
142
+      origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+   7. Disclaimer of Warranty. Unless required by applicable law or
145
+      agreed to in writing, Licensor provides the Work (and each
146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+      implied, including, without limitation, any warranties or conditions
149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
151
+      appropriateness of using or redistributing the Work and assume any
152
+      risks associated with Your exercise of permissions under this License.
153
+
154
+   8. Limitation of Liability. In no event and under no legal theory,
155
+      whether in tort (including negligence), contract, or otherwise,
156
+      unless required by applicable law (such as deliberate and grossly
157
+      negligent acts) or agreed to in writing, shall any Contributor be
158
+      liable to You for damages, including any direct, indirect, special,
159
+      incidental, or consequential damages of any character arising as a
160
+      result of this License or out of the use or inability to use the
161
+      Work (including but not limited to damages for loss of goodwill,
162
+      work stoppage, computer failure or malfunction, or any and all
163
+      other commercial damages or losses), even if such Contributor
164
+      has been advised of the possibility of such damages.
165
+
166
+   9. Accepting Warranty or Additional Liability. While redistributing
167
+      the Work or Derivative Works thereof, You may choose to offer,
168
+      and charge a fee for, acceptance of support, warranty, indemnity,
169
+      or other liability obligations and/or rights consistent with this
170
+      License. However, in accepting such obligations, You may act only
171
+      on Your own behalf and on Your sole responsibility, not on behalf
172
+      of any other Contributor, and only if You agree to indemnify,
173
+      defend, and hold each Contributor harmless for any liability
174
+      incurred by, or claims asserted against, such Contributor by reason
175
+      of your accepting any such warranty or additional liability.
176
+
177
+   END OF TERMS AND CONDITIONS
178
+
179
+   APPENDIX: How to apply the Apache License to your work.
180
+
181
+      To apply the Apache License to your work, attach the following
182
+      boilerplate notice, with the fields enclosed by brackets "[]"
183
+      replaced with your own identifying information. (Don't include
184
+      the brackets!)  The text should be enclosed in the appropriate
185
+      comment syntax for the file format. We also recommend that a
186
+      file or class name and description of purpose be included on the
187
+      same "printed page" as the copyright notice for easier
188
+      identification within third-party archives.
189
+
190
+   Copyright [yyyy] [name of copyright owner]
191
+
192
+   Licensed under the Apache License, Version 2.0 (the "License");
193
+   you may not use this file except in compliance with the License.
194
+   You may obtain a copy of the License at
195
+
196
+       http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+   Unless required by applicable law or agreed to in writing, software
199
+   distributed under the License is distributed on an "AS IS" BASIS,
200
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+   See the License for the specific language governing permissions and
202
+   limitations under the License.

BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-Bold.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-BoldItalic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-ExtraBold.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-ExtraBoldItalic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-Italic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-Light.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-LightItalic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-Regular.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-SemiBold.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Open_Sans/OpenSans-SemiBoldItalic.ttf View File


+ 202
- 0
Site-Proximo-v1/assets/css/fonts/Roboto/LICENSE.txt View File

@@ -0,0 +1,202 @@
1
+
2
+                                 Apache License
3
+                           Version 2.0, January 2004
4
+                        http://www.apache.org/licenses/
5
+
6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+   1. Definitions.
9
+
10
+      "License" shall mean the terms and conditions for use, reproduction,
11
+      and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+      "Licensor" shall mean the copyright owner or entity authorized by
14
+      the copyright owner that is granting the License.
15
+
16
+      "Legal Entity" shall mean the union of the acting entity and all
17
+      other entities that control, are controlled by, or are under common
18
+      control with that entity. For the purposes of this definition,
19
+      "control" means (i) the power, direct or indirect, to cause the
20
+      direction or management of such entity, whether by contract or
21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+      outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+      "You" (or "Your") shall mean an individual or Legal Entity
25
+      exercising permissions granted by this License.
26
+
27
+      "Source" form shall mean the preferred form for making modifications,
28
+      including but not limited to software source code, documentation
29
+      source, and configuration files.
30
+
31
+      "Object" form shall mean any form resulting from mechanical
32
+      transformation or translation of a Source form, including but
33
+      not limited to compiled object code, generated documentation,
34
+      and conversions to other media types.
35
+
36
+      "Work" shall mean the work of authorship, whether in Source or
37
+      Object form, made available under the License, as indicated by a
38
+      copyright notice that is included in or attached to the work
39
+      (an example is provided in the Appendix below).
40
+
41
+      "Derivative Works" shall mean any work, whether in Source or Object
42
+      form, that is based on (or derived from) the Work and for which the
43
+      editorial revisions, annotations, elaborations, or other modifications
44
+      represent, as a whole, an original work of authorship. For the purposes
45
+      of this License, Derivative Works shall not include works that remain
46
+      separable from, or merely link (or bind by name) to the interfaces of,
47
+      the Work and Derivative Works thereof.
48
+
49
+      "Contribution" shall mean any work of authorship, including
50
+      the original version of the Work and any modifications or additions
51
+      to that Work or Derivative Works thereof, that is intentionally
52
+      submitted to Licensor for inclusion in the Work by the copyright owner
53
+      or by an individual or Legal Entity authorized to submit on behalf of
54
+      the copyright owner. For the purposes of this definition, "submitted"
55
+      means any form of electronic, verbal, or written communication sent
56
+      to the Licensor or its representatives, including but not limited to
57
+      communication on electronic mailing lists, source code control systems,
58
+      and issue tracking systems that are managed by, or on behalf of, the
59
+      Licensor for the purpose of discussing and improving the Work, but
60
+      excluding communication that is conspicuously marked or otherwise
61
+      designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
64
+      on behalf of whom a Contribution has been received by Licensor and
65
+      subsequently incorporated within the Work.
66
+
67
+   2. Grant of Copyright License. Subject to the terms and conditions of
68
+      this License, each Contributor hereby grants to You a perpetual,
69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+      copyright license to reproduce, prepare Derivative Works of,
71
+      publicly display, publicly perform, sublicense, and distribute the
72
+      Work and such Derivative Works in Source or Object form.
73
+
74
+   3. Grant of Patent License. Subject to the terms and conditions of
75
+      this License, each Contributor hereby grants to You a perpetual,
76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+      (except as stated in this section) patent license to make, have made,
78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
79
+      where such license applies only to those patent claims licensable
80
+      by such Contributor that are necessarily infringed by their
81
+      Contribution(s) alone or by combination of their Contribution(s)
82
+      with the Work to which such Contribution(s) was submitted. If You
83
+      institute patent litigation against any entity (including a
84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+      or a Contribution incorporated within the Work constitutes direct
86
+      or contributory patent infringement, then any patent licenses
87
+      granted to You under this License for that Work shall terminate
88
+      as of the date such litigation is filed.
89
+
90
+   4. Redistribution. You may reproduce and distribute copies of the
91
+      Work or Derivative Works thereof in any medium, with or without
92
+      modifications, and in Source or Object form, provided that You
93
+      meet the following conditions:
94
+
95
+      (a) You must give any other recipients of the Work or
96
+          Derivative Works a copy of this License; and
97
+
98
+      (b) You must cause any modified files to carry prominent notices
99
+          stating that You changed the files; and
100
+
101
+      (c) You must retain, in the Source form of any Derivative Works
102
+          that You distribute, all copyright, patent, trademark, and
103
+          attribution notices from the Source form of the Work,
104
+          excluding those notices that do not pertain to any part of
105
+          the Derivative Works; and
106
+
107
+      (d) If the Work includes a "NOTICE" text file as part of its
108
+          distribution, then any Derivative Works that You distribute must
109
+          include a readable copy of the attribution notices contained
110
+          within such NOTICE file, excluding those notices that do not
111
+          pertain to any part of the Derivative Works, in at least one
112
+          of the following places: within a NOTICE text file distributed
113
+          as part of the Derivative Works; within the Source form or
114
+          documentation, if provided along with the Derivative Works; or,
115
+          within a display generated by the Derivative Works, if and
116
+          wherever such third-party notices normally appear. The contents
117
+          of the NOTICE file are for informational purposes only and
118
+          do not modify the License. You may add Your own attribution
119
+          notices within Derivative Works that You distribute, alongside
120
+          or as an addendum to the NOTICE text from the Work, provided
121
+          that such additional attribution notices cannot be construed
122
+          as modifying the License.
123
+
124
+      You may add Your own copyright statement to Your modifications and
125
+      may provide additional or different license terms and conditions
126
+      for use, reproduction, or distribution of Your modifications, or
127
+      for any such Derivative Works as a whole, provided Your use,
128
+      reproduction, and distribution of the Work otherwise complies with
129
+      the conditions stated in this License.
130
+
131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
132
+      any Contribution intentionally submitted for inclusion in the Work
133
+      by You to the Licensor shall be under the terms and conditions of
134
+      this License, without any additional terms or conditions.
135
+      Notwithstanding the above, nothing herein shall supersede or modify
136
+      the terms of any separate license agreement you may have executed
137
+      with Licensor regarding such Contributions.
138
+
139
+   6. Trademarks. This License does not grant permission to use the trade
140
+      names, trademarks, service marks, or product names of the Licensor,
141
+      except as required for reasonable and customary use in describing the
142
+      origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+   7. Disclaimer of Warranty. Unless required by applicable law or
145
+      agreed to in writing, Licensor provides the Work (and each
146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+      implied, including, without limitation, any warranties or conditions
149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
151
+      appropriateness of using or redistributing the Work and assume any
152
+      risks associated with Your exercise of permissions under this License.
153
+
154
+   8. Limitation of Liability. In no event and under no legal theory,
155
+      whether in tort (including negligence), contract, or otherwise,
156
+      unless required by applicable law (such as deliberate and grossly
157
+      negligent acts) or agreed to in writing, shall any Contributor be
158
+      liable to You for damages, including any direct, indirect, special,
159
+      incidental, or consequential damages of any character arising as a
160
+      result of this License or out of the use or inability to use the
161
+      Work (including but not limited to damages for loss of goodwill,
162
+      work stoppage, computer failure or malfunction, or any and all
163
+      other commercial damages or losses), even if such Contributor
164
+      has been advised of the possibility of such damages.
165
+
166
+   9. Accepting Warranty or Additional Liability. While redistributing
167
+      the Work or Derivative Works thereof, You may choose to offer,
168
+      and charge a fee for, acceptance of support, warranty, indemnity,
169
+      or other liability obligations and/or rights consistent with this
170
+      License. However, in accepting such obligations, You may act only
171
+      on Your own behalf and on Your sole responsibility, not on behalf
172
+      of any other Contributor, and only if You agree to indemnify,
173
+      defend, and hold each Contributor harmless for any liability
174
+      incurred by, or claims asserted against, such Contributor by reason
175
+      of your accepting any such warranty or additional liability.
176
+
177
+   END OF TERMS AND CONDITIONS
178
+
179
+   APPENDIX: How to apply the Apache License to your work.
180
+
181
+      To apply the Apache License to your work, attach the following
182
+      boilerplate notice, with the fields enclosed by brackets "[]"
183
+      replaced with your own identifying information. (Don't include
184
+      the brackets!)  The text should be enclosed in the appropriate
185
+      comment syntax for the file format. We also recommend that a
186
+      file or class name and description of purpose be included on the
187
+      same "printed page" as the copyright notice for easier
188
+      identification within third-party archives.
189
+
190
+   Copyright [yyyy] [name of copyright owner]
191
+
192
+   Licensed under the Apache License, Version 2.0 (the "License");
193
+   you may not use this file except in compliance with the License.
194
+   You may obtain a copy of the License at
195
+
196
+       http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+   Unless required by applicable law or agreed to in writing, software
199
+   distributed under the License is distributed on an "AS IS" BASIS,
200
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+   See the License for the specific language governing permissions and
202
+   limitations under the License.

BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Black.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-BlackItalic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Bold.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-BoldItalic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Italic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Light.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-LightItalic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Medium.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-MediumItalic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Regular.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-Thin.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/Roboto/Roboto-ThinItalic.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/materialdesignicons-webfont.ttf View File


BIN
Site-Proximo-v1/assets/css/fonts/materialdesignicons-webfont.woff View File


BIN
Site-Proximo-v1/assets/css/fonts/materialdesignicons-webfont.woff2 View File


+ 239
- 0
Site-Proximo-v1/assets/css/general.css View File

@@ -0,0 +1,239 @@
1
+.text-proximo {
2
+    color: #FB5F03 !important;
3
+}
4
+
5
+.bg-proximo {
6
+    background: #FB5F03 !important;
7
+}
8
+
9
+#mainContainer {
10
+    min-height:100%;
11
+    position:relative;
12
+}
13
+
14
+#contentContainer {
15
+    margin-bottom: 0;
16
+    /* Height of the footer */
17
+    padding: 0 0 250px;
18
+    overflow: hidden;
19
+}
20
+
21
+.footer-copyright {
22
+    background-color: #e5e5e5;
23
+}
24
+
25
+#navbarLogo, #navbarNav, #navbarLogoMobile {
26
+    height: 64px;
27
+    line-height: 64px;
28
+}
29
+
30
+#navbarLogo img, #navbarLogoMobile img {
31
+    max-height: 100%;
32
+    max-width: 100%;
33
+    padding: 12px;
34
+}
35
+
36
+#navbarLogoMobile {
37
+    display: none;
38
+}
39
+
40
+.main-section-text {
41
+    font-size: 2rem;
42
+}
43
+
44
+.section-text {
45
+    font-size: 1.5rem;
46
+}
47
+
48
+.main-section-title {
49
+    font-size: 3rem;
50
+}
51
+
52
+.scrollingload {
53
+    opacity: 0;
54
+}
55
+
56
+.jarallax {
57
+    overflow: hidden;
58
+}
59
+
60
+.link-effect {
61
+    position: absolute;
62
+    bottom: 0;
63
+    height: 10px;
64
+    width: 100%;
65
+    background-color: #FB5F03;
66
+    transition: 0.1s;
67
+    -webkit-clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%);
68
+    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%);
69
+}
70
+
71
+.link-hovered {
72
+    -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
73
+    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
74
+}
75
+
76
+.link-active {
77
+    -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
78
+    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
79
+}
80
+
81
+#headerJumbotron {
82
+    padding: 0;
83
+    height: 40vh;
84
+    border-radius: 0;
85
+    margin: 0 0 64px; /* height of navbar */
86
+    background: rgb(166,61,0);
87
+    background: linear-gradient(157deg, rgba(166,61,0,1) 0%, rgba(251,95,3,1) 35%, rgba(255,162,108,1) 100%);
88
+}
89
+
90
+#headerTitleContainer{
91
+    z-index: 1;
92
+    position: absolute;
93
+    top: 10%;
94
+    width: 100%;
95
+    color: #e8e8e8;
96
+}
97
+
98
+#headerTitle {
99
+    font-size: 5rem;
100
+    text-shadow: 0 0 10px #555555;
101
+    opacity: 0;
102
+}
103
+
104
+#headerSubTitle {
105
+    text-shadow: 0 0 5px #4c4c4c;
106
+    opacity: 0;
107
+}
108
+
109
+
110
+.jconfirm.jconfirm-supervan .jconfirm-bg {
111
+    background-color: rgb(0, 0, 0);
112
+}
113
+
114
+.section-separator-top, .section-separator-bottom {
115
+    background-color: #FB5F03;
116
+    height: 50px;
117
+    width: 100%;
118
+}
119
+
120
+.section-separator-top {
121
+    -webkit-clip-path: polygon(0 0, 0% 100%, 100% 100%);
122
+    clip-path: polygon(0 0, 0% 100%, 100% 100%);
123
+}
124
+
125
+.section-separator-bottom {
126
+    -webkit-clip-path: polygon(0 0, 0% 100%, 100% 0);
127
+    clip-path: polygon(0 0, 0% 100%, 100% 0);
128
+}
129
+
130
+#socialLinks {
131
+    font-size: 4rem;
132
+}
133
+
134
+.hamburger {
135
+    display: none;
136
+}
137
+
138
+.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content {
139
+    font-size: 1.2rem;
140
+    color: #d7d7d7;
141
+}
142
+
143
+@media
144
+only screen and (max-width: 1199px) {
145
+    .hamburger {
146
+        display: inline-block;
147
+    }
148
+
149
+    .section-separator-top, .section-separator-bottom {
150
+        height: 35px;
151
+    }
152
+
153
+    #mainJumbotron:after {
154
+        box-shadow: inset 0 0 150px 50px rgba(0, 0, 0, 0.8);
155
+    }
156
+
157
+    .main-section-text {
158
+        font-size: 1.8rem;
159
+    }
160
+
161
+    .section-text {
162
+        font-size: 1.4rem;
163
+    }
164
+
165
+    .main-section-title {
166
+        font-size: 2.5rem;
167
+    }
168
+
169
+    #headerTitle {
170
+        font-size: 4rem;
171
+    }
172
+
173
+    #headerSubTitle {
174
+        font-size: 1.8rem;
175
+    }
176
+
177
+    #navbarLogoMobile {
178
+        display: block;
179
+        margin: auto;
180
+    }
181
+}
182
+
183
+@media
184
+only screen and (max-width: 575px) {
185
+    #contentContainer {
186
+        /* Height of the footer */
187
+        padding-bottom: 300px;
188
+    }
189
+
190
+    .section-separator-top, .section-separator-bottom {
191
+        height: 20px;
192
+    }
193
+
194
+    #mainJumbotron:after {
195
+        box-shadow: inset 0 0 150px 50px rgba(0, 0, 0, 0.8);
196
+    }
197
+
198
+    .main-section-text {
199
+        font-size: 1.2rem;
200
+    }
201
+
202
+    .section-text {
203
+        font-size: 1.1rem;
204
+    }
205
+
206
+    .main-section-title {
207
+        font-size: 2rem;
208
+    }
209
+
210
+    #headerTitle {
211
+        font-size: 3rem;
212
+        width: 100%;
213
+    }
214
+
215
+    #headerSubTitle {
216
+        font-size: 1.2rem;
217
+        text-align: center;
218
+    }
219
+
220
+    #navbarLogoMobile {
221
+        width: 70%;
222
+    }
223
+
224
+    .image-fixed-text-container {
225
+        width: 90%;
226
+    }
227
+
228
+    .jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content {
229
+        font-size: 1rem;
230
+    }
231
+
232
+    .jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c .jconfirm-title {
233
+        font-size: 1.4rem;
234
+    }
235
+
236
+    .jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c > * {
237
+        padding-bottom: 0;
238
+    }
239
+}

+ 69
- 0
Site-Proximo-v1/assets/css/hamburger.css View File

@@ -0,0 +1,69 @@
1
+.hamburger {
2
+    position: relative;
3
+    cursor: pointer;
4
+    font-size: 32px;
5
+    margin: auto 5px;
6
+    height: 40px;
7
+    width: 40px;
8
+    pointer-events: auto;
9
+}
10
+
11
+.bar1, .bar2-1, .bar2-2, .bar3 {
12
+    position: absolute;
13
+    width: 40px;
14
+    height: 5px;
15
+    background-color: #404040;
16
+    margin: 5px 0;
17
+    transition: 0.3s;
18
+}
19
+
20
+.bar1 {
21
+    top: 0;
22
+}
23
+
24
+.bar2-1, .bar2-2 {
25
+    margin: 0;
26
+    width: 20px;
27
+    top: 50%;
28
+    transform: translateY(-50%);
29
+}
30
+
31
+.bar2-1 {
32
+    left: 0;
33
+}
34
+
35
+.bar2-2 {
36
+    right: 0;
37
+}
38
+
39
+.bar3 {
40
+    bottom: 0;
41
+}
42
+
43
+/* Rotate first bar */
44
+
45
+.change .bar1 {
46
+    -webkit-transform: rotate(-45deg) translate(-10px, 10px);
47
+    transform: rotate(-45deg) translate(-8px, 8px);
48
+}
49
+
50
+/* Fade out the second bar */
51
+
52
+.change .bar2-1 {
53
+    opacity: 0;
54
+    -webkit-transform: translateX(-50%);
55
+    transform: translateX(-50%);
56
+}
57
+
58
+.change .bar2-2 {
59
+    opacity: 0;
60
+    -webkit-transform: translateX(50%);
61
+    transform: translateX(50%);
62
+}
63
+
64
+/* Rotate last bar */
65
+
66
+.change .bar3 {
67
+    -webkit-transform: rotate(45deg) translate(-10px, -10px);
68
+    transform: rotate(45deg) translate(-10px, -10px);
69
+}

+ 0
- 0
Site-Proximo-v1/assets/css/index.css View File


+ 3625
- 0
Site-Proximo-v1/assets/css/libs/animatecss.css
File diff suppressed because it is too large
View File


+ 7
- 0
Site-Proximo-v1/assets/css/libs/bootstrap.min.css
File diff suppressed because it is too large
View File


+ 9
- 0
Site-Proximo-v1/assets/css/libs/jquery-confirm.min.css
File diff suppressed because it is too large
View File


+ 3
- 0
Site-Proximo-v1/assets/css/libs/materialdesignicons.min.css
File diff suppressed because it is too large
View File


+ 77
- 0
Site-Proximo-v1/assets/css/list.css View File

@@ -0,0 +1,77 @@
1
+#dataList {
2
+    list-style: none;
3
+    margin: auto;
4
+    padding: 0;
5
+}
6
+
7
+#dataList li {
8
+    height: 50px;
9
+    line-height: 50px;
10
+    display: flex;
11
+    cursor: pointer;
12
+    transition: 0.2s;
13
+    padding: 0 20px 0 20px;
14
+}
15
+
16
+#dataList li:hover {
17
+    background-color: #e5e5e5;
18
+}
19
+
20
+#dataList li div {
21
+    margin: auto;
22
+    display: flex;
23
+    width: 100%;
24
+}
25
+
26
+#dataList li div span {
27
+    margin-right: 5px;
28
+    height: 50px;
29
+}
30
+
31
+#listContainer {
32
+    display: flex;
33
+    margin: 20px 0 20px 0;
34
+}
35
+
36
+#listContainer .mdi {
37
+    font-size: 2rem;
38
+}
39
+
40
+.list-name {
41
+    font-weight: bold;
42
+    width: 200px;
43
+    height: 50px;
44
+    overflow: hidden;
45
+}
46
+
47
+.list-description {
48
+    width: 200px;
49
+    height: 50px;
50
+    overflow: hidden;
51
+    font-size: 0.8rem;
52
+    line-height: 25px;
53
+}
54
+
55
+.list-price {
56
+    width: 70px;
57
+    text-align: center;
58
+}
59
+
60
+.list-code {
61
+    color: #8e8e8e;
62
+    width: 200px;
63
+    text-align: right;
64
+}
65
+
66
+.list-image  {
67
+    width: 50px;
68
+    height: 50px;
69
+    display: flex;
70
+}
71
+
72
+
73
+.list-image img {
74
+    width: 45px;
75
+    height: 45px;
76
+    margin: auto;
77
+}

+ 37
- 0
Site-Proximo-v1/assets/css/sidenav.css View File

@@ -0,0 +1,37 @@
1
+/* The side navigation menu */
2
+
3
+#sidenav {
4
+    position: fixed;
5
+    height: 100%;
6
+    width: 100%;
7
+    z-index: 1300;
8
+    top: 0;
9
+    left: 0;
10
+    transition: 0.5s;
11
+    text-align: center;
12
+    background: #ffffff;
13
+    transform: translateX(-100%);
14
+    padding-top: 30px;
15
+    -webkit-clip-path: circle(0% at 50% 50%);
16
+    clip-path: circle(0% at 50% 50%);
17
+}
18
+
19
+.sidenav-open {
20
+    transform: translateX(0%) !important;
21
+    -webkit-clip-path: circle(70.7% at 50% 50%) !important;
22
+    clip-path: circle(70.7% at 50% 50%) !important;
23
+}
24
+
25
+#sidenavScroll {
26
+    height: 100%;
27
+    width: 100%;
28
+    overflow-y: auto;
29
+    display: block;
30
+}
31
+
32
+
33
+#sidenavList {
34
+    padding: 0;
35
+    width: 300px;
36
+    margin: auto;
37
+}

+ 52
- 0
Site-Proximo-v1/assets/css/stock.css View File

@@ -0,0 +1,52 @@
1
+#dataList {
2
+    display: flex;
3
+    flex-wrap: wrap;
4
+    grid-template-columns: auto auto ;
5
+    width: 100%;
6
+}
7
+
8
+.img-container {
9
+    display: flex;
10
+    width: 100px;
11
+    height: 100px;
12
+    margin-bottom: 5px;
13
+}
14
+
15
+.grid-item {
16
+    display: flex;
17
+    margin: 10px;
18
+}
19
+
20
+
21
+.grid-container {
22
+    width: 100px;
23
+    margin: auto;
24
+    display: block;
25
+}
26
+
27
+.grid-container input {
28
+    width: 100px;
29
+}
30
+
31
+.grid-container p, .grid-container h5 {
32
+    text-align: center;
33
+}
34
+
35
+.grid-container h5 {
36
+    overflow: hidden;
37
+}
38
+
39
+.grid-container img {
40
+    margin: auto;
41
+    height: 100%;
42
+    width: 100%;
43
+    object-fit: contain;
44
+}
45
+
46
+.button-container {
47
+    display: flex;
48
+}
49
+
50
+.button-container button {
51
+    margin: auto;
52
+}

BIN
Site-Proximo-v1/assets/images/favicon.png View File


BIN
Site-Proximo-v1/assets/images/proximo.png View File


+ 101
- 0
Site-Proximo-v1/assets/js/ajaxManager.js View File

@@ -0,0 +1,101 @@
1
+
2
+class AjaxManager {
3
+
4
+    static async getAll() {
5
+        let categories = await AjaxManager.get('category');
6
+        let articles = await AjaxManager.get('article');
7
+        let article_categories = await AjaxManager.get('article_categories');
8
+        return {articles: articles, categories: categories, article_categories: article_categories};
9
+    }
10
+
11
+    static async get(type) {
12
+        let data = {
13
+            type: type,
14
+            action: 'get',
15
+        };
16
+        let response = await $.ajax({
17
+            type: "POST",
18
+            url: "json_ajax.php",
19
+            data: JSON.stringify(data),
20
+            dataType: "json",
21
+            contentType: "application/json; charset=utf-8",
22
+        });
23
+        console.log(response);
24
+        return response['data'];
25
+    }
26
+
27
+    static async delete(id, type) {
28
+        let data = {
29
+            type: type,
30
+            action: 'remove',
31
+            data: id,
32
+        };
33
+        let response = await $.ajax({
34
+            type: "POST",
35
+            url: "json_ajax.php",
36
+            data: JSON.stringify(data),
37
+            dataType: "json",
38
+            contentType: "application/json; charset=utf-8",
39
+        });
40
+        console.log(response);
41
+        return response['status'];
42
+    }
43
+
44
+    static async save(data, isNew, type) {
45
+        let formattedData = {
46
+            type: type,
47
+            action: isNew ? 'create' : 'update',
48
+            data: data,
49
+        };
50
+        let response = await $.ajax({
51
+            type: "POST",
52
+            url: "json_ajax.php",
53
+            data: JSON.stringify(formattedData),
54
+            dataType: "json",
55
+            contentType: "application/json; charset=utf-8",
56
+        });
57
+        console.log(response);
58
+        return response['data'];
59
+    }
60
+
61
+    static async saveArticleImage(image, id) {
62
+        if (image !== undefined) {
63
+            let formData = new FormData();
64
+            formData.append('type', 'image');
65
+            formData.append('data', id);
66
+            formData.append('image', image);
67
+            let response = await $.ajax({
68
+                type: "POST",
69
+                url: "form_ajax.php",
70
+                data: formData,
71
+                cache: false,
72
+                contentType: false,
73
+                processData: false,
74
+            });
75
+            response = JSON.parse(response);
76
+            console.log(response);
77
+            return response['status'];
78
+        } else
79
+            return 1;
80
+    }
81
+
82
+    static async saveStockChange(data, isSell) {
83
+        let formattedData = {
84
+            type: 'stock',
85
+            action: isSell ? 'sell' : 'buy',
86
+            data: data,
87
+        };
88
+        let response = await $.ajax({
89
+            type: "POST",
90
+            url: "json_ajax.php",
91
+            data: JSON.stringify(formattedData),
92
+            dataType: "json",
93
+            contentType: "application/json; charset=utf-8",
94
+        });
95
+        console.log(response);
96
+        return response['data'];
97
+    }
98
+}
99
+
100
+
101
+

+ 37
- 0
Site-Proximo-v1/assets/js/articles.js View File

@@ -0,0 +1,37 @@
1
+let listManager;
2
+
3
+$(document).ready(function () {
4
+    listManager = new ListManager($("#dataList"), 'article',
5
+        [
6
+            {
7
+                name: 'image',
8
+                description: 'Image',
9
+                type: 'image'
10
+            },
11
+            {
12
+                name: 'name',
13
+                description: 'Nom',
14
+                type: 'text'
15
+            },
16
+            {
17
+                name: 'description',
18
+                description: 'Description',
19
+                type: 'text'
20
+            },
21
+            {
22
+                name: 'price',
23
+                description: 'Prix',
24
+                type: 'text'
25
+            },
26
+            {
27
+                name: 'code',
28
+                description: 'Code',
29
+                type: 'text'
30
+            },
31
+            {
32
+                name: 'category',
33
+                description: 'Catégories',
34
+                type: 'checkboxes'
35
+            },
36
+        ]);
37
+});

+ 17
- 0
Site-Proximo-v1/assets/js/categories.js View File

@@ -0,0 +1,17 @@
1
+let listManager;
2
+
3
+$(document).ready(function () {
4
+    listManager = new ListManager($("#dataList"), 'category',
5
+        [
6
+            {
7
+                name: 'icon',
8
+                description: 'Icone',
9
+                type: 'icon'
10
+            },
11
+            {
12
+                name: 'name',
13
+                description: 'Nom',
14
+                type: 'text'
15
+            },
16
+        ]);
17
+});

+ 55
- 0
Site-Proximo-v1/assets/js/index.js View File

@@ -0,0 +1,55 @@
1
+$('#uploadButton').on('click', function () {
2
+    $.confirm({
3
+        title: 'Confirmer',
4
+        content: "Voulez vous vraiment mettre en ligne le stock actuel du Proximo ? Il sera visible depuis l'application CAMPUS.",
5
+        type: "orange",
6
+        buttons: {
7
+            formSubmit: {
8
+                text: 'Confirmer',
9
+                btnClass: "btn-warning",
10
+                action: function () {
11
+                    $.confirm({
12
+                        columnClass: "small",
13
+                        content: function () {
14
+                            let self = this;
15
+                            return $.ajax({
16
+                                type: "POST",
17
+                                url: "write_json.php",
18
+                            }).done((data) => {
19
+                                const response = JSON.parse(data);
20
+                                if (response["status"] === 0) {
21
+                                    self.setTitle("Succès");
22
+                                    self.setContent('Le stock a bien été mis à jour.');
23
+                                    self.setType("green");
24
+                                } else {
25
+                                    self.setTitle("Erreur");
26
+                                    self.setContent('Une erreur est survenue, merci de réessayer plus tard.<br/><br/>' + response["message"]);
27
+                                    self.setType("red");
28
+                                }
29
+                            }).fail(() => {
30
+                                self.setTitle("Erreur");
31
+                                self.setContent('Une erreur est survenue, merci de réessayer plus tard.');
32
+                                self.setType("red");
33
+                            });
34
+                        },
35
+                        type: "orange",
36
+                    })
37
+                }
38
+            },
39
+            cancel: {
40
+                text: 'Annuler',
41
+            }
42
+        }
43
+    });
44
+});
45
+
46
+$('#errorButton').on('click', function () {
47
+    $.confirm({
48
+        title: 'Contacter le développeur',
49
+        content: "Choisis le moyen de contact que tu souhaites :<br/>" +
50
+            "<ul>" +
51
+            "<li><strong>Mail: </strong><a href='mailto:vergnet@etud.insa-toulouse.fr'>vergnet@etud.insa-toulouse.fr</a></li>" +
52
+            "<li><strong>Facebook: </strong><a href='https://www.facebook.com/arnaud.vergnet/' target='_blank'>Arnaud Vergnet</a></li>" +
53
+            "</ul>"
54
+    });
55
+});

+ 72
- 0
Site-Proximo-v1/assets/js/init.js View File

@@ -0,0 +1,72 @@
1
+(function ($) {
2
+    /**
3
+     * Get an HTMLElement using Jquery, and store them in a cache for a faster access later
4
+     * @param selector {String} The Jquery selector to use
5
+     * @return {(jQuery.fn.init | jQuery | HTMLElement)} The JQuery HTMLElement
6
+     */
7
+    $.selector_cache = function (selector) {
8
+        if (!$.selector_cache[selector]) {
9
+            $.selector_cache[selector] = $(selector);
10
+        }
11
+        return $.selector_cache[selector];
12
+    };
13
+})(jQuery); // Edit JQuery namespace to use the function as $.selector_cache('#elements');
14
+
15
+
16
+$(document).ready(function () {
17
+    loadHeader();
18
+    fixheader();
19
+});
20
+
21
+
22
+
23
+$.selector_cache('.nav-item')
24
+    .on('mouseover', function () {
25
+        $(this).find('.link-effect').addClass('link-hovered');
26
+    })
27
+    .on('mouseleave', function () {
28
+        $(this).find('.link-effect').removeClass('link-hovered');
29
+    }).on('click', function () {
30
+    $(this).find('.link-effect').removeClass('link-hovered');
31
+    $(this).find('.link-effect').addClass('link-active');
32
+});
33
+
34
+/**
35
+ * Stop the header from changing height on mobile (with fullscreen browsing)
36
+ */
37
+function fixheader() {
38
+    if ($.selector_cache("#headerJumbotron").length > 0) {
39
+        let height = $(window).height() * 0.4;
40
+        $.selector_cache('#headerJumbotron').css('height', height);
41
+    }
42
+}
43
+
44
+function loadHeader() {
45
+    if ($.selector_cache("#headerJumbotron").length > 0) {
46
+        animateCss($.selector_cache('#headerTitle'), 'fadeInUp faster');
47
+        $.selector_cache('#headerTitle').css('opacity', 1);
48
+        setTimeout(function () {
49
+            animateCss($.selector_cache('#headerSubTitle'), 'fadeInUp faster');
50
+            $.selector_cache('#headerSubTitle').css('opacity', 1);
51
+        }, 100);
52
+
53
+        setTimeout(function () {
54
+            $.selector_cache('#headerTop').addClass('loaded');
55
+        }, 100);
56
+
57
+        setTimeout(function () {
58
+            $.selector_cache('#headerBottom').addClass('loaded');
59
+        }, 300);
60
+    }
61
+}
62
+
63
+// Using animate.css, translated into jquery
64
+// https://github.com/daneden/animate.css
65
+function animateCss($elem, animationName, callback) {
66
+    $elem.addClass('animated ' + animationName);
67
+    $elem.on('animationend', function () {
68
+        $elem.removeClass('animated ' + animationName);
69
+        if (typeof callback === 'function')
70
+            callback();
71
+    });
72
+}

+ 73
- 0
Site-Proximo-v1/assets/js/jquery-confirm-defaults.js View File

@@ -0,0 +1,73 @@
1
+jconfirm.defaults = {
2
+    title: 'Title',
3
+    titleClass: '',
4
+    type: 'blue',
5
+    typeAnimated: true,
6
+    draggable: false,
7
+    dragWindowGap: 15,
8
+    dragWindowBorder: true,
9
+    animateFromElement: false,
10
+    smoothContent: true,
11
+    content: 'content',
12
+    escapeKey: 'ok',
13
+    buttons: {},
14
+    defaultButtons: {
15
+        ok: {
16
+            keys: ['enter'],
17
+            text: 'OK',
18
+            action: function () {
19
+            }
20
+        },
21
+        close: {
22
+            action: function () {
23
+            }
24
+        },
25
+    },
26
+    contentLoaded: function (data, status, xhr) {
27
+    },
28
+    icon: '',
29
+    lazyOpen: false,
30
+    bgOpacity: null,
31
+    theme: 'material',
32
+    animation: 'scale',
33
+    closeAnimation: 'scale',
34
+    animationSpeed: 300,
35
+    animationBounce: 1.3,
36
+    rtl: false,
37
+    container: 'body',
38
+    containerFluid: false,
39
+    backgroundDismiss: false,
40
+    backgroundDismissAnimation: 'shake',
41
+    autoClose: false,
42
+    closeIcon: null,
43
+    closeIconClass: false,
44
+    watchInterval: 100,
45
+    columnClass: 'xlarge',
46
+    boxWidth: '50%',
47
+    scrollToPreviousElement: true,
48
+    scrollToPreviousElementAnimate: true,
49
+    useBootstrap: true,
50
+    offsetTop: 40,
51
+    offsetBottom: 40,
52
+    bootstrapClasses: {
53
+        container: 'container',
54
+        containerFluid: 'container-fluid',
55
+        row: 'row',
56
+    },
57
+    onContentReady: function () {
58
+    },
59
+    onOpenBefore: function () {
60
+        // after the modal is displayed.
61
+        $('body').css('overflow', 'hidden');
62
+    },
63
+    onOpen: function () {
64
+    },
65
+    onClose: function () {
66
+        // before the modal is hidden.
67
+        $('body').css('overflow', 'auto');
68
+    },
69
+    onDestroy: function () {
70
+    },
71
+    onAction: function () {
72
+    }
73
+};

+ 7
- 0
Site-Proximo-v1/assets/js/libs/bootstrap.min.js
File diff suppressed because it is too large
View File


+ 10
- 0
Site-Proximo-v1/assets/js/libs/jquery-confirm.min.js
File diff suppressed because it is too large
View File


+ 2
- 0
Site-Proximo-v1/assets/js/libs/jquery.min.js
File diff suppressed because it is too large
View File


+ 2
- 0
Site-Proximo-v1/assets/js/libs/sortable.min.js
File diff suppressed because it is too large
View File


+ 346
- 0
Site-Proximo-v1/assets/js/listManager.js View File

@@ -0,0 +1,346 @@
1
+class ListManager {
2
+
3
+    currentData = [];
4
+    displayedData = [];
5
+    editableTypes = [];
6
+    type = '';
7
+
8
+    referredTable = [];
9
+    associationTable = [];
10
+
11
+    constructor(listContainer, type, editableTypes) {
12
+        this.listContainer = listContainer;
13
+        this.editableTypes = editableTypes;
14
+        this.type = type;
15
+
16
+        if (type === 'article') {
17
+            AjaxManager.getAll().then((data) => {
18
+                this.currentData = data['articles'];
19
+                this.referredTable = data['categories'];
20
+                this.associationTable = data['article_categories'];
21
+                this.generateList()
22
+            });
23
+        } else {
24
+            AjaxManager.get(type).then((data) => {
25
+                this.currentData = data;
26
+                this.generateList()
27
+            });
28
+        }
29
+    }
30
+
31
+    generateList() {
32
+        for (let i = 0; i < this.currentData.length; i++) {
33
+            this.createNewListEntry(this.currentData[i]);
34
+        }
35
+    }
36
+
37
+    createNewListEntry(item) {
38
+        let listItem = this.getListItem(item);
39
+        this.displayedData.push($(listItem));
40
+        const index = this.displayedData.length - 1;
41
+        let JQueryItem = this.displayedData[index];
42
+        this.listContainer.append(JQueryItem);
43
+        JQueryItem.on('click', () => {
44
+            this.showEditPopup(index);
45
+        });
46
+    }
47
+
48
+    deleteListEntry(id) {
49
+        $('#listItem_' + id).remove();
50
+    }
51
+
52
+    getCategoriesOfArticle(articleId) {
53
+        let filteredList = [];
54
+        for (let i = 0; i < this.associationTable.length; i++) {
55
+            if (this.associationTable[i]['article_id'] === articleId)
56
+                filteredList.push(this.associationTable[i]['category_id']);
57
+        }
58
+        return filteredList;
59
+    }
60
+
61
+    getCategoryOfId(categoryId) {
62
+        for (let i = 0; i < this.referredTable.length; i++) {
63
+            if (this.referredTable[i]['id'] === categoryId) {
64
+                return this.referredTable[i];
65
+            }
66
+        }
67
+        return "";
68
+    }
69
+
70
+    getCategoryIcons(articleId) {
71
+        let icons = "";
72
+        let categories = this.getCategoriesOfArticle(articleId);
73
+        for (let i = 0; i < categories.length; i++) {
74
+            icons += "<i class='mdi mdi-" + this.getCategoryOfId(categories[i])["icon"] + "' style='margin-right: 5px'></i>";
75
+        }
76
+        return icons;
77
+    }
78
+
79
+    getListItem(item) {
80
+        let listItem = "<li id='listItem_" + item["id"] + "'><div>";
81
+        for (let i = 0; i < this.editableTypes.length; i++) {
82
+            listItem += "<span class='list-" + this.editableTypes[i]["name"] + "'>";
83
+            if (this.editableTypes[i]["type"] === "icon")
84
+                listItem += "<i class='mdi mdi-" + item["icon"] + "' style='margin-right: 5px'></i></span>";
85
+            else if (this.editableTypes[i]["type"] === 'checkboxes') {
86
+                listItem += this.getCategoryIcons(item['id']);
87
+            } else if (this.editableTypes[i]["type"] === 'image') {
88
+                listItem += '<img src="../uploaded_images/' + item['id'] + '.jpg" /></span>'
89
+            } else
90
+                listItem += item[this.editableTypes[i]["name"]] + '</span>';
91
+        }
92
+        listItem += "</div></li>";
93
+        return listItem;
94
+    }
95
+
96
+    getCategoryCheckboxes(articleId) {
97
+        let checkboxes = "<div id='checkboxesContainer' style='display: flex'>";
98
+        let categories = [];
99
+        if (articleId !== undefined)
100
+            categories = this.getCategoriesOfArticle(articleId);
101
+        for (let i = 0; i < this.referredTable.length; i++) {
102
+            let id = this.referredTable[i]['id'];
103
+            let cat = this.getCategoryOfId(id);
104
+            let checked = categories.indexOf(id) !== -1 ? 'checked' : '';
105
+            checkboxes +=
106
+                '<div class="custom-control custom-checkbox" style="margin-right: 20px">\n' +
107
+                '<input type="checkbox" class="custom-control-input" id="checkbox_' + id + '"' + checked + ' >\n' +
108
+                '<label class="custom-control-label" for="checkbox_' + id + '">' +
109
+                '<i class="mdi mdi-' + cat["icon"] + '" style="margin-right: 5px"></i>' +
110
+                '</label>\n' +
111
+                '</div>';
112
+        }
113
+        checkboxes += '</div>';
114
+        return checkboxes;
115
+    }
116
+
117
+    getFormData(defaultValues, index) {
118
+        let formData = '<form id="popupForm" name="popupForm" method="post" enctype="multipart/form-data"><div class="form-group">';
119
+        for (let i = 0; i < this.editableTypes.length; i++) {
120
+            let inputId = this.editableTypes[i]['name'] + 'Input';
121
+            let inputName = this.editableTypes[i]['name'];
122
+            let inputType = this.editableTypes[i]['type'] === 'number' ? 'number' : 'text';
123
+            let value = defaultValues[this.editableTypes[i]['name']] !== undefined ? defaultValues[this.editableTypes[i]['name']] : '';
124
+            formData += '<label for="' + inputId + '">' + this.editableTypes[i]['description'] + ' :</label>';
125
+            if (this.editableTypes[i]['type'] === 'image') {
126
+                formData += this.getImagePicker(defaultValues['id'], index);
127
+            } else if (this.editableTypes[i]['type'] === 'checkboxes') {
128
+                formData += this.getCategoryCheckboxes(defaultValues['id']);
129
+            } else {
130
+                if (this.editableTypes[i]['name'] === 'icon'){
131
+                    formData += "<i id='" + inputId + "Icon' class='mdi mdi-" + value + "' style='margin-left: 5px'></i>";
132
+                    formData += '<input name="' + inputName + '" id="' + inputId + '" type="' + inputType + '" placeholder="Entrez une valeur" class="form-control" value="' + value + '" onchange="ListManager.onIconInputChange(this)" required />';
133
+                } else if (this.editableTypes[i]['name'] === 'description')
134
+                    formData += '<textarea name="' + inputName + '" id="' + inputId + '" type="' + inputType + '" placeholder="Entrez une valeur" class="form-control" required >' + value + '</textarea>';
135
+                else
136
+                    formData += '<input name="' + inputName + '" id="' + inputId + '" type="' + inputType + '" placeholder="Entrez une valeur" class="form-control" value="' + value + '" required />';
137
+            }
138
+        }
139
+        formData += "</div></form>";
140
+        return formData;
141
+    }
142
+
143
+    static onIconInputChange(input) {
144
+        const id = $(input).attr('id') + 'Icon';
145
+        $('#' + id).attr('class', 'mdi mdi-' + $(input).val());
146
+    }
147
+
148
+    getImagePicker(id, index) {
149
+        let imageSrc = undefined;
150
+        if (index !== -1)
151
+            imageSrc = $(this.displayedData[index].find("img")[0]).attr('src');
152
+        return (
153
+            '<img style="width: 50px; height: 50px" src="' + imageSrc + '" id="image_' + id + '"/>' +
154
+            '<div class="custom-file">\n' +
155
+            '<input ' +
156
+            'type="file" ' +
157
+            'class="custom-file-input" ' +
158
+            'id="fileInput"' +
159
+            'accept="image/jpeg"' +
160
+            'onchange="listManager.updatePickerImagePreview(this, \'image_' + id + '\')"' +
161
+            '>\n' +
162
+            '<label class="custom-file-label" for="customFile">Choose file</label>\n' +
163
+            '</div>');
164
+    }
165
+
166
+    updatePickerImagePreview(picker, previewId) {
167
+        $("#" + previewId).attr('src', window.URL.createObjectURL(picker.files[0]));
168
+    }
169
+
170
+    getFormValues(form) {
171
+        let values = [];
172
+        for (let i = 0; i < this.editableTypes.length; i++) {
173
+            values.push(form.find('#' + this.editableTypes[i]['name'] + 'Input').val())
174
+        }
175
+        return values;
176
+    }
177
+
178
+    isFormValid(values) {
179
+        let isValid = true;
180
+        for (let i = 0; i < values.length; i++) {
181
+            if (values[i] === '') {
182
+                isValid = false;
183
+                break;
184
+            }
185
+        }
186
+        return isValid;
187
+    }
188
+
189
+    getCheckedCategories(content) {
190
+        let checkedList = [];
191
+        let checkboxes = content.find('#checkboxesContainer').children();
192
+        for (let i = 0; i < checkboxes.length; i++) {
193
+            let input = $(checkboxes[i]).find('input')[0];
194
+            let id = $(input).attr('id').replace('checkbox_', '');
195
+            if (input.checked)
196
+                checkedList.push(id);
197
+        }
198
+        return checkedList;
199
+    }
200
+
201
+    insertFormDataIntoObject(values, object) {
202
+        for (let i = 0; i < values.length; i++) {
203
+            object[this.editableTypes[i]['name']] = values[i];
204
+        }
205
+        return object;
206
+    }
207
+
208
+    updateListItem(values, index) {
209
+        for (let i = 0; i < values.length; i++) {
210
+            if (this.editableTypes[i]['type'] === 'icon')
211
+                this.displayedData[index].find(".mdi")[0].className = "mdi mdi-" + values[i];
212
+            else
213
+                this.displayedData[index].find(".list-" + this.editableTypes[i]['name']).text(values[i]);
214
+        }
215
+    }
216
+
217
+    updateListItemCategories(categories, index) {
218
+        if (index === -1)
219
+            index = this.displayedData.length - 1;
220
+        let iconContainer = this.displayedData[index].find(".list-category");
221
+        iconContainer.html(this.getCategoryIcons(this.currentData[index]['id']));
222
+    }
223
+
224
+    updateAssociationList(articleId, newCategories) {
225
+        let newTable = [];
226
+        for (let i = 0; i < this.associationTable.length; i++) {
227
+            if (this.associationTable[i]['article_id'] !== articleId)
228
+                newTable.push(this.associationTable[i]);
229
+        }
230
+        for (let i = 0; i < newCategories.length; i++) {
231
+            newTable.push({article_id: articleId, category_id: newCategories[i]});
232
+        }
233
+        console.log(newTable);
234
+        this.associationTable = newTable;
235
+    }
236
+
237
+    updateArticleImage(image, index) {
238
+        if (index === -1)
239
+            index = this.displayedData.length - 1;
240
+        $(this.displayedData[index].find("img")[0]).attr('src', window.URL.createObjectURL(image));
241
+    }
242
+
243
+    showEditPopup(index) {
244
+        let defaultValues = {};
245
+        let title = "Créer une nouvelle entrée";
246
+        if (index !== -1) {
247
+            defaultValues = this.currentData[index];
248
+            title = "Modifier l'entrée";
249
+        }
250
+        let formData = this.getFormData(defaultValues, index);
251
+        let thisInstance = this;
252
+        $.confirm({
253
+            title: title,
254
+            content: formData,
255
+            buttons: {
256
+                formSubmit: {
257
+                    text: 'Sauvegarder',
258
+                    btnClass: 'btn-blue',
259
+                    action: async function () {
260
+                        let image = undefined;
261
+                        if (this.$content.find('input[type=file]').length > 0)
262
+                            image = this.$content.find('input[type=file]')[0].files[0];
263
+
264
+                        let values = thisInstance.getFormValues(this.$content);
265
+
266
+                        if (!thisInstance.isFormValid(values)) {
267
+                            $.alert('Merci de rentrer toutes les valeurs');
268
+                            return false;
269
+                        }
270
+                        let itemToSave = {};
271
+                        if (index !== -1) {
272
+                            itemToSave = thisInstance.currentData[index];
273
+                        }
274
+
275
+                        itemToSave = thisInstance.insertFormDataIntoObject(values, itemToSave);
276
+
277
+                        if (index !== -1) {
278
+                            thisInstance.currentData[index] = itemToSave;
279
+                            thisInstance.updateListItem(values, index);
280
+                        }
281
+                        let id = await AjaxManager.save(itemToSave, index === -1, thisInstance.type);
282
+                        if (id >= 0 && index === -1) {
283
+                            itemToSave["id"] = id;
284
+                            thisInstance.currentData[thisInstance.displayedData.length] = itemToSave;
285
+                            thisInstance.createNewListEntry(itemToSave);
286
+                        } else if (id === -1) {
287
+                            $.alert("Erreur serveur !");
288
+                        }
289
+                        if (id > 0 && thisInstance.type === 'article') {
290
+                            let categories = thisInstance.getCheckedCategories(this.$content);
291
+                            let data = {
292
+                                id: id,
293
+                                categories: categories
294
+                            };
295
+                            let result = await AjaxManager.save(data, true, 'article_categories');
296
+                            if (result) {
297
+                                thisInstance.updateAssociationList(id, categories);
298
+                                thisInstance.updateListItemCategories(categories, index);
299
+                                let imageResult = await AjaxManager.saveArticleImage(image, id);
300
+                                if (imageResult === 0)
301
+                                    thisInstance.updateArticleImage(image, index);
302
+                            }
303
+                        }
304
+                    }
305
+                },
306
+                deleteButton: {
307
+                    text: 'Supprimer',
308
+                    btnClass: 'btn-red',
309
+                    isHidden: index === -1,
310
+                    action: function () {
311
+                        thisInstance.showDeleteConfirmation(index);
312
+                    }
313
+                },
314
+                cancelButton: {
315
+                    text: 'Annuler',
316
+                },
317
+            }
318
+        });
319
+    }
320
+
321
+    showDeleteConfirmation(index) {
322
+        let thisInstance = this;
323
+        $.confirm({
324
+            title: "Confirmation",
325
+            content: "Êtes vous sûr de vouloir supprimer cette entrée ?",
326
+            buttons: {
327
+                deleteButton: {
328
+                    text: 'Confirmer',
329
+                    btnClass: 'btn-red',
330
+                    action: async function () {
331
+                        let id = thisInstance.currentData[index]['id'];
332
+                        let status = await AjaxManager.delete(id, thisInstance.type);
333
+                        if (status === 0)
334
+                            thisInstance.deleteListEntry(id);
335
+                        else
336
+                            $.alert("Erreur serveur !");
337
+                    }
338
+                },
339
+                cancelButton: {
340
+                    text: 'Annuler',
341
+                },
342
+            }
343
+        });
344
+    }
345
+
346
+}

+ 61
- 0
Site-Proximo-v1/assets/js/sidenav.js View File

@@ -0,0 +1,61 @@
1
+let menuOpen = false;
2
+let hamburger = $(".hamburger");
3
+
4
+/*
5
+ * Open navigation menu, change Hamburger icon to selected state
6
+ * and display the back button overlay over the page
7
+ */
8
+
9
+function openNav() {
10
+    $.selector_cache('#sidenav').addClass("sidenav-open");
11
+    enableHamburger();
12
+    menuOpen = true;
13
+}
14
+
15
+
16
+/*
17
+ * Close navigation menu, change Hamburger icon back to default state
18
+ * and hide the back button overlay
19
+ */
20
+function closeNav() {
21
+    $.selector_cache('#sidenav').removeClass("sidenav-open");
22
+    disableHamburger();
23
+    menuOpen = false;
24
+}
25
+
26
+
27
+/*
28
+ * Toggle the navigation bar
29
+ */
30
+function toggleNav() {
31
+    if (menuOpen) {
32
+        closeNav();
33
+    } else {
34
+        openNav();
35
+    }
36
+}
37
+
38
+function disableHamburger() {
39
+    $.selector_cache('.hamburger').removeClass("change");
40
+}
41
+
42
+function enableHamburger() {
43
+    $.selector_cache('.hamburger').addClass("change");
44
+}
45
+
46
+// Animate hamburger on hover
47
+$.selector_cache('.hamburger').hover(function(){
48
+    $.selector_cache('.bar1').css("background-color", "#e62b1e");
49
+    $.selector_cache('.bar2-1').css("background-color", "#e62b1e");
50
+    $.selector_cache('.bar2-2').css("background-color", "#e62b1e");
51
+    $.selector_cache('.bar2-1').css("left", "-5px");
52
+    $.selector_cache('.bar2-2').css("right", "-5px");
53
+    $.selector_cache('.bar3').css("background-color", "#e62b1e");
54
+}, function(){
55
+    $.selector_cache('.bar1').css("background-color", "#404040");
56
+    $.selector_cache('.bar2-1').css("background-color", "#404040");
57
+    $.selector_cache('.bar2-2').css("background-color", "#404040");
58
+    $.selector_cache('.bar2-1').css("left", "0");
59
+    $.selector_cache('.bar2-2').css("right", "0");
60
+    $.selector_cache('.bar3').css("background-color", "#404040");
61
+});

+ 120
- 0
Site-Proximo-v1/assets/js/stock.js View File

@@ -0,0 +1,120 @@
1
+let listContainer = $("#dataList");
2
+let displayedItems = [];
3
+let fetchedData = {};
4
+
5
+let currentMode = "buy";
6
+
7
+let sellClass = 'btn-danger';
8
+let buyClass = 'btn-success';
9
+
10
+$(document).ready(async function () {
11
+    await generateList();
12
+
13
+    $('#buyButton').addClass(buyClass);
14
+    $('#saveButton').addClass(buyClass);
15
+
16
+
17
+    $('#buyButton').on('click', function () {
18
+        if (!$(this).hasClass(buyClass)) {
19
+            $(this).addClass(buyClass);
20
+            $('#sellButton').removeClass(sellClass);
21
+            $('#saveButton').removeClass(sellClass).addClass(buyClass);
22
+            currentMode = "buy";
23
+        }
24
+    });
25
+    $('#sellButton').on('click', function () {
26
+        if (!$(this).hasClass(sellClass)) {
27
+            $(this).addClass(sellClass);
28
+            $('#buyButton').removeClass(buyClass);
29
+            $('#saveButton').removeClass(buyClass).addClass(sellClass);
30
+            currentMode = "sell";
31
+        }
32
+    });
33
+    $('#saveButton').on('click', function () {
34
+        let values = getValues();
35
+        let message = 'Voulez vous vraimer ajouter ces articles au stock ?<br><ul>';
36
+        let color = 'green';
37
+        if (currentMode === "sell"){
38
+            message = 'Voulez vous vraiment supprimer ces articles du stock ?<br><ul>';
39
+            color = 'red';
40
+        }
41
+        for (let  i = 0; i < values.length; i++) {
42
+            if (values[i]['value'] > 0){
43
+                message += '<li>' + fetchedData['articles'][i]['name'] + ' : ' + values[i]['value'] + '</li>'
44
+            }
45
+        }
46
+        message += '</ul>';
47
+        $.confirm({
48
+            title: 'Confirmer',
49
+            content: message,
50
+            type: color,
51
+            buttons: {
52
+                formSubmit: {
53
+                    text: 'Confirmer',
54
+                    action: async function () {
55
+                        await AjaxManager.saveStockChange(getFormattedValues(values), currentMode === "sell");
56
+                        await generateList();
57
+                    }
58
+                },
59
+                cancel: {
60
+                    text: 'Annuler',
61
+                }
62
+            }
63
+        });
64
+    });
65
+});
66
+
67
+function getListItem(item) {
68
+    const inputId = 'stockDiffInput' + item['id'];
69
+    const labelId = 'stockDiffLabel' + item['id'];
70
+    return (
71
+        '<div class="grid-item">' +
72
+        '<div class="grid-container">' +
73
+        '<div class="img-container">' +
74
+        '<img class="list-image" src="../uploaded_images/' + item['id'] + '.jpg"/>' +
75
+        '</div>' +
76
+        '<h5>' + item['name'] + '</h5>' +
77
+        '<p>Quantité : <strong>' + item['quantity'] + '</strong></p>' +
78
+        '<label for="' + inputId + '" id="' + labelId + '">À Ajouter :</label>' +
79
+        '<input id="' + inputId + '" placeholder="Nombre" type="number" value="0" class="form-control" onchange="onStockDiffInputChange(this)"/>' +
80
+        '</div>' +
81
+        '</div>');
82
+}
83
+
84
+function onStockDiffInputChange(input) {
85
+    if ($(input).val() < 0 || isNaN(parseInt($(input).val()))) {
86
+        $(input).val(0);
87
+    }
88
+}
89
+
90
+
91
+async function generateList() {
92
+    fetchedData = await AjaxManager.getAll();
93
+    displayedItems = [];
94
+    listContainer.html('');
95
+    for (let i = 0; i < fetchedData['articles'].length; i++) {
96
+        let listItem = getListItem(fetchedData['articles'][i]);
97
+        displayedItems.push($(listItem));
98
+        listContainer.append(displayedItems[i]);
99
+    }
100
+}
101
+
102
+
103
+function getValues() {
104
+    let values = [];
105
+    for (let  i = 0; i < displayedItems.length; i++) {
106
+        let value = displayedItems[i].find('input').val();
107
+        let id = fetchedData['articles'][i]['id'];
108
+        values.push({id: id, value: value});
109
+    }
110
+    return values;
111
+}
112
+
113
+function getFormattedValues(values) {
114
+    let newValues = [];
115
+    for (let  i = 0; i < values.length; i++) {
116
+        if (values[i]['value'] > 0)
117
+            newValues.push(values[i]);
118
+    }
119
+    return newValues;
120
+}

+ 169
- 0
Site-Proximo-v1/classes/dao.php View File

@@ -0,0 +1,169 @@
1
+<?php
2
+
3
+
4
+class Dao
5
+{
6
+    private $conn;
7
+
8
+    public function __construct()
9
+    {
10
+        $username = 'proximo';
11
+        $password = $this->read_password();
12
+        $dsn = 'mysql:dbname=proximo;host=127.0.0.1';
13
+        try {
14
+            $this->conn = new PDO($dsn, $username, $password, [PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8']);
15
+        } catch (PDOException $e) {
16
+            echo "error";
17
+            echo $e;
18
+        }
19
+    }
20
+
21
+    private function read_password()
22
+    {
23
+        $real_path = __DIR__ . DIRECTORY_SEPARATOR . ".htpassdb";
24
+        $file = fopen($real_path, "r") or die("Unable to open DB password file!");
25
+        $password = fgets($file);
26
+        fclose($file);
27
+        return trim($password);
28
+    }
29
+
30
+    public function get_articles()
31
+    {
32
+        $sql = 'SELECT * FROM articles';
33
+        $cursor = $this->conn->prepare($sql);
34
+        $cursor->execute();
35
+        return $cursor->fetchAll(PDO::FETCH_ASSOC);
36
+    }
37
+
38
+    public function get_article_of_code($code)
39
+    {
40
+        $sql = 'SELECT * FROM articles WHERE code=?';
41
+        $cursor = $this->conn->prepare($sql);
42
+        $cursor->execute([$code]);
43
+        return $cursor->fetchAll(PDO::FETCH_ASSOC)[0];
44
+    }
45
+
46
+    public function get_categories_of_article($articleid)
47
+    {
48
+        $sql = 'SELECT category_id FROM article_categories WHERE article_id=?';
49
+        $cursor = $this->conn->prepare($sql);
50
+        $cursor->execute([$articleid]);
51
+        $result = $cursor->fetchAll(PDO::FETCH_ASSOC);
52
+        $final = [];
53
+        foreach ($result as $row) {
54
+            array_push($final, $row["category_id"]);
55
+        }
56
+        return $final;
57
+    }
58
+
59
+    public function get_article_categories()
60
+    {
61
+        $sql = 'SELECT * FROM article_categories';
62
+        $cursor = $this->conn->prepare($sql);
63
+        $cursor->execute();
64
+        return $cursor->fetchAll(PDO::FETCH_ASSOC);
65
+    }
66
+
67
+    public function remove_article_categories_of_article($articleId)
68
+    {
69
+        $sql = 'DELETE FROM article_categories WHERE article_id=?';
70
+        $cursor = $this->conn->prepare($sql);
71
+        return $cursor->execute([$articleId]);
72
+    }
73
+
74
+    public function remove_article_categories_of_category($categoryId)
75
+    {
76
+        $sql = 'DELETE FROM article_categories WHERE category_id=?';
77
+        $cursor = $this->conn->prepare($sql);
78
+        return $cursor->execute([$categoryId]);
79
+    }
80
+
81
+    public function save_article_categories($articleId, $categories)
82
+    {
83
+        foreach ($categories as $category) {
84
+            $sql = 'INSERT INTO article_categories (article_id, category_id) VALUES (?, ?)';
85
+            $cursor = $this->conn->prepare($sql);
86
+            $data = [$articleId, $category];
87
+            $cursor->execute($data);
88
+        }
89
+        return 1;
90
+    }
91
+
92
+    public function get_categories()
93
+    {
94
+        $sql = 'SELECT * FROM categories';
95
+        $cursor = $this->conn->prepare($sql);
96
+        $cursor->execute();
97
+        return $cursor->fetchAll(PDO::FETCH_ASSOC);
98
+    }
99
+
100
+    public function create_category($category)
101
+    {
102
+        $sql = 'INSERT INTO categories (name, icon) VALUES (?, ?)';
103
+        $cursor = $this->conn->prepare($sql);
104
+        $data = [$category["name"], $category["icon"]];
105
+        $cursor->execute($data);
106
+        return $this->conn->lastInsertId();
107
+    }
108
+
109
+    public function update_category($category)
110
+    {
111
+        $sql = 'UPDATE categories SET name=?, icon=? WHERE id=?';
112
+        $cursor = $this->conn->prepare($sql);
113
+        $data = [$category["name"], $category["icon"], $category["id"]];
114
+        $cursor->execute($data);
115
+        return $category["id"];
116
+    }
117
+
118
+    public function remove_category($id)
119
+    {
120
+        $sql = 'DELETE FROM categories WHERE id=?';
121
+        $cursor = $this->conn->prepare($sql);
122
+        $data = [$id];
123
+        $result = $cursor->execute($data);
124
+        if ($result) {
125
+            $this->remove_article_categories_of_category($id);
126
+            return $cursor->rowCount();
127
+        } else
128
+            return 0;
129
+    }
130
+
131
+    public function create_article($article)
132
+    {
133
+        $sql = 'INSERT INTO articles (name, description, price, code) VALUES (?, ?, ?, ?)';
134
+        $cursor = $this->conn->prepare($sql);
135
+        $data = [$article["name"], $article["description"], $article["price"], $article["code"]];
136
+        $cursor->execute($data);
137
+        return $this->conn->lastInsertId();
138
+    }
139
+
140
+    public function update_article($article)
141
+    {
142
+        $sql = 'UPDATE articles SET name=?, description=?, price=?, code=? WHERE id=?';
143
+        $cursor = $this->conn->prepare($sql);
144
+        $data = [$article["name"], $article["description"], $article["price"], $article["code"], $article["id"]];
145
+        $cursor->execute($data);
146
+        return $article["id"];
147
+    }
148
+
149
+    public function remove_article($id)
150
+    {
151
+        $sql = 'DELETE FROM articles WHERE id=?';
152
+        $cursor = $this->conn->prepare($sql);
153
+        $data = [$id];
154
+        $result = $cursor->execute($data);
155
+        if ($result) {
156
+            $this->remove_article_categories_of_article($id);
157
+            return $cursor->rowCount();
158
+        } else
159
+            return 0;
160
+    }
161
+
162
+    public function update_article_stock($articleid, $diff)
163
+    {
164
+        $sql = 'UPDATE articles SET quantity=quantity+? WHERE id=?';
165
+        $cursor = $this->conn->prepare($sql);
166
+        $data = [$diff, $articleid];
167
+        return $cursor->execute($data);
168
+    }
169
+}

+ 258
- 0
Site-Proximo-v1/classes/postHandler.php View File

@@ -0,0 +1,258 @@
1
+<?php
2
+require_once 'dao.php';
3
+
4
+class PostHandler
5
+{
6
+    private $valid_types = ["article", "category", "article_categories", "image", "stock"];
7
+    private $valid_actions = ["create", "update", "remove", "get", "buy", "sell"];
8
+
9
+    private $action;
10
+    private $type;
11
+    private $postData;
12
+    private $filesData;
13
+    private $data;
14
+    private $dao;
15
+    private $uploadBaseDir = '../uploaded_images/';
16
+    private $stockFile = "../data/stock-v2.json";
17
+    private $imageBaseUrl = "https://etud.insa-toulouse.fr/~proximo/uploaded_images/";
18
+
19
+    private $responseArray = array(
20
+        "status" => 0,
21
+        "message" => "Success",
22
+        "data" => "",
23
+    );
24
+
25
+    public function __construct($post, $files)
26
+    {
27
+        $this->filesData = $files;
28
+        $this->action = $this->get_action($post);
29
+        $this->type = $this->get_type($post);
30
+        $this->data = $this->get_data($post);
31
+        $this->postData = $post;
32
+        $this->dao = new Dao();
33
+    }
34
+
35
+    public function do_action()
36
+    {
37
+        $result = -1;
38
+        if ($this->type == "image") {
39
+            $result = $this->save_image();
40
+        } else if ($this->type == "stock") {
41
+            $result = $this->updateStock();
42
+        } else if (count($this->data) > 0) {
43
+            if ($this->action == "create")
44
+                $result = $this->create();
45
+            else if ($this->action == "update")
46
+                $result = $this->update();
47
+            else if ($this->action == "remove")
48
+                $result = $this->remove();
49
+            else
50
+                $this->setUnknownActionResponse();
51
+        } else if ($this->action == "get")
52
+            $result = $this->get();
53
+        else
54
+            $this->setUnknownDataResponse();
55
+
56
+        if ($this->responseArray["status"] == 0 && $result < 0) {
57
+            $this->setProcessingErrorResponse();
58
+            $result = -1;
59
+        }
60
+        $this->responseArray["data"] = $result;
61
+        return $this->responseArray;
62
+    }
63
+
64
+    public function write_json()
65
+    {
66
+        $result = 0;
67
+        $array = array(
68
+            "types" => $this->dao->get_categories(),
69
+            "articles" => $this->get_articles_json_list(),
70
+        );
71
+        $fp = fopen($this->stockFile, "w");
72
+        if ($fp) {
73
+            fwrite($fp, json_encode($array));
74
+            fclose($fp);
75
+            $this->responseArray["data"] = $result;
76
+        } else {
77
+            $this->setFileErrorResponse();
78
+        }
79
+
80
+        return $this->responseArray;
81
+    }
82
+
83
+    public function get_articles_json_list()
84
+    {
85
+        $articles = $this->dao->get_articles();
86
+        $formatted_articles = [];
87
+        foreach ($articles as $article) {
88
+            $article["type"] = $this->dao->get_categories_of_article($article["id"]);
89
+            $article["image"] = $this->imageBaseUrl . $article["id"] . ".jpg";
90
+            array_push($formatted_articles, $article);
91
+        }
92
+        return $formatted_articles;
93
+    }
94
+
95
+    private function save_image()
96
+    {
97
+        $success = true;
98
+        if ($this->filesData["image"]["size"] > 0 && $this->data != null) {
99
+            $uploadPath = $this->uploadBaseDir . $this->data . ".jpg";
100
+
101
+            if (move_uploaded_file($this->filesData["image"]["tmp_name"], $uploadPath)) {
102
+                $this->responseArray["message"] = "Image upload success";
103
+            } else {
104
+                $this->responseArray["message"] = "Image upload failure: " . $uploadPath;
105
+                $this->responseArray["status"] = 1;
106
+                $success = false;
107
+            }
108
+        } else {
109
+            $this->responseArray["message"] = "No valid file to send";
110
+            $this->responseArray["status"] = 1;
111
+            $success = false;
112
+        }
113
+        if ($success)
114
+            return 0;
115
+        else
116
+            return json_encode($this->filesData) . "id: " . $this->data;
117
+    }
118
+
119
+    private function remove_image()
120
+    {
121
+        $uploadPath = $this->uploadBaseDir . $this->data["id"] . ".jpg";
122
+        if (file_exists($uploadPath) && unlink($uploadPath)) {
123
+            $this->responseArray["message"] = "Success: Deleted image";
124
+        } else if (!file_exists($uploadPath)) {
125
+            $this->responseArray["message"] = "Success: No image to delete";
126
+        } else {
127
+            $this->responseArray["message"] = "Success: Could not delete image";
128
+        }
129
+    }
130
+
131
+    function create()
132
+    {
133
+        $result = -1;
134
+        if ($this->type == "article") {
135
+            $result = $this->dao->create_article($this->data);
136
+        } else if ($this->type == "category") {
137
+            $result = $this->dao->create_category($this->data);
138
+        } else if ($this->type == "article_categories") {
139
+            $result = $this->dao->remove_article_categories_of_article($this->data['id']);
140
+            if ($result)
141
+                $result = $this->dao->save_article_categories($this->data['id'], $this->data['categories']);
142
+        } else
143
+            $this->setUnknownTypeResponse();
144
+        return $result;
145
+    }
146
+
147
+    function update()
148
+    {
149
+        $result = -1;
150
+        if ($this->type == "article") {
151
+            $result = $this->dao->update_article($this->data);
152
+        } else if ($this->type == "category") {
153
+            $result = $this->dao->update_category($this->data);
154
+        } else
155
+            $this->setUnknownTypeResponse();
156
+        return $result;
157
+    }
158
+
159
+    function remove()
160
+    {
161
+        $result = -1;
162
+        if ($this->type == "article") {
163
+            $result = $this->dao->remove_article($this->data);
164
+            if ($result != 0)
165
+                $this->remove_image();
166
+        } else if ($this->type == "category") {
167
+            $result = $this->dao->remove_category($this->data);
168
+        } else
169
+            $this->setUnknownTypeResponse();
170
+        if ($result == 0)
171
+            return -1;
172
+        else
173
+            return 1;
174
+    }
175
+
176
+    function get()
177
+    {
178
+        $result = -1;
179
+        if ($this->type == "article") {
180
+            $result = $this->dao->get_articles();
181
+        } else if ($this->type == "category") {
182
+            $result = $this->dao->get_categories();
183
+        } else if ($this->type == "article_categories") {
184
+            $result = $this->dao->get_article_categories();
185
+        } else
186
+            $this->setUnknownTypeResponse();
187
+        return $result;
188
+    }
189
+
190
+    function updateStock()
191
+    {
192
+        $result = 0;
193
+        foreach ($this->data as $row) {
194
+            $value = $row["value"];
195
+            if ($this->action == "sell")
196
+                $value = -$value;
197
+            $result = $this->dao->update_article_stock($row["id"], $value);
198
+            if (!$result)
199
+                break;
200
+        }
201
+        return $result;
202
+    }
203
+
204
+    function setUnknownTypeResponse()
205
+    {
206
+        $this->responseArray["status"] = 1;
207
+        $this->responseArray["message"] = "Error: Unknown type";
208
+    }
209
+
210
+    function setUnknownActionResponse()
211
+    {
212
+        $this->responseArray["status"] = 2;
213
+        $this->responseArray["message"] = "Error: Unknown action";
214
+    }
215
+
216
+    function setUnknownDataResponse()
217
+    {
218
+        $this->responseArray["status"] = 3;
219
+        $this->responseArray["message"] = "Error: Unknown data";
220
+    }
221
+
222
+    function setProcessingErrorResponse()
223
+    {
224
+        $this->responseArray["status"] = 4;
225
+        $this->responseArray["message"] = "Error: Data processing error";
226
+    }
227
+
228
+    function setFileErrorResponse()
229
+    {
230
+        $this->responseArray["status"] = 5;
231
+        $this->responseArray["message"] = "Error: Could not open file";
232
+    }
233
+
234
+    private function get_action($inputData)
235
+    {
236
+        if (!in_array($inputData["action"], $this->valid_actions))
237
+            return "";
238
+        else
239
+            return $inputData["action"];
240
+    }
241
+
242
+    private function get_type($inputData)
243
+    {
244
+        if (!in_array($inputData["type"], $this->valid_types))
245
+            return "";
246
+        else
247
+            return $inputData["type"];
248
+    }
249
+
250
+    private function get_data($inputData)
251
+    {
252
+        if ($inputData["data"] == null)
253
+            return [];
254
+        else
255
+            return $inputData["data"];
256
+    }
257
+
258
+}

+ 121
- 0
Site-Proximo-v1/classes/zapetteHandler.php View File

@@ -0,0 +1,121 @@
1
+<?php
2
+require_once 'dao.php';
3
+
4
+class ZapetteHandler
5
+{
6
+    private $valid_actions = ["scan", "validate",];
7
+
8
+    private $action;
9
+    private $data;
10
+    private $given_password;
11
+    private $dao;
12
+    private $password;
13
+
14
+    private $responseArray = array(
15
+        "status" => 0,
16
+        "message" => "Success",
17
+        "data" => "",
18
+    );
19
+
20
+    public function __construct($post)
21
+    {
22
+        $this->read_password();
23
+        $this->given_password = $this->get_password($post);
24
+        $this->action = $this->get_action($post);
25
+        $this->data = $this->get_data($post);
26
+        $this->dao = new Dao();
27
+    }
28
+
29
+    public function do_action()
30
+    {
31
+        $result = "";
32
+        if ($this->is_password_valid()) {
33
+            if ($this->action == "scan") {
34
+                $result = $this->get_scanned_article();
35
+                if (sizeof($result) == 0)
36
+                    $this->setUnknownCodeErrorResponse();
37
+            } else if ($this->action == "validate") {
38
+                $result = $this->update_stock();
39
+                if (!$result)
40
+                    $this->setUpdateStockErrorResponse();
41
+            }
42
+        } else {
43
+            $this->setWrongPasswordErrorResponse();
44
+        }
45
+
46
+
47
+        $this->responseArray["data"] = $result;
48
+        return $this->responseArray;
49
+    }
50
+
51
+    private function read_password() {
52
+        $real_path = __DIR__ . "/.htpasszapette";
53
+        $fp = fopen($real_path, 'r');
54
+        $this->password = trim(fread($fp, filesize($real_path)));
55
+        fclose($fp);
56
+    }
57
+
58
+    private function is_password_valid() {
59
+        return $this->given_password == $this->password;
60
+    }
61
+
62
+    private function get_scanned_article() {
63
+        $article = [];
64
+        if ($this->data != "") {
65
+            $article = $this->dao->get_article_of_code($this->data);
66
+        }
67
+        return $article;
68
+    }
69
+
70
+    private function update_stock() {
71
+        $result = false;
72
+        if ($this->data != "") {
73
+            foreach ($this->data as $row) {
74
+                $result = $this->dao->update_article_stock($row["id"], $row["quantity"]);
75
+            }
76
+        }
77
+        return $result;
78
+    }
79
+
80
+    function setWrongPasswordErrorResponse()
81
+    {
82
+        $this->responseArray["status"] = 1;
83
+        $this->responseArray["message"] = "Error: Wrong password";
84
+    }
85
+
86
+    function setUnknownCodeErrorResponse()
87
+    {
88
+        $this->responseArray["status"] = 2;
89
+        $this->responseArray["message"] = "Error: Unknown code scanned";
90
+    }
91
+
92
+    function setUpdateStockErrorResponse()
93
+    {
94
+        $this->responseArray["status"] = 3;
95
+        $this->responseArray["message"] = "Error: Impossible to update stock";
96
+    }
97
+
98
+    private function get_action($inputData)
99
+    {
100
+        if (!in_array($inputData["action"], $this->valid_actions))
101
+            return "";
102
+        else
103
+            return $inputData["action"];
104
+    }
105
+
106
+    private function get_data($inputData)
107
+    {
108
+        if ($inputData["data"] == null)
109
+            return "";
110
+        else
111
+            return $inputData["data"];
112
+    }
113
+
114
+    private function get_password($inputData)
115
+    {
116
+        if ($inputData["password"] == null)
117
+            return "";
118
+        else
119
+            return $inputData["password"];
120
+    }
121
+}

+ 1
- 0
Site-Proximo-v1/includes/.htpassadmin View File

@@ -0,0 +1 @@
1
+bli:LFqJx9olAYDvk

+ 31
- 0
Site-Proximo-v1/includes/footer.php View File

@@ -0,0 +1,31 @@
1
+<footer class="p-0 shadow">
2
+    <div class="container-fluid text-center">
3
+        <div class="row">
4
+            <div class="col-lg p-3">
5
+                <h5 class="text-uppercase">À Propos de Proximo</h5>
6
+                <p class="text-center">
7
+                    Coucou
8
+                </p>
9
+            </div>
10
+            <div class="col-lg-2 text-center p-3">
11
+                <h3>SUIVEZ NOUS</h3>
12
+                <ul class="list-unstyled" id="socialLinks">
13
+                    <li>
14
+                        <a href="https://www.facebook.com/" target="_blank">
15
+                            <i class="fab fa-facebook"></i>
16
+                        </a>
17
+                    </li>
18
+                </ul>
19
+            </div>
20
+        </div>
21
+        <div class="footer-copyright text-center py-3 shadow">
22
+            Site du Proximo de l'INSA Toulouse
23
+            <br>
24
+            Copyright ©
25
+            <script type="text/javascript">
26
+                document.write(new Date().getFullYear().toString())
27
+            </script>
28
+            Arnaud VERGNET. Tous droits réservés.
29
+        </div>
30
+    </div>
31
+</footer>

+ 55
- 0
Site-Proximo-v1/includes/navbar.php View File

@@ -0,0 +1,55 @@
1
+<!--NAVBAR-->
2
+<nav class="navbar navbar-expand-xl sticky-top">
3
+    <div class="container-fluid">
4
+        <div class="hamburger" onclick="openNav()">
5
+            <div class="bar1"></div>
6
+            <div class="bar2-1"></div>
7
+            <div class="bar2-2"></div>
8
+            <div class="bar3"></div>
9
+        </div>
10
+        <a href="<?= $relativePath ?>index.php" id="navbarLogoMobile">
11
+            <img src="<?= $relativePath ?>assets/images/proximo.png" alt="">
12
+        </a>
13
+        <div class="collapse navbar-collapse" id="navbarNav">
14
+            <ul class="navbar-nav">
15
+                <li class="nav-item">
16
+                    <div class="link-effect clipped clipped"></div>
17
+                    <a class="nav-link" href="<?= $relativePath ?>index.php" id="navbarLogo">
18
+                        <img src="<?= $relativePath ?>assets/images/proximo.png" alt="">
19
+                    </a>
20
+                </li>
21
+                <li class="nav-item">
22
+                    <div class="link-effect clipped"></div>
23
+                    <a class="nav-link" href="<?= $relativePath ?>event.php">
24
+                        <i class="fas fa-cubes mr-2"></i>
25
+                        Stock
26
+                    </a>
27
+                </li>
28
+                <li class="nav-item">
29
+                    <div class="link-effect clipped"></div>
30
+                    <a class="nav-link" href="<?= $relativePath ?>contact.php">
31
+                        <!--Team an contact links-->
32
+                        <i class="fas fa-envelope mr-2"></i>
33
+                        Contact
34
+                    </a>
35
+                </li>
36
+                <li class="nav-item">
37
+                    <div class="link-effect clipped"></div>
38
+                    <a class="nav-link" href="<?= $relativePath ?>about.php">
39
+                        <!--Place and access-->
40
+                        <i class="fas fa-info-circle mr-2"></i>
41
+                        À Propos
42
+                    </a>
43
+                </li>
44
+                <li class="nav-item">
45
+                    <div class="link-effect clipped"></div>
46
+                    <a class="nav-link" href="<?= $relativePath ?>admin">
47
+                        <!--Place and access-->
48
+                        <i class="fas fa-sign-in-alt mr-2"></i>
49
+                        Connexion
50
+                    </a>
51
+                </li>
52
+            </ul>
53
+        </div>
54
+    </div>
55
+</nav>

+ 49
- 0
Site-Proximo-v1/includes/sidenav.php View File

@@ -0,0 +1,49 @@
1
+<div id="sidenav" onclick="closeNav()">
2
+    <div id="sidenavScroll">
3
+        <div class="hamburger" onclick="closeNav()">
4
+            <div class="bar1"></div>
5
+            <div class="bar2-1"></div>
6
+            <div class="bar2-2"></div>
7
+            <div class="bar3"></div>
8
+        </div>
9
+        <ul id="sidenavList">
10
+            <li class="nav-item">
11
+                <div class="link-effect clipped clipped"></div>
12
+                <a class="nav-link" href="<?= $relativePath ?>index.php" id="navbarLogo">
13
+                    <img src="<?= $relativePath ?>assets/images/proximo.png" alt="">
14
+                </a>
15
+            </li>
16
+            <li class="nav-item">
17
+                <div class="link-effect clipped"></div>
18
+                <a class="nav-link" href="<?= $relativePath ?>event.php">
19
+                    <i class="fas fa-cubes mr-2"></i>
20
+                    Stock
21
+                </a>
22
+            </li>
23
+            <li class="nav-item">
24
+                <div class="link-effect clipped"></div>
25
+                <a class="nav-link" href="<?= $relativePath ?>contact.php">
26
+                    <!--Team an contact links-->
27
+                    <i class="fas fa-envelope mr-2"></i>
28
+                    Contact
29
+                </a>
30
+            </li>
31
+            <li class="nav-item">
32
+                <div class="link-effect clipped"></div>
33
+                <a class="nav-link" href="<?= $relativePath ?>about.php">
34
+                    <!--Place and access-->
35
+                    <i class="fas fa-info-circle mr-2"></i>
36
+                    À Propos
37
+                </a>
38
+            </li>
39
+            <li class="nav-item">
40
+                <div class="link-effect clipped"></div>
41
+                <a class="nav-link" href="<?= $relativePath ?>admin">
42
+                    <!--Place and access-->
43
+                    <i class="fas fa-sign-in-alt mr-2"></i>
44
+                    Connexion
45
+                </a>
46
+            </li>
47
+        </ul>
48
+    </div>
49
+</div>

+ 66
- 0
Site-Proximo-v1/includes/template.php View File

@@ -0,0 +1,66 @@
1
+<?php
2
+
3
+if (!isset($relativePath))
4
+    $relativePath = "";
5
+
6
+if (!isset($pageScripts))
7
+    $pageScripts = "";
8
+
9
+if (!isset($hasHeader))
10
+    $hasHeader = false;
11
+
12
+?>
13
+
14
+<!DOCTYPE html>
15
+<html>
16
+<head>
17
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
18
+    <title><?= $pageTitle ?> | Proximo</title>
19
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/libs/bootstrap.min.css" media="screen,projection"/>
20
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/libs/jquery-confirm.min.css" media="screen,projection"/>
21
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/libs/animatecss.css" media="screen,projection"/>
22
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/general.css" media="screen,projection"/>
23
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/index.css" media="screen,projection"/>
24
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/hamburger.css"
25
+          media="screen,projection"/>
26
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/sidenav.css" media="screen,projection"/>
27
+    <link type="text/css" rel="stylesheet" href="<?= $relativePath ?>assets/css/bootstrapOverwrite.css" media="screen,projection"/>
28
+    <link rel="icon" type="image/png" href="<?= $relativePath ?>assets/images/favicon.png">
29
+    <!--Let browser know website is optimized for mobile-->
30
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
31
+</head>
32
+
33
+<body>
34
+
35
+<div id="mainContainer">
36
+
37
+
38
+    <?php
39
+    if (isset($header)) {
40
+        echo $header;
41
+    }
42
+    include($relativePath . "includes/navbar.php");
43
+    include($relativePath . "includes/sidenav.php");
44
+    ?>
45
+    <div class="mt-4" id="contentContainer">
46
+        <?= $pageContent ?>
47
+    </div>
48
+
49
+    <?php include($relativePath . "includes/footer.php") ?>
50
+</div>
51
+
52
+<div id="scrollIndicator" style="display: none;">
53
+    <i class="fas fa-angle-double-down"></i>
54
+</div>
55
+
56
+<!--JavaScript at end of body for optimized loading-->
57
+<script type="text/javascript" src="<?= $relativePath ?>assets/js/libs/jquery.min.js"></script>
58
+<script type="text/javascript" src="<?= $relativePath ?>assets/js/libs/bootstrap.min.js"></script>
59
+<script type="text/javascript" src="<?= $relativePath ?>assets/js/libs/jquery-confirm.min.js"></script>
60
+<script type="text/javascript" src="<?= $relativePath ?>assets/js/libs/sortable.min.js"></script>
61
+<script type="text/javascript" src="<?= $relativePath ?>assets/js/init.js"></script>
62
+<script type="text/javascript" src="<?= $relativePath ?>assets/js/sidenav.js"></script>
63
+<?= $pageScripts ?>
64
+
65
+</body>
66
+</html>

+ 25
- 0
Site-Proximo-v1/index.php View File

@@ -0,0 +1,25 @@
1
+<?php
2
+ob_start();
3
+?>
4
+<div id="headerJumbotron" class="jumbotron text-center d-flex">
5
+    <div id="headerTitleContainer">
6
+        <h1 id="headerTitle">Proximo</h1>
7
+        <h2 id="headerSubTitle">La supérette de l'INSA</h2>
8
+    </div>
9
+</div>
10
+<?php
11
+$header = ob_get_clean();
12
+ob_start();
13
+?>
14
+
15
+<div class="container">
16
+    <h1 class="text-center">Coucou</h1>
17
+    <p class="text-center">Ceci est du texte</p>
18
+</div>
19
+
20
+<?php
21
+$pageContent = ob_get_clean();
22
+$pageTitle = "Accueil";
23
+$relativePath = "";
24
+include($relativePath . "includes/template.php");
25
+?>

+ 174
- 0
Site-Proximo-v1/zapette.py View File

@@ -0,0 +1,174 @@
1
+# run pip3 install requests
2
+import requests
3
+import json
4
+import os
5
+from signal import signal, SIGINT
6
+from sys import exit
7
+
8
+# API_ENDPOINT = "https://etud.insa-toulouse.fr/~proximo/ajax/zapette.php"
9
+API_ENDPOINT = "http://localhost/proximo/ajax/zapette.php"
10
+
11
+class bcolors:
12
+    HEADER = '\033[95m'
13
+    OKBLUE = '\033[94m'
14
+    OKGREEN = '\033[92m'
15
+    WARNING = '\033[93m'
16
+    FAIL = '\033[91m'
17
+    ENDC = '\033[0m'
18
+    BOLD = '\033[1m'
19
+    UNDERLINE = '\033[4m'
20
+
21
+class scan_types:
22
+    SELL = 'v',
23
+    BUY = 'a',
24
+
25
+class error_types:
26
+    NONE = 0,
27
+    NETWORK = 1,
28
+    URL = 2,
29
+    INPUT = 3,
30
+    NO_EXIST = 4,
31
+
32
+class Scanner:
33
+
34
+    def __init__(self):
35
+        self.ask_type()
36
+        self.password = self.get_password()
37
+        self.scannedArticles = []
38
+
39
+    def ask_type(self):
40
+        typeInput = input("\nVoulez vous " + bcolors.OKGREEN + "acheter" + bcolors.ENDC + " ou " + bcolors.FAIL + "vendre" + bcolors.ENDC + " ? [" + bcolors.OKGREEN + "a" + bcolors.ENDC + "/" + bcolors.FAIL + "v" + bcolors.ENDC + "] ")
41
+        if (typeInput.lower() == 'a'):
42
+            self.type = scan_types.BUY
43
+        else:
44
+            self.type = scan_types.SELL
45
+
46
+    def get_password(self):
47
+        with open('pass') as f:
48
+            password = f.readline()
49
+        return password.strip()
50
+
51
+    def display_type(self):
52
+        if (self.type == scan_types.SELL):
53
+            print("    ==> Mode " + bcolors.FAIL + bcolors.BOLD + "VENTE")
54
+        else:
55
+            print("    ==> Mode " + bcolors.OKGREEN + bcolors.BOLD + "ACHAT")
56
+        print(bcolors.ENDC)
57
+
58
+    def scan_product(self, code):
59
+        data = {
60
+            'password': self.password,
61
+            'action': 'scan',
62
+            'data': str(code)
63
+        }
64
+        r = requests.post(url=API_ENDPOINT, data=json.dumps(data))
65
+        if (r.json()['status'] == 0):
66
+            article = r.json()["data"]
67
+            self.scannedArticles.append(article)
68
+        return r.json()['status'] == 0
69
+
70
+    def display_cart(self):
71
+        total = 0.0
72
+        for article in self.scannedArticles:
73
+            print(article["name"] + ' : ' + bcolors.BOLD + article["price"] + '€' + bcolors.ENDC)
74
+            total += float(article["price"])
75
+        # Print only to only 2 decimals
76
+        total_display = "{:.2f}".format(total)
77
+        print(bcolors.OKGREEN + "Total: " + bcolors.BOLD + total_display + '€' + bcolors.ENDC)
78
+
79
+    def send_cart(self):
80
+        scanned_list = []
81
+        modifier = -1 if self.type == scan_types.SELL else 1
82
+        for article in self.scannedArticles:
83
+            scanned_list.append({"id": article["id"], "quantity": modifier})
84
+        data = {
85
+            'password': self.password,
86
+            'action': 'validate',
87
+            'data': scanned_list
88
+        }
89
+        r = requests.post(url=API_ENDPOINT, data=json.dumps(data))
90
+        return r.json()['status'] == 0
91
+
92
+def ask_confirmation(message):
93
+    confirm_input = input(message)
94
+    return confirm_input.lower() == 'o'
95
+
96
+def clear_screen():
97
+    os.system('clear')
98
+    print("Appuyez sur " + bcolors.BOLD + "[CTRL + C]" + bcolors.ENDC + " à tout moment pour quitter.\n")
99
+
100
+def printStartScreen():
101
+    clear_screen()
102
+    print(bcolors.BOLD)
103
+    print(bcolors.WARNING + "#########################################")
104
+    print("#/                                     \#")
105
+    print("#            " + bcolors.FAIL + "-=|" + bcolors.OKGREEN + " ZAPETTE " + bcolors.FAIL + "|=-" + bcolors.WARNING + "            #")
106
+    print("#\                                     /#")
107
+    print("#########################################")
108
+    print(bcolors.ENDC)
109
+    print("Bienvenue dans le programme de la Zapette !")
110
+
111
+def display_scan_header(scanner, last_error):
112
+    clear_screen()
113
+    scanner.display_type()
114
+    print("Scannez le codes puis appuyez sur [ENTRÉE] pour valider.")
115
+    print("Appuyez sur [ENTRÉE] sans code pour valider la commande.\n")
116
+    scanner.display_cart()
117
+    if (last_error == error_types.URL):
118
+        print(bcolors.FAIL + "Format URL invalide !" + bcolors.ENDC)
119
+    elif (last_error == error_types.NETWORK):
120
+        print(bcolors.FAIL + "URL invalide !" + bcolors.ENDC)
121
+    elif (last_error == error_types.INPUT):
122
+       print(bcolors.FAIL + "Code invalide !" + bcolors.ENDC)
123
+    elif (last_error == error_types.NO_EXIST):
124
+       print(bcolors.FAIL + "L'article n'existe pas." + bcolors.ENDC)
125
+    print()
126
+
127
+def confirm_end_scan(scanner):
128
+    display_scan_header(scanner, error_types.NONE)
129
+    return ask_confirmation("Voulez vous vraiment terminer et envoyer les modifications ? [o/n] ")
130
+
131
+def handler(signal_received, frame):
132
+    os.system('clear')
133
+    print('Programme de la zapette terminé.')
134
+    exit(0)
135
+
136
+def validate_cart(scanner):
137
+    clear_screen()
138
+    print("Envoi des modifications au serveur...")
139
+    if (scanner.send_cart()):
140
+        print(bcolors.OKGREEN + bcolors.BOLD + "Succès !" + bcolors.ENDC)
141
+    else:
142
+        print(bcolors.FAIL + bcolors.BOLD + "Échec !" + bcolors.ENDC)
143
+    input("\nAppuyez sur [ENTRÉE] pour continuer...")
144
+
145
+def main():
146
+    signal(SIGINT, handler)
147
+    printStartScreen()
148
+    while True:
149
+        scanner = Scanner()
150
+        last_error = error_types.NONE
151
+        while True:
152
+            display_scan_header(scanner, last_error)
153
+            code_input = input('=> ')
154
+            if (code_input == ""):
155
+                if (confirm_end_scan(scanner)):
156
+                    validate_cart(scanner)
157
+                    break
158
+                else:
159
+                    continue
160
+            try:
161
+                code = int(code_input)
162
+                if (scanner.scan_product(code)):
163
+                    last_error = error_types.NONE
164
+                else:
165
+                    last_error = error_types.NO_EXIST
166
+            except requests.exceptions.MissingSchema:
167
+                last_error = error_types.URL
168
+            except requests.exceptions.ConnectionError:
169
+                last_error = error_types.NETWORK
170
+            except ValueError:
171
+                last_error = error_types.INPUT
172
+        clear_screen()
173
+
174
+main()

+ 23
- 0
Site-Proximo-v2/.gitignore View File

@@ -0,0 +1,23 @@
1
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+# dependencies
4
+/node_modules
5
+/.pnp
6
+.pnp.js
7
+
8
+# testing
9
+/coverage
10
+
11
+# production
12
+/build
13
+
14
+# misc
15
+.DS_Store
16
+.env.local
17
+.env.development.local
18
+.env.test.local
19
+.env.production.local
20
+
21
+npm-debug.log*
22
+yarn-debug.log*
23
+yarn-error.log*

+ 68
- 0
Site-Proximo-v2/README.md View File

@@ -0,0 +1,68 @@
1
+This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2
+
3
+## Available Scripts
4
+
5
+In the project directory, you can run:
6
+
7
+### `npm start`
8
+
9
+Runs the app in the development mode.<br />
10
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11
+
12
+The page will reload if you make edits.<br />
13
+You will also see any lint errors in the console.
14
+
15
+### `npm test`
16
+
17
+Launches the test runner in the interactive watch mode.<br />
18
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19
+
20
+### `npm run build`
21
+
22
+Builds the app for production to the `build` folder.<br />
23
+It correctly bundles React in production mode and optimizes the build for the best performance.
24
+
25
+The build is minified and the filenames include the hashes.<br />
26
+Your app is ready to be deployed!
27
+
28
+See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29
+
30
+### `npm run eject`
31
+
32
+**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33
+
34
+If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35
+
36
+Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37
+
38
+You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39
+
40
+## Learn More
41
+
42
+You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43
+
44
+To learn React, check out the [React documentation](https://reactjs.org/).
45
+
46
+### Code Splitting
47
+
48
+This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49
+
50
+### Analyzing the Bundle Size
51
+
52
+This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53
+
54
+### Making a Progressive Web App
55
+
56
+This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57
+
58
+### Advanced Configuration
59
+
60
+This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61
+
62
+### Deployment
63
+
64
+This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65
+
66
+### `npm run build` fails to minify
67
+
68
+This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

+ 13923
- 0
Site-Proximo-v2/package-lock.json
File diff suppressed because it is too large
View File


+ 34
- 0
Site-Proximo-v2/package.json View File

@@ -0,0 +1,34 @@
1
+{
2
+  "name": "mon-app",
3
+  "version": "0.1.0",
4
+  "private": true,
5
+  "dependencies": {
6
+    "@testing-library/jest-dom": "^4.2.4",
7
+    "@testing-library/react": "^9.5.0",
8
+    "@testing-library/user-event": "^7.2.1",
9
+    "react": "^16.13.1",
10
+    "react-dom": "^16.13.1",
11
+    "react-scripts": "3.4.3"
12
+  },
13
+  "scripts": {
14
+    "start": "react-scripts start",
15
+    "build": "react-scripts build",
16
+    "test": "react-scripts test",
17
+    "eject": "react-scripts eject"
18
+  },
19
+  "eslintConfig": {
20
+    "extends": "react-app"
21
+  },
22
+  "browserslist": {
23
+    "production": [
24
+      ">0.2%",
25
+      "not dead",
26
+      "not op_mini all"
27
+    ],
28
+    "development": [
29
+      "last 1 chrome version",
30
+      "last 1 firefox version",
31
+      "last 1 safari version"
32
+    ]
33
+  }
34
+}

BIN
Site-Proximo-v2/public/favicon.ico View File


+ 43
- 0
Site-Proximo-v2/public/index.html View File

@@ -0,0 +1,43 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
+    <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+    <meta name="theme-color" content="#000000" />
8
+    <meta
9
+      name="description"
10
+      content="Web site created using create-react-app"
11
+    />
12
+    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
+    <!--
14
+      manifest.json provides metadata used when your web app is installed on a
15
+      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
+    -->
17
+    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
+    <!--
19
+      Notice the use of %PUBLIC_URL% in the tags above.
20
+      It will be replaced with the URL of the `public` folder during the build.
21
+      Only files inside the `public` folder can be referenced from the HTML.
22
+
23
+      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
+      work correctly both with client-side routing and a non-root public URL.
25
+      Learn how to configure a non-root public URL by running `npm run build`.
26
+    -->
27
+    <title>React App</title>
28
+  </head>
29
+  <body>
30
+    <noscript>You need to enable JavaScript to run this app.</noscript>
31
+    <div id="root"></div>
32
+    <!--
33
+      This HTML file is a template.
34
+      If you open it directly in the browser, you will see an empty page.
35
+
36
+      You can add webfonts, meta tags, or analytics to this file.
37
+      The build step will place the bundled scripts into the <body> tag.
38
+
39
+      To begin the development, run `npm start` or `yarn start`.
40
+      To create a production bundle, use `npm run build` or `yarn build`.
41
+    -->
42
+  </body>
43
+</html>

BIN
Site-Proximo-v2/public/logo192.png View File


BIN
Site-Proximo-v2/public/logo512.png View File


+ 25
- 0
Site-Proximo-v2/public/manifest.json View File

@@ -0,0 +1,25 @@
1
+{
2
+  "short_name": "React App",
3
+  "name": "Create React App Sample",
4
+  "icons": [
5
+    {
6
+      "src": "favicon.ico",
7
+      "sizes": "64x64 32x32 24x24 16x16",
8
+      "type": "image/x-icon"
9
+    },
10
+    {
11
+      "src": "logo192.png",
12
+      "type": "image/png",
13
+      "sizes": "192x192"
14
+    },
15
+    {
16
+      "src": "logo512.png",
17
+      "type": "image/png",
18
+      "sizes": "512x512"
19
+    }
20
+  ],
21
+  "start_url": ".",
22
+  "display": "standalone",
23
+  "theme_color": "#000000",
24
+  "background_color": "#ffffff"
25
+}

+ 3
- 0
Site-Proximo-v2/public/robots.txt View File

@@ -0,0 +1,3 @@
1
+# https://www.robotstxt.org/robotstxt.html
2
+User-agent: *
3
+Disallow:

+ 50
- 0
Site-Proximo-v2/src/index.css View File

@@ -0,0 +1,50 @@
1
+body {
2
+    font: 14px "Century Gothic", Futura, sans-serif;
3
+    margin: 20px;
4
+  }
5
+  
6
+  ol, ul {
7
+    padding-left: 30px;
8
+  }
9
+  
10
+  .board-row:after {
11
+    clear: both;
12
+    content: "";
13
+    display: table;
14
+  }
15
+  
16
+  .status {
17
+    margin-bottom: 10px;
18
+  }
19
+  
20
+  .square {
21
+    background: #fff;
22
+    border: 1px solid #999;
23
+    float: left;
24
+    font-size: 24px;
25
+    font-weight: bold;
26
+    line-height: 34px;
27
+    height: 34px;
28
+    margin-right: -1px;
29
+    margin-top: -1px;
30
+    padding: 0;
31
+    text-align: center;
32
+    width: 34px;
33
+  }
34
+  
35
+  .square:focus {
36
+    outline: none;
37
+  }
38
+  
39
+  .kbd-navigation .square:focus {
40
+    background: #ddd;
41
+  }
42
+  
43
+  .game {
44
+    display: flex;
45
+    flex-direction: row;
46
+  }
47
+  
48
+  .game-info {
49
+    margin-left: 20px;
50
+  }

+ 67
- 0
Site-Proximo-v2/src/index.js View File

@@ -0,0 +1,67 @@
1
+import React from 'react';
2
+import ReactDOM from 'react-dom';
3
+import './index.css';
4
+
5
+class Square extends React.Component {
6
+    render() {
7
+      return (
8
+        <button className="square">
9
+          {/* TODO */}
10
+        </button>
11
+      );
12
+    }
13
+  }
14
+  
15
+  class Board extends React.Component {
16
+    renderSquare(i) {
17
+      return <Square />;
18
+    }
19
+  
20
+    render() {
21
+      const status = 'Next player: X';
22
+  
23
+      return (
24
+        <div>
25
+          <div className="status">{status}</div>
26
+          <div className="board-row">
27
+            {this.renderSquare(0)}
28
+            {this.renderSquare(1)}
29
+            {this.renderSquare(2)}
30
+          </div>
31
+          <div className="board-row">
32
+            {this.renderSquare(3)}
33
+            {this.renderSquare(4)}
34
+            {this.renderSquare(5)}
35
+          </div>
36
+          <div className="board-row">
37
+            {this.renderSquare(6)}
38
+            {this.renderSquare(7)}
39
+            {this.renderSquare(8)}
40
+          </div>
41
+        </div>
42
+      );
43
+    }
44
+  }
45
+  
46
+  class Game extends React.Component {
47
+    render() {
48
+      return (
49
+        <div className="game">
50
+          <div className="game-board">
51
+            <Board />
52
+          </div>
53
+          <div className="game-info">
54
+            <div>{/* status */}</div>
55
+            <ol>{/* TODO */}</ol>
56
+          </div>
57
+        </div>
58
+      );
59
+    }
60
+  }
61
+  
62
+  // ========================================
63
+  
64
+  ReactDOM.render(
65
+    <Game />,
66
+    document.getElementById('root')
67
+  );

Loading…
Cancel
Save