<?php
class UserPersonalInfo extends AppDataBaseModel{
private $cinfoId;
private $infoUserId;
private $userInfoRif;
private $userInfoPassport;
private $userInfoMaritalStatus;
private $userInfoBirthdate;
private $userInfoAge;
private $userInfoLicenseType;
private $userInfoState;
private $userInfoCity;
private $userInfoAddress;
private $userInfoCountryCode;
private $userInfoStateCode;
private $userInfoPhoneNumber;
private $userInfoCountryCode2;
private $userInfoStateCode2;
private $userInfoPhoneNumber2;
private $tableName = _TABLE_USERS_INFO_;
private $tableName2 = _TABLE_USERS_;
private $tableName3 = _TABLE_USERS_LEVEL_ACCESS_;
private $theId ='i_users_personal_info_id';
private $userId ="u_user_id";
private $theUserId ='i_users_personal_info_user_id';
private $orderBy ='i_users_personal_info_id';
public function __construct($infoId=0,$infoUserId=0,$userInfoRif="",$userInfoPassport="",$userInfoMaritalStatus="",$userInfoBirthdate="",$userInfoAge="",$userInfoLicenseType="",$userInfoState="",$userInfoCity="",$userInfoAddress="",$userInfoCountryCode="",$userInfoStateCode="",$userInfoPhoneNumber="",$userInfoCountryCode2="",$userInfoStateCode2="",$userInfoPhoneNumber2=""){
$this->infoId = $infoId;
$this->infoUserId = $infoUserId;
$this->userInfoRif = $userInfoRif;
$this->userInfoPassport = $userInfoPassport;
$this->userInfoMaritalStatus = $userInfoMaritalStatus;
$this->userInfoBirthdate = $userInfoBirthdate;
$this->userInfoAge = $userInfoAge;
$this->userInfoLicenseType = $userInfoLicenseType;
$this->userInfoState = $userInfoState;
$this->userInfoCity = $userInfoCity;
$this->userInfoAddress = $userInfoAddress;
$this->userInfoCountryCode = $userInfoCountryCode;
$this->userInfoStateCode = $userInfoStateCode;
$this->userInfoPhoneNumber = $userInfoPhoneNumber;
$this->userInfoCountryCode2 = $userInfoCountryCode2;
$this->userInfoStateCode2 = $userInfoStateCode2;
$this->userInfoPhoneNumber2 = $userInfoPhoneNumber2;
}//FIN DEL CONSTRUCTOR
public function save(){
//AQUI ES DONDE LLAMO EL METODO GENERICO DE LA CLASE BASE DE DATOS PARA OBTENER EL ULTIMO ID
$resultQuery = $this->getLastID($this->tableName2,$this->userId);
$last_user_id = $this->mysqliFetchObject($resultQuery);
$this->userId = $last_user_id->u_user_id;
//LE COLOCO ESTE ECHO PARA VER SI ERROJA CERO O EL ID
echo '<H1>ID - </H1>'.$this->userId;
$getResult = $this->executeQuery("INSERT INTO ".$this->tableName."(i_users_personal_info_id,
i_users_personal_info_user_id,
i_users_personal_info_rif,
i_users_personal_info_passport,
i_users_personal_info_marital_status,
i_users_personal_info_birthdate,
i_users_personal_info_age,
i_users_personal_info_driving_license_type,
i_users_personal_info_state,
i_users_personal_info_city,
i_users_personal_info_address,
i_users_personal_info_phone_country_code,
i_users_personal_info_phone_state_code,
i_users_personal_info_phone_number,
i_users_personal_info_phone_country_code2,
i_users_personal_info_phone_state_code2,
i_users_personal_info_phone_number2)
VALUES ('',
'".$this->escapeSqlString($this->userId)."',
'".$this->escapeSqlString($this->userInfoRif)."',
'".$this->escapeSqlString($this->userInfoPassport)."',
'".$this->escapeSqlString($this->userInfoMaritalStatus)."',
'".$this->escapeSqlString($this->userInfoBirthdate)."',
'".$this->escapeSqlString($this->userInfoAge)."',
'".$this->escapeSqlString($this->userInfoLicenseType)."',
'".$this->escapeSqlString($this->userInfoState)."',
'".$this->escapeSqlString($this->userInfoCity)."',
'".$this->escapeSqlString($this->userInfoAddress)."',
'".$this->escapeSqlString($this->userInfoCountryCode)."',
'".$this->escapeSqlString($this->userInfoStateCode)."',
'".$this->escapeSqlString($this->userInfoPhoneNumber)."',
'".$this->escapeSqlString($this->userInfoCountryCode2)."',
'".$this->escapeSqlString($this->userInfoStateCode2)."',
'".$this->escapeSqlString($this->userInfoPhoneNumber2)."');");
return $getResult;
}//FIN DEL METODO SAVE
}//FIN DE LA CLASE
?>