⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 siteemails.php

📁 通达OA部分源代码
💻 PHP
字号:
<?
include_once("myconnect.php");
include "logincheck.php";
function RTESafe($strText) {
	//returns safe code for preloading in the RTE
	$tmpString = trim($strText);
	
	//convert all types of single quotes
	$tmpString = str_replace(chr(145), chr(39), $tmpString);
	$tmpString = str_replace(chr(146), chr(39), $tmpString);
	$tmpString = str_replace("'", "&#39;", $tmpString);
	
	//convert all types of double quotes
	$tmpString = str_replace(chr(147), chr(34), $tmpString);
	$tmpString = str_replace(chr(148), chr(34), $tmpString);
//	$tmpString = str_replace("\"", "\"", $tmpString);
	
	//replace carriage returns & line feeds
	$tmpString = str_replace(chr(10), " ", $tmpString);
	$tmpString = str_replace(chr(13), " ", $tmpString);
	
	return $tmpString;
}
function main()
{
?> 
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="10">
  <tr> 
    <td colspan="2" valign="top"> 
      <?
		
		$errcnt=0;
		$showform="";
		
		$mailid="";
		$fromid="";
		$subject="";
		$mail="";
		
		if ( count($_POST)!=0 )
		{
		$mailid=$_REQUEST["mailid"];
		
		if ($_REQUEST["mailid"]!="" )
		{
		$rs=mysql_query("select * from sbbleads_mails where sb_mailid=" . $_REQUEST["mailid"] );
		$rs=mysql_fetch_array($rs);
		$fromid=$rs["sb_fromid"];
		$subject=$rs["sb_subject"];
		$mail=$rs["sb_mail"];
		}
		
		if (  isset( $_REQUEST["update"])  )
		{
		
		if ( !isset( $_REQUEST["fromid"] ) || $_REQUEST["fromid"]=="" )
		{
			$errs[$errcnt]="From/ Reply address must be provided";
			$errcnt++;
		}
		if ( !isset( $_REQUEST["subject"] ) || $_REQUEST["subject"]=="" )
		{
			$errs[$errcnt]="Email Subject must be provided";
			$errcnt++;
		}
		if ( !isset( $_REQUEST["mail"] ) || $_REQUEST["mail"]=="" )
		{
			$errs[$errcnt]="Email Contents must be provided";
			$errcnt++;
		}
		

		}
		
		}
		if  (count($_POST)<>0)
		{
		if ( $errcnt==0 )
		{
		if (  isset( $_REQUEST["update"])  )
		{
			if (!get_magic_quotes_gpc()) {
			$insert_fromid=str_replace('$', '\$',addslashes($_REQUEST["fromid"]));
			$insert_subject=str_replace('$', '\$',addslashes($_REQUEST["subject"]));
			$insert_mail=str_replace('$', '\$',addslashes($_REQUEST["mail"]));
			}
			else
			{
			$insert_fromid=str_replace('$', '\$',$_REQUEST["fromid"]);
			$insert_subject=str_replace('$', '\$',$_REQUEST["subject"]);
			$insert_mail=str_replace('$', '\$',$_REQUEST["mail"]);
			}
			$html="no";
			if(isset($_REQUEST["html_format"]))
			{
			$html="yes";
			}
		$update_str="update sbbleads_mails set sb_fromid='$insert_fromid', sb_subject='$insert_subject', sb_mail='$insert_mail',sb_status='".$_REQUEST["status"]."',sb_html_format='".$html."' where sb_mailid =" . $_REQUEST["mailid"];
		mysql_query($update_str);
		
		?>
      <div align="center"> <font color="#FF0000" size="2" face="Arial, Helvetica, sans-serif">Mail 
        has been updated</font></div>
      <?
		$showform="No";
		}
		
		}
		else
		{
		?>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td colspan="2"><font color="#FF0000" size="2" face="Arial, Helvetica, sans-serif">Your 
            Update Email Request cannot be processed due to following Reasons</font></td>
        </tr>
        <?

for ($i=0;$i<$errcnt;$i++)
{
?>
        <tr> 
          <td width="6%"><font color="#FF0000"><?php echo $i+1; ?></font></td>
          <td width="94%"><font color="#FF0000" size="2" face="Arial, Helvetica, sans-serif"><?php echo  $errs[$i]; ?> 
            </font></td>
        </tr>
        <?
}//end for
?>
      </table>
      <?

}

}

if (isset($_REQUEST["mailid"])&& ($_REQUEST["mailid"]!="" ))
{
$rs=mysql_query("select * from sbbleads_mails where sb_mailid=" . $_REQUEST["mailid"] );
$rs=mysql_fetch_array($rs);
$fromid=$rs["sb_fromid"];
$subject=$rs["sb_subject"];
$mail=$rs["sb_mail"];
}
 ?>
    </td>
  </tr>
  <tr> 
    <td height="25" colspan="2" bgcolor="#004080"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>&nbsp;Configure 
      Site Emails</strong></font></td>
  </tr>
  <tr> 
    <form name="form2" method="post" action="siteemails.php">
      <td width="40%" align="right" valign="top" bgcolor="#F5F5F5"><strong><font size="2" face="Arial, Helvetica, sans-serif">Choose 
        Email:&nbsp; </font></strong> </td>
      <td valign="top"><font size="1" face="Arial, Helvetica, sans-serif"> 
        <select name="mailid" id="mailid">
          <option  value="">Select a mail message</option>
          <option  value="">--------------------------------</option>
          <option value="22" 
				   <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="22")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
				  >Signup Verification Email</option>
          <option value="1" 
				   <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="1")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
				  >Welcome Email</option>
          <option value="4" 				   <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="4")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Forgot Password Email</option>
          <option value="12" 				   <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="4")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Change Email Confirmation Email</option>
          <option value="2"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="2")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Offer Approval Email</option>
          <option value="3"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="3")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Offer Rejected Email</option>
          <option value="6"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="6")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Offer Posting Email</option>
          <option value="7"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="7")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Offer Posting Email(Admin)</option>
          <option value="24"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="24")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Mail Alert Email</option>
          <option value="23"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="23")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Message Posting Email</option>
          <option value="10"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="10")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Feedback Confirmation Email</option>
          <option value="11"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="11")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Feedback Posted Email(Admin)</option>
