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


PHP mssql_fetch_array函数代码示例

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


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

示例1: login

function login($email, $password)
{
    /* query db and set session variables, as necessary */
    $theQuery = "SELECT * FROM users WHERE email = '" . $email . "' AND userpassword = '" . $password . "'";
    $theData = queryG0($theQuery);
    if (!mssql_num_rows($theData)) {
        echo 'No records found';
    } else {
        while ($row = mssql_fetch_array($query)) {
            $thisEmail = $row['username'];
            $thisPassword = $row['userpassword'];
            $thisID = $row['id'];
            $thisAccessLevel = $row['accesslevel'];
        }
        if ($email == $thisEmail && $password == $thisPassword) {
            createSessionVariables($thisID, $thisAccessLevel);
            /* Redirect to admin landing page */
            header("Location: " . $GLOBALS['adminLandingPage']);
        } else {
            clearSessionVariables();
            /* Redirect to login with error msg */
            header("Location: " . $GLOBALS['loginWithError']);
        }
    }
}
开发者ID:rhammonds1,项目名称:tejasapplication,代码行数:25,代码来源:global-functions.php

示例2: Login

    function Login()
    {
        $link = Conectarse();
        $consulta = "SELECT * FROM [022BDCOMUN].DBO.USUARIOS\r\nWHERE usuario='{$this->user}' AND contrasena='{$this->pass}' AND idtipousuario=2 ";
        $resultado = mssql_query($consulta, $link) or die(mssql_error());
        $fila = mssql_fetch_array($resultado);
        if (!$fila[0]) {
            echo '<script>
alert("Usuario o Password errados, por favor verifique.")
self.location = "/adm-reserva/"
</script>';
        } else {
            if (!isset($_SESSION)) {
                @session_start();
            }
            $_SESSION['id_usuario'] = $fila['id_usuario'];
            $_SESSION['nombres'] = $fila['nombres'];
            $_SESSION['apellidos'] = $fila['apellidos'];
            $_SESSION['starsoft'] = $fila['starsoft'];
            $_SESSION['idempresa'] = $fila['idempresa'];
            $_SESSION['idarea'] = $fila['idarea'];
            $_SESSION['aud_jefe'] = $fila['aud_jefe'];
            header("Location: /adm-reserva/home");
        }
    }
开发者ID:Codrise,项目名称:adm-reservas,代码行数:25,代码来源:Acceso.php

示例3: get_ASPPlayground_members_list

 /**
  * Returns the user_id => username array
  *
  * @param	object	databaseobject	The database object to run the query against
  * @param	string	mixed			Table database type
  * @param	string	mixed			The prefix to the table name i.e. 'vb3_'
  * @param	int		mixed			Start point
  * @param	int		mixed			End point
  *
  * @return	array
  */
 function get_ASPPlayground_members_list(&$Db_object, &$databasetype, &$tableprefix, &$start, &$per_page)
 {
     $return_array = array();
     // Check that there is not a empty value
     if (empty($per_page)) {
         return $return_array;
     }
     if ($databasetype == 'mssql') {
         $count = mssql_fetch_array(mssql_query("SELECT count(*) FROM {$tableprefix}Members"));
         $internal = $start_at + $per_page;
         if ($internal > intval($count[0])) {
             $per_page = abs($start_at - intval($count[0]));
             $internal = intval($count[0]);
         }
         $sql = "SELECT \tMem,\n\t\t\t\t\t\t\tLogin\n\t\t\t\t\tFROM {$tableprefix}Members WHERE Mem\n\t\t\t\t\t\tIN(SELECT TOP {$per_page} Mem\n\t\t\t\t\t\t\tFROM (SELECT TOP {$internal} Mem FROM {$tableprefix}Members ORDER BY Mem)\n\t\t\t\t\t\tA ORDER BY Mem DESC)\n\t\t\t\t\tORDER BY Mem";
         $user_list = $Db_object->query($sql);
         while ($user = $Db_object->fetch_array($user_list)) {
             if ($user['Mem'] != -1) {
                 $return_array["{$user['Mem']}"] = $user['Login'];
             }
         }
         return $return_array;
     } else {
         return false;
     }
 }
开发者ID:arikpeterson,项目名称:vbimpex,代码行数:37,代码来源:000.php

示例4: getRecord

 /**
  * mengambil record dari sebuah tabel dalam bentuk array
  * @param sqlString ini sql string
  * @param offset 
  *
  */
 public function getRecord($sqlString, $offset = 1)
 {
     // 		echo $sqlString;
     if (mssql_num_rows($result = $this->query($sqlString)) >= 1) {
         if ($offset == '') {
             $offset = 1;
         }
         $ft = $this->getFieldTable("field");
         // 			print_r($ft);
         $countFieldTable = count($ft);
         $counter = 1;
         while ($row = mssql_fetch_array($result)) {
             //echo $row . "<br>";
             $tempRecord['no'] = $offset;
             for ($i = 0; $i < $countFieldTable; $i++) {
                 $tempRecord[$ft[$i]] = trim($row[$ft[$i]]);
             }
             $ListRecord[$counter] = $tempRecord;
             $counter++;
             $offset++;
         }
         // 	 		print_r($ListRecord);
         $this->ListRecord = $ListRecord;
     } else {
         $this->ListRecord = array();
     }
     return $this->ListRecord;
 }
开发者ID:silotester,项目名称:silo,代码行数:34,代码来源:MSSQL.php

示例5: get_userinfo

 public function get_userinfo($userid, $password)
 {
     //select the database
     mssql_select_db($this->dbname, $this->dbcon);
     //SQL Select statement
     $sqlselect = "SELECT userid,password,userright,ws,ws_name,location,fullname,gender,position,member_since,avatar FROM pospass WITH (NOLOCK) WHERE userid ='" . $userid . "';";
     //Run the SQL query
     $sqlquery = mssql_query($sqlselect);
     $string_result = '{"uservalidation":"false"}';
     //$login = new Blowfish();
     //$encpassword = $login->genpwd($password);
     $encpassword = $this->encryptIt($password);
     while ($result = mssql_fetch_array($sqlquery)) {
         //$verify = $login->verify_hash($password, $result["password"]);
         if ($encpassword == $result["password"]) {
             $xml = new XMLHandler(LOCAL_DIR . "/etc/greenSys.config.xml");
             $_SESSION["activedb"] = (string) $xml->Child("locationmapping", $result["location"]);
             $_SESSION["user-id"] = (string) $userid;
             $_SESSION["user-ws"] = (string) $result["ws"];
             $_SESSION["ws-name"] = (string) $result["ws_name"];
             $_SESSION["user-fullname"] = (string) $result["fullname"];
             $_SESSION["user-gender"] = (string) $result["gender"];
             $_SESSION["user-position"] = (string) $result["position"];
             $_SESSION["user-member_since"] = (string) $result["member_since"];
             $_SESSION["user-avatar"] = (string) $result["avatar"];
             //session_write_close();
             //setcookie("user-id",(string)$userid, time()+3600*24);
             $string_result = '{"uservalidation":"true","fullname":"' . $result["fullname"] . '","gender":"' . $result["gender"] . '","position":"' . $result["position"] . '","member_since":"' . $result["member_since"] . '","avatar":"' . $result["avatar"] . '"}';
         }
     }
     return $string_result;
 }
开发者ID:edosatriani,项目名称:greensys,代码行数:32,代码来源:login_Model.php

示例6: getProductos

function getProductos()
{
    $myServer = "172.30.5.49";
    $myUser = "UsrPsg";
    $myPass = "PsGcRm1402*LaU+";
    $myDB = "LAUMAYER";
    $dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on {$myServer}");
    $selected = mssql_select_db($myDB, $dbhandle) or die("Couldn't open database {$myDB}");
    //Realiza el query en la base de datos
    $mysqli = makeSqlConnection();
    //$sql = "SELECT * FROM psg_productos a LEFT JOIN psg_productos_cstm ac ON a.id = ac.id_c";
    $sql = "SELECT id,name FROM psg_productos where deleted ='0'";
    $res = $mysqli->query($sql);
    $rows = array();
    while ($r = mysqli_fetch_assoc($res)) {
        $obj = (object) $r;
        $querySaldo = "Select dbo.F_Saldo_Bodega_Informe(Year(GETDATE()),MONTH(GETDATE()),'" . $r['id'] . "','BODPRDCTO','T','C') as Saldo";
        $result = mssql_query($querySaldo);
        if ($row = mssql_fetch_array($result)) {
            $obj->saldo = $row['Saldo'];
        }
        $a = (array) $obj;
        $rows[] = $a;
    }
    mssql_close($dbhandle);
    if (empty($rows)) {
        return '{"results" :[]}';
    } else {
        //Convierte el arreglo en json y lo retorna
        $temp = json_encode(utf8ize($rows));
        return '{"results" :' . $temp . '}';
    }
}
开发者ID:ekutor,项目名称:hermes,代码行数:33,代码来源:getProductos.php

