Cara membatasi members untuk edit profile di toko onlinemuDibuat
Login Terakhir
1 Bulan lalu,
Telah Dilihat 1689 Kali
| |
Sultan Account |
|
|
Reza Dalimunthe
Mengatakan :
Sultan Account
Assalamualaikum Warahmatullahi Wabarakatuh... mau minta petunjuk ini gan, Cara membatasi member untuk edit profilenya hanya 3x edit saja.. trus cara locked username biar gak bisa di edit.. thx gan |
|
| Reza Dalimunthe commented on 11 Mei 2018 23:31:48 Sultan Account |
|
|
|
Assalam,.. yang di lock atau gak bisa di edit username yang bebas untuk di edit berulang2 foto profile, password, alamat, kota sekarang yang dibatasi 3x pengeditan tgl lahir, email, kelamin, tempat lahir, no hp |
|
| Reza Dalimunthe commented on 12 Mei 2018 19:35:37 Sultan Account |
|
|
|
Assalam,.. up gan |
|
| Agung Budi Prihantono commented on 12 Mei 2018 22:57:51 Sultan Account |
|
|
|
Assalam,.. kalau username lock bisa pake readonly mas di folder pengunjung/view_profile_edit.php baris ke 9 <tr><td width='140px'><b>Username</b></td> <td><input class='required form-control' style='width:50%; display:inline-block' name='aa' type='text' value='$row[username]'></td></tr> tambahin readonly jadi: <tr><td width='140px'><b>Username</b></td> <td><input class='required form-control' style='width:50%; display:inline-block' name='aa' type='text' value='$row[username]' readonly></td></tr> kalau yang lainnya ga ngerti deh hehehehe |
|
| Reza Dalimunthe commented on 13 Mei 2018 06:30:05 Sultan Account |
|
|
|
Assalam,.. Yg lainnya itu seperti di forum ini gan.. Maksimal update profil cuma 3x.. Mohon petunjuk gan |
|
| Bukhori Muslim commented on 13 Mei 2018 07:05:17 Sultan Account |
|
|
|
Assalam,.. bisa dengan menambahkan field baru pada table rb_konsumen
ALTER TABLE `rb_konsumen` ADD `update_profile` INT(11) NOT NULL AFTER `tanggal_daftar`;
Selanjutnya pada "application/controllers/members.php" pada baris 27 - 28 ubah jadi :
<?php
$mem = $this->db->query("SELECT * FROM rb_konsumen where id_konsumen='".$this->session->id_konsumen."'")->row_array();
if ($mem['update_profile']<3){
$this->model_members->profile_update($this->session->id_konsumen);
$this->db->query("UPDATE rb_konsumen SET update_profile=$mem['update_profile']+1 where id_konsumen='".$this->session->id_konsumen."'");
redirect('members/profile');
}else{
echo "<script>window.alert('Maaf, anda sudah update profile 3 kali');
window.location=('".base_url()."members/edit_profile/".$this->session->id_konsumen."')</script>";
}
?>
Simpan dan selesai...
|
|
| Reza Dalimunthe commented on 13 Mei 2018 08:11:34 Sultan Account |
|
|
|
Assalam,.. Ok gan, makasi banyak yo... Ntar ane coba.. Lagi gak didepan laptop ni gan... |
|