Ejemplo n.º 1
6
 function itemLikeSum($itemID)
 {
     $re = UserLike::userlike_sum($itemID);
     $line = mysql_fetch_array($re);
     $data = array('id' => $itemID);
     $re2 = mysql_fetch_array(ItemInfo::ItemInfo_select($data, 1));
     $water = $re2['stockNum'];
     //加水收藏
     $sum = $line[0] + $water;
     return $sum;
 }
Ejemplo n.º 2
0
 function itemUpdate($id, $data = array())
 {
     $su = new ItemInfo();
     $condition = '`id`=' . $id;
     $r = $su->iteminfo_update($data, $condition);
     return mysql_fetch_assoc($r);
 }
Ejemplo n.º 3
0
 function search_admin($key, $type, $page)
 {
     $string = "`id` LIKE '%{$key}%' || `describe` LIKE '%{$key}%' ORDER BY `id`";
     $num = 50;
     $limit = ($page - 1) * $num;
     $limit .= ',' . $num;
     $re = new ItemInfo();
     $data = $re->iteminfo_select_like($string, $limit);
     return $data;
 }
Ejemplo n.º 4
0
 function recommend($pageId, $uid = null)
 {
     $itemsNum = 4;
     //控制次调用返回的数据数量$itemsNum-1个
     $from = $itemsNum * ($pageId - 1);
     $to = $itemsNum;
     $limit = ' ' . $from . ',' . $to . ' ';
     // 每页4条数据
     if (isset($uid)) {
         $items = UserLikeModel::getUserItems($uid);
         $arr = array('isRecommend' => 1);
         $orderby = '`itemPic desc`';
         $re = ItemInfo::iteminfo_select_ordby($arr, $orderby, $limit);
         $data = array();
         while ($line = mysql_fetch_array($re, MYSQL_ASSOC)) {
             if (in_array($line['id'], $items)) {
                 $line['isFavorite'] = 1;
             } else {
                 $line['isFavorite'] = 0;
             }
             $data[] = $line;
         }
         return $data;
     } else {
         $arr = array('isRecommend' => 1);
         $orderby = '`itemPic desc`';
         $re = ItemInfo::iteminfo_select_ordby($arr, $orderby, $limit);
         $data = array();
         while ($line = mysql_fetch_array($re, MYSQL_ASSOC)) {
             $line['isFavorite'] = 0;
             $data[] = $line;
         }
         return $data;
     }
 }
Ejemplo n.º 5
0
 function relatedItems($itemID, $pageId, $uid = null)
 {
     $arr = array('id' => $itemID);
     $re = ItemInfo::iteminfo_select($arr, $limit);
     $data = array();
     $line = mysql_fetch_array($re, MYSQL_ASSOC);
     $items = $line['relatedItems'];
     if (!empty($items)) {
         $ids = explode(",", $items);
         $data = array();
         foreach ($ids as $key => $value) {
             //取字段,分隔处理....
             $arr = array('id' => $itemID);
             $itemsNum = 5;
             //控制次调用返回的数据数量$itemsNum-1个
             $from = $itemsNum * ($pageId - 1);
             $to = $itemsNum * $pageId - 1;
             $limit = ' ' . $from . ',' . $to . ' ';
             // 每页4条数据
             $re = ItemInfo::iteminfo_select($arr, $limit);
             while ($line = mysql_fetch_array($re, MYSQL_ASSOC)) {
                 $favorite = self::isFavorite($itemID, $uid);
                 $data[] = array($value => array('itemName' => $line['itemName'], 'itemPrice' => $line['itemPrice'], 'itemPic' => $line['itemPic'], 'isFavorite' => $favorite));
             }
         }
     }
     return $data;
 }
Ejemplo n.º 6
0
 public function Decode($buf = '')
 {
     $this->buffer = new CodeEngine($buf);
     $this->DstUIN = $this->buffer->DecodeInt32();
     $this->DstAccount = $this->buffer->DecodeString();
     $this->ItemCount = $this->buffer->DecodeInt16();
     for ($i = 0; $i < $this->ItemCount; $i++) {
         $this->ItemInfos[] = ItemInfo::decode_item_info($this->buffer);
     }
     $this->NofifyTransparentDataSize = $this->buffer->DecodeInt16();
     if ($this->NofifyTransparentDataSize > 0) {
         $this->NofifyTransparentData = $this->buffer->DecodeMemory($this->NofifyTransparentDataSize);
     }
     return $this;
 }
Ejemplo n.º 7
0
<?php

