/? $ index.php? view=addtocart amp; goods_id=$ 1 ^ reg /? $ index.php? view=reg ^ cart /? $ index.php? view=cart ^ cart/qty=( d +)/id=( d +) /? $ index.php? view=cart amp; qty=$ 1 amp; id=$ 2
3-5.
3. index.php
lt ;? php
//
define ( ISHOP raquo ;, TRUE);
//
require_once config.php raquo ;;
//_once CONTROLLER;
4 CONTROLLER
lt ;? php
( ISHOP ) or die ( Access denied );
_ start ();
//_once MODEL;
//_once functions/functions.php raquo ;;
//
$ cat=catalog ();
//
$ informers=informer ();
//
$ pages=pages ();
//
$ news=get_title_news ();
//($ _POST [ reg ]) {(); ();
}
//($ _POST [ auth ]) {(); ($ _ SESSION [ auth ] [ user ]) {
//
echo « lt; p gt; , {$ _SESSION [ Laquo; auth ] [ user ]} lt;/p gt; »;
exit;
} else {
//
echo $ _SESSION [ auth ] [ error ];
unset ($ _SESSION [ auth ]) ;;
}
}
//($ _GET [ do ] == logout ) {(); ();
}
//
$ meta=array ();
//#content
$ view=empty ($ _GET [ view ])? hits raquo ;: $ _GET [ view ];
($ view) {( hits ):
//
$ eyestoppers=eyestopper ( hits );
$ meta [ title ]=TITLE;
$ meta [ description ]=TITLE;
$ meta [ keywords ]=TITLE. »,,» ;;
( new ):
//
$ eyestoppers=eyestopper ( new );
$ meta [ title ]=«|» .TITLE;
$ meta [ description ]=«|» .TITLE ;;
( sale ):
//
$ eyestoppers=eyestopper ( sale );
$ meta [ title ]=«|» .TITLE;
$ meta [ description ]=«|» .TITLE ;;
( page ):
//
$ page_id=abs ((int) $ _ GET [ page_id ]);
$ get_page=get_page ($ page_id);
$ meta [ title ]=«{$ get_page [ title ]} |» .TITLE;
$ meta [ description ]=«{$ get_page [ description ]} |» .TITLE ;;
( news ):
//
$ news_id=abs ((int) $ _ GET [ news_id ]);
$ news_text=get_news_text ($ news_id) ;;
case ( archive ):
//()
//
$ perpage=2;// -
if (isset ($ _ GET [ page ])) {
$ page=(int) $ _ GET [ page ]; ($ page lt; 1) $ page=1;
} else {
$ page=1;
}
$ count_rows=count_news ();// -
$ pages_count=ceil ($ count_rows/$ perpage);// - (! $ Pages_count) $ pages_count=1;// 1 ($ page gt; $ pages_count) $ page=$ pages_count;//
$ start_pos=($ page - 1) * $ perpage;//
$ all_news=get_all_news ($ start_pos, $ perpage) ;;
( informer ):
//
$ informer_id=abs ((int) $ _ GET [ informer_id ]);
$ text_informer=get_text_informer ($ informer_id) ;;
( cat ):
//
$ category=abs ((int) $ _ GET [ category ]);
/* ========== */
//
//-, GET -
//-, SQL-,
$ order_p=array (
pricea = gt; array ( raquo ;, price ASC ),
priced = gt; array ( raquo ;, price DESC ),
datea = gt; array ( - raquo ;, date ASC ),