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

📄 post_product.php

📁 通达OA部分源代码
💻 PHP
📖 第 1 页 / 共 3 页
字号:
		alert('Please specify Quantity as a non-zero positive integer');
		frm.sb_quantity.focus();
		frm.sb_quantity.select();
		return(false);
	}
	
	if(frm.sb_keywords.value=='')
	{
		alert('Please specify Keywords');
		frm.sb_keywords.focus();
		return(false);
	}
	else if(frm.sb_keywords.value.match(/[&<>]+/))
	{
		alert("Please remove special characters from Keywords i.e. & < >");
		frm.sb_keywords.focus();
		frm.sb_keywords.select();
		return(false);
	}
	else 
	{
		var list=frm.sb_keywords.value.split(",");
		if( list.length > <?php echo $sbrow_gro["sb_keyword_cnt"]; ?> )
		{
			alert("You can't specify more than <?php echo ($sbrow_gro["sb_keyword_cnt"]==1)?$sbrow_gro["sb_keyword_cnt"].' keyword':$sbrow_gro["sb_keyword_cnt"].' keywords'; ?>");
			frm.sb_keywords.focus();
			frm.sb_keywords.select();
			return(false);
		}
	}

	if(frm.sb_location.value=='')
	{
		alert('Please specify Location');
		frm.sb_location.focus();
		return(false);
	}
	else if(frm.sb_location.value.match(/[&<>]+/))
	{
		alert("Please remove special characters from Location i.e. & < >");
		frm.sb_location.focus();
		frm.sb_location.select();
		return(false);
	}

	if( isNaN(frm.sb_min_order.value) || frm.sb_min_order.value<=0)
	{
		alert('Please specify Minimum Order as a non-zero positive integer');
		frm.sb_min_order.focus();
		frm.sb_min_order.select();
		return(false);
	}
	else if( parseInt(frm.sb_min_order.value) > parseInt(frm.sb_quantity.value) )
	{
		alert("Minimum Order can't be more than Quantity");
		frm.sb_min_order.focus();
		frm.sb_min_order.select();
		return(false);
	}

	if( frm.sb_price_cur_id.value == 0)
	{
		alert('Please choose currency for Price');
		frm.sb_price_cur_id.focus();
		return(false);
	}
	
	if( isNaN(frm.sb_price.value) || frm.sb_price.value<=0)
	{
		alert('Please specify Price as a non-zero positive number');
		frm.sb_price.focus();
		frm.sb_price.select();
		return(false);
	}
	
	if( isNaN(frm.sb_delivery_time.value) || frm.sb_delivery_time.value < 0 || frm.sb_delivery_time.value=='')
	{
		alert('Please specify Delivery Time as a positive integer');
		frm.sb_delivery_time.focus();
		frm.sb_delivery_time.select();
		return(false);
	}

	if ( frm.sb_cash.checked==false && frm.sb_cheque.checked==false && frm.sb_credit.checked==false && frm.sb_bank.checked==false && frm.sb_loc.checked==false && frm.sb_escrow.checked==false && frm.sb_other_mode.value=='' )
	{
		alert('Please specify atleast one Payment Mode');
		frm.sb_cash.focus();
		return(false);
	}

	if( isNaN(frm.sb_shipping_cost.value) || frm.sb_shipping_cost.value < 0 || frm.sb_shipping_cost.value=='' )
	{
		alert('Please specify Shipping Cost as a positive number');
		frm.sb_shipping_cost.focus();
		frm.sb_shipping_cost.select();
		return(false);
	}
	
	return(true);
}
</script>
<form name="form123" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onSubmit="return validate_form(this);">
  <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="onepxtable">
    <tr> 
      <td class="titlestyle">&nbsp;Post Product Catalog</td>
    </tr>
    <tr> 
      <td><table width="100%" border="0" align="center" cellpadding="2" cellspacing="5" >
          <tr> 
            <td colspan="3" class="innertablestyle"><div align="center"><font class="normal">Product 
                      Catalogs: Posted - <strong><font class="red"><?php echo $sbsell_count; ?></font></strong> 
                      Maximum Allowed - <strong><font class="red"><?php echo $sbrow_gro["sb_product_cnt"]; ?></font></strong><br>
                      </font></div></td>
          </tr>
          <tr valign="top"> 
            <td align="right" class="innertablestyle"><font class="normal"><strong>Categories<br>
              </strong></font><font class="smalltext">(Max <strong><?php echo $sbrow_gro["sb_cat_cnt"]; ?></strong><?php echo ($sbrow_gro["sb_cat_cnt"]>1)?' categories':' category'; ?>)</font></td>
            <td><font class="red">*</font></td>
            <td> <font class="smalltext"> 
              <textarea name="category" cols="37" rows="5" readonly="readonly" id="category"><? echo $sb_cat_list;?></textarea>
              <br>
              <select name="cats" id="select2" >
                <option value="0">Choose a category</option>
                <?
				  $rs_query=mysql_query("select * from sbbleads_categories order by sb_pid");
				  
				  while($rst=mysql_fetch_array($rs_query))
				  {
				  $cat_path="";
		$child=mysql_fetch_array(mysql_query("select * from sbbleads_categories where sb_pid=".$rst["sb_id"]));
									  if($child)
									  {
									  continue;
									  }
									  $cat_path.=$rst["sb_cat_name"];
		 $par=mysql_query("select * from sbbleads_categories where sb_id=".$rst["sb_pid"]);
		 				while($parent=mysql_fetch_array($par))
		 				{
						$cat_path=$parent["sb_cat_name"].">".$cat_path;
						$par=mysql_query("select * from sbbleads_categories where sb_id=".$parent["sb_pid"]);
						}
                                      ?>
                <option value="<? echo $rst["sb_id"];?>" ><? echo $cat_path;?></option>
                <?
									  }
									  ?>
              </select>
              <input name="cid" type="hidden" id="cid" value="<? echo $cid_list;?>">
              <input name="add" type="button" id="add" value="Add" onClick="add_category()">
              <input name="Remove" type="button" id="Remove" value="Remove" onClick="remove_category()">
              </font></td>
          </tr>
          <tr valign="top"> 
            <td align="right" class="innertablestyle"><font class="normal"><strong>Title</strong></font></td>
            <td><font class="red">*</font></td>
            <td><font face="Arial, Helvetica, sans-serif" size="2"> 
              <input name="sb_title" type="text" class=select id="sb_title" value="<?php echo $sb_title; ?>" size="30" maxlength="40">
              </font></td>
          </tr>
          <tr valign="top"> 
            <td align="right" class="innertablestyle"><font class="normal"><strong>Description</strong></font></td>
            <td><font class="red">*</font></td>
            <td valign="middle"> <font class='normal'> 
              <script language="JavaScript" type="text/javascript">
