Xaraya / Postnuke CVS Notices - Message

Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites

View Statistics - Next Notice - Previous Notice

Directory filter : [ all ] / postnuke_modules / PostContact / user_functions [ view in CVS ]

Date Directory [filter] File(s) [view] Author [filter]
06 Aug 2002 20:17:00postnuke_modules/PostContact/user_functionssendmail.php,1.2,1.3 vicitcard.php,1.2,1.3Richard Cave
 ADODB conversion.

Update of /home/cvsroot/postnuke_modules/PostContact/user_functions
In directory ns7.hostnuke.net:/tmp/cvs-serv17969/PostContact/user_functions

Modified Files:
	sendmail.php vicitcard.php 
Log Message:
ADODB conversion.


Index: sendmail.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/PostContact/user_functions/sendmail.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sendmail.php	23 Jul 2002 12:07:04 -0000	1.2
--- sendmail.php	6 Aug 2002 20:16:57 -0000	1.3
***************
*** 1,21 ****
  <?
  // $Id$ $Name$
  if(basename($PHP_SELF) == basename(__FILE__)){
! echo "You have no access to this file!!!";
! exit;
  }
  
  function writeToErrorLogg($message){
! 	$export_folder		= "./errors";
! 	if(file_exists($export_folder)){
! 		if(is_writable($export_folder)){
! 			$dagens_datum	= date("Y-m-d");
! 			$filnamn		= "ErrorLog_".$dagens_datum;
! 			$filnamn		= $export_folder."/".$filnamn.".tab";
! 			$filen			= fopen($filnamn, "a+");
! 			$filskriv		= fwrite($filen, $export);
! 			$filstangd		= fclose($filen);
! 		}
! 	}
  }
  
--- 1,45 ----
  <?
  // $Id$ $Name$
+ // ----------------------------------------------------------------------
+ // POST-NUKE Content Management System
+ // Copyright (C) 2002 by the PostNuke Development Team.
+ // http://www.postnuke.com/
+ // ----------------------------------------------------------------------
+ // LICENSE
+ //
+ // This program is free software; you can redistribute it and/or
+ // modify it under the terms of the GNU General Public License (GPL)
+ // as published by the Free Software Foundation; either version 2
+ // of the License, or (at your option) any later version.
+ //
+ // This program is distributed in the hope that it will be useful,
+ // but WIthOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ //
+ // To read the license please visit http://www.gnu.org/copyleft/gpl.html
+ // ----------------------------------------------------------------------
+ // Original Author of file: Bjarne Varöystrand and Bjarne Varöystrand
+ // Modifications by: Richard Cave
+ // Purpose of file:  Send mail to company or contact person
+ // ----------------------------------------------------------------------
+ 
  if(basename($PHP_SELF) == basename(__FILE__)){
!     echo "You have no access to this file!!!";
!     exit;
  }
  
  function writeToErrorLogg($message){
!     $export_folder        = "./errors";
!     if(file_exists($export_folder)){
!         if(is_writable($export_folder)){
!             $dagens_datum    = date("Y-m-d");
!             $filnamn        = "ErrorLog_".$dagens_datum;
!             $filnamn        = $export_folder."/".$filnamn.".tab";
!             $filen            = fopen($filnamn, "a+");
!             $filskriv        = fwrite($filen, $export);
!             $filstangd        = fclose($filen);
!         }
!     }
  }
  
***************
*** 23,41 ****
  
  $department = $GLOBALS['departmentID'];
! $name 		= $GLOBALS['sender_name'];
! $phone 		= $GLOBALS['sender_phone'];
! $email 		= $GLOBALS['sender_email'];
! $copy 		= $GLOBALS['sender_wantcopy'];
! $message 	= htmlspecialchars($GLOBALS['sender_message']);
! $contact 	= $GLOBALS['sender_wants_contact'];
! $to 		= $department['email'];
! $department	= $department['name'];
  if($contact == 1){
! 	$contact = ""._CIIWANTYOUTOCONTACTME."";
  }
  echo "&nbsp;<br /><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><p class=\"ContactInfoHeader\">"._CITHANKYOUFORYOURMAIL." ".$name."!<br>";
  echo ""._CIWEWILLREPLYSOON."<br>";
  if($copy){
! 	echo "("._CACOPYHASBEENSENTTOYOURMAIL_.")<br><br>";
  }
  echo _CIENJOYTHERESTOFTHESITE."</p>";
--- 47,65 ----
  
  $department = $GLOBALS['departmentID'];
! $name         = $GLOBALS['sender_name'];
! $phone         = $GLOBALS['sender_phone'];
! $email         = $GLOBALS['sender_email'];
! $copy         = $GLOBALS['sender_wantcopy'];
! $message     = htmlspecialchars($GLOBALS['sender_message']);
! $contact     = $GLOBALS['sender_wants_contact'];
! $to         = $department['email'];
! $department    = $department['name'];
  if($contact == 1){
!     $contact = ""._CIIWANTYOUTOCONTACTME."";
  }
  echo "&nbsp;<br /><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><p class=\"ContactInfoHeader\">"._CITHANKYOUFORYOURMAIL." ".$name."!<br>";
  echo ""._CIWEWILLREPLYSOON."<br>";
  if($copy){
!     echo "("._CACOPYHASBEENSENTTOYOURMAIL_.")<br><br>";
  }
  echo _CIENJOYTHERESTOFTHESITE."</p>";
***************
*** 48,106 ****
  function print_FormParts($preview_data){
  echo $preview_data."&nbsp;<br /><table  border=\"0\"  cellspacing=\"0\" cellpadding=\"1\">
! 		<tr>
! 		<td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIYOUR." "._CINAME.":&nbsp;</font></td>
! 		<td><input name=\"sender_name\" value=\"".$GLOBALS['sender_name']."\" type=\"text\" class=\"ContactInfoText\" /></td>
! 		</tr>
! 		
! 		<tr>
! 		<td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIYOUR." "._CIPHONE.":&nbsp;</font></td>
! 		<td><input name=\"sender_phone\" value=\"".$GLOBALS['sender_phone']."\" type=\"text\" class=\"ContactInfoText\" /></td>
! 		</tr>
! 		
! 		<tr>
! 		<td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIYOUR." "._CIEMAIL.":&nbsp;</font></td>
! 		<td><input name=\"sender_email\" value=\"".$GLOBALS['sender_email']."\" type=\"text\" class=\"ContactInfoText\" /></td>
! 		</tr>
! 		
! 		<tr>
! 		<td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIYOUR." "._CIMESSAGE.":&nbsp;</font></td>
! 		<td><textarea name=\"sender_message\" wrap=\"virtual\" rows=\"8\" class=\"ContactInfoText\">".$GLOBALS['sender_message']."</textarea></td>
! 		</tr>
! 		<tr>
! 		<td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CISENDMEACOPY.":&nbsp;</font></td>
! 		<td><input type=\"checkbox\" name=\"sender_wantcopy\"";
! 		if($GLOBALS['sender_wantcopy'] == 1){
! 			echo " checked=\"checked\"";
! 		}
! 		echo "\" value=\"1\" /></td>
! 		</tr>
! 		
! 		<tr>
! 		<td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIPLEASECONTACTME.":&nbsp;</font></td>
! 		<td><input type=\"checkbox\" name=\"sender_wants_contact\"";
! 		if($GLOBALS['sender_wants_contact'] == 1){
! 			echo " checked=\"checked\"";
! 		}
! 		echo "\" value=\"1\" /></td>
! 		</tr>
! 		
! 		<tr>
! 		<td>&nbsp;</td>
! 		<td>
! 		<table  border=\"0\"  cellspacing=\"0\" cellpadding=\"1\">
! 		<tr>
! 		<td align=\"right\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIPREVIEW."&nbsp;</font></td>
! 		<td><input type=\"radio\" name=\"preview\" value=\"1\" checked=\"checked\" /></td>
! 		</tr><tr>
! 		<td align=\"right\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CISEND."&nbsp;</font></td>
! 		<td><input type=\"radio\" name=\"preview\" value=\"2\" /></td>
! 		</tr>
! 		</table>
! 		</td>
! 		</tr><tr>
! 		<td>&nbsp;</td>
! 		<td><input name=\"Reset\" type=\"reset\" class=\"ContactInfoText\" value=\""._CIRESET."\" /><input name=\"Submit\" type=\"submit\" class=\"ContactInfoText\" value=\""._CISUBMIT."\" /></td>
! 		</tr>
! 		</table>";
  }
  
