当前位置: 首页>>代码示例>>PHP>>正文


PHP Connector类代码示例

本文整理汇总了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';
    }
}
开发者ID:almazorajan,项目名称:upshiftexpress,代码行数:30,代码来源:data_access.php

示例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')");
}
开发者ID:GeorgeKaraxalios,项目名称:Management-of-Employees,代码行数:9,代码来源:AdminIndexPage.php

示例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;
 }
开发者ID:zatoshi,项目名称:raidplaner,代码行数:10,代码来源:eqdkp.php

示例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;
 }
开发者ID:console-helpers,项目名称:svn-buddy,代码行数:18,代码来源:UrlResolver.php

示例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;
 }
开发者ID:zatoshi,项目名称:raidplaner,代码行数:13,代码来源:joomla3.php

示例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);
 }
开发者ID:almazorajan,项目名称:upshiftexpress,代码行数:15,代码来源:classes.php

示例7: __construct

 public function __construct()
 {
     $this->connection = Connector::getConnection();
     $this->builder = $this->connection->createQueryBuilder();
     $this->setTable(get_class($this) . "s");
     $this->setPrimary("id");
 }
开发者ID:akbarjimi,项目名称:dialog,代码行数:7,代码来源:Model.php

示例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'));
    }
}
开发者ID:zatoshi,项目名称:raidplaner,代码行数:32,代码来源:message_query_locations.php

示例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'));
    }
}
开发者ID:zatoshi,项目名称:raidplaner,代码行数:29,代码来源:message_raid_list.php

示例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'));
    }
}
开发者ID:zatoshi,项目名称:raidplaner,代码行数:26,代码来源:message_query_newraid.php

示例11: getRequireOnce

 public function getRequireOnce($path)
 {
     if ($this->exists($path)) {
         return \Connector::needOnce($path);
     } else {
         throw new FileNotFoundException($path);
     }
 }
开发者ID:ar-framework-labs,项目名称:kernel,代码行数:8,代码来源:Filesystem.php

示例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());
    }
}
开发者ID:almazorajan,项目名称:upshiftexpress,代码行数:46,代码来源:data_access.php

示例13: __construct

 private $_item;
 private $quantity;
 private $price;
 private $_dbase;
 //  Class Constructor function
 public function __construct()
 {
开发者ID:jzagalo,项目名称:store,代码行数:7,代码来源:database_store.php

示例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);
 }
开发者ID:rclilly,项目名称:stream,代码行数:12,代码来源:class-connector-settings.php

示例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');
 }
开发者ID:ohjack,项目名称:csc385,代码行数:11,代码来源:Linker.php


注:本文中的Connector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。