当前位置: 首页>>代码示例>>PHP>>正文


PHP DB_Functions::deleteUser方法代码示例

本文整理汇总了PHP中DB_Functions::deleteUser方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_Functions::deleteUser方法的具体用法?PHP DB_Functions::deleteUser怎么用?PHP DB_Functions::deleteUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DB_Functions的用法示例。


在下文中一共展示了DB_Functions::deleteUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: send_notification

 /**
  * Sending Push Notification
  */
 public function send_notification($registration_ids, $message)
 {
     // include config
     require_once 'config.php';
     // Set POST variables
     $url = 'https://android.googleapis.com/gcm/send';
     $fields = array('registration_ids' => $registration_ids, 'data' => $message);
     $headers = array('Authorization: key=' . GOOGLE_API_KEY, 'Content-Type: application/json');
     // Open connection
     $ch = curl_init();
     // Set the url, number of POST vars, POST data
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_POST, true);
     curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     // Disabling SSL Certificate support temporarly
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
     // Execute post
     $result = curl_exec($ch);
     if ($result === FALSE) {
         die('Curl failed: ' . curl_error($ch));
     } else {
         $jsonres = json_decode($result);
         if (!empty($jsonres->results)) {
             require_once 'db_functions.php';
             $db = new DB_Functions();
             for ($i = 0; $i < count($jsonres->results); $i++) {
                 if (isset($jsonres->results[$i]->registration_id)) {
                     $new = $db->updateUser($registration_ids[$i], $jsonres->results[$i]->registration_id);
                 } else {
                     if (isset($jsonres->results[$i]->error)) {
                         if ($jsonres->results[$i]->error == "NotRegistered") {
                             $res = $db->deleteUser($registration_ids[$i]);
                         }
                     }
                 }
             }
             echo $result . "\n";
             $canonical_ids_count = $jsonres->canonical_ids;
             if ($canonical_ids_count) {
                 echo count($canonical_ids_count) . " registrations updated\n";
             }
         }
     }
     // Close connection
     curl_close($ch);
 }
开发者ID:MumbaiHackerspace,项目名称:kzpa,代码行数:51,代码来源:GCM.php

示例2: array

<?php

// response json
$json = array();
/**
 * Registering a user device
 * Store reg id in users table
 */
if (isset($_POST["regId"])) {
    $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();
    $res = $db->deleteUser($gcm_regid);
    $registatoin_ids = array($gcm_regid);
    $message = array("Price" => "<data><title>Unregister</title> <description>You'ar now unrgistered for the app you will no longer receive any notifications.</description></data>");
    $result = $gcm->send_notification($registatoin_ids, $message);
    echo $result;
} else {
    // user details missing
}
?>
		
开发者ID:Yazany6b,项目名称:php-repo,代码行数:24,代码来源:unregister.php

示例3:

include_once 'db_functions.php';
$db = new DB_Functions();
if (isset($_POST["status"])) {
    $result = $db->editActiveUser($_POST["status"], $_POST["SNo"]);
}
if (isset($_POST["permission"])) {
    $result = $db->editPermissionUser($_POST["permission"], $_POST["UserId"]);
}
if (isset($_POST["AdminUserId"])) {
    $result = $db->editAdminUser($_POST["permissionAdmin"], $_POST["AdminUserId"]);
}
if (isset($_POST["AuditorUserId"])) {
    $result = $db->editAuditorUser($_POST["permissionAuditor"], $_POST["AuditorUserId"]);
}
if (isset($_POST["DeleteUserId"])) {
    $result = $db->deleteUser($_POST["DeleteUserId"]);
}
if (isset($_POST["DeleteReport"])) {
    $result = $db->deleteReportRow($_POST["DeleteReport"]);
}
if (isset($_POST["ChangePassword"])) {
    $result = $db->changePassword($_POST["ChangePassword"], $_POST["Email"], $_POST["Pass"]);
}
if (isset($_POST["replaceName"])) {
    $result = $db->replaceResponsible($_POST["replaceName"], $_POST["newName"]);
}
if (isset($_POST["ChangeEmailId"])) {
    $result = $db->editEmail($_POST["ChangeEmailId"], $_POST["NewEmailId"]);
}
if (isset($_POST["ChangePasswordId"])) {
    $result = $db->editPasswordById($_POST["ChangePasswordId"], $_POST["NewPassword"]);
开发者ID:ameerhamza26,项目名称:audit,代码行数:31,代码来源:posting.php


注:本文中的DB_Functions::deleteUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。