Así es como las estoy usando:
Obtengo los datos de los formularios con este archivo
Código PHP:
Ver original<?php
if(isset($_REQUEST['task'])){
$task = $_REQUEST['task'];
//DATOS DE ACCESO A LA CUENTA DEL USUARIO//
if(isset($_SESSION['loged_user'])){$userSession = safeString
($_SESSION['loged_user']);}else{$userSession=NULL;} if(isset($_SESSION['level_user'])){$userLevel = safeString
($_SESSION['level_user']);}else{$userLevel=NULL;} if(isset($_REQUEST['name'])){$name = safeString
($_REQUEST['name']);}else{$name=NULL;} if(isset($_REQUEST['lastname'])){$lastName = safeString
($_REQUEST['lastname']);}else{$lastName=NULL;} if(isset($_REQUEST['idnumber_nationality'])){$userIdnumberNationality = safeString
($_REQUEST['idnumber_nationality']);}else{$userIdnumberNationality = NULL;} if(isset($_REQUEST['idnumber'])){$idNumber = safeString
($_REQUEST['idnumber']);}else{$idNumber=NULL;} if(isset($_REQUEST['email'])&&$_REQUEST['email']!==NULL){$userName=safeString
($_REQUEST['email']);}else{$userName=NULL;} if(isset($_REQUEST['email'])){$userMail = safeString
($_REQUEST['email']);}else{$userMail=NULL;}
if(isset($_REQUEST['password'])){$passWord = safeString
($_REQUEST['password']);}else{$passWord = NULL;} if(isset($_REQUEST['confirmpassword'])){$confirmPassWord=safeString
($_REQUEST['confirmpassword']);}else{$confirmPassWord=NULL;} if(isset($_REQUEST['status'])){$userStatus = safeString
($_REQUEST['status']);}else{$userStatus = NULL;} if(isset($_REQUEST['activate'])){$activate = safeString
($_REQUEST['activate']);}else{$activate = '0';} if(isset($_REQUEST['level'])){$userLevelAccess = $_REQUEST['level'];}else{$userLevelAccess = '4';}
//DATOS DE LA INFORMACION PERSONAL DEL USUARIO//
if(isset($_REQUEST['infoId'])){$infoId = $_REQUEST['infoId'];}else{$infoId = '';} if(isset($_REQUEST['rif'])){$userInfoRif = $_REQUEST['rif'];}else{$userInfoRif = '';} if(isset($_REQUEST['passport'])){$userInfoPassport = $_REQUEST['passport'];}else{$userInfoPassport = '';} if(isset($_REQUEST['marital_status'])){$userInfoMaritalStatus = $_REQUEST['marital_status'];}else{$userInfoMaritalStatus = '';} if(isset($_REQUEST['birthday'])){$userInfoBirthdate = $_REQUEST['birthday'];}else{$userInfoBirthdate = '';} if(isset($_REQUEST['age'])){$userInfoAge = $_REQUEST['age'];}else{$userInfoAge = '';} if(isset($_REQUEST['license_grade'])){$userInfoLicenseType = $_REQUEST['license_grade'];}else{$userInfoLicenseType = '';} if(isset($_REQUEST['state'])){$userInfoState = $_REQUEST['state'];}else{$userInfoState = '';} if(isset($_REQUEST['city'])){$userInfoCity = $_REQUEST['city'];}else{$userInfoCity = '';}
if(isset($_REQUEST['address'])){$userInfoAddress = safeString
($_REQUEST['address']);}else{$userInfoAddress = NULL;}
if(isset($_REQUEST['phone_country_code'])){$userInfoCountryCode = safeString
($_REQUEST['phone_country_code']);}else{$userInfoCountryCode = NULL;} if(isset($_REQUEST['phone_code_area'])){$userInfoStateCode = safeString
($_REQUEST['phone_code_area']);}else{$userInfoStateCode = NULL;} if(isset($_REQUEST['phone'])){$userInfoPhoneNumber = safeString
($_REQUEST['phone']);}else{$userInfoPhoneNumber = NULL;}
if(isset($_REQUEST['phone_country_code2'])){$userInfoCountryCode2 = safeString
($_REQUEST['phone_country_code2']);}else{$userInfoCountryCode2 = NULL;} if(isset($_REQUEST['phone_code_area2'])){$userInfoStateCode2 = safeString
($_REQUEST['phone_code_area2']);}else{$userInfoStateCode2 = NULL;} if(isset($_REQUEST['phone2'])){ $userInfoPhoneNumber2 = safeString
($_REQUEST['phone2']);}else{$userInfoPhoneNumber2 = NULL;}
$obj = new User($id,$countryId,$name,$lastName,$userIdnumberNationality,$idNumber,$userMail,$userName,$passWord,'','','',$activate,$userStatus,$userLevelAccess,$userTerms);
$objUI = new UserPersonalInfo($infoId,$id,$userInfoRif,$userInfoPassport,$userInfoMaritalStatus,$userInfoBirthdate,$userInfoAge,$userInfoLicenseType,$userInfoState,$userInfoCity,$userInfoAddress,$userInfoCountryCode,$userInfoStateCode,$userInfoPhoneNumber,$userInfoCountryCode2,$userInfoStateCode2,$userInfoPhoneNumber2);
switch ($task){
case 'add':
include_once'views/app_form_users.php';
break;
case 'save':
$triggerAlert=NULL;
$checkMailExist = $obj->checkUserFieldAvalibility('u_user_mail',$userMail);
if($name==NULL){$triggerAlert='Escriba el nombre</br>';}
if($lastName==NULL){$triggerAlert.='Escriba el apellido</br>';}
if($userMail==NULL){$triggerAlert.='Escriba el correo.</br>';}
//if($checkMailExist==true){$triggerAlert.='El correo que intenta ingresar ya esta registrado, no es posible ingresarlo de nuevo..!<br>';}
if(check_email($userMail)==false){$triggerAlert.='El correo no es valido..!<br>';}
if($passWord==NULL){$triggerAlert.='Escriba la clave.</br>';}
if($confirmPassWord==NULL){$triggerAlert.='Escriba la clave de confirmación.</br>';}
if($passWord!==$confirmPassWord){$triggerAlert.='La claves no coinciden.</br>';}
if($triggerAlert==NULL){
//AQUI AGREGO PRIMERO AL USUARIO POR ESO DIGO QUE YA SE HA INSERTADO EL ID DE USUARIO POR LO QUE SE GENERA EL ULTIMO ID
$eventResult = $obj->save();
//LUEGO AQUI AGREGO LA OTRA INFORMACION DEL USUARIO..
$eventResultUI = $objUI->save();
if(!$eventResult && !$eventResultUI){
$Warning = '<div id="Msg">
<div id="warningAlertError">
<div id="warningError">
<div id="warningErrorText">Error al guardar..!</div>
</div>
</div>
</div>';
} else{
$Warning = '<div id="Msg">
<div id="warningAlertSave">
<div id="warningSave">
<div id="warningSaveText">Datos guardados..!</div>
</div>
</div>
</div>';
} echo''.$Warning.'';
}else{
echo'<div id="Msg">
<div id="warningAlertError">
<div id="warningError">
<div id="warningErrorText">'.$triggerAlert.'</div>
</div>
</div>
</div>';
}
break;
}//FIN SWITCH
}//FIN IF