Beispiel #1
0
 public function get_status()
 {
     $UserID = $_POST['UserID'];
     $status = $_POST['status'];
     $type = $_GET['ask_method'];
     $res = new dbconnect();
     $sql = "select* from users where UserName='******'";
     $row = $res->connect($sql);
     if ($UserID == "" || $status == "") {
         $code = "409";
         $msg = "error:UserID or status can not be empty!";
         $data = "null";
         $result = api_response::api_method($type, $code, $msg, $data);
         return $result;
     } else {
         if ($row['status'] == $status && $status != "") {
             $code = "200";
             $msg = "success!";
             $data = array('id' => "{$row['id']}", 'UserID' => "{$row['UserName']}", 'openid' => "{$row['openid']}", 'nickname' => "{$row['nickname']}", 'headimgurl' => "{$row['headimgurl']}", 'sex' => "{$row['sex']}", 'mobile' => "{$row['mobile']}");
             $result = api_response::api_method($type, $code, $msg, $data);
         } else {
             $code = "406";
             $msg = "error:Failure login status!";
             $data = "null";
             $result = api_response::api_method($type, $code, $msg, $data);
         }
         return $result;
     }
 }
Beispiel #2
0
 public function permission()
 {
     session_start();
     $infoarr = @$_SESSION['user'];
     $media_id = @$_GET['media_id'];
     $type = @$_GET['ask_method'];
     $sql = "select*from card where media_id='{$media_id}'";
     $result = new dbconnect();
     $row = $result->connect($sql);
     if ($infoarr['openid'] != "") {
         if ($row['from_openid'] == $infoarr['openid'] || $row['to_openid'] == $infoarr['openid']) {
             if ($media_id == "") {
                 $url = "http://weixin.faeries-land.com/test/player.html?ask_method=json&media_id={$media_id}&Token=";
             } else {
                 include "../cache/" . $media_id . ".php";
                 $Token = $Token['token'];
                 $url = "http://weixin.faeries-land.com/test/player.html?ask_method=json&media_id={$media_id}&Token={$Token}&ask_method=json";
             }
         } else {
             $url = "http://weixin.faeries-land.com/test/player.html?ask_method=json&media_id={$media_id}&Token=";
         }
         $code = new code();
         $code->code_make($url, $media_id);
         $this->show($row, $type);
     } else {
         $code = -1;
         $msg = "error:You have to use wechat app to open! ";
         $data = "null";
         api_response::api_method($type, $code, $msg, $data);
     }
 }
Beispiel #3
0
 public function connect_pdb()
 {
     if (!isset($pdb)) {
         $pdb = new dbconnect();
         $pdb->db_conn();
     }
     return $pdb;
 }
Beispiel #4
0
 function getAllBirthdays()
 {
     $result = array();
     $conn = new dbconnect();
     $conn->setHandler()->query("SELECT * FROM Person");
     var_dump($conn);
     //$a = $conn->handler;
     //$result = $conn->handler->query("SELECT * FROM Person");
     return $result;
 }
Beispiel #5
0
 public function show_receive()
 {
     $infoarr = @$_SESSION['user'];
     $type = @$_GET['ask_method'];
     $sql = "select*from card  where to_openid='{$infoarr['openid']}'";
     $result = new dbconnect();
     $row = $result->connect($sql);
     if (empty($row)) {
         $code = -1;
         $msg = "error:The info not exist! ";
         $data = "null";
         $result = api_response::api_method($type, $code, $msg, $data);
     } else {
         while ($row = $result->connect($sql)) {
             $data = array('media_id' => "{$row['media_id']}", 'title' => "{$row['title']}", 'content' => "{$row['content']}", 'create_at' => "{$row['create_at']}", 'From_nickname' => "{$row['From_nickname']}", 'To_nickname' => "{$row['To_nickname']}", 'code_url' => "http://weixin.faeries-land.com/card/ask_cardinfo.php?media_id={$row['media_id']}");
             $code = 0;
             $msg = "success!";
             $result = api_response::api_method($type, $code, $msg, $data);
         }
     }
     return $result;
 }
Beispiel #6
0
<?php

/**
 * Created by PhpStorm.
 * User: SHESHA
 * Date: 14-07-2015
 * Time: 08:17 PM
 */
//Includes
require_once "./dbconnect.php";
$dbobj = new dbconnect();
//Check for all required post params
$isValidPost = $_GET["pass"] == "talentspear" ? true : false;
if ($isValidPost) {
    $connection = $dbobj->getDB();
    $get_contacts = "SELECT * from quick_contacts";
    $get_res = mysqli_query($connection, $get_contacts);
    echo "{\"contacts\":";
    $contacts = "";
    while ($row = mysqli_fetch_assoc($get_res)) {
        $contacts[] = $row;
    }
    echo json_encode($contacts);
    echo "}";
} else {
    die("{\"status\":\"0\"}");
}
Beispiel #7
0
$gender = "";
$search = "";
if (isset($_GET['year'])) {
    $year = $_GET['year'];
}
if (isset($_GET['region'])) {
    $region = $_GET['region'];
}
if (isset($_GET['gender'])) {
    $gender = $_GET['gender'];
}
if (isset($_GET['search'])) {
    $search = $_GET['search'];
}
// DB接続
$dbconnect = new dbconnect();
$pdo = $dbconnect->connect();
// 年
function getYear()
{
    global $year;
    for ($y = date("Y"); $y >= 2003; $y--) {
        echo "<OPTION value='" . $y . "'";
        if ($y == $year) {
            echo selected;
        }
        echo ">" . $y . "</OPTION>";
    }
    echo "<OPTION value='1982' ";
    if ($y == 1982) {
        echo selected;
 private function func_execute()
 {
     $this->connection = parent::func_query($this->query, $this->query_data);
 }
Beispiel #9
0
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<meta http-equiv="Expires" content="Tue,01 Jan 1995 12:12:12 GMT">
		<meta http-equiv="Pragma" content="no-cache">
		<title>DEPLOY-0</title>
	</head>
	<body>


	<?php 
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/php/dbconnect.php";
include_once $path;
$memcache = new Memcache();
$memcache->connect('localhost', 11211);
$memcache->flush();
$dbA = new dbconnect();
$dbA->db_con();
$result = $dbA->db_query("CREATE USER 'apache'@'localhost'");
$result = $dbA->db_query("GRANT ALL ON *.* TO 'apache'@'localhost'");
$result = $dbA->db_query("FLUSH PRIVILEGES");
echo "created temp apache user<br>";
exec('/bin/cat /var/www/html/sql/schema.sql |/usr/bin/mysql', $output, $rv);
echo "Schema update Run<br>";
//echo "$output[0]";
echo "<br>";
$result = $dbA->db_query("INSERT INTO `organisations` (`name`) VALUES('TempOrg')");
echo "<br>Created TempOrg record<br>";
$result = $dbA->db_query("INSERT INTO `user_profiles` (`organisations_id`,`name`) VALUES(1,'Default-Temp')");
echo "Created Default temp user profile record<br>";
$result = $dbA->db_query("INSERT INTO `user_profiles` (`organisations_id`,`name`) VALUES(1,'Default-Prereg')");
echo "Created Default user pre-reg profile record<br>";
Beispiel #10
0
 public function show_info()
 {
     $type = @$_GET['ask_method'];
     $sql = "select*from card where openid='{$infoarr['openid']}'";
     $result = new dbconnect();
     $row = $result->connect($sql);
     if ($row) {
         $code = 0;
         $msg = "success!";
         $data = array('media_id' => "{$row['media_id']}");
         api_response::api_method($type, $code, $msg, $data);
     } else {
         $code = -1;
         $msg = "error:The info not exist!";
         $data = "null";
         api_response::api_method($type, $code, $msg, $data);
     }
 }
Beispiel #11
0
<?php

/**
 * Created by PhpStorm.
 * User: SHESHA
 * Date: 14-07-2015
 * Time: 08:17 PM
 */
//Includes
require_once "./dbconnect.php";
$dbobj = new dbconnect();
//Check for all required post params
$isValidPost = $dbobj->validatePost(array("mid"));
if ($isValidPost) {
    $connection = $dbobj->getDB();
    $epost = $dbobj->escapePost(array("mid"), $connection);
    $get_query = "SELECT id,thread,catid,time,modified_time,subject from rnbje_kunena_messages WHERE id='{$epost["mid"]}'";
    $get_res = mysqli_query($connection, $get_query);
    $ids = array();
    while ($row = mysqli_fetch_assoc($get_res)) {
        $ids[] = $row["id"];
        $tid = $row["thread"];
        $cid = $row["catid"];
        $time[] = $row["time"];
        $mtime[] = $row["modified_time"];
        $sub[] = json_encode($row["subject"]);
    }
    $len = count($ids);
    $attachments = array();
    for ($i = 0; $i < $len; $i++) {
        $attach_query = "SELECT id from rnbje_kunena_attachments WHERE mesid='{$ids[$i]}'";
Beispiel #12
0
 function __construct()
 {
     $this->db = dbconnect::CreateDatabaseResource();
 }
Beispiel #13
0
    {
        $ret = array();
        $results = $this->con->query($command, MYSQLI_USE_RESULT);
        while ($row = $results->fetch_row()) {
            array_push($ret, $row);
        }
        return $ret;
    }
    // Counts rows retrieved from query
    public function queryCount($command)
    {
        $results;
        $count = 0;
        if ($results = $this->con->query($command)) {
            $count = $results->num_rows;
        }
        return $count;
    }
    public function close()
    {
        $this->con->close();
    }
}
$connection = new dbconnect("192.168.1.20", "jeegna", "password", "just_lee");
$connection->initializeConnection();
$i = $connection->query("SELECT * FROM AUTHOR");
foreach ($i as $j) {
    $k = $j[1];
    echo $k . " : ";
}
$connection->close();
Beispiel #14
0
/* 
   Setup file php inlog system, made by Eldin Zenderink from scratch. 
* I am to lazy to look up the license stuff, but: 
* these scripts are free for ever, I would like to see some credit, hidden on a page for example, but if you dont want to, thats fine
* Also if you want to show me your project with this little login scriptie, post it here: ask.fm/rareamv
*/
include_once "db.php";
//database connection setup
$pw = 'Negami-Senpai';
$dburl = 'mysql.grendelhosting.com';
$uname = 'u478222806_rare';
$dbname = 'u478222806_user';
//contains all things needed to connect to an database
$dbsetup = array("pw" => $pw, "dburl" => $dburl, "uname" => $uname, "dbname" => $dbname);
//connects to database
$dbcon = new dbconnect($dbsetup);
$con = $dbcon->connect();
//My db exists out of 6 columns, 1 column is an auto increment primery key called ID <- might need this in future
$table = 'reg_user';
// table naam
$column1 = 'nick';
//var_char(15) unique, but do whatever you need
$column2 = 'password';
//tiny text, can also be var_char, but I got some problems creating my db, so i used this
$column3 = 'email';
// var_char (255) <- unique, should be enough for email, could also use tiny text, but i am random
$column4 = 'verificationurl';
//tiny text <- should be unique, i should use var_char here since this is random generated but with a max char of 10 XD, wups
$column5 = 'verified';
//var_char(3) <- is null if not verified, if it is verified, it will change into "yes", but you can set that to whatever you want
//contains all vars needed to connect to an database, including the connecting data