noalyss Version-9
card_multiple_display_option.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * PhpCompta is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * PhpCompta is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with PhpCompta; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
20
21if (!defined('ALLOWED'))
22 die('Appel direct ne sont pas permis');
23
24/**
25 * @file
26 * @brief Show the option of a contact,
27 * parameters received
28 * - $fiche_id
29 * - $ag_id
30 * - $a_option array
31 * - $a_option.cor_id
32 * - $a_option.cor_label
33 * - $a_option.cor_type
34 * - $a_option.ap_id (-1 if option for this contact doesn't exist)
35 * @see Card_Multiple
36 */
38?>
39<h3 class="info" style="margin:1px">
40 <?=$aIdentity['name']." ".$aIdentity['first_name']." ".$aIdentity['qcode']?>
41</h3>
42<form method="POST" onsubmit="save_linked_card_option(this);return false">
43 <input type="hidden" name="op" value="card">
44 <input type="hidden" name="op2" value="save_card_option">
45 <input type="hidden" name="ctl" value="notused">
46 <input type="hidden" name="ag_id" value="<?=$ag_id?>">
47 <input type="hidden" name="f_id" value="<?=$fiche_id?>">
48 <input type="hidden" name="action_person_id" value="<?=$p_action_person_id?>">
49 <?= Dossier::hidden() ?>
50 <?php
51 $nb_option=count($a_option);
52 for ($i=0; $i<$nb_option; $i++):
53 switch ($a_option[$i]['cor_type'])
54 {
55 case 0:
56 $input=new IText("ap_value[]");
57 break;
58 case 2:
59 $input=new IDate("ap_value[]");
60 break;
61 case 1:
62 $input=new INum("ap_value[]");
63 break;
64 case 3:
65 $input=new ISelect("ap_value[]");
66 $input->value=array();
67 // for select , we need to take the list
68 if (!empty($a_option[$i]['cor_value_select']))
69 {
70 $a_select=explode("|", $a_option[$i]['cor_value_select']);
71 if (is_array($a_select))
72 {
73 $nb=count($a_select);
74 $array=[];
75 for ($e=0; $e<$nb; $e++)
76 {
77 $a["label"]=$a_select[$e];
78 $a["value"]=$a_select[$e];
79 $array[$e]=$a;
80 }
81 $input->value=$array;
82 $input->selected = $a_option[$i]['ap_value'] ;
83 }
84 }
85 break;
86 case 4:
87 $input=new InputSwitch("ap_value[]");
88 if ( $a_option[$i]['ap_value'] =="") {
89 $a_option[$i]['ap_value']=0;
90 }
91 break;
92
93 }
94 $input->set_value ($a_option[$i]['ap_value']);
95 echo '<span style="display:table-row">';
96 echo '<span style="display:table-cell">';
97 echo $a_option[$i]['cor_label'];
98 echo HtmlInput::hidden("f_id",$fiche_id);
99 echo HtmlInput::hidden("ap_id[]",$a_option[$i]['ap_id']);
100 echo HtmlInput::hidden("cor_id[]",$a_option[$i]['cor_id']);
101 echo '</span>';
102 echo '<span style="display:table-cell">';
103 echo $input->input();
104 echo '</span>';
105 echo '</span>';
106
108
109 ?>
110 <ul class="aligned-block">
111 <li>
112 <?=HtmlInput::button_close("d_linked_card_option")?>
113 </li>
114 <li>
115 <?=HtmlInput::submit("save",_("Sauver"))?>
116 </li>
117
118 </ul>
119
120
121</form>
$input
$opd_description style
$from_poste name
$input_from type
Definition: balance.inc.php:65
static hidden()
return a string to set gDossier into a FORM
static button_close($div_name, $class='smallbutton')
close button for the HTML popup
static hidden($p_name, $p_value, $p_id="")
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Definition: idate.class.php:34
This class handles only the numeric input, the input will call a javascript to change comma to period...
Definition: inum.class.php:42
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Html Input.
Definition: itext.class.php:30
show a switch, when you click on it an hidden field is changed, the value is 1 or 0
static echo_file($msg, $print=true)
display the file
Definition: dbg.php:88