--- 72,130 ----
  function print_FormParts($preview_data){
  echo $preview_data."&nbsp;<br /><table  border=\"0\"  cellspacing=\"0\" cellpadding=\"1\">
!         <tr>
!         <td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIYOUR." "._CINAME.":&nbsp;</font></td>
!         <td><input name=\"sender_name\" value=\"".$GLOBALS['sender_name']."\" type=\"text\" class=\"ContactInfoText\" /></td>
!         </tr>
!         
!         <tr>
!         <td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIYOUR." "._CIPHONE.":&nbsp;</font></td>
!         <td><input name=\"sender_phone\" value=\"".$GLOBALS['sender_phone']."\" type=\"text\" class=\"ContactInfoText\" /></td>
!         </tr>
!         
!         <tr>
!         <td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIYOUR." "._CIEMAIL.":&nbsp;</font></td>
!         <td><input name=\"sender_email\" value=\"".$GLOBALS['sender_email']."\" type=\"text\" class=\"ContactInfoText\" /></td>
!         </tr>
!         
!         <tr>
!         <td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIYOUR." "._CIMESSAGE.":&nbsp;</font></td>
!         <td><textarea name=\"sender_message\" wrap=\"virtual\" rows=\"8\" class=\"ContactInfoText\">".$GLOBALS['sender_message']."</textarea></td>
!         </tr>
!         <tr>
!         <td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CISENDMEACOPY.":&nbsp;</font></td>
!         <td><input type=\"checkbox\" name=\"sender_wantcopy\"";
!         if($GLOBALS['sender_wantcopy'] == 1){
!             echo " checked=\"checked\"";
!         }
!         echo "\" value=\"1\" /></td>
!         </tr>
!         
!         <tr>
!         <td align=\"right\" valign=\"top\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIPLEASECONTACTME.":&nbsp;</font></td>
!         <td><input type=\"checkbox\" name=\"sender_wants_contact\"";
!         if($GLOBALS['sender_wants_contact'] == 1){
!             echo " checked=\"checked\"";
!         }
!         echo "\" value=\"1\" /></td>
!         </tr>
!         
!         <tr>
!         <td>&nbsp;</td>
!         <td>
!         <table  border=\"0\"  cellspacing=\"0\" cellpadding=\"1\">
!         <tr>
!         <td align=\"right\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CIPREVIEW."&nbsp;</font></td>
!         <td><input type=\"radio\" name=\"preview\" value=\"1\" checked=\"checked\" /></td>
!         </tr><tr>
!         <td align=\"right\" class=\"ContactInfoText\"><font class=\"ContactInfoText\">"._CISEND."&nbsp;</font></td>
!         <td><input type=\"radio\" name=\"preview\" value=\"2\" /></td>
!         </tr>
!         </table>
!         </td>
!         </tr><tr>
!         <td>&nbsp;</td>
!         <td><input name=\"Reset\" type=\"reset\" class=\"ContactInfoText\" value=\""._CIRESET."\" /><input name=\"Submit\" type=\"submit\" class=\"ContactInfoText\" value=\""._CISUBMIT."\" /></td>
!         </tr>
!         </table>";
  }
  
