/* Decoded by unphp.net */
if ($otherCat[1] == "pay"){
$smarty->assign("pay",true);
$orderID = preg_replace("[^0-9]","",$otherCat[2]);
if ($orderID <>$otherCat[2]){
$ERROR_pay = 1;
}else{
$order = getOrder($dbh,$orderID);
$priceSumAll = order::getSumOrderIfRURFormatted($dbh,$orderID);
$smarty->assign('order',$order);
$amount = $order['allPaySum'];
$currency = "RUB";
$merch_name = "СÐÐÐ ÐÐÐÐÐ";
$merchant = "000553330693101";
$terminal = "30693101";
$email = "DrozdovAA@bk.ru";
$trtype = "1";
$timestamp = gmdate("YmdHis",time());
$nonce = md5($timestamp);
$backref = "http://plaza.spb.ru/busket/pay/$orderID/?payResult";
$desc = "Ðаказ â: ".$orderID;
$key = '38155EFD426017A368EDA0524DDDEF2F';
$hmac = strlen($amount) .$amount .strlen($currency) .$currency .strlen($orderID) .$orderID .strlen($merch_name) .$merch_name .strlen($merchant) .$merchant .
strlen($terminal) .$terminal .strlen($email) .$email .strlen($trtype) .$trtype .strlen($timestamp) .$timestamp .strlen($nonce) .$nonce .strlen($backref) .$backref;
$p_sign = strtoupper(hash_hmac('sha1',$hmac,pack('H*',$key)));
$BankFormData = '
';
$smarty->assign("BankFormData",$BankFormData);
}
}
deleteUnusedOrders($dbh);
if(isset($_SESSION['myOrder'])){
if(isset($_POST['itemId'])){
if(isset($_POST['chgComment'])){
if(order::chgComment($dbh,$_POST['data'],$_POST['itemId'])){
echo "ÐнаÑение изменено!";
}else{
echo "ÐÑибка пÑи изменении знаÑениÑ!";
}
exit();
}
exit();
}
if(isset($_POST['orderId'])){
if(isset($_POST['chgMainComment'])){
if(order::chgMainComment($dbh,$_POST['data'],$_POST['orderId'])){
echo "ÐнаÑение изменено!";
}else{
echo "ÐÑибка пÑи изменении знаÑениÑ!";
}
exit();
}
if(isset($_POST['chgDeliver'])){
if(order::chgDeliver($dbh,$_POST['data'],$_POST['orderId'])){
if (isset($_POST['deliverPrice'])){
order::chgDeliverPrice($dbh,$_POST['deliverPrice'],$_POST['orderId']);
}
echo "СоÑ
Ñанено";
}else{
echo "ÐÑибка пÑи ÑоÑ
Ñанении";
}
exit();
}
}
}
if(isset($_POST['mkOrderNotReg'])){
if(isset($_SESSION['myOrder'])){
require_once 'inc/class.phpmailer.php';
if(!isset($_SESSION['user'])){
$E_mail = trim($_POST['userMail']);
$user = users::getId($dbh,$E_mail);
if ($user == 0){
$user = users::createNewByMail($dbh,$E_mail,$_POST['dataArr']);
$_SESSION['user'] = $user;
if($user == -1){
unset($_SESSION['user']);
echo "userCreateErr";
exit();
}
$pwd = uniqid();
users::editUser($dbh,md5( md5 ($pwd) ),"pwd",$user);
$mail = new PHPMailer();
$host = str_replace("www.","",$_SERVER['HTTP_HOST']);
$mail->From = "noreply@".$host;
$mail->FromName = 'www.'.$host;
$mail->AddAddress($_POST['userMail'],'');
$mail->CharSet = "UTF-8";
$mail->IsHTML(true);
$mail->Subject = "ÐнÑоÑмаÑÐ¸Ñ Ð´Ð»Ñ Ð²Ñ
ода на ÑÐ°Ð¹Ñ http://www.".$_SERVER['HTTP_HOST'];
$data = "
ÐонÑиденÑиалÑÐ½Ð°Ñ Ð¸Ð½ÑоÑмаÑиÑ
";
$data.= "ÐÑ Ð±Ñли ÑÑпеÑно заÑегиÑÑÑиÑÐ¾Ð²Ð°Ð½Ñ Ð½Ð° ÑайÑе http://www.".$_SERVER['HTTP_HOST']."
";
$data.= "ÐÐ»Ñ Ð²Ñ
ода на ÑÐ°Ð¹Ñ Ð¸ÑполÑзÑйÑе даннÑе:
";
$data.= "Ðогин: ".$_POST['userMail']." (ÐÐ°Ñ ÑлекÑÑоннÑй адÑеÑ)
";
$data.= "ÐаÑолÑ: ".$pwd."
";
$data.= "";
$data.= "ÐиÑÑмо оÑпÑавлено ÑобоÑом и не ÑÑебÑÐµÑ Ð¾ÑвеÑа.
ÐÑли ÐÑ Ð½Ðµ ÑегиÑÑÑиÑовалиÑÑ, и не пÑоизводили заказов на ÑайÑе http://www.".$_SERVER['HTTP_HOST'].", пÑоÑÑо ÑдалиÑе ÑÑо пиÑÑмо
";
$mail->Body = $data;
if (!$mail->Send()) die ('Mailer Error: '.$mail->ErrorInfo);
}else{
$userDataNewOrder = $_POST['dataArr'];
$userDataNewOrderTxt = "";
$userDataNewOrderComment = "";
for($i = 0;$i";
$userDataNewOrderComment .= $userDataNewOrder[$i][2].": ".$userDataNewOrder[$i][1]."
";
}
}
$userNotAuthorized = true;
}
if($user == 0){
unset($_SESSION['user']);
exit();
}
}else{
$user = $_SESSION['user'];
if(!users::testUser($dbh,$user)){
echo "ÐÐ°Ñ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ Ð±Ñл заблокиÑован! ÐбÑаÑиÑеÑÑ Ð² ÑлÑÐ¶Ð±Ñ Ð¿Ð¾Ð´Ð´ÐµÑжки.";
exit();
}
}
if($user == -1){
unset($_SESSION['user']);
echo -1;
exit();
}
$user_mail = users::getLogin($dbh,$user);
$result = "ÐнÑоÑмаÑÐ¸Ñ Ð¿Ð¾ Ð·Ð°ÐºÐ°Ð·Ñ â".$_SESSION['myOrder']."
";
$res = users::get($dbh,$user_mail);
if ($userNotAuthorized == false){
$result .= "ÐаÑи пеÑÑоналÑнÑе даннÑе:
";
$result .= "Ðогин: ".$res[0]['login']."
";
$fields = users::getAllUserFields($dbh);
foreach($fields as $key =>$value){
$result.= "".$value['title'].": ".$res[0]['data'][$value['id']]."
";
}
}else{
$result .= "ÐаÑи пеÑÑоналÑнÑе даннÑе:
$userDataNewOrderTxt";
}
updateOrder($dbh,$user,1,$_SESSION['myOrder']);
$orderTmp = getOrder($dbh,$_SESSION['myOrder']);
if ($userNotAuthorized == true){
if ($userDataNewOrderComment){
$mailComment = $orderTmp["comment"]."
Ðаказ без авÑоÑизаÑии - введена инÑоÑмаÑиÑ:
$userDataNewOrderTxt";
$orderTmp["comment"] = $orderTmp["comment"]."
__________________
Ðаказ без авÑоÑизаÑии - введена инÑоÑмаÑиÑ:
$userDataNewOrderComment";
order::chgMainComment($dbh,$orderTmp["comment"],$_SESSION['myOrder']);
$orderTmp["comment"] = $mailComment;
}
}
$result .= "
Ðаименование |
СÑоимоÑÑÑ |
ÐолиÑеÑÑво |
СÑмма |
";
$sum = 0;
$col = 0;
for ($i=0;$i
";
$tmp = $orderTmp['orderData'][$i]['options'];
for($i2 = 0;$i2''){
$result .= "
ÐомменÑаÑий к позиÑии: ".$orderTmp['orderData'][$i]['comment'];
}
$result .= "
".$orderTmp['orderData'][$i]['priceFormated'].".- |
".$orderTmp['orderData'][$i]['col']." |
".$orderTmp['orderData'][$i]['priceSumCurrent'].".- |
";
}
if ($style == "background:#efefef; color:#000;"){
$style = "background:#fff; color:#000;";
}else{
$style = "background:#efefef; color:#000;";
}
$sum = str_replace(" "," ",number_format($sum,0,'.'," "));
$result .= "
ÐТÐÐÐ: |
$col |
$sum.- |
";
$result .= "
";
if($orderTmp["comment"]){
$result .= "ÐомменÑаÑий к заказÑ: ".$orderTmp["comment"]."
";
}
$deliverData = order::getDeliverData();
$result .= "
ÐоÑÑавка: ".$deliverData[$orderTmp["deliver"]]."
";
$result .= "
ÐаÑа ÑовеÑÑÐµÐ½Ð¸Ñ Ð·Ð°ÐºÐ°Ð·Ð°: ".$orderTmp["dateFormated"]."
";
$result .= "
ÐÑ Ð¼Ð¾Ð¶ÐµÑе пÑоÑмоÑÑеÑÑ Ð·Ð°ÐºÐ°Ð·, а Ñакже оÑÑледиÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ðµ ÑÑаÑÑÑов по позиÑиÑм ÑеÑез ÐÐ°Ñ Ð»Ð¸ÑнÑй ÐºÐ°Ð±Ð¸Ð½ÐµÑ Ð½Ð° ÑайÑе: http://".$_SERVER['HTTP_HOST'].". ÐеÑейÑи в лиÑнÑй кабинеÑ
";
$result .= "ÐаÑим логином Ð´Ð»Ñ Ð²Ñ
ода в ÑиÑÑÐµÐ¼Ñ ÑвлÑеÑÑÑ ÐÐ°Ñ ÑлекÑÑоннÑй адÑеÑ.
";
$result .= "
СпаÑибо за Ñо, ÑÑо вÑбÑали наÑÑ ÐºÐ¾Ð¼Ð¿Ð°Ð½Ð¸Ñ!
С Уважением, ÐнÑеÑнеÑ-магазин http://".$_SERVER['HTTP_HOST']."
";
$smarty->assign("orderId",$_SESSION['myOrder']);
$smarty->assign("orderCount",0);
$smarty->assign("justMkOrder",1);
$theme = "Уведомление о заказе Ñ ÑайÑа http://".$_SERVER['HTTP_HOST'];
$data = $result;
$mail = new PHPMailer();
$host = str_replace("www.","",$_SERVER['HTTP_HOST']);
$mail->From = "noreply@".$host;
$mail->FromName = 'www.'.$host;
$e_mail = explode(",",$_this->admin_mail);
for($i=0;$i""){
$mail->AddBCC($e_mail[$i],'');
}
}
$mail->AddAddress($user_mail,'');
$mail->CharSet = "UTF-8";
$mail->IsHTML(true);
$mail->Subject = $theme;
$mail->Body = $data;
if (!$mail->Send()) die ('Mailer Error: '.$mail->ErrorInfo);
unset($_SESSION['myOrder']);
}
echo 1;
exit();
}
if(isset($_SESSION['myOrder'])){
$smarty->assign("orderCount",countOrderData($dbh,$_SESSION['myOrder']));
$price = getOrderPriceInRub($dbh,$_SESSION['myOrder']);
$smarty->assign("allPriceData",$price);
}else{
$smarty->assign("orderCount",0);
$smarty->assign("allPriceData",0);
}
if(isset($_POST['mkOrder'])){
if(updateOrder($dbh,1,$_POST['orderId'])){
if(isset($_SESSION['myOrder'])){
$smarty->assign("orderId",$_SESSION['myOrder']);
$smarty->assign("orderCount",0);
$smarty->assign("justMkOrder",1);
$theme = iconv("UTF-8","KOI8-R","Уведомление заказе Ñ ÑайÑа http://".$_SERVER['HTTP_HOST']);
$data = iconv("UTF-8","KOI8-R","ÐÑоизведен заказ:
ID заказа: ".$_SESSION['myOrder']."
_____________________________________________________
ÐаÑа ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð¿Ð¸ÑÑма: ".date("H-m d.m.Y"));
mail($_this->admin_mail2,"$theme","$data".date("H-m d.m.Y"),"From: info@".$_SERVER['HTTP_HOST'],
"Reply-To: info@".$_SERVER['HTTP_HOST'],
"X-Mailer: PHP/".phpversion()
);
mail("DrozdovAA@bk.ru","$theme","$data".date("H-m d.m.Y"),"From: info@".$_SERVER['HTTP_HOST'],
"Reply-To: info@".$_SERVER['HTTP_HOST'],
"X-Mailer: PHP/".phpversion()
);
unset($_SESSION['myOrder']);
}
}
}
if( count($otherCat) == 2 &&$otherCat[1] <>"pay"){
$err = false;
$ref = $_SERVER['HTTP_REFERER'];
$hst = "http://".$_SERVER['HTTP_HOST'];
for($i=0;$iassign("host",$_SERVER['HTTP_HOST']);
$smarty->display("404.tpl");
exit();
}
}
if (!$err){
$newId = $otherCat[1];
settype($newId,"integer");
if($newId){
if(!isset($_SESSION['myOrder'])){
if(isset($userarray[0]['id'])){
$orderId = createOrder($dbh,"","","",0,$userarray[0]['id']);
}else{
$orderId = createOrder($dbh,"","","",0,0);
}
if($orderId>0){
$_SESSION['myOrder'] = $orderId;
$res = createOrderData($dbh,$newId,$_SESSION['myOrder']);
}
}else{
$res = createOrderData($dbh,$newId,$_SESSION['myOrder']);
}
}
if (!$res){
echo -2;
exit();
}
echo countOrderData($dbh,$_SESSION['myOrder']);
}else{
echo -1;
}
exit();
}
if(isset($_SESSION['myOrder'])){
$smarty->assign("orderId",$_SESSION['myOrder']);
$smarty->assign("fields",users::getAllUserFields($dbh));
$smarty->assign("showClient",true);
$data = getOrder($dbh,$_SESSION['myOrder']);
$smarty->assign("comment",$data["comment"]);
$smarty->assign("orderId",$_SESSION['myOrder']);
$smarty->assign('orderData',$data['orderData']);
$smarty->assign("deliverData",order::getDeliverData());
$priceSumAll = order::getSumOrderIfRURFormatted($dbh,$_SESSION['myOrder']);
$smarty->assign("priceSumAll",$priceSumAll);
};