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


PHP odbc_fetch_object函数代码示例

本文整理汇总了PHP中odbc_fetch_object函数的典型用法代码示例。如果您正苦于以下问题:PHP odbc_fetch_object函数的具体用法?PHP odbc_fetch_object怎么用?PHP odbc_fetch_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了odbc_fetch_object函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Search_Buys

 private function Search_Buys()
 {
     global $ODBC, $LD_History;
     $lasts = $_POST['lasts'] < 1 ? 1 : $_POST['lasts'];
     $login = $_POST['login'];
     if (empty($login) == false) {
         $query_p = "WHERE login='" . $login . "'";
     }
     $findKitsSoldsQ = $ODBC->query("SELECT TOP " . $lasts . " * FROM LogSoldsKits {$query_p} ORDER BY Number DESC");
     while ($findKitsSolds = odbc_fetch_object($findKitsSoldsQ)) {
         $findKitDetailsQuery = $ODBC->query("SELECT * FROM Kits WHERE Number = " . $findKitsSolds->kitNumber);
         $findKitDetails = odbc_fetch_object($findKitDetailsQuery);
         $this->tmp_box_list .= "<div class=\"quadros\">Id Interno: <strong>{$findKitsSolds->Number}</strong> - <a href=\"?cmd=Logs::[KitsBuys]&DeleteLog=true&id={$findKitsSolds->Number}\">Deletar log</a><br />\nNome do Kit: <strong>{$findKitDetails->kitName}</strong><br />\nLogin: <strong>{$findKitsSolds->login}</strong><br />\nPre&ccedil;o pago: <strong>{$findKitsSolds->price}</strong> " . GOLDNAME . "<br />\nComprado em: <strong>" . date("d/m/Y g:i a", $findKitsSolds->data) . "</strong><br />\n<strong>Produtos que est&atilde;o incluidos no kit:</strong> ";
         $FindSoldsDetailsQuery = $ODBC->query("SELECT * FROM LogSoldsKitsDetails WHERE NumberSoldKit = " . $findKitsSolds->Number . " AND login = '" . $_SESSION['Login'] . "'");
         while ($FindSoldsDetails = odbc_fetch_object($FindSoldsDetailsQuery)) {
             $FindSoldsQuery = $ODBC->query("SELECT * FROM LogSolds WHERE login = '" . $_SESSION['Login'] . "' AND type='kit' AND serial='{$FindSoldsDetails->itemSerial}'");
             $FindSolds = odbc_fetch_object($FindSoldsQuery);
             $IDI++;
             $FindItemDetailsQuery = $ODBC->query("SELECT NAME,EXE,photoItem,photoItemAnc,JH,RF FROM Items WHERE Number = '" . $FindSoldsDetails->itemId . "'");
             $FindItemDetails = odbc_fetch_object($FindItemDetailsQuery);
             $LD_History->GetNameOptions($FindItemDetails->EXE);
             $LD_History->GetNameOptionJH($FindSolds->jh, $FindItemDetails->JH);
             $LD_History->GetNameOptionRefine($FindSolds->refine, $FindItemDetails->RF);
             $LD_History->GetNameOptionsSocketItem(array($FindSolds->socket1_int, $FindSolds->socket2_int, $FindSolds->socket3_int, $FindSolds->socket4_int, $FindSolds->socket5_int));
             $this->tmp_box_list .= "<div class=\"quadros\">\n                                    <div style=\"position:relative; float: right; text-align:center;\">\n                                        <img src=\"../" . ($FindSoldsQuery->ancient == 0 ? $FindItemDetails->photoItem : $FindItemDetails->photoItemAnc) . "\" style=\"border: none;\" />\n\n                                    </div>\n                                    <em>ID. Interno</em>: <strong>" . $FindSolds->number . "</strong><br />\n\n                                    <em>Nome do item</em>: <strong>" . $FindItemDetails->NAME . "</strong><br />\n\n                                    <em>Serial</em>: <strong>" . $FindSolds->serial . "</strong><br />\n\n                                    <em>Level</em>: <strong>+" . $FindSolds->level . "</strong> | \n\n                                    <em>Option (adcional)</em>: <strong>+" . $FindSolds->option * 4 . "</strong><br />\n\n                                    <em>Luck</em>: <strong>" . ($FindSolds->luck == "true" ? "Sim" : "Não") . "</strong> | \n\n                                    <em>Skill</em>: <strong>" . ($FindSolds->skill == "true" ? "Sim" : "Não") . "</strong><br />\n\n                                    <em>Ancient</em>: <strong>" . ($FindSolds->ancient == 0 ? "Não" : "") . ($FindSolds->ancient == 1 ? "+5 Stamina" : "") . ($FindSolds->ancient == 2 ? "+10 Stamina" : "") . "</strong><br />\n\n                                    <em>Option Harmony</em>: <strong>" . $LD_History->textHarmonyOption . "</strong><br />\n\n                                    <em>Option Level 380</em>: <strong>" . $LD_History->textRefineOption . "</strong><br /><br />\n\n                                    <em><strong>Opções Excelentes</strong></em>: <br />\n\n                                    <em>" . $LD_History->NomeOpExc1 . "</em>: <strong>" . ($FindSolds->excop1 == "true" ? "Sim" : "Não") . "</strong><br />\n\n                                    <em>" . $LD_History->NomeOpExc2 . "</em>: <strong>" . ($FindSolds->excop2 == "true" ? "Sim" : "Não") . "</strong><br />\n\n                                    <em>" . $LD_History->NomeOpExc3 . "</em>: <strong>" . ($FindSolds->excop3 == "true" ? "Sim" : "Não") . "</strong><br />\n\n                                    <em>" . $LD_History->NomeOpExc4 . "</em>: <strong>" . ($FindSolds->excop4 == "true" ? "Sim" : "Não") . "</strong><br />\n\n                                    <em>" . $LD_History->NomeOpExc5 . "</em>: <strong>" . ($FindSolds->excop5 == "true" ? "Sim" : "Não") . "</strong><br />\n\n                                    <em>" . $LD_History->NomeOpExc6 . "</em>: <strong>" . ($FindSolds->excop6 == "true" ? "Sim" : "Não") . "</strong><br /><br />\n\n                                    <em><strong>Opções Sockets</strong></em>: <br />\n\n                                    <em>Slot Socket 1</em>: <strong>" . ($FindSolds->socket1 == "true" ? "Sim - {$LD_History->socketItemOptionName[0]}" : "Não") . "</strong><br />\n\n                                    <em>Slot Socket 2</em>: <strong>" . ($FindSolds->socket2 == "true" ? "Sim - {$LD_History->socketItemOptionName[1]}" : "Não") . "</strong><br />\n\n                                    <em>Slot Socket 3</em>: <strong>" . ($FindSolds->socket3 == "true" ? "Sim - {$LD_History->socketItemOptionName[2]}" : "Não") . "</strong><br />\n\n                                    <em>Slot Socket 4</em>: <strong>" . ($FindSolds->socket4 == "true" ? "Sim - {$LD_History->socketItemOptionName[3]}" : "Não") . "</strong><br />\n\n                                    <em>Slot Socket 5</em>: <strong>" . ($FindSolds->socket5 == "true" ? "Sim - {$LD_History->socketItemOptionName[4]}" : "Não") . "</strong><br /><br />\n\n                                    <em>Recuperado</em>: <strong>" . $FindSolds->recovery . "</strong> vezes<br />\n\n                                </div>";
         }
         $this->tmp_box_list .= "</div>";
     }
 }
开发者ID:neilor,项目名称:MuShopping-v3,代码行数:29,代码来源:logskits.class.php

示例2: to_object

 function to_object($res)
 {
     if ($object = odbc_fetch_object($res)) {
         return $object;
     } else {
         return false;
     }
 }
开发者ID:ricardoletelier,项目名称:conexion-mysqli-postgresql-desde-php,代码行数:8,代码来源:odbc.php

示例3: sql_fetch_obj

function sql_fetch_obj($result)
{
    if (DATABASE == "mysql") {
        return @mysql_fetch_object($result);
    } else {
        if (DATABASE == "odbc") {
            return @odbc_fetch_object($result);
        }
    }
}
开发者ID:rugbyprof,项目名称:visitme,代码行数:10,代码来源:sqlfunctions.php

示例4: index

 public function index()
 {
     //test the dynamic connection with other databases seems successfull
     $systems = System::all();
     $res = [];
     foreach ($systems as $system) {
         $query = "SELECT [states].eq_id, [states].time, [states].[state_OK],[states].[state_MaintRQ], [states].[state_InMaint], [states].[state_Fault], [equipment].eq_id, CAST(CAST([equipment].eq_name AS VARBINARY) AS VARCHAR) as eq_name FROM [states] LEFT JOIN [equipment] on states.eq_id = [equipment].eq_id";
         if ($system['dbversion'] == '2000') {
             $port = '1434';
             try {
                 $connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server=" . $system['host'] . "," . $port . ";Database=" . $system['dbname'], $system['dbuser'], Crypt::decrypt($system['dbuserpass']));
             } catch (ErrorException $e) {
                 $system->status = 'default';
                 $system->save();
                 $res[$system['name']] = ['error' => $e];
             }
             if ($conn) {
                 $results = odbc_exec($connection, $query);
                 $realData = [];
                 $i = 0;
                 while ($row = json_decode(json_encode(odbc_fetch_object($results)), true)) {
                     foreach ($row as $key => $item) {
                         if ($key == "eq_name" && is_string($item)) {
                             $row[$key] = iconv('UCS-2LE', 'UTF-8', $item);
                         }
                     }
                     $realData[$i] = $row;
                     $i++;
                 }
                 $res[$system['name']] = $realData;
                 odbc_free_result($results);
                 odbc_close($connection);
             }
         } else {
             try {
                 $conn = new PDO("sqlsrv:Server=" . $system['host'] . ";Database=" . $system['dbname'], $system['dbuser'], Crypt::decrypt($system['dbuserpass']));
             } catch (PDOException $e) {
                 $system->status = 'default';
                 $system->save();
                 $res[$system['name']] = ['error' => $e];
             }
             if ($conn) {
                 $sql = $conn->prepare($query);
                 $sql->execute();
                 $res[$system['name']] = $sql->fetchAll();
                 $conn = null;
             }
         }
     }
     return $res;
 }