<!--

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

//Usage: writeRichText(fieldname, html, width, height, buttons)
writeRichText('sb_description', '<?=$content?>', 450, 200, true, false);

//uncomment the following to see a demo of multiple RTEs on one page
//document.writeln('<br><br>');
//writeRichText('rte2', 'read-only text', 450, 100, true, false);
//-->
document.write("<br><font class='smalltext'>Description length must not exceed <?php echo $sbrow_con['sb_description_length'];?> characters</font>");
</script>
              </font> <noscript>
              <p><font class="normal"><b>Javascript must be enabled to use this 
                form.</b></font></p>
              </noscript></td>
          </tr>
          <tr valign="top"> 
            <td align="right" class="innertablestyle"><font class="normal"><strong>Quantity</strong></font></td>
            <td><font class="red">*</font></td>
            <td><font face="Arial, Helvetica, sans-serif" size="2"> 
              <input name="sb_quantity" type="text" class=select id="sb_quantity" value="<?php echo  $sb_quantity; ?>" size="30" maxlength="40">
              </font><font face="Arial, Helvetica, sans-serif" size="2">&nbsp; 
              </font></td>
          </tr>
          <tr valign="top"> 
            <td align="right" class="innertablestyle"><font class="normal"><strong>Keywords<br>
              </strong></font><font class="smalltext">(Max <strong><?php echo $sbrow_gro["sb_keyword_cnt"]; ?></strong><?php echo ($sbrow_gro["sb_keyword_cnt"]>1)?' keywords':' keyword'; ?>)</font></td>
            <td><font class="red">*</font></td>
            <td><input name="sb_keywords" type="text" class=select id="sb_keywords" value="<?php echo  $sb_keywords; ?>" size="30" maxlength="40"> 
              <br> <font class="smalltext">Please specify a comma seperated list 
              of keywords related to your product. Appropriate keywords will lead 
              more buyers to find your products.</font></td>
          </tr>
          <tr valign="top"> 
            <td class="innertablestyle"> <div align="right"><strong><font class="normal">Location</font></strong></div></td>
            <td width="6"><font class="red">*</font></td>
            <td><font face="Arial, Helvetica, sans-serif" size="2"> 
              <input name="sb_location" type="text" id="sb_location" value="<?php echo $sb_location;  ?>">
              </font></td>
          </tr>
          <tr valign="top"> 
            <td class="innertablestyle"> <div align="right"><strong><font class="normal">Minimum 
                Order</font></strong></div></td>
            <td><font class="red">*</font></td>
            <td><font face="Arial, Helvetica, sans-serif" size="2"> 
              <input name="sb_min_order" type="text" id="sb_min_order" value="<?php echo $sb_min_order;  ?>" maxlength="20">
              </font></td>
          </tr>
          <tr valign="top"> 
            <td class="innertablestyle"> <div align="right"><strong><font class="normal">Price</font></strong></div></td>
            <td><font class="red">*</font></td>
            <td><font face="Arial, Helvetica, sans-serif" size="2"> 
              <select name="sb_price_cur_id">
                <option value="0">Select Currency</option>
                <?
				$rs_query=mysql_query("Select * from sbbleads_currencies where 1" );
	while ($rs=mysql_fetch_array($rs_query))
	{
				?>
                <option value="<?php echo $rs["sbcur_id"]; ?>"
				<?php
				if ( $rs["sbcur_id"]==$sb_price_cur_id)
				{
				echo "  selected ";
				}
				?>
				
				><?php echo $rs["sbcur_name"]; ?></option>
                <?
			  }
			  ?>
              </select>
              &nbsp;&nbsp; 
              <input name="sb_price" type="text" id="sb_price" value="<?php echo $sb_price;  ?>" size="5" maxlength="30">
              </font></td>
          </tr>
          <tr valign="top"> 
            <td width="40%" class="innertablestyle"> <div align="right"><strong><font class="normal">Samples 
                Available</font></strong></div></td>
            <td><font class="red">*</font></td>
            <td width="60%"><font face="Arial, Helvetica, sans-serif" size="2"> 
              <select name="sb_samples_available" id="sb_samples_available">
                <option value="yes" <?php echo ($sb_samples_available=="yes")?'selected':''; ?>>Yes</option>
                <option value="no" 							<?php
				if ( $sb_samples_available=="no" )
				{
				echo "selected";
				}
				?>>No</option>
              </select>
              </font></td>
          </tr>
          <tr valign="top"> 
            <td width="40%" class="innertablestyle"> <div align="right"><strong><font class="normal">Product 
                Status</font></strong></div></td>
            <td><font class="red">*</font></td>
            <td width="60%"><font face="Arial, Helvetica, sans-serif" size="2"> 
              <select name='sb_product_status' id="sb_product_status">
                <option value="New" 							<?php
				if ( $sb_product_status=="New" )
				{
				echo "selected";
				}
				?>>New</option>
                <option value="Used" 							<?php
				if ( $sb_product_status=="Used" )
				{
				echo "selected";
				}
				?>>Used</option>
              </select>
              </font></td>
          </tr>
          <tr valign="top"> 
            <td width="40%" class="innertablestyle"> <div align="right"><strong><font class="normal">Delivery 
                Time</font></strong></div></td>
            <td><font class="red">*</font></td>
            <td width="60%"><input name="sb_delivery_time" type="text" value="<?php echo $sb_delivery_time;  ?>" size="6"> 
              <font class='normal'>Days </font></td>
          </tr>
          <tr valign="top"> 
            <td width="40%" class="innertablestyle"> <div align="right"><strong><font class="normal">Payments 
                Mode</font></strong></div></td>
            <td><font class="red">*</font></td>
            <td width="60%"><font class="normal"> 
              <input  name="sb_cash" type="checkbox" id="sb_cash" value="yes" 							<?php
				if ( strstr($sb_payment_mode,'cash') )
				{
					echo "  checked ";
				}
				?>>
              Cash <br>
              <input  name="sb_cheque" type="checkbox" id="sb_cheque" value="yes" 							<?php
				if ( strstr($sb_payment_mode,'cheque') )
				{
				echo "  checked ";
				}
				?>>
              Cheque<br>
              <font face="Arial, Helvetica, sans-serif"><font size="2"> 
              <input  name="sb_credit" type="checkbox" id="sb_credit" value="yes" 							<?php
				if ( strstr($sb_payment_mode,'credit') )
				{
				echo "  checked ";
				}
				?>>
              </font></font> Credit card<br>
              <font face="Arial, Helvetica, sans-serif"><font size="2"> 
              <input  name="sb_bank" type="checkbox" id="sb_bank" value="yes" 							<?php
				if ( strstr($sb_payment_mode,'bank') )
				{
				echo "  checked ";
				}
				?>>
              </font></font> Bank transfer<br>
              <font face="Arial, Helvetica, sans-serif"><font size="2"> 
              <input  name="sb_loc" type="checkbox" id="sb_loc" value="yes" 							<?php
				if ( strstr($sb_payment_mode,'loc') )
				{
				echo "  checked ";
				}
				?>>
              </font></font> Letter of Credit<br>
              <font face="Arial, Helvetica, sans-serif"><font size="2"> 
              <input  name="sb_escrow" type="checkbox" id="sb_escrow" value="yes" 							<?php
				if ( strstr($sb_payment_mode,'escrow') )
				{
				echo "  checked ";
				}
				?>>
              </font></font> Escrow <br>
              Other: <font face="Arial, Helvetica, sans-serif" size="2"> 
              <input name="sb_other_mode" type="text" id="sb_other_mode" value="<?php echo $sb_other_mode;  ?>">
              </font> </font> </td>
          </tr>
          <tr valign="top"> 
            <td class="innertablestyle"> <div align="right"><strong><font class="normal">Shipping 
                Cost</font></strong></div></td>
            <td><font class="red">*</font></td>
            <td><font face="Arial, Helvetica, sans-serif" size="2"> 
              <input name="sb_shipping_cost" type="text" id="sb_shipping_cost" value="<?php echo $sb_shipping_cost;  ?>" size="5">
              </font></td>
          </tr>
          <tr valign="top"> 
            <td align="right" class="innertablestyle">&nbsp;</td>
            <td>&nbsp;</td>
            <td><input name="submit"  type="submit" value="Post Now"></td>
          </tr>
        </table></td>
    </tr>
  </table>
  </form>
<?
} //If showform = No? ends here

}
include_once("template1.php");

 ?>

⌨️ 快捷键说明

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