コード例 #1
0
 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='******'";
     }
     $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 = '******'Login'] . "'");
         while ($FindSoldsDetails = odbc_fetch_object($FindSoldsDetailsQuery)) {
             $FindSoldsQuery = $ODBC->query("SELECT * FROM LogSolds WHERE login = '******'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>";
     }
 }
コード例 #2
0
 function to_object($res)
 {
     if ($object = odbc_fetch_object($res)) {
         return $object;
     } else {
         return false;
     }
 }
コード例 #3
0
ファイル: sqlfunctions.php プロジェクト: rugbyprof/visitme
function sql_fetch_obj($result)
{
    if (DATABASE == "mysql") {
        return @mysql_fetch_object($result);
    } else {
        if (DATABASE == "odbc") {
            return @odbc_fetch_object($result);
        }
    }
}
コード例 #4
0
 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;
 }
コード例 #5
0
 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>");
     }
 }
コード例 #6
0
 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>";
 }
コード例 #7
0
 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>";
 }
コード例 #8
0
ファイル: coupon.class.php プロジェクト: neilor/MuShopping-v3
 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>";
     }
 }
コード例 #9
0
 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;
 }
コード例 #10
0
ファイル: fetches.php プロジェクト: jenalgit/roadsend-php
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);
コード例 #11
0
ファイル: examen.php プロジェクト: hansphp/examenes
    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">
コード例 #12
0
ファイル: index.php プロジェクト: hansphp/examenes
<?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>
コード例 #13
0
ファイル: class_dbodbc.php プロジェクト: JDevelopers/Mail
 /**
  * @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;
     }
 }
 function &_fetch()
 {
     $res = odbc_fetch_object($this->_idResult);
     return $res;
 }
コード例 #15
0
 /**
  * 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);
     }
 }
コード例 #16
0
 private function loadFormAlterKitFrom($number)
 {
     global $ODBC;
     if (is_numeric($number) == false) {
         exit("Erro: N&uacute;mero inv&aacute;lido");
     }
     if (isset($_GET['action']) == false) {
         echo "<input value=\"Adicionar item\" type=\"button\" class=\"button\" onclick=\"Verify('?AjaxFunctions=true&Function=managerProducts&module=alterThisKit&number={$number}&action=includeItemSelect', 'resultItemsAjaxKitsResult', 'GET');\" />";
         echo "<input value=\"Alterar item\" type=\"button\" class=\"button\" onclick=\"Verify('?AjaxFunctions=true&Function=managerProducts&module=alterThisKit&number={$number}&action=alterItemSelect', 'resultItemsAjaxKitsResult', 'GET');\" />";
         echo "<input value=\"Remover item\" type=\"button\" class=\"button\" onclick=\"Verify('?AjaxFunctions=true&Function=managerProducts&module=alterThisKit&number={$number}&action=removeItemSelect', 'resultItemsAjaxKitsResult', 'GET');\" />";
         echo "<input value=\"Ativar / Desativar vendas\" type=\"button\" class=\"button\" onclick=\"Verify('?AjaxFunctions=true&Function=managerProducts&module=alterThisKit&number={$number}&action=activeDesactiveSolds', 'resultItemsAjaxKitsResult', 'GET');\" />";
         echo "<div id=\"resultItemsAjaxKitsResult\"></div>";
     } else {
         $findKitDetailsQuery = $ODBC->query("SELECT kitName FROM Kits WHERE Number = " . $number);
         $findKitDetails = odbc_fetch_object($findKitDetailsQuery);
         switch ($_GET['action']) {
             case "includeItemSelect":
                 echo "Selecione o item a incluir no kit <strong>{$findKitDetails->kitName}</strong>";
                 $this->loadItens();
                 echo "<select multiple style=\"width:500px; height:150px\" onchange=\"javascript: Verify('?AjaxFunctions=true&Function=managerProducts&module=alterThisKit&action=includeItemForm&number={$number}&itemNumber='+this.options[this.selectedIndex].value, 'resultItemsAjaxKitsResult', 'get');\">";
                 foreach ($this->memoryItems as $item) {
                     echo "<option value=\"{$item->Number}\">{$item->NAME}</option>";
                 }
                 echo "</select>";
                 break;
             case "includeItemForm":
                 $checkItemIncludeQuery = $ODBC->query("SELECT itemNumber FROM KitsItemsDetails WHERE kitNumber = {$number} AND itemNumber='{$_GET['itemNumber']}'");
                 $checkItemInclude = odbc_fetch_object($checkItemIncludeQuery);
                 if ($checkItemInclude->itemNumber == $_GET['itemNumber']) {
                     exit("<ul><li>Erro, esse item j&aacute; foi cadastrado nesse kit.</li></ul>");
                 }
                 $findItemDetailsQuery = $ODBC->query("SELECT * FROM Items WHERE Number = '{$_GET['itemNumber']}'");
                 $findItemDetails = odbc_fetch_object($findItemDetailsQuery);
                 $this->loadOptionsExeNames($findItemDetails->EXE);
                 $selectTagLevel .= "<option value=\"00\">Level +00 Fixo</option>";
                 $selectTagLevel .= "<option value=\"01\">Level +01 fixo</option>";
                 $selectTagLevel .= "<option value=\"02\">Level +02 fixo</option>";
                 $selectTagLevel .= "<option value=\"03\">Level +03 fixo</option>";
                 $selectTagLevel .= "<option value=\"04\">Level +04 fixo</option>";
                 $selectTagLevel .= "<option value=\"05\">Level +05 fixo</option>";
                 $selectTagLevel .= "<option value=\"06\">Level +06 fixo</option>";
                 $selectTagLevel .= "<option value=\"07\">Level +07 fixo</option>";
                 $selectTagLevel .= "<option value=\"08\">Level +08 fixo</option>";
                 $selectTagLevel .= "<option value=\"09\">Level +09 fixo</option>";
                 $selectTagLevel .= "<option value=\"10\">Level +10 fixo</option>";
                 $selectTagLevel .= "<option value=\"11\">Level +11 fixo</option>";
                 $selectTagLevel .= "<option value=\"12\">Level +12 fixo</option>";
                 $selectTagLevel .= "<option value=\"13\">Level +13 fixo</option>";
                 $selectTagLevel .= "<option value=\"14\">Level +14 fixo</option>";
                 $selectTagLevel .= "<option value=\"15\">Level +15 fixo</option>";
                 $selectTagOpt .= "<option value=\"0\">Option +0 fixo</option>";
                 $selectTagOpt .= "<option value=\"1\">Option +4 fixo</option>";
                 $selectTagOpt .= "<option value=\"2\">Option +8 fixo</option>";
                 $selectTagOpt .= "<option value=\"3\">Option +12 fixo</option>";
                 $selectTagOpt .= "<option value=\"4\">Option +16 fixo</option>";
                 $selectTagOpt .= "<option value=\"5\">Option +20 fixo</option>";
                 $selectTagOpt .= "<option value=\"6\">Option +24 fixo</option>";
                 $selectTagOpt .= "<option value=\"7\">Option +28 fixo</option>";
                 $selectTagAnc .= "<option value=\"0\">N&atilde;o tem</option>";
                 $selectTagAnc .= "<option value=\"1\">+5 Stamina</option>";
                 $selectTagAnc .= "<option value=\"2\">+10 Stamina</option>";
                 if ($findItemDetails->JH == 0) {
                     $selectTagJh .= "<option value='00'>Nenhuma</option>";
                 } else {
                     $selectTagJh .= "<option value='00'>Nenhuma</option>";
                     $SelectOptionsJhQ = $ODBC->query("SELECT * FROM ItemsJewelOfHarmony WHERE TP = '{$findItemDetails->JH}' ORDER BY [Number]");
                     while ($SelectOptionsJh = odbc_fetch_array($SelectOptionsJhQ)) {
                         if (substr($SelectOptionsJh['NM'], 0, 8) == "NONE JoH") {
                             continue;
                         }
                         for ($iJh = 0; $iJh < 15; $iJh++) {
                             $indexJh = strtoupper(dechex($iJh));
                             if ($this->isZeroOptionJh == true && $SelectOptionsJh['prefx' . $indexJh] == 0) {
                                 continue;
                             }
                             if ($SelectOptionsJh['prefx' . $indexJh] == 0) {
                                 $this->isZeroOptionJh = true;
                             }
                             $selectTagJh .= "<option value='{$SelectOptionsJh['ID']}{$indexJh}'>{$SelectOptionsJh['NM']} " . $SelectOptionsJh['prefx' . $indexJh] . " </option>\n";
                         }
                     }
                 }
                 if ($findItemDetails->RF == 0) {
                     $selectTagRefine .= "<option value=\"0\">Nenhuma</option>";
                 } else {
                     $SelectOptionRefineQ = $ODBC->query("SELECT prefx1, prefx2 FROM ItemsRefinery WHERE ID={$findItemDetails->RF}");
                     $SelectOptionRefine = odbc_fetch_object($SelectOptionRefineQ);
                     $selectTagRefine .= "<option value=\"0\">Nenhuma</option><option value=\"1\">{$SelectOptionRefine->prefx1}, {$SelectOptionRefine->prefx2}";
                 }
                 require "../modules/sockets.lib.php";
                 if ($findItemDetails->Socket == 0) {
                     $selectTagSocket1 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     $selectTagSocket2 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     $selectTagSocket3 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     $selectTagSocket4 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     $selectTagSocket5 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                 } else {
                     switch ($findItemDetails->CATEGORIA) {
                         //None: -1, Fire: 1, Water: 2, Ice: 3, Wind: 4, Lightning: 5, Ground/Earth: 6
                         case "Amulets":
                             $typesSockets = array("-1");
                             break;
                         case "Armors":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Axes":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Boots":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Bows":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Castel Siege":
                             $typesSockets = array("-1");
                             break;
                         case "CrossBows":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Events":
                             $typesSockets = array("-1");
                             break;
                         case "Events MIX":
                             $typesSockets = array("-1");
                             break;
                         case "Gifts/Boxs":
                             $typesSockets = array("-1");
                             break;
                         case "Gloves":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Guards/Pets":
                             $typesSockets = array("-1");
                             break;
                         case "Helms":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Jewels":
                             $typesSockets = array("-1");
                             break;
                         case "Jewels MIX":
                             $typesSockets = array("-1");
                             break;
                         case "Maces":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Mix Items":
                             $typesSockets = array("-1");
                             break;
                         case "Mix Pets":
                             $typesSockets = array("-1");
                             break;
                         case "New/Test":
                             $typesSockets = array("-1");
                             break;
                         case "Orbs":
                             $typesSockets = array("-1");
                             break;
                         case "Other Items":
                             $typesSockets = array("-1");
                             break;
                         case "Pants":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Pendants":
                             $typesSockets = array("-1");
                             break;
                         case "Potions":
                             $typesSockets = array("-1");
                             break;
                         case "Quests":
                             $typesSockets = array("-1");
                             break;
                         case "Rings":
                             $typesSockets = array("-1");
                             break;
                         case "Scepters":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Scrolls":
                             $typesSockets = array("-1");
                             break;
                         case "Shields":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Spears":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Staffs":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Swords":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Wings":
                             $typesSockets = array("-1");
                             break;
                         default:
                             $typesSockets = array("-1");
                     }
                     if ($typesSockets[0] == "-1") {
                         $selectTagSocket1 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                         $selectTagSocket2 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                         $selectTagSocket3 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                         $selectTagSocket4 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                         $selectTagSocket5 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     } else {
                         for ($iSocketCount = 0, $iSocketIncrement = count($typesSockets); $iSocketCount < $iSocketIncrement; $iSocketCount++) {
                             foreach ($socketLib['socketTypeNumber'][$typesSockets[$iSocketCount]] as $key => $socket) {
                                 $this->selectOptionsSocketItemTmp[0] .= "<option value=\"" . (int) $key . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][1]})</option>\n";
                                 $this->selectOptionsSocketItemTmp[1] .= "<option value=\"" . (int) ($key + 50) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][2]})</option>\n";
                                 $this->selectOptionsSocketItemTmp[2] .= "<option value=\"" . (int) ($key + 100) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][3]})</option>\n";
                                 $this->selectOptionsSocketItemTmp[3] .= "<option value=\"" . (int) ($key + 150) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][5]})</option>\n";
                                 $this->selectOptionsSocketItemTmp[4] .= "<option value=\"" . (int) ($key + 200) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][5]})</option>\n";
                             }
                         }
                         /*for($iSocketCount = 0, $iSocketIncrement = count($typesSockets); $iSocketCount < $iSocketIncrement; $iSocketCount++)
                           {
                               $SelectOptionsSocketQ = $ODBC->query("SELECT ST, NM, ID, S1, S2, S3, S4, S5 FROM ItemsSocket WHERE TP = ".$typesSockets[$iSocketCount]);
                               while($SelectOptionsSocket = odbc_fetch_array($SelectOptionsSocketQ))
                               {                                                                      
                                   $this->selectOptionsSocketItemTmp[0] .= "<option value=\"". ($SelectOptionsSocket['ID']) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S1']})</option>\n";
                                   $this->selectOptionsSocketItemTmp[1] .= "<option value=\"". ($SelectOptionsSocket['ID']+50) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S2']})</option>\n";
                                   $this->selectOptionsSocketItemTmp[2] .= "<option value=\"". ($SelectOptionsSocket['ID']+100) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S3']})</option>\n";
                                   $this->selectOptionsSocketItemTmp[3] .= "<option value=\"". ($SelectOptionsSocket['ID']+150) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S4']})</option>\n";
                                   $this->selectOptionsSocketItemTmp[4] .= "<option value=\"". ($SelectOptionsSocket['ID']+200) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S5']})</option>\n";
                               }
                           }*/
                         $selectTagSocket1 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[0];
                         $selectTagSocket2 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[1];
                         $selectTagSocket3 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[2];
                         $selectTagSocket4 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[3];
                         $selectTagSocket5 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[4];
                     }
                 }
                 echo "<form action=\"\" method=\"POST\" id=\"manager\" name=\"manager\">";
                 echo "Nome do item a incluir:<br />\n<strong>{$findItemDetails->NAME}</strong><br />\n";
                 echo "Level fixo:<br />\n<select name=\"fixLevel\" id=\"fixLevel\">{$selectTagLevel}</select><br />\n";
                 echo "Option fixo:<br />\n<select name=\"fixOP\" id=\"fixOP\">{$selectTagOpt}</select><br />\n";
                 echo "Luck fixo:<br />\n<input type=\"checkbox\" value=\"1\" id=\"fixLuck\" name=\"fixLuck\" /><br />\n";
                 echo "Skill fixo:<br />\n<input type=\"checkbox\" value=\"1\" id=\"fixSkill\" name=\"fixSkill\" /><br />\n";
                 echo "Ancient fixo:<br />\n<select name=\"fixANC\" id=\"fixANC\">{$selectTagAnc}</select><br />\n";
                 echo "<fieldset><legend>Op&ccedil;&otilde;es excelentes:</legend>";
                 echo "<input name=\"fixOpEx1\" id=\"fixOpEx1\" type=\"checkbox\" value=\"1\"> {$this->NomeOpExc1}<br />\n";
                 echo "<input name=\"fixOpEx2\" id=\"fixOpEx2\" type=\"checkbox\" value=\"1\"> {$this->NomeOpExc2}<br />\n";
                 echo "<input name=\"fixOpEx3\" id=\"fixOpEx3\" type=\"checkbox\" value=\"1\"> {$this->NomeOpExc3}<br />\n";
                 echo "<input name=\"fixOpEx4\" id=\"fixOpEx4\" type=\"checkbox\" value=\"1\"> {$this->NomeOpExc4}<br />\n";
                 echo "<input name=\"fixOpEx5\" id=\"fixOpEx5\" type=\"checkbox\" value=\"1\"> {$this->NomeOpExc5}<br />\n";
                 echo "<input name=\"fixOpEx6\" id=\"fixOpEx6\" type=\"checkbox\" value=\"1\"> {$this->NomeOpExc6}";
                 echo "</fieldset>";
                 echo "Option harmony fixo:<br />\n<select name=\"fixJH\" id=\"fixJH\">{$selectTagJh}</select><br />\n";
                 echo "Option refine fixo:<br />\n<select name=\"fixRefine\" id=\"fixRefine\">{$selectTagRefine}</select><br />\n";
                 echo "<fieldset><legend>Op&ccedil;&otilde;es sockets:</legend>";
                 echo "<select name=\"fixSocket1\" id=\"fixSocket1\"> {$selectTagSocket1}</select><br />\n";
                 echo "<select name=\"fixSocket2\" id=\"fixSocket2\"> {$selectTagSocket2}</select><br />\n";
                 echo "<select name=\"fixSocket3\" id=\"fixSocket3\"> {$selectTagSocket3}</select><br />\n";
                 echo "<select name=\"fixSocket4\" id=\"fixSocket4\"> {$selectTagSocket4}</select><br />\n";
                 echo "<select name=\"fixSocket5\" id=\"fixSocket5\"> {$selectTagSocket5}</select>";
                 echo "</fieldset>";
                 echo "<input type=\"button\" class=\"button\" value=\"Incluir item no kit\" onclick=\"Verify('?AjaxFunctions=true&Function=managerProducts&module=alterThisKit&action=includeItemDb&number={$number}&itemNumber={$_GET['itemNumber']}', 'resultItemsAjaxKitsSubResult', 'POST', BuscaElementosForm('manager'));\" />";
                 echo "</form>";
                 echo "<div id=\"resultItemsAjaxKitsSubResult\"></div>";
                 break;
             case "includeItemDb":
                 $number = (int) $_GET['number'];
                 $itemNumber = (string) $_GET['itemNumber'];
                 $fixLevel = (string) $_POST['fixLevel'];
                 $fixOP = (int) $_POST['fixOP'];
                 $fixLuck = (int) $_POST['fixLuck'];
                 $fixSkill = (int) $_POST['fixSkill'];
                 $fixANC = (int) $_POST['fixANC'];
                 $fixOpEx1 = (int) $_POST['fixOpEx1'];
                 $fixOpEx2 = (int) $_POST['fixOpEx2'];
                 $fixOpEx3 = (int) $_POST['fixOpEx3'];
                 $fixOpEx4 = (int) $_POST['fixOpEx4'];
                 $fixOpEx5 = (int) $_POST['fixOpEx5'];
                 $fixOpEx6 = (int) $_POST['fixOpEx6'];
                 $fixJH = (string) $_POST['fixJH'];
                 $fixRefine = (int) $_POST['fixRefine'];
                 $fixSocket1 = (int) $_POST['fixSocket1'];
                 $fixSocket2 = (int) $_POST['fixSocket2'];
                 $fixSocket3 = (int) $_POST['fixSocket3'];
                 $fixSocket4 = (int) $_POST['fixSocket4'];
                 $fixSocket5 = (int) $_POST['fixSocket5'];
                 if ($ODBC->query("INSERT INTO KitsItemsDetails \n                                        (`kitNumber`,`itemNumber`,`fixLVL`,`fixOP`,`fixLuck`,`fixSkill`,`fixANC`,`fixOpEx1`,`fixOpEx2`,`fixOpEx3`,`fixOpEx4`,`fixOpEx5`,`fixOpEx6`,`fixJH`,`fixRefine`,`fixSocket1`,`fixSocket2`,`fixSocket3`,`fixSocket4`,`fixSocket5`) \n                                        VALUES ({$number}, '{$itemNumber}', {$fixLevel}, {$fixOP}, {$fixLuck}, {$fixSkill}, {$fixANC}, {$fixOpEx1}, {$fixOpEx2}, {$fixOpEx3}, {$fixOpEx4}, {$fixOpEx5}, {$fixOpEx6}, '{$fixJH}', {$fixRefine}, {$fixSocket1}, {$fixSocket2}, {$fixSocket3}, {$fixSocket4}, {$fixSocket5});\n                                     ") == false) {
                     echo "<ul><li>Erro ao adicionar item. Favor tentar novamente.</li></ul>";
                 } else {
                     echo "<ul><li>Item adicionado com sucesso!.</li></ul>";
                 }
                 break;
             case "alterItemSelect":
                 echo "Selecione o item que deseja altera em <strong>{$findKitDetails->kitName}</strong>";
                 echo "<select multiple style=\"width:500px; height:150px\" onchange=\"javascript: Verify('?AjaxFunctions=true&Function=managerProducts&module=alterThisKit&action=alterItemForm&number={$number}&itemNumber='+this.options[this.selectedIndex].value, 'resultItemsAjaxKitsResult', 'get');\">";
                 $findItensInKitQuery = $ODBC->query("SELECT itemNumber FROM KitsItemsDetails WHERE kitNumber = " . $number);
                 while ($findItensInKit = odbc_fetch_object($findItensInKitQuery)) {
                     $findItemKitDetailsQuery = $ODBC->query("SELECT NAME FROM Items WHERE Number='{$findItensInKit->itemNumber}'");
                     $findItemKitDetails = odbc_fetch_object($findItemKitDetailsQuery);
                     echo "<option value=\"{$findItensInKit->itemNumber}\">{$findItemKitDetails->NAME}</option>";
                 }
                 echo "</select>";
                 break;
             case "alterItemForm":
                 $checkItemDetailsKitQuery = $ODBC->query("SELECT * FROM KitsItemsDetails WHERE kitNumber = {$number} AND itemNumber='{$_GET['itemNumber']}'");
                 $checkItemDetailsKit = odbc_fetch_object($checkItemDetailsKitQuery);
                 if ($checkItemDetailsKit->itemNumber != $_GET['itemNumber']) {
                     exit("<ul><li>Erro, esse item n&aatilde; foi cadastrado nesse kit.</li></ul>");
                 }
                 $findItemDetailsQuery = $ODBC->query("SELECT * FROM Items WHERE Number = '{$_GET['itemNumber']}'");
                 $findItemDetails = odbc_fetch_object($findItemDetailsQuery);
                 $this->loadOptionsExeNames($findItemDetails->EXE);
                 $selectTagLevel .= "<option value=\"00\" " . ($checkItemDetailsKit->fixLVL == "0" ? "selected = \"selected\"" : "") . ">Level +00 fixo</option>";
                 $selectTagLevel .= "<option value=\"01\" " . ($checkItemDetailsKit->fixLVL == "1" ? "selected = \"selected\"" : "") . ">Level +01 fixo</option>";
                 $selectTagLevel .= "<option value=\"02\" " . ($checkItemDetailsKit->fixLVL == "2" ? "selected = \"selected\"" : "") . ">Level +02 fixo</option>";
                 $selectTagLevel .= "<option value=\"03\" " . ($checkItemDetailsKit->fixLVL == "3" ? "selected = \"selected\"" : "") . ">Level +03 fixo</option>";
                 $selectTagLevel .= "<option value=\"04\" " . ($checkItemDetailsKit->fixLVL == "4" ? "selected = \"selected\"" : "") . ">Level +04 fixo</option>";
                 $selectTagLevel .= "<option value=\"05\" " . ($checkItemDetailsKit->fixLVL == "5" ? "selected = \"selected\"" : "") . ">Level +05 fixo</option>";
                 $selectTagLevel .= "<option value=\"06\" " . ($checkItemDetailsKit->fixLVL == "6" ? "selected = \"selected\"" : "") . ">Level +06 fixo</option>";
                 $selectTagLevel .= "<option value=\"07\" " . ($checkItemDetailsKit->fixLVL == "7" ? "selected = \"selected\"" : "") . ">Level +07 fixo</option>";
                 $selectTagLevel .= "<option value=\"08\" " . ($checkItemDetailsKit->fixLVL == "8" ? "selected = \"selected\"" : "") . ">Level +08 fixo</option>";
                 $selectTagLevel .= "<option value=\"09\" " . ($checkItemDetailsKit->fixLVL == "9" ? "selected = \"selected\"" : "") . ">Level +09 fixo</option>";
                 $selectTagLevel .= "<option value=\"10\" " . ($checkItemDetailsKit->fixLVL == "10" ? "selected = \"selected\"" : "") . ">Level +10 fixo</option>";
                 $selectTagLevel .= "<option value=\"11\" " . ($checkItemDetailsKit->fixLVL == "11" ? "selected = \"selected\"" : "") . ">Level +11 fixo</option>";
                 $selectTagLevel .= "<option value=\"12\" " . ($checkItemDetailsKit->fixLVL == "12" ? "selected = \"selected\"" : "") . ">Level +12 fixo</option>";
                 $selectTagLevel .= "<option value=\"13\" " . ($checkItemDetailsKit->fixLVL == "13" ? "selected = \"selected\"" : "") . ">Level +13 fixo</option>";
                 $selectTagLevel .= "<option value=\"14\" " . ($checkItemDetailsKit->fixLVL == "14" ? "selected = \"selected\"" : "") . ">Level +14 fixo</option>";
                 $selectTagLevel .= "<option value=\"15\" " . ($checkItemDetailsKit->fixLVL == "15" ? "selected = \"selected\"" : "") . ">Level +15 fixo</option>";
                 $selectTagOpt .= "<option value=\"0\" " . ($checkItemDetailsKit->fixOP == "0" ? "selected = \"selected\"" : "") . ">Option +0 fixo</option>";
                 $selectTagOpt .= "<option value=\"1\" " . ($checkItemDetailsKit->fixOP == "1" ? "selected = \"selected\"" : "") . ">Option +4 fixo</option>";
                 $selectTagOpt .= "<option value=\"2\" " . ($checkItemDetailsKit->fixOP == "2" ? "selected = \"selected\"" : "") . ">Option +8 fixo</option>";
                 $selectTagOpt .= "<option value=\"3\" " . ($checkItemDetailsKit->fixOP == "3" ? "selected = \"selected\"" : "") . ">Option +12 fixo</option>";
                 $selectTagOpt .= "<option value=\"4\" " . ($checkItemDetailsKit->fixOP == "4" ? "selected = \"selected\"" : "") . ">Option +16 fixo</option>";
                 $selectTagOpt .= "<option value=\"5\" " . ($checkItemDetailsKit->fixOP == "5" ? "selected = \"selected\"" : "") . ">Option +20 fixo</option>";
                 $selectTagOpt .= "<option value=\"6\" " . ($checkItemDetailsKit->fixOP == "6" ? "selected = \"selected\"" : "") . ">Option +24 fixo</option>";
                 $selectTagOpt .= "<option value=\"7\" " . ($checkItemDetailsKit->fixOP == "7" ? "selected = \"selected\"" : "") . ">Option +28 fixo</option>";
                 $selectTagAnc .= "<option value=\"0\" " . ($checkItemDetailsKit->fixANC == "0" ? "selected = \"selected\"" : "") . ">N&atilde;o tem</option>";
                 $selectTagAnc .= "<option value=\"1\" " . ($checkItemDetailsKit->fixANC == "1" ? "selected = \"selected\"" : "") . ">+5 Stamina</option>";
                 $selectTagAnc .= "<option value=\"2\" " . ($checkItemDetailsKit->fixANC == "2" ? "selected = \"selected\"" : "") . ">+10 Stamina</option>";
                 if ($findItemDetails->JH == 0) {
                     $selectTagJh .= "<option value='00'>Nenhuma</option>";
                 } else {
                     $selectTagJh .= "<option value='00'>Nenhuma</option>";
                     $SelectOptionsJhQ = $ODBC->query("SELECT * FROM ItemsJewelOfHarmony WHERE TP = '{$findItemDetails->JH}' ORDER BY [Number]");
                     while ($SelectOptionsJh = odbc_fetch_array($SelectOptionsJhQ)) {
                         if (substr($SelectOptionsJh['NM'], 0, 8) == "NONE JoH") {
                             continue;
                         }
                         for ($iJh = 0; $iJh < 15; $iJh++) {
                             $indexJh = strtoupper(dechex($iJh));
                             if ($this->isZeroOptionJh == true && $SelectOptionsJh['prefx' . $indexJh] == 0) {
                                 continue;
                             }
                             if ($SelectOptionsJh['prefx' . $indexJh] == 0) {
                                 $this->isZeroOptionJh = true;
                             }
                             $selectTagJh .= "<option value='{$SelectOptionsJh['ID']}{$indexJh}' " . ($checkItemDetailsKit->fixJH == $SelectOptionsJh['ID'] . $indexJh ? "selected = \"selected\"" : "") . ">{$SelectOptionsJh['NM']} " . $SelectOptionsJh['prefx' . $indexJh] . " </option>\n";
                         }
                     }
                 }
                 if ($findItemDetails->RF == 0) {
                     $selectTagRefine .= "<option value=\"0\">Nenhuma</option>";
                 } else {
                     $SelectOptionRefineQ = $ODBC->query("SELECT prefx1, prefx2 FROM ItemsRefinery WHERE ID={$findItemDetails->RF}");
                     $SelectOptionRefine = odbc_fetch_object($SelectOptionRefineQ);
                     $selectTagRefine .= "<option value=\"0\">Nenhuma</option><option value=\"1\" " . ($checkItemDetailsKit->fixRefine == "1" ? "selected = \"selected\"" : "") . ">{$SelectOptionRefine->prefx1}, {$SelectOptionRefine->prefx2}";
                 }
                 require "../modules/sockets.lib.php";
                 if ($findItemDetails->Socket == 0) {
                     $selectTagSocket1 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     $selectTagSocket2 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     $selectTagSocket3 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     $selectTagSocket4 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     $selectTagSocket5 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                 } else {
                     switch ($findItemDetails->CATEGORIA) {
                         //None: -1, Fire: 1, Water: 2, Ice: 3, Wind: 4, Lightning: 5, Ground/Earth: 6
                         case "Amulets":
                             $typesSockets = array("-1");
                             break;
                         case "Armors":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Axes":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Boots":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Bows":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Castel Siege":
                             $typesSockets = array("-1");
                             break;
                         case "CrossBows":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Events":
                             $typesSockets = array("-1");
                             break;
                         case "Events MIX":
                             $typesSockets = array("-1");
                             break;
                         case "Gifts/Boxs":
                             $typesSockets = array("-1");
                             break;
                         case "Gloves":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Guards/Pets":
                             $typesSockets = array("-1");
                             break;
                         case "Helms":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Jewels":
                             $typesSockets = array("-1");
                             break;
                         case "Jewels MIX":
                             $typesSockets = array("-1");
                             break;
                         case "Maces":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Mix Items":
                             $typesSockets = array("-1");
                             break;
                         case "Mix Pets":
                             $typesSockets = array("-1");
                             break;
                         case "New/Test":
                             $typesSockets = array("-1");
                             break;
                         case "Orbs":
                             $typesSockets = array("-1");
                             break;
                         case "Other Items":
                             $typesSockets = array("-1");
                             break;
                         case "Pants":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Pendants":
                             $typesSockets = array("-1");
                             break;
                         case "Potions":
                             $typesSockets = array("-1");
                             break;
                         case "Quests":
                             $typesSockets = array("-1");
                             break;
                         case "Rings":
                             $typesSockets = array("-1");
                             break;
                         case "Scepters":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Scrolls":
                             $typesSockets = array("-1");
                             break;
                         case "Shields":
                             $typesSockets = array("2", "4", "6");
                             break;
                         case "Spears":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Staffs":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Swords":
                             $typesSockets = array("1", "3", "5");
                             break;
                         case "Wings":
                             $typesSockets = array("-1");
                             break;
                         default:
                             $typesSockets = array("-1");
                     }
                     if ($typesSockets[0] == "-1") {
                         $selectTagSocket1 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                         $selectTagSocket2 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                         $selectTagSocket3 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                         $selectTagSocket4 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                         $selectTagSocket5 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>";
                     } else {
                         for ($iSocketCount = 0, $iSocketIncrement = count($typesSockets); $iSocketCount < $iSocketIncrement; $iSocketCount++) {
                             foreach ($socketLib['socketTypeNumber'][$typesSockets[$iSocketCount]] as $key => $socket) {
                                 $this->selectOptionsSocketItemTmp[0] .= "<option value=\"" . (int) $key . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][1]})</option>\n";
                                 $this->selectOptionsSocketItemTmp[1] .= "<option value=\"" . (int) ($key + 50) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][2]})</option>\n";
                                 $this->selectOptionsSocketItemTmp[2] .= "<option value=\"" . (int) ($key + 100) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][3]})</option>\n";
                                 $this->selectOptionsSocketItemTmp[3] .= "<option value=\"" . (int) ($key + 150) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][5]})</option>\n";
                                 $this->selectOptionsSocketItemTmp[4] .= "<option value=\"" . (int) ($key + 200) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][5]})</option>\n";
                             }
                         }
                         /*for($iSocketCount = 0, $iSocketIncrement = count($typesSockets); $iSocketCount < $iSocketIncrement; $iSocketCount++)
                           {
                               $SelectOptionsSocketQ = $ODBC->query("SELECT ST, NM, ID, S1, S2, S3, S4, S5 FROM ItemsSocket WHERE TP = ".$typesSockets[$iSocketCount]);
                               while($SelectOptionsSocket = odbc_fetch_array($SelectOptionsSocketQ))
                               {                                                                      
                                   $this->selectOptionsSocketItemTmp[0] .= "<option value=\"". ($SelectOptionsSocket['ID']) ."\" ". ($checkItemDetailsKit->fixSocket1 == ($SelectOptionsSocket['ID']) ? "selected = \"selected\"":"") .">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S1']})</option>\n";
                                   $this->selectOptionsSocketItemTmp[1] .= "<option value=\"". ($SelectOptionsSocket['ID']+50) ."\" ". ($checkItemDetailsKit->fixSocket2 == ($SelectOptionsSocket['ID']+50) ? "selected = \"selected\"":"") .">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S2']})</option>\n";
                                   $this->selectOptionsSocketItemTmp[2] .= "<option value=\"". ($SelectOptionsSocket['ID']+100) ."\" ". ($checkItemDetailsKit->fixSocket3 == ($SelectOptionsSocket['ID']+100) ? "selected = \"selected\"":"") .">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S3']})</option>\n";
                                   $this->selectOptionsSocketItemTmp[3] .= "<option value=\"". ($SelectOptionsSocket['ID']+150) ."\" ". ($checkItemDetailsKit->fixSocket4 == ($SelectOptionsSocket['ID']+150) ? "selected = \"selected\"":"") .">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S4']})</option>\n";
                                   $this->selectOptionsSocketItemTmp[4] .= "<option value=\"". ($SelectOptionsSocket['ID']+200) ."\" ". ($checkItemDetailsKit->fixSocket5 == ($SelectOptionsSocket['ID']+200) ? "selected = \"selected\"":"") .">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S5']})</option>\n";
                               }
                           }*/
                         $selectTagSocket1 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[0];
                         $selectTagSocket2 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[1];
                         $selectTagSocket3 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[2];
                         $selectTagSocket4 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[3];
                         $selectTagSocket5 = "<option value=\"{$socketLib['notSocket']}\">Nenhuma ({$socketLib['notSocket']})</option><option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre ({$socketLib['emptySocket']})</option>" . $this->selectOptionsSocketItemTmp[4];
                     }
                 }
                 echo "<form action=\"\" method=\"POST\" id=\"manager\" name=\"manager\">";
                 echo "Nome do item a alterar:<br />\n<strong>{$findItemDetails->NAME}</strong><br />\n";
                 echo "Level fixo:<br />\n<select name=\"fixLevel\" id=\"fixLevel\">{$selectTagLevel}</select><br />\n";
                 echo "Option fixo:<br />\n<select name=\"fixOP\" id=\"fixOP\">{$selectTagOpt}</select><br />\n";
                 echo "Luck fixo:<br />\n<input type=\"checkbox\" value=\"1\" id=\"fixLuck\" name=\"fixLuck\" " . ($checkItemDetailsKit->fixLuck == "1" ? "checked = \"checked\"" : "") . " /><br />\n";
                 echo "Skill fixo:<br />\n<input type=\"checkbox\" value=\"1\" id=\"fixSkill\" name=\"fixSkill\" " . ($checkItemDetailsKit->fixSkill == "1" ? "checked = \"checked\"" : "") . " /><br />\n";
                 echo "Ancient fixo:<br />\n<select name=\"fixANC\" id=\"fixANC\">{$selectTagAnc}</select><br />\n";
                 echo "<fieldset><legend>Op&ccedil;&otilde;es excelentes:</legend>";
                 echo "<input name=\"fixOpEx1\" id=\"fixOpEx1\" type=\"checkbox\" value=\"1\" " . ($checkItemDetailsKit->fixOpEx1 == "1" ? "checked = \"checked\"" : "") . " /> {$this->NomeOpExc1}<br />\n";
                 echo "<input name=\"fixOpEx2\" id=\"fixOpEx2\" type=\"checkbox\" value=\"1\" " . ($checkItemDetailsKit->fixOpEx2 == "1" ? "checked = \"checked\"" : "") . " /> {$this->NomeOpExc2}<br />\n";
                 echo "<input name=\"fixOpEx3\" id=\"fixOpEx3\" type=\"checkbox\" value=\"1\" " . ($checkItemDetailsKit->fixOpEx3 == "1" ? "checked = \"checked\"" : "") . " /> {$this->NomeOpExc3}<br />\n";
                 echo "<input name=\"fixOpEx4\" id=\"fixOpEx4\" type=\"checkbox\" value=\"1\" " . ($checkItemDetailsKit->fixOpEx4 == "1" ? "checked = \"checked\"" : "") . " /> {$this->NomeOpExc4}<br />\n";
                 echo "<input name=\"fixOpEx5\" id=\"fixOpEx5\" type=\"checkbox\" value=\"1\" " . ($checkItemDetailsKit->fixOpEx5 == "1" ? "checked = \"checked\"" : "") . " /> {$this->NomeOpExc5}<br />\n";
                 echo "<input name=\"fixOpEx6\" id=\"fixOpEx6\" type=\"checkbox\" value=\"1\" " . ($checkItemDetailsKit->fixOpEx6 == "1" ? "checked = \"checked\"" : "") . " /> {$this->NomeOpExc6}";
                 echo "</fieldset>";
                 echo "Option harmony fixo:<br />\n<select name=\"fixJH\" id=\"fixJH\">{$selectTagJh}</select><br />\n";
                 echo "Option refine fixo:<br />\n<select name=\"fixRefine\" id=\"fixRefine\">{$selectTagRefine}</select><br />\n";
                 echo "<fieldset><legend>Op&ccedil;&otilde;es sockets:</legend>";
                 echo "<select name=\"fixSocket1\" id=\"fixSocket1\"> {$selectTagSocket1}</select><br />\n";
                 echo "<select name=\"fixSocket2\" id=\"fixSocket2\"> {$selectTagSocket2}</select><br />\n";
                 echo "<select name=\"fixSocket3\" id=\"fixSocket3\"> {$selectTagSocket3}</select><br />\n";
                 echo "<select name=\"fixSocket4\" id=\"fixSocket4\"> {$selectTagSocket4}</select><br />\n";
                 echo "<select name=\"fixSocket5\" id=\"fixSocket5\"> {$selectTagSocket5}</select>";
                 echo "</fieldset>";
                 echo "<input type=\"button\" class=\"button\" value=\"Alterar item\" onclick=\"Verify('?AjaxFunctions=true&Function=managerProducts&module=alterThisKit&action=alterItemDb&number={$number}&itemNumber={$_GET['itemNumber']}', 'resultItemsAjaxKitsSubResult', 'POST', BuscaElementosForm('manager'));\" />";
                 echo "</form>";
                 echo "<div id=\"resultItemsAjaxKitsSubResult\"></div>";
                 break;
             case "alterItemDb":
                 $number = (int) $_GET['number'];
                 $itemNumber = (string) $_GET['itemNumber'];
                 $fixLevel = (string) $_POST['fixLevel'];
                 $fixOP = (int) $_POST['fixOP'];
                 $fixLuck = (int) $_POST['fixLuck'];
                 $fixSkill = (int) $_POST['fixSkill'];
                 $fixANC = (int) $_POST['fixANC'];
                 $fixOpEx1 = (int) $_POST['fixOpEx1'];
                 $fixOpEx2 = (int) $_POST['fixOpEx2'];
                 $fixOpEx3 = (int) $_POST['fixOpEx3'];
                 $fixOpEx4 = (int) $_POST['fixOpEx4'];
                 $fixOpEx5 = (int) $_POST['fixOpEx5'];
                 $fixOpEx6 = (int) $_POST['fixOpEx6'];
                 $fixJH = (string) $_POST['fixJH'];
                 $fixRefine = (int) $_POST['fixRefine'];
                 $fixSocket1 = (int) $_POST['fixSocket1'];
                 $fixSocket2 = (int) $_POST['fixSocket2'];
                 $fixSocket3 = (int) $_POST['fixSocket3'];
                 $fixSocket4 = (int) $_POST['fixSocket4'];
                 $fixSocket5 = (int) $_POST['fixSocket5'];
                 if ($ODBC->query("UPDATE KitsItemsDetails SET              \n                                        `fixLVL` = {$fixLevel},\n                                        `fixOP` = {$fixOP},\n                                        `fixLuck` = {$fixLuck},\n                                        `fixSkill` = {$fixSkill},\n                                        `fixANC` = {$fixANC},\n                                        `fixOpEx1` = {$fixOpEx1},\n                                        `fixOpEx2` = {$fixOpEx2},\n                                        `fixOpEx3` = {$fixOpEx3},\n                                        `fixOpEx4` = {$fixOpEx4},\n                                        `fixOpEx5` = {$fixOpEx5},\n                                        `fixOpEx6` = {$fixOpEx6},\n                                        `fixJH` = '{$fixJH}',\n                                        `fixRefine` = {$fixRefine},\n                                        `fixSocket1` = {$fixSocket1},\n                                        `fixSocket2` = {$fixSocket2},\n                                        `fixSocket3` = {$fixSocket3},\n                                        `fixSocket4` = {$fixSocket4},\n                                        `fixSocket5` = {$fixSocket5}\n                                        WHERE `kitNumber` = {$number} AND `itemNumber` = '{$itemNumber}'\n                                     ") == false) {
                     echo "<ul><li>Erro ao alterar item. Favor tentar novamente.</li></ul>";
                 } else {
                     echo "<ul><li>Item alterado com sucesso!</li></ul>";
                 }
                 break;
             case "removeItemSelect":
                 echo "Selecione o item que deseja remover em <strong>{$findKitDetails->kitName}</strong>";
                 echo "<select multiple style=\"width:500px; height:150px\" id=\"productsList\">";
                 $findItensInKitQuery = $ODBC->query("SELECT itemNumber FROM KitsItemsDetails WHERE kitNumber = " . $number);
                 while ($findItensInKit = odbc_fetch_object($findItensInKitQuery)) {
                     $findItemKitDetailsQuery = $ODBC->query("SELECT NAME FROM Items WHERE Number='{$findItensInKit->itemNumber}'");
                     $findItemKitDetails = odbc_fetch_object($findItemKitDetailsQuery);
                     echo "<option value=\"{$findItensInKit->itemNumber}\">{$findItemKitDetails->NAME}</option>";
                 }
                 echo "</select>";
                 echo "<div class=\"qdestaques\">Aten&ccedil;&atilde;o, ao remover um item do shopping, o hist&oacute;rico de compras dos players podem aprensentar problemas caso j&aacute; tenham realizado alguma compra.</div>";
                 echo "<input type=\"button\" class=\"button\" value=\"Deletar\" onclick=\"javascript: Verify('?AjaxFunctions=true&Function=managerProducts&module=alterThisKit&action=removeItemDb&number={$number}&itemNumber='+document.getElementById('productsList').value, 'resultItemsAjaxKitsResult', 'get');\" />";
                 break;
             case "removeItemDb":
                 $number = (int) $_GET['number'];
                 $itemNumber = (string) $_GET['itemNumber'];
                 if ($ODBC->query("DELETE FROM KitsItemsDetails WHERE `kitNumber` = {$number} AND `itemNumber` = '{$itemNumber}'") == false) {
                     echo "<ul><li>Erro ao remover item. Favor tentar novamente.</li></ul>";
                 } else {
                     echo "<ul><li>Item removido com sucesso!</li></ul>";
                 }
                 break;
             case "activeDesactiveSolds":
                 $findKitDetailsQuery = $ODBC->query("SELECT active FROM Kits WHERE Number = " . $number);
                 $findKitDetails = odbc_fetch_object($findKitDetailsQuery);
                 if ($findKitDetails->active == 0) {
                     $ODBC->query("UPDATE Kits SET active = 1 WHERE Number = " . $number);
                     echo "<ul><li>As vendas desse kits foram <strong>ativadas</strong> nesse momento.</ul></li>";
                 } else {
                     $ODBC->query("UPDATE Kits SET active = 0 WHERE Number = " . $number);
                     echo "<ul><li>As vendas desse kits foram <strong>desativadas</strong> nesse momento.</ul></li>";
                 }
                 break;
             default:
                 echo "A&ccedil;&atilde;o indefinida";
         }
     }
 }
コード例 #17
0
ファイル: vault.class.php プロジェクト: neilor/MuShopping-v3
 public function CutHexSlotsVault()
 {
     $ODBC = new LD_ODBC();
     for ($i = 0; $i < 120; $i++) {
         if ($this->Vault_Slots[$i]['Hex'] != str_pad("", DIVISOR, "F") && $this->Vault_Slots[$i]['Hex'] != str_pad("", DIVISOR, "0") && $this->Vault_Slots[$i]['Hex'] != NULL) {
             if (SYSTEM_ITEMS == "NEW") {
                 $Ancient = hexdec(substr($this->Vault_Slots[$i]['Hex'], 17, 1));
                 $Categorie = hexdec(substr($this->Vault_Slots[$i]['Hex'], 18, 1));
                 $Index = hexdec(substr($this->Vault_Slots[$i]['Hex'], 0, 2));
                 $FindItemDetailsQuery = $ODBC->query("SELECT Number, X, Y, NAME, DUR FROM Items WHERE ID = {$Index} AND TP = {$Categorie}");
                 $FindItemDetails = odbc_fetch_object($FindItemDetailsQuery);
             } else {
                 $Ancient = hexdec(substr($this->Vault_Slots[$i]['Hex'], 17, 1));
                 $Index = substr($this->Vault_Slots[$i]['Hex'], 0, 2);
                 $Unique = substr($this->Vault_Slots[$i]['Hex'], 14, 2);
                 $UniqueIntValue = hexdec($Unique) >= 128 ? 8 : 0;
                 $New = substr($this->Vault_Slots[$i]['Hex'], 6, 2);
                 $ID = $this->GetItemId($Index);
                 if ($New == "F9") {
                     $ID['index'] += 32;
                 }
                 $FindItemDetailsQuery = $ODBC->query("SELECT Number, X, Y, NAME, DUR FROM Items WHERE ID = {$ID['index']} AND TP = " . (int) ($ID['section'] + $UniqueIntValue) . "");
                 $FindItemDetails = odbc_fetch_object($FindItemDetailsQuery);
             }
             //if($FindItemDetails->Number == NULL);
             //    exit(Print_error("<ul><li>Existe um item no seu ba&uacute; que n&atilde;o foi cadastrado no shopping! A a&ccedil;&atildeo foi interrompida, entre em contato com o suporte.</ul></li>"));
             $this->Vault_Slots[$i]['Key'] = $FindItemDetails->Number;
             $this->Vault_Slots[$i]['Width'] = $FindItemDetails->X;
             $this->Vault_Slots[$i]['Height'] = $FindItemDetails->Y;
             $this->Vault_Slots[$i]['Name'] = $FindItemDetails->NAME;
             $this->Vault_Slots[$i]['Dur'] = $FindItemDetails->DUR;
             $this->Vault_Slots[$i]['Free'] = false;
         } else {
             $this->Vault_Slots[$i]['Key'] = NULL;
             $this->Vault_Slots[$i]['Width'] = 0;
             $this->Vault_Slots[$i]['Height'] = 0;
             $this->Vault_Slots[$i]['Name'] = NULL;
             $this->Vault_Slots[$i]['Free'] = true;
         }
     }
     //var_dump($this->Vault_Slots);
 }
コード例 #18
0
ファイル: metricas_BK.php プロジェクト: C0l0ch0/BPV_WAU
function getDataTableSACA()
{
    $keyAccess = getAccess();
    $conexion = odbc_connect("Driver={SQL Server Native Client 10.0};Server={$keyAccess['2']};Database={$keyAccess['3']};", $keyAccess[0], $keyAccess[1]);
    $result = odbc_exec($conexion, "USE WauReports");
    $result = odbc_exec($conexion, "EXEC GetChargesSA");
    $r = odbc_fetch_object($result);
    $result2 = odbc_exec($conexion, "GetpercentageSA");
    $r2 = odbc_fetch_object($result2);
    $body = "<tr><td align=\"center\"> SANIC </td><td align=\"right\">" . number_format($r->SANIC) . "</td><td align=\"right\">" . number_format($r2->SANIC) . "</td><td align=\"right\">  " . number_format($r->SANIC * 100 / $r2->SANIC);
    $body = $body . "%</td></tr>";
    $body = $body . "<tr><td align=\"center\"> SAPAN </td><td align=\"right\">" . number_format($r->SAPAN) . "</td><td align=\"right\">" . number_format($r2->SAPAN) . "</td><td align=\"right\">  ";
    $body = $body . "%</td></tr>";
    return $body;
}
コード例 #19
0
 public function GetProductDetails($ProductID)
 {
     global $tpl, $LD_General, $ODBC;
     $ODBC_Q = $ODBC->query("SELECT * FROM Items WHERE Number='" . $ProductID . "'");
     $ODBC_R = odbc_fetch_object($ODBC_Q);
     if (odbc_num_rows($ODBC_Q) == 0) {
         exit(Print_error("<script type=\"text/javascript\">alert(\"Desculpe, esse produto não encontrado.\"); //history.go(-1);</script>"));
     }
     $tpl->set("ProductID", $ProductID);
     $tpl->set("ProductName", $ODBC_R->NAME);
     $tpl->set("ProductPhoto", $ODBC_R->photoItem);
     $tpl->set("ProductPhotoAnc", $ODBC_R->photoItemAnc);
     $tpl->set("NormalPriceJS", $ODBC_R->price);
     $tpl->set("LevelPrice", $ODBC_R->priceLevel);
     $tpl->set("AdcionalPrice", $ODBC_R->priceOption);
     $tpl->set("SkillPrice", $ODBC_R->priceSkill);
     $tpl->set("LuckPrice", $ODBC_R->priceLuck);
     $tpl->set("AncientPrice", $ODBC_R->priceAncient);
     $tpl->set("JhPrice", $ODBC_R->priceJh);
     $tpl->set("RefinePrice", $ODBC_R->priceRefine);
     $tpl->set("SocketPrice", $ODBC_R->priceSocket);
     $tpl->set("OpExcPrice", $ODBC_R->priceOptExc);
     $tpl->set("ClassesName", ($ODBC_R->C_0 == 1 ? $LD_General->GetNameClass(0) . ",&nbsp;" : "") . ($ODBC_R->C_1 == 1 ? $LD_General->GetNameClass(1) . ",&nbsp;" : "") . ($ODBC_R->C_2 == 1 ? $LD_General->GetNameClass(2) . ",&nbsp;" : "") . ($ODBC_R->C_16 == 1 ? $LD_General->GetNameClass(16) . ",&nbsp;" : "") . ($ODBC_R->C_17 == 1 ? $LD_General->GetNameClass(17) . ",&nbsp;" : "") . ($ODBC_R->C_18 == 1 ? $LD_General->GetNameClass(18) . ",&nbsp;" : "") . ($ODBC_R->C_32 == 1 ? $LD_General->GetNameClass(32) . ",&nbsp;" : "") . ($ODBC_R->C_33 == 1 ? $LD_General->GetNameClass(33) . ",&nbsp;" : "") . ($ODBC_R->C_34 == 1 ? $LD_General->GetNameClass(34) . ",&nbsp;" : "") . ($ODBC_R->C_48 == 1 ? $LD_General->GetNameClass(48) . ",&nbsp;" : "") . ($ODBC_R->C_49 == 1 ? $LD_General->GetNameClass(49) . ",&nbsp;" : "") . ($ODBC_R->C_64 == 1 ? $LD_General->GetNameClass(64) . ",&nbsp;" : "") . ($ODBC_R->C_65 == 1 ? $LD_General->GetNameClass(65) . ",&nbsp;" : "") . ($ODBC_R->C_80 == 1 ? $LD_General->GetNameClass(80) . ",&nbsp;" : "") . ($ODBC_R->C_81 == 1 ? $LD_General->GetNameClass(81) . ",&nbsp;" : "") . ($ODBC_R->C_82 == 1 ? $LD_General->GetNameClass(82) . ",&nbsp;" : "") . ($ODBC_R->C_96 == 1 ? $LD_General->GetNameClass(96) . ",&nbsp;" : "") . ($ODBC_R->C_98 == 1 ? $LD_General->GetNameClass(98) . ",&nbsp;" : ""));
     $tpl->set("DisabledLevel", $ODBC_R->LVL == "SN" || $ODBC_R->LVL != "NO" ? "disabled=\"disabled\"" : "");
     $tpl->set("LevelFix", $ODBC_R->LVL != "SN" && $ODBC_R->LVL != "NO" ? (int) $ODBC_R->LVL : "0");
     $tpl->set("DisabledAdcional", $ODBC_R->OP == 0 ? "disabled=\"disabled\"" : "");
     $tpl->set("DisabledAncient", $ODBC_R->ANC == 0 ? "disabled=\"disabled\"" : "");
     //$tpl->set("ProductNameAncient", ($ODBC_R->ANC == 1 ? $ODBC_R->SetItem1:""));
     $tpl->set("DisabledSkill", $ODBC_R->SK == 0 ? "disabled=\"disabled\"" : "");
     $tpl->set("DisabledLuck", $ODBC_R->LK == 0 ? "disabled=\"disabled\"" : "");
     $tpl->set("DisabledOpExc", $ODBC_R->EXE == 0 ? "disabled=\"disabled\"" : "");
     $tpl->set("DisabledJH", $ODBC_R->JH == 0 || SYSTEM_ITEMS == "OLD" ? "disabled=\"disabled\"" : "");
     $tpl->set("DisabledRefine", $ODBC_R->RF == 0 || SYSTEM_ITEMS == "OLD" ? "disabled=\"disabled\"" : "");
     $tpl->set("DisabledSocket", $ODBC_R->Socket == 0 ? "disabled=\"disabled\"" : "");
     $tpl->set("MaxOptionsBuy", $ODBC_R->maxOptExcSel);
     if ($ODBC_R->ANC == 1) {
         $tmpAncSelect = "<option value='0'>N&atilde;o</option>";
         if ($ODBC_R->SetItem1 != "NO") {
             $tpl->set("SetItemAnc1", $ODBC_R->SetItem1);
         } else {
             $tpl->set("SetItemAnc1", "");
         }
         if ($ODBC_R->SetItem2 != "NO") {
             $tpl->set("SetItemAnc2", $ODBC_R->SetItem2);
         } else {
             $tpl->set("SetItemAnc2", "");
         }
         if ($ODBC_R->SetItem1 != "NO") {
             $tmpAncSelect .= "<option value='1'>{$ODBC_R->SetItem1}</option>";
         }
         if ($ODBC_R->SetItem2 != "NO") {
             $tmpAncSelect .= "<option value='2'>{$ODBC_R->SetItem2}</option>";
         }
         $tpl->set("OptionSelectAnc", $tmpAncSelect);
     } else {
         $tpl->set("SetItemAnc1", "");
         $tpl->set("SetItemAnc2", "");
         $tpl->set("OptionSelectAnc", "<option value='0'>N&atilde;o</option>");
     }
     if ($ODBC_R->JH == 0) {
         $tpl->set("OptionSelectJH", "<option value='00'>Nenhuma</option>");
     } else {
         $SelectOptionsJhQ = $ODBC->query("SELECT * FROM ItemsJewelOfHarmony WHERE TP = '{$ODBC_R->JH}' ORDER BY [Number]");
         while ($SelectOptionsJh = odbc_fetch_array($SelectOptionsJhQ)) {
             if (substr($SelectOptionsJh['NM'], 0, 8) == "NONE JoH") {
                 continue;
             }
             for ($iJh = 0; $iJh < 14; $iJh++) {
                 $indexJh = strtoupper(dechex($iJh));
                 if ($this->isZeroOptionJh == true && $SelectOptionsJh['prefx' . $indexJh] == 0) {
                     continue;
                 }
                 if ($SelectOptionsJh['prefx' . $indexJh] == 0) {
                     $this->isZeroOptionJh = true;
                 }
                 $this->optionJHTemp .= "<option value='{$SelectOptionsJh['ID']}{$indexJh}'>{$SelectOptionsJh['NM']} " . $SelectOptionsJh['prefx' . $indexJh] . " </option>\n";
             }
             $this->isZeroOptionJh = false;
             $this->optionJHTemp .= "<option disabled='disabled'>--------</option>\n";
         }
         $tpl->set("OptionSelectJH", "<option value='00'>Nenhuma</option><option disabled='disabled'>--------</option>\n" . $this->optionJHTemp);
     }
     if ($ODBC_R->RF == 0) {
         $tpl->set("OptionRadioRF", "Nenhuma");
     } else {
         $SelectOptionRefineQ = $ODBC->query("SELECT prefx1, prefx2 FROM ItemsRefinery WHERE ID={$ODBC_R->RF}");
         $SelectOptionRefine = odbc_fetch_object($SelectOptionRefineQ);
         $tpl->set("OptionRadioRF", $SelectOptionRefine->prefx1 . ", " . $SelectOptionRefine->prefx2);
     }
     require "modules/sockets.lib.php";
     if ($ODBC_R->Socket == 0) {
         $tpl->set("OptionSocketSelect1", "<option value=\"{$socketLib['notSocket']}\">Slot de socket fechado</option>");
         $tpl->set("OptionSocketSelect2", "<option value=\"{$socketLib['notSocket']}\">Slot de socket fechado</option>");
         $tpl->set("OptionSocketSelect3", "<option value=\"{$socketLib['notSocket']}\">Slot de socket fechado</option>");
         $tpl->set("OptionSocketSelect4", "<option value=\"{$socketLib['notSocket']}\">Slot de socket fechado</option>");
         $tpl->set("OptionSocketSelect5", "<option value=\"{$socketLib['notSocket']}\">Slot de socket fechado</option>");
     } else {
         switch ($ODBC_R->CATEGORIA) {
             //None: -1, Fire: 1, Water: 2, Ice: 3, Wind: 4, Lightning: 5, Ground/Earth: 6
             case "Amulets":
                 $typesSockets = array("-1");
                 break;
             case "Armors":
                 $typesSockets = array("2", "4", "6");
                 break;
             case "Axes":
                 $typesSockets = array("1", "3", "5");
                 break;
             case "Boots":
                 $typesSockets = array("2", "4", "6");
                 break;
             case "Bows":
                 $typesSockets = array("1", "3", "5");
                 break;
             case "Castel Siege":
                 $typesSockets = array("-1");
                 break;
             case "CrossBows":
                 $typesSockets = array("1", "3", "5");
                 break;
             case "Events":
                 $typesSockets = array("-1");
                 break;
             case "Events MIX":
                 $typesSockets = array("-1");
                 break;
             case "Gifts/Boxs":
                 $typesSockets = array("-1");
                 break;
             case "Gloves":
                 $typesSockets = array("2", "4", "6");
                 break;
             case "Guards/Pets":
                 $typesSockets = array("-1");
                 break;
             case "Helms":
                 $typesSockets = array("2", "4", "6");
                 break;
             case "Jewels":
                 $typesSockets = array("-1");
                 break;
             case "Jewels MIX":
                 $typesSockets = array("-1");
                 break;
             case "Maces":
                 $typesSockets = array("1", "3", "5");
                 break;
             case "Mix Items":
                 $typesSockets = array("-1");
                 break;
             case "Mix Pets":
                 $typesSockets = array("-1");
                 break;
             case "New/Test":
                 $typesSockets = array("-1");
                 break;
             case "Orbs":
                 $typesSockets = array("-1");
                 break;
             case "Other Items":
                 $typesSockets = array("-1");
                 break;
             case "Pants":
                 $typesSockets = array("2", "4", "6");
                 break;
             case "Pendants":
                 $typesSockets = array("-1");
                 break;
             case "Potions":
                 $typesSockets = array("-1");
                 break;
             case "Quests":
                 $typesSockets = array("-1");
                 break;
             case "Rings":
                 $typesSockets = array("-1");
                 break;
             case "Scepters":
                 $typesSockets = array("1", "3", "5");
                 break;
             case "Scrolls":
                 $typesSockets = array("-1");
                 break;
             case "Shields":
                 $typesSockets = array("2", "4", "6");
                 break;
             case "Spears":
                 $typesSockets = array("1", "3", "5");
                 break;
             case "Staffs":
                 $typesSockets = array("1", "3", "5");
                 break;
             case "Swords":
                 $typesSockets = array("1", "3", "5");
                 break;
             case "Wings":
                 $typesSockets = array("-1");
                 break;
             default:
                 $typesSockets = array("-1");
         }
         if ($typesSockets[0] == "-1") {
             $tpl->set("OptionSocketSelect1", "<option value=\"{$socketLib['emptySocket']}\">Socket livre [Provavelmente sem suporte]</option>");
             $tpl->set("OptionSocketSelect2", "<option value=\"{$socketLib['emptySocket']}\">Socket livre [Provavelmente sem suporte]</option>");
             $tpl->set("OptionSocketSelect3", "<option value=\"{$socketLib['emptySocket']}\">Socket livre [Provavelmente sem suporte]</option>");
             $tpl->set("OptionSocketSelect4", "<option value=\"{$socketLib['emptySocket']}\">Socket livre [Provavelmente sem suporte]</option>");
             $tpl->set("OptionSocketSelect5", "<option value=\"{$socketLib['emptySocket']}\">Socket livre [Provavelmente sem suporte]</option>");
         } else {
             for ($iSocketCount = 0, $iSocketIncrement = count($typesSockets); $iSocketCount < $iSocketIncrement; $iSocketCount++) {
                 foreach ($socketLib['socketTypeNumber'][$typesSockets[$iSocketCount]] as $key => $socket) {
                     $this->selectOptionsSocketItemTmp[0] .= "<option value=\"" . (int) $key . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][1]})</option>\n";
                     $this->selectOptionsSocketItemTmp[1] .= "<option value=\"" . (int) ($key + 50) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][2]})</option>\n";
                     $this->selectOptionsSocketItemTmp[2] .= "<option value=\"" . (int) ($key + 100) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][3]})</option>\n";
                     $this->selectOptionsSocketItemTmp[3] .= "<option value=\"" . (int) ($key + 150) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][5]})</option>\n";
                     $this->selectOptionsSocketItemTmp[4] .= "<option value=\"" . (int) ($key + 200) . "\">{$socket['socketTypeName']} ({$socket['socketName']} + {$socket['socketsArgs'][5]})</option>\n";
                 }
             }
             /*for($iSocketCount = 0, $iSocketIncrement = count($typesSockets); $iSocketCount < $iSocketIncrement; $iSocketCount++)
               {
                   $SelectOptionsSocketQ = $ODBC->query("SELECT ST, NM, ID, S1, S2, S3, S4, S5 FROM ItemsSocket WHERE TP = ".$typesSockets[$iSocketCount]);
                   while($SelectOptionsSocket = odbc_fetch_array($SelectOptionsSocketQ))
                   {                                                                      
                       $this->selectOptionsSocketItemTmp[0] .= "<option value=\"". ($SelectOptionsSocket['ID']) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S1']})</option>\n";
                       $this->selectOptionsSocketItemTmp[1] .= "<option value=\"". ($SelectOptionsSocket['ID']+50) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S2']})</option>\n";
                       $this->selectOptionsSocketItemTmp[2] .= "<option value=\"". ($SelectOptionsSocket['ID']+100) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S3']})</option>\n";
                       $this->selectOptionsSocketItemTmp[3] .= "<option value=\"". ($SelectOptionsSocket['ID']+150) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S4']})</option>\n";
                       $this->selectOptionsSocketItemTmp[4] .= "<option value=\"". ($SelectOptionsSocket['ID']+200) ."\">{$SelectOptionsSocket['ST']} ({$SelectOptionsSocket['NM']} + {$SelectOptionsSocket['S5']})</option>\n";
                   }
               }*/
             $tpl->set("OptionSocketSelect1", "<option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre</option>" . $this->selectOptionsSocketItemTmp[0]);
             $tpl->set("OptionSocketSelect2", "<option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre</option>" . $this->selectOptionsSocketItemTmp[1]);
             $tpl->set("OptionSocketSelect3", "<option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre</option>" . $this->selectOptionsSocketItemTmp[2]);
             $tpl->set("OptionSocketSelect4", "<option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre</option>" . $this->selectOptionsSocketItemTmp[3]);
             $tpl->set("OptionSocketSelect5", "<option value=\"{$socketLib['emptySocket']}\">Deixar o socket livre</option>" . $this->selectOptionsSocketItemTmp[4]);
         }
     }
     $tpl->set("MaxOptText", "<em>Max. de op&ccedil;&otilde;es excelentes: </em><strong>" . $ODBC_R->maxOptExcSel . "</strong>");
     if ($_SESSION['COUPON_ACTIVE'] == true) {
         $tpl->set("NormalPrice", ceil($ODBC_R->preco / 100 * (100 - $_SESSION['COUPON_PERCENT'])));
         $tpl->set("CouponActiveJS", "true");
         $tpl->set("CouponAmount", $_SESSION['COUPON_PERCENT']);
         $tpl->set("CouponCode", $_SESSION['COUPON_CODE']);
         $tpl->set("CouponActiveDIV", "<div id=\"CouponCodeDIV\" style=\"text-align:center;\" class=\"quadros\">Cupom <em>" . $_SESSION['COUPON_CODE'] . "</em> ativado.<br />Valor do desconto <em>" . $_SESSION['COUPON_PERCENT'] . "%</em>.</div>");
     } else {
         $tpl->set("NormalPrice", $ODBC_R->price);
         $tpl->set("CouponActiveJS", "false");
         $tpl->set("CouponAmount", 0);
         $tpl->set("CouponCode", "");
         $tpl->set("CouponActiveDIV", "");
     }
     switch ($ODBC_R->EXE) {
         case 1:
             $tpl->set("NomeOpExc1", "Aumenta mana ap&oacute;s matar monstros +mana/8 ");
             $tpl->set("NomeOpExc2", "Aumenta vida ap&oacute;s matar monstros +vida/8");
             $tpl->set("NomeOpExc3", "Aumenta velocidade de ataque +7");
             $tpl->set("NomeOpExc4", "Adiciona dano +2%");
             $tpl->set("NomeOpExc5", "Aumenta danos +leve1/20");
             $tpl->set("NomeOpExc6", "Excelente dano ratio +10%");
             $tpl->set("NomeOpExc1Disabled", "false");
             $tpl->set("NomeOpExc2Disabled", "false");
             $tpl->set("NomeOpExc3Disabled", "false");
             $tpl->set("NomeOpExc4Disabled", "false");
             $tpl->set("NomeOpExc5Disabled", "false");
             $tpl->set("NomeOpExc6Disabled", "false");
             break;
         case 2:
             $tpl->set("NomeOpExc1", "Aumenta os zens que caem em +40%");
             $tpl->set("NomeOpExc2", "&Ecirc;xito rank defensivo +10%");
             $tpl->set("NomeOpExc3", "Devolve o golpe recebido +5%");
             $tpl->set("NomeOpExc4", "Golpe recebido reduzido +4%");
             $tpl->set("NomeOpExc5", "Aumenta mana em +4%");
             $tpl->set("NomeOpExc6", "Aumenta vida em +4%");
             $tpl->set("NomeOpExc1Disabled", "false");
             $tpl->set("NomeOpExc2Disabled", "false");
             $tpl->set("NomeOpExc3Disabled", "false");
             $tpl->set("NomeOpExc4Disabled", "false");
             $tpl->set("NomeOpExc5Disabled", "false");
             $tpl->set("NomeOpExc6Disabled", "false");
             break;
         case 3:
             $tpl->set("NomeOpExc1", "Aumenta hp");
             $tpl->set("NomeOpExc2", "Aumenta mana");
             $tpl->set("NomeOpExc3", "Poder defensivo contra oponentes de 3%");
             $tpl->set("NomeOpExc4", "Aumenta stamina");
             $tpl->set("NomeOpExc5", "Aumenta velocidade de ataque +7");
             $tpl->set("NomeOpExc6", "Sem Efeito");
             $tpl->set("NomeOpExc1Disabled", "false");
             $tpl->set("NomeOpExc2Disabled", "false");
             $tpl->set("NomeOpExc3Disabled", "false");
             $tpl->set("NomeOpExc4Disabled", "false");
             $tpl->set("NomeOpExc5Disabled", "false");
             $tpl->set("NomeOpExc6Disabled", "\"disabled\"");
             break;
         case 4:
             $tpl->set("NomeOpExc1", "+ Ataque");
             $tpl->set("NomeOpExc2", "+ Defesa");
             $tpl->set("NomeOpExc3", "+ Illusion");
             $tpl->set("NomeOpExc4", "Sem efeito");
             $tpl->set("NomeOpExc5", "Sem efeito");
             $tpl->set("NomeOpExc6", "Sem efeito");
             $tpl->set("NomeOpExc1Disabled", "false");
             $tpl->set("NomeOpExc2Disabled", "false");
             $tpl->set("NomeOpExc3Disabled", "false");
             $tpl->set("NomeOpExc4Disabled", "\"disabled\"");
             $tpl->set("NomeOpExc5Disabled", "\"disabled\"");
             $tpl->set("NomeOpExc6Disabled", "\"disabled\"");
             break;
         case 5:
             $tpl->set("NomeOpExc1", "Aumenta os zens que caem em +40%");
             $tpl->set("NomeOpExc2", "&Ecirc;xito rank defensivo +10%");
             $tpl->set("NomeOpExc3", "Devolve o golpe recebido +5%");
             $tpl->set("NomeOpExc4", "Golpe recebido reduzido +4%");
             $tpl->set("NomeOpExc5", "Aumenta mana em +4%");
             $tpl->set("NomeOpExc6", "Aumenta vida em +4%");
             $tpl->set("NomeOpExc1Disabled", "false");
             $tpl->set("NomeOpExc2Disabled", "false");
             $tpl->set("NomeOpExc3Disabled", "false");
             $tpl->set("NomeOpExc4Disabled", "false");
             $tpl->set("NomeOpExc5Disabled", "false");
             $tpl->set("NomeOpExc6Disabled", "false");
             break;
         case 6:
             $tpl->set("NomeOpExc1", "Aumenta mana ap&oacute;s matar monstros +mana/8");
             $tpl->set("NomeOpExc2", "Aumenta vida ap&oacute;s matar monstros +vida/8");
             $tpl->set("NomeOpExc3", "Aumenta velocidade de ataque +7");
             $tpl->set("NomeOpExc4", "Adiciona dano +2%");
             $tpl->set("NomeOpExc5", "Aumenta danos +leve1/20");
             $tpl->set("NomeOpExc6", "&Ecirc;xito rank defensivo +10%");
             $tpl->set("NomeOpExc1Disabled", "false");
             $tpl->set("NomeOpExc2Disabled", "false");
             $tpl->set("NomeOpExc3Disabled", "false");
             $tpl->set("NomeOpExc4Disabled", "false");
             $tpl->set("NomeOpExc5Disabled", "false");
             $tpl->set("NomeOpExc6Disabled", "false");
             break;
         case 7:
             $tpl->set("NomeOpExc1", "Ignora o Poder Defensivo do Oponente 5%");
             $tpl->set("NomeOpExc2", "5% Chance de retornar o dano");
             $tpl->set("NomeOpExc3", "5% Chance de recuperar toda a vida");
             $tpl->set("NomeOpExc4", "5% Chance de recuperar toda a mana");
             $tpl->set("NomeOpExc5", "Sem efeito");
             $tpl->set("NomeOpExc6", "Sem efeito");
             $tpl->set("NomeOpExc1Disabled", "false");
             $tpl->set("NomeOpExc2Disabled", "false");
             $tpl->set("NomeOpExc3Disabled", "false");
             $tpl->set("NomeOpExc4Disabled", "false");
             $tpl->set("NomeOpExc5Disabled", "true");
             $tpl->set("NomeOpExc6Disabled", "true");
             break;
         default:
             $tpl->set("NomeOpExc1", "Sem efeito");
             $tpl->set("NomeOpExc2", "Sem efeito");
             $tpl->set("NomeOpExc3", "Sem efeito");
             $tpl->set("NomeOpExc4", "Sem efeito");
             $tpl->set("NomeOpExc5", "Sem efeito");
             $tpl->set("NomeOpExc6", "Sem efeito");
             $tpl->set("NomeOpExc1Disabled", "\"disabled\"");
             $tpl->set("NomeOpExc2Disabled", "\"disabled\"");
             $tpl->set("NomeOpExc3Disabled", "\"disabled\"");
             $tpl->set("NomeOpExc4Disabled", "\"disabled\"");
             $tpl->set("NomeOpExc5Disabled", "\"disabled\"");
             $tpl->set("NomeOpExc6Disabled", "\"disabled\"");
             break;
     }
 }
コード例 #20
0
ファイル: inicio.php プロジェクト: hansphp/examenes
    <link href="css/panel.css" rel="stylesheet">
    <script src="js/jquery-2.1.4.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.dataTables.min.js"></script>
  </head>

  <body>
    <div class="container">
<h1>Lista de encuestas</h1>
<hr>
      <!-- Main component for a primary marketing message or call to action -->
<?php 
$clases = array();
$ssql = "SELECT Clases.id_materia, Clases.num_cuenta, Clases.id_profesor, Materias.Materia, Alumnos.Nombre, Alumnos.Apellido\nFROM Materias RIGHT JOIN (Alumnos RIGHT JOIN Clases ON Alumnos.[num_cuenta] = Clases.[num_cuenta]) ON Materias.[Id_materia] = Clases.[id_materia] WHERE  Clases.num_cuenta = {$_SESSION['alumno']->num_cuenta}";
$rs_access = odbc_exec($conn_access, $ssql);
while ($clases[] = odbc_fetch_object($rs_access)) {
}
array_pop($clases);
foreach ($clases as $v) {
    echo "<a href=\"examen.php?id={$v->id_materia}\">" . utf8_encode($v->Materia) . "</a><br>";
}
/*print_r($_SESSION['alumno']);
		echo "<div role=\"tabpanel\" class=\"tab-pane\" id=\"1\">
				   		<p>{\$reactivo->pregunta}</p>
						Opciones:<br>
						<input type=\"radio\" name=\"reactivo {$contador}\" value=1 required> {$reactivo->op1} <br>
						<input type=\"radio\" name=\"reactivo {$contador}\" value=2 required> {$reactivo->op2} <br>
						<input type=\"radio\" name=\"reactivo {$contador}\" value=3 required> {$reactivo->op3} <br>
						<input type=\"radio\" name=\"reactivo {$contador}\" value=4 required> {$reactivo->op4} <br>
					</div>";*/
?>
コード例 #21
0
ファイル: Monitoring.php プロジェクト: C0l0ch0/BPV_WAU
                            </div>
                            <h4 class="panel-title">Data Table - Default</h4>
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table id="data-table" class="table table-striped table-bordered">
                                    <thead>
                                        <tr>
                                            <th>Nombre del Servicio</th>
											<th>Detalle del servicio</th>
											<th>Status</th>
                                        </tr>
                                    </thead>
                                    <tbody>';
$result = odbc_exec($conexión, " select *\r\n\t\t\t\t\t\t\t\tFROM    \r\n\t\t\t\t\t\t\t\tOPENQUERY([192.168.3.11], 'EXEC WauReports.dbo.[GetMonitorService]')");
while ($r = odbc_fetch_object($result)) {
    $body = $body . "<tr><td>";
    if (strlen($r->name) > 30) {
        $body = $body . substr($r->name, 0, 30) . "</td><td >" . $r->current_message;
    } else {
        $body = $body . $r->name . "</td><td >" . $r->current_message;
    }
    $body = $body . "</td><td>\r\n\t\t\t\t\t\t<span class=\"label-default label label-danger\">Error</span>\r\n\t\t\t\t\t</td></tr>";
}
$body = $body . '
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <!-- end panel -->
コード例 #22
0
 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @param	string	$class_name
  * @return	object
  */
 protected function _fetch_object($class_name = 'stdClass')
 {
     $row = odbc_fetch_object($this->result_id);
     if ($class_name === 'stdClass' or !$row) {
         return $row;
     }
     $class_name = new $class_name();
     foreach ($row as $key => $value) {
         $class_name->{$key} = $value;
     }
     return $class_name;
 }
コード例 #23
0
 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @access	private
  * @return	object
  */
 function _fetch_object()
 {
     return odbc_fetch_object($this->result_id);
 }
コード例 #24
0
 private function Find_Details()
 {
     global $ODBC;
     $ODBC_Q = $ODBC->query("SELECT NAME, ID, CATEGORIA, TP, X, Y, DUR, LVL, RF, JH, Socket, ANC, SetItem1, SetItem2, price, priceLevel, priceOption, priceSkill, priceLuck, priceAncient, priceOptExc, priceJh, priceRefine, priceSocket, insertShop, maxOptExcSel FROM Items WHERE Number='" . $this->ProductID . "'");
     $ODBC_R = odbc_fetch_object($ODBC_Q);
     require "modules/sockets.lib.php";
     if ($ODBC_R->Socket == 0 && ($socketLib["notSocket"] != $this->Item_Socket_Slot_1_Option || $socketLib["notSocket"] != $this->Item_Socket_Slot_2_Option || $socketLib["notSocket"] != $this->Item_Socket_Slot_3_Option || $socketLib["notSocket"] != $this->Item_Socket_Slot_4_Option || $socketLib["notSocket"] != $this->Item_Socket_Slot_5_Option)) {
         exit(Print_error("<ul><li>Desculpe, esse item n&atilde;o suporta socket.</li></ul>"));
     }
     if ($this->Item_Level > constant("LOCK_MAX_LEVEL")) {
         exit(Print_error("<ul><li>Desculpe, o level m&aacute;ximo permitido por item &eacute; " . constant("LOCK_MAX_LEVEL") . ".</li></ul>"));
     }
     if ($ODBC_R->LVL != "NO" && $ODBC_R->LVL != "SN" && $ODBC_R->LVL != $this->Item_Level) {
         exit(Print_error("<ul><li>Desculpe, o level permitido para esse item &eacute; " . $ODBC_R->LVL . ".</li></ul>"));
     }
     if (LOCK_REPEAT_SOCKET == true) {
         $tmpSockCheck = array();
         if ($this->Item_Socket_Slot_1 == "true" && $this->Item_Socket_Slot_1_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_1_Option != $socketLib['emptySocket']) {
             $tmpSockCheck[] = $this->Item_Socket_Slot_1_Option;
         }
         if ($this->Item_Socket_Slot_2 == "true" && $this->Item_Socket_Slot_2_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_2_Option != $socketLib['emptySocket']) {
             $tmpSockCheck[] = $this->Item_Socket_Slot_2_Option;
         }
         if ($this->Item_Socket_Slot_3 == "true" && $this->Item_Socket_Slot_3_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_3_Option != $socketLib['emptySocket']) {
             $tmpSockCheck[] = $this->Item_Socket_Slot_3_Option;
         }
         if ($this->Item_Socket_Slot_4 == "true" && $this->Item_Socket_Slot_4_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_4_Option != $socketLib['emptySocket']) {
             $tmpSockCheck[] = $this->Item_Socket_Slot_4_Option;
         }
         if ($this->Item_Socket_Slot_5 == "true" && $this->Item_Socket_Slot_5_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_5_Option != $socketLib['emptySocket']) {
             $tmpSockCheck[] = $this->Item_Socket_Slot_5_Option;
         }
         $newCheck = array_unique($tmpSockCheck);
         if (sizeof($newCheck) != sizeof($tmpSockCheck)) {
             exit(Print_error("<ul><li>Desculpe, n&atilde;o &eacute; permitida a repeti&ccedil;&atilde;o de op&ccedil;&otilde;es socket.</li></ul>"));
         }
     }
     if (LOCK_REPEAT_CATEGORIE_SOCKET == true) {
         $checkRepeatSocketType['Fire'] = 0;
         $checkRepeatSocketType['Water'] = 0;
         $checkRepeatSocketType['Ice'] = 0;
         $checkRepeatSocketType['Wind'] = 0;
         $checkRepeatSocketType['Lightning'] = 0;
         $checkRepeatSocketType['Ground'] = 0;
         for ($i = 1; $i < 6; $i++) {
             if ($i == 1) {
                 if ($this->Item_Socket_Slot_1_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_1_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             if ($i == 2) {
                 if ($this->Item_Socket_Slot_2_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_2_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             if ($i == 3) {
                 if ($this->Item_Socket_Slot_3_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_3_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             if ($i == 4) {
                 if ($this->Item_Socket_Slot_4_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_4_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             if ($i == 5) {
                 if ($this->Item_Socket_Slot_5_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_5_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             eval("\$socketId = \$this->Item_Socket_Slot_" . $i . "_Option % 50;");
             if (SOCKET_USE_LIB == 1) {
                 $socketId -= 1;
             }
             //Sistema da SCF / SCFMT (MuMaker) precisa de -1 no numero
             if ($socketId >= 0 && $socketId <= 9) {
                 $checkRepeatSocketType['Fire'] += 1;
             } elseif ($socketId >= 10 && $socketId <= 15) {
                 $checkRepeatSocketType['Water'] += 1;
             } elseif ($socketId >= 16 && $socketId <= 20) {
                 $checkRepeatSocketType['Ice'] += 1;
             } elseif ($socketId >= 21 && $socketId <= 28) {
                 $checkRepeatSocketType['Wind'] += 1;
             } elseif ($socketId >= 29 && $socketId <= 35) {
                 $checkRepeatSocketType['Lightning'] += 1;
             } elseif ($socketId >= 36 && $socketId <= 46) {
                 //Até 46 por garantia
                 $checkRepeatSocketType['Ground'] += 1;
             }
         }
         foreach ($checkRepeatSocketType as $checkTmp) {
             if ($checkTmp > 1) {
                 exit(Print_error("<ul><li>Desculpe, n&atilde;o &eacute; permitida a repeti&ccedil;&atilde;o das categorias das op&ccedil;&otilde;es sockets.</li></ul>"));
             }
         }
     }
     /*
     Sets & Shields = Water, Wind, Earth
     Armas = Fire, Ice, Lightning
     */
     if ($ODBC_R->Socket == 1) {
         switch ($ODBC_R->CATEGORIA) {
             //None: -1, Fire: 1, Water: 2, Ice: 3, Wind: 4, Lightning: 5, Ground/Earth: 6
             case "Armors":
                 $typesSockets = array(2, 4, 6);
                 break;
             case "Axes":
                 $typesSockets = array(1, 3, 5);
                 break;
             case "Boots":
                 $typesSockets = array(2, 4, 6);
                 break;
             case "Bows":
                 $typesSockets = array(1, 3, 5);
                 break;
             case "CrossBows":
                 $typesSockets = array(1, 3, 5);
                 break;
             case "Gloves":
                 $typesSockets = array(2, 4, 6);
                 break;
             case "Helms":
                 $typesSockets = array(2, 4, 6);
                 break;
             case "Maces":
                 $typesSockets = array(1, 3, 5);
                 break;
             case "Pants":
                 $typesSockets = array(2, 4, 6);
                 break;
             case "Scepters":
                 $typesSockets = array(1, 3, 5);
                 break;
             case "Shields":
                 $typesSockets = array(2, 4, 6);
                 break;
             case "Spears":
                 $typesSockets = array(1, 3, 5);
                 break;
             case "Staffs":
                 $typesSockets = array(1, 3, 5);
                 break;
             case "Swords":
                 $typesSockets = array(1, 3, 5);
                 break;
             default:
                 $typesSockets = null;
         }
         $ignoreCheck = 0;
         for ($iSocketCheck = 1; $iSocketCheck < 6; $iSocketCheck++) {
             if ($iSocketCheck == 1) {
                 if ($this->Item_Socket_Slot_1_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_1_Option == $socketLib['emptySocket']) {
                     $ignoreCheck++;
                     continue;
                 }
             }
             if ($iSocketCheck == 2) {
                 if ($this->Item_Socket_Slot_2_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_2_Option == $socketLib['emptySocket']) {
                     $ignoreCheck++;
                     continue;
                 }
             }
             if ($iSocketCheck == 3) {
                 if ($this->Item_Socket_Slot_3_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_3_Option == $socketLib['emptySocket']) {
                     $ignoreCheck++;
                     continue;
                 }
             }
             if ($iSocketCheck == 4) {
                 if ($this->Item_Socket_Slot_4_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_4_Option == $socketLib['emptySocket']) {
                     $ignoreCheck++;
                     continue;
                 }
             }
             if ($iSocketCheck == 5) {
                 if ($this->Item_Socket_Slot_5_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_5_Option == $socketLib['emptySocket']) {
                     $ignoreCheck++;
                     continue;
                 }
             }
             if ($typesSockets == null) {
                 exit(Print_error("<ul><li>Desculpe, a categoria desse item n&atilde;o suporta socket.</li></ul>"));
             }
             eval("\$socketId = \$this->Item_Socket_Slot_" . $iSocketCheck . "_Option % 50;");
             if (isset($socketLib["socketTypeNumber"][$typesSockets[0]][$socketId]) == false && isset($socketLib["socketTypeNumber"][$typesSockets[1]][$socketId]) == false && isset($socketLib["socketTypeNumber"][$typesSockets[2]][$socketId]) == false) {
                 exit("<ul><li>Desculpe, a categoria desse item n&atilde;o suporta o socket selecionado.</li></ul>");
             }
         }
     }
     if (LOCK_REPEAT_SLOT_SOCKET == true) {
         $checkTmp = 0;
         if ($this->Item_Socket_Slot_1_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_1_Option != $socketLib['emptySocket']) {
             if ($this->Item_Socket_Slot_1_Option < 0 || $this->Item_Socket_Slot_1_Option > 49) {
                 $checkTmp = 1;
             }
         }
         if ($this->Item_Socket_Slot_2_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_2_Option != $socketLib['emptySocket']) {
             if ($this->Item_Socket_Slot_2_Option < 50 || $this->Item_Socket_Slot_2_Option > 99) {
                 $checkTmp = 1;
             }
         }
         if ($this->Item_Socket_Slot_3_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_3_Option != $socketLib['emptySocket']) {
             if ($this->Item_Socket_Slot_3_Option < 100 || $this->Item_Socket_Slot_3_Option > 149) {
                 $checkTmp = 1;
             }
         }
         if ($this->Item_Socket_Slot_4_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_4_Option != $socketLib['emptySocket']) {
             if ($this->Item_Socket_Slot_4_Option < 150 || $this->Item_Socket_Slot_4_Option > 199) {
                 $checkTmp = 1;
             }
         }
         if ($this->Item_Socket_Slot_5_Option != $socketLib['notSocket'] && $this->Item_Socket_Slot_5_Option != $socketLib['emptySocket']) {
             if ($this->Item_Socket_Slot_5_Option < 200 || $this->Item_Socket_Slot_5_Option > 249) {
                 $checkTmp = 1;
             }
         }
         if ($checkTmp == 1) {
             exit(Print_error("<ul><li>Desculpe, alguma op&ccedil;&atilde;o socket selecionada n&atilde;o faz parte do slot em qual foi colocada.</li></ul>"));
         }
     }
     if (LOCK_REPEAT_SOCKET_TYPE == true) {
         $checkRepeatSocketType = array();
         for ($i = 1; $i < 6; $i++) {
             if ($i == 1) {
                 if ($this->Item_Socket_Slot_1_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_1_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             if ($i == 2) {
                 if ($this->Item_Socket_Slot_2_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_2_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             if ($i == 3) {
                 if ($this->Item_Socket_Slot_3_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_3_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             if ($i == 4) {
                 if ($this->Item_Socket_Slot_4_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_4_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             if ($i == 5) {
                 if ($this->Item_Socket_Slot_5_Option == $socketLib['notSocket'] || $this->Item_Socket_Slot_5_Option == $socketLib['emptySocket']) {
                     continue;
                 }
             }
             eval("\$checkRepeatSocketType[] = \$this->Item_Socket_Slot_" . $i . "_Option % 50;");
         }
         $newCheck = array_unique($checkRepeatSocketType);
         if (sizeof($newCheck) != sizeof($checkRepeatSocketType)) {
             exit(Print_error("<ul><li>Desculpe, n&atilde;o &eacute; permitida a repeti&ccedil;&atilde;o de op&ccedil;&otilde;es sockets do mesmo tipo.</li></ul>"));
         }
     }
     if (LOCK_ANCIENT_AND_EXCELLENT == true) {
         $tempOptExcCheck = 0;
         if ($this->Item_OpExc_1 == 'true') {
             $tempOptExcCheck++;
         }
         if ($this->Item_OpExc_2 == 'true') {
             $tempOptExcCheck++;
         }
         if ($this->Item_OpExc_3 == 'true') {
             $tempOptExcCheck++;
         }
         if ($this->Item_OpExc_4 == 'true') {
             $tempOptExcCheck++;
         }
         if ($this->Item_OpExc_5 == 'true') {
             $tempOptExcCheck++;
         }
         if ($this->Item_OpExc_6 == 'true') {
             $tempOptExcCheck++;
         }
         if ($tempOptExcCheck > 0 && $this->Item_Ancient > 0) {
             exit(Print_error("<ul><li>Desculpe, op&ccedil;&otilde;es excelentes n&atilde;o s&atilde;o permitidas com ancient.</li></ul>"));
         }
     }
     if (LOCK_SOCKET_AND_HARMONY == true) {
         if (($this->Item_Socket_Slot_1 == "true" || $this->Item_Socket_Slot_2 == "true" || $this->Item_Socket_Slot_3 == "true" || $this->Item_Socket_Slot_4 == "true" || $this->Item_Socket_Slot_5 == "true") && $this->Item_JH != "00") {
             exit(Print_error("<ul><li>Desculpe, op&ccedil;&otilde;es sockets n&atilde;o s&atilde;o permitidas com harmony.</li></ul>"));
         }
     }
     if ($ODBC_R->ANC == 0 && $this->Item_Ancient > 0) {
         exit(Print_error("<ul><li>Desculpe, esse item n&atilde;o suporta ancient.</li></ul>"));
     }
     switch ($this->Item_Ancient) {
         case 1:
             if ($ODBC_R->SetItem1 == "NO") {
                 exit(Print_error("<ul><li>Desculpe, esse item n&atilde;o suporta o ancient selecionado.</li></ul>"));
             }
             break;
         case 2:
             if ($ODBC_R->SetItem2 == "NO") {
                 exit(Print_error("<ul><li>Desculpe, esse item n&atilde;o suporta o ancient selecionado.</li></ul>"));
             }
             break;
     }
     if ($ODBC_R->JH == 0 && $this->Item_JH != 0) {
         exit(Print_error("<ul><li>Desculpe, esse item n&atilde;o suporta harmony.</li></ul>"));
     }
     if ($ODBC_R->RF == 0 && $this->Item_Refine != "false") {
         exit(Print_error("<ul><li>Desculpe, esse item n&atilde;o suporta refine.</li></ul>"));
     }
     if ((int) $ODBC_R->insertShop == 0) {
         exit(Print_error("<ul><li>Desculpe, esse produto n&atilde;o foi cadastrado em nosso shopping.</li></ul>"));
     }
     $this->NAME = $ODBC_R->NAME;
     $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->LVL = $ODBC_R->LVL;
     $this->RF = $ODBC_R->RF;
     $this->JH = $ODBC_R->JH;
     $this->Price = $ODBC_R->price;
     $this->Price_Level = $ODBC_R->priceLevel;
     $this->Price_Adicional = $ODBC_R->priceOption;
     $this->Price_Skill = $ODBC_R->priceSkill;
     $this->Price_Luck = $ODBC_R->priceLuck;
     $this->Price_Ancient = $ODBC_R->priceAncient;
     $this->Price_OpExc = $ODBC_R->priceOptExc;
     $this->Price_JH = $ODBC_R->priceJh;
     $this->Price_Refine = $ODBC_R->priceRefine;
     $this->Price_Socket = $ODBC_R->priceSocket;
     $this->maxOptExcSel = $ODBC_R->maxOptExcSel;
 }
コード例 #25
0
ファイル: evaluacion.php プロジェクト: hansphp/examenes
<div class="container">
      <!-- Main component for a primary marketing message or call to action -->
      <div>
        <h1>Evaluación</h1>
        <hr>
       
        <?php 
$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['materia']} AND Clases.num_cuenta = {$_GET['cuenta']}";
if ($rs_access = odbc_exec($conn_access, $ssql)) {
    $encuesta = odbc_fetch_object($rs_access);
} else {
    echo "Error al ejecutar la sentencia SQL";
}
$ssql = "SELECT Respuestas.num_cuenta, Respuestas.respuesta, Preguntas.id_encuesta, Preguntas.id_pregunta, Preguntas.pregunta, Preguntas.opcion_1, Preguntas.opcion_2, Preguntas.opcion_3, Preguntas.opcion_4, Preguntas.respuesta_correcta\nFROM 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 NOT NULL AND Respuestas.num_cuenta = {$_GET['cuenta']}";
if ($rs_access = odbc_exec($conn_access, $ssql)) {
    while ($preguntas[] = odbc_fetch_object($rs_access)) {
    }
    array_pop($preguntas);
} else {
    echo "Error al ejecutar la sentencia SQL";
}
if (empty($preguntas)) {
    echo "No disponible";
} else {
    $i = 0;
    $calificacion = 0;
    foreach ($preguntas as $pregunta) {
        $i++;
        echo "<hr><div>\n\t\t\t\t\t   \t\t<p>" . utf8_encode($pregunta->pregunta) . " <b>{$i}</b></p>\n\t\t\t\t\t\t\tOpciones:<br>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id_pregunta\" value=\"{$pregunta->id_pregunta}\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id_encuesta\" value=\"{$pregunta->id_encuesta}\">\n\t\t\t\t\t\t\t<input type=\"radio\" onClick=\"reactivo.submit();\" name=\"respuesta_{$pregunta->id_pregunta}\" " . ($pregunta->respuesta == 1 ? 'checked' : '') . " value=1 required>" . utf8_encode($pregunta->opcion_1) . "<br>\n\t\t\t\t\t\t\t<input type=\"radio\" onClick=\"reactivo.submit();\" name=\"respuesta_{$pregunta->id_pregunta}\" " . ($pregunta->respuesta == 2 ? 'checked' : '') . "value=2 required>" . utf8_encode($pregunta->opcion_2) . "<br>\n\t\t\t\t\t\t\t<input type=\"radio\" onClick=\"reactivo.submit();\" name=\"respuesta_{$pregunta->id_pregunta}\" " . ($pregunta->respuesta == 3 ? 'checked' : '') . "value=3 required>" . utf8_encode($pregunta->opcion_3) . "<br>\n\t\t\t\t\t\t\t<input type=\"radio\" onClick=\"reactivo.submit();\" name=\"respuesta_{$pregunta->id_pregunta}\"" . ($pregunta->respuesta == 4 ? 'checked' : '') . " value=4 required>" . utf8_encode($pregunta->opcion_4) . "<br>\n\t\t\t\t\t\t</div>";
        if ($pregunta->respuesta == $pregunta->respuesta_correcta) {
            echo "<b>Correcto</b>";
コード例 #26
0
ファイル: alumnos.php プロジェクト: hansphp/examenes
    }
}
?>
<div class="container">
      <!-- Main component for a primary marketing message or call to action -->
      <div>
        <h1>Alumnos <a type="button" class="btn btn-sm btn-success" data-toggle="modal" data-target="#exampleModal" data-cuenta="" data-nombre="" data-apellido="">Agregar</a></h1>
        <hr>
        <table id="tableAlumnos" class="display" cellspacing="0" width="100%">
        <thead><tr><th>Cuenta</th><th>Nombre</th><th>Apellido</th><th width="100px">Opciones</th></tr></thead>
        <tfoot><tr><th>Cuenta</th><th>Nombre</th><th>Apellido</th><th>Opciones</th></tr></tfoot>
        <tbody>
        <?php 
$ssql = "select * from Alumnos";
if ($rs_access = odbc_exec($conn_access, $ssql)) {
    while ($fila = odbc_fetch_object($rs_access)) {
        echo "<tr><td>{$fila->num_cuenta}</td><td>" . utf8_encode($fila->Nombre) . "</td><td>" . utf8_encode($fila->Apellido) . "</td><td><a type=\"button\" class=\"btn btn-xs btn-primary\" data-toggle=\"modal\" data-target=\"#exampleModal\" data-cuenta=\"{$fila->num_cuenta}\" data-nombre=\"" . utf8_encode($fila->Nombre) . "\" data-apellido=\"" . utf8_encode($fila->Apellido) . "\">Editar</a></td></tr>";
    }
} else {
    echo "Error al ejecutar la sentencia SQL";
}
?>
        </tbody></table>
        <!--        
        <p>
          <a class="btn btn-lg btn-primary" href="../../components/#navbar" role="button">View navbar docs &raquo;</a>
        </p>
        -->
      </div>

    </div> <!-- /container -->
コード例 #27
0
*/
include "php/configBATCH.php";
global $DB;
$DB = str_replace("\"", "", $DB);
$connection_string = odbc_connect($DB, "", "");
if ($argv[1] != "") {
    $yyyy = $argv[1];
} else {
    $yyyy = date("Y");
}
//$yyyy='2014';
$q = "exec usp_USI_getCashinByTPACheckNumber '" . $yyyy . "'";
$process = odbc_exec($connection_string, $q);
$month_array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
$count = 0;
while ($row = odbc_fetch_object($process)) {
    $arr[] = $row;
    $count++;
}
//Initialize cashin and pend array with 0 values
for ($i = 0; $i < $count; $i++) {
    $hold_client = $arr[$i]->employergroup_ud;
    for ($x = 0; $x <= 12; $x++) {
        $amount_cashin[$hold_client][$x] = 0.0;
        $amount_pend[$hold_client][$x] = 0.0;
    }
}
for ($i = 0; $i < $count; $i++) {
    $hold_client = $arr[$i]->employergroup_ud;
    for ($j = 1; $j <= 12; $j++) {
        if ($arr[$i]->for_month == $j) {
コード例 #28
0
 private function Generate_Boxes_Confirmations($status)
 {
     global $tpl, $ODBC;
     $findPaymentsQuery = $ODBC->query("SELECT * FROM LogsPayments WHERE status = " . $status);
     $Result_Tpl_Temp = NULL;
     $begin = (int) ($_GET['begin'] < 0 ? 0 : $_GET['begin']);
     $records = (int) 10;
     $i = -1;
     while ($findPayments = odbc_fetch_object($findPaymentsQuery)) {
         $i++;
         if (isset($_GET['showAll']) == false) {
             if ($i < $begin || $i >= $begin + $records) {
                 continue;
             }
         }
         $findPayments->valor = str_replace("R\$", "", $findPayments->valor);
         $findPayments->valor = str_replace(" ", "", $findPayments->valor);
         $findPayments->valor = str_replace(",", ".", $findPayments->valor);
         $Result_Tpl_Temp .= "<form action=\"?cmd=" . $_GET['cmd'] . "&amp;Write=true&amp;Id=" . $findPayments->id . "\" method=\"post\" class=\"quadros\">\n                                        <em>Id:</em> <strong>" . $findPayments->id . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Login:</em> <input name=\"login\" type=\"text\" value=\"" . $findPayments->login . "\" /><br />\n\t\t\t\t\t\t\t\t\t\t<em>Total de " . GOLDNAME . ":</em> <input name=\"golds\" type=\"text\" value=\"" . $findPayments->golds . "\" /><br />\n\t\t\t\t\t\t\t\t\t\t<em>Banco:</em> <strong>" . $findPayments->banco . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Número Terminal:</em> <strong>" . $findPayments->nterminal . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Número Transferência:</em> <strong>" . $findPayments->ntransferencia . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Agência Acolhedora:</em> <strong>" . $findPayments->agencia_acolhedora . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Número Sequencia:</em> <strong>" . $findPayments->nsequencia . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>CTR:</em> <strong>" . $findPayments->ctr . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Caixa Eletrônico:</em> <strong>" . $findPayments->caixa_eletronico . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Número Envelope:</em> <strong>" . $findPayments->nenvelope . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Número Documento:</em> <strong>" . $findPayments->ndocumento . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Número Controle:</em> <strong>" . $findPayments->ncontrole . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Número Operador:</em> <strong>" . $findPayments->noperador . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Data:</em> <strong>" . $findPayments->data . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Hora:</em> <strong>" . $findPayments->hora . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Pago em:</em> <strong>" . $findPayments->pago_em . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Anexo:</em> <strong>" . (strlen($findPayments->anexo) < 2 ? "[Não enviado]" : "<a href='../" . $findPayments->anexo . "' target=\"_blank\">[Enviado (Clique para ver)]</a>") . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Comentário:</em> <strong>" . nl2br(base64_decode($findPayments->comentario)) . "</strong><br />\n\t\t\t\t\t\t\t\t\t\t<em>Valor:</em> <input name=\"valor\" type=\"text\" value=\"" . $findPayments->valor . "\" />" . ($findPayments->valor < 1 ? "&nbsp;<strong style=\"color:red;\">Atenção no valor</strong>" : "") . "<br />\n\t\t\t\t\t\t\t\t\t\t<em>Comentario ADM:</em> <textarea name=\"comentario_adm\">" . nl2br(base64_decode($findPayments->comentario_adm)) . "</textarea><br />\n\t\t\t\t\t\t\t\t\t\t<em>Novo Status:</em> <select name=\"status\"><option value=\"1\">Em andamento</option><option value=\"2\">Confirmado</option><option value=\"3\">Falso</option><option value=\"4\">Falso / Remover X " . GOLDNAME . "</option></select>\n\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" value=\"Salvar\" class=\"button\" />\n\t\t\t\t\t\t\t\t\t </form>";
     }
     $tpl->set("BOXES_CONFIRMATIONS", $Result_Tpl_Temp);
 }
コード例 #29
0
ファイル: Chargins.php プロジェクト: C0l0ch0/BPV_WAU
<?php

$user = '******';
$password = '******';
$server = '192.168.3.11';
$database = 'WauReports';
$conexión = odbc_connect("Driver={SQL Server Native Client 10.0};Server={$server};Database={$database};", $user, $password);
odbc_exec($conexión, "USE WauReports");
$body = "<div class=\"box col-md-12\">\r\n\t<div class=\"box-inner\">\r\n\t\t<div class=\"box-header well\" data-original-title=\"\">\r\n\t\t\t<h2>Servicios Monitoring</h2>\r\n\t\t</div>\r\n\t<div class=\"box-content\">\r\n\t\t<table class=\"table table-striped table-bordered bootstrap-datatable datatable responsive\" style=\"width:100%\">\r\n\t\t\t<thead>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th>Super Agregador</th>\r\n\t\t\t\t\t<th>Cobros Hoy</th>\r\n\t\t\t\t\t<th>Promedio</th>\r\n\t\t\t\t\t<th>Porcentaje</th>\r\n\t\t\t</thead>\r\n\t\t\t</tr>\r\n\t\t\t<tbody>";
$result = odbc_exec($conexión, " EXEC [GetChargesSA]");
$r = odbc_fetch_object($result);
$result2 = odbc_exec($conexión, " EXEC [GetpercentageSA]");
$r2 = odbc_fetch_object($result2);
$body = $body . "<tr><td class=\"center\"> SAMEX </td><td class=\"center\">" . $r->SAMEX . "</td><td class=\"center\">" . $r2->SAMEX . "</td><td class=\"center\">" . $r->SAMEX * 100 / $r2->SAMEX;
$body = $body . "%</td></tr>";
$body = $body . "<tr><td class=\"center\"> SAPER </td><td class=\"center\">" . $r->SAPER . "</td><td class=\"center\">" . $r2->SAPER . "</td><td class=\"center\">" . $r->SAPER * 100 / $r2->SAPER;
$body = $body . "%</td></tr>";
$body = $body . "<tr><td class=\"center\"> SANIC </td><td class=\"center\">" . $r->SANIC . "</td><td class=\"center\">" . $r2->SANIC . "</td><td class=\"center\">" . $r->SANIC * 100 / $r2->SANIC;
$body = $body . "%</td></tr>";
$body = $body . "<tr><td class=\"center\"> SAECU </td><td class=\"center\">" . $r->SAECU . "</td><td class=\"center\">" . $r2->SAECU . "</td><td class=\"center\">" . $r->SAECU * 100 / $r2->SAECU;
$body = $body . "%</td></tr>";
$body = $body . "<tr><td class=\"center\"> SAPAN </td><td class=\"center\">0</td><td class=\"center\">0</td><td class=\"center\">0";
$body = $body . "%</td></tr>";
$body = $body . "</tbody>\r\n\t\t</table>\r\n\t</div>\r\n\t</div>\r\n</div>";
echo $body;
コード例 #30
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $systems = System::all();
         foreach ($systems as $key => $system) {
             $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";
             $meas;
             $eq;
             $conn = false;
             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) {
                     $system->status = 'default';
                     $system->save();
                 }
                 if ($conn) {
                     $sysStatus = 'success';
                     $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';
                         $sysStatus = $sysStatus != $row->status && $row->status == 'warning' ? $row->status : $sysStatus;
                         $realDataMeas[$i] = $row;
                         $i++;
                     }
                     $meas = json_decode(json_encode($realDataMeas), true);
                     odbc_free_result($results);
                     $results = odbc_exec($conn, $queryEquipment2000);
                     $realDataEq = [];
                     $i = 0;
                     while ($row = json_decode(json_encode(odbc_fetch_object($results)), true)) {
                         if ($row['state_Fault'] == 1 && $sysStatus != 'error') {
                             $sysStatus = 'error';
                         }
                         if ($sysStatus != 'error' && ($row['state_InMaint'] == 1 || $row['state_MaintRQ'] == 1)) {
                             $sysStatus = 'warning';
                         }
                         if ($sysStatus != 'warning' && $sysStatus != 'error' && $row['state_OK'] == 1) {
                             $sysStatus = 'success';
                         }
                         foreach ($row as $key => $item) {
                             if ($key == "eq_name" && is_string($item)) {
                                 $row[$key] = iconv('UCS-2LE', 'UTF-8', $item);
                             }
                         }
                         $realDataEq[$i] = $row;
                         $i++;
                     }
                     $system->status = $sysStatus;
                     $system->save();
                     odbc_free_result($results);
                     odbc_close($conn);
                 }
             } 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();
                 }
                 if ($conn) {
                     $sysStatus = 'success';
                     $sql = $conn->prepare($queryMeas);
                     $sql->execute();
                     $meas = $sql->fetchAll();
                     foreach ($meas as $key => $row) {
                         $row['status'] = $row['param_name'] != 'O2' && $row['ad_limit'] && $row['value'] > $row['ad_limit'] ? 'warning' : 'success';
                         $sysStatus = $sysStatus != $row['status'] && $row['status'] == 'warning' ? $row['status'] : $sysStatus;
                         $meas[$key] = $row;
                     }
                     $sql = $conn->prepare($queryEquipment);
                     $sql->execute();
                     $eq = $sql->fetchAll();
                     foreach ($eq as $key => $row) {
                         if ($row['state_Fault'] == 1 && $sysStatus != 'error') {
                             $sysStatus = 'error';
                         }
                         if ($sysStatus != 'error' && ($row['state_InMaint'] == 1 || $row['state_MaintRQ'] == 1)) {
                             $sysStatus = 'warning';
                         }
                         if ($sysStatus != 'warning' && $sysStatus != 'error' && $row['state_OK'] == 1) {
                             $sysStatus = 'success';
                         }
                         $eq[$key] = $row;
                     }
                     $system->status = $sysStatus;
                     $system->save();
                     $conn = null;
                 }
             }
         }
     })->everyMinute();
 }