示例7: buscarUsuarios

 function buscarUsuarios()
 {
     $this->usuarios = array();
     // maximo por pagina
     $limit = $_GET["s"];
     // pagina pedida
     $pag = (int) $_GET["p"];
     if ($pag < 1) {
         $pag = 1;
     }
     $offset = ($pag - 1) * $limit;
     $limit = $limit * $pag;
     if (isset($_GET['sort'])) {
         switch ($_GET['sort']) {
             case 1:
                 $order = "FECHA_R DESC ";
                 break;
         }
     }
     $plan = $_GET['IDPlan'];
     $sql = "WITH CTE AS\n(\n  SELECT  A.PK1 AS ID,U.IMAGEN,U.PK1,U.NOMBRE,U.APELLIDOS,U.EMAIL,U.PK_JERARQUIA,U.DISPONIBLE,A.PK_USUARIO,A.PK_POPERATIVO,A.ROL, \n     ROW_NUMBER() OVER ( ORDER BY U.FECHA_R ) AS RowNum\n  FROM PL_POPERATIVOS_ASIGNACIONES A, USUARIOS U\n  WHERE   U.PK1 = A.PK_USUARIO AND A.PK_POPERATIVO = '{$plan}' \n)\nSELECT * FROM CTE \nWHERE RowNum >= {$offset} AND RowNum < {$limit}";
     if (isset($_GET['q']) && $_GET['q'] != "") {
         $sql .= "AND (NOMBRE LIKE '%" . $_GET['q'] . "%') ";
     }
     //echo $sql;
     $result = database::executeQuery($sql);
     $total = database::getNumRows($sql);
     $this->totalnum = $total;
     while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
         $this->usuarios[] = $row;
     }
     //CALCULAMOS EL TOTAL DE PAGINAS
     $this->totalPag = ceil($total / $limit);
 }
开发者ID:maroend,项目名称:protocolos,代码行数:34,代码来源:asignaciones.model.php

示例8: dbactionAdd

 function dbactionAdd()
 {
     print "starting\n";
     if (!windowsOs()) {
         throw new lxException('mssql_is_only_on_windows', '', '');
     }
     print "\n mantu\n";
     $req = mssql_connect("localhost,1433");
     if (!$req) {
         throw new lxException('MsSql Connection is Failed', '', '');
     }
     $loginname = $this->main->username;
     $dbname = $loginname;
     print "\n" . $loginname;
     $pass = $this->main->dbpassword;
     print "\n" . $pass;
     $result = mssql_query("select loginname from syslogins where loginname='{$loginname}'");
     $row = mssql_fetch_array($result, MSSQL_ASSOC);
     if (!$row) {
         mssql_query("sp_addlogin '{$loginname}', '{$pass}'");
     } else {
         print "user already exist by this name\n";
         throw new Exception("couldn't create {$loginname}--already user exist\n");
     }
     print "executing\n";
     try {
         mssql_query("create database {$dbname}");
     } catch (Exception $e) {
         print "\n ERROR: Create database";
     }
     mssql_query("use  {$dbname}");
     mssql_query("sp_adduser '{$loginname}', '{$loginname}', 'db_owner'");
     mssql_close();
     print "\ndone\n";
 }
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:35,代码来源:mssqldb__mssqllib.php

