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

📄 template.php

📁 通达OA部分源代码
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php
include_once "myconnect.php";
include_once "session.php";
include_once "styles.php";
include_once "left_panel.php";
include_once "date_time_format.php";
include_once "send_alerts.php";

if(isset($_COOKIE["softbiz_blead_user"]))
{
	$username=$_COOKIE["softbiz_blead_user"];
	$sql="SELECT * FROM sbbleads_members WHERE sb_username = '$username'" ;
	$rs_query=mysql_query($sql);
	if ( $rs=mysql_fetch_array($rs_query)  )
	{
		$_SESSION["sbbleads_username"]=$rs["sb_username"] ;
		$_SESSION["sbbleads_userid"]=$rs["sb_id"] ;
		$_SESSION["sbbleads_memtype"]=$rs["sb_memtype"];
	}
}


//include_once "check_msg_function.php";

///////////////////////////////////////////////////////////////////////////////
///      THE CODE OF THIS SCRIPT HAS BEEN DEVELOPED BY SOFTBIZ SOLUTIONS  /////
///      AND IS MEANT TO BE USED ON THIS SITE ONLY AND IS NOT FOR REUSE,  /////
///      RESALE OR REDISTRIBUTION.                                        ///// 
///      IF YOU NOTICE ANY VIOLATION OF ABOVE PLEASE REPORT AT:           /////
///      admin@softbizscripts.com                                         /////
///      http://www.softbizscripts.com                                    /////
///      http://www.softbizsolutions.com                                  /////  
///////////////////////////////////////////////////////////////////////////////
$config=mysql_fetch_array(mysql_query("select * from sbbleads_config "));
//======================code here is equivalent to chron file code=============================
mysql_query("update sbbleads_members set sb_memtype=".$config["sb_memtype"]." where sb_expiry_date < NOW()");
if(date("Ymd",time())."000000">$config["sb_last_sent"])
{
//echo "working";
send_mail_alerts();////
mysql_query("update sbbleads_config set sb_last_sent=".date("Ymd",time())." where 1"); 
}
//==============================update stats===================================================

	$sql="Update sbbleads_stats set sb_hits_thismonth=sb_hits_thismonth+1,sb_hits=sb_hits+1"  ;
	mysql_query($sql);
	$sql="Select * from sbbleads_stats "  ;
	$rs0_query=mysql_query($sql);
	$rs0=mysql_fetch_array($rs0_query);
    if (!((date("m",time())==$rs0["sb_thismonth"])) )
	{
	$sql="Update sbbleads_stats set sb_hits_lastmonth=sb_hits_thismonth,
	sb_thismonth=".date("m",time()) ;
	mysql_query($sql);
	$sql="Update sb_bleads_stats set sb_hits_thismonth=0" ;
	mysql_query($sql);
	}

//=============================================================================================
// LOAD style number from the config file
$config=mysql_fetch_array(mysql_query("select * from sbbleads_config "));
$icons=mysql_fetch_array(mysql_query("select * from sbbleads_icons where sb_id=".$config["sb_icon_list"]));

$keyword="";
$title_str="";
$site_keywords="";

if(isset($_REQUEST["keyword"])&&($_REQUEST["keyword"]<>""))
{
$keyword=$_REQUEST["keyword"];
$title_str=$keyword." : ";
$site_keywords=$keyword.",";
}

	if(preg_match("/\/selloffers.php/",$_SERVER['PHP_SELF']))
	{
	$title_str.="Sell Offers : ";
	$site_keywords.="Sell Offers,";
	}
	elseif(preg_match("/\/buyoffers.php/",$_SERVER['PHP_SELF']))
	{
	$title_str.="Buy Offers : ";
	$site_keywords.="Buy Offers,";
	}
	elseif(preg_match("/\/products.php/",$_SERVER['PHP_SELF']))
	{
	$title_str.="Products : ";
	$site_keywords.="Products,";
	}
	elseif(preg_match("/\/profiles.php/",$_SERVER['PHP_SELF']))
	{
	$title_str.="Companies : ";
	$site_keywords.="Companies,";
	}


if(isset($_REQUEST["id"])&&($_REQUEST["id"]<>"")&&($_REQUEST["id"]<>0))
{
	$id=$_REQUEST["id"];
	if(preg_match("/\/view_offer.php/",$_SERVER['PHP_SELF']))
	{
	$offer=mysql_fetch_array(mysql_query("select * from sbbleads_offers where sb_id=$id")); 
	$title_str.=$offer["sb_title"]." : ";
	$site_keywords.=$offer["sb_title"].",";
	}
	elseif(preg_match("/\/view_offer_buy.php/",$_SERVER['PHP_SELF']))
	{
	$offer=mysql_fetch_array(mysql_query("select * from sbbleads_offers_buy where sb_id=$id")); 
	$title_str.=$offer["sb_title"]." : ";
	$site_keywords.=$offer["sb_title"].",";
	}
	elseif(preg_match("/\/view_product.php/",$_SERVER['PHP_SELF']))
	{
	$offer=mysql_fetch_array(mysql_query("select * from sbbleads_products where sb_id=$id")); 
	$title_str.=$offer["sb_title"]." : ";
	$site_keywords.=$offer["sb_title"].",";
	}
	elseif(preg_match("/\/view_profile.php/",$_SERVER['PHP_SELF']))
	{
	$offer=mysql_fetch_array(mysql_query("select * from sbbleads_companyprofiles where sb_id=$id")); 
	$title_str.=$offer["sb_companyname"]." : ";
	$site_keywords.=$offer["sb_companyname"].",";
	}
}
if(isset($_REQUEST["cid"])&&($_REQUEST["cid"]<>"")&&($_REQUEST["cid"]<>0))
{
	$cid=$_REQUEST["cid"];
	$catpath="";
	$catpath2="";
  	$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=" . $cid );
	while ($rs=mysql_fetch_array($cat_query))
    {
    $catpath .=$rs["sb_cat_name"]." : "; 
  	$catpath2 .=$rs["sb_cat_name"].",";
	$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=" . $rs["sb_pid"] );
	}
$title_str.=$catpath;
$site_keywords.=$catpath2;
}
$title_str.=$config["sb_site_name"];
$site_keywords.=$config["sb_site_keywords"];

?><html>
<head>
<title><? echo $title_str;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="keywords" content="<?php echo $site_keywords;?>"> 
<script language="JavaScript" type="text/JavaScript">
<!--
function sb_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body bgcolor="<?php echo $softbiz_page_bg; ?>" leftmargin="1" topmargin="1" rightmargin="1">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="25" align="center" valign="middle"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><font size="1"> 
        </font></font><font class='normal'><strong>Color Scheme : </strong> 
        <select name="style_list" onChange="sb_jumpMenu('parent',this,0)" >
          <?
								$rs_query=mysql_query("select * from sbbleads_styles");
								while($rst=mysql_fetch_array($rs_query))
								{ 
								?>
          <option value="<? echo $_SERVER['PHP_SELF'];?>?provided=<? echo $rst["sb_id"];?><? echo $strpass;?>" <? if($provided==$rst["sb_id"])
								{ echo "selected";}
								?>><? echo $rst["sb_title"];?></option>
          <?
                                }
								  ?>
        </select>
        <br>
        </font></div></td>
  </tr>
  <tr align="left"> 
    <td   valign="top" ><div align="center">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td> 
              <!--<img src="admin/sbbleads_icons/<? echo $config["sb_logo"];?>">-->
              <img src="images/logo.gif" width="199" height="87"></td>
            <td align="center"> 
              <?php
	mt_srand( (double)microtime() * 1000000);

	$rs_t_query=mysql_query("select * from sbbleads_ads where approved= 'yes' and credits > displays");
//die($rs_t_query);
	$cnt= mysql_num_rows($rs_t_query);

	$rs_t_query1=mysql_query("select * from sbbleads_affiliate_banner where sbaff_active= 'yes'");
//die($rs_t_query);
	$cnt2 = mysql_num_rows($rs_t_query1);
	if(!is_numeric($cnt))
	$cnt=0;
	if(!is_numeric($cnt2))
	$cnt2=0;
	
	$sbdowhat=0;		//stands for do nothing
	if ( ($cnt == 0) && ($cnt2 > 0) )
	{		//no banner but affiliate exists
		$sbdowhat=1;	/// stands for "affiliate";
	}
	elseif( ($cnt > 0) && ($cnt2 == 0) )
	{		//no affiliate but banner exists
		$sbdowhat=2;		//	stands for "banner";
	}
	elseif( ($cnt > 0) && ($cnt2 > 0) )
	{		//
		$sbrandon=mt_rand(1,2);
		if($sbrandon == 1)
			$sbdowhat=1;
		else
			$sbdowhat=2;
	}
	if($sbdowhat == 1)
	{
		if($cnt2>1)
		$rnum= mt_rand(1,$cnt2);
		else
		$rnum=1;
		for ($i=0;$i<$rnum;$i++)
			$rs_t=mysql_fetch_array($rs_t_query1);
		echo $rs_t["sbaff_text"];
	}
	elseif($sbdowhat == 2)
	{
		if($cnt>1)
		$rnum= mt_rand(1,$cnt);
		else
		$rnum=1;
		for ($i=0;$i<$rnum;$i++)
			$rs_t=mysql_fetch_array($rs_t_query);
		$id=$rs_t["id"];
		$sbtitle=$rs_t["sbtitle"];
		$url=$rs_t["url"];
		$bannerurl=$rs_t["bannerurl"];
		echo "<a href='$url' target=\"_blank\"><img src='$bannerurl' width=468 height=60 border=0 alt=\"$sbtitle\"></a>";
		mysql_query("update sbbleads_ads set displays=displays+1 where id=$id");
	}
			?>
            </td>
          </tr>
        </table>
        
      </div></td>
  </tr>
  <tr> 
    <td width="100%" height="100%" align="center"   valign="top" > <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <form action="index.php" method="get">
        </form>
        <tr> 
          <td height="25" align="center" valign="bottom"> <table width="95%" height="100%" border="0" cellpadding="0" cellspacing="0">
              <tr align="center"> 
                <td height="25"  class="<?php 
				if(!preg_match("/\/index.php/",$_SERVER['SCRIPT_NAME']))
				{ echo "inactivetab";} 
				else
				{ echo "activetab"; }
				?>
				"> 
                  <?php 
				  
				if(!preg_match("/\/index.php/",$_SERVER['SCRIPT_NAME']))
				{
				?>
                  <a href="index.php" >Home</a> 
                  <?php
				} 
				else
				{
				echo "HOME";
				}
				?>
                </td>
                <td width="7"  >&nbsp;</td>
                <td height="25"  class="<?php 
				if(!preg_match("/\/selloffers.php/",$_SERVER['SCRIPT_NAME']))
				{ echo "inactivetab";} 
				else
				{ echo "activetab"; }
				?>
				"> 
                  <?php 
				if(!preg_match("/\/selloffers.php/",$_SERVER['SCRIPT_NAME']))
				{
				?>
                  <a href="selloffers.php" >Sell Offers</a> 
                  <?php
				} 
				else

⌨️ 快捷键说明

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