public function holds_position($deptid) { if (empty($this->positions)) { return false; } $dept = new DepartmentObj($deptid); foreach ($this->positions as $posid) { if ($dept->has_position($posid)) { return true; } } return false; }
public function action_delete_department() { $deptid = $_REQUEST["deptid"]; $department = new DepartmentObj($deptid); if (!$department->loaded) { return print "Department cannot be found!"; } $department->delete(); return print 1; }