示例9: executeQuery

 private function executeQuery()
 {
     $return = false;
     if ($this->queryType == 'other') {
         if (mssql_query($this->query, $this->link) === true) {
             $return = true;
             $this->error = mssql_get_last_message();
         }
     } else {
         if ($result = mssql_query($this->query, $this->link)) {
             // Conteo de registros
             if ($this->queryType == 'insert' || $this->queryType == 'update' || $this->queryType == 'delete') {
                 $this->numRows = mssql_rows_affected($this->link);
                 $return = true;
             } else {
                 $this->numRows = mssql_num_rows($result);
                 $fetchType = MSSQL_NUM;
                 if ($this->queryReturn == 'assoc') {
                     $fetchType = MSSQL_ASSOC;
                 } elseif ($this->queryReturn == 'both') {
                     $fetchType = MSSQL_BOTH;
                 }
                 $return = array();
                 while ($row = mssql_fetch_array($result, $fetchType)) {
                     array_push($return, $row);
                 }
             }
             $this->error = mssql_get_last_message();
             mssql_free_result($result);
         } else {
             $this->error = mssql_get_last_message();
         }
     }
     return $return;
 }
开发者ID:foreverphp,项目名称:framework,代码行数:35,代码来源:MSSQLEngine.php

示例10: SQLOutput

 public function SQLOutput()
 {
     $result = mssql_query($this->SQL);
     while ($row = mssql_fetch_array($result)) {
         echo "<tr><td>" . $row["id"] . "</td><td>" . $row["name"] . "</td><tr>";
     }
 }
开发者ID:Tacit007,项目名称:Tacit007-php-framework,代码行数:7,代码来源:SQL.php