***************
*** 110,307 ****
  
  function theindex($personID,$department,$company) {
! 	global $ModName,$prefix,$sitename,$SERVER_NAME;
! 	list($dbconn) = pnDBGetConn();
! 	$pntable = PostContact_pntables();
  
! 	if($personID > 0){
!     	$table	= $pntable['persons_table'];
! 	    $column	= &$pntable['person'];
! 		$result = mysql_query("SELECT * FROM ".$table." WHERE (".$column['id']."='$personID' and ".$column['hide']."='1')");
! 		$num = mysql_numrows($result);
! 		for ($i = 0 ;$i < $num; $i++) {
! 			$personID					= mysql_result($result, $i, $column['id']);
! 			$to							= mysql_result($result, $i, $column['mail']);
! 			$personFirstName			= mysql_result($result, $i, $column['firstname']);
! 			$personLastName				= mysql_result($result, $i, $column['lastname']);
! 		}
! 		$recepient = $personFirstName." ".$personLastName;
! 		if(strlen($to) < 4){
!     		$table	= $pntable['company_table'];
! 		    $column	= &$pntable['company'];
! 			$result = mysql_query("SELECT * FROM ".$table." WHERE ".$column['hide']."='0' order by ".$column['name']."");
! 			$num = mysql_numrows($result);
! 			for ($i = 0 ;$i < $num; $i++){
! 				$companyName				= mysql_result($result, $i, $column['name']);
! 				$companyAddress				= mysql_result($result, $i, $column['address']);
! 				$companyCity				= mysql_result($result, $i, $column['city']);
! 				$companyZip					= mysql_result($result, $i, $column['zip']);
! 				$companyCountry				= mysql_result($result, $i, $column['country']);
! 				$companyPhone				= mysql_result($result, $i, $column['phone']);
! 				$companyFax					= mysql_result($result, $i, $column['fax']);
! 				$to							= mysql_result($result, $i, $column['mail']);
! 			}
! 			if(strlen($recepient) < 4){
! 				$recepient = $companyName;
! 			}
! 		}
! 	}elseif($department > 0){
! 	    $table	= $pntable['departments_table'];
!     	$column	= &$pntable['departments'];
! 		$result = mysql_query("SELECT * FROM ".$table." WHERE ".$column['id']."='$department'");
! 		$num = mysql_numrows($result);
! 		echo mysql_error();
! 		for ($i = 0 ;$i < $num; $i++) {
! 			$departmentID				= mysql_result($result, $i, $column['id']);
! 			$to							= mysql_result($result, $i, $column['email']);
! 			$departmentName				= mysql_result($result, $i, $column['name']);
! 			$departmentPhone			= mysql_result($result, $i, $column['phone']);
! 			$departmentCountry			= mysql_result($result, $i, $column['country']);
! 			$departmentFax				= mysql_result($result, $i, $column['fax']);
! 		}
! 		$recepient = $departmentName;
! 		if(strlen($to) < 4){
! 		    $table	= $pntable['company_table'];
! 	    	$column	= &$pntable['company'];
! 			$result = mysql_query("SELECT * FROM ".$table." WHERE ".$column['hide']."='0' order by ".$column['name']."");
! 			$num = mysql_numrows($result);
! 			for ($i = 0 ;$i < $num; $i++){
! 				$companyName				= mysql_result($result, $i, $column['name']);
! 				$companyAddress				= mysql_result($result, $i, $column['address']);
! 				$companyCity				= mysql_result($result, $i, $column['city']);
! 				$companyZip					= mysql_result($result, $i, $column['zip']);
! 				$companyCountry				= mysql_result($result, $i, $column['country']);
! 				$companyPhone				= mysql_result($result, $i, $column['phone']);
! 				$companyFax					= mysql_result($result, $i, $column['fax']);
! 				$to							= mysql_result($result, $i, $column['mail']);
! 			}
! 			if(strlen($recepient) < 4){
! 				$recepient = $companyName;
! 			}
! 		}
! 	}else{
! 	    $table	= $pntable['company_table'];
!     	$column	= &$pntable['company'];
! 		$result = mysql_query("SELECT * FROM ".$table." WHERE ".$column['hide']."='0' order by ".$column['name']."");
! 		$num = mysql_numrows($result);
! 		for ($i = 0 ;$i < $num; $i++){
! 			$companyName				= mysql_result($result, $i, $column['name']);
! 			$companyAddress				= mysql_result($result, $i, $column['address']);
! 			$companyCity				= mysql_result($result, $i, $column['city']);
! 			$companyZip					= mysql_result($result, $i, $column['zip']);
! 			$companyCountry				= mysql_result($result, $i, $column['country']);
! 			$companyPhone				= mysql_result($result, $i, $column['phone']);
! 			$companyFax					= mysql_result($result, $i, $column['fax']);
! 			$to							= mysql_result($result, $i, $column['mail']);
! 		}
! 		$country	= getCountry($prefix,$companyCountry);
! 		$city		= getCity($prefix,$companyCity);
! 		$recepient	= $companyName;
! 	}
  
  echo "
! 	<html xmlns=\"http://www.w3.org/1999/xhtml\">
! 	<head>
! 	<title>"._CICONTACT." $recepient</title>
! 	<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />
! 	<link href=\"modules/".$ModName."/css/style.css\" rel=\"stylesheet\" type=\"text/css\" />
! 	</head>
! 	<body bgcolor=\"#FFFFFF\" text=\"#000000\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">
  ";
  include("modules/$ModName/global_functions/javascripts.php");
  echo "<form action=\"modules.php?op=modload&file=show_user_functions&pid=sendmail&name=".$ModName."&personID=".$personID."&department=".$department."&company=".$company."\" method=\"post\">";
  
! 	if($GLOBALS['sendMailToCompany'] == 1) {
! 		$name 		= $GLOBALS['sender_name'];
! 		$phone 		= $GLOBALS['sender_phone'];
! 		$email 		= $GLOBALS['sender_email'];
! 		$copy 		= $GLOBALS['sender_wantcopy'];
! 		$message 	= htmlspecialchars($GLOBALS['sender_message']);
! 		
! 		if(strlen($email) > 0){
! 			if(!preg_match("'^[a-z0-9_.=-]+@(?:[a-z0-9-]+\.)+([a-z]{2,3})\$'i", $email)){
! 				$error_message .= _EMAIL_ERROR_."<br>";
! 			}
! 		}
! 		if(strlen($message) < 3){
! 			$error_message .= _MESSAGE_ERROR_."<br>";
! 		}
! 		if(strlen($name) < 3){
! 			$error_message .= _NAME_ERROR_."<br>";
! 		}
! 		$contact 	= $GLOBALS['sender_wants_contact'];
! 		$department	= $recepient;
! 		if($contact == 1) {
! 			$contact 		= "-----------------------------------------------------------------------------\nPlease Contact me!\n";
! 			$contactHTML 	= "Please Contact me!\n";
! 		}
! 		$sendMessage = "Contact: $department\n";
! 		$sendMessage .= "-----------------------------------------------------------------------------\n";
! 		$sendMessage .= "Name $name\n";
! 		$sendMessage .= "Phone $phone\n";
! 		$sendMessage .= "Email $email\n";
! 		$sendMessage .= "-----------------------------------------------------------------------------\n";
! 		$sendMessage .= "$message\n";
! 		$sendMessage .= "\n";
! 		$sendMessage .= "".$contact."-----------------------------------------------------------------------------\n";
! 		$sendMessage .= "Date and time: ".date("Y-m-d")." ".date("H:i")."\n";
! 		$sendMessage .= "\n";
  
! 		$sendHTMLMessage = "Department: $department\n";
! 		$sendHTMLMessage .= "\n";
! 		$sendHTMLMessage .= "Name $name\n";
! 		$sendHTMLMessage .= "Phone $phone\n";
! 		$sendHTMLMessage .= "Email $email\n";
! 		$sendHTMLMessage .= "\n";
! 		$sendHTMLMessage .= "$message\n";
! 		$sendHTMLMessage .= "\n";
! 		$sendHTMLMessage .= $contactHTML;
! 		$sendHTMLMessage .= "Date and time: ".date("Y-m-d")." ".date("H:i")."\n";
  
! 		if($GLOBALS['preview'] == 1) {
! 			$preview_data .= "&nbsp;<br /><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><p class=\"ContactInfoHeader\"><b>"._CIPREVIEW."</b></p><font class=\"ContactInfoText\">".nl2br(htmlspecialchars($sendHTMLMessage))."<hr noshade size=\"1\"></font></td></tr></table>";
! 		}else{
! 			if(!$error_message){
! 				$header = "From: ".$email."\r\nReply-To: ".$email."\r\nX-Mailer: Script from server ".$SERVER_NAME;
! 				$mail_success	= @mail($to,"ContactMail",$sendMessage,$header);
! 				if($copy && $email){
! 					$c_mail_success = @mail($email,"Copy of ContactMail",$sendMessage,$header);
! 				}
! 				if(!$mail_success){
! 					writeToErrorLogg($sendMessage);
! 				}
! 				$mail_sent = 1;
! 			}
! 		}
! 	}
! 	if($error_message){
! 		$preview_data = "&nbsp;<br /><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><p class=\"ContactInfoHeader\"><font class=\"ContactInfoHeader\"><b>"._ERROR_INTRODUCTION_."</b></font><p class=\"ContactInfoText\">".$error_message."</p></td></tr></table>".$preview_data;
! 	}
! 		echo "<table width=\"100%\"  border=\"0\"  cellspacing=\"0\" cellpadding=\"0\">
! 		<tr><input type=\"hidden\" name=\"sendMailToCompany\" value=\"1\">
! 		<td width=\"20\"><img src=\"modules/$ModName/images/contactform/head_left.gif\" width=\"20\" height=\"28\" /></td>
! 		<td align=\"center\" valign=\"middle\" background=\"modules/$ModName/images/contactform/head_middle.gif\" class=\"ContactInfoHeader\"><font class=\"ContactInfoHeader\"><b>"._CICONTACT." $recepient</font><img src=\"modules/$ModName/images/contactform/exclam.gif\" width=\"11\" height=\"22\" align=\"absmiddle\" /></b></td>
! 		<td width=\"27\"><img src=\"modules/$ModName/images/contactform/head_right.gif\" width=\"27\" height=\"28\" /></td>
! 		</tr>
! 		</table><table width=\"100%\"  border=\"0\"  cellspacing=\"0\" cellpadding=\"0\">
! 		<tr>
! 		<td width=\"20\" background=\"modules/$ModName/images/contactform/boxleft.gif\"><img src=\"modules/$ModName/images/contactform/boxleft.gif\" width=\"20\" height=\"25\" /></td>
! 		<td align=\"center\">";
! 	if(!$mail_sent) {
! 		print_FormParts($preview_data);
! 	}else{
! 		sendThankYou();
! 	}
! 		echo "</td>
! 		<td width=\"27\" background=\"modules/$ModName/images/contactform/boxright.gif\"><img src=\"modules/$ModName/images/contactform/boxright.gif\" width=\"27\" height=\"25\" /></td>
! 		</tr>
! 		</table><table width=\"100%\"  border=\"0\"  cellspacing=\"0\" cellpadding=\"0\">
! 		<tr>
! 		<td width=\"20\"><img src=\"modules/$ModName/images/contactform/boxbott_left.gif\" width=\"20\" height=\"22\" /></td>
! 		<td background=\"modules/$ModName/images/contactform/boxbott_middle.gif\"><img src=\"modules/$ModName/images/contactform/boxbott_middle.gif\" width=\"9\" height=\"22\" /></td>
! 		<td width=\"27\"><img src=\"modules/$ModName/images/contactform/boxbott_right.gif\" width=\"27\" height=\"22\" /></td>
! 		</tr>
! 		</table></form>
! 		</body>
! 		</html>";
  }
  theindex($personID,$department,$company);
