Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Theme-WordPress-Adullact-org
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adullact
Theme-WordPress-Adullact-org
Commits
671df2fc
Commit
671df2fc
authored
May 29, 2019
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add input for period selection
parent
8afe8b88
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
1 deletion
+79
-1
twentynineteen-child/contact.php
twentynineteen-child/contact.php
+18
-1
twentynineteen-child/periodSelection.php
twentynineteen-child/periodSelection.php
+61
-0
No files found.
twentynineteen-child/contact.php
View file @
671df2fc
...
...
@@ -3,7 +3,14 @@
<title>
Renouvellement d'adhésion
</title>
<meta
charset=
"UTF-8"
>
<?php
$grillePath
=
$_SERVER
[
"CONTEXT_DOCUMENT_ROOT"
]
.
'/wp-content/themes/twentyseventeen-child/twentynineteen-child/grille.csv'
;
//le dossier où se trouvent les fichiers
$workingDirectory
=
$_SERVER
[
"CONTEXT_DOCUMENT_ROOT"
]
.
'/wp-content/themes/twentyseventeen-child/twentynineteen-child/'
;
$grillePath
=
$workingDirectory
.
'grille.csv'
;
$periodSelectionPath
=
$workingDirectory
.
"periodSelection.php"
;
$JSPath
=
'/wp-content/themes/twentyseventeen-child/twentynineteen-child/adhesionForm.js'
;
?>
<script
type=
"text/javascript"
src=
"
<?php
echo
$JSPath
?>
"
></script>
...
...
@@ -18,6 +25,8 @@ Template Name: Test
get_header
();
include_once
$periodSelectionPath
;
$fichier
=
fopen
(
$grillePath
,
'r'
);
$ligne
=
fgetcsv
(
$fichier
,
1024
,
";"
);
...
...
@@ -34,6 +43,7 @@ $textsSelectMenuExtended = []; //même rôle qu'au dessus mais en ajoutant les o
$classSelectMenu
=
[];
//contiendra les classes des option menu gérés automatiquement
$classSelectMenuExtended
=
[];
//contiendra les classes des option menu gérés automatiquement + manuellement
function
createFirstSelectionList
(
$liste
)
{
//fonction qui crée la première liste de sélection sans modifier les textes
...
...
@@ -312,6 +322,13 @@ sort($classSelectMenuExtended);
<label
for=
"siteCollectivite"
>
Site internet :
</label>
<input
type=
"url"
name=
"siteCollectivite"
id=
"siteCollectivite"
required=
""
><br>
<label
for=
"periodeAdhesionCollectivite"
>
Période d'adhésion :
</label>
<select
name=
"periodeAdhesionCollectivite"
id=
"periodeAdhesionCollectivite"
required
>
<option
value=
"none"
selected
>
---
</option>
<?php
generateDates
();
?>
</select>
<h3>
Informations relatives à Chorus Pro
</h3>
<label
for=
"siretCollectivite"
>
SIRET :
</label>
...
...
twentynineteen-child/periodSelection.php
0 → 100644
View file @
671df2fc
<?php
function
actualMonthYear
(
$plus
=
0
)
{
//retourne un string : le mois actuel auquel on ajoute $plus et les années à rajouter en fonction
//sous la forme MM/YY
$month
=
date
(
"m"
);
$year
=
date
(
"y"
);
$month
=
$month
+
$plus
;
while
(
$month
>
12
)
{
$month
-=
12
;
$year
+=
1
;
}
$month
=
addZero
(
$month
);
$year
=
addZero
(
$year
);
return
$month
.
"/01/"
.
$year
;;
}
function
addZero
(
$number
)
{
//cette fonction ajoute un zéro à $number s'il le faut
if
(
strlen
(
$number
)
==
1
)
{
return
"0"
.
$number
;
}
return
$number
;
}
function
generateDates
()
{
//cette fonction génère les options pour la question "période d'adhésion"
for
(
$i
=
1
;
$i
<
13
;
$i
++
)
{
$premiereDate
=
new
DateTime
(
actualMonthYear
(
$i
));
$annee
=
new
DateInterval
(
"P1Y"
);
$jour
=
new
DateInterval
(
"P1D"
);
$message
=
"du "
.
$premiereDate
->
format
(
"d/m/y"
)
.
" au "
;
$premiereDate
->
add
(
$annee
);
$premiereDate
->
sub
(
$jour
);
$message
=
$message
.
$premiereDate
->
format
(
"d/m/y"
);
$message
=
"<option value='"
.
$message
.
"'>"
.
$message
.
"</option>"
;
echo
$message
;
}
}
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment