public static function userAdd($userId, $option, $value = '') { $db = Database::getDatabase(); if (Options::userExists($userId, $option)) { $db->query('UPDATE options_users SET `value`=:value: WHERE `key`=:key: and `user_id`=:user_id:', array('key' => $option, 'value' => $value, 'user_id' => $userId)); /*echo "Update option";*/ } else { $db->query('INSERT INTO options_users (`user_id`, `key`, `value`) VALUES (:user_id:, :key:, :value:)', array('user_id' => $userId, 'key' => $option, 'value' => $value)); /*echo "Inserted new option";*/ } return $db->affectedRows(); }
<th>Group</th> <th>First Name</th> <th>Surname</th> <th>Birthdate</th> </tr> </thead> <tbody> <?php foreach ($users as $id => $values) { echo "<tr>" . nl(); echo "<td>" . $values['username'] . "</td>" . nl(); echo "<td><a class='btn' href='mailto:" . $values['email'] . "?subject=Hi There'>Send Email</i></a></td>" . nl(); echo "<td>" . $values['group'] . "</td>" . nl(); echo "<td>" . Options::userGet($id, 'firstName') . "</td>" . nl(); echo "<td>" . Options::userGet($id, 'surname') . "</td>" . nl(); $dob = Options::userExists($id, 'dateOfBirth') ? time2str(Options::userGet($id, 'dateOfBirth')) : ''; echo "<td>" . $dob . "</td>" . nl(); echo "</tr>" . nl(); } } ?> </tbody> </table> <?php if (isset($pager)) { echo $pager; } // Print Pager } else {