Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
clivi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NF17 - CAMP - P14
clivi
Commits
34219dbd
Commit
34219dbd
authored
10 years ago
by
clement
Browse files
Options
Downloads
Patches
Plain Diff
c
parent
7a5ffa5f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
class/prestation.php
+2
-1
2 additions, 1 deletion
class/prestation.php
class/typefield.php
+31
-0
31 additions, 0 deletions
class/typefield.php
with
33 additions
and
1 deletion
class/prestation.php
+
2
−
1
View file @
34219dbd
...
...
@@ -11,7 +11,8 @@ class Prestation extends Objet
"i"
=>
3
),
"type"
=>
array
(
"i"
=>
2
"i"
=>
2
,
"t"
=>
"TypeField"
),
"id"
=>
array
(
"i"
=>
1
...
...
This diff is collapsed.
Click to expand it.
class/typefield.php
0 → 100644
+
31
−
0
View file @
34219dbd
<?php
class
TypeField
extends
Field
{
public
function
html
()
{
// Todo, if isset($_POST[$this->name]) && !$this->validate() => Show a error msg explanation for this line.
$html
=
'<div class="form-group">
<label for="form'
.
$this
->
name
.
'">'
.
$this
->
label
.
'</label>
<select class="form-control" name="'
.
$this
->
name
.
'">
<option value="consultation" '
.
(
$this
->
value
==
"consultation"
?
"selected"
:
""
)
.
'>Consultation</option>
<option value="intervention" '
.
(
$this
->
value
==
"intervention"
?
"selected"
:
""
)
.
'>Intervention</option>
</select>
</div>'
;
return
$html
;
}
public
function
validate
()
{
$this
->
value
=
$_POST
[
$this
->
name
];
return
true
;
}
public
function
show
()
{
if
(
$this
->
value
==
'M'
)
{
$html
=
'Consultation'
;
}
else
{
$html
=
'Intervention'
;
}
return
$html
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment