示例#1
0
    $new_rol = $_REQUEST["rol"];
    $usuarios_mng = new ControlUsuario();
    $json_resp["added"] = NULL;
    if ($new_pass == NULL || !(strlen($new_pass) > 0)) {
        $new_pass = $new_id;
        $json_resp["extras"]["r_pass"] = "******";
    } else {
        $json_resp["extras"]["r_pass"] = "******";
    }
    if ($new_nick == NULL || !(strlen($new_nick) > 0)) {
        $new_nick = $new_id;
        $json_resp["extras"]["r_nick"] = "Tu Nick -> tu Identificacion";
    } else {
        $json_resp["extras"]["r_nick"] = "Tu Nick -> {$new_nick}";
    }
    $resp_bd = $usuarios_mng->registrarUsuario($new_id, $new_nom, $new_ape, $new_tipo_id, $new_tel, $new_mail, $new_pass, $new_rol, $new_nick);
    if ($resp_bd == TRUE) {
        $json_resp["added"] = TRUE;
    } else {
        $json_resp["added"] = FALSE;
    }
    header('Content-type: application/json; charset=utf-8');
    echo json_encode($json_resp, JSON_FORCE_OBJECT);
    //echo json_encode($json_resp);
    exit;
}
?>
<!--<!DOCTYPE html>
<html>
    <head></head>
    <body>