コード例 #1
0
ファイル: CardsModel.php プロジェクト: sov-20-07/billing
    public static function SaveCard()
    {
        Funcs::escapePost();
        $tree = array('name' => $_SESSION['card']['title']);
        $id = Tree::addTree(100, $tree, 'cards');
        $sql = '
			INSERT INTO {{catalog}}
			SET 
				tree=' . $id . ',
				description=\'' . $_SESSION['card']['message'] . '\',
				price=' . $_SESSION['card']['price'] . ',
				vendor=' . $_SESSION['iuser']['id'] . '
		';
        DB::exec($sql);
        $mrh_login = Cards::$mrh_login;
        $mrh_pass1 = Cards::$mrh_pass1;
        $inv_id = $id;
        $_SESSION['card']['id'] = $id;
        $out_summ = $_SESSION['card']['price'];
        $shp_item = Cards::$shp_item;
        $inv_desc = "Подарочная карта, на сумму " . $_SESSION['card']['price'];
        $in_curr = "";
        $culture = "ru";
        $encoding = "utf-8";
        $crc = md5("{$mrh_login}:{$out_summ}:{$inv_id}:{$mrh_pass1}:Shp_item={$shp_item}");
        /*print "<html><script language=JavaScript ". 
        		"src='https://merchant.roboxchange.com/Handler/MrchSumPreview.ashx?". 
        		"MrchLogin=$mrh_login&OutSum=$out_summ&InvId=$inv_id&IncCurrLabel=$in_curr". 
        		"&Desc=$inv_desc&SignatureValue=$crc&Shp_item=$shp_item". 
        		"&Culture=$culture&Encoding=$encoding'></script></html>";*/
        print "<html><script>" . "document.location.href='http://test.robokassa.ru/index.aspx?" . "MrchLogin={$mrh_login}&OutSum={$out_summ}&InvId={$inv_id}&IncCurrLabel={$in_curr}" . "&Desc={$inv_desc}&SignatureValue={$crc}&Shp_item={$shp_item}" . "&Culture={$culture}&Encoding={$encoding}';</script></html>";
    }
コード例 #2
0
ファイル: UploadModel.php プロジェクト: sov-20-07/billing
 public function step3()
 {
     Funcs::escapePost();
     if ($_FILES['filecover']['type'] == 'application/pdf' && $_FILES['filepages']['type'] == 'application/pdf') {
         foreach ($_FILES as $key => $item) {
             $name = explode('/', $item['tmp_name']);
             $name = $name[count($name) - 1];
             $dirfile = $_SERVER['DOCUMENT_ROOT'] . TEMP_DIR . $name;
             move_uploaded_file($item['tmp_name'], $dirfile);
             chmod($dirfile, 0777);
             $_SESSION['iuser']['upload'][$key]['name'] = $item['name'];
             $_SESSION['iuser']['upload'][$key]['path'] = $dirfile;
             if ($key == 'filepages') {
                 $imagick = new Imagick($dirfile);
                 $countpage = $imagick->getNumberImages();
                 $countpage = $countpage + $countpage % 2;
                 $_SESSION['iuser']['upload']['countpage'] = $countpage;
             }
         }
     }
 }
コード例 #3
0
ファイル: FeedbackModel.php プロジェクト: sov-20-07/billing
    public function sendMessage()
    {
        Funcs::escapePost();
        //if($_POST['kcaptcha']==$_SESSION['captcha_keystring'] && $_POST['kcaptcha']!='' && $_SESSION['captcha_keystring']!=''){
        $text = '
				<b>ФИО:</b> ' . $_POST['fio'] . '<br />
				<b>Телефон:</b> ' . $_POST['tel'] . '<br />
				<b>Email:</b> <a href="mailto:' . $_POST['email'] . '">' . $_POST['email'] . '</a><br />
				<b>Тема:</b> ' . $_POST['theme'] . '<br />
				<b>Сообщение:</b><br />' . nl2br($_POST['quest']) . '<br />
			';
        $mail = new Email();
        $mail->To(Funcs::$conf['email']['feedback']);
        $mail->Subject('Обратная связь на сайте ' . $_SERVER['HTTP_HOST']);
        $mail->Text($text);
        $mail->Send();
        return false;
        /*}else{
        			return true;
        		}*/
    }
コード例 #4
0
 function messages()
 {
     if ($_POST) {
         Funcs::escapePost();
         Message::addMessage(Funcs::$uri[2], $_POST['message']);
         $this->redirect('/cabinet/messages/' . Funcs::$uri[2] . '/');
     }
     if ($_GET['del']) {
         Funcs::escapeGet();
         Message::delMessage($_GET['del']);
         $this->redirect('/cabinet/messages/' . Funcs::$uri[2] . '/');
     }
     if (is_numeric(Funcs::$uri[2])) {
         $seo['seo_title'] = 'Сообщения';
         Funcs::setMeta($seo);
         $data = Message::getList(Funcs::$uri[2]);
         View::render('cabinet/messagesOne', $data);
     } else {
         $seo['seo_title'] = 'Сообщения';
         Funcs::setMeta($seo);
         $data['list'] = Message::getUsers();
         View::render('cabinet/messages', $data);
     }
 }
コード例 #5
0
ファイル: BasketModel.php プロジェクト: sov-20-07/billing
 public static function setStep3()
 {
     Funcs::escapePost();
     $_SESSION['mydata']['payment'] = $_POST['rgr2'];
 }
コード例 #6
0
ファイル: UserModel.php プロジェクト: sov-20-07/billing
    public function setAnketa()
    {
        Funcs::escapePost();
        $data = array();
        $text = '';
        foreach (OneSSA::$iuserStandartAdds as $title => $items) {
            $text .= '<h3>' . $title . ':</h3>';
            foreach ($items as $key => $item) {
                if ($item['type'] == 'bool') {
                    $data[$key] = $_POST[$key] == 1 ? '1' : '0';
                    $_POST[$key] = $_POST[$key] == 1 ? 'Да' : 'Нет';
                } else {
                    if ($item['main'] != 1) {
                        $data[$key] = $_POST[$key];
                    }
                }
                $text .= '<b>' . $item['name'] . ':</b> ' . $_POST[$key] . '<br />';
            }
        }
        $pass = Funcs::generate_password(8);
        $address = array();
        foreach (OneSSA::$iuserStandartAdds['1.2 Фактический адрес'] as $key => $item) {
            if ($_POST[$key] != '') {
                $address[] = $_POST[$key];
            }
        }
        if (count($address) > 0) {
            $address = implode(', ', $address);
        } else {
            $address = '';
        }
        $sql = '
			INSERT INTO {{iusers}}
			SET name=\'' . $_POST['name'] . '\',
				phone=\'' . $_POST['phone'] . '\',
				email=\'' . $_POST['email'] . '\',
				pass=\'' . md5($pass) . '\',
				address=\'' . $address . '\',
				visible=0,
				cdate=NOW()
		';
        $id = DB::exec($sql);
        $text .= '<b>Пароль:</b> ' . $pass . '<br />';
        $text .= '<b>Пользователь:</b> ' . $id . '<br />';
        foreach ($data as $key => $item) {
            $sql = '
				INSERT INTO {{iusers_adds}}
				SET iuser='******',
					name=\'' . $key . '\',
					string_value=\'' . $_POST[$key] . '\'
			';
            DB::exec($sql);
        }
        $mail = new Email();
        $mail->mailTo(Funcs::$conf['email']['anketa']);
        $mail->Subject('Новая анкета партнера на сайте ' . str_replace("www.", "", $_SERVER["HTTP_HOST"]));
        View::$layout = 'empty';
        $text = View::getRender('email/anketa', array('text' => $text));
        $mail->Text($text);
        $mail->Send();
    }
コード例 #7
0
ファイル: PopupController.php プロジェクト: sov-20-07/billing
 function sendmessage()
 {
     if ($_SESSION['iuser']) {
         Funcs::escapePost();
         Message::addMessage($_POST['touser'], $_POST['message']);
         View::$layout = 'popup';
         View::render('popup/loginclose');
     }
 }