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

📄 manage_productfocus.php

📁 通达OA部分源代码
💻 PHP
字号:
<?
include "logincheck.php";
include "myconnect.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                                  /////  
///////////////////////////////////////////////////////////////////////////////

/////////add new code
if(count($_POST)>0)
{
			if (!get_magic_quotes_gpc()) {
			$sb_productfocus=str_replace('$', '\$',addslashes($_REQUEST["sb_productfocus"]));
			}
			else
			{
			$sb_productfocus=str_replace('$', '\$',$_REQUEST["sb_productfocus"]);
			}
		$errcnt=0;
		if(strlen(trim($_POST["sb_productfocus"]))==0)
		{
			$errmsg[$errcnt]="Please specify Product Focus.";
			$errcnt++;
		}
		else
		{
			$rst=mysql_fetch_array(mysql_query("select * from sbbleads_productfocus where
			sb_productfocus='$sb_productfocus'"));
			if($rst)
			{
				$errmsg[$errcnt]="Product Focus already exists.";
				$errcnt++;
			}
		}


if($errcnt==0)
{
    mysql_query("insert into sbbleads_productfocus (sb_productfocus) values ('$sb_productfocus')");
	if(mysql_affected_rows()>0)
	{
	header("Location: "."manage_productfocus.php?msg=".urlencode("Product Focus has been added."));
	die();
	}
	else
	{
	header("Location: "."manage_productfocus.php?msg=".urlencode("Some error occurred, please try again."));
	die();
	}
}
}
/////////////////////

function main()
{
global $errcnt,$errmsg;
$sb_productfocus="";

//////////////////////////////////
////////////////////////////////
?>
<script language="JavaScript1.1">
function Validator()
{

if ( frm1.sb_productfocus.value=='' )
{
	alert("Please specify Product Focus");
	document.frm1.sb_productfocus.focus();
	return (false);
}
return (true);
}

</script>
<?

if(count($_POST)>0)
{
$sb_productfocus=$_POST["sb_productfocus"];

if($errcnt<>0)
	{
	?>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="errorstyle">
  <tr> 
    <td colspan="2"><strong>&nbsp;Your request cannot be processed due to following 
      reasons</strong></td>
  </tr>
  <tr height="10"> 
    <td colspan="2"></td>
  </tr>
  <?

for ($i=0;$i<$errcnt;$i++)
{
?>
  <tr valign="top"> 
    <td width="6%">&nbsp;<?php echo $i+1;?></td>
    <td width="94%"><?php echo  $errmsg[$i]; ?></td>
  </tr>
  <?
}
?>
</table>
<?
	}
	}		

?>
<table width="90%" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td colspan="2" valign="top"> <div align="center"> 
        <table width="100%" border="0" cellspacing="10" cellpadding="2">
          <form action="<? echo $_SERVER['PHP_SELF'];?>" method="post" name="frm1" id="frm1"  
		  onSubmit="return Validator();" >
            <tr align="left" class="row1"> 
              <td height="25" colspan="3" bgcolor="#004080"><font size="3" face="Arial, Helvetica, sans-serif"><font color="#FFFFFF" size="2"><strong>&nbsp;Add 
                Product Focus</strong></font></font></td>
            </tr>
            <tr class="row1"> 
              <td width="40%" align="right" bgcolor="#F5F5F5"> <div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Product 
                  Focus:</strong></font></div></td>
              <TD align=left valign="top" class="onepxtable"><font color=red 
                        size=2 face="Arial, Helvetica, sans-serif">*</font></TD>
              <td width="60%"> <input name="sb_productfocus" type="text" class="box" id="sb_productfocus" value="<? echo $sb_productfocus;?>"> 
              </td>
            </tr>
            <tr class="row1"> 
              <td width="40%" align="right" bgcolor="#F5F5F5"><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
              <td width="6">&nbsp;</td>
              <td width="60%"> <input name="Submit" type="submit" class="submit" value="Add New"></td>
            </tr>
          </form>
        </table>
      </div></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top"><table width="100%" border="0" cellspacing="10" cellpadding="2">
        <tr> 
          <td height="25" colspan="2" bgcolor="#004080"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif"><strong>&nbsp;Product 
            Focus </strong></font></td>
        </tr>
        <?
					  $loc_query=mysql_query("select * from sbbleads_productfocus order by sb_productfocus");
					  
					  while($loc=mysql_fetch_array($loc_query))
					  {
                      ?>
        <tr> 
          <td width="50%" valign="top"><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;
            <? 
		  echo $loc["sb_productfocus"];?>
            </font></td>
          <td valign="top"><font size="1" face="Arial, Helvetica, sans-serif">&nbsp;[&nbsp;<a href="edit_product_focus.php?id=<? echo $loc["sb_id"];?>" ><font size="1" face="Arial, Helvetica, sans-serif">Edit</font></a>&nbsp;]&nbsp;&nbsp;[&nbsp;<a href="delete_product_focus.php?id=<? echo $loc["sb_id"];?>" onClick="javascript: return confirm('Do you really want to remove the product focus?');">Delete</a>&nbsp;]&nbsp;</font></td>
        </tr>
        <?
					  }
                    ?>
      </table>
		</td>
  </tr>
  <tr> 
    <td colspan="2" align="left" valign="top"> <div align="left"><font size="2" face="Arial, Helvetica, sans-serif"><strong>&nbsp;</strong></font></div></td>
  </tr>
</table><?

}//end main
include "template.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                                  /////  
///////////////////////////////////////////////////////////////////////////////


?>

⌨️ 快捷键说明

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