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

📄 edit_product_focus.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' and sb_id<>".$_POST["id"]));
			if($rst)
			{
				$errmsg[$errcnt]="Product Focus is already exists in the list.";
				$errcnt++;
			}
		}

if($errcnt==0)
{

    mysql_query("update sbbleads_productfocus set sb_productfocus='$sb_productfocus' 
	where sb_id=".$_POST["id"]);
	if(mysql_affected_rows()>0)
	{
	header("Location: "."manage_productfocus.php?msg=".urlencode("Product Focus has been updated."));
	die();
	}
	else
	{
	header("Location: "."edit_product_focus.php?id=".$_POST["id"]."&msg=".urlencode("Some error occurred. Please try again."));
	die();
	}
}
}
/////////////////////

function main()
{
global $errcnt,$errmsg;
$id=$_REQUEST["id"];
$cur=mysql_fetch_array(mysql_query("select * from sbbleads_productfocus where sb_id=$id"));

$sb_productfocus=$cur["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 valign="top"> <div align="center"> 
        <table width="100%" border="0" cellspacing="10" cellpadding="2">
          <form action="<?php 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;Edit 
                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> 
                  <input name="id" type="hidden" id="id" value="<? echo $id;?>">
                  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="Update"></td>
            </tr>
          </form>
        </table>
      </div></td>
  </tr>
  <tr> 
    <td 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 + -