예제 #1
4
 /**
  * Constructor method for the adapter.  This constructor implements the setting of the
  * 3 required properties for the object.
  * 
  * The body of this method was provided by Mario Falomir... Thanks.
  * 
  * @param resource $d The datasource resource
  */
 function odbcAdapter($d)
 {
     parent::RecordSetAdapter($d);
     // count number of fields
     $fieldcount = odbc_num_fields($d);
     $ob = "";
     $be = $this->isBigEndian;
     $fc = pack('N', $fieldcount);
     if (odbc_num_rows($d) > 0) {
         $line = odbc_fetch_row($d, 0);
         do {
             // write all of the array elements
             $ob .= "\n" . $fc;
             for ($i = 1; $i <= $fieldcount; $i++) {
                 // write all of the array elements
                 $value = odbc_result($d, $i);
                 if (is_string($value)) {
                     // type as string
                     $os = $this->_directCharsetHandler->transliterate($value);
                     //string flag, string length, and string
                     $len = strlen($os);
                     if ($len < 65536) {
                         $ob .= "" . pack('n', $len) . $os;
                     } else {
                         $ob .= "\f" . pack('N', $len) . $os;
                     }
                 } elseif (is_float($value) || is_int($value)) {
                     // type as double
                     $b = pack('d', $value);
                     // pack the bytes
                     if ($be) {
                         // if we are a big-endian processor
                         $r = strrev($b);
                     } else {
                         // add the bytes to the output
                         $r = $b;
                     }
                     $ob .= "" . $r;
                 } elseif (is_bool($value)) {
                     //type as bool
                     $ob .= "";
                     $ob .= pack('c', $value);
                 } elseif (is_null($value)) {
                     // null
                     $ob .= "";
                 }
             }
         } while ($line = odbc_fetch_row($d));
     }
     $this->serializedData = $ob;
     // grab the number of fields
     // loop over all of the fields
     for ($i = 1; $i <= $fieldcount; $i++) {
         // decode each field name ready for encoding when it goes through serialization
         // and save each field name into the array
         $this->columnNames[$i - 1] = $this->_directCharsetHandler->transliterate(odbc_field_name($d, $i));
     }
     $this->numRows = odbc_num_rows($d);
 }
예제 #2
2
 public function get_json_data()
 {
     $lista = json_decode($this->field_list);
     $base = $this->db->getDB();
     $this->conn = odbc_connect("DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ={$base}", '', '') or exit('Cannot open with driver.');
     if (!$this->conn) {
         exit("Connection Failed: " . $this->conn);
     }
     $rs = odbc_exec($this->conn, $this->sql);
     if (!$rs) {
         exit("Error in SQL");
     }
     $value = '[';
     while (odbc_fetch_row($rs)) {
         $value .= '[';
         foreach ($lista as $valor) {
             $value .= $this->not_null(odbc_result($rs, $valor[0]), $valor[1]) . ',';
         }
         $value .= '],';
     }
     $value .= ']';
     $value = str_replace(",]", "]", $value);
     odbc_close_all();
     //$value = utf8_encode($value);
     return $value;
 }
예제 #3
0
파일: access.php 프로젝트: rohmad-st/fpdf
 function Table($sql, $col)
 {
     global $conn;
     //Query
     $res = odbc_do($conn, $sql);
     if (!$res) {
         die('SQL error');
     }
     //Header
     $this->SetFillColor(255, 0, 0);
     $this->SetTextColor(255);
     $this->SetDrawColor(128, 0, 0);
     $this->SetLineWidth(0.3);
     $this->SetFont('', 'B');
     $tw = 0;
     foreach ($col as $label => $width) {
         $tw += $width;
         $this->Cell($width, 7, $label, 1, 0, 'C', 1);
     }
     $this->Ln();
     //Rows
     $this->SetFillColor(224, 235, 255);
     $this->SetTextColor(0);
     $this->SetFont('');
     $fill = false;
     while (odbc_fetch_row($res)) {
         foreach ($col as $field => $width) {
             $this->Cell($width, 6, odbc_result($res, $field), 'LR', 0, 'L', $fill);
         }
         $this->Ln();
         $fill = !$fill;
     }
     $this->Cell($tw, 0, '', 'T');
 }
