ign="justify"> dated = gt; array ( - raquo ;, date DESC ),
namea = gt; array ( raquo ;, name ASC ),
named = gt; array ( raquo ;, name DESC )
);
$ order_get=clear ($ _GET [ order ]);//
if (array_key_exists ($ order_get, $ order_p)) {
$ order=$ order_p [$ order_get] [0];
$ order_db=$ order_p [$ order_get] [1];
} else {
//order_p
$ order=$ order_p [ namea ] [0];
$ order_db=$ order_p [ namea ] [1];
}
/* ========== */
//
$ perpage=3;// -
if (isset ($ _ GET [ page ])) {
$ page=(int) $ _ GET [ page ]; ($ page lt; 1) $ page=1;
} else {
$ page=1;
}
$ count_rows=count_rows ($ category);// -
$ pages_count=ceil ($ count_rows/$ perpage);// - (! $ Pages_count) $ pages_count=1;// 1 ($ page gt; $ pages_count) $ page=$ pages_count;//
$ start_pos=($ page - 1) * $ perpage;//
$ brand_name=brand_name ($ category);//
$ products=products ($ category, $ order_db, $ start_pos, $ perpage);//
$ meta [ title ]=$ brand_name [0] [ brand_name ]; ($ brand_name [1]) $ meta [ title ].=«- {$ brand_name [1] [ brand_name ]} »;
$ meta [ title ].=«|» .TITLE;
$ meta [ description ]=«{$ brand_name [0] [ brand_name ]}, {$ brand_name [1] [ brand_name ]}» ;;
case ( addtocart ):
//
$ goods_id=abs ((int) $ _ GET [ goods_id ]); ($ goods_id);
$ _ SESSION [ total_sum ]=total_sum ($ _SESSION [ cart ]);
//- + ID
total_quantity (); () ;;
( cart ):
/* */
//
$ dostavka=get_dostavka ();
//
if (isset ($ _ GET [ id ], $ _GET [ qty ])) {
$ goods_id=abs ((int) $ _ GET [ id ]);
$ qty=abs ((int) $ _ GET [ qty ]);
$ qty=$ qty - $ _SESSION [ cart ] [$ goods_id] [ qty ]; ($ goods_id, $ qty);
$ _ SESSION [ total_sum ]=total_sum ($ _SESSION [ cart ]);//
_ quantity ();// - + ID
redirect ();
}
//
if (isset ($ _ GET [ delete ])) {
$ id=abs ((int) $ _ GET [ delete ]); ($ id) {_from_cart ($ id);
} ();
}
($ _ POST [ order_x ]) {_order (); ();
};
( reg ):
//;
case ( search ):
//
$ result_search=search ();
//
$ perpage=9;// -
if (isset ($ _ GET [ page ])) {
$ page=(int) $ _ GET [ page ]; ($ page lt; 1) $ page=1;
} else {
$ page=1;
}
$ count_rows=count ($ result_search);// -
$ pages_count=ceil ($ count_rows/$ perpage);// - (! $ Pages_count) $ pages_count=1;// 1 ($ page gt; $ pages_count) $ page=$ pages_count;//
$ start_pos=($ page - 1) * $ perpage;//
$ endpos=$ start_pos + $ perpage;//
if ($ endpos gt; $ count_rows) $ endpos=$ count_rows ;;
case ( filter ):
//
$ startprice=(int) $ _ GET [ startprice ];
$ endprice=(int) $ _ GET [ endprice ];
$ brand=array ();
($ _ GET [ brand ]) {($ _GET [ brand ] as $ value) {
$ value=(int) $ value;
$ brand [$ value]=$ value;
}
} ($ brand) {
$ category=implode ( laquo ;, raquo ;, $ brand);
}
$ products=filter ($ category, $ startprice, $ endprice) ;;
( product ):
//
$ goods_id...