-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.php
171 lines (136 loc) · 5.5 KB
/
user.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
<div style='min-height:630px;'>
<!-- Load jQuery and the validate plugin -->
<script src="validation/jquery-1.9.1.js"></script>
<script src="validation/jquery.validate.min.js"></script>
<!-- jQuery Form Validation code -->
<script>
// When the browser is ready...
$(function() {
// Setup form validation on the #register-form element
$("#data_user-form").validate({
// Specify the validation rules
rules: {
user: "required",
password: {
required: true,
minlength: 3
},
nama: "required",
petugas: "required",
alamat: "required",
email: {
required: true,
email: true
},
telp: {
required: true,
number: true
},
agree: "required"
},
// Specify the validation error messages
messages: {
user: "Masukkan Username Dengan Benar",
password: {
required: "Masukkan Password Dengan Benar",
minlength: "Minimal 3 karakter"
},
nama: "Textbox Harus diisi",
petugas: "Textbox Harus diisi",
email: "Masukan Email Valid, contoh: [email protected]",
alamat: "Masuk Alamat Dengan Benar",
tlp: "Masukan Angka Valid",
agree: "Please accept our policy"
},
submitHandler: function(form) {
form.simpan();
}
});
});
</script>
<br><br><br><br><br>
<form class="form-horizontal" method="post" action="proses_user.php" role="form" id="data_user-form">
<fieldset>
<!-- Form Username -->
<center><legend><h2>Tambah Data User</h2></legend></center>
<br><br>
<!-- Text input-->
<input type="hidden" name="id_user">
<div class="form-group">
<label class="col-md-4 control-label" for="user">Username</label>
<div class="col-md-4">
<input id="user" name="user" placeholder="username" class="form-control input-md" type="text">
</div>
</div>
<!-- Password-->
<div class="form-group">
<label class="col-md-4 control-label" for="password">Password</label>
<div class="col-md-4">
<input id="password" name="password" placeholder="password" class="form-control input-md" type="password" >
</div>
</div>
<!-- Nama Perusahaan-->
<div class="form-group">
<label class="col-md-4 control-label" for="nama">Nama Klien</label>
<div class="col-md-4">
<input id="nama" name="nama" placeholder="nama klien" class="form-control input-md" type="text" >
</div>
</div>
<!-- Nama Perusahaan-->
<div class="form-group">
<label class="col-md-4 control-label" for="petugas">Nama Petugas</label>
<div class="col-md-4">
<input id="petugas" name="petugas" placeholder="nama petugas" class="form-control input-md" type="text" >
</div>
</div>
<!-- Alamat-->
<div class="form-group">
<label class="col-md-4 control-label" for="alamat">Alamat</label>
<div class="col-md-4">
<textarea class="form-control" id="alamat" name="alamat"></textarea>
</div>
</div>
<!-- Email-->
<div class="form-group">
<label class="col-md-4 control-label" for="email">Email</label>
<div class="col-md-4">
<input type="email" id="email" name="email" placeholder="email" class="form-control input-md" >
</div>
</div>
<!-- Telp-->
<div class="form-group">
<label class="col-md-4 control-label" for="telp">No. Telepon</label>
<div class="col-md-4">
<input id="telp" name="tlp" placeholder="telp" class="form-control input-md" type="text">
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="hak_akses">Hak Akses</label>
<div class="col-md-4">
<select id="hak_akses" name="hak_akses" class="form-control">
<?php
// tampilkan untuk form ubah mahasiswa
if($id_user > 0) { ?>
<option value="<?php echo $hak_akses ?>"><?php echo "$hak_akses"; ?></option>
<?php } ?>
<option value="">-- Pilih --</option>
<option value="admin">Admin</option>
<option value="user">User</option>
</select>
</div>
</div>
<!-- Button (Double) -->
<div class="form-group">
<label class="col-md-4 control-label" for="simpan"></label>
<div class="col-md-8">
<button type="submit" id="simpan" name="simpan" class="btn btn-primary">Simpan</button>
<button id="reset" name="reset" class="btn btn-danger" onclick="history.back();">Back</button>
</div>
</div>
<br><br>
</fieldset>
</form>
</div>
<!-- /.container-fluid -->
</div>