예제 #4
0
파일: ODBC.php 프로젝트: ljarray/dbpedia
 public function execAsJson($query, $logComponent)
 {
     $query = 'sparql define output:format "RDF/XML" ' . $query;
     /*
     		$query= 'sparql define output:format "TTL" ' .$query;
     */
     /*
     		echo $query;
     		die;
     */
     $odbc_result = $this->exec($query, $logComponent);
     odbc_longreadlen($odbc_result, ODBC_MAX_LONGREAD_LENGTH);
     odbc_fetch_row($odbc_result);
     $data = false;
     do {
         $temp = odbc_result($odbc_result, 1);
         if ($temp != null) {
             $data .= $temp;
         }
     } while ($temp != null);
     //=$data;
     $conv = new XmlConverter();
     $arr = $conv->toArray($data);
     //print_r($arr);
     //die;
     //Logger::warn('check if faster with default graph, ');
     return $arr;
 }
예제 #5
0
 public function getKOSUserByCharacter($chr_uid, $con)
 {
     $sql = "select * from dbo.chr_info where chr_uid = {$chr_uid}";
     $result = odbc_exec($con, $sql);
     while (odbc_fetch_row($result)) {
         $return = array('UserId' => odbc_result($result, "chr_uin"));
     }
     return $return;
 }
예제 #6
0
 function valCurRow($col)
 {
     return odbc_result($this->res, $col);
     /*         if (isset($this->curRow[$col]))
                 return $this->curRow[$col] ;
               else
                 return null ;
     */
 }
예제 #7
0
function isAvailable($conn, $id)
{
    $req = 'SELECT ESTDISPONIBLE FROM appartement WHERE IDAPPARTEMENT=' . $id;
    $res = odbc_exec($conn, $req);
    if (odbc_result($res, 1)) {
        return true;
    } else {
        return false;
    }
}
예제 #8
0
 public function getCount($sql, $row = 0, $field = null)
 {
     $query = odbc_exec($this->dbConnection(), $sql);
     if ($query) {
         $result = odbc_result($query, $row, $field);
         return $result;
     } else {
         $this->halt('Database query error', $sql);
     }
 }
예제 #9
0
 public function getLastId()
 {
     try {
         $result = $this->query("SELECT LAST_INSERT_ID()");
         $id = @odbc_result($result, 1);
     } catch (Exception $e) {
         throw new DbControlException("Error in trying to acquire Last inserted id.\n" . $e->getMessage(), $e->getCode());
     }
     return $id;
 }
예제 #10
0
function db_gettablelist()
{
	global $conn;
	$ret=array();
	$rs = odbc_tables($conn);
	while(odbc_fetch_row($rs))
		if(odbc_result($rs,"TABLE_TYPE")=="TABLE" || odbc_result($rs,"TABLE_TYPE")=="VIEW")
			$ret[]=odbc_result($rs,"TABLE_NAME");
	return $ret;
}
 public function CheckEmailIfExists($db)
 {
     $query = "select Fc_Email from tblMember";
     $rows = odbc_exec($db, $query);
     while (odbc_fetch_row($rows)) {
         $existing = odbc_result($rows, "Fc_Email");
         if ($this->email == $existing) {
             return true;
         }
     }
 }
예제 #12
0
 /**
  * @return Array
  */
 public function db_gettablelist()
 {
     $ret = array();
     $rs = odbc_tables($this->connectionObj->conn);
     while (odbc_fetch_row($rs)) {
         if (odbc_result($rs, "TABLE_TYPE") == "TABLE" || odbc_result($rs, "TABLE_TYPE") == "VIEW") {
             $ret[] = odbc_result($rs, "TABLE_NAME");
         }
     }
     return $ret;
 }
 public function GetLoginUser($db, $user)
 {
     try {
         $query = "select Fc_Fullname from tblMember\n\t\t\t\t \twhere Pk_MemberID='" . $user . "'";
         $toprow = odbc_exec($db, $query);
         if (odbc_fetch_row($toprow)) {
             return odbc_result($toprow, "Fc_Fullname");
         }
     } catch (Exception $e) {
         return "";
     }
 }
