本文整理汇总了PHP中Connector类的典型用法代码示例。如果您正苦于以下问题:PHP Connector类的具体用法?PHP Connector怎么用?PHP Connector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Connector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetUserInformation
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';
}
}
示例2: Insert
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')");
}
示例3: getGroups
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;
}
示例4: resolve
/**
* 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;
}
示例5: getGroups
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;
}
示例6: GetShippingPrices
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);
}
示例7: __construct
public function __construct()
{
$this->connection = Connector::getConnection();
$this->builder = $this->connection->createQueryBuilder();
$this->setTable(get_class($this) . "s");
$this->setPrimary("id");
}
示例8: msgQueryLocations
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'));
}
}
示例9: msgRaidList
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'));
}
}
示例10: msgQueryNewRaidData
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'));
}
}
示例11: getRequireOnce
public function getRequireOnce($path)
{
if ($this->exists($path)) {
return \Connector::needOnce($path);
} else {
throw new FileNotFoundException($path);
}
}
示例12: AddBook
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());
}
}
示例13: __construct
private $_item;
private $quantity;
private $price;
private $_dbase;
// Class Constructor function
public function __construct()
{
示例14: register
/**
* 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);
}
示例15: __construct
/**
* 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');
}