function get_by_au($au) { $db = new dbConnector(); $str = "select * from transaction where au='{$au}'"; $rst = $db->query($str); $row = $rst->fetch_assoc(); return $row; }
public function getByInvoice($invoice) { $db = new dbConnector(); $sql = "select * from passenger where invoice={$invoice}"; $result = $db->query($sql); $rst = array(); while ($row = $result->fetch_assoc()) { $rst[$row['id']] = $row; } return $rst; }
public function get_history($id, $start = '', $end = '') { if ($start) { $_start = $start . ' 00:00:00'; $_end = $end . ' 00:00:00'; $sql = "select * from paydoc where user={$id} and date<='{$_end}' and date>='{$_start}' order by date desc"; } else { $sql = "select * from paydoc where user={$id} order by date desc"; } $db = new dbConnector(); $result = $db->query($sql); $rst = array(); while ($row = $result->fetch_assoc()) { $rst[$row['id']] = $row; } return $rst; }
<?php include '../../phpdb/dbExpertConnector.php'; $connector = new dbConnector(); $buffer = $connector->query("SELECT block_id,tree,treestring,sequences,base_score,game_par,game_highscore FROM bioblocks"); while ($myrow = $connector->fetchArray($buffer)) { /* misc variables */ $blockid = $myrow['block_id']; $tree_string = $myrow['treestring']; /* build species list */ $tree_struct = $myrow['tree']; $speclist = array(); $newid = ""; for ($i = 0; $i <= strlen($tree_struct); $i++) { $carac = substr($tree_struct, $i, 1); if ($carac == '(' or $carac == ')' or $carac == ',') { if ($newid != "") { array_push($speclist, $newid); $newid = ""; } } else { $newid .= $carac; } } /* build sequence array */ $fulldataseqs = json_decode($myrow['sequences'], true); $sequences = $fulldataseqs['sequence']; /* combine */ $fullsequences = array_combine($speclist, $sequences); /* compute real score */ $treefilename = $blockid . ".tree";
<?php session_start(); echo '<pre>'; //print_r($_POST);exit; /////////////////////const & function define('Public_Api_URl', 'http://xmltest.mercan.travel/ws/index.php'); define('Public_Api_Username', 'mercan_darvishi'); define('Public_Api_Password', 'darvishi123'); define('hot_room_service_type', '1'); //get country & city require "class/DB.php"; $dbs = new dbConnector(); $objdata = null; $res = $dbs->query("SELECT * FROM `hotels_source` WHERE `hotels_id`=" . $_SESSION['hotel_id']); while ($row = mysqli_fetch_array($res)) { $objdata = json_decode($row['extra_data']); break; } $country = $objdata->country; $city = $objdata->city; //get room_type name $room_type_name = ''; $res = $dbs->query("SELECT * FROM `hot_room_type` WHERE `id` =" . $_SESSION['room_id']); while ($row = mysqli_fetch_array($res)) { $room_type_name = $row['name']; break; } // send search requet $d1 = explode('-', $_SESSION['checkin']); $d1 = $d1[2] . '/' . $d1[1] . '/' . $d1[0];
function DFS($mytree, &$myseqs) { if (count($mytree) == 1) { array_push($myseqs, str_replace('.', '-', $mytree)); } else { DFS($mytree['0'], &$myseqs); DFS($mytree['1'], &$myseqs); } } /* define arguments to submit */ $id = $_POST['stage']; $user = $_POST['user']; $score = $_POST['score']; $fulltree = $_POST['tree']; /* retrieve missing data */ $connector = new dbConnector(); /* id syntax: s<num> from bioblocks & x<num> from expertblocks */ /* if it starts with x, one must look into the expertblock data to know the bioblocks id */ $prefix = $id[0]; $suffix = substr($id, 1); if ($prefix == 's') { $buffer = $connector->query("SELECT tree,treestring FROM bioblocks WHERE block_id = {$suffix}"); $xarray = $connector->fetchArray($buffer); $tree_string = $xarray['treestring']; $tree_struct = $xarray['tree']; $bio_id = $suffix; } elseif ($prefix == 'x') { $buffer = $connector->query("SELECT bioblock_id,tree,treestring FROM expertblocks WHERE block_id = {$suffix}"); $xarray = $connector->fetchArray($buffer); $tree_string = $xarray['treestring']; $tree_struct = $xarray['tree'];
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ require "DB.php"; $dbs = new dbConnector(); $t = strip_tags($_GET["t"]); switch ($t) { case 1: $cid = strip_tags($_GET["cid"]); $city = strip_tags($_GET["city"]); $res = $dbs->query("select * from pub_city where country_id='{$cid}' order by en_name"); echo '<select class="form-control" id="city" name="reserve[city_id]">' . "\n"; while ($row = mysqli_fetch_array($res)) { $sel = $row[id] == $city ? "selected='selected'" : ""; echo "<option value='{$row['id']}' {$sel}>{$row['en_name']}</option>\n"; } echo '</select>'; break; }
<?php session_start(); error_reporting('E_ALL ~E_NOTICE'); require "class/DB.php"; $dbs = new dbConnector(); /// //$res=$dbs->query("SELECT * FROM `hotel_avail`"); //while($row=mysqli_fetch_array($res)){ // var_dump($dbs->query("UPDATE `safar`.`hotel_avail` SET `avi_date` = '".$row['tarikh']."' WHERE `hotel_avail`.`id` =".$row['id'])); // //} // // // //exit; //$types="9614,9613"; //$date='2015-12-24,2015-12-26'; //$res=$dbs->query("select get_RoomType($types,$date)"); //var_dump($res);exit; //while($row=mysqli_fetch_array($res)){ // var_dump($row); //} //exit; $res = $dbs->query("select * from pub_country order by en_name"); while ($row = mysqli_fetch_array($res)) { $countries[$row[id]] = $row[en_name]; } $reserve = $_POST["reserve"]; //print_r($reserve); $numRooms = 0;
public function Get_Guest_ID() { $db = new dbConnector(); $str = "select id from user where username='******'"; $q = $db->query($str); $users = array(); $row = mysqli_fetch_assoc($q); return $row['id']; }
$authenticator = new Authenticator(); $authenticator->setAccessID($AccessID); $authenticator->setSecretKey($SecretKey); $authenticator->setRateLimit($rateLimit); // Add your hostname here $hostname = 'localhost'; // Add your database here $database = ''; // Add your table here $table = ''; // Add your username here $username = ''; // Add your password here $password = ''; // Setup/Connect database $dbConnector = new dbConnector(); $dbConnector->setHostname($hostname); $dbConnector->setDatabase($database); $dbConnector->setUsername($username); $dbConnector->setPassword($password); $dbConnector->connectDB(); // Query database for URLs $dbConnector->setTable($table); $db_urls = $dbConnector->getURLsFromDB(); // Set batch size here $batchSize = 200; // Batch URLs $dbConnector->setBatchSize($batchSize); $batchedDomains = $dbConnector->getBatchedURLs($db_urls); // Close DB connection $dbConnector->closeDB();
<?php error_reporting('E_ALL ~E_NOTICE'); require "class/DB.php"; $dbs = new dbConnector(); $res = $dbs->query("select * from country order by en_name"); while ($row = mysqli_fetch_array($res)) { $countries[$row[id]] = $row[en_name]; } //$reserve=$_POST["reserve"]; //if($reserve) { // $numDays=(strtotime($reserve[checkout])-strtotime($reserve[checkin]))/3600/24; // foreach($reserve[rooms] as $room){ // for($i=0; $i<=$numDays; $i++){ // $checkDate=date("Y-m-d", strtotome($reserve[checkin].'+'.$i.' days')); // $res = $dbs->query("select avail.*, hotels.id as hotelId, hotels.en_name, hotels.star from hotel_avail as avail inner join hotels on avail.hotels_id=hotels.id // where hotels.country_id='$reserve[country_id]' and hotels.city_id='$reserve[city_id]' and avail.tarikh=$checkDate and avail.capa>=$room[adult]"); // if (mysqli_num_rows($res)) { // while ($row = mysqli_fetch_array($res)) { // // } // } // } // } // // if (mysqli_num_rows($res)) { // while ($row = mysqli_fetch_array($res)) { // $result[]=array( // 'hotel_id'=>$row[hotelId], // 'hotel_name'=>$row[en_name], // 'hotel_star'=>$row[star],
<?php include '../../phpdb/dbExpertConnector.php'; $connector = new dbConnector(); $buffer = $connector->query("SELECT block_id,bioblock_id,tree,treestring,sequences,full_score,submitted_score FROM expertblocks"); $buffer2 = $connector->query("SELECT block_id,base_score,bio_highscore,game_par,game_highscore FROM bioblocks"); $bioblocktable = array(); while ($myrow = $connector->fetchArray($buffer2)) { $id = $myrow['block_id']; $bioblocktable[$id] = array(); $bioblocktable[$id]['bio_par'] = $myrow['base_score']; $bioblocktable[$id]['bio_hs'] = $myrow['bio_highscore']; $bioblocktable[$id]['game_par'] = $myrow['game_par']; $bioblocktable[$id]['game_hs'] = $myrow['game_highscore']; $bioblocktable[$id]['count'] = 0; } while ($myrow = $connector->fetchArray($buffer)) { /* misc variables */ $blockid = $myrow['block_id']; $tree_string = $myrow['treestring']; $refid = $myrow['bioblock_id']; /* build species list */ $tree_struct = $myrow['tree']; $speclist = array(); $newid = ""; for ($i = 0; $i <= strlen($tree_struct); $i++) { $carac = substr($tree_struct, $i, 1); if ($carac == '(' or $carac == ')' or $carac == ',') { if ($newid != "") { array_push($speclist, $newid); $newid = "";
function GetDBConnection() { $dbConnection = new dbConnector(); $dbConnectProperty = new dbConnectProperty(); $dbConnection->setCustomConnectionParameters($dbConnectProperty); $dbConnection->connect(); $dbConnection->selectDatabase("peep_track"); return $dbConnection; }
public function get_By_id($id) { $sql = "select * from invoice where id=" . $id; $db = new dbConnector(); $result = $db->query($sql); $rst = array(); $row = $result->fetch_assoc(); return $row; }
<?php error_reporting('E_ALL ~E_NOTICE'); require "class/DB.php"; $dbs = new dbConnector(); $reserve = $_POST["reserve"]; $res = $dbs->query("select avail.*, hotels.en_name, hotels.star from hotel_avail as avail inner join hotels on avail.hotels_id=hotels.id\n where hotels.country_id='{$reserve['country_id']}' and hotels.city_id='{$reserve['city_id']}' and avail.tarikh>={$reserve['checkin']}\n and avail.tarikh<={$reserve['checkout']} and avail.capa>={$reserve['adult']}"); if (mysqli_num_rows($res)) { while ($row = mysqli_fetch_array($res)) { } } else { }