PHP User::setNextel Examples

PHP User::setNextel - 2 examples found. These are the top rated real world PHP examples of User::setNextel extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
$u = new User();
$p = fRequest::encode('password', 'string') . SALT;
$p = md5($p);
$p = base64_encode($p);
$p = hash('sha256', $p);
try {
    $u->setIdRole(fRequest::encode('role', 'integer'));
    $u->setEmail(fRequest::encode('email', 'string'));
    $u->setPassword($p);
    $u->setFirstName(fRequest::encode('firstName', 'string'));
    $u->setLastName(fRequest::encode('lastName', 'string'));
    $u->setBirthday(fRequest::encode('birthday', 'date'));
    $u->setPhone(fRequest::encode('phone', 'string'));
    $u->setCellphone(fRequest::encode('cellphone', 'string'));
    $u->setNextel(fRequest::encode('nextel', 'string'));
    $u->setNextel(fRequest::encode('fax', 'string'));
    $u->setNextel(fRequest::encode('address', 'string'));
    $u->store();
} catch (Exception $e) {
    die('El correo electrónico ya está asociado con una cuenta' . $e->getMessage());
}
$regions = array_unique(fRequest::encode('region', 'array'));
$permissions = array_unique(fRequest::encode('permission', 'array'));
try {
    foreach ($regions as $item) {
        if (!empty($item) && $item != 'null') {
            $ur = new UserRegion();
            $ur->setIdUser($u->getIdUser());
            $ur->setIdRegion($item);
            $ur->store();
        }
Example #2
0
$u = new User($id);
$p = fRequest::encode('password', 'string');
if (!empty($p)) {
    $p = md5($p . SALT);
    $p = base64_encode($p);
    $p = hash('sha256', $p);
    $u->setPassword($p);
}
$u->setIdRole(fRequest::encode('role', 'integer'));
$u->setEmail(fRequest::encode('email', 'string'));
$u->setFirstName(fRequest::encode('firstName', 'string'));
$u->setLastName(fRequest::encode('lastName', 'string'));
$u->setBirthday(fRequest::encode('birthday', 'date'));
$u->setPhone(fRequest::encode('phone', 'string'));
$u->setCellphone(fRequest::encode('cellphone', 'string'));
$u->setNextel(fRequest::encode('nextel', 'string'));
$u->setFax(fRequest::encode('fax', 'string'));
$u->setAddress(fRequest::encode('address', 'string'));
try {
    $u->store();
} catch (Exception $e) {
    die('El correo electrónico ya está asociado con una cuenta');
}
try {
    $regions = array_unique(fRequest::encode('region', 'array'));
    $permissions = array_unique(fRequest::encode('permission', 'array'));
    $ur = new UserRegion();
    $userRegions = $ur->getByIdUser($u->getIdUser());
    foreach ($userRegions as $item) {
        $ur = new UserRegion(array('id_user' => $u->getIdUser(), 'id_region' => $item->getIdRegion()));
        $ur->delete();