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

📄 view_profile.php

📁 通达OA部分源代码
💻 PHP
字号:
<?php
include_once "myconnect.php";
include_once "date_time_format.php";


if(!isset($_REQUEST['id']) || !is_numeric($_REQUEST['id']) || ($_REQUEST['id'] == 0) )
{
	header("Location: gen_confirm.php?errmsg=".urlencode("Invalid access, denied"));
	die();
}

$id=$_REQUEST['id'];

$sbq_off="select * from sbbleads_companyprofiles where sb_id=$id and sb_approved='yes'";
//die($sbq_off);
$sbrow_off=mysql_fetch_array(mysql_query($sbq_off));
if(!$sbrow_off)
{
	header("Location: gen_confirm.php?errmsg=".urlencode("No such profile exists or disabled by admin"));
	die();
}
///////////------updating view count
$sbqu_off="update sbbleads_companyprofiles set sb_viewed=sb_viewed+1 where sb_id=$id";
mysql_query($sbqu_off);

//////////---------
function main()
{
	global $sbrow_off;

$id=$_REQUEST['id'];

	
	$config=mysql_fetch_array(mysql_query("select * from sbbleads_config"));
	$sb_null_char=$config["sb_null_char"];
	$icons=mysql_fetch_array(mysql_query("select * from sbbleads_icons where sb_id=".$config["sb_icon_list"]));
	$send_inquiry_icon="admin/sbbleads_icons/".$icons["sb_send_inquiry"];
	$inquiry_basket_icon="admin/sbbleads_icons/".$icons["sb_inquiry_basket"];
	$contact_list_icon="admin/sbbleads_icons/".$icons["sb_contact_list"];
	$block_list_icon="admin/sbbleads_icons/".$icons["sb_block_list"];
	$add_fav_icon="admin/sbbleads_icons/".$icons["sb_add_fav"];
	$company_profile_icon="admin/sbbleads_icons/".$icons["sb_profile"];

$cid=0;
$keyword="";

	if(isset($_REQUEST["cid"])&&($_REQUEST["cid"]<>""))
	{
	$cid=$_REQUEST["cid"];
	}

	if(isset($_REQUEST["keyword"])&&($_REQUEST["keyword"]<>""))
	{
		$keyword=$_REQUEST["keyword"];
	}


	$catname="";
	$category=0;
  
  	$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=" . $cid );
	if ($cat=mysql_fetch_array($cat_query))
	{
	$catname=$cat["sb_cat_name"];
	$category=$cat["sb_id"];
	}

	$catpath="";
  	$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=" . $cid );
	while ($rs=mysql_fetch_array($cat_query))
    {
    $catpath =" > <a href=\"cat_sell.php?cid=" . $rs["sb_id"] . "\">" .$rs["sb_cat_name"]."</a>".$catpath; 
  	$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=" . $rs["sb_pid"] );
	 
	}

 $mem=mysql_fetch_array(mysql_query("select * from sbbleads_members where sb_id=".$sbrow_off["sb_uid"]));


?> 
<script language="JavaScript">
function win(box)
{
str="addcontact_popup.php?"  + box;

window.open(str,"Allot","top=5,left=30,toolbars=no,maximize=yes,resize=yes,width=350,height=150,location=no,directories=no,scrollbars=yes");
return false;
}
function win1(box)
{
str="addblock_popup.php?"  + box;

window.open(str,"Allot","top=5,left=30,toolbars=no,maximize=yes,resize=yes,width=350,height=150,location=no,directories=no,scrollbars=yes");
return false;
}
</script> 
<table width="100%" border="0" cellspacing="10" cellpadding="2" class="maintablestyle">
  <tr> 
    <td valign="top"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="onepxtable">
        <tr> 
          <form name="form1" method="post" action="search.php">
            <td align="center" valign="middle" class="innertablestyle"><br> <input name="keyword" type="text" value="<? echo $keyword;?>" size="40"> 
              &nbsp;&nbsp; <select name="type">
                <option value="1">Sell Offers</option>
                <option value="2">Buy Offers</option>
                <option value="3">Products Catalogs</option>
                <option value="4" selected>Company Profiles</option>
              </select>
              <font class='normal'>
              <input name="show_save" type="hidden" id="show_save" value="yes">
              </font> &nbsp;&nbsp; 
              <input type="submit" name="Submit" value="Search"> 
              &nbsp;<a href="advance_search.php">Advance Search</a> <br> &nbsp; 
            </td>
          </form>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td valign="top"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" >
        <tr> 
          <td> 
            <!--font class="normal">&nbsp;<a href="index.php">Home</a><? echo $catpath;?></font-->
          </td>
        </tr>
        <tr> 
          <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="titlestyle">
              <tr> 
                <td width="150" align="center" valign="middle" >&#8595; &nbsp;Company 
                  Profile </td>
                <td valign="middle"  class="subtitle">&nbsp;<?php echo $sbrow_off["sb_companyname"]; ?> 
                  posted by <strong><font class="normal"> 
                  <?php 
		  echo $mem["sb_username"];
 ?>
                  </font><font class="smalltext"><font class="red"><strong>[ <font class="smalltext"><font class="red"><strong> 
                  <?php  
			$level_query=mysql_query("select * from sbbleads_levels where sb_levelid=" .$mem["sb_memtype"]);
            $level= mysql_fetch_array($level_query);
			echo $level["sb_levelname"];
			?>
                  </strong></font></font>]</strong></font></font></strong> <div align="left"></div>
                  <div align="left"></div>
                  <div align="right" ></div></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td valign="top"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td><div align="center"> 
              <?php
		  if($sbrow_off["sb_logo"]<>"")
		  {
		  ?>
              <img src="uploadedimages/<?php echo $sbrow_off["sb_logo"]; ?>" border="0"> 
              <?php
		  }
		  ?>
            </div></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td valign="top"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" class="onepxtable">
        <tr valign="top"> 
          <td><table width="100%" border="0" cellspacing="1" cellpadding="1">
              <tr valign="top"> 
                <td width="50%" height="100%"> <table width="100%" height="100%" border="0" cellpadding="2" cellspacing="1">
                    <tr valign="top" class="onepxtable"> 
                      <td width="40%" height="25" class="subtitle"> <div align="left">Main 
                          Product Focus</div></td>
                      <td width="60%" height="25" class="innertablestyle"> 
                        <?php 
		  $sbq_pro_fo="select * from sbbleads_productfocus where sb_id=".$sbrow_off["sb_productfocus"];
		  $sbrow_pro_fo=mysql_fetch_array(mysql_query($sbq_pro_fo));
		  echo $sbrow_pro_fo["sb_productfocus"];
		   ?>
                      </td>
                    </tr>
                    <tr valign="top" class="onepxtable"> 
                      <td height="25" class="subtitle"> <div align="left">Bussiness 
                          Type</div></td>
                      <td height="25" class="innertablestyle" ><font class="normal"> 
                        <?php 
		  $sbq_pro_fo="select * from sbbleads_businesstypes where sb_id=".$sbrow_off["sb_businesstype"];
		  $sbrow_pro_fo=mysql_fetch_array(mysql_query($sbq_pro_fo));
		  echo $sbrow_pro_fo["sb_businesstype"];
		?>
                        </font></td>
                    </tr>
                    <tr valign="top" class="onepxtable"> 
                      <td height="25" class="subtitle"> <div align="left">Year 
                          Established</div></td>
                      <td height="25" class="innertablestyle" > <font class="normal"> 
                        <?php 
		  	echo $sbrow_off['sb_yearestablished']; ?>
                        </font></td>
                    </tr>
                  </table></td>
                <td height="100%"> <table width="100%" height="100%" border="0" cellpadding="2" cellspacing="1">
                    <tr valign="top" class="onepxtable"> 
                      <td width="40%" height="25" class="subtitle"> <div align="left">CEO/Owners 
                          Name</div></td>
                      <td width="60%" height="25" class="innertablestyle" ><font class='normal'><?php echo $sbrow_off["sb_ceo"];?></font></td>
                    </tr>
                    <tr valign="top" class="onepxtable"> 
                      <td height="25" class="subtitle"> <div align="left">Number 
                          of Employees</div></td>
                      <td height="25" class="innertablestyle" ><font class="normal"><?php 
					  $emp=mysql_fetch_array(mysql_query("select * from sbbleads_employees where sb_id=".$sbrow_off["sb_employees"]));
					  echo $emp["sb_employees"]; ?></font></td>
                    </tr>
                    <tr valign="top" class="onepxtable"> 
                      <td height="25" class="subtitle"> <div align="left">Website 
                          Address</div></td>
                      <td height="25" class="innertablestyle" ><font class="normal"> 
                        <?php
						$group_set=mysql_fetch_array(mysql_query("select * from sbbleads_groups where sb_memtype=".$mem["sb_memtype"]));
					   if(($sbrow_off["sb_website"]<>"")&&($group_set["sb_posturl"]=='yes'))
					   {echo "<a href='http://".$sbrow_off["sb_website"]."' target='_blank'>".$sbrow_off["sb_website"]."</a>"; }
					   else
					   {echo $config["sb_null_char"];}
					   ?>
                        </font></td>
                    </tr>
                  </table></td>
              </tr>
              <tr valign="top"> 
                <td colspan="2"><table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr valign="top" class="onepxtable"> 
                      <td width="20%" height="25" class="subtitle"> <div align="left">Main 
                          Markets </div></td>
                      <td height="25" class="innertablestyle" ><font class="normal"> 
                        <?php 
		$markets="-1";
		$mkts_q=mysql_query("select * from sbbleads_profile_markets where sb_profile_id=$id");
		while($mkts=mysql_fetch_array($mkts_q))
		{ $markets.=",".$mkts["sb_market"];}				
		$sbq_pro_fo="select * from sbbleads_markets where sb_id in ($markets)";
		$sbrs_pro_fo=mysql_query($sbq_pro_fo);
		while( $sbrow_pro_fo=mysql_fetch_array($sbrs_pro_fo) )
			echo $sbrow_pro_fo["sb_market"].'<br>';
			echo $sbrow_off['sb_othermarkets'];
	?>
                        </font></td>
                    </tr>
                    <tr valign="top" class="onepxtable"> 
                      <td height="25" class="subtitle"> <div align="left">Categories</div></td>
                      <td height="25" class="innertablestyle"> 
                        <?php 
		  	$sbq_cat="select * from sbbleads_profile_cats where sb_profile_id=$id";
			//echo $sbq_cat;
			$sbrs_cat=mysql_query($sbq_cat);
	/*		$sbcat_exists=false;
	*/		while($sbrow_cat=mysql_fetch_array($sbrs_cat))
			{
				$catpath="";
				$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=".$sbrow_cat["sb_cid"] );
/*				if($sbrow_cat["sb_cid"] == $cid)		//working code
//					continue; 		//for skipping the category that is alreday displayed or passed 
*/				while ($rs=mysql_fetch_array($cat_query))
				{
/*					$sbcat_exists=true;		//just checks whether we come in this portion ever 
*/					$catpath =" > <a href=\"cat_profiles.php?cid=" . $rs["sb_id"] . "\">" .$rs["sb_cat_name"]."</a>".$catpath; 
					$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=" . $rs["sb_pid"] );
	 
				}
				echo '<a href="index.php">Home</a>'.$catpath.'<br>'; 
			}
/*			if(!$sbcat_exists)
				echo $config["sb_null_char"];	//prints in case no other category than cid
*/   
		  ?>
                      </td>
                    </tr>
                  </table></td>
              </tr>
              <tr valign="top"> 
                <td colspan="2"><table width="100%" border="0" cellspacing="1" cellpadding="2" class="innertablestyle">
                    <tr valign="bottom"> 
                      <td align="center"><a href="contactuser.php?sb_type=4&sb_id=<?php echo $id; ?>"><img src="<?php echo $send_inquiry_icon;?>" border="0" alt="Send Inquiries" onMouseOver="javascript: window.status='Send inqueries to user'; return true;" onMouseOut="javascript: window.status=''; return true;" ></a></td>
                      <td align="center"> <a href="dummy.htm" onClick="return win('<?php echo "sb_type=1&sb_id=$id&username=".$mem["sb_username"]; ?>');"  ><img src="<?php echo $contact_list_icon;?>" border="0" alt="Add to Contact List" onMouseOver="javascript: window.status='Add to contact list'; return true;" onMouseOut="javascript: window.status=''; return true;" ></a></td>
                      <td align="center"><a href="dummy.htm" onClick="return win1('<?php echo "sb_type=1&sb_id=$id&username=".$mem["sb_username"]; ?>');" onMouseOver="javascript: window.status='Add to block list'; return true;" onMouseOut="javascript: window.status=''; return true;" ><img src="<?php echo $block_list_icon;?>" border="0" alt="Add to Block List"></a></td>
                      <td align="center"> <a href="add_favorites.php?sb_type=4&sb_id=<?php echo $id; ?>"><img src="<?php echo $add_fav_icon;?>" border="0" alt="Add to Favorites" onMouseOver="javascript: window.status='Add to favorites'; return true;" onMouseOut="javascript: window.status=''; return true;" ></a></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td valign="top"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="onepxtable" >
        <tr> 
          <td class="titlestyle">&nbsp;Products/Services</td>
        </tr>
      </table>
      <table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" class="onepxtable">
        <tr> 
          <td height="25" valign="top" class="innertablestyle"><font class="normal"><?php echo $sbrow_off["sb_services"]; ?></font></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td valign="top"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="onepxtable">
        <tr> 
          <td class="titlestyle">&nbsp;Company Profile</td>
        </tr>
      </table>
      <table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" class="onepxtable">
        <tr> 
          <td height="25" valign="top" class="innertablestyle"> <font class="normal"><?php echo $sbrow_off["sb_companyprofile"]; ?></font></td>
        </tr>
      </table></td>
  </tr>
</table>
<?
}// end main
include "template.php";
?>

⌨️ 快捷键说明

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