-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.html
More file actions
187 lines (182 loc) · 7.37 KB
/
user.html
File metadata and controls
187 lines (182 loc) · 7.37 KB
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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DevDebu 基本情報入力</title>
<!-- BootstrapのCSS読み込み -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<!-- jQuery読み込み -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<!-- underescore読み込み -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<!-- BootstrapのJS読み込み -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<STYLE type="text/css">
BODY{color : white ;background-color : #272B30}
table{color : black;}
.debu-label{display: inline-block;width : 6em;text-align:right;}
.debu-txt{display: inline-block;width : 20em; margin-left:0.5em ;color : black;}
.debuBox{width:12em; background-color:lightskyblue; border:2px white double; margin-top:1em; margin-right:1em; margin-bottom:1em; margin-left:auto}
.debuVal{width:8em; display: inline-block;text-align: right;margin-left:0.5em;}
</STYLE>
</head>
<body>
<script>
$(document).ready(function(){
var userId = localStorage.getItem("userId");
//基本情報取得
$.ajax({
url:'https://deboo.mybluemix.net/v1/user?userId=' + userId,
type:'GET',
success:function(user){
var myUser = user;
$("#name").val(myUser.name);
$("#mail").val(myUser.mail);
$("#birthday").val(myUser.birthday);
$("#dspName").text(myUser.name);
if(myUser.sex==1){
$("#man").attr("checked",true);
}else if(myUser.sex==1){
$("#worman").attr("checked",true);
}else{
$("#other").attr("checked",true);
}
}
});
//UPDATE button
$(".btn_ajax").on("click", function(e) {
var button = $(this);
var form =$("#update");
$("#userId").val(userId);
$.ajax({
url: 'https://deboo.mybluemix.net/v1/user',
type: 'PUT',
data: form.serialize(),
timeout: 10000,
success:ajaxSuccess
})
});
$(".btn_del").on("click", function(e) {
if(window.confirm('退会処理を続行します')){
var button = $(this);
$("#userId").val(userId);
$.ajax({
url: 'https://deboo.mybluemix.net/v1/user',
type: 'DELETE',
data: {userId:userId},
timeout: 10000,
success:ajaxDelSuccess
})
}else{
alert('退会をキャンセルしました');
}
});
function ajaxDelSuccess(result){
if(result.result === "failure"){
$("#errorMsg").html("");
$("#errorMsg").append(" <div class='alert alert-danger' id='myAlert'></div>");
$("#myAlert").append("退会できませんでした。");
}else{
window.location.href = "//devdebu.github.io/signup.html";
}
}
function ajaxSuccess(result){
if(result.result === "failure"){
$("#errorMsg").html("");
$("#errorMsg").append(" <div class='alert alert-danger' id='myAlert'></div>");
$("#myAlert").append("<string>Password</string>、をもう一度確認してください。");
}else{
window.location.href = "//devdebu.github.io/myroom.html";
}
}
});
</script>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbarEexample7">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="myroom.html">DevDebu</a>
</div>
<div class="collapse navbar-collapse" id="navbarEexample7">
<ul class="nav navbar-nav">
<li><a href="input.html">アクティビティ入力</a></li>
</ul>
<p class="navbar-text navbar-right">ようこそ <a href="#" class="navbar-link"><span id ="dspName"></span></a> さん。</p>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row-fluid">
<div class="col-xs-12 col-md-6 panel-primary">
<div class="panel-heading">
<div class="panel-title">基本情報</div>
</div>
<div class="panel-body panel">
<form method ="POST" id="update">
<div class="login-block">
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-envelope"></span>
<input type="email" class="form-control rounded-right" placeholder="E-mailを入力してください。" name="mail" id="mail" >
</div>
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-lock"></span>
<input type="password" class="form-control rounded-right" placeholder="旧Passwordを入力してください。" name="passwordOld" id="passwordOld" >
</div>
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-lock"></span>
<input type="password" class="form-control rounded-right" placeholder="新Passwordを入力してください。" name="password" id="password" >
</div>
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-lock"></span>
<input type="password" class="form-control rounded-right" placeholder="新Passwordを入力してください(確認)" name="password2" id="password2" >
</div>
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-user"></span>
<input type="input" class="form-control rounded-right" placeholder="名前を入力してください" name="name" id="name" >
</div>
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-star"></span>
<div class="form-control rounded-right">
<div class="radio-inline">
<input type="radio" value="1" name="sex" id="man">
<label for="man">男性</label>
</div>
<div class="radio-inline">
<input type="radio" value="2" name="sex" id="woman">
<label for="woman">女性</label>
</div>
<div class="radio-inline">
<input type="radio" value="3" name="sex" id="other">
<label for="other">その他</label>
</div>
</div>
</div>
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-heart"></span>
<input type="input" class="form-control rounded-right" placeholder="生年月日を入力してください" name="birthday" id="birthday" >
</div>
<input type="hidden" name="userId" id="userId">
<div class="row margin-bottom-70">
<div class="col-md-12">
<button type="button" class ="btn btn-danger btn-block btn_ajax" action = "update" >UPDATE</button>
</div>
</div>
</div>
</form>
<div id = "errorMsg">
</div>
</div>
</div>
</div>
</div>
<hr>
<button type="button" class ="btn btn-danger btn-block btn_del" action = "del" >退会</button>
</body>
</html>