Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.html
More file actions
Latest commit
187 lines (182 loc) · 7.37 KB
/
Copy pathuser.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>
<htmllang="ja">
<head>
<metacharset="utf-8">
<metahttp-equiv="X-UA-Compatible" content="IE=edge">
<metaname="viewport" content="width=device-width, initial-scale=1">
<title>DevDebu 基本情報入力</title>
<!-- BootstrapのCSS読み込み -->
<linkhref="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<!-- jQuery読み込み -->
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<!-- underescore読み込み -->
<scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<!-- BootstrapのJS読み込み -->
<scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<STYLEtype="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(){
varuserId=localStorage.getItem("userId");
//基本情報取得
$.ajax({
url:'https://deboo.mybluemix.net/v1/user?userId='+userId,
type:'GET',
success:function(user){
varmyUser=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);
}elseif(myUser.sex==1){
$("#worman").attr("checked",true);
}else{
$("#other").attr("checked",true);
}
}
});
//UPDATE button
$(".btn_ajax").on("click",function(e){
varbutton=$(this);
varform=$("#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('退会処理を続行します')){
varbutton=$(this);
$("#userId").val(userId);
$.ajax({
url: 'https://deboo.mybluemix.net/v1/user',
type: 'DELETE',
data: {userId:userId},
timeout: 10000,
success:ajaxDelSuccess
})
}else{
alert('退会をキャンセルしました');
}
});
functionajaxDelSuccess(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";
}
}
functionajaxSuccess(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>
<navclass="navbar navbar-inverse">
<divclass="container-fluid">
<divclass="navbar-header">
<buttontype="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbarEexample7">
<spanclass="sr-only">Toggle navigation</span>
<spanclass="icon-bar"></span>
<spanclass="icon-bar"></span>
<spanclass="icon-bar"></span>
</button>
<aclass="navbar-brand" href="myroom.html">DevDebu</a>
</div>
<divclass="collapse navbar-collapse" id="navbarEexample7">
<ulclass="nav navbar-nav">
<li><ahref="input.html">アクティビティ入力</a></li>
</ul>
<pclass="navbar-text navbar-right">ようこそ <ahref="#" class="navbar-link"><spanid ="dspName"></span></a> さん。</p>
</div>
</div>
</nav>
<divclass="container-fluid">
<divclass="row-fluid">
<divclass="col-xs-12 col-md-6 panel-primary">
<divclass="panel-heading">
<divclass="panel-title">基本情報</div>
</div>
<divclass="panel-body panel">
<formmethod ="POST" id="update">
<divclass="login-block">
<divclass="input-group margin-bottom-20">
<spanclass="input-group-addon rounded-left glyphicon glyphicon-envelope"></span>
<inputtype="email" class="form-control rounded-right" placeholder="E-mailを入力してください。" name="mail" id="mail" >
</div>
<divclass="input-group margin-bottom-20">
<spanclass="input-group-addon rounded-left glyphicon glyphicon-lock"></span>
<inputtype="password" class="form-control rounded-right" placeholder="旧Passwordを入力してください。" name="passwordOld" id="passwordOld" >
</div>
<divclass="input-group margin-bottom-20">
<spanclass="input-group-addon rounded-left glyphicon glyphicon-lock"></span>
<inputtype="password" class="form-control rounded-right" placeholder="新Passwordを入力してください。" name="password" id="password" >
</div>
<divclass="input-group margin-bottom-20">
<spanclass="input-group-addon rounded-left glyphicon glyphicon-lock"></span>
<inputtype="password" class="form-control rounded-right" placeholder="新Passwordを入力してください(確認)" name="password2" id="password2" >
</div>
<divclass="input-group margin-bottom-20">
<spanclass="input-group-addon rounded-left glyphicon glyphicon-user"></span>
<inputtype="input" class="form-control rounded-right" placeholder="名前を入力してください" name="name" id="name" >
</div>
<divclass="input-group margin-bottom-20">
<spanclass="input-group-addon rounded-left glyphicon glyphicon-star"></span>
<divclass="form-control rounded-right">
<divclass="radio-inline">
<inputtype="radio" value="1" name="sex" id="man">
<labelfor="man">男性</label>
</div>
<divclass="radio-inline">
<inputtype="radio" value="2" name="sex" id="woman">
<labelfor="woman">女性</label>
</div>
<divclass="radio-inline">
<inputtype="radio" value="3" name="sex" id="other">
<labelfor="other">その他</label>
</div>
</div>
</div>
<divclass="input-group margin-bottom-20">
<spanclass="input-group-addon rounded-left glyphicon glyphicon-heart"></span>
<inputtype="input" class="form-control rounded-right" placeholder="生年月日を入力してください" name="birthday" id="birthday" >
</div>
<inputtype="hidden" name="userId" id="userId">
<divclass="row margin-bottom-70">
<divclass="col-md-12">
<buttontype="button" class ="btn btn-danger btn-block btn_ajax" action = "update" >UPDATE</button>
</div>
</div>
</div>
</form>
<divid = "errorMsg">
</div>
</div>
</div>
</div>
</div>
<hr>
<buttontype="button" class ="btn btn-danger btn-block btn_del" action = "del" >退会</button>
</body>
</html>