}
$c = explode(',', $p->countries);
$c[] = $_REQUEST['country'];
+ sort($c);
+// print_r($c);
$p->countries = implode(',', $c);
$p->update();
}
+ $this->jok(true);
}
- function supPersonToCountry($users)
+ function subPersonToCountry($users)
{
-
+ foreach($users as $id){
+ $p = DB_DataObject::factory('Person');
+ if(!$p->get($id)){
+ $this->jerr('This Person is not exsiting');
+ }
+ $c = explode(',', $p->countries);
+ if(($key = array_search($_REQUEST['country'], $c)) !== false) {
+ unset($c[$key]);
+ }
+ sort($c);
+// print_r($c);
+ $p->countries = implode(',', $c);
+ $p->update();
+ }
+ $this->jok(true);
}
}