#Member.pm # (c) 2006 SapphireGroup # All rights reserved ###################################################################### # ===================== # # Member Functions # # ===================== # ###################################################################### package modules::Member; use CGI qw(:standard); my $mycgi=new CGI; use lib ".."; #use libs::Config; use libs::DBFunctions; use libs::Core; $libs::DBfunctions::db = libs::DBfunctions::connectDB(); my $db = $libs::DBfunctions::db; my $l=$mycgi->param("l"); if ($l eq ""){$l = "eng";} my $page=$mycgi->param("page"); $page = 1 unless $page; use Exporter; @ISA=qw(Exporter); @EXPORT=qw(&member_Details); $VERSION=1.01; ############################################################################### sub member_Details { unless ($mid){ return; } my ($query,$table,$rows); my ($mName,$mCompanyName,$mAddressLine1,$mAddressLine2,$mAddressLine3,$mAddressLine4,$tName,$mPostCode,$mPhone,$mMobile,$mFax,$mEmail,$mURL,$mFacebookURL,$mTwitterURL,$mLinkedinURL,$mPhoto,$mLogo,$mDescription); $query="SELECT mName,mCompanyName,mAddressLine1,mAddressLine2,mAddressLine3,mAddressLine4,tName,mPostCode,mPhone,mMobile,mFax,mEmail,mURL,mFacebookURL,mTwitterURL,mLinkedinURL,mPhoto,mLogo,mDescription,mStatus FROM ${Settings::table_prefix}member INNER JOIN ${Settings::table_prefix}dict_town on (${Settings::table_prefix}member.tid=${Settings::table_prefix}dict_town.tid) WHERE mid=$mid AND mStatus != 'UnApproved'"; #print "$query
"; $table=$db->prepare($query); $table->execute; $table->bind_columns(undef,\($mName,$mCompanyName,$mAddressLine1,$mAddressLine2,$mAddressLine3,$mAddressLine4,$tName,$mPostCode,$mPhone,$mMobile,$mFax,$mEmail,$mURL,$mFacebookURL,$mTwitterURL,$mLinkedinURL,$mPhoto,$mLogo,$mDescription)); $rows = $table->rows; unless ($table->fetch){ print qq|
|; libs::Template::ShowMessage("Sorry, profile not found"); print qq|
<< Back
|; return; } $mDescription =~ s/\n/
/g; $mEmail=libs::Core::email_transform($mEmail); #qq|| if $mEmail ne ""; $mURL=libs::Core::url_transform($mURL); #$mFacebookURL=libs::Core::url_transform($mFacebookURL); # might be https.. #$mTwitterURL=libs::Core::url_transform($mTwitterURL); #$mLinkedinURL=libs::Core::url_transform($mLinkedinURL); # Amended by SK 28/09/2010 # This is a right mess - updated the table layout print qq|

$mCompanyName


|; ($mPhoto ne "")? print qq||: print qq||; $mAddressLine1 = ($mAddressLine1 ne "") ? "$mAddressLine1
": ""; $mAddressLine2 = ($mAddressLine2 ne "") ? "$mAddressLine2
": ""; $mAddressLine3 = ($mAddressLine3 ne "") ? "$mAddressLine3
": ""; $mAddressLine4 = ($mAddressLine4 ne "") ? "$mAddressLine4
": ""; $tName = ($tName ne "") ? "$tName
": ""; #$mPostCode = ($mPostCode ne "") ? qq|$mPostCode
|: ""; $mPostCode = ($mPostCode ne "") ? qq{$mPostCode} : ""; $mEmail = ($mEmail ne "") ? "E-mail: $mEmail
": ""; $mURL = ($mURL ne "") ? "Web: $mURL
": ""; $mPhone = ($mPhone ne "") ? "Tel: $mPhone
": ""; $mMobile = ($mMobile ne "") ? "Mobile: $mMobile
": ""; $mFax = ($mFax ne "") ? "Fax: $mFax
": ""; $mFacebookURL = ($mFacebookURL ne "")? qq[Facebook icon] : ""; $mTwitterURL = ($mTwitterURL ne "")? qq[Twitter icon] : ""; $mLinkedinURL = ($mLinkedinURL ne "")? qq[LinkedIn icon] : ""; $social_gap = ($mFacebookURL ne "" || $mTwitterURL ne "" || $mLinkedinURL ne "")? "
\n" : ""; print qq|
|; print qq|| if ($mLogo ne ""); print qq|

$mCompanyName

$mAddressLine1 $mAddressLine2 $mAddressLine3 $mAddressLine4 $tName $mPostCode
Contact: $mName
$mEmail $mURL $mPhone $mMobile $mFax $social_gap $mFacebookURL $mTwitterURL $mLinkedinURL
$mDescription
<< Back
|; } ############################################################################### return 1;