示例11: fnFrete

 public function fnFrete($tipoFrete = null, $idPedido = null)
 {
     $idPedido = sqlvalue($idPedido, false);
     $tipoFrete = sqlvalue($tipoFrete, false);
     if (isset($tipoFrete) and isset($idPedido)) {
         $queryPeso = "SELECT \r\n\t\t\t\t\t\t\t    ROUND((SUM((IFNULL(PROD.ALTURA_CM,0)*PEIT.QUANTIDADE))*SUM((IFNULL(PROD.LARGURA_CM,0)*PEIT.QUANTIDADE))*SUM((IFNULL(PROD.PROFUNDIDADE_CM,0)*PEIT.QUANTIDADE)))/6000,2) TOTAL_PESO_CUBICO,\r\n\t\t\t\t\t\t\t    ROUND(SUM((IFNULL(PROD.PESO_KG,0)*PEIT.QUANTIDADE)),2) TOTAL_PESO_KG,\r\n\t\t\t\t\t\t\t    ROUND(SUM((IFNULL(PROD.ALTURA_CM,0)*PEIT.QUANTIDADE)),2) TOTAL_ALTURA,\r\n\t\t\t\t\t\t\t    ROUND(SUM((IFNULL(PROD.LARGURA_CM,0)*PEIT.QUANTIDADE)),2) TOTAL_LARGURA,\r\n\t\t\t\t\t\t\t    ROUND(SUM((IFNULL(PROD.PROFUNDIDADE_CM,0)*PEIT.QUANTIDADE)),2) TOTAL_PROFUNDIDADE,\r\n\t\t\t\t\t\t\t    PEEN.CEP_ID_CEP\t\t\t\t\t\t\t    \r\n\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t    e_PEDIDO PEDI,\r\n\t\t\t\t\t\t\t    e_PEDIDO_ITEM PEIT,\r\n\t\t\t\t\t\t\t    e_PRODUTO_COMBINACAO_ATRIBUTO_VALOR PCAV,\r\n\t\t\t\t\t\t\t    e_PRODUTO_COMBINACAO PRCO,\r\n\t\t\t\t\t\t\t    e_PRODUTO PROD,\r\n\t\t\t\t\t\t\t    e_PEDIDO_ENDERECO PEEN\r\n\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t    PEDI.ID_PEDIDO = PEIT.PEDI_ID_PEDIDO\r\n\t\t\t\t\t\t\tAND PEIT.PCAV_ID_PRODUTO_COMBINACAO_ATRIBUTO_VALOR = PCAV.ID_PRODUTO_COMBINACAO_ATRIBUTO_VALOR\r\n\t\t\t\t\t\t\tAND PCAV.PRCO_ID_PRODUTO_COMBINACAO = PRCO.ID_PRODUTO_COMBINACAO\r\n\t\t\t\t\t\t\tAND PRCO.PROD_ID_PRODUTO = PROD.ID_PRODUTO\r\n\t\t\t\t\t\t\tAND PEDI.ID_PEDIDO = " . $idPedido . "\r\n\t\t\t\t\t\t\tAND PEDI.ID_PEDIDO = PEEN.PEDI_ID_PEDIDO\r\n\t\t\t\t\t\t\tGROUP BY\r\n\t\t\t\t\t\t\t\tPEEN.CEP_ID_CEP";
         $resultQueryPeso = $mysqli->ExecutarSQL($queryPeso);
         $rowQueryPeso = @mssql_fetch_array($resultQueryPeso);
         $totalPesoCubico = number_format($rowQueryPeso["TOTAL_PESO_CUBICO"], 2, ',', '.');
         $totalPesoKg = number_format($rowQueryPeso["TOTAL_PESO_KG"], 2, ',', '.');
         $totalAltura = number_format($rowQueryPeso["TOTAL_ALTURA"], 2, ',', '.');
         $totalLargura = number_format($rowQueryPeso["TOTAL_LARGURA"], 2, ',', '.');
         $totalProfundidade = number_format($rowQueryPeso["TOTAL_PROFUNDIDADE"], 2, ',', '.');
         $cepDestino = $rowQueryPeso["CEP_ID_CEP"];
         if ($totalAltura <= 105 or $totalLargura <= 105 or $totalProfundidade <= 105) {
             /*WEBSERVICE CORREIOS*/
             $xml = @simplexml_load_file("http://ws.correios.com.br/calculador/CalcPrecoPrazo.aspx?nCdEmpresa=08132828&sDsSenha=02804744&sCepOrigem=93525240&sCepDestino=" . $cepDestino . "&nVlPeso=" . $totalPesoKg . "&nCdFormato=1&nVlComprimento=" . $totalProfundidade . "&nVlAltura=" . $totalAltura . "&nVlLargura=" . $totalLargura . "&sCdMaoPropria=n&nVlValorDeclarado=0&sCdAvisoRecebimento=n&nCdServico=" . $tipoFrete . "&nVlDiametro=0&StrRetorno=xml&nIndicaCalculo=3");
             //printr($xml);
         } else {
             $xml = "";
             $tipoFrete = ID_TIPO_FRETE_TRANSP_PADRAO;
         }
     }
     if ($xml->cServico->Codigo) {
         $valorFrete = formataPrecoInsert($xml->cServico->Valor);
         $codErro = $xml->cServico->Erro;
         $MsgErro = $xml->cServico->MsgErro;
         if ($codErro == '0') {
             $retorno = array(array("VALOR_FRETE" => $valorFrete));
             $mysqli->ExecutarSQL("UPDATE e_PEDIDO SET VALOR_FRETE = " . $valorFrete . ", TIFR_ID_TIPO_FRETE = " . $tipoFrete . " WHERE ID_PEDIDO = " . $idPedido . "");
         } else {
             $retorno = array(array("MENSAGEM_ERRO" => $MsgErro, "COD_ERRO" => $codErro));
             //printr($retorno);
         }
     } else {
         if (isset($tipoFrete)) {
             $tipoFrete = sqlvalue($tipoFrete, true);
         } else {
             $tipoFrete = "PEDI.TIFR_ID_TIPO_FRETE";
         }
         if ($totalPesoCubico > $totalPesoKg) {
             if ($totalPesoCubico > PESO_MAXIMO_CORREIOS) {
                 $adicionalTotalPesoCubico = $totalPesoCubico / PESO_MAXIMO_CORREIOS;
                 $peso = PESO_MAXIMO_CORREIOS;
                 $coluna = "IFNULL(PRUF.VALOR_FRETE, 0)*" . $adicionalTotalPesoCubico;
             } else {
                 $peso = $totalPesoCubico;
                 $coluna = "IFNULL(PRUF.VALOR_FRETE, 0)";
             }
         } else {
             $peso = $totalPesoKg;
             $coluna = "IFNULL(PRUF.VALOR_FRETE, 0)";
         }
         $query = "DECLARE @FRETE_GRATIS VARCHAR(1),\r\n\t\t\t\t\t\t\t\t@VALOR_FRETE NUMERIC(14,4),\r\n\t\t\t\t\t\t\t\t@TIPO_FRETE VARCHAR(10),\r\n\t\t\t\t\t\t\t\t@PESO_TOTAL NUMERIC(14,4)\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSET @PESO_TOTAL = " . $peso . "\r\n\t\t\t\t\t\tSET @TIPO_FRETE = " . $tipoFrete . "\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tIF(@TIPO_FRETE <> " . ID_TIPO_FRETE_TRANSP_PADRAO . ")\r\n\t\t\t\t\t\tBEGIN\r\n\t\t\t\t\t\t\tSELECT \r\n\t\t\t\t\t\t\t\t@FRETE_GRATIS = IFNULL(PRUF.FRETE_GRATIS, 'N'),\r\n\t\t\t\t\t\t\t\t@VALOR_FRETE = ROUND(" . $coluna . ",2),\r\n\t\t\t\t\t\t\t\t@TIPO_FRETE = " . $tipoFrete . "  \r\n\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\te_PEDIDO PEDI,\r\n\t\t\t\t\t\t\t\te_PEDIDO_ENDERECO PEEN,\r\n\t\t\t\t\t\t\t\te_MUNICIPIO MUNI,\r\n\t\t\t\t\t\t\t\te_CEP_PRECIFICACAO_UF PRUF\r\n\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\tPEDI.ID_PEDIDO = PEEN.PEDI_ID_PEDIDO\r\n\t\t\t\t\t\t\tAND PEDI.ID_PEDIDO = " . $idPedido . "\r\n\t\t\t\t\t\t\tAND PEEN.MUNI_ID_MUNICIPIO = MUNI.ID_MUNICIPIO\r\n\t\t\t\t\t\t\tAND PRUF.TIFR_ID_TIPO_FRETE = " . $tipoFrete . "\r\n\t\t\t\t\t\t\tAND MUNI.UNFE_ID_ESTADO = PRUF.UNFE_ID_ESTADO\r\n\t\t\t\t\t\t\tAND " . $peso . " BETWEEN PRUF.PESO_INICIAL AND PRUF.PESO_FINAL\r\n\t\t\t\t\t\t\tAND PEEN.CEP_ID_CEP BETWEEN PRUF.CEP_INICIAL AND PRUF.CEP_FINAL\r\n\t\t\t\t\t\tEND\r\n\t\t\t\t\t\tELSE\r\n\t\t\t\t\t\tBEGIN\r\n\t\t\t\t\t\t\tIF EXISTS (\r\n\t\t\t\t\t\t\t\tSELECT \r\n\t\t\t\t\t\t\t\t\t1\r\n\t\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t\te_PEDIDO PEDI,\r\n\t\t\t\t\t\t\t\t\te_PEDIDO_ENDERECO PEEN,\r\n\t\t\t\t\t\t\t\t\te_MUNICIPIO MUNI,\r\n\t\t\t\t\t\t\t\t\te_PRECIFICACAO_TRANSP PRUF\r\n\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\tPEDI.ID_PEDIDO = PEEN.PEDI_ID_PEDIDO\r\n\t\t\t\t\t\t\t\tAND PEDI.ID_PEDIDO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t\t-IFNULL(PEIT.VALOR_DESCONTO,0))*TIFR.GRIS_PERCENTUAL)/100\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND,\r\n\t\t\t\t\t\t\t\t\t@TIPO_FRETE = " . $tipoFrete . "\r\n\t\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t\te_PEDIDO PEDI,\r\n\t\t\t\t\t\t\t\t\te_PEDIDO_ENDERECO PEEN,\r\n\t\t\t\t\t\t\t\t\te_MUNICIPIO MUNI,\r\n\t\t\t\t\t\t\t\t\te_PRECIFICACAO_TRANSP PRUF,\r\n\t\t\t\t\t\t\t\t\te_TIPO_FRETE TIFR,\r\n\t\t\t\t\t\t\t\t\te_PEDIDO_ITEM PEIT\r\n\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\tPEDI.ID_PEDIDO = PEEN.PEDI_ID_PEDIDO\r\n\t\t\t\t\t\t\t\tAND PEDI.ID_PEDIDO = " . $idPedido . "\r\n\t\t\t\t\t\t\t\tAND PEEN.MUNI_ID_MUNICIPIO = MUNI.ID_MUNICIPIO\r\n\t\t\t\t\t\t\t\tAND PRUF.TIFR_ID_TIPO_FRETE = " . $tipoFrete . "\r\n\t\t\t\t\t\t\t\tAND MUNI.UNFE_ID_ESTADO = PRUF.UNFE_ID_ESTADO\r\n\t\t\t\t\t\t\t\tAND PRUF.MUNI_ID_MUNICIPIO = MUNI.ID_MUNICIPIO\r\n\t\t\t\t\t\t\t\tAND PRUF.TIFR_ID_TIPO_FRETE = TIFR.ID_TIPO_FRETE\r\n\t\t\t\t\t\t\t\tAND PEDI.ID_PEDIDO = PEIT.PEDI_ID_PEDIDO\r\n\t\t\t\t\t\t\t\tGROUP BY\r\n\t\t\t\t\t\t\t\t((@PESO_TOTAL*PRUF.FRETE_KG)+PRUF.TAXA_FRETE_KG)+IFNULL(PRUF.PEDAGIO,0),\r\n\t\t\t\t\t\t\t\tTIFR.GRIS_MINIMO,\r\n\t\t\t\t\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\tEND\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tUPDATE e_PEDIDO SET VALOR_FRETE = @VALOR_FRETE, FRETE_GRATIS = @FRETE_GRATIS, TIFR_ID_TIPO_FRETE = @TIPO_FRETE \r\n\t\t\t\t\t\tWHERE ID_PEDIDO = " . $idPedido . ";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT @FRETE_GRATIS FRETE_GRATIS, @VALOR_FRETE VALOR_FRETE";
         //printr($query);
         $retorno = $this->mysqli->ConsultarSQL($query);
     }
     //fim else xml
     return $retorno;
 }