开发者ID:rvmladenov,项目名称:monitoring_system,代码行数:51,代码来源:TestController.php

示例5: Find_Details

 private function Find_Details()
 {
     global $ODBC;
     $ODBC_Q = $ODBC->query("SELECT ID, TP, X, Y, DUR, CATEGORIA FROM Items WHERE Number='" . $this->ProductID . "'");
     $ODBC_R = odbc_fetch_object($ODBC_Q);
     $this->ID = $ODBC_R->ID;
     $this->TP = $ODBC_R->TP;
     $this->X = $ODBC_R->X;
     $this->Y = $ODBC_R->Y;
     $this->DUR = $ODBC_R->DUR;
     $this->categoriasBlockeds = array("Amulets", "Castel Siege", "Events", "Events MIX", "Gifts/Boxs", "Jewels", "Jewels MIX", "Mix Items", "Mix Pets", "Orbs", "Quests", "Scrolls");
     if (in_array($ODBC_R->CATEGORIA, $this->categoriasBlockeds) == true) {
         exit("<ul><li>Erro, este tipo de item n&atilde;o pode ser recuperado no shopping.</li></ul>");
     }
 }
开发者ID:axlduff,项目名称:teste,代码行数:15,代码来源:recover_lost_item.class.php

示例6: __construct

 public function __construct()
 {
     global $ODBC, $LD_Items;
     $_GET['ProductID'] = (int) $_GET['ProductID'];
     $SQL_Q = $this->query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='" . $_SESSION['Login'] . "'");
     $SQL = mssql_fetch_object($SQL_Q);
     if ($SQL->ConnectStat != 0) {
         exit(Print_error("<ul><li>Voc&ecirc; deve estar offline do jogo para efetuar essa a&ccedil;&atilde;o!</li></ul>"));
     }
     $searchKitQ = $ODBC->query("SELECT priceFix FROM Kits WHERE active = 1 AND Number = " . $_GET['ProductID']);
     if (odbc_num_rows($searchKitQ) == 0) {
         exit(Print_error("<script type=\"text/javascript\">alert(\"Erro kit n&atilde;o cadastrado.\"); window.location='?';</script>"));
     }
     $searchItensKitQ = $ODBC->query("SELECT * FROM KitsItemsDetails WHERE kitNumber = " . $_GET['ProductID']);
     echo "<ul><li>Aguarde em quanto sua compra &eacute; processada.</li><br />";
     //Inicio Função independente para cobrar o kit
     $searchKit = odbc_fetch_object($searchKitQ);
     $SQL_Q = $this->query("SELECT " . GOLDCOLUMN . " FROM " . GOLDTABLE . " WHERE " . GOLDMEMBIDENT . " = '" . $_SESSION['Login'] . "'");
     $SQL_R = mssql_fetch_row($SQL_Q);
     if ($SQL_R[0] < $searchKit->priceFix) {
         exit(Print_error("<ul><li>Desculpe, essa compra n&atilde;o pode ser realizada, pois seu saldo de " . GOLDNAME . " &eacute; insuficiente.</li></ul>"));
     }
     $SQL_Q = $this->query("UPDATE " . GOLDTABLE . " SET " . GOLDCOLUMN . " = " . GOLDCOLUMN . "-" . $searchKit->priceFix . " WHERE " . GOLDMEMBIDENT . " = '" . $_SESSION['Login'] . "' AND " . GOLDCOLUMN . " >= " . $searchKit->priceFix . "; select @@rowcount as rows;");
     $SQL_R = mssql_fetch_object($SQL_Q);
     if ((int) $SQL_R->rows == 0) {
         exit(Print_error("<ul><li>Erro ao cobrar pelo kit.</li></ul>"));
     }
     //Fim Função independente para cobrar o kit
     $ODBC->query("UPDATE Kits SET solds=solds+1 WHERE Number=" . $_GET['ProductID']);
     $searchLastSoldNumberQ = $ODBC->query("SELECT max(Number) as Numb FROM LogSoldsKits");
     $searchLastSoldNumber = odbc_fetch_object($searchLastSoldNumberQ);
     $searchLastSoldNumber->Numb = (int) $searchLastSoldNumber->Numb + 1;
     $ODBC->query("INSERT INTO LogSoldsKits (login,kitNumber,price,data) VALUES ('{$_SESSION['Login']}', {$_GET['ProductID']}, {$searchKit->priceFix}, '" . time() . "')");
     require "sockets.lib.php";
     //exit(var_dump($socketLib));
     while ($searchItensKit = odbc_fetch_object($searchItensKitQ)) {
         //var_dump($searchItensKit);
         $LD_FinishBuy = new LD_FinishBuy($searchItensKit->itemNumber, $searchItensKit->fixLVL, $searchItensKit->fixOP, $searchItensKit->fixANC, $searchItensKit->fixSkill == 0 ? "false" : "true", $searchItensKit->fixLuck == 0 ? "false" : "true", $searchItensKit->fixOpEx1 == 0 ? "false" : "true", $searchItensKit->fixOpEx2 == 0 ? "false" : "true", $searchItensKit->fixOpEx3 == 0 ? "false" : "true", $searchItensKit->fixOpEx4 == 0 ? "false" : "true", $searchItensKit->fixOpEx5 == 0 ? "false" : "true", $searchItensKit->fixOpEx6 == 0 ? "false" : "true", $searchItensKit->fixJH, $searchItensKit->fixRefine == 0 ? "false" : "true", $searchItensKit->fixSocket1 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket2 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket3 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket4 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket5 == $socketLib['notSocket'] ? "false" : "true", $searchItensKit->fixSocket1, $searchItensKit->fixSocket2, $searchItensKit->fixSocket3, $searchItensKit->fixSocket4, $searchItensKit->fixSocket5, true);
         $ODBC->query("INSERT INTO LogSoldsKitsDetails (NumberSoldKit,login,itemId,itemSerial) VALUES ({$searchLastSoldNumber->Numb}, '{$_SESSION['Login']}', '{$searchItensKit->itemNumber}', '{$LD_Items->Item_Serial}')");
         if ($LD_FinishBuy->delivered == true) {
             echo "<li>Item: <strong>{$LD_FinishBuy->NAME}</strong>, entregue.</li>";
         } else {
             echo "<li>Item: <strong>{$LD_FinishBuy->NAME}</strong>, n&atilde;o houve espa&ccedil;o. <br />Libere espa&ccedil;o no bau e reenvie o item pelo hist&oacute;rico de compras.</li>";
         }
         unset($LD_FinishBuy);
     }
     echo "<br /><li>Compra finalizada com sucesso!</li></ul>";
 }
