本文整理汇总了PHP中DB_Functions::getAllUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_Functions::getAllUsers方法的具体用法?PHP DB_Functions::getAllUsers怎么用?PHP DB_Functions::getAllUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_Functions
的用法示例。
在下文中一共展示了DB_Functions::getAllUsers方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smartpush
function smartpush($uid, $message)
{
include "db_functions.php";
include "gcm.php";
$gcm = new GCM();
$db = new DB_Functions();
$users = $db->getAllUsers();
if ($users != false) {
$no_of_users = mysql_num_rows($users);
} else {
$no_of_users = 0;
}
if ($no_of_users > 0) {
while ($row = mysql_fetch_array($users)) {
$regId = $row['gcm_regid'];
// $message = "สวัสดีชาวโลก";
$registatoin_ids = array($regId);
// $message = array("price" => $message);
$result = $gcm->send_notification($registatoin_ids, $message);
//echo $result;
}
} else {
echo "ไม่มีข้อมูล";
}
}
示例2: usersList
function usersList()
{
$db = new DB_Functions();
$users = $db->getAllUsers();
if ($users != false) {
$no_of_users = mysql_num_rows($users);
} else {
$no_of_users = 0;
}
echo '<li><a >All</a></li>';
if ($no_of_users > 0) {
while ($row = mysql_fetch_array($users)) {
echo '<li><a >' . $row["Name"] . '</a></li>';
}
} else {
echo '<li>No Users Registered Yet!</li>';
}
}
示例3: from
ul.devices li .send_btn{
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0096FF), to(#005DFF));
background: -webkit-linear-gradient(0% 0%, 0% 100%, from(#0096FF), to(#005DFF));
background: -moz-linear-gradient(center top, #0096FF, #005DFF);
background: linear-gradient(#0096FF, #005DFF);
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
border-radius: 3px;
color: #fff;
}
</style>
</head>
<body>
<?php
include_once 'funciones.php';
$db = new DB_Functions();
$users = $db->getAllUsers();
if ($users != false) {
$no_of_users = mysql_num_rows($users);
} else {
$no_of_users = 0;
}
?>
<div class="container">
<h1>N° de dispositivos registrados: <?php
echo $no_of_users;
?>
</h1>
<hr/>
<ul class="devices">
<?php
if ($no_of_users > 0) {
示例4: while
$response["user"]["name"] = $user["name"];
$response["user"]["email"] = $user["email"];
$response["user"]["username"] = $user["username"];
$response["user"]["phone"] = $user["phone"];
$response["user"]["lat"] = $user["lat"];
$response["user"]["longi"] = $user["lng"];
echo json_encode($response);
} else {
// User not found
// echo JSON with error
$response["error"] = 1;
echo json_encode($response);
}
} else {
if ($tag == 'getContacts') {
while ($user = $db->getAllUsers()) {
$res["use"]["username"] = $user["username"];
$res["use"]["latitude"] = $user["lat"];
$res["use"]["longitude"] = $user["lng"];
$response["user"][] = $res;
}
$response["success"] = 1;
echo json_encode($response);
} else {
if ($tag == 'getGpsData') {
$phone = $_POST['phone'];
// Check for User
$user = $db->getGpsData($phone);
if ($user != false) {
// user found
// echo JSON with Success
示例5: array
// response json
$json = array();
/**
* Registering a user device
* Store reg id in users table
*/
if (isset($_POST["name"]) && isset($_POST["email"]) && isset($_POST["regId"])) {
$name = $_POST["name"];
$email = $_POST["email"];
$gcm_regid = $_POST["regId"];
// GCM Registration ID
// Store user details in db
include_once './db_functions.php';
include_once './GCM.php';
$db = new DB_Functions();
$gcm = new GCM();
$allUser = $db->getAllUsers();
while ($row = mysql_fetch_assoc($allUser)) {
if ($gcm_regid == $row['gcm_regid']) {
exit;
}
}
$res = $db->storeUser($name, $email, $gcm_regid);
$registatoin_ids = array($gcm_regid);
//$message = array("product" => "shirt");
$message = "앱이 성공적으로 설치되었습니다.";
$result = $gcm->send_notification($registatoin_ids, $message);
echo $result;
} else {
// user details missing
}
示例6:
<title>Gray Routes GCM</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class = "container">
<center>
<?php
require_once 'db_functions.php';
$db = new DB_Functions();
$users = $db->getAllUsers();
$email = $db->getAllUsersEmail();
$name = $db->getAllUsers();
if ($users != false) {
$no_of_users = mysql_num_rows($users);
} else {
$no_of_users = 0;
}
?>
<h1>Devices Registered: <?php
echo $no_of_users;
?>
</h1>
<hr/>
<?php
if ($no_of_users > 0) {