/** * Getting all users */ public function getAllUsers() { $c = new DB_Connect(); $d = $c->connect(); $result = mysqli_query($d, "select * FROM gcm_users"); return $result; }
function __construct() { require_once 'include/DB_Connect.php'; // connecting to database $db = new DB_Connect(); $this->conn = $db->connect(); }
function __construct() { $path = elgg_get_plugins_path(); include_once $path . 'elgg_with_rest_api/lib/DB_connect.php'; $conn = new DB_Connect(); $this->db = $conn->connect(); }
function __construct() { $path = elgg_get_plugins_path(); include_once $path . 'web_services/lib/DB_connect.php'; $conn = new DB_Connect(); $this->db = $conn->connect(); }
require_once __DIR__ . '/include/util.inc'; require_once __DIR__ . '/include/db_connect.php'; require_once '/home/vcap/app/lib/vendor/autoload.php'; use PhpAmqpLib\Connection\AMQPConnection; use PhpAmqpLib\Message\AMQPMessage; //header('Content-type: text/html'); header('Access-Control-Allow-Origin: *'); $services = getenv('VCAP_SERVICES'); $json = json_decode($services, TRUE); $hostname = $json['p-rabbitmq'][0]['credentials']['protocols']['amqp']['host']; $user = $json['p-rabbitmq'][0]['credentials']['protocols']['amqp']['username']; $password = $json['p-rabbitmq'][0]['credentials']['protocols']['amqp']['password']; $port = $json['p-rabbitmq'][0]['credentials']['protocols']['amqp']['port']; $vhost = $json['p-rabbitmq'][0]['credentials']['protocols']['amqp']['vhost']; $db = new DB_Connect(); $db->connect(); $system_id = string_escape(util_aiod($_POST, 'ID', "")); $name = string_escape(util_aiod($_POST, 'name', "")); $type = 'Thin'; $capacity = string_escape(util_aiod($_POST, 'capacity', "")); $offset = 0; $sq = 'gb'; $pool_id = '0'; $sp = string_escape(util_aiod($_POST, 'sp', "")); $auto_assignment = '1'; $tiering_policy = 'autoTier'; $initial_tier = 'highestAvailable'; $cmd = "naviseccli lun -create -type " . $type . " -capacity " . $capacity . " -sq " . $sq . " -poolId " . $pool_id . " -sp " . $sp . " -aa " . $auto_assignment . " -name " . $name . " -offset " . $offset . " -tieringPolicy " . $tiering_policy . " -initialTier " . $initial_tier; $result = mysql_query("INSERT INTO `requests` (system_id, cmd, type, status) values ('{$system_id}', '{$cmd}', 'create_lun', 'N');"); $tuple_id = mysql_insert_id(); $connection = new AMQPConnection($hostname, $port, $user, $password, $vhost);
<?php if (isset($_POST['submit'])) { include_once 'db_functions.php'; $db = new DB_Functions(); $email = "test"; $i = 0; $regId = array(); $msg = array(); $message = $_POST["message"]; include_once './gcm.php'; $gcm = new GCM(); $c = new DB_Connect(); $d = $c->connect(); $res = mysqli_query($d, "SELECT * FROM gcm_users WHERE email = '{$email}'") or die(mysql_error()); while ($row = mysqli_fetch_array($res)) { $regId[$i] = $row["gcm_regid"]; $msg[$i] = $message; $i = $i + 1; } for ($j = 0; $j < sizeof($regId); $j = $j + 1) { $registatoin_ids = array($regId[$j]); $message = array("price" => $msg[$j]); $result = $gcm->send_notification($registatoin_ids, $message); echo $result; } }
<?php /* preverjanje stanja login! require_once 'include/DB_Functions.php'; $db = new DB_Functions(); $IsLogedIn=$db->IsLogedIn(); */ if ($_SERVER['REQUEST_METHOD'] == 'POST') { require_once 'include/DB_Connect.php'; $db1 = new DB_Connect(); $con = $db1->connect(); $_SESSION['UserName'] = mysqli_real_escape_string($con, $_POST['user']); $_SESSION['FirstName'] = mysqli_real_escape_string($con, $_POST['fname']); $_SESSION['LastName'] = mysqli_real_escape_string($con, $_POST['lname']); $_SESSION['Email'] = mysqli_real_escape_string($con, $_POST['email']); require_once 'include/DB_Functions.php'; $db = new DB_Functions(); $password = mysqli_real_escape_string($con, $_POST['pass']); $cpassword = mysqli_real_escape_string($con, $_POST['cpass']); $signup = $db->SignUp($password, $cpassword); if ($_SESSION['sucess'] == "Your registration is completed!") { $_SESSION['FirstName'] = ""; $_SESSION['LastName'] = ""; $_SESSION['Email'] = ""; // preusmeritev na login! } } else { $_SESSION['UserName'] = ''; $_SESSION['FirstName'] = ''; $_SESSION['LastName'] = ''; $_SESSION['Email'] = '';
function __construct() { require_once 'DB_Connect.php'; $db = new DB_Connect(); $this->conn = $db->connect(); }