function GetUserInformation($payload) { $connector = new Connector(); $payload = json_decode($payload); $sql = ""; $sql .= " SELECT"; $sql .= " \t members_info.email"; $sql .= " \t , members_info.lastname"; $sql .= " \t , members_info.firstname"; $sql .= " \t , members_info.middlename"; $sql .= " \t , members_info.contactno"; $sql .= " \t , members_info.status"; $sql .= " \t , members_address.houseno"; $sql .= " \t , members_address.companyname"; $sql .= " \t , members_address.barangay"; $sql .= " \t , members_address.city"; $sql .= " \t , members_address.district"; $sql .= " FROM members_info"; $sql .= " INNER JOIN members_address ON"; $sql .= " \tmembers_info.email = members_address.email"; $sql .= " WHERE"; $sql .= "\tmembers_info.email \t\t\t= '" . $payload->email . "'"; $sql .= "\tAND members_info.password \t= '" . md5($payload->password) . "'"; $mysqliQuery = mysqli_query($connector->GetConnection(), $sql); if ($mysqliQuery) { echo json_encode(mysqli_fetch_array($mysqliQuery)); } else { echo 'error'; } }
function Insert() { include './connector.php'; $con = new Connector(); $NameOfLogin = $_SESSION['NameOfLogin']; $SurnameOfLogin = $_SESSION['SurnameOfLogin']; $ProgrammThatUserClick = $_SESSION['ProgrammThatUserClick']; $res = $con->prepare("INSERT INTO history VALUES('{$NameOfLogin}', '{$SurnameOfLogin}', '{$ProgrammThatUserClick}','null')"); }
public function getGroups($aDatabase, $aPrefix, $aUser, $aPass, $aThrow) { $Connector = new Connector(SQL_HOST, $aDatabase, $aUser, $aPass, $aThrow); if ($Connector != null) { // only test if we can read the user table $TestQuery = $Connector->prepare('SELECT user_id FROM `' . $aPrefix . 'users` LIMIT 1'); $Connector->run($TestQuery, $aThrow); } return null; }
/** * Resolves any url into absolute one using given url for missing parts. * * @param string $wc_url Working copy url. * @param string $url_to_resolve Url to resolve. * * @return string */ public function resolve($wc_url, $url_to_resolve) { if (strpos($url_to_resolve, '/') === false && $url_to_resolve !== 'trunk') { return dirname($wc_url) . '/' . $url_to_resolve; } if (preg_match('#^(/|\\^/)(.*)$#', $url_to_resolve, $regs)) { return str_replace(parse_url($wc_url, PHP_URL_PATH), '/' . $regs[2], $wc_url); } return $this->repositoryConnector->getProjectUrl($wc_url) . '/' . $url_to_resolve; }
function Insert() { include './connector.php'; $con = new Connector(); //Το όνομα του χρήστη που κάνει σύνδεση $NameOfLogin = $_SESSION['NameOfLogin']; //Το επώνυμο του χρήστη που κάνει σύνδεση $SurnameOfLogin = $_SESSION['SurnameOfLogin']; //Το πρόγραμμα που επέλεξε να χρησιμοποιήσει ο χρήστης $ProgrammThatUserClick = $_SESSION["ProgrammThatUserClick"]; $res = $con->prepare("INSERT INTO history VALUES('{$NameOfLogin}', '{$SurnameOfLogin}', '{$ProgrammThatUserClick}','null')"); }
public function getGroups($aDatabase, $aPrefix, $aUser, $aPass, $aThrow) { $Connector = new Connector(SQL_HOST, $aDatabase, $aUser, $aPass, $aThrow); if ($Connector != null) { $GroupQuery = $Connector->prepare('SELECT id, title FROM `' . $aPrefix . 'usergroups` ORDER BY title'); $Groups = array(); $GroupQuery->loop(function ($Group) use(&$Groups) { array_push($Groups, array('id' => $Group['id'], 'name' => $Group['title'])); }, $aThrow); return $Groups; } return null; }
public function GetShippingPrices() { $connector = new Connector(); $sql = " SELECT"; $sql .= "\tdistancefrom"; $sql .= " \t, distanceto"; $sql .= "\t, price"; $sql .= " FROM shipping_prices"; $mysqliQuery = mysqli_query($connector->GetConnection(), $sql); $output = array(); while ($row = mysqli_fetch_array($mysqliQuery, MYSQLI_ASSOC)) { array_push($output, $row); } return json_encode($output); }
function msgQueryLocations($aRequest) { global $gSite; global $gGame; loadGameSettings(); $Out = Out::getInstance(); if (validRaidlead()) { $Connector = Connector::getInstance(); // Locations $ListLocations = $Connector->prepare('Select * FROM `' . RP_TABLE_PREFIX . 'Location` WHERE Game = :Game ORDER BY Name'); $ListLocations->bindValue(':Game', $gGame['GameId'], PDO::PARAM_STR); $Locations = array(); $ListLocations->loop(function ($Data) use(&$Locations) { $LocationData = array('id' => $Data['LocationId'], 'name' => $Data['Name'], 'image' => $Data['Image']); array_push($Locations, $LocationData); }); $Out->pushValue('location', $Locations); // Images $Images = @scandir('../themes/icons/' . $gSite['Iconset'] . '/raidsmall'); $ImageList = array(); if ($Images != null) { foreach ($Images as $Image) { if (strripos($Image, '.png') !== false) { array_push($ImageList, $Image); } } } $Out->pushValue('locationimage', $ImageList); } else { $Out->pushError(L('AccessDenied')); } }
/** * Register all context hooks * * @return void */ public function register() { parent::register(); add_action('load-theme-editor.php', array($this, 'get_edition_data')); add_action('load-plugin-editor.php', array($this, 'get_edition_data')); add_filter('wp_redirect', array($this, 'log_changes')); }
function msgQueryNewRaidData($aRequest) { $Out = Out::getInstance(); if (validRaidlead()) { $Connector = Connector::getInstance(); // Settings $NewRaidSettings = $Connector->prepare('SELECT Name, IntValue, TextValue FROM `' . RP_TABLE_PREFIX . 'Setting`'); $IntOfInterest = array('RaidSize', 'RaidStartHour', 'RaidStartMinute', 'RaidEndHour', 'RaidEndMinute', 'StartOfWeek'); $TextOfInterest = array('RaidMode'); $Settings = array(); $NewRaidSettings->loop(function ($Data) use(&$Settings, $IntOfInterest, $TextOfInterest) { $KeyValue = array('name' => $Data['Name'], 'value' => null); if (in_array($Data['Name'], $IntOfInterest)) { $KeyValue['value'] = $Data['IntValue']; } elseif (in_array($Data['Name'], $TextOfInterest)) { $KeyValue['value'] = $Data['TextValue']; } array_push($Settings, $KeyValue); }); $Out->pushValue('setting', $Settings); // Locations msgQueryLocations($aRequest); } else { $Out->pushError(L('AccessDenied')); } }
public function __construct() { $this->connection = Connector::getConnection(); $this->builder = $this->connection->createQueryBuilder(); $this->setTable(get_class($this) . "s"); $this->setPrimary("id"); }
/** * Constructor * Loads required models */ public function __construct() { parent::__construct(); // Load linking models $this->ci->load->model('tag_type_m'); $this->ci->load->model('item_has_tag_m'); }
public function __construct($res, $type = false, $item_type = false, $data_type = false) { if (!$item_type) { $item_type = "OptionsDataItem"; } parent::__construct($res, $type, $item_type, $data_type); }
function parse_request() { parent::parse_request(); if (isset($_GET["posStart"]) && isset($_GET["count"])) { $this->request->set_limit($_GET["posStart"], $_GET["count"]); } }
public function register() { parent::register(); add_filter('wp_stream_posts_exclude_post_types', array($this, 'exclude_order_post_types')); add_action('wp_stream_comments_exclude_comment_types', array($this, 'exclude_order_comment_types')); $this->get_woocommerce_settings_fields(); }
private $_item; private $quantity; private $price; private $_dbase; // Class Constructor function public function __construct() {
/** * Register all context hooks * * @return void */ public function register() { parent::register(); add_action('admin_head', array($this, 'highlight_field')); add_action('admin_enqueue_scripts', array($this, 'enqueue_jquery_color')); add_action(sprintf('update_option_theme_mods_%s', get_option('stylesheet')), array($this, 'log_theme_modification'), 10, 2); }
/** * Analog of Handler::getInstance()->debug(...) method * @param mixed $data * @param string|null $tags Tags separated by dot, e.g. "low.db.billing" * @param int|array $ignoreTraceCalls Ignore tracing classes by name prefix `array('PhpConsole')` or fixed number of calls to ignore */ public static function debug($data, $tags = null, $ignoreTraceCalls = 0) { if (self::$debug) { if (self::$isActive) { self::$connector->getDebugDispatcher()->dispatchDebug($data, $tags, is_numeric($ignoreTraceCalls) ? $ignoreTraceCalls + 1 : $ignoreTraceCalls); } } }
public function getRequireOnce($path) { if ($this->exists($path)) { return \Connector::needOnce($path); } else { throw new FileNotFoundException($path); } }
private function get_total_amount_of($type, $date) { $mysqli = Connector::get_connection(); $query_result = $mysqli->query("SELECT sum(amount) FROM {$type}s WHERE date = '{$date}' AND user_id = {$_SESSION['id_user']}"); $result = $query_result->fetch_assoc(); return format_amount($result['sum(amount)']); $mysqli->close(); }
public function run() { $i = 0; while ($i < 100) { $i++; $proxy = $this->proxy->getWorks(); $this->connector->setProxy($proxy); $list = $this->parserFreeProxy->getIpList(); //$response = $this->connector->getResponse('https://api.ipify.org'); /*if($response == $proxy->ip){ echo 'works'; } else { echo 'not wokrs'; }*/ exit; } }
function AddBook($payload) { $book = new Book(); $connector = new Connector(); $conn = $connector->GetConnection(); $payload = json_decode($payload); $book->sender->SetName($payload->sender->name); $book->sender->SetHouseNo($payload->sender->houseNo); $book->sender->SetCompanyName($payload->sender->companyName); $book->sender->SetBarangay($payload->sender->barangay); $book->sender->SetCity($payload->sender->city); $book->sender->SetDistrict($payload->sender->district); $book->sender->SetContactNo($payload->sender->contactNo); $book->receiver->SetName($payload->receiver->name); $book->receiver->SetHouseNo($payload->receiver->houseNo); $book->receiver->SetCompanyName($payload->receiver->companyName); $book->receiver->SetBarangay($payload->receiver->barangay); $book->receiver->SetCity($payload->receiver->city); $book->receiver->SetDistrict($payload->receiver->district); $book->receiver->SetContactNo($payload->receiver->contactNo); $book->SetServiceLevel($payload->serviceLevel); $book->SetSize($payload->size); $book->SetHeight($payload->height); $book->SetLength($payload->length); $book->SetWidth($payload->width); $book->SetWeight($payload->weight); $book->SetChargeableWeight($payload->chargeableWeight); $book->SetDimension($payload->dimension); $book->SetInsurance($payload->insurance); $book->SetDeclaredValue($payload->declaredValue); $book->SetPaymentMethod($payload->paymentMethod); $payload->cod->bankName = isset($payload->cod->bankName) ? $payload->cod->bankName : ""; $payload->cod->accountName = isset($payload->cod->accountName) ? $payload->cod->accountName : ""; $payload->cod->accountNo = isset($payload->cod->accountNo) ? $payload->cod->accountNo : ""; $payload->cod->amount = isset($payload->cod->amount) ? $payload->cod->amount : 0; $book->cod->SetBankName($payload->cod->bankName); $book->cod->SetAccountName($payload->cod->accountName); $book->cod->SetAccountNo($payload->cod->accountNo); $book->cod->SetAmount($payload->cod->amount); $book->SetAmountDue($payload->amountDue); if ($book->SaveBooking()[1]) { echo json_encode($book->SaveBooking()); } else { echo json_encode($book->SaveBooking()); } }
public function getGroups($aDatabase, $aPrefix, $aUser, $aPass, $aThrow) { $Connector = new Connector(SQL_HOST, $aDatabase, $aUser, $aPass, $aThrow); if ($Connector != null) { $OptionsQuery = $Connector->prepare('SELECT option_value FROM `' . $aPrefix . 'options` WHERE option_name = "' . $aPrefix . 'user_roles" LIMIT 1'); $Option = $OptionsQuery->fetchFirst($aThrow); $Groups = array(); $Roles = unserialize($Option['option_value']); if (is_array($Roles)) { foreach ($Roles as $Role => $Options) { array_push($Groups, array('id' => strtolower($Role), 'name' => $Role)); } } return $Groups; } return null; }
/** * ProwlConnector.class provides access to the * webservice interface of Prowl by using * cUrl + SSL. Use the setters of this class * to provide the mandatory parameters. * * @throws \RuntimeException */ public function __construct() { parent::__construct(); $curl_info = curl_version(); // Checks for cURL function and SSL version. Thanks Adrian Rollett! if (empty($curl_info['ssl_version'])) { throw new \RuntimeException('Your cUrl Extension does not support SSL.'); } }
public function __construct() { parent::__construct(); $this->ci->load->model('tag_type_m'); // Load in tag types if (empty($this->_tag_types)) { $this->_tag_types = $this->ci->tag_type_m->get(array('array_key' => 'name')); } }
/** * Initialise les variables en tableaux, et crée l'ensemble des catégories question de la partie */ function __construct() { $bddConnect = new Connector(); $this->tabCategorie = array(); $this->tabTheme1 = array(); $this->tabTheme2 = array(); $this->tabQuestion = array(); $this->tabReponse = array(); $this->tabExplication = array(); // étape actuelle de la partie (1 étape = 1 question) $this->position = 0; // création et récupération des catégories de la partie $Categorie = new Categorie($bddConnect->getBdd()); $nomCategorie = $Categorie->getNomCategorie(); for ($i = 0; $i < sizeof($nomCategorie); $i++) { // création et récupération des thèmes de la partie associés aux catégories choisies $Theme = new Theme($bddConnect->getBdd(), $nomCategorie[$i]); $idTheme = $Theme->getIdTheme(); $theme1 = $Theme->getTheme1(); $theme2 = $Theme->getTheme2(); for ($j = 0; $j < sizeof($theme1); $j++) { // cration et récupération des questions de la partie associées aux thémes $Question = new Question($bddConnect->getBdd(), $idTheme[$j]); $intituleQuestion = $Question->getIntituleQuestion(); $reponse = $Question->getReponse(); $explication = $Question->getExplication(); for ($h = 0; $h < sizeof($intituleQuestion); $h++) { // 1 indice de chauqe tableau équivaut au catégorie / theme question / ... de la question actuelle array_push($this->tabCategorie, $nomCategorie[$i]); array_push($this->tabTheme1, $theme1[$j]); array_push($this->tabTheme2, $theme2[$j]); array_push($this->tabQuestion, $intituleQuestion[$h]); array_push($this->tabReponse, $reponse[$h]); // s'il existe ou non une explication de la réponse if (isset($explication[$h])) { array_push($this->tabExplication, $explication[$h]); } else { array_push($this->tabExplication, null); } } } } }
function parse_request() { parent::parse_request(); if (isset($_GET["to"])) { $this->request->set_filter($this->config->text[0]["name"], $_GET["to"], "<"); } if (isset($_GET["from"])) { $this->request->set_filter($this->config->text[1]["name"], $_GET["from"], ">"); } }
private static function initialize() { // Create connectio self::$conn = new mysqli(self::$servername, self::$username, self::$password, self::$dbname); // Check connection if (self::$conn->connect_error) { return -1; } return 0; }
function parse_request() { parent::parse_request(); if (isset($_GET["id"])) { $this->request->set_filter($this->config->id["name"], $_GET["id"], "="); } else { if (!$_POST["ids"]) { throw new Exception("ID parameter is missed"); } } }
function msgRaidList($aRequest) { if (validUser()) { global $gGame; loadGameSettings(); $Out = Out::getInstance(); $Connector = Connector::getInstance(); // Get next 6 raids $NextRaidQuery = $Connector->prepare('Select ' . RP_TABLE_PREFIX . 'Raid.*, ' . RP_TABLE_PREFIX . 'Location.*, ' . RP_TABLE_PREFIX . 'Attendance.CharacterId, ' . RP_TABLE_PREFIX . 'Attendance.UserId, ' . RP_TABLE_PREFIX . 'Attendance.Status, ' . RP_TABLE_PREFIX . 'Attendance.Class, ' . RP_TABLE_PREFIX . 'Attendance.Role, ' . RP_TABLE_PREFIX . 'Attendance.Comment, ' . 'UNIX_TIMESTAMP(' . RP_TABLE_PREFIX . 'Raid.Start) AS StartUTC, ' . 'UNIX_TIMESTAMP(' . RP_TABLE_PREFIX . 'Raid.End) AS EndUTC ' . 'FROM `' . RP_TABLE_PREFIX . 'Raid` ' . 'LEFT JOIN `' . RP_TABLE_PREFIX . 'Location` USING(LocationId) ' . 'LEFT JOIN `' . RP_TABLE_PREFIX . 'Attendance` USING(RaidId) ' . 'LEFT JOIN `' . RP_TABLE_PREFIX . 'Character` USING (CharacterId) ' . 'WHERE ' . RP_TABLE_PREFIX . 'Raid.Start >= FROM_UNIXTIME(:Start) ' . 'AND ' . RP_TABLE_PREFIX . 'Location.Game = :Game ' . 'ORDER BY ' . RP_TABLE_PREFIX . 'Raid.Start, ' . RP_TABLE_PREFIX . 'Raid.RaidId'); $NextRaidQuery->bindValue(':Start', mktime(0, 0, 0), PDO::PARAM_INT); $NextRaidQuery->bindValue(':Game', $gGame['GameId'], PDO::PARAM_STR); parseRaidQuery($aRequest, $NextRaidQuery, 6); // Load raid history $RaidHistoryQuery = $Connector->prepare('Select ' . RP_TABLE_PREFIX . 'Raid.*, ' . RP_TABLE_PREFIX . 'Location.*, ' . 'UNIX_TIMESTAMP(' . RP_TABLE_PREFIX . 'Raid.Start) AS StartUTC, ' . 'UNIX_TIMESTAMP(' . RP_TABLE_PREFIX . 'Raid.End) AS EndUTC ' . 'FROM `' . RP_TABLE_PREFIX . 'Raid` ' . 'LEFT JOIN `' . RP_TABLE_PREFIX . 'Location` USING(LocationId) ' . 'WHERE ' . RP_TABLE_PREFIX . 'Raid.Start < FROM_UNIXTIME(:Start) ' . 'AND ' . RP_TABLE_PREFIX . 'Location.Game = :Game ' . 'ORDER BY Start DESC LIMIT ' . intval($aRequest['offset']) . ', ' . intval($aRequest['count'])); $RaidHistoryQuery->bindValue(':Start', mktime(0, 0, 0), PDO::PARAM_INT); $RaidHistoryQuery->bindValue(':Game', $gGame['GameId'], PDO::PARAM_STR); $RaidList = array(); $RaidHistoryQuery->loop(function ($Data) use(&$RaidList) { $StartDate = getdate($Data['StartUTC']); $EndDate = getdate($Data['EndUTC']); $Raid = array('id' => $Data['RaidId'], 'location' => $Data['Name'], 'stage' => $Data['Stage'], 'image' => $Data['Image'], 'size' => $Data['Size'], 'startDate' => $StartDate['year'] . '-' . leadingZero10($StartDate['mon']) . '-' . leadingZero10($StartDate['mday']), 'start' => leadingZero10($StartDate['hours']) . ':' . leadingZero10($StartDate['minutes']), 'endDate' => $EndDate['year'] . '-' . leadingZero10($EndDate['mon']) . '-' . leadingZero10($EndDate['mday']), 'end' => leadingZero10($EndDate['hours']) . ':' . leadingZero10($EndDate['minutes'])); array_push($RaidList, $Raid); }); $Out->pushValue('history', $RaidList); } else { $Out = Out::getInstance(); $Out->pushError(L('AccessDenied')); } }