function __construct($servername, $username, $password, $dbname, $router_login, $router_pasword, $cli_login, $cli_password, $id_cli) { parent::__construct($servername, $username, $password, $dbname); if ($router_login && $router_pasword && !$cli_login && !$cli_password && !$id_cli) { // Get web user credentials (from router) $this->id_db_user = $this->getWebUserByAuthenticatingViaRouterData($router_login, $router_pasword); } else { if (!$router_login && !$router_pasword && $cli_login && $cli_password && !$id_cli) { // Get web user credentials (from live user) (login act) $this->setWebUser($cli_login, $cli_password); } else { if (!$router_login && !$router_pasword && !$cli_login && !$cli_password && $id_cli) { // Set id $this->setWebUserByID($id_cli); } else { if (!$router_login && !$router_pasword && !$cli_login && !$cli_password && !$id_cli) { // Ничего не делать, база данных подключена. } else { Error::fatalError('DEBUG Error: DBWiFiTinterface constructor received bad parameters'); } } } } if ($this->is_valid()) { $this->pretendToBe(); } // Notification::add("Database interface constructor performed ".$this->num_queries_performed.' queries'); }
public function __construct($legislation_id = 0) { parent::__construct('legislation', $legislation_id); if ($legislation_id) { $state = new State($this->region_id()); $logo = LOGO_PATH . strtolower('state_' . $state->state_abbr() . '_' . $this->current_chamber()) . '.png'; $location = $state->state_name() . ' State ' . $this->current_chamber(); list($category_id, $category_name) = Category::legislation_get_category($this->current_location()); $committee = Category::get_location($this->current_location()); $this->legislator_ids = $this->get_legislator_ids(); $legislators = array(); if (!empty($this->legislator_ids)) { foreach ($this->legislator_ids as $id) { $legislators[] = new Legislator($id); } } $this->sponsors = Legislation::get_legislator_data($legislators, $committee); $this->bill = $this->_extract_bill_id(); $this->image = $logo; $this->bill_location = $location; $this->location_description = $committee; $this->category = array('id' => $category_id, 'name' => $category_name); $this->status = new Status($this->status_id()); $this->date_introduced_parts = get_date_parts($this->date_introduced()); $this->date_heard_parts = get_date_parts($this->date_heard()); $this->_get_public_opinion(); $this->comment_data = $this->get_comment_data(); } }
public function __construct($feedback_id = 0) { parent::__construct('legislation_feedback', $feedback_id); if ($feedback_id) { $this->user = new User($this->user_id()); } }
public function __construct($user_alert_id = 0) { parent::__construct('user_alert', $user_alert_id); if ($user_alert_id) { $this->tag = new Tag($this->tag_id()); } }
public function __construct($lc_id = 0) { parent::__construct('category', $lc_id); if ($lc_id) { $sql = "SELECT COUNT(*) FROM legislation WHERE current_location IN (SELECT lc_category FROM category WHERE lc_parent_id={$lc_id})"; $l_count = db()->Get_Cell($sql); $sql = "SELECT COUNT(*) FROM announcement WHERE category_id={$lc_id}"; $a_count = db()->Get_Cell($sql); $total_count = $l_count = $a_count; $this->cat_count($total_count); } }
public function __construct($sponsor_id = 0) { parent::__construct('sponsor', $sponsor_id); if ($sponsor_id) { $region = new Region($this->region_id(), $this->region_type()); $office = new Office($this->office_id()); $this->sponsor_id = $sponsor_id; $this->office = $this->title(); $this->full_name = $this->name_first() . ' ' . $this->name_last(); $this->img_name = $this->image(); $this->public_image = $this->get_image_src(); $this->image = $this->get_image_src(); $this->region = $region->city_name(); } }
public function __construct($legislator_id = 0) { $title_abbr = array('Senator' => 'Sen.', 'Assemblymember' => 'Asm.'); parent::__construct('legislator', $legislator_id); if ($legislator_id) { $dist_number = substr($this->district(), 2, 2); $this->id = $this->id(); $this->img_name = remove_accents(strtolower(fix_name($this->name_last()) . '_' . fix_name($this->name_first()))) . '.jpg'; $this->image = $this->get_image_src(); $this->level = $this->state() ? 'State' : ''; $this->title = $title_abbr[$this->name_title()]; $this->full_name = $this->name_first() . ' ' . $this->name_last(); $this->party = substr($this->party(), 0, 1); $this->district = $this->state() . '-' . $dist_number; $this->full_title = sprintf("%s %s - %s (%s)", $this->level, $this->title, $this->party, $this->district); $this->office = $this->name_title(); } }
public function __construct($region_id = 0, $region_type = REGION_CITY) { if ($region_type == REGION_CITY) { parent::__construct('ref_city', $region_id); if ($region_id) { $this->name($this->city_name()); } } elseif ($region_type == REGION_COUNTY) { parent::__construct('ref_county', $region_id); if ($region_id) { $this->name($this->county_name()); } } elseif ($region_type == REGION_STATE) { parent::__construct('ref_state', $region_id); if ($region_id) { $this->name($this->state_name()); } } elseif ($region_type == REGION_NATION) { } }
public function __construct($announcement_id = 0, $get_list = false) { parent::__construct('announcement', $announcement_id); if ($get_list === false && $announcement_id) { $this->sponsor_ids = $this->get_sponsor_ids(); $sponsors = array(); if (!empty($this->sponsor_ids)) { foreach ($this->sponsor_ids as $id) { $sponsors[] = new Sponsor($id); } } $this->sponsors = Announcement::get_sponsor_data($sponsors); list($category_id, $category_name) = Category::announcement_get_category($this->id()); $this->category = array('id' => $category_id, 'name' => $category_name); $this->status = new Status($this->status_id()); $this->office = new Office($this->sponsor_id()); $this->date_beginning_parts = get_date_parts($this->date_beginning()); $this->date_ending_parts = get_date_parts($this->date_ending()); $this->calendared_parts = get_date_parts($this->calendared()); $this->vote_parts = get_date_parts($this->vote()); $this->_get_public_opinion(); $this->comment_data = $this->get_comment_data(); } }
function __construct() { parent::__construct(GUEST_NAME, GUEST_PASS); }
public function __construct($sms_id = 0) { parent::__construct('sms_gateway', $sms_id); }
public function __construct($office_id = 0) { parent::__construct('ref_office', $office_id); }
public function __construct($status_id = 0) { parent::__construct('status', $status_id); }
public function __construct($log_id = 0) { parent::__construct('log', $log_id); }
public function __construct($image_id = 0) { parent::__construct('ref_image', $image_id); }
public function __construct($tf_id = 0) { parent::__construct('tell_friend', $tf_id); }
public function __construct($admin_id = 0) { parent::__construct('user', $admin_id); }
public function __construct($state_id = 0) { parent::__construct('ref_state', $state_id); }
public function __construct($tag_id = 0) { parent::__construct('tag', $tag_id); if ($tag_id) { } }
public function __construct($user_region_id = 0) { parent::__construct('user_region', $user_region_id); }