function deleteUser($empid) { $sql = "DELETE FROM employees WHERE id=:id"; try { $db = getDB(); $stmt = $db->prepare($sql); $stmt->bindParam("id", $empid); $stmt->execute(); $db = null; //echo true; loadUsers(); } catch (PDOException $e) { echo '{"error":{"text":' . $e->getMessage() . '}}'; } }
public function __construct($companyID) { $this->gremlin = new Gremlin(); #load company's info from ID $sql = "SELECT * FROM company WHERE cmp_id='{$companyID}'"; $rawData = $gremlin->query($sql); extract($rawData); $this->companyID = $companyID; $this->active = $active; $this->name = $name; $this->address = $address; $this->city = $city; $this->state = $state; $this->zip = $zip; loadUsers(); loadDistributors(); }
<br> <div class="col s12"> <div class="card-panel"> <h4 class="left-align">Profil</h4> <?php if (isset($_GET['update'])) { if ($_GET['update'] == "success") { ?> <blockquote class="green-text">User is updated</blockquote> <?php } } ?> <div class="row"> <?php $user = loadUsers(getUsername()); ?> <form action="proses.php" method="post" class="col s12"> <div class="row"> <div class="input-field col s6"> <i class="material-icons prefix">account_circle</i> <input name="firstname" id="firstname" type="text"<?php if (!isset($_GET['stat'])) { ?> disabled <?php } ?> class="validate" required value="<?php echo $user[1]; ?> ">
$limit = $validator->optionalGetVar('limit'); $user_id = $validator->optionalGetVar('user_id'); $group_id = $validator->optionalGetVar('group_id'); // Add alerts for any failed input validation foreach ($validator->errors as $error) { addAlert("danger", $error); } if ($user_id) { // Special case to load groups for the logged in user if ($user_id == "0") { $user_id = $loggedInUser->user_id; } if (!($results = loadUser($user_id))) { echo json_encode(array("errors" => 1, "successes" => 0)); exit; } } else { if ($group_id) { if (!($results = loadUsersInGroup($group_id))) { echo json_encode(array("errors" => 1, "successes" => 0)); exit; } } else { if (!($results = loadUsers($limit))) { echo json_encode(array("errors" => 1, "successes" => 0)); exit; } } } restore_error_handler(); echo json_encode($results);
$get = $v->data(); } // Generate button display modes $buttons_render = ['add', 'view_all']; if (isset($get['buttons']['add'])) { $buttons_render['add']['hidden'] = ""; } else { $buttons_render['add']['hidden'] = "hidden"; } if (isset($get['buttons']['view_all'])) { $buttons_render['view_all']['hidden'] = ""; } else { $buttons_render['view_all']['hidden'] = "hidden"; } // Load users if (($users = loadUsers($get['limit'])) === false) { apiReturnError($ajax, ACCOUNT_ROOT); } // Compute user table properties foreach ($users as $user_id => $user) { $users[$user_id]['user_status'] = "Active"; $users[$user_id]['user_status_style'] = "primary"; $date_disp = formatDateComponents($user['last_sign_in_stamp']); $users[$user_id]['last_sign_in_day'] = $date_disp['day']; $users[$user_id]['last_sign_in_date'] = $date_disp['date']; $users[$user_id]['last_sign_in_time'] = $date_disp['time']; $date_disp = formatDateComponents($user['sign_up_stamp']); $users[$user_id]['sign_up_day'] = $date_disp['day']; $users[$user_id]['sign_up_date'] = $date_disp['date']; $users[$user_id]['sign_up_time'] = $date_disp['time']; if ($user['active'] == '1') {
} ?> }</script><?php } else { $errorMessage2 = "[SERVER-SIDE CHECK] Impossibile promuovere, degradare, validare, sospendere o eliminare il proprio account. Richiedere la modifica ad un altro amministratore di PartySmile."; } } ?> <p class="info5" id="errorMessage2"><?php echo $errorMessage2; ?> </p> <h3>Lista degli utenti iscritti</h3> <?php $lista_iscritti = loadUsers(); $administrator = ""; $validated = ""; echo "<table>"; echo "<tr><td>Username</td><td>Amministratore</td><td>Utente Validato</td></tr>"; for ($i = 0; $i < count($lista_iscritti); $i = $i + 3) { if ($lista_iscritti[$i + 1] == 1) { $administrator = "si"; } else { $administrator = "no"; } if ($lista_iscritti[$i + 2] == 1) { $validated = "si"; } else { $validated = "no"; }
<label class="active" for="country">Country</label> </div> </div> <div class="row"> <div class="input-field col s3"> <i class="material-icons prefix active">markunread_mailbox</i> <input name="postcode" id="postcode" type="text" value="<?php echo loadUsers($_GET['userid'])['postcode']; ?> " class="validate" disabled> <label class="active" for="postcode">Postcode</label> </div> <div class="input-field col s9"> <i class="material-icons prefix active">email</i> <input name="email" id="email" type="email" value="<?php echo loadUsers($_GET['userid'])['email']; ?> " class="validate" disabled> <label class="active" for="email">Email</label> </div> </div> <div class="divider"></div><br> <div class="row"> <div class="col s12"> <p class="center-align"> <button class="btn btn-block waves-effect waves-light" type="submit" name="delete">Delete</button> </p> </div> </div> </form> </div>
public function list_all_users() { $users = loadUsers(); return view('users.list', compact('users')); }
function addUser($userData) { $fh = fopen("users.db", "a"); fwrite($fh, $userData . "\n"); fclose($fh); } #php://input returns the raw data from the request $input = json_decode(file_get_contents("php://input")); $id = $input->registration_ids; $msg = $input->data[0]->message; echo "ID id {$id}\n"; echo "Message is " . $msg . "\n"; #hardcoded for testing only: $multicast_id = "5574652367352264803"; $message_id = "0:1446505844247516%934ed4baf9fd7ecd"; if (!in_array($id, loadUsers())) { #Build a record for the file $record = $id . "/" . $multicast_id . "/" . $message_id; adduser($record); #send back an ack via gcm $toUrl = "https://android.googleapis.com/gcm/send"; $apiKey = "AIzaSyAFTdicdJZKMBVdsC-ygVu2b4JehB-cIQQ"; $devices = array($id); $pm = new ChatProtoPushMessage($api_key, $url); $pm->setDevices($devices); $response = $pm->send($msg); return $response; } else { #Its already registered, so silently discard. return 0; }
loadRounds(); } if ($type == "changeChallangesNumber") { changeChallangesNumber($data); } if ($type == "changeStatus") { changeStatus($data); } if ($type == "loadTeams") { loadTeams($data); } if ($type == "loadPlayers") { loadPlayers($data); } if ($type == "loadUsers") { loadUsers(); } if ($type == "addPlayer") { addPlayer($data); } if ($type == "loadChalleneges") { loadChalleneges(); } if ($type == "loadChallengeText") { loadChallengeText(); } if ($type == "addLink") { addLink($data); } if ($type == "loadLinks") { loadLinks($data);
<div class="row"> <div class="col s12"> <div class="row"> <div class="input-field col s6"> <input id="firstname" name="firstname" type="text" class="validate" <?php if (isset($_GET['user'])) { echo 'value="' . loadUsers(getUsername())[1] . '" readonly'; } ?> > <label for="firstname">First Name</label> </div> <div class="input-field col s6"> <input id="lastname" name="lastname" type="text" class="validate" <?php if (isset($_GET['user'])) { echo 'value="' . loadUsers(getUsername())[2] . '" readonly'; } ?> > <label for="lastname">Last Name</label> </div> </div> <div class="row"> <div class="col s12"><label>FROM</label></div> <div class="col s6"> <?php $koneksi = mysql_connect('localhost', 'root', ''); mysql_select_db('mtrain', $koneksi); $query = "SELECT * FROM venue GROUP BY venuelocation"; $mQuery = mysql_query($query); ?>