pum=ParticipantsManager::factory(); } function index(){ $this->error403(); } } class UserUsers extends Users{ public function profile(){ $id = (($this->user instanceof Secretary )? $this->defineId() : $id = $this->user->getInfo('id')); $user_data = $this->pum->getUserInfo($id); $bill = empty ($user_data['bill']) ? null : $user_data['bill']; $this->templater->assign('user_data', $user_data); $this->templater->assign('abstracts', PresentationsManager::factory()->getAbstracts(array('user_id' =>$id))); $this->templater->assign('user_info', $user_data); $this->templater->assign('bill', $bill); $this->templater->assign('status', Module::factory('Forms')->getStatusList($id)); } private function changePwd(){ if (empty($_POST['pass'])) return false; $pass=$this->factory('main')->checkPassword(1); unset($_POST['pass']); if (empty($pass)) return false; $login = $this->user->getInfo('login'); $error = ''; if (!Person::login($login, $_POST['oldPwd'], $error, false)){ $this->templater->assign('old_pass_error', 'incorrect password'); return false; } $hache = md5($login.':'.Config::get()->usersPasswordsHashKey().':'.$pass); $this->db->query('UPDATE `users` SET `pass_hash`=? WHERE id=?d', $hache, $this->user->getId()); Person::login($login, $pass); return $this->redirect('/users/profile/?passChange'); unset($_POST['oldPwd']); } protected function defineId(){ if (!empty($_GET['id'])){ $id = $_GET['id']; }elseif (preg_match('~/(\d+)(\.html)($|\?|#)~', WebRequestParcer::getURI(), $regs)){ $id = $regs[1]; }else{ $id = $this->user->getInfo('id'); } return intval($id); } } class OrganizerUsers extends UserUsers{ function index(){ $_GET['mask'] = 253; $users = $this->pum->getAllUsers(); $this->templater->assign('users', $users); $this->templater->assign('usersCount', count($users)); } } class SecretaryUsers extends OrganizerUsers{ function index(){ //Mask & Session if (!empty($_POST['session_mask'])) $_SESSION['mask'] = $_POST['mask']; if (!empty($_POST['clear_mask']) and !empty($_SESSION['mask'])) unset($_SESSION['mask']); if (!empty($_SESSION['mask']) and empty($_GET['mask'])) $_GET['mask'] = $_SESSION['mask']; if (isset($_GET['id']) or isset($_GET['key'])) return $this->doAction('user'); //Save if (!empty($_POST['save'])){ reset($_POST['save']); $id = key($_POST['save']); if ($id == 'all'){ foreach ($_POST['userdata'] as $i => $v){ $this->saveUserTableData($i, $_POST['userdata'][$i]); } }else{ $this->saveUserTableData($id, $_POST['userdata'][$id]); } } //Load $users = $this->pum->getAllUsers(); if (!empty($users)){ $stats = array(); $stats['status']['user'] = 0; $stats['status']['participant'] = 0; $stats['status']['acc_persons'] = 0; $stats['status']['hotel'] = 0; $stats['status']['visa'] = 0; $stats['status']['payment'] = 0; $stats['status']['invoice'] = 0; $stats['type']['none'] = 0; $types = $this->pum->getUserTypes(); foreach ($types as $t) $stats['type'][$t] = 0; $stats['type']['eng'] = 0; $stats['type']['stud'] = 0; $stats['type']['free'] = 0; $stats['mark']['none'] = 0; $stats['mark']['payment'] = 0; $stats['mark']['invoice'] = 0; $stats['mark']['form'] = 0; $stats['mark']['no'] = 0; $payment_stats['RUB']['payed']=0; $payment_stats['RUB']['by_cash']=0; $payment_stats['RUB']['rest']=0; $payment_stats['RUB']['reg']=0; $payment_stats['RUB']['hotel']=0; $payment_stats['RUB']['total']=0; $payment_stats['€']['payed']=0; $payment_stats['€']['by_cash']=0; $payment_stats['€']['rest']=0; $payment_stats['€']['reg']=0; $payment_stats['€']['hotel']=0; $payment_stats['€']['total']=0; $payment_stats['kurs'] = floatval(str_replace(',', '.', isset($_GET['euro']) ? urldecode($_GET['euro']) : 40)); foreach ($users as $id => $u) { //User $_POST['userdata'][$id]['user']['secretary_comment'] = $u['secretary_comment']; //Participant $_POST['userdata'][$id]['participant']['type'] = (!empty($u['type']) ? $u['type'] : ''); $_POST['userdata'][$id]['participant']['mark'] = (!empty($u['mark']) ? $u['mark'] : ''); $_POST['userdata'][$id]['participant']['secretary_hotel'] = (!empty($u['secretary_hotel']) ? $u['secretary_hotel'] : ''); //Payment $_POST['userdata'][$id]['payment']['late'] = (!empty($u['payment']['state']['late']) ? $u['payment']['state']['late'] : ''); $_POST['userdata'][$id]['payment']['payed'] = (!empty($u['payment']['state']['payed']) ? $u['payment']['state']['payed'] : ''); $_POST['userdata'][$id]['payment']['add_pay'] = (!empty($u['payment']['state']['add_pay']) ? $u['payment']['state']['add_pay'] : ''); $_POST['userdata'][$id]['payment']['add_pay_reason'] = (!empty($u['payment']['state']['add_pay_reason']) ? $u['payment']['state']['add_pay_reason'] : ''); $_POST['userdata'][$id]['payment']['by_cash'] = (!empty($u['payment']['state']['by_cash']) ? $u['payment']['state']['by_cash'] : ''); //Statistics //Status if (!empty($u['status'])) $stats['status'][$u['status']]++; if (!empty($u['type'])){ $stats['type'][$u['type']]++; }else{ $stats['type']['none']++; } if (!empty($u['mark'])){ $stats['mark'][$u['mark']]++; }else{ $stats['mark']['none']++; } //Payment if (!empty($u['bill']) and $u['mark']!='no'){ $valuta = $u['bill']['currency']; $payment_stats[$valuta]['payed'] += $u['payment']['state']['payed']; $payment_stats[$valuta]['by_cash'] += $u['payment']['state']['by_cash']; $payment_stats[$valuta]['rest'] += $u['bill']['rest']; $payment_stats[$valuta]['hotel'] += $u['bill']['hotel']; $payment_stats[$valuta]['reg'] += $u['bill']['reg']; $payment_stats[$valuta]['total'] += $u['bill']['total']; } //Test user Type $users[$id]['autotype']=$this->pum->autoUserType($u['country_id']); } } if (!empty($users)){ $this->sortBy($users); } $hotel_rooms = $this->pum->get_hotel_rooms(); $plain_hotel_rooms=array(); foreach ($hotel_rooms as $h){ foreach ($h as $r_k => $r){ $plain_hotel_rooms[$r_k]=$r; } } $this->templater->assign('hotel_names', $this->pum->get_hotel_names()); $this->templater->assign('plain_hotel_rooms', $plain_hotel_rooms); $this->templater->assign('users', $users); $this->templater->assign('usersCount', count($users)); $this->templater->assign('stats', $stats); $this->templater->assign('payment_stats', $payment_stats); $this->templater->assign('types', $this->pum->getUserTypes()); $this->templater->assign('country_list', $this->pum->getCountryList()); } function edit(){ $id = $this->defineId(); if (!empty($_POST['submit'])){ //SAVE $user_set=array(); if (!empty($_POST['user']['email'])) $user_set['email']=$_POST['user']['email']; if (isset($_POST['user']['p_email'])) $user_set['p_email']=$_POST['user']['p_email']; if (!empty($_POST['user']['name'])) $user_set['name']=$_POST['user']['name']; if (isset($_POST['user']['other_name'])) $user_set['other_name']=$_POST['user']['other_name']; if (!empty($_POST['user']['surname'])) $user_set['surname']=$_POST['user']['surname']; if (!empty($_POST['user']['citizenship'])) $user_set['citizenship']=$_POST['user']['citizenship']; if (!empty($_POST['user']['affiliation'])) $user_set['affiliation']=$_POST['user']['affiliation']; if (isset($_POST['user']['city'])) $user_set['city']=$_POST['user']['city']; if (!empty($_POST['user']['country'])) $user_set['country']=$_POST['user']['country']; if (isset($_POST['user']['phone'])) $user_set['phone']=$_POST['user']['phone']; if (isset($_POST['user']['fax'])) $user_set['fax']=$_POST['user']['fax']; if (!empty($user_set)){ //echo "
";
//print_r($user_set);
//echo "
"; $this->pum->savePerson($user_set, $id); } } $_POST['user'] = $this->pum->getUserInfo($id); $_POST['user']['country'] = $_POST['user']['country_id']; $this->templater->assign('country_list', $this->pum->getCountryList()); } protected function saveUserTableData($id, $data){ //2DO: Allowed filter //USER & PARTICIPANT $person_set = array(); if (isset($data['user']['secretary_comment'])) $person_set['secretary_comment'] = $data['user']['secretary_comment']; if (isset($data['participant']['type'])) $person_set['type'] = $data['participant']['type']; if (isset($data['participant']['mark'])) $person_set['mark'] = $data['participant']['mark']; if (isset($data['participant']['secretary_hotel'])) $person_set['secretary_hotel'] = $data['participant']['secretary_hotel']; if (!empty($person_set)) $this->pum->savePerson($person_set, $id); //PAYMENT $payment_set = array(); if (isset($data['payment']['late'])) $payment_set[] = '`late`="'.$data['payment']['late'].'"'; if (isset($data['payment']['payed'])) $payment_set[] = '`payed`="'.$data['payment']['payed'].'"'; if (isset($data['payment']['add_pay'])) $payment_set[] = '`add_pay`="'.$data['payment']['add_pay'].'"'; if (isset($data['payment']['add_pay_reason'])) $payment_set[] = '`add_pay_reason`="'.$data['payment']['add_pay_reason'].'"'; if (isset($data['payment']['by_cash'])) $payment_set[] = '`by_cash`="'.$data['payment']['by_cash'].'"'; if (!empty($payment_set)){ $this->db->query('UPDATE `payment` SET '.implode(', ', $payment_set).' WHERE `user_id` = ?d', $id); } } public function acc_persons_list(){ $acc_persons = $this->db->select('SELECT *, `id` AS ARRAY_KEY FROM `acc_persons` WHERE 1'); $users = $this->pum->getFullUsersData($this->db->selectCol('SELECT `user_id` FROM `acc_persons` WHERE 1')); $this->templater->assign('acc_persons_list', $acc_persons); $this->templater->assign('users_list', $users); } public function banquet_list(){ $boi = 2; //Banquet Option ID $free_users = $this->pum->getFullUsersData($this->db->selectCol('SELECT `participants`.`user_id` FROM `payment_prices` INNER JOIN `participants` ON `payment_prices`.`type`=`participants`.`type` WHERE `payment_prices`.`option_id`=?d AND `payment_prices`.`inc`="included"', $boi)); $payed_ids = $this->db->selectCol('SELECT `p_id` FROM `payment_by_options` WHERE `option_id`=2 AND `quantity`=1'); if (!empty($payed_ids)){ $acc_persons_ids = array(); $participants_ids = array(); foreach ($payed_ids as $pid){ if (preg_match('~acc_(\d+)~', $pid, $mathches)){ $acc_persons_ids[] = $mathches[1]; }else { $participants_ids[] = $pid; } } if (!empty($participants_ids)) $payed_users = $this->pum->getFullUsersData($participants_ids); if (!empty($acc_persons_ids)){ $payed_acc_persons = $this->db->select('SELECT *, `id` AS ARRAY_KEY FROM `acc_persons` WHERE `id` IN(?a)', $acc_persons_ids); $users4acc_p = $this->pum->getFullUsersData($this->db->selectCol('SELECT `user_id` FROM `acc_persons` WHERE 1')); } $this->templater->assign('count_free', count($free_users)); $this->templater->assign('count_payed', count($payed_users)); $this->templater->assign('count_acc_p', count($payed_acc_persons)); $this->templater->assign('free_users', $free_users); $this->templater->assign('payed_users', $payed_users); $this->templater->assign('payed_acc_persons', $payed_acc_persons); $this->templater->assign('users4acc_p', $users4acc_p); } } protected function sortBy(&$array){ //check field presence reset($array); $a = current($array); if (!isset($_GET["sort"])) return false; $field = $_GET["sort"]; // if (!isset($a[$field])) // return false; // $direction = isset($_GET['desc']) ? -1 : 1; uasort($array, create_function('$a, $b',' $direction = isset($_GET["desc"]) ? -1 : 1; $field = $_GET["sort"]; return (isset($a[$field])?$direction*($a[$field]>$b[$field] ? 1 : ($a[$field] < $b[$field] ? -1 : 0)):(isset($b[$field])?0:1)); ')); } } class AdminUsers extends SecretaryUsers { public function get(){ /** * @var PresentationsManager */ $pm=PresentationsManager::factory(); $users = $this->pum->getAllUsers(); $result = array(); foreach ($users as $u_id => $u){ if ($u['type']!='free' and $u['type']!='free_inv' and $this->pum->autoUserType($u['country_id'])!='eng'){ echo $u['email'].'
'; } } } } ?> ACNS'2013: Error 404 - Page not found
User menu:
  Forgot password? or Register
 

Error

There is no such page at this site.

You can try again from the Home Page