require_once("../conn.php"); require_once("access.php"); require_once("../includes.php"); if(isset($_POST[s1])) { $PriceInfo = explode("|", $_POST[price]); $NewExp = mktime(0,0,0,date(m) + $PriceInfo[0],date(d),date(Y)); $LogoImage = $_FILES[logo][name]; if(!empty($LogoImage)) { $MyLogo = $t."_logo_".$LogoImage; copy($_FILES[logo][tmp_name], "../yellow_images/".$MyLogo); } else { $MyLogo = $_POST[OldLogo]; } //manage files $MyImages = array(); if(!empty($_FILES[ResumeImages][name][0])) { while(list($key,$value) = each($_FILES[ResumeImages][name])) { if(!empty($value)) { $NewImageName = $t."_resume_".$value; copy($_FILES[ResumeImages][tmp_name][$key], "../yellow_images/".$NewImageName); $MyImages[] = $NewImageName; } } if(!empty($MyImages)) { if(empty($_POST[OldImages])) { $ImageStr = implode("|", $MyImages); } else { $ImageStr = implode("|", $MyImages); $ImageStr = $ImageStr."|".$_POST[OldImages]; } } } else { $ImageStr = $_POST[OldImages]; } if(!empty($_POST[website])) { if(!ereg("^http://", $_POST[website])) { $NewWebsite = ""; } elseif(strlen($_POST[website]) < '11') { $NewWebsite = ""; } else { $NewWebsite = $_POST[website]; } } $q1 = "update yellow_agents set password = '$_POST[p1]', CompanyName = '$_POST[CompanyName]', CategoryID = '$_POST[CategoryID]', FirstName = '$_POST[FirstName]', LastName = '$_POST[LastName]', address = '$_POST[address]', city = '$_POST[city]', state = '$_POST[state]', country = '$_POST[country]', resume = '$_POST[resume]', phone = '$_POST[phone]', cellular = '$_POST[cellular]', pager = '$_POST[pager]', logo = '$MyLogo', ResumeImages = '$ImageStr', PriorityLevel = '$PriceInfo[1]', ExpDate = '$NewExp', email = '$_POST[email]', website = '$NewWebsite', news = '$_POST[news]', NewsletterType = '$_POST[format]' where AgentID = '$_GET[AgentID]' "; mysql_query($q1); if(mysql_error()) { echo mysql_error(); } else { header("location:info.php?id=$_GET[AgentID]"); } } //get the info $q1 = "select * from yellow_agents where AgentID = '$_GET[AgentID]' "; $r1 = mysql_query($q1) or die(mysql_error()); $a1 = mysql_fetch_array($r1); if($a1[news] == 'y') { $ch1 = "checked"; } if($a1[news] == 'n') { $ch2 = "checked"; } if($a1[NewsletterType] == 'html') { $ch3 = "checked"; } if($a1[NewsletterType] == 'plain') { $ch4 = "checked"; } ///////////////////////// ///// image block ///////////////////////// $images = ""; if(!empty($a1[ResumeImages])) { $images = explode("|", $a1[ResumeImages]); while(list(,$v2) = each($images)) { $ImageBlock .= "
delete | ";
$mi++;
}
}
$images .= "||
\n |