--- 134,385 ----
  
  function theindex($personID,$department,$company) {
!     global $ModName,$prefix,$sitename,$SERVER_NAME;
!     list($dbconn) = pnDBGetConn();
!     $pntable = PostContact_pntables();
  
!     if($personID > 0){
!         $table    = $pntable['persons_table'];
!         $column    = &$pntable['person'];
! 
!         $query = "SELECT ".$column['id'].", ".$column['mail']. 
!             ", ".$column['firstname'].", ".$column['lastname'].
!             " FROM ".$table." WHERE (".$column['id']."='$personID' and ".$column['hide']."='1')";
!         $result = $dbconn->Execute( $query );
!         if ( $result == false ) {
!             PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
!         }
! 
!         for (; !$result->EOF; $result->MoveNext() ) {
!             $personID               = $result->fields[0];  
!             $to                     = $result->fields[1];  
!             $personFirstName        = $result->fields[2];  
!             $personLastName         = $result->fields[3];  
!         }
! 
!         $recepient = $personFirstName." ".$personLastName;
!         if(strlen($to) < 4){
!             $table    = $pntable['company_table'];
!             $column    = &$pntable['company'];
! 
!             $query = "SELECT ".$column['name'].", ".$column['address'].
!                 ", ".$column['address2'].", ".$column['city'].
!                 ", ".$column['state'].", ".$column['zip'].
!                 ", ".$column['country'].", ".$column['phone'].
!                 ", ".$column['fax'].", ".$column['mail'].
!                 " FROM ".$table." WHERE ".$column['hide']."='0' order by ".$column['name']."";
!                 
!             $result = $dbconn->Execute( $query );
!             if ( $result == false ) {
!                 PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
!             }
! 
!             for (; !$result->EOF; $result->MoveNext() ) {
!                 $companyName            = $result->fields[0];  
!                 $companyAddress         = $result->fields[1];  
!                 $companyAddress2        = $result->fields[2];  
!                 $companyCity            = $result->fields[3];  
!                 $companyState           = $result->fields[4];  
!                 $companyZip             = $result->fields[5];  
!                 $companyCountry         = $result->fields[6];  
!                 $companyPhone           = $result->fields[7];  
!                 $companyFax             = $result->fields[8];  
!                 $to                     = $result->fields[9];  
!             }
!             if(strlen($recepient) < 4){
!                 $recepient = $companyName;
!             }
!         }
!     }elseif($department > 0){
!         $table    = $pntable['departments_table'];
!         $column    = &$pntable['departments'];
!         $query = "SELECT ".$column['id'].", ".$column['name'].
!             ", ".$column['phone'].", ".$column['country'].
!             ", ".$column['fax'].", ".$column['email'].
!             " FROM ".$table." WHERE ".$column['id']."='$department'";
! 
!         $result = $dbconn->Execute( $query );
!         if ( $result == false ) {
!             PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
!         }
! 
!         for (; !$result->EOF; $result->MoveNext() ) {
!             $departmentID           = $result->fields[0];  
!             $departmentName         = $result->fields[1];  
!             $departmentPhone        = $result->fields[2];  
!             $departmentCountry      = $result->fields[3];  
!             $departmentFax          = $result->fields[4];  
!             $to                     = $result->fields[5];  
!         }
!         $recepient = $departmentName;
!         if(strlen($to) < 4){
!             $table    = $pntable['company_table'];
!                 $column    = &$pntable['company'];
! 
!             $query = "SELECT ".$column['name'].", ".$column['address'].
!                 ", ".$column['address2'].", ".$column['city'].
!                 ", ".$column['state'].", ".$column['zip'].
!                 ", ".$column['country'].", ".$column['phone'].
!                 ", ".$column['fax'].", ".$column['mail'].
!                 " FROM ".$table." WHERE ".$column['hide']."='0' order by ".$column['name']."";
! 
!             $result = $dbconn->Execute( $query );
!             if ( $result == false ) {
!                 PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
!             }
! 
!             for (; !$result->EOF; $result->MoveNext() ) {
!                 $companyName            = $result->fields[0];  
!                 $companyAddress         = $result->fields[1];  
!                 $companyAddress2        = $result->fields[2];  
!                 $companyCity            = $result->fields[3];  
!                 $companyState           = $result->fields[4];  
!                 $companyZip             = $result->fields[5];  
!                 $companyCountry         = $result->fields[6];  
!                 $companyPhone           = $result->fields[7];  
!                 $companyFax             = $result->fields[8];  
!                 $to                     = $result->fields[9];  
!             }
!             if(strlen($recepient) < 4){
!                 $recepient = $companyName;
!             }
!         }
!     }else{
!         $table    = $pntable['company_table'];
!         $column    = &$pntable['company'];
! 
!         $query = "SELECT ".$column['name'].", ".$column['address'].
!             ", ".$column['address2'].", ".$column['city'].
!             ", ".$column['state'].", ".$column['zip'].
!             ", ".$column['country'].", ".$column['phone'].
!             ", ".$column['fax'].", ".$column['mail'].
!             " FROM ".$table." WHERE ".$column['hide']."='0' order by ".$column['name']."";
! 
!         $result = $dbconn->Execute( $query );
!         if ( $result == false ) {
!             PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
!         }
! 
!         for (; !$result->EOF; $result->MoveNext() ) {
!             $companyName            = $result->fields[0];  
!             $companyAddress         = $result->fields[1];  
!             $companyAddress2        = $result->fields[2];  
!             $companyCity            = $result->fields[3];  
!             $companyState           = $result->fields[4];  
!             $companyZip             = $result->fields[5];  
!             $companyCountry         = $result->fields[6];  
!             $companyPhone           = $result->fields[7];  
!             $companyFax             = $result->fields[8];  
!             $to                     = $result->fields[9];  
!         }
!         $country        = getCountry($prefix,$companyCountry);
!         $city           = getCity($prefix,$companyCity);
!         $recepient      = $companyName;
!     }
  
  echo "
!     <html xmlns=\"http://www.w3.org/1999/xhtml\">
!     <head>
!     <title>"._CICONTACT." $recepient</title>
!     <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />
!     <link href=\"modules/".$ModName."/css/style.css\" rel=\"stylesheet\" type=\"text/css\" />
!     </head>
!     <body bgcolor=\"#FFFFFF\" text=\"#000000\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">
  ";
  include("modules/$ModName/global_functions/javascripts.php");
  echo "<form action=\"modules.php?op=modload&file=show_user_functions&pid=sendmail&name=".$ModName."&personID=".$personID."&department=".$department."&company=".$company."\" method=\"post\">";
  
!     if($GLOBALS['sendMailToCompany'] == 1) {
!         $name         = $GLOBALS['sender_name'];
!         $phone         = $GLOBALS['sender_phone'];
!         $email         = $GLOBALS['sender_email'];
!         $copy         = $GLOBALS['sender_wantcopy'];
!         $message     = htmlspecialchars($GLOBALS['sender_message']);
!         
!         if(strlen($email) > 0){
!             if(!preg_match("'^[a-z0-9_.=-]+@(?:[a-z0-9-]+\.)+([a-z]{2,3})\$'i", $email)){
!                 $error_message .= _EMAIL_ERROR_."<br>";
!             }
!         }
!         if(strlen($message) < 3){
!             $error_message .= _MESSAGE_ERROR_."<br>";
!         }
!         if(strlen($name) < 3){
!             $error_message .= _NAME_ERROR_."<br>";
!         }
!         $contact     = $GLOBALS['sender_wants_contact'];
!         $department    = $recepient;
!         if($contact == 1) {
!             $contact         = "-----------------------------------------------------------------------------\nPlease Contact me!\n";
!             $contactHTML     = "Please Contact me!\n";
!         }
!         $sendMessage = "Contact: $department\n";
!         $sendMessage .= "-----------------------------------------------------------------------------\n";
!         $sendMessage .= "Name $name\n";
!         $sendMessage .= "Phone $phone\n";
!         $sendMessage .= "Email $email\n";
!         $sendMessage .= "-----------------------------------------------------------------------------\n";
!         $sendMessage .= "$message\n";
!         $sendMessage .= "\n";
!         $sendMessage .= "".$contact."-----------------------------------------------------------------------------\n";
!         $sendMessage .= "Date and time: ".date("Y-m-d")." ".date("H:i")."\n";
!         $sendMessage .= "\n";
  
!         $sendHTMLMessage = "Department: $department\n";
!         $sendHTMLMessage .= "\n";
!         $sendHTMLMessage .= "Name $name\n";
!         $sendHTMLMessage .= "Phone $phone\n";
!         $sendHTMLMessage .= "Email $email\n";
!         $sendHTMLMessage .= "\n";
!         $sendHTMLMessage .= "$message\n";
!         $sendHTMLMessage .= "\n";
!         $sendHTMLMessage .= $contactHTML;
!         $sendHTMLMessage .= "Date and time: ".date("Y-m-d")." ".date("H:i")."\n";
  
!         if($GLOBALS['preview'] == 1) {
!             $preview_data .= "&nbsp;<br /><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><p class=\"ContactInfoHeader\"><b>"._CIPREVIEW."</b></p><font class=\"ContactInfoText\">".nl2br(htmlspecialchars($sendHTMLMessage))."<hr noshade size=\"1\"></font></td></tr></table>";
!         }else{
!             if(!$error_message){
!                 $header = "From: ".$email."\r\nReply-To: ".$email."\r\nX-Mailer: Script from server ".$SERVER_NAME;
!                 $mail_success    = @mail($to,"ContactMail",$sendMessage,$header);
!                 if($copy && $email){
!                     $c_mail_success = @mail($email,"Copy of ContactMail",$sendMessage,$header);
!                 }
!                 if(!$mail_success){
!                     writeToErrorLogg($sendMessage);
!                 }
!                 $mail_sent = 1;
!             }
!         }
!     }
!     if($error_message){
!         $preview_data = "&nbsp;<br /><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><p class=\"ContactInfoHeader\"><font class=\"ContactInfoHeader\"><b>"._ERROR_INTRODUCTION_."</b></font><p class=\"ContactInfoText\">".$error_message."</p></td></tr></table>".$preview_data;
!     }
!         echo "<table width=\"100%\"  border=\"0\"  cellspacing=\"0\" cellpadding=\"0\">
!         <tr><input type=\"hidden\" name=\"sendMailToCompany\" value=\"1\">
!         <td width=\"20\"><img src=\"modules/$ModName/images/contactform/head_left.gif\" width=\"20\" height=\"28\" /></td>
!         <td align=\"center\" valign=\"middle\" background=\"modules/$ModName/images/contactform/head_middle.gif\" class=\"ContactInfoHeader\"><font class=\"ContactInfoHeader\"><b>"._CICONTACT." $recepient</font><img src=\"modules/$ModName/images/contactform/exclam.gif\" width=\"11\" height=\"22\" align=\"absmiddle\" /></b></td>
!         <td width=\"27\"><img src=\"modules/$ModName/images/contactform/head_right.gif\" width=\"27\" height=\"28\" /></td>
!         </tr>
!         </table><table width=\"100%\"  border=\"0\"  cellspacing=\"0\" cellpadding=\"0\">
!         <tr>
!         <td width=\"20\" background=\"modules/$ModName/images/contactform/boxleft.gif\"><img src=\"modules/$ModName/images/contactform/boxleft.gif\" width=\"20\" height=\"25\" /></td>
!         <td align=\"center\">";
!     if(!$mail_sent) {
!         print_FormParts($preview_data);
!     }else{
!         sendThankYou();
!     }
!         echo "</td>
!         <td width=\"27\" background=\"modules/$ModName/images/contactform/boxright.gif\"><img src=\"modules/$ModName/images/contactform/boxright.gif\" width=\"27\" height=\"25\" /></td>
!         </tr>
!         </table><table width=\"100%\"  border=\"0\"  cellspacing=\"0\" cellpadding=\"0\">
!         <tr>
!         <td width=\"20\"><img src=\"modules/$ModName/images/contactform/boxbott_left.gif\" width=\"20\" height=\"22\" /></td>
!         <td background=\"modules/$ModName/images/contactform/boxbott_middle.gif\"><img src=\"modules/$ModName/images/contactform/boxbott_middle.gif\" width=\"9\" height=\"22\" /></td>
!         <td width=\"27\"><img src=\"modules/$ModName/images/contactform/boxbott_right.gif\" width=\"27\" height=\"22\" /></td>
!         </tr>
!         </table></form>
!         </body>
!         </html>";
  }
  theindex($personID,$department,$company);

Index: vicitcard.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/PostContact/user_functions/vicitcard.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** vicitcard.php	23 Jul 2002 12:07:08 -0000	1.2
--- vicitcard.php	6 Aug 2002 20:16:57 -0000	1.3
***************
*** 1,197 ****
  <?
  // $Id$ $Name$
  if(basename($PHP_SELF) == basename(__FILE__)){
! echo "You have no access to this file!!!";
! exit;
  }
  
  function theindex($personID){
! 	global $ModName,$prefix,$sitename;
! 	list($dbconn) = pnDBGetConn();
! 	$pntable = PostContact_pntables();
! 
!     $table          = $pntable['company_table'];
!     $column         = &$pntable['company'];
  
!     $result = mysql_query("SELECT * FROM ".$table." WHERE ".$column['hide']."='0' order by ".$column['name']);
  
!     $num = mysql_numrows($result);
!     for ($i = 0 ;$i < $num; $i++){
! 		$companyName				= mysql_result($result, $i, $column['name']);
! 		$companyAddress				= mysql_result($result, $i, $column['address']);
! 		$companyCity				= mysql_result($result, $i, $column['city']);
! 		$companyZip					= mysql_result($result, $i, $column['zip']);
! 		$companyCountry				= mysql_result($result, $i, $column['country']);
! 		$companyPhone				= mysql_result($result, $i, $column['phone']);
! 		$companyFax					= mysql_result($result, $i, $column['fax']);
! 		$companyMail				= mysql_result($result, $i, $column['mail']);
! 		$companyState				= mysql_result($result, $i, $column['state']);
! 		$companyLogo				= mysql_result($result, $i, $column['logo']);
! 	}
  
! 	$companyCity				= getCity($prefix,$companyCity);
! 	$companyCity				= $companyCity['name'];
  
  
!     $table          = $pntable['persons_table'];
!     $column         = &$pntable['person'];
!     $table2         = $pntable['attributes_table'];
!     $column2        = &$pntable['attribute'];
      $contactType    = "P";
  
!     $query = "SELECT * FROM ".$table.", ".$table2 .
!              " WHERE (".$column['id']."='$personID' and ".$column['hide']."='1')" .
!              " AND ".$column['id']."=".$column2['id'] .
!              " AND ".$column2['contacttype']."='".$contactType."'";
  
!     $result = mysql_query($query);
  
!     if(mysql_error()){
! 	echo "<p>MySQL-fel: ".mysql_error()."</p>";
!         echo "<p>".$query."</p>";
      }
  
!     $num = mysql_numrows($result);
!     for ($i = 0 ;$i < $num; $i++){
! 		$personID					= mysql_result($result, $i, $column['id']);
! 		$attributeShowImage			= mysql_result($result, $i, $column['showimage']);
! 		$personMail					= mysql_result($result, $i, $column['mail']);
! 		$personFirstName			= mysql_result($result, $i, $column['firstname']);
! 		$personLastName				= mysql_result($result, $i, $column['lastname']);
! 		$personAddress				= mysql_result($result, $i, $column['address']);
! 		$personAddress2				= mysql_result($result, $i, $column['address2']);
! 		$personZip					= mysql_result($result, $i, $column['zip']);
! 		$personCity					= mysql_result($result, $i, $column['city']);
! 		$personCountry				= mysql_result($result, $i, $column['country']);
! 		$personLang					= mysql_result($result, $i, $column['lang']);
! 		$personFax					= mysql_result($result, $i, $column['fax']);
! 		$personState				= mysql_result($result, $i, $column['state']);
! 		$personMobile				= mysql_result($result, $i, $column['mobile']);
! 		$personPhone				= mysql_result($result, $i, $column['phone']);
! 		$personPager				= mysql_result($result, $i, $column['pager']);
! 		$personICQ					= mysql_result($result, $i, $column['ICQ']);
! 		$personAIM					= mysql_result($result, $i, $column['AIM']);
! 		$personYIM					= mysql_result($result, $i, $column['YIM']);
! 		$personMSNM					= mysql_result($result, $i, $column['MSNM']);
! 		$personImage				= mysql_result($result, $i, $column['image']);
! 		$personTypePhone			= mysql_result($result, $i, $column['typephone']);
! 		$personTypeFax				= mysql_result($result, $i, $column['typefax']);
! 		$personTypePager			= mysql_result($result, $i, $column['typepager']);
! 		$personTypeMobile			= mysql_result($result, $i, $column['typemobile']);
! 		$personHide					= mysql_result($result, $i, $column['hide']);
! 		$attributeShowName			= mysql_result($result, $i, $column2['showname']);
! 		$attributeShowAddress		= mysql_result($result, $i, $column2['showaddress']);
! 		$attributeShowAddress2		= mysql_result($result, $i, $column2['showaddress2']);
! 		$attributeShowZip			= mysql_result($result, $i, $column2['showzip']);
! 		$attributeShowCity			= mysql_result($result, $i, $column2['showcity']);
! 		$attributeShowCountry		= mysql_result($result, $i, $column2['showcountry']);
! 		$attributeShowPhone			= mysql_result($result, $i, $column2['showphone']);
! 		$attributeShowFax			= mysql_result($result, $i, $column2['showfax']);
! 		$attributeShowMobile		= mysql_result($result, $i, $column2['showmobile']);
! 		$attributeShowPager			= mysql_result($result, $i, $column2['showpager']);
! 		$attributeShowEmail			= mysql_result($result, $i, $column2['showemail']);
! 		$attributeShowICQ			= mysql_result($result, $i, $column2['showICQ']);
! 		$attributeShowAIM			= mysql_result($result, $i, $column2['showAIM']);
! 		$attributeShowYIM			= mysql_result($result, $i, $column2['showYIM']);
! 		$attributeShowMSNM			= mysql_result($result, $i, $column2['showMSNM']);
! 		$attributeShowTitle			= mysql_result($result, $i, $column2['showtitle']);
! 		$attributeShowState			= mysql_result($result, $i, $column2['showState']);
! 		$attributeShowDepartment	= mysql_result($result, $i, $column2['showdepartment']);
! 		$personTitleID				= mysql_result($result, $i, $column['titleID']);
! 		
! 		
! 	}
  
  
! 		$personTitle				= getTitle($prefix,$personTitleID);
! 		$personCity					= getCity($prefix,$personCity);
! 		
! 		$personTitleName			= $personTitle['name'];
! 		$personCityName				= $personCity['name'];
! 		
! 		$personTypePhone			= getContactType($prefix,$personTypePhone);
! 		$personTypeFax				= getContactType($prefix,$personTypeFax);
! 		$personTypePager			= getContactType($prefix,$personTypePager);
! 		$personTypeMobile			= getContactType($prefix,$personTypeMobile);
! 		
! 		$personTypePhone			= $personTypePhone['name'];
! 		$personTypeFax				= $personTypeFax['name'];
! 		$personTypePager			= $personTypePager['name'];
! 		$personTypeMobile			= $personTypeMobile['name'];
  
  
! 		if((!is_file($personImage)) OR (!$attributeShowImage)){
! 			$personImage 			= "modules/$ModName/images/transparent.gif";
! 			$PersonImageProp		= " border=\"0\" cellpadding=\"0\"  cellspacing=\"0\"";
! 		}else{
! 			$PersonImageProp		= " border=\"1\" cellpadding=\"0\"  cellspacing=\"0\" class=\"BusinessCardFotoBackground\"";
! 		}
  
  
! 	if(!is_file($companyLogo)){
! 		$companyLogo 				= "modules/$ModName/images/transparent.gif";
! 		$logoProp					= " border=\"0\" cellpadding=\"0\"  cellspacing=\"0\"";
! 	}else{
! 		$logoProp					= " border=\"1\" cellpadding=\"0\"  cellspacing=\"0\" class=\"BusinessCardFotoBackground\"";
! 	}
  
!     $table	= $pntable['department_members_table'];
!     $column	= &$pntable['department_members'];
  
  
! 	$result = mysql_query("SELECT * FROM ".$table." WHERE ".$column['id']."='$personID'");
! 	$num = mysql_numrows($result);
! 	echo mysql_error();
! 	for ($i = 0 ;$i < $num; $i++){
! 		$departmentID				= mysql_result($result, $i, $column['depid']);
! 	}
  
!     $table	= $pntable['departments_table'];
!     $column	= &$pntable['departments'];
  
  
! 	$result = mysql_query("SELECT * FROM ".$table." WHERE ".$column['id']."='$departmentID'");
! 	$num = mysql_numrows($result);
! 	if(!$num){
! 		$departmentName = "";
! 	}else{
! 		echo mysql_error();
! 		for ($i = 0 ;$i < $num; $i++){
! 			$departmentID				= mysql_result($result, $i, $column['id']);
! 			$departmentEmail			= mysql_result($result, $i, $column['email']);
! 			$departmentName				= mysql_result($result, $i, $column['name']);
! 			$departmentPhone			= mysql_result($result, $i, $column['phone']);
! 			$departmentCountry			= mysql_result($result, $i, $column['country']);
! 			$departmentFax				= mysql_result($result, $i, $column['fax']);
! 		}
! 	}
  
  
! // Check what to show, else use companyinfo
! if(!$attributeShowState){
! 	$personState = $companyState;
! }elseif(!$personState){ // If no state is used for user, then use company state
! 	$personState = $companyState;
! }
  if((!$attributeShowAddress) or ($personAddress == "")){
! 	$personAddress = $companyAddress;
  }
  if((!$attributeShowZip) or ($personZip == "")){
! 	$personZip = $companyZip;
  }
  if((!$attributeShowCity) or ($personCity == "")){
! 	$personCity = $companyCity;
  }
  if((!$attributeShowCountry) or ($personCountry == "")){
! 	$personCountry = $companyCountry;
  }
  if((!$attributeShowPhone) or ($personPhone == "")){
! 	$personPhone = $companyPhone;
  }
  if((!$attributeShowFax) or ($personFax == "")){
! 	$personFax = $companyFax;
  }
  if(!$attributeShowMobile){
! 	$personMobile = "";
  }
  if(!$attributeShowPager){
--- 1,252 ----
  <?
  // $Id$ $Name$
+ // ----------------------------------------------------------------------
+ // POST-NUKE Content Management System
+ // Copyright (C) 2002 by the PostNuke Development Team.
+ // http://www.postnuke.com/
+ // ----------------------------------------------------------------------
+ // LICENSE
+ //
+ // This program is free software; you can redistribute it and/or
+ // modify it under the terms of the GNU General Public License (GPL)
+ // as published by the Free Software Foundation; either version 2
+ // of the License, or (at your option) any later version.
+ //
+ // This program is distributed in the hope that it will be useful,
+ // but WIthOUT ANY WARRANTY; without even the implied warranty of
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ // GNU General Public License for more details.
+ //
+ // To read the license please visit http://www.gnu.org/copyleft/gpl.html
+ // ----------------------------------------------------------------------
+ // Original Author of file: Bjarne Varöystrand and Bjarne Varöystrand
+ // Modifications by: Richard Cave
+ // Purpose of file:  Display contact person information
+ // ----------------------------------------------------------------------
+ 
  if(basename($PHP_SELF) == basename(__FILE__)){
!     echo "You have no access to this file!!!";
!     exit;
  }
  
  function theindex($personID){
!     global $ModName,$prefix,$sitename;
!     list($dbconn) = pnDBGetConn();
!     $pntable = PostContact_pntables();
  
!     $table      = $pntable['company_table'];
!     $column     = &$pntable['company'];
  
!     $query = "SELECT ".$column['name'].", ".$column['address'].
!         ", ".$column['address2'].", ".$column['city'].
!         ", ".$column['state'].", ".$column['zip'].
!         ", ".$column['country'].", ".$column['phone'].
!         ", ".$column['fax'].", ".$column['mail'].", ".$column['logo'].
!         " FROM ".$table." WHERE ".$column['hide']."='0' order by ".$column['name'];
  
!     $result = $dbconn->Execute( $query );
!     if ( $result == false ) {
!         PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
!     }
  
+     for (; !$result->EOF; $result->MoveNext() ) {
+         $companyName            = $result->fields[0];  
+         $companyAddress         = $result->fields[1];  
+         $companyAddress2        = $result->fields[2];  
+         $companyCity            = $result->fields[3];  
+         $companyState           = $result->fields[4];  
+         $companyZip             = $result->fields[5];  
+         $companyCountry         = $result->fields[6];  
+         $companyPhone           = $result->fields[7];  
+         $companyFax             = $result->fields[8];  
+         $companyMail            = $result->fields[9];  
+         $companyLogo            = $result->fields[10];  
+     }
+     $companyCity        = getCity($prefix,$companyCity);
+     $companyCity        = $companyCity['name'];
  
!     $table      = $pntable['persons_table'];
!     $column     = &$pntable['person'];
!     $table2     = $pntable['attributes_table'];
!     $column2    = &$pntable['attribute'];
      $contactType    = "P";
  
!     $query = "SELECT ".$column['id'].", ".$column['mail'].
!         ", ".$column['firstname'].", ".$column['lastname'].
!         ", ".$column['mobile'].", ".$column['phone'].
!         ", ".$column['address'].", ".$column['address2'].
!         ", ".$column['city'].", ".$column['state'].
!         ", ".$column['zip'].", ".$column['country'].
!         ", ".$column['lang'].
!         ", ".$column['fax'].", ".$column['hide'].
!         ", ".$column['image'].", ".$column['pager'].
!         ", ".$column['ICQ'].", ".$column['AIM'].
!         ", ".$column['YIM'].", ".$column['MSNM'].
!         ", ".$column['typephone'].", ".$column['typefax'].
!         ", ".$column['titleID'].", ".$column['typepager'].
!         ", ".$column['typemobile'].
!         ", ".$column2['showname'].
!         ", ".$column2['showaddress'].", ".$column2['showaddress2'].
!         ", ".$column2['showcity'].", ".$column2['showstate'].
!         ", ".$column2['showzip'].", ".$column2['showcountry']. 
!         ", ".$column2['showphone'].", ".$column2['showfax'].
!         ", ".$column2['showmobile'].", ".$column2['showpager'].
!         ", ".$column2['showemail'].", ".$column2['showICQ'].
!         ", ".$column2['showAIM'].", ".$column2['showYIM'].
!         ", ".$column2['showMSNM'].", ".$column2['showtitle'].
!         ", ".$column2['showdepartment'].", ".$column2['showimage'].
!         " FROM ".$table.", ".$table2.
!         " WHERE (".$column['id']."='$personID' and ".$column['hide']."='1')" .
!         " AND ".$column['id']."=".$column2['id'] .
!         " AND ".$column2['contacttype']."='".$contactType."'";
  
!     $result = $dbconn->Execute( $query );
!     if ( $result == false ) {
!         PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
!     }
  
!     for (; !$result->EOF; $result->MoveNext() ) {
!         $personID                   = $result->fields[0];  
!         $personMail                 = $result->fields[1];  
!         $personFirstName            = $result->fields[2];  
!         $personLastName             = $result->fields[3];  
!         $personMobile               = $result->fields[4];  
!         $personPhone                = $result->fields[5];  
!         $personAddress              = $result->fields[6];  
!         $personAddress2             = $result->fields[7];  
!         $personCity                 = $result->fields[8];  
!         $personState                = $result->fields[9];  
!         $personZip                  = $result->fields[10];  
!         $personCountry              = $result->fields[11];  
!         $personLang                 = $result->fields[12];  
!         $personFax                  = $result->fields[13];  
!         $personHide                 = $result->fields[14];  
!         $personImage                = $result->fields[15];  
!         $personPager                = $result->fields[16];  
!         $personICQ                  = $result->fields[17];  
!         $personAIM                  = $result->fields[18];  
!         $personYIM                  = $result->fields[19];  
!         $personMSNM                 = $result->fields[20];  
!         $personTypePhone            = $result->fields[21];  
!         $personTypeFax              = $result->fields[22];  
!         $personTitleID              = $result->fields[23];  
!         $personTypePager            = $result->fields[24];  
!         $personTypeMobile           = $result->fields[25];  
!         $attributeShowName          = $result->fields[26];  
!         $attributeShowAddress       = $result->fields[27];  
!         $attributeShowAddress2      = $result->fields[28];  
!         $attributeShowCity          = $result->fields[29];  
!         $attributeShowState         = $result->fields[30];  
!         $attributeShowZip           = $result->fields[31];  
!         $attributeShowCountry       = $result->fields[32];  
!         $attributeShowPhone         = $result->fields[33];  
!         $attributeShowFax           = $result->fields[34];  
!         $attributeShowMobile        = $result->fields[35];  
!         $attributeShowPager         = $result->fields[36];  
!         $attributeShowEmail         = $result->fields[37];  
!         $attributeShowICQ           = $result->fields[38];  
!         $attributeShowAIM           = $result->fields[39];  
!         $attributeShowYIM           = $result->fields[40];  
!         $attributeShowMSNM          = $result->fields[41];  
!         $attributeShowTitle         = $result->fields[42];  
!         $attributeShowDepartment    = $result->fields[43];  
!         $attributeShowImage         = $result->fields[44];  
      }
  
!     $personTitle                = getTitle($prefix,$personTitleID);
!     $personCity                 = getCity($prefix,$personCity);
!     
!     $personTitleName            = $personTitle['name'];
!     $personCityName             = $personCity['name'];
!     
!     $personTypePhone            = getContactType($prefix,$personTypePhone);
!     $personTypeFax              = getContactType($prefix,$personTypeFax);
!     $personTypePager            = getContactType($prefix,$personTypePager);
!     $personTypeMobile           = getContactType($prefix,$personTypeMobile);
!     
!     $personTypePhone            = $personTypePhone['name'];
!     $personTypeFax              = $personTypeFax['name'];
!     $personTypePager            = $personTypePager['name'];
!     $personTypeMobile           = $personTypeMobile['name'];
  
  
!     if((!is_file($personImage)) OR (!$attributeShowImage)){
!         $personImage            = "modules/$ModName/images/transparent.gif";
!         $PersonImageProp        = " border=\"0\" cellpadding=\"0\"  cellspacing=\"0\"";
!     }else{
!         $PersonImageProp        = " border=\"1\" cellpadding=\"0\"  cellspacing=\"0\" class=\"BusinessCardFotoBackground\"";
!     }
  
  
!     if(!is_file($companyLogo)){
!         $companyLogo             = "modules/$ModName/images/transparent.gif";
!         $logoProp                = " border=\"0\" cellpadding=\"0\"  cellspacing=\"0\"";
!     }else{
!         $logoProp                = " border=\"1\" cellpadding=\"0\"  cellspacing=\"0\" class=\"BusinessCardFotoBackground\"";
!     }
  
+     $table      = $pntable['department_members_table'];
+     $column     = &$pntable['department_members'];
  
!     $query = "SELECT ".$column['depid']." FROM ".$table." WHERE ".$column['id']."='$personID'";
!     $result = $dbconn->Execute( $query );
!     if ( $result == false ) {
!         PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
!     }
  
!     for (; !$result->EOF; $result->MoveNext() ) {
!         $departmentID            = $result->fields[0];  
!     }
  
+     $table    = $pntable['departments_table'];
+     $column    = &$pntable['departments'];
  
!     $query = "SELECT ".$column['id'].", ".$column['email'].", ".$column['name'].
!         ", ".$column['phone'].", ".$column['country'].", ".$column['fax'].
!         " FROM ".$table." WHERE ".$column['id']."='$departmentID'";
  
!     $result = $dbconn->Execute( $query );
!     if ( $result == false ) {
!          PN_DBMsgError( $dbconn, __FILE__, __LINE__, "Error accessing the database" );
!     }
  
+     // R.Cave - initialize $departmentName incase no rows are returned
+     $departmentName = "";
  
!     for (; !$result->EOF; $result->MoveNext() ) {
!         $departmentID            = $result->fields[0];  
!         $departmentEmail        = $result->fields[1];  
!         $departmentName            = $result->fields[2];  
!         $departmentPhone        = $result->fields[3];  
!         $departmentCountry        = $result->fields[4];  
!         $departmentFax            = $result->fields[5];  
!     }
  
  
! // Kontrollera vad som ska visas, anvŠnd annars company-prefs
! 
  if((!$attributeShowAddress) or ($personAddress == "")){
!     $personAddress = $companyAddress;
! }
! if((!$attributeShowState) or ($personState == "")){
!     $personState = $companyState;
  }
  if((!$attributeShowZip) or ($personZip == "")){
!     $personZip = $companyZip;
  }
  if((!$attributeShowCity) or ($personCity == "")){
!     $personCity = $companyCity;
  }
  if((!$attributeShowCountry) or ($personCountry == "")){
!     $personCountry = $companyCountry;
  }
  if((!$attributeShowPhone) or ($personPhone == "")){
!     $personPhone = $companyPhone;
  }
  if((!$attributeShowFax) or ($personFax == "")){
!     $personFax = $companyFax;
  }
  if(!$attributeShowMobile){
!     $personMobile = "";
  }
  if(!$attributeShowPager){
***************
*** 199,203 ****
  }
  if((!$attributeShowEmail) or ($personMail == "")){
! 	$personMail = $companyMail;
  }
  if(!$attributeShowICQ){
--- 254,258 ----
  }
  if((!$attributeShowEmail) or ($personMail == "")){
!     $personMail = $companyMail;
  }
  if(!$attributeShowICQ){
***************
*** 221,317 ****
  
  echo "<html>
! 	<head>
! 	<title>".$personFirstName." ".$personLastName."</title>
! 	</head>
! 	<link rel=\"StyleSheet\" href=\"modules/$ModName/css/style.css\" type=\"text/css\">
! 	<body bgcolor=\"#ffffff\" leftmargin=\"0\" marginwidth=\"0\" topmargin=\"0\" marginheight=\"0\">
! 	<table width=\"100%\" height=\"100%\">
! 	<tr>
! 	<td align=\"center\" valign=\"middle\">
! 	<table border=\"1\" cellpadding=\"0\"  cellspacing=\"0\" class=\"BusinessCardBackground\">
! 	<tr>
! 	<td><table width=\"100%\"  border=\"0\"  cellspacing=\"0\" cellpadding=\"2\">
! 	<tr>
! 	<td width=\"70\">&nbsp;</td>
! 	<th class=\"BusinessCardHeader\"><font class=\"BusinessCardHeader\">".$companyName;
! 	if($departmentName && $companyName){
! 		echo " - ";
! 	}
! 	echo $departmentName."</font></th>
! 	<td width=\"70\">&nbsp;</td>
! 	</tr><tr>
! 	<td width=\"70\" align=\"center\" valign=\"top\"><table width=\"100%\"".$PersonImageProp.">
! 	<tr>
! 	<td align=\"center\"><img src=\"".$personImage."\" width=\"60\" height=\"80\" vspace=\"3\" /></td>
! 	</tr>
! 	</table></td>
! 	<td align=\"left\" valign=\"middle\"><table width=\"100%\"  border=\"0\" cellpadding=\"2\"  cellspacing=\"0\">
! 	<tr>
! 	<td align=\"center\" class=\"BusinessCardText\"><font class=\"BusinessCardText\">".$personFirstName." ".$personLastName."</font></td>
! 	</tr>";
! 	if($attributeShowTitle){
! 		if($personTitleName){
! 			echo "<tr>
! 			<td align=\"center\" class=\"BusinessCardText\"><font class=\"BusinessCardText\"><i>".$personTitleName."</i></font></td>
! 			</tr>
! 			";
! 		}
! 	}	
! 	echo "<tr>
! 	<td align=\"center\" class=\"BusinessCardText\"><font class=\"BusinessCardText\">".$personAddress;
! 	if($personZip && $personAddress){
! 		echo ", ";
! 	}
! 	echo $personZip." ".$personCityName."</font></td>
! 	</tr><tr>
! 	<td align=\"center\" class=\"BusinessCardText\"><font class=\"BusinessCardText\">".$personCountry."</font></td>
! 	</tr><tr>
! 	<td align=\"center\"><img src=\"dots.gif\" width=\"207\" height=\"1\" vspace=\"1\" /></td>
! 	</tr>
! 	</table></td>
! 	<td width=\"70\" align=\"center\" valign=\"top\"><table width=\"100%\"".$logoProp.">
! 	<tr>
! 	<td align=\"center\" height=\"80\" valign=\"middle\"><img src=\"".$companyLogo."\" width=\"60\" vspace=\"3\" /></td>
! 	</tr>
! 	</table></td>
! 	</tr><tr>
! 	<td align=\"center\" valign=\"top\">&nbsp;</td>
! 	<td align=\"center\" valign=\"middle\" nowrap=\"nowrap\" class=\"BusinessCardContactWays\">";
! 	if($personPhone){
! 		echo "<font class=\"BusinessCardContactWays\"><b>"._CIPHONE.":</b>&nbsp;".$personPhone;
! 	}
! 	if($personFax && $personPhone){
! 		echo ",";
! 	}
! 	if($personFax){
! 		echo "&nbsp;<b>"._CIFAX.":</b>&nbsp;".$personFax."</font>";
! 	}
! 	echo "<br />";
! 	if($attributeShowMobile){
! 		if($personMobile){
! 			echo "<font class=\"BusinessCardContactWays\"><b>"._CIMOBILE.":</b>&nbsp;".$personMobile."";
! 		}
! 	}
! 	if($attributeShowICQ){
! 		if($attributeShowMobile && $personMobile){
! 			echo ", ";
! 		}
! 		if($personICQ){
! 		echo "<b>"._CIICQ.":</b> ".$personICQ."</font>";
! 		}
! 		echo "<br />";
! 	}elseif($attributeShowMobile){
! 		echo "<br />";
! 	}
! 	if($personMail){
! 		echo "<font class=\"BusinessCardContactWays\"><b>"._CIEMAIL.":</b>&nbsp;".$personMail."</font>";
! 	}
! 	echo "</td>
  
! 	<td align=\"center\" valign=\"top\">&nbsp;</td>
! 	</tr>
! 	</table></td>
! 	</tr>
! 	</table>";
  
  }
--- 276,372 ----
  
  echo "<html>
!     <head>
!     <title>".$personFirstName." ".$personLastName."</title>
!     </head>
!     <link rel=\"StyleSheet\" href=\"modules/$ModName/css/style.css\" type=\"text/css\">
!     <body bgcolor=\"#ffffff\" leftmargin=\"0\" marginwidth=\"0\" topmargin=\"0\" marginheight=\"0\">
!     <table width=\"100%\" height=\"90%\">
!     <tr>
!     <td align=\"center\" valign=\"middle\">
!     <table border=\"1\" cellpadding=\"0\"  cellspacing=\"0\" class=\"BusinessCardBackground\">
!     <tr>
!     <td><table width=\"100%\"  border=\"0\"  cellspacing=\"0\" cellpadding=\"2\">
!     <tr>
!     <td width=\"70\">&nbsp;</td>
!     <th class=\"BusinessCardHeader\"><font class=\"BusinessCardHeader\">".$companyName;
!     if($departmentName && $companyName){
!         echo " - ";
!     }
!     echo $departmentName."</font></th>
!     <td width=\"70\">&nbsp;</td>
!     </tr><tr>
!     <td width=\"70\" align=\"center\" valign=\"top\"><table width=\"100%\"".$PersonImageProp.">
!     <tr>
!     <td align=\"center\"><img src=\"".$personImage."\" width=\"60\" height=\"80\" vspace=\"3\" /></td>
!     </tr>
!     </table></td>
!     <td align=\"left\" valign=\"middle\"><table width=\"100%\"  border=\"0\" cellpadding=\"2\"  cellspacing=\"0\">
!     <tr>
!     <td align=\"center\" class=\"BusinessCardText\"><font class=\"BusinessCardText\">".$personFirstName." ".$personLastName."</font></td>
!     </tr>";
!     if($attributeShowTitle){
!         if($personTitleName){
!             echo "<tr>
!             <td align=\"center\" class=\"BusinessCardText\"><font class=\"BusinessCardText\"><i>".$personTitleName."</i></font></td>
!             </tr>
!             ";
!         }
!     }    
!     echo "<tr>
!     <td align=\"center\" class=\"BusinessCardText\"><font class=\"BusinessCardText\">".$personAddress;
!     if($personZip && $personAddress){
!         echo ", ";
!     }
!     echo $personCityName." ".$personState." ".$personZip."</font></td>
!     </tr><tr>
!     <td align=\"center\" class=\"BusinessCardText\"><font class=\"BusinessCardText\">".$personCountry."</font></td>
!     </tr><tr>
!     <td align=\"center\"><img src=\"dots.gif\" width=\"207\" height=\"1\" vspace=\"1\" /></td>
!     </tr>
!     </table></td>
!     <td width=\"70\" align=\"center\" valign=\"top\"><table width=\"100%\"".$logoProp.">
!     <tr>
!     <td align=\"center\" height=\"80\" valign=\"middle\"><img src=\"".$companyLogo."\" width=\"60\" vspace=\"3\" /></td>
!     </tr>
!     </table></td>
!     </tr><tr>
!     <td align=\"center\" valign=\"top\">&nbsp;</td>
!     <td align=\"center\" valign=\"middle\" nowrap=\"nowrap\" class=\"BusinessCardContactWays\">";
!     if($personPhone){
!         echo "<font class=\"BusinessCardContactWays\"><b>"._CIPHONE.":</b>&nbsp;".$personPhone;
!     }
!     if($personFax && $personPhone){
!         echo ",";
!     }
!     if($personFax){
!         echo "&nbsp;<b>"._CIFAX.":</b>&nbsp;".$personFax."</font>";
!     }
!     echo "<br />";
!     if($attributeShowMobile){
!         if($personMobile){
!             echo "<font class=\"BusinessCardContactWays\"><b>"._CIMOBILE.":</b>&nbsp;".$personMobile."";
!         }
!     }
!     if($attributeShowICQ){
!         if($attributeShowMobile && $personMobile){
!             echo ", ";
!         }
!         if($personICQ){
!         echo "<b>"._CIICQ.":</b> ".$personICQ."</font>";
!         }
!         echo "<br />";
!     }elseif($attributeShowMobile){
!         echo "<br />";
!     }
!     if($personMail){
!         echo "<font class=\"BusinessCardContactWays\"><b>"._CIEMAIL.":</b>&nbsp;".$personMail."</font>";
!     }
!     echo "</td>
  
!     <td align=\"center\" valign=\"top\">&nbsp;</td>
!     </tr>
!     </table></td>
!     </tr>
!     </table>";
  
  }
***************
*** 321,324 ****
  </tr>
  </table>
  </body>
! </html>
--- 376,384 ----
  </tr>
  </table>
+ <div align="center">
+ <font class="BusinessCardText">
+ <a href="javascript:window.close();">Close Window</a>
+ </font>
+ </div>
  </body>
! </html>
\ No newline at end of file


Directory filter : [ all ] / postnuke_modules / PostContact / user_functions [ view in CVS ]

View Statistics - Next Notice - Previous Notice


Visit Developer Site - Browse CVS Repository Syndicate via backend.rss
(max. once per hour please)
Powered by CVSNotice 0.1.3