" .
"" .
"");
$getcats = $dbcnx->query("SELECT cat_name,catpage FROM cats ORDER BY cat_name");
if(!$getcats){
$air[]="Could not get categories for menu. Error: ";
}else{
while ($row = $getcats->fetch_row()) {
echo("");
}//while fetching cats
}//got cats
echo("" .
"" .
" ");
if($repped==""){
$skip="on";
}else{
$show="on";
$dnum=date(Ymd)*4;
$dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1');
mysql_select_db('ecosmar_website', $dbcnx);
$checkrep=mysql_query("SELECT ID FROM psw WHERE usrn='$repped'");
if(!$checkrep){
$air[]="Could not verify rep. Error: ".mysql_error();
$show="off";
}else{
$row=mysql_fetch_array($checkrep);
$uID=$row[0];
if($uID==""){
$air[]="Representative does not match records.";
$show="off";
}else{
echo("" .
" Eco-\$mart Representative $repped Logged In. ");
mysql_select_db('ecosmar_inv', $dbcnx);
$getquote = $dbcnx->query("SELECT ID,CID FROM quotes WHERE usrn='$repped'");
if(!$getquote){
$air[]="Could not get quotes for ".$repped.". Error: ".mysql_error();
$show="off";
}else{
$numquos=mysql_num_rows($getquote);
if($numquos < 1){
$show="off";
$air[]="No Quotes Started.";
}else{//there are quotes
while($rowq=mysql_fetch_array($getquote)){
$QIDs[]=$rowq['ID'];
$CIDs[]=$rowq['CID'];
}//while getting and filling arrays
mysql_select_db('ecosmar_contacts', $dbcnx);
foreach($CIDs as $value){
$getcon=mysql_query("SELECT first_Name,Name,Company FROM con_main WHERE ID='$value'");
if(!$getcon){
$air[]="Could not get contact info for contact. Error: ".mysql_error();
$show="off";
}else{
$rowc=mysql_fetch_array($getcon);
$first_Name=$rowc[0];
$Name=$rowc[1];
$Company=$rowc[2];
if($Company!=""){
$quocos[]=$Company;
}else{
$quocos[]=$first_Name." ".$Name;
}
}//got contact
}//4each quote/contact ID
}//there are quotes
}//got quote
$i=0;
$countem=count($items);
while($i<$countem){
if(in_array($items[$i],$qoks)){
$ast[]=$items[$i];
$astname[]=$itemnames[$i];
}//in array with dealer prices
$i=$i+1;
}//while counting items
if(empty($ast)){
$air[]="No Quotes. No qualifying prices.";
$show="off";
}
if($show=="on"){
echo("");
}//show is on
}//repped matches usrn in psw
}//chekd rep
}//rep is present
if(!empty($air)){
echo("");
foreach($air as $value){
echo(" $value");
}//4each
echo(" ");
}//air is not empty
}//print is not yes
?>
|