public function add(User $user) { $query = $this->_db->prepare('INSERT INTO t_user (login, password, created, profil, status) VALUES (:login, :password, :created, :profil, :status)') or die(print_r($this->_db->errorInfo())); $query->bindValue(':login', $user->login()); $query->bindValue(':password', $user->password()); $query->bindValue(':created', $user->created()); $query->bindValue(':profil', $user->profil()); $query->bindValue(':status', $user->status()); $query->execute(); $query->closeCursor(); }
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/global.php'; require_once DOC_ROOT . '/includes/classes/class.html.php'; require_once DOC_ROOT . '/includes/classes/class.user.php'; require_once DOC_ROOT . '/includes/classes/class.sms_gateway.php'; $id = get_param('id'); $code = get_param('code'); $user = new User($id); if ($code == '11235') { $user->status(1); $result = $user->update(); echo 'Updated.'; echo 'Result:<pre>'; print_r($result); echo '</pre>'; }
if ($action == 'deleteContent') { $content = new Content(); $content->storeFormValues($_GET); $content->delete(); } // enable the user profile if ($action == 'enableUser') { $user = new User(); $user->storeFormValues($_GET); $user->status(); } // disable the user profile if ($action == 'disableUser') { $user = new User(); $user->storeFormValues($_GET); $user->status(); } // delete the user profile if ($action == 'deleteUser') { $user = new User(); $user->storeFormValues($_GET); $user->delete(); } // enable the group if ($action == 'enableGroup') { $user = new Group(); $user->storeFormValues($_GET); $user->status(); } // disable the group if ($action == 'disableGroup') {