Projet

Général

Profil

suggestion_multi.tpl.php

Alexandre Boucher, 11/09/2013 13:51

 
1
<?php
2
// +-------------------------------------------------+
3
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
4
// +-------------------------------------------------+
5
// $Id: suggestion_multi.tpl.php,v 1.11 2013-04-11 08:47:35 mbertin Exp $
6

    
7
if (stristr($_SERVER['REQUEST_URI'], ".tpl.php")) die("no access");
8

    
9
$multi_sug_form= "<div id='make_mul_sugg'>
10
<h1>".htmlentities($msg['acquisition_sug_ges'], ENT_QUOTES, $charset)."</h1>
11
<div id='make_mul_sugg-container'>
12
<script src='./javascript/suggestion_multi.js' type='text/javascript'></script>
13
<script>
14
        function check_fields(nb_ligne){
15
        var retour=true;
16
        var qte_error = false;
17
        var txt_error = false;
18

19
        for(var i=0;i<nb_ligne;i++){
20
                if (document.getElementById('sugg_'+i)){
21
                        if((document.getElementById('sugg_tit_'+i).disabled == true) && (i==0) ){
22
                                alert(\"".$msg[sugg_no_field_fill]."\");
23
                                return false;
24
                        } else if(document.getElementById('sugg_tit_'+i).disabled == true) 
25
                                        break;        
26
                        
27
                        var tit = document.getElementById('sugg_tit_'+i).value;
28
                        var aut = document.getElementById('sugg_aut_'+i).value;
29
                        var edi = document.getElementById('sugg_edi_'+i).value;
30
                        var qte = document.getElementById('sugg_qte_'+i).value;
31
                        var cod = document.getElementById('sugg_code_'+i).value;
32
                        if(!tit || (!aut && !edi && !cod)){
33
                                document.getElementById('sugg_'+i).className = 'erreur_saisie';
34
                                retour=false;
35
                                txt_error = true;
36
                        } else if(isNaN(qte)){
37
                                document.getElementById('sugg_'+i).className = 'erreur_saisie';
38
                                retour=false;
39
                                qte_error = true;
40
                        } else{
41
                                document.getElementById('sugg_'+i).className = '';
42
                        }
43
                }
44
        }
45

46
        if(qte_error){
47
                alert('".$msg[acquisition_sugg_qte_error]."');
48
        } else if(txt_error){
49
                alert(\"".$msg[acquisition_sug_ko]."\");
50
        }
51
                
52
        return retour;
53
}
54
</script>
55
<form action=\"acquisition.php?categ=sug&sub=multi\" method=\"post\" name=\"sug_multi\" onsubmit=\"return check_fields(document.getElementById('max_nblignes').value);\"> 
56
        <h3>".htmlentities($msg['acquisition_make_mul_sugg'], ENT_QUOTES, $charset)."</h3>
57
        <input type='hidden' name='act' id='act' />
58
        <input type='hidden' name='max_nblignes' id='max_nblignes' value='!!max_lignes!!'/>
59
        <div class='form-contenu'>
60
                <table class='tab_sug'>
61
                        <tbody id='tableau_multi_sugg'>
62
                        <tr>
63
                                <th style='width:15%'>".htmlentities($msg["acquisition_sugg_tit"], ENT_QUOTES, $charset)."</th>
64
                                <th style='width:15%'>".htmlentities($msg["acquisition_sugg_aut"], ENT_QUOTES, $charset)."</th>
65
                                <th style='width:12%'>".htmlentities($msg["acquisition_sugg_edi"], ENT_QUOTES, $charset)."</th>
66
                                <th style='width:8%'>".htmlentities($msg["acquisition_sugg_code"], ENT_QUOTES, $charset)."</th>
67
                                <th style='width:5%'>".htmlentities($msg["acquisition_sugg_prix"], ENT_QUOTES, $charset)."</th>
68
                                <th style='width:12%'>".htmlentities($msg["acquisition_sugg_url"], ENT_QUOTES, $charset)."</th>
69
                                <th style='width:15%'>".htmlentities($msg["acquisition_sugg_comment"], ENT_QUOTES, $charset)."</th>
70
                                <th style='width:15%'>".htmlentities($msg["acquisition_sugg_comment_gestion"], ENT_QUOTES, $charset)."</th>
71
                                <th style='width:7%'>".htmlentities($msg["acquisition_sugg_date_publication"], ENT_QUOTES, $charset)."</th>
72
                                <th style='width:10%'>".htmlentities($msg["acquisition_sugg_src"], ENT_QUOTES, $charset)."</th>
73
                                <th style='width:3%'>".htmlentities($msg["acquisition_sugg_qte"], ENT_QUOTES, $charset)."</th>
74
                                <th style='width:1%'></th>
75
                        </tr>
76
                        !!ligne!!
77
                        </tbody>
78
                </table>
79
                <div class='row'>
80
                        <div class='colonne3'>
81
                                <label class='etiquette'>".htmlentities($msg['acquisition_sugg_origine_user'], ENT_QUOTES, $charset)."</label>                                        
82
                                <input type='hidden' id='id_user' name='id_user' value='!!id_user!!' />
83
                                <input type='hidden' id='type_user' name='type_user' value='!!type_user!!' />
84
                                <input type='text' id='user_txt' name='user_txt' class='saisie-20emr' value='!!user_txt!!'/>
85
                                <input type='button' class='bouton_small' value='...' onclick=\"openPopUp('./select.php?what=origine&caller=sug_multi&param1=id_user&param2=user_txt&param3=type_user&deb_rech='+".pmb_escape()."(this.form.user_txt.value), 'select_user', 400, 400, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" />                                
86
                                <input type='button' class='bouton_small' value='X'  onclick=\"this.form.id_user.value=0;this.form.type_user.value=0;this.form.user_txt.value=''\"/>                        
87
                        </div>
88
                        <div class='colonne3'>
89
                                !!localisation!!
90
                        </div>
91
                        <div class='colonne3'>
92
                                !!categorie!!
93
                        </div>                        
94
                </div>        
95
                <div class='row'></div>                
96
        </div>        
97
        <div class='row'>
98
                <div class='left'>
99
                        <input type='submit' class='bouton' name='save_multi_sugg' value='$msg[acquisition_sugg_save_multi]' onclick='this.form.act.value=\"save_multi_sugg\";' />
100
                </div>
101
        </div>
102
        <div class='row'></div>
103
</form>
104
</div>
105
</div>";
106

    
107

    
108
$import_sug_form="
109
<div id='import_sug'>
110
<h1>".htmlentities($msg['acquisition_sug_ges'], ENT_QUOTES, $charset)."</h1>
111
<div id='import_sug-container'>
112
<form action=\"acquisition.php?categ=sug&sub=import\" method=\"post\" enctype=\"multipart/form-data\"> 
113
        <h3>".htmlentities($msg['acquisition_sugg_import_title'], ENT_QUOTES, $charset)."</h3>
114
        <input type='hidden' name='act' id='act' />
115
        <input type='hidden' name='explnum_id' value='!!explnum_id!!' /> 
116
        <input type='hidden' name='origine_id' value='!!origine_id!!' />
117
        <input type='hidden' name='type_origine' value='!!type_origine!!' />
118
        <div class='form-contenu'>
119
                <div class='row'>
120
                        <label for='import file' class='etiquette'>$msg[acquisition_sugg_file_to_import]</label>
121
                </div>
122
                <div class='row'>
123
                        !!import_file!!        
124
                </div>
125
                <div class='row'>
126
                        <label for='src_liste' class='etiquette'>$msg[acquisition_sugg_srcliste]</label>
127
                </div>
128
                <div class='row'>
129
                        !!liste_source!!
130
                </div>
131
                <div class='row'>
132
                        <label for='import_liste' class='etiquette'>$msg[acquisition_sugg_importliste]</label>
133
                </div>
134
                <div class='row'>
135
                        !!liste_import!!
136
                </div>
137
        </div>
138
        <input type='button' class='bouton' value=\"".$msg[76]."\" onClick=\"document.location='acquisition.php?categ=sug&action=list' \"/>&nbsp;<input type='submit' class='bouton' name='import_sugg' value='$msg[acquisition_sugg_btn_import]' onclick='this.form.act.value=\"import_sugg\"' />
139
</form>
140
</div>
141
</div>"
142
?>