当前位置: 首页>>代码示例>>PHP>>正文


PHP Tree::addTree方法代码示例

本文整理汇总了PHP中Tree::addTree方法的典型用法代码示例。如果您正苦于以下问题:PHP Tree::addTree方法的具体用法?PHP Tree::addTree怎么用?PHP Tree::addTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tree的用法示例。


在下文中一共展示了Tree::addTree方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: SaveCard

    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>";
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:32,代码来源:CardsModel.php

示例2: add

 public function add()
 {
     $model = new Tree();
     if (count(Index::getModuleList()) == 0) {
         Module::createPageContent();
     }
     $model->addTree();
     $this->redirect('/');
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:9,代码来源:TreeController.php

示例3: add

    public function add()
    {
        $module = Module::getModuleById($_POST['module']);
        if (!is_numeric($_POST['tree'])) {
            $tree = Tree::addTree();
        } else {
            $tree = Tree::editTree($_POST['tree']);
        }
        if ($_POST['id'] != '0') {
            $sql = '
				INSERT INTO {{catalog}}
				SET tree=' . $tree . '
			';
            $dataId = DB::exec($sql);
            $sql = 'SELECT path FROM {{modules}} WHERE id=' . $module['catalog'];
            $moduleCtatalog = DB::getOne($sql);
            if ($moduleCtatalog) {
                $sql = '
					INSERT INTO {{relations}}
					SET
						modul1=\'tree\',
						modul2=\'' . $moduleCtatalog . '\',
						id1=\'' . $tree . '\',
						id2=0,
						cdate=NOW()
				';
                DB::exec($sql);
            }
        } else {
            $dataId = 0;
        }
        $sql = '
			INSERT INTO {{relations}}
			SET
				modul1=\'tree\',
				modul2=\'' . $module['path'] . '\',
				id1=\'' . $tree . '\',
				id2=1,
				cdate=NOW()
		';
        DB::exec($sql);
        return $tree;
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:43,代码来源:CatalogModel.php

示例4: step4

    public function step4()
    {
        $tree = array('name' => $_SESSION['iuser']['upload']['title']);
        $id = Tree::addTree($_SESSION['iuser']['upload']['spec'], $tree, 'catalog');
        if (file_exists($_SESSION['iuser']['upload']['filecover']['path']) && file_exists($_SESSION['iuser']['upload']['filepages']['path'])) {
            $dir = $_SERVER['DOCUMENT_ROOT'] . IUSER_DIR . md5('fotouser' . $_SESSION['iuser']['id']) . '/';
            if (!file_exists($dir)) {
                mkdir($dir, 0777);
            }
            $dir = $dir . md5('fotobook' . $id) . '/';
            mkdir($dir, 0777);
            for ($file2i = 0; $file2i < 2; $file2i++) {
                if ($file2i == 0) {
                    $filename = explode('.', $_SESSION['iuser']['upload']['filecover']['name']);
                    $filesource = $_SESSION['iuser']['upload']['filecover']['path'];
                } else {
                    $filename = explode('.', $_SESSION['iuser']['upload']['filepages']['name']);
                    $filesource = $_SESSION['iuser']['upload']['filepages']['path'];
                }
                $raz = $filename[count($filename) - 1];
                unset($filename[count($filename) - 1]);
                $filename = implode('', $filename);
                $filenameraz = Funcs::Transliterate($filename) . '.' . $raz;
                $dirfile = $dir . $filenameraz;
                $x = 0;
                $i = 1;
                while ($x == 0) {
                    if (file_exists($dirfile)) {
                        $filenameraz = Funcs::Transliterate($filename) . $i . '.' . $raz;
                        $dirfile = $dir . md5($filename) . '/' . $filenameraz;
                    } else {
                        $x = 1;
                    }
                    $i++;
                }
                copy($filesource, $dirfile);
                chmod($dirfile, 0777);
                unlink($filesource);
                if ($file2i == 0) {
                    $filename1 = $filenameraz;
                } else {
                    $filename2 = $filenameraz;
                }
            }
        }
        $price = Basket::getPrice('session');
        $sql = '
			INSERT INTO {{catalog}}
			SET
				tree=' . $id . ',
				description=\'' . $_SESSION['iuser']['upload']['description'] . '\',
				phrase=\'' . $_SESSION['iuser']['upload']['phrase'] . '\',
				author=\'' . $_SESSION['iuser']['upload']['author'] . '\',
				private=' . $_SESSION['iuser']['upload']['private'] . ',
				booksize=' . $_SESSION['iuser']['upload']['booksize'] . ',
				countpage=' . $_SESSION['iuser']['upload']['countpage'] . ',
				binding=' . $_SESSION['iuser']['upload']['binding'] . ',
				paper=' . $_SESSION['iuser']['upload']['paper'] . ',
				price=' . $price . ',
				filecover=\'' . $filename1 . '\',
				filepages=\'' . $filename2 . '\',
				vendor=' . $_SESSION['iuser']['id'] . '
		';
        DB::exec($sql);
        unset($_SESSION['iuser']['upload']);
        $_SESSION['iuser']['upload']['id'] = $id;
        $_SESSION['iuser']['upload']['price'] = $price;
        Upload::addGallery($id, $filename1, $filename2, $dir);
        Email::uploadSend();
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:70,代码来源:UploadModel.php

示例5: add

    function add()
    {
        if (!is_numeric($_POST['tree'])) {
            $tree = Tree::addTree();
        } else {
            $tree = Tree::editTree($_POST['tree']);
        }
        $i = 0;
        if (count($_POST['data']) > 0) {
            foreach ($_POST['data'] as $key => $item) {
                Fields::Insert($tree, $_POST['module'], $key, $item, $_POST['fieldtypes'][$i], $i);
                $i++;
            }
        }
        $sql = 'SELECT * FROM {{modules}} WHERE id=' . $_POST['module'];
        $module = DB::getRow($sql);
        $sql = '
			INSERT INTO {{relations}}
			SET
				modul1=\'tree\',
				modul2=\'' . $module['path'] . '\',
				id1=\'' . $tree . '\',
				id2=1,
				cdate=NOW()
		';
        DB::exec($sql);
        $sql = 'SELECT path FROM {{modules}} WHERE id=' . $module['catalog'];
        $moduleCtatalog = DB::getOne($sql);
        if ($moduleCtatalog) {
            $sql = '
				INSERT INTO {{relations}}
				SET
					modul1=\'tree\',
					modul2=\'' . $moduleCtatalog . '\',
					id1=\'' . $tree . '\',
					id2=0,
					cdate=NOW()
			';
            DB::exec($sql);
        }
        return $tree;
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:42,代码来源:WorkModel.php


注:本文中的Tree::addTree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。