Exemplo n.º 1
0
<?
require($cfg['path'].'/models/catalogshopcoinsrelation.php');

$catalogshopcoinsrelation_class = new model_catalogshopcoinsrelation($db_class);

$data_result = array();
$data_result['error'] = null;
$data_result['value'] = false;

$error = array();

$catalog = (integer)request('catalog');

if(!$tpl['user']['user_id']) $data_result['error'] = "auth";
else {
    $rows2 = $catalogshopcoinsrelation_class->getRowByParams(array('shopcoins'=>$catalog));

	if ($rows2) {		
		if ($catalogshopcoinsrelation_class->getRow('catalogshopcoinssubscribe', array('catalog'=>$rows2['catalog'],'user'=>$tpl['user']['user_id']))) {			
			$error[] = 'У Вас есть такая заявка';
		}
	} else $error[] = "Монеты еще нет в каталоге";
	    
	if (!sizeof ($error)) {
	    $data_insert = array('user'=>$tpl['user']['user_id'], 
    		                 'catalog' => $rows2['catalog'], 
    		                 'dateinsert'=>time(), 
    		                 'datesend'=>0,
    		                 'amountdatesend'=>0,
    		                 'buy'=>0,
    		                 'amount'=>1);  	
Exemplo n.º 2
0
<?
require_once($cfg['path'].'/helpers/Paginator.php');
require_once($cfg['path'].'/models/catalogshopcoinsrelation.php');
require_once $cfg['path'] . '/configs/config_shopcoins.php';
require_once $cfg['path'] . '/models/shopcoinsdetails.php';
$details_class = new model_shopcoins_details($db_class);

require_once $cfg['path'] . '/models/stats.php';
$stats_class = new stats($db_class,$tpl['user']['user_id'],session_id());
 

$catalogshopcoinsrelation_class = new model_catalogshopcoinsrelation($db_class);
//var_dump($_SERVER);

$page = 'show';
$tpl['show']['lhreg'] = isset($_COOKIE['lhref'])?trim($_COOKIE['lhref']):(isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'/shopcoins');

if(substr($tpl['show']['lhreg'],-1) =='?' ) $tpl['show']['lhreg'] = substr($tpl['show']['lhreg'],0,strlen($tpl['show']['lhreg'])-1);

$arraynewcoins = Array(1=>date('Y')-2,2=>date('Y')-1,3=>date('Y'));
$show50 = 0;

$catalog=(integer)request('catalog');
$materialtype=(integer)request('materialtype');
$parent=(integer)request('parent');

if (!$materialtype) 	$materialtype = 1;
if ($parent && !$catalog) 	$catalog = $parent;

$orderusernow = 0;
$ciclelink = "";
Exemplo n.º 3
0
<?
require $cfg['path'] . '/configs/config_shopcoins.php';
require_once $cfg['path'] . '/models/order.php';
require_once $cfg['path'] . '/models/orderdetails.php';
require_once $cfg['path'] . '/models/catalogshopcoinsrelation.php';
require_once($cfg['path'] . '/models/mails.php');

$order_class = new model_order($db_class,$shopcoinsorder,$tpl['user']['user_id']);
$orderdetails_class = new model_orderdetails($db_class,$shopcoinsorder);
$catalogshopcoinsrelation_class = new model_catalogshopcoinsrelation($db_class);

$addinordersubmit = request('addinordersubmit');

$MetroName ='';

$tpl['addinorder']['error'] = '';
if ($blockend > time()) {
	$tpl['addinorder']['error'] = "Возможность добавления к предыдущим заказам приостановлена до " . date('H:i', $blockend);

} else if (!$tpl['user']['user_id']) {
	$tpl['addinorder']['error']  = "Нужна авторизация на сайте для оформления этого заказа.";
} else if (!$tpl['user']['orderusernow']) {
	$tpl['addinorder']['error']  = "У вас нет заказов для объединения с этим, поэтому минимальная сумма заказа должна быть 500 руб.";
} else {
	$rows90 = $order_class->getOrder();
	if ($rows90['check']==1)
		$tpl['addinorder']['error'] = "Заказ $shopcoinsorder уже оформлен Вами. Вы можете его просомтреть в \"Ваши заказы\"";
}