Skip to content
Browse files

viewer is nearly done...

  • Loading branch information...
1 parent f390664 commit cfc916e31b5f2e3e6a0de6a26bac6c4b47363893 @Will-Smelser committed Aug 31, 2011
View
6 cake/app/controllers/products_controller.php
@@ -28,7 +28,8 @@ function add() {
}
$manufacturers = $this->Product->Manufacturer->find('list');
$pattributes = $this->Product->Pattribute->find('list');
- $this->set(compact('manufacturers', 'pattributes'));
+ $schools = $this->Product->School->find('list');
+ $this->set(compact('manufacturers', 'pattributes', 'schools'));
}
function edit($id = null) {
@@ -49,7 +50,8 @@ function edit($id = null) {
}
$manufacturers = $this->Product->Manufacturer->find('list');
$pattributes = $this->Product->Pattribute->find('list');
- $this->set(compact('manufacturers', 'pattributes'));
+ $schools = $this->Product->School->find('list');
+ $this->set(compact('manufacturers', 'pattributes', 'schools'));
}
function delete($id = null) {
View
58 cake/app/controllers/shop_controller.php
@@ -51,62 +51,70 @@ function noproduct(){
}
- function product($school=null, $sex=null, $sale = null){
+ function product($school=null, $sex=null, $sale = null, $product = null){
+ $imageIndex = 0;
$this->layout = 'ajax';
- $this->main($school, $sex, $sale);
+ //fix data if needed
+ $this->fixVars($product, $school, $sex, $sale, $expired);
+
+ $productRight = array();
+ $products = $this->getProductsDetails($sale);
+ $this->getPagination($products,$product,$productRight, $index);
+
+ $this->set(compact('school','sex','sale','product','imageIndex'));
}
//TODO implament expired display
//main page for shopping
//imageIndex is the product image to show
- function main ($school=null, $sex=null, $sale = null, $expired=false) {
+ function main ($school=null, $sex=null, $sale = null, $product = null, $expired=false) {
$imageIndex = 0;
- $product = null;
//fix data if needed
- $school = $this->getSchool($school);
- $sex = $this->getSex($sex);
- $sale = $this->getSale($sale, $sex, $school);
- $product = $this->getProduct($product, $sale, $sex, $school);
+ $this->fixVars($product, $school, $sex, $sale, $expired);
+
+
$products = $this->getProductsDetails($sale);
//get left and right products
- $productLeft = array();
$productRight= array();
- $this->getPagination($products,$product,$productLeft,$productRight, $index);
+ $this->getPagination($products,$product,$productRight, $index);
$this->Sale->Saleuser->addUserSaleEndDate($this->myuser, $sale['Sale']['id']);
- //debug($products);
- //debug($product);
+
$this->addSaleEnds($this->myuser, $sale);
+ //debug($product);
- $this->set(compact('school','sex','sale','product','productLeft','productRight','imageIndex'));
+ $this->set(compact('school','sex','sale','product','productRight','imageIndex'));
}
+ private function fixVars(&$product, &$school, &$sex, &$sale, &$expired){
+
+ //fix data if needed
+ $school = $this->getSchool($school);
+ $sex = $this->getSex($sex);
+ $sale = $this->getSale($sale, $sex, $school);
+ $product = $this->getProduct($product, $sale, $sex, $school);
+ }
+
//set the pagination and move detailed product data into $product
- private function getPagination($products,&$product,&$productLeft,&$productRight, &$index){
+ private function getPagination($products,&$product,&$productRight, &$index){
$id = $product['id'];
$temp = null;
- $found = false;
+
foreach($products as $p) {
if($p['Product']['id'] == $id){
- $found = true;
$temp = $p;
} else {
- //add left
- if(!$found){
- array_push($productLeft, $p['Product']);
- //add right
- } else {
- array_push($productRight, $p['Product']);
- }
+ array_push($productRight, $p['Product']);
}
}
+
$product = $temp;
- //$index = $temp[]
+
return;
}
@@ -311,7 +319,7 @@ private function getProduct($product, &$sale, &$sex, &$school){
}
}
//forward to first product
- $this->redirect(array('action'=>"main/{$school['id']}/{$sex}/{$sale['id']}/{$sale['Product'][0]['id']}"));
+ $this->redirect(array('action'=>"main/{$school['id']}/{$sex}/{$sale['Sale']['id']}/{$sale['Product'][0]['id']}"));
return;
}
//no product found
View
2 cake/app/tmp/cache/models/cake_model_default_acos
@@ -1,2 +1,2 @@
-1314653647
+1314834358
a:7:{s:2:"id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:10;s:3:"key";s:7:"primary";}s:9:"parent_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:10;}s:5:"model";a:6:{s:4:"type";s:6:"string";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:255;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:11:"foreign_key";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:10;}s:5:"alias";a:6:{s:4:"type";s:6:"string";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:255;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:3:"lft";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:10;}s:4:"rght";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:10;}}
View
2 cake/app/tmp/cache/models/cake_model_default_actors
@@ -1,2 +1,2 @@
-1314653648
+1314834359
a:8:{s:2:"id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;s:3:"key";s:7:"primary";}s:4:"name";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:30;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:6:"height";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:6:"weight";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:5:"waist";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:4:"bust";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:3:"sex";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:1;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:7:"created";a:4:{s:4:"type";s:8:"datetime";s:4:"null";b:0;s:7:"default";N;s:6:"length";N;}}
View
2 cake/app/tmp/cache/models/cake_model_default_aros
@@ -1,2 +1,2 @@
-1314653647
+1314834358
a:7:{s:2:"id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:10;s:3:"key";s:7:"primary";}s:9:"parent_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:10;}s:5:"model";a:6:{s:4:"type";s:6:"string";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:255;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:11:"foreign_key";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:10;}s:5:"alias";a:6:{s:4:"type";s:6:"string";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:255;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:3:"lft";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:10;}s:4:"rght";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:1;s:7:"default";N;s:6:"length";i:10;}}
View
2 cake/app/tmp/cache/models/cake_model_default_aros_acos
@@ -1,2 +1,2 @@
-1314653647
+1314834358
a:7:{s:2:"id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:10;s:3:"key";s:7:"primary";}s:6:"aro_id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:10;s:3:"key";s:5:"index";}s:6:"aco_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:10;}s:7:"_create";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";s:1:"0";s:6:"length";i:2;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:5:"_read";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";s:1:"0";s:6:"length";i:2;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:7:"_update";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";s:1:"0";s:6:"length";i:2;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:7:"_delete";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";s:1:"0";s:6:"length";i:2;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}}
View
2 cake/app/tmp/cache/models/cake_model_default_groups
@@ -1,2 +1,2 @@
-1314653648
+1314834359
a:4:{s:2:"id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;s:3:"key";s:7:"primary";}s:4:"name";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:75;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:8:"modified";a:4:{s:4:"type";s:8:"datetime";s:4:"null";b:0;s:7:"default";N;s:6:"length";N;}s:7:"created";a:4:{s:4:"type";s:8:"datetime";s:4:"null";b:0;s:7:"default";N;s:6:"length";N;}}
View
2 cake/app/tmp/cache/models/cake_model_default_oinfos
@@ -1,2 +1,2 @@
-1314653648
+1314834359
a:4:{s:2:"id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:10:"product_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:8:"quantity";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:9:"unitprice";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}}
View
2 cake/app/tmp/cache/models/cake_model_default_pattributes
@@ -1,2 +1,2 @@
-1314653648
+1314834359
a:4:{s:2:"id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;s:3:"key";s:7:"primary";}s:4:"name";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:30;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:5:"image";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:200;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:11:"description";a:6:{s:4:"type";s:4:"text";s:4:"null";b:0;s:7:"default";N;s:6:"length";N;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}}
View
2 cake/app/tmp/cache/models/cake_model_default_products
@@ -1,2 +1,2 @@
-1314653647
+1314834358
a:14:{s:2:"id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;s:3:"key";s:7:"primary";}s:15:"manufacturer_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:9:"school_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:4:"name";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:100;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:4:"desc";a:6:{s:4:"type";s:4:"text";s:4:"null";b:0;s:7:"default";N;s:6:"length";N;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:3:"sex";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:1;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:5:"style";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:50;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:6:"active";a:4:{s:4:"type";s:7:"boolean";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:1;}s:12:"price_retail";a:4:{s:4:"type";s:5:"float";s:4:"null";b:0;s:7:"default";N;s:6:"length";s:3:"4,2";}s:12:"price_member";a:4:{s:4:"type";s:5:"float";s:4:"null";b:0;s:7:"default";N;s:6:"length";s:3:"4,2";}s:12:"price_buynow";a:4:{s:4:"type";s:5:"float";s:4:"null";b:0;s:7:"default";N;s:6:"length";s:3:"4,2";}s:8:"pricetag";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:150;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:4:"cost";a:4:{s:4:"type";s:5:"float";s:4:"null";b:0;s:7:"default";N;s:6:"length";s:3:"4,2";}s:7:"created";a:4:{s:4:"type";s:8:"datetime";s:4:"null";b:0;s:7:"default";N;s:6:"length";N;}}
View
2 cake/app/tmp/cache/models/cake_model_default_products_pattributes
@@ -1,2 +1,2 @@
-1314653648
+1314834359
a:3:{s:2:"id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;s:3:"key";s:7:"primary";}s:10:"product_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:13:"pattribute_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}}
View
2 cake/app/tmp/cache/models/cake_model_default_users
@@ -1,2 +1,2 @@
-1314653648
+1314834359
a:13:{s:2:"id";a:5:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;s:3:"key";s:7:"primary";}s:11:"facebook_id";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:100;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:5:"fname";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:75;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:5:"lname";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:75;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:5:"email";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:150;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:8:"password";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:150;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:9:"birthdate";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:3:"sex";a:6:{s:4:"type";s:6:"string";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:1;s:7:"collate";s:17:"latin1_swedish_ci";s:7:"charset";s:6:"latin1";}s:9:"school_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:8:"group_id";a:4:{s:4:"type";s:7:"integer";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:11;}s:6:"active";a:4:{s:4:"type";s:7:"boolean";s:4:"null";b:0;s:7:"default";N;s:6:"length";i:1;}s:8:"modified";a:4:{s:4:"type";s:8:"datetime";s:4:"null";b:0;s:7:"default";N;s:6:"length";N;}s:7:"created";a:4:{s:4:"type";s:8:"datetime";s:4:"null";b:0;s:7:"default";N;s:6:"length";N;}}
View
2 cake/app/tmp/cache/persistent/cake_core_default_en-us
@@ -1,2 +1,2 @@
-1314653648
+1314834359
a:1:{s:11:"LC_MESSAGES";a:0:{}}
View
2 cake/app/tmp/cache/persistent/cake_core_object_map
@@ -1,2 +1,2 @@
-1314653657
+1314834359
a:1:{s:6:"plugin";a:0:{}}
View
10 cake/app/views/elements/product/features.ctp
@@ -4,8 +4,14 @@
*/
?>
<div id="uniquefeatures">
- <span id="uftext"class="two">Unique Features</span>
+ <div id="uftext"class="two">Unique Features</div>
+ <div style="padding-left:20px;">
<?php foreach($product['Pattribute'] as $p){ ?>
- <img class="one" src="<?php echo $p['image']; ?>" title="<?php echo $p['description']; ?>" width="77" height="88" />
+ <div class="feature-wrapper">
+ <a class="feature-thumb" href="<?php echo $p['image']; ?>" rel="<?php echo $p['image']; ?>">
+ <img src="<?php echo $p['image']; ?>" title="<?php echo $p['description']; ?>" width="77" height="88" />
+ </a>
+ </div>
<?php } ?>
+ </div>
</div><!-- End Unique Features -->
View
2 cake/app/views/elements/product/main_photo.ctp
@@ -7,7 +7,7 @@
?>
-<div id="mainphoto">
+<div class="mainphoto">
<img src="<?php echo $product['Pimage'][$index]['image']; ?>" width="351" height="401" />
<span class="three" id="productname">
<?php echo $product['Pimage'][$index]['Product']['name']; ?>
View
28 cake/app/views/elements/product/thumbs.ctp
@@ -1,7 +1,25 @@
+<?php
+/**
+ * $product
+ */
+
+ $x = 77;
+ $h = 88;
+
+ function(){
+
+
+ }
+
+?>
+
<div id="thumbnails">
- <span id="thumbtext" class="two">More Photos</span>
- <img class="one" src="/img/productphotos/krista_77_88.png" width="77" height="88" />
- <img class="one" src="/img/productphotos/krista_77_88.png" width="77" height="88" />
- <img class="one" src="/img/productphotos/krista_77_88.png" width="77" height="88" />
- <img class="one" src="/img/productphotos/krista_77_88.png" width="77" height="88" />
+ <div id="thumbtext" class="two">More Photos</div>
+ <?php foreach($product['Pimage'] as $p){ ?>
+ <div class="thumb-wrapper">
+ <a class="gallery-thumb" href="<?php echo $p['image']; ?>" rel="<?php echo $p['image']; ?>">
+ <img src="<?php echo $p['image']; ?>" width="77" height="88" />
+ </a>
+ </div>
+ <?php } ?>
</div><!-- End Thumbnails -->
View
249 cake/app/views/layouts/shop.ctp
@@ -39,10 +39,259 @@
</div>
</body>
+<link rel="stylesheet" type="text/css" href="/css/jquery.jqzoom.css"></link>
<script type="text/javascript" src="/js/jquery.qtip-1.0.0-rc3.min.js"></script>
+<script type='text/javascript' src='/js/jquery.jqzoom-core.js'></script>
<script type="text/javascript">
+//product viewer
+$(document).ready(function(){
+ var viewer = {
+ width : 935,
+ x : 0,
+ $wrapper : null,
+ $sliders : [],
+ current : 0,
+ $lnav : null,
+ $rnav : null,
+ speed : 1000,
+ inTrans : false,
+
+ init : function() {
+ var obj = this;
+
+ //build info
+ obj.$wrapper = $('#sliderpane');
+ obj.$wrapper.children('.slider').each(function(){
+ obj.$sliders.push($(this));
+ });
+
+ //load other pages
+ for(var i = 1; i < obj.$sliders.length; i++){
+ var temp = i;
+ obj.$sliders[i].load(
+ obj.$sliders[i].attr('id'), //the id actually holds the url
+ function(){
+ obj.$sliders[temp].removeClass('product-loading');
+ obj.$sliders[temp].find(".gallery-thumb").mioZoom({'$target':obj.$sliders[temp].find('.mainphoto')});
+ obj.$sliders[temp].find(".feature-thumb").mioZoom({'$target':obj.$sliders[temp].find('.mainphoto'),'zoom':false,'hideOnExit':true});
+ }
+ );
+ }
+
+ //set left/right nav
+ obj.$lnav = $('#leftarrow');
+ obj.$rnav = $('#rightarrow');
+
+ //bind nav
+ obj.$rnav.click($.proxy(obj.moveRight,obj));
+ obj.$lnav.click($.proxy(obj.moveLeft,obj));
+ },
+ moveLeft : function() {
+ var obj = this;
+
+ if(obj.inTrans) return;
+ if(obj.current <= 0) return;
+
+ obj.inTrans = true;
+ obj.current--;
+ obj.anim('+='+obj.width);
+ obj.toggleNavs();
+ },
+
+ moveRight : function() {
+ var obj = this;
+
+ if(obj.inTrans) return;
+ if(obj.current == obj.$sliders.length-1) return;
+
+ obj.inTrans = true;
+ obj.current++;
+ obj.anim('-='+obj.width);
+ obj.toggleNavs();
+ },
+
+ anim : function(pos) {
+ var obj = this;
+ obj.$wrapper.animate({
+ left: pos
+ },
+ obj.speed,
+ function(){
+ obj.inTrans = false;
+ }
+ );
+ },
+
+ toggleNavs : function() {
+ var obj = this;
+
+ //check left
+ (obj.current > 0) ? obj.showLeftNav() : obj.hideLeftNav();
+
+ //we never actually hide the right
+ },
+
+ showLeftNav : function() {this.$lnav.fadeIn();},
+ showRightNav: function() {this.$rnav.fadeIn();},
+
+ hideLeftNav : function() {this.$lnav.fadeOut();},
+ hideRightNav: function() {this.$rnav.fadeOut();}
+ };
+
+ viewer.init();
+});
+
+(function( $ ){
+
+ $.fn.mioZoom = function( options ) {
+
+ var settings = {
+ $target : null, //some jquery element
+ zoom : true,
+ hideOnExit : false, //hide all images on exit
+ onEnterHook: function(){return;},
+ imageWidth :700,
+ imageHeight :800,
+ wrapperWidth : 355,
+ wrapperHeight: 405,
+ zoomZindex : 1000,
+ imageZindex : 999
+ };
+
+ //cycle the thumbs
+ this.each(function() {
+ // If options exist, lets merge them
+ // with our default settings
+ if ( options ) {
+ $.extend( settings, options );
+ }
+
+ //lets add the images to the target (hidden)
+ var $el = $(this);
+
+ var cssWrapper = {
+ 'display':'none',
+ 'position':'absolute',
+ 'z-index':settings.zoomZindex,
+ 'top':'0px',
+ 'left':'0px',
+ 'overflow':'hidden',
+ 'width':settings.wrapperWidth+'px',
+ 'height':settings.wrapperHeight+'px'
+ };
+
+ var $bigImg = $(document.createElement('img')).
+ attr('src',$el.attr('href')).
+ attr('height',settings.imageHeight).
+ attr('width',settings.imageWidth);
+
+ var $normImg = $(document.createElement('img')).
+ attr('src',$el.attr('rel')).
+ attr('width',settings.wrapperWidth).
+ attr('height',settings.wrapperHeight);
+
+ var $zoomWrapper = $(document.createElement('div')).
+ addClass('mioZoomWrapper').
+ append($bigImg).
+ css(cssWrapper);
+
+ cssWrapper['z-index'] = settings.imageZindex;
+ var $imgWrapper = $(document.createElement('div')).
+ addClass('mioImageWrapper').
+ append($normImg).
+ css(cssWrapper);
+
+ //needed functions
+ var hideZoom = function(){
+ settings.$target.find('.mioZoomWrapper').hide();
+ };
+ var hideImgs = function($except){
+ settings.$target.find('.mioImageWrapper').each(function(){
+ if($(this).find('img').attr('src') != $except.attr('src')) $(this).hide();
+ });
+ };
+ var resetZoomImage = function() {
+ $zoomWrapper.find('img').css({
+ 'position':'absolute',
+ 'left':'0px',
+ 'top' :'0px'
+ });
+ };
+
+ settings.$target.append($zoomWrapper).append($imgWrapper);
+
+ //need to position all images absolutely
+ var pos = $el.offset();
+ //$el.css({'display':'block','position':'absolute','top':pos.top+'px','left':pos.left+'px'});
+
+ //now lets bind the events
+ //show zoom window
+ $el.bind('mouseenter mouseover', function (event) {
+ hideImgs($imgWrapper);
+ if(settings.zoom){
+ $zoomWrapper.show();
+ }
+ $imgWrapper.show();
+ settings.onEnterHook();
+ });
+
+
+ //hide zoom window
+ $el.bind('mouseleave',function(){
+ hideZoom();
+ resetZoomImage();
+ if(settings.hideOnExit){
+ settings.$target.find('.mioImageWrapper').hide();
+ }
+ });
+
+
+ //remove the onclick
+ $el.click(function(){return false;});
+
+ //make the movement happen
+ if(settings.zoom){
+ $el.bind('mousemove', function (e) {
+ var x = -1*(e.pageX - $el.offset().left - 20);// + settings.wrapperWidth/2 ;
+ var y = -1*(e.pageY - $el.offset().top - 30);// + settings.wrapperHeight/2;
+
+ var $img = $zoomWrapper.find('img');
+
+ var xFactor = $img.attr('width') / $el.width();
+ var yFactor = $img.attr('height') / $el.height();
+
+ var posX = Math.floor(xFactor*x);
+ var posY = Math.floor(yFactor*y);
+
+ if(posX > 0) posX = 0;
+ if(posY > 0) posY = 0;
+ if(posX + settings.imageWidth < settings.wrapperWidth) posX = settings.imageWidth - settings.wrapperWidth;
+ if(posY + settings.imageHeight < settings.wrapperHeight) posY = settings.imageHeight - settings.wrapperHeight;
+
+ $img.css({
+ 'position':'absolute',
+ 'left':posX+'px',
+ 'top' :posY+'px'
+ });
+ });
+ }
+
+
+ });
+
+ };
+ })( jQuery );
+
+$(document).ready(function(){
+ //$(".gallery-thumb").jqzoom({'ztarget':'mainphoto'});
+ var $main = $('#sliderpane').children().first();
+ $main.find(".gallery-thumb").mioZoom({'$target':$main.find('.mainphoto')});
+ $main.find(".feature-thumb").mioZoom({'$target':$main.find('.mainphoto'),'zoom':false,'hideOnExit':true});
+});
+
+
//share this
var switchTo5x=true;
$(document).ready(function(){
View
1 cake/app/views/products/add.ctp
@@ -4,6 +4,7 @@
<legend><?php __('Add Product'); ?></legend>
<?php
echo $this->Form->input('manufacturer_id');
+ echo $this->Form->input('school_id');
echo $this->Form->input('name');
echo $this->Form->input('desc');
echo $this->Form->input('sex');
View
1 cake/app/views/products/edit.ctp
@@ -5,6 +5,7 @@
<?php
echo $this->Form->input('id');
echo $this->Form->input('manufacturer_id');
+ echo $this->Form->input('school_id');
echo $this->Form->input('name');
echo $this->Form->input('desc');
echo $this->Form->input('sex');
View
2 cake/app/views/products/index.ctp
@@ -4,6 +4,7 @@
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('manufacturer_id');?></th>
+ <th><?php echo $this->Paginator->sort('school_id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th><?php echo $this->Paginator->sort('desc');?></th>
<th><?php echo $this->Paginator->sort('sex');?></th>
@@ -30,6 +31,7 @@
<td>
<?php echo $this->Html->link($product['Manufacturer']['name'], array('controller' => 'manufacturers', 'action' => 'view', $product['Manufacturer']['id'])); ?>
</td>
+ <td><?php echo $product['School']['name']; ?>&nbsp;</td>
<td><?php echo $product['Product']['name']; ?>&nbsp;</td>
<td><?php echo $product['Product']['desc']; ?>&nbsp;</td>
<td><?php echo $product['Product']['sex']; ?>&nbsp;</td>
View
39 cake/app/views/shop/main.ctp
@@ -7,33 +7,29 @@
<a href="#"><img id="comments" src="/img/productpresentation/flyfoenix_product_presentation_comments.png" width="171" height="57" alt="comments" /></a>
- <img id="buytwo" src="/img/productpresentation/flyfoenix_product_presentation_buy2.png" width="121" height="121" alt="buyTwo" />
+ <img id="buytwo" style="position:absolute;top:1px;right:1px;"
+ src="/img/productpresentation/flyfoenix_product_presentation_buy2.png" width="121" height="121" alt="buyTwo" />
<!-- NAVIGATION ARROWS -->
- <div id="leftarrow">
- <a href="" onMouseOver="document.lbutton.src='/img/productpresentation/flyfoenix_product_presentation_elements_lbuttonorange.png';" onMouseOut="document.lbutton.src='/img/productpresentation/flyfoenix_product_presentation_elements_lbutton.png';"><img name="lbutton" src="/img/productpresentation/flyfoenix_product_presentation_elements_lbutton.png" width="37" height="52" alt="leftarrow" /> </a>
- </div>
-
- <div id="rightarrow">
- <a href="" onMouseOver="document.rbutton.src='/img/productpresentation/flyfoenix_product_presentation_elements_rbuttonorange.png';" onMouseOut="document.rbutton.src='/img/productpresentation/flyfoenix_product_presentation_rbutton.png';"><img name="rbutton" src="/img/productpresentation/flyfoenix_product_presentation_rbutton.png" width="36" height="50" alt="rightarrow" /></a>
- </div>
+ <a href="#"><div id="leftarrow" class="hidden"></div></a>
+
+ <?php $class = (count($productRight) > 0) ? '' : 'hidden'; ?>
+ <a href="#"><div id="rightarrow" class="<?php echo $class; ?>"></div></a>
<!-- SLIDER WRAPPER -->
<div id="sliderwrapper"><!-- Begin Slider Wrapper -->
-
-
- <div id="slider"><!-- Begin Slider -->
+ <div id="sliderpane">
+ <div class="slider" style="left:0px;"><!-- Begin Slider -->
- <div id="viewer">
+ <div class="viewer">
<?php echo $this->element('product/features'); ?>
- <?php echo $this->element('product/main_photo',array('index'=>$imageIndex)); ?>
+ <?php echo $this->element('product/main_photo',array('index'=>$imageIndex,'product'=>$product)); ?>
<?php echo $this->element('product/thumbs',array('index'=>$imageIndex)); ?>
</div><!-- End Viewer Container -->
-
<div id="content">
<div id="earn5">
<img src="/img/productpresentation/flyfoenix_product_presentation_earn5.png" width="214" height="33" alt="earn5" />
@@ -44,6 +40,19 @@
<?php echo $this->element('product/details',array('product'=>$product,'index'=>$imageIndex))?>
</div>
-</div>
</div> <!-- End Slider -->
+
+<?php
+ $i = 1;
+ foreach($productRight as $p){
+ //calulate the position
+ $x = 935 * $i;
+ $i++;
+ $url = "/shop/product/{$p['school_id']}/{$p['sex']}/{$sale['Sale']['id']}/{$p['id']}";
+ ?>
+ <div id="<?php echo $url ?>" class="slider product-loading" style="left:<?php echo $x; ?>px">
+
+ </div>
+ <?php } ?>
+</div>
</div> <!-- End Slider Wrapper -->
View
8 cake/app/views/shop/product.ctp
@@ -1,15 +1,14 @@
-<div id="slider"><!-- Begin Slider -->
+ <div class="slider" style="left:0px;"><!-- Begin Slider -->
- <div id="viewer">
+ <div class="viewer">
<?php echo $this->element('product/features'); ?>
- <?php echo $this->element('product/main_photo',array('index'=>$imageIndex)); ?>
+ <?php echo $this->element('product/main_photo',array('index'=>$imageIndex,'product'=>$product)); ?>
<?php echo $this->element('product/thumbs',array('index'=>$imageIndex)); ?>
</div><!-- End Viewer Container -->
-
<div id="content">
<div id="earn5">
<img src="/img/productpresentation/flyfoenix_product_presentation_earn5.png" width="214" height="33" alt="earn5" />
@@ -20,5 +19,4 @@
<?php echo $this->element('product/details',array('product'=>$product,'index'=>$imageIndex))?>
</div>
-</div>
</div> <!-- End Slider -->
View
99 public_html/css/productpresentation.css
@@ -273,17 +273,47 @@ body{
position: absolute;
left: 8px;
top:240px;
- z-index:5;
+ z-index:15;
+
+ width:36px;
+ height:50px;
+
+}
+a #leftarrow {
+ text-decoration:none;
+
+ background-image:url(/img/productpresentation/flyfoenix_product_presentation_elements_lbutton.png);
+ background-repeat:no-repeat;
+}
+a #leftarrow :hover{
+ background-image:url(/img/productpresentation/flyfoenix_product_presentation_elements_lbuttonorange.png);
}
#rightarrow{
position: absolute;
top: 240px;
right: 21px;
- z-index: 5;
+ z-index: 15;
+
+ width:36px;
+ height:50px;
+
+}
+a #rightarrow {
+ text-decoration:none;
+
+ background-image:url(/img/productpresentation/flyfoenix_product_presentation_rbutton.png);
+ background-repeat:no-repeat;
+}
+a #rightarrow:hover{
+ background-image:url(/img/productpresentation/flyfoenix_product_presentation_elements_rbuttonorange.png);
+}
+
+#leftarrow.hidden, #rightarrow.hidden {
+ display:none;
}
-#viewer{
+.viewer{
position: absolute;
left: 60px;
top: 54px;
@@ -297,11 +327,29 @@ body{
#sliderwrapper{
+ position:absolute;
+ top:12px;
+ left:12px;
+
+ height:525px;
+ width:935px;
+ overflow:hidden;
+}
+#sliderpane{
+ position:absolute;
+}
+.slider{
+ position:absolute;
+ width:935px;
+ height:525px;
}
-#slider{
-
+.slider .product-loading {
+ background-image:url(/img/loading.gif);
+ background-position:center center;
+ background-repeat:no-repeat;
+ background-color:#000;
}
@@ -322,25 +370,39 @@ body{
#uftext{
text-align: center;
- width: 112px;
- display:block;
+
+ padding-left:10px;
+
+ width:100px;
}
-#mainphoto{
+.mainphoto{
width: 351px;
height:401px;
- display:inline-block;
- margin-top:15px;
+ display:block;
+
+ position:absolute;
+ top:15px;
+ left:115px;
}
#thumbnails{
- float: right;
- width: 112px;
- margin-top:15px;
-}
+ position:absolute;
+ right:10px;
+ top:15px;
+ width:88px;
+}
+.gallery-thumb, .feature-thumb{
+ display:block;
+}
+.thumb-wrapper, .feature-wrapper{
+ padding-top:10px;
+ width:88px;
+ height:90px;
+ overflow:hidden;
+}
#thumbtext{
- width: 112px;
text-align:center;
display:block;
}
@@ -359,7 +421,7 @@ body{
}
#sharethis{
-
+ height:37px;
}
#inventory{
@@ -384,6 +446,7 @@ body{
margin-left: 6px;
}
#size select{
+ border-style:none;
float:right;
width:100px;
}
@@ -407,4 +470,8 @@ body{
/*End Body Container Elements*/
+//mioZoom
+.mioZoomWrapper{
+ background-color:#333;
+}
View
BIN public_html/img/pricetag/pricetage_03.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cfc916e

Please sign in to comment.
Something went wrong with that request. Please try again.