<option value="25"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="25")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Upgrade Membership Email</option>
<option value="26"				   
				  <? 
				  if  (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"]=="26")
				  {
				  echo " Selected ";
				  }
				  
				  ?>
>Account Deletion Notification</option>

        </select>
        <input type="submit" name="Submit3" value="Select email message">
        <br>
        Choose an Email to configure.</font></td>
    </form>
  </tr>
  <? if(isset($_REQUEST["mailid"])&& ($_REQUEST["mailid"]!="" ))
	  {?>
	  <script language="JavaScript" type="text/javascript" src="richtext.js"></script>
	<script language="JavaScript">
	function validate(form)
	{
		updateRTEs();
	}	
	</script>
  <form name="form1" method="post" action="siteemails.php" onSubmit="return validate(this)">
    <tr> 
      <td height="25" colspan="2" bgcolor="#004080"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>&nbsp;Custom 
        Shortcuts </strong></font></td>
    </tr>
    <tr> 
      <td colspan="2" valign="top"><font size="2" face="Arial, Helvetica, sans-serif"> 
        <strong><font color="#003366">MEMBER/SIGNUP SPECIFIC:</font></strong><br>
        1. %fname% will display the user's first name.<br>
        2. %lname% will display the user's last name.<br>
        3. %email% will display the user's email id.<br>
        4. %username% will display user's username.<br>
        5. %password% will display the user's password.<br>
        6. %login_url% will display user's login link.<strong><font size="2" face="Arial, Helvetica, sans-serif"><br>
        </font></strong>7<font size="2" face="Arial, Helvetica, sans-serif">. 
        %signup_url% will display user's login link.<br>
        8. %newemail% will display user's new email.<strong><font size="2" face="Arial, Helvetica, sans-serif"><br>
        </font></strong>9<font size="2" face="Arial, Helvetica, sans-serif">. 
        %confirm_url% will display user's confirmation link.</font><br>
        <strong><font color="#003366">OFFER SPECIFIC:</font></strong><br>
        1. %offer_title% will display the offer's title.<br>
        2. %offer_id% will display the offer's ID.<br>
        3. %offer_url% will display the view offer link.<br>
        4. %category% will display category name.<font size="2" face="Arial, Helvetica, sans-serif"><br>
        5. %offer_str% will display newly posted offers/products/profiles in mail 
        alerts.</font><br>
        <strong><font color="#003366">MESSAGE/FEEDBACK SPECIFIC:</font></strong><br>
        1.%message_text% will display message text.<br>
        2.%message_title% will display message title.<br>
        3.%sender_username% will display sender's username.<br>
        4.%message_date% will display date on which message was received.<br>
        <font size="2" face="Arial, Helvetica, sans-serif"><font size="2" face="Arial, Helvetica, sans-serif"><font size="2" face="Arial, Helvetica, sans-serif">5<font size="2" face="Arial, Helvetica, sans-serif"><font size="2" face="Arial, Helvetica, sans-serif"><font size="2" face="Arial, Helvetica, sans-serif"><font size="2" face="Arial, Helvetica, sans-serif"><font size="2" face="Arial, Helvetica, sans-serif">.%visitor_name% 
        will display visitor's name who posted comments/feedbacks.</font></font></font></font></font></font></font></font></font><br>
        <font size="2" face="Arial, Helvetica, sans-serif"><strong><font color="#003366">MEMBERSHIP 
        UPGRADE SPECIFIC:</font></strong><br>
        1.%upgrade_level% will display the level to be upgraded to.<br>
        2.%current_level% will display the current membership level.<br>
        3.%upgrade_fee% will display the upgradation fee.</font> </font></td>
    </tr>
    <tr> 
      <td height="25" colspan="2" bgcolor="#004080"><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>&nbsp; 
        Edit Mail Template</strong></font></strong></td>
    </tr>
    <tr> 
      <td width="40%" align="right" valign="top" bgcolor="F5F5F5"><strong><font size="2" face="Arial, Helvetica, sans-serif">From 
        / Reply address: 
        <input name="update" type="hidden" id="update" value="Yes">
        <input name="mailid" type="hidden" id="mailid" value="<?php echo $mailid; ?>">
        </font></strong></td>
      <td><font size="1" face="Arial, Helvetica, sans-serif"> 
        <input name="fromid" type="text" id="fromid" value="<?php echo $fromid; ?>" size="30">
        <br>
        The above Email Address will be sent as Sender's Email.</font></td>
    </tr>
    <tr> 
      <td width="40%" align="right" valign="top" bgcolor="F5F5F5"><strong><font size="2" face="Arial, Helvetica, sans-serif">Subject:</font></strong></td>
      <td><font size="1" face="Arial, Helvetica, sans-serif"> 
        <input name="subject" type="text" id="subject" value="<?php echo $subject; ?>" size="30">
        <br>
        The above text will act as a custom subject for the Email</font></td>
    </tr>
    <tr> 
      <td width="40%" align="right" valign="top" bgcolor="F5F5F5"><strong><font size="2" face="Arial, Helvetica, sans-serif">Email 
        Message:</font></strong></td>
      <td><font class="normal"> 
        <!--textarea name="mail" cols="40" rows="10" id="mail"><?php echo $mail; ?></textarea-->
         
              <script language="JavaScript" type="text/javascript">
//<!--

<?
$content = $mail;
$content = RTESafe($content);
?>//Usage: initRTE(imagesPath, includesPath, cssFile)
initRTE("../images/", "", "");

//Usage: writeRichText(fieldname, html, width, height, buttons)
writeRichText('mail', '<?=$content?>', 450, 200, true, false);
//-->
</script>
              <noscript>
              <b>Javascript must be enabled to use this 
                form.</b></noscript><br>
        The above text will be sent as automated mail upon certain actions eg. 
        Welcome message when a new user Signs up.</font></td>
    </tr>
    <tr> 
      <td bgcolor="#F5F5F5"><div align="right"><strong><font size="2" face="Arial, Helvetica, sans-serif">Send 
          this Mail:</font></strong></div></td>
      <td><font size="2" face="Arial, Helvetica, sans-serif"> 
        <input name="status" type="radio" value="yes" <?php if($rs["sb_status"]=="yes") {echo "checked";}?>>
        Yes 
        <input type="radio" name="status" value="no" <?php if($rs["sb_status"]=="no") {echo "checked";}?>>
        No</font></td>
    </tr>
    <tr> 
      <td bgcolor="#F5F5F5">&nbsp;</td>
      <td><font size="2" face="Arial, Helvetica, sans-serif"> 
        <input name="html_format" type="checkbox" id="html_format" value="yes" <?php if($rs["sb_html_format"]=="yes") {echo "checked";}?>>
        Send as HTML </font></td>
    </tr>
    <tr> 
      <td width="45%" bgcolor="#F5F5F5">&nbsp;</td>
      <td> <input type="submit" name="Submit22" value="Save message"> </td>
    </tr>
  </form>
  <?
}

?>
</table>
<?
}// end of main()
include "template.php";
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -