View Single Post
  #2  
Old 04-21-2017, 10:09 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 36,229
kristhasirah
Default

dont know if you already fixed this but here is something that works for me as im using the shops as base to create groups for my page and this stops the users from editing others shops
so try changing this:
PHP Code:
            $shop $mysidia->db->select("user_shops", array(), "usid='{$mysidia->input->get("usid")}'")->fetchObject(); 
for this:
PHP Code:
            $shop $mysidia->db->select("user_shops", array(), "usid='{$mysidia->input->get("usid")}' and manager_id = '{$mysidia->user->uid}'")->fetchObject(); 
and for showing only the shops for each user you can try this:
PHP Code:
        $stmt $mysidia->db->select("user_shops", array(), "manager_id = '{$mysidia->user->uid}'"); 
please note that im assuming that manager_id is where you have stored the owner of the shop... as im using owner as the name for the row where the username is stored when a group is created by that user ^^ so if the code above don't work
then try changing the manager_id = '{$mysidia->user->uid}'
for manager_id = '{$mysidia->user->username}' or owner = '{$mysidia->user->username}'

hope this works for you =)
Reply With Quote