예제 #14
0
function ValorSqlODBC($sql, $default)
{
    // Devuelve el valor del primer campo del primer registro del query pasado como parámetro..
    global $conn;
    $query = DBExecSql($conn, $sql);
    $value = odbc_result($query, 1);
    if ($value == "") {
        return $default;
    } else {
        return $value;
    }
}
예제 #15
0
 /**
  * @see DatabaseInfo::initTables()
  */
 protected function initTables()
 {
     include_once 'creole/drivers/odbc/metadata/ODBCTableInfo.php';
     $result = @odbc_tables($this->conn->getResource());
     if (!$result) {
         throw new SQLException('Could not list tables', $this->conn->nativeError());
     }
     while (odbc_fetch_row($result)) {
         $tablename = strtoupper(odbc_result($result, 'TABLE_NAME'));
         $this->tables[$tablename] = new ODBCTableInfo($this, $tablename);
     }
     @odbc_free_result($result);
 }
예제 #16
0
파일: utils.php 프로젝트: Tkachov/POD
function get_num_rows(client $client, $table_name)
{
    //TODO: check client's cookie (setting) not to do all these selects
    if (false) {
        return "";
    }
    $query = "select count(*) from " . $table_name . ";";
    $res = odbc_exec($client->get_connection(), $query);
    if ($res === false) {
        return "unknown";
    } else {
        return format_num_rows(odbc_result($res, 1));
    }
}
예제 #17
0
 function afficheTables($pFichAction)
 {
     //remplissage de la liste
     $tablelist = odbc_tables($this->connexion);
     echo '<form name="choixTables" method="get" action="' . $pFichAction . '">';
     echo '<select name="lesTables">';
     while (odbc_fetch_row($tablelist)) {
         if (odbc_result($tablelist, 4) == "TABLE") {
             // Si l'objet en cours a pour indicateur TABLE                //test à ajouter dans la condition pour ne pas afficher les  tables système en Access     && !(substr(odbc_result($tablelist,3),0,4)=="MSys")
             echo '<option value="' . odbc_result($tablelist, 3) . '">' . odbc_result($tablelist, 3) . '</option>';
         }
         // Affiche nom de la TABLE
     }
     echo '</select><input type="submit" value="Afficher"></input></form>';
 }
 public function LoadUserInfo($db)
 {
     try {
         $query = "select Fc_Fullname,Fc_Gender,Fc_Email,Fc_Bday,Fc_PhotoLink from tblMember \n\t\t\t\t\t\twhere Pk_MemberID='" . $this->userID . "'";
         $rows = odbc_exec($db, $query);
         while (odbc_fetch_row($rows)) {
             $user = odbc_result($rows, "Fc_Fullname");
             $sex = odbc_result($rows, "Fc_Gender");
             $email = odbc_result($rows, "Fc_Email");
             $bday = odbc_result($rows, "Fc_Bday");
             $avatar = odbc_result($rows, "Fc_PhotoLink");
             echo "\n\t\t\t\t<table><tr><td>\n\t\t\t\t\t<table style='border-right:1px solid gray;'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><img src='Users/Avatar/" . $avatar . "' alt='no photo'\n\t\t\t\t\t\t\t height='180px' width='180px' style='border-radius:7px;'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><input type='button' name='submit-editphoto' value='Change Photo'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><input type='button' name='submit-changepass' value='Change Password'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table></td><td>\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><b style='color:gray;'>Username:</b></td>\n\t\t\t\t\t\t\t<td><input type='text' name='fullname' value='" . $user . "' style='color:teal;'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><b style='color:gray;'>Sex:</b></td>\n\t\t\t\t\t\t\t<td><b style='color:teal;'>" . $sex . "</b></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><b style='color:gray;'>Birthday:</b></td>\n\t\t\t\t\t\t\t<td><b style='color:teal;'>" . $bday . "</b></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><b style='color:gray;'>Email:</b></td>\n\t\t\t\t\t\t\t<td><b style='color:teal;'>" . $email . "</b></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t\t\t<input type='button' name='submit-updateprofile' value='Update Profile'>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table></td></tr>\n\t\t\t\t</table>\n\t\t\t\t";
         }
     } catch (Exception $e) {
     }
 }
예제 #19
0
function creation_contrat2($conn)
{
    $id = $_GET['id'];
    $plage = $_POST['plage'];
    if (isset($_SESSION['utilisateur'])) {
        $user = $_SESSION['utilisateur'];
    }
    $req = 'INSERT INTO  contratlocation (IDAPPARTEMENT,IDUTILISATEUR,DATEDEBUTLOC,DATEFINLOC)
VALUES (' . $id . ',' . $user . ',CONVERT(DATETIME,"01/01/1970",103),CONVERT(DATETIME,"01/01/1970",103))';
    odbc_exec($conn, $req);
    $req = 'SELECT @@IDENTITY FROM contratlocation';
    $res = odbc_exec($conn, $req);
    $idcont = odbc_result($res, 1);
    $req = 'INSERT INTO paiement (IDCONTRAT,IDPLAGE,DATEPAIEMENT) VALUES (' . $idcont . ',' . $plage . ',NULL)';
    //odbc_exec($conn,$req);
}
예제 #20
0
function listeFourni()
{
    global $cnx, $liste;
    $cnx = ouvresylob(1);
    //on selectionne tous les champs qui seront utiles
    $sQuery = "SELECT distinct (f.no_frn) as id, f.rais_soc as raison_sociale, a.nom as contact, f.telph as tel, telex as email, \r\n                        CONCAT(a.adr1,a.adr2) as adresse, CONCAT(a.cd_post,a.ville) as ville\r\n                FROM (informix.bas_frn f \r\n                INNER JOIN informix.bas_adrfrn a ON a.no_frn = f.no_frn) \r\n                LEFT JOIN informix.zz_materiel m ON m.frn_materiel = f.no_frn\r\n                WHERE f.no_frn is not null\r\n                AND a.no_adr = 1\r\n                ORDER BY f.rais_soc asc, a.nom asc";
    //echo $sQuery;
    $res = odbc_exec($cnx, $sQuery);
    $i = 0;
    while (odbc_fetch_row($res)) {
        for ($j = 1; $j <= odbc_num_fields($res); $j++) {
            $liste[$i][odbc_field_name($res, $j)] = odbc_result($res, $j);
        }
        $i++;
    }
    //odbc_close($cnx);
    return $liste;
}
예제 #21
0
 public function LoadTrails($db)
 {
     $query = "select \n\t\t\t\t\tFk_ID,\n\t\t\t\t\ta.Fc_Fullname,\n\t\t\t\t\tFc_Doing,\n\t\t\t\t\tFc_Desc,\n\t\t\t\t\tFc_Where,\n\t\t\t\t\tFc_TimeStart,\n\t\t\t\t\tpkTrailID,\n\t\t\t\t\tFc_Tag,\n\t\t\t\t\ta.Fc_PhotoLink,\n\t\t\t\t\tb.Fc_PhotoLink as [User_PLink]\n\t\t\t\t\tfrom tblQuickTrail a\n\t\t\t\t\tLEFT JOIN tblMember b on a.Fk_ID = b.Pk_MemberID \n\t\t\t\t\torder by pkTrailID desc";
     $rows = odbc_exec($db, $query);
     while (odbc_fetch_row($rows)) {
         $id = odbc_result($rows, "Fk_ID");
         $user = odbc_result($rows, "Fc_Fullname");
         $d = odbc_result($rows, "Fc_Doing");
         $desc = odbc_result($rows, "Fc_Desc");
         $w = odbc_result($rows, "Fc_Where");
         $t = odbc_result($rows, "Fc_TimeStart");
         $trailID = odbc_result($rows, "pkTrailID");
         $tag = odbc_result($rows, "Fc_Tag");
         $photolink = odbc_result($rows, "Fc_PhotoLink");
         $userphoto = odbc_result($rows, "User_PLink");
         echo "\n\t\t\t<div class='ui-content' style='border-radius:7px;border:1px solid #585899;background-color:white;'>\n\t\t\t\t<div style='background-color:white;padding:2%;border-radius:7px;'>\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<img src='Users/Avatar/" . $userphoto . "' \n\t\t\t\t\t\t\t\t\theight='50px' width='50px' style='border-radius:7px;'>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td><a href='' class='ui-btn'><b style='color:teal;'>" . $user . "</b></a></td>\n\t\t\t\t\t\t\t\t<td><small style='color:gray;'>is " . $this->MiniEvent($photolink) . "</small></td>\n\t\t\t\t\t\t\t\t<td>" . $this->GetEventIcon($d) . "</td>\n\t\t\t\t\t\t\t\t<td id='event'><b>" . $d . "</b></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<hr>\n\t\t\t\t\t\t" . $this->isPhoto($photolink) . "\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td><span>" . $desc . "</span></td>\n\t\t\t\t\t\t\t\t<td><b style='font-size:large;color:teal;'>" . $tag . "</b></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<small style='color:teal;'>at " . $w . "</small>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<small style='color:gray;'>" . $t . "</small>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t\t<div class='ui-content' id='writecomment'>\n\t\t\t\t\t<form action='Dashboard.php' method='POST'>\n\t\t\t\t\t<input type='hidden' name='trailID' value='" . $trailID . "'>\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<img src='Users/Avatar/" . $_SESSION["userAvatar"] . "' \n\t\t\t\t\t\t\t\theight='30px' width='30px' style='border-radius:7px;'>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<textarea name='comment' placeHolder='say something'></textarea></td><td>\n\t\t\t\t\t\t\t<input type='submit' name='submit-comment' value='add comment'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<div id='comments'>\n\t\t\t\t<small>comments</small><img src='images/Comment.png'>\n\t\t\t\t\t<iframe id='frameComments'\n\t\t\t\t\t src='pagelets/LoadComments.php?id=" . $trailID . "' width='100%'\n\t\t\t\t\t onload='resizeIframe(this)' frameborder='0' scrolling='yes'>\n\t\t\t\t\t</iframe>\n\t\t\t\t</div>\n\t\t\t</div><br>";
     }
 }
예제 #22
0
 public function Authenticate($user, $pass)
 {
     try {
         $query = "select username,password from tblUser\n\t\t\t\t \twhere username='******'\n\t\t\t\t \t and password='******'";
         $toprow = odbc_exec($this->link, $query);
         if (odbc_fetch_row($toprow)) {
             $u = odbc_result($toprow, "username");
             $p = odbc_result($toprow, "password");
             if ($user == $u && $pass == $p) {
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } catch (Exception $e) {
     }
 }
예제 #23
0
function addUser($conn)
{
    // ajout de l'adresse avec retour id
    // ajout utilisaeur avec id adresse
    $idville = is_numeric($_POST['ville']) ? (int) $_POST['ville'] : 0;
    $numrue = is_numeric($_POST['num']) ? (int) $_POST['num'] : 0;
    $nomrue = trim($_POST["adr"]);
    $idadresse = (int) Utilisateur::addAdress($conn, $idville, $numrue, $nomrue);
    //int
    $nom = trim($_POST["nom"]);
    //chaine
    $prenom = trim($_POST["prenom"]);
    //chaine
    $mail = trim($_POST["mail"]);
    //chaine
    $tel = is_numeric($_POST['tel']) ? (int) $_POST['tel'] : 0;
    //int
    $password = trim($_POST["pass"]);
    //chaine
    $estouvert = 1;
    //int
    $idsysuser = 0;
    //int
    $user = Utilisateur::addUser($conn, $idadresse, $nom, $prenom, $mail, $tel, $password, $estouvert, $idsysuser);
    if ($user != null) {
        $est_co = Utilisateur::connexion($conn, $mail, $password);
        if ($est_co) {
            $req = "select IDUTILISATEUR from utilisateur WHERE MAIL = '{$mail}';";
            $result = odbc_exec($conn, $req);
            $id = odbc_result($result, 1);
            $req = "select IDSYSUSER from utilisateur WHERE MAIL = '{$mail}';";
            $result = odbc_exec($conn, $req);
            $sysuser = odbc_result($result, 1);
            // while(odbc_fetch_row($result)){
            //   $id = odbc_result($result, 1);
            $_SESSION['idsysuser'] = $sysuser;
            $_SESSION['utilisateur'] = $id;
        } else {
            echo 'nan';
        }
    }
}
예제 #24
0
function GetCachedContent_Database_Virtuoso($cacheId, $config)
{
    $virtUser = $config['store.virtuoso.username'];
    $virtPass = $config['store.virtuoso.password'];
    $virtDsn = $config['store.virtuoso.dsn'];
    $connection = @odbc_connect($virtDsn, $virtUser, $virtPass);
    if ($connection == false) {
        exit('Could not connect to virtuoso');
    }
    $query = "SELECT content\n        FROM DB.DBA.ef_cache\n        WHERE id = '{$cacheId}'";
    $resultId = odbc_exec($connection, $query);
    if ($resultId == false) {
        // Erroneous query
        return;
    }
    if (odbc_num_rows($resultId) == 1) {
        $serialized = '';
        while ($segment = odbc_result($resultId, 1)) {
            $serialized .= (string) $segment;
        }
        return unserialize($serialized);
    }
}
예제 #25
0
 function get_report(client $client, $table_name, $show, $rownum)
 {
     if ($table_name == null) {
         return "Bad table name.";
     }
     //TODO check table_name is one word
     //compile query
     $colnames = odbc_exec($client->get_connection(), "SELECT column_name, data_type, data_length FROM ALL_TAB_COLUMNS WHERE table_name = '" . strtoupper($table_name) . "';");
     if ($colnames === false) {
         return "Unable to get table fields.";
     }
     $query = "SELECT ";
     $i = 0;
     while (odbc_fetch_row($colnames)) {
         if (isset($show) && isset($show[$i]) && $show[$i] == true) {
             if ($query != "SELECT ") {
                 $query .= ", ";
             }
             $query .= odbc_result($colnames, 1);
         }
         $i += 1;
     }
     $query .= " FROM " . $table_name . " WHERE rownum <= ?;";
     //prepare statement
     $statement = odbc_prepare($client->get_connection(), $query);
     if ($statement === false) {
         return $query . "\n\n" . get_odbc_error();
     }
     $items = array();
     $items[] = (int) $rownum;
     $result = odbc_execute($statement, $items);
     if ($result === false) {
         return $query . "\n\n" . get_odbc_error();
     }
     return $statement;
 }
//57
echo "\t";
//58
echo "\t";
//59
odbc_close($connection_string);
$process2 = odbc_exec($connection_string2, "Exec usp_USI_getReferralProcedures '" . $_GET['pReferral_ud'] . "'");
while (odbc_fetch_row($process2)) {
    echo odbc_result($process2, "procedurecode_ud") . "\t";
    // 60,70,80,90,100,110
    echo odbc_result($process2, "description") . "\t";
    // 61,71,81,91,101,111
    echo round(odbc_result($process2, "average_cost")) . "\t";
    // 62,72,82,92,102,112
    // Spare fields for later use
    echo odbc_result($process2, "modifier_1") . "\t";
    // 63,73,83,93,103,113
    echo "\t";
    // 64,74,84,94,104,114
    echo "\t";
    // 65,75,85,95,105,115
    echo "\t";
    // 66,76,86,96,106,116
    echo "\t";
    // 67,77,87,97,107,117
    echo "\t";
    // 68,78,88,98,108,118
    echo "\t";
    // 69,79,89,99,109,119
}
odbc_close($connection_string2);
예제 #27
0
            $totYTDIncompAppts += odbc_result($process, "IntCount");
            break;
        case 100:
            $totRefNoClaim += odbc_result($process, "IntCount");
            break;
        case 110:
            $totYTDApptXAdvance += odbc_result($process, "IntCount");
            break;
        case 120:
            $totYTDAppyXNoShow += odbc_result($process, "IntCount");
            break;
        case 150:
            $totCasesCreated += odbc_result($process, "IntCount");
            break;
    }
    $totalAppts += odbc_result($process, "IntCount");
    if ($trClass == "tr2") {
        $trClass = "tr1";
    } else {
        $trClass = "tr2";
    }
    $benefitPlanCount++;
}
echo "<td class=\"tdRight\">" . $totalAppts . "</td>";
echo "</tr>";
$totTotal = $totApptsSchedToday + $totFollowUpCalls + $totApptsDueToday + $totReminderCalls + $totYTDApptsSched + $totYTDExamsSched + $totYTDApptsComp + $totYTDExamsComp + $totYTDIncompAppts + $totRefNoClaim + $totYTDApptXAdvance + $totYTDAppyXNoShow + $totCasesCreated;
echo "<tr>";
echo "<th width=\"100px\">Total</th>";
echo "<th width=\"65px\">" . number_format($totApptsSchedToday) . "</th>";
echo "<th width=\"65px\">" . number_format($totFollowUpCalls) . "</th>";
echo "<th width=\"65px\">" . number_format($totApptsDueToday) . "</th>";
예제 #28
0
<?php

