<?
//Send Mail for new message on Special Orders
 function mailmessage($subject,$eventName,$eventLink,$body="")
 {
	 
//include 'mandrill.php';
//$mandrill = new Mandrill_Wrapper();
// session_start();
 
$Header = "MIME-Version: 1.0\r\n";
$Header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$Header .= "From: overstockArt.net <sales@overstockart.net>\r\n";
$Header .= "Reply-To: $repEmail\r\n";
$Header .= "Bcc: asasson@overstockart.com\r\n";
$Header .= "X-Mailer: PHP/" . phpversion();
 
 $msg ="<body bgcolor=white>";
	$msg.="<table width=532>";
	$msg.="<tr><td colspan=2 bgcolor=#99B3CC height=1><font size='+1'><b>overstockArt.com CCM Update <br>" . $subject . "</td></tr>";
	$msg.="<tr><td><font color=black>" . $eventName . " Event has been uploaded. Go to download the QuickBooks export: </font></td></tr>";
	$msg.="<tr><td><font color=black>Event Link: <a href=\"https://www.overstockart.net/ccm/" . $eventLink . "\">https://www.overstockart.net/ccm/" . $eventLink . "</a></font></td></tr>";
	$msg.="<tr><td><font color=black>Go to " . $eventName . " on Fulfillment: ";
	
	if($eventName == "CommerceHub")
	{
		$msg.="<a href=\"https://www.overstockart.net/ccm/fullfilment.php?q=&status=All&source=Macys Order&showOnly=lastUpdate\">https://www.overstockart.net/ccm/fullfilment.php?q=&status=All&source=Macys Order&showOnly=lastUpdate</a>";
		$msg.="<a href=\"https://www.overstockart.net/ccm/fullfilment.php?q=&status=All&source=Lowes Order&showOnly=lastUpdate\">https://www.overstockart.net/ccm/fullfilment.php?q=&status=All&source=Lowes Order&showOnly=lastUpdate</a>";
		$msg.="<a href=\"https://www.overstockart.net/ccm/fullfilment.php?q=&status=All&source=Home Depot Order&showOnly=lastUpdate\">https://www.overstockart.net/ccm/fullfilment.php?q=&status=All&source=Home Depot Order&showOnly=lastUpdate</a>";
	}
	else {
	$msg.="<a href=\"https://www.overstockart.net/ccm/fullfilment.php?q=&status=All&source=" . $eventName . " Order&showOnly=lastUpdate\">https://www.overstockart.net/ccm/fullfilment.php?q=&status=All&source=". $eventName . " Order&showOnly=lastUpdate</a>";
	}
	
	$msg.="</font></td></tr><tr><td><font color=black>" . $body . "</font></td></tr>";
	$msg.="</table><br>";
	$msg.="</body>";
	
	/*$Body = trim(preg_replace('/\s+/', ' ', $msg));
	$Body = utf8_encode($Body);*/
	/*$deliver_to_arr[] = array(
            array(
                'email' => 'mkrause@overstockart.com', 
                'name' => 'Melinda',
                'type' => 'to'
            ),
			array(
                'email' => 'egarcia@overstockart.com', 
                'name' => 'Erica',
                'type' => 'to'
            ),
			array(
                'email' => 'info@overstockart.com', 
                'name' => 'Info',
                'type' => 'to'
            ),
			array(
                'email' => 'dholmes@overstockart.com', 
                'name' => 'Dena',
                'type' => 'to'
            ),
			array(
                'email' => 'asasson@overstockart.com', 
                'name' => 'Amitai',
                'type' => 'to'
            )
        );*/
		
$mailto = "mkrause@overstockart.com, jlattimer@overstockart.com, eholt@overstockart.com, info@overstockart.com, bparrott@overstockart.com";  //"sassonamitai@yahoo.com"; //
// send email to customer
//$success = mail($email, $subject, $Body, $Header);
/*$header = array(
    'from_name' => 'overstockArt.com',
    'from_email' => 'sales@overstockart.com',
	'to' => $delivery_to_arr,
	'preserve_recipients' => false,
    'reply_to' => 'sales@overstockart.com',
    'bcc_email' => 'asasson@overstockart.com'
);*/
//$success = $mandrill->sendEmail($header, $subject, $Body);
$success = mail($mailto, $subject, $msg, $Header);
 // redirect to success page 
 if ($success){
   print "Email Sent Successfully!";
 }
 else{
   print "ERROR IN MAIL";
 }
   
 }
 ?>
<?
 function table_header_vip($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Customer Name</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Customer Email</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Total Orders on Web</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Total Orders on Phone</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Total Orders</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Last Order Date</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_frames_buckets($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Frame Name</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 First Painting Framed</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Size</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Count</font></b></td>
 </tr> 
 <?php } ?>
 
 <?
 function table_header_coupon_buckets($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Coupon Name</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 First Order</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
Total Savings</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Count</font></b></td>
 </tr> 
 <?php } ?>
 
 <?
 function table_header_custom_size($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Contact Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Painting Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Price Quote</font></b></td>
 </tr>
 <?php } ?>
 
 <?
 function table_header_tasks($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Customer Name</font></b></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Notes</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Status</font></b></td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Priority</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_sendEmail_report($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Customer Email</font></b></td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Customer Rep</font></b></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Notes</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date Emailed</font></b></td>
 </tr> 
 <?php } ?>
 <?php function display_sendEmail_data_report($result) {
 // Loop Thru Records
  while($row = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
  <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="index.php?customeremail=<?php echo trim($row["CustomerEmail"]); ?>&opstatus=customeremailsearch&customeremailsearch=Search"><?php echo $row["CustomerEmail"]; ?> </a>
 </font> 
 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php echo $row["user"];      ?>
 </font>
 </td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php 
  if(isset($row["Subject"])) echo "<b>" . $row["Subject"] . "</b><br>";
  if(isset($row["Note"])) echo $row["Note"];
        ?>
 </font>
 </td>
  <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $Date = date("j M Y",$row["Date"]);
 echo $Date;
 ?> 
 </font> 
 </td>  
 </tr>
 <?php 
 	}
 }
 ?>
 <?
 function table_header_logcall_report($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=6 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Customer Email & Phone</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Customer Rep</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Call Status</font></b></td>
 <td width="30%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Objective</font></b></td>
 <td width="30%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Notes</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date Called</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_logDesignercall_report($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Name & Company</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Phone, Fax & Email</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Full Address</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Status & Rating</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Notes</font></b></td>
 </tr>
 <?php } ?>
 <?php function display_logDesignercall_data_report($result) {
 // Loop Thru Records
  while($row = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
  <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <b><?php echo $row["Name"]; ?> </b>
 <br />
 <?php echo $row["Title"]; ?> 
 <br />
 <b><?php echo $row["Company"] . "</b>";
 echo '<br /><br />';
 echo "<b style=\"color:#0c5218\">Designer set as Lead! <a target='_blank' href='viewLead.php?leadId=" . $row["leadID"] . "'>click to edit lead &raquo; </a>";
 ?>
 </font> 
 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo $row["Telephone"]; ?>
 <br /> <br />
 Phone 2: <?php echo $row["Phone2"]; ?> <br /> 
 Email: <?php echo $row["Email"]; ?>
 </font>
 </td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo $row["Name"] . "<br><br>"; echo $row["Address1"] . "<br>";
     if($row["Address2"] != "") echo $row["Address2"] . "<br>"; 
 	echo $row["City"] . ", " . $row["State"] . " " . $row["Zip"] . " " . $row["Country"]; 
 ?>
 </font>
 </td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php echo $row["status"]; ?> 
  <BR /><BR />
 <?php echo $row["ratings"]; ?> 
 </font> 
 </td>  
  <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($row["Notes"])) echo $row["Notes"]; ?> 
  <BR /><BR />
 <?php 
 $Date = date("j M Y",$row["LastDate"]); 
 echo $Date;
 ?> 
 </font> 
 </td>  
 </tr>
 <?php 
 	}
 }
 ?>
 <?php function display_logcall_data_report($result) {
 // Loop Thru Records
  while($row = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <?php
   $colorstatus = "#000000";
   $sqlStatus = "SELECT * FROM `status-call` WHERE `status` = '" . $row["Status"] . "' LIMIT 1 ";
   $resultStatus = mysql_query($sqlStatus);
   $myrowStatus = mysql_fetch_array($resultStatus);
   $colorstatus = $myrowStatus['color'];
   ?>
   <td width="15%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;"> 
 <a href="index.php?customeremail=<?php echo trim($row["CustomerEmail"]); ?>&opstatus=customeremailsearch&customeremailsearch=Search"><?php echo $row["CustomerEmail"]; ?> </a><br />
 <?php echo $row["Telephone"]; ?>
 </td> 
 <td width="25%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;"> 
  <?php echo $row["user"];      ?>
 </td>
 <td width="25%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;"> 
  <?php if(isset($row["Status"])) echo $row["Status"];
        ?>
 </td>
  <td width="25%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;"> 
  <?php if(isset($row["objective"])) echo $row["objective"];
    ?>
 </td>
 <td width="25%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;"> 
  <?php if(isset($row["Note"])) echo $row["Note"];
        ?>
 </td>
  <td width="15%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;"> 
 <?php 
 $Date = date("j M Y",$row["Date"]); 
 echo $Date;
 ?> 
 </td>  
 </tr>
 <?php 
 	}
 }
 ?>
 <?
 function table_header_tasks_report($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Customer Name</font></b></td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Customer Rep</font></b></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Notes</font></b></td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Status</font></b></td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Priority</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date</font></b></td>
 </tr> 
 <?php } ?>
 <?php function display_task_data_report($result) {
 // Loop Thru Records
  while($row = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
  <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="index.php?customeremail=<?php echo trim($row["CustomerEmail"]); ?>&opstatus=customeremailsearch&customeremailsearch=Search"><?php echo $row["Name"]; ?> </a><br />
 <a href="mailto:<?php echo $row["CustomerEmail"]; ?> " ><?php echo $row["CustomerEmail"]; ?> </a>
 <br /><br />
 <a href="delete.php?op=deletetask&id=<?php echo $row["id"]; ?>" onclick="return confirm('Are you sure you want to delete?')">[Delete Task]</a>
 </font> 
 </td> 
 <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php echo $row["user"];      ?>
 </font>
 </td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($row["message"])) echo $row["message"];
        ?>
 </font>
 </td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <!--<form name="send_quote_<?php echo $row["id"];?>" action="update-task.php" method="post">-->
 <?php 
 $current_status = $row["status"]; 
 /*$result1 = mysql_query ("SELECT * FROM `status-task`");
  echo "<select name=\"status\">\r";
  if ($row2 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row2["status"] == $current_status)
 		  $selected="selected";
    print "<option $selected value=\"" . $row2["status"]."\">" . $row2["status"]."\r";
 	 } while($row2 = mysql_fetch_array($result1));
 }*/
 echo $current_status;
 ?> 
 </font> 
 </td>  
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php
 $current_priority = $row["priority"]; 
 /*$result1 = mysql_query ("SELECT * FROM `priority`");
  echo "<select name=\"priority\">\r";
  if ($row3 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row3["priority"] == $current_priority)
 		  $selected="selected";
    print "<option $selected value=\"" . $row3["priority"]."\">" . $row3["priority"]."\r";
 	 } while($row3 = mysql_fetch_array($result1));
 }*/
 echo $current_priority
 ?><BR />
 Initiated: &nbsp;
 <?php // ... is posted into a readable date, using date().
 $posted = date("j M Y",$row['Date']);
 echo $posted;
  ?> 	   
 <!--<input type="hidden" name="id" value="<?= $row["id"]; ?>" />
 <input style="padding-left:5px;" align="right" onClick="return confirm('Are you sure you want to update task?')" type='submit' NAME='sendTask_<?php echo $row["id"];?>' value='Update Task' ></form>
 -->
 </font> 
 </td>  
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php // ... is posted into a readable date, using date().
 if ($row['Due'] != "")
 {
     $now = time();
 	if ($now > $row['Due']) //now is more then due then it is passed due...
 	{
 	$color = "#AE0011";
 	$due_text = "Past Due: ";
 	}
 	else
 	{
 	$color = "#000000";
 	$due_text = "Due: ";
 	}
 	
 	$due = "<b style=\"color:" . $color . "\"> " . $due_text . " " . date("j M Y",$row['Due']);
 	
 }
 else $due = "No Due Date";
 echo $due;
  ?> 	   
 </font> 
 </td>  
 </tr>
 <?php 
 	}
 }
 ?>
 <?php function display_task_data($result) {
 // Loop Thru Records
  while($row = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
  <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="index.php?customeremail=<?php echo trim($row["CustomerEmail"]); ?>&opstatus=customeremailsearch&customeremailsearch=Search"><?php echo $row["Name"]; ?> </a><br />
 <a href="mailto:<?php echo $row["CustomerEmail"]; ?> " ><?php echo $row["CustomerEmail"]; ?> </a>
 <br /><br />
 <a href="delete.php?op=deletetask&id=<?php echo $row["id"]; ?>" onclick="return confirm('Are you sure you want to delete?')">[Delete Task]</a>
 </font> 
 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($row["message"])) echo $row["message"];
        ?>
 </font>
 </td>
  <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <form name="send_quote_<?php echo $row["id"];?>" action="update-task.php" method="post">
 <?php 
 $current_status = $row["status"]; 
 $result1 = mysql_query ("SELECT * FROM `status-task`");
  echo "<select name=\"status\">\r";
  if ($row2 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row2["status"] == $current_status)
 		  $selected="selected";
    print "<option $selected value=\"" . $row2["status"]."\">" . $row2["status"]."\r";
 	 } while($row2 = mysql_fetch_array($result1));
 }
 ?> 
 </font> 
 </td>  
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php
 $current_priority = $row["priority"]; 
 $result1 = mysql_query ("SELECT * FROM `priority`");
  echo "<select name=\"priority\">\r";
  if ($row3 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row3["priority"] == $current_priority)
 		  $selected="selected";
    print "<option $selected value=\"" . $row3["priority"]."\">" . $row3["priority"]."\r";
 	 } while($row3 = mysql_fetch_array($result1));
 }
 ?>
 <input type="hidden" name="id" value="<?= $row["id"]; ?>" />
 <input style="padding-left:5px;" align="right" onClick="return confirm('Are you sure you want to update task?')" type='submit' NAME='sendTask_<?php echo $row["id"];?>' value='Update Task' ></form>
 </font> 
 </td>  
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Initiated: &nbsp;
 <?php // ... is posted into a readable date, using date().
 $posted = date("j M Y",$row['Date']);
 echo $posted;
  ?> 	   
  <br /><Br />
 <?php // ... is posted into a readable date, using date().
 if ($row['Due'] != "")
 {
     $now = time();
 	if ($now > $row['Due']) //now is more then due then it is passed due...
 	{
 	$color = "#AE0011";
 	$due_text = "Past Due: ";
 	}
 	else
 	{
 	$color = "#000000";
 	$due_text = "Due: ";
 	}
 	
 	$due = "<b style=\"color:" . $color . "\"> " . $due_text . " " . date("j M Y",$row['Due']);
 	
 }
 else $due = "No Due Date";
 echo $due;
  ?> 	   
 </font> 
 </td>  
 </tr>
 <?php 
 	}
 }
 ?>
 <?
 function table_header_contactus($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Contact Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Comments</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Customer Service Comments</font></b></td>
 </tr> 
 <?php } ?>
 
 <?php function display_contactus_data($result) {
 // Loop Thru Records
  while($row = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
  <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="viewContactUsLead.php?leadId=<?= $row["primary"];?>" ><img title="Edit" alt="Edit Lead" align="LEFT" src="images/28.png" border="0"/>
 <?php echo $row["Name"]; ?> </a><br />
 <a href="mailto:<?php echo $row["Email"]; ?> " ><?php echo $row["Email"]; ?> </a><br />
 <?php echo $row["Phone"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $row['Email'];?>&phone=<?= $row['Phone'];?>&table=customerserv&thread=<?= $row["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $row['Email'];?>&table=customerserv&thread=<?= $row["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $row["Email"];?>&table=customerserv&thread=<?= $row["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $row["Email"];?>" target="_blank"><img title="View on Hubspot" alt="View on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>
  </font> 
 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($row["Comments"])) echo $row["Comments"];   ?>
 </font>
 </td> 
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo $row["Date"]; ?> 
 <br /><br />
  <a href="delete.php?op=deletecontcatus&id=<?php echo $row["primary"]; ?>" onclick="return confirm('Are you sure you want to delete this?')">Delete</a>
 </font> 
 </td>  
  <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php if ($row["sent"] == 1)
 {
 ?>
 Contacted: <br />
 <?php 
 echo $row["rep_comments"]; 
 ?> 
<!-- <br /><br />
  <a href="delete.php?op=deletecontcatus&id=<?php echo $row["primary"]; ?>" onclick="return confirm('Are you sure you want to delete this?')">Delete</a>-->
 </font> </p></td>
 <?php
 }
 else
 {
 ?>
 <form name="send_quote_<?php echo $row["primary"];?>" action="write-comment.php" method="post">
 <textarea rows="5" cols="20" name='comment'></textarea>
 <input type="hidden" name="primary" value="<?php echo $row["primary"]; ?>" />
 <input onClick="return confirm('Are you sure you want to Add Comment?')" type='submit' NAME='sendComment_<?php echo $row["primary"];?>' value='Enter Comments and Close' ></form>
 </font> </p>
 </td>
 <?php } ?>
 </tr>
 <?php 
 	}
 }
 ?>
 
  <?
 function table_header_virtual_chat($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Contact Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Chat Transcript</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Customer Service Comments</font></b></td>
 </tr> 
 <?php } ?>
 
 <?
 function table_header_live_chat_msgs($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Contact Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Chat Transcript</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Customer Service Comments</font></b></td>
 </tr> 
 <?php } ?>
 
 <?php function display_virtual_chat_data($result) {
 // Loop Thru Records
  while($row = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
  <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="viewVirtualChatLead.php?leadId=<?= $row["id"];?>" ><img title="Edit" alt="Edit Lead" align="LEFT" src="images/28.png" border="0"/>
 <?php echo $row["name"]; ?></a>, <?php echo $row["location"];?><br />
 <a href="mailto:<?php echo $row["email"]; ?> " ><?php echo $row["email"]; ?> </a><br />
 <?php echo $row["phone"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $row['email'];?>&phone=<?= $row['phone'];?>&table=virtualSpirit&thread=<?= $row["id"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $row['email'];?>&table=virtualSpirit&thread=<?= $row["id"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $row["email"];?>&table=virtualSpirit&thread=<?= $row["id"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $row["email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>
 </font> 

 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($row["chat"])) echo $row["chat"];   ?>
 </font>
 </td> 
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo "Product Viewed: <a href=\"" . $row["referrer"] . "\" target=\"_blank\">" . $row["referrer"] . "</a>"; ?> 
 <br />
 <br />
 <?php echo date("F j, Y",$row["Date"]); ?> 
 </font> 
 </td>  
  <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php if ($row["sent"] == 1)
 {
 ?>
 Contacted: <br />
 <?php 
 echo $row["rep_comments"]; 
 ?> 
 </font> </p></td>
 <?php
 }
 else
 {
 ?>
 <form name="send_quote_<?php echo $row["id"];?>" action="write_comment_virtual_chat.php" method="post">
 <textarea rows="5" cols="20" name='comment'></textarea>
 <input type="hidden" name="id" value="<?php echo $row["id"]; ?>" />
 <input onClick="return confirm('Are you sure you want to Add Comment?')" type='submit' NAME='sendComment_<?php echo $row["id"];?>' value='Enter Comments and Close' ></form>
 </font> </p></td>
 <?php } ?>
 </tr>
 <?php 
 	}
 }
 ?>
 
 <?php function display_live_chat_msgs_data($result) {
 // Loop Thru Records
  while($row = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
  <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="viewLiveChatMsgLead.php?leadId=<?= $row["id"];?>" ><img title="Edit" alt="Edit Lead" align="LEFT" src="images/28.png" border="0"/>
 <?php echo $row["name"]; ?></a>, <?php echo $row["location"];?><br />
 <a href="mailto:<?php echo $row["email"]; ?> " ><?php echo $row["email"]; ?> </a><br />
 <?php echo $row["phone"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $row['email'];?>&phone=<?= $row['phone'];?>&table=livechatmsgs&thread=<?= $row["id"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $row['email'];?>&table=livechatmsgs&thread=<?= $row["id"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $row["email"];?>&table=livechatmsgs&thread=<?= $row["id"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $row["email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>
  
 </font> 
 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($row["chat"])) echo $row["chat"];   ?>
 </font>
 </td> 
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo "Product Viewed: <a href=\"" . $row["referrer"] . "\" target=\"_blank\">" . $row["referrer"] . "</a>"; ?> 
 <br />
 <br />
 <?php echo date("F j, Y",$row["Date"]); ?> 
 	   <br /><br />
 <a href="delete.php?op=deletelivechat&id=<?php echo $row["id"]; ?>" onclick="return confirm('Are you sure you want to delete?')">[Delete Chat Record]</a>
 </font> 
 </td>  
  <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php if ($row["sent"] == 1)
 {
 ?>
 Contacted: <br />
 <?php 
 echo $row["rep_comments"]; 
 ?> 
 </font> </p></td>
 <?php
 }
 else
 {
 ?>
 <form name="send_quote_<?php echo $row["id"];?>" action="write_comment_live_chat_msg.php" method="post">
 <textarea rows="5" cols="20" name='comment'></textarea>
 <input type="hidden" name="id" value="<?php echo $row["id"]; ?>" />
 <input onClick="return confirm('Are you sure you want to Add Comment?')" type='submit' NAME='sendComment_<?php echo $row["id"];?>' value='Enter Comments and Close' ></form>
 </font> </p></td>
 <?php } ?>
 </tr>
 <?php 
 	}
 }
 ?>
 
 <?
 function table_header_decor_help($title,$color) {
 ?>
 <table border="1" cellpadding="0" cellspacing="0" bordercolor="#111111" width="100%">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;color:#FFFFFF;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Name</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Email and Phone</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Room, Colors and Dimensions</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Style, Subject and Aritst</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Comments</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date Added</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Rep Comments</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_custom_size_bucket($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;color:#FFFFFF;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Size</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Count Requests</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_custom_size_list($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;color:#FFFFFF;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Size</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Count Requests</font></b></td>
 </tr> 
 <?php } ?>
 <?php
 function table_header_items($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Return</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Art Info</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Unit Price</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Framing</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Qty</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Sub Total</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_cart($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Remove</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Art Info</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Unit Price</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Framing Price</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Qty</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Sub Total</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Update</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_returns($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Update</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Art Info</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Return</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Description</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Solution</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Claim</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Total Cost</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_items_returned($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Remove</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Art Info</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Unit Price</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Framing Price</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Qty</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Sub Total</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_confirm($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Art Info</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Unit Price</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Framing Price</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Qty</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Sub Total</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_packingslip_item($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Art Info</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Framing Option</font></b></td>
 <td width="5%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Qty</font></b></td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Barcode</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_packingslip_station_item($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Art Info</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Framing Option</font></b></td>
 <td width="5%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Qty</font></b></td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Stage</font></b></td>
 </tr> 
 <?php } ?>
  <?
 function table_header_packingslip_item_return($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Art Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Notes</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Qty</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_orders($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <tr>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_manual($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_tada($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_hautelook($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 
 <?
 function table_header_orders_kohls($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_macys($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_woot($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_zulily($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_groupon($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_amazonDropShip($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_wayfair($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_opensky($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_houzz($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_rue($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 
 <?
 function table_header_orders_sams($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_ch($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_homedepot($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 
 <?
 function table_header_orders_lowes($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_overstock($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_overstockm($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_AAA($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_btr($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_myhabit($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_amazonv($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="6" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="15%" height="21"> 
 PO Info:</td> 
 <td width="20%" height="21">
 Item Details:
 </td>
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Fulfillment Center:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 
 <?
 function table_header_orders_tada_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_hautelook_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_kohls_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_woot_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_zulily_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_groupon_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_amazonDropShip_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_wayfair_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_opensky_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
  <?
 function table_header_orders_houzz_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
  <?
 function table_header_orders_rue_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_sams_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 
 <?
 function table_header_orders_ch_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_homedepot_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 
 <?
 function table_header_orders_lowes_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_overstock_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_overstockm_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
  <?
 function table_header_orders_AAA_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_btr_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_orders_myhabit_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_orders_amazonv_invoice($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="6" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="15%" height="21"> 
 Order Info:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
Fulfillment Center:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_comission_report($title,$color) {
 ?>
 <table>
 <tr>
 <td>
 <table width="950" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="9" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <!--<td width="5%" height="21"> 
 Select:</td> -->
 <td width="40" height="21"> 
 Cnt</td> 
 <td width="80" height="21"> 
 Order Info:</td> 
 <td width="160" height="21"> 
 Name & Email:</td> 
 <td width="90" height="21">
 Ship Date:
 </td>
 <td width="80" height="21"> 
 Total Amount:
 </td> 
 <td width="120" height="21"> 
 Ship cost:
 </td> 
 <td width="120" height="21"> 
 COGS:
 </td> 
 <td width="120" height="21"> 
 FOB China:
 </td> 
 <td width="120" height="21"> 
 NGM:
 </td> 
 </tr>
 </table>  
     </td>
   </tr>
 <tr>
     <td valign="top">
 	<div id="divCommission" onscroll="SetDivPosition()" >
 	<table cellspacing="0" cellpadding="1" border="1" width="950">
 <?php } ?>
 <?
 function table_header_lead_total($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="13" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="8%" height="21"> 
 Info</td> 
 <td width="8%" height="21"> 
 custom size:</td>
 <td width="8%" height="21"> 
 custom order:</td>
 <td width="8%" height="21">
 corporate:
 </td>
 <td width="8%" height="21">
 Int. Designers:
 </td>
 <td width="8%" height="21"> 
 catalog:
 </td> 
 <td width="8%" height="21"> 
 decor help:
 </td> 
 <td width="8%" height="21"> 
 contact us:
 </td> 
 <td width="8%" height="21"> 
 pdf download:
 </td> 
 <td width="8%" height="21"> 
 newsletter:
 </td> 
  <td width="8%" height="21"> 
 daily deal:
 </td> 
  <td width="8%" height="21"> 
 homepage overlay:
 </td> 
  <td width="8%" height="21"> 
 virtual chat:
 </td> 
 </tr>
 <?php } ?>
 <?
 function sql_date($query,$table) {
 $query_result = str_replace("Date",$table . ".Date",$query);
 return $query_result;
  } ?>
  
 <?
 function table_header_return_order($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 
 <?
 function table_header_return_order_mail($title,$color) {
 $header = "<table width='100%' cellpadding='1' cellspacing='2' border='1'>
 <tr><td colspan='7' align=center style='background-color:" . $color . "'>---- " . $title . " ----</td></tr>
 <tr bgcolor='#cccccc'> <td width='5%' height='21'> 
 Order Info:</td> 
 <td width='15%' height='21'> 
 Shipping Info:
 </td> 
 <td width='15%' height='21'> 
 Billing Info:
 </td> 
 <td width='10%' height='21'> 
 Shipping Method:
 </td> 
 <td width='10%' height='21'> 
 Total:
 </td> 
 </tr>";
 
 return $header;
 } ?>
 
 <?
 function table_header_confirm_top($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="10%" height="21"> 
 Email:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="15%" height="21"> 
 Billing Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 <td width="10%" height="21"> 
 Total:
 </td> 
 </tr>
 <?php } ?>
 <?
 function table_header_packinglist($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="7" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74" class=special_order_status>
 <td width="5%" height="21"> 
 Order Info:</td> 
 <td width="15%" height="21"> 
 Shipping Info:
 </td> 
 <td width="10%" height="21"> 
 Shipping Method:
 </td> 
 </tr>
 <?php } ?>
 
  <?
 function table_header_packinglist_return_phone($title,$color) {
 ?>
  <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Select</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Notes</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Art Info</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21">
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Frame Info</font></b></td>
 <td width="10%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Qty</font></b></td>
 </tr> 
 <?php } ?>
 
 <?
 function table_header_custom($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan="6" align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="25%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Name</font></b></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Email and Phone</font></b></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Painting Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Price Quote</font></b></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date Added</font></b></td>
 </tr> 
 <?php } ?>
 
 <?
 function table_header_custom_order_frame($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Contact Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Frame Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Image</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Price Quote</font></b></td>
 </tr>
 <?php } ?>
 
 <?
 function table_header_corporate($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=5 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Name</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Email and Phone</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Address &amp; Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Lead Notes</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Status</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_b2c($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=5 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Name</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Email and Phone</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Address &amp; Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Lead Notes</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Status</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_account($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=5 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Name</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Email and Phone</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Address &amp; Info</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Lead Notes</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Status</font></b></td>
 </tr> 
 <?php } ?>
 
 <?
 function table_header_events($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=5 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
Event Name</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Event Details</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Start &amp; End Date</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Notes</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 File</font></b></td>
 </tr> 
 <?php } ?>
 
 <?
 function table_header_catalog_request($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=9 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Name</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Email</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Address</font></b></td>
 <td width="20%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Date Added</font></b></td>
 </tr>
 <?php } ?>
 <?
 function table_header_call_log($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=5 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="33%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Date</font></b></td>
 <td width="33%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Call Status</font></b></td>
 <td width="33%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Objective</font></b></td>
 <td width="33%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Notes</font></b></td>
 </tr> 
 <?php } ?>
 <?
 function table_header_email_log($title,$color) {
 ?>
 <table width="100%" cellpadding="1" cellspacing="2" border="1">
 <tr><td colspan=5 align=center class=special_order_status style="background-color:<? echo $color;?>;">---- <? echo $title; ?> ----</td></tr>
 <tr bgcolor="#293b74">
 <td width="50%" height="21"> 
 <p style="margin-left: 10"><b><font size="2" face="Verdana" color="#FFFFFF"> 
 Date</font></b></td>
 <td width="50%" height="21"> 
 <p style="margin-left: 10"><b><font face="Verdana" size="2" color="#FFFFFF"> 
 Email</font></b></td>
 </tr> 
 <?php } ?>
 
 <?php function display_custom_order_frame_data($result) {
 // Loop Thru Records
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a href="viewCustomFrameLead.php?leadId=<?= $myrow["clientID"];?>" ><img title="Edit" alt="Edit Lead" align="LEFT" src="images/28.png" border="0"/><?php echo $myrow["Name"]; ?></a> <br><br />
 <a href="mailto:<?php echo $myrow["Email"]; ?> " > <?php echo $myrow["Email"]; ?> </a><br />
 <?php echo $myrow["Phone"]; ?><br>
 </font>
 <p style="margin-left: 10; margin-right: 10"> 
 DATE: <?php echo $myrow["Date"]; ?> 
 </font> 
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?= $myrow["Email"];?>&phone=<?= $myrow["Phone"];?>&table=custom_order_frame',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["Email"];?>&table=custom_order_frame',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["Email"];?>&table=custom_order_frame&thread=<?= $myrow["clientID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $myrow["Email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>

 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php 
  		if(isset($myrow["Frame"])) echo "Frame P/N: " . $myrow["Frame"] . "<br>"; 
 	   if(isset($myrow["W_size"])) echo "Width: " . $myrow["W_size"] . " " . $myrow["Units"] . "<br>"; 
	   if(isset($myrow["H_size"])) echo "Height: " .$myrow["H_size"] . " " . $myrow["Units"] . "<br>";
 	   if(isset($myrow["Orientation"])) echo "Orientation: " .$myrow["Orientation"] . "<br>";
	    
 	   if(isset($myrow["Instructions"])) echo "Instructions: " .$myrow["Instructions"] . "<br>";
 	   ?>
 	   <br /><br />
 <a href="delete.php?op=deletecustomframe&id=<?php echo $myrow["clientID"]; ?>" onclick="return confirm('Are you sure you want to delete?')">[Delete Request]</a>
 </font> 
 </td> 
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["Frame"] . "20X24.gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["Frame"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["Frame"] . "20X24.jpg";
		if(url_exists($image_file_jpg)){
		 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
		}else if (url_exists($image_file_gif)){
			echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
		}else{
		 	echo "<img src=\"" . $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
		}
 ?>
 </td> 
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php if ($myrow["sent-quote"] == 1)
 {
 ?>
 Quote Given: <?php echo number_format($myrow["quote"],2,'.',','); 
 ?> <br /> <input name="group1" onclick="changeDiv('send_quote_<?php echo $myrow["clientID"];?>','block');" type="radio">Give a New Quote?</a><br />
 <br />
 <div id="send_quote_<?php echo $myrow["clientID"];?>" style="margin-left: 10px; display:none;">
 <form name="send_quote_<?php echo $myrow["clientID"];?>" action="send-frame-quote.php" method="post">
 <textarea rows="5" cols="20" name='Message'><?php echo $myrow["Message"]; ?></textarea><br />
 <input type='text' size='5' name='price' value='<?php echo number_format($myrow["quote"],2,'.',',');?>'>
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" />
 <input type="hidden" name="frameCode" value="<?php echo $myrow["Frame"]; ?>" />
 <input type="hidden" name="WSize" value="<?php echo $myrow["W_size"]; ?>" />
 <input type="hidden" name="HSize" value="<?php echo $myrow["H_size"]; ?>" />
 <input type="hidden" name="Units" value="<?php echo $myrow["Units"]; ?>" />
 <input type="hidden" name="customerEmail" value="<?php echo $myrow["Email"]; ?>" />
 <input type="hidden" name="customerName" value="<?php echo $myrow["Name"]; ?>" />
  <input onClick="return confirm('Are you sure you want to Send this Quote?')" type='submit' NAME='sendQuote_<?php echo $myrow["clientID"];?>' value='Send Quote' ></form>
 </div>
  <br />
 <?php echo "Sales Rep Comment: " . $myrow["comments"] . "<br><br>"; ?>
   <form name="add_comment_<?php echo $myrow["clientID"];?>" action="add-comment-frame-only.php" method="post">
 <textarea rows="3" cols="20" name='comments_int'> <?php echo $myrow["comments"]; ?> </textarea><br /> 
 Status: &nbsp;
 <?php
  $current_status = $myrow["status_custom_order"];
 $result1 = mysql_query ("SELECT * FROM `status-special-order` ORDER BY `statusid` ASC ");
  echo "<select name=\"status\">\r";
  if ($row2 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row2["status"] == $current_status)
 		  $selected="selected";
    print "<option $selected value=\"" . $row2["status"]."\">" . $row2["status"]."\r";
 	 } while($row2 = mysql_fetch_array($result1));
 }
 ?>
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" /><br />
 <input onClick="return confirm('Are you sure you want to add this comment?')" type='submit' NAME='addComment_<?php echo $myrow["clientID"];?>' value='Edit Comment' ></form> <br />
 <a href="saleOrder.php?source=customFrame&customerID=<?php echo $myrow["clientID"]; ?>"><img title="New Order" alt="Make an Order" align="right" src="images/cart_add.png" border="0"/></a>
 <a href="saleOrder.php?source=customFrame&customerID=<?php echo $myrow["clientID"]; ?>">Make an Order</a> 
 </font> </p></td>
 <?php
 }
 else
 {
 ?>
 <form name="send_quote_<?php echo $myrow["clientID"];?>" action="send-frame-quote.php" method="post">
 Add message in email: <br />
 <textarea rows="5" cols="20" name='Message'></textarea><br />
 <input type='text' size='5' name='price' value='0'>
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" />
 <input type="hidden" name="frameCode" value="<?php echo $myrow["Frame"]; ?>" />
 <input type="hidden" name="WSize" value="<?php echo $myrow["W_size"]; ?>" />
 <input type="hidden" name="HSize" value="<?php echo $myrow["H_size"]; ?>" />
 <input type="hidden" name="Units" value="<?php echo $myrow["Units"]; ?>" />
 <input type="hidden" name="customerEmail" value="<?php echo $myrow["Email"]; ?>" />
 <input type="hidden" name="customerName" value="<?php echo $myrow["Name"]; ?>" />
  <input onClick="return confirm('Are you sure you want to Send this Quote?')" type='submit' NAME='sendQuote_<?php echo $myrow["clientID"];?>' value='Send Quote' ></form>
 <br />
 <?php echo "Sales Rep Comment: " . $myrow["comments"] . "<br><br>"; ?>
   <form name="add_comment_<?php echo $myrow["clientID"];?>" action="add-comment-frame-only.php" method="post">
 <textarea rows="3" cols="20" name='comments_int'><?php echo $myrow["comments"];?></textarea> <br />
 Status: &nbsp;
 <?php
  $current_status = $myrow["status_custom_order"];
 $result1 = mysql_query ("SELECT * FROM `status-special-order` ORDER BY `statusid` ASC ");
  echo "<select name=\"status\">\r";
  if ($row2 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row2["status"] == $current_status)
 		  $selected="selected";
    print "<option $selected value=\"" . $row2["status"]."\">" . $row2["status"]."\r";
 	 } while($row2 = mysql_fetch_array($result1));
 }
 ?>
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" /><br />
 <input onClick="return confirm('Are you sure you want to add this comment?')" type='submit' NAME='addComment_<?php echo $myrow["clientID"];?>' value='Edit Comment' ></form> <br />
 
 </font> </p></td>
 <?php } ?>
 
   </tr>
 <?php } 
 }
 ?>
 
 <?php function display_custom_size_data($result) {
 // Loop Thru Records
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
	
	/*Code added for the artistBe images */
	 $isArtistBeImage = 'N';
	 $artistBeImgUrl = '';
	 $artBeImg = '';
	 if($myrow["artistbe_imgurl"] != "" && !empty($myrow["artistbe_imgurl"])){
		  $isArtistBeImage = 'Y';
		  $artistBeImgUrl = 'https://www.artistbe.com/images/artistImage/thumbs/[160x160]'.$myrow["artistbe_imgurl"];
		  $artBeImg = $myrow["artistbe_imgurl"];
	 }
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a href="viewCustomSizeLead.php?leadId=<?= $myrow["clientID"];?>" ><img title="Edit" alt="Edit Lead" align="LEFT" src="images/28.png" border="0"/><?php echo $myrow["Name"]; ?></a> <br><br />
 <a href="mailto:<?php echo $myrow["Email"]; ?> " > <?php echo $myrow["Email"]; ?> </a><br />
 <?php echo $myrow["phone"]; ?><br>
 </font>
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 ADDRESS:<BR>
 <?php  if(isset($myrow["Address1"])) echo $myrow["Address1"] . "<br>" ;
        if(isset($myrow["Address2"])) echo $myrow["Address2"] . "<br>";
  	   if(isset($myrow["City"])) echo $myrow["City"] . ", "; 
        if(isset($myrow["State"])) echo $myrow["State"]; 
 	   if(isset($myrow["Zip"])) echo $myrow["Zip"]; 
 	 ?>
 <br><br>
 DATE: <?php echo $myrow["Date"]; ?> 
 <?php if($myrow["time_stamp"] != "") { echo "<br>TIME: " . $myrow["time_stamp"]; }?>
 </font> 
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?= $myrow["Email"];?>&phone=<?= $myrow["phone"];?>&table=custom_size',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["Email"];?>&table=custom_size',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["Email"];?>&table=custom_size&thread=<?= $myrow["clientID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $myrow["Email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>
  

 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($myrow["ArtName"])) echo $myrow["ArtName"] . "<br>"; 
        if(isset($myrow["ItemCode"])) echo "P/N: " . $myrow["ItemCode"] . "<br>"; 
 	   if(isset($myrow["Size"])) echo "Size: " .$myrow["Size"] . "<br>"; 
 	   if(isset($myrow["Comments"])) echo "Comments: " .$myrow["Comments"] . "<br>";
 	   ?>
 	   <br /><br />
 <a href="delete.php?op=deletecustomsize&id=<?php echo $myrow["clientID"]; ?>" onclick="return confirm('Are you sure you want to delete?')">[Delete Request]</a>
 </font> 
 </td> 
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["ItemCode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["ItemCode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["ItemCode"] . ".jpg";
	if($isArtistBeImage == 'N'){
		if(url_exists($image_file_jpg)){
		 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
		}else if (url_exists($image_file_gif)){
			echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
		}else{
		 	echo "<img src=\"" . $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
		}
	}else{
	 	echo "<img src=\"" . $artistBeImgUrl . "\" border=\"0\" hspace=\"3\" vspace=\"3\" width=\"80%\" >";
	}
if(isset($myrow["Source"])) echo "<br><br> Source: " . $myrow["Source"] ;
 ?>
 </td> 
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php if ($myrow["sent-quote"] == 1)
 {
 ?>
 Quote Given: <?php echo number_format($myrow["quote"],2,'.',','); 
 ?> <br /> <input name="group1" onclick="changeDiv('send_quote_<?php echo $myrow["clientID"];?>','block');" type="radio">Give a New Quote?</a><br />
 <br />
 <div id="send_quote_<?php echo $myrow["clientID"];?>" style="margin-left: 10px; display:none;">
 <form name="send_quote_<?php echo $myrow["clientID"];?>" action="send-quote.php" method="post">
 <textarea rows="5" cols="20" name='Message'><?php echo $myrow["Message"]; ?></textarea><br />
 <input type='text' size='5' name='price' value='<?php echo number_format($myrow["quote"],2,'.',',');?>'>
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" />
 <input type="hidden" name="artName" value="<?php echo $myrow["ArtName"]; ?>" />
 <input type="hidden" name="artCode" value="<?php echo $myrow["ItemCode"]; ?>" />
 <input type="hidden" name="artSize" value="<?php echo $myrow["Size"]; ?>" />
 <input type="hidden" name="customerEmail" value="<?php echo $myrow["Email"]; ?>" />
 <input type="hidden" name="customerName" value="<?php echo $myrow["Name"]; ?>" />
 
 <input type="hidden" name="artistbeImg" value="<?php echo $artBeImg ?>" />
 <input onClick="return confirm('Are you sure you want to Send this Quote?')" type='submit' NAME='sendQuote_<?php echo $myrow["clientID"];?>' value='Send Quote' ></form>
 </div>
  <br />
 <?php echo "Sales Rep Comment: " . $myrow["comments_internal"] . "<br><br>"; ?>
   <form name="add_comment_<?php echo $myrow["clientID"];?>" action="add-comment-size-only.php" method="post">
 <textarea rows="3" cols="20" name='comments_int'> <?php echo $myrow["comments_internal"]; ?> </textarea><br />
 
 Status: &nbsp;
 <?php
  $current_status = $myrow["status_custom_size"];
 $result1 = mysql_query ("SELECT * FROM `status-custom-size` ORDER BY `statusid` ASC ");
  echo "<select name=\"status\">\r";
  if ($row2 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row2["status"] == $current_status)
 		  $selected="selected";
    print "<option $selected value=\"" . $row2["status"]."\">" . $row2["status"]."\r";
 	 } while($row2 = mysql_fetch_array($result1));
 }
 ?>
 
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" /><br />
 <input onClick="return confirm('Are you sure you want to add this comment?')" type='submit' NAME='addComment_<?php echo $myrow["clientID"];?>' value='Edit Comment' ></form> <br />
 <a href="saleOrder.php?source=customSize&customerID=<?php echo $myrow["clientID"]; ?>"><img title="New Order" alt="Make an Order" align="right" src="images/cart_add.png" border="0"/></a>
 <a href="saleOrder.php?source=customSize&customerID=<?php echo $myrow["clientID"]; ?>">Make an Order</a> <br /><br /> 
 <a href="javascript:GlobalPopUp('https://overstockart.net/communicator/addSpecialOrder.php?sOrderNum=<?=$myrow["Name"];?>-quote&customerName=<?=$myrow["Name"];?>&size=<?=$myrow["Size"];?>&partUS=<?=$myrow["ItemCode"];?>&artName<?=$myrow["ArtName"];?>',550,400);">Request a Quote</a>
 </font> </p></td>
 <?php
 }
 else
 {
 ?>
 <form name="send_quote_<?php echo $myrow["clientID"];?>" action="send-quote.php" method="post">
 Add message in email: <br />
 <textarea rows="5" cols="20" name='Message'></textarea><br />
 <input type='text' size='5' name='price' value='0'>
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" />
 <input type="hidden" name="artName" value="<?php echo $myrow["ArtName"]; ?>" />
 <input type="hidden" name="artCode" value="<?php echo $myrow["ItemCode"]; ?>" />
 <input type="hidden" name="artSize" value="<?php echo $myrow["Size"]; ?>" />
 <input type="hidden" name="customerEmail" value="<?php echo $myrow["Email"]; ?>" />
 <input type="hidden" name="customerName" value="<?php echo $myrow["Name"]; ?>" />
 
  <input type="hidden" name="artistbeImg" value="<?php echo $artBeImg ?>" />
 <input onClick="return confirm('Are you sure you want to Send this Quote?')" type='submit' NAME='sendQuote_<?php echo $myrow["clientID"];?>' value='Send Quote' ></form>
 <br />
 <?php echo "Sales Rep Comment: " . $myrow["comments_internal"] . "<br><br>"; ?>
   <form name="add_comment_<?php echo $myrow["clientID"];?>" action="add-comment-size-only.php" method="post">
 <textarea rows="3" cols="20" name='comments_int'> <?php echo $myrow["comments_internal"]; ?> </textarea> <br />
 Status: &nbsp;
 <?php
  $current_status = $myrow["status_custom_size"];
 $result1 = mysql_query ("SELECT * FROM `status-custom-size` ORDER BY `statusid` ASC");
  echo "<select name=\"status\">\r";
  if ($row2 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row2["status"] == $current_status)
 		  $selected="selected";
    print "<option $selected value=\"" . $row2["status"]."\">" . $row2["status"]."\r";
 	 } while($row2 = mysql_fetch_array($result1));
 }
 ?>
 
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" /><br />
 <input onClick="return confirm('Are you sure you want to add this comment?')" type='submit' NAME='addComment_<?php echo $myrow["clientID"];?>' value='Edit Comment' ></form> <br />
 
 </font> </p></td>
 <?php } ?>
 
   </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_vip_report($result) {
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <a href="index.php?customeremail=<?php echo $myrow["Email"]; ?>&opstatus=customeremailsearch&customeremailsearch=Search" target="_blank"><?php echo $myrow["Name"]; ?></a> </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <?php echo $myrow["Email"]; ?> </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <a href="index.php?customeremail=<?php echo $myrow["Email"]; ?>&opstatus=customeremailsearch&customeremailsearch=Search" target="_blank"><?php echo $myrow["worth"]; ?> </a></p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <a href="index.php?customeremail=<?php echo $myrow["Email"]; ?>&opstatus=customeremailsearch&customeremailsearch=Search" target="_blank"><?php echo $myrow["phone_worth"]; ?> </a></p></td>
 <td>
 <p style="margin-left: 10; margin-right: 10">  
 <?php echo $myrow["totalWorth"]; ?> </p>
 </td> 
   </tr>
 <?php
 	}
 }
 ?>
 <?php 
 function display_frames_bucket_report($resultunique) {
 // Loop Thru Records
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase2, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <?php echo $myrow["option"]; ?> </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <a href="https://www.overstockart.com/<?php echo $myrow["productid"]; ?>.html" target="_blank"><?php echo $myrow["productcode"]; ?></a></p></td>
 <?php 
 $query4 = "SELECT SubDeptName4 FROM catalogcity WHERE CatalogSK= '" . $myrow["productcode"] . "' LIMIT 1;";
 		$sizeQ = mysql_query($query4);
 		$row = mysql_fetch_array($sizeQ, MYSQL_NUM);
 		$size = $row[0];
 ?>
 <td>
 <p style="margin-left: 10; margin-right: 10">  
 <?php echo $size; ?> </p>
 </td> 
 <td>
 <p style="margin-left: 10; margin-right: 10">  
 <?php echo $myrow["cnt"]; ?> </p>
 </td> 
   </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_coupon_bucket_report($resultunique) {
 // Loop Thru Records
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase2, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <?php echo $myrow["option"]; ?> </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
<?php echo $myrow["orderid"]; ?></a></p></td>
 <?php 
 /*$query4 = "SELECT SubDeptName4 FROM catalogcity WHERE CatalogSK= '" . $myrow["productcode"] . "' LIMIT 1;";
 		$sizeQ = mysql_query($query4);
 		$row = mysql_fetch_array($sizeQ, MYSQL_NUM);
 		$size = $row[0];*/
 ?>
 <td>
 <p style="margin-left: 10; margin-right: 10">  
 <?php echo $myrow["sum"]; ?> </p>
 </td> 
 <td>
 <p style="margin-left: 10; margin-right: 10">  
 <?php echo $myrow["cnt"]; ?> </p>
 </td> 
   </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_custom_size_report($result) {
 // Loop Thru Records
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <?php echo $myrow["Name"]; ?> <br>
 <a href="mailto:<?php echo $myrow["Email"]; ?> " > <?php echo $myrow["Email"]; ?> </a><br />
 <?php echo $myrow["phone"]; ?><br>
 </font>
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 ADDRESS:<BR>
 <?php  if(isset($myrow["Address1"])) echo $myrow["Address1"] . "<br>" ;
        if(isset($myrow["Address2"])) echo $myrow["Address2"] . "<br>";
  	   if(isset($myrow["City"])) echo $myrow["City"] . ", "; 
        if(isset($myrow["State"])) echo $myrow["State"]; 
 	   if(isset($myrow["Zip"])) echo $myrow["Zip"]; 
 	 ?>
 <br><br>
 DATE: <?php echo $myrow["Date"]; ?> 
 </font> 
 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($myrow["ArtName"])) echo $myrow["ArtName"] . "<br>"; 
        if(isset($myrow["ItemCode"])) echo "P/N: " . $myrow["ItemCode"] . "<br>"; 
 	   if(isset($myrow["Size"])) echo "Last Size Request: " .$myrow["Size"] . "<br>"; 
 	   echo "<a href=\"javascript:GlobalPopUp('custom_size_bucket.php?artid=". $myrow['ItemCode'] . "',400,300);\" style=\"color:#293b74; text-decoration:underline; font-size:10;\">Custom Request Count: " . $myrow["cnt"] . "</a><br>";
 	   ?>
 </font> 
 </td> 
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["ItemCode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["ItemCode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["ItemCode"] . ".jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else
 {
 echo "<img src=\"" . $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 ?>
 </td> 
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php if ($myrow["sent-quote"] == 1)
 {
 ?>
 Quote Given: <?php echo number_format($myrow["quote"],2,'.',','); 
 ?> <br /> <input name="group1" onclick="changeDiv('send_quote_<?php echo $myrow["clientID"];?>','block');" type="radio">Give a New Quote?</a><br />
 <br />
 <div id="send_quote_<?php echo $myrow["clientID"];?>" style="margin-left: 10px; display:none;">
 <form name="send_quote_<?php echo $myrow["clientID"];?>" action="send-quote.php" method="post">
 <input type='text' size='5' name='price' value='<?php echo number_format($myrow["quote"],2,'.',',');?>'>
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" />
 <input type="hidden" name="artName" value="<?php echo $myrow["ArtName"]; ?>" />
 <input type="hidden" name="artCode" value="<?php echo $myrow["ItemCode"]; ?>" />
 <input type="hidden" name="artSize" value="<?php echo $myrow["Size"]; ?>" />
 <input type="hidden" name="customerEmail" value="<?php echo $myrow["Email"]; ?>" />
 <input type="hidden" name="customerName" value="<?php echo $myrow["Name"]; ?>" />
 <input onClick="return confirm('Are you sure you want to Send this Quote?')" type='submit' NAME='sendQuote_<?php echo $myrow["clientID"];?>' value='Send Quote' ></form>
 </div>
 <a href="saleOrder.php?source=customSize&customerID=<?php echo $myrow["clientID"]; ?>"><img title="New Order" alt="Make an Order" align="right" src="images/cart_add.png" border="0"/></a>
 <a href="saleOrder.php?source=customSize&customerID=<?php echo $myrow["clientID"]; ?>">Make an Order</a>
 </font> </p></td>
 <?php
 }
 else
 {
 ?>
 <form name="send_quote_<?php echo $myrow["clientID"];?>" action="send-quote.php" method="post">
 <input type='text' size='5' name='price' value='0'>
 <input type="hidden" name="clientID" value="<?php echo $myrow["clientID"]; ?>" />
 <input type="hidden" name="artName" value="<?php echo $myrow["ArtName"]; ?>" />
 <input type="hidden" name="artCode" value="<?php echo $myrow["ItemCode"]; ?>" />
 <input type="hidden" name="artSize" value="<?php echo $myrow["Size"]; ?>" />
 <input type="hidden" name="customerEmail" value="<?php echo $myrow["Email"]; ?>" />
 <input type="hidden" name="customerName" value="<?php echo $myrow["Name"]; ?>" />
 <input onClick="return confirm('Are you sure you want to Send this Quote?')" type='submit' NAME='sendQuote_<?php echo $myrow["clientID"];?>' value='Send Quote' ></form>
 </font> </p></td>
 <?php } ?>
   </tr>
 <?php } 
 }
 ?>
 <?php function display_decor_help_data($result) {
 // Loop Thru Records
  while($row = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
  <td width="10%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <?php if($row["Date"] != "") echo "Date: " . $row["Date"] . "<br>"; ?> 
 <?php echo $row["Name"]; ?> 
 </font> 
 </td> 
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="mailto:<?php echo $row["Email"]; ?> " ><?php echo $row["Email"]; ?> </a><br />
 <?php echo $row["Phone"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $row['Email'];?>&phone=<?= $row["Phone"];?>&table=decor',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $row['Email'];?>&table=decor',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $row["Email"];?>&table=decor&thread=<?= $row["clientID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $row["Email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>


 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <?php  if(isset($row["Room"])) echo "Room: " . $row["Room"] . "<br>" ;
        if(isset($row["Color"])) echo "<table><tr><td bgcolor=\"" .$row["Clr"] . "\"> Wall Color..." .  $row["Color"] . "</td></tr></table><br>";
  	   if(isset($row["Width"])) echo "Width: " . $row["Width"]; 
        if(isset($row["Height"])) echo " Height: " . $row["Height"]; 
 	   ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($row["Style"])) echo "Style: " . $row["Style"] . "<br>";
        if(isset($row["Subject"])) echo "Subject: " .$row["Subject"] . "<br>";
        if(isset($row["Artist"])) echo "Artist: " .$row["Artist"] . "<br>";
 	   if(isset($row["ItemCode"])) echo "Looking at: <a href=\"https://www.overstockart.com/" . strtolower($row["ItemID"]) . ".html\" target=_blank>" . $row["ArtName"] . " - " . $row["ItemCode"] . "</a><br>";
        ?>
 </font>
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php if(isset($row["Comments"])) echo $row["Comments"];
        ?>
 </font>
 </td> 
   <td width="10%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo $row["Date"]; ?> 
 <BR /><BR />
 <a href="delete.php?op=deletedecor&id=<?php echo $row["PrimaryID"]; ?>" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
 </font> 
 </td> 
  <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php if ($row["sent"] == 1)
 {
 ?>
 Contacted: <br />
 <?php 
 echo $row["rep_comments"]; 
 ?> 
 </font> </p></td>
 <?php
 }
 else
 {
 ?>
 <form name="send_quote_<?php echo $row["PrimaryID"];?>" action="write-comment-decor.php" method="post">
 <textarea rows="5" cols="20" name='comment'></textarea>
 <input type="hidden" name="primary" value="<?php echo $row["PrimaryID"]; ?>" />
 <input onClick="return confirm('Are you sure you want to Add Comment?')" type='submit' NAME='sendComment_<?php echo $row["PrimaryID"];?>' value='Enter Comment and Close' ></form>
 </font> </p></td>
 <?php } ?>
 </tr>
 <?php 
 }
 }
 ?>
 <?php function display_custom_size_list($result) {
 // Loop Thru Records
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="50%" height="21">
 <font face="Verdana" size="1">
 <?php echo $myrow["Size"]; ?> <br>
 </font>
 </td>
 <td width="50%" height="21">
 <font face="Verdana" size="1"> 
 <?php  
 if(isset($myrow["cnt"])) echo $myrow["cnt"] ;   
 	 ?>
 </td> 
   </tr>
 <?php } 
 }
 ?>
 <?php function display_custom_size_bucket($result) {
 // Loop Thru Records
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="50%" height="21">
 <font face="Verdana" size="1">
 <?php echo $myrow["Size"]; ?> <br>
 </font>
 </td>
 <td width="50%" height="21">
 <font face="Verdana" size="1"> 
 <?php  
 if(isset($myrow["cnt"])) echo $myrow["cnt"] ;   
 	 ?>
 </td>
   </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_cart_data($result,$tax,$shipMethod,$shipCost,$coupon,$couponCode,$couponType,$storeCredit) {
  $storeCredit1 = $storeCredit;
  $couponCode1 = $couponCode;
  $couponType1 = $couponType;
  include ("config.php");
  
 // Loop Thru Records
 $total = 0;
 $count=1;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <script language="javascript" type="text/javascript">
 function updateScanFramingField<?=$count?>()
{
    var string=document.getElementById("framing<?=$count?>").options[document.getElementById("framing<?=$count?>").selectedIndex].innerHTML;  
    var broken_string=string.split(" - ");
    var special_price=broken_string[broken_string.length-1];
    document.getElementById("framingPrice<?=$count?>").value=parseFloat(special_price).toFixed(2);
}
</script>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a href="cart.php?op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a>
 </font><br />
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["itemName"] . "<br>" ;
        echo $myrow["itemNumber"] . "<br>";
     echo $myrow["size"]; 
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primary"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primary"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primary"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="cart.php" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo number_format($myrow["subTotal"],2,'.',','); ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php
 if ($myrow["customOrder"] == '1')
 {
 ?>
 Frame: <input size="10" type="text" name="framing<?=$count?>" value="<?php echo $myrow["framing"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
 <?php
 }
 else
 {
	$dbDatabase2 = "yaaris_sorter";
	$sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
	or die("Couldn't connect to database server"); 
	$dConn = mysql_select_db($dbDatabase2, $sConn) 
	or die("Couldn't connect to database $dbDatabase");
	//20x24
	if($myrow["size"] == '55')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '20X24') || (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,6)) = '20X24P') || (LEFT(`SKU`,3) = 'GAL' AND UPPER(RIGHT(`SKU`,5)) = '18X22') || (`SKU` = 'STR-SVC20X24') || (`SKU` = 'STR-SVC') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
	<?php
	}//30x40
	else if($myrow["size"] == '53')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '30X40') || (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,6)) = '30X40P') || (`SKU` = 'GALWRP28X38') || (`SKU` = 'STR-SVC30X40') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	}//36x48
	else if($myrow["size"] == '57')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '36X48') || (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,6)) = '36X48P') || (`SKU` = 'GALWRP34X46') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	}//24x36
	else if($myrow["size"] == '52')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '24X36') || (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,6)) = '24X36P') || (`SKU` = 'GALWRP22X34') || (`SKU` = 'STR-SVC24X36')  ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	} //8x10
	else if($myrow["size"] == '54')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,4)) = '8X10') || (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '8X10P') || (`SKU` = 'GALWRP6X8') || (`SKU` = 'STR-SVC8X10') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	} //24x24
	else if($myrow["size"] == '56')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '24X24') || (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,6)) = '24X24P') || (`SKU` = 'GALWRP22X22') || (`SKU` = 'STR-SVC24X24') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	} //16x20
	else if($myrow["size"] == '51')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '16X20') || (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,6)) = '16X20P') || (`SKU` = 'GALWRP14X18') || (`SKU` = 'STR-SVC16X20') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	}
	else
	 {
	 ?>
	 Frame: <input size="10" type="text" name="framing<?=$count?>" value="<?php echo $myrow["framing"]; ?>" /><br />
	 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
	 <?php
	 }
 }
	$sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
	or die("Couldn't connect to database server"); 
	$dConn = mysql_select_db($dbDatabase, $sConn) 
	or die("Couldn't connect to database $dbDatabase");
 ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["subTotal"] + $myrow["framingPrice"]);
 echo number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateCount" value="<?= $count?>" /> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php 
  $count++;
 } 
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 if ($couponType1 > 0)
 {
 $totalCoupon = $total - $coupon;
 $checkD = "checked";
 $checkP = "";
 $discountAmount = $coupon;
 }
 else
 {
 $checkP = "checked";
 $checkD = "";
 $totalCoupon = $total*(100-$coupon)/100;
 $discountAmount = $total*$coupon/100;
 }
 echo "<tr><form name=\"updateCoupon\" action=\"cart.php\" method=\"post\"><td COLSPAN=\"8\">APPLY COUPON CODE: <input size=\"5\" type=\"text\" name=\"couponCode\" value=\"" . $couponCode1 . "\" /> &nbsp; &nbsp; COUPON VALUE: <input size=\"5\" type=\"text\" name=\"couponUpdate\" value=\"" . number_format($coupon,2,'.',',') . "\" /> &nbsp; &nbsp; <input name=\"couponType\" value= \"0\" type=\"radio\" $checkP> % OFF &nbsp;&nbsp; <input name=\"couponType\" value= \"1\" type=\"radio\" $checkD> $ OFF &nbsp;&nbsp; <input type='submit' NAME='updateCoupon' value='update' ></form>";
 if ($coupon > 0) 
 {
 echo "<BR><B style=\"COLOR:RED;\">Coupon code: $couponCode1 for "; 
 if ($couponType1 > 0) echo "$" . $coupon; 
 else echo $coupon . "%";
 echo " off applied successfully! Total after coupon: $" . number_format($totalCoupon,2,'.',',') . " Discounted amount: $" . $discountAmount . "</B>";
 }
 echo "</td></tr>";
 $totalShip = $totalCoupon + $shipCost; //calculate cost of items with shippment
 echo "<tr><form name=\"updateShip\" action=\"cart.php\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 $addTax = $totalShip*$tax - $totalShip;
 echo "<tr><td COLSPAN=\"8\">TAX (7.5% Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 $totalOrder = $totalShip + $addTax - $storeCredit1;  //remove tax and add the ship cost 
 echo "<tr><form name=\"updateStoreCredit\" action=\"cart.php\" method=\"post\"><td COLSPAN=\"8\">Store Credit: <input size=\"5\" type=\"text\" name=\"storeCredit\" value=\"" . $storeCredit1 . "\" /> &nbsp;<input type='submit' NAME='updateStoreCredit' value='update' ></form>";
 if ($storeCredit1 > 0) echo " <B style=\"COLOR:RED;\">Total after $" . number_format($storeCredit1,2,'.',',') . " Store credit: $" . number_format($totalOrder,2,'.',',') . "</B>";
 echo "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 <?php 
 function display_cart_add_data($result) {
 include ("config.php");
 // Loop Thru Records
 $total = 0;
 $count = 1;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <script language="javascript" type="text/javascript">
 function updateScanFramingField<?=$count?>()
{
    var string=document.getElementById("framing<?=$count?>").options[document.getElementById("framing<?=$count?>").selectedIndex].innerHTML;  
    var broken_string=string.split(" - ");
    var special_price=broken_string[broken_string.length-1];
    document.getElementById("framingPrice<?=$count?>").value=parseFloat(special_price).toFixed(2);
}
</script>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a href="cart-add.php?orderid=<?= $myrow["orderID"]; ?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["itemName"] . "<br>" ;
        echo $myrow["itemNumber"] . "<br>";
  	    echo $myrow["size"]; 
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primary"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primary"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primary"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="cart-add.php?orderid=<?= $myrow["orderID"]; ?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo number_format($myrow["subTotal"],2,'.',','); ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php
 if ($myrow["customOrder"] == '1')
 {
 ?>
 Frame: <input size="10" type="text" name="framing<?=$count?>" value="<?php echo $myrow["framing"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
 <?php
 }
 else
 {
	$dbDatabase2 = "yaaris_sorter";
	$sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
	or die("Couldn't connect to database server"); 
	$dConn = mysql_select_db($dbDatabase2, $sConn) 
	or die("Couldn't connect to database $dbDatabase");
	//20x24
	if($myrow["size"] == '55')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '20X24') || (`SKU` = 'GALWRP20X24') || (`SKU` = 'STR-SVC20X24') || (`SKU` = 'STR-SVC') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
	<?php
	} //30x40
	else if($myrow["size"] == '53')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '30X40') || (`SKU` = 'GALWRP30X40') || (`SKU` = 'STR-SVC30X40') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	} //16x20
	else if($myrow["size"] == '51')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '16X20') || (`SKU` = 'GALWRP16X20') || (`SKU` = 'STR-SVC16X20') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	} //36x48
	else if($myrow["size"] == '57')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '36X48') || (`SKU` = 'GALWRP36X48') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	} //24x36
	else if($myrow["size"] == '52')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '24X36') || (`SKU` = 'GALWRP20X24') || (`SKU` = 'GALWRP24X36') || (`SKU` = 'STR-SVC24X36')  ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	} //8x10
	else if($myrow["size"] == '54')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,4)) = '8X10') || (`SKU` = 'STR-SVC8X10') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	} //24x24
	else if($myrow["size"] == '56')
	{
		$result1 = mysql_query ("SELECT * FROM `opencart-inventory` WHERE (LEFT(`SKU`,3) = 'FR-' AND UPPER(RIGHT(`SKU`,5)) = '24X24') || (`SKU` = 'GALWRP24X24') || (`SKU` = 'STR-SVC24X24') ORDER BY SalePrice ASC, SKU DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["SKU"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["SKU"] ."\">" . $row["SKU"] . " - " . $row["Name"] . " - " . $row["SalePrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	}
	else
	 {
	 ?>
	 Frame: <input size="10" type="text" name="framing<?=$count?>" value="<?php echo $myrow["framing"]; ?>" /><br />
	 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
	 <?php
	 }
 }
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
	or die("Couldn't connect to database server"); 
	$dConn = mysql_select_db($dbDatabase, $sConn) 
	or die("Couldn't connect to database $dbDatabase");
 ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["subTotal"] + $myrow["framingPrice"]);
 echo number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <input type="hidden" name="updateCount" value="<?= $count?>" /> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php 
 		$count++;
		 } 
 }
 ?>
 
 <?php 
 function display_cart_site_add_data($result) {
 include ("config.php");
 // Loop Thru Records
 $total = 0;
 $count = 1;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <script language="javascript" type="text/javascript">
 function updateScanFramingField<?=$count?>()
{
    var string=document.getElementById("framing<?=$count?>").options[document.getElementById("framing<?=$count?>").selectedIndex].innerHTML;  
    var broken_string=string.split(" - ");
    var special_price=broken_string[broken_string.length-1];
    document.getElementById("framingPrice<?=$count?>").value=parseFloat(special_price).toFixed(2);
}
</script>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a href="cart-site-add.php?orderid=<?= $myrow["orderID"]; ?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["itemName"] . "<br>" ;
        echo $myrow["itemNumber"] . "<br>";
  	    echo $myrow["size"]; 
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primary"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primary"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primary"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="cart-site-add.php?orderid=<?= $myrow["orderID"]; ?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo number_format($myrow["subTotal"],2,'.',','); ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php
 if ($myrow["customOrder"] == '1')
 {
 ?>
 Frame: <input size="10" type="text" name="framing<?=$count?>" value="<?php echo $myrow["framing"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
 <?php
 }
 else
 {
	$dbDatabase2 = "yaaris_sorter";
	$sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
	or die("Couldn't connect to database server"); 
	$dConn = mysql_select_db($dbDatabase2, $sConn) 
	or die("Couldn't connect to database $dbDatabase");
	
	if($myrow["size"] == 'Classic 20" X 24"' || $myrow["size"] == 'Classic 20"X24"')
	{
		$result1 = mysql_query ("SELECT * FROM `catalogcity` WHERE (LEFT(`CatalogSK`,3) = 'FR-' AND UPPER(RIGHT(`CatalogSK`,5)) = '20X24') || (`CatalogSK` = 'GALWRP20X24') || (`CatalogSK` = 'STR-SVC20X24') || (`CatalogSK` = 'STR-SVC') ORDER BY SpecialPrice ASC, CatalogSK DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["CatalogSK"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["CatalogSK"] ."\">" . $row["CatalogSK"] . " - " . $row["Ordertext"] . " - " . $row["SpecialPrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
	<?php
	}
	else if($myrow["size"] == 'Extra Large 30" X 40"' || $myrow["size"] == 'Extra Large 30"X40"')
	{
		$result1 = mysql_query ("SELECT * FROM `catalogcity` WHERE (LEFT(`CatalogSK`,3) = 'FR-' AND UPPER(RIGHT(`CatalogSK`,5)) = '30X40') || (`CatalogSK` = 'GALWRP30X40') || (`CatalogSK` = 'STR-SVC30X40') ORDER BY SpecialPrice ASC, CatalogSK DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["CatalogSK"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["CatalogSK"] ."\">" . $row["CatalogSK"] . " - " . $row["Ordertext"] . " - " . $row["SpecialPrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	}
	else if($myrow["size"] == 'Extra Large 36" X 48"' || $myrow["size"] == 'Extra Large 36"X48"')
	{
		$result1 = mysql_query ("SELECT * FROM `catalogcity` WHERE (LEFT(`CatalogSK`,3) = 'FR-' AND UPPER(RIGHT(`CatalogSK`,5)) = '36X48') || (`CatalogSK` = 'GALWRP36X48') ORDER BY SpecialPrice ASC, CatalogSK DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["CatalogSK"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["CatalogSK"] ."\">" . $row["CatalogSK"] . " - " . $row["Ordertext"] . " - " . $row["SpecialPrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	}
	else if($myrow["size"] == 'Large 24" X 36"' || $myrow["size"] == 'Large 24"X36"')
	{
		$result1 = mysql_query ("SELECT * FROM `catalogcity` WHERE (LEFT(`CatalogSK`,3) = 'FR-' AND UPPER(RIGHT(`CatalogSK`,5)) = '24X36') || (`CatalogSK` = 'GALWRP20X24') || (`CatalogSK` = 'GALWRP24X36') || (`CatalogSK` = 'STR-SVC24X36')  ORDER BY SpecialPrice ASC, CatalogSK DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["CatalogSK"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["CatalogSK"] ."\">" . $row["CatalogSK"] . " - " . $row["Ordertext"] . " - " . $row["SpecialPrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	}
	else if($myrow["size"] == 'Small 8"X10"' || $myrow["size"] == 'Small 8X10' || $myrow["size"] == 'Small 8" X 10"')
	{
		$result1 = mysql_query ("SELECT * FROM `catalogcity` WHERE (LEFT(`CatalogSK`,3) = 'FR-' AND UPPER(RIGHT(`CatalogSK`,4)) = '8X10') || (`CatalogSK` = 'STR-SVC8X10') ORDER BY SpecialPrice ASC, CatalogSK DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["CatalogSK"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["CatalogSK"] ."\">" . $row["CatalogSK"] . " - " . $row["Ordertext"] . " - " . $row["SpecialPrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	}
	else if($myrow["size"] == 'Square 24" X 24"' || $myrow["size"] == 'Square 24"X24"')
	{
		$result1 = mysql_query ("SELECT * FROM `catalogcity` WHERE (LEFT(`CatalogSK`,3) = 'FR-' AND UPPER(RIGHT(`CatalogSK`,5)) = '24X24') || (`CatalogSK` = 'GALWRP24X24') || (`CatalogSK` = 'STR-SVC24X24') ORDER BY SpecialPrice ASC, CatalogSK DESC;");
		echo "Frame: <select id=\"framing" . $count . "\" name=\"framing" . $count . "\" style=\"border: 1px solid rgb(127, 157, 185); margin: 0px; padding: 0px; font-size: 9px; width: 225px; height: 17px; background-color: rgb(255, 255, 160);\" border=\"0\" tabindex=\"7\" onchange=\"updateScanFramingField" . $count . "()\">\r<option value=\"\">No Frame - 0.00\r";
		if ($row = mysql_fetch_array($result1)) {
		do {
			 if ($myrow["framing"] == $row["CatalogSK"]) $selected = "selected";
			 else $selected = "" ;
		 print "<option $selected value=\"" . $row["CatalogSK"] ."\">" . $row["CatalogSK"] . " - " . $row["Ordertext"] . " - " . $row["SpecialPrice"] . "\r";
			 } while($row = mysql_fetch_array($result1));
		  }
		  echo "</select>";
		?>
		 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" id="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
		 <?php
	}
	else
	 {
	 ?>
	 Frame: <input size="10" type="text" name="framing<?=$count?>" value="<?php echo $myrow["framing"]; ?>" /><br />
	 Frame Price: <input size="5" type="text" name="framingPrice<?=$count?>" value="<?php echo number_format($myrow["framingPrice"],2,'.',','); ?>" />
	 <?php
	 }
 }
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
	or die("Couldn't connect to database server"); 
	$dConn = mysql_select_db($dbDatabase, $sConn) 
	or die("Couldn't connect to database $dbDatabase");
 ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["subTotal"] + $myrow["framingPrice"]);
 echo number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <input type="hidden" name="updateCount" value="<?= $count?>" /> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php 
 		$count++;
		 } 
 }
 ?>
 
 <?php 
 function total_vieworder($result,$tax,$shipMethod,$shipCost,$coupon,$couponCode,$couponType,$orderNum,$storeCredit) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
 $subTotal = $myrow["qty"] * ($myrow["subTotal"] + $myrow["framingPrice"]);
 //echo $subTotal; 
 $total += $subTotal;
   } 
 if ($total != 0)
 {
		if ($couponType > 0)
		{
		$totalCoupon = $total - $coupon;
		$checkD = "checked";
		$checkP = "";
		}
		else
		{
		$checkP = "checked";
		$checkD = "";
		$totalCoupon = $total*(100-$coupon)/100;
		}
	
    $totalShip = $totalCoupon + $shipCost; 
 	$addTax = $totalShip*$tax - $totalShip;
	
 	$totalOrder = $totalShip + $addTax - $storeCredit; // + $shipCost;  
 	}
 	else 
 	{ 
 	 $totalOrder = 0;
 	}
 	return $totalOrder;
 }
 ?>
 
 <?php 
 function display_vieworder_data_return_index($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 $subTotal = 0;
 while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$orderNum = $myrow["orderid"];
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <?php 
 if ($myrow["typeOrder"] == '1')
 { ?>
 <a onClick="return confirm('Are you sure you want to delete this return?')" href="viewOrder.php?orderid=<?php echo $orderNum;?>&op=deleteReturn&key=<?php echo $myrow["returnid"]; ?>">[cancel return]</a><br /><br />
 <a href="rma-edit.php?orderid=<?= $orderNum;?>&orderType=1&item=<?= $myrow["productid"]; ?>&return=<?= $myrow["returnid"]; ?>">[edit return]</a>
 </font>
 </p>
 <?php
 }
 else
 {
 ?>
 <a onClick="return confirm('Are you sure you want to delete this return?')" href="viewOrderDetails.php?orderid=<?php echo $orderNum;?>&op=deleteReturn&key=<?php echo $myrow["returnid"]; ?>">[cancel return]</a><br /><br />
 <a href="rma-edit.php?orderid=<?= $orderNum;?>&orderType=0&item=<?= $myrow["productid"]; ?>&return=<?= $myrow["returnid"]; ?>">[edit return]</a>
 </font>
 </p>
 <?php
 }
 ?>
 </td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo "Order #: " . $orderNum . "<br>";
 if ($myrow["typeOrder"] == '1')
 {
 $result2 = mysql_query("SELECT * FROM `manual_orders` WHERE `orderid` = '" . $orderNum . "' LIMIT 1;");
 while($myrow2 = mysql_fetch_array($result2))
 {
        $name = $myrow2["billName"];
        $email = $myrow2["email"];
 	   $thread = $myrow2["primary"];
 	   $phone = $myrow2["billPhone"];
 }
 $result1 = mysql_query("SELECT * FROM `manual_order_items` WHERE `primary` = '" . $myrow["productid"] . "' LIMIT 1;");
 while($myrow1 = mysql_fetch_array($result1))
 {
        echo $myrow1["itemName"] . "<br>" ;
        echo $myrow1["itemNumber"] . "<br>";
  	   echo $myrow1["size"] . "<br>"; 	   
 	   echo "qty: " . $myrow["quantity"];
 	  // echo "qty: " . $myrow1["qty"] . "<br>";
 ?>
 <br><br>
 DATE: <?php echo $myrow["date"]; ?> 
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $email;?>&phone=<?= $phone;?>&table=manual_orders',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $email;?>&table=manual_orders&thread=<?=  $thread;?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $email;?>&table=manual_orders&thread=<?=  $thread;?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $email;?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow1["specialImage"] == '1')
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow1["orderID"] . "-" . $myrow1["primaryCart"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow1["orderID"] . "-" . $myrow1["primaryCart"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow1["orderID"] . "-" . $myrow1["primaryCart"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow1["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow1["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow1["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 }
 }
 else
 {
 $result2 = mysql_query("SELECT * FROM `orders` WHERE `orderid` = '" . $orderNum . "' LIMIT 1;");
 while($myrow2 = mysql_fetch_array($result2))
 {
        $name = $myrow2["billName"];
        $email = $myrow2["email"];
 	   $thread = $myrow2["primary"];
 	   $phone = $myrow2["billPhone"]; 
 }
 $result1 = mysql_query("SELECT * FROM `items` WHERE `primary` = '" . $myrow["productid"] . "' LIMIT 1;");
 while($myrow1 = mysql_fetch_array($result1))
 {
        echo $myrow1["productcode"] . "<br>" ;
        echo $myrow1["qty"] . "<br>";
 ?>
 <br><br>
 DATE: <?php echo $myrow["date"]; ?> 
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $email;?>&phone=<?= $phone;?>&table=orders&thread=<?=  $thread;?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $email;?>&table=orders',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $email;?>&table=orders&thread=<?=  $thread;?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $email;?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>
 </font> 

 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow1["productcode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow1["productcode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow1["productcode"] . ".jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 }
 }
 ?>
 </td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1">
 <?php echo "<b>Type Return: " . $myrow["typeReturn"] . "</b><br>"; ?>
 <?php echo "Refund: " . $myrow["refund"] . "<br>"; ?>
 <?php echo "RMA #: " . $myrow["rma"] . "<br>"; ?>
 <?php echo "Call Tag #: " . $myrow["callTag"] . "<br>"; ?>
 <?php echo "<br>Tracking #: " . "<a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>" . "<br><br>"; ?>
 <?php echo "<b>Status: " . $myrow["rmaStatus"] . "</b>"; ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Description: <?php echo $myrow["description"]; ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 Solution: <?php echo $myrow["solution"]; ?>
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo "Condition of Return: " . $myrow["condition"] . "<br>"; ?>
 <?php 
 /* echo "Claim Status: " . $myrow["claimStatus"] . "<br>"; 
  echo "Claim Amount: " . $myrow["claimAmount"] . "<br>"; */
  ?>
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 if($myrow["creditAmount"] > 0)
 {
 echo "In Store Credit: <br><b style=\"color:#ae0011;\">" . "$" . number_format($myrow["creditAmount"],2,'.',',') . "</b><br><br>"; 
 }
 
 if ($myrow["refund"] > $myrow["paidAmount"])
 {
 $total = $myrow["refund"] - $myrow["paidAmount"];
 $sign = "money down -";
 }
 else
 {
 $total = $myrow["paidAmount"] - $myrow["paidAmount"];
 $sign = "money ahead +";
 }
 echo "Refund: <br>" .  "$" . number_format($myrow["refund"],2,'.',',') . "<br><br>"; 
 /*echo "Claimed: <br>" . $myrow["claimAmount"] . "<br><br>";
 echo "Claimed Paid: <br>" . $myrow["paidAmount"] . "<br><br>";*/
 echo "Total: <br>" . $sign .  "$" . number_format($total,2,'.',',') . "<br>";
  ?>
 </font></p></td>
   </tr>
 <?php }
 }
 ?>
 <?php 
 function display_vieworder_data_return_items($resultunique,$orderNum2) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 $subTotal = 0;
 while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 
 if ($myrow["typeOrder"] == '1')
 { ?>
 <a onClick="return confirm('Are you sure you want to delete this return?')" href="viewOrder.php?orderid=<?php echo $orderNum2;?>&op=deleteReturn&key=<?php echo $myrow["returnid"]; ?>">[cancel return]</a><br /><br />
 <a href="rma-edit.php?orderid=<?= $orderNum2;?>&orderType=1&item=<?= $myrow["productid"]; ?>&return=<?= $myrow["returnid"]; ?>">[edit return]</a>
 </font>
 </p>
 <?php
 }
 else if ($myrow["typeOrder"] == '2')
 { ?>
 <a onClick="return confirm('Are you sure you want to delete this return?')" href="viewOrderDetails.php?orderid=<?php echo $orderNum2;?>&op=deleteReturn&key=<?php echo $myrow["returnid"]; ?>">[cancel return]</a><br /><br />
 <a href="rma-edit.php?orderid=<?= $orderNum2;?>&orderType=2&item=<?= $myrow["productid"]; ?>&return=<?= $myrow["returnid"]; ?>">[edit return]</a>
 </font>
 </p>
 <?php
 }
 else
 {
 ?>
 <a onClick="return confirm('Are you sure you want to delete this return?')" href="viewOrderDetails.php?orderid=<?php echo $orderNum2;?>&op=deleteReturn&key=<?php echo $myrow["returnid"]; ?>">[cancel return]</a><br /><br />
 <a href="rma-edit.php?orderid=<?= $orderNum2;?>&orderType=0&item=<?= $myrow["productid"]; ?>&return=<?= $myrow["returnid"]; ?>">[edit return]</a>
 </font>
 </p>
 <?php
 }
 
 
  $rmaStatus = $myrow["rmaStatus"];
 echo "<br><b style=\"color:#AE0011;\">Status: " . $rmaStatus . "</b>";
 ?>
 </td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo "Order #: " . $myrow["orderid"] . "<br>";
 if ($myrow["typeOrder"] == '1')
 {
 $result1 = mysql_query("SELECT * FROM `manual_order_items` WHERE `primary` = '" . $myrow["productid"] . "' LIMIT 1;");
	 while($myrow1 = mysql_fetch_array($result1))
	 {
			echo $myrow1["itemName"] . "<br>" ;
			echo $myrow1["itemNumber"] . "<br>";
		   echo $myrow1["size"] . "<br>"; 	   
		   echo "qty: " . $myrow["quantity"];
		  // echo "qty: " . $myrow1["qty"] . "<br>";
	 ?>
	 <br><br>
	 DATE: <br><?php echo $myrow1["date"]; ?> 
	 </font> 
	 </td> 
	 <td width="20%" height="21" align="center"> 
	 <p style="margin-left: 10; margin-right: 10"> 
	 <?php 
	 if ($myrow1["specialImage"] == '1')
	 {
	 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow1["orderID"] . "-" . $myrow1["primaryCart"] . ".gif";
	 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow1["orderID"] . "-" . $myrow1["primaryCart"] . ".jpg";
	 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow1["orderID"] . "-" . $myrow1["primaryCart"] . ".jpg";
	 }
	 else
	 {
	 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow1["itemNumber"] . ".gif";
	 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow1["itemNumber"] . ".jpg";
	 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow1["itemNumber"] . ".jpg";
	 }
	 if (url_exists($image_file_jpg))
	 {
	 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
	 }
	 else if (url_exists($image_file_gif))
	 {
	 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
	 }
	 else
	 {
	 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
	 }
	 }
 }
 else if ($myrow["typeOrder"] == '2')
 {
 $result1 = mysql_query("SELECT * FROM `order_add_items` WHERE `primary` = '" . $myrow["productid"] . "' LIMIT 1;");
	 while($myrow1 = mysql_fetch_array($result1))
	 {
			echo $myrow1["itemName"] . "<br>" ;
			echo $myrow1["itemNumber"] . "<br>";
		   echo $myrow1["size"] . "<br>"; 	   
		   echo "qty: " . $myrow1["qty"];
		  // echo "qty: " . $myrow1["qty"] . "<br>";
	 ?>
	 <br><br>
	 DATE: <br><?php echo $myrow1["orderDate"]; ?> 
	 </font> 
	 </td> 
	 <td width="20%" height="21" align="center"> 
	 <p style="margin-left: 10; margin-right: 10"> 
	 <?php 
	 if ($myrow1["specialImage"] == '1')
	 {
	 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow1["orderID"] . "-" . $myrow1["primaryCart"] . ".gif";
	 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow1["orderID"] . "-" . $myrow1["primaryCart"] . ".jpg";
	 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow1["orderID"] . "-" . $myrow1["primaryCart"] . ".jpg";
	 }
	 else
	 {
	 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow1["itemNumber"] . ".gif";
	 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow1["itemNumber"] . ".jpg";
	 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow1["itemNumber"] . ".jpg";
	 }
	 if (url_exists($image_file_jpg))
	 {
	 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
	 }
	 else if (url_exists($image_file_gif))
	 {
	 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
	 }
	 else
	 {
	 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
	 }
	 }
 }
 else
 {
 $result1 = mysql_query("SELECT * FROM `items` WHERE `primary` = '" . $myrow["productid"] . "' LIMIT 1;");
 while($myrow1 = mysql_fetch_array($result1))
 {
        echo $myrow1["productcode"] . "<br>" ;
        echo $myrow1["qty"] . "<br>";
 ?>
 <br><br>
 DATE: <br><?php echo $myrow["date"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow1["productcode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow1["productcode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow1["productcode"] . ".jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 }
 }
 ?>
 </td>
   <td width="25%" height="21"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1">
 <?php echo "<b>Type Return:</b> " . $myrow["typeReturn"] . "<br>"; ?>
 <?php echo "<b>Refund:</b> " . $myrow["refund"] . "<br>"; ?>
 <?php echo "<b>RMA #:</b> " . $myrow["rma"] . "<br>"; ?>
 <?php echo "<b>Call Tag #:</b> " . $myrow["callTag"] . "<br>"; ?>
 <?php echo "<br><b>Tracking #:</b> " . "<a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>" . "<br><br>"; ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <b>Description:</b> <?php echo $myrow["description"]; ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <b>Solution:</b> <?php echo $myrow["solution"]; ?>
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo "<b>Condition of Return:</b> " . $myrow["condition"] . "<br>"; ?>
 <?php 
 /*echo "<b>Claim Status:</b> " . $myrow["claimStatus"] . "<br>"; 
 echo "<b>Claim Amount:</b> " . $myrow["claimAmount"] . "<br>"; */
 ?>
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 if($myrow["creditAmount"] > 0)
 {
 echo "In Store Credit: <br><b style=\"color:#ae0011;\">" . "$" . number_format($myrow["creditAmount"],2,'.',',') . "</b><br><br>"; 
 }
 if ($myrow["refund"] > $myrow["paidAmount"])
 {
 $total = $myrow["refund"] - $myrow["paidAmount"];
 $sign = "money down -";
 }
 else
 {
 $total = $myrow["paidAmount"] - $myrow["paidAmount"];
 $sign = "money ahead +";
 }
 echo "<b>Refund:</b> <br>" . "$" . number_format($myrow["refund"],2,'.',',') . "<br>"; 
 /*echo "<b>Claimed:</b> <br>" . $myrow["claimAmount"] . "<br>";
 echo "<b>Claimed Paid:</b> <br>" . $myrow["paidAmount"] . "<br>";*/
 echo "<b>Total:</b> <br>" . $sign . "$" . number_format($total,2,'.',',') . "<br>";
   ?>
 </font></p></td>
   </tr>
 <?php }
 }
 ?>
 
 <?php 
 function display_vieworder_data_added_return($result) {
 $subTotal = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewOrderDetails.php?orderid=<?= $myrow["orderID"];?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $myrow["orderID"];?>&orderType=2&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["itemName"] . "<br>" ;
        echo $myrow["itemNumber"] . "<br>";
  	    echo $myrow["size"]; 
 ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["subTotal"]; ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame:<?php echo $myrow["framing"]; ?><br />
 Frame Price: <?php echo $myrow["framingPrice"]; ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["qty"]; ?>
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["subTotal"] + $myrow["framingPrice"]);
 echo "$" . number_format($subTotal,'2','.',','); 
 ?>
 </font></p></td>
   </tr>
 <?php }
 }
 ?>
 
 <?php 
 function display_vieworder_data_return($result,$orderNum) {
 $subTotal = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewOrder.php?orderid=<?php echo $orderNum;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderNum;?>&orderType=1&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["itemName"] . "<br>" ;
        echo $myrow["itemNumber"] . "<br>";
  	    echo $myrow["size"]; 
 ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["subTotal"]; ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame:<?php echo $myrow["framing"]; ?><br />
 Frame Price: <?php echo $myrow["framingPrice"]; ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["qty"]; ?>
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["subTotal"] + $myrow["framingPrice"]);
 echo "$" . number_format($subTotal,'2','.',','); 
 ?>
 </font></p></td>
   </tr>
 <?php }
 }
 ?>
 <?php 
 function display_vieworder_data($result,$tax,$shipMethod,$shipCost,$coupon,$couponCode,$couponType,$orderNum,$storeCredit) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewOrder.php?orderid=<?php echo $orderNum;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderNum;?>&orderType=1&item=<?= $myrow["primary"]; ?>">[return]</a>
 <br /><br />
 <?php
if ($myrow["primaryF"] != "")
{
?>
<b style="color:#AE0011;">In Fullfilment:</b>
<?php
}
else
{
?>
<b style="color:#AE0011;">Not In Fullfilment:</b>
<?php
}
?>
 <form name="recordUpdate<?= $myrow["primary"]; ?>" id="recordUpdate<?= $myrow["primary"]; ?>" onsubmit="return false;">
            <?php
$result1 = mysql_query ("SELECT * FROM `status-fullfilment` ORDER BY `statusid` ASC");
 echo "<select name=\"status1\" id=\"status1\">\r";
 if ($srow = mysql_fetch_array($result1)) {
   do {
    $selected = "" ;
     if ($srow["status"] == $myrow["status"])
		  $selected="selected";
   print "<option $selected value=\"" . $srow["status"] ."\">" . $srow["status"]."\r";
	 } while($srow = mysql_fetch_array($result1));
 }
?></select>
   <input type="hidden" name="fullID" id="fullID" value="<?= $myrow["primaryF"]; ?>" />
   <input type="hidden" name="itemID" id="itemID" value="<?= $myrow["primary"]; ?>" />
   <input style="padding:0px; margin:0px;" type="submit" value="update" onClick="sendRequest('recordUpdate<?= $myrow["primary"]; ?>')" align="right">
  </form>
    <div id="show<?= $myrow["primary"]; ?>" style="color:#AE0011; font-weight:bold;"></div>
 </font>
 
 <?php  
 if ($myrow["trackingItem"] == "")
 {
 echo "<form name=\"addTrack\" action=\"viewOrder.php?orderid=". $orderNum ."\" method=\"post\">";
 echo "<input type=\"text\" name=\"updateTrackItem\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"itemID\" value=\"" . $myrow["primary"] . "\">";
 echo "<input type='submit' NAME='updateTrackingItem' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br>Tracking #<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["trackingItem"] . "\">" . $myrow["trackingItem"] . "</a>";
 echo "<br><button onclick=\"javascript:GlobalPopUp('sendTrackingEmailItem.php?orderid=". $orderNum ."&itemID=" . $myrow["primary"] . "',550,400);\">Send Tracking</button>";
 }
 ?>
 </td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["itemName"] . "<br>" ;
        echo $myrow["itemNumber"] . "<br>";
  	    echo $myrow["size"]; 
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewOrder.php?orderid=<?php echo $orderNum;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["subTotal"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["framing"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framingPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["subTotal"] + $myrow["framingPrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Tracking #: <br />
   <input size="15" type="text" name="trackingItem" value="<?php echo  $myrow["trackingItem"]; ?>" /><br /><br />
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='Update Item' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-add.php?orderid=" . $orderNum . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 if ($couponType > 0)
 {
 $totalCoupon = $total - $coupon;
 $checkD = "checked";
 $checkP = "";
 $discountAmount = $coupon;
 }
 else
 {
 $checkP = "checked";
 $checkD = "";
 $totalCoupon = $total*(100-$coupon)/100;
 $discountAmount = $total*$coupon/100;
 }
 echo "<tr><td COLSPAN=\"8\"><form name=\"updateCoupon\" action=\"viewOrder.php?orderid=$orderNum\" method=\"post\">APPLY COUPON CODE: <input size=\"5\" type=\"text\" name=\"couponCode\" value=\"" . $couponCode . "\" /> &nbsp; &nbsp; COUPON VALUE: <input size=\"5\" type=\"text\" name=\"couponUpdate\" value=\"" . number_format($coupon,2,'.',',') . "\" /> &nbsp; &nbsp; <input name=\"couponType\" value= \"0\" type=\"radio\" $checkP> % OFF &nbsp;&nbsp; <input name=\"couponType\" value= \"1\" type=\"radio\" $checkD> $ OFF &nbsp;&nbsp; <input type='submit' NAME='updateCoupon' value='update' ></form>";
 if ($coupon > 0) 
 {
 echo "<BR><B style=\"COLOR:RED;\">Coupon code: $couponCode for "; 
 if ($couponType > 0) echo "$" . $coupon;
 else echo $coupon . "%";
 echo " off applied successfully! Total after coupon: $" . number_format($totalCoupon,2,'.',',') . " Discounted amount: $" . number_format($discountAmount,2,'.',',');
 }
 echo "</td></tr>";
 $totalShip = $totalCoupon + $shipCost; //add ship cost to total after coupon
 echo "<tr><td COLSPAN=\"8\"><form name=\"updateShip\" action=\"viewOrder.php?orderid=$orderNum\" method=\"post\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 $addTax = $totalShip*$tax - $totalShip;
 $totalAfterTax = $totalShip + $addTax;
  if ($tax == "1.075") 
  {
  $taxString = "7.5%";
  $checkTax = "checked";
  $checkNoTax = "";
  }
 else 
 {
	 $taxString = "7.5%";
	 $checkNoTax = "checked";
	 $checkTax = "";
 }
 
 echo "<tr><td COLSPAN=\"8\"><form name=\"updateTax\" action=\"viewOrder.php?orderid=$orderNum\" method=\"post\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',');
 echo "&nbsp;&nbsp; Update Tax: &nbsp; <input name=\"storeTax\" value=\"1.00\" type=\"radio\" $checkNoTax > 0% &nbsp;&nbsp; <input name=\"storeTax\" value= \"1.075\" type=\"radio\" $checkTax > 7.5% &nbsp;&nbsp; <input type='submit' NAME='updateTax' value='update' ></form>";
 echo "</td></tr>";
 
 $totalOrder = $totalAfterTax - $storeCredit; //remove store credit from total after coupon
 echo "<tr><td COLSPAN=\"8\"><form name=\"updateStoreCredit\" action=\"viewOrder.php?orderid=$orderNum\" method=\"post\">Store Credit: <input size=\"5\" type=\"text\" name=\"storeCredit\" value=\"" . $storeCredit . "\" /> &nbsp;<input type='submit' NAME='updateStoreCredit' value='update' ></form>";
 if ($storeCredit > 0) echo " <B style=\"COLOR:RED;\">Total after $" . number_format($storeCredit,2,'.',',') . " Store credit: $" . number_format($totalOrder,2,'.',',') . "</B>";
 echo "</td></tr>";
// $totalOrder = $totalStoreCredit + $addTax; // + $shipCost;  //remove tax and add the ship cost 
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_tada_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewTadaOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewTadaOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-tada-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewTadaOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_btr_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewBTROrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewBTROrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-btr-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewBTROrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 <?php 
 function display_myhabit_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewMyhabitOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewMyhabitOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-myhabit-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewMyhabitOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
<?php 
 function display_amazonv_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewAmazonvOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td>
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10">
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center">
 <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1">
 <form name="update" action="viewMyhabitOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-myhabit-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewAmazonvOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_hautelook_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewHautelookOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewHautelookOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-hautelook-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewHautelookOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 
 <?php 
 function display_kohls_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewKohlsOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a><br /><br />
 <a href="../sorter/kohls-item-label.php?sku=<?= $myrow["SKU"];?>">[print UPC label]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewKohlsOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-kohls-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewKohlsOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_woot_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewWootOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a><br /><br />
 Ship ID: <br /><?php echo $myrow["shipID"];?>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewWootOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-woot-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewWootOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 <?php 
 function display_zulily_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewZulilyOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo date("Y-m-d",$myrow["orderDate"]); ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewZulilyOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-zulily-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewZulilyOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 <?php 
 function display_groupon_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewGrouponOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: 
 <?php echo date("F j, Y",$myrow["orderDate"]); ?>
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewGrouponOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-groupon-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewGrouponOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 <?php 
 function display_amazonDropShip_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewAmazonDropShipOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: 
 <?php echo date("F j, Y",$myrow["orderDate"]); ?>
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewAmazonDropShipOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-amazonDropShip-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewAmazonDropShipOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 <?php 
 function display_wayfair_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewWayfairOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewWayfairOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-wayfair-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewWayfairOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
  <?php 
 function display_opensky_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewOpenskyOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewOpenskyOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-opensky-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewOpenskyOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
  <?php 
 function display_houzz_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewHouzzOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewHouzzOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-houzz-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewHouzzOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
  <?php 
 function display_franklinmint_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewFranklinmintOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewFranklinmintOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-franklinmint-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewFranklinmintOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 
  <?php 
 function display_rue_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewRueOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewRueOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-rue-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewRueOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 
  <?php 
 function display_sams_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewSamsOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewSamsOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-sams-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewSamsOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
  <?php 
 function display_macys_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewMacysOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewMacysOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-macys-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewMacysOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
  <?php 
 function display_homedepot_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewHomedepotOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewHomedepotOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-homedepot-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewHomedepotOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 
  <?php 
 function display_lowes_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewLowesOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewLowesOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-lowes-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewLowesOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 
 <?php 
 function display_overstock_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewOverstockOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewOverstockOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-overstock-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewOverstockOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
  <?php 
 function display_overstockm_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewOverstockMOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <form name="update" action="viewOverstockMOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <p style="margin-left: 10; margin-right: 10"> 
  <?php  echo $myrow["Title"] . "<br>" ;  ?>
 <font face="Verdana" size="1"> 
 SKU: <input size="10" type="text" name="SKU" value="<?php echo $myrow["SKU"]; ?>" /><br />
 Art SKU: <input size="5" type="text" name="artSKU" value="<?php echo $myrow["artSKU"]; ?>" />
 </font></p>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-overstockm-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewOverstockMOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 
 <?php 
 function display_AAA_vieworder_data($result,$tax,$shipMethod,$shipCost,$orderID) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewAAAOrder.php?orderid=<?php echo $orderID;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
 <a href="rma.php?orderid=<?= $orderID;?>&orderType=T&item=<?= $myrow["primary"]; ?>">[return]</a>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["Title"] . "<br>" ;
        echo $myrow["SKU"];
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewAAAOrder.php?orderid=<?php echo $orderID;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["artPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["frameSKU"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framePrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 echo "<tr><td COLSPAN=\"8\" align=center><a href=\"cart-AAA-add.php?orderid=" . $orderID . "\">[add items to order]</a></td></tr>";
 if ($total != 0)
 {
 echo "<tr><td COLSPAN=\"8\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 echo "<tr><form name=\"updateShip\" action=\"viewAAAOrder.php?orderid=$orderID\" method=\"post\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): <input size=\"5\" type=\"text\" name=\"costShip\" value=\"" . $shipCost . "\" /> &nbsp;<input type='submit' NAME='updateShip' value='update' ></form>";
 if ($shipCost > 0) echo " Total including $" . number_format($shipCost,2,'.',',') . " Shipping cost: $" . number_format($totalShip,2,'.',',');
 echo "</td></tr>";
 
 $totalOrder = $total + $Tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($tax,2,'.',',') . "</td></tr>";
 echo "<tr><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 }
 else 
 { 
  $totalOrder = 0;
 }
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_vieworder_site_added($result,$orderNum) {
 // Loop Thru Records
 $total = 0;
 $subTotal = 0;
  while($myrow = mysql_fetch_array($result))
   {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a onClick="return confirm('Are you sure you want to delete this item?')" href="viewOrderDetails.php?orderid=<?php echo $orderNum;?>&op=delete&key=<?php echo $myrow["primary"]; ?>">[remove]</a><br /><br />
  <a href="rma.php?orderType=2&item=<?= $myrow["primary"]; ?>">[return]</a>
  
  <br /><br />
 <?php
if ($myrow["primaryF"] != "")
{
?>
<b style="color:#AE0011;">In Fullfilment:</b>
<?php
}
else
{
?>
<b style="color:#AE0011;">Not In Fullfilment:</b>
<?php
}
?>
 <form name="recordUpdateAdd<?= $myrow["primary"]; ?>" id="recordUpdateAdd<?= $myrow["primary"]; ?>" onsubmit="return false;">
            <?php
$result1 = mysql_query ("SELECT * FROM `status-fullfilment` ORDER BY `statusid` ASC");
 echo "<select name=\"status1\" id=\"status1\">\r";
 if ($srow = mysql_fetch_array($result1)) {
   do {
    $selected = "" ;
     if ($srow["status"] == $myrow["status"])
		  $selected="selected";
   print "<option $selected value=\"" . $srow["status"] ."\">" . $srow["status"]."\r";
	 } while($srow = mysql_fetch_array($result1));
 }
?></select>
   <input type="hidden" name="fullID" id="fullID" value="<?= $myrow["primaryF"]; ?>" />
   <input type="hidden" name="itemID" id="itemID" value="<?= $myrow["primary"]; ?>" />
   <input style="padding:0px; margin:0px;" type="submit" value="update" onClick="sendRequestAdd('recordUpdateAdd<?= $myrow["primary"]; ?>')" align="right">
  </form>
    <div id="show<?= $myrow["primary"]; ?>" style="color:#AE0011; font-weight:bold;"></div>
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  echo $myrow["itemName"] . "<br>" ;
        echo $myrow["itemNumber"] . "<br>";
  	    echo $myrow["size"]; 
  ?>
 <br><br>
 Date Ordered: <?php echo $myrow["orderDate"]; ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
   <td width="25%" height="21" align="center"> 
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <form name="update" action="viewOrderDetails.php?orderid=<?php echo $orderNum;?>" method="post">
 <input size="5" type="text" name="unitPrice" value="<?php echo $myrow["subTotal"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <input size="10" type="text" name="framing" value="<?php echo $myrow["framing"]; ?>" /><br />
 Frame Price: <input size="5" type="text" name="framingPrice" value="<?php echo $myrow["framingPrice"]; ?>" />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input size="5" type="text" name="qty" value="<?php echo $myrow["qty"]; ?>" />
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["subTotal"] + $myrow["framingPrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <input type="hidden" name="updateItem" value="<?php echo $myrow["primary"]; ?>" />
 <input type='submit' NAME='update' value='update' ></form>
 </font> </p>
 </td>
   </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_confirm_data($result,$tax,$shipMethod,$shipCost,$coupon,$couponCode,$couponType,$storeCredit) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["itemName"] . "<br>" ;
 echo $myrow["itemNumber"] . "<br>";
 echo $myrow["size"]; 
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 if ($myrow["customOrder"] == '1')
 echo "CUSTOM ORDER";
 else echo "IN STOCK ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg. "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> <?php echo $myrow["subTotal"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["framing"]; ?><br />
 Frame Price: <?php echo $myrow["framingPrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["subTotal"] + $myrow["framingPrice"]);
 echo $subTotal; 
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 if ($couponType > 0)
 {
 $totalCoupon = $total - $coupon;
 $discountAmount = $coupon;
 }
 else
 {
 $totalCoupon = $total*(100-$coupon)/100;
 $discountAmount = $total*$coupon/100;
 }
 if ($coupon > 0) 
 {
 echo "<tr align=\"right\"><td COLSPAN=\"8\"><B style=\"COLOR:RED;\">Coupon code: $couponCode for "; 
 if ($couponType > 0) echo "$" . $coupon; 
 else echo $coupon . "%";
 echo " off applied successfully! Total after coupon: $" . number_format($totalCoupon,2,'.',',') . " Discounted amount: $" . number_format($discountAmount,2,'.',',');
 echo "</td></tr>";
 }
 $totalShip = $totalCoupon + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 $addTax = $totalShip*$tax - $totalShip;
 if ($tax == "1.075") $taxString = "7.5%"; 
 else $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 $totalOrder = $totalShip + $addTax - $storeCredit; //remove store credit from total after coupon
 if ($storeCredit > 0) 
 {
 echo "<tr align=\"right\"><td COLSPAN=\"8\"><B style=\"COLOR:RED;\">Total after $" . $storeCredit . " Store Credit: $" . $totalOrder . "</B>"; 
 echo "</td></tr>";
 }
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_tada_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "TaDa.com ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',','); 
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_hautelook_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Hautelook ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_kohls_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Kohls ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_woot_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Woot Order";
 ?> 
  <br /><br /><?php echo $myrow["shipID"];?>
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 <?php 
 function display_zulily_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Zulily ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
<?php 
 function display_groupon_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo date("F j, Y",$myrow["orderDate"]); ?>
 <br /><br />
 <?php 
 echo "Groupon ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
<?php 
 function display_amazonDropShip_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo date("F j, Y",$myrow["orderDate"]); ?>
 <br /><br />
 <?php 
 echo "Amazon Drop Ship ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 <?php 
 function display_wayfair_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Wayfair ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_opensky_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Opensky ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
  <?php 
 function display_houzz_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Houzz ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
  <?php 
 function display_franklinmint_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Franklinmint ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?> 
 
 <?php 
 function display_rue_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Rue La La ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_sams_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Sams Club ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_macys_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Macys ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 
 
 <?php 
 function display_homedepot_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Home Depot ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 
 <?php 
 function display_lowes_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Home Depot ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 
  <?php 
 function display_overstock_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Overstock ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_overstockm_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Overstock.com Marketplace ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 
 <?php 
 function display_AAA_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "AAA ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_btr_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "BTR ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 <?php 
 function display_myhabit_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Myhabit ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0) 
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_amazonv_invoice_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "AMAZON ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 ?>
 </td>
 <td width="25%" height="21" align="center"> <p style="margin-left:10; margin-right:10px;">
 <font face="Verdana" size="1"> <?php echo $myrow["artPrice"]; ?>
 </font></p></td>
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?><br />
 Frame Price: <?php echo $myrow["framePrice"]; ?></font></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="25%" height="21">
 <p style="margin-left: 10; margin-right: 10">
 <font face="Verdana" size="1">
 <?php
 $subTotal = $myrow["qty"] * ($myrow["artPrice"] + $myrow["framePrice"]);
 echo "$" . number_format($subTotal,2,'.',',');
 $total += $subTotal;
 ?>
 </font></p></td>
   </tr>
 <?php 
 } 
 echo "<tr align=\"right\"><td COLSPAN=\"8\" align=\"right\">SUB TOTAL: $" . number_format($total,2,'.',',') . "</td></tr>";
 
 $totalShip = $total + $shipCost; //calculate cost of items with shippment
 echo "<tr align=\"right\"><td COLSPAN=\"8\">SHIPPING (" . $shipMethod . "): $" . $shipCost;
 if ($shipCost > 0)
 {
 echo " Total including shipping cost: $" . number_format($totalShip,2,'.',',');
 }
 echo "</td></tr>";
 //echo "Total = " . $total . " Tax = " . $tax . " ship cost = " . $shipCost;
 $totalOrder = $total + $tax + $shipCost;  //remove tax and add the ship cost 
 $taxString = "7.5%";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TAX (" . $taxString . " Kansas Only): $" . number_format($addTax,2,'.',',') . "</td></tr>";
 echo "<tr align=\"right\"><td COLSPAN=\"8\">TOTAL ORDER: $" . number_format($totalOrder,2,'.',',') . "</td></tr>";
 return $totalOrder;
 }
 ?>
 
 <?php 
 function display_tada_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "TaDa.com ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 <?php 
 function display_hautelook_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Hautelook ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 
 <?php 
 function display_kohls_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Kohls ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 
 <?php 
 function display_woot_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Woot Order";
 ?> 
 <br /><br /><?php echo $myrow["shipID"];?>
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 <?php 
 function display_zulily_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Zulily ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 <?php 
 function display_groupon_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo date("F j, Y",$myrow["orderDate"]); ?>
 <br /><br />
 <?php 
 echo "Groupon ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 <?php 
 function display_amazonDropShip_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo date("F j, Y",$myrow["orderDate"]); ?>
 <br /><br />
 <?php 
 echo "Amazon Drop Ship ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 <?php 
 function display_wayfair_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Wayfair ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
  <?php 
 function display_opensky_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Opensky ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
  <?php 
 function display_houzz_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Houzz ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
  <?php 
 function display_franklinmint_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Franklinmint ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 <?php 
 function display_fulfillment_packingslip_data($result,$source,$shipMethod) 
 {
 // Loop Thru Records
 $total = 0;
 $j = 1;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $dateOrder = date("D, M j Y",$myrow["orderDate"]); ?>
 <br /><br />
 <?php 
 echo $source;
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if(strpos($myrow["SKU"],"-") > 0 && substr($myrow["SKU"],0,3) != "FR-" && substr($myrow["SKU"],0,1) != "6" && substr($myrow["SKU"],0,1) != "U" && substr($myrow["SKU"],0,3) != "BVM" && substr($myrow["SKU"],0,3) != "STR")
	$image_unframed = substr($myrow["SKU"],0,strpos($myrow["SKU"],"-"));
 else $image_unframed = $myrow["SKU"];
 
 $image_file_unframed_jpg = "https://www.overstockart.net/sorter/search1/" . $image_unframed . ".jpg";
 $image_file_unframed_original = "https://www.overstockart.net/sorter/original/" . $image_unframed . ".jpg";
 if (file_exists("../sorter/overstock/" . $myrow["SKU"] . "_tn.jpg"))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 else if (file_exists("../sorter/search1/" . $image_unframed . ".jpg"))
 echo "<img src=\"" . $image_file_unframed_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
else if (file_exists("../sorter/original/" . $image_unframed . ".jpg"))
 echo "<img src=\"" . $image_file_unframed_original . "\" border=\"0\" hspace=\"3\" vspace=\"3\" style=\"max-width: 150px;\">";
else
echo $image_unframed;
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td >
 
 <div  class="itembarcode-image" id="itembarcode_<?php echo $myrow["primary"]; ?>" sourceType="<?php echo $myrow["primary"]; ?>" primaryId="<?php  echo $myrow["primary"]; ?>" orderId="<?php echo $myrow["orderID"]; ?>"></div>
 
 </td>  
   </tr>
 <?php 
 $j++;
 	} 
 }
 ?>
 
 <?php 
 function display_fulfillment_packingslip_station_data($result,$source,$shipMethod) 
 {
 // Loop Thru Records
 $total = 0;
 $j = 1;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $dateOrder = date("D, M j Y",$myrow["orderDate"]); ?>
 <br /><br />
 <?php 
 echo $source;
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if(strpos($myrow["SKU"],"-") > 0 && substr($myrow["SKU"],0,3) != "FR-" && substr($myrow["SKU"],0,1) != "6" && substr($myrow["SKU"],0,1) != "U" && substr($myrow["SKU"],0,3) != "BVM" && substr($myrow["SKU"],0,3) != "STR")
	$image_unframed = substr($myrow["SKU"],0,strpos($myrow["SKU"],"-"));
 else $image_unframed = $myrow["SKU"];
 
 $image_file_unframed_jpg = "https://www.overstockart.net/sorter/search1/" . $image_unframed . ".jpg";
 $image_file_unframed_original = "https://www.overstockart.net/sorter/original/" . $image_unframed . ".jpg";
 if (file_exists("../sorter/overstock/" . $myrow["SKU"] . "_tn.jpg"))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 else if (file_exists("../sorter/search1/" . $image_unframed . ".jpg"))
 echo "<img src=\"" . $image_file_unframed_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
else if (file_exists("../sorter/original/" . $image_unframed . ".jpg"))
 echo "<img src=\"" . $image_file_unframed_original . "\" border=\"0\" hspace=\"3\" vspace=\"3\" style=\"max-width: 150px;\">";
else
echo $image_unframed;
 ?>
 </td> 
 <td width="20%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="5%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 <td width="15%" height="21" align="center">
 
 <h3><?php 
if($myrow["stage"] != "")
 echo $myrow["stage"]; 
else echo "No stage set.";
?></h3>
 
 </td>  
   </tr>
 <?php 
 $j++;
 	} 
 }
 ?>
 
 <?php 
 function display_rue_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Rue La La ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 <?php 
 function display_sams_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Sams Club ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 <?php 
 function display_macys_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Macys ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 <?php 
 function display_homedepot_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Home Depot ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 
 <?php 
 function display_lowes_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Home Depot ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 
 <?php 
 function display_overstock_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Overstock ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 <?php 
 function display_overstockm_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Marketplace Order";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 <?php 
 function display_AAA_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "AAA ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 <?php 
 function display_btr_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php 
 echo date('D, M j Y',strtotime($myrow["orderDate"])); 
 //echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "BTR ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 <?php 
 function display_myhabit_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php 
 echo date('D, M j Y',$myrow["orderDateTime"]); 
 //echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Myhabit ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
  <?php 
 function display_amazonv_packingslip_data($result,$tax,$shipMethod,$shipCost) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["Title"] . "<br>" ;
 echo $myrow["SKU"];
  ?>
 <br><br>
 DATE: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 echo "Amazon Vendor ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_jpg = "https://www.overstockart.net/sorter/overstock/" . $myrow["SKU"] . "_tn.jpg";
 if (url_exists($image_file_jpg))
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["frameSKU"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 	} 
 }
 ?>
 
 <?php 
 function display_packingslip_data($result,$tax,$shipMethod,$shipCost,$coupon) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["itemName"] . "<br>" ;
 echo $myrow["itemNumber"] . "<br>";
 echo $myrow["size"]; 
  ?>
 <br><br>
 DATE ORDERED: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 if ($myrow["customOrder"] == '1')
 echo "CUSTOM ORDER";
 else echo "IN STOCK ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["framing"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 } 
 }
 ?>
 
<?php 
 function display_packingslip_return_data($result,$tax,$shipMethod) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
/* echo $myrow["itemName"] . "<br>" ;*/
 echo $myrow["productcode"] . "<br>";
/* echo $myrow["size"]; */
  ?>
 <br /><br />
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["productcode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["productcode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["productcode"] . ".jpg";
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
 </tr>
 <?php 
 } 
 }
 ?>
 
 
 <?php 
 function display_packingslip_data_com($result,$tax,$shipMethod,$shipCost,$coupon) 
 {
 // Loop Thru Records
 $total = 0;
 while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  
 echo $myrow["itemName"] . "<br>" ;
 echo "<br>";
 echo $myrow["size"]; 
  ?>
 <br><br>
 DATE ORDERED: <?php echo $myrow["orderDate"]; ?>
 <br /><br />
 <?php 
 if ($myrow["customOrder"] == '1')
 echo "CUSTOM ORDER";
 else echo "IN STOCK ORDER";
 ?> 
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["specialImage"] == '1')
 {
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["paintingImage"];
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".gif";
 $image_file_jpg2 = "https://www.overstockart.net/sorter/upresent/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["orderID"] . "-" . $myrow["primaryCart"] . ".jpg";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["itemNumber"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["itemNumber"] . ".jpg";
 }
 if (url_exists($image_file_jpg))
 {
 echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_jpg2))
 {
 echo "<img src=\"" . $image_file_jpg2 . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else if (url_exists($image_file_gif))
 {
 echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 else
 {
 echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; 
 }
 ?>
 </td> 
 <td width="25%" height="21" align="center"> <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> Frame: <?php echo $myrow["framing"]; ?></p></td>
 <td width="25%" height="21" align="center"><p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> <?php echo $myrow["qty"]; ?></font></p></td>
   </tr>
 <?php 
 } 
 }
 ?>
 <?php 
 function display_catalog_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21"> 
 <?php echo $myrow["Name"]; ?> 
 </td> 
 <td width="20%" height="21"> 
 <a href="mailto:<?php echo $myrow["Email"]; ?>">
 <?php echo $myrow["Email"]; ?>
 </a> 
 </td> 
 <td width="20%" height="21"> 
 <?php echo $myrow["Address1"] . "<br> ";
     if(isset($myrow["Address2"])) echo $myrow["Address2"] . "<br>"; 
 	echo $myrow["City"] . ", "; 
 	echo $myrow["State"]; 
 	echo " " . $myrow["Zip"]; ?>
 </td> 
 <td width="20%" height="21"> 
 <?php echo $myrow["Date"]; ?> <br />
 <a href="saleOrder.php?source=catalog&customerID=<?php echo $myrow["clientID"]; ?>">Make an Order</a><BR />
 <a href="delete.php?op=deletecatalog&id=<?php echo $myrow["clientID"]; ?>" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
 </td>
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_corporate_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	
 	$status = $myrow["status"];
 	$rating = $myrow["rating"];
 				
 	$query4 = "SELECT color FROM status WHERE status= '" . $status . "';";
 		$status1 = mysql_query($query4);
 		$row = mysql_fetch_array($status1, MYSQL_NUM);
 		$status_color = $row[0];
 		
     $query5 = "SELECT color FROM rating WHERE rating= '" . $rating . "';";
 		$rating1 = mysql_query($query5);
 		$row = mysql_fetch_array($rating1, MYSQL_NUM);
 		$rating_color = $row[0];
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <a href="saleOrder.php?source=corporate&customerID=<?php echo $myrow["clientID"]; ?>"><img title="New Order" alt="Make an Order" align="right" src="images/cart_add.png" border="0"/></a>
 <font face="Verdana" size="1"> 
  <?php echo "<a href=\"viewLead.php?leadId=" . $myrow["clientID"] . "\"> <img title=\"Edit\" alt=\"Edit Lead\" align=\"LEFT\" src=\"images/28.png\" border=\"0\"/>" . $myrow["Name"] . "</a><br>";  
  if(isset($myrow["Title"])) echo "Title: " .$myrow["Title"] ;
  ?>
  <br /><br /><a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow['Email'];?>&phone=<?= $myrow["Telephone"];?>&table=corporate&thread=<?= $myrow["clientID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow['Email'];?>&table=corporate&thread=<?= $myrow["clientID"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["Email"];?>&table=corporate&thread=<?= $myrow["clientID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $myrow["Email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>
 
 </font> 
 </td>   
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="mailto:<?php echo $myrow["Email"]; ?> " ><?php echo $myrow["Email"]; ?> </a><br />
 <?php echo $myrow["Telephone"]; ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  if(isset($myrow["Address1"])) echo $myrow["Address1"] . "<br>" ;
        if(isset($myrow["Address2"])) echo $myrow["Address2"] . "<br>";
  	   if(isset($myrow["City"])) echo $myrow["City"] . ", "; 
        if(isset($myrow["State"])) echo $myrow["State"]; 
 	   if(isset($myrow["Zip"])) echo $myrow["Zip"] . "<br>"; 
        if(isset($myrow["Country"])) echo $myrow["Country"]; 
 	   ?>
 	   <br /><br />
  <?php if(isset($myrow["Company"])) echo "Company: " . $myrow["Company"] . "<br>";
        if(isset($myrow["Industry"])) echo "Industry: " .$myrow["Industry"] . "<br>";
 	   if(isset($myrow["URL"])) echo "Website: " .$myrow["URL"] ;
        ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["Note"]; ?>
 </font> 
 </td> 
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Date Added: <?php echo $myrow["Date"]; ?> <br /><br />
 <b style="color: <?php echo $status_color; ?>"><?php echo $myrow["status"]; ?></b><br />
 <b style="color: <?php echo $rating_color; ?>"><?php echo $myrow["rating"]; ?></b><br /><br />
 Last Date Contacted: <?php echo $myrow["LastDate"]; ?><br /><br />
 <a href="saleOrder.php?source=corporate&customerID=<?php echo $myrow["clientID"]; ?>">Make an Order</a>
  <?php  if($_SESSION['admin_username'] == "amitai" || $_SESSION['admin_username'] == "bparrott")
 { ?>
 <br /><br />
 <a href="delete.php?op=deletecorporate&id=<?php echo $myrow["clientID"]; ?>" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
   <?php } ?>
 </font> 
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_b2c_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	
 	$status = $myrow["status"];
 	$rating = $myrow["rating"];
 				
 	$query4 = "SELECT color FROM status WHERE status= '" . $status . "';";
 		$status1 = mysql_query($query4);
 		$row = mysql_fetch_array($status1, MYSQL_NUM);
 		$status_color = $row[0];
 		
     $query5 = "SELECT color FROM rating WHERE rating= '" . $rating . "';";
 		$rating1 = mysql_query($query5);
 		$row = mysql_fetch_array($rating1, MYSQL_NUM);
 		$rating_color = $row[0];
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <a href="saleOrder.php?source=b2c&customerID=<?php echo $myrow["clientID"]; ?>"><img title="New Order" alt="Make an Order" align="right" src="images/cart_add.png" border="0"/></a>
 <font face="Verdana" size="1"> 
  <?php echo "<a href=\"viewLeadB2C.php?leadId=" . $myrow["clientID"] . "\"> <img title=\"Edit\" alt=\"Edit Lead\" align=\"LEFT\" src=\"images/28.png\" border=\"0\"/>" . $myrow["Name"] . "</a><br>";  
  if(isset($myrow["Title"])) echo "Title: " .$myrow["Title"] ;
  ?>
  <br /><br /><a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow['Email'];?>&phone=<?= $myrow["Telephone"];?>&table=b2c&thread=<?= $myrow["clientID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow['Email'];?>&table=b2c&thread=<?= $myrow["clientID"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["Email"];?>&table=b2c&thread=<?= $myrow["clientID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $myrow["Email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>

 </font> 
 </td>   
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="mailto:<?php echo $myrow["Email"]; ?> " ><?php echo $myrow["Email"]; ?> </a><br />
 <?php echo $myrow["Telephone"]; ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  if(isset($myrow["Address1"])) echo $myrow["Address1"] . "<br>" ;
        if(isset($myrow["Address2"])) echo $myrow["Address2"] . "<br>";
  	   if(isset($myrow["City"])) echo $myrow["City"] . ", "; 
        if(isset($myrow["State"])) echo $myrow["State"]; 
 	   if(isset($myrow["Zip"])) echo $myrow["Zip"] . "<br>"; 
        if(isset($myrow["Country"])) echo $myrow["Country"]; 
 	   ?>
 	   <br /><br />
  <?php if(isset($myrow["Company"])) echo "Company: " . $myrow["Company"] . "<br>";
        if(isset($myrow["Industry"])) echo "Industry: " .$myrow["Industry"] . "<br>";
 	   if(isset($myrow["URL"])) echo "Website: " .$myrow["URL"] ;
        ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["Note"]; ?>
 </font> 
 </td> 
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Date Added: <?php echo $myrow["Date"]; ?> <br /><br />
 <b style="color: <?php echo $status_color; ?>"><?php echo $myrow["status"]; ?></b><br />
 <b style="color: <?php echo $rating_color; ?>"><?php echo $myrow["rating"]; ?></b><br /><br />
 Last Date Contacted: <?php echo $myrow["LastDate"]; ?><br /><br />
 <a href="saleOrder.php?source=b2c&customerID=<?php echo $myrow["clientID"]; ?>">Make an Order</a>
 <br /><br />
 <a href="delete.php?op=deleteb2c&id=<?php echo $myrow["clientID"]; ?>" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
 </font> 
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_account_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	
 	$status = $myrow["status"];
 //	$rating = $myrow["rating"];
 	$query4 = "SELECT color FROM status WHERE status= '" . $status . "';";
 		$status1 = mysql_query($query4);
 		$row = mysql_fetch_array($status1, MYSQL_NUM);
 		$status_color = $row[0];
 		
  /*   $query5 = "SELECT color FROM rating WHERE rating= '" . $rating . "';";
 		$rating1 = mysql_query($query5);
 		$row = mysql_fetch_array($rating1, MYSQL_NUM);
 		$rating_color = $row[0];*/
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
  <font face="Verdana" size="1"> 
  <?php echo "<a href=\"viewAccount.php?leadId=" . $myrow["accountID"] . "\"> <img title=\"Edit\" alt=\"Edit Lead\" align=\"LEFT\" src=\"images/28.png\" border=\"0\"/>" . $myrow["Company"] . "</a><BR><BR>Name: <a href=\"viewAccount.php?leadId=" . $myrow["accountID"] . "\">" . $myrow["Name"] . "</a><br>";  
  if(isset($myrow["Number"])) echo "Title: " .$myrow["Title"] . "<br>";
  if(isset($myrow["Number"])) echo "Account No.: " .$myrow["Number"] . "<br>";
  if(isset($myrow["Type"])) echo "Account Type: " .$myrow["Type"] ;
  ?>
  <br /><br /><a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow['Email'];?>&phone=<?= $myrow["Telephone"];?>&table=account&thread=<?= $myrow["accountID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow['Email'];?>&table=account&thread=<?= $myrow["accountID"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["Email"];?>&table=account&thread=<?= $myrow["accountID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $myrow["Email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>

 </font> 
 </td>   
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="mailto:<?php echo $myrow["Email"]; ?> " ><?php echo $myrow["Email"]; ?> </a><br />
 <?php echo $myrow["Telephone"]; ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  if(isset($myrow["Address1"])) echo $myrow["Address1"] . "<br>" ;
        if(isset($myrow["Address2"])) echo $myrow["Address2"] . "<br>";
  	   if(isset($myrow["City"])) echo $myrow["City"] . ", "; 
        if(isset($myrow["State"])) echo $myrow["State"]; 
 	   if(isset($myrow["Zip"])) echo $myrow["Zip"] . "<br>"; 
        if(isset($myrow["Country"])) echo $myrow["Country"]; 
 	   ?>
 	   <br /><br />
  <?php if(isset($myrow["Company"])) echo "Company: " . $myrow["Company"] . "<br>";
        if(isset($myrow["Industry"])) echo "Industry: " .$myrow["Industry"] . "<br>";
 	   if(isset($myrow["URL"])) echo "Website: " .$myrow["URL"] ;
        ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php  if(isset($myrow["ShippingLeadTime"])) echo "Shipping Lead Time: " . $myrow["ShippingLeadTime"] . "<br>";
        if(isset($myrow["ServiceRequestLeadTime"])) echo "Service Level Request Lead Time: " .$myrow["ServiceRequestLeadTime"] . "<br>";
 	   if(isset($myrow["ShippingMethod"])) echo "Shipping Method: " .$myrow["ShippingMethod"] . "<br>";
	   if(isset($myrow["ShippingAccount"])) echo "3rd Party Shipping Account: " .$myrow["ShippingAccount"] . "<br>";
	   if(isset($myrow["PaymentTerms"])) echo "<br>Payment Terms: " .$myrow["PaymentTerms"] . "<br>";
	   if(isset($myrow["Note"])) echo "Notes: " . $myrow["Note"]; ?>
 </font> 
 </td> 
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <a href="saleOrder.php?source=account&customerID=<?php echo $myrow["accountID"]; ?>"><img title="New Order" alt="Make an Order" align="right" src="images/cart_add.png" border="0"/></a>
 <font face="Verdana" size="1"> 
 Date Added: <?php echo $myrow["Date"]; ?> <br /><br />
 <b style="color: <?php echo $status_color; ?>"><?php echo $myrow["status"]; ?></b><br /><br />
 Last Date Contacted: <?php echo $myrow["LastDate"]; ?><br /><br />
 <a href="saleOrder.php?source=account&customerID=<?php echo $myrow["accountID"]; ?>">Make an Order</a>
 <br /><br />
 <a href="delete.php?op=deleteaccount&id=<?php echo $myrow["accountID"]; ?>" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
 </font> 
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
function addhttp($url) {
    if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
        $url = "https://" . $url;
    }
    return $url;
}
 function display_event_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	
 	$startDate= $myrow["DateStart"];
	$endDate= $myrow["DateEnd"];
	$now = time();
	
	if ($startDate > $now) $event_color = "#AE0011";
	else if ($endDate > $now) $event_color = "#0b4f04"; 
	else $event_color = "#000000";
 //	$rating = $myrow["rating"];
/* 	$query4 = "SELECT color FROM status WHERE status= '" . $status . "';";
 		$status1 = mysql_query($query4);
 		$row = mysql_fetch_array($status1, MYSQL_NUM);
 		$status_color = $row[0];*/
 		
  /*   $query5 = "SELECT color FROM rating WHERE rating= '" . $rating . "';";
 		$rating1 = mysql_query($query5);
 		$row = mysql_fetch_array($rating1, MYSQL_NUM);
 		$rating_color = $row[0];*/
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10; color:<?= $event_color; ?>;"> 
  <font face="Verdana" size="1"> 
  <?php echo "<a href=\"viewEvent.php?eventID=" . $myrow["eventID"] . "\">" . $myrow["Company"] . "</a><BR><BR>Event Name: <a href=\"viewEvent.php?eventID=" . $myrow["eventID"] . "\">" . $myrow["Name"] . "</a>";  
  ?>
  <br /><br />
 <?php  if($_SESSION['admin_username'] == "amitai" || $_SESSION['admin_username'] == "bparrott")
 { ?>
 <a href="delete.php?op=deleteevent&id=<?php echo $myrow["eventID"]; ?>" onclick="return confirm('Are you sure you want to delete the event?')">Delete Event</a>
 <?php } ?>
 &nbsp;|&nbsp;<a href="editEvent.php?eventID=<?php echo $myrow["eventID"]; ?>">Edit Event</a> &nbsp;|&nbsp;<a href="https://www.overstockart.net/communicator/on-event-countsheet.php?eventid=<?php echo $myrow["eventID"]; ?>" target="_blank">Count Sheets</a>
 <br />
 </font> 
 </td>   
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10; color:<?= $event_color; ?>;"> 
 <font face="Verdana" size="1">
 <?php
 if(isset($myrow["URL"])) echo "Website: <a href=\"" . addhttp($myrow["URL"]) . "\" target=\"_blank\">" . $myrow["URL"] . "</a><br>";
  if(isset($myrow["Type"])) 
  {
  $type = $myrow["Type"];
  
  	$query4 = "SELECT name FROM `phpc_categories` WHERE `catid`= '" . $type . "';";
 		$status1 = mysql_query($query4);
 		$row = mysql_fetch_array($status1, MYSQL_NUM);
 		$type_name = $row[0];
		
  echo "Event Type: " . $type_name ;
  }
  ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10; color:<?= $event_color; ?>;"> 
 <font face="Verdana" size="1">
 <?php 
 //echo $startDate;
 if(isset($myrow["DateStart"])) echo "Start: " . date("F j, Y",($startDate + 6*60*60)) . "<br>";
 if(isset($myrow["DateEnd"])) echo "End: " . date("F j, Y",($endDate + 6*60*60));
 ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10; color:<?= $event_color; ?>;"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["Notes"]; ?>
 </font> 
 </td> 
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10; color:<?= $event_color; ?>;"> 
 <?php
if ($myrow["fileLocation"] != "")
{
?>
 <?php echo "<a href=\"https://www.overstockart.net/communicator/eventItems.php?eventid=" . $myrow["eventID"] . "\" target=\"_blank\">"; ?>See list of Items on Event</a>
 <br /><a href="<?php echo $myrow["fileLocation"]; ?>"><img title="File" alt="File" align="right" src="images/file-icon.gif" border="0"/></a>
 
 <?php } ?>
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_custom_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo "<a href=\"viewCustomLead.php?leadId=" . $myrow["customerID"] . "\"><img title=\"Edit\" alt=\"Edit Lead\" align=\"LEFT\" src=\"images/28.png\" border=\"0\"/>" . $myrow["Name"] . "</a><br>"; ?>
 <?php //echo $myrow["Name"]; ?> 
 </font> <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow['Email'];?>&phone=<?= $myrow["Phone"];?>&table=custom_order&thread=<?= $myrow["clientID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow['Email'];?>&table=custom_order',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["Email"];?>&table=custom_order&thread=<?= $myrow["clientID"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a> &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $myrow["Email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>

 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="mailto:<?php echo $myrow["Email"]; ?> " > <?php echo $myrow["Email"]; ?> </a><br />
 <?php echo $myrow["Phone"]; ?>
 </font> 
 </td> 
  <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <form action="special-photo.php" method="post" enctype="multipart/form-data">
 <?php
 	$link = '../upl/server/php/files/';
	$artimage = $myrow["artimage"];
	$file = $link.$artimage;
	if($artimage == "noimage.jpg")
	{
		echo "NO IMAGE PROVIDED";
	}
	else if ($artimage != "" && file_exists($file)) {
    echo "<a href=\"javascript:GlobalPopUp('../upl/server/php/files/$artimage',600,500);\"><img src=\"../upl/server/php/files/thumbnail/$artimage\" alt=\"custom art sent\" style=\"margin:10px; padding:1px; border:1px solid #333333;\"></a>";
	 echo "<br><a style=\"padding-bottom:10px;padding-left:10px;\" href=\"delete.php?op=deletecustomimage&id=" . $myrow["customerID"] . "\" onclick=\"return confirm('Are you sure you want to delete?')\">Delete Image</a>";
    }
	else if($artimage != "" && $artimage != "noimage.jpg")
    {
    echo "<a href=\"javascript:GlobalPopUp('$artimage',600,500);\"><img align=\"right\" src=\"$artimage\" alt=\"custom art sent\" style=\"width:80px; margin:10px; padding:1px; border:1px solid #333333;\"></a>"; 
    } 
	?>
	<br />
    <input type="file" name="photo" size="25" />
     <input type="hidden" name="clientID" value="<?php echo $myrow["customerID"]; ?>" />
	<input  onClick="return confirm('Are you sure you want to add this image?')" type="submit" name="submit" value="Add Image" />
</form><br /><br />
<hr />
<br />
 <form action="special-photo-alt.php" method="post" enctype="multipart/form-data">
 <?php
 	$link = '../upl/server/php/files/';
	$artimagealt = $myrow["artimagealt"];
	$file = $link.$artimagealt;
	if($artimagealt == "")
	{
		echo "NO ALT IMAGE PROVIDED";
	}
	else if ($artimagealt != "" && file_exists($file)) {
    echo "<a href=\"javascript:GlobalPopUp('../upl/server/php/files/$artimagealt',600,500);\"><img src=\"../upl/server/php/files/thumbnail/$artimagealt\" alt=\"custom art sent\" style=\"margin:10px; padding:1px; border:1px solid #333333;\"></a>";
	 echo "<br><a style=\"padding-bottom:10px;padding-left:10px;\" href=\"delete.php?op=deletecustomimagealt&id=" . $myrow["customerID"] . "\" onclick=\"return confirm('Are you sure you want to delete?')\">Delete Image</a>";
    }
	else if($artimagealt != "" && $artimagealt != "noimage.jpg")
    {
    echo "<a href=\"javascript:GlobalPopUp('$artimagealt',600,500);\"><img align=\"right\" src=\"$artimagealt\" alt=\"custom art sent\" style=\"width:80px; margin:10px; padding:1px; border:1px solid #333333;\"></a>"; 
    } 
	?>
	<br />
    <input type="file" name="photo" size="25" />
     <input type="hidden" name="clientID" value="<?php echo $myrow["customerID"]; ?>" />
	<input  onClick="return confirm('Are you sure you want to add this image?')" type="submit" name="submit" value="Add Alt Image" />
</form><br />
  <?php echo $myrow["Type"]; ?> <br>
  <?php if(isset($myrow["PaintingName"])) echo $myrow["PaintingName"] . "<br>"; ?>
   <?php if(isset($myrow["Artist"])) echo $myrow["Artist"] . "<br>"; ?>
   <?php if(isset($myrow["Size"])) echo "Size: " . $myrow["Size"] . "<br>"; ?> 
    <?php if(isset($myrow["Instructions"])) echo "Instructions: " . substr($myrow["Instructions"],0,128); 
    if (strlen($myrow["Instructions"])>128) echo "...";
    ?>
 </font> 
 </td> 
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php if ($myrow["sent-quote"] == 1)
 {
 if ($myrow["quote"] > 0)
 {
 ?>
 Most recent quotes given per size: <?php echo number_format($myrow["quote"],2,'.',','); 
  $sql2 = "select q.artsize, q.quoteHand, q.quotePrint, q.date
from ( SELECT artsize,quoteHand,quotePrint,MAX(`date`) as maxdate FROM quote WHERE `specialorderid` = '" . $myrow["customerID"] . "' GROUP BY `artsize`) as x inner join quote as q on q.artsize = x.artsize and q.date = x.maxdate;";
 // echo $sql2;
  $result2 = mysql_query($sql2);
if (mysql_num_rows($result2))
{
echo "<table width=\"390\" style=\"BORDER: #999999 1px solid; FONT-SIZE: 11px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;\"><tr style=\"color:#293b74\"><td width=\"120\">Requested Size</td><td width=\"120\">Quote Hand Painted</td><td width=\"150\">Quote Canvas Transfer</td></tr>";
   $result2 = mysql_query($sql2);
   while($myrow2 = mysql_fetch_array($result2))
   {
   echo "<tr width=\"390\"><td width=\"120\">" . $myrow2["artsize"] . "</td><td width=\"120\">" . "$" . number_format($myrow2["quoteHand"],2) . "</td><td width=\"150\">" . "$" . number_format($myrow2["quotePrint"],2) . "</td></tr>";
   }  
echo "</table>";
 }
 ?> <br /> <input name="group1" onclick="changeDiv('send_quote_<?php echo $myrow["customerID"];?>','block');" type="radio">Give New Quotes?
 <?PHP
 }
 else
 {
 ?>
 Mail Sent without Quote
 <br /> <input name="group1" onclick="changeDiv('send_quote_<?php echo $myrow["customerID"];?>','block');" type="radio"><b>Pending Quote</b>
 <?php
 }
 ?>
 <br />
 <br />
 <div id="send_quote_<?php echo $myrow["customerID"];?>" style="margin-left: 10px; display:none;">
 <form name="send_quote_<?php echo $myrow["customerID"];?>" action="send-quote-special.php" method="post">
 Add message in email: <br />
 <textarea rows="5" cols="20" name='Message'> <?php echo $myrow["Message"]; ?> </textarea><br />
  <input type="hidden" name="author" value="<?php echo $_SESSION['admin_username'];?>">
   <!--   <input type='text' size='5' name='price' value='<?php echo number_format($myrow["quote"],2,'.',',');?>'>
-->
 <!-- lots of quotes -->
<table border="1" id="tblQuote" width="260" style="background-color:FFFFFF;">
  <tr>
    <td colspan="4" width="260"><b>Quotes Given Table</b> 
	<input type="button" value="+" onclick="addRowToTable();" />
<input type="button" value="-" onclick="removeRowFromTable();" />
</td>
  </tr>
  <tr>
    <td width="10">No.</td>
    <td width="10">Size</td>
   <td width="10">Quote Hand</td>
	 <td width="10">Quote Print</td>
  </tr>
  <tr>
    <td>1</td>
    <td><input type="text" name="size1"
     id="size1" size="10" value="<?= $myrow["Size"];?>"/></td>
   <td><input type="text" name="quoteHand1"
     id="quoteHand1" size="10" /></td>
	 <td><input type="text" name="quotePrint1"
     id="quotePrint1" size="10" /></td>
  </tr>
</table>
 <!-- lots of quotes end-->
 <input type="hidden" name="clientID" value="<?php echo $myrow["customerID"]; ?>" />
 <input type="hidden" name="artName" value="<?php echo $myrow["PaintingName"]; ?>" />
 <input type="hidden" name="customerEmail" value="<?php echo $myrow["Email"]; ?>" /> 
 <input type="hidden" name="customerName" value="<?php echo $myrow["Name"]; ?>" />
 <input type="hidden" name="Instructions" value="<?php echo $myrow["Instructions"]; ?>" />
 <input onClick="return confirm('Are you sure you want to Send this Quote?');validateRow(this.form);" type='submit' NAME='sendQuote_<?php echo $myrow["customerID"];?>' value='Send Quote' ></form> 
 </div>
 <?php echo "Sales Rep Comment: " . $myrow["comments"] . "<br><br>"; ?>
   <form name="add_comment_<?php echo $myrow["customerID"];?>" action="add-comment-special-only.php" method="post">
 <textarea rows="3" cols="20" name='comments'> <?php echo $myrow["comments"]; ?> </textarea><br />
 Status: &nbsp;
 <?php
 $current_status = $myrow["status_custom_order"];
 $result1 = mysql_query ("SELECT * FROM `status-special-order` ORDER BY `statusid` ASC");
  echo "<select name=\"status\">\r";
  if ($row2 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row2["status"] == $current_status)
 		  $selected="selected";
    print "<option $selected value=\"" . $row2["status"]."\">" . $row2["status"]."\r";
 	 } while($row2 = mysql_fetch_array($result1));
 }
 ?>
 <input type="hidden" name="clientID" value="<?php echo $myrow["customerID"]; ?>" /><br />
 <input onClick="return confirm('Are you sure you want to add this comment and close?')" type='submit' NAME='addComment_<?php echo $myrow["customerID"];?>' value='Edit Comment' ></form> <br />
 <a href="saleOrder.php?source=customSpecial&customerID=<?php echo $myrow["customerID"]; ?>"><img title="New Order" alt="Make an Order" align="right" src="images/cart_add.png" border="0"/></a>
 <a href="saleOrder.php?source=customSpecial&customerID=<?php echo $myrow["customerID"]; ?>">Make an Order</a> &nbsp; | &nbsp;
 <a href="javascript:GlobalPopUp('https://overstockart.net/communicator/addSpecialOrder.php?sOrderNum=<?=$myrow["Name"];?>-quote&customerName=<?=$myrow["Name"];?>',550,400);">Request a Quote</a>
 </font> </p></td>
 <?php
 }
 else
 {
 ?>
 <form name="send_quote_<?php echo $myrow["customerID"];?>" action="send-quote-special.php" method="post">
 Add message in email: <br />
 <textarea rows="5" cols="20" name='Message'></textarea><br />
   <input type="hidden" name="author" value="<?php echo $_SESSION['admin_username'];?>">
   <!-- <input type='text' size='5' name='price' value='0'>-->
 <!-- lots of quotes -->
<table border="1" id="tblQuote" width="260" style="background-color:FFFFFF;">
  <tr>
    <td colspan="4" width="260"><b>Quotes Given Table</b> 
	<input type="button" value="+" onclick="addRowToTable();" />
<input type="button" value="-" onclick="removeRowFromTable();" />
</td>
  </tr>
  <tr>
    <td width="10">No.</td>
    <td width="10">Size</td>
   <td width="10">Quote Hand</td>
	 <td width="10">Quote Print</td>
  </tr>
  <tr>
    <td>1</td>
    <td><input type="text" name="size1"
     id="size1" size="10" value="<?= $myrow["Size"];?>"/></td>
   <td><input type="text" name="quoteHand1"
     id="quoteHand1" size="10" /></td>
	 <td><input type="text" name="quotePrint1"
     id="quotePrint1" size="10" /></td>
  </tr>
</table>
 <!-- lots of quotes end-->
 <input type="hidden" name="clientID" value="<?php echo $myrow["customerID"]; ?>" />
 <input type="hidden" name="artName" value="<?php echo $myrow["PaintingName"]; ?>" />
 <input type="hidden" name="customerEmail" value="<?php echo $myrow["Email"]; ?>" /> 
 <input type="hidden" name="customerName" value="<?php echo $myrow["Name"]; ?>" />
 <input type="hidden" name="Instructions" value="<?php echo $myrow["Instructions"]; ?>" />
 <input onClick="return confirm('Are you sure you want to Send this Quote?');validateRow(this.form);" type='submit' NAME='sendQuote_<?php echo $myrow["customerID"];?>' value='Send Quote' >
 </form>
 <br />
 <form name="add_comment_<?php echo $myrow["customerID"];?>" action="add-comment-special.php" method="post">
 <textarea rows="3" cols="20" name='comments'></textarea><br />
 Status: &nbsp;
 <?php
 $current_status = $myrow["status_custom_order"];
 $result1 = mysql_query ("SELECT * FROM `status-special-order` ORDER BY `statusid` ASC");
  echo "<select name=\"status\">\r";
  if ($row2 = mysql_fetch_array($result1)) {
    do {
 $selected="";
    if ($row2["status"] == $current_status)
 		  $selected="selected";
    print "<option $selected value=\"" . $row2["status"]."\">" . $row2["status"]."\r";
 	 } while($row2 = mysql_fetch_array($result1));
 }
 ?> <br>
 <input type="checkbox" name="Notify" value="Yes" /> Notify Customer?<br />
 <input type="hidden" name="clientID" value="<?php echo $myrow["customerID"]; ?>" />
 <input type="hidden" name="artName" value="<?php echo $myrow["PaintingName"]; ?>" />
 <input type="hidden" name="customerEmail" value="<?php echo $myrow["Email"]; ?>" />
 <input type="hidden" name="customerName" value="<?php echo $myrow["Name"]; ?>" />
 <input type="hidden" name="Instructions" value="<?php echo $myrow["Instructions"]; ?>" /><br />
 <input onClick="return confirm('Are you sure you want to add this comment?')" type='submit' NAME='addComment_<?php echo $myrow["customerID"];?>' value='Add Comment' ></form>
 </font> </p></td>
 <?php } ?>
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["Date"]; ?> <br />
 <a href="saleOrder.php?source=customSpecial&customerID=<?php echo $myrow["customerID"]; ?>">Make an Order</a><BR /><BR />
 <a href="delete.php?op=deletecustom&id=<?php echo $myrow["customerID"]; ?>" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
 </font> 
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_site_order_data_return ($result) {
 // Loop Thru Records
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	
 $orderid2 = $myrow["primary"];
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOrderDetails.php?orderid=<?= $myrow["primary"];?>"><?php echo $myrow["orderid"]; ?></a> <br>
 <?php echo $myrow["date"]; ?> <BR /><BR />
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipName"]; ?><br>
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"]; ?><br>
 <?php echo $myrow["shipState"]; ?><br>
 <?php echo $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br><br />
 <?php echo $myrow["shipPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["billName"]; ?><br>
 <?php echo $myrow["billAdd1"]; ?><br>
 <?php echo $myrow["billAdd2"]; ?><br>
 <?php echo $myrow["billCity"]; ?><br>
 <?php echo $myrow["billState"]; ?><br>
 <?php echo $myrow["billZip"]; ?><br>
 <?php echo $myrow["billCountry"]; ?><br><br />
 <?php echo $myrow["billPhone"]; ?><br>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipping"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["total"]; ?> <br />
 <a href="saleOrder.php?source=pastOrder&customerID=<?php echo $myrow["orderid"]; ?>">Make an Order</a>
 </td> 
 </tr>
 <?php } 
 return $orderid2;
 }
 ?>
 <?php 
 function display_site_order_data_return_mail ($result) {
 // Loop Thru Records
  while($myrow = mysql_fetch_array($result))
   { 	
 $table = "<tr><td width='10%' height='21'><a  href='https://www.overstockart.net/ccm/viewOrderDetails.php?orderid=" . $myrow["primary"] . "'>" . $myrow["orderid"] . "</a> <br>" . $myrow["date"] . " <BR /><BR /><a href='mailto:" . $myrow["email"] . "'>" . $myrow["email"] . "</a></td> <td width='15%' height='21'> " . $myrow["shipName"] . "<br>" . $myrow["shipAdd1"] . "<br>" . $myrow["shipAdd2"] . "<br>" . $myrow["shipCity"] . "<br>" . $myrow["shipState"] . "<br>" . $myrow["shipZip"] . "<br>" . $myrow["shipCountry"] . "<br> </td><td width='15%' height='21'>" . $myrow["billName"] . "<br>" . $myrow["billAdd1"] . "<br>" . $myrow["billAdd2"] . "<br>" . $myrow["billCity"] . " " . $myrow["billState"] . "<br>" . $myrow["billZip"] . "<br>" . $myrow["billCountry"] . "<br></td> 
 <td width='15%' height='21'> " . $myrow["shipping"] . "</td><td width='15%' height='21'>" . $myrow["total"] . "</td> </tr>";
  } 
 $table .= "</table>";
 return $table;
 }
 ?>
 <?php 
 function display_site_order_data ($result) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	
 $orderid2 = $myrow["orderid"];
 $email = $myrow["email"];
  $phone = $myrow["billPhone"];
	 $stripPhoneB = preg_replace('/\D+/', '', $phone);
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewNewOrderDetails.php?orderid=<?= $myrow["primary"];?>"><?php echo $myrow["orderid"]; ?></a> <br>
 <?php echo $myrow["date"]; ?></a><br><br>
  <a href="https://www.overstockart.com/osaadmin/index.php?route=sale/order/info&order_id=<?= $myrow["orderid"];?>" target="_blank"><?php echo "site backend order #" . $myrow["orderid"]; ?></a> 
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>" id="view_order_details_email">
 <?php echo $myrow["email"]; ?>
 </a>
  <?php
 //Lookup email in customer list, else append the next customer ID
 	if($email != "")
		{
			$dbQueryCustomer = "SELECT `CustomerID` FROM `customerIDs` WHERE `Email` = '$email' LIMIT 1;";
			//echo $dbQueryCustomer . "<br>";
			$resultCustomer = mysql_query($dbQueryCustomer); // or die("Couldn't get the Connectors $dbQueryRef");
			while($rowCID = mysql_fetch_array($resultCustomer)) 
			{
			$customerID = "a" . $rowCID[0];
			}
		}
					
		  if ($customerID == "")
		  {
			  $dbQueryCustomer = "SELECT `CustomerID` FROM `customerIDs` WHERE 1=1 ORDER BY CustomerID DESC LIMIT 1;";
			$resultCustomer = mysql_query($dbQueryCustomer); // or die("Couldn't get the Connectors $dbQueryRef");
			while($rowCID = mysql_fetch_array($resultCustomer)) 
			{ 
			$lastCustomerID = $rowCID[0];
			$nextID = $lastCustomerID + 1;
			//echo "The NextID: " . $nextID;
			}
			  $customerID = "a" . $nextID;
			  $query = "INSERT INTO `customerIDs` (`CustomerID`, `Email`, `Phone`) VALUES ('$nextID', '$email', '$stripPhoneB');";
			  mysql_query($query); // or die("Couldn't add row to CustomerIDs $query");
			  $nextID++;
		  }
		  
		 // echo " Customer ID: " . $customerID . " nextID: " . $nextID . " <br>";
 ?>
  <br /><br /> 
 <?php 
 echo "<form name=\"updateCustomerID\" method=\"post\" action=\"updateCustomerID.php\">";
 echo " <b>Customer ID: </b><input type=\"text\" name=\"updateCustomerID\" size=\"8\" value=\"" . $customerID . "\">";
 echo "<input type=\"hidden\" name=\"updateEmail\" value=\"" . $email . "\">";
 echo "<input type='submit' NAME='updateCustomerIDSubmit' value='Update Customer ID' ></form>";
 ?>
 <br><br>
 <div style="text-align:right"><a href="javascript:void(0)" onClick="edit_email(<?=$myrow['orderid']?>);" style="text-decoration:none;">edit &raquo;</div>
 </td> 
 <td width="15%" height="21">
 <div id="ship_info">
 <?php echo $myrow["shipName"]; ?><br>
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"]; ?><br>
 <?php echo $myrow["shipState"]; ?><br>
 <?php echo $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br><br>
 <?php echo $myrow["shipPhone"]; ?><br><br>
 </div>
 <div style="text-align:right"><a href="javascript:void(0)" onClick="edit_shipinfo(<?=$myrow['orderid']?>);" style="text-decoration:none;">edit &raquo;</div>
 </td> 
 <td width="15%" height="21">
  <div id="bill_info">
 <?php echo $myrow["billName"]; ?><br>
 <?php echo $myrow["billAdd1"]; ?><br>
 <?php echo $myrow["billAdd2"]; ?><br>
 <?php echo $myrow["billCity"]; ?><br>
 <?php echo $myrow["billState"]; ?><br>
 <?php echo $myrow["billZip"]; ?><br>
 <?php echo $myrow["billCountry"]; ?><br><br>
 <?php echo $myrow["billPhone"]; ?><br><br>
 </div>
 <div style="text-align:right"><a href="javascript:void(0)" onClick="edit_billinfo(<?=$myrow['orderid']?>);" style="text-decoration:none;">edit &raquo;</div>
 </td> 
 <td width="20%" height="21">
 <div id="shipping_method">
 <?php echo $myrow["shipping"]; ?>
 </div>
  <div style="text-align:right"><br><br><a href="javascript:void(0)" onClick="edit_shipping(<?=$myrow['orderid']?>);" style="text-decoration:none;">edit &raquo;</div>
 </td> 
 <td width="20%" height="21"> 
 <?php echo $myrow["total"]; ?> <br />
 <a href="saleOrder.php?source=pastOrderNew&customerID=<?php echo $myrow["orderid"]; ?>">Make an Order &raquo;</a>
 <BR /><BR />
 <a href="javascript:GlobalPopUp('returnLabel.php?orderid=<?php echo $myrow["orderid"]; ?>',650,650);">Packing Slip Creator&raquo;</a>
 </td> 
 </tr>
 <?php } 
 return $orderid2;
 }
 ?>
 <?php 
 function display_new_site_order_data ($result) {
 // Loop Thru Records
  while($myrow = mysql_fetch_array($result))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	
 $orderid2 = $myrow["orderid"];
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewNewOrderDetails.php?orderid=<?= $myrow["primary"];?>"><?php echo $myrow["orderid"]; ?></a> <br>
 <?php echo $myrow["date"]; ?></a>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>" id="view_order_details_email">
 <?php echo $myrow["email"]; ?>
 </a><br><br>
 <div style="text-align:right"><a href="javascript:void(0)" onClick="edit_email(<?=$myrow['orderid']?>);" style="text-decoration:none;">edit &raquo;</div>
 </td> 
 <td width="15%" height="21">
 <div id="ship_info">
 <?php echo $myrow["shipName"]; ?><br>
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"]; ?><br>
 <?php echo $myrow["shipState"]; ?><br>
 <?php echo $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br><br>
 <?php echo $myrow["shipPhone"]; ?><br><br>
 </div>
 <div style="text-align:right"><a href="javascript:void(0)" onClick="edit_shipinfo(<?=$myrow['orderid']?>);" style="text-decoration:none;">edit &raquo;</div>
 </td> 
 <td width="15%" height="21">
  <div id="bill_info">
 <?php echo $myrow["billName"]; ?><br>
 <?php echo $myrow["billAdd1"]; ?><br>
 <?php echo $myrow["billAdd2"]; ?><br>
 <?php echo $myrow["billCity"]; ?><br>
 <?php echo $myrow["billState"]; ?><br>
 <?php echo $myrow["billZip"]; ?><br>
 <?php echo $myrow["billCountry"]; ?><br><br>
 <?php echo $myrow["billPhone"]; ?><br><br>
 </div>
 <div style="text-align:right"><a href="javascript:void(0)" onClick="edit_billinfo(<?=$myrow['orderid']?>);" style="text-decoration:none;">edit &raquo;</div>
 </td> 
 <td width="20%" height="21">
 <div id="shipping_method">
 <?php echo $myrow["shipping"]; ?>
 </div>
  <div style="text-align:right"><br><br><a href="javascript:void(0)" onClick="edit_shipping(<?=$myrow['orderid']?>);" style="text-decoration:none;">edit &raquo;</div>
 </td> 
 <td width="20%" height="21"> 
 <?php echo $myrow["total"]; ?> <br />
 <a href="saleOrder.php?source=pastOrder&customerID=<?php echo $myrow["orderid"]; ?>">Make an Order &raquo;</a>
 <BR /><BR />
 <a href="javascript:GlobalPopUp('returnLabel.php?orderid=<?php echo $myrow["orderid"]; ?>',650,650);">Packing Slip Creator&raquo;</a>
 </td> 
 </tr>
 <?php } 
 return $orderid2;
 }
 ?>
 <?php 
 function display_order_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOrderDetails.php?orderid=<?= $myrow["primary"];?>"><?php echo $myrow["orderid"]; ?></a> <br>
 <?php echo $myrow["date"]; ?> 
 </td> 
 <td width="10%" height="21"> 
 <a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;">
 <?php echo $myrow["email"]; ?>
 </a> 
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&table=orders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=orders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=orders&thread=<?= $primary;?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $myrow["email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>

 </td> 
 <td width="20%" height="21">
 <?php
 $itemQuery = "SELECT * FROM items WHERE orderid = " . $myrow["orderid"] . ";";
 $resultItem = mysql_query($itemQuery) or die("Couldn't get the Connectors");
 while($myrow1 = mysql_fetch_array($resultItem)) 
 {
 if ($myrow1["productcode"] == "Tax" || $myrow1["productcode"] == "Shipping") continue;
 if ($myrow1["productid"] == "Coupon")
 {
 $image_link = "images/coupon.gif";
 echo "<br><img src=\"" . $image_link . "\" align=\"right\" border=0 style=\"padding:5px;\">" . $myrow1["productcode"] . "<br><b style=\"color:#ae0011;\"> Discount:  -" . $myrow1["price"] . "</b><br>";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/uploads/" . $myrow1["productcode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/uploads/" . $myrow1["productcode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/uploads-old/" . $myrow1["productcode"] . ".jpg";
 if (url_exists($image_file_jpg))
 { $image_link = $image_file_jpg;}
 else if (url_exists($image_file_gif))
 { $image_link = $image_file_gif; }
 else
 { $image_link = $image_file_old_jpg ; }
 echo "<br><a href=\"https://www.overstockart.com/" .  $myrow1["productid"] . ".html\"><img src=\"" . $image_link . "\" align=\"right\" border=0 style=\"padding:5px;\">" . $myrow1["productcode"] . "</a> <br> Qty:  " . $myrow1["qty"] . "<br> Price:  " . $myrow1["price"] . "<br> Framing Option: ". $myrow1["option"] . "<br>";
 }
 } 
 ?>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["shipName"]; ?><br>
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"]; ?><br>
 <?php echo $myrow["shipState"]; ?><br>
 <?php echo $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br /><br>
 <?php echo $myrow["shipPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["billName"]; ?><br>
 <?php echo $myrow["billAdd1"]; ?><br>
 <?php echo $myrow["billAdd2"]; ?><br>
 <?php echo $myrow["billCity"]; ?><br>
 <?php echo $myrow["billState"]; ?><br>
 <?php echo $myrow["billZip"]; ?><br>
 <?php echo $myrow["billCountry"]; ?><br /><br>
 <?php echo $myrow["billPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipping"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["total"]; ?> <br />
 <a href="saleOrder.php?source=pastOrder&customerID=<?php echo $myrow["orderid"]; ?>">Make an Order</a>
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_new_order_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewNewOrderDetails.php?orderid=<?= $myrow["primary"];?>"><?php echo $myrow["orderid"]; ?></a> <br>
 <?php echo $myrow["date"]; ?> 
 </td> 
 <td width="10%" height="21"> 
 <a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;">
 <?php echo $myrow["email"]; ?>
 </a> 
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&table=orders_new&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=orders_new&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=orders_new&thread=<?= $primary;?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a> &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $myrow["email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>


 </td> 
 <td width="20%" height="21">
 <?php
 $itemQuery = "SELECT * FROM items_new WHERE orderid = " . $myrow["orderid"] . ";";
 $resultItem = mysql_query($itemQuery) or die("Couldn't get the Connectors");
 while($myrow1 = mysql_fetch_array($resultItem)) 
 {
 if ($myrow1["productcode"] == "Tax" || $myrow1["productcode"] == "Shipping") continue;
 
 if ($myrow1["productid"] == "Coupon")
 {
 $image_link = "images/coupon.gif";
 echo "<br><img src=\"" . $image_link . "\" align=\"right\" border=0 style=\"padding:5px;\">" . $myrow1["productcode"] . "<br><b style=\"color:#ae0011;\"> Discount:  -" . $myrow1["price"] . "</b><br>";
 }
 else if ($myrow1["productid"] == "Rewards")
 {
 $image_link = "images/rewards.svg";
 echo "<br><img src=\"" . $image_link . "\" align=\"right\" border=0 style=\"padding:5px;\">" . $myrow1["productcode"] . "<br><b style=\"color:#6c5070;\"> Value: -" . $myrow1["price"] . "</b><br>";
 }
 else
 {
	 $dConn = mysql_select_db($dbDatabase2, $sConn) 
 or die("Couldn't connect to database $dbDatabase2");
	$link = "https://www.overstockart.com/";
	
	 $queryLink = "SELECT * FROM `opencart-inventory` WHERE `SKU` = '" . $myrow1["productcode"] . "' ORDER BY `Status` DESC LIMIT 1;";
				//echo $queryLink;
				$resultLink = mysql_query($queryLink) or die("Couldn't get item link"); 
				while($rowLink = mysql_fetch_array($resultLink))
					{
						$catalogSK = $rowLink["SKU"];
						$url =  $rowLink["SEOKeywords"];
						$storeID =  $rowLink["StoreID"];
						$type = $rowLink["Type"];
					if($type == "painting")
						{
						$url_type = "painting";
						$ptype = "Hand Painted Oil Painting";
						}
						else if($type == "print")
						{
						$url_type = "painting";
						$ptype = "Hi End Canvas Print";
						}
						else if($type == "preframed")
						{
						$url_type = "preframed";
						$ptype = "Pre Framed Art";
						}
						else if($type == "frame")
						{
						$url_type = "frame";
						$ptype = "Museum Frame";
						}
						else if($type == "wrap")
						{
						$url_type = "gallery-wrap";
						$ptype = "Gallery Wrap";
						}
						else if($type == "tile")
						{
						$url_type = "tile";
						$ptype = "Hand Carved Ceramic Tile";
						}
						else if($type == "ornament")
						{
						$url_type = "ornament";
						$ptype = "Hand Painted Glass Ornament";
						}
						else if($type == "mirror")
						{
						$url_type = "mirror";
						$ptype = "Hi-End Mirror";
						$promotion = 1.0;
						}
						else
						{
						$url_type = "painting";
						$ptype = "Hand Painted Oil Painting";
						}
						
						$link = "https://www.overstockart.com/" . $url_type . "/" . $url . "?option_id=" . $storeID;
					}
					$dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 $image_file_gif = "https://www.overstockart.net/sorter/uploads/" . $myrow1["productcode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/uploads/" . $myrow1["productcode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/uploads-old/" . $myrow1["productcode"] . ".jpg";
 if (url_exists($image_file_jpg))
 { $image_link = $image_file_jpg;}
 else if (url_exists($image_file_gif))
 { $image_link = $image_file_gif; }
 else
 { $image_link = $image_file_old_jpg ; }
						
 echo "<br><a href=\"" . $link . "\"><img src=\"" . $image_link . "\" align=\"right\" border=0 style=\"padding:5px;\"></a><a href=\"" . $link . "\">" . $myrow1["productcode"] . "</a> <br> Qty:  " . $myrow1["qty"] . "<br> Price:  " . $myrow1["price"] . "<br> Framing Option: ". $myrow1["option"] . "<br>";
 }
 } 
 ?>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["shipName"]; ?><br>
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"]; ?><br>
 <?php echo $myrow["shipState"]; ?><br>
 <?php echo $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br /><br>
 <?php echo $myrow["shipPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["billName"]; ?><br>
 <?php echo $myrow["billAdd1"]; ?><br>
 <?php echo $myrow["billAdd2"]; ?><br>
 <?php echo $myrow["billCity"]; ?><br>
 <?php echo $myrow["billState"]; ?><br>
 <?php echo $myrow["billZip"]; ?><br>
 <?php echo $myrow["billCountry"]; ?><br /><br>
 <?php echo $myrow["billPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipping"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["total"]; ?> <br />
 <a href="saleOrder.php?source=pastOrderNew&customerID=<?php echo $myrow["orderid"]; ?>">Make an Order</a>
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 
 <?php 
 function display_manual_order_data($result) {
 // Loop Thru Records
  //Get the next customer ID:
						
 while($myrow = mysql_fetch_array($result))
  {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
	 
	 $email = $myrow["email"];
	 $phone = $myrow["billPhone"];
	 $stripPhoneB = preg_replace('/\D+/', '', $phone);
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <?php echo $myrow["orderid"]; ?> <br>
 Date Ordered: <?php echo $myrow["dateOrder"]; ?> 
 <br /><br />
 <a href="editOrder.php?orderid=<?php echo $myrow["orderid"]; ?>">
 Edit Order</a>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php 
 echo $myrow["email"]; 
 ?>
 </a>
 <?php
 //Lookup email in customer list, else append the next customer ID
 	if($email != "")
		{
			$dbQueryCustomer = "SELECT `CustomerID` FROM `customerIDs` WHERE `Email` = '$email' LIMIT 1;";
			//echo $dbQueryCustomer . "<br>";
			$resultCustomer = mysql_query($dbQueryCustomer); // or die("Couldn't get the Connectors $dbQueryRef");
			while($rowCID = mysql_fetch_array($resultCustomer)) 
			{
			$customerID = "a" . $rowCID[0];
			}
		}
					
		  if ($customerID == "")
		  {
			  $dbQueryCustomer = "SELECT `CustomerID` FROM `customerIDs` WHERE 1=1 ORDER BY CustomerID DESC LIMIT 1;";
			$resultCustomer = mysql_query($dbQueryCustomer); // or die("Couldn't get the Connectors $dbQueryRef");
			while($rowCID = mysql_fetch_array($resultCustomer)) 
			{ 
			$lastCustomerID = $rowCID[0];
			$nextID = $lastCustomerID + 1;
			//echo "The NextID: " . $nextID;
			}
			  $customerID = "a" . $nextID;
			  $query = "INSERT INTO `customerIDs` (`CustomerID`, `Email`, `Phone`) VALUES ('$nextID', '$email', '$stripPhoneB');";
			  mysql_query($query); // or die("Couldn't add row to CustomerIDs $query");
			  $nextID++;
		  }
		  
		 // echo " Customer ID: " . $customerID . " nextID: " . $nextID . " <br>";
 ?>
  <br /><br /> 
 <?php 
 echo "<form name=\"updateCustomerID\" method=\"post\" action=\"updateCustomerID.php\">";
 echo " <b>Customer ID: </b><input type=\"text\" name=\"updateCustomerID\" size=\"8\" value=\"" . $customerID . "\">";
 echo "<input type=\"hidden\" name=\"updateEmail\" value=\"" . $email . "\">";
 echo "<input type='submit' NAME='updateCustomerIDSubmit' value='Update Customer ID' ></form>";
 
 if ($myrow["email_alt"] != "")
 {
 echo "<br> <br>Secondary Email: <a href=\"mailto:" . $myrow["email_alt"] . "\">" . $myrow["email_alt"] . "</a>";
 echo "<button onclick=\"javascript:GlobalPopUp('sendTransEmail.php?altemail=1&orderid=" . $myrow["orderid"] . "',550,400);\">Send Confirmation</button>";
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipName"]; ?><br><br />
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"] . ", " . $myrow["shipState"] . " " . $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["shipPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["billName"]; ?><br><br />
 <?php echo $myrow["billAdd1"]; ?><br>
 <?php echo $myrow["billAdd2"]; ?><br>
 <?php echo $myrow["billCity"] . ", " . $myrow["billState"] . " " . $myrow["billZip"]; ?><br>
 <?php echo $myrow["billCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["billPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipping"]; ?><BR /><br />
 Shipping Cost:<?php echo "$" . number_format($myrow["shipCost"],'2','.',','); //["costShip"] ?><br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"viewOrder.php?orderid=" . $myrow["orderid"] . "\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
  if ($myrow["tracking6"] != "")
echo "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking6"] . "'>" . $myrow["tracking6"] . "</a>";
 if ($myrow["tracking7"] != "")
echo "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking7"] . "'>" . $myrow["tracking7"] . "</a>";
 if ($myrow["tracking8"] != "")
echo "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking8"] . "'>" . $myrow["tracking8"] . "</a>";
 if ($myrow["tracking9"] != "")
echo "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking9"] . "'>" . $myrow["tracking9"] . "</a>";
 if ($myrow["tracking10"] != "")
echo "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking10"] . "'>" . $myrow["tracking10"] . "</a>";
 }
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 if ($myrow["paidDate"] != "")
 {
 echo "<br><br>";
 echo "Date Paid: " . $myrow["paidDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 Status: <b><?php echo $myrow["status"]; ?></b>
 <br /><br />
 <?php
 if ($myrow["giftM"] != "")
 {
 ?>
 Gift Message:<BR />
 <?php echo $myrow["giftM"]; ?><BR /><br />
 <?php
 }
 if ($myrow["iNotes"] != "")
 {
 ?>
 Internal Notes:<BR />
 <?php echo $myrow["iNotes"]; ?><BR /><br />
 <?php
 }
 ?>
 Total: <b><?php echo "$" . number_format($myrow["total"],2,'.',','); ?></b> <a href="viewOrder.php?orderid=<?= $myrow["orderid"]; ?>&op=updateTotal" style="color:#AE0011; font-size:10px;">update</a><br /><br />
 Total Charged: <b><?php echo "$" . number_format($myrow["chargeU"],2,'.',','); ?> </b>
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_manual_order_return_mail($result) {
 // Loop Thru Records
 while($myrow = mysql_fetch_array($result))
  {
$table = "<tr><td width='10%' height='21'>" . $myrow["orderid"] . "<br> DATE: " . $myrow["dateOrder"]; 
$table .= "<br /><br /><a href='https://www.overstockart.net/ccm/editOrder.php?orderid=" . $myrow["orderid"] . "'> Edit Order </a><br />";
$table .= "<a href='mailto:" . $myrow["email"] ."'>" . $myrow["email"] . "</a></td><td width='15%' height='21'>" . $myrow["shipName"] . "<br><br />" . $myrow["shipAdd1"] . "<br>" . $myrow["shipAdd2"] . "<br>" . $myrow["shipCity"] . ", " . $myrow["shipState"] . " " . $myrow["shipZip"] . "<br>" . $myrow["shipCountry"] . "<br><br /><u>Ship Phone:</u> <br />" . $myrow["shipPhone"] . "</td> <td width='15%' height='21'>" . $myrow["billName"] . "<br><br />" . $myrow["billAdd1"] . "<br>" . $myrow["billAdd2"] . "<br>" . $myrow["billCity"] . ", " . $myrow["billState"] . " " . $myrow["billZip"] . "<br>" . $myrow["billCountry"] . "<br><br /><u>Bill Phone:</u> <br />" . $myrow["billPhone"] . "</td><td width='15%' height='21'>" . $myrow["shipping"] . "<BR /><br />Shipping Cost: $" . number_format($myrow["shipCost"],'2','.',',') . "<br /><br />"; //["costShip"]
if ($myrow["tracking"] == "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "'>" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "'>" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "'>" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "'>" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "'>" . $myrow["tracking5"] . "</a>";
 if ($myrow["tracking6"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking6"] . "'>" . $myrow["tracking6"] . "</a>";
 if ($myrow["tracking7"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking7"] . "'>" . $myrow["tracking7"] . "</a>";
 if ($myrow["tracking8"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking8"] . "'>" . $myrow["tracking8"] . "</a>";
 if ($myrow["tracking9"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking9"] . "'>" . $myrow["tracking9"] . "</a>";
 if ($myrow["tracking10"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking10"] . "'>" . $myrow["tracking10"] . "</a>";
$table .= "<br><br>";
$table .= "Ship Date: " . $myrow["shipDate"] . " </td>"; 
 $table .= "<td width='15%' height='21'>GIFT MESSAGE:<BR />" . $myrow["giftM"] . "<BR /><br />Total: <b>" . number_format($myrow["total"],2,'.',',') . "</b> <br /><br />Total Charged: <b>" . number_format($myrow["chargeU"],2,'.',',') . "</b></td></tr>";
  } 
   $table .= "</table>";
 return $table;
 }
 ?>
 
 <?php 
 function display_manual_order_return($result) {
 // Loop Thru Records
 while($myrow = mysql_fetch_array($result))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <?php echo $myrow["orderid"]; ?> <br>
 DATE: <?php echo $myrow["dateOrder"]; ?> 
 <br /><br />
 <a href="editOrder.php?orderid=<?php echo $myrow["orderid"]; ?>">
 Edit Order</a><br />
 <a href="mailto:<?php echo $myrow["email"]; ?>"><?php echo $myrow["email"]; ?></a>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipName"]; ?><br><br />
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"] . ", " . $myrow["shipState"] . " " . $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["shipPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["billName"]; ?><br><br />
 <?php echo $myrow["billAdd1"]; ?><br>
 <?php echo $myrow["billAdd2"]; ?><br>
 <?php echo $myrow["billCity"] . ", " . $myrow["billState"] . " " . $myrow["billZip"]; ?><br>
 <?php echo $myrow["billCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["billPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipping"]; ?><BR /><br />
 Shipping Cost:<?php echo "$" . number_format($myrow["costShip"],'2','.',','); ?><br /><br />
 <?php if ($myrow["tracking"] == "")
 {
/* echo "<form name=\"addTrack\" method=\"post\" action=\"viewOrder.php?orderid=" . $myrow["orderid"] . "\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";*/
 echo "NO TRACKING INFO";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
  if ($myrow["tracking6"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking6"] . "'>" . $myrow["tracking6"] . "</a>";
 if ($myrow["tracking7"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking7"] . "'>" . $myrow["tracking7"] . "</a>";
 if ($myrow["tracking8"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking8"] . "'>" . $myrow["tracking8"] . "</a>";
 if ($myrow["tracking9"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking9"] . "'>" . $myrow["tracking9"] . "</a>";
 if ($myrow["tracking10"] != "")
$table .= "<br><a target='_blank' href='https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking10"] . "'>" . $myrow["tracking10"] . "</a>";
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 GIFT MESSAGE:<BR />
 <?php echo $myrow["giftM"]; ?><BR /><br />
 Total: <b><?php echo number_format($myrow["total"],2,'.',','); ?></b> <br /><br />
 Total Charged: <b><?php echo number_format($myrow["chargeU"],2,'.',','); ?> </b>
 </td> 
 </tr>
 <?php } 
 return $myrow["primary"];
 }
 ?>
 <?php 
 function display_manual_order_packingslip($result) {
 // Loop Thru Records
 while($myrow = mysql_fetch_array($result))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <?php echo $myrow["orderid"]; ?> <br>
 DATE: <?php echo $myrow["dateOrder"]; ?> 
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipName"]; ?><br><br />
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"] . ", " . $myrow["shipState"] . " " . $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["shipPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipping"]; ?>
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_order_packingslip($result) {
 // Loop Thru Records
 while($myrow = mysql_fetch_array($result))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <?php echo $myrow["orderid"]; ?> <br>
 DATE: <?php echo $myrow["date"]; ?> 
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipName"]; ?><br><br />
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"] . ", " . $myrow["shipState"] . " " . $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["shipPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipping"]; ?>
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_items_order($result) {
 while($myrow = mysql_fetch_array($result))
   {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
	
	if ($myrow["productcode"] == "Tax" || $myrow["productcode"] == "Shipping") continue;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a href="rma.php?orderType=0&item=<?= $myrow["primary"]; ?>">[return]</a>
 
 <br /><br />
 <?php
if ($myrow["primaryF"] != "")
{
?>
<b style="color:#AE0011;">In Fullfilment:</b>
<?php
}
else
{
?>
<b style="color:#AE0011;">Not In Fullfilment:</b>
<?php
}
?>
 <form name="recordUpdate<?= $myrow["primary"]; ?>" id="recordUpdate<?= $myrow["primary"]; ?>" onsubmit="return false;">
            <?php
$result1 = mysql_query ("SELECT * FROM `status-fullfilment` ORDER BY `statusid` ASC");
 echo "<select name=\"status1\" id=\"status1\">\r";
 if ($srow = mysql_fetch_array($result1)) {
   do {
    $selected = "" ;
     if ($srow["status"] == $myrow["status"])
		  $selected="selected";
   print "<option $selected value=\"" . $srow["status"] ."\">" . $srow["status"]."\r";
	 } while($srow = mysql_fetch_array($result1));
 }
?></select>
<?php
if ($myrow["tracking"] != "")
{
echo "<br>Tracking #:<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a><br><br>";
}
?>
   <input type="hidden" name="fullID" id="fullID" value="<?= $myrow["primaryF"]; ?>" />
   <input type="hidden" name="itemID" id="itemID" value="<?= $myrow["primary"]; ?>" />
   <input style="padding:0px; margin:0px;" type="submit" value="update" onClick="sendRequest('recordUpdate<?= $myrow["primary"]; ?>')" align="right">
  </form>
    <div id="show<?= $myrow["primary"]; ?>" style="color:#AE0011; font-weight:bold;"></div>
 
 </font>
 </p>
 </td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <?php        
 echo "<a href=\"https://www.overstockart.com/" . $myrow["productid"] . ".html\" id=\"view_order_details_item" . $myrow['orderid'] . "_" . $myrow['productcode'] . "_code\">" . $myrow["productcode"] . "</a><br>";
  ?>
 </font>
<?php 
if ($myrow["primaryF"] != "") {
	echo '<br><br><a href="javascript:edit_item_code(' . $myrow['orderid'] . ', \'' . $myrow['productcode'] . '\')" style="float:right;text-decoration:none;">edit &raquo;</a> </div>';
} 
?>
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 
 
 if ($myrow["productid"] == "Coupon")
 {
 $image_link = "images/coupon.gif";
 echo "<img src=\"" . $image_link . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else
 {
 
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["productcode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["productcode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["productcode"] . ".jpg";
 if (url_exists($image_file_jpg))
 { echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; }
 else if (url_exists($image_file_gif))
 { echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; }
 else
 { echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; }
   
 }
 
 
 
 ?>
 </td> 
   <td width="15%" height="21" align="center">
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["productcode"]; ?>
 </font></p></td>
   <td width="15%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <span id="view_order_details_item<?=$myrow['orderid']?>_<?=$myrow["productcode"]?>_frame"><?php echo $myrow["option"]; ?></span><br />
 </font>
  <?php 
if ($myrow["primaryF"] != "") {
	echo '<br><br><a href="javascript:edit_item_frame(' . $myrow['orderid'] . ', \'' . $myrow['productcode'] . '\')" style="float:right;text-decoration:none;">edit &raquo;</a> </div>';
} 
?>
 </p>
 </td>
   <td width="15%" height="21" align="center" nowrap> 
 <p style="margin-left: 10; margin-right: 10"> 
 <span id="view_order_details_item<?=$myrow['orderid']?>_<?=$myrow["productcode"]?>_qty"><?php echo $myrow["qty"]; ?></span>
 </font>
   <?php 
if ($myrow["primaryF"] != "") {
	echo '<br><br><a href="javascript:edit_item_qty(' . $myrow['orderid'] . ', \'' . $myrow['productcode'] . '\')" style="float:right;text-decoration:none;">edit &raquo;</a> </div>';
} 
?>
 </p></td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 echo $myrow["price"];
 $subTotal = $myrow["qty"] * substr($myrow["price"],1);
 echo "<br> Total: $" . number_format($subTotal,2,'.',','); 
 ?>
 </font></p></td>
   </tr>
 <?php } 
 }
 ?>
 <?php
 function display_new_items_order($result) {
	 
	 include ("config.php");
	 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 
 while($myrow = mysql_fetch_array($result))
   {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
	
	if ($myrow["productcode"] == "Tax" || $myrow["productcode"] == "Shipping") continue;
	
	$dConn = mysql_select_db($dbDatabase2, $sConn) 
 or die("Couldn't connect to database $dbDatabase2");
	$link = "https://www.overstockart.com/";
	
	 $queryLink = "SELECT * FROM `opencart-inventory` WHERE `SKU` = '" . $myrow["productcode"] . "' ORDER BY `Status` DESC LIMIT 1;";
				//echo $queryLink;
				$resultLink = mysql_query($queryLink) or die("Couldn't get item link"); 
				while($rowLink = mysql_fetch_array($resultLink))
					{
						$catalogSK = $rowLink["SKU"];
						$url =  $rowLink["SEOKeywords"];
						$storeID =  $rowLink["StoreID"];
						$type = $rowLink["Type"];
					if($type == "painting")
						{
						$url_type = "painting";
						$ptype = "Hand Painted Oil Painting";
						}
						else if($type == "print")
						{
						$url_type = "painting";
						$ptype = "Hi End Canvas Print";
						}
						else if($type == "preframed")
						{
						$url_type = "preframed";
						$ptype = "Pre Framed Art";
						}
						else if($type == "frame")
						{
						$url_type = "frame";
						$ptype = "Museum Frame";
						}
						else if($type == "wrap")
						{
						$url_type = "gallery-wrap";
						$ptype = "Gallery Wrap";
						}
						else if($type == "tile")
						{
						$url_type = "tile";
						$ptype = "Hand Carved Ceramic Tile";
						}
						else if($type == "ornament")
						{
						$url_type = "ornament";
						$ptype = "Hand Painted Glass Ornament";
						}
						else if($type == "mirror")
						{
						$url_type = "mirror";
						$ptype = "Hi-End Mirror";
						$promotion = 1.0;
						}
						else
						{
						$url_type = "painting";
						$ptype = "Hand Painted Oil Painting";
						}
						
						$link = "https://www.overstockart.com/" . $url_type . "/" . $url . "?option_id=" . $storeID;
					}
					$dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a href="rma.php?orderType=0&item=<?= $myrow["primary"]; ?>">[return]</a>
 
 <br /><br />
 <?php
if ($myrow["primaryF"] != "")
{
?>
<b style="color:#AE0011;">In Fullfilment:</b>
<?php
}
else
{
?>
<b style="color:#AE0011;">Not In Fullfilment:</b>
<?php
}
?>
 <form name="recordUpdate<?= $myrow["primary"]; ?>" id="recordUpdate<?= $myrow["primary"]; ?>" onsubmit="return false;">
            <?php
$result1 = mysql_query ("SELECT * FROM `status-fullfilment` ORDER BY `statusid` ASC");
 echo "<select name=\"status1\" id=\"status1\">\r";
 if ($srow = mysql_fetch_array($result1)) {
   do {
    $selected = "" ;
     if ($srow["status"] == $myrow["status"])
		  $selected="selected";
   print "<option $selected value=\"" . $srow["status"] ."\">" . $srow["status"]."\r";
	 } while($srow = mysql_fetch_array($result1));
 }
?></select>
<?php
if ($myrow["tracking"] != "")
{
echo "<br>Tracking #:<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a><br><br>";
}
?>
   <input type="hidden" name="fullID" id="fullID" value="<?= $myrow["primaryF"]; ?>" />
   <input type="hidden" name="itemID" id="itemID" value="<?= $myrow["primary"]; ?>" />
   <input style="padding:0px; margin:0px;" type="submit" value="update" onClick="sendRequest('recordUpdate<?= $myrow["primary"]; ?>')" align="right">
  </form>
    <div id="show<?= $myrow["primary"]; ?>" style="color:#AE0011; font-weight:bold;"></div>
 
 </font>
 </p>
 </td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <?php        
 echo "<a href=\"" . $link . "\" target=\"_blank\" id=\"view_order_details_item" . $myrow['orderid'] . "_" . $myrow['productcode'] . "_code\">" . $myrow["productcode"] . "</a><br>";
  ?>
 </font>
<?php 
if ($myrow["primaryF"] != "") {
	echo '<br><br><a href="javascript:edit_item_code(' . $myrow['orderid'] . ', \'' . $myrow['productcode'] . '\')" style="float:right;text-decoration:none;">edit &raquo;</a> </div>';
} 
?>
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 if ($myrow["productid"] == "Coupon")
 {
 $image_link = "images/coupon.gif";
 echo "<img src=\"" . $image_link . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else
 {
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["productcode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["productcode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["productcode"] . ".jpg";
 if (url_exists($image_file_jpg))
 { echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; }
 else if (url_exists($image_file_gif))
 { echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; }
 else
 { echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; } 
 } 
 ?>
 </td> 
   <td width="15%" height="21" align="center">
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["productcode"]; ?>
 </font></p></td>
   <td width="15%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <span id="view_order_details_item<?=$myrow['orderid']?>_<?=$myrow["productcode"]?>_frame"><?php echo $myrow["option"]; ?></span><br />
 </font>
  <?php 
if ($myrow["primaryF"] != "") {
	echo '<br><br><a href="javascript:edit_item_frame(' . $myrow['orderid'] . ', \'' . $myrow['productcode'] . '\')" style="float:right;text-decoration:none;">edit &raquo;</a> </div>';
} 
?>
 </p>
 </td>
   <td width="15%" height="21" align="center" nowrap> 
 <p style="margin-left: 10; margin-right: 10"> 
 <span id="view_order_details_item<?=$myrow['orderid']?>_<?=$myrow["productcode"]?>_qty"><?php echo $myrow["qty"]; ?></span>
 </font>
   <?php 
if ($myrow["primaryF"] != "") {
	echo '<br><br><a href="javascript:edit_item_qty(' . $myrow['orderid'] . ', \'' . $myrow['productcode'] . '\')" style="float:right;text-decoration:none;">edit &raquo;</a> </div>';
} 
?>
 </p></td>
 <td width="15%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 echo $myrow["price"];
 $subTotal = $myrow["qty"] * $myrow["price"];
 echo "<br> Total: $" . number_format($subTotal,2,'.',','); 
 ?>
 </font></p></td>
   </tr>
 <?php } 
 }
 ?>
 <?php
 function display_items_order_return($result) {
 while($myrow = mysql_fetch_array($result))
   {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
	
	if ($myrow["productcode"] == "Tax" || $myrow["productcode"] == "Shipping") continue;
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="20%" height="21" align="center">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1">
 <a href="rma.php?orderType=0&item=<?= $myrow["primary"]; ?>">[return]</a> 
 </font>
 </p></td>
 <td width="20%" height="21">
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php        
 echo "<a href=\"https://www.overstockart.com/" . $myrow["productid"] . ".html\">" . $myrow["productcode"] . "</a><br>";
  ?>
 </font> 
 </td> 
 <td width="20%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php 
 
 
 if ($myrow["productid"] == "Coupon")
 {
 $image_link = "images/coupon.gif";
 echo "<img src=\"" . $image_link . "\" border=\"0\" hspace=\"3\" vspace=\"3\">";
 }
 else
 {
 
 $image_file_gif = "https://www.overstockart.net/sorter/upresent/" . $myrow["productcode"] . ".gif";
 $image_file_jpg = "https://www.overstockart.net/sorter/upresent/" . $myrow["productcode"] . ".jpg";
 $image_file_old_jpg = "https://www.overstockart.net/sorter/upresent-old/" . $myrow["productcode"] . ".jpg";
 if (url_exists($image_file_jpg))
 { echo "<img src=\"" . $image_file_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; }
 else if (url_exists($image_file_gif))
 { echo "<img src=\"" . $image_file_gif . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; }
 else
 { echo "<img src=\"" .  $image_file_old_jpg . "\" border=\"0\" hspace=\"3\" vspace=\"3\">"; }
   
 }
 
 
 
 ?>
 </td> 
   <td width="25%" height="21" align="center">
 <p style="margin-left:10; margin-right:10px;"> 
 <font face="Verdana" size="1"> 
 <?php echo $myrow["productcode"]; ?>
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 Frame: <?php echo $myrow["option"]; ?><br />
 </font></p></td>
   <td width="25%" height="21" align="center"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <?php echo $myrow["qty"]; ?>
 </font></p></td>
 <td width="25%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <?php 
 echo $myrow["price"];
 $subTotal = $myrow["qty"] * substr($myrow["price"],1);
 echo "<br> Total: $" . number_format($subTotal,2,'.',','); 
 ?>
 </font></p></td>
   </tr>
 <?php } 
 }
 ?>
 <?php
 function display_manual_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
			
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$email = $myrow["email"];
	$phone = $myrow["billPhone"];
	$stripPhoneB = preg_replace('/\D+/', '', $phone);
	
	$customerID = "";
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($myrow["status"] == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOrder.php?orderid=<?php echo $myrow["orderid"];?>"><?php echo $myrow["orderid"]; ?></a> <br>
 Date Ordered: 
 <?php 
 echo $myrow["dateOrder"]; 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 if ($myrow["paidDate"] != "")
 {
 echo "<br><br>";
 echo "Date Paid: " . $myrow["paidDate"];
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $email; ?>">
 <?php echo $myrow["email"]; ?></a>
 <br /><br />
 <?php 
//Lookup email in customer list, else append the next customer ID
		if($email != "")
			{
				$dbQueryCustomer = "SELECT `CustomerID` FROM `customerIDs` WHERE `Email` = '$email' LIMIT 1;";
				$resultCustomer = mysql_query($dbQueryCustomer); // or die("Couldn't get the Connectors $dbQueryRef");
				while($rowCID = mysql_fetch_array($resultCustomer)) 
				{ 
				$customerID = "a" . $rowCID[0];
				}			
			}
			if ($customerID =="")
			{
				//Get the next customer ID:
				$dbQueryCustomer = "SELECT `CustomerID` FROM `customerIDs` WHERE 1=1 ORDER BY CustomerID DESC LIMIT 1;";
				$resultCustomer = mysql_query($dbQueryCustomer); // or die("Couldn't get the Connectors $dbQueryRef");
				while($rowCID = mysql_fetch_array($resultCustomer)) 
				{ 
				$lastCustomerID = $rowCID[0];
				$nextID = $lastCustomerID+1;
				}
			
				$customerID = "a" . $nextID;
				$query = "INSERT INTO `customerIDs` (`CustomerID`, `Email`, `Phone`) VALUES ('$nextID', '$email', '$stripPhoneB');";
				mysql_query($query); // or die("Couldn't add row to CustomerIDs $query");
				$nextID++;
			}
 echo "<form name=\"updateCustomerID\" method=\"post\" action=\"updateCustomerID.php\">";
 echo " <b>Customer ID: </b><input type=\"text\" name=\"updateCustomerID\" size=\"8\" value=\"" . $customerID . "\">";
 echo "<input type=\"hidden\" name=\"updateEmail\" value=\"" . $email . "\">";
 echo "<input type='submit' NAME='updateCustomerIDSubmit' value='Update Customer ID' ></form>";
?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["billPhone"];?>&table=manual_orders&thread=<?=  $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=manual_orders&thread=<?=  $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=manual_orders&thread=<?=  $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a> &nbsp;&nbsp;&nbsp;&nbsp;
 <a href="https://app.hubspot.com/contacts/7586134/contact/email/<?= $myrow["email"];?>" target="_blank"><img title="View Contact on Hubspot" alt="View Contact on Hubspot" align="bottom" src="images/hubspot.png" border="0"/></a>

 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewOrder.php?orderid=<?php echo $myrow["orderid"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastManOrder&orderID=<?php echo $myrow["orderid"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["shipName"]; ?><br>
 <?php echo $myrow["shipAdd1"]; ?><br>
 <?php echo $myrow["shipAdd2"]; ?><br>
 <?php echo $myrow["shipCity"] . ", " . $myrow["shipState"] . " " . $myrow["shipZip"]; ?><br>
 <?php echo $myrow["shipCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["shipPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["billName"]; ?><br>
 <?php echo $myrow["billAdd1"]; ?><br>
 <?php echo $myrow["billAdd2"]; ?><br>
 <?php echo $myrow["billCity"] . ", " . $myrow["billState"] . " " . $myrow["billZip"]; ?><br>
 <?php echo $myrow["billCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["billPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["shipping"]; ?><br /><br />
 Shipping Cost:<?php echo $myrow["shipCost"]; ?><br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"phone_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderNum\" value=\"" . $myrow["orderid"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 if ($myrow["tracking6"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking6"] . "\">" . $myrow["tracking6"] . "</a>";
 if ($myrow["tracking7"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking7"] . "\">" . $myrow["tracking7"] . "</a>";
 if ($myrow["tracking8"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking8"] . "\">" . $myrow["tracking8"] . "</a>";
 if ($myrow["tracking9"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking9"] . "\">" . $myrow["tracking9"] . "</a>";
if ($myrow["tracking10"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking10"] . "\">" . $myrow["tracking10"] . "</a>";
 }
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 GIFT MESSAGE:<BR />
 <?php echo $myrow["giftM"]; ?><BR /><br />
 Total: <b><?php echo number_format($myrow["total"],2,'.',','); ?> </b><br /><br />
 Total Charged: <b><?php echo number_format($myrow["chargeU"],2,'.',','); ?> </b>
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_tada_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewTadaOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"];
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_hautelook_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewHautelookOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "UPS Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_kohls_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewKohlsOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "UPS Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_woot_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewWootOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_zulily_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewZulilyOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_groupon_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewGrouponOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date("F j, Y",$myrow["orderDate"]);
 //echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_amazonDropShip_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewAmazonDropShipOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date("F j, Y",$myrow["orderDate"]);
 //echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_wayfair_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewWayfairOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_opensky_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOpenskyOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_houzz_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewHouzzOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_franklinmint_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewFranklinmintOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_fulfillment_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
	$source = $myrow["source"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <?php echo "Order #: " . $orderID; ?> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',$myrow["orderDate"]); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipping"] != "")
 {
 echo $myrow["shipping"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_rue_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewRueOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_sams_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewSamsOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_macys_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewMacysOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_homedepot_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewHomedepotOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 
  <?php 
 function display_lowes_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewLowesOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 
 <?php 
 function display_overstock_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOverstockOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_overstockm_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOverstockMOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 
 <?php 
 function display_AAA_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewAAAOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "FedEx Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_btr_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewBTROrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('D, M j Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "UPS Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_myhabit_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewMyhabitOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('D, M j Y',$myrow["orderDate"]); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "UPS Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_amazonv_order_packingslip($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
    $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
    $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewAmazonvOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <u>Fulfillment Center:</u> <br /><?php echo $myrow["fulfillmentCenter"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 if ($myrow["shipCarrier"] != "")
 {
 echo $myrow["shipCarrier"];
 }
 else
 echo "UPS Ground";
 ?>
 </td>
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_tada_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewTadaOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=tadaOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=tadaOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=tadaOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editTadaOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewTadaOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastTadaOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"tada_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `tadaOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_hautelook_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewHautelookOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=hautelookOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=hautelookOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=hautelookOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editHautelookOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewHautelookOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastHautelookOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"hautelook_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `hautelookOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_kohls_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewKohlsOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=kohlsOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=kohlsOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=kohlsOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editKohlsOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewKohlsOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastKohlsOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"kohls_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `kohlsOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
<?php 
 function display_woot_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewWootOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=wootOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=wootOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=wootOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editWootOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewWootOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastWootOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"woot_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `wootOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
?>
<?php 
 function display_zulily_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewZulilyOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',$myrow["orderDate"]); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=zulilyOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=zulilyOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=zulilyOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editZulilyOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewZulilyOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastZulilyOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"zulily_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `zulilyOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
?>
<?php 
 function display_groupon_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewGrouponOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php echo date("F j, Y",$myrow["orderDate"]); ?>
 <?php 
 //echo date('F j, Y',strtotime($myrow["orderDate"])); 
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=grouponOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=grouponOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=grouponOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editGrouponOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewGrouponOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastGrouponOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"groupon_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `grouponOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
?>
<?php 
 function display_amazonDropShip_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewAmazonDropShipOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php echo date("F j, Y",$myrow["orderDate"]); ?>
 <?php 
 //echo date('F j, Y',strtotime($myrow["orderDate"])); 
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=amazonDropShipOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=amazonDropShipOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=amazonDropShipOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editAmazonDropShipOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewAmazonDropShipOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastAmazonDropShipOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"amazonDropShip_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `amazonDropShipOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
?>
<?php 
 function display_opensky_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOpenskyOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=openskyOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=openskyOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=openskyOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editOpenskyOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewOpenskyOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastOpenskyOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"opensky_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `openskyOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?> 
 
 <?php 
 function display_houzz_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewHouzzOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=houzzOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=houzzOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=houzzOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editHouzzOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewHouzzOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastHouzzOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"houzz_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `houzzOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?> 
 
 <?php 
 function display_franklinmint_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewFranklinmintOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=franklinmintOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=franklinmintOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=franklinmintOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editFranklinmintOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewFranklinmintOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastFranklinmintOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"franklinmint_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `franklinmintOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?> 
 
 <?php 
 function display_wayfair_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewWayfairOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=wayfairOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=wayfairOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=wayfairOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editWayfairOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewWayfairOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastWayfairOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"wayfair_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `wayfairOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_rue_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewRueOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',$myrow["orderDate"]); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=rueOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=rueOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=rueOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editRueOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewRueOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastRueOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"rue_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `rueOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 
 <?php 
 function display_sams_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewSamsOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo $myrow["orderDate"]; 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=samsOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=samsOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=samsOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editSamsOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewSamsOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastSamsOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"sams_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `samsOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_macys_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewMacysOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo $myrow["orderDate"]; 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=macysOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=macysOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=macysOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editMacysOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewMacysOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastMacysOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"macys_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `macysOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_homedepot_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewHomedepotOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo $myrow["orderDate"]; 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=homedepotOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=homedepotOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=homedepotOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editHomedepotOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewHomedepotOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastHomedepotOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"homedepot_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `homedepotOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 
 <?php 
 function display_lowes_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewLowesOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo $myrow["orderDate"]; 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=lowesOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=lowesOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=lowesOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editLowesOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewLowesOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastLowesOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"lowes_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `lowesOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_overstock_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOverstockOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=overstockOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=overstockOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=overstockOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editOverstockOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewOverstockOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastOverstockOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"overstock_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `overstockOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_overstockm_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOverstockMOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=overstockmOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=overstockmOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=overstockmOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editOverstockMOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewOverstockMOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastOverstockMOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"overstockm_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `overstockmOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_AAA_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewAAAOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=AAAOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=AAAOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=AAAOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editAAAOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewAAAOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastAAAOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"AAA_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `AAAOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_btr_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewBTROrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=btrOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=btrOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=btrOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editBTROrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewBTROrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastBTROrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"btr_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `btrOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_myhabit_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewMyhabitOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 <br /><br />
 <a href="javascript:GlobalPopUp('logCall.php?email=<?php echo $myrow["email"];?>&phone=<?= $myrow["bPhone"];?>&table=myhabitOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Log Call" alt="Log Call" align="bottom" src="images/Phone.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:GlobalPopUp('sendEmail.php?email=<?php echo $myrow["email"];?>&table=myhabitOrders&thread=<?= $myrow["primary"];?>',550,400);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Send an Email" alt="Send an Email" align="bottom" src="images/email.gif" border="0"/></a>&nbsp;&nbsp;&nbsp;&nbsp;
 <a href="javascript:GlobalPopUp('taskLog.php?email=<?= $myrow["email"];?>&table=myhabitOrders&thread=<?= $myrow["primary"];?>',400,300);" style="color:#293b74; text-decoration:underline; font-size:10;"><img title="Add Task" alt="Add Task" align="bottom" src="images/task.gif" border="0"/></a>
 <br /><br />
 <a href="editMyhabitOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewMyhabitOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastMyhabitOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"myhabit_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `myhabitOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php 
 function display_amazonv_order_data_full($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewAmazonvOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 <br /><br />
 <a href="editAmazonvOrder.php?orderid=<?php echo $myrow["orderID"]; ?>" style="margin:10px;">
 Edit Order &raquo;</a>
 </td> 
 <td width="20%" height="21"> <p style="margin-left: 10; margin-right: 10"> 
 <a href="viewAmazonvOrder.php?orderid=<?php echo $myrow["orderID"]; ?>">View Order Details</a><br /><br />
 <a href="saleOrder.php?source=pastAmazonvOrder&orderID=<?php echo $myrow["orderID"]; ?>">Make an Order</a><br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td>
 <td width="15%" height="21"> 
 <?php echo $myrow["fulfillmentCenter"]; ?><br>
 </td> 
 <td width="15%" height="21">
<?php echo $myrow["fulfillmentCenter"]; ?><br>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?> 
 <br /><br />
 Ship Date: <?php echo $myrow["shipDate"];  ?> 
 <br />
 Early Delivery Date: <?php echo $myrow["earlyDeliveryDate"];  ?>
<br />
Late Delivery Date: <?php echo $myrow["lateDeliveryDate"];  ?>
<br />
Expected Delivery Date: <?php echo $myrow["expectedDeliveryDate"];  ?>
 <br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"];
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"amazonv_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 if ($myrow["tracking2"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking2"] . "\">" . $myrow["tracking2"] . "</a>";
 if ($myrow["tracking3"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking3"] . "\">" . $myrow["tracking3"] . "</a>";
 if ($myrow["tracking4"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking4"] . "\">" . $myrow["tracking4"] . "</a>";
 if ($myrow["tracking5"] != "")
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking5"] . "\">" . $myrow["tracking5"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `amazonvOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_tada_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewTadaOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?= $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"tada_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `tadaOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_hautelook_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewHautelookOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"hautelook_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `hautelookOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_kohls_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewKohlsOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"kohls_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `kohlsOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_woot_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewWootOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"woot_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `wootOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php
 function display_zulily_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewZulilyOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"zulily_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `zulilyOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php
 function display_groupon_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewGrouponOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date("F j, Y",$myrow["orderDate"]);
 //echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"groupon_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `grouponOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php
 function display_amazonDropShip_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewAmazonDropShipOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date("F j, Y",$myrow["orderDate"]);
 //echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"amazonDropShip_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `amazonDropShipOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php
 function display_wayfair_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewWayfairOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"wayfair_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `wayfairOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_opensky_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOpenskyOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"opensky_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `openskyOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php
 function display_houzz_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewHouzzOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"houzz_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `houzzOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_franklinmint_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewFranklinmintOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"franklinmint_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `franklinmintOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_rue_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewRueOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"rue_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `rueOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 
 <?php
 function display_sams_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewSamsOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"sams_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `samsOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_macys_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewMacysOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"macys_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `macysOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 
 <?php
 function display_homedepot_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewHomedepotOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"homedepot_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `homedepotOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 
 <?php
 function display_lowes_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewLowesOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"lowes_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `lowesOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php
 function display_overstock_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOverstockOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"overstock_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `overstockOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php
 function display_overstockm_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewOverstockMOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"overstockm_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `overstockmOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 
 <?php
 function display_AAA_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewAAAOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"AAA_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `AAAOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_btr_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewBTROrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"btr_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `btrOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
  <?php
 function display_myhabit_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewMyhabitOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',$myrow["orderDateTime"]); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 </td> 
 <td width="10%" height="21"> 
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["email"]; ?>
 </a>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <?php echo $myrow["sName"]; ?><br>
 <?php echo $myrow["sAddress1"]; ?><br>
 <?php echo $myrow["sAddress2"]; ?><br>
 <?php echo $myrow["sCity"] . ", " . $myrow["sState"] . " " . $myrow["sZip"]; ?><br>
 <?php echo $myrow["sCountry"]; ?><br><br />
 <u>Ship Phone:</u> <br /><?php echo $myrow["sPhone"]; ?>
 </td> 
 <td width="15%" height="21">
 <?php echo $myrow["bName"]; ?><br>
 <?php echo $myrow["bAddress1"]; ?><br>
 <?php echo $myrow["bAddress2"]; ?><br>
 <?php echo $myrow["bCity"] . ", " . $myrow["bState"] . " " . $myrow["bZip"]; ?><br>
 <?php echo $myrow["bCountry"]; ?><br><br />
 <u>Bill Phone:</u> <br /><?php echo $myrow["bPhone"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"myhabit_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `myhabitOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php
 function display_amazonv_order_data_invoice($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;
 	$status = $myrow["status"];
	$orderID = $myrow["orderID"];
 	$query4 = "SELECT `color` FROM `status-order` WHERE `status` = '" . $status . "';"; 
 		$status1 = mysql_query($query4);
 		//echo $query4;
 		$row = mysql_fetch_array($status1);
 		$status2 = $row[0];
 ?>
 <tr <? if ($status == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
 <td width="10%" height="21"> 
 <a href="viewMyhabitOrder.php?orderid=<?php echo $orderID;?>"><?php echo $orderID; ?></a> <br>
 Date Ordered: 
 <?php 
 echo date('F j, Y',strtotime($myrow["orderDate"])); 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"]; 
 }
 ?>
 <br /><br />
 <b style="color:<? echo $status2; ?>;">
   Status: <? echo $myrow["status"]; ?>
   <br />
   Condition: <? echo $myrow["condition"]; ?></b>
   <br />
   Availability: <? echo $myrow["availability"]; ?></b>
 </td> 
 <td width="15%" height="21"> 
 <u>Fulfillment Center:</u> <br /><?php echo $myrow["fulfillmentCenter"]; ?>
 </td> 
 <td width="15%" height="21">
 <u>Fulfillment Center:</u> <br /><?php echo $myrow["fulfillmentCenter"]; ?>
 </td> 
 <td width="15%" height="21"> 
 <?php 
 echo $myrow["shipCarrier"]; ?><br /><br />
 Shipping Cost: <?php echo $myrow["shipCost"]; 
 ?>
 <br /><br />
 <?php if ($myrow["tracking"] == "")
 {
 echo "<form name=\"addTrack\" method=\"post\" action=\"myhabit_orders.php\">";
 echo "<input type=\"text\" name=\"updateTrack\" size=\"15\">";
 echo "<input type=\"hidden\" name=\"orderID\" value=\"" . $myrow["orderID"] . "\">";
 echo "<input type='submit' NAME='updateTracking' value='Add Tracking' ></form>";
 }
 else
 {
 echo "<br><a target=\"_blank\" href=\"https://www.fedex.com/fedextrack/?trknbr=" . $myrow["tracking"] . "\">" . $myrow["tracking"] . "</a>";
 }
 
 if ($myrow["shipDate"] != "")
 {
 echo "<br><br>";
 echo "Ship Date: " . $myrow["shipDate"];
 }
 ?>
 </td> 
 <td width="15%" height="21"> 
 <?php
 $totalOrder = 0;
 $query4 = "SELECT `qty`,`Price` FROM `amazonvOrders` WHERE `orderID` = '" . $orderID . "';"; 
 		$totalRows = mysql_query($query4);
 		//echo $query4;
 		while($rowTotal = mysql_fetch_array($totalRows))
		$totalOrder += $rowTotal["Price"]*$rowTotal["qty"]; 
 ?>
 Total: <b><?php echo "$" . number_format($totalOrder,2,'.',','); ?> </b><br /><br />
 </td> 
 </tr>
 <?php } 
 }
 ?>
 
 <?php 
 function display_comission_report($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 $cnt= 1;
 $ngmTotal = 0;
 // Loop Thru Records
 while($myrow = mysql_fetch_array($resultunique))
  {
    $J == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$J == 0 ? $class = "normal" : $class = "normal2";
    $J == 0 ? $J = 1 : $J = 0;
	 
 	$status = $myrow["status"];
 	$query4 = "SELECT color FROM status-order WHERE status= '" . $status . "';"; 
 		$status1 = mysql_query($query4,$db);
 		$row = mysql_fetch_array($status1, MYSQL_NUM);
 		$status2 = $row[0];
 //echo '<div class="record" id="record-' . $myrow["primary"] . '">';
 ?>
 <!--<tr <? if ($myrow["status"] == "Cancelled") echo 'bordercolor="#AE0011"'; ?> onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">-->
 
 <tr <? if ($myrow["status"] == "Cancelled") echo 'bordercolor="#AE0011"'; ?> bgcolor="<? echo $color; ?>">
 
 <!--<td width="10%" height="21"> 
 <input type='checkbox' name='check<?php echo $myrow["orderid"];?>' value='<?php echo $myrow["primary"];?>' checked="checked">
 </td>-->
 <td width="40">
 <?php echo $cnt; 
 // echo '<br><a href="?delete=' . $myrow["primary"] . '" class="delete">Delete</a>';
 echo '<br /><a href="#" onClick="removeComm(' . $myrow["primary"] . ')" style="color:#AE0011;">[delete]</a>';
 ?>
 </td> 
 <td width="80"> 
 <a href="viewOrder.php?orderid=<?php echo $myrow["orderid"];?>" target="_blank"><?php echo $myrow["orderid"]; ?></a> <br>
 Invoice Date: <?php echo $myrow["dateOrder"]; ?>
 </td> 
 <td width="160" style="WIDTH:160px;">
 <a href="mailto:<?php echo $myrow["email"]; ?>">
 <?php echo $myrow["billName"]; ?> <?php //echo $myrow["email"]; ?>
 </a>
 </td> 
 <td width="90"> 
 <B><?php echo $myrow["shipDate"]; ?></B>
 </td>
 <td width="80">
 Total: <b>$<?php echo number_format($myrow["total"],2,'.',','); ?> </b><br /><br />
 Charged: <b>$<?php echo number_format($myrow["chargeU"],2,'.',','); ?> </b>
 <?php
 if ($myrow["storeCredit"] > 0) {
 ?>
 <br /><br />
 Store Credit: <b style="color:#ae0011;">$<?php echo number_format($myrow["storeCredit"],2,'.',','); ?> </b>
 <br /><br />
 Adjusted Gross: <b style="color:#ae0011;">$<?php echo number_format(($myrow["chargeU"] + $myrow["storeCredit"]),2,'.',','); ?> </b>
 <?php
 }
 ?>
 </td>
 <td width="120"> 
 <?php
 if ($myrow["shipCost"] =="")
 $costShip = 0;
 else $costShip = $myrow["shipCost"];
 ?>
 <input type="hidden" name="id<?php echo $myrow["orderid"];?>" value="<?php echo $myrow["primary"];?>">
 <b><input type="text" value="<?= round($costShip,2); ?>" name="costShip<?php echo $myrow["orderid"];?>" size="5" style="margin-left: 10; margin-right: 10"/></b>
 </td>
 <td width="120"> 
 <?php
 $fob = 0;
 $i = 1;
 $html = '';
 $query5 = "SELECT itemNumber,qty,framing FROM `manual_order_items` WHERE `orderID` = '" . $myrow["orderid"] . "'"; 
 //echo $query5;
 		$itemResult = mysql_query($query5);
 	while($row = mysql_fetch_array($itemResult))
 	{
 		$itemNumber = $row[0];
 		$qty = $row[1];
 		$framing = $row[2];
		$html .= $i . ". item #: " . $itemNumber;
 		if ($framing != "")
		{
		$html .= "<br>" . "  frame #: " . $framing;
		}
 	$html .= "<br>";
 	$i++;
 	}
 
 if ($myrow["cost"] =="")
 $cost = 0;
 else $cost = $myrow["cost"];
 echo "<span style=\"font-size:10px; font-family:Arial, Helvetica, sans-serif; color:#333333;\">" . $html . "</span>";
 ?> 
 <b> <input type="text" value="<?= $cost; ?>" name="cogs<?php echo $myrow["orderid"];?>" size="5" style="margin-left: 10; margin-right: 10"/></b>
 </td> 
 <td width="120"> 
 <?php
 $fob = 0;
 $i = 1;
 $html = '';
 $query5 = "SELECT size,qty,framing,framingPrice FROM `manual_order_items` WHERE `orderID` = '" . $myrow["orderid"] . "'"; 
 //echo $query5;
 		$itemResult = mysql_query($query5);
 	while($row = mysql_fetch_array($itemResult))
 	{
 		$size = addslashes($row[0]);
 		$qty = $row[1];
 		$framing = $row[2];
 		//CHECK ON GALLERY WRAP AND STRETCHING
 		$pos1 = strpos(strtoupper($framing),"WRAP");
 		$pos2 = strpos(strtoupper($framing),"GAL");
 		$pos3 = strpos(strtoupper($framing),"STR");
 			
 		$framingPrice = $row[3];
 	$html .= $i . ". Size: " . $size;	
 		//$html .= "Percieved Size: " . intval($size) . "<BR>";	
 		//$html .= "Percieved Size 2: " . str2int($size, false) . "<BR>";
 	if ( str2int($size, false) < 8 ) //8X10
 	{
 		$fob += 1;
 			if ($framingPrice > 0) 
 			{
 			if ($pos1 === false && $pos2 === false && $pos3 === false)
 			{
 			$fob += 3;
 			}
 			$html .= "<br>FR: " . $framing;
 			}
 	} //20X24
 	else if ( str2int($size, false) < 20 ) 
 	{
 		$fob += 1;
 			if ($framingPrice > 0) 
 		{
 			if ($pos1 === false && $pos2 === false && $pos3 === false)
 			{
 			$fob += 5;
 			}
 			$html .= "<br>FR: " . $framing;
 			}
 	} //20X24
 	else if ( str2int($size, false) < 24 ) 
 	{
 		$fob += 1;
 			if ($framingPrice > 0) 
 			{
 			if ($pos1 === false && $pos2 === false && $pos3 === false)
 			{
 			$fob += 5;
 			}
 			$html .= "<br>FR: " . $framing;
 			}
 	}
 	else if ( str2int($size, false) < 30 ) 
 	{
 		$fob += 2;
 			if ($framingPrice > 0) 
 			{
 			if ($pos1 === false && $pos2 === false && $pos3 === false)
 			{
 			$fob += 7;
 			}
 			$html .= "<br>FR: " . $framing;
 			}
 	}
 	else if ( str2int($size, false) >= 30 ) 
 	{
 		$fob += 3;
 			if ($framingPrice > 0) 
 			{
 			if ($pos1 === false && $pos2 === false && $pos3 === false)
 			{
 			$fob += 10;
 			}
 			$html .= "<br>FR: " . $framing;
 			}
 	}
 		
 	$html .= "<br>";
 	$i++;
 	}
 //if already modified...
 if ($myrow["fobChina"] != "")
 {
 $fob = $myrow["fobChina"];
 //echo "!!!!!!!!!!!!!!";
 }
 echo "<span style=\"font-size:10px; font-family:Arial, Helvetica, sans-serif; color:#333333;\">" . $html . "</span>";
 ?>
 <b><input type="text" value="<?= $fob; ?>" name="fob<?php echo $myrow["orderid"];?>" size="5" style="margin-left: 10; margin-right: 10"/></b>
 </td> 
 <td width="120">
 <?php $ngm = $myrow["storeCredit"] + $myrow["chargeU"] - ($myrow["cost"] + $myrow["shipCost"] + $fob); ?> 
 <b>$<?php echo number_format($ngm,2,'.',','); ?></b> 
 </td> 
 </tr>
 <!--</div>-->
 <?php
 $cnt++;
 $ngmTotal += $ngm;
  } 
  
  return $ngmTotal;
 }
 ?>
 <?php
 function str2int($string, $concat = true) {
     $length = strlen($string);   
     for ($i = 0, $int = '', $concat_flag = true; $i < $length; $i++) {
         if (is_numeric($string[$i]) && $concat_flag) {
             $int .= $string[$i];
         } elseif(!$concat && $concat_flag && strlen($int) > 0) {
             $concat_flag = false;
         }       
     }
    
     return (int) $int;
 }
 ?>
 <?php 
 function display_log_call_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;	
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
   <?php
   $colorstatus = "#000000";
   $sqlStatus = "SELECT * FROM `status-call` WHERE `status` = '" . $myrow["Status"] . "' LIMIT 1 ";
   $resultStatus = mysql_query($sqlStatus);
   $myrowStatus = mysql_fetch_array($resultStatus);
   $colorstatus = $myrowStatus['color'];
   ?>
   <td width="20%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;"> 
  <?php echo date("F j, Y",$myrow["Date"]) ; ?>
 </td>   
 <td width="20%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;"> 
 <?php echo $myrow["Status"]; ?>
 </td> 
 
 <td width="20%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;">
 <?php echo $myrow["objective"]; ?>
 </td> 
 
 <td width="20%" height="21" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin-left: 10; margin-right: 10; color:<?= $colorstatus; ?>;"> 
 <?php echo $myrow["Note"]; ?>
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php 
 function display_email_data($resultunique) {
 include ("config.php");
 $sConn = mysql_connect($dbServer, $dbUser, $dbPass) 
 or die("Couldn't connect to database server"); 
 $dConn = mysql_select_db($dbDatabase, $sConn) 
 or die("Couldn't connect to database $dbDatabase");
 // Loop Thru Records
  while($myrow = mysql_fetch_array($resultunique))
   {
     $i == 0 ? $color = "#FFFFFF" : $color = "#DDDDDD";
 	$i == 0 ? $class = "normal" : $class = "normal2";
     $i == 0 ? $i = 1 : $i = 0;	
 ?>
 <tr onMouseOver=this.className='highlight' onMouseOut=this.className='<? echo $class; ?>' bgcolor="<? echo $color; ?>">
   <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
  <?php echo date("F j, Y",$myrow["Date"]) ;
  ?>
 </font> 
 </td>   
 <td width="20%" height="21"> 
 <p style="margin-left: 10; margin-right: 10"> 
 <font face="Verdana" size="1"> 
 <a href="javascript:GlobalPopUp('viewEmail.php?emailId=<?php echo $myrow['Emailid'];?>',550,400);"><?php echo $myrow["Subject"]; ?></a>
 </font> 
 </td> 
 </tr>
 <?php } 
 }
 ?>
 <?php
 function sendMail($email,$subject,$body)
 {
 session_start();
 $Header = "MIME-Version: 1.0\r\n";
 $Header .= "Content-type: text/html; charset=iso-8859-1\r\n";
 $Header .= "From: Brett Parrott <bparrott@overstockart.net>\r\n";
 $Header .= "Reply-To: bparrott@overstockart.net\r\n";
 $Header .= "Bcc: asasson@overstockart.com, bparrott@overstockart.com, eholt@overstockart.com, info@overstockart.com\r\n";
 $Header .= "X-Mailer: PHP/" . phpversion();
 $Body = "<span style=\"font-family: Arial;\">" . $body . "</span>";
 if($_SESSION['admin_username'] == "bparrott")
 {
 $Body .= "<P dir=ltr align=left><FONT face=Arial size=2>Brett Parrott<BR>Sales Manager</FONT></P>";
 }
 $Body .= "<P><FONT face=Arial size=2>US Tel. 1-866-686-1888</FONT><BR><FONT face=Arial size=2>Int. Tel. 00-1-316-631-3999</FONT><BR><A href=\"mailto:" . $_SESSION['admin_email'] . "\"><FONT face=Arial size=2>" . $_SESSION['admin_email'] . "</FONT> </P></A>";
 $Body .= "<A href=\"https://www.overstockArt.com\"><IMG align=\"left\" border=\"0\" src=\"https://site.overstockart.com/images/sig-logo.gif\"></A>";
 echo "The Email: " . $_SESSION['admin_email'] . "<br>";
 echo $Body . "<br>";
 $emailTo = $email; //"sassonamitai@yahoo.com"; //
 // send email to customer
 $success = mail($emailTo, $subject, $Body, $Header);
 // redirect to success page 
 if ($success){
   print "Email Sent Successfully!";
 }
 else{
   print "ERROR IN MAIL";
 }
   
 }
 ?>
 <?php
 function url_exists($url){
         $url = str_replace("https://", "", $url);
         if (strstr($url, "/")) {
             $url = explode("/", $url, 2);
             $url[1] = "/".$url[1];
         } else {
             $url = array($url, "/");
         }
         $fh = fsockopen($url[0], 80);
         if ($fh) {
             fputs($fh,"GET ".$url[1]." HTTP/1.1\nHost:".$url[0]."\n\n");
             if (fread($fh, 22) == "HTTP/1.1 404 Not Found") { return FALSE; }
             else { return TRUE;    }
         } else { return FALSE;}
     }
 ?>
 <?php
 function createthumb($name,$filename,$new_w)
 {
 			$type = getimagesize($name);
 			$type1 = $type[2];
 			//echo $type1;  //jpeg = 2 gif = 1
 			if ($type1 == 1)
             {
                     $src_img=imagecreatefromgif($name);
 					//$filename = $filename . ".gif";  
             }
             else
 			{
 					$src_img=imagecreatefromjpeg($name);
 					//$filename = $filename . ".jpg"; 
             }
   			
   $old_x=imagesx($src_img);
   $old_y=imagesy($src_img);
             $thumb_w= $new_w;
             $thumb_h= ($new_w*$old_y)/$old_x;
  
   $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
   imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); 
   
    if (exif_imagetype($name) == IMAGETYPE_GIF)
 	{
 			imagegif($dst_img,$filename);
     } 
 	else 
 	{
             imagejpeg($dst_img,$filename); 
     }
             imagedestroy($dst_img); 
             imagedestroy($src_img); 			
 return $filename;
 }
 //This function reads the extension of the file. It is used to determine if the file  is an image by checking the extension.
  function getExtension($str) {
          $i = strrpos($str,".");
          if (!$i) { return ""; }
          $l = strlen($str) - $i;
          $ext = substr($str,$i+1,$l);
          return $ext;
  }
  
  
  //FIND THE WIDTH, HEIGHT, LENGTH AND WEIGHT OF THE BOX
  function dimensions($frameSKU,$frameCheck,$frameCheck6,$size,$size8X10) {
         
		 if($size8X10 == "8X10")
					{
					if($frameSKU == "STR-SVC8X10" || $frameCheck6 == "FR-117" || $frameCheck6 == "FR-158" || $frameCheck6 == "FR-530")
						{
						$boxLength = "12";
						$boxWidth = "10";
						$boxHeight = "1";
						$boxWeight = "1";
						}
					else if($frameSKU == "FR-744468X10" )
						{
						$boxLength = "16";
						$boxWidth = "11";
						$boxHeight = "4";
						$boxWeight = "3";	
						}
					else if($frameCheck == "98238X10" || $frameSKU == "FR-93018X10" || $frameSKU == "FR-137B8X10" || $frameSKU == "FR-93958X10" || $frameSKU == "FR-98238X10" || $frameSKU == "FR-99468X10" || $frameSKU == "FR-99488X10" || $frameSKU == "FR-BW743408X10" || $frameSKU == "FR-BW2243048X10" || $frameSKU == "FR-98498X10" || $frameSKU == "FR-BW746908X10" || $frameSKU == "FR-BW22311128X10"|| $frameSKU == "FR-BW74SB8X10" || $frameSKU == "FR-93248X10" || $frameSKU == "FR-2043138X10" || $frameSKU == "FR-M805048X10" || $frameSKU == "FR-M805888X10" || $frameSKU == "FR-H51008X10" || $frameSKU == "FR-34921128X10" || $frameSKU == "FR-BW207278X10" || $frameSKU == "FR-799418X10" || $frameSKU == "FR-807068X10" || $frameSKU == "FR-838108X10" || $frameSKU == "FR-837268X10" || $frameSKU == "FR-837298X10" || $frameSKU == "FR-837308X10" || $frameSKU == "FR-5082008X10" || $frameSKU == "FR-5082258X10" || $frameSKU == "FR-6302258X10" || $frameSKU == "FR-6302008X10" || $frameSKU == "FR-838838X10" || $frameSKU == "FR-906568X10"  || $frameSKU == "FR-687058X10" || $frameSKU == "FR-3209418X10" || $frameSKU == "FR-5868108X10" || $frameSKU == "FR-1041008X10" || $frameSKU == "FR-32542118X10" || $frameSKU == "FR-5522008X10" || $frameSKU == "FR-6878058X10" || $frameSKU == "FR-7870G8X10" || $frameSKU == "FR-7870S8X10" || $frameSKU == "FR-805188X10" || $frameSKU == "FR-838818X10" || $frameSKU == "FR-BW2072738X10" || $frameSKU == "FR-BW22311038X10" || $frameSKU == "FR-G20068X10" || $frameSKU == "FR-X40058X10" || $frameSKU == "FR-X40108X10" || $frameSKU == "FR-X40218X10" || $frameSKU == "FR-X40238X10" || $frameSKU == "FR-744468X10" || $frameSKU == "FR-6262008X10" || $frameSKU == "FR-H50008X10")
						{
						$boxLength = "16";
						$boxWidth = "16";
						$boxHeight = "4";
						$boxWeight = "3";						
						}
						else 
						{
						$boxLength = "28";
						$boxWidth = "24";
						$boxHeight = "4";
						$boxWeight = "4";						
						}
					}
					else if($size == "16X20" || $size == "14X18")
					{
					if($frameSKU == "FR-6996G16X20" || $frameSKU == "FR-240G16X20" || $frameSKU == "FR-X401616X20" || $frameSKU == "FR-X402016X20" || $frameSKU == "FR-M8098616X20" || $frameSKU == "FR-939316X20" || $frameSKU == "FR-20527316X20" || $frameSKU == "FR-20530816X20")
						{	
						$boxLength = "31";
						$boxWidth = "27";
						$boxHeight = "5";
						$boxWeight = "10";
						}
						else
						{
						$boxLength = "28";
						$boxWidth = "24";
						$boxHeight = "4";
						$boxWeight = "4";
						}	
					}
					else if($size == "18X22")  // $frameSKU == "GALWRP18X22"
					{
						$boxLength = "28";
						$boxWidth = "24";
						$boxHeight = "4";
						$boxWeight = "4";
					}						
					else if($size == "20X24" || $frameSKU == "STR-SVC")
					{
						if($frameCheck == "137B20X24" || $frameCheck == "994820X24" || $frameCheck == "930120X24" || $frameCheck == "139G20X24" || $frameCheck == "637G20X24" || $frameCheck == "994620X24" || $frameCheck == "7870G20X24" || $frameCheck == "7870GS20X24" || $frameCheck == "7870S20X24"  || $frameCheck == "994420X24"  || $frameCheck == "EDFI20X24"  || $frameCheck == "EDTI20X24" || $frameCheck == "EDTC20X24" || $frameCheck == "EDBC20X24" || $frameCheck == "REGBLK20X24" || $frameCheck == "REGBLACK20X24" || $frameCheck == "B5W20X24" || $frameCheck == "EDCH20X24" || $frameCheck == "932420X24" || $frameCheck == "939520X24" || $frameCheck == "984920X24" || $frameCheck == "939520X24" || $frameCheck == "125A20X24" || $frameCheck == "982520X24" || $frameSKU == "FR-181GL20X24" || $frameSKU == "FR-215320X24" || $frameSKU == "FR-276G20X24" || $frameSKU == "FR-276S20X24" || $frameSKU == "FR-332G20X24" || $frameSKU == "FR-382G20X24" || $frameSKU == "FR-799420X24" || $frameSKU == "FR-827G20X24" || $frameSKU == "FR-835G20X24" || $frameSKU == "FR-932920X24" || $frameSKU == "FR-994720X24" || $frameSKU == "FR-M8334120X24" || $frameSKU == "FR-M8334220X24" || $frameSKU == "FR-M8050420X24" || $frameSKU == "FR-8070620X24" || $frameSKU == "FR-8050420X24" || $frameSKU == "FR-M8058820X24" || $frameSKU == "FR-982520X24" || $frameSKU == "FR-20431320X24" || $frameSKU == "FR-EDCHG20X24" || $frameSKU == "FR-870901320X24" || $frameSKU == "FR-20430620X24" || $frameSKU == "FR-BW7469020X24" || $frameSKU == "FR-870901520X24" || $frameSKU == "FR-X400720X24" || $frameSKU == "FR-X401620X24" || $frameSKU == "FR-X400820X24" || $frameSKU == "FR-BW74SB20X24" || $frameSKU == "FR-349211220X24" || $frameSKU == "FR-M8334120X24" || $frameSKU == "FR-8388120X24" || $frameSKU == "FR-10410020X24" || $frameSKU == "FR-870901420X24" || $frameSKU == "FR-7994120X24" || $frameSKU == "FR-BW7434020X24" || $frameSKU == "FR-8374720X24" || $frameSKU == "FR-8381020X24" || $frameSKU == "FR-8373020X24" || $frameSKU == "FR-8372920X24" || $frameSKU == "FR-8375720X24" || $frameSKU == "FR-8372620X24" || $frameSKU == "FR-50820020X24" || $frameSKU == "FR-50822520X24" || $frameSKU == "FR-63022520X24" || $frameSKU == "FR-63020020X24" || $frameSKU == "FR-8388320X24" || $frameSKU == "FR-9065620X24" || $frameSKU == "FR-20430420X24" || $frameSKU == "FR-49413020X24" || $frameSKU == "FR-49715120X24" || $frameSKU == "FR-51322520X24" || $frameSKU == "FR-55220020X24" || $frameSKU == "FR-68780520X24" || $frameSKU == "FR-69780720X24" || $frameSKU == "FR-8002220X24" || $frameSKU == "FR-M8334320X24" || $frameSKU == "FR-N11620X24" || $frameSKU == "FR-X400320X24" || $frameSKU == "FR-X400420X24" || $frameSKU == "FR-X400520X24" || $frameSKU == "FR-X401020X24" || $frameSKU == "FR-X402320X24" || $frameSKU == "FR-X402120X24" || $frameSKU == "FR-7444620X24" || $frameSKU == "FR-62620020X24" || $frameSKU == "FR-H500020X24" )
						{
						$boxLength = "31";
						$boxWidth = "27";
						$boxHeight = "5";
						$boxWeight = "10";
						}
						else if($frameSKU == "GALWRP20X24" || $frameSKU == "STR-SVC20X24" || $frameCheck6 == "FR-117" || $frameCheck6 == "FR-158" || $frameCheck6 == "FR-530" || $frameSKU == "FR-128S20X24" || $frameSKU == "FR-927120X24" || $frameSKU == "FR-929820X24" || $frameSKU == "FR-982320X24" || $frameSKU == "FR-120A20X24" || $frameSKU == "FR-BW22430420X24"  || $frameSKU == "FR-BW20727320X24" || $frameSKU == "FR-H510020X24"  || $frameSKU == "FR-BW223111220X24" || $frameSKU == "FR-BW223110320X24" || $frameSKU == "FR-32094120X24" || $frameSKU == "FR-6870520X24" || $frameSKU == "FR-325421120X24" || $frameSKU == "FR-8051820X24" || $frameSKU == "FR-G200620X24" ) 
 						{ //fix frame exception studios and gallery wraps
						$boxLength = "28";
						$boxWidth = "24";
						$boxHeight = "4";
						$boxWeight = "4";						
						}		
						else if($frameCheck == "365G20X24" || $frameCheck == "HF101020X24") 
 						{
						$boxLength = "46";
						$boxWidth = "36";
						$boxHeight = "4";
						$boxWeight = "16";
						}						
						else if($frameCheck == "1013G20X24")
 						{
						$boxLength = "41";
						$boxWidth = "33";
						$boxHeight = "6";
						$boxWeight = "25";
						}				
						else if($frameCheck == "HF101520X24")
 						{
						$boxLength = "54";
						$boxWidth = "44";
						$boxHeight = "6";
						$boxWeight = "25";
						}						
						else
						{
						$boxLength = "35";
						$boxWidth = "31";
						$boxHeight = "5";
						$boxWeight = "12";
						}
					}
					else if($size == "22X22")  // $frameSKU == "GALWRP22X22"
					{
					$boxLength = "28";
					$boxWidth = "24";
					$boxHeight = "4";
					$boxWeight = "4";
					}		
					else if($size == "24X24")
					{
						if($frameSKU == "STR-SVC24X24")
						{
						$boxLength = "27";
						$boxWidth = "31";
						$boxHeight = "5";
						$boxWeight = "10";
						}
						else if($frameSKU == "FR-982324X24" || $frameSKU == "FR-982524X24" || $frameSKU == "FR-20431324X24" || $frameSKU == "FR-M8334224X24" || $frameSKU == "FR-M8334124X24" || $frameSKU == "FR-BW7434024X24" || $frameSKU == "FR-8381024X24" || $frameSKU == "FR-8372624X24" || $frameSKU == "FR-8372924X24" || $frameSKU == "FR-8373024X24" || $frameSKU == "FR-BW22430424X24" || $frameSKU == "FR-530624X24" || $frameSKU == "FR-6870524X24" || $frameSKU == "FR-58681024X24" || $frameSKU == "FR-32094124X24" || $frameSKU == "FR-H500024X24")			{
						$boxLength = "27";
						$boxWidth = "31";
						$boxHeight = "5";
						$boxWeight = "10";
						}
						else if($frameCheck6 == "FR-117" || $frameCheck6 == "FR-158" || $frameCheck6 == "FR-530")
						{
						$boxLength = "29";
						$boxWidth = "31";
						$boxHeight = "5";
						$boxWeight = "10";
						}
						else
						{
						$boxLength = "35";
						$boxWidth = "31";
						$boxHeight = "5";
						$boxWeight = "12";
						}
					}
					else if($size == "24X36" || $size == "22X34")
					{
						if($frameSKU == "GALWRP24X36" || $frameSKU == "GALWRP22X34")
						{
						$boxLength = "29";
						$boxWidth = "31";
						$boxHeight = "5";
						$boxWeight = "10";
						}
						else if($frameSKU == "STR-SVC24X36" || $frameCheck6 == "FR-117" || $frameSKU == "FR-994424X36")
						{
						$boxLength = "35";
						$boxWidth = "31";
						$boxHeight = "5";
						$boxWeight = "12";
						}
						else if ($frameSKU == "FR-530624X36" || $frameSKU == "FR-8388324X36")
						{
						$boxLength = "46";
						$boxWidth = "36";
						$boxHeight = "4";
						$boxWeight = "16";					
						}
						else if ($frameSKU == "FR-994424X36")
						{
						$boxLength = "39.5";
						$boxWidth = "27.5";
						$boxHeight = "2";
						$boxWeight = "16";					
						}
						else if ($frameCheck6 == "FR-530")
						{
						$boxLength = "42.5";
						$boxWidth = "24";
						$boxHeight = "5";
						$boxWeight = "10";							
						}
						else if ($frameCheck6 == "FR-158" || $frameSKU == "FR-927124X36" || $frameSKU == "FR-929824X36" || $frameSKU == "FR-932924X36" || $frameSKU == "FR-982324X36" || $frameSKU == "FR-994424X36" || $frameSKU == "FR-8381024X36" || $frameSKU == "FR-8373024X36" || $frameSKU == "FR-8372924X36" || $frameSKU == "FR-8372624X36" || $frameSKU == "FR-32094124X36" || $frameSKU == "FR-325421124X36" || $frameSKU == "FR-55220024X36" || $frameSKU == "FR-68780524X36" || $frameSKU == "FR-8051824X36" || $frameSKU == "FR-BW20727324X36" || $frameSKU == "FR-BW223110324X36" || $frameSKU == "FR-BW223111224X36" || $frameSKU == "FR-G200624X36" || $frameSKU == "FR-X402124X36" || $frameSKU == "FR-H500024X36")
						{
						$boxLength = "35";
						$boxWidth = "31";
						$boxHeight = "5";
						$boxWeight = "12";						
						}
						else if($frameSKU == "FR-620BP24X36") //  || $frameSKU == "FR-939324X36"
						{
						$boxLength = "50";
						$boxWidth  = "39";
						$boxHeight = "8";
						$boxWeight = "20";
						}
						else if($frameSKU == "FR-6870524X36") //  || $frameSKU == "FR-939324X36"
						{
						$boxLength = "31";
						$boxWidth  = "27";
						$boxHeight = "5";
						$boxWeight = "10";
						}
						else
						{
						$boxLength = "46";
						$boxWidth = "36";
						$boxHeight = "4";
						$boxWeight = "16";
						}
					}
					else if($size == "28X38")  // $frameSKU == "GALWRP18X22"
					{
					$boxLength = "35";
					$boxWidth = "31";
					$boxHeight = "5";
					$boxWeight = "12";
					}		
					else if($size == "30X40")
					{
							if($frameSKU == "GALWRP30X40" || $frameSKU == "GALWRP28X38" || $frameSKU == "STR-SVC30X40") ///fix gallery wrap
							{
						$boxLength = "46";
						$boxWidth = "36";
						$boxHeight = "4";
						$boxWeight = "16";
							}
							else if($frameSKU == "FR-H500030X40") ///fix gallery wrap
							{
						$boxLength = "41";
						$boxWidth = "36";
						$boxHeight = "4";
						$boxWeight = "16";
							}
							else if($frameCheck6 == "FR-117" || $frameCheck6 == "FR-158" || $frameCheck6 == "FR-530" || $frameCheck6 == "FR-807" ||  $frameSKU == "FR-927130X40" || $frameSKU == "FR-929830X40" || $frameSKU == "FR-930130X40" || $frameSKU == "FR-932930X40" || $frameSKU == "FR-939530X40" || $frameSKU == "FR-982330X40" || $frameSKU == "FR-982530X40" || $frameSKU == "FR-994430X40" || $frameSKU == "FR-994630X40" || $frameSKU == "FR-994730X40" || $frameSKU == "FR-994830X40" || $frameSKU == "FR-994830X40" || $frameSKU == "FR-M8058830X40" || $frameSKU == "FR-137B30X40" || $frameSKU == "FR-BW74SB30X40" || $frameSKU == "FR-BW20727330X40" || $frameSKU == "FR-BW22430430X40" || $frameSKU == "FR-20431330X40" || $frameSKU == "FR-984930X40" || $frameSKU == "FR-870901330X40" || $frameSKU == "FR-349211230X40" || $frameSKU == "FR-349211230X40" || $frameSKU == "FR-20430630X40" || $frameSKU == "FR-932430X40" || $frameSKU == "FR-870901430X40" || $frameSKU == "FR-BW7434030X40" || $frameSKU == "FR-7994130X40" || $frameSKU == "FR-H510030X40" || $frameSKU == "FR-10520030X40" || $frameSKU == "FR-420200130X40" || $frameSKU == "FR-BW223111230X40" || $frameSKU == "FR-X400730X40" || $frameSKU == "FR-M8050430X40" || $frameSKU == "FR-X400830X40" || $frameSKU == "FR-BW7469030X40" || $frameSKU == "FR-8381030X40" || $frameSKU == "FR-8372630X40" || $frameSKU == "FR-8372930X40" || $frameSKU == "FR-8373030X40" || $frameSKU == "FR-49413030X40" || $frameSKU == "FR-X402230X40" || $frameSKU == "FR-50820030X40" || $frameSKU == "FR-51322530X40" || $frameSKU == "FR-50822530X40" || $frameSKU == "FR-8388330X40" || $frameSKU == "FR-8388130X40" || $frameSKU == "FR-58681030X40" || $frameSKU == "FR-32094130X40" || $frameSKU == "FR-9065630X40" || $frameSKU == "FR-32094130X40" || $frameSKU == "FR-58681030X40" || $frameSKU == "FR-8388330X40" || $frameSKU == "FR-6870530X40" || $frameSKU == "FR-20430430X40" || $frameSKU == "FR-325421130X40" || $frameSKU == "FR-49715130X40" || $frameSKU == "FR-55220030X40" || $frameSKU == "FR-68780530X40" || $frameSKU == "FR-8002230X40" || $frameSKU == "FR-8051830X40" || $frameSKU == "FR-BW223110330X40" || $frameSKU == "FR-G200630X40" || $frameSKU == "FR-X401030X40" || $frameSKU == "FR-G200630X40" || $frameSKU == "FR-X402330X40" || $frameSKU == "FR-X402130X40" || $frameSKU == "FR-69780730X40" || $frameSKU == "FR-58682030X40" || $frameSKU == "FR-7444630X40" || $frameSKU == "FR-62620030X40" ) ///fix gallery wrap
							{
						$boxLength = "46";
						$boxWidth = "36";
						$boxHeight = "4";
						$boxWeight = "16";
							}
							else
							{
						$boxLength = "54";
						$boxWidth = "44";
						$boxHeight = "6";
						$boxWeight = "25";
						}
					}
					else if ($size == "36X48" || $size == "34X46")
					{
							if($frameSKU == "GALWRP36X48" || $frameSKU == "GALWRP34X46" || $frameCheck6 == "FR-117" || $frameCheck6 == "FR-158" || $frameCheck6 == "FR-530" || $frameSKU == "FR-325421136X48" ) ///fix gallery wraps
							{
						$boxLength = "46";
						$boxWidth = "36";
						$boxHeight = "4";
						$boxWeight = "16";
							}
							else
							{	
						$boxLength = "54";
						$boxWidth = "44";
						$boxHeight = "6";
						$boxWeight = "25";
						}
					}
					else if(substr($frameSKU,0,3) == 'ORM')  // ORM == "Round Mirrors"
					{
					$boxLength = "28";
					$boxWidth = "24";
					$boxHeight = "4";
					$boxWeight = "4";
					}
					
         return array ($boxLength, $boxWidth, $boxHeight, $boxWeight);
  }
  //FIND THE WIDTH, HEIGHT, LENGTH AND WEIGHT OF THE BOX
  function dimensionsArt($size,$size8X10) {
         
		 			if($size8X10 == "8X10")
					{
						$boxLength = "18";
						$boxWidth = "14";
						$boxHeight = "6";
						$boxWeight = "1";						
					}
					else if($size == "16X20")
					{
					$boxLength = "38";
					$boxWidth = "6";
					$boxHeight = "6";
					$boxWeight = "2";
					}	
					else if($size == "20X24")
					{
					$boxLength = "38";
					$boxWidth = "6";
					$boxHeight = "6";
					$boxWeight = "2";
					}
					else if($size == "24X24")
					{
					$boxLength = "38";
					$boxWidth = "6";
					$boxHeight = "6";
					$boxWeight = "2";
					}
					else if($size == "24X36")
					{
					$boxLength = "38";
					$boxWidth = "6";
					$boxHeight = "6";
					$boxWeight = "2";
					}
					else if($size == "30X40")
					{
					$boxLength = "38";
					$boxWidth = "6";
					$boxHeight = "6";
					$boxWeight = "2";
					}
					else if ($size == "36X48")
					{
					$boxLength = "60";
					$boxWidth = "6";
					$boxHeight = "6";
					$boxWeight = "4";
					}
					else if ($size == "11X14")
					{
					$boxLength = "16";
					$boxWidth = "4";
					$boxHeight = "16";
					$boxWeight = "3";
					}
					else if ($size == "X6X12")
					{
					$boxLength = "11";
					$boxWidth = "11";
					$boxHeight = "11";
					$boxWeight = "7";
					}
					else if ($size == "60X70")
					{
					$boxLength = "60";
					$boxWidth = "6";
					$boxHeight = "6";
					$boxWeight = "4";
					}
					else if ($size == "X5" || $size8X10 == "5X")
					{
					$boxLength = "16";
					$boxWidth = "4";
					$boxHeight = "16";
					$boxWeight = "3";
					}
					else 
					{
						$boxLength = "11";
						$boxWidth = "11";
						$boxHeight = "14";
						$boxWeight = "5";						
					}
         return array ($boxLength, $boxWidth, $boxHeight, $boxWeight);
  }
  
    //FIND THE WIDTH, HEIGHT, LENGTH AND WEIGHT OF THE BOX
  function dimensionsMirror($size,$size8X10) {
         
		 			if($size == "24X36")
					{
						$boxLength = "46";
						$boxWidth = "36";
						$boxHeight = "4";
						$boxWeight = "16";				
					}
					else if($size == "22X28")
					{
						$boxLength = "29";
						$boxWidth = "31";
						$boxHeight = "5";
						$boxWeight = "10";
					}
	  return array ($boxLength, $boxWidth, $boxHeight, $boxWeight);
  }
  
    //FIND THE WIDTH, HEIGHT, LENGTH AND WEIGHT OF THE BOX
  function costBoxShipping($boxWeight) {
         
		 			if($boxWeight == "3")
					{
						$shippingCost = "15";				
					}
					else if($boxWeight == "4")
					{
						$shippingCost = "18";	
					}
					else if($boxWeight == "10")
					{
						$shippingCost = "20";	
					}
					else if($boxWeight == "12")
					{
						$shippingCost = "25";	
					}
					else if($boxWeight == "16")
					{
						$shippingCost = "30";	
					}
					else if($boxWeight == "25")
					{
						$shippingCost = "95";	
					}
					
	  return $shippingCost;
  }
  
 ?>
 
 <?php
 function getSizeMolding($framepn)
 {
	 /*$width = 1;
	 $height = 1;*/
     if(stripos($framepn,"20x24"))
     {
         $width = 20;
         $height = 24;
     }
     else if(stripos($framepn,"8x10"))
     {
         $width = 8;
         $height = 10;
     }
     else if(stripos($framepn,"16x20"))
     {
         $width = 16;
         $height = 20;
     }
     else if(stripos($framepn,"24x24"))
     {
         $width = 24;
         $height = 24;
     }
     else if(stripos($framepn,"24x36"))
     {
         $width = 24;
         $height = 36;
     }
     else if(stripos($framepn,"30x40"))
     {
         $width = 30;
         $height = 40;
     }
     else if(stripos($framepn,"36x48"))
     {
         $width = 36;
         $height = 48;
     }
	 else {
		 $pos_x = stripos($framepn,'X');
		 //echo "pos_x: " . $pos_x . "<br>";
		 $width = substr($framepn, $pos_x+1,2);
		 $height = substr($framepn, $pos_x-2,2);
		 //echo "width: " . $width . " height: " . $height . "<br>";
	 }
	 
	 
     return round((($width*2 + $height*2)*1.2)/12,2);
 }
 ?>
 
 
  <?php
 function getFrameArea($framepn)
 {
	 /*$width = 1;
	 $height = 1;*/
     if(stripos($framepn,"20x24"))
     {
         $width = 20;
         $height = 24;
     }
     else if(stripos($framepn,"8x10"))
     {
         $width = 8;
         $height = 10;
     }
     else if(stripos($framepn,"16x20"))
     {
         $width = 16;
         $height = 20;
     }
     else if(stripos($framepn,"24x24"))
     {
         $width = 24;
         $height = 24;
     }
     else if(stripos($framepn,"24x36"))
     {
         $width = 24;
         $height = 36;
     }
     else if(stripos($framepn,"30x40"))
     {
         $width = 30;
         $height = 40;
     }
     else if(stripos($framepn,"36x48"))
     {
         $width = 36;
         $height = 48;
     }
	 else {
		 $pos_x = stripos($framepn,'X');
		 //echo "pos_x: " . $pos_x . "<br>";
		 $width = substr($framepn, $pos_x+1,2);
		 $height = substr($framepn, $pos_x-2,2);
		 //echo "width: " . $width . " height: " . $height . "<br>";
	 }
	 
	 
     return $width*$height;
 }
 ?>