}
 if ($extnum) {
     $ret = gs_user_external_number_add($edit_user, $extnum);
     if (isGsError($ret)) {
         echo '<div class="errorbox">', $ret->getMsg(), '</div>', "\n";
     }
 }
 if ($u_pgrp_ed) {
     $sql_query = 'DELETE `p` ' . 'FROM `pickupgroups_users` `p` , `users` `u` ' . 'WHERE ' . '`p`.`user_id` = `u`.`id` AND ' . '`u`.`user` = \'' . $DB->escape($edit_user) . '\'';
     $ok = $DB->execute($sql_query);
     if (is_array($u_pgrps)) {
         foreach ($u_pgrps as $u_pgrp) {
             if ($u_pgrp < 1) {
                 continue;
             }
             $ret = gs_pickupgroup_user_add($u_pgrp, $edit_user);
             if (isGsError($ret)) {
                 echo '<div class="errorbox">', $ret->getMsg(), '</div>', "\n";
             }
         }
     }
 }
 if ($u_prv_grp_ed) {
     $query = 'UPDATE `users` SET ' . '`group_id`=' . ($u_prv_grp_id > 0 ? $u_prv_grp_id : 'NULL') . ' ' . 'WHERE `user`=\'' . $DB->escape($edit_user) . '\'';
     $ok = $DB->execute($query);
 }
 if ($bp_add_h > 0) {
     $user_id = (int) $DB->executeGetOne('SELECT `id` FROM `users` WHERE `user`=\'' . $DB->escape($edit_user) . '\'');
     if ($user_id > 0) {
         $host_exists = $DB->executeGetOne('SELECT 1 FROM `hosts` WHERE `id`=' . $bp_add_h);
         if ($host_exists) {
Exemplo n.º 2
0
    }
}
if ($title && !$save) {
    $ret = gs_pickupgroup_add($title);
    if (isGsError($ret)) {
        echo $ret->getMsg();
    }
}
if ($save) {
    $sql_query = 'UPDATE `pickupgroups` SET
	`title`=\'' . $DB->escape($title) . '\'
WHERE `id`=' . $save;
    $rs = $DB->execute($sql_query);
}
if ($group && $user) {
    $ret = gs_pickupgroup_user_add($group, $user);
    if (isGsError($ret)) {
        echo $ret->getMsg();
    }
}
#####################################################################
#  show pickup group {
#####################################################################
if (!$group) {
    $sql_query = 'SELECT SQL_CALC_FOUND_ROWS
	`p`.`id` `id`, `p`.`title` `title`,
	COUNT(`pu`.`user_id`) `num_members`
FROM
	`pickupgroups` `p` LEFT JOIN
	`pickupgroups_users` `pu` ON (`pu`.`group_id`=`p`.`id`)
GROUP BY `p`.`id`