📄 edit_profile.php
字号:
}
else */
{
?>
<script language="JavaScript" type="text/javascript" src="richtext.js"></script>
<script language="JavaScript">
<!--
function add_category()
{
if(document.form123.cats.value!=0)
{
var id=document.form123.cats.selectedIndex;
if(document.form123.category.value=="")
{
document.form123.cid.value=document.form123.cats.value;
document.form123.category.value=document.form123.cats.options[id].text;
document.form123.category.focus();
document.form123.cats.selectedIndex=0;
}
else
{
document.form123.cid.value=document.form123.cid.value+";"+document.form123.cats.value;
document.form123.category.value=document.form123.category.value+";"+document.form123.cats.options[id].text;
document.form123.category.focus();
document.form123.cats.selectedIndex=0;
}
}
else
{
alert('Choose a Category to add!');
}
}
function remove_category()
{
var s1=window.document.form123.category.value;
var s2=s1.split(";");
var i=0;
var id=document.form123.cats.selectedIndex;
var s3=document.form123.cats.options[id].text;
var id_list=document.form123.cid.value;
var id_split=id_list.split(";");
var rem_id=document.form123.cats.value;
window.document.form123.category.value="";
window.document.form123.cid.value="";
while(i<s2.length)
{
//alert('Checking '+s2[i]+' nnn with'+s3+' mm');
if(s3==s2[i])
{
//continue;
// alert('Removing'+s3);
}
else
{
if(document.form123.category.value=="")
{
document.form123.category.value=s2[i];
}
else
{
document.form123.category.value=document.form123.category.value+";"+s2[i];
}
}
if(rem_id==id_split[i])
{
//continue;
// alert('Removing'+s3);
}
else
{
if(document.form123.cid.value=="")
{
document.form123.cid.value=id_split[i];
}
else
{
document.form123.cid.value=document.form123.cid.value+";"+id_split[i];
}
}
i++;
}
//window.document.form123.related.value="";
//window.document.form123.rel_id.value="";
}
function attachment(box)
{
str="fileupload.php?box=" + box;
window.open(str,"Attachment","top=5,left=30,toolbars=no,maximize=yes,resize=yes,width=380,height=450,location=no,directories=no,scrollbars=yes");
}
function category(box)
{
str="choosecategory.php?box=" + box;
window.open(str,"Category","top=5,left=30,toolbars=no,maximize=yes,resize=yes,width=550,height=450,location=no,directories=no,scrollbars=yes");
}
function removeattachment(box)
{
window.document.form123.list1.value=""
}
function validate(form)
{
updateRTEs();
if ( form.companyname.value == "" ) {
alert('Please Specify Companyname!');
form.companyname.focus();
return false;
}
if(form.companyname.value.match(/[&<>]+/))
{
alert("Please remove Invalid characters from Companyname (e.g. & < >)");
form.companyname.focus();
return(false);
}
if ( form.businesstype.value == "" ) {
alert('Please Choose a Business Type!');
form.businesstype.focus();
return false;
}
if ( form.services.value == "" ) {
alert('Please Specify Products/Services!');
return false;
}
var checked='no';
var count=form.cnt.value;
var i=1;
for(i=1;i<form.elements.length;i++)
{
if(form.elements[i].checked==true)
{
checked='yes';
}
}
if((checked=='no')&&(form.othermarkets.value==""))
{
alert(' Please choose atleast one market.')
form.othermarkets.focus();
return false;
}
if ( form.productfocus.value == "" ) {
alert('Please Choose Main Product Focus!');
form.productfocus.focus();
return false;
}
if ( form.employees.value == "" ) {
alert('Please Choose Number of Employees!');
form.employees.focus();
return false;
}
if ( form.companyprofile.value == "" ) {
alert('Please Specify Company Profile!');
return false;
}
if ( form.ceo.value == "" ) {
alert("Please Specify CEO/Owner's Name!");
form.ceo.focus();
return false;
}
if(form.ceo.value.match(/[&<>]+/))
{
alert("Please remove Invalid characters from CEO/Owner's Name (e.g. & < >)");
form.ceo.focus();
return(false);
}
return true;
}
//-->
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<?
$pofile_id=0;
$rs=mysql_query("Select * from sbbleads_companyprofiles where sb_id =$sb_id");
$profile=mysql_fetch_array($rs);
if($profile)
{
$profile_id=$profile["sb_id"];
$companyname=$profile["sb_companyname"];
$logo=$profile["sb_logo"];
$businesstype=$profile["sb_businesstype"];
$services=$profile["sb_services"];
$yearestablished=$profile["sb_yearestablished"];
/*$markets=$profile["sb_markets"];*/
$markets="-1";
$mkt_q=mysql_query("select * from sbbleads_profile_markets where sb_profile_id=$profile_id");
while($mkt=mysql_fetch_array($mkt_q))
{
$markets.=",".$mkt["sb_market"];
}
$markets.=",-1";
$othermarkets=$profile["sb_othermarkets"];
$productfocus=$profile["sb_productfocus"];
$companyprofile=$profile["sb_companyprofile"];
$employees=$profile["sb_employees"];
$ceo=$profile["sb_ceo"];
$website=$profile["sb_website"];
$cat_list="";
$cid_list="";
$profile_cat_query=mysql_query("select * from sbbleads_profile_cats where sb_profile_id=".$profile["sb_id"]);
while($profile_cat=mysql_fetch_array($profile_cat_query))
{
$cat=mysql_fetch_array(mysql_query("select * from sbbleads_categories where sb_id=".$profile_cat["sb_cid"]));
$cat_path=$cat["sb_cat_name"];
$par=mysql_query("select * from sbbleads_categories where sb_id=".$cat["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"]);
}
if($cat_list=="")
{
$cat_list=$cat_path;
$cid_list=$cat["sb_id"];
}
else
{
$cat_list.=";".$cat_path;
$cid_list.=";".$cat["sb_id"];
}
$phone_arr=explode("-",$profile["sb_phone"]);
$phone=$phone_arr[0];
$phone1=$phone_arr[1];
$phone2=$phone_arr[2];
$fax_arr=explode("-",$profile["sb_fax"]);
$fax=$fax_arr[0];
$fax1=$fax_arr[1];
$fax2=$fax_arr[2];
}
}
else
{
$cid_list="";
$companyname="";
$logo="";
$businesstype="";
$services="";
$yearestablished="";
$markets="";
$othermarkets="";
$productfocus="";
$companyprofile="";
$employees="";
$ceo="";
$website="";
$cat_list="";
$phone="";
$phone1="";
$phone2="";
$fax="";
$fax1="";
$fax2="";
}
//IF SOME FORM WAS POSTED DO VALIDATION
if ( count($_POST)<>0 )
{
$companyname=$_REQUEST["companyname"];
$logo=$_REQUEST["list1"];
$businesstype=$_REQUEST["businesstype"];
$services=$_REQUEST["services"];
$yearestablished=$_REQUEST["yearestablished"];
$othermarkets=$_REQUEST["othermarkets"];
$productfocus=$_REQUEST["productfocus"];
$companyprofile=$_REQUEST["companyprofile"];
$employees=$_REQUEST["employees"];
$ceo=$_REQUEST["ceo"];
$website=$_REQUEST["website"];
global $markets;
$markets="-1,".$markets.",-1";
$cid_list=$_REQUEST["cid"];
$cat_list=$_REQUEST["category"];
$phone=$_REQUEST["phone"];
$phone1=$_REQUEST["phone1"];
$phone2=$_REQUEST["phone2"];
$fax=$_REQUEST["fax"];
$fax1=$_REQUEST["fax1"];
$fax2=$_REQUEST["fax2"];
}
if (count($_POST)>0)
{
if ( $errcnt<>0 )
{
?>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="errorstyle">
<tr>
<td colspan="2"><strong> 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%"> <?php echo $i+1;?></td>
<td width="94%"><?php echo $errs[$i]; ?></td>
</tr>
<?
}
?>
</table>
<?
}
}
?>
<form name="form123" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onSubmit="return validate(this);">
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="5" class="onepxtable">
<tr class="titlestyle">
<td colspan="3"> Company Profile</td>
</tr>
<tr valign="top">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -