forked from masudeden/Point-of-Sale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dummy.php
240 lines (210 loc) · 8.48 KB
/
dummy.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<?php
$form =array('id'=>'form1',
'runat'=>'server',
'name'=>'combo_box');
echo form_open_multipart('users/add_pos_users_details/',$form);?><table>
<tr><td><?php echo form_label($this->lang->line('first_name'))?> </td><td><?php echo form_input('first_name',set_value('first_name'), 'id="first_name" autofocus')?> </td></tr>
<tr><td><?php echo form_label($this->lang->line('last_name'))?></td><td><?php echo form_input('last_name',set_value('last_name'), 'id="llast_name" autofocus')?></td></tr>
<tr><td><?php echo form_label($this->lang->line('sex'))?></td><td><select name="sex"><option name="male" value="Male">Male</option><option name="Female" value="FeMale">Female</option></select></td></tr>
<tr><td><?php echo form_label($this->lang->line('age'))?></td><td><?php echo form_input('age',set_value('age'), 'id="age" autofocus')?></td></tr>
<tr><td><?php echo form_label($this->lang->line('address'))?></td><td><?php echo form_input('address',set_value('address'), 'id="address" autofocus')?></td></tr>
<tr><td><?php echo form_label($this->lang->line('city'))?></td><td><?php echo form_input('city',set_value('city'), 'id="city" autofocus')?> </td></tr>
<tr><td><?php echo form_label($this->lang->line('state'))?></td><td><?php echo form_input('state',set_value('state'), 'id="state" autofocus')?> </td></tr>
<tr><td><?php echo form_label($this->lang->line('zip'))?></td><td><?php echo form_input('zip',set_value('zip'), 'id="zip" autofocus')?></td></tr>
<tr><td><?php echo form_label($this->lang->line('country'))?></td><td><?php echo form_input('country',set_value('country'), 'id="country" autofocus')?></td></tr>
<tr><td><?php echo form_label($this->lang->line('email'))?></td><td><?php echo form_input('email',set_value('email'), 'id="email" autofocus')?> </td></tr>
<tr><td><?php echo form_label($this->lang->line('phone'))?></td><td><?php echo form_input('phone',set_value('phone'), 'id="phone" autofocus')?></td></tr>
<tr><td><?php echo form_label($this->lang->line('date_of'))?></td><td><?php echo form_input('dob',set_value('dob'), 'id="dob" autofocus')?> </td></tr>
<tr><td><?php echo form_label($this->lang->line('user_groups'))?></td><td>
<script>
function select_branch(tbTo)
{
var arrLU="";
for (i = 0;i < tbTo.options.length; i++)
{
arrLU =arrLU+" "+tbTo.options[i].value;
}
var jibi = document.getElementById("branch").value;
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","<?php echo base_url() ?>index.php/user_groupsselecting/add/"+jibi+"/"+arrLU,false);
xmlhttp.send();
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
function move(tbFrom, tbTo)
{
var arrFrom = new Array(); var arrTo = new Array();
var arrLU = new Array();
var i;
for (i = 0;i < tbTo.options.length; i++)
{
arrLU[tbTo.options[i].text] = tbTo.options[i].value;
arrTo[i] = tbTo.options[i].text;
}
var fLength = 0;
var tLength = arrTo.length;
for(i = 0; i < tbFrom.options.length; i++)
{
arrLU[tbFrom.options[i].text] = tbFrom.options[i].value;
if (tbFrom.options[i].selected && tbFrom.options[i].value != "")
{
arrTo[tLength] = tbFrom.options[i].text;
tLength++;
}
else
{
arrFrom[fLength] = tbFrom.options[i].text;
fLength++;
}
}
tbFrom.length = 0;
tbTo.length = 0;
var ii;
for(ii = 0; ii < arrFrom.length; ii++)
{
var no = new Option();
no.value = arrLU[arrFrom[ii]];
no.text = arrFrom[ii];
tbFrom[ii] = no;
}
for(ii = 0; ii < arrTo.length; ii++)
{
var no = new Option();
no.value = arrLU[arrTo[ii]];
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","<?php echo base_url() ?>index.php/user_groupsselecting/get_user_groups_branch/"+arrLU[arrTo[ii]],false);
xmlhttp.send();
no.text = xmlhttp.responseText;
tbTo[ii] = no;
}
}
function backmove(tbFrom, tbTo)
{
var jibi = document.getElementById("branch").value;
var arrFrom = new Array(); var arrTo = new Array();
var arrLU = new Array();
var i;
for (i = 0;i < tbTo.options.length; i++)
{
arrLU[tbTo.options[i].text] = tbTo.options[i].value;
arrTo[i] = tbTo.options[i].text;
}
var fLength = 0;
var tLength = arrTo.length;
for(i = 0; i < tbFrom.options.length; i++)
{
arrLU[tbFrom.options[i].text] = tbFrom.options[i].value;
if (tbFrom.options[i].selected && tbFrom.options[i].value != "")
{
arrTo[tLength] = tbFrom.options[i].text;
tLength++;
}
else
{
arrFrom[fLength] = tbFrom.options[i].text;
fLength++;
}
}
tbFrom.length = 0;
tbTo.length = 0;
var ii;
for(ii = 0; ii < arrFrom.length; ii++)
{
var no = new Option();
no.value = arrLU[arrFrom[ii]];
no.text = arrFrom[ii];
tbFrom[ii] = no;
}
for(ii = 0; ii < arrTo.length; ii++)
{
var no = new Option();
no.value = arrLU[arrTo[ii]];
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","<?php echo base_url() ?>index.php/user_groupsselecting/check_user_groups_branch/"+jibi+"/"+arrLU[arrTo[ii]],false);
xmlhttp.send();
if(xmlhttp.responseText=='TRUE'){
xmlhttp.open("GET","<?php echo base_url() ?>index.php/user_groupsselecting/set_user_groups_branch/"+jibi+"/"+arrLU[arrTo[ii]],false);
xmlhttp.send();
no.text = xmlhttp.responseText;
tbTo[ii] = no;
}
}
}
function get_selected(tbTo){
var arrLU="";
for (i = 0;i <tbTo.options.length; i++)
{
arrLU =arrLU+" "+tbTo.options[i].value;
}
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
if(arrLU!=""){
xmlhttp.open("GET","<?php echo base_url() ?>index.php/user_groupsselecting/get_selected_user_groups/"+arrLU,false);
xmlhttp.send();
document.getElementById("depa").value = xmlhttp.responseText;
}else{
document.getElementById("mine").innerHTML="";
}
}
</script>
<select id="branch" name="FromLJ" style="width:150">
<?php if($this->session->userdata['user_type']==2){
foreach ($branch as $brow) {
?> <option name="<?php echo $brow->guid ?>" value="<?php echo $brow->guid ?>" onClick="select_branch(this.form.lang)" > <?php echo $brow->store_name ?></option><?php
}}else{ foreach ($branch as $brow) {
?> <option name="<?php echo $brow->branch_id ?>" value="<?php echo $brow->branch_id ?>" onClick="select_branch(this.form.lang)" > <?php echo $brow->branch_name ?></option>
<?php }}?>
</select>
<select multiple id="myDiv" name="ToLJ" style="width: 150">
</select>
<input type="button" onClick="move(this.form.ToLJ,this.form.lang),get_selected(this.form.lang)"
value="->">
<input type="button" onClick="backmove(this.form.lang,this.form.ToLJ),get_selected(this.form.lang)"
value="<-">
<select multiple name="lang" size="7" style="width: 250">
</select>
<input type="hidden" name="depa" id="depa"></td></tr>
<tr><td><?php echo form_label($this->lang->line('user_name'))?></td><td><?php echo form_input('pos_users_id',set_value('pos_users_id'), 'id="pos_users_id" autofocus')?> </td></tr>
<tr><td><?php echo form_label($this->lang->line('password'))?></td><td><?php echo form_input('password',set_value('password'), 'id="password" autofocus')?></td></tr>
<tr><td></td>
<td><input type="submit" name="Save" value="<?php echo $this->lang->line('save') ?>" >
<?php echo form_submit('Cancel', $this->lang->line('cancel')) ?></td>
</tr>
<?php form_close() ?>
<?php //echo validation_errors(); ?>
</table>
</script>
<div id="upload" ><span><?php echo $this->lang->line('photo') ?><span></div><span id="status" ></span>
<ul id="files" ></ul>
</form>
<?php echo validation_errors(); ?>