require_once '/var/www/git/application/models/data/ItemInfo.php';
//获取商品信息为空的
$items = new ItemInfo();
$key = '`id`';
$string = '1=1';
$limit = 1000;
$re = array();
$result = $items->iteminfo_select_key($key, $string, $limit);
$count = 0;
$group = 1;
while ($r = mysql_fetch_array($result, true)) {
    $re[$group][] = $r['id'];
    $count++;
    if ($count == 50) {
        $group++;
        $count = 0;
        continue;
    }
}
//请求内容
$token = 'mengchun';
$appkey = '23182322';
$secret = '0bfab4f09119f33ebabb8348d314ceeb';
$tb_result = null;
if (!is_null($re)) {
    foreach ($re as $key => $value) {
        $ids = implode(',', $value);
        $url = 'http://nuannuangouwu-1.wx.jaeapp.com/?token=' . $token . '&appkey=' . $appkey . '&secret=' . $secret . '&ids=' . $ids;
        $ch = curl_init($url);
Ejemplo n.º 8
0
function PageContent()
{
    $item = new Item($_REQUEST['item']);
    $category = new Category($item->CategoryId);
    ?>
    
        <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                // fix to preserve width of cells
                var fixHelper = function(e, ui) {
                    ui.children().each(function() {
                        $(this).width($(this).width());
                    });
                    return ui;
                };
                var saveIndex = function(e, ui) {
                    //alert("New position: " + ui.item.index());
                    //alert("Image Id: " + ui.item.attr("id"));
                    id = ui.item.attr("id").replace("img_", "");
                    $.ajax({
                        url: 'itemimage_list.php',
                        data: {
                            dragsort: 1,
                            idx: ui.item.index(),
                            id: id
                        },
                        type: 'POST',
                        dataType: 'html',
                        success: function (data) {
                            //alert("done");
                        },
                        error: function (xhr, status) {
                            alert('Sorry, there was a problem!');
                        }
                    });
                }; // end saveIndex
    
                $("#list_table tbody").sortable({
                    helper: fixHelper,
                    stop: saveIndex
                }).disableSelection();
    
            }); // end document.ready
        </script>
        <style>
            .icon-resize-vertical:hover {
                cursor:grab;
            }
        </style>        
    
            <div class="layout center-flex">

                <?php 
    $aLabels = array();
    $aLinks = array();
    $aLabels[0] = 'Home';
    $aLinks[0] = 'mainpage.php';
    $aLabels[1] = $category->CategoryName;
    $aLinks[1] = 'item_list.php?cat=' . $category->Id;
    $aLabels[2] = $item->ItemName;
    $aLinks[2] = '';
    echo Helpers::CreateBreadCrumbs($aLabels, $aLinks);
    ?>

<!-- 
                <div class="bigbotspace flex-container space-between">
                    <p class="larger auto heading"><?php 
    echo $item->ItemName;
    ?>
 Images</p>
                    <a href="itemimage_admin.php?item=<?php 
    echo $_REQUEST['item'];
    ?>
" class="button_link"><button class="">Add New Item Image</button></a>
                </div>
 -->
            </div>
    
            <div class="layout">
    
                <table class="tablestyle">
                    <thead>
                        <tr>
                            <th colspan="2">Item Settings&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="item_admin.php?id=<?php 
    echo $item->Id;
    ?>
"><img src="img/edit-icon.png" /></a></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>Item Name:</td>
                            <td><?php 
    echo $item->ItemName;
    ?>
</td>
                        </tr>
                        <tr>
                            <td>Background Color:</td>
                            <td><?php 
    echo $item->BackgroundColor;
    ?>
</td>
                        </tr>
                        <tr>
                            <td>Contact Email:</td>
                            <td><?php 
    echo $item->ContactEmail;
    ?>
</td>
                        </tr>
                    </tbody>
                </table>
                    
            </div> <!-- layout -->

			<div class="all-section-separator"></div>
			
            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                    	<tr>
                    		<th colspan="5">Item Images</th>
                    	</tr>
                    </thead>
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Side</th>
                            <th>Image</th>
                            <th>Hotspots</th>
<!-- 
                            <th class="mid">Order</th>
 -->
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objItemImage = new ItemImage();
    $objItemImageHighlight = new ItemImageHighlight();
    $oItemImage = $objItemImage->getAllItemImageByItemId($_REQUEST['item']);
    foreach ($oItemImage as $itemimage) {
        echo '<tr id="img_' . $itemimage->Id . '">' . PHP_EOL;
        echo '<td>' . $itemimage->Id . '</td>' . PHP_EOL;
        echo '<td>' . $itemimage->ItemImageSide . '</td>' . PHP_EOL;
        echo '<td><img src="/' . $itemimage->GetPath() . $itemimage->ItemImageUrl . '" style="width:80px;"></td>' . PHP_EOL;
        echo '<td>';
        $hcount = $objItemImageHighlight->getCountItemImageHighlightByItemImageId($itemimage->Id);
        //echo '<a href="itemimagehotspot.php?img=' . $itemimage->Id . '">' . $hcount . ' Hotspots</a>';
        // note: above hotspot admin would be pretty complicated from a user perspective (x, y, dimensions, image).
        //       therefore, not implementing now. - Jay
        echo $hcount . ' Hotspots</a>';
        echo '</td>' . PHP_EOL;
        //                             echo '<td class="mid"><img src="img/arrow-up-down.png" /></td>' . PHP_EOL;
        echo '<td class="mid"><a href="itemimage_admin.php?id=' . $itemimage->Id . '" style="width:200px;"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="itemimage_delete.php?id=' . $itemimage->Id . '"><img src="img/delete-icon.png" /></a></td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->

			<div class="all-section-separator"></div>

            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                    	<tr>
                    		<th colspan="4">Item Infos</th>
                    	</tr>
                    </thead>
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Category</th>
                            <th>Text</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objItemInfo = new ItemInfo();
    $objItemInfoType = new ItemInfoType();
    $item_info_types = $objItemInfoType->GetAllItemInfoType();
    $objItemInfoImage = new ItemInfoImage();
    foreach ($item_info_types as $type) {
        $oItemInfo = $objItemInfo->GetAllItemInfoByItemIdItemInfoTypeId($_REQUEST['item'], $type->Id);
        $item_info = $oItemInfo[0];
        echo '<tr>' . PHP_EOL;
        echo '<td>' . $item_info->Id . '</td>' . PHP_EOL;
        echo '<td>' . $type->ItemInfoTypeName . '</td>' . PHP_EOL;
        echo '<td>' . strip_tags($item_info->ItemInfo) . '</td>' . PHP_EOL;
        echo '<td class="mid"><a href="iteminfotype_admin.php?id=' . $item_info->Id . '" style="width:200px;"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="iteminfotype_delete.php?id=' . $item_info->Id . '"><img src="img/delete-icon.png" /></a> (not working)</td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->

			<div class="all-section-separator"></div>

            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                    	<tr>
                    		<th colspan="4">Item Info Images</th>
                    	</tr>
                    </thead>
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Image</th>
                            <th>&nbsp;</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objItemInfoImage = new ItemInfoImage();
    $oItemInfoImage = $objItemInfoImage->GetAllItemInfoImageByItemId($_REQUEST['item']);
    foreach ($oItemInfoImage as $image) {
        echo '<tr>' . PHP_EOL;
        echo '<td>' . $image->Id . '</td>' . PHP_EOL;
        echo '<td><img src="/' . $image->GetPath() . $image->ItemInfoImageUrl . '" style="height:60px;"></td>' . PHP_EOL;
        echo '<td>' . '&nbsp;' . '</td>' . PHP_EOL;
        echo '<td class="mid"><a href="iteminfoimage_admin.php?id=' . $image->Id . '" style="width:200px;"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="iteminfoimage_delete.php?id=' . $image->Id . '"><img src="img/delete-icon.png" /></a> (not working)</td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->
            			
			<div class="all-section-separator"></div>

            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                    	<tr>
                    		<th colspan="5">Item Videos</th>
                    	</tr>
                    </thead>
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Title</th>
                            <th>URL</th>
                            <th>Image</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objItemVideo = new ItemVideo();
    $oItemVideo = $objItemVideo->GetAllItemVideoByItemId($_REQUEST['item']);
    foreach ($oItemVideo as $video) {
        echo '<tr>' . PHP_EOL;
        echo '<td>' . $video->Id . '</td>' . PHP_EOL;
        echo '<td>' . $video->ItemVideoTitle . '</td>' . PHP_EOL;
        echo '<td>' . $video->ItemVideoUrl . '</td>' . PHP_EOL;
        echo '<td><img src="/' . $video->GetPath() . $video->ItemVideoPlaceholderImageUrl . '" style="height:60px;"></td>' . PHP_EOL;
        echo '<td class="mid"><a href="itemvideo_admin.php?id=' . $video->Id . '" style="width:200px;"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="itemvideo_delete.php?id=' . $video->Id . '"><img src="img/delete-icon.png" /></a> (not working)</td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->
						
			<div class="all-section-separator"></div>

<?php 
    // this section disabled because added item_gallery table.
    ?>
<!-- 
            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                    	<tr>
                    		<th colspan="4">Item Gallery Images</th>
                    	</tr>
                    </thead>
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Description</th>
                            <th>Image</th> 
                            <th class="mid">Order (comment out)</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objItemGalleryImage = new ItemGalleryImage();
    $oItemGalleryImage = $objItemGalleryImage->getAllItemGalleryImageByItemId($_REQUEST['item']);
    foreach ($oItemGalleryImage as $image) {
        echo '<tr id="img_' . $image->Id . '">' . PHP_EOL;
        echo '<td>' . $image->ItemGalleryImageDescription . '</td>' . PHP_EOL;
        echo '<td><img src="/' . $image->GetPath() . $image->ItemGalleryImageUrl . '" style="width:80px;"></td>' . PHP_EOL;
        //                             echo '<td class="mid"><img src="img/arrow-up-down.png" /></td>' . PHP_EOL;
        echo '<td class="mid"><a href="itemgalleryimage_admin.php?id=' . $image->Id . '" style="width:200px;"><img src="img/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="itemgalleryimage_delete.php?id=' . $image->Id . '"><img src="img/delete-icon.png" /></a> (not working)</td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!~~ layout ~~>
 -->
			
			<p>Presentations:</p>

<?php 
}
Ejemplo n.º 9
0
 function numForHuman($gender = 0)
 {
     $re = ItemInfo::iteminfo_select_count($gender);
     $line = mysql_fetch_row($re);
     return $line[0];
 }
Ejemplo n.º 10
0
                echo $res->show(500);
            }
        } else {
            echo $res->show(200);
        }
    }
    exit;
} elseif (isset($_POST['uid']) && isset($_POST['page'])) {
    $uid = $_POST['uid'];
    $page = $_POST['page'] < 0 ? 1 : $_POST['page'];
    $arr = array('userid' => $uid);
    $re = mysql_fetch_assoc($ul->userlike_select($arr, 1));
    $re['items'] = trim($re['items'], ',');
    $items_id_arr = explode(',', $re['items']);
    $data = array();
    $ii = new ItemInfo();
    $it_num = 6;
    //一页几个
    for ($i = ($page - 1) * $it_num; $i < $page * $it_num; $i++) {
        if ($items_id_arr[$i]) {
            $item_id = $items_id_arr[$i];
            $arr_item = array('id' => $item_id);
            $tmp = mysql_fetch_assoc($ii->ItemInfo_select($arr_item, 1));
            if ($tmp == false) {
                continue;
            }
            $tmp['islike'] = "1";
            $data[] = $tmp;
        }
    }
    echo $res->show(200, $data);
Ejemplo n.º 11
0
 public function Decode($buf = '')
 {
     $this->buffer = new CodeEngine($buf);
     $this->RealUIN = $this->buffer->DecodeInt32();
     $this->RealAccount = $this->buffer->DecodeString();
     $this->ActorUIN = $this->buffer->DecodeInt32();
     $this->ActorAccount = $this->buffer->DecodeString();
     $this->ServiceTag = $this->buffer->DecodeInt32();
     $this->SourceTag = $this->buffer->DecodeInt32();
     $this->IP = $this->buffer->DecodeInt32();
     $this->ItemCount = $this->buffer->DecodeInt16();
     for ($i = 0; $i < $this->ItemCount; $i++) {
         $this->ItemInfos[] = ItemInfo::decode_item_info($this->buffer);
     }
     $this->GoodsCount = $this->buffer->DecodeInt16();
     for ($i = 0; $i < $this->GoodsCount; $i++) {
         $this->GoodsInfo[] = GoodsInfo::decode_goods_info($this->buffer);
     }
     $this->TransparentDataSize = $this->buffer->DecodeInt16();
     if ($this->TransparentDataSize > 0) {
         $this->TransparentData = $this->buffer->DecodeMemory($this->TransparentDataSize);
     }
     $this->OperateDescription = $this->buffer->DecodeString();
     $this->TransTag = $this->buffer->DecodeString();
     $this->NofifyTransparentDataSize = $this->buffer->DecodeInt16();
     if ($this->NofifyTransparentDataSize > 0) {
         $this->NofifyTransparentData = $this->buffer->DecodeMemory($this->NofifyTransparentDataSize);
     }
     return $this;
 }
Ejemplo n.º 12
0
 /**
  * Retrieve itemInfo model
  * 
  * @param array $itemData
  * @return ItemInfo
  */
 private static function getItem(array $itemData)
 {
     $item = new ItemInfo();
     $item->setArticleName($itemData['name'])->setArticleNumber($itemData['id'])->setQuantity($itemData['qty'])->setTax($itemData['tax'])->setTotalPrice($itemData['totalPrice'])->setUnitPrice($itemData['unitPrice']);
     return $item;
 }
Ejemplo n.º 13
0
function PageContent()
{
    global $objCategory;
    ?>
    
            <div class="layout center-flex">

                <?php 
    $aLabels = array();
    $aLinks = array();
    $aLabels[0] = 'Home';
    $aLinks[0] = 'mainpage.php';
    $aLabels[1] = $objCategory->CategoryName;
    $aLinks[1] = 'category_list.php?';
    $aLabels[2] = 'Items';
    $aLinks[2] = 'item_list.php?cat=' . $_REQUEST['cat'];
    $aLabels[3] = 'Item Info List';
    $aLinks[3] = '';
    echo Helpers::CreateBreadCrumbs($aLabels, $aLinks);
    ?>

                <div class="bigbotspace flex-container space-between">
                    <p class="larger auto heading"><?php 
    echo $objCategory->CategoryName;
    ?>
</p>
                    <!-- a href="itemimage_admin.php?cat=<?php 
    echo $objCategory->Id;
    ?>
&item=<?php 
    echo $_REQUEST['item'];
    ?>
" class="button_link"><button class="">Add New Item Image</button></a -->
                </div>
            </div>
    
            <div class="layout">
    
                <table class="tablestyle" id="list_table">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Type</th>
                            <th>Text</th>
                            <th class="mid">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
    $objItemInfoType = new ItemInfoType();
    $oItemInfoType = $objItemInfoType->getAllItemInfoType('item_info_type_name');
    foreach ($oItemInfoType as $iteminfotype) {
        $objItemInfo = new ItemInfo();
        $oItemInfo = $objItemInfo->getAllItemInfoByItemIdItemInfoTypeId($_REQUEST['item'], $iteminfotype->Id);
        echo '<tr id="img_' . $oItemInfo[0]->Id . '">' . PHP_EOL;
        echo '<td>' . $oItemInfo[0]->Id . '</td>' . PHP_EOL;
        echo '<td>' . $iteminfotype->ItemInfoTypeName . '</td>' . PHP_EOL;
        echo '<td>';
        if ($oItemInfo[0]->ItemInfo != '') {
            echo substr($oItemInfo[0]->ItemInfo, 0, 200);
        }
        echo '</td>' . PHP_EOL;
        echo '<td class="mid"><a href="iteminfo_admin.php?cat=' . $_REQUEST['cat'] . '&item=' . $_REQUEST['item'] . '&infoid=' . $iteminfotype->Id . '&type=' . $iteminfotype->Id . '&id=' . $oItemInfo[0]->Id . '"><img src="img/edit-icon.png" /></a></td>' . PHP_EOL;
        echo '</tr>' . PHP_EOL;
    }
    ?>
                    </tbody>
                </table>
    
            </div> <!-- layout -->
    
<?php 
}
Ejemplo n.º 14
0
<?php

require_once '/var/www/git/application/models/NewItems.php';
//获取商品信息为空的
$items = new NewItems();
$it = new ItemInfo();
$string = '`end_time` is  NOT NULL';
$limit = 1000;
$result = $it->iteminfo_select_like($string, $limit);
while ($r = mysql_fetch_array($result, true)) {
    $endTime = $r['end_time'] / 1000;
    //获取字符串
    $startTime = time();
    if ($startTime >= $endTime) {
        $items->itemDel($r['id']);
    }
}
Ejemplo n.º 15
0
 public static function decode_item_info(CodeEngine &$buf)
 {
     $ii = new ItemInfo();
     $temp = $buf->DecodeInt16();
     $ii->setItemID($buf->DecodeInt32());
     $ii->setItemType($buf->DecodeInt16());
     $ii->setCount($buf->DecodeInt32());
     $ii->setGameID($buf->DecodeInt16());
     $ii->setExpiredTime($buf->DecodeInt32());
     $ii->setUpdateMode($buf->DecodeInt8());
     return $ii;
 }
Ejemplo n.º 16
0
<?php

//error_reporting(0);
require_once '/var/www/git/application/models/data/ItemInfo.php';
$obj = new ItemInfo();
$arr = array('stockNum' => 0);
$ids = array();
$r = $obj->ItemInfo_select($arr, 1000);
while ($re = mysql_fetch_array($r)) {
    $id = $re['id'];
    $ids[$id] = rand(10, 50);
}
foreach ($ids as $id => $water) {
    $arr = array('stockNum' => $water);
    $condition = 'id =' . $id;
    $obj->iteminfo_update($arr, $condition);
}
Ejemplo n.º 17
0
    exit;
}
if ($_POST['commit'] == "Save Item Info") {
    if ($id == 0) {
        // insert
        $obj = new ItemInfo();
        $obj->ItemId = $_REQUEST["item"];
        $obj->ItemInfo = $_REQUEST["item_info"];
        $obj->ItemInfoTypeId = $_REQUEST["item_info_type_id"];
        $obj->create();
        // redirect to listing list
        header("Location:iteminfo_list.php?cat=" . $_REQUEST['cat'] . "&item=" . $_REQUEST['item']);
        exit;
    } else {
        // update
        $obj = new ItemInfo($_REQUEST["id"]);
        $obj->ItemInfo = $_REQUEST["item_info"];
        $obj->ItemInfoTypeId = $_REQUEST["item_info_type_id"];
        $obj->update();
        // redirect to listing list
        header("Location:iteminfo_list.php?cat=" . $_REQUEST['cat'] . "&item=" . $_REQUEST['item']);
        exit;
    }
} else {
    if ($_REQUEST['mode'] == 'e') {
        //listing
        $objItemInfo = new ItemInfo($id);
        $item_info = $objItemInfo->ItemInfo;
        $type = $objItemInfo->ItemInfoTypeId;
    }
}
Ejemplo n.º 18
0
<?php

require_once '../models/data/ItemInfo.php';
$des_name = time();
$im = new ItemInfo();
try {
    $fp = fopen('./12345', 'r');
    $data = array();
    while (!feof($fp)) {
        $line = fgets($fp);
        $line = preg_replace('/\\t{1,}/', ' ', $line);
        //去掉多个tab制表位
        $line = preg_replace('/\\s{2,}/', ' ', $line);
        //去掉多个空格
        $l = explode(" ", $line);
        $l[1] = gender($l[1]);
        $l[2] = type($l[2]);
        if ($l[0] == null) {
            continue;
        }
        $data[] = $l;
    }
    $cons = '`id`,`itemGender`,`type`,`itemName`,`itemDate`';
    $ln = null;
    foreach ($data as $k => $v) {
        $time = time();
        array_walk($v, 'trim_arr');
        $ln .= '(\'';
        $ln .= join($v, '\',\'');
        $ln .= '\',\'' . $time . '\'),';
    }
Ejemplo n.º 19
0
function pageContent()
{
    global $id, $item;
    $objItemInfo = new ItemInfo();
    $oItemInfo = $objItemInfo->getAllItemInfoByItemId($item->Id);
    $info_types_list = '<ol class="info-buttons">';
    $i = 0;
    foreach ($oItemInfo as $item_info) {
        $info_type = new ItemInfoType($item_info->ItemInfoTypeId);
        $class = '';
        if ($i == 0) {
            $class = ' class="active"';
        }
        $info_types_list .= '<li' . $class . ' data-id="' . $item_info->ItemInfoTypeId . '">' . $info_type->ItemInfoTypeName . '</li>';
        $i++;
    }
    //$info_types_list .= '<li data-id="2">Specs</li>';
    $info_types_list .= '</ol>';
    $info_types_content = '<div class="content">';
    $i = 0;
    foreach ($oItemInfo as $item_info) {
        $active_class = '';
        if ($i == 0) {
            $active_class = 'active ';
        }
        $info_types_content .= '<div class="' . $active_class . 'info-content-section info-content-section-' . $item_info->ItemInfoTypeId . '">' . preg_replace("/[\r\n]/", "", $item_info->ItemInfo) . '</div>';
        $i++;
    }
    $info_types_content .= '</div>';
    $objItemInfoImage = new ItemInfoImage();
    $oItemInfoImage = $objItemInfoImage->getAllItemInfoImageByItemId($id);
    $info_images = '';
    $i = 0;
    $info_image_count = 0;
    foreach ($oItemInfoImage as $image) {
        if ($i > 0) {
            $info_images .= ",";
        }
        $info_images .= "'/" . $image->GetPath() . $image->ItemInfoImageUrl . "'";
        $i++;
    }
    $info_image_count = $i;
    $info_images = "var info_images = [" . $info_images . "];\n";
    $frontimage = '';
    $rightimage = '';
    $leftimage = '';
    $backimage = '';
    $frontimage_id = 0;
    $rightimage_id = 0;
    $leftimage_id = 0;
    $backimage_id = 0;
    $openimage = '';
    $rotate_sides = array();
    $objItemImage = new ItemImage();
    $obj = $objItemImage->getAllItemImageByItemIdItemImageSide($id, 'Open');
    if (count($obj) > 0) {
        $itemimage = $obj[0];
        $openimage = '/' . $itemimage->GetPath() . $itemimage->ItemImageUrl;
    }
    $obj = $objItemImage->getAllItemImageByItemIdItemImageSide($id, 'Front');
    if (count($obj) > 0) {
        $itemimage = $obj[0];
        $rotate_sides[] = 'Front';
        $frontimage = '/' . $itemimage->GetPath() . $itemimage->ItemImageUrl;
        $frontimage_id = $itemimage->Id;
    }
    $obj = $objItemImage->getAllItemImageByItemIdItemImageSide($id, 'Right');
    if (count($obj) > 0) {
        $itemimage = $obj[0];
        $rotate_sides[] = 'Right';
        $rightimage = '/' . $itemimage->GetPath() . $itemimage->ItemImageUrl;
        $rightimage_id = $itemimage->Id;
    }
    $obj = $objItemImage->getAllItemImageByItemIdItemImageSide($id, 'Back');
    if (count($obj) > 0) {
        $itemimage = $obj[0];
        $rotate_sides[] = 'Back';
        $backimage = '/' . $itemimage->GetPath() . $itemimage->ItemImageUrl;
        $backimage_id = $itemimage->Id;
    }
    $obj = $objItemImage->getAllItemImageByItemIdItemImageSide($id, 'Left');
    if (count($obj) > 0) {
        $itemimage = $obj[0];
        $rotate_sides[] = 'Left';
        $leftimage = '/' . $itemimage->GetPath() . $itemimage->ItemImageUrl;
        $leftimage_id = $itemimage->Id;
    }
    $objItemVideo = new ItemVideo();
    $oItemVideo = $objItemVideo->getAllItemVideoByItemId($id);
    $product_videos = '';
    $i = 0;
    $video_count = 0;
    foreach ($oItemVideo as $video) {
        if ($i > 0) {
            $product_videos .= ",";
        }
        $vpath = "/" . $video->GetPath();
        if (preg_match("/http/", $video->ItemVideoUrl)) {
            // a URL, don't get from local directory:
            $vpath = "";
        }
        $product_videos .= '{"video":"' . $vpath . $video->ItemVideoUrl . '", "title":"' . $video->ItemVideoTitle . '"}';
        $i++;
    }
    $video_count = $i;
    $product_videos = 'var product_videos = {"videos":[' . "\n" . $product_videos . "\n" . '    ]}' . "\n";
    $objItemGalleryImage = new ItemGalleryImage();
    $oItemGalleryImage = $objItemGalleryImage->getAllItemGalleryImageByItemId($id);
    $gallery_images = '';
    $i = 0;
    $gallery_image_count = 0;
    foreach ($oItemGalleryImage as $image) {
        if ($i > 0) {
            $gallery_images .= ",";
        }
        $gallery_images .= "'/" . $image->GetPath() . $image->ItemGalleryImageUrl . "'";
        $i++;
    }
    $gallery_image_count = $i;
    $gallery_images = "var gallery_images = [" . $gallery_images . "];\n";
    $gallery_caption = "Gallery";
    if ($item->GalleryDescription != "") {
        $gallery_caption = $item->GalleryDescription;
    }
    $objItemPresentation = new ItemPresentation();
    $objItemPresentationImage = new ItemPresentationImage();
    $oItemPresentation = $objItemPresentation->getAllItemPresentationByItemId($id);
    $product_shows = "";
    $show_images = array();
    $product_show_images = '';
    $i = 0;
    $show_count = 0;
    foreach ($oItemPresentation as $show) {
        if ($i > 0) {
            $product_shows .= ",";
        }
        $product_shows .= '{"thumbnail":"/' . $show->GetPath() . $show->ItemPresentationThumbnailUrl . '", "title":"' . $show->ItemPresentationName . '"}';
        $oItemPresentationImage = $objItemPresentationImage->getAllItemPresentationImageByItemPresentationId($show->Id);
        $j = 0;
        foreach ($oItemPresentationImage as $image) {
            if ($j > 0) {
                $show_images[$i] .= ",";
            }
            $show_images[$i] .= "'/" . $image->GetPath() . $image->ItemPresentationImageUrl . "'";
            $j++;
        }
        $product_show_images .= "            show_images[" . $i . "] = [" . $show_images[$i] . "];\n";
        $i++;
    }
    $show_count = $i;
    $product_shows = 'var product_shows = {"shows":[' . "\n" . $product_shows . "\n" . '    ]}' . "\n";
    $objItemImageHighlight = new ItemImageHighlight();
    ?>
        <script type="text/javascript">
			var current_show = 0;
			var show_needs_full_load = true;
            var rotate_sides = [];
<?php 
    foreach ($rotate_sides as $side) {
        echo "            rotate_sides.push('" . $side . "');\n";
    }
    ?>
            var rotate_current_item = 0;
            <?php 
    echo $info_images;
    ?>
            <?php 
    echo $product_videos;
    ?>
            <?php 
    echo $gallery_images;
    ?>
            var show_images = [];
<?php 
    echo $product_show_images;
    ?>
            <?php 
    echo $product_shows;
    ?>
            $(document).ready(function() {              
                $("#email_form_submit").on('click touch', function() {
                    if ($("#name").val() == "" || $("#email").val() == "" || $("#question").val() == "") {
                        alert("All fields are required.");
                        return false;
                    };
                    if (!validateEmail($("#email").val())) {
                        alert("Email address is invalid.")
                        return false;
                    }
                
                    $.ajax({
                    url: "ajax_send_email.php",
                        type: 'GET',
                        data: {
                            name: $("#name").val(),
                            email: $("#email").val(),
                            question: $("#question").val(),
                            item_id: "<?php 
    echo $item->Id;
    ?>
",
                            category_id: "<?php 
    echo $item->CategoryId;
    ?>
"
                        },
                        success: function(data){
                            if (data == '1') {
                                $("#thankDiv").show();
                                $("#form-div").hide();
                                $("#name").val("");
                                $("#email").val("");
                                $("#question").val("");
                            }
                            else {
                                alert("Error: Please try again.");
                            }
                        },
                        error: function(){
                            console.log('error');
                        }
                    });
                    return false;
                });
				$('.prod-icon').on('click',function(){
                	show_needs_full_load = true;
                	current_show = 0;
					$('.close-form').trigger('click');
					$('.rotate-carousel-indicators').fadeOut();
					$('.open-not-active').fadeOut();
					$('.carousel-inner').fadeIn();
					$('.top-section').css('border-bottom','none');
					$('.bottom-section').css('display','block');
					$('.rotate-menu-item').css('display', 'block');
					$('.rotate-menu-item-active').css('display', 'none');
					$('.open-door').attr('src','/assets/img/opendoor.png');
					$('.open-door').removeClass('open-door-active');
					var activeItem = $('.active-item').parent().parent().attr('data-id');
					$('.active-item').attr('src','/assets/img/'+activeItem+'.png');
					$('.active-item').removeClass('active-item')
					var newItem = $(this).parent().parent().attr('data-id');
					$(this).attr('src','/assets/img/'+newItem+'-active.png');
					$(this).addClass('active-item');
				});
				$('.rotate-icon').on('click',function(){
                	show_needs_full_load = true;
                	current_show = 0;
					$('.close-form').trigger('click');
					$('.open-not-active').fadeOut();
					$('.carousel-inner').fadeIn();
					$('.open-door').attr('src','/assets/img/opendoor.png');
					$('.open-door').removeClass('open-door-active');
					if( $(this).parent().parent().hasClass('rotate-menu-item-active') ){
						$(this).parent().parent().css('display','none');
						$('.rotate-menu-item').css('display', 'block');
					}else if( $(this).parent().parent().hasClass('rotate-menu-item') ){
						$(this).parent().parent().css('display','none');
						$('.rotate-menu-item-active').css('display', 'block');
					}
				});
				
				var nav_controls = ""; // used in lightbox add functions below
                // adds info data to the lightbox
                $('.info-menu-item').on('click touch',function () {
                	show_needs_full_load = true;
                    $("#name").val("");
                    $("#email").val("");
                    $("#question").val("");
                    $("#form-div").show();
                    $("#thankDiv").hide();
                	current_show = 0;
                    $('.product-lightbox-container .top-section').html('<div id="product-info-carousel" class="carousel slide" data-ride="carousel"><div class="carousel-inner" role="listbox"></div></div>');
                    nav_controls = "";
                    if (info_images.length > 1) {
                    	nav_controls = '<div class="prev"><a href="#product-info-carousel" role="button" data-slide="prev"><img src="assets/img/red-arrow.png" alt="arrow"></a></div><div class="next slider-next"><a href="#product-info-carousel" role="button" data-slide="next"><img src="assets/img/red-arrow.png" alt="arrow"></a></div>';
                    }
                    $('.product-lightbox-container .bottom-content').prepend('<div class="slider-container"><div class="slider-controls">'+nav_controls+'</div></div>');
                    $(info_images).each(function(i, data){
                        $('#product-info-carousel .carousel-inner').append('<div class="item"><img src="'+data+'" alt="Info Image"></div>');
                        $('.info-carousel-indicators').append('<li data-target="#product-info-carousel" data-slide-to="'+i+'"></li>');
                    });
                    $('#product-info-carousel .carousel-inner .item').first().addClass('active');
                    $('.info-carousel-indicators li').first().addClass('active');
                    $('.info-carousel-indicators li').on('click',function(){
                        $('.info-carousel-indicators .active').removeClass('active');
                        $(this).addClass('active');
                    });
                    $('.product-lightbox-container .bottom-content').append('<div class="show-form-container"><a href="" class="show-form">Request Info</a><a href="" class="show-form show-form-img"><img src="assets/img/mail_button.png"></a></div><div class="clear"></div><?php 
    echo $info_types_list . $info_types_content;
    ?>
');
                });
                
                $('.rotate-menu-item-active .next-view').on('click touch', function() {
                    rotate_current_item++;
                    if (rotate_current_item >= rotate_sides.length) {
                        rotate_current_item = 0;
                    }
                    $('#rotate-title').text(rotate_sides[rotate_current_item]);
                });
                $('.rotate-menu-item-active .prev-view').on('click touch', function() {
                    rotate_current_item--;
                    if (rotate_current_item < 0) {
                        rotate_current_item = (rotate_sides.length - 1);
                    }
                    $('#rotate-title').text(rotate_sides[rotate_current_item]);
                });
                $('.open-door').on('click',function(e){
                	show_needs_full_load = true;
                	current_show = 0;
                    e.preventDefault();
                    $('.close-form').trigger('click');
                    $('.rotate-carousel-indicators').fadeOut();
                    $('.modalx-container').trigger('click')
                    $('.rotate-menu-item').css('display', 'block');
                    $('.rotate-menu-item-active').css('display', 'none');
                    if( $('.open-door').hasClass('open-door-active') ){
                        $(this).attr('src','assets/img/opendoor.png');
                        $(this).removeClass('open-door-active');
                        $('.open-not-active').fadeOut( 300, function() {
                            $('.carousel-inner').fadeIn();
                        });
                    }else{
                        $(this).attr('src','assets/img/opendoor-active.png');
                        $(this).addClass('open-door-active');
                        $('.carousel-inner').fadeOut( 300, function() {
                            $('.open-not-active').fadeIn();
                        });
                    }
                });
                // adds video data to the lightbox
                $('.video-menu-item').on('click',function(){
                	show_needs_full_load = true;
                	current_show = 0;
                    $('.product-lightbox-container .bottom-section').css('display','none');
                    $('.product-lightbox-container .top-section').html('<div id="product-video-carousel" class="carousel slide" data-ride="carousel"><div class="carousel-inner" role="listbox"></div></div>').css('border-bottom','#FF1D25 solid 55px');
                    $(product_videos.videos).each(function(i, data){
                    	var mimetype = "video/mp4";
                    	var ext = data.video.split('.').pop();
                    	if (ext == "mov") {
                    		mimetype = "video/quicktime";
                    	}
                    	else if (ext == "wmv") {
                    		mimetype = "video/x-ms-wmv";
                    	}
                    	else if (data.video.indexOf("webm")) {
                    	    mimetype = "video/webm";
                    	}
                        $('#product-video-carousel .carousel-inner').append('<div class="item"><video style="width:560px; height:315px;"><source src="'+data.video+'" type="'+mimetype+'"></video><div class="video-info-container"><div class="carousel-caption">'+data.title+'</div><div class="fullscreen"></div><div class="videoplay" ><img src="assets/img/red_play.png" style="width:100%; height:100%;"></div><div class="videopause" style="display:none;"><img src="assets/img/red_pause.png" style="width:100%; height:100%;"></div><div class="video-time" style="float:right; margin-right:20px; color:red; display:none;">Length: <span id="video-length"></span></div></div>');
                    });
                    nav_controls = "";
                    if (product_videos.videos.length > 1) {
                    	nav_controls = '<div class="prev"><a href="#product-video-carousel" role="button" data-slide="prev"><img src="assets/img/red-arrow.png" alt="arrow"></a></div><div class="next slider-next"><a href="#product-video-carousel" role="button" data-slide="next"><img src="assets/img/red-arrow.png" alt="arrow"></a></div>';
                    }
                    $('.product-lightbox-container .top-section').append('<div class="video-info-container"><div class="video-slider-controls">'+nav_controls+'</div></div>');
                    $('#product-video-carousel .carousel-inner .item').first().addClass('active');
                });
                // adds gallery data to the lightbox
                $('.gallery-menu-item').on('click',function(){
                	show_needs_full_load = true;
                	current_show = 0;
                    $('.product-lightbox-container .bottom-section').css('display','none');
                    $('.product-lightbox-container .top-section').html('<div id="product-gallery-carousel" class="carousel slide" data-ride="carousel"><div class="carousel-inner" role="listbox"></div></div>').css('border-bottom','#FF1D25 solid 55px');
                    $(gallery_images).each(function(i, data){
                        $('#product-gallery-carousel .carousel-inner').append('<div class="item"><img src="'+data+'" alt="Gallery Image"></div>');
                        $('.info-carousel-indicators').append('<li data-target="#gallery-info-carousel" data-slide-to="'+i+'"></li>');
                    });
                    nav_controls = "";
                    if (gallery_images.length > 1) {
                    	nav_controls = '<div class="prev"><a href="#product-gallery-carousel" role="button" data-slide="prev"><img src="assets/img/red-arrow.png" alt="arrow"></a></div><div class="next slider-next"><a href="#product-gallery-carousel" role="button" data-slide="next"><img src="assets/img/red-arrow.png" alt="arrow"></a></div>';
                    }
                    $('.product-lightbox-container .top-section').append('<div class="gallery-info-container"><div class="carousel-caption"><?php 
    echo $gallery_caption;
    ?>
</div><div class="fullscreen"></div><div class="gallery-slider-controls">'+nav_controls+'</div></div>');
                    $('#product-gallery-carousel .carousel-inner .item').first().addClass('active');
                });
                // adds show/presentation data to the lightbox
                $('.show-menu-item').on('click',function(){
                	$('#bottom-slides div').removeClass("selected");
                    $('.product-lightbox-container .top-section').html('<div id="product-show-carousel" class="carousel slide" data-ride="carousel"><div class="carousel-inner" role="listbox"></div></div>');
                    $(show_images[current_show]).each(function(i, data){
                        $('#product-show-carousel .carousel-inner').append('<div class="item"><img src="'+data+'" alt="Gallery Image"></div>');
                        $('.info-carousel-indicators').append('<li data-target="#show-info-carousel" data-slide-to="'+i+'"></li>');
                    });
                	if (show_needs_full_load) {
						nav_controls = "";
						if (show_images.length > 1) {
							nav_controls = '<div class="prev"><a href="#product-show-carousel" role="button" data-slide="prev"><img src="assets/img/red-arrow.png" alt="arrow"></a></div><div class="next slider-next"><a href="#product-show-carousel" role="button" data-slide="next"><img src="assets/img/red-arrow.png" alt="arrow"></a></div>';
						}
                    	$('.product-lightbox-container .bottom-content').html('<div class="bottom-top-container"><div class="col-sm-2"><div class="show-slider-controls">'+nav_controls+'</div></div><div class="col-sm-8"><h2>'+product_shows.shows[current_show].title+'</h2></div><div class="col-sm-2"><div class="fullscreen"></div></div></div>');
						// bottom slider to switch show/presentation:
						nav_controls = "";
						if (product_shows.shows.length > 3) {
							nav_controls = '<div class="prev"><a href="javascript:void(0);" id="bottom-show-prev"><img src="assets/img/red-arrow.png" alt="arrow"></a></div><div id="bottom-slides-outer"><div id="bottom-slides"></div></div><div class="next slider-next"><a href="javascript:void(0);" id="bottom-show-next"><img src="assets/img/red-arrow.png" alt="arrow"></a></div>';
						}
						$('.product-lightbox-container .bottom-content').append('<div class="bottom-bottom-container">'+nav_controls+'</div>');
						$(product_shows.shows).each(function(i, data){
							$('#bottom-slides').append('<div id="bottom_slide_'+i+'"><img src="'+data.thumbnail+'"><p>'+data.title+'</p></div>');
						});
					}
					else {
						// not first load, only load top of bottom container
                    	$('.product-lightbox-container .bottom-content .bottom-top-container').html('<div class="col-sm-2"><div class="show-slider-controls"><div class="prev"><a href="#product-show-carousel" role="button" data-slide="prev"><img src="assets/img/red-arrow.png" alt="arrow"></a></div><div class="next slider-next"><a href="#product-show-carousel" role="button" data-slide="next"><img src="assets/img/red-arrow.png" alt="arrow"></a></div></div></div><div class="col-sm-8"><h2>'+product_shows.shows[current_show].title+'</h2></div><div class="col-sm-2"><div class="fullscreen"></div></div>');
					}
					$('#product-show-carousel .carousel-inner .item').first().addClass('active');
                    $('#bottom_slide_' + current_show).addClass("selected");
                    show_needs_full_load = false;
                });
                
                $(".product-lightbox-container").on("click touch", "#bottom-show-next", function() {
                	var newPos = $("#bottom-slides-outer").scrollLeft() + ($("#bottom-slides-outer").width() / 3);
                	$("#bottom-slides-outer").animate({scrollLeft: newPos}, 800);
                });
                $(".product-lightbox-container").on("click touch", "#bottom-show-prev", function() {
                	var newPos = $("#bottom-slides-outer").scrollLeft() - ($("#bottom-slides-outer").width() / 3);
                	$("#bottom-slides-outer").animate({scrollLeft: newPos}, 800);
                });
                
                $(".product-lightbox-container").on("click touch", "#bottom-slides div", function() {
                	var id = $(this).attr("id").replace("bottom_slide_", "");
                	current_show = id;
                    $('.show-menu-item').click();
                });
                
                $(".product-lightbox-container").on("click touch", ".fullscreen", function() {
                 	$("#underlay").show();
                 	$(".product-lightbox-container").css("width", "100%").addClass('fullscreen-wrap');
                 	$(".product-lightbox-container").css("margin-left", "0");
                 	$(".product-lightbox-container .top-section").css("background-color", "black");
                 	$(".product-lightbox-container .top-section").css("border-bottom", "0");
                 	$(".product-lightbox-container .modalx-container").css("background-color", "transparent");
                 	$(".product-lightbox-container .modalx-container").css("margin-right", "2%");
                 	$(".product-lightbox-container .videoplay, .product-lightbox-container .videopause").css("margin-right", "0");
                 	$(".product-lightbox-container .video-slider-controls").css("margin-top", "20px");
                 	$(".product-lightbox-container .video-info-container").css("width", "94%");
                 	$(".fullscreen").hide();
                 	$(".bottom-section").css("background-color", "black");
                 	$(".bottom-section").css("border-bottom", "0");
                 	$(".bottom-top-container").css("border-bottom", "0");
                 	$(".bottom-bottom-container").hide();
                 	$("#product-video-carousel video").css("width", "94%");
                 	$(".gallery-info-container").css("width", "94%");
                 	$("#product-video-carousel video").css("height", "");
                 	$(".carousel-caption").hide();
                 	if ($(".item.active .video-info-container .carousel-caption").length) {
                 		$(".modaltitle-container p").text($(".item.active .video-info-container .carousel-caption").text());
                 	}
                 	else if ($(".gallery-info-container .carousel-caption").length) {
                 		$(".modaltitle-container p").text($(".gallery-info-container .carousel-caption").text());
                 	}
                 	else if ($(".bottom-top-container div h2").length) {
                 		$(".modaltitle-container p").text($(".bottom-top-container div h2").text());
                 		$(".bottom-top-container div h2").hide();
                 	}
                 	$(".modaltitle-container").show();
                });
				$(".product-lightbox-container").on("click touch", ".videoplay", function() {
					$("video").trigger('pause');
					$(".product-lightbox-container #product-video-carousel .item.active video").trigger('play');
					$(".videoplay").hide();
					$(".videopause").show();
					//var duration_secs = $(".product-lightbox-container #product-video-carousel .item.active video").get(0).duration;
					//var minutes = Math.round(duration_secs / 60);
					//var seconds = Math.round(duration_secs % 60);
					//$("#video-length").text(minutes + ":" + seconds);
				});
				
				$(".product-lightbox-container").on("click touch", ".videopause, .video-info-container .next, .video-info-container .prev", function() {
					$("video").trigger('pause');
					$(".videopause").hide();
					$(".videoplay").show();
				});
				$(".product-lightbox-container").on("slid.bs.carousel", "#product-video-carousel", function() {
                 	$(".modaltitle-container p").text($(".item.active .video-info-container .carousel-caption").text());
				});
				
				$(".highlight").on("click touch", function(e) {
					$(this).next("div.highlight-text").toggle();
					$(this).toggleClass("highlight-active");
				});
				
				// swipe left/right on slideshows: touch handling
				document.addEventListener('touchstart', handleTouchStart, false);
				document.addEventListener('touchmove', handleTouchMove, false);
				var xDown = null;
				var yDown = null;
				var carousel_id = null;  // use to call carousel "next" or "prev" actions (default slideHandler)
				var slideHandler = null; // determines how to do slide action (default or other)
				var section = null;      // some swipes require this also for alternate or additional function call
				var nextClass = null;    // some swipes require this also for alternate or additional function call
				var prevClass = null;    // some swipes require this also for alternate or additional function call
				function handleTouchStart(e) {
					if (e.target.id == "top-section" || $(e.target).parents("#top-section").size()) { 
						xDown = e.touches[0].clientX;
						yDown = e.touches[0].clientY;
						slideHandler = "default"; // use default carousel action
						if (e.target.id == "product-info-carousel" || $(e.target).parents("#product-info-carousel").size()) {
						    carousel_id = "#product-info-carousel";
						}
						else if (e.target.id == "product-video-carousel" || $(e.target).parents("#product-video-carousel").size()) {
						    carousel_id = "#product-video-carousel";
						}
						else if (e.target.id == "product-gallery-carousel" || $(e.target).parents("#product-gallery-carousel").size()) {
						    carousel_id = "#product-gallery-carousel";
						}
						else if (e.target.id == "product-show-carousel" || $(e.target).parents("#product-show-carousel").size()) {
						    carousel_id = "#product-show-carousel";
						}
					}
					else if (e.target.id == "bottom-section" || $(e.target).parents("#bottom-section").size()) { 
						xDown = e.touches[0].clientX;
						yDown = e.touches[0].clientY;
						slideHandler = "bottom-div"; // uses slider-specific action
						section = ".product-lightbox-container .bottom-bottom-container";
						nextClass = " .next a:first";
						prevClass = " .prev a:first";
					}
					else if (e.target.id == "rotate-product-carousel" || $(e.target).parents("#rotate-product-carousel").size()) { 
						xDown = e.touches[0].clientX;
						yDown = e.touches[0].clientY;
						slideHandler = "rotate-prod"; // uses default carousel action AND slider-specific action
						carousel_id = "#rotate-product-carousel";
						section = ".rotate-menu-item-active";
						nextClass = " .next-view";
						prevClass = " .prev-view";
					}
					else {
						xDown = null;
						yDown = null;
						carousel_id = null
						slideHandler = null;
						section = null;
						nextClass = null;
						prevClass = null;
					}
				};                                                
				function handleTouchMove(e) {
					if (!xDown || !yDown) {
						return;
					}
					var xUp = e.touches[0].clientX;
					var yUp = e.touches[0].clientY;
					var xDiff = xDown - xUp;
					var yDiff = yDown - yUp;
					// check for most significant touch movement direction
					if (Math.abs(xDiff) > Math.abs(yDiff)) {
						if ( xDiff > 0 && xDiff > 10) {
							// left swipe
							//$(section+nextClass).click();
							if (slideHandler == "default" || slideHandler == "rotate-prod") {
							    $(carousel_id).carousel("next");
							}
							if (slideHandler == "bottom-div" || slideHandler == "rotate-prod") {
							   $(section+nextClass).click(); 
							}
							e.stopPropagation();
						}
						else if (xDiff < 0 && xDiff < -10) {
							// right swipe
							//$(section+prevClass).click();
							if (slideHandler == "default" || slideHandler == "rotate-prod") {
							    $(carousel_id).carousel("prev");
							}
							if (slideHandler == "bottom-div" || slideHandler == "rotate-prod") {
							   $(section+prevClass).click();
							}
							e.stopPropagation();
						}
					} else {
						if ( yDiff > 0 && yDiff > 2) {
							// up swipe
						}
						else if (yDiff < 0 && yDiff < -2) {
							// down swipe
						}
					}
					/* reset values */
					xDown = null;
					yDown = null;
					carousel_id = null;
					slideHandler = null;
					section = null;
					nextClass = null;
					prevClass = null;
				};
				
            }); // end document.ready
        </script>
        <header class="product-header">
            <div class="col-sm-5"><a class="main-logo" href="/">Coca-Cola</a></div>
            <div class="col-sm-7 header-tagline">Explore <strong><?php 
    echo $item->ItemName;
    ?>
</strong></div>
        </header>
        <div class="product-left-nav left-nav col-sm-3">
            <ul>
<?php 
    if ($info_image_count > 0) {
        ?>
                <li data-id="info" class="info-menu-item"><a href="" class="activate-lightbox"><img class="prod-icon" src="assets/img/info.png" alt="Info"></a></li>
<?php 
    }
    if (count($rotate_sides) > 1) {
        ?>
                <li data-id="rotate" class="rotate-menu-item-active" style="display:none">
                    <a data-id="rotate" href="" class="activate-menu-toggle"><img class="rotate-icon" src="assets/img/rotate-active.png" alt="Rotate"></a>
                    <div class="menu-activated-toggles">
                        <h6 id="rotate-title">Front</h6>
                        <div class="prev-view"><a href="#rotate-product-carousel" role="button" data-slide="prev"><img src="assets/img/arrow-toggle.png" alt="arrow"></a></div>
                        <div class="next-view"><a href="#rotate-product-carousel" role="button" data-slide="next"><img src="assets/img/arrow-toggle.png" alt="arrow"></a></div>
                    </div>
                </li>
                <li data-id="rotate" class="rotate-menu-item" style="display: block;">
                    <a data-id="rotate" href="" class="activate-menu-toggle"><img class="rotate-icon active-rotate" src="assets/img/rotate.png" alt="Rotate"></a>
                </li>
<?php 
    }
    if ($openimage != "") {
        ?>
                <li data-id="opendoor" class="open-menu-item">
                    <a href=""><img class="open-door" src="assets/img/opendoor.png" alt="open-door"></a>
                </li>
<?php 
    }
    if ($video_count > 0) {
        ?>
                <li data-id="video" class="video-menu-item"><a href="" class="activate-lightbox"><img class="prod-icon" src="assets/img/video.png" alt="Video"></a></li>
<?php 
    }
    if ($gallery_image_count > 0) {
        ?>
                <li data-id="gallery" class="gallery-menu-item"><a href="" class="activate-lightbox"><img class="prod-icon" src="assets/img/gallery.png" alt="Gallery"></a></li>
<?php 
    }
    if ($show_count > 0) {
        ?>
                <li data-id="show" class="show-menu-item"><a href="" class="activate-lightbox"><img class="prod-icon" src="assets/img/show.png" alt="Show"></a></li>
<?php 
    }
    ?>
            </ul>
        </div>
        <div class="product-content col-sm-9">
            <div class="item open-not-active">
                <img src="<?php 
    echo $openimage;
    ?>
" alt="Product Front">
                <div class="carousel-caption"></div>
            </div>
            <div id="rotate-product-carousel" class="carousel slide" data-ride="carousel">
                <!-- Indicators -->
                <ol class="carousel-indicators rotate-carousel-indicators">
                    <li data-target="#rotate-product-carousel" data-slide-to="0" class="active"></li>
                    <li data-target="#rotate-product-carousel" data-slide-to="1"></li>
                </ol>

                <!-- Wrapper for slides -->
                <div class="carousel-inner" role="listbox">
<?php 
    if ($frontimage != '') {
        ?>
                    <div class="item active">
                        <img src="<?php 
        echo $frontimage;
        ?>
" alt="Product Front">
                        <div class="carousel-caption"></div>
<?php 
        $button_width = 64;
        $full_div_width = 615;
        $bubble_LR_offset = 16;
        $bubble_top_offset = 8;
        $oItemImageHighlight = $objItemImageHighlight->getAllItemImageHighlightByItemImageId($frontimage_id);
        foreach ($oItemImageHighlight as $highlight) {
            echo '                        <div class="highlight" style="top:' . $highlight->HotspotTop . 'px; ';
            echo 'left:' . $highlight->HotspotLeft . 'px;"><img src="assets/img/plus_white.png"></div>' . "\n";
            $htext_position = 'left:' . ($highlight->HotspotLeft + ($button_width + $bubble_LR_offset)) . 'px;';
            $htext_class = "highlight-text-right";
            if ($highlight->HotspotLeft > $full_div_width / 2) {
                $htext_position = 'right:' . ($full_div_width - $highlight->HotspotLeft + $bubble_LR_offset) . 'px;';
                $htext_class = "highlight-text-left";
            }
            echo '						  <div class="highlight-text ' . $htext_class . '" style="top:' . ($highlight->HotspotTop - $bubble_top_offset) . 'px; ';
            echo $htext_position . '"><span class="red">Highlight</span><br />' . $highlight->ItemImageHighlightInfo . '</div>' . "\n";
            // note: 64 is width of highlight button
        }
        ?>
                    </div>
<?php 
    }
    if ($rightimage != '') {
        ?>
                    <div class="item">
                        <img src="<?php 
        echo $rightimage;
        ?>
" alt="Product Right">
                        <div class="carousel-caption"></div>
                    </div>
<?php 
    }
    if ($backimage != '') {
        ?>
                    <div class="item">
                        <img src="<?php 
        echo $backimage;
        ?>
" alt="Product Back">
                        <div class="carousel-caption"></div>
                    </div>
<?php 
    }
    if ($leftimage != '') {
        ?>
                    <div class="item">
                        <img src="<?php 
        echo $leftimage;
        ?>
" alt="Product Left">
                        <div class="carousel-caption"></div>
                    </div>
<?php 
    }
    ?>
                </div>
            </div>
        </div>
<?php 
}