if ($_GET['p03'] == 0) {
    if ($_GET['p01'] == "1/1/2009") {
        echo "0";
    } else {
        if (substr($_GET['p01'], 0, 4) == "1/1/" && substr($_GET['p01'], 0, 5) == "3/31/") {
            echo "0";
        } else {
            if (substr($_GET['p01'], 0, 4) != "1/1/") {
                echo "0";
            } else {
                echo "2788";
            }
        }
    }
} else {
    include 'config.php';
    global $DB;
    $DB = str_replace("\"", "", $DB);
    $connection_string = odbc_connect($DB, "", "");
    set_time_limit(0);
    $sqlquery = "Exec usp_USI_getExamsPaid '" . $_GET['p01'] . "','" . $_GET['p02'] . "'," . $_GET['p03'] . "," . $_GET['p04'];
    $process = odbc_exec($connection_string, $sqlquery);
    //echo $sqlquery;
    while (odbc_fetch_row($process)) {
        echo number_format(odbc_result($process, "examCount"));
    }
    odbc_close($connection_string);
}
예제 #29
0
<?php

include 'config.php';
global $DB;
$DB = str_replace("\"", "", $DB);
$connection_string = odbc_connect($DB, "", "");
$sqlquery = "Exec usp_USI_GetReferralStatus";
$process = odbc_exec($connection_string, $sqlquery);
$selected = "";
while (odbc_fetch_row($process)) {
    if (odbc_result($process, "referral_status_ud") == $chosenStatus) {
        $selected = "selected=\"selected\"";
    } else {
        $selected = "";
    }
    if (odbc_result($process, "referral_status_id") == 8 || odbc_result($process, "referral_status_id") == 10 || odbc_result($process, "referral_status_id") == 11 || odbc_result($process, "referral_status_id") == 19 || odbc_result($process, "referral_status_id") == 18 || odbc_result($process, "referral_status_id") == 1 || odbc_result($process, "referral_status_id") == 2 || odbc_result($process, "referral_status_id") == 29 || odbc_result($process, "referral_status_id") == 37 || odbc_result($process, "referral_status_id") == 40 || odbc_result($process, "referral_status_id") == 30 || odbc_result($process, "referral_status_id") == 32 || odbc_result($process, "referral_status_id") == 3 || odbc_result($process, "referral_status_id") == 7 || odbc_result($process, "referral_status_id") == 36 || odbc_result($process, "referral_status_id") == 35 || odbc_result($process, "referral_status_id") == 6 || odbc_result($process, "referral_status_id") == 38) {
        $objClass = "";
    } else {
        $objClass = "optHighlight";
    }
    echo "<option class=\"" . $objClass . "\" value=\"" . odbc_result($process, "referral_status_id") . "\" id=\"" . odbc_result($process, "referral_status_id") . "\" " . $selected . ">";
    echo odbc_result($process, "referral_status_ud");
    echo "</option>";
}
odbc_close($connection_string);
예제 #30
0
 /**
  * Fetches the row at current position and moves the internal cursor to the next position.
  * @param  bool     TRUE for associative array, FALSE for numeric
  * @return array    array on success, nonarray if no next record
  * @internal
  */
 public function fetch($assoc)
 {
     if ($assoc) {
         return odbc_fetch_array($this->resultSet, ++$this->row);
     } else {
         $set = $this->resultSet;
         if (!odbc_fetch_row($set, ++$this->row)) {
             return FALSE;
         }
         $count = odbc_num_fields($set);
         $cols = array();
         for ($i = 1; $i <= $count; $i++) {
             $cols[] = odbc_result($set, $i);
         }
         return $cols;
     }
 }