📄 cart_items.php
字号:
<?
include_once "logincheck.php";
include_once "myconnect.php";
function main()
{
$total=0;
if(isset($_SESSION["offer_count"]))
{
$buy_cnt=0;
$sell_cnt=0;
$catalog_cnt=0;
for($i=1;$i<=$_SESSION["offer_count"];$i++)
{
if(isset($_SESSION["buy_offer_".$i]))
{
$buy_cnt++;
}
if(isset($_SESSION["sell_offer_".$i]))
{
$sell_cnt++;
}
if(isset($_SESSION["catalog_offer_".$i]))
{
$catalog_cnt++;
}
}
$total=$buy_cnt+$sell_cnt+$catalog_cnt;
}
if($total>0)
{
//echo $_SESSION["offer_count"];
?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"> <div align="center">
<table width="90%" border="0" cellpadding="0" cellspacing="0" class="onepxtable">
<tr>
<td class="titlestyle"> Inquiry Basket</td>
</tr>
<tr>
<td height="25"> </td>
</tr>
<tr>
<td height="25" valign="top"> <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" >
<tr class="subtitle">
<td width="25%"> Buy Offer</td>
<td width="60%"><strong><font class="normal"> Description</font></strong></td>
<td><font class="normal"><strong> Option</strong></font></td>
</tr>
<?
$total=0;
$cnt=0;
for($i=1;$i<=$_SESSION["offer_count"];$i++)
{
if(isset($_SESSION["buy_offer_".$i]))
{
$cnt++;
$buy_offer=mysql_fetch_array(mysql_query("select * from sbbleads_offers_buy where sb_id=".$_SESSION["buy_offer_".$i]));
?>
<tr >
<td><a href="view_offer_buy.php?id=<?php echo $buy_offer["sb_id"];?>">
<?php
if (strlen ($buy_offer["sb_title"])>50)
{
echo substr($buy_offer["sb_title"], 0, strrpos( substr($buy_offer["sb_title"], 0, 50),' ' ));
}
else
{
echo $buy_offer["sb_title"];
}
?>
</a></td>
<td><font class="normal">
<?php
if (strlen (strip_tags($buy_offer["sb_description"]))>100)
{
echo substr(strip_tags($buy_offer["sb_description"]), 0, strrpos( substr(strip_tags($buy_offer["sb_description"]), 0, 100),' ' )) . "..";
}
else
{
echo strip_tags($buy_offer["sb_description"]);
}
?>
</font></td>
<td><a href="remove_from_cart.php?id=<? echo $i;?>">Remove</a></td>
</tr>
<?
}// end if
}// end loop
?>
</table></td>
</tr>
<tr>
<td height="25"> </td>
</tr>
<tr>
<td height="25" valign="top"> <table width="100%" align="center" cellpadding="2" cellspacing="1" >
<tr class="subtitle">
<td width="25%">Sell Offer</td>
<td width="60%"><strong><font class="normal">Description</font></strong></td>
<td><font class="normal"><strong>Option</strong></font></td>
</tr>
<?
$cnt=0;
for($i=1;$i<=$_SESSION["offer_count"];$i++)
{
if(isset($_SESSION["sell_offer_".$i]))
{
$cnt++;
$sell_offer=mysql_fetch_array(mysql_query("select * from sbbleads_offers where sb_id=".$_SESSION["sell_offer_".$i]));
?>
<tr>
<td ><a href="view_offer.php?id=<?php echo $sell_offer["sb_id"];?>">
<?php
if (strlen ($sell_offer["sb_title"])>50)
{
echo substr($sell_offer["sb_title"], 0, strrpos( substr($sell_offer["sb_title"], 0, 50),' ' ));
}
else
{
echo $sell_offer["sb_title"];
}
?>
</a></td>
<td ><font class="normal">
<?php
if (strlen (strip_tags($sell_offer["sb_description"]))>100)
{
echo substr(strip_tags($sell_offer["sb_description"]), 0, strrpos( substr(strip_tags($sell_offer["sb_description"]), 0, 100),' ' )) . "..";
}
else
{
echo strip_tags($sell_offer["sb_description"]);
}
?>
</font></td>
<td ><a href="remove_from_cart.php?id=<? echo $i;?>">Remove</a></td>
</tr>
<?
}// end if
}// end loop
?>
</table></td>
</tr>
<tr>
<td height="25"> </td>
</tr>
<tr>
<td height="25" valign="top"> <table width="100%" align="center" cellpadding="2" cellspacing="1" >
<tr class="subtitle">
<td width="25%">Catalog Item</td>
<td width="60%"><strong><font class="normal">Description</font></strong></td>
<td><font class="normal"><strong>Option</strong></font></td>
</tr>
<?
$cnt=0;
for($i=1;$i<=$_SESSION["offer_count"];$i++)
{
if(isset($_SESSION["catalog_offer_".$i]))
{
$cnt++;
$catalog=mysql_fetch_array(mysql_query("select * from sbbleads_products where sb_id=".$_SESSION["catalog_offer_".$i]));
?>
<tr >
<td><a href="view_product.php?id=<?php echo $catalog["sb_id"];?>">
<?php
if (strlen ($catalog["sb_title"])>50)
{
echo substr($catalog["sb_title"], 0, strrpos( substr($catalog["sb_title"], 0, 50),' ' ));
}
else
{
echo $catalog["sb_title"];
}
?>
</a></td>
<td><font class="normal">
<?php
if (strlen (strip_tags($catalog["sb_description"]))>100)
{
echo substr(strip_tags($catalog["sb_description"]), 0, strrpos( substr(strip_tags($catalog["sb_description"]), 0, 100),' ' )) . "..";
}
else
{
echo strip_tags($catalog["sb_description"]);
}
?>
</font></td>
<td><a href="remove_from_cart.php?id=<? echo $i;?>">Remove</a></td>
</tr>
<?
}// end if
}// end loop
?>
</table></td>
</tr>
<tr>
<td height="25"> </td>
</tr>
<tr>
<td height="25"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="right"> <form action="inquire_all.php" method="get" >
<input type="submit" name="Button" value="Inquire All" >
</form></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
</table>
<br>
<?
}
else
{?>
<table width="90%" border="0" align="center" cellpadding="5" cellspacing="0" class="msgstyle">
<tr align="left">
<td colspan="2"><strong>Your Inquiry Basket is empty.</strong></td>
</tr>
<tr>
<td width="2%" align="center"> </td>
<td width="100%" align="left"> Click <a href="cat_sell.php">here</a> to view
sell offers. </td>
</tr>
<tr>
<td align="center"> </td>
<td align="left">Click <a href="cat_buy.php">here</a> to view buy offers.
</td>
</tr>
<tr>
<td align="center"> </td>
<td align="left">Click <a href="cat_products.php">here</a> to view product
catalogs offers. </td>
</tr>
</table>
<?
}
}// end main
include_once "template.php";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -