"; // print_r($_POST); // echo ""; $error_registro = $error_valida = ''; if (isset($_POST['registrar'])) { if (empty($_POST['cif'])){ $error_valida = 'Falta el CIF'; $err_class_nif = 'has-error'; } else { $cif = array(); $check = new Check(); $cif = $check->verificaNieNifCif($_POST['cif']); if ($cif[0] < 1){ $_POST['cif'] = $cif[1]; $error_valida = 'Nº Identificación Fiscal incorrecto'; $err_class_nif = 'has-error'; } else { $_POST['cif'] = $cif[1]; } } // if (empty($_POST['dgsfp'])){ // $error_valida = 'Falta el Nº Registro en la DGSFP'; // $err_class_dgsfp = 'has-error'; // } if (empty($_POST['nombre']) || strlen($_POST['nombre']) <= 2){ $error_valida = 'Falta el nombre'; $err_class_nombre = 'has-error'; } if (empty($_POST['telefono']) || strlen($_POST['telefono']) < 9){ $error_valida = 'Falta el teléfono'; $err_class_telefono = 'has-error'; } if (empty($_POST['email'])){ $error_valida = 'Falta el email'; $err_class_nif = 'has-error'; } else { if (!$check->esEmailCorrecto($_POST['email'])){ $error_valida = 'Email incorrecto'; $err_class_email = 'has-error'; } } if ($error_valida == '') { $sqlagente = "SELECT * FROM corredores WHERE documento = '".$_POST['cif']."' "; $qryagente = mysqli_query($conn, $sqlagente) or die ("Error en query: " . $sqlagente . mysqli_error($conn)); if (mysqli_num_rows($qryagente) > 0) { $error_registro = 'Error. Empresa registrada en el sistema'; } else { $sqlreg = "INSERT INTO corredores SET f_alta = NOW(), documento = '".$_POST['cif']."', dgsfp = '".$_POST['dgsfp']."', nombre = '".$_POST['nombre']."', tlf1 = '".$_POST['telefono']."', email = '".$_POST['email']."', passwd = '".$_POST['password']."', activo = '1' "; $qryreg = mysqli_query($conn, $sqlreg) or die ("Error en query sqlreg: " . $sqlreg . mysqli_error($conn)); // Si no existe el directorio, lo creamos $p_path = 'cursos/'.$_POST['cif']; if (!is_dir($p_path)){ mkdir($p_path, 0777); } shell_exec('chmod -R 777 '.$p_path); $p_path = 'cursos/'.$_POST['cif'].'/logotipo'; if (!is_dir($p_path)){ mkdir($p_path, 0777); } shell_exec('chmod -R 777 '.$p_path); $cmd = 'cp -p Administracion/img/logo.jpg '.$p_path.'/'; shell_exec($cmd); $p_path = 'cursos/'.$_POST['cif'].'/firma'; if (!is_dir($p_path)){ mkdir($p_path, 0777); } shell_exec('chmod -R 777 '.$p_path); $cmd = 'cp -p Administracion/img/logofirma.jpg '.$p_path.'/'; shell_exec($cmd); // GENERO VARIABLES DE SESSION $_SESSION['empresa'] = $_POST['cif']; $_SESSION['nombre'] = $_POST['nombre']; $_SESSION['cif'] = $_POST['cif']; $_SESSION['usuarioadmin'] = $_POST['email']; $f_efecto = date('Y-m-d'); // $f_vencimiento = strtotime ( '+1 year' , strtotime ( $f_efecto ) ) ; // $f_vencimiento = date ( 'Y-m-d' , $f_vencimiento ); $f_vencimiento = date('Y').'-12-31'; $sql_new2 = "INSERT INTO pagos_aplicacion SET f_alta = NOW(), documento = '".$_POST['cif']."', fecha_efecto = '".$f_efecto."', fecha_vencimiento = '".$f_vencimiento."', pagofraccionado = 'A', forma_pago = 'T', pagado = 'N' "; $qry_new2 = mysqli_query($conn, $sql_new2) or die ("Error en sql_new2: " . $sql_new2 . mysqli_error($conn)); // ENVIAMOS EMAIL DE BIENVENIDA include('enviomail/bienvenida.php'); } } else { $error_registro = $error_valida; } } ?>
"); } else { $postcif = (isset($_POST['cif']) && $_POST['cif'] != '') ? $_POST['cif'] : ''; $postdgsfp = (isset($_POST['dgsfp']) && $_POST['dgsfp'] != '') ? $_POST['dgsfp'] : ''; $postnombre = (isset($_POST['nombre']) && $_POST['nombre'] != '') ? $_POST['nombre'] : ''; $posttelefono = (isset($_POST['telefono']) && $_POST['telefono'] != '') ? $_POST['telefono'] : ''; $postemail = (isset($_POST['email']) && $_POST['email'] != '') ? $_POST['email'] : ''; $postpassword = (isset($_POST['password']) && $_POST['password'] != '') ? $_POST['password'] : ''; ?>

Registro de Empresa

  He leído y acepto los Términos y Condiciones del uso del sitio web
  He leído y acepto la Política de Privacidad.
Acceso Empresas

formacioncontinuaseguros.com ©2026