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

📄 index.php

📁 通达OA部分源代码
💻 PHP
📖 第 1 页 / 共 3 页
字号:
                  <?php }	//end if
						else
						{
						?>
                      <a href="view_offer.php?id=<?php echo $sbrow_off["sb_id"]; ?>"><img src="images/nopic.gif" <? echo $img_pmt; ?> border="0" title="<?php echo $sbrow_off["sb_title"]; ?>"></a> 
                <?php 	}		//end else
				  ?>
                    </div></td>
                </tr>
                <tr valign="top"> 
                  <td align="center"><a href="view_offer.php?id=<?php echo $sbrow_off["sb_id"]; ?>"> 
                    <?php 
						 echo $sbrow_off["sb_title"];  
					 ?>
                    </a></td>
                </tr>
              </table></td>
            <?php	
						$sb_td_count++;
						if($sb_td_count%$sb_no_of_columns_sell == 0)
						{?>
				  </tr>
				  <?php }	?>
          <?php	
		  				$i++;			//one add displayed		
		  				break;		//after showing the add
		  			}	//end if sbcounter == number[j]
				}	//for loop j
			}	//end while 
				//////-------padding empty tds
		//	echo "td count $sb_td_count, sb_no_of_columns $sb_no_of_columns  ";
			$sb_remainder=$sb_td_count%$sb_no_of_columns_sell;
			$sb_no_of_pads=($sb_remainder!=0)?$sb_no_of_columns_sell-$sb_remainder:0;
			for($sb_new_counter=1;$sb_new_counter<=$sb_no_of_pads;$sb_new_counter++)
			{
			  ?>
          <td width="<?php echo round(100/$sb_no_of_columns_sell);?>%" height="100%"> 
            <table width="100%" height="100%" border="0" cellpadding="5" cellspacing="0">
              <tr> 
                <td class="innertablestyle"> <font class="red"><strong>Default 
                  Ad </strong></font></td>
              </tr>
              <tr> 
                <td class="innertablestyle"> <font class="smalltext"> Become a 
                  Gold member and your Offer will appear here. </font></td>
              </tr>
            </table></td>
          <?php 
			}		//end for padding?>
        </table>
        <?php
		}	//end else generate random
	}	//end if ($sbrow_count > 0)  && ($sb_feature_count > 0) 
?>
      </div></td>
  </tr>
  <tr> 
    <td valign="top"> <div align="center"> 
        <?
	////////------getting gold members
	mt_srand((double)microtime()*1000000);
	$sbq1_mem="select * from sbbleads_members where sb_memtype=1";
	$sbrs1_mem=mysql_query($sbq1_mem);
	$sbgold_list="0";
	while($sbrow1_mem=mysql_fetch_array($sbrs1_mem))
	{
		$sbgold_list.=",".$sbrow1_mem["sb_id"];
	}
	  
	$sbq_off="select *,UNIX_TIMESTAMP(sb_postedon) as sbposted from sbbleads_products where sb_approved='yes' and sb_uid in ($sbgold_list)  order by sb_id desc";	
//	echo($sbq_off);
	$sbrs_off=mysql_query($sbq_off); 
	$sbrow_count=mysql_num_rows($sbrs_off);
	if( ($sbrow_count > 0) && ($sb_feature_count > 0) )
	{
		if( ($sbrow_count <= $sb_feature_count) )
		{	///////------no need of random coz records are not enough
		?>
        <table width="90%" border="0" cellspacing="1" cellpadding="0" class="seperatorstyle">
          <tr> 
            <td colspan="<?php echo $sb_no_of_columns; ?>" class="titlestyle"><strong>&nbsp;Featured 
              Product Catalogs</strong></td>
          </tr>
          <?php
		  	$sb_td_count=0;
	  		while( $sbrow_off=mysql_fetch_array($sbrs_off) )
			{ 
				if($sb_td_count%$sb_no_of_columns == 0)
				{?>
          <tr> 
            <?php }
			?>
            <td width="<?php echo round(100/$sb_no_of_columns);?>%" height="100%"> 
              <table width="100%" height="100%" border="0" cellpadding="5" cellspacing="0" class="innertablestyle">
                <tr valign="top" > 
                  <td width="60"> 
                    <?php 
		$sbq_img_off="select * from sbbleads_product_images where sb_offer_id=".$sbrow_off["sb_id"];
		$sbrow_img_off=mysql_fetch_array(mysql_query($sbq_img_off));
		if($sbrow_img_off)
		{?>
                    <div align="center"><a href="view_product.php?id=<?php echo $sbrow_off["sb_id"]; ?>"><img src="<? echo $img_path; ?><?php echo $sbrow_img_off["sb_img_url"]; ?>" <? echo $img_pmt; ?> border="0" title="<?php echo $sbrow_off["sb_title"]; ?>"></a> 
                      <?php }	//end if
		else
		{
		?>
                      <a href="view_product.php?id=<?php echo $sbrow_off["sb_id"]; ?>"><img src="images/nopic.gif" <? echo $img_pmt; ?> border="0" title="<?php echo $sbrow_off["sb_title"]; ?>"></a> 
                      <?php 	}		//end else
				  ?>
                    </div></td>
                  <td width="100%"><font class="red"><strong>[ 
                    <?php  
		$mem=mysql_fetch_array(mysql_query("select * from sbbleads_members where sb_id=".$sbrow_off["sb_uid"]));
		$profile=mysql_fetch_array(mysql_query("select * from sbbleads_companyprofiles where sb_uid=".$sbrow_off["sb_uid"]));
		if ($profile) 
		   	echo $profile["sb_companyname"]; 
		  else   
		  	echo $mem["sb_username"]; ?>
                    ]</strong></font><br> <font class="smalltext"> 
                    <?php
if (strlen (strip_tags($sbrow_off["sb_description"]))>50)
{
 echo substr(strip_tags($sbrow_off["sb_description"]), 0,  strrpos( substr(strip_tags($sbrow_off["sb_description"]), 0, 50),' ' )) . "...";  
}
else
{
 echo strip_tags($sbrow_off["sb_description"]);  
}
?></font></td>
                </tr>
                <tr valign="top"> 
                  <td colspan="2"><a href="view_product.php?id=<?php echo $sbrow_off["sb_id"]; ?>"> 
                    <?php 				if (strlen ($sbrow_off["sb_title"])>25)
					{
					 echo substr($sbrow_off["sb_title"], 0,  strrpos( substr($sbrow_off["sb_title"], 0, 25),' ' ));  
					}
					else
					{
					 echo $sbrow_off["sb_title"];  
					}
		//echo $sbrow_off['sb_title']; ?>
                    </a></td>
                </tr>
              </table></td>
            <?php	
				$sb_td_count++;
				if($sb_td_count%$sb_no_of_columns == 0)
				{?>
          </tr>
          <?php }
			?>
          <?php
			}	//end while 
	//////-------padding empty tds
			$sb_remainder=$sb_td_count%$sb_no_of_columns;
			if($sb_remainder==0)
			{
			$sb_no_of_pads=0;
			}
			else
			{
			$sb_no_of_pads=$sb_no_of_columns-$sb_remainder;
			}
			
			for($sb_new_counter=1;$sb_new_counter<=$sb_no_of_pads;$sb_new_counter++)
			{
			  ?>
          <td width="<?php echo round(100/$sb_no_of_columns);?>%" height="100%"> 
            <table width="100%" height="100%" border="0" cellpadding="5" cellspacing="0">
              <tr> 
                <td class="innertablestyle"> <font class="red"><strong>Default 
                  Ad </strong></font></td>
              </tr>
              <tr> 
                <td class="innertablestyle"> <font class="smalltext"> Become a 
                  Gold member and your Product will appear here. </font></td>
              </tr>
            </table></td>
          <?php 
			}		//end for padding?>
        </table>
        <?php 
		}	//end if  no need of random
		else
		{	// generate random
/////////////////////////////-------------------------------		
					unset($number);
					$number[0]=-1;
					for($i=0;$i<$sb_feature_count;$i++)
					{
						$unique=0;
						while($unique==0)
						{
							$j=mt_rand(1,$sbrow_count);
							for($k=0;$k<count($number);$k++)
							{
							//	echo $j;
								if($number[$k]==$j)
								break;
							}
							if($k>(count($number)-1))
							{
								$unique=1;
							}
						}
						$number[$i]=$j;
					}
					
					//echo "$sbtotal_in_rs hi";
			/*		for($k=0;$k<count($number);$k++)
					{
						echo $number[$k]." ";
					}
			//		die();
		*/
//////////////////////////---------------------------------
		?>
        <table width="90%" border="0" cellspacing="1" cellpadding="0" class="seperatorstyle">
          <tr> 
            <td colspan="<?php echo $sb_no_of_columns; ?>" class="titlestyle"><strong>&nbsp;Featured 
              Product Catalogs</strong></td>
          </tr>
          <?php
		  	$sbcounter=0;
			$i=0;
			$sb_td_count=0;		
	  		while( ($i<$sb_feature_count) ) //&& ($sbcounter >= 0) )
			{ 
//				echo "I is $i,    ";
				if( $sbrow_off=mysql_fetch_array($sbrs_off) )
					$sbcounter++;
	//			else
	//				$sbcounter=-1;
				for($j=0;$j<count($number);$j++)
				{
					if( ($sbcounter == $number[$j]) )
					{
						 if($sb_td_count%$sb_no_of_columns == 0)
						{?>
          <tr > 
            <?php }
					?>
            <td width="<?php echo round(100/$sb_no_of_columns);?>%" height="100%" valign="top"> 
              <table width="100%" height="100%" border="0" cellpadding="5" cellspacing="0" class="innertablestyle">
                <tr valign="top" > 
                  <td width="60"> 
                    <?php 
		$sbq_img_off="select * from sbbleads_product_images where sb_offer_id=".$sbrow_off["sb_id"];
		$sbrow_img_off=mysql_fetch_array(mysql_query($sbq_img_off));
		if($sbrow_img_off)
		{?>
                    <div align="center"><a href="view_product.php?id=<?php echo $sbrow_off["sb_id"]; ?>"><img src="<? echo $img_path; ?><?php echo $sbrow_img_off["sb_img_url"]; ?>" <? echo $img_pmt; ?> border="0" title="<?php echo $sbrow_off["sb_title"]; ?>"></a> 
                      <?php }	//end if
		else
		{
		?>
                      <a href="view_product.php?id=<?php echo $sbrow_off["sb_id"]; ?>"><img src="images/nopic.gif" <? echo $img_pmt; ?> border="0" title="<?php echo $sbrow_off["sb_title"]; ?>"></a> 
                      <?php 	}		//end else
				  ?>
                    </div></td>
                  <td width="100%"><font class="red"><strong>[ 
                    <?php  
		$mem=mysql_fetch_array(mysql_query("select * from sbbleads_members where sb_id=".$sbrow_off["sb_uid"]));
		$profile=mysql_fetch_array(mysql_query("select * from sbbleads_companyprofiles where sb_uid=".$sbrow_off["sb_uid"]));
		if ($profile) 
		   	echo $profile["sb_companyname"]; 
		  else   
		  	echo $mem["sb_username"]; ?>
                    ]</strong></font><br> <font class="smalltext"> 
                    <?php
if (strlen (strip_tags($sbrow_off["sb_description"]))>50)
{
 echo substr(strip_tags($sbrow_off["sb_description"]), 0,  strrpos( substr(strip_tags($sbrow_off["sb_description"]), 0, 50),' ' )) . "...";  
}
else
{
 echo strip_tags($sbrow_off["sb_description"]);  
}
?>
                    </font></td>
                </tr>
                <tr valign="top"> 
                  <td colspan="2"><a href="view_product.php?id=<?php echo $sbrow_off["sb_id"]; ?>"> 
                    <?php 				if (strlen ($sbrow_off["sb_title"])>25)
					{
					 echo substr($sbrow_off["sb_title"], 0,  strrpos( substr($sbrow_off["sb_title"], 0, 25),' ' ));  
					}
					else
					{
					 echo $sbrow_off["sb_title"];  
					}
		//echo $sbrow_off['sb_title']; ?>
                    </a></td>
                </tr>
              </table></td>
            <?php	
				$sb_td_count++;
				if($sb_td_count%$sb_no_of_columns == 0)
				{?>
          </tr>
          <?php }
			?>
          <?php	
		  				$i++;			//one add displayed		
		  				break;		//after showing the add
		  			}	//end if sbcounter == number[j]
				}	//for loop j
			}	//end while 
				//////-------padding empty tds
		//	echo "td count $sb_td_count, sb_no_of_columns $sb_no_of_columns  ";
			$sb_remainder=$sb_td_count%$sb_no_of_columns;
			$sb_no_of_pads=($sb_remainder!=0)?$sb_no_of_columns-$sb_remainder:0;
			for($sb_new_counter=1;$sb_new_counter<=$sb_no_of_pads;$sb_new_counter++)
			{
			  ?>
          <td width="<?php echo round(100/$sb_no_of_columns);?>%" height="100%"> 
            <table width="100%" height="100%" border="0" cellpadding="5" cellspacing="0">

⌨️ 快捷键说明

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