开发者ID:neilor,项目名称:MuShopping-v3,代码行数:48,代码来源:finishbuykits.class.php

示例7: GenerateReports

 private function GenerateReports()
 {
     global $ODBC;
     $months_one = $_POST['months_one'];
     $year_one = $_POST['year_one'];
     $months_two = $_POST['months_two'];
     $year_two = $_POST['year_two'];
     $timeOneBegin = mktime(0, 0, 0, $months_one, 1, $year_one);
     $timeOneEnd = mktime(0, 0, 0, $months_one, 29, $year_one);
     $timeTwoBegin = mktime(0, 0, 0, $months_two, 1, $year_two);
     $timeTwoEnd = mktime(0, 0, 0, $months_two, 29, $year_two);
     if ($timeOneBegin > $timeTwoBegin) {
         return $this->Results_Reports .= "<div class=\"quadros\"><ul><li>Erro: A data inicial deve ser menor que a data final.</li></ul></div>";
     }
     $this->findPaymentsQuery = $ODBC->query("SELECT price FROM LogsReports WHERE dateInclude > {$timeOneBegin} AND dateInclude < {$timeOneEnd}");
     while ($this->findPayments = odbc_fetch_object($this->findPaymentsQuery)) {
         $this->totalPaymentsValueOne += $this->findPayments->price;
     }
     $this->findPaymentsQuery = $ODBC->query("SELECT price FROM LogsReports WHERE dateInclude > {$timeTwoBegin} AND dateInclude < {$timeTwoEnd}");
     while ($this->findPayments = odbc_fetch_object($this->findPaymentsQuery)) {
         $this->totalPaymentsValueTwo += $this->findPayments->price;
     }
     $this->findSoldsItemsOneQuery = $ODBC->query("SELECT count(1) as totalSolds FROM LogSolds WHERE data > '{$timeOneBegin}' AND data < '{$timeOneEnd}'");
     $this->findSoldsItemsOne = odbc_fetch_object($this->findSoldsItemsOneQuery);
     $this->findSoldsItemsTwoQuery = $ODBC->query("SELECT count(1) as totalSolds FROM LogSolds WHERE data > '{$timeTwoBegin}' AND data < '{$timeTwoEnd}'");
     $this->findSoldsItemsTwo = odbc_fetch_object($this->findSoldsItemsTwoQuery);
     $this->findSoldsKitsOneQuery = $ODBC->query("SELECT count(1) as totalSolds FROM LogSoldsKits WHERE data > '{$timeOneBegin}' AND data < '{$timeOneEnd}'");
     $this->findSoldsKitsOne = odbc_fetch_object($this->findSoldsKitsOneQuery);
     $this->findSoldsKitsTwoQuery = $ODBC->query("SELECT count(1) as totalSolds FROM LogSoldsKits WHERE data > '{$timeTwoBegin}' AND data < '{$timeTwoEnd}'");
     $this->findSoldsKitsTwo = odbc_fetch_object($this->findSoldsKitsTwoQuery);
     $this->Results_Reports .= "<div class=\"quadros\">Gerando relatório entre as datas: <strong>" . $months_one . "/" . $year_one . "</strong> e <strong>" . $months_two . "/" . $year_two . "</strong><br /><br />";
     $this->Results_Reports .= "Atenção, esse relatório é uma estimativa. Não garantimos total precisão.<br /><br />";
     $this->Results_Reports .= "<ul><li>Mês: <strong>{$months_one}</strong> do ano: <strong>{$year_one}</strong> total: <strong>R\$ {$this->totalPaymentsValueOne}</strong></li><li>Mês: <strong>{$months_two}</strong> do ano: <strong>{$year_two}</strong> total: <strong>R\$ {$this->totalPaymentsValueTwo}</strong></li>";
     if ($this->totalPaymentsValueOne > $this->totalPaymentsValueTwo) {
         $this->differenceSolds = number_format($this->totalPaymentsValueOne - $this->totalPaymentsValueTwo, 2, ".", "");
         $this->Results_Reports .= "<li>O mês <strong>{$months_one}</strong> do ano <strong>{$year_one}</strong> teve um lucro maior de:<strong> R\$ {$this->differenceSolds}</strong></li><br />";
     } elseif ($this->totalPaymentsValueOne < $this->totalPaymentsValueTwo) {
         $this->differenceSolds = number_format($this->totalPaymentsValueTwo - $this->totalPaymentsValueOne, 2, ".", "");
         $this->Results_Reports .= "<li>O mês <strong>{$months_two}</strong> do ano <strong>{$year_two}</strong> teve um lucro maior de: <strong>R\$ {$this->differenceSolds}</strong></li><br />";
     }
     $this->Results_Reports .= "<li>No mês <strong>{$months_one}</strong> do ano <strong>{$year_one}</strong> o shopping vendeu <strong>{$this->findSoldsItemsOne->totalSolds}</strong> itens.</li>";
     $this->Results_Reports .= "<li>No mês <strong>{$months_two}</strong> do ano <strong>{$year_two}</strong> o shopping vendeu <strong>{$this->findSoldsItemsTwo->totalSolds}</strong> itens.</li><br />";
     $this->Results_Reports .= "<li>No mês <strong>{$months_one}</strong> do ano <strong>{$year_one}</strong> o shopping vendeu <strong>{$this->findSoldsKitsOne->totalSolds}</strong> kits.</li>";
     $this->Results_Reports .= "<li>No mês <strong>{$months_two}</strong> do ano <strong>{$year_two}</strong> o shopping vendeu <strong>{$this->findSoldsKitsTwo->totalSolds}</strong> kits.</li>";
     $this->Results_Reports .= "</ul></div>";
 }
开发者ID:neilor,项目名称:MuShopping-v3,代码行数:46,代码来源:reports.class.php

示例8: __construct

 public function __construct($couponCode)
 {
     global $ODBC;
     $findQ = $ODBC->query("SELECT * FROM CouponCodes WHERE couponCode='" . $couponCode . "'");
     $find = odbc_fetch_object($findQ);
     if ($find->active == 0) {
         exit(Print_error("Esse cupom est&aacute; desativado ou &eacute; inv&aacute;lido."));
     } elseif ($find->dateBegin > time()) {
         exit(Print_error("Esse cupom inicia em: " . date("d/m/Y g:i a", $find->dateBegin)));
     } elseif (time() > $find->dateEnd) {
         exit(Print_error("Esse cupom venceu em: " . date("d/m/Y g:i a", $find->dateEnd)));
     } else {
         echo "Copum com o " . $find->percent . "% de desconto ativado.<br />Aguarde enquanto a p&aacute;gina &eacute; atualizada.";
         $_SESSION['COUPON_ACTIVE'] = true;
         $_SESSION['COUPON_CODE'] = $couponCode;
         $_SESSION['COUPON_PERCENT'] = $find->percent;
         echo "<script type=\"text/javascript\">setInterval(\"top.location = self.location;\",3000);</script>";
     }
 }
开发者ID:neilor,项目名称:MuShopping-v3,代码行数:19,代码来源:coupon.class.php

示例9: getSytemIinfo

 private function getSytemIinfo($id)
 {
     $system = System::find($id);
     $queryMeas = "SELECT [meas].param_id, [meas].time, [meas].value, [param].param_name, [param].param_unit, [limit].ad_limit FROM [meas] LEFT JOIN [param] on meas.param_id = [param].param_id LEFT JOIN [limit] on meas.param_id = [limit].param_id";
     $queryEquipment2000 = "SELECT [time] ,st.[eq_id],[state_OK],[state_MaintRQ],[state_InMaint],[state_Fault] ,CAST(CAST([eq_name] AS VARBINARY) AS VARCHAR) as eq_name FROM [states] st JOIN [equipment] eq ON  st.eq_id = eq.eq_id";
     $queryEquipment = "SELECT [time] ,st.[eq_id],[state_OK],[state_MaintRQ],[state_InMaint],[state_Fault], [eq_name] FROM [states] st JOIN [equipment] eq ON  st.eq_id = eq.eq_id";
     $res;
     $meas;
     $eq;
     $conn = false;
     if ($system['status'] != 'default') {
         if ($system['dbversion'] == '2000') {
             $port = '1434';
             try {
                 $conn = odbc_connect("Driver={SQL Server Native Client 10.0};Server=" . $system['host'] . "," . $port . ";Database=" . $system['dbname'], $system['dbuser'], Crypt::decrypt($system['dbuserpass']));
             } catch (ErrorException $e) {
                 $res[$system['name']] = ['error' => 'Connection Error'];
                 $res[$system['name']]['meas'] = [];
                 $res[$system['name']]['equipment'] = [];
             }
             if ($conn) {
                 $results = odbc_exec($conn, $queryMeas);
                 $realDataMeas = [];
                 $i = 0;
                 while ($row = odbc_fetch_object($results)) {
                     $row->status = $row->param_name != "O2" && $row->ad_limit && $row->value > $row->ad_limit ? 'warning' : 'success';
                     $realDataMeas[$i] = $row;
                     $i++;
                 }
                 $meas = json_decode(json_encode($realDataMeas), true);
                 odbc_free_result($results);
                 $results = odbc_exec($conn, $queryEquipment2000);
                 $realDataEq = [];
                 $i = 0;
                 $state;
                 while ($row = json_decode(json_encode(odbc_fetch_object($results)), true)) {
                     foreach ($row as $key => $item) {
                         if ($key == "eq_name" && is_string($item)) {
                             $row[$key] = iconv('UCS-2LE', 'UTF-8', $item);
                         }
                     }
                     $realDataEq[$i] = $row;
                     $i++;
                 }
                 $eq = $realDataEq;
                 odbc_free_result($results);
                 odbc_close($conn);
                 $res[$system['name']] = ['meas' => $meas, 'equipment' => $eq];
             }
         } else {
             try {
                 $conn = new PDO("sqlsrv:Server=" . $system['host'] . ";Database=" . $system['dbname'], $system['dbuser'], Crypt::decrypt($system['dbuserpass']));
             } catch (PDOException $e) {
                 $res[$system['name']] = ['error' => 'Connection Error'];
                 $res[$system['name']]['meas'] = [];
                 $res[$system['name']]['equipment'] = [];
             }
             if ($conn) {
                 $sql = $conn->prepare($queryMeas);
                 $sql->execute();
                 $meas = $sql->fetchAll();
                 foreach ($meas as $key => $result) {
                     $result['status'] = $result['param_name'] != 'O2' && $result['ad_limit'] && $result['value'] > $result['ad_limit'] ? 'warning' : 'success';
                     $meas[$key] = $result;
                 }
                 $sql = $conn->prepare($queryEquipment);
                 $sql->execute();
                 $eq = $sql->fetchAll();
                 $conn = null;
                 $res[$system['name']] = ['meas' => $meas, 'equipment' => $eq];
             }
         }
     } else {
         $res[$system['name']] = ['error' => 'Connection Error'];
         $res[$system['name']]['meas'] = [];
         $res[$system['name']]['equipment'] = [];
     }
     return $res;
 }
开发者ID:rvmladenov,项目名称:monitoring_system,代码行数:79,代码来源:SystemController.php

示例10: var_dump

var_dump($rval);
$val = odbc_result($rh, 1);
var_dump($val);
// fetch_array, next
echo "testing odbc_fetch_array, next\n";
$rval = odbc_fetch_array($rh);
var_dump($rval);
// fetch_array with row number
echo "testing odbc_fetch_array with row specified\n";
$rval = odbc_fetch_array($rh, 4);
var_dump($rval);
// fetch_object, next
echo "testing odbc_fetch_object, next\n";
$rval = odbc_fetch_object($rh);
var_dump($rval);
// fetch_object with row number
echo "testing odbc_fetch_object with row specified\n";
$rval = odbc_fetch_object($rh, 4);
var_dump($rval);
// fetch_into, next
$ar = array();
echo "testing odbc_fetch_into, next\n";
$rval = odbc_fetch_into($rh, $ar);
var_dump($rval);
var_dump($ar);
// fetch_into with row number
echo "testing odbc_fetch_into with row specified\n";
$rval = odbc_fetch_into($rh, $ar, 7);
var_dump($rval);
var_dump($ar);
echo odbc_close($r);
开发者ID:jenalgit,项目名称:roadsend-php,代码行数:31,代码来源:fetches.php

