<?php
include("src/Dealhot.php");
include("config.php");

$action = 'deal_record';
$this_photo = '';
$rest_data = array(
  'productID' => $id
); 
$Dealhot = new Dealhot($auth_arr,$action,$rest_data);
$result_arr = $Dealhot->go();

if($result_arr["result"]=="fail"){
  $msg = 'You have failed to retrive a deal record. Reason: '.$result_arr["error"];
}
else{
  $photo = $result_arr['photo'.$photo_index];
  if($photo!="")
    $this_photo = '<img src="'.$Dealhot->get_photo($photo,$result_arr["pDate"]).'" alt="deal"/>';
  
  $submenu = '<a href="deal_edit.php?id='.$id.'">[text][img'.($i+1).']</a> ';
    else
      $submenu .= '<a href="deal_photo.php?id='.$result_arr["productID"].'&photo_index='.$i.'&pDate='.$result_arr["pDate"].'">[+ img'.($i+1).']</a> ';
  }
  $submenu .= '<a target="_blank" href="'.$Dealhot->product_url($id).'">[preview]</a>';
}
?>