http://www.thottbot.com/?qu=10691
HAHHA
Är reklamen ivägen? Logga in eller registrera dig så försvinner den!
Är reklamen ivägen? Logga in eller registrera dig så försvinner den!
Ah you think Hamsterpaj is your ally? You merely adopted the Hamsterpaj. I was born in it, molded by it.
Emmos snis riyi emmos snis
bitch please
Exactly which part of B flat you don't understand!?
A lot of our imports come from other countries
I'm the allmighty fish-god
<?php
class MemberTbl implements SQLModule {
// storage
private $_data = array(
);
// SQL Connection
private $_sql;
/**
* Sets the SQL connection
*
* Makes it possible for the class to query the database
*
* param PDO $sql
*/
public function setSqlAdapter(PDO $sql) {
$this->_sql = $sql;
}
public function save() {
if(!$this->isLoaded()) {
$stmt = $this->_sql->prepare('
INSERT INTO
memberTbl
(
`mId`,
`userType`,
`firstname`,
`lastname`,
`email`,
`password`,
`emailReceiveType`,
`personalNo`,
`company`,
`companyNo`,
`address`,
`postNo`,
`province`,
`country`,
`phone`,
`mobile`,
`fax`,
`website`,
`registered`,
`lastlogin`,
`ip`,
`visitcount`,
) VALUES (
:mId,
:userType,
:firstname,
:lastname,
:email,
:password,
:emailReceiveType,
:personalNo,
:company,
:companyNo,
:address,
:postNo,
:province,
:country,
:phone,
:mobile,
:fax,
:website,
:registered,
:lastlogin,
:ip,
:visitcount,
)
');
$parameters = array(
':mId' => $this->_data['mId'];
':userType' => $this->_data['userType'];
':firstname' => $this->_data['firstname'];
':lastname' => $this->_data['lastname'];
':email' => $this->_data['email'];
':password' => $this->_data['password'];
':emailReceiveType' => $this->_data['emailReceiveType'];
':personalNo' => $this->_data['personalNo'];
':company' => $this->_data['company'];
':companyNo' => $this->_data['companyNo'];
':address' => $this->_data['address'];
':postNo' => $this->_data['postNo'];
':province' => $this->_data['province'];
':country' => $this->_data['country'];
':phone' => $this->_data['phone'];
':mobile' => $this->_data['mobile'];
':fax' => $this->_data['fax'];
':website' => $this->_data['website'];
':registered' => $this->_data['registered'];
':lastlogin' => $this->_data['lastlogin'];
':ip' => $this->_data['ip'];
':visitcount' => $this->_data['visitcount'];
);
$stmt->execute($parameters);
} else {
$stmt = $this->_sql->prepare('
UPDATE
memberTbl
SET
`mId` = :mId
`userType` = :userType
`firstname` = :firstname
`lastname` = :lastname
`email` = :email
`password` = :password
`emailReceiveType` = :emailReceiveType
`personalNo` = :personalNo
`company` = :company
`companyNo` = :companyNo
`address` = :address
`postNo` = :postNo
`province` = :province
`country` = :country
`phone` = :phone
`mobile` = :mobile
`fax` = :fax
`website` = :website
`registered` = :registered
`lastlogin` = :lastlogin
`ip` = :ip
`visitcount` = :visitcount
WHERE
`id` = :id
');
$parameters = array(
':mId' = $this->_data['mId'],
':userType' = $this->_data['userType'],
':firstname' = $this->_data['firstname'],
':lastname' = $this->_data['lastname'],
':email' = $this->_data['email'],
':password' = $this->_data['password'],
':emailReceiveType' = $this->_data['emailReceiveType'],
':personalNo' = $this->_data['personalNo'],
':company' = $this->_data['company'],
':companyNo' = $this->_data['companyNo'],
':address' = $this->_data['address'],
':postNo' = $this->_data['postNo'],
':province' = $this->_data['province'],
':country' = $this->_data['country'],
':phone' = $this->_data['phone'],
':mobile' = $this->_data['mobile'],
':fax' = $this->_data['fax'],
':website' = $this->_data['website'],
':registered' = $this->_data['registered'],
':lastlogin' = $this->_data['lastlogin'],
':ip' = $this->_data['ip'],
':visitcount' = $this->_data['visitcount'],
);
$stmt->execute($parameters);
}
}
public function load($id) {
$sql = '
SELECT
`mId`,
`userType`,
`firstname`,
`lastname`,
`email`,
`password`,
`emailReceiveType`,
`personalNo`,
`company`,
`companyNo`,
`address`,
`postNo`,
`province`,
`country`,
`phone`,
`mobile`,
`fax`,
`website`,
`registered`,
`lastlogin`,
`ip`,
`visitcount`,
FROM
`memberTbl`
WHERE
`id` = '. (int) $id.'
LIMIT 1
';
$query = $this->_sql->query($sql)->fetch();
if(!empty($query)) {
$this->_data = $query;
}
}
public function isLoaded() {
return (boolean) isSet($this->_data['id']) === true;
}
/**
* param int $mId
*/
public function setMId($mId) {
$this->_data['mId'] = $mId;
}
/**
* return int
*/
public function getMId() {
return (int) $this->_data['mId'];
}
/**
* param String $userType
*/
public function setUserType($userType) {
$this->_data['userType'] = $userType;
}
/**
* return String
*/
public function getUserType() {
return (String) $this->_data['userType'];
}
/**
* param String $firstname
*/
public function setFirstname($firstname) {
$this->_data['firstname'] = $firstname;
}
/**
* return String
*/
public function getFirstname() {
return (String) $this->_data['firstname'];
}
/**
* param String $lastname
*/
public function setLastname($lastname) {
$this->_data['lastname'] = $lastname;
}
/**
* return String
*/
public function getLastname() {
return (String) $this->_data['lastname'];
}
/**
* param String $email
*/
public function setEmail($email) {
$this->_data['email'] = $email;
}
/**
* return String
*/
public function getEmail() {
return (String) $this->_data['email'];
}
/**
* param String $password
*/
public function setPassword($password) {
$this->_data['password'] = $password;
}
/**
* return String
*/
public function getPassword() {
return (String) $this->_data['password'];
}
/**
* param String $emailReceiveType
*/
public function setEmailReceiveType($emailReceiveType) {
$this->_data['emailReceiveType'] = $emailReceiveType;
}
/**
* return String
*/
public function getEmailReceiveType() {
return (String) $this->_data['emailReceiveType'];
}
/**
* param String $personalNo
*/
public function setPersonalNo($personalNo) {
$this->_data['personalNo'] = $personalNo;
}
/**
* return String
*/
public function getPersonalNo() {
return (String) $this->_data['personalNo'];
}
/**
* param String $company
*/
public function setCompany($company) {
$this->_data['company'] = $company;
}
/**
* return String
*/
public function getCompany() {
return (String) $this->_data['company'];
}
/**
* param String $companyNo
*/
public function setCompanyNo($companyNo) {
$this->_data['companyNo'] = $companyNo;
}
/**
* return String
*/
public function getCompanyNo() {
return (String) $this->_data['companyNo'];
}
/**
* param String $address
*/
public function setAddress($address) {
$this->_data['address'] = $address;
}
/**
* return String
*/
public function getAddress() {
return (String) $this->_data['address'];
}
/**
* param String $postNo
*/
public function setPostNo($postNo) {
$this->_data['postNo'] = $postNo;
}
/**
* return String
*/
public function getPostNo() {
return (String) $this->_data['postNo'];
}
/**
* param String $province
*/
public function setProvince($province) {
$this->_data['province'] = $province;
}
/**
* return String
*/
public function getProvince() {
return (String) $this->_data['province'];
}
/**
* param String $country
*/
public function setCountry($country) {
$this->_data['country'] = $country;
}
/**
* return String
*/
public function getCountry() {
return (String) $this->_data['country'];
}
/**
* param String $phone
*/
public function setPhone($phone) {
$this->_data['phone'] = $phone;
}
/**
* return String
*/
public function getPhone() {
return (String) $this->_data['phone'];
}
/**
* param String $mobile
*/
public function setMobile($mobile) {
$this->_data['mobile'] = $mobile;
}
/**
* return String
*/
public function getMobile() {
return (String) $this->_data['mobile'];
}
/**
* param String $fax
*/
public function setFax($fax) {
$this->_data['fax'] = $fax;
}
/**
* return String
*/
public function getFax() {
return (String) $this->_data['fax'];
}
/**
* param String $website
*/
public function setWebsite($website) {
$this->_data['website'] = $website;
}
/**
* return String
*/
public function getWebsite() {
return (String) $this->_data['website'];
}
/**
* param $registered
*/
public function setRegistered($registered) {
$this->_data['registered'] = $registered;
}
/**
* return
*/
public function getRegistered() {
return () $this->_data['registered'];
}
/**
* param $lastlogin
*/
public function setLastlogin($lastlogin) {
$this->_data['lastlogin'] = $lastlogin;
}
/**
* return
*/
public function getLastlogin() {
return () $this->_data['lastlogin'];
}
/**
* param String $ip
*/
public function setIp($ip) {
$this->_data['ip'] = $ip;
}
/**
* return String
*/
public function getIp() {
return (String) $this->_data['ip'];
}
/**
* param int $visitcount
*/
public function setVisitcount($visitcount) {
$this->_data['visitcount'] = $visitcount;
}
/**
* return int
*/
public function getVisitcount() {
return (int) $this->_data['visitcount'];
}
/**
* Simple getter function
*
* Simplifies the retrival of information
*
* return String|Integer
*/
public function __get($name) {
switch(strtoupper($name))
{
case 'MID':
return $this->getMId();
break;
case 'USERTYPE':
return $this->getUserType();
break;
case 'FIRSTNAME':
return $this->getFirstname();
break;
case 'LASTNAME':
return $this->getLastname();
break;
case 'EMAIL':
return $this->getEmail();
break;
case 'PASSWORD':
return $this->getPassword();
break;
case 'EMAILRECEIVETYPE':
return $this->getEmailReceiveType();
break;
case 'PERSONALNO':
return $this->getPersonalNo();
break;
case 'COMPANY':
return $this->getCompany();
break;
case 'COMPANYNO':
return $this->getCompanyNo();
break;
case 'ADDRESS':
return $this->getAddress();
break;
case 'POSTNO':
return $this->getPostNo();
break;
case 'PROVINCE':
return $this->getProvince();
break;
case 'COUNTRY':
return $this->getCountry();
break;
case 'PHONE':
return $this->getPhone();
break;
case 'MOBILE':
return $this->getMobile();
break;
case 'FAX':
return $this->getFax();
break;
case 'WEBSITE':
return $this->getWebsite();
break;
case 'REGISTERED':
return $this->getRegistered();
break;
case 'LASTLOGIN':
return $this->getLastlogin();
break;
case 'IP':
return $this->getIp();
break;
case 'VISITCOUNT':
return $this->getVisitcount();
break;
default:
throw new OutOfBoundsException();
break;
}
}
/**
* Simple etter function
*
* Simplifies the way of setting varibles
*
* param String $name
* param String|Integer $value
*/
public function __set($name, $value) {
switch(strtoupper($name))
{
case 'MID':
$this->setMId($value);
break;
case 'USERTYPE':
$this->setUserType($value);
break;
case 'FIRSTNAME':
$this->setFirstname($value);
break;
case 'LASTNAME':
$this->setLastname($value);
break;
case 'EMAIL':
$this->setEmail($value);
break;
case 'PASSWORD':
$this->setPassword($value);
break;
case 'EMAILRECEIVETYPE':
$this->setEmailReceiveType($value);
break;
case 'PERSONALNO':
$this->setPersonalNo($value);
break;
case 'COMPANY':
$this->setCompany($value);
break;
case 'COMPANYNO':
$this->setCompanyNo($value);
break;
case 'ADDRESS':
$this->setAddress($value);
break;
case 'POSTNO':
$this->setPostNo($value);
break;
case 'PROVINCE':
$this->setProvince($value);
break;
case 'COUNTRY':
$this->setCountry($value);
break;
case 'PHONE':
$this->setPhone($value);
break;
case 'MOBILE':
$this->setMobile($value);
break;
case 'FAX':
$this->setFax($value);
break;
case 'WEBSITE':
$this->setWebsite($value);
break;
case 'REGISTERED':
$this->setRegistered($value);
break;
case 'LASTLOGIN':
$this->setLastlogin($value);
break;
case 'IP':
$this->setIp($value);
break;
case 'VISITCOUNT':
$this->setVisitcount($value);
break;
default:
throw new OutOfBoundsException();
break;
}
}
}
?>
Hej! Innan du skriver om ett potentiellt problem så vill vi påminna dig om att du faktiskt inte är ensam. Du är inte onormal och världen kommer inte att gå under, vi lovar! Så slappna av och gilla livet i några minuter - känns det fortfarande hemskt? Skriv gärna ner dina tankar och frågor, vi älskar att hjälpa just dig!