<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */

  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
 $dirsToCheck = array('/hsphere/local/home/c382004/rcartierperry.com/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

   list($common_informationRecords, $common_informationMetaData) = getRecords(array(
    'tableName'   => 'common_information',
'allowSearch' => false,
    'limit'       => '1',
  ));
  $common_informationRecord = @$common_informationRecords[0]; // get first record

 list($store_inventoryRecords, $store_inventoryMetaData) = getRecords(array(
    'tableName'   => 'store_inventory',
     'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',

  ));
  $store_inventoryRecord = @$store_inventoryRecords[0]; // get first record

  list($google_font_namesRecords, $google_font_namesMetaData) = getRecords(array(
    'tableName'   => 'google_font_names',
  ));
  list($navigation_menu_linksRecords, $navigation_menu_linksMetaData) = getRecords(array(
    'tableName'   => 'navigation_menu_links',
    'loadUploads' => true,
    'allowSearch' => false,
  ));
  
  showme($store_inventoryRecord);
exit;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>R. &nbsp; C a r t i e r &nbsp; P e r r y</title>
<meta name="robots" content="index,follow" />
<link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
<meta name="description" content="<?php echo $common_informationRecord['site_description'] ?>">
<meta name="keywords" content="<?php echo $common_informationRecord['site_keywords'] ?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/perry.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/slideshow.css">
<script src="Scripts/mootools-1.3.2-core.js"></script>
<script src="Scripts/mootools-1.3.2.1-more.js"></script>
<link rel="stylesheet" type="text/css" href="css/fonts.css.php" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php 
    $output = ''; 
    foreach ($google_font_namesRecords as $record) { $record['name'] = preg_replace("/[, ]/", "+", $record['name']);
      $output .= $record['name'] . "|"; 
    } 
    $output = rtrim($output,"|"); // remove trailing pipe 
    print $output; 
?>">
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
//-->
</script>
</head>

<body>
<table width="52%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><br />
      <hr align="left" width="85%" color="#<?php echo $common_informationRecord['line_color'] ?>" /></td>
  </tr>
  <tr>
    <td><table align="left" width="85%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td style="text-shadow: 2px 2px 2px #<?php echo $common_informationRecord['drop_shadow_color'] ?>" align="center" valign="middle"><a href="index.php"><span class="masthead_font" >R. Cartier Perry</span></a></td>
          <td><img src="images/clear.gif" alt="" width="25" height="25" /></td>
          <?php foreach ($navigation_menu_linksRecords as $record): ?>
          <td align="left" valign="middle"><a href="<?php echo htmlencode($record['linked_page']) ?>"><span class="navigation_font"><?php echo htmlencode($record['title']) ?></span></a></td>
          <td><img src="images/clear.gif" alt="" width="25" height="25" /></td>
          <?php endforeach ?>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td><hr align="left" width="85%" color="#<?php echo $common_informationRecord['line_color'] ?>" />
      <br /></td>
  </tr>
  <tr>
    <td><table width="85%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td align="left" valign="top"><table  align="center" cellpadding="15">
              <tr>
                <td valign="top">
               <table width="600">
               <tr><td colspan="2">
               <div align="center"> <br />
                    <?php if ($store_inventoryRecord ['image_shape'] == "Horizontal"): ?>
                    <?php foreach ($store_inventoryRecord['image'] as $upload): ?>
                    <img src="<?php echo $upload['thumbUrlPath2'] ?>" width="<?php echo $upload['thumbWidth2'] ?>" height="<?php echo $upload['thumbHeight2'] ?>" alt="" />
                   <?php break?> <?php endforeach ?>
                    <?php endif ?>
                    <?php if ($store_inventoryRecord ['image_shape'] == "Vertical"): ?>
                    <?php foreach ($store_inventoryRecord['image'] as $upload): ?>
                    <img src="<?php echo $upload['thumbUrlPath2'] ?>" width="<?php echo $upload['thumbWidth2'] ?>" height="<?php echo $upload['thumbHeight2'] ?>" alt="" />
                     <?php break?><?php endforeach ?>
                    <?php endif ?>
                    <?php if ($store_inventoryRecord ['image_shape'] == "Square"): ?>
                    <?php foreach ($store_inventoryRecord['image'] as $upload): ?>
                    <img src="<?php echo $upload['thumbUrlPath2'] ?>" width="<?php echo $upload['thumbWidth2'] ?>" height="<?php echo $upload['thumbHeight2'] ?>" alt="" />
                     <?php break?><?php endforeach ?>
                    <?php endif ?>
                    <br />
                    <p align="center"></p>
                  </div>
                  </td></tr>
                  <tr><td colspan="2">
				  <?php $colors1 = join(', ', $store_inventoryRecord['colors:labels']); ?>
                  <span class="navigation_font">Available Colors: <?php echo $colors1 ?></span><br /></td></tr>
                  <tr>
                   <?php foreach ($store_inventoryRecord['image'] as $upload): ?>
				   <?php $info1 = $upload['info1'] ?>
				   <?php if(strpos($colors1, $info1)):?>
                   <td align="center">
                  <span class="sub_heading_font"><?php echo $upload['info1'] ?></span><br /> 
                  <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
                  </td>
                   <?php endif ?>
				   <?PHP $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr><?PHP endif; ?>
                   <?php endforeach ?>
                </tr>
                  
                  </table>
                  <?php if ($store_inventoryRecord['artwork_for_sale_on_line'] == 1): ?>
                  <div align="center"><br /><img src="images/paypal-logo.jpg" alt="" border="0" height="99" width="100" /></div>
                  <?php endif ?>
                  &nbsp;</td>
                <td valign="top"><p align="center"><span <?php if($common_informationRecord['use_drop_shadows_on_page_headings']):?>style="text-shadow: 2px 2px 2px #<?php echo $common_informationRecord['drop_shadow_color'] ?>" <?php endif ?> align="center" valign="top" class="masthead_font"><?php echo $store_inventoryRecord['title'] ?></span><br />
                  
                  <div align="center">
                    <?php if ($store_inventoryRecord['size_of_work']): ?>
                    <br />
                    <span class="text_font"><b>Size: </b><?php echo $store_inventoryRecord['size_of_work'] ?></span>
                    <?php endif ?>
                    <?php if ($store_inventoryRecord['medium']): ?>
                    <br />
                    <span class="text_font"><b>Medium:</b> </span> <span class="text_font"><?php echo $store_inventoryRecord['medium'] ?></span>
                    <?php endif ?>
                    <?php if ($store_inventoryRecord['year_created']): ?>
                    <br />
                    <span class="text_font"><b>Created in:</b> </span><span class="text_font"><?php echo $store_inventoryRecord['year_created'] ?></span>
                    <?php endif; ?>
                    <?php if ($store_inventoryRecord['edition_size']): ?>
                    <br />
                    <span class="text_font"><b>Edition of: </b></span><span class="text_font"><?php echo $store_inventoryRecord['edition_size'] ?></span>
                    <?php endif ?>
                    <?php if ($store_inventoryRecord['artwork_for_sale_on_line'] == 1 || $store_inventoryRecord ['sold'] == 1): ?>
                    <?php if ($store_inventoryRecord['price_of_work']): ?>
                    <br />
                    <span class="text_font"><b>Price:</b> $<?php echo $store_inventoryRecord['price_of_work'] ?></span>
                    <?php elseif ($store_inventoryRecord ['sold'] == 1): ?>
                    <br />
                    <?php foreach ($common_informationRecord['red_dot'] as $upload2): ?>
                    <img src="<?php echo $upload2['thumbUrlPath2'] ?>" width="<?php echo $upload2['thumbWidth2'] ?>" height="<?php echo $upload2['thumbHeight2'] ?>" alt="" />
                    <?php endforeach ?>
                    - <span class="text_font"><b>temporarily sold out</b></span>
                    <?php endif ?>
                  </div>
                  <br />
                  <?php endif ?>
                  <br />
                  <?php if ($store_inventoryRecord['work_description']): ?>
                  <br />
                  <div style="text-align:left" class="text_font"><?php echo $store_inventoryRecord['work_description'] ?></span>
                    <?php endif ?>
                  </div>
                  <br />
                  <br />
                  <?php if ($store_inventoryRecord ['artwork_for_sale_on_line'] == 0 || $store_inventoryRecord ['sold'] == 1): ?>
                  <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                  </table>
                  <?php endif ?>
                  <?php if ($store_inventoryRecord ['artwork_for_sale_on_line'] == 1 && $store_inventoryRecord ['sold'] == 0): ?>
                  <table width="233" border="0" align="center" cellpadding="5" cellspacing="2">
                    <tr>
                      <td align="center" width="219"><span class="small_text_font">
                        <?php if ($store_inventoryRecord ['special_note']): ?>
                        <?php echo $store_inventoryRecord['special_note'] ?><br />
                        <br />
                        </span>
                        <?php endif ?>
                        <a target="_blank" class="special" href="terms_of_sale.php"><span class="navigation_font"><u>Terms of Sale</u></span><br />
                        </a></td>
                    </tr>
                    
                    <tr>
                      <td align="center" width="219"><form name='cart101' action="https://www.paypal.com/cgi-bin/webscr" 
 method="post" 
 onsubmit="return PackageForm(this);">
                          <input type="hidden" name="business" value="<?php echo $common_informationRecord['paypal_payment_e_mail_address'] ?>">
                          <input type="hidden" name="cmd" value="_cart">
                          <input type="hidden" name="shopping_url" value="http://www.rcartierperry.com/store.php">
                          <input type="hidden" name="add" value="1">
                          <input type="hidden" name="no_note" value="1">
                          <input type="hidden" name="no_shipping" value="0">
                          <input type="hidden" name="cpp_header_image" value="http://www.rcartierperry.com/images/rcppp.jpg">
                          <input type="hidden" name="currency_code" value="USD">
                          <input type="hidden" name="lc" value="US">
                          <input type="hidden" name="bn value" value="PP-ShopCartBF">
                          <input type="hidden" name="alt" value="Buy%20an%20Item">
                          <input type="hidden" name="item_name" value="<?php echo $store_inventoryRecord['paypal_description'] ?>">
                          <input type="hidden" name="amount" value="<?php echo $store_inventoryRecord['price_of_work'] ?>">
                          <input type="hidden" name="on1" value="Color">
                        
   <?php  // load record from 'store_inventory'
  list($colors, $store_inventoryMetaData) = getRecords(array(
    'tableName'   => 'store_inventory',
         'where'       => whereRecordNumberInUrl(1),
    'loadUploads' => true,
    'allowSearch' => false,
    'limit'       => '1',
  ));
   ?>                    
  <?php $available_colors = $colors['0'];

  //Create a drop down list by combining the values and labels into one array
  $dropList = array_combine($available_colors['colors:values'], $available_colors['colors:labels']);

  ?>
  <select name="os1">
    <option value="">Please Choose a Color</option>
    <!-- cycle through drop list to create options -->
    <?php foreach($dropList as $value => $label): ?>
      <option value = " <?php echo $label; ?>" <?php selectedIf($value, @$_REQUEST['colors']);?>> <?php echo $label; ?></option>
    <?php endforeach; ?>
  </select>
                           
                          <br />
                          <br />
                          <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but10.gif" 
 name="submit" 
 alt="Make payments with PayPal - it's fast, free and secure!">
                        </form>
                        <br />
                        <span class="text_font">Or</span><br />
                        <br />
                        <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
                          <input name="cmd" value="_cart" type="hidden" />
                          <input name="business" value="<?php echo $common_informationRecord['paypal_payment_e_mail_address'] ?>" type="hidden" />
                          <input src="https://www.paypal.com/en_US/i/btn/btn_viewcart_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" border="0" type="image" />
                          <input name="cpp_header_image" value="http://www.rcartierperry.com/images/rcppp.jpg" type="hidden" />
                          <input name="display" value="1" type="hidden" />
                        </form></td>
                    </tr>
                  </table>
                  <?php endif ?>
            </table></td>
        </tr>
        <tr>
          <td  valign="middle"><div align="right"><br />
              <?php if ($common_informationRecord['disclaimer']): ?>
              <a  href="disclaimer.php"><span class="style1">Read This First</span></a><br />
              <?php endif ?>
              <span class="style1">© R. Cartier Perry <?php echo date("Y") ?> -  All Rights Reserved</span> </div></td>
        </tr>
      </table></td>
  </tr>
</table>
8
</body>
</html>