开发者ID:jonathanbugs,项目名称:anselmi,代码行数:60,代码来源:frete.class.php

示例12: db_fetch

 function db_fetch($oStmt)
 {
     $aArray = array();
     if (($aArray = mssql_fetch_array($oStmt)) == null) {
         return false;
     }
     return $aArray;
 }
开发者ID:brustj,项目名称:tracmor,代码行数:8,代码来源:db_mssql.php

示例13: MostrarAtributo

 function MostrarAtributo($ot)
 {
     $link = Conectarse();
     $sql = "SELECT * FROM CENCOSOT WHERE  CODIGOOT='{$ot}'";
     $result = mssql_query($sql);
     $row = mssql_fetch_array($result);
     echo $row['CODIGOCENTROCOSTO'];
 }
开发者ID:Codrise,项目名称:Modulo-de-Reservas,代码行数:8,代码来源:Otcc.php

示例14: fetch_array

 public static function fetch_array($queryDB = '', $objectStr = '', $fetchType = 'MSSQL_ASSOC')
 {
     $row = mssql_fetch_array($queryDB, $fetchType);
     if (is_object($objectStr)) {
         $objectStr($row);
     }
     return $row;
 }
开发者ID:neworldwebsites,项目名称:noblessecms,代码行数:8,代码来源:DatabaseMSSQL.php

示例15: MostrarAtributo

 function MostrarAtributo($kit, $atributo)
 {
     $link = Conectarse();
     $sql = "SELECT  IDKITS_REPARACION,CODART,CODKIT,CANART,KDESCRI,\r\nKUNIDAD,FECHA_CREACION FROM  \r\nKITS_REPARACION WHERE KUNIDAD='REP' AND CODKIT='{$kit}'";
     $result = mssql_query($sql);
     $row = mssql_fetch_array($result);
     echo $row[$atributo];
 }
开发者ID:Codrise,项目名称:Modulo-de-Reservas,代码行数:8,代码来源:Kitreparacion.php


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