-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpreferences.html
179 lines (159 loc) · 8.5 KB
/
preferences.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Alef|Varela+Round&display=swap" rel="stylesheet">
<link rel="icon" type="image/png" href="img/icons/logo_icon.png">
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/mefathim.css">
<!-- <script src="js/navbar.js"></script> -->
<script src="js/load.js"></script>
<script src="js/version.js"></script>
<style>
table{
text-align: center;
}
#result {
width: 25%;
}
#mg:hover {
cursor: pointer;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.274), 0 6px 20px 0 rgba(0, 0, 0, 0.13);
transition: 0.3s;
}
</style>
<title>שינוי העדפות</title>
</head>
<body dir="rtl" onload="check_params()"></body>
<nav id="nav" class="navbar navbar-expand-sm bg-light navbar-light"></nav>
<div id="now_logged" style="padding-top: 50px;"></div>
<div class="card card-container sign_up" style="text-align: right;">
<h3>העדפות</h3>
<p id="ok"></p>
<div id="result">
</div>
<a href="avatars.html">שנה תמונה</a>
<form action="scripts/preferences.py" method="post">
<div class="form-row">
<div calss="form-group col-md-4 mb-3">
<label for="first_name">שינוי שם פרטי</label>
<input class="form-control" type="text" name="first_name" id="first_name">
</div>
<div calss="form-group col-md-8 mb-3">
<label for="last_name">שינוי שם משפחה</label>
<input class="form-control" type="text" name="last_name" id="last_name">
</div>
</div>
<div class="form-row">
<div calss="form-group col-md-4 mb-3">
<label for="nick_name">כינוי חדש</label>
<input class="form-control" type="text"name="nick_name">
</div>
<!-- <div calss="form-group col-md-3 mb-3">
<label for="nick_name">מגדר</label>
<select class="form-control" name="gender">
<option value="1">זכר</option>
<option value="2">נקבה</option>
<option value="3">אחר</option>
</select>
</div> -->
<div calss="form-group col-md-3 mb-3" style="width: 50%;">
<label for="birth_date">תאריך לידה *</label>
<input class="form-control" type="date" name="birth_date">
</div>
</div>
<!-- <div class="form-row">
<label for="pwd" class="col-4">תאריך לידה * </label>
<input class="col-8" type="date" placeholder="תאריך לידה" name="birth_date">
</div> -->
<div class="form-row">
<div calss="form-group col-6">
<label for="city">עיר</label>
<input class="form-control" type="text" name="city">
</div>
<div calss="form-group col-6">
<label for="country">הכנס מדינה ב3 אותיות (isr)</label>
<input class="form-control" type="text" value="isr" name="country">
</div>
</div>
<div class="form-row">
<div calss="form-group col-8">
<label for="phone">טלפון</label>
<input class="form-control" type="text" name="phone">
</div>
<div calss="form-group col-4" style="width: 50%;">
<label for="nick_name">מגדר</label>
<select class="form-control" name="gender">
<option value="1">זכר</option>
<option value="2">נקבה</option>
<option value="3">אחר</option>
</select>
</div>
</div>
<button type="button" id="_btn" onclick="make_change()">בצע שינויים</button>
</form>
</div>
<p class="" id="version" style="text-align: center;"></p>
<script>
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if(this.readyState == 4){
data_from_json = JSON.parse(this.responseText);
if(data_from_json.ok == true){
document.getElementsByName("first_name")[0].value = data_from_json.data.first_name;
document.getElementsByName("last_name")[0].value = data_from_json.data.last_name;
document.getElementsByName("nick_name")[0].value = data_from_json.data.nickname;
document.getElementsByName("gender")[0].value = data_from_json.data.gender;
document.getElementsByName("birth_date")[0].value = data_from_json.data.date_of_birth;
document.getElementsByName("city")[0].value = data_from_json.data.city;
document.getElementsByName("country")[0].value = data_from_json.data.country;
document.getElementsByName("phone")[0].value = data_from_json.data.phone_number;
var img_num = String(data_from_json.data.picture_number);
if(img_num == ""){
img_num = "22";
}
var img = "<a href="+"avatars.html"+"><img id="+"mg"+" style='height:100%; width:100%; border-radius: 50%;'src="+"img/avatars/";
img += img_num+ ".png"+"></a>";
document.getElementById("result").innerHTML = img;
}
else{
window.location = "login.html";
}
}
}
xmlhttp.open("POST", "scripts/user_data.py", true);
xmlhttp.send();
function check_params(){
var url_string = window.location.href;
var url = new URL(url_string);
if (url.searchParams.get("msg") == "1"){
document.getElementById('ok').innerHTML = "השינוי בוצע בהצלחה!!";
}
}
buildnavbar();
get_connected_users();
setInterval(function(){ get_connected_users() }, 3000);
let cheker = false;
$(document).ready(function(){
$("input").change(function(){
document.getElementById("_btn").type ="submit";
cheker=true;
window.onbeforeunload = function(){
return '';
}
})
})
function make_change(){
if(cheker == false){
document.getElementById('ok').innerHTML = "לא בוצעו שינויים!!";
}
window.onbeforeunload = null;
}
$("#version").append("גירסה: "+get_version()+"") ;
</script>
</body>
</html>