示例11: odbc_do

    odbc_do($conn_access, $ssql);
}
$ssql = "SELECT DISTINCT Clases.id_materia,\n\tMaterias.Materia,\n\tEncuestas.encuesta_nombre,\n\tEncuestas.id_encuesta\n\tFROM Materias\n\tRIGHT JOIN (Encuestas RIGHT JOIN Clases ON Encuestas.[id_materia] = Clases.[id_materia])\n\tON Materias.[Id_materia] = Clases.[id_materia]\n\tWHERE Clases.id_materia = {$_GET['id']}";
if ($rs_access = odbc_exec($conn_access, $ssql)) {
    $encuesta = odbc_fetch_object($rs_access);
} else {
    echo "Error al ejecutar la sentencia SQL";
}
$ssql = "select COUNT(*) AS total from Respuestas WHERE id_encuesta = {$encuesta->id_encuesta} AND num_cuenta = {$_SESSION['alumno']->num_cuenta}";
$rs_access = odbc_exec($conn_access, $ssql);
$fila = odbc_fetch_object($rs_access);
$preguntas = array();
$ssql = "SELECT id_pregunta,pregunta,opcion_1,opcion_2,opcion_3,opcion_4,respuesta_correcta FROM Preguntas WHERE id_encuesta = {$encuesta->id_encuesta}";
$ssql = "SELECT Respuestas.num_cuenta,\n\t\t\t\tRespuestas.respuesta,\n\t\t\t\tPreguntas.id_encuesta,\n\t\t\t\tPreguntas.id_pregunta,\n\t\t\t\tPreguntas.pregunta,\n\t\t\t\tPreguntas.opcion_1,\n\t\t\t\tPreguntas.opcion_2,\n\t\t\t\tPreguntas.opcion_3,\n\t\t\t\tPreguntas.opcion_4,\n\t\t\t\tPreguntas.respuesta_correcta\n\t\t\t\tFROM Preguntas LEFT JOIN Respuestas ON (Preguntas.[id_pregunta] = Respuestas.[id_pregunta]) AND (Preguntas.[id_encuesta] = Respuestas.[id_encuesta])\nWHERE  Preguntas.id_encuesta = {$encuesta->id_encuesta} AND Respuestas.respuesta IS NULL ORDER BY 1";
if ($rs_access = odbc_exec($conn_access, $ssql)) {
    $pregunta = odbc_fetch_object($rs_access);
} else {
    echo "Error al ejecutar la sentencia SQL";
}
//print_r($pregunta);
//echo "[".count($pregunta)."]";
//print_r($encuesta->id_encuesta);
?>
<!DOCTYPE html>
<html lang="es">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="Sistema de evaluaciones">
开发者ID:hansphp,项目名称:examenes,代码行数:31,代码来源:examen.php

示例12: odbc_fetch_object

<?php

require_once 'config.php';
if (isset($_POST['cuenta'])) {
    $ssql = "SELECT * FROM Alumnos WHERE num_cuenta LIKE '%{$_POST['cuenta']}%'";
    $error = "";
    if ($rs_access = odbc_exec($conn_access, $ssql)) {
        $fila = odbc_fetch_object($rs_access);
        if (isset($fila->Nombre) && !empty($fila->Nombre)) {
            $_SESSION['alumno'] = $fila;
            header('Location: inicio.php');
            exit;
        } else {
            $error = "Clave o usuario incorrecto.";
        }
    } else {
        die("Error al ejecutar la sentencia SQL");
    }
}
?>
<!DOCTYPE html>
<html lang="es">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="Sistema de evaluaciones">
    <meta name="author" content="Hans Von Herrera Ortega">

    <title>Sistema de evaluaciones</title>
开发者ID:hansphp,项目名称:examenes,代码行数:31,代码来源:index.php

示例13:

 /**
  * @param	bool	$autoFree[optional] = true
  * @return	object
  */
 function &GetNextRecord($autoFree = true)
 {
     if ($this->_resultId) {
         $result = @odbc_fetch_object($this->_resultId);
         if (!$result && $autoFree) {
             $this->FreeResult();
         }
         return $result;
     } else {
         $this->_setSqlError();
         return false;
     }
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:17,代码来源:class_dbodbc.php

示例14: odbc_fetch_object

 function &_fetch()
 {
     $res = odbc_fetch_object($this->_idResult);
     return $res;
 }
开发者ID:BackupTheBerlios,项目名称:phpannu-svn,代码行数:5,代码来源:CopixDbResultSet.odbcsqlserver.class.php

示例15: _fetch_object

 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @access	private
  * @return	object
  */
 function _fetch_object()
 {
     if (function_exists('odbc_fetch_object')) {
         return odbc_fetch_object($this->result_id);
     } else {
         return $this->_odbc_fetch_object($this->result_id);
     }
 }
开发者ID:pmward,项目名称:Codeigniter-Braintree-v.zero-test-harness,代码行数:16,代码来源:odbc_result.php


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