code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui; import com.google.android.apps.iosched.util.ActivityHelper; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; /** * A base activity that defers common functionality across app activities to an * {@link ActivityHelper}. This class shouldn't be used directly; instead, activities should * inherit from {@link BaseSinglePaneActivity} or {@link BaseMultiPaneActivity}. */ public abstract class BaseActivity extends FragmentActivity { final ActivityHelper mActivityHelper = ActivityHelper.createInstance(this); @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); mActivityHelper.onPostCreate(savedInstanceState); } @Override public boolean onKeyLongPress(int keyCode, KeyEvent event) { return mActivityHelper.onKeyLongPress(keyCode, event) || super.onKeyLongPress(keyCode, event); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { return mActivityHelper.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event); } @Override public boolean onCreateOptionsMenu(Menu menu) { return mActivityHelper.onCreateOptionsMenu(menu) || super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { return mActivityHelper.onOptionsItemSelected(item) || super.onOptionsItemSelected(item); } /** * Returns the {@link ActivityHelper} object associated with this activity. */ protected ActivityHelper getActivityHelper() { return mActivityHelper; } /** * Takes a given intent and either starts a new activity to handle it (the default behavior), * or creates/updates a fragment (in the case of a multi-pane activity) that can handle the * intent. * * Must be called from the main (UI) thread. */ public void openActivityOrFragment(Intent intent) { // Default implementation simply calls startActivity startActivity(intent); } /** * Converts an intent into a {@link Bundle} suitable for use as fragment arguments. */ public static Bundle intentToFragmentArguments(Intent intent) { Bundle arguments = new Bundle(); if (intent == null) { return arguments; } final Uri data = intent.getData(); if (data != null) { arguments.putParcelable("_uri", data); } final Bundle extras = intent.getExtras(); if (extras != null) { arguments.putAll(intent.getExtras()); } return arguments; } /** * Converts a fragment arguments bundle into an intent. */ public static Intent fragmentArgumentsToIntent(Bundle arguments) { Intent intent = new Intent(); if (arguments == null) { return intent; } final Uri data = arguments.getParcelable("_uri"); if (data != null) { intent.setData(data); } intent.putExtras(arguments); intent.removeExtra("_uri"); return intent; } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/BaseActivity.java
Java
asf20
3,953
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui; import com.google.android.apps.iosched.R; import com.google.android.apps.iosched.provider.ScheduleContract; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.graphics.drawable.ColorDrawable; import android.provider.BaseColumns; import android.view.View; import android.view.ViewGroup; import android.widget.CursorAdapter; import android.widget.ImageView; import android.widget.TextView; /** * A {@link android.widget.CursorAdapter} that renders a {@link TracksQuery}. */ public class TracksAdapter extends CursorAdapter { private static final int ALL_ITEM_ID = Integer.MAX_VALUE; private Activity mActivity; private boolean mHasAllItem; private int mPositionDisplacement; private boolean mIsSessions = true; public TracksAdapter(Activity activity) { super(activity, null); mActivity = activity; } public void setHasAllItem(boolean hasAllItem) { mHasAllItem = hasAllItem; mPositionDisplacement = mHasAllItem ? 1 : 0; } public void setIsSessions(boolean isSessions) { mIsSessions = isSessions; } @Override public int getCount() { return super.getCount() + mPositionDisplacement; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (mHasAllItem && position == 0) { if (convertView == null) { convertView = mActivity.getLayoutInflater().inflate( R.layout.list_item_track, parent, false); } // Custom binding for the first item ((TextView) convertView.findViewById(android.R.id.text1)).setText( "(" + mActivity.getResources().getString(mIsSessions ? R.string.all_sessions_title : R.string.all_sandbox_title) + ")"); convertView.findViewById(android.R.id.icon1).setVisibility(View.INVISIBLE); return convertView; } return super.getView(position - mPositionDisplacement, convertView, parent); } @Override public Object getItem(int position) { if (mHasAllItem && position == 0) { return null; } return super.getItem(position - mPositionDisplacement); } @Override public long getItemId(int position) { if (mHasAllItem && position == 0) { return ALL_ITEM_ID; } return super.getItemId(position - mPositionDisplacement); } @Override public boolean isEnabled(int position) { if (mHasAllItem && position == 0) { return true; } return super.isEnabled(position - mPositionDisplacement); } @Override public int getViewTypeCount() { // Add an item type for the "All" view. return super.getViewTypeCount() + 1; } @Override public int getItemViewType(int position) { if (mHasAllItem && position == 0) { return getViewTypeCount() - 1; } return super.getItemViewType(position - mPositionDisplacement); } /** {@inheritDoc} */ @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { return mActivity.getLayoutInflater().inflate(R.layout.list_item_track, parent, false); } /** {@inheritDoc} */ @Override public void bindView(View view, Context context, Cursor cursor) { final TextView textView = (TextView) view.findViewById(android.R.id.text1); textView.setText(cursor.getString(TracksQuery.TRACK_NAME)); // Assign track color to visible block final ImageView iconView = (ImageView) view.findViewById(android.R.id.icon1); iconView.setImageDrawable(new ColorDrawable(cursor.getInt(TracksQuery.TRACK_COLOR))); } /** {@link com.google.android.apps.iosched.provider.ScheduleContract.Tracks} query parameters. */ public interface TracksQuery { int _TOKEN = 0x1; String[] PROJECTION = { BaseColumns._ID, ScheduleContract.Tracks.TRACK_ID, ScheduleContract.Tracks.TRACK_NAME, ScheduleContract.Tracks.TRACK_ABSTRACT, ScheduleContract.Tracks.TRACK_COLOR, }; String[] PROJECTION_WITH_SESSIONS_COUNT = { BaseColumns._ID, ScheduleContract.Tracks.TRACK_ID, ScheduleContract.Tracks.TRACK_NAME, ScheduleContract.Tracks.TRACK_ABSTRACT, ScheduleContract.Tracks.TRACK_COLOR, ScheduleContract.Tracks.SESSIONS_COUNT, }; String[] PROJECTION_WITH_VENDORS_COUNT = { BaseColumns._ID, ScheduleContract.Tracks.TRACK_ID, ScheduleContract.Tracks.TRACK_NAME, ScheduleContract.Tracks.TRACK_ABSTRACT, ScheduleContract.Tracks.TRACK_COLOR, ScheduleContract.Tracks.VENDORS_COUNT, }; int _ID = 0; int TRACK_ID = 1; int TRACK_NAME = 2; int TRACK_ABSTRACT = 3; int TRACK_COLOR = 4; } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/TracksAdapter.java
Java
asf20
5,862
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * ATTENTION: Consider using the 'ViewPager' widget, available in the * Android Compatibility Package, r3: * * http://developer.android.com/sdk/compatibility-library.html */ package com.google.android.apps.iosched.ui.widget; import com.google.android.apps.iosched.util.MotionEventUtils; import com.google.android.apps.iosched.util.ReflectionUtils; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.ViewParent; import android.widget.Scroller; import java.util.ArrayList; /** * A {@link android.view.ViewGroup} that shows one child at a time, allowing the user to swipe * horizontally to page between other child views. Based on <code>Workspace.java</code> in the * <code>Launcher.git</code> AOSP project. * * An improved version of this UI widget named 'ViewPager' is now available in the * <a href="http://developer.android.com/sdk/compatibility-library.html">Android Compatibility * Package, r3</a>. */ public class Workspace extends ViewGroup { private static final String TAG = "Workspace"; private static final int INVALID_SCREEN = -1; /** * The velocity at which a fling gesture will cause us to snap to the next screen */ private static final int SNAP_VELOCITY = 500; /** * The user needs to drag at least this much for it to be considered a fling gesture. This * reduces the chance of a random twitch sending the user to the next screen. */ // TODO: refactor private static final int MIN_LENGTH_FOR_FLING = 100; private int mDefaultScreen; private boolean mFirstLayout = true; private boolean mHasLaidOut = false; private int mCurrentScreen; private int mNextScreen = INVALID_SCREEN; private Scroller mScroller; private VelocityTracker mVelocityTracker; /** * X position of the active pointer when it was first pressed down. */ private float mDownMotionX; /** * Y position of the active pointer when it was first pressed down. */ private float mDownMotionY; /** * This view's X scroll offset when the active pointer was first pressed down. */ private int mDownScrollX; private final static int TOUCH_STATE_REST = 0; private final static int TOUCH_STATE_SCROLLING = 1; private int mTouchState = TOUCH_STATE_REST; private OnLongClickListener mLongClickListener; private boolean mAllowLongPress = true; private int mTouchSlop; private int mPagingTouchSlop; private int mMaximumVelocity; private static final int INVALID_POINTER = -1; private int mActivePointerId = INVALID_POINTER; private Drawable mSeparatorDrawable; private OnScreenChangeListener mOnScreenChangeListener; private OnScrollListener mOnScrollListener; private boolean mLocked; private int mDeferredScreenChange = -1; private boolean mDeferredScreenChangeFast = false; private boolean mDeferredNotify = false; private boolean mIgnoreChildFocusRequests; private boolean mIsVerbose = false; public interface OnScreenChangeListener { void onScreenChanged(View newScreen, int newScreenIndex); void onScreenChanging(View newScreen, int newScreenIndex); } public interface OnScrollListener { void onScroll(float screenFraction); } /** * Used to inflate the com.google.android.ext.workspace.Workspace from XML. * * @param context The application's context. * @param attrs The attributes set containing the com.google.android.ext.workspace.Workspace's * customization values. */ public Workspace(Context context, AttributeSet attrs) { super(context, attrs); mDefaultScreen = 0; mLocked = false; setHapticFeedbackEnabled(false); initWorkspace(); mIsVerbose = Log.isLoggable(TAG, Log.VERBOSE); } /** * Initializes various states for this workspace. */ private void initWorkspace() { mScroller = new Scroller(getContext()); mCurrentScreen = mDefaultScreen; final ViewConfiguration configuration = ViewConfiguration.get(getContext()); mTouchSlop = configuration.getScaledTouchSlop(); mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); mPagingTouchSlop = ReflectionUtils.callWithDefault(configuration, "getScaledPagingTouchSlop", mTouchSlop * 2); } /** * Returns the index of the currently displayed screen. */ int getCurrentScreen() { return mCurrentScreen; } /** * Returns the number of screens currently contained in this Workspace. */ int getScreenCount() { int childCount = getChildCount(); if (mSeparatorDrawable != null) { return (childCount + 1) / 2; } return childCount; } View getScreenAt(int index) { if (mSeparatorDrawable == null) { return getChildAt(index); } return getChildAt(index * 2); } int getScrollWidth() { int w = getWidth(); if (mSeparatorDrawable != null) { w += mSeparatorDrawable.getIntrinsicWidth(); } return w; } void handleScreenChangeCompletion(int currentScreen) { mCurrentScreen = currentScreen; View screen = getScreenAt(mCurrentScreen); //screen.requestFocus(); try { ReflectionUtils.tryInvoke(screen, "dispatchDisplayHint", new Class[]{int.class}, View.VISIBLE); invalidate(); } catch (NullPointerException e) { Log.e(TAG, "Caught NullPointerException", e); } notifyScreenChangeListener(mCurrentScreen, true); } void notifyScreenChangeListener(int whichScreen, boolean changeComplete) { if (mOnScreenChangeListener != null) { if (changeComplete) mOnScreenChangeListener.onScreenChanged(getScreenAt(whichScreen), whichScreen); else mOnScreenChangeListener.onScreenChanging(getScreenAt(whichScreen), whichScreen); } if (mOnScrollListener != null) { mOnScrollListener.onScroll(getCurrentScreenFraction()); } } /** * Registers the specified listener on each screen contained in this workspace. * * @param listener The listener used to respond to long clicks. */ @Override public void setOnLongClickListener(OnLongClickListener listener) { mLongClickListener = listener; final int count = getScreenCount(); for (int i = 0; i < count; i++) { getScreenAt(i).setOnLongClickListener(listener); } } @Override public void computeScroll() { if (mScroller.computeScrollOffset()) { scrollTo(mScroller.getCurrX(), mScroller.getCurrY()); if (mOnScrollListener != null) { mOnScrollListener.onScroll(getCurrentScreenFraction()); } postInvalidate(); } else if (mNextScreen != INVALID_SCREEN) { // The scroller has finished. handleScreenChangeCompletion(Math.max(0, Math.min(mNextScreen, getScreenCount() - 1))); mNextScreen = INVALID_SCREEN; } } @Override protected void dispatchDraw(Canvas canvas) { boolean restore = false; int restoreCount = 0; // ViewGroup.dispatchDraw() supports many features we don't need: // clip to padding, layout animation, animation listener, disappearing // children, etc. The following implementation attempts to fast-track // the drawing dispatch by drawing only what we know needs to be drawn. boolean fastDraw = mTouchState != TOUCH_STATE_SCROLLING && mNextScreen == INVALID_SCREEN; // If we are not scrolling or flinging, draw only the current screen if (fastDraw) { if (getScreenAt(mCurrentScreen) != null) { drawChild(canvas, getScreenAt(mCurrentScreen), getDrawingTime()); } } else { final long drawingTime = getDrawingTime(); // If we are flinging, draw only the current screen and the target screen if (mNextScreen >= 0 && mNextScreen < getScreenCount() && Math.abs(mCurrentScreen - mNextScreen) == 1) { drawChild(canvas, getScreenAt(mCurrentScreen), drawingTime); drawChild(canvas, getScreenAt(mNextScreen), drawingTime); } else { // If we are scrolling, draw all of our children final int count = getChildCount(); for (int i = 0; i < count; i++) { drawChild(canvas, getChildAt(i), drawingTime); } } } if (restore) { canvas.restoreToCount(restoreCount); } } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); // The children are given the same width and height as the workspace final int count = getChildCount(); for (int i = 0; i < count; i++) { if (mSeparatorDrawable != null && (i & 1) == 1) { // separator getChildAt(i).measure(mSeparatorDrawable.getIntrinsicWidth(), heightMeasureSpec); } else { getChildAt(i).measure(widthMeasureSpec, heightMeasureSpec); } } if (mFirstLayout) { setHorizontalScrollBarEnabled(false); int width = MeasureSpec.getSize(widthMeasureSpec); if (mSeparatorDrawable != null) { width += mSeparatorDrawable.getIntrinsicWidth(); } scrollTo(mCurrentScreen * width, 0); setHorizontalScrollBarEnabled(true); mFirstLayout = false; } } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { int childLeft = 0; final int count = getChildCount(); for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (child.getVisibility() != View.GONE) { final int childWidth = child.getMeasuredWidth(); child.layout(childLeft, 0, childLeft + childWidth, child.getMeasuredHeight()); childLeft += childWidth; } } mHasLaidOut = true; if (mDeferredScreenChange >= 0) { snapToScreen(mDeferredScreenChange, mDeferredScreenChangeFast, mDeferredNotify); mDeferredScreenChange = -1; mDeferredScreenChangeFast = false; } } @Override public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) { int screen = indexOfChild(child); if (mIgnoreChildFocusRequests && !mScroller.isFinished()) { Log.w(TAG, "Ignoring child focus request: request " + mCurrentScreen + " -> " + screen); return false; } if (screen != mCurrentScreen || !mScroller.isFinished()) { snapToScreen(screen); return true; } return false; } @Override protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) { int focusableScreen; if (mNextScreen != INVALID_SCREEN) { focusableScreen = mNextScreen; } else { focusableScreen = mCurrentScreen; } View v = getScreenAt(focusableScreen); if (v != null) { return v.requestFocus(direction, previouslyFocusedRect); } return false; } @Override public boolean dispatchUnhandledMove(View focused, int direction) { if (direction == View.FOCUS_LEFT) { if (getCurrentScreen() > 0) { snapToScreen(getCurrentScreen() - 1); return true; } } else if (direction == View.FOCUS_RIGHT) { if (getCurrentScreen() < getScreenCount() - 1) { snapToScreen(getCurrentScreen() + 1); return true; } } return super.dispatchUnhandledMove(focused, direction); } @Override public void addFocusables(ArrayList<View> views, int direction, int focusableMode) { View focusableSourceScreen = null; if (mCurrentScreen >= 0 && mCurrentScreen < getScreenCount()) { focusableSourceScreen = getScreenAt(mCurrentScreen); } if (direction == View.FOCUS_LEFT) { if (mCurrentScreen > 0) { focusableSourceScreen = getScreenAt(mCurrentScreen - 1); } } else if (direction == View.FOCUS_RIGHT) { if (mCurrentScreen < getScreenCount() - 1) { focusableSourceScreen = getScreenAt(mCurrentScreen + 1); } } if (focusableSourceScreen != null) { focusableSourceScreen.addFocusables(views, direction, focusableMode); } } /** * If one of our descendant views decides that it could be focused now, only pass that along if * it's on the current screen. * * This happens when live folders requery, and if they're off screen, they end up calling * requestFocus, which pulls it on screen. */ @Override public void focusableViewAvailable(View focused) { View current = getScreenAt(mCurrentScreen); View v = focused; ViewParent parent; while (true) { if (v == current) { super.focusableViewAvailable(focused); return; } if (v == this) { return; } parent = v.getParent(); if (parent instanceof View) { v = (View) v.getParent(); } else { return; } } } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { /* * This method JUST determines whether we want to intercept the motion. * If we return true, onTouchEvent will be called and we do the actual * scrolling there. */ // Begin tracking velocity even before we have intercepted touch events. if (mVelocityTracker == null) { mVelocityTracker = VelocityTracker.obtain(); } mVelocityTracker.addMovement(ev); /* * Shortcut the most recurring case: the user is in the dragging * state and he is moving his finger. We want to intercept this * motion. */ final int action = ev.getAction(); if (mIsVerbose) { Log.v(TAG, "onInterceptTouchEvent: " + (ev.getAction() & MotionEventUtils.ACTION_MASK)); } if (((action & MotionEventUtils.ACTION_MASK) == MotionEvent.ACTION_MOVE) && (mTouchState == TOUCH_STATE_SCROLLING)) { if (mIsVerbose) { Log.v(TAG, "Intercepting touch events"); } return true; } switch (action & MotionEventUtils.ACTION_MASK) { case MotionEvent.ACTION_MOVE: { if (mLocked) { // we're locked on the current screen, don't allow moving break; } /* * Locally do absolute value. mDownMotionX is set to the y value * of the down event. */ final int pointerIndex = MotionEventUtils.findPointerIndex(ev, mActivePointerId); final float x = MotionEventUtils.getX(ev, pointerIndex); final float y = MotionEventUtils.getY(ev, pointerIndex); final int xDiff = (int) Math.abs(x - mDownMotionX); final int yDiff = (int) Math.abs(y - mDownMotionY); boolean xPaged = xDiff > mPagingTouchSlop; boolean xMoved = xDiff > mTouchSlop; boolean yMoved = yDiff > mTouchSlop; if (xMoved || yMoved) { if (xPaged) { // Scroll if the user moved far enough along the X axis mTouchState = TOUCH_STATE_SCROLLING; } // Either way, cancel any pending longpress if (mAllowLongPress) { mAllowLongPress = false; // Try canceling the long press. It could also have been scheduled // by a distant descendant, so use the mAllowLongPress flag to block // everything final View currentScreen = getScreenAt(mCurrentScreen); if (currentScreen != null) { currentScreen.cancelLongPress(); } } } break; } case MotionEvent.ACTION_DOWN: { final float x = ev.getX(); final float y = ev.getY(); // Remember location of down touch mDownMotionX = x; mDownMotionY = y; mDownScrollX = getScrollX(); mActivePointerId = MotionEventUtils.getPointerId(ev, 0); mAllowLongPress = true; /* * If being flinged and user touches the screen, initiate drag; * otherwise don't. mScroller.isFinished should be false when * being flinged. */ mTouchState = mScroller.isFinished() ? TOUCH_STATE_REST : TOUCH_STATE_SCROLLING; break; } case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: // Release the drag mTouchState = TOUCH_STATE_REST; mAllowLongPress = false; mActivePointerId = INVALID_POINTER; if (mVelocityTracker == null) { mVelocityTracker.recycle(); mVelocityTracker = null; } break; case MotionEventUtils.ACTION_POINTER_UP: onSecondaryPointerUp(ev); break; } /* * The only time we want to intercept motion events is if we are in the * drag mode. */ boolean intercept = mTouchState != TOUCH_STATE_REST; if (mIsVerbose) { Log.v(TAG, "Intercepting touch events: " + Boolean.toString(intercept)); } return intercept; } void onSecondaryPointerUp(MotionEvent ev) { final int pointerIndex = (ev.getAction() & MotionEventUtils.ACTION_POINTER_INDEX_MASK) >> MotionEventUtils.ACTION_POINTER_INDEX_SHIFT; final int pointerId = MotionEventUtils.getPointerId(ev, pointerIndex); if (pointerId == mActivePointerId) { // This was our active pointer going up. Choose a new // active pointer and adjust accordingly. // TODO: Make this decision more intelligent. final int newPointerIndex = pointerIndex == 0 ? 1 : 0; mDownMotionX = MotionEventUtils.getX(ev, newPointerIndex); mDownMotionX = MotionEventUtils.getY(ev, newPointerIndex); mDownScrollX = getScrollX(); mActivePointerId = MotionEventUtils.getPointerId(ev, newPointerIndex); if (mVelocityTracker != null) { mVelocityTracker.clear(); } } } @Override public void requestChildFocus(View child, View focused) { super.requestChildFocus(child, focused); int screen = indexOfChild(child); if (mSeparatorDrawable != null) { screen /= 2; } if (screen >= 0 && !isInTouchMode()) { snapToScreen(screen); } } @Override public boolean onTouchEvent(MotionEvent ev) { if (mIsVerbose) { Log.v(TAG, "onTouchEvent: " + (ev.getAction() & MotionEventUtils.ACTION_MASK)); } if (mVelocityTracker == null) { mVelocityTracker = VelocityTracker.obtain(); } mVelocityTracker.addMovement(ev); final int action = ev.getAction(); switch (action & MotionEventUtils.ACTION_MASK) { case MotionEvent.ACTION_DOWN: // If being flinged and user touches, stop the fling. isFinished // will be false if being flinged. if (!mScroller.isFinished()) { mScroller.abortAnimation(); } // Remember where the motion event started mDownMotionX = ev.getX(); mDownMotionY = ev.getY(); mDownScrollX = getScrollX(); mActivePointerId = MotionEventUtils.getPointerId(ev, 0); break; case MotionEvent.ACTION_MOVE: if (mIsVerbose) { Log.v(TAG, "mTouchState=" + mTouchState); } if (mTouchState == TOUCH_STATE_SCROLLING) { // Scroll to follow the motion event final int pointerIndex = MotionEventUtils .findPointerIndex(ev, mActivePointerId); final float x = MotionEventUtils.getX(ev, pointerIndex); final View lastChild = getChildAt(getChildCount() - 1); final int maxScrollX = lastChild.getRight() - getWidth(); scrollTo(Math.max(0, Math.min(maxScrollX, (int)(mDownScrollX + mDownMotionX - x ))), 0); if (mOnScrollListener != null) { mOnScrollListener.onScroll(getCurrentScreenFraction()); } } else if (mTouchState == TOUCH_STATE_REST) { if (mLocked) { // we're locked on the current screen, don't allow moving break; } /* * Locally do absolute value. mLastMotionX is set to the y value * of the down event. */ final int pointerIndex = MotionEventUtils.findPointerIndex(ev, mActivePointerId); final float x = MotionEventUtils.getX(ev, pointerIndex); final float y = MotionEventUtils.getY(ev, pointerIndex); final int xDiff = (int) Math.abs(x - mDownMotionX); final int yDiff = (int) Math.abs(y - mDownMotionY); boolean xPaged = xDiff > mPagingTouchSlop; boolean xMoved = xDiff > mTouchSlop; boolean yMoved = yDiff > mTouchSlop; if (xMoved || yMoved) { if (xPaged) { // Scroll if the user moved far enough along the X axis mTouchState = TOUCH_STATE_SCROLLING; } // Either way, cancel any pending longpress if (mAllowLongPress) { mAllowLongPress = false; // Try canceling the long press. It could also have been scheduled // by a distant descendant, so use the mAllowLongPress flag to block // everything final View currentScreen = getScreenAt(mCurrentScreen); if (currentScreen != null) { currentScreen.cancelLongPress(); } } } } break; case MotionEvent.ACTION_UP: if (mTouchState == TOUCH_STATE_SCROLLING) { final int activePointerId = mActivePointerId; final int pointerIndex = MotionEventUtils.findPointerIndex(ev, activePointerId); final float x = MotionEventUtils.getX(ev, pointerIndex); final VelocityTracker velocityTracker = mVelocityTracker; velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); //TODO(minsdk8): int velocityX = (int) MotionEventUtils.getXVelocity(velocityTracker, activePointerId); int velocityX = (int) velocityTracker.getXVelocity(); boolean isFling = Math.abs(mDownMotionX - x) > MIN_LENGTH_FOR_FLING; final float scrolledPos = getCurrentScreenFraction(); final int whichScreen = Math.round(scrolledPos); if (isFling && mIsVerbose) { Log.v(TAG, "isFling, whichScreen=" + whichScreen + " scrolledPos=" + scrolledPos + " mCurrentScreen=" + mCurrentScreen + " velocityX=" + velocityX); } if (isFling && velocityX > SNAP_VELOCITY && mCurrentScreen > 0) { // Fling hard enough to move left // Don't fling across more than one screen at a time. final int bound = scrolledPos <= whichScreen ? mCurrentScreen - 1 : mCurrentScreen; snapToScreen(Math.min(whichScreen, bound)); } else if (isFling && velocityX < -SNAP_VELOCITY && mCurrentScreen < getChildCount() - 1) { // Fling hard enough to move right // Don't fling across more than one screen at a time. final int bound = scrolledPos >= whichScreen ? mCurrentScreen + 1 : mCurrentScreen; snapToScreen(Math.max(whichScreen, bound)); } else { snapToDestination(); } } else { performClick(); } mTouchState = TOUCH_STATE_REST; mActivePointerId = INVALID_POINTER; // Intentially fall through to cancel case MotionEvent.ACTION_CANCEL: mTouchState = TOUCH_STATE_REST; mActivePointerId = INVALID_POINTER; if (mVelocityTracker != null) { mVelocityTracker.recycle(); mVelocityTracker = null; } break; case MotionEventUtils.ACTION_POINTER_UP: onSecondaryPointerUp(ev); break; } return true; } /** * Returns the current scroll position as a float value from 0 to the number of screens. * Fractional values indicate that the user is mid-scroll or mid-fling, and whole values * indicate that the Workspace is currently snapped to a screen. */ float getCurrentScreenFraction() { if (!mHasLaidOut) { return mCurrentScreen; } final int scrollX = getScrollX(); final int screenWidth = getWidth(); return (float) scrollX / screenWidth; } void snapToDestination() { final int screenWidth = getScrollWidth(); final int whichScreen = (getScrollX() + (screenWidth / 2)) / screenWidth; snapToScreen(whichScreen); } void snapToScreen(int whichScreen) { snapToScreen(whichScreen, false, true); } void snapToScreen(int whichScreen, boolean fast, boolean notify) { if (!mHasLaidOut) { // Can't handle scrolling until we are laid out. mDeferredScreenChange = whichScreen; mDeferredScreenChangeFast = fast; mDeferredNotify = notify; return; } if (mIsVerbose) { Log.v(TAG, "Snapping to screen: " + whichScreen); } whichScreen = Math.max(0, Math.min(whichScreen, getScreenCount() - 1)); final int screenDelta = Math.abs(whichScreen - mCurrentScreen); final boolean screenChanging = (mNextScreen != INVALID_SCREEN && mNextScreen != whichScreen) || (mCurrentScreen != whichScreen); mNextScreen = whichScreen; View focusedChild = getFocusedChild(); boolean setTabFocus = false; if (focusedChild != null && screenDelta != 0 && focusedChild == getScreenAt( mCurrentScreen)) { // clearing the focus of the child will cause focus to jump to the tabs, // which will in turn cause snapToScreen to be called again with a different // value. To prevent this, we temporarily disable the OnTabClickListener //if (mTabRow != null) { // mTabRow.setOnTabClickListener(null); //} //focusedChild.clearFocus(); //setTabRow(mTabRow); // restore the listener //setTabFocus = true; } final int newX = whichScreen * getScrollWidth(); final int sX = getScrollX(); final int delta = newX - sX; int duration = screenDelta * 300; awakenScrollBars(duration); if (duration == 0) { duration = Math.abs(delta); } if (fast) { duration = 0; } if (mNextScreen != mCurrentScreen) { // make the current listview hide its filter popup final View screenAt = getScreenAt(mCurrentScreen); if (screenAt != null) { ReflectionUtils.tryInvoke(screenAt, "dispatchDisplayHint", new Class[]{int.class}, View.INVISIBLE); } else { Log.e(TAG, "Screen at index was null. mCurrentScreen = " + mCurrentScreen); return; } // showing the filter popup for the next listview needs to be delayed // until we've fully moved to that listview, since otherwise the // popup will appear at the wrong place on the screen //removeCallbacks(mFilterWindowEnabler); //postDelayed(mFilterWindowEnabler, duration + 10); // NOTE: moved to computeScroll and handleScreenChangeCompletion() } if (!mScroller.isFinished()) { mScroller.abortAnimation(); } mScroller.startScroll(sX, 0, delta, 0, duration); if (screenChanging && notify) { notifyScreenChangeListener(mNextScreen, false); } invalidate(); } @Override protected Parcelable onSaveInstanceState() { final SavedState state = new SavedState(super.onSaveInstanceState()); state.currentScreen = mCurrentScreen; return state; } @Override protected void onRestoreInstanceState(Parcelable state) { SavedState savedState = (SavedState) state; super.onRestoreInstanceState(savedState.getSuperState()); if (savedState.currentScreen != -1) { snapToScreen(savedState.currentScreen, true, true); } } /** * @return True is long presses are still allowed for the current touch */ boolean allowLongPress() { return mAllowLongPress; } /** * Register a callback to be invoked when the screen is changed, either programmatically or via * user interaction. Will automatically trigger a callback. * * @param screenChangeListener The callback. */ public void setOnScreenChangeListener(OnScreenChangeListener screenChangeListener) { setOnScreenChangeListener(screenChangeListener, true); } /** * Register a callback to be invoked when the screen is changed, either programmatically or via * user interaction. * * @param screenChangeListener The callback. * @param notifyImmediately Whether to trigger a notification immediately */ public void setOnScreenChangeListener(OnScreenChangeListener screenChangeListener, boolean notifyImmediately) { mOnScreenChangeListener = screenChangeListener; if (mOnScreenChangeListener != null && notifyImmediately) { mOnScreenChangeListener.onScreenChanged(getScreenAt(mCurrentScreen), mCurrentScreen); } } /** * Register a callback to be invoked when this Workspace is mid-scroll or mid-fling, either * due to user interaction or programmatic changes in the current screen index. * * @param scrollListener The callback. * @param notifyImmediately Whether to trigger a notification immediately */ public void setOnScrollListener(OnScrollListener scrollListener, boolean notifyImmediately) { mOnScrollListener = scrollListener; if (mOnScrollListener != null && notifyImmediately) { mOnScrollListener.onScroll(getCurrentScreenFraction()); } } /** * Scrolls to the given screen. */ public void setCurrentScreen(int screenIndex) { snapToScreen(Math.max(0, Math.min(getScreenCount() - 1, screenIndex))); } /** * Scrolls to the given screen fast (no matter how large the scroll distance is) * * @param screenIndex */ public void setCurrentScreenNow(int screenIndex) { setCurrentScreenNow(screenIndex, true); } public void setCurrentScreenNow(int screenIndex, boolean notify) { snapToScreen(Math.max(0, Math.min(getScreenCount() - 1, screenIndex)), true, notify); } /** * Scrolls to the screen adjacent to the current screen on the left, if it exists. This method * is a no-op if the Workspace is currently locked. */ public void scrollLeft() { if (mLocked) { return; } if (mScroller.isFinished()) { if (mCurrentScreen > 0) { snapToScreen(mCurrentScreen - 1); } } else { if (mNextScreen > 0) { snapToScreen(mNextScreen - 1); } } } /** * Scrolls to the screen adjacent to the current screen on the right, if it exists. This method * is a no-op if the Workspace is currently locked. */ public void scrollRight() { if (mLocked) { return; } if (mScroller.isFinished()) { if (mCurrentScreen < getChildCount() - 1) { snapToScreen(mCurrentScreen + 1); } } else { if (mNextScreen < getChildCount() - 1) { snapToScreen(mNextScreen + 1); } } } /** * If set, invocations of requestChildRectangleOnScreen() will be ignored. */ public void setIgnoreChildFocusRequests(boolean mIgnoreChildFocusRequests) { this.mIgnoreChildFocusRequests = mIgnoreChildFocusRequests; } public void markViewSelected(View v) { mCurrentScreen = indexOfChild(v); } /** * Locks the current screen, preventing users from changing screens by swiping. */ public void lockCurrentScreen() { mLocked = true; } /** * Unlocks the current screen, if it was previously locked. See also {@link * Workspace#lockCurrentScreen()}. */ public void unlockCurrentScreen() { mLocked = false; } /** * Sets the resource ID of the separator drawable to use between adjacent screens. */ public void setSeparator(int resId) { if (mSeparatorDrawable != null && resId == 0) { // remove existing separators mSeparatorDrawable = null; int num = getChildCount(); for (int i = num - 2; i > 0; i -= 2) { removeViewAt(i); } requestLayout(); } else if (resId != 0) { // add or update separators if (mSeparatorDrawable == null) { // add int numsep = getChildCount(); int insertIndex = 1; mSeparatorDrawable = getResources().getDrawable(resId); for (int i = 1; i < numsep; i++) { View v = new View(getContext()); v.setBackgroundDrawable(mSeparatorDrawable); LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT); v.setLayoutParams(lp); addView(v, insertIndex); insertIndex += 2; } requestLayout(); } else { // update mSeparatorDrawable = getResources().getDrawable(resId); int num = getChildCount(); for (int i = num - 2; i > 0; i -= 2) { getChildAt(i).setBackgroundDrawable(mSeparatorDrawable); } requestLayout(); } } } private static class SavedState extends BaseSavedState { int currentScreen = -1; SavedState(Parcelable superState) { super(superState); } private SavedState(Parcel in) { super(in); currentScreen = in.readInt(); } @Override public void writeToParcel(Parcel out, int flags) { super.writeToParcel(out, flags); out.writeInt(currentScreen); } public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() { public SavedState createFromParcel(Parcel in) { return new SavedState(in); } public SavedState[] newArray(int size) { return new SavedState[size]; } }; } public void addViewToFront(View v) { mCurrentScreen++; addView(v, 0); } public void removeViewFromFront() { mCurrentScreen--; removeViewAt(0); } public void addViewToBack(View v) { addView(v); } public void removeViewFromBack() { removeViewAt(getChildCount() - 1); } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/widget/Workspace.java
Java
asf20
39,471
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui.widget; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; /** * Custom layout that arranges children in a grid-like manner, optimizing for even horizontal and * vertical whitespace. */ public class DashboardLayout extends ViewGroup { private static final int UNEVEN_GRID_PENALTY_MULTIPLIER = 10; private int mMaxChildWidth = 0; private int mMaxChildHeight = 0; public DashboardLayout(Context context) { super(context, null); } public DashboardLayout(Context context, AttributeSet attrs) { super(context, attrs, 0); } public DashboardLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { mMaxChildWidth = 0; mMaxChildHeight = 0; // Measure once to find the maximum child size. int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec( MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.AT_MOST); int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec( MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.AT_MOST); final int count = getChildCount(); for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (child.getVisibility() == GONE) { continue; } child.measure(childWidthMeasureSpec, childHeightMeasureSpec); mMaxChildWidth = Math.max(mMaxChildWidth, child.getMeasuredWidth()); mMaxChildHeight = Math.max(mMaxChildHeight, child.getMeasuredHeight()); } // Measure again for each child to be exactly the same size. childWidthMeasureSpec = MeasureSpec.makeMeasureSpec( mMaxChildWidth, MeasureSpec.EXACTLY); childHeightMeasureSpec = MeasureSpec.makeMeasureSpec( mMaxChildHeight, MeasureSpec.EXACTLY); for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (child.getVisibility() == GONE) { continue; } child.measure(childWidthMeasureSpec, childHeightMeasureSpec); } setMeasuredDimension( resolveSize(mMaxChildWidth, widthMeasureSpec), resolveSize(mMaxChildHeight, heightMeasureSpec)); } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { int width = r - l; int height = b - t; final int count = getChildCount(); // Calculate the number of visible children. int visibleCount = 0; for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (child.getVisibility() == GONE) { continue; } ++visibleCount; } if (visibleCount == 0) { return; } // Calculate what number of rows and columns will optimize for even horizontal and // vertical whitespace between items. Start with a 1 x N grid, then try 2 x N, and so on. int bestSpaceDifference = Integer.MAX_VALUE; int spaceDifference; // Horizontal and vertical space between items int hSpace = 0; int vSpace = 0; int cols = 1; int rows; while (true) { rows = (visibleCount - 1) / cols + 1; hSpace = ((width - mMaxChildWidth * cols) / (cols + 1)); vSpace = ((height - mMaxChildHeight * rows) / (rows + 1)); spaceDifference = Math.abs(vSpace - hSpace); if (rows * cols != visibleCount) { spaceDifference *= UNEVEN_GRID_PENALTY_MULTIPLIER; } if (spaceDifference < bestSpaceDifference) { // Found a better whitespace squareness/ratio bestSpaceDifference = spaceDifference; // If we found a better whitespace squareness and there's only 1 row, this is // the best we can do. if (rows == 1) { break; } } else { // This is a worse whitespace ratio, use the previous value of cols and exit. --cols; rows = (visibleCount - 1) / cols + 1; hSpace = ((width - mMaxChildWidth * cols) / (cols + 1)); vSpace = ((height - mMaxChildHeight * rows) / (rows + 1)); break; } ++cols; } // Lay out children based on calculated best-fit number of rows and cols. // If we chose a layout that has negative horizontal or vertical space, force it to zero. hSpace = Math.max(0, hSpace); vSpace = Math.max(0, vSpace); // Re-use width/height variables to be child width/height. width = (width - hSpace * (cols + 1)) / cols; height = (height - vSpace * (rows + 1)) / rows; int left, top; int col, row; int visibleIndex = 0; for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (child.getVisibility() == GONE) { continue; } row = visibleIndex / cols; col = visibleIndex % cols; left = hSpace * (col + 1) + width * col; top = vSpace * (row + 1) + height * row; child.layout(left, top, (hSpace == 0 && col == cols - 1) ? r : (left + width), (vSpace == 0 && row == rows - 1) ? b : (top + height)); ++visibleIndex; } } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/widget/DashboardLayout.java
Java
asf20
6,381
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui.widget; import com.google.android.apps.iosched.R; import com.google.android.apps.iosched.util.UIUtils; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Paint.FontMetricsInt; import android.graphics.Paint.Style; import android.graphics.Typeface; import android.text.format.Time; import android.util.AttributeSet; import android.view.View; /** * Custom view that draws a vertical time "ruler" representing the chronological * progression of a single day. Usually shown along with {@link BlockView} * instances to give a spatial sense of time. */ public class TimeRulerView extends View { private int mHeaderWidth = 70; private int mHourHeight = 90; private boolean mHorizontalDivider = true; private int mLabelTextSize = 20; private int mLabelPaddingLeft = 8; private int mLabelColor = Color.BLACK; private int mDividerColor = Color.LTGRAY; private int mStartHour = 0; private int mEndHour = 23; public TimeRulerView(Context context) { this(context, null); } public TimeRulerView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public TimeRulerView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TimeRulerView, defStyle, 0); mHeaderWidth = a.getDimensionPixelSize(R.styleable.TimeRulerView_headerWidth, mHeaderWidth); mHourHeight = a .getDimensionPixelSize(R.styleable.TimeRulerView_hourHeight, mHourHeight); mHorizontalDivider = a.getBoolean(R.styleable.TimeRulerView_horizontalDivider, mHorizontalDivider); mLabelTextSize = a.getDimensionPixelSize(R.styleable.TimeRulerView_labelTextSize, mLabelTextSize); mLabelPaddingLeft = a.getDimensionPixelSize(R.styleable.TimeRulerView_labelPaddingLeft, mLabelPaddingLeft); mLabelColor = a.getColor(R.styleable.TimeRulerView_labelColor, mLabelColor); mDividerColor = a.getColor(R.styleable.TimeRulerView_dividerColor, mDividerColor); mStartHour = a.getInt(R.styleable.TimeRulerView_startHour, mStartHour); mEndHour = a.getInt(R.styleable.TimeRulerView_endHour, mEndHour); a.recycle(); } /** * Return the vertical offset (in pixels) for a requested time (in * milliseconds since epoch). */ public int getTimeVerticalOffset(long timeMillis) { Time time = new Time(UIUtils.CONFERENCE_TIME_ZONE.getID()); time.set(timeMillis); final int minutes = ((time.hour - mStartHour) * 60) + time.minute; return (minutes * mHourHeight) / 60; } @Override protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final int hours = mEndHour - mStartHour; int width = mHeaderWidth; int height = mHourHeight * hours; setMeasuredDimension(resolveSize(width, widthMeasureSpec), resolveSize(height, heightMeasureSpec)); } private Paint mDividerPaint = new Paint(); private Paint mLabelPaint = new Paint(); @Override protected synchronized void onDraw(Canvas canvas) { super.onDraw(canvas); final int hourHeight = mHourHeight; final Paint dividerPaint = mDividerPaint; dividerPaint.setColor(mDividerColor); dividerPaint.setStyle(Style.FILL); final Paint labelPaint = mLabelPaint; labelPaint.setColor(mLabelColor); labelPaint.setTextSize(mLabelTextSize); labelPaint.setTypeface(Typeface.DEFAULT_BOLD); labelPaint.setAntiAlias(true); final FontMetricsInt metrics = labelPaint.getFontMetricsInt(); final int labelHeight = Math.abs(metrics.ascent); final int labelOffset = labelHeight + mLabelPaddingLeft; final int right = getRight(); // Walk left side of canvas drawing timestamps final int hours = mEndHour - mStartHour; for (int i = 0; i < hours; i++) { final int dividerY = hourHeight * i; final int nextDividerY = hourHeight * (i + 1); canvas.drawLine(0, dividerY, right, dividerY, dividerPaint); // draw text title for timestamp canvas.drawRect(0, dividerY, mHeaderWidth, nextDividerY, dividerPaint); // TODO: localize these labels better, including handling // 24-hour mode when set in framework. final int hour = mStartHour + i; String label; if (hour == 0) { label = "12am"; } else if (hour <= 11) { label = hour + "am"; } else if (hour == 12) { label = "12pm"; } else { label = (hour - 12) + "pm"; } final float labelWidth = labelPaint.measureText(label); canvas.drawText(label, 0, label.length(), mHeaderWidth - labelWidth - mLabelPaddingLeft, dividerY + labelOffset, labelPaint); } } public int getHeaderWidth() { return mHeaderWidth; } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/widget/TimeRulerView.java
Java
asf20
5,975
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui.widget; import android.content.Context; import android.util.AttributeSet; import android.widget.ScrollView; /** * A custom ScrollView that can notify a scroll listener when scrolled. */ public class ObservableScrollView extends ScrollView { private OnScrollListener mScrollListener; public ObservableScrollView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { super.onScrollChanged(l, t, oldl, oldt); if (mScrollListener != null) { mScrollListener.onScrollChanged(this); } } public boolean isScrollPossible() { return computeVerticalScrollRange() > getHeight(); } public void setOnScrollListener(OnScrollListener listener) { mScrollListener = listener; } public static interface OnScrollListener { public void onScrollChanged(ObservableScrollView view); } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/widget/ObservableScrollView.java
Java
asf20
1,615
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui.widget; import com.google.android.apps.iosched.R; import com.google.android.apps.iosched.provider.ScheduleContract.Blocks; import com.google.android.apps.iosched.util.UIUtils; import android.content.Context; import android.graphics.Color; import android.graphics.PorterDuff; import android.graphics.drawable.LayerDrawable; import android.text.format.DateUtils; import android.widget.Button; import java.util.TimeZone; /** * Custom view that represents a {@link Blocks#BLOCK_ID} instance, including its * title and time span that it occupies. Usually organized automatically by * {@link BlocksLayout} to match up against a {@link TimeRulerView} instance. */ public class BlockView extends Button { private static final int TIME_STRING_FLAGS = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_WEEKDAY | DateUtils.FORMAT_ABBREV_WEEKDAY | DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_TIME; private final String mBlockId; private final String mTitle; private final long mStartTime; private final long mEndTime; private final boolean mContainsStarred; private final int mColumn; public BlockView(Context context, String blockId, String title, long startTime, long endTime, boolean containsStarred, int column) { super(context); mBlockId = blockId; mTitle = title; mStartTime = startTime; mEndTime = endTime; mContainsStarred = containsStarred; mColumn = column; setText(mTitle); // TODO: turn into color state list with layers? int textColor = Color.WHITE; int accentColor = -1; switch (mColumn) { case 0: accentColor = getResources().getColor(R.color.block_column_1); break; case 1: accentColor = getResources().getColor(R.color.block_column_2); break; case 2: accentColor = getResources().getColor(R.color.block_column_3); break; } LayerDrawable buttonDrawable = (LayerDrawable) context.getResources().getDrawable(R.drawable.btn_block); buttonDrawable.getDrawable(0).setColorFilter(accentColor, PorterDuff.Mode.SRC_ATOP); buttonDrawable.getDrawable(1).setAlpha(mContainsStarred ? 255 : 0); setTextColor(textColor); setBackgroundDrawable(buttonDrawable); } public String getBlockId() { return mBlockId; } public String getBlockTimeString() { TimeZone.setDefault(UIUtils.CONFERENCE_TIME_ZONE); return DateUtils.formatDateTime(getContext(), mStartTime, TIME_STRING_FLAGS); } public long getStartTime() { return mStartTime; } public long getEndTime() { return mEndTime; } public int getColumn() { return mColumn; } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/widget/BlockView.java
Java
asf20
3,531
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui.widget; import com.google.android.apps.iosched.R; import com.google.android.apps.iosched.util.UIUtils; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; /** * Custom layout that contains and organizes a {@link TimeRulerView} and several * instances of {@link BlockView}. Also positions current "now" divider using * {@link R.id#blocks_now} view when applicable. */ public class BlocksLayout extends ViewGroup { private int mColumns = 3; private TimeRulerView mRulerView; private View mNowView; public BlocksLayout(Context context) { this(context, null); } public BlocksLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } public BlocksLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BlocksLayout, defStyle, 0); mColumns = a.getInt(R.styleable.TimeRulerView_headerWidth, mColumns); a.recycle(); } private void ensureChildren() { mRulerView = (TimeRulerView) findViewById(R.id.blocks_ruler); if (mRulerView == null) { throw new IllegalStateException("Must include a R.id.blocks_ruler view."); } mRulerView.setDrawingCacheEnabled(true); mNowView = findViewById(R.id.blocks_now); if (mNowView == null) { throw new IllegalStateException("Must include a R.id.blocks_now view."); } mNowView.setDrawingCacheEnabled(true); } /** * Remove any {@link BlockView} instances, leaving only * {@link TimeRulerView} remaining. */ public void removeAllBlocks() { ensureChildren(); removeAllViews(); addView(mRulerView); addView(mNowView); } public void addBlock(BlockView blockView) { blockView.setDrawingCacheEnabled(true); addView(blockView, 1); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { ensureChildren(); mRulerView.measure(widthMeasureSpec, heightMeasureSpec); mNowView.measure(widthMeasureSpec, heightMeasureSpec); final int width = mRulerView.getMeasuredWidth(); final int height = mRulerView.getMeasuredHeight(); setMeasuredDimension(resolveSize(width, widthMeasureSpec), resolveSize(height, heightMeasureSpec)); } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { ensureChildren(); final TimeRulerView rulerView = mRulerView; final int headerWidth = rulerView.getHeaderWidth(); final int columnWidth = (getWidth() - headerWidth) / mColumns; rulerView.layout(0, 0, getWidth(), getHeight()); final int count = getChildCount(); for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (child.getVisibility() == GONE) continue; if (child instanceof BlockView) { final BlockView blockView = (BlockView) child; final int top = rulerView.getTimeVerticalOffset(blockView.getStartTime()); final int bottom = rulerView.getTimeVerticalOffset(blockView.getEndTime()); final int left = headerWidth + (blockView.getColumn() * columnWidth); final int right = left + columnWidth; child.layout(left, top, right, bottom); } } // Align now view to match current time final View nowView = mNowView; final long now = UIUtils.getCurrentTime(getContext()); final int top = rulerView.getTimeVerticalOffset(now); final int bottom = top + nowView.getMeasuredHeight(); final int left = 0; final int right = getWidth(); nowView.layout(left, top, right, bottom); } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/widget/BlocksLayout.java
Java
asf20
4,672
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui.widget; import com.google.android.apps.iosched.R; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.ImageView; /** * An {@link ImageView} that draws its contents inside a mask and draws a border drawable on top. * This is useful for applying a beveled look to image contents, but is also flexible enough for use * with other desired aesthetics. */ public class BezelImageView extends ImageView { private static final String TAG = "BezelImageView"; private Paint mMaskedPaint; private Paint mCopyPaint; private Rect mBounds; private RectF mBoundsF; private Drawable mBorderDrawable; private Drawable mMaskDrawable; public BezelImageView(Context context) { this(context, null); } public BezelImageView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public BezelImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); // Attribute initialization final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BezelImageView, defStyle, 0); mMaskDrawable = a.getDrawable(R.styleable.BezelImageView_maskDrawable); if (mMaskDrawable == null) { mMaskDrawable = getResources().getDrawable(R.drawable.bezel_mask); } mMaskDrawable.setCallback(this); mBorderDrawable = a.getDrawable(R.styleable.BezelImageView_borderDrawable); if (mBorderDrawable == null) { mBorderDrawable = getResources().getDrawable(R.drawable.bezel_border); } mBorderDrawable.setCallback(this); a.recycle(); // Other initialization mMaskedPaint = new Paint(); mMaskedPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP)); mCopyPaint = new Paint(); } @Override protected boolean setFrame(int l, int t, int r, int b) { final boolean changed = super.setFrame(l, t, r, b); mBounds = new Rect(0, 0, r - l, b - t); mBoundsF = new RectF(mBounds); mBorderDrawable.setBounds(mBounds); mMaskDrawable.setBounds(mBounds); return changed; } @Override protected void onDraw(Canvas canvas) { int sc = canvas.saveLayer(mBoundsF, mCopyPaint, Canvas.HAS_ALPHA_LAYER_SAVE_FLAG | Canvas.FULL_COLOR_LAYER_SAVE_FLAG); mMaskDrawable.draw(canvas); canvas.saveLayer(mBoundsF, mMaskedPaint, 0); super.onDraw(canvas); canvas.restoreToCount(sc); mBorderDrawable.draw(canvas); } @Override protected void drawableStateChanged() { super.drawableStateChanged(); if (mBorderDrawable.isStateful()) { mBorderDrawable.setState(getDrawableState()); } if (mMaskDrawable.isStateful()) { mMaskDrawable.setState(getDrawableState()); } // TODO: is this the right place to invalidate? invalidate(); } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/widget/BezelImageView.java
Java
asf20
3,952
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui; import com.google.android.apps.iosched.R; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebView; import android.webkit.WebViewClient; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; /** * A {@link WebView}-based fragment that shows Google Realtime Search results for a given query, * provided as the {@link TagStreamFragment#EXTRA_QUERY} extra in the fragment arguments. If no * search query is provided, the conference hashtag is used as the default query. */ public class TagStreamFragment extends Fragment { private static final String TAG = "TagStreamFragment"; public static final String EXTRA_QUERY = "com.google.android.iosched.extra.QUERY"; public static final String CONFERENCE_HASHTAG = "#io2011"; private String mSearchString; private WebView mWebView; private View mLoadingSpinner; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Intent intent = BaseActivity.fragmentArgumentsToIntent(getArguments()); mSearchString = intent.getStringExtra(EXTRA_QUERY); if (TextUtils.isEmpty(mSearchString)) { mSearchString = CONFERENCE_HASHTAG; } if (!mSearchString.startsWith("#")) { mSearchString = "#" + mSearchString; } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null); // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity. root.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); mLoadingSpinner = root.findViewById(R.id.loading_spinner); mWebView = (WebView) root.findViewById(R.id.webview); mWebView.setWebViewClient(mWebViewClient); mWebView.post(new Runnable() { public void run() { mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); try { mWebView.loadUrl( "http://www.google.com/search?tbs=" + "mbl%3A1&hl=en&source=hp&biw=1170&bih=668&q=" + URLEncoder.encode(mSearchString, "UTF-8") + "&btnG=Search"); } catch (UnsupportedEncodingException e) { Log.e(TAG, "Could not construct the realtime search URL", e); } } }); return root; } public void refresh() { mWebView.reload(); } private WebViewClient mWebViewClient = new WebViewClient() { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); mLoadingSpinner.setVisibility(View.VISIBLE); mWebView.setVisibility(View.INVISIBLE); } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); mLoadingSpinner.setVisibility(View.GONE); mWebView.setVisibility(View.VISIBLE); } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.startsWith("javascript")) { return false; } Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); return true; } }; }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/TagStreamFragment.java
Java
asf20
4,730
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui; import com.google.android.apps.iosched.R; import com.google.android.apps.iosched.provider.ScheduleContract; import com.google.android.apps.iosched.util.ActivityHelper; import com.google.android.apps.iosched.util.AnalyticsUtils; import com.google.android.apps.iosched.util.NotifyingAsyncQueryHandler; import android.content.Context; import android.content.Intent; import android.database.ContentObserver; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.provider.BaseColumns; import android.support.v4.app.ListFragment; import android.text.Spannable; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.CursorAdapter; import android.widget.ListView; import android.widget.TextView; import static com.google.android.apps.iosched.util.UIUtils.buildStyledSnippet; /** * A {@link ListFragment} showing a list of sandbox comapnies. */ public class VendorsFragment extends ListFragment implements NotifyingAsyncQueryHandler.AsyncQueryListener { private static final String STATE_CHECKED_POSITION = "checkedPosition"; private Uri mTrackUri; private Cursor mCursor; private CursorAdapter mAdapter; private int mCheckedPosition = -1; private boolean mHasSetEmptyText = false; private NotifyingAsyncQueryHandler mHandler; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mHandler = new NotifyingAsyncQueryHandler(getActivity().getContentResolver(), this); reloadFromArguments(getArguments()); } public void reloadFromArguments(Bundle arguments) { // Teardown from previous arguments if (mCursor != null) { getActivity().stopManagingCursor(mCursor); mCursor = null; } mCheckedPosition = -1; setListAdapter(null); mHandler.cancelOperation(SearchQuery._TOKEN); mHandler.cancelOperation(VendorsQuery._TOKEN); // Load new arguments final Intent intent = BaseActivity.fragmentArgumentsToIntent(arguments); final Uri vendorsUri = intent.getData(); final int vendorQueryToken; if (vendorsUri == null) { return; } String[] projection; if (!ScheduleContract.Vendors.isSearchUri(vendorsUri)) { mAdapter = new VendorsAdapter(getActivity()); projection = VendorsQuery.PROJECTION; vendorQueryToken = VendorsQuery._TOKEN; } else { Log.d("VendorsFragment/reloadFromArguments", "A search URL definitely gets passed in."); mAdapter = new SearchAdapter(getActivity()); projection = SearchQuery.PROJECTION; vendorQueryToken = SearchQuery._TOKEN; } setListAdapter(mAdapter); // Start background query to load vendors mHandler.startQuery(vendorQueryToken, null, vendorsUri, projection, null, null, ScheduleContract.Vendors.DEFAULT_SORT); // If caller launched us with specific track hint, pass it along when // launching vendor details. Also start a query to load the track info. mTrackUri = intent.getParcelableExtra(SessionDetailFragment.EXTRA_TRACK); if (mTrackUri != null) { mHandler.startQuery(TracksQuery._TOKEN, mTrackUri, TracksQuery.PROJECTION); } } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); if (savedInstanceState != null) { mCheckedPosition = savedInstanceState.getInt(STATE_CHECKED_POSITION, -1); } if (!mHasSetEmptyText) { // Could be a bug, but calling this twice makes it become visible when it shouldn't // be visible. setEmptyText(getString(R.string.empty_vendors)); mHasSetEmptyText = true; } } /** {@inheritDoc} */ public void onQueryComplete(int token, Object cookie, Cursor cursor) { if (getActivity() == null) { return; } if (token == VendorsQuery._TOKEN || token == SearchQuery._TOKEN) { onVendorsOrSearchQueryComplete(cursor); } else if (token == TracksQuery._TOKEN) { onTrackQueryComplete(cursor); } else { cursor.close(); } } /** * Handle {@link VendorsQuery} {@link Cursor}. */ private void onVendorsOrSearchQueryComplete(Cursor cursor) { if (mCursor != null) { // In case cancelOperation() doesn't work and we end up with consecutive calls to this // callback. getActivity().stopManagingCursor(mCursor); mCursor = null; } // TODO(romannurik): stopManagingCursor on detach (throughout app) mCursor = cursor; getActivity().startManagingCursor(mCursor); mAdapter.changeCursor(mCursor); if (mCheckedPosition >= 0 && getView() != null) { getListView().setItemChecked(mCheckedPosition, true); } } /** * Handle {@link TracksQuery} {@link Cursor}. */ private void onTrackQueryComplete(Cursor cursor) { try { if (!cursor.moveToFirst()) { return; } // Use found track to build title-bar ActivityHelper activityHelper = ((BaseActivity) getActivity()).getActivityHelper(); String trackName = cursor.getString(TracksQuery.TRACK_NAME); activityHelper.setActionBarTitle(trackName); activityHelper.setActionBarColor(cursor.getInt(TracksQuery.TRACK_COLOR)); AnalyticsUtils.getInstance(getActivity()).trackPageView("/Sandbox/Track/" + trackName); } finally { cursor.close(); } } @Override public void onResume() { super.onResume(); getActivity().getContentResolver().registerContentObserver( ScheduleContract.Vendors.CONTENT_URI, true, mVendorChangesObserver); if (mCursor != null) { mCursor.requery(); } } @Override public void onPause() { super.onPause(); getActivity().getContentResolver().unregisterContentObserver(mVendorChangesObserver); } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(STATE_CHECKED_POSITION, mCheckedPosition); } /** {@inheritDoc} */ @Override public void onListItemClick(ListView l, View v, int position, long id) { // Launch viewer for specific vendor. final Cursor cursor = (Cursor)mAdapter.getItem(position); final String vendorId = cursor.getString(VendorsQuery.VENDOR_ID); final Uri vendorUri = ScheduleContract.Vendors.buildVendorUri(vendorId); ((BaseActivity) getActivity()).openActivityOrFragment(new Intent(Intent.ACTION_VIEW, vendorUri)); getListView().setItemChecked(position, true); mCheckedPosition = position; } public void clearCheckedPosition() { if (mCheckedPosition >= 0) { getListView().setItemChecked(mCheckedPosition, false); mCheckedPosition = -1; } } /** * {@link CursorAdapter} that renders a {@link VendorsQuery}. */ private class VendorsAdapter extends CursorAdapter { public VendorsAdapter(Context context) { super(context, null); } /** {@inheritDoc} */ @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { return getActivity().getLayoutInflater().inflate(R.layout.list_item_vendor_oneline, parent, false); } /** {@inheritDoc} */ @Override public void bindView(View view, Context context, Cursor cursor) { ((TextView) view.findViewById(R.id.vendor_name)).setText( cursor.getString(VendorsQuery.NAME)); final boolean starred = cursor.getInt(VendorsQuery.STARRED) != 0; view.findViewById(R.id.star_button).setVisibility( starred ? View.VISIBLE : View.INVISIBLE); } } /** * {@link CursorAdapter} that renders a {@link SearchQuery}. */ private class SearchAdapter extends CursorAdapter { public SearchAdapter(Context context) { super(context, null); } /** {@inheritDoc} */ @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { return getActivity().getLayoutInflater().inflate(R.layout.list_item_vendor, parent, false); } /** {@inheritDoc} */ @Override public void bindView(View view, Context context, Cursor cursor) { ((TextView) view.findViewById(R.id.vendor_name)).setText(cursor .getString(SearchQuery.NAME)); final String snippet = cursor.getString(SearchQuery.SEARCH_SNIPPET); final Spannable styledSnippet = buildStyledSnippet(snippet); ((TextView) view.findViewById(R.id.vendor_location)).setText(styledSnippet); final boolean starred = cursor.getInt(VendorsQuery.STARRED) != 0; view.findViewById(R.id.star_button).setVisibility( starred ? View.VISIBLE : View.INVISIBLE); } } private ContentObserver mVendorChangesObserver = new ContentObserver(new Handler()) { @Override public void onChange(boolean selfChange) { if (mCursor != null) { mCursor.requery(); } } }; /** * {@link com.google.android.apps.iosched.provider.ScheduleContract.Vendors} query parameters. */ private interface VendorsQuery { int _TOKEN = 0x1; String[] PROJECTION = { BaseColumns._ID, ScheduleContract.Vendors.VENDOR_ID, ScheduleContract.Vendors.VENDOR_NAME, ScheduleContract.Vendors.VENDOR_LOCATION, ScheduleContract.Vendors.VENDOR_STARRED, }; int _ID = 0; int VENDOR_ID = 1; int NAME = 2; int LOCATION = 3; int STARRED = 4; } /** * {@link com.google.android.apps.iosched.provider.ScheduleContract.Tracks} query parameters. */ private interface TracksQuery { int _TOKEN = 0x2; String[] PROJECTION = { ScheduleContract.Tracks.TRACK_NAME, ScheduleContract.Tracks.TRACK_COLOR, }; int TRACK_NAME = 0; int TRACK_COLOR = 1; } /** {@link com.google.android.apps.iosched.provider.ScheduleContract.Vendors} search query * parameters. */ private interface SearchQuery { int _TOKEN = 0x3; String[] PROJECTION = { BaseColumns._ID, ScheduleContract.Vendors.VENDOR_ID, ScheduleContract.Vendors.VENDOR_NAME, ScheduleContract.Vendors.SEARCH_SNIPPET, ScheduleContract.Vendors.VENDOR_STARRED, }; int _ID = 0; int VENDOR_ID = 1; int NAME = 2; int SEARCH_SNIPPET = 3; int STARRED = 4; } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/VendorsFragment.java
Java
asf20
12,111
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui; import com.google.android.apps.iosched.R; import com.google.android.apps.iosched.util.AnalyticsUtils; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.webkit.WebView; import android.webkit.WebViewClient; import java.util.regex.Pattern; /** * A fragment containing a {@link WebView} pointing to the I/O announcements URL. */ public class BulletinFragment extends Fragment { private static final Pattern sSiteUrlPattern = Pattern.compile("google\\.com\\/events\\/io"); private static final String BULLETIN_URL = "http://www.google.com/events/io/2011/mobile_announcements.html"; private WebView mWebView; private View mLoadingSpinner; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); AnalyticsUtils.getInstance(getActivity()).trackPageView("/Bulletin"); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null); // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity. root.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); mLoadingSpinner = root.findViewById(R.id.loading_spinner); mWebView = (WebView) root.findViewById(R.id.webview); mWebView.setWebViewClient(mWebViewClient); mWebView.post(new Runnable() { public void run() { mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false); mWebView.loadUrl(BULLETIN_URL); } }); return root; } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.refresh_menu_items, menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.menu_refresh) { mWebView.reload(); return true; } return super.onOptionsItemSelected(item); } private WebViewClient mWebViewClient = new WebViewClient() { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); mLoadingSpinner.setVisibility(View.VISIBLE); mWebView.setVisibility(View.INVISIBLE); } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); mLoadingSpinner.setVisibility(View.GONE); mWebView.setVisibility(View.VISIBLE); } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (sSiteUrlPattern.matcher(url).find()) { return false; } Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); return true; } }; }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/BulletinFragment.java
Java
asf20
4,286
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import java.util.List; /** * A {@link BaseActivity} that can contain multiple panes, and has the ability to substitute * fragments for activities when intents are fired using * {@link BaseActivity#openActivityOrFragment(android.content.Intent)}. */ public abstract class BaseMultiPaneActivity extends BaseActivity { /** {@inheritDoc} */ @Override public void openActivityOrFragment(final Intent intent) { final PackageManager pm = getPackageManager(); List<ResolveInfo> resolveInfoList = pm .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); for (ResolveInfo resolveInfo : resolveInfoList) { final FragmentReplaceInfo fri = onSubstituteFragmentForActivityLaunch( resolveInfo.activityInfo.name); if (fri != null) { final Bundle arguments = intentToFragmentArguments(intent); final FragmentManager fm = getSupportFragmentManager(); try { Fragment fragment = (Fragment) fri.getFragmentClass().newInstance(); fragment.setArguments(arguments); FragmentTransaction ft = fm.beginTransaction(); ft.replace(fri.getContainerId(), fragment, fri.getFragmentTag()); onBeforeCommitReplaceFragment(fm, ft, fragment); ft.commit(); } catch (InstantiationException e) { throw new IllegalStateException( "Error creating new fragment.", e); } catch (IllegalAccessException e) { throw new IllegalStateException( "Error creating new fragment.", e); } return; } } super.openActivityOrFragment(intent); } /** * Callback that's triggered to find out if a fragment can substitute the given activity class. * Base activites should return a {@link FragmentReplaceInfo} if a fragment can act in place * of the given activity class name. */ protected FragmentReplaceInfo onSubstituteFragmentForActivityLaunch(String activityClassName) { return null; } /** * Called just before a fragment replacement transaction is committed in response to an intent * being fired and substituted for a fragment. */ protected void onBeforeCommitReplaceFragment(FragmentManager fm, FragmentTransaction ft, Fragment fragment) { } /** * A class describing information for a fragment-substitution, used when a fragment can act * in place of an activity. */ protected class FragmentReplaceInfo { private Class mFragmentClass; private String mFragmentTag; private int mContainerId; public FragmentReplaceInfo(Class fragmentClass, String fragmentTag, int containerId) { mFragmentClass = fragmentClass; mFragmentTag = fragmentTag; mContainerId = containerId; } public Class getFragmentClass() { return mFragmentClass; } public String getFragmentTag() { return mFragmentTag; } public int getContainerId() { return mContainerId; } } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/BaseMultiPaneActivity.java
Java
asf20
4,249
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui; import com.google.android.apps.iosched.R; import com.google.android.apps.iosched.provider.ScheduleContract; import com.google.android.apps.iosched.util.ActivityHelper; import com.google.android.apps.iosched.util.AnalyticsUtils; import com.google.android.apps.iosched.util.NotifyingAsyncQueryHandler; import com.google.android.apps.iosched.util.UIUtils; import android.content.Context; import android.content.Intent; import android.database.ContentObserver; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.SystemClock; import android.provider.BaseColumns; import android.support.v4.app.ListFragment; import android.text.Spannable; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.CursorAdapter; import android.widget.ListView; import android.widget.TextView; import static com.google.android.apps.iosched.util.UIUtils.buildStyledSnippet; import static com.google.android.apps.iosched.util.UIUtils.formatSessionSubtitle; /** * A {@link ListFragment} showing a list of sessions. */ public class SessionsFragment extends ListFragment implements NotifyingAsyncQueryHandler.AsyncQueryListener { public static final String EXTRA_SCHEDULE_TIME_STRING = "com.google.android.iosched.extra.SCHEDULE_TIME_STRING"; private static final String STATE_CHECKED_POSITION = "checkedPosition"; private Uri mTrackUri; private Cursor mCursor; private CursorAdapter mAdapter; private int mCheckedPosition = -1; private boolean mHasSetEmptyText = false; private NotifyingAsyncQueryHandler mHandler; private Handler mMessageQueueHandler = new Handler(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mHandler = new NotifyingAsyncQueryHandler(getActivity().getContentResolver(), this); reloadFromArguments(getArguments()); } public void reloadFromArguments(Bundle arguments) { // Teardown from previous arguments if (mCursor != null) { getActivity().stopManagingCursor(mCursor); mCursor = null; } mCheckedPosition = -1; setListAdapter(null); mHandler.cancelOperation(SearchQuery._TOKEN); mHandler.cancelOperation(SessionsQuery._TOKEN); mHandler.cancelOperation(TracksQuery._TOKEN); // Load new arguments final Intent intent = BaseActivity.fragmentArgumentsToIntent(arguments); final Uri sessionsUri = intent.getData(); final int sessionQueryToken; if (sessionsUri == null) { return; } String[] projection; if (!ScheduleContract.Sessions.isSearchUri(sessionsUri)) { mAdapter = new SessionsAdapter(getActivity()); projection = SessionsQuery.PROJECTION; sessionQueryToken = SessionsQuery._TOKEN; } else { mAdapter = new SearchAdapter(getActivity()); projection = SearchQuery.PROJECTION; sessionQueryToken = SearchQuery._TOKEN; } setListAdapter(mAdapter); // Start background query to load sessions mHandler.startQuery(sessionQueryToken, null, sessionsUri, projection, null, null, ScheduleContract.Sessions.DEFAULT_SORT); // If caller launched us with specific track hint, pass it along when // launching session details. Also start a query to load the track info. mTrackUri = intent.getParcelableExtra(SessionDetailFragment.EXTRA_TRACK); if (mTrackUri != null) { mHandler.startQuery(TracksQuery._TOKEN, mTrackUri, TracksQuery.PROJECTION); } } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); if (savedInstanceState != null) { mCheckedPosition = savedInstanceState.getInt(STATE_CHECKED_POSITION, -1); } if (!mHasSetEmptyText) { // Could be a bug, but calling this twice makes it become visible when it shouldn't // be visible. setEmptyText(getString(R.string.empty_sessions)); mHasSetEmptyText = true; } } /** {@inheritDoc} */ public void onQueryComplete(int token, Object cookie, Cursor cursor) { if (getActivity() == null) { return; } if (token == SessionsQuery._TOKEN || token == SearchQuery._TOKEN) { onSessionOrSearchQueryComplete(cursor); } else if (token == TracksQuery._TOKEN) { onTrackQueryComplete(cursor); } else { Log.d("SessionsFragment/onQueryComplete", "Query complete, Not Actionable: " + token); cursor.close(); } } /** * Handle {@link SessionsQuery} {@link Cursor}. */ private void onSessionOrSearchQueryComplete(Cursor cursor) { if (mCursor != null) { // In case cancelOperation() doesn't work and we end up with consecutive calls to this // callback. getActivity().stopManagingCursor(mCursor); mCursor = null; } mCursor = cursor; getActivity().startManagingCursor(mCursor); mAdapter.changeCursor(mCursor); if (mCheckedPosition >= 0 && getView() != null) { getListView().setItemChecked(mCheckedPosition, true); } } /** * Handle {@link TracksQuery} {@link Cursor}. */ private void onTrackQueryComplete(Cursor cursor) { try { if (!cursor.moveToFirst()) { return; } // Use found track to build title-bar ActivityHelper activityHelper = ((BaseActivity) getActivity()).getActivityHelper(); String trackName = cursor.getString(TracksQuery.TRACK_NAME); activityHelper.setActionBarTitle(trackName); activityHelper.setActionBarColor(cursor.getInt(TracksQuery.TRACK_COLOR)); AnalyticsUtils.getInstance(getActivity()).trackPageView("/Tracks/" + trackName); } finally { cursor.close(); } } @Override public void onResume() { super.onResume(); mMessageQueueHandler.post(mRefreshSessionsRunnable); getActivity().getContentResolver().registerContentObserver( ScheduleContract.Sessions.CONTENT_URI, true, mSessionChangesObserver); if (mCursor != null) { mCursor.requery(); } } @Override public void onPause() { super.onPause(); mMessageQueueHandler.removeCallbacks(mRefreshSessionsRunnable); getActivity().getContentResolver().unregisterContentObserver(mSessionChangesObserver); } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(STATE_CHECKED_POSITION, mCheckedPosition); } /** {@inheritDoc} */ @Override public void onListItemClick(ListView l, View v, int position, long id) { // Launch viewer for specific session, passing along any track knowledge // that should influence the title-bar. final Cursor cursor = (Cursor)mAdapter.getItem(position); final String sessionId = cursor.getString(cursor.getColumnIndex( ScheduleContract.Sessions.SESSION_ID)); final Uri sessionUri = ScheduleContract.Sessions.buildSessionUri(sessionId); final Intent intent = new Intent(Intent.ACTION_VIEW, sessionUri); intent.putExtra(SessionDetailFragment.EXTRA_TRACK, mTrackUri); ((BaseActivity) getActivity()).openActivityOrFragment(intent); getListView().setItemChecked(position, true); mCheckedPosition = position; } public void clearCheckedPosition() { if (mCheckedPosition >= 0) { getListView().setItemChecked(mCheckedPosition, false); mCheckedPosition = -1; } } /** * {@link CursorAdapter} that renders a {@link SessionsQuery}. */ private class SessionsAdapter extends CursorAdapter { public SessionsAdapter(Context context) { super(context, null); } /** {@inheritDoc} */ @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { return getActivity().getLayoutInflater().inflate(R.layout.list_item_session, parent, false); } /** {@inheritDoc} */ @Override public void bindView(View view, Context context, Cursor cursor) { final TextView titleView = (TextView) view.findViewById(R.id.session_title); final TextView subtitleView = (TextView) view.findViewById(R.id.session_subtitle); titleView.setText(cursor.getString(SessionsQuery.TITLE)); // Format time block this session occupies final long blockStart = cursor.getLong(SessionsQuery.BLOCK_START); final long blockEnd = cursor.getLong(SessionsQuery.BLOCK_END); final String roomName = cursor.getString(SessionsQuery.ROOM_NAME); final String subtitle = formatSessionSubtitle(blockStart, blockEnd, roomName, context); subtitleView.setText(subtitle); final boolean starred = cursor.getInt(SessionsQuery.STARRED) != 0; view.findViewById(R.id.star_button).setVisibility( starred ? View.VISIBLE : View.INVISIBLE); // Possibly indicate that the session has occurred in the past. UIUtils.setSessionTitleColor(blockStart, blockEnd, titleView, subtitleView); } } /** * {@link CursorAdapter} that renders a {@link SearchQuery}. */ private class SearchAdapter extends CursorAdapter { public SearchAdapter(Context context) { super(context, null); } /** {@inheritDoc} */ @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { return getActivity().getLayoutInflater().inflate(R.layout.list_item_session, parent, false); } /** {@inheritDoc} */ @Override public void bindView(View view, Context context, Cursor cursor) { ((TextView) view.findViewById(R.id.session_title)).setText(cursor .getString(SearchQuery.TITLE)); final String snippet = cursor.getString(SearchQuery.SEARCH_SNIPPET); final Spannable styledSnippet = buildStyledSnippet(snippet); ((TextView) view.findViewById(R.id.session_subtitle)).setText(styledSnippet); final boolean starred = cursor.getInt(SearchQuery.STARRED) != 0; view.findViewById(R.id.star_button).setVisibility( starred ? View.VISIBLE : View.INVISIBLE); } } private ContentObserver mSessionChangesObserver = new ContentObserver(new Handler()) { @Override public void onChange(boolean selfChange) { if (mCursor != null) { mCursor.requery(); } } }; private Runnable mRefreshSessionsRunnable = new Runnable() { public void run() { if (mAdapter != null) { // This is used to refresh session title colors. mAdapter.notifyDataSetChanged(); } // Check again on the next quarter hour, with some padding to account for network // time differences. long nextQuarterHour = (SystemClock.uptimeMillis() / 900000 + 1) * 900000 + 5000; mMessageQueueHandler.postAtTime(mRefreshSessionsRunnable, nextQuarterHour); } }; /** * {@link com.google.android.apps.iosched.provider.ScheduleContract.Sessions} query parameters. */ private interface SessionsQuery { int _TOKEN = 0x1; String[] PROJECTION = { BaseColumns._ID, ScheduleContract.Sessions.SESSION_ID, ScheduleContract.Sessions.SESSION_TITLE, ScheduleContract.Sessions.SESSION_STARRED, ScheduleContract.Blocks.BLOCK_START, ScheduleContract.Blocks.BLOCK_END, ScheduleContract.Rooms.ROOM_NAME, }; int _ID = 0; int SESSION_ID = 1; int TITLE = 2; int STARRED = 3; int BLOCK_START = 4; int BLOCK_END = 5; int ROOM_NAME = 6; } /** * {@link com.google.android.apps.iosched.provider.ScheduleContract.Tracks} query parameters. */ private interface TracksQuery { int _TOKEN = 0x2; String[] PROJECTION = { ScheduleContract.Tracks.TRACK_NAME, ScheduleContract.Tracks.TRACK_COLOR, }; int TRACK_NAME = 0; int TRACK_COLOR = 1; } /** {@link com.google.android.apps.iosched.provider.ScheduleContract.Sessions} search query * parameters. */ private interface SearchQuery { int _TOKEN = 0x3; String[] PROJECTION = { BaseColumns._ID, ScheduleContract.Sessions.SESSION_ID, ScheduleContract.Sessions.SESSION_TITLE, ScheduleContract.Sessions.SEARCH_SNIPPET, ScheduleContract.Sessions.SESSION_STARRED, }; int _ID = 0; int SESSION_ID = 1; int TITLE = 2; int SEARCH_SNIPPET = 3; int STARRED = 4; } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/SessionsFragment.java
Java
asf20
14,305
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui; import com.google.android.apps.iosched.R; import com.google.android.apps.iosched.provider.ScheduleContract.Sessions; import com.google.android.apps.iosched.provider.ScheduleContract.Vendors; import com.google.android.apps.iosched.ui.phone.SessionDetailActivity; import com.google.android.apps.iosched.ui.phone.VendorDetailActivity; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.TabHost; import android.widget.TabWidget; import android.widget.TextView; /** * An activity that shows the user's starred sessions and sandbox companies. This activity can be * either single or multi-pane, depending on the device configuration. We want the multi-pane * support that {@link BaseMultiPaneActivity} offers, so we inherit from it instead of * {@link BaseSinglePaneActivity}. */ public class StarredActivity extends BaseMultiPaneActivity { public static final String TAG_SESSIONS = "sessions"; public static final String TAG_VENDORS = "vendors"; private TabHost mTabHost; private TabWidget mTabWidget; private SessionsFragment mSessionsFragment; private VendorsFragment mVendorsFragment; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_starred); getActivityHelper().setupActionBar(getTitle(), 0); mTabHost = (TabHost) findViewById(android.R.id.tabhost); mTabWidget = (TabWidget) findViewById(android.R.id.tabs); mTabHost.setup(); setupSessionsTab(); setupVendorsTab(); } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); getActivityHelper().setupSubActivity(); ViewGroup detailContainer = (ViewGroup) findViewById(R.id.fragment_container_starred_detail); if (detailContainer != null && detailContainer.getChildCount() > 1) { findViewById(android.R.id.empty).setVisibility(View.GONE); } } /** * Build and add "sessions" tab. */ private void setupSessionsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_sessions); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final Intent intent = new Intent(Intent.ACTION_VIEW, Sessions.CONTENT_STARRED_URI); final FragmentManager fm = getSupportFragmentManager(); mSessionsFragment = (SessionsFragment) fm.findFragmentByTag("sessions"); if (mSessionsFragment == null) { mSessionsFragment = new SessionsFragment(); mSessionsFragment.setArguments(intentToFragmentArguments(intent)); fm.beginTransaction() .add(R.id.fragment_sessions, mSessionsFragment, "sessions") .commit(); } // Sessions content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS) .setIndicator(buildIndicator(R.string.starred_sessions)) .setContent(R.id.fragment_sessions)); } /** * Build and add "vendors" tab. */ private void setupVendorsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_vendors); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final Intent intent = new Intent(Intent.ACTION_VIEW, Vendors.CONTENT_STARRED_URI); final FragmentManager fm = getSupportFragmentManager(); mVendorsFragment = (VendorsFragment) fm.findFragmentByTag("vendors"); if (mVendorsFragment == null) { mVendorsFragment = new VendorsFragment(); mVendorsFragment.setArguments(intentToFragmentArguments(intent)); fm.beginTransaction() .add(R.id.fragment_vendors, mVendorsFragment, "vendors") .commit(); } // Vendors content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_VENDORS) .setIndicator(buildIndicator(R.string.starred_vendors)) .setContent(R.id.fragment_vendors)); } /** * Build a {@link View} to be used as a tab indicator, setting the requested string resource as * its label. */ private View buildIndicator(int textRes) { final TextView indicator = (TextView) getLayoutInflater().inflate(R.layout.tab_indicator, mTabWidget, false); indicator.setText(textRes); return indicator; } @Override public FragmentReplaceInfo onSubstituteFragmentForActivityLaunch(String activityClassName) { if (findViewById(R.id.fragment_container_starred_detail) != null) { // The layout we currently have has a detail container, we can add fragments there. findViewById(android.R.id.empty).setVisibility(View.GONE); if (SessionDetailActivity.class.getName().equals(activityClassName)) { clearSelectedItems(); return new FragmentReplaceInfo( SessionDetailFragment.class, "session_detail", R.id.fragment_container_starred_detail); } else if (VendorDetailActivity.class.getName().equals(activityClassName)) { clearSelectedItems(); return new FragmentReplaceInfo( VendorDetailFragment.class, "vendor_detail", R.id.fragment_container_starred_detail); } } return null; } private void clearSelectedItems() { if (mSessionsFragment != null) { mSessionsFragment.clearCheckedPosition(); } if (mVendorsFragment != null) { mVendorsFragment.clearCheckedPosition(); } } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/StarredActivity.java
Java
asf20
7,236
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.ui; import com.google.android.apps.iosched.R; import com.google.android.apps.iosched.provider.ScheduleContract.Sessions; import com.google.android.apps.iosched.provider.ScheduleContract.Vendors; import com.google.android.apps.iosched.ui.phone.SessionDetailActivity; import com.google.android.apps.iosched.ui.phone.VendorDetailActivity; import android.app.SearchManager; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.TabHost; import android.widget.TabWidget; import android.widget.TextView; /** * An activity that shows session and sandbox search results. This activity can be either single * or multi-pane, depending on the device configuration. We want the multi-pane support that * {@link BaseMultiPaneActivity} offers, so we inherit from it instead of * {@link BaseSinglePaneActivity}. */ public class SearchActivity extends BaseMultiPaneActivity { public static final String TAG_SESSIONS = "sessions"; public static final String TAG_VENDORS = "vendors"; private String mQuery; private TabHost mTabHost; private TabWidget mTabWidget; private SessionsFragment mSessionsFragment; private VendorsFragment mVendorsFragment; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); mQuery = intent.getStringExtra(SearchManager.QUERY); setContentView(R.layout.activity_search); getActivityHelper().setupActionBar(getTitle(), 0); final CharSequence title = getString(R.string.title_search_query, mQuery); getActivityHelper().setActionBarTitle(title); mTabHost = (TabHost) findViewById(android.R.id.tabhost); mTabWidget = (TabWidget) findViewById(android.R.id.tabs); mTabHost.setup(); setupSessionsTab(); setupVendorsTab(); } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); getActivityHelper().setupSubActivity(); ViewGroup detailContainer = (ViewGroup) findViewById(R.id.fragment_container_search_detail); if (detailContainer != null && detailContainer.getChildCount() > 1) { findViewById(android.R.id.empty).setVisibility(View.GONE); } } @Override public void onNewIntent(Intent intent) { setIntent(intent); mQuery = intent.getStringExtra(SearchManager.QUERY); final CharSequence title = getString(R.string.title_search_query, mQuery); getActivityHelper().setActionBarTitle(title); mTabHost.setCurrentTab(0); mSessionsFragment.reloadFromArguments(getSessionsFragmentArguments()); mVendorsFragment.reloadFromArguments(getVendorsFragmentArguments()); } /** * Build and add "sessions" tab. */ private void setupSessionsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_sessions); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final FragmentManager fm = getSupportFragmentManager(); mSessionsFragment = (SessionsFragment) fm.findFragmentByTag("sessions"); if (mSessionsFragment == null) { mSessionsFragment = new SessionsFragment(); mSessionsFragment.setArguments(getSessionsFragmentArguments()); fm.beginTransaction() .add(R.id.fragment_sessions, mSessionsFragment, "sessions") .commit(); } else { mSessionsFragment.reloadFromArguments(getSessionsFragmentArguments()); } // Sessions content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_SESSIONS) .setIndicator(buildIndicator(R.string.starred_sessions)) .setContent(R.id.fragment_sessions)); } /** * Build and add "vendors" tab. */ private void setupVendorsTab() { // TODO: this is very inefficient and messy, clean it up FrameLayout fragmentContainer = new FrameLayout(this); fragmentContainer.setId(R.id.fragment_vendors); fragmentContainer.setLayoutParams( new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); ((ViewGroup) findViewById(android.R.id.tabcontent)).addView(fragmentContainer); final FragmentManager fm = getSupportFragmentManager(); mVendorsFragment = (VendorsFragment) fm.findFragmentByTag("vendors"); if (mVendorsFragment == null) { mVendorsFragment = new VendorsFragment(); mVendorsFragment.setArguments(getVendorsFragmentArguments()); fm.beginTransaction() .add(R.id.fragment_vendors, mVendorsFragment, "vendors") .commit(); } else { mVendorsFragment.reloadFromArguments(getVendorsFragmentArguments()); } // Vendors content comes from reused activity mTabHost.addTab(mTabHost.newTabSpec(TAG_VENDORS) .setIndicator(buildIndicator(R.string.starred_vendors)) .setContent(R.id.fragment_vendors)); } private Bundle getSessionsFragmentArguments() { return intentToFragmentArguments( new Intent(Intent.ACTION_VIEW, Sessions.buildSearchUri(mQuery))); } private Bundle getVendorsFragmentArguments() { return intentToFragmentArguments( new Intent(Intent.ACTION_VIEW, Vendors.buildSearchUri(mQuery))); } /** * Build a {@link View} to be used as a tab indicator, setting the requested string resource as * its label. */ private View buildIndicator(int textRes) { final TextView indicator = (TextView) getLayoutInflater().inflate(R.layout.tab_indicator, mTabWidget, false); indicator.setText(textRes); return indicator; } @Override public BaseMultiPaneActivity.FragmentReplaceInfo onSubstituteFragmentForActivityLaunch( String activityClassName) { if (findViewById(R.id.fragment_container_search_detail) != null) { // The layout we currently have has a detail container, we can add fragments there. findViewById(android.R.id.empty).setVisibility(View.GONE); if (SessionDetailActivity.class.getName().equals(activityClassName)) { clearSelectedItems(); return new BaseMultiPaneActivity.FragmentReplaceInfo( SessionDetailFragment.class, "session_detail", R.id.fragment_container_search_detail); } else if (VendorDetailActivity.class.getName().equals(activityClassName)) { clearSelectedItems(); return new BaseMultiPaneActivity.FragmentReplaceInfo( VendorDetailFragment.class, "vendor_detail", R.id.fragment_container_search_detail); } } return null; } private void clearSelectedItems() { if (mSessionsFragment != null) { mSessionsFragment.clearCheckedPosition(); } if (mVendorsFragment != null) { mVendorsFragment.clearCheckedPosition(); } } }
zzkmawade-iosched
android/src/com/google/android/apps/iosched/ui/SearchActivity.java
Java
asf20
8,456
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.io; import org.apache.http.ConnectionReuseStrategy; import org.apache.http.HttpEntity; import org.apache.http.HttpException; import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.HttpVersion; import org.apache.http.StatusLine; import org.apache.http.client.AuthenticationHandler; import org.apache.http.client.HttpClient; import org.apache.http.client.HttpRequestRetryHandler; import org.apache.http.client.RedirectHandler; import org.apache.http.client.RequestDirector; import org.apache.http.client.UserTokenHandler; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.ConnectionKeepAliveStrategy; import org.apache.http.conn.routing.HttpRoutePlanner; import org.apache.http.entity.InputStreamEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicHttpResponse; import org.apache.http.message.BasicStatusLine; import org.apache.http.params.HttpParams; import org.apache.http.protocol.HttpContext; import org.apache.http.protocol.HttpProcessor; import org.apache.http.protocol.HttpRequestExecutor; import android.content.Context; import android.content.res.AssetManager; import android.test.AndroidTestCase; import android.util.Log; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.InvocationTargetException; /** * Stub {@link HttpClient} that will provide a single {@link HttpResponse} to * any incoming {@link HttpRequest}. This single response can be set using * {@link #setResponse(HttpResponse)}. */ class StubHttpClient extends DefaultHttpClient { private static final String TAG = "StubHttpClient"; private HttpResponse mResponse; private HttpRequest mLastRequest; public StubHttpClient() { resetState(); } /** * Set the default {@link HttpResponse} to always return for any * {@link #execute(HttpUriRequest)} calls. */ public void setResponse(HttpResponse currentResponse) { mResponse = currentResponse; } /** * Set the default {@link HttpResponse} to always return for any * {@link #execute(HttpUriRequest)} calls. This is a shortcut instead of * calling {@link #buildResponse(int, String, AndroidTestCase)}. */ public void setResponse(int statusCode, String assetName, AndroidTestCase testCase) throws Exception { setResponse(buildResponse(statusCode, assetName, testCase)); } /** * Return the last {@link HttpRequest} that was requested through * {@link #execute(HttpUriRequest)}, exposed for testing purposes. */ public HttpRequest getLastRequest() { return mLastRequest; } /** * Reset any internal state, usually so this heavy {@link HttpClient} can be * reused across tests. */ public void resetState() { mResponse = buildInternalServerError(); } private static HttpResponse buildInternalServerError() { final StatusLine status = new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_INTERNAL_SERVER_ERROR, null); return new BasicHttpResponse(status); } /** * Build a stub {@link HttpResponse}, probably for use with * {@link #setResponse(HttpResponse)}. * * @param statusCode {@link HttpStatus} code to use. * @param assetName Name of asset that should be included as a single * {@link HttpEntity} to be included in the response, loaded * through {@link AssetManager}. */ public static HttpResponse buildResponse(int statusCode, String assetName, AndroidTestCase testCase) throws Exception { final Context testContext = getTestContext(testCase); return buildResponse(statusCode, assetName, testContext); } /** * Exposes method {@code getTestContext()} in {@link AndroidTestCase}, which * is hidden for now. Useful for obtaining access to the test assets. */ public static Context getTestContext(AndroidTestCase testCase) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { return (Context) AndroidTestCase.class.getMethod("getTestContext").invoke(testCase); } /** * Build a stub {@link HttpResponse}, probably for use with * {@link #setResponse(HttpResponse)}. * * @param statusCode {@link HttpStatus} code to use. * @param assetName Name of asset that should be included as a single * {@link HttpEntity} to be included in the response, loaded * through {@link AssetManager}. */ public static HttpResponse buildResponse(int statusCode, String assetName, Context context) throws IOException { final StatusLine status = new BasicStatusLine(HttpVersion.HTTP_1_1, statusCode, null); final HttpResponse response = new BasicHttpResponse(status); if (assetName != null) { final InputStream entity = context.getAssets().open(assetName); response.setEntity(new InputStreamEntity(entity, entity.available())); } return response; } /** {@inheritDoc} */ @Override protected RequestDirector createClientRequestDirector( final HttpRequestExecutor requestExec, final ClientConnectionManager conman, final ConnectionReuseStrategy reustrat, final ConnectionKeepAliveStrategy kastrat, final HttpRoutePlanner rouplan, final HttpProcessor httpProcessor, final HttpRequestRetryHandler retryHandler, final RedirectHandler redirectHandler, final AuthenticationHandler targetAuthHandler, final AuthenticationHandler proxyAuthHandler, final UserTokenHandler stateHandler, final HttpParams params) { return new RequestDirector() { /** {@inheritDoc} */ public HttpResponse execute(HttpHost target, HttpRequest request, HttpContext context) throws HttpException, IOException { Log.d(TAG, "Intercepted: " + request.getRequestLine().toString()); mLastRequest = request; return mResponse; } }; } }
zzkmawade-iosched
android/tests.old/src/com/google/android/apps/iosched/io/StubHttpClient.java
Java
asf20
7,043
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.io; import com.google.android.apps.iosched.provider.ScheduleContract; import com.google.android.apps.iosched.provider.ScheduleProvider; import com.google.android.apps.iosched.provider.ScheduleContract.Sessions; import com.google.android.apps.iosched.provider.ScheduleContract.Tracks; import com.google.android.apps.iosched.util.ParserUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.test.AndroidTestCase; import android.test.ProviderTestCase2; import java.io.IOException; import java.lang.reflect.InvocationTargetException; public class SessionsHandlerTest extends ProviderTestCase2<ScheduleProvider> { public SessionsHandlerTest() { super(ScheduleProvider.class, ScheduleContract.CONTENT_AUTHORITY); } public void testLocalHandler() throws Exception { parseBlocks(); parseTracks(); parseRooms(); final ContentResolver resolver = getMockContentResolver(); final XmlPullParser parser = openAssetParser("local-sessions.xml"); new LocalSessionsHandler().parseAndApply(parser, resolver); Cursor cursor = resolver.query(Sessions.CONTENT_URI, null, null, null, Sessions.DEFAULT_SORT); try { assertEquals(2, cursor.getCount()); assertTrue(cursor.moveToNext()); assertEquals("writingreal-timegamesforandroidredux", getString(cursor, Sessions.SESSION_ID)); assertEquals("Writing real-time games for Android redux", getString(cursor, Sessions.TITLE)); assertEquals(6, getInt(cursor, Sessions.ROOM_ID)); assertEquals(2, getInt(cursor, Sessions.ROOM_FLOOR)); assertEquals(ParserUtils.BLOCK_TYPE_OFFICE_HOURS, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1274270400000L, getLong(cursor, Sessions.BLOCK_START)); assertEquals(1274295600000L, getLong(cursor, Sessions.BLOCK_END)); assertTrue(cursor.moveToNext()); assertEquals("beginners-guide-android", getString(cursor, Sessions.SESSION_ID)); assertEquals("A beginner's guide to Android", getString(cursor, Sessions.TITLE)); assertEquals(4, getInt(cursor, Sessions.ROOM_ID)); assertEquals(2, getInt(cursor, Sessions.ROOM_FLOOR)); assertEquals(ParserUtils.BLOCK_TYPE_OFFICE_HOURS, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1274291100000L, getLong(cursor, Sessions.BLOCK_START)); assertEquals(1274294700000L, getLong(cursor, Sessions.BLOCK_END)); } finally { cursor.close(); } final Uri sessionTracks = Sessions.buildTracksDirUri("beginners-guide-android"); cursor = resolver.query(sessionTracks, null, null, null, Tracks.DEFAULT_SORT); try { assertEquals(1, cursor.getCount()); assertTrue(cursor.moveToNext()); assertEquals("beginners-guide-android", getString(cursor, Sessions.SESSION_ID)); assertEquals("android", getString(cursor, Tracks.TRACK_ID)); assertEquals(-14002535, getInt(cursor, Tracks.TRACK_COLOR)); } finally { cursor.close(); } } public void testRemoteHandler() throws Exception { parseTracks(); parseRooms(); final ContentResolver resolver = getMockContentResolver(); final XmlPullParser parser = openAssetParser("remote-sessions1.xml"); new RemoteSessionsHandler().parseAndApply(parser, resolver); Cursor cursor = resolver.query(Sessions.CONTENT_URI, null, null, null, Sessions.DEFAULT_SORT); try { assertEquals(6, cursor.getCount()); assertTrue(cursor.moveToNext()); assertEquals("beginners-guide-android", getString(cursor, Sessions.SESSION_ID)); assertEquals(6, getInt(cursor, Sessions.ROOM_ID)); assertEquals(2, getInt(cursor, Sessions.ROOM_FLOOR)); assertEquals(ParserUtils.BLOCK_TYPE_SESSION, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1274291100000L, getLong(cursor, Sessions.BLOCK_START)); assertEquals(1274294700000L, getLong(cursor, Sessions.BLOCK_END)); assertEquals("http://www.google.com/moderator/#15/e=68f0&t=68f0.45", getString(cursor, Sessions.MODERATOR_URL)); assertTrue(cursor.moveToNext()); assertEquals("writing-real-time-games-android", getString(cursor, Sessions.SESSION_ID)); assertEquals(ParserUtils.BLOCK_TYPE_SESSION, getString(cursor, Sessions.BLOCK_TYPE)); assertTrue(cursor.moveToLast()); assertEquals("developing-restful-android-apps", getString(cursor, Sessions.SESSION_ID)); assertEquals(ParserUtils.BLOCK_TYPE_SESSION, getString(cursor, Sessions.BLOCK_TYPE)); } finally { cursor.close(); } final Uri sessionTracks = Sessions.buildTracksDirUri("android-ui-design-patterns"); cursor = resolver.query(sessionTracks, null, null, null, Tracks.DEFAULT_SORT); try { assertEquals(2, cursor.getCount()); assertTrue(cursor.moveToNext()); assertEquals("android-ui-design-patterns", getString(cursor, Sessions.SESSION_ID)); assertEquals("android", getString(cursor, Tracks.TRACK_ID)); assertEquals(-14002535, getInt(cursor, Tracks.TRACK_COLOR)); assertTrue(cursor.moveToNext()); assertEquals("android-ui-design-patterns", getString(cursor, Sessions.SESSION_ID)); assertEquals("enterprise", getString(cursor, Tracks.TRACK_ID)); assertEquals(-15750145, getInt(cursor, Tracks.TRACK_COLOR)); } finally { cursor.close(); } } public void testLocalRemoteUpdate() throws Exception { parseBlocks(); parseTracks(); parseRooms(); // first, insert session data from local source final ContentResolver resolver = getMockContentResolver(); final XmlPullParser parser = openAssetParser("local-sessions.xml"); new LocalSessionsHandler().parseAndApply(parser, resolver); // now, star one of the sessions final Uri sessionUri = Sessions.buildSessionUri("beginners-guide-android"); final ContentValues values = new ContentValues(); values.put(Sessions.STARRED, 1); resolver.update(sessionUri, values, null, null); Cursor cursor = resolver.query(Sessions.CONTENT_URI, null, null, null, Sessions.DEFAULT_SORT); try { assertEquals(2, cursor.getCount()); assertTrue(cursor.moveToNext()); assertEquals("writingreal-timegamesforandroidredux", getString(cursor, Sessions.SESSION_ID)); assertEquals(ParserUtils.BLOCK_TYPE_OFFICE_HOURS, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(0, getInt(cursor, Sessions.STARRED)); assertEquals(0L, getLong(cursor, Sessions.UPDATED)); // make sure session is starred assertTrue(cursor.moveToNext()); assertEquals("beginners-guide-android", getString(cursor, Sessions.SESSION_ID)); assertEquals(4, getInt(cursor, Sessions.ROOM_ID)); assertEquals(2, getInt(cursor, Sessions.ROOM_FLOOR)); assertEquals(ParserUtils.BLOCK_TYPE_OFFICE_HOURS, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1274291100000L, getLong(cursor, Sessions.BLOCK_START)); assertEquals(1274294700000L, getLong(cursor, Sessions.BLOCK_END)); assertEquals(1, getInt(cursor, Sessions.STARRED)); assertEquals(0L, getLong(cursor, Sessions.UPDATED)); } finally { cursor.close(); } // second, perform remote sync to pull in updates final XmlPullParser parser1 = openAssetParser("remote-sessions1.xml"); new RemoteSessionsHandler().parseAndApply(parser1, resolver); cursor = resolver.query(Sessions.CONTENT_URI, null, null, null, Sessions.DEFAULT_SORT); try { // six sessions from remote sync, plus one original assertEquals(7, cursor.getCount()); // original local-only session is still hanging around assertTrue(cursor.moveToNext()); assertEquals("writingreal-timegamesforandroidredux", getString(cursor, Sessions.SESSION_ID)); assertEquals(ParserUtils.BLOCK_TYPE_OFFICE_HOURS, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(0, getInt(cursor, Sessions.STARRED)); assertEquals(0L, getLong(cursor, Sessions.UPDATED)); // existing session was updated with remote values, and has star assertTrue(cursor.moveToNext()); assertEquals("beginners-guide-android", getString(cursor, Sessions.SESSION_ID)); assertEquals(1, getInt(cursor, Sessions.STARRED)); assertEquals(ParserUtils.BLOCK_TYPE_SESSION, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1273186984000L, getLong(cursor, Sessions.UPDATED)); // make sure session block was updated from remote assertTrue(cursor.moveToNext()); assertEquals("writing-real-time-games-android", getString(cursor, Sessions.SESSION_ID)); assertEquals(6, getInt(cursor, Sessions.ROOM_ID)); assertEquals(2, getInt(cursor, Sessions.ROOM_FLOOR)); assertEquals(ParserUtils.BLOCK_TYPE_SESSION, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1274297400000L, getLong(cursor, Sessions.BLOCK_START)); assertEquals(1274301000000L, getLong(cursor, Sessions.BLOCK_END)); assertEquals("This session is a crash course in Android game development: everything " + "you need to know to get started writing 2D and 3D games, as well as tips, " + "tricks, and benchmarks to help your code reach optimal performance. In " + "addition, we'll discuss hot topics related to game development, including " + "hardware differences across devices, using C++ to write Android games, " + "and the traits of the most popular games on Market.", getString(cursor, Sessions.ABSTRACT)); assertEquals("Proficiency in Java and a solid grasp of Android's fundamental concepts", getString(cursor, Sessions.REQUIREMENTS)); assertEquals("http://www.google.com/moderator/#15/e=68f0&t=68f0.9B", getString(cursor, Sessions.MODERATOR_URL)); assertEquals(0, getInt(cursor, Sessions.STARRED)); assertEquals(1273186984000L, getLong(cursor, Sessions.UPDATED)); assertTrue(cursor.moveToLast()); assertEquals("developing-restful-android-apps", getString(cursor, Sessions.SESSION_ID)); assertEquals("301", getString(cursor, Sessions.TYPE)); assertEquals(0, getInt(cursor, Sessions.STARRED)); assertEquals(ParserUtils.BLOCK_TYPE_SESSION, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1273186984000L, getLong(cursor, Sessions.UPDATED)); } finally { cursor.close(); } // third, perform another remote sync final XmlPullParser parser2 = openAssetParser("remote-sessions2.xml"); new RemoteSessionsHandler().parseAndApply(parser2, resolver); cursor = resolver.query(Sessions.CONTENT_URI, null, null, null, Sessions.DEFAULT_SORT); try { // six sessions from remote sync, plus one original assertEquals(7, cursor.getCount()); // original local-only session is still hanging around assertTrue(cursor.moveToNext()); assertEquals("writingreal-timegamesforandroidredux", getString(cursor, Sessions.SESSION_ID)); assertEquals(ParserUtils.BLOCK_TYPE_OFFICE_HOURS, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(0, getInt(cursor, Sessions.STARRED)); assertEquals(0L, getLong(cursor, Sessions.UPDATED)); // existing session was updated with remote values, and has star assertTrue(cursor.moveToNext()); assertEquals("beginners-guide-android", getString(cursor, Sessions.SESSION_ID)); assertEquals(ParserUtils.BLOCK_TYPE_SESSION, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1, getInt(cursor, Sessions.STARRED)); assertEquals(1273186984000L, getLong(cursor, Sessions.UPDATED)); // existing session was updated with remote values, and has star assertTrue(cursor.moveToNext()); assertEquals("writing-real-time-games-android", getString(cursor, Sessions.SESSION_ID)); assertEquals("Proficiency in Java and Python and Ruby and Scheme and " + "Bash and Ada and a solid grasp of Android's fundamental concepts", getString(cursor, Sessions.REQUIREMENTS)); assertEquals(0, getInt(cursor, Sessions.STARRED)); assertEquals(ParserUtils.BLOCK_TYPE_SESSION, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1273532584000L, getLong(cursor, Sessions.UPDATED)); // last session should remain unchanged, since updated flag didn't // get touched. the remote spreadsheet said "102401", but we should // still have "301". assertTrue(cursor.moveToLast()); assertEquals("developing-restful-android-apps", getString(cursor, Sessions.SESSION_ID)); assertEquals("301", getString(cursor, Sessions.TYPE)); assertEquals(ParserUtils.BLOCK_TYPE_SESSION, getString(cursor, Sessions.BLOCK_TYPE)); assertEquals(1273186984000L, getLong(cursor, Sessions.UPDATED)); } finally { cursor.close(); } } private void parseBlocks() throws Exception { final XmlPullParser parser = openAssetParser("local-blocks.xml"); new LocalBlocksHandler().parseAndApply(parser, getMockContentResolver()); } private void parseTracks() throws Exception { final XmlPullParser parser = openAssetParser("local-tracks.xml"); new LocalTracksHandler().parseAndApply(parser, getMockContentResolver()); } private void parseRooms() throws Exception { final XmlPullParser parser = openAssetParser("local-rooms.xml"); new LocalRoomsHandler().parseAndApply(parser, getMockContentResolver()); } private String getString(Cursor cursor, String column) { return cursor.getString(cursor.getColumnIndex(column)); } private long getInt(Cursor cursor, String column) { return cursor.getInt(cursor.getColumnIndex(column)); } private long getLong(Cursor cursor, String column) { return cursor.getLong(cursor.getColumnIndex(column)); } private XmlPullParser openAssetParser(String assetName) throws XmlPullParserException, IOException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Context testContext = getTestContext(this); return ParserUtils.newPullParser(testContext.getResources().getAssets().open(assetName)); } /** * Exposes method {@code getTestContext()} in {@link AndroidTestCase}, which * is hidden for now. Useful for obtaining access to the test assets. */ public static Context getTestContext(AndroidTestCase testCase) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { return (Context) AndroidTestCase.class.getMethod("getTestContext").invoke(testCase); } }
zzkmawade-iosched
android/tests.old/src/com/google/android/apps/iosched/io/SessionsHandlerTest.java
Java
asf20
16,845
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.iosched.util; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import android.content.Context; import android.test.AndroidTestCase; import java.io.IOException; import java.lang.reflect.InvocationTargetException; public class SpreadsheetEntryTest extends AndroidTestCase { public void testParseNormal() throws Exception { final XmlPullParser parser = openAssetParser("spreadsheet-normal.xml"); final SpreadsheetEntry entry = SpreadsheetEntry.fromParser(parser); assertEquals("unexpected columns", 19, entry.size()); assertEquals("Wednesday May 19", entry.get("sessiondate")); assertEquals("10:45am-11:45am", entry.get("sessiontime")); assertEquals("6", entry.get("room")); assertEquals("Android", entry.get("product")); assertEquals("Android", entry.get("track")); assertEquals("101", entry.get("sessiontype")); assertEquals("A beginner's guide to Android", entry.get("sessiontitle")); assertEquals("Android, Mobile, Java", entry.get("tags")); assertEquals("Reto Meier", entry.get("sessionspeakers")); assertEquals("retomeier", entry.get("speakers")); assertEquals("This session will introduce some of the basic concepts involved in " + "Android development. Starting with an overview of the SDK APIs available " + "to developers, we will work through some simple code examples that " + "explore some of the more common user features including using sensors, " + "maps, and geolocation.", entry.get("sessionabstract")); assertEquals("Proficiency in Java and a basic understanding of embedded " + "environments like mobile phones", entry.get("sessionrequirements")); assertEquals("beginners-guide-android", entry.get("sessionlink")); assertEquals("#android1", entry.get("sessionhashtag")); assertEquals("http://www.google.com/moderator/#15/e=68f0&t=68f0.45", entry.get("moderatorlink")); assertEquals( "https://wave.google.com/wave/#restored:wave:googlewave.com!w%252B-Xhdu7ZkBHw", entry.get("wavelink")); assertEquals("https://wave.google.com/wave/#restored:wave:googlewave.com", entry.get("_e8rn7")); assertEquals("w%252B-Xhdu7ZkBHw", entry.get("_dmair")); assertEquals("w+-Xhdu7ZkBHw", entry.get("waveid")); } public void testParseEmpty() throws Exception { final XmlPullParser parser = openAssetParser("spreadsheet-empty.xml"); final SpreadsheetEntry entry = SpreadsheetEntry.fromParser(parser); assertEquals("unexpected columns", 0, entry.size()); } public void testParseEmptyField() throws Exception { final XmlPullParser parser = openAssetParser("spreadsheet-emptyfield.xml"); final SpreadsheetEntry entry = SpreadsheetEntry.fromParser(parser); assertEquals("unexpected columns", 3, entry.size()); assertEquals("Wednesday May 19", entry.get("sessiondate")); assertEquals("", entry.get("sessiontime")); assertEquals("6", entry.get("room")); } public void testParseSingle() throws Exception { final XmlPullParser parser = openAssetParser("spreadsheet-single.xml"); final SpreadsheetEntry entry = SpreadsheetEntry.fromParser(parser); assertEquals("unexpected columns", 1, entry.size()); assertEquals("Wednesday May 19", entry.get("sessiondate")); } private XmlPullParser openAssetParser(String assetName) throws XmlPullParserException, IOException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Context testContext = getTestContext(this); return ParserUtils.newPullParser(testContext.getResources().getAssets().open(assetName)); } /** * Exposes method {@code getTestContext()} in {@link AndroidTestCase}, which * is hidden for now. Useful for obtaining access to the test assets. */ public static Context getTestContext(AndroidTestCase testCase) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { return (Context) AndroidTestCase.class.getMethod("getTestContext").invoke(testCase); } }
zzkmawade-iosched
android/tests.old/src/com/google/android/apps/iosched/util/SpreadsheetEntryTest.java
Java
asf20
4,971
<?php /** * ECSHOP google sitemap 文件 * =========================================================== * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ========================================================== * $Author: liuhui $ * $Id: sitemaps.php 17063 2010-03-25 06:35:46Z liuhui $ */ class sitemap { var $head = "<\x3Fxml version=\"1.0\" encoding=\"UTF-8\"\x3F>\n<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\">\n"; var $footer = "</urlset>\n"; var $item; function item($item) { $this->item .= "<url>\n"; foreach($item as $key => $val){ $this->item .=" <$key>".htmlentities($val, ENT_QUOTES)."</$key>\n"; } $this->item .= "</url>\n"; } function generate() { $all = $this->head; $all .= $this->item; $all .= $this->footer; return $all; } } define('IN_ECS', true); define('INIT_NO_USERS', true); define('INIT_NO_SMARTY', true); require(dirname(__FILE__) . '/includes/init.php'); if (file_exists(ROOT_PATH . DATA_DIR . '/sitemap.dat') && time() - filemtime(ROOT_PATH . DATA_DIR . '/sitemap.dat') < 86400) { $out = file_get_contents(ROOT_PATH . DATA_DIR . '/sitemap.dat'); } else { $site_url = rtrim($ecs->url(),'/'); $sitemap = new sitemap; $config = unserialize($_CFG['sitemap']); $item = array( 'loc' => "$site_url/", 'lastmod' => local_date('Y-m-d'), 'changefreq' => $config['homepage_changefreq'], 'priority' => $config['homepage_priority'], ); $sitemap->item($item); /* 商品分类 */ $sql = "SELECT cat_id,cat_name FROM " .$ecs->table('category'). " ORDER BY parent_id"; $res = $db->query($sql); while ($row = $db->fetchRow($res)) { $item = array( 'loc' => "$site_url/" . build_uri('category', array('cid' => $row['cat_id']), $row['cat_name']), 'lastmod' => local_date('Y-m-d'), 'changefreq' => $config['category_changefreq'], 'priority' => $config['category_priority'], ); $sitemap->item($item); } /* 文章分类 */ $sql = "SELECT cat_id,cat_name FROM " .$ecs->table('article_cat'). " WHERE cat_type=1"; $res = $db->query($sql); while ($row = $db->fetchRow($res)) { $item = array( 'loc' => "$site_url/" . build_uri('article_cat', array('acid' => $row['cat_id']), $row['cat_name']), 'lastmod' => local_date('Y-m-d'), 'changefreq' => $config['category_changefreq'], 'priority' => $config['category_priority'], ); $sitemap->item($item); } /* 商品 */ $sql = "SELECT goods_id, goods_name, last_update FROM " .$ecs->table('goods'). " WHERE is_delete = 0 LIMIT 300"; $res = $db->query($sql); while ($row = $db->fetchRow($res)) { $item = array( 'loc' => "$site_url/" . build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']), 'lastmod' => local_date('Y-m-d', $row['last_update']), 'changefreq' => $config['content_changefreq'], 'priority' => $config['content_priority'], ); $sitemap->item($item); } /* 文章 */ $sql = "SELECT article_id,title,file_url,open_type, add_time FROM " .$ecs->table('article'). " WHERE is_open=1"; $res = $db->query($sql); while ($row = $db->fetchRow($res)) { $article_url=$row['open_type'] != 1 ? build_uri('article', array('aid'=>$row['article_id']), $row['title']) : trim($row['file_url']); $item = array( 'loc' => "$site_url/" . $article_url, 'lastmod' => local_date('Y-m-d', $row['add_time']), 'changefreq' => $config['content_changefreq'], 'priority' => $config['content_priority'], ); $sitemap->item($item); } $out = $sitemap->generate(); file_put_contents(ROOT_PATH . DATA_DIR . '/sitemap.dat', $out); } if (function_exists('gzencode')) { header('Content-type: application/x-gzip'); $out = gzencode($out, 9); } else { header('Content-type: application/xml; charset=utf-8'); } die($out); ?>
zzshop
trunk/sitemaps.php
PHP
asf20
4,687
<?php /** * ECSHOP 支付响应页面 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: respond.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); require(ROOT_PATH . 'includes/lib_payment.php'); require(ROOT_PATH . 'includes/lib_order.php'); /* 支付方式代码 */ $pay_code = !empty($_REQUEST['code']) ? trim($_REQUEST['code']) : ''; //获取首信支付方式 if (empty($pay_code) && !empty($_REQUEST['v_pmode']) && !empty($_REQUEST['v_pstring'])) { $pay_code = 'cappay'; } //获取快钱神州行支付方式 if (empty($pay_code) && ($_REQUEST['ext1'] == 'shenzhou') && ($_REQUEST['ext2'] == 'ecshop')) { $pay_code = 'shenzhou'; } /* 参数是否为空 */ if (empty($pay_code)) { $msg = $_LANG['pay_not_exist']; } else { /* 检查code里面有没有问号 */ if (strpos($pay_code, '?') !== false) { $arr1 = explode('?', $pay_code); $arr2 = explode('=', $arr1[1]); $_REQUEST['code'] = $arr1[0]; $_REQUEST[$arr2[0]] = $arr2[1]; $_GET['code'] = $arr1[0]; $_GET[$arr2[0]] = $arr2[1]; $pay_code = $arr1[0]; } /* 判断是否启用 */ $sql = "SELECT COUNT(*) FROM " . $ecs->table('payment') . " WHERE pay_code = '$pay_code' AND enabled = 1"; if ($db->getOne($sql) == 0) { $msg = $_LANG['pay_disabled']; } else { $plugin_file = 'includes/modules/payment/' . $pay_code . '.php'; /* 检查插件文件是否存在,如果存在则验证支付是否成功,否则则返回失败信息 */ if (file_exists($plugin_file)) { /* 根据支付方式代码创建支付类的对象并调用其响应操作方法 */ include_once($plugin_file); $payment = new $pay_code(); $msg = ($payment->respond()) ? $_LANG['pay_success'] : $_LANG['pay_fail']; } else { $msg = $_LANG['pay_not_exist']; } } } assign_template(); $position = assign_ur_here(); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('message', $msg); $smarty->assign('shop_url', $ecs->url()); $smarty->display('respond.dwt'); ?>
zzshop
trunk/respond.php
PHP
asf20
3,182
<?php /** * ECSHOP 品牌专区 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: brands.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $b_id = !empty($_GET['b_id']) ? intval($_GET['b_id']) : 0; if ($b_id <= 0) { exit(); } $brands_array = assign_brand_goods($b_id); $brands_array['brand']['name'] = encode_output($brands_array['brand']['name']); $smarty->assign('brands_array' , $brands_array); $num = count($brands_array['goods']); if ($num > 0) { $page_num = '10'; $page = !empty($_GET['page']) ? intval($_GET['page']) : 1; $pages = ceil($num / $page_num); if ($page <= 0) { $page = 1; } if ($pages == 0) { $pages = 1; } if ($page > $pages) { $page = $pages; } $i = 1; foreach ($brands_array['goods'] as $goods_data) { if (($i > ($page_num * ($page - 1 ))) && ($i <= ($page_num * $page))) { $price = empty($goods_info['promote_price_org']) ? $goods_data['shop_price'] : $goods_data['promote_price']; //$wml_data .= "<a href='goods.php?id={$goods_data['id']}'>".encode_output($goods_data['name'])."</a>[".encode_output($price)."]<br/>"; $data[] = array('i' => $i , 'price' => encode_output($price) , 'id' => $goods_data['id'] , 'name' => encode_output($goods_data['name'])); } $i++; } $smarty->assign('goods_data', $data); $pagebar = get_wap_pager($num, $page_num, $page, 'brands.php?b_id=' . $b_id, 'page'); $smarty->assign('pagebar', $pagebar); } $brands_array = get_brands(); if (count($brands_array) > 1) { foreach ($brands_array as $key => $brands_data) { $brands_array[$key]['brand_name'] = encode_output($brands_data['brand_name']); } $smarty->assign('brand_id', $b_id); $smarty->assign('other_brands', $brands_array); } $smarty->assign('footer', get_footer()); $smarty->display('brands.wml'); ?>
zzshop
trunk/wap/brands.php
PHP
asf20
2,601
<?php /** * ECSHOP 商品页 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: goods.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $goods_id = !empty($_GET['id']) ? intval($_GET['id']) : ''; $act = !empty($_GET['act']) ? $_GET['act'] : ''; $_LANG['kilogram'] = '千克'; $_LANG['gram'] = '克'; $_LANG['home'] = '首页'; $smarty->assign('goods_id', $goods_id); $goods_info = get_goods_info($goods_id); $goods_info['goods_name'] = encode_output($goods_info['goods_name']); $goods_info['goods_brief'] = encode_output($goods_info['goods_brief']); $goods_info['promote_price'] = encode_output($goods_info['promote_price']); $goods_info['market_price'] = encode_output($goods_info['market_price']); $goods_info['shop_price'] = encode_output($goods_info['shop_price']); $goods_info['shop_price_formated'] = encode_output($goods_info['shop_price_formated']); $smarty->assign('goods_info', $goods_info); $smarty->assign('footer', get_footer()); /* 查看商品图片操作 */ if ($act == 'view_img') { $smarty->display('goods_img.wml'); exit(); } /* 检查是否有商品品牌 */ if (!empty($goods_info['brand_id'])) { $brand_name = $db->getOne("SELECT brand_name FROM " . $ecs->table('brand') . " WHERE brand_id={$goods_info['brand_id']}"); $smarty->assign('brand_name', encode_output($brand_name)); } /* 显示分类名称 */ $cat_array = get_parent_cats($goods_info['cat_id']); krsort($cat_array); $cat_str = ''; foreach ($cat_array as $key => $cat_data) { $cat_array[$key]['cat_name'] = encode_output($cat_data['cat_name']); $cat_str .= "<a href='category.php?c_id={$cat_data['cat_id']}'>" . encode_output($cat_data['cat_name']) . "</a>-&gt;"; } $smarty->assign('cat_array', $cat_array); $comment = assign_comment($goods_id, 0); $smarty->assign('comment', $comment); $smarty->display('goods.wml'); ?>
zzshop
trunk/wap/goods.php
PHP
asf20
2,505
<?php /** * ECSHOP 商品分类页 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: category.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $c_id = !empty($_GET['c_id']) ? intval($_GET['c_id']) : 0; if ($c_id <= 0) { exit(); } $cat_array = get_categories_tree($c_id); $smarty->assign('c_id', $c_id); $cat_name = $db->getOne('SELECT cat_name FROM ' . $ecs->table('category') . ' WHERE cat_id=' . $c_id); $smarty->assign('cat_name', encode_output($cat_name)); if (!empty($cat_array[$c_id]['children'])) { foreach ($cat_array[$c_id]['children'] as $key => $child_data) { $cat_array[$c_id]['children'][$key]['name'] = encode_output($child_data['name']); } $smarty->assign('cat_children', $cat_array[$c_id]['children']); } $cat_goods = assign_cat_goods($c_id, 0, 'wap'); $num = count($cat_goods['goods']); if ($num > 0) { $page_num = '10'; $page = !empty($_GET['page']) ? intval($_GET['page']) : 1; $pages = ceil($num / $page_num); if ($page <= 0) { $page = 1; } if ($pages == 0) { $pages = 1; } if ($page > $pages) { $page = $pages; } $i = 1; foreach ($cat_goods['goods'] as $goods_data) { if (($i > ($page_num * ($page - 1 ))) && ($i <= ($page_num * $page))) { $price = empty($goods_info['promote_price_org']) ? $goods_data['shop_price'] : $goods_data['promote_price']; //$wml_data .= "<a href='goods.php?id={$goods_data['id']}'>".encode_output($goods_data['name'])."</a>[".encode_output($price)."]<br/>"; $data[] = array('i' => $i , 'price' => encode_output($price) , 'id' => $goods_data['id'] , 'name' => encode_output($goods_data['name'])); } $i++; } $smarty->assign('goods_data', $data); $pagebar = get_wap_pager($num, $page_num, $page, 'category.php?c_id='.$c_id, 'page'); $smarty->assign('pagebar', $pagebar); } $pcat_array = get_parent_cats($c_id); if (!empty($pcat_array[1]['cat_name'])) { $pcat_array[1]['cat_name'] = encode_output($pcat_array[1]['cat_name']); $smarty->assign('pcat_array', $pcat_array[1]); } $smarty->assign('footer', get_footer()); $smarty->display('category.wml'); ?>
zzshop
trunk/wap/category.php
PHP
asf20
2,897
<?php /** * ECSHOP wap前台公共函数 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: init.php 17063 2010-03-25 06:35:46Z liuhui $ */ if (!defined('IN_ECS')) { die('Hacking attempt'); } define('ECS_WAP', true); error_reporting(E_ALL); if (__FILE__ == '') { die('Fatal error code: 0'); } /* 取得当前ecshop所在的根目录 */ define('ROOT_PATH', str_replace('wap/includes/init.php', '', str_replace('\\', '/', __FILE__))); /* 初始化设置 */ @ini_set('memory_limit', '64M'); @ini_set('session.cache_expire', 180); @ini_set('session.use_cookies', 1); @ini_set('session.auto_start', 0); @ini_set('display_errors', 1); @ini_set("arg_separator.output","&amp;"); if (DIRECTORY_SEPARATOR == '\\') { @ini_set('include_path', '.;' . ROOT_PATH); } else { @ini_set('include_path', '.:' . ROOT_PATH); } if (file_exists(ROOT_PATH . 'data/config.php')) { include(ROOT_PATH . 'data/config.php'); } else { include(ROOT_PATH . 'includes/config.php'); } if (defined('DEBUG_MODE') == false) { define('DEBUG_MODE', 7); } if (PHP_VERSION >= '5.1' && !empty($timezone)) { date_default_timezone_set($timezone); } $php_self = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; if ('/' == substr($php_self, -1)) { $php_self .= 'index.php'; } define('PHP_SELF', $php_self); require(ROOT_PATH . 'includes/cls_ecshop.php'); require(ROOT_PATH . 'includes/lib_goods.php'); require(ROOT_PATH . 'includes/lib_base.php'); require(ROOT_PATH . 'includes/lib_common.php'); require(ROOT_PATH . 'includes/lib_time.php'); require(ROOT_PATH . 'includes/lib_main.php'); require(ROOT_PATH . 'wap/includes/lib_main.php'); require(ROOT_PATH . 'includes/inc_constant.php'); /* 对用户传入的变量进行转义操作。*/ if (!get_magic_quotes_gpc()) { if (!empty($_GET)) { $_GET = addslashes_deep($_GET); } if (!empty($_POST)) { $_POST = addslashes_deep($_POST); } $_COOKIE = addslashes_deep($_COOKIE); $_REQUEST = addslashes_deep($_REQUEST); } /* 创建 ECSHOP 对象 */ $ecs = new ECS($db_name, $prefix); /* 初始化数据库类 */ require(ROOT_PATH . 'includes/cls_mysql.php'); $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name); $db_host = $db_user = $db_pass = $db_name = NULL; /* 载入系统参数 */ $_CFG = load_config(); /* 初始化session */ require(ROOT_PATH . 'includes/cls_session.php'); $sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), 'ecsid'); if (!defined('INIT_NO_SMARTY')) { header('Cache-control: private'); header('Content-type: text/html; charset=utf-8'); /* 创建 Smarty 对象。*/ require(ROOT_PATH . 'includes/cls_template.php'); $smarty = new cls_template; $smarty->cache_lifetime = $_CFG['cache_time']; $smarty->template_dir = ROOT_PATH . 'wap/templates'; $smarty->cache_dir = ROOT_PATH . 'temp/caches'; $smarty->compile_dir = ROOT_PATH . 'temp/compiled/wap'; if ((DEBUG_MODE & 2) == 2) { $smarty->direct_output = true; $smarty->force_compile = true; } else { $smarty->direct_output = false; $smarty->force_compile = false; } } if (!defined('INIT_NO_USERS')) { /* 会员信息 */ $user =& init_users(); if (empty($_SESSION['user_id'])) { if ($user->get_cookie()) { /* 如果会员已经登录并且还没有获得会员的帐户余额、积分以及优惠券 */ if ($_SESSION['user_id'] > 0 && !isset($_SESSION['user_money'])) { update_user_info(); } } else { $_SESSION['user_id'] = 0; $_SESSION['user_name'] = ''; $_SESSION['email'] = ''; $_SESSION['user_rank'] = 0; $_SESSION['discount'] = 1.00; } } } if ((DEBUG_MODE & 1) == 1) { error_reporting(E_ALL); } else { error_reporting(E_ALL ^ E_NOTICE); } if ((DEBUG_MODE & 4) == 4) { include(ROOT_PATH . 'includes/lib.debug.php'); } /* 判断是否支持gzip模式 */ if (gzip_enabled()) { ob_start('ob_gzhandler'); } /* wap头文件 */ //if (substr($_SERVER['SCRIPT_NAME'], strrpos($_SERVER['SCRIPT_NAME'], '/')) != '/user.php') //{} header("Content-Type:text/vnd.wap.wml; charset=utf-8"); echo "<?xml version='1.0' encoding='utf-8'?>"; if (empty($_CFG['wap_config'])) { echo "<!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.1//EN' 'http://www.wapforum.org/DTD/wml_1.1.xml'><wml><head><meta http-equiv='Cache-Control' content='max-age=0'/></head><card id='ecshop' title='ECShop_WAP'><p align='left'>对不起,{$_CFG['shop_name']}暂时没有开启WAP功能</p></card></wml>"; exit(); } ?>
zzshop
trunk/wap/includes/init.php
PHP
asf20
5,528
<?php /** * ECSHOP wap前台公共函数 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: lib_main.php 17063 2010-03-25 06:35:46Z liuhui $ */ if (!defined('IN_ECS')) { die('Hacking attempt'); } /** * 对输出编码 * * @access public * @param string $str * @return string */ function encode_output($str) { if (EC_CHARSET != 'utf-8') { $str = ecs_iconv(EC_CHARSET, 'utf-8', $str); } return htmlspecialchars($str); } /** * wap分页函数 * * @access public * @param int $num 总记录数 * @param int $perpage 每页记录数 * @param int $curr_page 当前页数 * @param string $mpurl 传入的连接地址 * @param string $pvar 分页变量 */ function get_wap_pager($num, $perpage, $curr_page, $mpurl,$pvar) { $multipage = ''; if($num > $perpage) { $page = 2; $offset = 1; $pages = ceil($num / $perpage); $all_pages = $pages; $tmp_page = $curr_page; $setp = strpos($mpurl, '?') === false ? "?" : '&amp;'; if($curr_page > 1) { $multipage .= "<a href=\"$mpurl${setp}${pvar}=".($curr_page-1)."\">上一页</a>"; } $multipage .= $curr_page."/".$pages; if(($curr_page++) < $pages) { $multipage .= "<a href=\"$mpurl${setp}${pvar}=".$curr_page++."\">下一页</a><br/>"; } //$multipage .= $pages > $page ? " ... <a href=\"$mpurl&amp;$pvar=$pages\"> [$pages] &gt;&gt;</a>" : " 页/".$all_pages."页"; $url_array = explode("?" , $mpurl); $field_str = ""; if (isset($url_array[1])) { $filed_array = explode("&amp;" , $url_array[1]); if (count($filed_array) > 0) { foreach ($filed_array AS $data) { $value_array = explode("=" , $data); $field_str .= "<postfield name='".$value_array[0]."' value='".encode_output($value_array[1])."'/>\n"; } } } $multipage .= "跳转到第<input type='text' name='pageno' format='*N' size='4' value='' maxlength='2' emptyok='true' />页<anchor>[GO]<go href='{$url_array[0]}' method='get'>{$field_str}<postfield name='".$pvar."' value='$(pageno)'/></go></anchor>"; //<postfield name='snid' value='".session_id()."'/> } return $multipage; } /** * 返回尾文件 * * @return string */ function get_footer() { if (substr($_SERVER['SCRIPT_NAME'], strrpos($_SERVER['SCRIPT_NAME'], '/')) == '/index.php') { $footer = "<br/>Powered by ECShop[".local_date('H:i')."]"; } else { $footer = "<br/><select><option onpick='index.php'>快速通道</option><option onpick='goods_list.php?type=best'>精品推荐</option><option onpick='goods_list.php?type=promote'>商家促销</option><option onpick='goods_list.php?type=hot'>热门商品</option><option onpick='goods_list.php?type=new'>最新产品</option></select>"; } return $footer; } ?>
zzshop
trunk/wap/includes/lib_main.php
PHP
asf20
3,723
<?php /** * ECSHOP WAP评论页 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: comment.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $goods_id = !empty($_GET['g_id']) ? intval($_GET['g_id']) : exit(); if ($goods_id <= 0) { exit(); } /* 读取商品信息 */ $_LANG['kilogram'] = '千克'; $_LANG['gram'] = '克'; $_LANG['home'] = '首页'; $smarty->assign('goods_id', $goods_id); $goods_info = get_goods_info($goods_id); $goods_info['goods_name'] = encode_output($goods_info['goods_name']); $goods_info['goods_brief'] = encode_output($goods_info['goods_brief']); $smarty->assign('goods_info', $goods_info); /* 读评论信息 */ $comment = assign_comment($goods_id, 'comments'); $num = $comment['pager']['record_count']; if ($num > 0) { $page_num = '10'; $page = !empty($_GET['page']) ? intval($_GET['page']) : 1; $pages = ceil($num / $page_num); if ($page <= 0) { $page = 1; } if ($pages == 0) { $pages = 1; } if ($page > $pages) { $page = $pages; } $i = 1; foreach ($comment['comments'] as $key => $data) { if (($i > ($page_num * ($page - 1 ))) && ($i <= ($page_num * $page))) { $re_content = !empty($data['re_content']) ? encode_output($data['re_content']) : ''; $re_username = !empty($data['re_username']) ? encode_output($data['re_username']) : ''; $re_add_time = !empty($data['re_add_time']) ? substr($data['re_add_time'], 5, 14) : ''; $comment_data[] = array('i' => $i , 'content' => encode_output($data['content']) , 'username' => encode_output($data['username']) , 'add_time' => substr($data['add_time'], 5, 14) , 're_content' => $re_content , 're_username' => $re_username , 're_add_time' => $re_add_time); } $i++; } $smarty->assign('comment_data', $comment_data); $pagebar = get_wap_pager($num, $page_num, $page, 'comment.php?g_id='.$goods_id, 'page'); $smarty->assign('pagebar' , $pagebar); } $smarty->assign('footer', get_footer()); $smarty->display('comment.wml'); ?>
zzshop
trunk/wap/comment.php
PHP
asf20
2,763
<?php /** * ECSHOP 用户中心 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: user.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $act = !empty($_GET['act']) ? $_GET['act'] : 'login'; $smarty->assign('footer', get_footer()); /* 用户登陆 */ if ($act == 'do_login') { $user_name = !empty($_POST['username']) ? $_POST['username'] : ''; $pwd = !empty($_POST['pwd']) ? $_POST['pwd'] : ''; if (empty($user_name) || empty($pwd)) { $login_faild = 1; } else { if ($user->check_user($user_name, $pwd) > 0) { $user->set_session($user_name); show_user_center(); } else { $login_faild = 1; } } if (!empty($login_faild)) { $smarty->assign('login_faild', 1); $smarty->display('login.wml'); } } elseif ($act == 'order_list') { $record_count = $db->getOne("SELECT COUNT(*) FROM " .$ecs->table('order_info'). " WHERE user_id = {$_SESSION['user_id']}"); if ($record_count > 0) { include_once(ROOT_PATH . 'includes/lib_transaction.php'); $page_num = '10'; $page = !empty($_GET['page']) ? intval($_GET['page']) : 1; $pages = ceil($record_count / $page_num); if ($page <= 0) { $page = 1; } if ($pages == 0) { $pages = 1; } if ($page > $pages) { $page = $pages; } $pagebar = get_wap_pager($record_count, $page_num, $page, 'user.php?act=order_list', 'page'); $smarty->assign('pagebar' , $pagebar); /* 订单状态 */ $_LANG['os'][OS_UNCONFIRMED] = '未确认'; $_LANG['os'][OS_CONFIRMED] = '已确认'; $_LANG['os'][OS_CANCELED] = '已取消'; $_LANG['os'][OS_INVALID] = '无效'; $_LANG['os'][OS_RETURNED] = '退货'; $_LANG['ss'][SS_UNSHIPPED] = '未发货'; $_LANG['ss'][SS_SHIPPED] = '已发货'; $_LANG['ss'][SS_RECEIVED] = '收货确认'; $_LANG['ps'][PS_UNPAYED] = '未付款'; $_LANG['ps'][PS_PAYING] = '付款中'; $_LANG['ps'][PS_PAYED] = '已付款'; $_LANG['confirm_cancel'] = '您确认要取消该订单吗?取消后此订单将视为无效订单'; $_LANG['cancel'] = '取消订单'; $orders = get_user_orders($_SESSION['user_id'], $page_num, ($page_num * ($page - 1))); if (!empty($orders)) { foreach ($orders as $key => $val) { $orders[$key]['total_fee'] = encode_output($val['total_fee']); } } //$merge = get_user_merge($_SESSION['user_id']); $smarty->assign('orders', $orders); } $smarty->display('order_list.wml'); } /* 用户中心 */ else { if ($_SESSION['user_id'] > 0) { show_user_center(); } else { $smarty->display('login.wml'); } } /** * 用户中心显示 */ function show_user_center() { $best_goods = get_recommend_goods('best'); if (count($best_goods) > 0) { foreach ($best_goods as $key => $best_data) { $best_goods[$key]['shop_price'] = encode_output($best_data['shop_price']); $best_goods[$key]['name'] = encode_output($best_data['name']); } } $GLOBALS['smarty']->assign('best_goods' , $best_goods); $GLOBALS['smarty']->display('user.wml'); } ?>
zzshop
trunk/wap/user.php
PHP
asf20
4,176
<?php /** * ECSHOP WAP首页 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: goods_list.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $type = !empty($_GET['type']) ? $_GET['type'] : 'best'; if ($type != 'best' && $type != 'promote' && $type != 'hot' && $type != 'new') { $type = 'best'; } $smarty->assign('type', $type); $goods = get_recommend_goods($type); $num = count($goods); if ($num > 0) { foreach ($goods as $key => $data) { $sort_array[$data['id']] = $key; } krsort($sort_array); $page_num = '10'; $page = !empty($_GET['page']) ? intval($_GET['page']) : 1; $pages = ceil($num / $page_num); if ($page <= 0) { $page = 1; } if ($pages == 0) { $pages = 1; } if ($page > $pages) { $page = $pages; } $i = 1; foreach ($sort_array as $goods_key) { if (($i > ($page_num * ($page - 1 ))) && ($i <= ($page_num * $page))) { $price = empty($goods[$goods_key]['promote_price_org']) ? $goods[$goods_key]['shop_price'] : $goods[$goods_key]['promote_price']; //$wml_data .= "<a href='goods.php?id={}'>".encode_output($goods[$goods_key]['name'])."</a>[".encode_output($price)."]<br/>"; $goods_data[] = array('i' => $i , 'price' => encode_output($price) , 'id' => $goods[$goods_key]['id'] , 'name' => encode_output($goods[$goods_key]['name'])); } $i++; } $smarty->assign('goods_data', $goods_data); $pagebar = get_wap_pager($num, $page_num, $page, 'goods_list.php?type='.$type, 'page'); $smarty->assign('pagebar' , $pagebar); } $smarty->assign('footer', get_footer()); $smarty->display('goods_list.wml'); ?>
zzshop
trunk/wap/goods_list.php
PHP
asf20
2,382
<?php /** * ECSHOP WAP首页 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: index.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); define('ECS_ADMIN', true); require(dirname(__FILE__) . '/includes/init.php'); $best_goods = get_recommend_goods('best'); $best_num = count($best_goods); $smarty->assign('best_num' , $best_num); if ($best_num > 0) { $i = 0; foreach ($best_goods as $key => $best_data) { $best_goods[$key]['shop_price'] = encode_output($best_data['shop_price']); $best_goods[$key]['name'] = encode_output($best_data['name']); /*if ($i > 2) { break; }*/ $i++; } $smarty->assign('best_goods' , $best_goods); } $promote_goods = get_promote_goods(); $promote_num = count($promote_goods); $smarty->assign('promote_num' , $promote_num); if ($promote_num > 0) { $i = 0; foreach ($promote_goods as $key => $promote_data) { $promote_goods[$key]['shop_price'] = encode_output($promote_data['shop_price']); $promote_goods[$key]['name'] = encode_output($promote_data['name']); /*if ($i > 2) { break; }*/ $i++; } $smarty->assign('promote_goods' , $promote_goods); } $pcat_array = get_categories_tree(); foreach ($pcat_array as $key => $pcat_data) { $pcat_array[$key]['name'] = encode_output($pcat_data['name']); } $smarty->assign('pcat_array' , $pcat_array); $brands_array = get_brands(); if (!empty($brands_array)) { foreach ($brands_array as $key => $brands_data) { $brands_array[$key]['brand_name'] = encode_output($brands_data['brand_name']); } $smarty->assign('brand_array', $brands_array); } $article_array = $db->GetALLCached("SELECT article_id, title FROM " . $ecs->table("article") . " WHERE cat_id != 0 AND is_open = 1 AND open_type = 0 ORDER BY article_id DESC LIMIT 0,4"); if (!empty($article_array)) { foreach ($article_array as $key => $article_data) { $article_array[$key]['title'] = encode_output($article_data['title']); } $smarty->assign('article_array', $article_array); } if ($_SESSION['user_id'] > 0) { $smarty->assign('user_name', $_SESSION['user_name']); } $smarty->assign('wap_logo', $_CFG['wap_logo']); $smarty->assign('footer', get_footer()); $smarty->display("index.wml"); ?>
zzshop
trunk/wap/index.php
PHP
asf20
2,982
<?php /** * ECSHOP 文章 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: article.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $act = !empty($_GET['act']) ? $_GET['act'] : ''; /* 文章详细 */ if ($act == 'detail') { $a_id = !empty($_GET['a_id']) ? intval($_GET['a_id']) : ''; if ($a_id > 0) { $article_row = $db->getRow('SELECT title, content FROM ' . $ecs->table('article') . ' WHERE article_id = ' . $a_id . ' AND cat_id > 0 AND is_open = 1'); if (!empty($article_row)) { $article_row['title'] = encode_output($article_row['title']); $replace_tag = array('<br />' , '<br/>' , '<br>' , '</p>'); $article_row['content'] = htmlspecialchars_decode(encode_output($article_row['content'])); $article_row['content'] = str_replace($replace_tag, '{br}' , $article_row['content']); $article_row['content'] = strip_tags($article_row['content']); $article_row['content'] = str_replace('{br}' , '<br />' , $article_row['content']); $smarty->assign('article_data', $article_row); } } $smarty->display('article.wml'); } /* 文章列表 */ else { $article_num = $db->getOne("SELECT count(*) FROM " . $ecs->table('article') . " WHERE cat_id > 0 AND is_open = 1"); if ($article_num > 0) { $page_num = '10'; $page = !empty($_GET['page']) ? intval($_GET['page']) : 1; $pages = ceil($article_num / $page_num); if ($page <= 0) { $page = 1; } if ($pages == 0) { $pages = 1; } if ($page > $pages) { $page = $pages; } $pagebar = get_wap_pager($article_num, $page_num, $page, 'article.php', 'page'); $smarty->assign('pagebar', $pagebar); include_once(ROOT_PATH . '/includes/lib_article.php'); $article_array = get_cat_articles(-1, $page, $page_num); $i = 1; foreach ($article_array as $key => $article_data) { $article_array[$key]['i'] = $i; $article_array[$key]['title'] = encode_output($article_data['title']); $i++; } $smarty->assign('article_array', $article_array); } $smarty->display('article_list.wml'); } ?>
zzshop
trunk/wap/article.php
PHP
asf20
2,991
<?php /** * ECSHOP 商品页 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: buy.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); $smarty->assign('footer', get_footer()); $smarty->display('buy.wml'); ?>
zzshop
trunk/wap/buy.php
PHP
asf20
838
<?php /** * ECSHOP API 公用初始化文件 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: init.php 17063 2010-03-25 06:35:46Z liuhui $ */ if (!defined('IN_ECS')) { die('Hacking attempt'); } error_reporting(E_ALL); if (__FILE__ == '') { die('Fatal error code: 0'); } /* 取得当前ecshop所在的根目录 */ define('ROOT_PATH', str_replace('api', '', str_replace('\\', '/', dirname(__FILE__)))); /* 初始化设置 */ @ini_set('memory_limit', '16M'); @ini_set('session.cache_expire', 180); @ini_set('session.use_trans_sid', 0); @ini_set('session.use_cookies', 1); @ini_set('session.auto_start', 0); @ini_set('display_errors', 1); if (DIRECTORY_SEPARATOR == '\\') { @ini_set('include_path', '.;' . ROOT_PATH); } else { @ini_set('include_path', '.:' . ROOT_PATH); } if (file_exists(ROOT_PATH . 'data/config.php')) { include(ROOT_PATH . 'data/config.php'); } else { include(ROOT_PATH . 'includes/config.php'); } if (defined('DEBUG_MODE') == false) { define('DEBUG_MODE', 0); } if (PHP_VERSION >= '5.1' && !empty($timezone)) { date_default_timezone_set($timezone); } $php_self = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; if ('/' == substr($php_self, -1)) { $php_self .= 'index.php'; } define('PHP_SELF', $php_self); require(ROOT_PATH . 'includes/inc_constant.php'); require(ROOT_PATH . 'includes/cls_ecshop.php'); require(ROOT_PATH . 'includes/lib_base.php'); require(ROOT_PATH . 'includes/lib_common.php'); require(ROOT_PATH . 'includes/lib_time.php'); /* 对用户传入的变量进行转义操作。*/ if (!get_magic_quotes_gpc()) { if (!empty($_GET)) { $_GET = addslashes_deep($_GET); } if (!empty($_POST)) { $_POST = addslashes_deep($_POST); } $_COOKIE = addslashes_deep($_COOKIE); $_REQUEST = addslashes_deep($_REQUEST); } /* 创建 ECSHOP 对象 */ $ecs = new ECS($db_name, $prefix); $data_dir = $ecs->data_dir(); /* 初始化数据库类 */ require(ROOT_PATH . 'includes/cls_mysql.php'); $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name); $db_host = $db_user = $db_pass = $db_name = NULL; /* 初始化session */ require(ROOT_PATH . 'includes/cls_session.php'); $sess_name = defined("SESS_NAME") ? SESS_NAME : 'ECS_ID'; $sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), $sess_name); /* 载入系统参数 */ $_CFG = load_config(); /* 初始化用户插件 */ $user =& init_users(); if ((DEBUG_MODE & 1) == 1) { error_reporting(E_ALL); } else { error_reporting(E_ALL ^ E_NOTICE); } if ((DEBUG_MODE & 4) == 4) { include(ROOT_PATH . 'includes/lib.debug.php'); } /* 判断是否支持 Gzip 模式 */ if (gzip_enabled()) { ob_start('ob_gzhandler'); } header('Content-type: text/html; charset=' . EC_CHARSET); ?>
zzshop
trunk/api/init.php
PHP
asf20
3,527
<?php define('IN_ECS', true); include_once './includes/init.php'; dispatch($_POST); ?>
zzshop
trunk/api/client/api.php
PHP
asf20
96
<?php /** * ECSHOP 前台公用文件 * ============================================================================ * 版权所有 (C) 2005-2007 康盛创想(北京)科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com * ---------------------------------------------------------------------------- * 这是一个免费开源的软件;这意味着您可以在不用于商业目的的前提下对程序代码 * 进行修改、使用和再发布。 * ============================================================================ * $Author: dolphin $ * $Date: 2008-10-09 17:56:28 +0800 (周四, 2008-10-09) $ * $Id: init.php 14938 2008-10-09 09:56:28Z dolphin $ */ error_reporting(7); if (!defined('IN_ECS')) { die('Hacking attempt'); } /* 取得当前client所在的根目录 */ define('CLIENT_PATH', substr(__FILE__, 0, -17)); /* 设置maifou.net所在的根目录 */ define('ROOT_PATH', substr(__FILE__, 0, -28)); $php_self = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']; if ('/' == substr($php_self, -1)) { $php_self .= 'index.php'; } define('PHP_SELF', $php_self); // 通用包含文件 require(ROOT_PATH . 'data/config.php'); require(ROOT_PATH . 'includes/lib_common.php'); require(ROOT_PATH . 'includes/cls_mysql.php'); /* 兼容ECShopV2.5.1版本载入库文件 */ if (!function_exists('addslashes_deep')) { require(ROOT_PATH . 'includes/lib_base.php'); } require(CLIENT_PATH . 'includes/lib_api.php'); // API库文件 require(CLIENT_PATH . 'includes/lib_struct.php'); // 结构库文件 // json类文件 require(ROOT_PATH . 'includes/cls_json.php'); /* 对用户传入的变量进行转义操作。*/ if (!get_magic_quotes_gpc()) { $_COOKIE = addslashes_deep($_COOKIE); } /* 兼容ECShopV2.5.1版本 */ if (!defined('EC_CHARSET')) { define('EC_CHARSET', 'utf-8'); } /* 初始化JSON对象 */ $json = new JSON; /* 分析JSON数据 */ parse_json($json, $_POST['Json']); /* 初始化包含文件 */ require(ROOT_PATH . 'includes/inc_constant.php'); require(ROOT_PATH . 'includes/cls_ecshop.php'); require(ROOT_PATH . 'includes/lib_time.php'); require(ROOT_PATH . 'includes/lib_main.php'); require(ROOT_PATH . 'includes/lib_insert.php'); require(ROOT_PATH . 'includes/lib_goods.php'); /* 创建 ECSHOP 对象 */ $ecs = new ECS($db_name, $prefix); /* 初始化数据库类 */ $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name); $db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart'))); $db_host = $db_user = $db_pass = $db_name = NULL; /* 载入系统参数 */ $_CFG = load_config(); /* 载入语言包 */ require(ROOT_PATH.'languages/' .$_CFG['lang']. '/admin/common.php'); require(ROOT_PATH.'languages/' .$_CFG['lang']. '/admin/log_action.php'); /* 初始化session */ include(ROOT_PATH . 'includes/cls_session.php'); $sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), 'CL_ECSCP_ID'); define('SESS_ID', $sess->get_session_id()); /* 判断是否登录了 */ if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) && ($_POST['Action'] != 'UserLogin')) { client_show_message(110); } if ($_CFG['shop_closed'] == 1) { /* 商店关闭了,输出关闭的消息 */ client_show_message(105); } ?>
zzshop
trunk/api/client/includes/init.php
PHP
asf20
3,458
<?php function dispatch($post) { // 分发器数组 $func_arr = array('GetDomain', 'UserLogin', 'AddCategory', 'AddBrand', 'AddGoods', 'GetCategory', 'GetBrand', 'GetGoods', 'DeleteBrand', 'DeleteCategory', 'DeleteGoods', 'EditBrand', 'EditCategory', 'EditGoods'); if(in_array($post['Action'], $func_arr) && function_exists('API_'.$post['Action'])) { return call_user_func('API_'.$post['Action'], $post); } else { API_Error(); } } function parse_json(&$json, $str) { if (defined('EC_CHARSET') && EC_CHARSET == 'gbk') { $str = addslashes(stripslashes(ecs_iconv('utf-8', 'gbk', $str))); } $json_obj = $json->decode($str, 1); $_POST = $json_obj; } function show_json(&$json, $array, $convert = false) { $json_str = $json->encode($array, false); if (!$convert && defined('EC_CHARSET') && EC_CHARSET == 'gbk') { $json_str = ecs_iconv('UTF-8', 'GBK', $json_str); } @header('Content-type:text/html; charset='.EC_CHARSET); exit($json_str); } function admin_privilege($priv_str) { if(isset($_SESSION['admin_id']) && intval($_SESSION['admin_id']) > 0) { if ($_SESSION['action_list'] == 'all') { return true; } if (strpos(',' . $_SESSION['action_list'] . ',', ',' . $priv_str . ',') !== false) { return true; } } client_show_message(101); } /** * 检查分类是否已经存在 * * @param string $cat_name 分类名称 * @param integer $parent_cat 上级分类 * @param integer $exclude 排除的分类ID * * @return boolean */ function cat_is_exists($cat_name, $parent_cat, $exclude = 0) { $sql = "SELECT COUNT(*) FROM " .$GLOBALS['ecs']->table('category'). " WHERE parent_id = '$parent_cat' AND cat_name = '$cat_name' AND cat_id<>'$exclude'"; return ($GLOBALS['db']->getOne($sql) > 0) ? true : false; } function debug_text($str='') { $file = 'D:/debug.txt'; $fp = fopen($file, 'a'); if($str == ''){ $str .= implode('', $_POST); $str .= implode('', $_GET); $str .= implode('', $_REQUEST); } fwrite($fp, $str); fclose($fp); } /** * 生成随机的数字串 * * @author: weber liu * @return string */ function random_filename() { $str = ''; for($i = 0; $i < 9; $i++) { $str .= mt_rand(0, 9); } return gmtime() . $str; } /** * 生成指定目录不重名的文件名 * * @access public * @param string $dir 要检查是否有同名文件的目录 * * @return string 文件名 */ function unique_name($dir) { $filename = ''; while (empty($filename)) { $filename = random_filename(); if (file_exists($dir . $filename . '.jpg') || file_exists($dir . $filename . '.gif') || file_exists($dir . $filename . '.png')) { $filename = ''; } } return $filename; } /** * 上传图片 * * @param string $str 二进制字符串 * @param string $dir 目录路径 * @param string $img_name 图片名称 * @return 图片名称 或 假值 */ function upload_image($str, $dir='', $img_name='') { if(empty($str['Data'])) { return false; } $allow_file_type = array('jpg', 'jpeg', 'png', 'gif', 'bmp'); if (empty($dir)) { /* 创建当月目录 */ $dir = date('Ym'); $dir = ROOT_PATH . '/images/'.$dir; } else { /* 创建目录 */ $dir = ROOT_PATH . '/'.$dir; if ($img_name) { /* 判断$img_name文件后缀与路径 */ $img_name = basename($img_name); $img_name_ext = substr($img_name,strrpos($img_name, '.')+1); if (!in_array($img_name_ext, $allow_file_type)) { return false; } $img_name = $dir.'/' . $img_name; // 将图片定位到正确地址 } } if (!file_exists($dir)) { if (!make_dir($dir)) { /* 创建目录失败 */ return false; } } if (empty($img_name)) { $img_name = unique_name($dir); $img_name = $dir . '/' . $img_name . '.' . $str['Type']; } $binary_data = base64_decode($str['Data']); if($fp = @fopen($img_name, 'wb')) { @fwrite($fp, $binary_data); @fclose($fp); return str_replace(ROOT_PATH . '/', '', $img_name); } else { return false; } } /** * 输出信息到客户端 * * @param int $code 错误代号 * @param boolean $result 返回结果 * @param string $msg 错误信息 * @param int $id 返回值 */ function client_show_message($code=0, $result=false, $message = '', $id=0, $custom_message=false, $charset='') { $msg = $GLOBALS['common_message']; $msg['Result'] = $result; $msg['MessageCode'] = $code; $msg['MessageString'] = ($custom_message === false) ? $GLOBALS['_ALANG'][$code] . $message : $message; $msg['InsertID'] = $id; $msg['Charset'] = $charset; show_json($GLOBALS['json'], $msg); } function client_check_image_size($str) { $max_size = 2097152; // 2M return $max_size > strlen($str['Data']); } function get_goods_image_url($goods_id, $img_url, $thumb = false) { return str_replace('/api.php', '', preg_replace("/\/api\/client/", '', $GLOBALS['ecs']->url())) . $img_url; } /** * 处理替换数组中的十六进制字符值 * * @param array $array 替换数组 * * @return array */ function process_replace_array($array) { foreach ($array['search'] as $key => $val) { $array['search'][$key] = chr(hexdec($val{0}.$val{1})).chr(hexdec($val{2}.$val{3})); } return $array; } if (!function_exists("htmlspecialchars_decode")) { function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT) { return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style))); } } /** * 用户登录函数 * 验证登录,设置COOKIE * * @param array $post */ function API_UserLogin($post) { $post['username'] = isset($post['UserId']) ? trim($post['UserId']) : ''; $post['password'] = isset($post['Password']) ? strtolower(trim($post['Password'])) : ''; /* 检查密码是否正确 */ $sql = "SELECT user_id, user_name, password, action_list, last_login". " FROM " . $GLOBALS['ecs']->table('admin_user') . " WHERE user_name = '" . $post['username']. "'"; $row = $GLOBALS['db']->getRow($sql); if ($row) { if ($row['password'] != $post['password']) { client_show_message(103); } require_once(ROOT_PATH. ADMIN_PATH . '/includes/lib_main.php'); // 登录成功 set_admin_session($row['user_id'], $row['user_name'], $row['action_list'], $row['last_login']); // 更新最后登录时间和IP $GLOBALS['db']->query("UPDATE " .$GLOBALS['ecs']->table('admin_user'). " SET last_login='" . gmtime() . "', last_ip='" . real_ip() . "'". " WHERE user_id='$_SESSION[admin_id]'"); client_show_message(100, true, VERSION, 0, true, EC_CHARSET); } else { client_show_message(103); } } /** * 添加分类 * * @param array $post */ function API_AddCategory($post) { /* 加载后台主操作函数 */ require_once(ROOT_PATH. ADMIN_PATH . '/includes/lib_main.php'); /* 检查权限 */ admin_privilege('cat_manage'); /* 初始化变量 */ $cat = array(); $cat['cat_id'] = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0; $cat['parent_id'] = !empty($_POST['parent_id']) ? intval($_POST['parent_id']) : 0; $cat['sort_order'] = !empty($_POST['sort_order']) ? intval($_POST['sort_order']) : 0; $cat['keywords'] = !empty($_POST['keywords']) ? trim($_POST['keywords']) : ''; $cat['cat_desc'] = !empty($_POST['cat_desc']) ? $_POST['cat_desc'] : ''; $cat['measure_unit'] = !empty($_POST['measure_unit']) ? trim($_POST['measure_unit']) : ''; $cat['cat_name'] = !empty($_POST['cat_name']) ? trim($_POST['cat_name']) : ''; $cat['show_in_nav'] = !empty($_POST['show_in_nav']) ? intval($_POST['show_in_nav']): 0; $cat['style'] = !empty($_POST['style']) ? trim($_POST['style']) : ''; $cat['is_show'] = !empty($_POST['is_show']) ? intval($_POST['is_show']) : 0; $cat['grade'] = !empty($_POST['grade']) ? intval($_POST['grade']) : 0; $cat['filter_attr'] = !empty($_POST['filter_attr']) ? intval($_POST['filter_attr']) : 0; if (cat_is_exists($cat['cat_name'], $cat['parent_id'])) { /* 同级别下不能有重复的分类名称 */ client_show_message(403); } if($cat['grade'] > 10 || $cat['grade'] < 0) { /* 价格区间数超过范围 */ client_show_message(402); } if ($GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('category'), $cat) !== false) { $insert_id = $GLOBALS['db']->insert_id(); if($cat['show_in_nav'] == 1) { $vieworder = $GLOBALS['db']->getOne("SELECT max(vieworder) FROM ". $GLOBALS['ecs']->table('nav') . " WHERE type = 'middle'"); $vieworder += 2; //显示在自定义导航栏中 $sql = "INSERT INTO " . $GLOBALS['ecs']->table('nav') . " (name, ctype, cid, ifshow, vieworder, opennew, url, type)". " VALUES('" . $cat['cat_name'] . "', 'c', '".$insert_id."','1','$vieworder','0', '" . build_uri('category', array('cid'=> $insert_id), $cat['cat_name']) . "','middle')"; $GLOBALS['db']->query($sql); } admin_log($_POST['cat_name'], 'add', 'category'); // 记录管理员操作 clear_cache_files(); // 清除缓存 /*添加链接*/ client_show_message(0, true); } } /** * 获取分类 * * @param array $post */ function API_GetCategory($post) { $sql = "SELECT c.cat_id, c.cat_name, c.keywords, c.cat_desc, c.parent_id, c.sort_order, c.measure_unit, c.show_in_nav, c.style, c.is_show, c.grade, c.filter_attr, COUNT(s.cat_id) AS has_children ". 'FROM ' . $GLOBALS['ecs']->table('category') . " AS c ". "LEFT JOIN " . $GLOBALS['ecs']->table('category') . " AS s ON s.parent_id=c.cat_id ". " GROUP BY c.cat_id ". 'ORDER BY parent_id, sort_order ASC'; $result = $GLOBALS['db']->getAllCached($sql); foreach ($result as $key => $cat) { $result[$key]['is_show'] = ($cat['is_show'] == 1); $result[$key]['show_in_nav'] = ($cat['show_in_nav'] == 1); } show_json($GLOBALS['json'], $result, true); } /** * 添加品牌 * * @param array $post */ function API_AddBrand($post) { /* 加载后台主操作函数 */ require_once(ROOT_PATH . ADMIN_PATH . '/includes/lib_main.php'); require_once(ROOT_PATH . ADMIN_PATH . '/includes/cls_exchange.php'); require_once(ROOT_PATH . 'includes/cls_image.php'); /* 检查权限 */ admin_privilege('brand_manage'); $is_show = isset($_POST['is_show']) ? 1 : 0; /*检查品牌名是否重复*/ $exc = new exchange($GLOBALS['ecs']->table("brand"), $GLOBALS['db'], 'brand_id', 'brand_name'); $is_only = $exc->is_only('brand_name', $_POST['brand_name'], '', ''); if (!$is_only) { client_show_message(301); } /* 处理图片 */ $img_name = upload_image($_POST['brand_logo'], 'brandlogo'); if($img_name !== false) { $img_name = basename($img_name); } else { $img_name = ''; } /*插入数据*/ $sql = "INSERT INTO ".$GLOBALS['ecs']->table('brand')."(brand_name, site_url, brand_desc, brand_logo, is_show, sort_order) ". "VALUES ('$_POST[brand_name]', '$_POST[site_url]', '$_POST[brand_desc]', '$img_name', '$is_show', '$_POST[sort_order]')"; //debug_text($sql); $GLOBALS['db']->query($sql); $insert_id = $GLOBALS['db']->insert_id(); admin_log($_POST['brand_name'],'add','brand'); /* 清除缓存 */ clear_cache_files(); client_show_message(0, true); } /** * 获取品牌数据 * * @param array $post */ function API_GetBrand($post) { $sql = "SELECT brand_id, brand_name, brand_logo, brand_desc, site_url, is_show FROM ".$GLOBALS['ecs']->table('brand')." ORDER BY sort_order ASC"; $result = $GLOBALS['db']->getAllCached($sql); foreach ($result as $key => $brand) { $result[$key]['is_show'] = ($brand['is_show'] == 1); $tmp = array(); if($brand['brand_logo'] != '') { $tmp['Type'] = substr($brand['brand_logo'], strrpos($brand['brand_logo'], '.')+1); $tmp['Data'] = 'data/brandlogo/' . $brand['brand_logo']; } else { $tmp['Type'] = ''; $tmp['Data'] = ''; } $result[$key]['brand_logo'] = $tmp; } show_json($GLOBALS['json'], $result, true); } /** * 添加商品 * * @param array $post */ function API_AddGoods($post) { //debug_text(); global $_CFG; /* 加载后台操作类与函数 */ require_once(ROOT_PATH . ADMIN_PATH . '/includes/lib_main.php'); require_once(ROOT_PATH . ADMIN_PATH . '/includes/lib_goods.php'); require_once(ROOT_PATH . 'includes/cls_image.php'); /* 检查权限 */ admin_privilege('goods_manage'); $image = new cls_image($GLOBALS['_CFG']['bgcolor']); $code = empty($_POST['extension_code']) ? '' : trim($_POST['extension_code']); /* 插入还是更新的标识 */ $is_insert = $_POST['act'] == 'insert'; /* 如果是更新,先检查该商品是否存在,不存在,则退出。 */ if (!$is_insert) { $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id = '$_POST[goods_id]' AND is_delete = 0"; if ($GLOBALS['db']->getOne($sql) <= 0) { client_show_message(240); //货号重复 } } /* 检查货号是否重复 */ if ($_POST['goods_sn']) { $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_sn = '$_POST[goods_sn]' AND is_delete = 0 AND goods_id <> '$_POST[goods_id]'"; if ($GLOBALS['db']->getOne($sql) > 0) { client_show_message(200); //货号重复 } } /* 处理商品图片 */ $goods_img = ''; // 初始化商品图片 $goods_thumb = ''; // 初始化商品缩略图 $original_img = ''; // 初始化原始图片 $old_original_img = ''; // 初始化原始图片旧图 $allow_file_type = array('jpg', 'jpeg', 'png', 'gif'); if(!empty($_POST['goods_img']['Data'])) { if(!in_array($_POST['goods_img']['Type'], $allow_file_type)) { client_show_message(201); } if(client_check_image_size($_POST['goods_img']['Data']) === false) { client_show_message(202); } if ($_POST['goods_id'] > 0) { /* 删除原来的图片文件 */ $sql = "SELECT goods_thumb, goods_img, original_img " . " FROM " . $GLOBALS['ecs']->table('goods') . " WHERE goods_id = '$_POST[goods_id]'"; $row = $GLOBALS['db']->getRow($sql); if ($row['goods_thumb'] != '' && is_file(ROOT_PATH . '/' . $row['goods_thumb'])) { @unlink(ROOT_PATH . '/' . $row['goods_thumb']); } if ($row['goods_img'] != '' && is_file(ROOT_PATH . '/' . $row['goods_img'])) { @unlink(ROOT_PATH . '/' . $row['goods_img']); } if ($row['original_img'] != '' && is_file(ROOT_PATH . '/' . $row['original_img'])) { /* 先不处理,以防止程序中途出错停止 */ //$old_original_img = $row['original_img']; //记录旧图路径 } } $original_img = upload_image($_POST['goods_img']); // 原始图片 if ($original_img === false) { client_show_message(210); // 写入商品图片出错 } $goods_img = $original_img; // 商品图片 /* 复制一份相册图片 */ $img = $original_img; // 相册图片 $pos = strpos(basename($img), '.'); $newname = dirname($img) . '/' . random_filename() . substr(basename($img), $pos); if (!copy(ROOT_PATH . '/' . $img, ROOT_PATH .'/'. $newname)) { client_show_message(211); // 复制相册图片时出错 } $img = $newname; $gallery_img = $img; $gallery_thumb = $img; /* 图片属性 */ $img_property = ($image->gd_version() > 0)?getimagesize(ROOT_PATH .'/'. $goods_img):array(); // 如果系统支持GD,缩放商品图片,且给商品图片和相册图片加水印 if ($image->gd_version() > 0 && $image->check_img_function($img_property[2])) { // 如果设置大小不为0,缩放图片 if ($GLOBALS['_CFG']['image_width'] != 0 || $GLOBALS['_CFG']['image_height'] != 0) { $goods_img = $image->make_thumb(ROOT_PATH .'/'. $goods_img, $GLOBALS['_CFG']['image_width'], $GLOBALS['_CFG']['image_height']); if ($goods_img === false) { client_show_message(212); } } // 加水印 if (intval($GLOBALS['_CFG']['watermark_place']) > 0 && !empty($GLOBALS['_CFG']['watermark'])) { if ($image->add_watermark(ROOT_PATH . '/' .$goods_img,'',$GLOBALS['_CFG']['watermark'], $GLOBALS['_CFG']['watermark_place'], $GLOBALS['_CFG']['watermark_alpha']) === false) { client_show_message(213); } $newname = dirname($img) . '/' . random_filename() . substr(basename($img), $pos); if (!copy(ROOT_PATH . '/'. $img, ROOT_PATH . '/'. $newname)) { client_show_message(214); } $gallery_img = $newname; if ($image->add_watermark(ROOT_PATH .'/'. $gallery_img,'',$GLOBALS['_CFG']['watermark'], $GLOBALS['_CFG']['watermark_place'], $GLOBALS['_CFG']['watermark_alpha']) === false) { client_show_message(213); } } // 相册缩略图 if ($_CFG['thumb_width'] != 0 || $_CFG['thumb_height'] != 0) { $gallery_thumb = $image->make_thumb(ROOT_PATH .'/'. $img, $GLOBALS['_CFG']['thumb_width'], $GLOBALS['_CFG']['thumb_height']); if ($gallery_thumb === false) { client_show_message(215); } } } } if(!empty($_POST['goods_thumb']['Data'])) { if(!in_array($_POST['goods_thumb']['Type'], $allow_file_type)) { client_show_message(203); } if(client_check_image_size($_POST['goods_thumb']['Data']) === false) { client_show_message(204); } $goods_thumb = upload_image($_POST['goods_thumb']); if ($goods_thumb === false) { client_show_message(217); } } else { // 未上传,如果自动选择生成,且上传了商品图片,生成所略图 if (isset($_POST['auto_thumb']) && !empty($original_img)) { // 如果设置缩略图大小不为0,生成缩略图 if ($_CFG['thumb_width'] != 0 || $_CFG['thumb_height'] != 0) { $goods_thumb = $image->make_thumb(ROOT_PATH .'/'. $original_img, $GLOBALS['_CFG']['thumb_width'], $GLOBALS['_CFG']['thumb_height']); if ($goods_thumb === false) { client_show_message(218); } } else { $goods_thumb = $original_img; } } } /* 如果没有输入商品货号则自动生成一个商品货号 */ if (empty($_POST['goods_sn'])) { $max_id = $is_insert ? $GLOBALS['db']->getOne("SELECT MAX(goods_id) + 1 FROM ".$GLOBALS['ecs']->table('goods')) : $_POST['goods_id']; $goods_sn = generate_goods_sn($max_id); } else { $goods_sn = $_POST['goods_sn']; } /* 处理商品数据 */ $is_promote = (isset($_POST['is_promote']) && $_POST['is_promote']) ? 1 : 0; $shop_price = !empty($_POST['shop_price']) ? $_POST['shop_price'] : 0; $market_price = !empty($_POST['market_price']) ? $_POST['market_price'] : ($GLOBALS['_CFG']['market_price_rate'] * $shop_price); $promote_price = !empty($_POST['promote_price']) ? floatval($_POST['promote_price'] ) : 0; $promote_start_date = ($is_promote && !empty($_POST['promote_start_date'])) ? local_strtotime($_POST['promote_start_date']) : 0; $promote_end_date = ($is_promote && !empty($_POST['promote_end_date'])) ? local_strtotime($_POST['promote_end_date']) : 0; $goods_weight = !empty($_POST['goods_weight']) ? $_POST['goods_weight'] * $_POST['weight_unit'] : 0; $is_best = (isset($_POST['is_best']) && $_POST['is_best']) ? 1 : 0; $is_new = (isset($_POST['is_new']) && $_POST['is_new']) ? 1 : 0; $is_hot = (isset($_POST['is_hot']) && $_POST['is_hot']) ? 1 : 0; $is_on_sale = (isset($_POST['is_on_sale']) && $_POST['is_on_sale']) ? 1 : 0; $is_alone_sale = (isset($_POST['is_alone_sale']) && $_POST['is_alone_sale']) ? 1 : 0; $goods_number = isset($_POST['goods_number']) ? $_POST['goods_number'] : 0; $warn_number = isset($_POST['warn_number']) ? $_POST['warn_number'] : 0; $goods_type = isset($_POST['goods_type']) ? $_POST['goods_type'] : 0; $goods_name_style = $_POST['goods_name_color'] . '+' . $_POST['goods_name_style']; $catgory_id = empty($_POST['cat_id']) ? '' : intval($_POST['cat_id']); $brand_id = empty($_POST['brand_id']) ? '' : intval($_POST['brand_id']); $new_brand_name = empty($_POST['new_brand_name']) ? '' : trim($_POST['new_brand_name']); $new_cat_name = empty($_POST['new_cat_name']) ? '' : trim($_POST['new_cat_name']); if($catgory_id == '' && $new_cat_name != '') { if (cat_exists($new_cat_name, $_POST['parent_cat'])) { /* 同级别下不能有重复的分类名称 */ client_show_message(219); } } if($brand_id == '' && $new_brand_name != '') { if (brand_exists($new_brand_name)) { /* 同级别下不能有重复的品牌名称 */ client_show_message(220); } } //处理快速添加分类 if($catgory_id == '' && $new_cat_name != '') { $sql = "INSERT INTO " . $GLOBALS['ecs']->table('category') . "(cat_name, parent_id, is_show)" . "VALUES ( '$new_cat_name', '$_POST[parent_cat]', 1)"; $GLOBALS['db']->query($sql); $catgory_id = $GLOBALS['db']->insert_id(); } //处理快速添加品牌 if($brand_id == '' && $new_brand_name != '') { $sql = "INSERT INTO ".$GLOBALS['ecs']->table('brand')."(brand_name) " . "VALUES ('$new_brand_name')"; $GLOBALS['db']->query($sql); $brand_id = $GLOBALS['db']->insert_id(); } /* 处理商品详细描述 */ $_POST['goods_desc'] = htmlspecialchars_decode($_POST['goods_desc']); /* 入库 */ if ($is_insert) { if ($code == '') { $sql = "INSERT INTO " . $GLOBALS['ecs']->table('goods') . " (goods_name, goods_name_style, goods_sn, " . "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " . "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " . "seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, " . "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type)" . "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " . "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ". "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ". "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',". " '$warn_number', '$_POST[integral]', '" . intval($_POST['give_integral']) . "', '$is_best', '$is_new', '$is_hot', '$is_on_sale', '$is_alone_sale', ". " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type')"; } else { $sql = "INSERT INTO " . $GLOBALS['ecs']->table('goods') . " (goods_name, goods_name_style, goods_sn, " . "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " . "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, " . "seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, is_real, " . "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type, extension_code)" . "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " . "'$brand_id', '$shop_price', '$market_price', '$is_promote', '$promote_price', ". "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ". "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight', '$goods_number',". " '$warn_number', '$_POST[integral]', '" . intval($_POST['give_integral']) . "', '$is_best', '$is_new', '$is_hot', 0, '$is_on_sale', '$is_alone_sale', ". " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code')"; } } else { /* 将上传的新图片图片名改为原图片 */ if ($goods_img && $row['goods_img']) { if (is_file(ROOT_PATH . $row['goods_img'])) { @unlink(ROOT_PATH . $row['goods_img']); } @rename(ROOT_PATH . $goods_img, ROOT_PATH . $row['goods_img']); if (is_file(ROOT_PATH . $row['original_img'])) { @unlink(ROOT_PATH . $row['original_img']); } @rename(ROOT_PATH . $original_img, ROOT_PATH . $row['original_img']); } if ($goods_thumb && $row['goods_thumb']) { if (is_file(ROOT_PATH . $row['goods_thumb'])) { @unlink(ROOT_PATH . $row['goods_thumb']); } @rename(ROOT_PATH . $goods_thumb, ROOT_PATH . $row['goods_thumb']); } $sql = "UPDATE " . $GLOBALS['ecs']->table('goods') . " SET " . "goods_name = '$_POST[goods_name]', " . "goods_name_style = '$goods_name_style', " . "goods_sn = '$goods_sn', " . "cat_id = '$catgory_id', " . "brand_id = '$brand_id', " . "shop_price = '$shop_price', " . "market_price = '$market_price', " . "is_promote = '$is_promote', " . "promote_price = '$promote_price', " . "promote_start_date = '$promote_start_date', " . "promote_end_date = '$promote_end_date', "; /* 如果以前没上传过图片,需要更新数据库 */ if ($goods_img && empty($row['goods_img'])) { $sql .= "goods_img = '$goods_img', original_img = '$original_img', "; } if (!empty($goods_thumb)) { $sql .= "goods_thumb = '$goods_thumb', "; } if ($code != '') { $sql .= "is_real=0, extension_code='$code', "; } $sql .= "keywords = '$_POST[keywords]', " . "goods_brief = '$_POST[goods_brief]', " . "seller_note = '$_POST[seller_note]', " . "goods_weight = '$goods_weight'," . "goods_number = '$goods_number', " . "warn_number = '$warn_number', " . "integral = '$_POST[integral]', " . "give_integral = '". $_POST['give_integral'] ."', " . "is_best = '$is_best', " . "is_new = '$is_new', " . "is_hot = '$is_hot', " . "is_on_sale = '$is_on_sale', " . "is_alone_sale = '$is_alone_sale', " . "goods_desc = '$_POST[goods_desc]', " . "last_update = '". gmtime() ."', ". "goods_type = '$goods_type' " . "WHERE goods_id = '$_POST[goods_id]' LIMIT 1"; } $GLOBALS['db']->query($sql); /* 商品编号 */ $goods_id = $is_insert ? $GLOBALS['db']->insert_id() : $_POST['goods_id']; /* 记录日志 */ if ($is_insert) { admin_log($_POST['goods_name'], 'add', 'goods'); } else { admin_log($_POST['goods_name'], 'edit', 'goods'); } /* 处理属性 */ if (isset($_POST['attr_id_list']) && isset($_POST['attr_value_list'])) { // 取得原有的属性值 $goods_attr_list = array(); $keywords_arr = explode(" ", $_POST['keywords']); $keywords_arr = array_flip($keywords_arr); if (isset($keywords_arr[''])) { unset($keywords_arr['']); } $sql = "SELECT attr_id, attr_index FROM " . $GLOBALS['ecs']->table('attribute') . " WHERE cat_id = '$goods_type' "; $attr_res = $GLOBALS['db']->query($sql); $attr_list = array(); while ($row = $GLOBALS['db']->fetchRow($attr_res)) { $attr_list[$row['attr_id']] = $row['attr_index']; } $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('goods_attr') . " WHERE goods_id = '$goods_id' "; $res = $GLOBALS['db']->query($sql); while ($row = $GLOBALS['db']->fetchRow($res)) { $goods_attr_list[$row['attr_id']][$row['attr_value']] = array('sign' => 'delete', 'goods_attr_id' => $row['goods_attr_id']); } // 循环现有的,根据原有的做相应处理 foreach ($_POST['attr_id_list'] AS $key => $attr_id) { $attr_value = $_POST['attr_value_list'][$key]; $attr_price = $_POST['attr_price_list'][$key]; if (!empty($attr_value)) { if (isset($goods_attr_list[$attr_id][$attr_value])) { // 如果原来有,标记为更新 $goods_attr_list[$attr_id][$attr_value]['sign'] = 'update'; $goods_attr_list[$attr_id][$attr_value]['attr_price'] = $attr_price; } else { // 如果原来没有,标记为新增 $goods_attr_list[$attr_id][$attr_value]['sign'] = 'insert'; $goods_attr_list[$attr_id][$attr_value]['attr_price'] = $attr_price; } $val_arr = explode(' ', $attr_value); foreach ($val_arr AS $k => $v) { if (!isset($keywords_arr[$v]) && $attr_list[$attr_id] == "1") { $keywords_arr[$v] = $v; } } } } $keywords = join(' ', array_flip($keywords_arr)); $sql = "UPDATE " .$GLOBALS['ecs']->table('goods'). " SET keywords = '$keywords' WHERE goods_id = '$goods_id' LIMIT 1"; $GLOBALS['db']->query($sql); /* 插入、更新、删除数据 */ foreach ($goods_attr_list as $attr_id => $attr_value_list) { foreach ($attr_value_list as $attr_value => $info) { if ($info['sign'] == 'insert') { $sql = "INSERT INTO " .$GLOBALS['ecs']->table('goods_attr'). " (attr_id, goods_id, attr_value, attr_price)". "VALUES ('$attr_id', '$goods_id', '$attr_value', '$info[attr_price]')"; } elseif ($info['sign'] == 'update') { $sql = "UPDATE " .$GLOBALS['ecs']->table('goods_attr'). " SET attr_price = '$info[attr_price]' WHERE goods_attr_id = '$info[goods_attr_id]' LIMIT 1"; } else { $sql = "DELETE FROM " .$GLOBALS['ecs']->table('goods_attr'). " WHERE goods_attr_id = '$info[goods_attr_id]' LIMIT 1"; } $GLOBALS['db']->query($sql); } } } /* 处理会员价格 */ if (isset($_POST['user_rank']) && isset($_POST['user_price'])) { handle_member_price($goods_id, $_POST['user_rank'], $_POST['user_price']); } /* 处理扩展分类 */ if (isset($_POST['other_cat'])) { handle_other_cat($goods_id, array_unique($_POST['other_cat'])); } if ($is_insert) { /* 处理关联商品 */ handle_link_goods($goods_id); /* 处理组合商品 */ handle_group_goods($goods_id); /* 处理关联文章 */ handle_goods_article($goods_id); } /* 如果有图片,把商品图片加入图片相册 */ if (isset($img)) { $sql = "INSERT INTO " . $GLOBALS['ecs']->table('goods_gallery') . " (goods_id, img_url, img_desc, thumb_url, img_original) " . "VALUES ('$goods_id', '$gallery_img', '', '$gallery_thumb', '$img')"; $GLOBALS['db']->query($sql); } /* 处理相册图片 handle_gallery_image($goods_id, $_FILES['img_url'], $_POST['img_desc']); */ if(!empty($_POST['img_url'])) { foreach ($_POST['img_url'] as $key => $img_url) { if(!in_array($img_url['Type'], $allow_file_type)) { client_show_message(205); } if(client_check_image_size($img_url['Data']) === false) { client_show_message(206); } $img_original = upload_image($img_url); if($img_original === false) { continue; } // 暂停生成缩略图 /* $thumb_url = $image->make_thumb(ROOT_PATH . $img_original, $GLOBALS['_CFG']['thumb_width'], $GLOBALS['_CFG']['thumb_height']); $thumb_url = is_string($thumb_url) ? $thumb_url : ''; $img_url = $img_original; // 如果服务器支持GD 则添加水印 if (gd_version() > 0) { $pos = strpos(basename($img_original), '.'); $newname = dirname($img_original) . '/' . random_filename() . substr(basename($img_original), $pos); copy(ROOT_PATH . '/' . $img_original, ROOT_PATH . '/' . $newname); $img_url = $newname; $image->add_watermark(ROOT_PATH . $img_url,'',$GLOBALS['_CFG']['watermark'], $GLOBALS['_CFG']['watermark_place'], $GLOBALS['_CFG']['watermark_alpha']); } */ $img_url = $thumb_url = $img_original; $img_desc = $_POST['img_desc'][$key]; $sql = "INSERT INTO " . $GLOBALS['ecs']->table('goods_gallery') . " (goods_id, img_url, img_desc, thumb_url, img_original) " . "VALUES ('$goods_id', '$img_url', '$img_desc', '$thumb_url', '$img_original')"; $GLOBALS['db']->query($sql); } } /* 编辑时处理相册图片描述 */ if (!$is_insert && isset($_POST['old_img_desc'])) { foreach ($_POST['old_img_desc'] AS $img_id => $img_desc) { $sql = "UPDATE " . $GLOBALS['ecs']->table('goods_gallery') . " SET img_desc = '$img_desc' WHERE img_id = '$img_id' LIMIT 1"; $GLOBALS['db']->query($sql); } } /* 清空缓存 */ clear_cache_files(); /* 提示页面 */ client_show_message(0, true, '', $goods_id); } /** * 获取商品数据 * * @param array $post POST数据 */ function API_GetGoods($post) { $pagesize = intval($_POST['PageSize']); $page = intval($_POST['Page']); if(empty($pagesize)) { $pagesize = 20; // 每页大小 } if($page < 0) { $page = 0; } //$limit = ' LIMIT ' . ($page * $pagesize) . ', ' . ($pagesize+1); $today = gmtime(); $is_delete = 0; $record_count = $GLOBALS['db']->getOne("SELECT count(*) FROM " . $GLOBALS['ecs']->table('goods') . " WHERE is_delete='$is_delete' $where "); if ($page > floor($record_count / $pagesize)) { $page = $record_count / $pagesize; } $limit = ' LIMIT ' . ($page * $pagesize) . ', ' . $pagesize; $sql = "SELECT goods_id, cat_id, goods_name, goods_sn, brand_id, market_price, shop_price, promote_price, is_on_sale, is_alone_sale, is_best, is_new, is_hot, goods_number, goods_weight, integral, goods_brief, REPLACE(goods_desc, CONCAT(char(170), char(178)), '') AS goods_desc, goods_thumb, goods_img, promote_start_date, promote_end_date, " . " (promote_price > 0 AND promote_start_date <= '$today' AND promote_end_date >= '$today') AS is_promote, warn_number, keywords, extension_code, seller_note, give_integral " . " FROM " . $GLOBALS['ecs']->table('goods') . " AS g WHERE is_delete='$is_delete' $where ORDER BY goods_id DESC $limit"; $result = array(); $result['Data'] = $GLOBALS['db']->getAll($sql); $result['NextPage'] = false; $result['PrevPage'] = false; $result['RecordCount'] = $record_count; if ($page < floor($record_count / $pagesize)) { $result['NextPage'] = true; } if($page > 0) { $result['PrevPage'] = true; } foreach ($result['Data'] as $key => $goods) { $result['Data'][$key]['is_on_sale'] = ($goods['is_on_sale'] == 1); $result['Data'][$key]['is_alone_sale'] = ($goods['is_alone_sale'] == 1); $result['Data'][$key]['is_best'] = ($goods['is_best'] == 1); $result['Data'][$key]['is_new'] = ($goods['is_new'] == 1); $result['Data'][$key]['is_hot'] = ($goods['is_hot'] == 1); $result['Data'][$key]['is_promote'] = ($goods['is_promote'] == 1); $result['Data'][$key]['goods_desc'] = htmlspecialchars($goods['goods_desc']); $result['Data'][$key]['keywords'] = htmlspecialchars($goods['keywords']); $result['Data'][$key]['promote_start_date'] = local_date('Y-m-d', $goods['promote_start_date']); $result['Data'][$key]['promote_end_date'] = local_date('Y-m-d', $goods['promote_end_date']); $tmp = array(); if($goods['goods_thumb'] != '') { $tmp['Type'] = substr($goods['goods_thumb'], strrpos($goods['goods_thumb'], '.')+1); $tmp['Data'] = get_goods_image_url($goods['goods_id'], $goods['goods_thumb'], true); } else { $tmp['Type'] = ''; $tmp['Data'] = ''; } $result['Data'][$key]['goods_thumb'] = $tmp; if($goods['goods_img'] != '') { $tmp['Type'] = substr($goods['goods_img'], strrpos($goods['goods_img'], '.')+1); $tmp['Data'] = get_goods_image_url($goods['goods_id'], $goods['goods_img'], false); } else { $tmp['Type'] = ''; $tmp['Data'] = ''; } $result['Data'][$key]['goods_img'] = $tmp; } show_json($GLOBALS['json'], $result, true); } /** * 删除品牌 * * @param array $post POST数据 */ function API_DeleteBrand($post) { require_once(ROOT_PATH . ADMIN_PATH . '/includes/cls_exchange.php'); admin_privilege('brand_manage'); $brand_id = intval($_POST['Id']); $exc = new exchange($GLOBALS['ecs']->table("brand"), $GLOBALS['db'], 'brand_id', 'brand_name'); $brand = $GLOBALS['db']->getRow("SELECT brand_logo FROM " . $GLOBALS['ecs']->table('brand') . " WHERE brand_id='$brand_id'"); if (!empty($brand['brand_logo'])) { @unlink(ROOT_PATH . '/brandlogo/' . $brand['brand_logo']); } $exc->drop($brand_id); /* 更新商品的品牌编号 */ $sql = "UPDATE " .$GLOBALS['ecs']->table('goods'). " SET brand_id=0 WHERE brand_id='$brand_id'"; $GLOBALS['db']->query($sql); client_show_message(0, true); } /** * 删除分类 * * @param array $post POST数据 */ function API_DeleteCategory($post) { /* 加载后台主操作函数 */ require_once(ROOT_PATH . ADMIN_PATH . '/includes/lib_main.php'); admin_privilege('cat_manage'); /* 初始化分类ID并取得分类名称 */ $cat_id = intval($_POST['Id']); $cat_name = $GLOBALS['db']->getOne('SELECT cat_name FROM ' .$GLOBALS['ecs']->table('category'). " WHERE cat_id='$cat_id'"); /* 当前分类下是否有子分类 */ $cat_count = $GLOBALS['db']->getOne('SELECT COUNT(*) FROM ' .$GLOBALS['ecs']->table('category'). " WHERE parent_id='$cat_id'"); /* 当前分类下是否存在商品 */ $goods_count = $GLOBALS['db']->getOne('SELECT COUNT(*) FROM ' .$GLOBALS['ecs']->table('goods'). " WHERE cat_id='$cat_id'"); /* 如果不存在下级子分类或商品,则删除之 */ if ($cat_count == 0 && $goods_count == 0) { /* 删除分类 */ $sql = 'DELETE FROM ' .$GLOBALS['ecs']->table('category'). " WHERE cat_id = '$cat_id'"; if ($GLOBALS['db']->query($sql)) { $GLOBALS['db']->query("DELETE FROM " . $GLOBALS['ecs']->table('nav') . "WHERE ctype = 'c' AND cid = '" . $cat_id . "' AND type = 'middle'"); clear_cache_files(); admin_log($cat_name, 'remove', 'category'); } client_show_message(0, true); } else { client_show_message(400); } } /** * 删除商品 * * @param array $post POST数据 */ function API_DeleteGoods($post) { require_once(ROOT_PATH . ADMIN_PATH . '/includes/cls_exchange.php'); $exc = new exchange($GLOBALS['ecs']->table("goods"), $GLOBALS['db'], 'goods_id', 'goods_name'); admin_privilege('remove_back'); $goods_id = intval($_POST['Id']); if ($exc->edit("is_delete = 1", $goods_id, '')) { client_show_message(0, true); } else { client_show_message(230); } } function API_EditCategory($post) { /* 加载后台主操作函数 */ require_once(ROOT_PATH . ADMIN_PATH . '/includes/lib_main.php'); /* 初始化变量 */ $cat_id = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0; $cat['parent_id'] = !empty($_POST['parent_id']) ? intval($_POST['parent_id']) : 0; $cat['sort_order'] = !empty($_POST['sort_order']) ? intval($_POST['sort_order']) : 0; $cat['keywords'] = !empty($_POST['keywords']) ? trim($_POST['keywords']) : ''; $cat['cat_desc'] = !empty($_POST['cat_desc']) ? $_POST['cat_desc'] : ''; $cat['measure_unit'] = !empty($_POST['measure_unit']) ? trim($_POST['measure_unit']) : ''; $cat['cat_name'] = !empty($_POST['cat_name']) ? trim($_POST['cat_name']) : ''; $cat['is_show'] = !empty($_POST['is_show']) ? intval($_POST['is_show']) : 0; $cat['show_in_nav'] = !empty($_POST['show_in_nav']) ? intval($_POST['show_in_nav']): 0; $cat['style'] = !empty($_POST['style']) ? trim($_POST['style']) : ''; $cat['grade'] = !empty($_POST['grade']) ? intval($_POST['grade']) : 0; $cat['filter_attr'] = !empty($_POST['filter_attr']) ? intval($_POST['filter_attr']) : 0; /* 判断上级目录是否合法 */ $children = array_keys(cat_list($cat_id, 0, false)); // 获得当前分类的所有下级分类 if (in_array($cat['parent_id'], $children)) { /* 选定的父类是当前分类或当前分类的下级分类 */ client_show_message(401); } if($cat['grade'] > 10 || $cat['grade'] < 0) { /* 价格区间数超过范围 */ client_show_message(402); } if (cat_exists($cat['cat_name'], $cat['parent_id'], $cat_id)) { /* 同级别下不能有重复的分类名称 */ client_show_message(403); } $dat = $GLOBALS['db']->getRow("SELECT cat_name, show_in_nav FROM ". $GLOBALS['ecs']->table('category') . " WHERE cat_id = '$cat_id'"); if ($GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('category'), $cat, 'UPDATE', "cat_id='$cat_id'")) { if($cat['cat_name'] != $dat['cat_name']) { //如果分类名称发生了改变 $sql = "UPDATE " . $GLOBALS['ecs']->table('nav') . " SET name = '" . $cat['cat_name'] . "' WHERE ctype = 'c' AND cid = '" . $cat_id . "' AND type = 'middle'"; $GLOBALS['db']->query($sql); } if($cat['show_in_nav'] != $dat['show_in_nav']) { //是否显示于导航栏发生了变化 if($cat['show_in_nav'] == 1) { //显示 $nid = $GLOBALS['db']->getOne("SELECT id FROM ". $GLOBALS['ecs']->table('nav') . " WHERE ctype = 'c' AND cid = '" . $cat_id . "' AND type = 'middle'"); if(empty($nid)) { //不存在 $vieworder = $GLOBALS['db']->getOne("SELECT max(vieworder) FROM ". $GLOBALS['ecs']->table('nav') . " WHERE type = 'middle'"); $vieworder += 2; $uri = build_uri('category', array('cid'=> $cat_id), $cat['cat_name']); $sql = "INSERT INTO " . $GLOBALS['ecs']->table('nav') . " (name,ctype,cid,ifshow,vieworder,opennew,url,type) VALUES('" . $cat['cat_name'] . "', 'c', '$cat_id','1','$vieworder','0', '" . $uri . "','middle')"; } else { $sql = "UPDATE " . $GLOBALS['ecs']->table('nav') . " SET ifshow = 1 WHERE ctype = 'c' AND cid = '" . $cat_id . "' AND type = 'middle'"; } $GLOBALS['db']->query($sql); } else { //去除 $GLOBALS['db']->query("UPDATE " . $GLOBALS['ecs']->table('nav') . " SET ifshow = 0 WHERE ctype = 'c' AND cid = '" . $cat_id . "' AND type = 'middle'"); } } } /* 更新分類信息成功 */ clear_cache_files(); // 清除缓存 admin_log($_POST['cat_name'], 'edit', 'category'); // 记录管理员操作 client_show_message(0, true); } function API_EditBrand($post) { /* 加载后台主操作函数 */ require_once(ROOT_PATH . ADMIN_PATH . '/includes/lib_main.php'); require_once(ROOT_PATH . ADMIN_PATH . '/includes/cls_exchange.php'); require_once(ROOT_PATH . 'includes/cls_image.php'); /* 检查权限 */ admin_privilege('brand_manage'); $is_show = isset($_POST['is_show']) ? 1 : 0; $brand_id = !empty($_POST['brand_id']) ? intval($_POST['brand_id']) : 0; /*检查品牌名是否重复*/ $exc = new exchange($GLOBALS['ecs']->table("brand"), $GLOBALS['db'], 'brand_id', 'brand_name'); $is_only = $exc->is_only('brand_name', $_POST['brand_name'], '', ''); if (!$is_only) { client_show_message(301); } $param = "brand_name = '$_POST[brand_name]', site_url='$_POST[site_url]', brand_desc='$_POST[brand_desc]', is_show='$is_show', sort_order='$_POST[sort_order]' "; /* 处理图片 */ $img_name = upload_image($_POST['brand_logo'], 'brandlogo'); if($img_name !== false) { $param .= " ,brand_logo = '" . basename($img_name) . "' "; } /* 更新数据 */ if ($exc->edit($param, $brand_id, '')) { /* 清除缓存 */ clear_cache_files(); admin_log($_POST['brand_name'], 'edit', 'brand'); client_show_message(0, true); } else { client_show_message(302); } } function API_EditGoods($post) { $_POST['act'] = 'update'; API_AddGoods($post); //client_show_message(0); } /** * 出错函数 * */ function API_Error() { client_show_message(102); } ?>
zzshop
trunk/api/client/includes/lib_api.php
PHP
asf20
54,711
<?php /** * 通用消息结构声明 */ $common_message = array( 'Result' => false, 'MessageCode' => 1, 'MessageString' => 'Nothing', 'InsertID' => 0 ); /** * 返回信息语言包 */ $_ALANG = array( /* 系统类 */ 100 => '登录成功', 101 => '没有权限', 102 => '无效调用', 103 => '登录失败,用户名或者密码错误。', 104 => '商店不存在', 105 => '商店已经被关闭', 106 => '域名未通过绑定审核或备案信息不合法', 107 => '缺少必要的网店信息', 108 => '独立网店的服务期限已经终止', 109 => '独立网店的顶级域名服务期限已经终止', 110 => '未登录或者登录超时。', /* 登录类 */ /* 分类操作 */ 400 => '存在下级子分类或商品,该分类不能被删除', 401 => '选定的父类是当前分类或当前分类的下级分类', 402 => '价格区间数超过范围', 403 => '同级别下不能有重复的分类名称', /* 品牌操作 */ 300 => '删除品牌时出错', 301 => '品牌名重复', 302 => '编辑品牌时出错', /* 商品操作 */ 200 => '商品货号重复', 201 => '商品图片类型不正确', 202 => '商品图片太大', 203 => '商品图片缩略图类型不正确', 204 => '商品图片缩略图太大', 205 => '商品相册图片类型不正确', 206 => '商品相册图片太大', 210 => '写入商品图片出错', 211 => '复制相册图片时出错', 212 => '生成缩略图时出错', 213 => '添加图片水印时出错', 214 => '复制水印图片时出错', 215 => '生成相册缩略图时出错', 216 => '复制原图时出错', 217 => '上传缩略图时出错', 218 => '自动生成缩略图时出错', 219 => '同级别下不能有重复的分类名称', 220 => '同级别下不能有重复的品牌名称', 221 => '商品数量已经超过限制', 230 => '把商品放入回收站时发生错误', 240 => '该商品已经不存在,编辑失败', 'undefined' => '未定义信息' ); ?>
zzshop
trunk/api/client/includes/lib_struct.php
PHP
asf20
2,192
<?php /** * ECSHOP 获取商品信息 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: goods.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require('./init.php'); require_once(ROOT_PATH . 'includes/cls_json.php'); $json = new JSON; $hash_code = $db->getOne("SELECT `value` FROM " . $ecs->table('shop_config') . " WHERE `code`='hash_code'", true); $action = isset($_REQUEST['action'])? $_REQUEST['action']:''; if (empty($_REQUEST['verify']) || empty($_REQUEST['auth']) || empty($_REQUEST['action'])) { $results = array('result'=>'false', 'data'=>'缺少必要的参数'); exit($json->encode($results)); } if ($_REQUEST['verify'] != md5($hash_code.$_REQUEST['action'].$_REQUEST['auth'])) { $results = array('result'=>'false', 'data'=>'数据来源不合法,请返回'); exit($json->encode($results)); } parse_str(passport_decrypt($_REQUEST['auth'], $hash_code), $data); switch ($action) { case 'get_goods_info': { $shop_id = isset($data['shop_id'])? intval($data['shop_id']):0; $record_number = isset($data['record_number'])? intval($data['record_number']):20; $page_number = isset($data['page_number'])? intval($data['page_number']):0; $limit = ' LIMIT ' . ($record_number * $page_number) . ', ' . ($record_number+1); $sql = "SELECT `goods_id`, `goods_name`, `goods_number`, `shop_price`, `keywords`, `goods_brief`, `goods_thumb`, `goods_img`, `last_update` FROM " . $ecs->table('goods') . " WHERE `is_delete`='0' ORDER BY `goods_id` ASC $limit "; $results = array('result' => 'false', 'next' => 'false', 'data' => array()); $query = $db->query($sql); $record_count = 0; while ($goods = $db->fetch_array($query)) { $goods['goods_thumb'] = (!empty($goods['goods_thumb']))? 'http://' . $_SERVER['SERVER_NAME'] . '/' . $goods['goods_thumb']:''; $goods['goods_img'] = (!empty($goods['goods_img']))? 'http://' . $_SERVER['SERVER_NAME'] . '/' . $goods['goods_img']:''; $results['data'][] = $goods; $record_count++; } if ($record_count > 0) { $results['result'] = 'true'; } if ($record_count > $record_number) { array_pop($results['data']); $results['next'] = 'true'; } exit($json->encode($results)); break; } case 'get_shop_info': { $results = array('result' => 'true', 'data' => array()); $sql = "SELECT `value` FROM " . $ecs->table('shop_config') . " WHERE code='shop_name'"; $shop_name = $db->getOne($sql); $sql = "SELECT `value` FROM " . $ecs->table('shop_config') . " WHERE code='currency_format'"; $currency_format = $db->getOne($sql); $sql = "SELECT r.region_name, sc.value FROM " . $ecs->table('region') . " AS r INNER JOIN " . $ecs->table('shop_config') . " AS sc ON r.`region_id`=sc.`value` WHERE sc.`code`='shop_country' OR sc.`code`='shop_province' OR sc.`code`='shop_city' ORDER BY sc.`id` ASC"; $shop_region = $db->getAll($sql); $results['data'] = array ( 'shop_name' => $shop_name, 'domain' => 'http://' . $_SERVER['SERVER_NAME'] . '/', 'shop_region' => $shop_region[0]['region_name'] . ' ' . $shop_region[1]['region_name'] . ' ' . $shop_region[2]['region_name'], 'currency_format' => $currency_format ); exit($json->encode($results)); break; } case 'get_shipping': { $results = array('result' => 'false', 'data' => array()); $sql = "SELECT `shipping_id`, `shipping_name`, `insure` FROM " . $ecs->table('shipping'); $result = $db->getAll($sql); if (!empty($result)) { $results['result'] = 'true'; $results['data'] = $result; } exit($json->encode($results)); break; } case 'get_goods_attribute': { $results = array('result' => 'false', 'data' => array()); $goods_id = isset($data['goods_id'])? intval($data['goods_id']):0; if (!empty($goods_id)) { $sql = "SELECT t2.attr_name, t1.attr_value FROM " . $ecs->table('goods_attr') . " AS t1 LEFT JOIN " . $ecs->table('attribute') . " AS t2 ON t1.attr_id=t2.attr_id WHERE t1.goods_id='$goods_id'"; $result = $db->getAll($sql); if (!empty($result)) { $results['result'] = 'true'; $results['data'] = $result; } } else { $results = array('result'=>'false', 'data'=>'缺少商品ID,无法获取其属性'); } exit($json->encode($results)); break; } default: { $results = array('result'=>'false', 'data'=>'缺少动作'); exit(json_encode($results)); break; } } /** * 解密函数 * * @param string $txt * @param string $key * @return string */ function passport_decrypt($txt, $key) { $txt = passport_key(base64_decode($txt), $key); $tmp = ''; for ($i = 0;$i < strlen($txt); $i++) { $md5 = $txt[$i]; $tmp .= $txt[++$i] ^ $md5; } return $tmp; } /** * 加密函数 * * @param string $txt * @param string $key * @return string */ function passport_encrypt($txt, $key) { srand((double)microtime() * 1000000); $encrypt_key = md5(rand(0, 32000)); $ctr = 0; $tmp = ''; for($i = 0; $i < strlen($txt); $i++ ) { $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; $tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]); } return base64_encode(passport_key($tmp, $key)); } /** * 编码函数 * * @param string $txt * @param string $key * @return string */ function passport_key($txt, $encrypt_key) { $encrypt_key = md5($encrypt_key); $ctr = 0; $tmp = ''; for($i = 0; $i < strlen($txt); $i++) { $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; $tmp .= $txt[$i] ^ $encrypt_key[$ctr++]; } return $tmp; } ?>
zzshop
trunk/api/goods.php
PHP
asf20
6,806
<?php /** * ECSHOP 程序说明 * =========================================================== * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ========================================================== * $Author: liuhui $ * $Id: cron.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require('./init.php'); //require('../includes/lib_time.php'); $timestamp = gmtime(); check_method(); $error_log = array(); if (isset($set_modules)) { $set_modules = false; unset($set_modules); } $crondb = get_cron_info(); // 获得需要执行的计划任务数据 foreach ($crondb AS $key => $cron_val) { if (file_exists(ROOT_PATH . 'includes/modules/cron/' . $cron_val['cron_code'] . '.php')) { if (!empty($cron_val['allow_ip'])) // 设置了允许ip { $allow_ip = explode(',', $cron_val['allow_ip']); $server_ip = real_server_ip(); if (!in_array($server_ip, $allow_ip)) { continue; } } if (!empty($cron_val['minute'])) // 设置了允许分钟段 { $m = explode(',', $cron_val['minute']); $m_now = intval(local_date('i',$timestamp)); if (!in_array($m_now, $m)) { continue; } } if (!empty($cron_val['alow_files'])) // 设置允许调用文件 { $f_info = parse_url($_SERVER['HTTP_REFERER']); $f_now = basename($f_info['path']); $f = explode(' ', $cron_val['alow_files']); if (!in_array($f_now, $f)) { continue; } } if (!empty($cron_val['cron_config'])) { foreach ($cron_val['cron_config'] AS $k => $v) { $cron[$v['name']] = $v['value']; } } include_once(ROOT_PATH . 'includes/modules/cron/' . $cron_val['cron_code'] . '.php'); } else { $error_log[] = make_error_arr('includes/modules/cron/' . $cron_val['cron_code'] . '.php not found!',__FILE__); } $close = $cron_val['run_once'] ? 0 : 1; $next_time = get_next_time($cron_val['cron']); $sql = "UPDATE " . $ecs->table('crons') . "SET thistime = '$timestamp', nextime = '$next_time', enable = $close " . "WHERE cron_id = '$cron_val[cron_id]' LIMIT 1"; $db->query($sql); } write_error_arr($error_log); function get_next_time($cron) { $y = local_date('Y', $GLOBALS['timestamp']); $mo = local_date('n', $GLOBALS['timestamp']); $d = local_date('j', $GLOBALS['timestamp']); $w = local_date('w', $GLOBALS['timestamp']); $h = local_date('G', $GLOBALS['timestamp']); $sh = $sm = 0; $sy = $y; if ($cron['day']) { $sd = $cron['day']; $smo = $mo + 1; } else { $sd = $d; $smo = $mo; if ($cron['week'] != '') { $sd += $cron['week'] - $w + 7; } } if ($cron['hour']) { $sh = $cron['hour']; if (empty($cron['day']) && $cron['week']=='') { $sd++; } } //$next = gmmktime($sh,$sm,0,$smo,$sd,$sy); $next = local_strtotime("$sy-$smo-$sd $sh:$sm:0"); if ($next < $GLOBALS['timestamp']) { if ($cron['m']) { return $GLOBALS['timestamp'] + 60 - intval(local_date('s', $GLOBALS['timestamp'])); } else { return $GLOBALS['timestamp']; } } else { return $next; } } function get_cron_info() { $crondb = array(); $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('crons') . " WHERE enable = 1 AND nextime < $GLOBALS[timestamp]"; $query = $GLOBALS['db']->query($sql); while ($rt = $GLOBALS['db']->fetch_array($query)) { $rt['cron'] = array('day'=>$rt['day'],'week'=>$rt['week'],'m'=>$rt['minute'],'hour'=>$rt['hour']); $rt['cron_config'] = unserialize($rt['cron_config']); $rt['minute'] = trim($rt['minute']); $rt['allow_ip'] = trim($rt['allow_ip']); $crondb[] = $rt; } return $crondb; } function make_error_arr($msg,$file) { $file = str_replace(ROOT_PATH, '' ,$file); return array('info' => $msg, 'file' => $file, 'time' => $GLOBALS['timestamp']); } function write_error_arr($err_arr) { if (!empty($err_arr)) { $query = ''; foreach ($err_arr AS $key => $val) { $query .= $query ? ",('$val[info]', '$val[file]', '$val[time]')" : "('$val[info]', '$val[file]', '$val[time]')"; } if ($query) { $sql = "INSERT INTO " . $GLOBALS['ecs']->table('error_log') . "(info, file, time) VALUES " . $query; $GLOBALS['db']->query($sql); } } } function check_method() { if (PHP_VERSION >= '4.2') { $if_cron = PHP_SAPI == 'cli' ? true : false; } else { $if_cron = php_sapi_name() == 'cgi' ? true : false; } if (!empty($GLOBALS['_CFG']['cron_method'])) { if (!$if_cron) { die('Hacking attempt'); } } else { if ($if_cron) { die('Hacking attempt'); } elseif (!isset($_GET['t']) || $GLOBALS['timestamp'] - $_GET['t'] > 60 || empty($_SERVER['HTTP_REFERER'])) { exit; } } } ?>
zzshop
trunk/api/cron.php
PHP
asf20
5,955
<?php /** * UCenter API * =========================================================== * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ========================================================== * $Author: liuhui $ * $Id: uc.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('UC_CLIENT_VERSION', '1.5.0'); //note UCenter 版本标识 define('UC_CLIENT_RELEASE', '20081031'); define('API_DELETEUSER', 1); //note 用户删除 API 接口开关 define('API_RENAMEUSER', 1); //note 用户改名 API 接口开关 define('API_GETTAG', 1); //note 获取标签 API 接口开关 define('API_SYNLOGIN', 1); //note 同步登录 API 接口开关 define('API_SYNLOGOUT', 1); //note 同步登出 API 接口开关 define('API_UPDATEPW', 1); //note 更改用户密码 开关 define('API_UPDATEBADWORDS', 1);//note 更新关键字列表 开关 define('API_UPDATEHOSTS', 1); //note 更新域名解析缓存 开关 define('API_UPDATEAPPS', 1); //note 更新应用列表 开关 define('API_UPDATECLIENT', 1); //note 更新客户端缓存 开关 define('API_UPDATECREDIT', 1); //note 更新用户积分 开关 define('API_GETCREDITSETTINGS', 1); //note 向 UCenter 提供积分设置 开关 define('API_GETCREDIT', 1); //note 获取用户的某项积分 开关 define('API_UPDATECREDITSETTINGS', 1); //note 更新应用积分设置 开关 define('API_RETURN_SUCCEED', '1'); define('API_RETURN_FAILED', '-1'); define('API_RETURN_FORBIDDEN', '-2'); define('IN_ECS', TRUE); require './init.php'; //数据验证 if(!defined('IN_UC')) { error_reporting(0); set_magic_quotes_runtime(0); defined('MAGIC_QUOTES_GPC') || define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc()); $_DCACHE = $get = $post = array(); $code = @$_GET['code']; parse_str(_authcode($code, 'DECODE', UC_KEY), $get); if(MAGIC_QUOTES_GPC) { $get = _stripslashes($get); } $timestamp = time(); if($timestamp - $get['time'] > 3600) { exit('Authracation has expiried'); } if(empty($get)) { exit('Invalid Request'); } } $action = $get['action']; include(ROOT_PATH . 'uc_client/lib/xml.class.php'); $post = xml_unserialize(file_get_contents('php://input')); if(in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings'))) { $uc_note = new uc_note(); exit($uc_note->$get['action']($get, $post)); } else { exit(API_RETURN_FAILED); } $ecs_url = str_replace('/api', '', $ecs->url()); class uc_note { var $db = ''; var $tablepre = ''; var $appdir = ''; function _serialize($arr, $htmlon = 0) { if(!function_exists('xml_serialize')) { include(ROOT_PATH . 'uc_client/lib/xml.class.php'); } return xml_serialize($arr, $htmlon); } function uc_note() { $this->appdir = ROOT_PATH; $this->db = $GLOBALS['db']; } function test($get, $post) { return API_RETURN_SUCCEED; } function deleteuser($get, $post) { $uids = $get['ids']; if(!API_DELETEUSER) { return API_RETURN_FORBIDDEN; } if (delete_user($uids)) { return API_RETURN_SUCCEED; } } function renameuser($get, $post) { $uid = $get['uid']; $usernameold = $get['oldusername']; $usernamenew = $get['newusername']; if(!API_RENAMEUSER) { return API_RETURN_FORBIDDEN; } $this->db->query("UPDATE " . $GLOBALS['ecs']->table("users") . " SET user_name='$usernamenew' WHERE user_id='$uid'"); $this->db->query("UPDATE " . $GLOBALS['ecs']->table("affiliate_log") . " SET user_name='$usernamenew' WHERE user_name='$usernameold'"); $this->db->query("UPDATE " . $GLOBALS['ecs']->table("comment") . " SET user_name='$usernamenew' WHERE user_name='$usernameold'"); $this->db->query("UPDATE " . $GLOBALS['ecs']->table("feedback") . " SET user_name='$usernamenew' WHERE user_name='$usernameold'"); clear_cache_files(); return API_RETURN_SUCCEED; } function gettag($get, $post) { $name = $get['id']; if(!API_GETTAG) { return API_RETURN_FORBIDDEN; } $tags = fetch_tag($name); $return = array($name, $tags); include_once(ROOT_PATH . 'uc_client/client.php'); return uc_serialize($return, 1); } function synlogin($get, $post) { $uid = intval($get['uid']); $username = $get['username']; if(!API_SYNLOGIN) { return API_RETURN_FORBIDDEN; } header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); set_login($uid, $username); } function synlogout($get, $post) { if(!API_SYNLOGOUT) { return API_RETURN_FORBIDDEN; } header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); set_cookie(); set_session(); } function updatepw($get, $post) { if(!API_UPDATEPW) { return API_RETURN_FORBIDDEN; } $username = $get['username']; #$password = md5($get['password']); $newpw = md5(time().rand(100000, 999999)); $this->db->query("UPDATE " . $GLOBALS['ecs']->table('users') . " SET password='$newpw' WHERE user_name='$username'"); return API_RETURN_SUCCEED; } function updatebadwords($get, $post) { if(!API_UPDATEBADWORDS) { return API_RETURN_FORBIDDEN; } $cachefile = $this->appdir.'./uc_client/data/cache/badwords.php'; $fp = fopen($cachefile, 'w'); $data = array(); if(is_array($post)) { foreach($post as $k => $v) { $data['findpattern'][$k] = $v['findpattern']; $data['replace'][$k] = $v['replacement']; } } $s = "<?php\r\n"; $s .= '$_CACHE[\'badwords\'] = '.var_export($data, TRUE).";\r\n"; fwrite($fp, $s); fclose($fp); return API_RETURN_SUCCEED; } function updatehosts($get, $post) { if(!API_UPDATEHOSTS) { return API_RETURN_FORBIDDEN; } $cachefile = $this->appdir . './uc_client/data/cache/hosts.php'; $fp = fopen($cachefile, 'w'); $s = "<?php\r\n"; $s .= '$_CACHE[\'hosts\'] = '.var_export($post, TRUE).";\r\n"; fwrite($fp, $s); fclose($fp); return API_RETURN_SUCCEED; } function updateapps($get, $post) { if(!API_UPDATEAPPS) { return API_RETURN_FORBIDDEN; } $UC_API = $post['UC_API']; $cachefile = $this->appdir . './uc_client/data/cache/apps.php'; $fp = fopen($cachefile, 'w'); $s = "<?php\r\n"; $s .= '$_CACHE[\'apps\'] = '.var_export($post, TRUE).";\r\n"; fwrite($fp, $s); fclose($fp); #clear_cache_files(); return API_RETURN_SUCCEED; } function updateclient($get, $post) { if(!API_UPDATECLIENT) { return API_RETURN_FORBIDDEN; } $cachefile = $this->appdir . './uc_client/data/cache/settings.php'; $fp = fopen($cachefile, 'w'); $s = "<?php\r\n"; $s .= '$_CACHE[\'settings\'] = '.var_export($post, TRUE).";\r\n"; fwrite($fp, $s); fclose($fp); return API_RETURN_SUCCEED; } function updatecredit($get, $post) { if(!API_UPDATECREDIT) { return API_RETURN_FORBIDDEN; } $cfg = unserialize($GLOBALS['_CFG']['integrate_config']); $credit = intval($get['credit']); $amount = intval($get['amount']); $uid = intval($get['uid']); $points = array(0 => 'rank_points', 1 => 'pay_points'); $sql = "UPDATE " . $GLOBALS['ecs']-> table('users') . " SET {$points[$credit]} = {$points[$credit]} + '$amount' WHERE user_id = $uid"; $this->db->query($sql); if ($this->db->affected_rows() <= 0) { return API_RETURN_FAILED; } $sql = "INSERT INTO " . $GLOBALS['ecs']->table('account_log') . "(user_id, {$points[$credit]}, change_time, change_desc, change_type)" . " VALUES ('$uid', '$amount', '". gmtime() ."', '" . $cfg['uc_lang']['exchange'] . "', '99')"; $this->db->query($sql); return API_RETURN_SUCCEED; } function getcredit($get, $post) { if(!API_GETCREDIT) { return API_RETURN_FORBIDDEN; } /*$uid = intval($get['uid']); $credit = intval($get['credit']); return $credit >= 1 && $credit <= 8 ? $this->db->result_first("SELECT extcredits$credit FROM ".$this->tablepre."members WHERE uid='$uid'") : 0;*/ } function getcreditsettings($get, $post) { if(!API_GETCREDITSETTINGS) { return API_RETURN_FORBIDDEN; } $cfg = unserialize($GLOBALS['_CFG']['integrate_config']); $credits = $cfg['uc_lang']['credits']; include_once(ROOT_PATH . 'uc_client/client.php'); return uc_serialize($credits); } function updatecreditsettings($get, $post) { if(!API_UPDATECREDITSETTINGS) { return API_RETURN_FORBIDDEN; } $outextcredits = array(); foreach($get['credit'] as $appid => $credititems) { if($appid == UC_APPID) { foreach($credititems as $value) { $outextcredits[] = array ( 'appiddesc' => $value['appiddesc'], 'creditdesc' => $value['creditdesc'], 'creditsrc' => $value['creditsrc'], 'title' => $value['title'], 'unit' => $value['unit'], 'ratio' => $value['ratio'] ); } } } $this->db->query("UPDATE " . $GLOBALS['ecs']->table("shop_config") . " SET value='".serialize($outextcredits)."' WHERE code='points_rule'"); return API_RETURN_SUCCEED; } } /** * 删除用户接口函数 * * @access public * @param int $uids * @return void */ function delete_user($uids = '') { if (empty($uids)) { return; } else { $uids = stripslashes($uids); $sql = "DELETE FROM " . $GLOBALS['ecs']->table('users') . " WHERE user_id IN ($uids)"; $result = $GLOBALS['db']->query($sql); return true; } } /** * 设置用户登陆 * * @access public * @param int $uid * @return void */ function set_login($user_id = '', $user_name = '') { if (empty($user_id)) { return ; } else { $sql = "SELECT user_name, email FROM " . $GLOBALS['ecs']->table('users') . " WHERE user_id='$user_id' LIMIT 1"; $row = $GLOBALS['db']->getRow($sql); if ($row) { set_cookie($user_id, $row['user_name'], $row['email']); set_session($user_id, $row['user_name'], $row['email']); include_once(ROOT_PATH . 'includes/lib_main.php'); update_user_info(); } else { include_once(ROOT_PATH . 'uc_client/client.php'); if($data = uc_get_user($user_name)) { list($uid, $uname, $email) = $data; $sql = "REPLACE INTO " . $GLOBALS['ecs']->table('users') ."(user_id, user_name, email) VALUES('$uid', '$uname', '$email')"; $GLOBALS['db']->query($sql); set_login($uid); } else { return false; } } } } /** * 设置cookie * * @access public * @param * @return void */ function set_cookie($user_id='', $user_name = '', $email = '') { if (empty($user_id)) { /* 摧毁cookie */ $time = time() - 3600; setcookie('ECS[user_id]', '', $time); setcookie('ECS[username]', '', $time); setcookie('ECS[email]', '', $time); } else { /* 设置cookie */ $time = time() + 3600 * 24 * 30; setcookie("ECS[user_id]", $user_id, $time, $GLOBALS['cookie_path'], $GLOBALS['cookie_domain']); setcookie("ECS[username]", $user_name, $time, $GLOBALS['cookie_path'], $GLOBALS['cookie_domain']); setcookie("ECS[email]", $email, $time, $GLOBALS['cookie_path'], $GLOBALS['cookie_domain']); } } /** * 设置指定用户SESSION * * @access public * @param * @return void */ function set_session ($user_id = '', $user_name = '', $email = '') { if (empty($user_id)) { $GLOBALS['sess']->destroy_session(); } else { $_SESSION['user_id'] = $user_id; $_SESSION['user_name'] = $user_name; $_SESSION['email'] = $email; } } /** * 获取EC的TAG数据 * * @access public * @param string $tagname * @param int $num 获取的数量 默认取最新的100条 * @return array */ function fetch_tag($tagname, $num=100) { $rewrite = intval($GLOBALS['_CFG']['rewrite']) > 0; $sql = "SELECT t.*, u.user_name, g.goods_name, g.goods_img, g.shop_price FROM " . $GLOBALS['ecs']->table('tag') . " as t, " . $GLOBALS['ecs']->table('users') ." as u, " . $GLOBALS['ecs']->table('goods') ." as g WHERE tag_words = '$tagname' AND t.user_id = u.user_id AND g.goods_id = t.goods_id ORDER BY t.tag_id DESC LIMIT " . $num; $arr = $GLOBALS['db']->getAll($sql); $tag_list = array(); foreach ($arr as $k=>$v) { $tag_list[$k]['goods_name'] = $v['goods_name']; $tag_list[$k]['uid'] = $v['user_id']; $tag_list[$k]['username'] = $v['user_name']; $tag_list[$k]['dateline'] = time(); $tag_list[$k]['url'] = $GLOBALS['ecs_url'] . 'goods.php?id=' . $v['goods_id']; $tag_list[$k]['image'] = $GLOBALS['ecs_url'] . $v['goods_img']; $tag_list[$k]['goods_price'] = $v['shop_price']; } return $tag_list; } /** * uc自带函数1 * * @access public * @param string $string * * @return string $string */ function _setcookie($var, $value, $life = 0, $prefix = 1) { global $cookiepre, $cookiedomain, $cookiepath, $timestamp, $_SERVER; setcookie(($prefix ? $cookiepre : '').$var, $value, $life ? $timestamp + $life : 0, $cookiepath, $cookiedomain, $_SERVER['SERVER_PORT'] == 443 ? 1 : 0); } /** * uc自带函数2 * * @access public * * @return string $string */ function _authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { $ckey_length = 4; $key = md5($key ? $key : UC_KEY); $keya = md5(substr($key, 0, 16)); $keyb = md5(substr($key, 16, 16)); $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : ''; $cryptkey = $keya.md5($keya.$keyc); $key_length = strlen($cryptkey); $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string; $string_length = strlen($string); $result = ''; $box = range(0, 255); $rndkey = array(); for($i = 0; $i <= 255; $i++) { $rndkey[$i] = ord($cryptkey[$i % $key_length]); } for($j = $i = 0; $i < 256; $i++) { $j = ($j + $box[$i] + $rndkey[$i]) % 256; $tmp = $box[$i]; $box[$i] = $box[$j]; $box[$j] = $tmp; } for($a = $j = $i = 0; $i < $string_length; $i++) { $a = ($a + 1) % 256; $j = ($j + $box[$a]) % 256; $tmp = $box[$a]; $box[$a] = $box[$j]; $box[$j] = $tmp; $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256])); } if($operation == 'DECODE') { if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) { return substr($result, 26); } else { return ''; } } else { return $keyc.str_replace('=', '', base64_encode($result)); } } /** * uc自带函数3 * * @access public * @param string $string * * @return string $string */ function _stripslashes($string) { if(is_array($string)) { foreach($string as $key => $val) { $string[$key] = _stripslashes($val); } } else { $string = stripslashes($string); } return $string; } ?>
zzshop
trunk/api/uc.php
PHP
asf20
17,886
<?php /** * ECSHOP 检查订单 API * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: checkorder.php 17200 2010-10-14 03:02:27Z liuhui $ */ define('IN_ECS', true); require('./init.php'); require_once(ROOT_PATH . 'includes/lib_order.php'); require_once('../includes/cls_json.php'); $json = new JSON; $res = array('error' => 0, 'new_orders' => 0, 'new_paid' => 0); $_REQUEST['username'] = urlencode(serialize(json_str_iconv($_REQUEST['username']))); /* 检查密码是否正确 */ $sql = "SELECT COUNT(*) ". " FROM " . $ecs->table('admin_user') . " WHERE user_name = '" . trim($_REQUEST['username']). "' AND password = '" . md5(trim($_REQUEST['password'])) . "'"; if ($db->getOne($sql)) { /* 新订单 */ $sql = 'SELECT COUNT(*) FROM ' . $ecs->table('order_info'). " WHERE order_status = " . OS_UNCONFIRMED; $res['new_orders'] = $db->getOne($sql); /* 待发货的订单: */ $sql = 'SELECT COUNT(*)'. ' FROM ' .$ecs->table('order_info') . " WHERE 1 ". order_query_sql('await_ship'); $res['new_paid'] = $db->getOne($sql); } else { $res['error'] = 1; } $val = $json->encode($res); die($val); ?>
zzshop
trunk/api/checkorder.php
PHP
asf20
1,786
<?php /** * ECSHOP 地区切换程序 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: region.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); define('INIT_NO_USERS', true); define('INIT_NO_SMARTY', true); require(dirname(__FILE__) . '/includes/init.php'); require(ROOT_PATH . 'includes/cls_json.php'); header('Content-type: text/html; charset=' . EC_CHARSET); $type = !empty($_REQUEST['type']) ? intval($_REQUEST['type']) : 0; $parent = !empty($_REQUEST['parent']) ? intval($_REQUEST['parent']) : 0; $arr['regions'] = get_regions($type, $parent); $arr['type'] = $type; $arr['target'] = !empty($_REQUEST['target']) ? stripslashes(trim($_REQUEST['target'])) : ''; $arr['target'] = htmlspecialchars($arr['target']); $json = new JSON; echo $json->encode($arr); ?>
zzshop
trunk/region.php
PHP
asf20
1,373
<?php /** * ECSHOP 商品相册 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: gallery.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); /* 参数 */ $_REQUEST['id'] = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; // 商品编号 $_REQUEST['img'] = isset($_REQUEST['img']) ? intval($_REQUEST['img']) : 0; // 图片编号 /* 获得商品名称 */ $sql = 'SELECT goods_name FROM ' . $ecs->table('goods') . "WHERE goods_id = '$_REQUEST[id]'"; $goods_name = $db->getOne($sql); /* 如果该商品不存在,返回首页 */ if ($goods_name === false) { ecs_header("Location: ./\n"); exit; } /* 获得所有的图片 */ $sql = 'SELECT img_id, img_desc, thumb_url, img_url'. ' FROM ' .$ecs->table('goods_gallery'). " WHERE goods_id = '$_REQUEST[id]' ORDER BY img_id"; $img_list = $db->getAll($sql); $img_count = count($img_list); $gallery = array('goods_name' => htmlspecialchars($goods_name, ENT_QUOTES), 'list' => array()); if ($img_count == 0) { /* 如果没有图片,返回商品详情页 */ ecs_header('Location: goods.php?id=' . $_REQUEST['id'] . "\n"); exit; } else { foreach ($img_list AS $key => $img) { $gallery['list'][] = array( 'gallery_thumb' => get_image_path($_REQUEST['id'], $img_list[$key]['thumb_url'], true, 'gallery'), 'gallery' => get_image_path($_REQUEST['id'], $img_list[$key]['img_url'], false, 'gallery'), 'img_desc' => $img_list[$key]['img_desc'] ); } } $smarty->assign('shop_name', $_CFG['shop_name']); $smarty->assign('watermark', str_replace('../', './', $_CFG['watermark'])); $smarty->assign('gallery', $gallery); $smarty->display('gallery.dwt'); ?>
zzshop
trunk/gallery.php
PHP
asf20
2,376
{literal} <style type="text/css"> body,td { font-size:13px; } </style> {/literal} <h1 align="center">{$lang.order_info}</h1> <table width="100%" cellpadding="1"> <tr> <td width="8%">{$lang.print_buy_name}</td> <td>{if $order.user_name}{$order.user_name}{else}{$lang.anonymous}{/if}<!-- 购货人姓名 --></td> <td align="right">{$lang.label_order_time}</td><td>{$order.order_time}<!-- 下订单时间 --></td> <td align="right">{$lang.label_payment}</td><td>{$order.pay_name}<!-- 支付方式 --></td> <td align="right">{$lang.print_order_sn}</td><td>{$order.order_sn}<!-- 订单号 --></td> </tr> <tr> <td>{$lang.label_pay_time}</td><td>{$order.pay_time}</td><!-- 付款时间 --> <td align="right">{$lang.label_shipping_time}</td><td>{$order.shipping_time}<!-- 发货时间 --></td> <td align="right">{$lang.label_shipping}</td><td>{$order.shipping_name}<!-- 配送方式 --></td> <td align="right">{$lang.label_invoice_no}</td><td>{$order.invoice_no} <!-- 发货单号 --></td> </tr> <tr> <td>{$lang.label_consignee_address}</td> <td colspan="7"> [{$order.region}]&nbsp;{$order.address}&nbsp;<!-- 收货人地址 --> {$lang.label_consignee}{$order.consignee}&nbsp;<!-- 收货人姓名 --> {if $order.zipcode}{$lang.label_zipcode}{$order.zipcode}&nbsp;{/if}<!-- 邮政编码 --> {if $order.tel}{$lang.label_tel}{$order.tel}&nbsp; {/if}<!-- 联系电话 --> {if $order.mobile}{$lang.label_mobile}{$order.mobile}{/if}<!-- 手机号码 --> </td> </tr> </table> <table width="100%" border="1" style="border-collapse:collapse;border-color:#000;"> <tr align="center"> <td bgcolor="#cccccc">{$lang.goods_name} <!-- 商品名称 --></td> <td bgcolor="#cccccc">{$lang.goods_sn} <!-- 商品货号 --></td> <td bgcolor="#cccccc">{$lang.goods_attr} <!-- 商品属性 --></td> <td bgcolor="#cccccc">{$lang.goods_price} <!-- 商品单价 --></td> <td bgcolor="#cccccc">{$lang.goods_number}<!-- 商品数量 --></td> <td bgcolor="#cccccc">{$lang.subtotal} <!-- 价格小计 --></td> </tr> <!-- {foreach from=$goods_list item=goods key=key} --> <tr> <td>&nbsp;{$goods.goods_name}<!-- 商品名称 --> {if $goods.is_gift}{if $goods.goods_price gt 0}{$lang.remark_favourable}{else}{$lang.remark_gift}{/if}{/if} {if $goods.parent_id gt 0}{$lang.remark_fittings}{/if} </td> <td>&nbsp;{$goods.goods_sn} <!-- 商品货号 --></td> <td><!-- 商品属性 --> <!-- {foreach key=key from=$goods_attr[$key] item=attr} --> <!-- {if $attr.name} --> {$attr.name}:{$attr.value} <!-- {/if} --> <!-- {/foreach} --> </td> <td align="right">{$goods.formated_goods_price}&nbsp;<!-- 商品单价 --></td> <td align="right">{$goods.goods_number}&nbsp;<!-- 商品数量 --></td> <td align="right">{$goods.formated_subtotal}&nbsp;<!-- 商品金额小计 --></td> </tr> <!-- {/foreach} --> <tr> <!-- 发票抬头和发票内容 --> <td colspan="4"> {if $order.inv_payee} {$lang.label_inv_payee}{$order.inv_payee}&nbsp;&nbsp;&nbsp; {$lang.label_inv_content}{$order.inv_content} {/if} </td> <!-- 商品总金额 --> <td colspan="2" align="right">{$lang.label_goods_amount}{$order.formated_goods_amount}</td> </tr> </table> <table width="100%" border="0"> <tr align="right"> <td>{if $order.discount gt 0}- {$lang.label_discount}{$order.formated_discount}{/if}{if $order.pack_name and $order.pack_fee neq '0.00'} <!-- 包装名称包装费用 --> + {$lang.label_pack_fee}{$order.formated_pack_fee} {/if} {if $order.card_name and $order.card_fee neq '0.00'}<!-- 贺卡名称以及贺卡费用 --> + {$lang.label_card_fee}{$order.formated_card_fee} {/if} {if $order.pay_fee neq '0.00'}<!-- 支付手续费 --> + {$lang.label_pay_fee}{$order.formated_pay_fee} {/if} {if $order.shipping_fee neq '0.00'}<!-- 配送费用 --> + {$lang.label_shipping_fee}{$order.formated_shipping_fee} {/if} {if $order.insure_fee neq '0.00'}<!-- 保价费用 --> + {$lang.label_insure_fee}{$order.formated_insure_fee} {/if} <!-- 订单总金额 --> = {$lang.label_order_amount}{$order.formated_total_fee} </td> </tr> <tr align="right"> <td> <!-- 如果已付了部分款项, 减去已付款金额 --> {if $order.money_paid neq '0.00'}- {$lang.label_money_paid}{$order.formated_money_paid}{/if} <!-- 如果使用了余额支付, 减去已使用的余额 --> {if $order.surplus neq '0.00'}- {$lang.label_surplus}{$order.formated_surplus}{/if} <!-- 如果使用了积分支付, 减去已使用的积分 --> {if $order.integral_money neq '0.00'}- {$lang.label_integral}{$order.formated_integral_money}{/if} <!-- 如果使用了红包支付, 减去已使用的红包 --> {if $order.bonus neq '0.00'}- {$lang.label_bonus}{$order.formated_bonus}{/if} <!-- 应付款金额 --> = {$lang.label_money_dues}{$order.formated_order_amount} </td> </tr> </table> <table width="100%" border="0"> {if $order.to_buyer} <tr><!-- 给购货人看的备注信息 --> <td>{$lang.label_to_buyer}{$order.to_buyer}</td> </tr> {/if} {if $order.invoice_note} <tr> <!-- 发货备注 --> <td>{$lang.label_invoice_note} {$order.invoice_note}</td> </tr> {/if} {if $order.pay_note} <tr> <!-- 支付备注 --> <td>{$lang.pay_note} {$order.pay_note}</td> </tr> {/if} <tr><!-- 网店名称, 网店地址, 网店URL以及联系电话 --> <td> {$shop_name}({$shop_url}) {$lang.label_shop_address}{$shop_address}&nbsp;&nbsp;{$lang.label_service_phone}{$service_phone} </td> </tr> <tr align="right"><!-- 订单操作员以及订单打印的日期 --> <td>{$lang.label_print_time}{$print_time}&nbsp;&nbsp;&nbsp;{$lang.action_user}{$action_user}</td> </tr> </table>
zzshop
trunk/data/order_print.html
HTML
asf20
6,417
<table width="100%" border="0" cellspacing="0" cellpadding="0"> {foreach from=$goods_list item=goods_item} <tr> {foreach from=$goods_item item=goods} <td><table width="100%"> {if $need_image} <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><img src="{$url}{$goods.goods_thumb}" alt="{$goods.goods_name}" border="0" {if $thumb_width and $thumb_height}width="{$thumb_width}" height="{$thumb_height}"{/if}></a></td> </tr> {/if} <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank">{$goods.goods_name}</a><br />{$goods.goods_price}</td> </tr> </table></td> {/foreach} </tr> {/foreach} </table>
zzshop
trunk/data/goods_script.html
HTML
asf20
748
/* Flash Name: Default Description: The default flash cycle. */ // 0xffffff:文字颜色|1:文字位置|0x0066ff:文字背景颜色|60:文字背景透明度|0xffffff:按键文字颜色|0x0066ff:按键默认颜色|0x000033:按键当前颜色|8:自动播放时间(秒)|2:图片过渡效果|1:是否显示按钮|_blank:打开窗口 var swf_config = "|2|||0xFFFFFF|0xFF6600||4|3|1|_blank" document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">'); document.write('<param name="movie" value="data/flashdata/default/bcastr.swf?bcastr_xml_url=data/flashdata/default/data.xml"><param name="quality" value="high">'); document.write('<param name="menu" value="false"><param name=wmode value="opaque">'); document.write('<param name="FlashVars" value="bcastr_config='+swf_config+'">'); document.write('<embed src="data/flashdata/default/bcastr.swf?bcastr_xml_url=data/flashdata/default/data.xml" wmode="opaque" FlashVars="bcastr_config='+swf_config+'" menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"/>'); document.write('</object>');
zzshop
trunk/data/flashdata/default/cycle_image.js
JavaScript
asf20
1,363
/* Flash Name: Red Focus Description: 红色聚焦Flash图片轮播 */ document.write('<div id="flash_cycle_image"></div>'); $importjs = (function() { var uid = 0; var curr = 0; var remove = function(id) { var head = document.getElementsByTagName('head')[0]; head.removeChild( document.getElementById('jsInclude_'+id) ); }; return function(file,callback) { var callback; var id = ++uid; var head = document.getElementsByTagName('head')[0]; var js = document.createElement('script'); js.setAttribute('type','text/javascript'); js.setAttribute('src',file); js.setAttribute('id','jsInclude_'+id); if( document.all ) { js.onreadystatechange = function() { if(/(complete|loaded)/.test(this.readyState)) { try { callback(id);remove(id); } catch(e) { setTimeout(function(){remove(id);include_js(file,callback)},2000); } } }; } else { js.onload = function(){callback(id); remove(id); }; } head.appendChild(js); return uid; }; } )(); function show_flash() { var text_height = 0; var focus_width = swf_width; var focus_height = swf_height - text_height; var total_height = focus_height + text_height; document.getElementById('flash_cycle_image').innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ total_height +'">'+'<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="data/flashdata/redfocus/redfocus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">'+'<param name="menu" value="false"><param name=wmode value="opaque">'+'<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">'+'<embed src="data/flashdata/redfocus/redfocus.swf" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" quality="high" width="'+ focus_width +'" height="'+ total_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"/>'+'</object>'; } $importjs('data/flashdata/redfocus/data.js', show_flash);
zzshop
trunk/data/flashdata/redfocus/cycle_image.js
JavaScript
asf20
2,791
imgUrl1="data/afficheimg/20081027angsif.jpg"; imgtext1="ECShop"; imgLink1=escape("http://www.ecshop.com"); imgUrl2="data/afficheimg/20081027xuorxj.jpg"; imgtext2="maifou"; imgLink2=escape("http://www.maifou.net"); imgUrl3="data/afficheimg/20081027wdwd.jpg"; imgtext3="ECShop"; imgLink3=escape("http://www.wdwd.com"); var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3; var links=imgLink1+"|"+imgLink2+"|"+imgLink3; var texts=imgtext1+"|"+imgtext2+"|"+imgtext3;
zzshop
trunk/data/flashdata/redfocus/data.js
JavaScript
asf20
451
/* Flash Name: Pink Focus Description: 粉红聚焦Flash图片轮播 */ document.write('<div id="flash_cycle_image"></div>'); $importjs = (function() { var uid = 0; var curr = 0; var remove = function(id) { var head = document.getElementsByTagName('head')[0]; head.removeChild( document.getElementById('jsInclude_'+id) ); }; return function(file,callback) { var callback; var id = ++uid; var head = document.getElementsByTagName('head')[0]; var js = document.createElement('script'); js.setAttribute('type','text/javascript'); js.setAttribute('src',file); js.setAttribute('id','jsInclude_'+id); if( document.all ) { js.onreadystatechange = function() { if(/(complete|loaded)/.test(this.readyState)) { try { callback(id);remove(id); } catch(e) { setTimeout(function(){remove(id);include_js(file,callback)},2000); } } }; } else { js.onload = function(){callback(id); remove(id); }; } head.appendChild(js); return uid; }; } )(); function show_flash() { var text_height = 0; var focus_width = swf_width; var focus_height = swf_height - text_height; var total_height = focus_height + text_height; document.getElementById('flash_cycle_image').innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ total_height +'">'+'<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="data/flashdata/pinkfocus/pinkfocus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">'+'<param name="menu" value="false"><param name=wmode value="opaque">'+'<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">'+'<embed src="data/flashdata/pinkfocus/pinkfocus.swf" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" quality="high" width="'+ focus_width +'" height="'+ total_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"/>'+'</object>'; } $importjs('data/flashdata/pinkfocus/data.js', show_flash);
zzshop
trunk/data/flashdata/pinkfocus/cycle_image.js
JavaScript
asf20
2,797
imgUrl1="data/afficheimg/20081027angsif.jpg"; imgtext1="ECShop"; imgLink1=escape("http://www.ecshop.com"); imgUrl2="data/afficheimg/20081027xuorxj.jpg"; imgtext2="maifou"; imgLink2=escape("http://www.maifou.net"); imgUrl3="data/afficheimg/20081027wdwd.jpg"; imgtext3="ECShop"; imgLink3=escape("http://www.wdwd.com"); var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3; var links=imgLink1+"|"+imgLink2+"|"+imgLink3; var texts=imgtext1+"|"+imgtext2+"|"+imgtext3;
zzshop
trunk/data/flashdata/pinkfocus/data.js
JavaScript
asf20
451
/* Flash Name: Dynamic Focus Description: 动感聚焦Flash图片轮播 */ document.write('<div id="flash_cycle_image"></div>'); $importjs = (function() { var uid = 0; var curr = 0; var remove = function(id) { var head = document.getElementsByTagName('head')[0]; head.removeChild( document.getElementById('jsInclude_'+id) ); }; return function(file,callback) { var callback; var id = ++uid; var head = document.getElementsByTagName('head')[0]; var js = document.createElement('script'); js.setAttribute('type','text/javascript'); js.setAttribute('src',file); js.setAttribute('id','jsInclude_'+id); if( document.all ) { js.onreadystatechange = function() { if(/(complete|loaded)/.test(this.readyState)) { try { callback(id);remove(id); } catch(e) { setTimeout(function(){remove(id);include_js(file,callback)},2000); } } }; } else { js.onload = function(){callback(id); remove(id); }; } head.appendChild(js); return uid; }; } )(); function show_flash() { var button_pos=4; //按扭位置 1左 2右 3上 4下 var stop_time=3000; //图片停留时间(1000为1秒钟) var show_text=1; //是否显示文字标签 1显示 0不显示 var txtcolor="000000"; //文字色 var bgcolor="DDDDDD"; //背景色 var text_height = 18; var focus_width = swf_width; var focus_height = swf_height - text_height; var total_height = focus_height + text_height; document.getElementById('flash_cycle_image').innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabversion=6,0,0,0" width="'+ focus_width +'" height="'+ total_height +'">'+'<param name="movie" value="data/flashdata/dynfocus/dynfocus.swf">'+'<param name="quality" value="high"><param name="wmode" value="opaque">'+'<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+focus_width+'&pic_height='+total_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'">'+'<embed src="data/flashdata/dynfocus/dynfocus.swf" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+focus_width+'&pic_height='+total_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'" quality="high" width="'+ focus_width +'" height="'+ total_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"/>'+'</object>'; } $importjs('data/flashdata/dynfocus/data.js', show_flash);
zzshop
trunk/data/flashdata/dynfocus/cycle_image.js
JavaScript
asf20
3,114
imgUrl1="data/afficheimg/20081027angsif.jpg"; imgtext1="ECShop"; imgLink1=escape("http://www.ecshop.com"); imgUrl2="data/afficheimg/20081027xuorxj.jpg"; imgtext2="maifou"; imgLink2=escape("http://www.maifou.net"); imgUrl3="data/afficheimg/20081027wdwd.jpg"; imgtext3="ECShop"; imgLink3=escape("http://www.wdwd.com"); var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3; var links=imgLink1+"|"+imgLink2+"|"+imgLink3; var texts=imgtext1+"|"+imgtext2+"|"+imgtext3;
zzshop
trunk/data/flashdata/dynfocus/data.js
JavaScript
asf20
451
<!-- {if $type eq 1} --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%"> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><img src="{$goods.goods_thumb}" alt="{$goods.goods_name}" border="0"></a></td> </tr> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><big>{$goods.goods_name}</big></a><br /><font color="#FF0000">{$goods.shop_price}</font></td> </tr> </table></td> </tr> </table> <!-- {elseif $type eq 2} --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%"> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><img src="{$goods.goods_thumb}" alt="{$goods.goods_name}" border="0"></a></td> </tr> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><big>{$goods.goods_name}</big></a><br /><s>{$goods.market_price}</s> <font color = "#FF0000">{$goods.shop_price}</font></td> </tr> </table></td> </tr> </table> <!-- {elseif $type eq 3} --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%"> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><img src="{$goods.goods_img}" alt="{$goods.goods_name}" border="0"></a></td> </tr> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><big>{$goods.goods_name}</big></a><br /><font color = "#FF0000">{$goods.shop_price}</font></td> </tr> </table></td> </tr> </table> <!-- {elseif $type eq 4} --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%"> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><img src="{$goods.goods_img}" alt="{$goods.goods_name}" border="0"></a></td> </tr> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><big>{$goods.goods_name}</big></a><br /><s>{$goods.market_price}</s> <font color = "#FF0000">{$goods.shop_price}</font></td> </tr> </table></td> </tr> </table> <!-- {elseif $type eq 5} --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><big>{$goods.goods_name}</big></a><br /><s>{$goods.market_price}</s> <font color = "#FF0000">{$goods.shop_price}</font></td> </tr> </table> <!-- {elseif $type eq 6} --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><a href="{$goods_url}{$goods.goods_id}" target="_blank"><img src="{$goods.goods_img}" alt="{$goods.goods_name}" border="0"></a></td> </tr> </table> <!-- {/if} -->
zzshop
trunk/data/affiliate.html
HTML
asf20
2,942
<?php // database host $db_host = "localhost:3306"; // database name $db_name = "zshop"; // database username $db_user = "root"; // database password $db_pass = "root"; // table prefix $prefix = "ecs_"; $timezone = "Europe/Berlin"; $cookie_path = "/"; $cookie_domain = ""; $session = "1440"; define('EC_CHARSET','utf-8'); define('ADMIN_PATH','admin'); define('AUTH_KEY', 'this is a key'); define('OLD_AUTH_KEY', ''); define('API_TIME', '2011-03-10 13:36:40'); ?>
zzshop
trunk/data/config.php
PHP
asf20
496
<html> <head> <title>{$lang.quotation} - {$shop_name}</title> {literal} <style type="text/css" media="all"> body,td,th {text-align:left;font-size:13px; padding:2px;} table{border-top:1px solid #000;border-left:1px solid #000;} table td,table th{border-right:1px solid #000;border-bottom:1px solid #000;} </style> <style type="text/css" media="print"> .print_btn{display:none;} </style> {/literal} </head> <body> <script type="text/javascript"> //<![CDATA[ function calc_price(base_price, rank_price) { document.write((base_price * rank_price / 100).toFixed(2)); } //]]> </script> <h3 align="center">{$shop_name} - {$lang.quotation}</h3> <table width="100%" cellspacing="0" cellpadding="0"> <tr> <th>{$lang.goods_name}</th> <th>{$lang.goods_category}</th> <!--{if $cfg.use_storage and $cfg.show_goodsnumber}--> <th>{$lang.goods_inventory}</th> <!-- {/if} --> <th>{$lang.price}</th> <!--{foreach from=$extend_price item=ext_price}--> <th>{$ext_price}</th> <!--{/foreach}--> </tr> <!--{foreach from=$goods_list item=goods}--> <tr> <td>{$goods.goods_name}</td> <td>{$goods.goods_category}</td> <!--{if $cfg.use_storage and $cfg.show_goodsnumber}--> <td>{$goods.goods_number}</td> <!-- {/if} --> <td>{$goods.shop_price}</td> <!--{foreach from=$extend_rank[$goods.goods_id] item=ext_rank}--> <td>{$ext_rank.price}</td> <!--{/foreach}--> </tr> <!--{/foreach}--> </table> <center><input type="button" class="print_btn" value="{$lang.print_quotation}" onClick="window.print()" /></center> </body> </html>
zzshop
trunk/data/quotation_print.html
HTML
asf20
1,776
<?php /** * ECSHOP 列出所有分类及品牌 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liuhui $ * $Id: catalog.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); if ((DEBUG_MODE & 2) != 2) { $smarty->caching = true; } if (!$smarty->is_cached('catalog.dwt')) { /* 取出所有分类 */ $cat_list = cat_list(0, 0, false); foreach ($cat_list AS $key=>$val) { if ($val['is_show'] == 0) { unset($cat_list[$key]); } } assign_template(); assign_dynamic('catalog'); $position = assign_ur_here(0, $_LANG['catalog']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('cat_list', $cat_list); // 分类列表 $smarty->assign('brand_list', get_brands()); // 所以品牌赋值 $smarty->assign('promotion_info', get_promotion_info()); } $smarty->display('catalog.dwt'); /** * 计算指定分类的商品数量 * * @access public * @param integer $cat_id * * @return void */ function calculate_goods_num($cat_list, $cat_id) { $goods_num = 0; foreach ($cat_list AS $cat) { if ($cat['parent_id'] == $cat_id && !empty($cat['goods_num'])) { $goods_num += $cat['goods_num']; } } return $goods_num; } ?>
zzshop
trunk/catalog.php
PHP
asf20
2,117
<?php /** * ECSHOP 团购商品前台文件 * ============================================================================ * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: sxc_shop $ * $Id: group_buy.php 17167 2010-05-28 06:10:40Z sxc_shop $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); if ((DEBUG_MODE & 2) != 2) { $smarty->caching = true; } /*------------------------------------------------------ */ //-- act 操作项的初始化 /*------------------------------------------------------ */ if (empty($_REQUEST['act'])) { $_REQUEST['act'] = 'list'; } /*------------------------------------------------------ */ //-- 团购商品 --> 团购活动商品列表 /*------------------------------------------------------ */ if ($_REQUEST['act'] == 'list') { /* 取得团购活动总数 */ $count = group_buy_count(); if ($count > 0) { /* 取得每页记录数 */ $size = isset($_CFG['page_size']) && intval($_CFG['page_size']) > 0 ? intval($_CFG['page_size']) : 10; /* 计算总页数 */ $page_count = ceil($count / $size); /* 取得当前页 */ $page = isset($_REQUEST['page']) && intval($_REQUEST['page']) > 0 ? intval($_REQUEST['page']) : 1; $page = $page > $page_count ? $page_count : $page; /* 缓存id:语言 - 每页记录数 - 当前页 */ $cache_id = $_CFG['lang'] . '-' . $size . '-' . $page; $cache_id = sprintf('%X', crc32($cache_id)); } else { /* 缓存id:语言 */ $cache_id = $_CFG['lang']; $cache_id = sprintf('%X', crc32($cache_id)); } /* 如果没有缓存,生成缓存 */ if (!$smarty->is_cached('group_buy_list.dwt', $cache_id)) { if ($count > 0) { /* 取得当前页的团购活动 */ $gb_list = group_buy_list($size, $page); $smarty->assign('gb_list', $gb_list); /* 设置分页链接 */ $pager = get_pager('group_buy.php', array('act' => 'list'), $count, $page, $size); $smarty->assign('pager', $pager); } /* 模板赋值 */ $smarty->assign('cfg', $_CFG); assign_template(); $position = assign_ur_here(); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('promotion_info', get_promotion_info()); $smarty->assign('feed_url', ($_CFG['rewrite'] == 1) ? "feed-typegroup_buy.xml" : 'feed.php?type=group_buy'); // RSS URL assign_dynamic('group_buy_list'); } /* 显示模板 */ $smarty->display('group_buy_list.dwt', $cache_id); } /*------------------------------------------------------ */ //-- 团购商品 --> 商品详情 /*------------------------------------------------------ */ elseif ($_REQUEST['act'] == 'view') { /* 取得参数:团购活动id */ $group_buy_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; if ($group_buy_id <= 0) { ecs_header("Location: ./\n"); exit; } /* 取得团购活动信息 */ $group_buy = group_buy_info($group_buy_id); if (empty($group_buy)) { ecs_header("Location: ./\n"); exit; } // elseif ($group_buy['is_on_sale'] == 0 || $group_buy['is_alone_sale'] == 0) // { // header("Location: ./\n"); // exit; // } /* 缓存id:语言,团购活动id,状态,(如果是进行中)当前数量和是否登录 */ $cache_id = $_CFG['lang'] . '-' . $group_buy_id . '-' . $group_buy['status']; if ($group_buy['status'] == GBS_UNDER_WAY) { $cache_id = $cache_id . '-' . $group_buy['valid_goods'] . '-' . intval($_SESSION['user_id'] > 0); } $cache_id = sprintf('%X', crc32($cache_id)); /* 如果没有缓存,生成缓存 */ if (!$smarty->is_cached('group_buy_goods.dwt', $cache_id)) { $group_buy['gmt_end_date'] = $group_buy['end_date']; $smarty->assign('group_buy', $group_buy); /* 取得团购商品信息 */ $goods_id = $group_buy['goods_id']; $goods = goods_info($goods_id); if (empty($goods)) { ecs_header("Location: ./\n"); exit; } $goods['url'] = build_uri('goods', array('gid' => $goods_id), $goods['goods_name']); $smarty->assign('gb_goods', $goods); /* 取得商品的规格 */ $properties = get_goods_properties($goods_id); $smarty->assign('specification', $properties['spe']); // 商品规格 //模板赋值 $smarty->assign('cfg', $_CFG); assign_template(); $position = assign_ur_here(0, $goods['goods_name']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('promotion_info', get_promotion_info()); assign_dynamic('group_buy_goods'); } //更新商品点击次数 $sql = 'UPDATE ' . $ecs->table('goods') . ' SET click_count = click_count + 1 '. "WHERE goods_id = '" . $group_buy['goods_id'] . "'"; $db->query($sql); $smarty->assign('now_time', gmtime()); // 当前系统时间 $smarty->display('group_buy_goods.dwt', $cache_id); } /*------------------------------------------------------ */ //-- 团购商品 --> 购买 /*------------------------------------------------------ */ elseif ($_REQUEST['act'] == 'buy') { /* 查询:判断是否登录 */ if ($_SESSION['user_id'] <= 0) { show_message($_LANG['gb_error_login'], '', '', 'error'); } /* 查询:取得参数:团购活动id */ $group_buy_id = isset($_POST['group_buy_id']) ? intval($_POST['group_buy_id']) : 0; if ($group_buy_id <= 0) { ecs_header("Location: ./\n"); exit; } /* 查询:取得数量 */ $number = isset($_POST['number']) ? intval($_POST['number']) : 1; $number = $number < 1 ? 1 : $number; /* 查询:取得团购活动信息 */ $group_buy = group_buy_info($group_buy_id, $number); if (empty($group_buy)) { ecs_header("Location: ./\n"); exit; } /* 查询:检查团购活动是否是进行中 */ if ($group_buy['status'] != GBS_UNDER_WAY) { show_message($_LANG['gb_error_status'], '', '', 'error'); } /* 查询:取得团购商品信息 */ $goods = goods_info($group_buy['goods_id']); if (empty($goods)) { ecs_header("Location: ./\n"); exit; } /* 查询:判断数量是否足够 */ if (($group_buy['restrict_amount'] > 0 && $number > ($group_buy['restrict_amount'] - $group_buy['valid_goods'])) || $number > $goods['goods_number']) { show_message($_LANG['gb_error_goods_lacking'], '', '', 'error'); } /* 查询:取得规格 */ $specs = ''; foreach ($_POST as $key => $value) { if (strpos($key, 'spec_') !== false) { $specs .= ',' . intval($value); } } $specs = trim($specs, ','); /* 查询:如果商品有规格则取规格商品信息 配件除外 */ if ($specs) { $_specs = explode(',', $specs); $product_info = get_products_info($goods['goods_id'], $_specs); } empty($product_info) ? $product_info = array('product_number' => 0, 'product_id' => 0) : ''; /* 查询:判断指定规格的货品数量是否足够 */ if ($specs && $number > $product_info['product_number']) { show_message($_LANG['gb_error_goods_lacking'], '', '', 'error'); } /* 查询:查询规格名称和值,不考虑价格 */ $attr_list = array(); $sql = "SELECT a.attr_name, g.attr_value " . "FROM " . $ecs->table('goods_attr') . " AS g, " . $ecs->table('attribute') . " AS a " . "WHERE g.attr_id = a.attr_id " . "AND g.goods_attr_id " . db_create_in($specs); $res = $db->query($sql); while ($row = $db->fetchRow($res)) { $attr_list[] = $row['attr_name'] . ': ' . $row['attr_value']; } $goods_attr = join(chr(13) . chr(10), $attr_list); /* 更新:清空购物车中所有团购商品 */ include_once(ROOT_PATH . 'includes/lib_order.php'); clear_cart(CART_GROUP_BUY_GOODS); /* 更新:加入购物车 */ $goods_price = $group_buy['deposit'] > 0 ? $group_buy['deposit'] : $group_buy['cur_price']; $cart = array( 'user_id' => $_SESSION['user_id'], 'session_id' => SESS_ID, 'goods_id' => $group_buy['goods_id'], 'product_id' => $product_info['product_id'], 'goods_sn' => addslashes($goods['goods_sn']), 'goods_name' => addslashes($goods['goods_name']), 'market_price' => $goods['market_price'], 'goods_price' => $goods_price, 'goods_number' => $number, 'goods_attr' => addslashes($goods_attr), 'goods_attr_id' => $specs, 'is_real' => $goods['is_real'], 'extension_code' => addslashes($goods['extension_code']), 'parent_id' => 0, 'rec_type' => CART_GROUP_BUY_GOODS, 'is_gift' => 0 ); $db->autoExecute($ecs->table('cart'), $cart, 'INSERT'); /* 更新:记录购物流程类型:团购 */ $_SESSION['flow_type'] = CART_GROUP_BUY_GOODS; $_SESSION['extension_code'] = 'group_buy'; $_SESSION['extension_id'] = $group_buy_id; /* 进入收货人页面 */ ecs_header("Location: ./flow.php?step=consignee\n"); exit; } /* 取得团购活动总数 */ function group_buy_count() { $now = gmtime(); $sql = "SELECT COUNT(*) " . "FROM " . $GLOBALS['ecs']->table('goods_activity') . "WHERE act_type = '" . GAT_GROUP_BUY . "' " . "AND start_time <= '$now' AND is_finished < 3"; return $GLOBALS['db']->getOne($sql); } /** * 取得某页的所有团购活动 * @param int $size 每页记录数 * @param int $page 当前页 * @return array */ function group_buy_list($size, $page) { /* 取得团购活动 */ $gb_list = array(); $now = gmtime(); $sql = "SELECT b.*, IFNULL(g.goods_thumb, '') AS goods_thumb, b.act_id AS group_buy_id, ". "b.start_time AS start_date, b.end_time AS end_date " . "FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS b " . "LEFT JOIN " . $GLOBALS['ecs']->table('goods') . " AS g ON b.goods_id = g.goods_id " . "WHERE b.act_type = '" . GAT_GROUP_BUY . "' " . "AND b.start_time <= '$now' AND b.is_finished < 3 ORDER BY b.act_id DESC"; $res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size); while ($group_buy = $GLOBALS['db']->fetchRow($res)) { $ext_info = unserialize($group_buy['ext_info']); $group_buy = array_merge($group_buy, $ext_info); /* 格式化时间 */ $group_buy['formated_start_date'] = local_date($GLOBALS['_CFG']['time_format'], $group_buy['start_date']); $group_buy['formated_end_date'] = local_date($GLOBALS['_CFG']['time_format'], $group_buy['end_date']); /* 格式化保证金 */ $group_buy['formated_deposit'] = price_format($group_buy['deposit'], false); /* 处理价格阶梯 */ $price_ladder = $group_buy['price_ladder']; if (!is_array($price_ladder) || empty($price_ladder)) { $price_ladder = array(array('amount' => 0, 'price' => 0)); } else { foreach ($price_ladder as $key => $amount_price) { $price_ladder[$key]['formated_price'] = price_format($amount_price['price']); } } $group_buy['price_ladder'] = $price_ladder; /* 处理图片 */ if (empty($group_buy['goods_thumb'])) { $group_buy['goods_thumb'] = get_image_path($group_buy['goods_id'], $group_buy['goods_thumb'], true); } /* 处理链接 */ $group_buy['url'] = build_uri('group_buy', array('gbid'=>$group_buy['group_buy_id'])); /* 加入数组 */ $gb_list[] = $group_buy; } return $gb_list; } ?>
zzshop
trunk/group_buy.php
PHP
asf20
13,659
<?php $data = array ( 'shop_name' => 'ECSHOP', 'shop_title' => 'ECSHOP演示站', 'shop_desc' => 'ECSHOP演示站', 'shop_keywords' => 'ECSHOP演示站', 'shop_country' => '1', 'shop_province' => '2', 'shop_city' => '52', 'shop_address' => '', 'qq' => '', 'ww' => '', 'skype' => '', 'ym' => '', 'msn' => '', 'service_email' => '', 'service_phone' => '', 'shop_closed' => '0', 'close_comment' => '', 'shop_logo' => '', 'licensed' => '0', 'user_notice' => '用户中心公告!', 'shop_notice' => '欢迎光临手机网,我们的宗旨:诚信经营、服务客户! <MARQUEE onmouseover=this.stop() onmouseout=this.start() scrollAmount=3><U><FONT color=red> <P>咨询电话010-10124444 010-21252454 8465544</P></FONT></U></MARQUEE>', 'shop_reg_closed' => '0', 'lang' => 'zh_cn', 'icp_number' => '', 'icp_file' => '', 'watermark' => '', 'watermark_place' => '1', 'watermark_alpha' => 65, 'use_storage' => '1', 'market_price_rate' => 1.2, 'rewrite' => '0', 'integral_name' => '积分', 'integral_scale' => 1, 'integral_percent' => '1', 'sn_prefix' => 'ECS', 'comment_check' => '1', 'no_picture' => 'images/no_picture.gif', 'stats_code' => '', 'cache_time' => 3600, 'register_points' => '0', 'enable_gzip' => '0', 'top10_time' => 0, 'timezone' => '8', 'upload_size_limit' => '64', 'cron_method' => '0', 'comment_factor' => '0', 'enable_order_check' => '1', 'default_storage' => 1, 'bgcolor' => '#FFFFFF', 'visit_stats' => 'on', 'send_mail_on' => 'off', 'auto_generate_gallery' => '1', 'retain_original_img' => '1', 'member_email_validate' => '1', 'message_board' => '1', 'certificate_id' => '108203', 'token' => 'f26131b01e74371e07f2acc5cda77ac99a59c4cd97c3142c54fed09ed5c1d7f9', 'certi' => 'http://service.shopex.cn/openapi/api.php', 'date_format' => 'Y-m-d', 'time_format' => 'Y-m-d H:i:s', 'currency_format' => '¥%s元', 'thumb_width' => 100, 'thumb_height' => 100, 'image_width' => 230, 'image_height' => 230, 'top_number' => 10, 'history_number' => 5, 'comments_number' => 5, 'bought_goods' => 3, 'article_number' => 8, 'goods_name_length' => 7, 'price_format' => '5', 'page_size' => 10, 'sort_order_type' => '0', 'sort_order_method' => '0', 'show_order_type' => '1', 'attr_related_number' => '5', 'goods_gallery_number' => 5, 'article_title_length' => '16', 'name_of_region_1' => '国家', 'name_of_region_2' => '省', 'name_of_region_3' => '市', 'name_of_region_4' => '区', 'search_keywords' => '', 'related_goods_number' => '4', 'help_open' => '1', 'article_page_size' => '10', 'page_style' => '1', 'recommend_order' => '0', 'index_ad' => 'sys', 'can_invoice' => '1', 'use_integral' => '1', 'use_bonus' => '1', 'use_surplus' => '1', 'use_how_oos' => '1', 'send_confirm_email' => '0', 'send_ship_email' => '0', 'send_cancel_email' => '0', 'send_invalid_email' => '0', 'order_pay_note' => '1', 'order_unpay_note' => '1', 'order_ship_note' => '1', 'order_receive_note' => '1', 'order_unship_note' => '1', 'order_return_note' => '1', 'order_invalid_note' => '1', 'order_cancel_note' => '1', 'invoice_content' => '', 'anonymous_buy' => '1', 'min_goods_amount' => 0, 'one_step_buy' => 0, 'invoice_type' => array ( 'type' => array ( 0 => '1', 1 => '2', 2 => '', ), 'rate' => array ( 0 => 1, 1 => 1.5, 2 => 0, ), ), 'stock_dec_time' => '0', 'cart_confirm' => '3', 'send_service_email' => '0', 'show_goods_in_cart' => '3', 'show_attr_in_cart' => '1', 'smtp_host' => 'localhost', 'smtp_port' => '25', 'smtp_user' => '', 'smtp_pass' => '', 'smtp_mail' => '', 'mail_charset' => 'UTF8', 'mail_service' => '0', 'smtp_ssl' => '0', 'integrate_code' => 'ecshop', 'integrate_config' => '', 'hash_code' => '31693422540744c0a6b6da635b7a5a93', 'template' => 'default', 'install_date' => '1299760562', 'ecs_version' => 'v2.7.2', 'sms_user_name' => '', 'sms_password' => '', 'sms_auth_str' => '', 'sms_domain' => '', 'sms_count' => '', 'sms_total_money' => '', 'sms_balance' => '', 'sms_last_request' => '', 'affiliate' => 'a:3:{s:6:"config";a:7:{s:6:"expire";d:24;s:11:"expire_unit";s:4:"hour";s:11:"separate_by";i:0;s:15:"level_point_all";s:2:"5%";s:15:"level_money_all";s:2:"1%";s:18:"level_register_all";i:2;s:17:"level_register_up";i:60;}s:4:"item";a:4:{i:0;a:2:{s:11:"level_point";s:3:"60%";s:11:"level_money";s:3:"60%";}i:1;a:2:{s:11:"level_point";s:3:"30%";s:11:"level_money";s:3:"30%";}i:2;a:2:{s:11:"level_point";s:2:"7%";s:11:"level_money";s:2:"7%";}i:3;a:2:{s:11:"level_point";s:2:"3%";s:11:"level_money";s:2:"3%";}}s:2:"on";i:1;}', 'captcha' => '12', 'captcha_width' => '100', 'captcha_height' => '20', 'sitemap' => 'a:6:{s:19:"homepage_changefreq";s:6:"hourly";s:17:"homepage_priority";s:3:"0.9";s:19:"category_changefreq";s:6:"hourly";s:17:"category_priority";s:3:"0.8";s:18:"content_changefreq";s:6:"weekly";s:16:"content_priority";s:3:"0.7";}', 'points_rule' => '', 'flash_theme' => 'dynfocus', 'stylename' => '', 'show_goodssn' => '1', 'show_brand' => '1', 'show_goodsweight' => '1', 'show_goodsnumber' => '1', 'show_addtime' => '1', 'goodsattr_style' => '1', 'show_marketprice' => '1', 'sms_shop_mobile' => '', 'sms_order_placed' => '0', 'sms_order_payed' => '0', 'sms_order_shipped' => '0', 'wap_config' => '0', 'wap_logo' => '', 'message_check' => '1', 'best_number' => 3, 'new_number' => 3, 'hot_number' => 3, 'promote_number' => 3, ); ?>
zzshop
trunk/temp/static_caches/shop_config.php
PHP
asf20
5,652
<?php $data = array ( 'best' => array ( 0 => array ( 'goods_id' => '9', 'sort_order' => '100', ), 1 => array ( 'goods_id' => '1', 'sort_order' => '100', ), 2 => array ( 'goods_id' => '8', 'sort_order' => '100', ), 3 => array ( 'goods_id' => '17', 'sort_order' => '100', ), 4 => array ( 'goods_id' => '19', 'sort_order' => '100', ), 5 => array ( 'goods_id' => '20', 'sort_order' => '100', ), 6 => array ( 'goods_id' => '22', 'sort_order' => '100', ), 7 => array ( 'goods_id' => '23', 'sort_order' => '100', ), 8 => array ( 'goods_id' => '24', 'sort_order' => '100', ), 9 => array ( 'goods_id' => '27', 'sort_order' => '100', ), 10 => array ( 'goods_id' => '30', 'sort_order' => '100', ), 11 => array ( 'goods_id' => '25', 'sort_order' => '100', ), 12 => array ( 'goods_id' => '29', 'sort_order' => '100', ), 13 => array ( 'goods_id' => '5', 'sort_order' => '100', ), ), 'new' => array ( 0 => array ( 'goods_id' => '9', 'sort_order' => '100', ), 1 => array ( 'goods_id' => '1', 'sort_order' => '100', ), 2 => array ( 'goods_id' => '8', 'sort_order' => '100', ), 3 => array ( 'goods_id' => '19', 'sort_order' => '100', ), 4 => array ( 'goods_id' => '20', 'sort_order' => '100', ), 5 => array ( 'goods_id' => '22', 'sort_order' => '100', ), 6 => array ( 'goods_id' => '23', 'sort_order' => '100', ), 7 => array ( 'goods_id' => '24', 'sort_order' => '100', ), 8 => array ( 'goods_id' => '32', 'sort_order' => '100', ), 9 => array ( 'goods_id' => '12', 'sort_order' => '100', ), 10 => array ( 'goods_id' => '27', 'sort_order' => '100', ), 11 => array ( 'goods_id' => '5', 'sort_order' => '100', ), ), 'hot' => array ( 0 => array ( 'goods_id' => '9', 'sort_order' => '100', ), 1 => array ( 'goods_id' => '1', 'sort_order' => '100', ), 2 => array ( 'goods_id' => '8', 'sort_order' => '100', ), 3 => array ( 'goods_id' => '13', 'sort_order' => '100', ), 4 => array ( 'goods_id' => '14', 'sort_order' => '100', ), 5 => array ( 'goods_id' => '17', 'sort_order' => '100', ), 6 => array ( 'goods_id' => '19', 'sort_order' => '100', ), 7 => array ( 'goods_id' => '20', 'sort_order' => '100', ), 8 => array ( 'goods_id' => '24', 'sort_order' => '100', ), 9 => array ( 'goods_id' => '32', 'sort_order' => '100', ), 10 => array ( 'goods_id' => '10', 'sort_order' => '100', ), 11 => array ( 'goods_id' => '27', 'sort_order' => '100', ), 12 => array ( 'goods_id' => '30', 'sort_order' => '100', ), 13 => array ( 'goods_id' => '25', 'sort_order' => '100', ), 14 => array ( 'goods_id' => '29', 'sort_order' => '100', ), 15 => array ( 'goods_id' => '28', 'sort_order' => '100', ), 16 => array ( 'goods_id' => '26', 'sort_order' => '100', ), ), 'brand' => array ( 9 => '诺基亚', 1 => 'LG', 8 => '飞利浦', 13 => '诺基亚', 14 => '诺基亚', 17 => '夏新', 19 => '三星', 20 => '三星', 22 => '多普达', 23 => '诺基亚', 24 => '联想', 32 => '诺基亚', 12 => '摩托罗拉', 10 => '索爱', 5 => '索爱', ), ); ?>
zzshop
trunk/temp/static_caches/recommend_goods.php
PHP
asf20
4,073
<?php $data = array ( 0 => array ( 'cat_id' => '6', 'cat_name' => '手机配件', 'measure_unit' => '', 'parent_id' => '0', 'is_show' => '1', 'show_in_nav' => '1', 'grade' => '0', 'sort_order' => '50', 'has_children' => '4', 'goods_num' => 0, ), 1 => array ( 'cat_id' => '1', 'cat_name' => '手机类型', 'measure_unit' => '', 'parent_id' => '0', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '5', 'sort_order' => '50', 'has_children' => '4', 'goods_num' => 0, ), 2 => array ( 'cat_id' => '12', 'cat_name' => '充值卡', 'measure_unit' => '', 'parent_id' => '0', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '3', 'goods_num' => 0, ), 3 => array ( 'cat_id' => '5', 'cat_name' => '双模手机', 'measure_unit' => '', 'parent_id' => '1', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '5', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => 2, ), 4 => array ( 'cat_id' => '2', 'cat_name' => 'CDMA手机', 'measure_unit' => '', 'parent_id' => '1', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => 0, ), 5 => array ( 'cat_id' => '3', 'cat_name' => 'GSM手机', 'measure_unit' => '台', 'parent_id' => '1', 'is_show' => '1', 'show_in_nav' => '1', 'grade' => '4', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '12', ), 6 => array ( 'cat_id' => '4', 'cat_name' => '3G手机', 'measure_unit' => '', 'parent_id' => '1', 'is_show' => '1', 'show_in_nav' => '1', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', ), 7 => array ( 'cat_id' => '9', 'cat_name' => '电池', 'measure_unit' => '', 'parent_id' => '6', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => 0, ), 8 => array ( 'cat_id' => '11', 'cat_name' => '读卡器和内存卡', 'measure_unit' => '', 'parent_id' => '6', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', ), 9 => array ( 'cat_id' => '7', 'cat_name' => '充电器', 'measure_unit' => '', 'parent_id' => '6', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => 0, ), 10 => array ( 'cat_id' => '8', 'cat_name' => '耳机', 'measure_unit' => '', 'parent_id' => '6', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '3', ), 11 => array ( 'cat_id' => '13', 'cat_name' => '小灵通/固话充值卡', 'measure_unit' => '', 'parent_id' => '12', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', ), 12 => array ( 'cat_id' => '14', 'cat_name' => '移动手机充值卡', 'measure_unit' => '', 'parent_id' => '12', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', ), 13 => array ( 'cat_id' => '15', 'cat_name' => '联通手机充值卡', 'measure_unit' => '', 'parent_id' => '12', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', ), ); ?>
zzshop
trunk/temp/static_caches/cat_pid_releate.php
PHP
asf20
3,866
<?php $data = array ( 6 => array ( 'cat_id' => '6', 'cat_name' => '手机配件', 'measure_unit' => '', 'parent_id' => '0', 'is_show' => '1', 'show_in_nav' => '1', 'grade' => '0', 'sort_order' => '50', 'has_children' => '4', 'goods_num' => 0, 'level' => 0, 'id' => '6', 'name' => '手机配件', ), 9 => array ( 'cat_id' => '9', 'cat_name' => '电池', 'measure_unit' => '', 'parent_id' => '6', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => 0, 'level' => 1, 'id' => '9', 'name' => '电池', ), 11 => array ( 'cat_id' => '11', 'cat_name' => '读卡器和内存卡', 'measure_unit' => '', 'parent_id' => '6', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', 'level' => 1, 'id' => '11', 'name' => '读卡器和内存卡', ), 7 => array ( 'cat_id' => '7', 'cat_name' => '充电器', 'measure_unit' => '', 'parent_id' => '6', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => 0, 'level' => 1, 'id' => '7', 'name' => '充电器', ), 8 => array ( 'cat_id' => '8', 'cat_name' => '耳机', 'measure_unit' => '', 'parent_id' => '6', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '3', 'level' => 1, 'id' => '8', 'name' => '耳机', ), 1 => array ( 'cat_id' => '1', 'cat_name' => '手机类型', 'measure_unit' => '', 'parent_id' => '0', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '5', 'sort_order' => '50', 'has_children' => '4', 'goods_num' => 0, 'level' => 0, 'id' => '1', 'name' => '手机类型', ), 5 => array ( 'cat_id' => '5', 'cat_name' => '双模手机', 'measure_unit' => '', 'parent_id' => '1', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '5', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => 2, 'level' => 1, 'id' => '5', 'name' => '双模手机', ), 2 => array ( 'cat_id' => '2', 'cat_name' => 'CDMA手机', 'measure_unit' => '', 'parent_id' => '1', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => 0, 'level' => 1, 'id' => '2', 'name' => 'CDMA手机', ), 3 => array ( 'cat_id' => '3', 'cat_name' => 'GSM手机', 'measure_unit' => '台', 'parent_id' => '1', 'is_show' => '1', 'show_in_nav' => '1', 'grade' => '4', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '12', 'level' => 1, 'id' => '3', 'name' => 'GSM手机', ), 4 => array ( 'cat_id' => '4', 'cat_name' => '3G手机', 'measure_unit' => '', 'parent_id' => '1', 'is_show' => '1', 'show_in_nav' => '1', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', 'level' => 1, 'id' => '4', 'name' => '3G手机', ), 12 => array ( 'cat_id' => '12', 'cat_name' => '充值卡', 'measure_unit' => '', 'parent_id' => '0', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '3', 'goods_num' => 0, 'level' => 0, 'id' => '12', 'name' => '充值卡', ), 13 => array ( 'cat_id' => '13', 'cat_name' => '小灵通/固话充值卡', 'measure_unit' => '', 'parent_id' => '12', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', 'level' => 1, 'id' => '13', 'name' => '小灵通/固话充值卡', ), 14 => array ( 'cat_id' => '14', 'cat_name' => '移动手机充值卡', 'measure_unit' => '', 'parent_id' => '12', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', 'level' => 1, 'id' => '14', 'name' => '移动手机充值卡', ), 15 => array ( 'cat_id' => '15', 'cat_name' => '联通手机充值卡', 'measure_unit' => '', 'parent_id' => '12', 'is_show' => '1', 'show_in_nav' => '0', 'grade' => '0', 'sort_order' => '50', 'has_children' => '0', 'goods_num' => '2', 'level' => 1, 'id' => '15', 'name' => '联通手机充值卡', ), ); ?>
zzshop
trunk/temp/static_caches/cat_option_static.php
PHP
asf20
4,795
<?php exit;?>a:3:{s:8:"template";a:11:{i:0;s:49:"C:/xampp/htdocs/zshop/themes/default/category.dwt";i:1;s:60:"C:/xampp/htdocs/zshop/themes/default/library/page_header.lbi";i:2;s:56:"C:/xampp/htdocs/zshop/themes/default/library/ur_here.lbi";i:3;s:53:"C:/xampp/htdocs/zshop/themes/default/library/cart.lbi";i:4;s:62:"C:/xampp/htdocs/zshop/themes/default/library/category_tree.lbi";i:5;s:56:"C:/xampp/htdocs/zshop/themes/default/library/history.lbi";i:6;s:63:"C:/xampp/htdocs/zshop/themes/default/library/recommend_best.lbi";i:7;s:59:"C:/xampp/htdocs/zshop/themes/default/library/goods_list.lbi";i:8;s:54:"C:/xampp/htdocs/zshop/themes/default/library/pages.lbi";i:9;s:53:"C:/xampp/htdocs/zshop/themes/default/library/help.lbi";i:10;s:60:"C:/xampp/htdocs/zshop/themes/default/library/page_footer.lbi";}s:7:"expires";i:1299766028;s:8:"maketime";i:1299762428;}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="Generator" content="ECSHOP v2.7.2" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Keywords" content="" /> <meta name="Description" content="" /> <title>手机配件_ECSHOP演示站 - Powered by ECShop</title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="icon" href="animated_favicon.gif" type="image/gif" /> <link href="themes/default/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/common.js"></script><script type="text/javascript" src="js/global.js"></script><script type="text/javascript" src="js/compare.js"></script></head> <body> <script type="text/javascript"> var process_request = "正在处理您的请求..."; </script> <div class="block clearfix"> <div class="f_l"><a href="index.php" name="top"><img src="themes/default/images/logo.gif" /></a></div> <div class="f_r log"> <ul> <li class="userInfo"> <script type="text/javascript" src="js/transport.js"></script><script type="text/javascript" src="js/utils.js"></script> <font id="ECS_MEMBERZONE">554fcae493e564ee0dc75bdf2ebf94camember_info|a:1:{s:4:"name";s:11:"member_info";}554fcae493e564ee0dc75bdf2ebf94ca </font> </li> <li id="topNav" class="clearfix"> <a href="flow.php" >查看购物车</a> | <a href="pick_out.php" >选购中心</a> | <a href="tag_cloud.php" >标签云</a> | <a href="quotation.php" >报价单</a> <div class="topNavR"></div> </li> </ul> </div> </div> <div class="blank"></div> <div id="mainNav" class="clearfix"> <a href="index.php">首页<span></span></a> <a href="category.php?id=3" >GSM手机<span></span></a> <a href="category.php?id=5" >双模手机<span></span></a> <a href="category.php?id=6" class="cur">手机配件<span></span></a> <a href="group_buy.php" >团购商品<span></span></a> <a href="activity.php" >优惠活动<span></span></a> <a href="snatch.php" >夺宝奇兵<span></span></a> <a href="auction.php" >拍卖活动<span></span></a> <a href="exchange.php" >积分商城<span></span></a> <a href="message.php" >留言板<span></span></a> <a href="http://bbs.ecshop.com/" target="_blank" >EC论坛<span></span></a> </div> <div id="search" class="clearfix"> <div class="keys f_l"> <script type="text/javascript"> <!-- function checkSearchForm() { if(document.getElementById('keyword').value) { return true; } else { alert("请输入搜索关键词!"); return false; } } --> </script> </div> <form id="searchForm" name="searchForm" method="get" action="search.php" onSubmit="return checkSearchForm()" class="f_r" style="_position:relative; top:5px;"> <select name="category" id="category" class="B_input"> <option value="0">所有分类</option> <option value="6" >手机配件</option><option value="9" >&nbsp;&nbsp;&nbsp;&nbsp;电池</option><option value="11" >&nbsp;&nbsp;&nbsp;&nbsp;读卡器和内存卡</option><option value="7" >&nbsp;&nbsp;&nbsp;&nbsp;充电器</option><option value="8" >&nbsp;&nbsp;&nbsp;&nbsp;耳机</option><option value="1" >手机类型</option><option value="5" >&nbsp;&nbsp;&nbsp;&nbsp;双模手机</option><option value="2" >&nbsp;&nbsp;&nbsp;&nbsp;CDMA手机</option><option value="3" >&nbsp;&nbsp;&nbsp;&nbsp;GSM手机</option><option value="4" >&nbsp;&nbsp;&nbsp;&nbsp;3G手机</option><option value="12" >充值卡</option><option value="13" >&nbsp;&nbsp;&nbsp;&nbsp;小灵通/固话充值卡</option><option value="14" >&nbsp;&nbsp;&nbsp;&nbsp;移动手机充值卡</option><option value="15" >&nbsp;&nbsp;&nbsp;&nbsp;联通手机充值卡</option> </select> <input name="keywords" type="text" id="keyword" value="" class="B_input" style="width:110px;"/> <input name="imageField" type="submit" value="" class="go" style="cursor:pointer;" /> <a href="search.php?act=advanced_search">高级搜索</a> </form> </div> <div class="block box"> <div id="ur_here"> 当前位置: <a href=".">首页</a> <code>&gt;</code> <a href="category.php?id=6">手机配件</a> </div> </div> <div class="blank"></div> <div class="block clearfix"> <div class="AreaL"> <div class="cart" id="ECS_CARTINFO"> 554fcae493e564ee0dc75bdf2ebf94cacart_info|a:1:{s:4:"name";s:9:"cart_info";}554fcae493e564ee0dc75bdf2ebf94ca</div> <div class="blank5"></div> <div class="box"> <div class="box_1"> <div id="category_tree"> <dl> <dt><a href="category.php?id=1">手机类型</a></dt> <dd><a href="category.php?id=2">CDMA手机</a></dd> <dd><a href="category.php?id=3">GSM手机</a></dd> <dd><a href="category.php?id=4">3G手机</a></dd> <dd><a href="category.php?id=5">双模手机</a></dd> </dl> <dl> <dt><a href="category.php?id=6">手机配件</a></dt> <dd><a href="category.php?id=7">充电器</a></dd> <dd><a href="category.php?id=8">耳机</a></dd> <dd><a href="category.php?id=9">电池</a></dd> <dd><a href="category.php?id=11">读卡器和内存卡</a></dd> </dl> <dl> <dt><a href="category.php?id=12">充值卡</a></dt> <dd><a href="category.php?id=13">小灵通/固话充值卡</a></dd> <dd><a href="category.php?id=14">移动手机充值卡</a></dd> <dd><a href="category.php?id=15">联通手机充值卡</a></dd> </dl> </div> </div> </div> <div class="blank5"></div> <div class="box" id='history_div'> <div class="box_1"> <h3><span>浏览历史</span></h3> <div class="boxCenterList clearfix" id='history_list'> 554fcae493e564ee0dc75bdf2ebf94cahistory|a:1:{s:4:"name";s:7:"history";}554fcae493e564ee0dc75bdf2ebf94ca </div> </div> </div> <div class="blank5"></div> <script type="text/javascript"> if (document.getElementById('history_list').innerHTML.replace(/\s/g,'').length<1) { document.getElementById('history_div').style.display='none'; } else { document.getElementById('history_div').style.display='block'; } function clear_history() { Ajax.call('user.php', 'act=clear_history',clear_history_Response, 'GET', 'TEXT',1,1); } function clear_history_Response(res) { document.getElementById('history_list').innerHTML = '您已清空最近浏览过的商品'; } </script> </div> <div class="AreaR"> <div class="box"> <div class="box_1"> <h3><span>商品筛选</span></h3> <div class="screeBox"> <strong>品牌:</strong> <span>全部</span> <a href="category.php?id=6&amp;brand=1&amp;price_min=0&amp;price_max=0">诺基亚</a>&nbsp; <a href="category.php?id=6&amp;brand=7&amp;price_min=0&amp;price_max=0">索爱</a>&nbsp; </div> </div> </div> <div class="blank5"></div> <div class="box"> <div class="box_2 centerPadd"> <div class="itemTit" id="itemBest"> </div> <div id="show_best_area" class="clearfix goodsBox"> <div class="goodsItem"> <span class="best"></span> <a href="goods.php?id=5"><img src="images/200905/thumb_img/5_thumb_G_1241422518886.jpg" alt="索爱原装M2卡读卡器" class="goodsimg" /></a><br /> <p><a href="goods.php?id=5" title="索爱原装M2卡读卡器">索爱原装M2卡...</a></p> <font class="f1"> ¥20元 </font> </div> <div class="more"><a href="search.php?intro=best"><img src="themes/default/images/more.gif" /></a></div> </div> </div> </div> <div class="blank5"></div> <div class="box"> <div class="box_1"> <h3> <span>商品列表</span><a name='goods_list'></a> <form method="GET" class="sort" name="listform"> 显示方式: <a href="javascript:;" onClick="javascript:display_mode('list')"><img src="themes/default/images/display_mode_list.gif" alt=""></a> <a href="javascript:;" onClick="javascript:display_mode('grid')"><img src="themes/default/images/display_mode_grid_act.gif" alt=""></a> <a href="javascript:;" onClick="javascript:display_mode('text')"><img src="themes/default/images/display_mode_text.gif" alt=""></a>&nbsp;&nbsp; <a href="category.php?category=6&display=grid&brand=0&price_min=0&price_max=0&filter_attr=0&page=1&sort=goods_id&order=ASC#goods_list"><img src="themes/default/images/goods_id_DESC.gif" alt="按上架时间排序"></a> <a href="category.php?category=6&display=grid&brand=0&price_min=0&price_max=0&filter_attr=0&page=1&sort=shop_price&order=ASC#goods_list"><img src="themes/default/images/shop_price_default.gif" alt="按价格排序"></a> <a href="category.php?category=6&display=grid&brand=0&price_min=0&price_max=0&filter_attr=0&page=1&sort=last_update&order=DESC#goods_list"><img src="themes/default/images/last_update_default.gif" alt="按更新时间排序"></a> <input type="hidden" name="category" value="6" /> <input type="hidden" name="display" value="grid" id="display" /> <input type="hidden" name="brand" value="0" /> <input type="hidden" name="price_min" value="0" /> <input type="hidden" name="price_max" value="0" /> <input type="hidden" name="filter_attr" value="0" /> <input type="hidden" name="page" value="1" /> <input type="hidden" name="sort" value="goods_id" /> <input type="hidden" name="order" value="DESC" /> </form> </h3> <form name="compareForm" action="compare.php" method="post" onSubmit="return compareGoods(this);"> <div class="centerPadd"> <div class="clearfix goodsBox" style="border:none;"> <div class="goodsItem"> <a href="goods.php?id=7"><img src="images/200905/thumb_img/7_thumb_G_1241422785492.jpg" alt="诺基亚N85原..." class="goodsimg" /></a><br /> <p><a href="goods.php?id=7" title="诺基亚N85原装立体声耳机HS-82">诺基亚N85原...</a></p> 市场价<font class="market_s">¥120元</font><br /> 本店价<font class="shop_s">¥100元</font><br /> <a href="javascript:collect(7);" class="f6">收藏</a> | <a href="javascript:addToCart(7)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(7,'诺基亚N85原...','2')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=5"><img src="images/200905/thumb_img/5_thumb_G_1241422518886.jpg" alt="索爱原装M2卡..." class="goodsimg" /></a><br /> <p><a href="goods.php?id=5" title="索爱原装M2卡读卡器">索爱原装M2卡...</a></p> 市场价<font class="market_s">¥24元</font><br /> 本店价<font class="shop_s">¥20元</font><br /> <a href="javascript:collect(5);" class="f6">收藏</a> | <a href="javascript:addToCart(5)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(5,'索爱原装M2卡...','2')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=3"><img src="images/200905/thumb_img/3_thumb_G_1241422082679.jpg" alt="诺基亚原装58..." class="goodsimg" /></a><br /> <p><a href="goods.php?id=3" title="诺基亚原装5800耳机">诺基亚原装58...</a></p> 市场价<font class="market_s">¥82元</font><br /> 本店价<font class="shop_s">¥68元</font><br /> <a href="javascript:collect(3);" class="f6">收藏</a> | <a href="javascript:addToCart(3)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(3,'诺基亚原装58...','6')" class="f6">比较</a> </div> </div> </div> </form> </div> </div> <div class="blank5"></div> <script type="Text/Javascript" language="JavaScript"> <!-- function selectPage(sel) { sel.form.submit(); } //--> </script> <script type="text/javascript"> window.onload = function() { Compare.init(); fixpng(); } var button_compare = ''; var exist = "您已经选择了%s"; var count_limit = "最多只能选择4个商品进行对比"; var goods_type_different = "\"%s\"和已选择商品类型不同无法进行对比"; var compare_no_goods = "您没有选定任何需要比较的商品或者比较的商品数少于 2 个。"; var btn_buy = "购买"; var is_cancel = "取消"; var select_spe = "请选择商品属性"; </script> <form name="selectPageForm" action="/zshop/category.php" method="get"> <div id="pager" class="pagebar"> <span class="f_l f6" style="margin-right:10px;">总计 <b>3</b> 个记录</span> </div> </form> <script type="Text/Javascript" language="JavaScript"> <!-- function selectPage(sel) { sel.form.submit(); } //--> </script> </div> </div> <div class="blank5"></div> <div class="block"> <div class="box"> <div class="helpTitBg clearfix"> <dl> <dt><a href='article_cat.php?id=5' title="新手上路 ">新手上路 </a></dt> <dd><a href="article.php?id=9" title="售后流程">售后流程</a></dd> <dd><a href="article.php?id=10" title="购物流程">购物流程</a></dd> <dd><a href="article.php?id=11" title="订购方式">订购方式</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=6' title="手机常识 ">手机常识 </a></dt> <dd><a href="article.php?id=12" title="如何分辨原装电池">如何分辨原装电池</a></dd> <dd><a href="article.php?id=13" title="如何分辨水货手机 ">如何分辨水货手机</a></dd> <dd><a href="article.php?id=14" title="如何享受全国联保">如何享受全国联保</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=7' title="配送与支付 ">配送与支付 </a></dt> <dd><a href="article.php?id=15" title="货到付款区域">货到付款区域</a></dd> <dd><a href="article.php?id=16" title="配送支付智能查询 ">配送支付智能查询</a></dd> <dd><a href="article.php?id=17" title="支付方式说明">支付方式说明</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=10' title="会员中心">会员中心</a></dt> <dd><a href="article.php?id=18" title="资金管理">资金管理</a></dd> <dd><a href="article.php?id=19" title="我的收藏">我的收藏</a></dd> <dd><a href="article.php?id=20" title="我的订单">我的订单</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=8' title="服务保证 ">服务保证 </a></dt> <dd><a href="article.php?id=21" title="退换货原则">退换货原则</a></dd> <dd><a href="article.php?id=22" title="售后服务保证 ">售后服务保证</a></dd> <dd><a href="article.php?id=23" title="产品质量保证 ">产品质量保证</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=9' title="联系我们 ">联系我们 </a></dt> <dd><a href="article.php?id=24" title="网站故障报告">网站故障报告</a></dd> <dd><a href="article.php?id=25" title="选机咨询 ">选机咨询</a></dd> <dd><a href="article.php?id=26" title="投诉与建议 ">投诉与建议</a></dd> </dl> </div> </div> </div> <div class="blank"></div> <div class="blank"></div> <div id="bottomNav" class="box"> <div class="box_1"> <div class="bNavList clearfix"> <div class="f_l"> <a href="article.php?id=1" >免责条款</a> - <a href="article.php?id=2" >隐私保护</a> - <a href="article.php?id=3" >咨询热点</a> - <a href="article.php?id=4" >联系我们</a> - <a href="article.php?id=5" >公司简介</a> - <a href="wholesale.php" >批发方案</a> - <a href="myship.php" >配送方式</a> </div> <div class="f_r"> <a href="#top"><img src="themes/default/images/bnt_top.gif" /></a> <a href="index.php"><img src="themes/default/images/bnt_home.gif" /></a> </div> </div> </div> </div> <div class="blank"></div> <div id="footer"> <div class="text"> &copy; 2005-2011 ECSHOP 版权所有,并保留所有权利。<br /> <br /> 554fcae493e564ee0dc75bdf2ebf94caquery_info|a:1:{s:4:"name";s:10:"query_info";}554fcae493e564ee0dc75bdf2ebf94ca<br /> <a href="http://www.ecshop.com" target="_blank" style=" font-family:Verdana; font-size:11px;">Powered&nbsp;by&nbsp;<strong><span style="color: #3366FF">ECShop</span>&nbsp;<span style="color: #FF9966">v2.7.2</span></strong></a>&nbsp;<br /> <div align="left" id="rss"><a href="feed.php?cat=6"><img src="themes/default/images/xml_rss2.gif" alt="rss" /></a></div> </div> </div> </body> </html>
zzshop
trunk/temp/caches/4/category_736E293F.php
PHP
asf20
18,328
<?php exit;?>a:3:{s:8:"template";a:11:{i:0;s:49:"C:/xampp/htdocs/zshop/themes/default/category.dwt";i:1;s:60:"C:/xampp/htdocs/zshop/themes/default/library/page_header.lbi";i:2;s:56:"C:/xampp/htdocs/zshop/themes/default/library/ur_here.lbi";i:3;s:53:"C:/xampp/htdocs/zshop/themes/default/library/cart.lbi";i:4;s:62:"C:/xampp/htdocs/zshop/themes/default/library/category_tree.lbi";i:5;s:56:"C:/xampp/htdocs/zshop/themes/default/library/history.lbi";i:6;s:63:"C:/xampp/htdocs/zshop/themes/default/library/recommend_best.lbi";i:7;s:59:"C:/xampp/htdocs/zshop/themes/default/library/goods_list.lbi";i:8;s:54:"C:/xampp/htdocs/zshop/themes/default/library/pages.lbi";i:9;s:53:"C:/xampp/htdocs/zshop/themes/default/library/help.lbi";i:10;s:60:"C:/xampp/htdocs/zshop/themes/default/library/page_footer.lbi";}s:7:"expires";i:1299766026;s:8:"maketime";i:1299762426;}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="Generator" content="ECSHOP v2.7.2" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Keywords" content="" /> <meta name="Description" content="" /> <title>GSM手机_手机类型_ECSHOP演示站 - Powered by ECShop</title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="icon" href="animated_favicon.gif" type="image/gif" /> <link href="themes/default/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/common.js"></script><script type="text/javascript" src="js/global.js"></script><script type="text/javascript" src="js/compare.js"></script></head> <body> <script type="text/javascript"> var process_request = "正在处理您的请求..."; </script> <div class="block clearfix"> <div class="f_l"><a href="index.php" name="top"><img src="themes/default/images/logo.gif" /></a></div> <div class="f_r log"> <ul> <li class="userInfo"> <script type="text/javascript" src="js/transport.js"></script><script type="text/javascript" src="js/utils.js"></script> <font id="ECS_MEMBERZONE">554fcae493e564ee0dc75bdf2ebf94camember_info|a:1:{s:4:"name";s:11:"member_info";}554fcae493e564ee0dc75bdf2ebf94ca </font> </li> <li id="topNav" class="clearfix"> <a href="flow.php" >查看购物车</a> | <a href="pick_out.php" >选购中心</a> | <a href="tag_cloud.php" >标签云</a> | <a href="quotation.php" >报价单</a> <div class="topNavR"></div> </li> </ul> </div> </div> <div class="blank"></div> <div id="mainNav" class="clearfix"> <a href="index.php">首页<span></span></a> <a href="category.php?id=3" class="cur">GSM手机<span></span></a> <a href="category.php?id=5" >双模手机<span></span></a> <a href="category.php?id=6" >手机配件<span></span></a> <a href="group_buy.php" >团购商品<span></span></a> <a href="activity.php" >优惠活动<span></span></a> <a href="snatch.php" >夺宝奇兵<span></span></a> <a href="auction.php" >拍卖活动<span></span></a> <a href="exchange.php" >积分商城<span></span></a> <a href="message.php" >留言板<span></span></a> <a href="http://bbs.ecshop.com/" target="_blank" >EC论坛<span></span></a> </div> <div id="search" class="clearfix"> <div class="keys f_l"> <script type="text/javascript"> <!-- function checkSearchForm() { if(document.getElementById('keyword').value) { return true; } else { alert("请输入搜索关键词!"); return false; } } --> </script> </div> <form id="searchForm" name="searchForm" method="get" action="search.php" onSubmit="return checkSearchForm()" class="f_r" style="_position:relative; top:5px;"> <select name="category" id="category" class="B_input"> <option value="0">所有分类</option> <option value="6" >手机配件</option><option value="9" >&nbsp;&nbsp;&nbsp;&nbsp;电池</option><option value="11" >&nbsp;&nbsp;&nbsp;&nbsp;读卡器和内存卡</option><option value="7" >&nbsp;&nbsp;&nbsp;&nbsp;充电器</option><option value="8" >&nbsp;&nbsp;&nbsp;&nbsp;耳机</option><option value="1" >手机类型</option><option value="5" >&nbsp;&nbsp;&nbsp;&nbsp;双模手机</option><option value="2" >&nbsp;&nbsp;&nbsp;&nbsp;CDMA手机</option><option value="3" >&nbsp;&nbsp;&nbsp;&nbsp;GSM手机</option><option value="4" >&nbsp;&nbsp;&nbsp;&nbsp;3G手机</option><option value="12" >充值卡</option><option value="13" >&nbsp;&nbsp;&nbsp;&nbsp;小灵通/固话充值卡</option><option value="14" >&nbsp;&nbsp;&nbsp;&nbsp;移动手机充值卡</option><option value="15" >&nbsp;&nbsp;&nbsp;&nbsp;联通手机充值卡</option> </select> <input name="keywords" type="text" id="keyword" value="" class="B_input" style="width:110px;"/> <input name="imageField" type="submit" value="" class="go" style="cursor:pointer;" /> <a href="search.php?act=advanced_search">高级搜索</a> </form> </div> <div class="block box"> <div id="ur_here"> 当前位置: <a href=".">首页</a> <code>&gt;</code> <a href="category.php?id=1">手机类型</a> <code>&gt;</code> <a href="category.php?id=3">GSM手机</a> </div> </div> <div class="blank"></div> <div class="block clearfix"> <div class="AreaL"> <div class="cart" id="ECS_CARTINFO"> 554fcae493e564ee0dc75bdf2ebf94cacart_info|a:1:{s:4:"name";s:9:"cart_info";}554fcae493e564ee0dc75bdf2ebf94ca</div> <div class="blank5"></div> <div class="box"> <div class="box_1"> <div id="category_tree"> <dl> <dt><a href="category.php?id=2">CDMA手机</a></dt> </dl> <dl> <dt><a href="category.php?id=3">GSM手机</a></dt> </dl> <dl> <dt><a href="category.php?id=4">3G手机</a></dt> </dl> <dl> <dt><a href="category.php?id=5">双模手机</a></dt> </dl> </div> </div> </div> <div class="blank5"></div> <div class="box" id='history_div'> <div class="box_1"> <h3><span>浏览历史</span></h3> <div class="boxCenterList clearfix" id='history_list'> 554fcae493e564ee0dc75bdf2ebf94cahistory|a:1:{s:4:"name";s:7:"history";}554fcae493e564ee0dc75bdf2ebf94ca </div> </div> </div> <div class="blank5"></div> <script type="text/javascript"> if (document.getElementById('history_list').innerHTML.replace(/\s/g,'').length<1) { document.getElementById('history_div').style.display='none'; } else { document.getElementById('history_div').style.display='block'; } function clear_history() { Ajax.call('user.php', 'act=clear_history',clear_history_Response, 'GET', 'TEXT',1,1); } function clear_history_Response(res) { document.getElementById('history_list').innerHTML = '您已清空最近浏览过的商品'; } </script> </div> <div class="AreaR"> <div class="box"> <div class="box_1"> <h3><span>商品筛选</span></h3> <div class="screeBox"> <strong>品牌:</strong> <span>全部</span> <a href="category.php?id=3&amp;brand=1&amp;price_min=0&amp;price_max=0">诺基亚</a>&nbsp; <a href="category.php?id=3&amp;brand=2&amp;price_min=0&amp;price_max=0">摩托罗拉</a>&nbsp; <a href="category.php?id=3&amp;brand=3&amp;price_min=0&amp;price_max=0">多普达</a>&nbsp; <a href="category.php?id=3&amp;brand=4&amp;price_min=0&amp;price_max=0">飞利浦</a>&nbsp; <a href="category.php?id=3&amp;brand=5&amp;price_min=0&amp;price_max=0">夏新</a>&nbsp; <a href="category.php?id=3&amp;brand=6&amp;price_min=0&amp;price_max=0">三星</a>&nbsp; <a href="category.php?id=3&amp;brand=7&amp;price_min=0&amp;price_max=0">索爱</a>&nbsp; <a href="category.php?id=3&amp;brand=9&amp;price_min=0&amp;price_max=0">联想</a>&nbsp; <a href="category.php?id=3&amp;brand=10&amp;price_min=0&amp;price_max=0">金立</a>&nbsp; </div> <div class="screeBox"> <strong>价格:</strong> <span>全部</span> <a href="category.php?id=3&amp;price_min=200&amp;price_max=1700">200&nbsp;-&nbsp;1700</a>&nbsp; <a href="category.php?id=3&amp;price_min=1700&amp;price_max=3200">1700&nbsp;-&nbsp;3200</a>&nbsp; <a href="category.php?id=3&amp;price_min=4700&amp;price_max=6200">4700&nbsp;-&nbsp;6200</a>&nbsp; </div> <div class="screeBox"> <strong>颜色 :</strong> <span>全部</span> <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=167.0.0.0">灰色</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=198.0.0.0">白色</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=197.0.0.0">金色</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=163.0.0.0">黑色</a>&nbsp; </div> <div class="screeBox"> <strong>屏幕大小 :</strong> <span>全部</span> <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.229.0.0">1.75英寸</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.216.0.0">2.0英寸</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.223.0.0">2.2英寸</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.156.0.0">2.6英寸</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.200.0.0">2.8英寸</a>&nbsp; </div> <div class="screeBox"> <strong>手机制式 :</strong> <span>全部</span> <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.0.202.0">CDMA</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.0.160.0">GSM,850,900,1800,1900</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.0.195.0">GSM,900,1800,1900,2100</a>&nbsp; </div> <div class="screeBox"> <strong>外观样式 :</strong> <span>全部</span> <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.0.0.199">滑盖</a>&nbsp; <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;filter_attr=0.0.0.186">直板</a>&nbsp; </div> </div> </div> <div class="blank5"></div> <div class="box"> <div class="box_2 centerPadd"> <div class="itemTit" id="itemBest"> </div> <div id="show_best_area" class="clearfix goodsBox"> <div class="goodsItem"> <span class="best"></span> <a href="goods.php?id=9"><img src="images/200905/thumb_img/9_thumb_G_1241511871555.jpg" alt="诺基亚E66" class="goodsimg" /></a><br /> <p><a href="goods.php?id=9" title="诺基亚E66">诺基亚E66</a></p> <font class="f1"> ¥2298元 </font> </div> <div class="goodsItem"> <span class="best"></span> <a href="goods.php?id=8"><img src="images/200905/thumb_img/8_thumb_G_1241425513488.jpg" alt="飞利浦9@9v" class="goodsimg" /></a><br /> <p><a href="goods.php?id=8" title="飞利浦9@9v">飞利浦9@9v</a></p> <font class="f1"> ¥399元 </font> </div> <div class="goodsItem"> <span class="best"></span> <a href="goods.php?id=17"><img src="images/200905/thumb_img/17_thumb_G_1241969394587.jpg" alt="夏新N7" class="goodsimg" /></a><br /> <p><a href="goods.php?id=17" title="夏新N7">夏新N7</a></p> <font class="f1"> ¥2300元 </font> </div> <div class="goodsItem"> <span class="best"></span> <a href="goods.php?id=19"><img src="images/200905/thumb_img/19_thumb_G_1241970175208.jpg" alt="三星SGH-F258" class="goodsimg" /></a><br /> <p><a href="goods.php?id=19" title="三星SGH-F258">三星SGH-F...</a></p> <font class="f1"> ¥858元 </font> </div> <div class="goodsItem"> <span class="best"></span> <a href="goods.php?id=20"><img src="images/200905/thumb_img/20_thumb_G_1242106490058.jpg" alt="三星BC01" class="goodsimg" /></a><br /> <p><a href="goods.php?id=20" title="三星BC01">三星BC01</a></p> <font class="f1"> ¥280元 </font> </div> <div class="more"><a href="search.php?intro=best"><img src="themes/default/images/more.gif" /></a></div> </div> </div> </div> <div class="blank5"></div> <div class="box"> <div class="box_1"> <h3> <span>商品列表</span><a name='goods_list'></a> <form method="GET" class="sort" name="listform"> 显示方式: <a href="javascript:;" onClick="javascript:display_mode('list')"><img src="themes/default/images/display_mode_list.gif" alt=""></a> <a href="javascript:;" onClick="javascript:display_mode('grid')"><img src="themes/default/images/display_mode_grid_act.gif" alt=""></a> <a href="javascript:;" onClick="javascript:display_mode('text')"><img src="themes/default/images/display_mode_text.gif" alt=""></a>&nbsp;&nbsp; <a href="category.php?category=3&display=grid&brand=0&price_min=0&price_max=0&filter_attr=0&page=1&sort=goods_id&order=ASC#goods_list"><img src="themes/default/images/goods_id_DESC.gif" alt="按上架时间排序"></a> <a href="category.php?category=3&display=grid&brand=0&price_min=0&price_max=0&filter_attr=0&page=1&sort=shop_price&order=ASC#goods_list"><img src="themes/default/images/shop_price_default.gif" alt="按价格排序"></a> <a href="category.php?category=3&display=grid&brand=0&price_min=0&price_max=0&filter_attr=0&page=1&sort=last_update&order=DESC#goods_list"><img src="themes/default/images/last_update_default.gif" alt="按更新时间排序"></a> <input type="hidden" name="category" value="3" /> <input type="hidden" name="display" value="grid" id="display" /> <input type="hidden" name="brand" value="0" /> <input type="hidden" name="price_min" value="0" /> <input type="hidden" name="price_max" value="0" /> <input type="hidden" name="filter_attr" value="0" /> <input type="hidden" name="page" value="1" /> <input type="hidden" name="sort" value="goods_id" /> <input type="hidden" name="order" value="DESC" /> </form> </h3> <form name="compareForm" action="compare.php" method="post" onSubmit="return compareGoods(this);"> <div class="centerPadd"> <div class="clearfix goodsBox" style="border:none;"> <div class="goodsItem"> <a href="goods.php?id=32"><img src="images/200905/thumb_img/32_thumb_G_1242110760196.jpg" alt="诺基亚N85" class="goodsimg" /></a><br /> <p><a href="goods.php?id=32" title="诺基亚N85">诺基亚N85</a></p> 市场价<font class="market_s">¥3612元</font><br /> 本店价<font class="shop_s">¥3010元</font><br /> <a href="javascript:collect(32);" class="f6">收藏</a> | <a href="javascript:addToCart(32)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(32,'诺基亚N85','9')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=24"><img src="images/200905/thumb_img/24_thumb_G_1241971981429.jpg" alt="P806" class="goodsimg" /></a><br /> <p><a href="goods.php?id=24" title="P806">P806</a></p> 市场价<font class="market_s">¥2400元</font><br /> 本店价<font class="shop_s">¥2000元</font><br /> <a href="javascript:collect(24);" class="f6">收藏</a> | <a href="javascript:addToCart(24)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(24,'P806','9')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=22"><img src="images/200905/thumb_img/22_thumb_G_1241971076803.jpg" alt="多普达Touc..." class="goodsimg" /></a><br /> <p><a href="goods.php?id=22" title="多普达Touch HD">多普达Touc...</a></p> 市场价<font class="market_s">¥7199元</font><br /> 本店价<font class="shop_s">¥5999元</font><br /> <a href="javascript:collect(22);" class="f6">收藏</a> | <a href="javascript:addToCart(22)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(22,'多普达Touc...','9')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=21"><img src="images/200905/thumb_img/21_thumb_G_1242109298150.jpg" alt="金立 A30" class="goodsimg" /></a><br /> <p><a href="goods.php?id=21" title="金立 A30">金立 A30</a></p> 市场价<font class="market_s">¥2400元</font><br /> 本店价<font class="shop_s">¥2000元</font><br /> <a href="javascript:collect(21);" class="f6">收藏</a> | <a href="javascript:addToCart(21)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(21,'金立 A30','9')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=20"><img src="images/200905/thumb_img/20_thumb_G_1242106490058.jpg" alt="三星BC01" class="goodsimg" /></a><br /> <p><a href="goods.php?id=20" title="三星BC01">三星BC01</a></p> 市场价<font class="market_s">¥336元</font><br /> 本店价<font class="shop_s">¥280元</font><br /> <a href="javascript:collect(20);" class="f6">收藏</a> | <a href="javascript:addToCart(20)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(20,'三星BC01','9')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=19"><img src="images/200905/thumb_img/19_thumb_G_1241970175208.jpg" alt="三星SGH-F..." class="goodsimg" /></a><br /> <p><a href="goods.php?id=19" title="三星SGH-F258">三星SGH-F...</a></p> 市场价<font class="market_s">¥1030元</font><br /> 本店价<font class="shop_s">¥858元</font><br /> <a href="javascript:collect(19);" class="f6">收藏</a> | <a href="javascript:addToCart(19)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(19,'三星SGH-F...','9')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=17"><img src="images/200905/thumb_img/17_thumb_G_1241969394587.jpg" alt="夏新N7" class="goodsimg" /></a><br /> <p><a href="goods.php?id=17" title="夏新N7">夏新N7</a></p> 市场价<font class="market_s">¥2760元</font><br /> 本店价<font class="shop_s">¥2300元</font><br /> <a href="javascript:collect(17);" class="f6">收藏</a> | <a href="javascript:addToCart(17)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(17,'夏新N7','9')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=13"><img src="images/200905/thumb_img/13_thumb_G_1241968002527.jpg" alt="诺基亚5320..." class="goodsimg" /></a><br /> <p><a href="goods.php?id=13" title="诺基亚5320 XpressMusic">诺基亚5320...</a></p> 市场价<font class="market_s">¥1573元</font><br /> 本店价<font class="shop_s">¥1311元</font><br /> <a href="javascript:collect(13);" class="f6">收藏</a> | <a href="javascript:addToCart(13)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(13,'诺基亚5320...','9')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=12"><img src="images/200905/thumb_img/12_thumb_G_1241965978410.jpg" alt="摩托罗拉A81..." class="goodsimg" /></a><br /> <p><a href="goods.php?id=12" title="摩托罗拉A810">摩托罗拉A81...</a></p> 市场价<font class="market_s">¥1180元</font><br /> 本店价<font class="shop_s">¥983元</font><br /> <a href="javascript:collect(12);" class="f6">收藏</a> | <a href="javascript:addToCart(12)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(12,'摩托罗拉A81...','3')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=10"><img src="images/200905/thumb_img/10_thumb_G_1242973436403.jpg" alt="索爱C702c" class="goodsimg" /></a><br /> <p><a href="goods.php?id=10" title="索爱C702c">索爱C702c</a></p> 市场价<font class="market_s">¥1594元</font><br /> 本店价<font class="shop_s">¥1328元</font><br /> <a href="javascript:collect(10);" class="f6">收藏</a> | <a href="javascript:addToCart(10)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(10,'索爱C702c','9')" class="f6">比较</a> </div> </div> </div> </form> </div> </div> <div class="blank5"></div> <script type="Text/Javascript" language="JavaScript"> <!-- function selectPage(sel) { sel.form.submit(); } //--> </script> <script type="text/javascript"> window.onload = function() { Compare.init(); fixpng(); } var button_compare = ''; var exist = "您已经选择了%s"; var count_limit = "最多只能选择4个商品进行对比"; var goods_type_different = "\"%s\"和已选择商品类型不同无法进行对比"; var compare_no_goods = "您没有选定任何需要比较的商品或者比较的商品数少于 2 个。"; var btn_buy = "购买"; var is_cancel = "取消"; var select_spe = "请选择商品属性"; </script> <form name="selectPageForm" action="/zshop/category.php" method="get"> <div id="pager" class="pagebar"> <span class="f_l f6" style="margin-right:10px;">总计 <b>12</b> 个记录</span> <span class="page_now">1</span> <a href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;page=2&amp;sort=goods_id&amp;order=DESC">[2]</a> <a class="next" href="category.php?id=3&amp;price_min=0&amp;price_max=0&amp;page=2&amp;sort=goods_id&amp;order=DESC">下一页</a> </div> </form> <script type="Text/Javascript" language="JavaScript"> <!-- function selectPage(sel) { sel.form.submit(); } //--> </script> </div> </div> <div class="blank5"></div> <div class="block"> <div class="box"> <div class="helpTitBg clearfix"> <dl> <dt><a href='article_cat.php?id=5' title="新手上路 ">新手上路 </a></dt> <dd><a href="article.php?id=9" title="售后流程">售后流程</a></dd> <dd><a href="article.php?id=10" title="购物流程">购物流程</a></dd> <dd><a href="article.php?id=11" title="订购方式">订购方式</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=6' title="手机常识 ">手机常识 </a></dt> <dd><a href="article.php?id=12" title="如何分辨原装电池">如何分辨原装电池</a></dd> <dd><a href="article.php?id=13" title="如何分辨水货手机 ">如何分辨水货手机</a></dd> <dd><a href="article.php?id=14" title="如何享受全国联保">如何享受全国联保</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=7' title="配送与支付 ">配送与支付 </a></dt> <dd><a href="article.php?id=15" title="货到付款区域">货到付款区域</a></dd> <dd><a href="article.php?id=16" title="配送支付智能查询 ">配送支付智能查询</a></dd> <dd><a href="article.php?id=17" title="支付方式说明">支付方式说明</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=10' title="会员中心">会员中心</a></dt> <dd><a href="article.php?id=18" title="资金管理">资金管理</a></dd> <dd><a href="article.php?id=19" title="我的收藏">我的收藏</a></dd> <dd><a href="article.php?id=20" title="我的订单">我的订单</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=8' title="服务保证 ">服务保证 </a></dt> <dd><a href="article.php?id=21" title="退换货原则">退换货原则</a></dd> <dd><a href="article.php?id=22" title="售后服务保证 ">售后服务保证</a></dd> <dd><a href="article.php?id=23" title="产品质量保证 ">产品质量保证</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=9' title="联系我们 ">联系我们 </a></dt> <dd><a href="article.php?id=24" title="网站故障报告">网站故障报告</a></dd> <dd><a href="article.php?id=25" title="选机咨询 ">选机咨询</a></dd> <dd><a href="article.php?id=26" title="投诉与建议 ">投诉与建议</a></dd> </dl> </div> </div> </div> <div class="blank"></div> <div class="blank"></div> <div id="bottomNav" class="box"> <div class="box_1"> <div class="bNavList clearfix"> <div class="f_l"> <a href="article.php?id=1" >免责条款</a> - <a href="article.php?id=2" >隐私保护</a> - <a href="article.php?id=3" >咨询热点</a> - <a href="article.php?id=4" >联系我们</a> - <a href="article.php?id=5" >公司简介</a> - <a href="wholesale.php" >批发方案</a> - <a href="myship.php" >配送方式</a> </div> <div class="f_r"> <a href="#top"><img src="themes/default/images/bnt_top.gif" /></a> <a href="index.php"><img src="themes/default/images/bnt_home.gif" /></a> </div> </div> </div> </div> <div class="blank"></div> <div id="footer"> <div class="text"> &copy; 2005-2011 ECSHOP 版权所有,并保留所有权利。<br /> <br /> 554fcae493e564ee0dc75bdf2ebf94caquery_info|a:1:{s:4:"name";s:10:"query_info";}554fcae493e564ee0dc75bdf2ebf94ca<br /> <a href="http://www.ecshop.com" target="_blank" style=" font-family:Verdana; font-size:11px;">Powered&nbsp;by&nbsp;<strong><span style="color: #3366FF">ECShop</span>&nbsp;<span style="color: #FF9966">v2.7.2</span></strong></a>&nbsp;<br /> <div align="left" id="rss"><a href="feed.php?cat=3"><img src="themes/default/images/xml_rss2.gif" alt="rss" /></a></div> </div> </div> </body> </html>
zzshop
trunk/temp/caches/5/category_8DC5F798.php
PHP
asf20
27,924
<?php exit;?>a:3:{s:8:"template";a:11:{i:0;s:49:"C:/xampp/htdocs/zshop/themes/default/category.dwt";i:1;s:60:"C:/xampp/htdocs/zshop/themes/default/library/page_header.lbi";i:2;s:56:"C:/xampp/htdocs/zshop/themes/default/library/ur_here.lbi";i:3;s:53:"C:/xampp/htdocs/zshop/themes/default/library/cart.lbi";i:4;s:62:"C:/xampp/htdocs/zshop/themes/default/library/category_tree.lbi";i:5;s:56:"C:/xampp/htdocs/zshop/themes/default/library/history.lbi";i:6;s:63:"C:/xampp/htdocs/zshop/themes/default/library/recommend_best.lbi";i:7;s:59:"C:/xampp/htdocs/zshop/themes/default/library/goods_list.lbi";i:8;s:54:"C:/xampp/htdocs/zshop/themes/default/library/pages.lbi";i:9;s:53:"C:/xampp/htdocs/zshop/themes/default/library/help.lbi";i:10;s:60:"C:/xampp/htdocs/zshop/themes/default/library/page_footer.lbi";}s:7:"expires";i:1299766027;s:8:"maketime";i:1299762427;}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="Generator" content="ECSHOP v2.7.2" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Keywords" content="" /> <meta name="Description" content="" /> <title>双模手机_手机类型_ECSHOP演示站 - Powered by ECShop</title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="icon" href="animated_favicon.gif" type="image/gif" /> <link href="themes/default/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/common.js"></script><script type="text/javascript" src="js/global.js"></script><script type="text/javascript" src="js/compare.js"></script></head> <body> <script type="text/javascript"> var process_request = "正在处理您的请求..."; </script> <div class="block clearfix"> <div class="f_l"><a href="index.php" name="top"><img src="themes/default/images/logo.gif" /></a></div> <div class="f_r log"> <ul> <li class="userInfo"> <script type="text/javascript" src="js/transport.js"></script><script type="text/javascript" src="js/utils.js"></script> <font id="ECS_MEMBERZONE">554fcae493e564ee0dc75bdf2ebf94camember_info|a:1:{s:4:"name";s:11:"member_info";}554fcae493e564ee0dc75bdf2ebf94ca </font> </li> <li id="topNav" class="clearfix"> <a href="flow.php" >查看购物车</a> | <a href="pick_out.php" >选购中心</a> | <a href="tag_cloud.php" >标签云</a> | <a href="quotation.php" >报价单</a> <div class="topNavR"></div> </li> </ul> </div> </div> <div class="blank"></div> <div id="mainNav" class="clearfix"> <a href="index.php">首页<span></span></a> <a href="category.php?id=3" >GSM手机<span></span></a> <a href="category.php?id=5" class="cur">双模手机<span></span></a> <a href="category.php?id=6" >手机配件<span></span></a> <a href="group_buy.php" >团购商品<span></span></a> <a href="activity.php" >优惠活动<span></span></a> <a href="snatch.php" >夺宝奇兵<span></span></a> <a href="auction.php" >拍卖活动<span></span></a> <a href="exchange.php" >积分商城<span></span></a> <a href="message.php" >留言板<span></span></a> <a href="http://bbs.ecshop.com/" target="_blank" >EC论坛<span></span></a> </div> <div id="search" class="clearfix"> <div class="keys f_l"> <script type="text/javascript"> <!-- function checkSearchForm() { if(document.getElementById('keyword').value) { return true; } else { alert("请输入搜索关键词!"); return false; } } --> </script> </div> <form id="searchForm" name="searchForm" method="get" action="search.php" onSubmit="return checkSearchForm()" class="f_r" style="_position:relative; top:5px;"> <select name="category" id="category" class="B_input"> <option value="0">所有分类</option> <option value="6" >手机配件</option><option value="9" >&nbsp;&nbsp;&nbsp;&nbsp;电池</option><option value="11" >&nbsp;&nbsp;&nbsp;&nbsp;读卡器和内存卡</option><option value="7" >&nbsp;&nbsp;&nbsp;&nbsp;充电器</option><option value="8" >&nbsp;&nbsp;&nbsp;&nbsp;耳机</option><option value="1" >手机类型</option><option value="5" >&nbsp;&nbsp;&nbsp;&nbsp;双模手机</option><option value="2" >&nbsp;&nbsp;&nbsp;&nbsp;CDMA手机</option><option value="3" >&nbsp;&nbsp;&nbsp;&nbsp;GSM手机</option><option value="4" >&nbsp;&nbsp;&nbsp;&nbsp;3G手机</option><option value="12" >充值卡</option><option value="13" >&nbsp;&nbsp;&nbsp;&nbsp;小灵通/固话充值卡</option><option value="14" >&nbsp;&nbsp;&nbsp;&nbsp;移动手机充值卡</option><option value="15" >&nbsp;&nbsp;&nbsp;&nbsp;联通手机充值卡</option> </select> <input name="keywords" type="text" id="keyword" value="" class="B_input" style="width:110px;"/> <input name="imageField" type="submit" value="" class="go" style="cursor:pointer;" /> <a href="search.php?act=advanced_search">高级搜索</a> </form> </div> <div class="block box"> <div id="ur_here"> 当前位置: <a href=".">首页</a> <code>&gt;</code> <a href="category.php?id=1">手机类型</a> <code>&gt;</code> <a href="category.php?id=5">双模手机</a> </div> </div> <div class="blank"></div> <div class="block clearfix"> <div class="AreaL"> <div class="cart" id="ECS_CARTINFO"> 554fcae493e564ee0dc75bdf2ebf94cacart_info|a:1:{s:4:"name";s:9:"cart_info";}554fcae493e564ee0dc75bdf2ebf94ca</div> <div class="blank5"></div> <div class="box"> <div class="box_1"> <div id="category_tree"> <dl> <dt><a href="category.php?id=2">CDMA手机</a></dt> </dl> <dl> <dt><a href="category.php?id=3">GSM手机</a></dt> </dl> <dl> <dt><a href="category.php?id=4">3G手机</a></dt> </dl> <dl> <dt><a href="category.php?id=5">双模手机</a></dt> </dl> </div> </div> </div> <div class="blank5"></div> <div class="box" id='history_div'> <div class="box_1"> <h3><span>浏览历史</span></h3> <div class="boxCenterList clearfix" id='history_list'> 554fcae493e564ee0dc75bdf2ebf94cahistory|a:1:{s:4:"name";s:7:"history";}554fcae493e564ee0dc75bdf2ebf94ca </div> </div> </div> <div class="blank5"></div> <script type="text/javascript"> if (document.getElementById('history_list').innerHTML.replace(/\s/g,'').length<1) { document.getElementById('history_div').style.display='none'; } else { document.getElementById('history_div').style.display='block'; } function clear_history() { Ajax.call('user.php', 'act=clear_history',clear_history_Response, 'GET', 'TEXT',1,1); } function clear_history_Response(res) { document.getElementById('history_list').innerHTML = '您已清空最近浏览过的商品'; } </script> </div> <div class="AreaR"> <div class="box"> <div class="box_1"> <h3><span>商品筛选</span></h3> <div class="screeBox"> <strong>品牌:</strong> <span>全部</span> <a href="category.php?id=5&amp;brand=1&amp;price_min=0&amp;price_max=0">诺基亚</a>&nbsp; <a href="category.php?id=5&amp;brand=4&amp;price_min=0&amp;price_max=0">飞利浦</a>&nbsp; </div> <div class="screeBox"> <strong>价格:</strong> <span>全部</span> <a href="category.php?id=5&amp;price_min=300&amp;price_max=1000">300&nbsp;-&nbsp;1000</a>&nbsp; <a href="category.php?id=5&amp;price_min=3100&amp;price_max=3800">3100&nbsp;-&nbsp;3800</a>&nbsp; </div> </div> </div> <div class="blank5"></div> <div class="box"> <div class="box_2 centerPadd"> <div class="itemTit" id="itemBest"> </div> <div id="show_best_area" class="clearfix goodsBox"> <div class="goodsItem"> <span class="best"></span> <a href="goods.php?id=8"><img src="images/200905/thumb_img/8_thumb_G_1241425513488.jpg" alt="飞利浦9@9v" class="goodsimg" /></a><br /> <p><a href="goods.php?id=8" title="飞利浦9@9v">飞利浦9@9v</a></p> <font class="f1"> ¥399元 </font> </div> <div class="goodsItem"> <span class="best"></span> <a href="goods.php?id=23"><img src="images/200905/thumb_img/23_thumb_G_1241971556399.jpg" alt="诺基亚N96" class="goodsimg" /></a><br /> <p><a href="goods.php?id=23" title="诺基亚N96">诺基亚N96</a></p> <font class="f1"> ¥3700元 </font> </div> <div class="more"><a href="search.php?intro=best"><img src="themes/default/images/more.gif" /></a></div> </div> </div> </div> <div class="blank5"></div> <div class="box"> <div class="box_1"> <h3> <span>商品列表</span><a name='goods_list'></a> <form method="GET" class="sort" name="listform"> 显示方式: <a href="javascript:;" onClick="javascript:display_mode('list')"><img src="themes/default/images/display_mode_list.gif" alt=""></a> <a href="javascript:;" onClick="javascript:display_mode('grid')"><img src="themes/default/images/display_mode_grid_act.gif" alt=""></a> <a href="javascript:;" onClick="javascript:display_mode('text')"><img src="themes/default/images/display_mode_text.gif" alt=""></a>&nbsp;&nbsp; <a href="category.php?category=5&display=grid&brand=0&price_min=0&price_max=0&filter_attr=0&page=1&sort=goods_id&order=ASC#goods_list"><img src="themes/default/images/goods_id_DESC.gif" alt="按上架时间排序"></a> <a href="category.php?category=5&display=grid&brand=0&price_min=0&price_max=0&filter_attr=0&page=1&sort=shop_price&order=ASC#goods_list"><img src="themes/default/images/shop_price_default.gif" alt="按价格排序"></a> <a href="category.php?category=5&display=grid&brand=0&price_min=0&price_max=0&filter_attr=0&page=1&sort=last_update&order=DESC#goods_list"><img src="themes/default/images/last_update_default.gif" alt="按更新时间排序"></a> <input type="hidden" name="category" value="5" /> <input type="hidden" name="display" value="grid" id="display" /> <input type="hidden" name="brand" value="0" /> <input type="hidden" name="price_min" value="0" /> <input type="hidden" name="price_max" value="0" /> <input type="hidden" name="filter_attr" value="0" /> <input type="hidden" name="page" value="1" /> <input type="hidden" name="sort" value="goods_id" /> <input type="hidden" name="order" value="DESC" /> </form> </h3> <form name="compareForm" action="compare.php" method="post" onSubmit="return compareGoods(this);"> <div class="centerPadd"> <div class="clearfix goodsBox" style="border:none;"> <div class="goodsItem"> <a href="goods.php?id=23"><img src="images/200905/thumb_img/23_thumb_G_1241971556399.jpg" alt="诺基亚N96" class="goodsimg" /></a><br /> <p><a href="goods.php?id=23" title="诺基亚N96">诺基亚N96</a></p> 市场价<font class="market_s">¥4440元</font><br /> 本店价<font class="shop_s">¥3700元</font><br /> <a href="javascript:collect(23);" class="f6">收藏</a> | <a href="javascript:addToCart(23)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(23,'诺基亚N96','9')" class="f6">比较</a> </div> <div class="goodsItem"> <a href="goods.php?id=8"><img src="images/200905/thumb_img/8_thumb_G_1241425513488.jpg" alt="飞利浦9@9v" class="goodsimg" /></a><br /> <p><a href="goods.php?id=8" title="飞利浦9@9v">飞利浦9@9v</a></p> 市场价<font class="market_s">¥479元</font><br /> 本店价<font class="shop_s">¥399元</font><br /> <a href="javascript:collect(8);" class="f6">收藏</a> | <a href="javascript:addToCart(8)" class="f6">购买</a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(8,'飞利浦9@9v','9')" class="f6">比较</a> </div> </div> </div> </form> </div> </div> <div class="blank5"></div> <script type="Text/Javascript" language="JavaScript"> <!-- function selectPage(sel) { sel.form.submit(); } //--> </script> <script type="text/javascript"> window.onload = function() { Compare.init(); fixpng(); } var button_compare = ''; var exist = "您已经选择了%s"; var count_limit = "最多只能选择4个商品进行对比"; var goods_type_different = "\"%s\"和已选择商品类型不同无法进行对比"; var compare_no_goods = "您没有选定任何需要比较的商品或者比较的商品数少于 2 个。"; var btn_buy = "购买"; var is_cancel = "取消"; var select_spe = "请选择商品属性"; </script> <form name="selectPageForm" action="/zshop/category.php" method="get"> <div id="pager" class="pagebar"> <span class="f_l f6" style="margin-right:10px;">总计 <b>2</b> 个记录</span> </div> </form> <script type="Text/Javascript" language="JavaScript"> <!-- function selectPage(sel) { sel.form.submit(); } //--> </script> </div> </div> <div class="blank5"></div> <div class="block"> <div class="box"> <div class="helpTitBg clearfix"> <dl> <dt><a href='article_cat.php?id=5' title="新手上路 ">新手上路 </a></dt> <dd><a href="article.php?id=9" title="售后流程">售后流程</a></dd> <dd><a href="article.php?id=10" title="购物流程">购物流程</a></dd> <dd><a href="article.php?id=11" title="订购方式">订购方式</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=6' title="手机常识 ">手机常识 </a></dt> <dd><a href="article.php?id=12" title="如何分辨原装电池">如何分辨原装电池</a></dd> <dd><a href="article.php?id=13" title="如何分辨水货手机 ">如何分辨水货手机</a></dd> <dd><a href="article.php?id=14" title="如何享受全国联保">如何享受全国联保</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=7' title="配送与支付 ">配送与支付 </a></dt> <dd><a href="article.php?id=15" title="货到付款区域">货到付款区域</a></dd> <dd><a href="article.php?id=16" title="配送支付智能查询 ">配送支付智能查询</a></dd> <dd><a href="article.php?id=17" title="支付方式说明">支付方式说明</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=10' title="会员中心">会员中心</a></dt> <dd><a href="article.php?id=18" title="资金管理">资金管理</a></dd> <dd><a href="article.php?id=19" title="我的收藏">我的收藏</a></dd> <dd><a href="article.php?id=20" title="我的订单">我的订单</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=8' title="服务保证 ">服务保证 </a></dt> <dd><a href="article.php?id=21" title="退换货原则">退换货原则</a></dd> <dd><a href="article.php?id=22" title="售后服务保证 ">售后服务保证</a></dd> <dd><a href="article.php?id=23" title="产品质量保证 ">产品质量保证</a></dd> </dl> <dl> <dt><a href='article_cat.php?id=9' title="联系我们 ">联系我们 </a></dt> <dd><a href="article.php?id=24" title="网站故障报告">网站故障报告</a></dd> <dd><a href="article.php?id=25" title="选机咨询 ">选机咨询</a></dd> <dd><a href="article.php?id=26" title="投诉与建议 ">投诉与建议</a></dd> </dl> </div> </div> </div> <div class="blank"></div> <div class="blank"></div> <div id="bottomNav" class="box"> <div class="box_1"> <div class="bNavList clearfix"> <div class="f_l"> <a href="article.php?id=1" >免责条款</a> - <a href="article.php?id=2" >隐私保护</a> - <a href="article.php?id=3" >咨询热点</a> - <a href="article.php?id=4" >联系我们</a> - <a href="article.php?id=5" >公司简介</a> - <a href="wholesale.php" >批发方案</a> - <a href="myship.php" >配送方式</a> </div> <div class="f_r"> <a href="#top"><img src="themes/default/images/bnt_top.gif" /></a> <a href="index.php"><img src="themes/default/images/bnt_home.gif" /></a> </div> </div> </div> </div> <div class="blank"></div> <div id="footer"> <div class="text"> &copy; 2005-2011 ECSHOP 版权所有,并保留所有权利。<br /> <br /> 554fcae493e564ee0dc75bdf2ebf94caquery_info|a:1:{s:4:"name";s:10:"query_info";}554fcae493e564ee0dc75bdf2ebf94ca<br /> <a href="http://www.ecshop.com" target="_blank" style=" font-family:Verdana; font-size:11px;">Powered&nbsp;by&nbsp;<strong><span style="color: #3366FF">ECShop</span>&nbsp;<span style="color: #FF9966">v2.7.2</span></strong></a>&nbsp;<br /> <div align="left" id="rss"><a href="feed.php?cat=5"><img src="themes/default/images/xml_rss2.gif" alt="rss" /></a></div> </div> </div> </body> </html>
zzshop
trunk/temp/caches/f/category_90279E9D.php
PHP
asf20
17,568
<?php if ($this->_var['hot_goods']): ?> <?php if ($this->_var['cat_rec_sign'] != 1): ?> <div class="box"> <div class="box_2 centerPadd"> <div class="itemTit Hot" id="itemHot"> <?php if ($this->_var['cat_rec'] [ 3 ]): ?> <h2><a href="javascript:void(0)" onclick="change_tab_style('itemHot', 'h2', this);get_cat_recommend(3, 0);"><?php echo $this->_var['lang']['all_goods']; ?></a></h2> <?php $_from = $this->_var['cat_rec']['3']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'rec_data_0_56152300_1299760685');if (count($_from)): foreach ($_from AS $this->_var['rec_data_0_56152300_1299760685']): ?> <h2 class="h2bg"><a href="javascript:void(0)" onclick="change_tab_style('itemHot', 'h2', this);get_cat_recommend(3, <?php echo $this->_var['rec_data_0_56152300_1299760685']['cat_id']; ?>)"><?php echo $this->_var['rec_data_0_56152300_1299760685']['cat_name']; ?></a></h2> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?> </div> <div id="show_hot_area" class="clearfix goodsBox"> <?php endif; ?> <?php $_from = $this->_var['hot_goods']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods_0_56194200_1299760685');if (count($_from)): foreach ($_from AS $this->_var['goods_0_56194200_1299760685']): ?> <div class="goodsItem"> <span class="hot"></span> <a href="<?php echo $this->_var['goods_0_56194200_1299760685']['url']; ?>"><img src="<?php echo $this->_var['goods_0_56194200_1299760685']['thumb']; ?>" alt="<?php echo htmlspecialchars($this->_var['goods_0_56194200_1299760685']['name']); ?>" class="goodsimg" /></a><br /> <p><a href="<?php echo $this->_var['goods_0_56194200_1299760685']['url']; ?>" title="<?php echo htmlspecialchars($this->_var['goods_0_56194200_1299760685']['name']); ?>"><?php echo $this->_var['goods_0_56194200_1299760685']['short_style_name']; ?></a></p> <font class="f1"> <?php if ($this->_var['goods_0_56194200_1299760685']['promote_price'] != ""): ?> <?php echo $this->_var['goods_0_56194200_1299760685']['promote_price']; ?> <?php else: ?> <?php echo $this->_var['goods_0_56194200_1299760685']['shop_price']; ?> <?php endif; ?> </font> </div> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <div class="more"><a href="search.php?intro=hot"><img src="themes/default/images/more.gif" /></a></div> <?php if ($this->_var['cat_rec_sign'] != 1): ?> </div> </div> </div> <div class="blank5"></div> <?php endif; ?> <?php endif; ?>
zzshop
trunk/temp/compiled/recommend_hot.lbi.php
PHP
asf20
2,726
<div class="box"> <div class="box_1"> <h3> <span><?php echo $this->_var['lang']['goods_list']; ?></span><a name='goods_list'></a> <form method="GET" class="sort" name="listform"> <?php echo $this->_var['lang']['btn_display']; ?>: <a href="javascript:;" onClick="javascript:display_mode('list')"><img src="themes/default/images/display_mode_list<?php if ($this->_var['pager']['display'] == 'list'): ?>_act<?php endif; ?>.gif" alt="<?php echo $this->_var['lang']['display']['list']; ?>"></a> <a href="javascript:;" onClick="javascript:display_mode('grid')"><img src="themes/default/images/display_mode_grid<?php if ($this->_var['pager']['display'] == 'grid'): ?>_act<?php endif; ?>.gif" alt="<?php echo $this->_var['lang']['display']['grid']; ?>"></a> <a href="javascript:;" onClick="javascript:display_mode('text')"><img src="themes/default/images/display_mode_text<?php if ($this->_var['pager']['display'] == 'text'): ?>_act<?php endif; ?>.gif" alt="<?php echo $this->_var['lang']['display']['text']; ?>"></a>&nbsp;&nbsp; <a href="<?php echo $this->_var['script_name']; ?>.php?category=<?php echo $this->_var['category']; ?>&display=<?php echo $this->_var['pager']['display']; ?>&brand=<?php echo $this->_var['brand_id']; ?>&price_min=<?php echo $this->_var['price_min']; ?>&price_max=<?php echo $this->_var['price_max']; ?>&filter_attr=<?php echo $this->_var['filter_attr']; ?>&page=<?php echo $this->_var['pager']['page']; ?>&sort=goods_id&order=<?php if ($this->_var['pager']['sort'] == 'goods_id' && $this->_var['pager']['order'] == 'DESC'): ?>ASC<?php else: ?>DESC<?php endif; ?>#goods_list"><img src="themes/default/images/goods_id_<?php if ($this->_var['pager']['sort'] == 'goods_id'): ?><?php echo $this->_var['pager']['order']; ?><?php else: ?>default<?php endif; ?>.gif" alt="<?php echo $this->_var['lang']['sort']['goods_id']; ?>"></a> <a href="<?php echo $this->_var['script_name']; ?>.php?category=<?php echo $this->_var['category']; ?>&display=<?php echo $this->_var['pager']['display']; ?>&brand=<?php echo $this->_var['brand_id']; ?>&price_min=<?php echo $this->_var['price_min']; ?>&price_max=<?php echo $this->_var['price_max']; ?>&filter_attr=<?php echo $this->_var['filter_attr']; ?>&page=<?php echo $this->_var['pager']['page']; ?>&sort=shop_price&order=<?php if ($this->_var['pager']['sort'] == 'shop_price' && $this->_var['pager']['order'] == 'ASC'): ?>DESC<?php else: ?>ASC<?php endif; ?>#goods_list"><img src="themes/default/images/shop_price_<?php if ($this->_var['pager']['sort'] == 'shop_price'): ?><?php echo $this->_var['pager']['order']; ?><?php else: ?>default<?php endif; ?>.gif" alt="<?php echo $this->_var['lang']['sort']['shop_price']; ?>"></a> <a href="<?php echo $this->_var['script_name']; ?>.php?category=<?php echo $this->_var['category']; ?>&display=<?php echo $this->_var['pager']['display']; ?>&brand=<?php echo $this->_var['brand_id']; ?>&price_min=<?php echo $this->_var['price_min']; ?>&price_max=<?php echo $this->_var['price_max']; ?>&filter_attr=<?php echo $this->_var['filter_attr']; ?>&page=<?php echo $this->_var['pager']['page']; ?>&sort=last_update&order=<?php if ($this->_var['pager']['sort'] == 'last_update' && $this->_var['pager']['order'] == 'DESC'): ?>ASC<?php else: ?>DESC<?php endif; ?>#goods_list"><img src="themes/default/images/last_update_<?php if ($this->_var['pager']['sort'] == 'last_update'): ?><?php echo $this->_var['pager']['order']; ?><?php else: ?>default<?php endif; ?>.gif" alt="<?php echo $this->_var['lang']['sort']['last_update']; ?>"></a> <input type="hidden" name="category" value="<?php echo $this->_var['category']; ?>" /> <input type="hidden" name="display" value="<?php echo $this->_var['pager']['display']; ?>" id="display" /> <input type="hidden" name="brand" value="<?php echo $this->_var['brand_id']; ?>" /> <input type="hidden" name="price_min" value="<?php echo $this->_var['price_min']; ?>" /> <input type="hidden" name="price_max" value="<?php echo $this->_var['price_max']; ?>" /> <input type="hidden" name="filter_attr" value="<?php echo $this->_var['filter_attr']; ?>" /> <input type="hidden" name="page" value="<?php echo $this->_var['pager']['page']; ?>" /> <input type="hidden" name="sort" value="<?php echo $this->_var['pager']['sort']; ?>" /> <input type="hidden" name="order" value="<?php echo $this->_var['pager']['order']; ?>" /> </form> </h3> <?php if ($this->_var['category'] > 0): ?> <form name="compareForm" action="compare.php" method="post" onSubmit="return compareGoods(this);"> <?php endif; ?> <?php if ($this->_var['pager']['display'] == 'list'): ?> <div class="goodsList"> <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');$this->_foreach['goods_list'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['goods_list']['total'] > 0): foreach ($_from AS $this->_var['goods']): $this->_foreach['goods_list']['iteration']++; ?> <ul class="clearfix bgcolor"<?php if (($this->_foreach['goods_list']['iteration'] - 1) % 2 == 0): ?>id=""<?php else: ?>id="bgcolor"<?php endif; ?>> <li> <br> <a href="javascript:;" id="compareLink" onClick="Compare.add(<?php echo $this->_var['goods']['goods_id']; ?>,'<?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?>','<?php echo $this->_var['goods']['type']; ?>')" class="f6">比较</a> </li> <li class="thumb"><a href="<?php echo $this->_var['goods']['url']; ?>"><img src="<?php echo $this->_var['goods']['goods_thumb']; ?>" alt="<?php echo $this->_var['goods']['goods_name']; ?>" /></a></li> <li class="goodsName"> <a href="<?php echo $this->_var['goods']['url']; ?>" class="f6"> <?php if ($this->_var['goods']['goods_style_name']): ?> <?php echo $this->_var['goods']['goods_style_name']; ?><br /> <?php else: ?> <?php echo $this->_var['goods']['goods_name']; ?><br /> <?php endif; ?> </a> <?php if ($this->_var['goods']['goods_brief']): ?> <?php echo $this->_var['lang']['goods_brief']; ?><?php echo $this->_var['goods']['goods_brief']; ?><br /> <?php endif; ?> </li> <li> <?php if ($this->_var['show_marketprice']): ?> <?php echo $this->_var['lang']['market_price']; ?><font class="market"><?php echo $this->_var['goods']['market_price']; ?></font><br /> <?php endif; ?> <?php if ($this->_var['goods']['promote_price'] != ""): ?> <?php echo $this->_var['lang']['promote_price']; ?><font class="shop"><?php echo $this->_var['goods']['promote_price']; ?></font><br /> <?php else: ?> <?php echo $this->_var['lang']['shop_price']; ?><font class="shop"><?php echo $this->_var['goods']['shop_price']; ?></font><br /> <?php endif; ?> </li> <li class="action"> <a href="javascript:collect(<?php echo $this->_var['goods']['goods_id']; ?>);" class="abg f6"><?php echo $this->_var['lang']['favourable_goods']; ?></a> <a href="javascript:addToCart(<?php echo $this->_var['goods']['goods_id']; ?>)"><img src="themes/default/images/bnt_buy_1.gif"></a> </li> </ul> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </div> <?php elseif ($this->_var['pager']['display'] == 'grid'): ?> <div class="centerPadd"> <div class="clearfix goodsBox" style="border:none;"> <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');if (count($_from)): foreach ($_from AS $this->_var['goods']): ?> <?php if ($this->_var['goods']['goods_id']): ?> <div class="goodsItem"> <a href="<?php echo $this->_var['goods']['url']; ?>"><img src="<?php echo $this->_var['goods']['goods_thumb']; ?>" alt="<?php echo $this->_var['goods']['goods_name']; ?>" class="goodsimg" /></a><br /> <p><a href="<?php echo $this->_var['goods']['url']; ?>" title="<?php echo htmlspecialchars($this->_var['goods']['name']); ?>"><?php echo $this->_var['goods']['goods_name']; ?></a></p> <?php if ($this->_var['show_marketprice']): ?> <?php echo $this->_var['lang']['market_prices']; ?><font class="market_s"><?php echo $this->_var['goods']['market_price']; ?></font><br /> <?php endif; ?> <?php if ($this->_var['goods']['promote_price'] != ""): ?> <?php echo $this->_var['lang']['promote_price']; ?><font class="shop_s"><?php echo $this->_var['goods']['promote_price']; ?></font><br /> <?php else: ?> <?php echo $this->_var['lang']['shop_prices']; ?><font class="shop_s"><?php echo $this->_var['goods']['shop_price']; ?></font><br /> <?php endif; ?> <a href="javascript:collect(<?php echo $this->_var['goods']['goods_id']; ?>);" class="f6"><?php echo $this->_var['lang']['btn_collect']; ?></a> | <a href="javascript:addToCart(<?php echo $this->_var['goods']['goods_id']; ?>)" class="f6"><?php echo $this->_var['lang']['btn_buy']; ?></a> | <a href="javascript:;" id="compareLink" onClick="Compare.add(<?php echo $this->_var['goods']['goods_id']; ?>,'<?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?>','<?php echo $this->_var['goods']['type']; ?>')" class="f6"><?php echo $this->_var['lang']['compare']; ?></a> </div> <?php endif; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </div> </div> <?php elseif ($this->_var['pager']['display'] == 'text'): ?> <div class="goodsList"> <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');if (count($_from)): foreach ($_from AS $this->_var['goods']): ?> <ul class="clearfix bgcolor"<?php if (($this->_foreach['goods_list']['iteration'] - 1) % 2 == 0): ?>id=""<?php else: ?>id="bgcolor"<?php endif; ?>> <li style="margin-right:15px;"> <a href="javascript:;" id="compareLink" onClick="Compare.add(<?php echo $this->_var['goods']['goods_id']; ?>,'<?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?>','<?php echo $this->_var['goods']['type']; ?>')" class="f6"><?php echo $this->_var['lang']['compare']; ?></a> </li> <li class="goodsName"> <a href="<?php echo $this->_var['goods']['url']; ?>" class="f6 f5"> <?php if ($this->_var['goods']['goods_style_name']): ?> <?php echo $this->_var['goods']['goods_style_name']; ?><br /> <?php else: ?> <?php echo $this->_var['goods']['goods_name']; ?><br /> <?php endif; ?> </a> <?php if ($this->_var['goods']['goods_brief']): ?> <?php echo $this->_var['lang']['goods_brief']; ?><?php echo $this->_var['goods']['goods_brief']; ?><br /> <?php endif; ?> </li> <li> <?php if ($this->_var['show_marketprice']): ?> <?php echo $this->_var['lang']['market_price']; ?><font class="market"><?php echo $this->_var['goods']['market_price']; ?></font><br /> <?php endif; ?> <?php if ($this->_var['goods']['promote_price'] != ""): ?> <?php echo $this->_var['lang']['promote_price']; ?><font class="shop"><?php echo $this->_var['goods']['promote_price']; ?></font><br /> <?php else: ?> <?php echo $this->_var['lang']['shop_price']; ?><font class="shop"><?php echo $this->_var['goods']['shop_price']; ?></font><br /> <?php endif; ?> </li> <li class="action"> <a href="javascript:collect(<?php echo $this->_var['goods']['goods_id']; ?>);" class="abg f6"><?php echo $this->_var['lang']['favourable_goods']; ?></a> <a href="javascript:addToCart(<?php echo $this->_var['goods']['goods_id']; ?>)"><img src="themes/default/images/bnt_buy_1.gif"></a> </li> </ul> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </div> <?php endif; ?> <?php if ($this->_var['category'] > 0): ?> </form> <?php endif; ?> </div> </div> <div class="blank5"></div> <script type="Text/Javascript" language="JavaScript"> <!-- function selectPage(sel) { sel.form.submit(); } //--> </script> <script type="text/javascript"> window.onload = function() { Compare.init(); fixpng(); } <?php $_from = $this->_var['lang']['compare_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> <?php if ($this->_var['key'] != 'button_compare'): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php else: ?> var button_compare = ''; <?php endif; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> var compare_no_goods = "<?php echo $this->_var['lang']['compare_no_goods']; ?>"; var btn_buy = "<?php echo $this->_var['lang']['btn_buy']; ?>"; var is_cancel = "<?php echo $this->_var['lang']['is_cancel']; ?>"; var select_spe = "<?php echo $this->_var['lang']['select_spe']; ?>"; </script>
zzshop
trunk/temp/compiled/goods_list.lbi.php
PHP
asf20
13,218
<?php echo $this->_var['lang']['ur_here']; ?> <?php echo $this->_var['ur_here']; ?>
zzshop
trunk/temp/compiled/ur_here.lbi.php
PHP
asf20
83
<?php if ($this->_var['best_goods']): ?> <?php if ($this->_var['cat_rec_sign'] != 1): ?> <div class="box"> <div class="box_2 centerPadd"> <div class="itemTit" id="itemBest"> <?php if ($this->_var['cat_rec'] [ 1 ]): ?> <h2><a href="javascript:void(0)" onclick="change_tab_style('itemBest', 'h2', this);get_cat_recommend(1, 0);"><?php echo $this->_var['lang']['all_goods']; ?></a></h2> <?php $_from = $this->_var['cat_rec']['1']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'rec_data');if (count($_from)): foreach ($_from AS $this->_var['rec_data']): ?> <h2 class="h2bg"><a href="javascript:void(0)" onclick="change_tab_style('itemBest', 'h2', this);get_cat_recommend(1, <?php echo $this->_var['rec_data']['cat_id']; ?>)"><?php echo $this->_var['rec_data']['cat_name']; ?></a></h2> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?> </div> <div id="show_best_area" class="clearfix goodsBox"> <?php endif; ?> <?php $_from = $this->_var['best_goods']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods_0_55318300_1299760685');if (count($_from)): foreach ($_from AS $this->_var['goods_0_55318300_1299760685']): ?> <div class="goodsItem"> <span class="best"></span> <a href="<?php echo $this->_var['goods_0_55318300_1299760685']['url']; ?>"><img src="<?php echo $this->_var['goods_0_55318300_1299760685']['thumb']; ?>" alt="<?php echo htmlspecialchars($this->_var['goods_0_55318300_1299760685']['name']); ?>" class="goodsimg" /></a><br /> <p><a href="<?php echo $this->_var['goods_0_55318300_1299760685']['url']; ?>" title="<?php echo htmlspecialchars($this->_var['goods_0_55318300_1299760685']['name']); ?>"><?php echo $this->_var['goods_0_55318300_1299760685']['short_style_name']; ?></a></p> <font class="f1"> <?php if ($this->_var['goods_0_55318300_1299760685']['promote_price'] != ""): ?> <?php echo $this->_var['goods_0_55318300_1299760685']['promote_price']; ?> <?php else: ?> <?php echo $this->_var['goods_0_55318300_1299760685']['shop_price']; ?> <?php endif; ?> </font> </div> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <div class="more"><a href="search.php?intro=best"><img src="themes/default/images/more.gif" /></a></div> <?php if ($this->_var['cat_rec_sign'] != 1): ?> </div> </div> </div> <div class="blank5"></div> <?php endif; ?> <?php endif; ?>
zzshop
trunk/temp/compiled/recommend_best.lbi.php
PHP
asf20
2,642
<?php $k = array ( 'name' => 'vote', ); echo $this->_echash . $k['name'] . '|' . serialize($k) . $this->_echash; ?>
zzshop
trunk/temp/compiled/vote_list.lbi.php
PHP
asf20
118
<?php echo $this->smarty_insert_scripts(array('files'=>'utils.js,transport.js')); ?> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td bgcolor="#ffffff"> <?php echo $this->_var['lang']['country_province']; ?>: <select name="country" id="selCountries_<?php echo $this->_var['sn']; ?>" onchange="region.changed(this, 1, 'selProvinces_<?php echo $this->_var['sn']; ?>')" style="border:1px solid #ccc;"> <option value="0"><?php echo $this->_var['lang']['please_select']; ?></option> <?php $_from = $this->_var['country_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'country');if (count($_from)): foreach ($_from AS $this->_var['country']): ?> <option value="<?php echo $this->_var['country']['region_id']; ?>" <?php if ($this->_var['choose']['country'] == $this->_var['country']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['country']['region_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> <select name="province" id="selProvinces_<?php echo $this->_var['sn']; ?>" onchange="region.changed(this, 2, 'selCities_<?php echo $this->_var['sn']; ?>')" style="border:1px solid #ccc;"> <option value="0"><?php echo $this->_var['lang']['please_select']; ?></option> <?php $_from = $this->_var['province_list'][$this->_var['sn']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'province');if (count($_from)): foreach ($_from AS $this->_var['province']): ?> <option value="<?php echo $this->_var['province']['region_id']; ?>" <?php if ($this->_var['choose']['province'] == $this->_var['province']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['province']['region_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> <select name="city" id="selCities_<?php echo $this->_var['sn']; ?>" onchange="region.changed(this, 3, 'selDistricts_<?php echo $this->_var['sn']; ?>')" style="border:1px solid #ccc;"> <option value="0"><?php echo $this->_var['lang']['please_select']; ?></option> <?php $_from = $this->_var['city_list'][$this->_var['sn']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'city');if (count($_from)): foreach ($_from AS $this->_var['city']): ?> <option value="<?php echo $this->_var['city']['region_id']; ?>" <?php if ($this->_var['choose']['city'] == $this->_var['city']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['city']['region_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> <select name="district" id="selDistricts_<?php echo $this->_var['sn']; ?>" <?php if (! $this->_var['district_list'][$this->_var['sn']]): ?>style="display:none"<?php endif; ?> style="border:1px solid #ccc;"> <option value="0"><?php echo $this->_var['lang']['please_select']; ?></option> <?php $_from = $this->_var['district_list'][$this->_var['sn']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'district');if (count($_from)): foreach ($_from AS $this->_var['district']): ?> <option value="<?php echo $this->_var['district']['region_id']; ?>" <?php if ($this->_var['choose']['district'] == $this->_var['district']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['district']['region_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> <input type="submit" name="Submit" class="bnt_blue_2" value="<?php echo $this->_var['lang']['search_ship']; ?>" /> <input type="hidden" name="act" value="viewship" /> </td> </tr> </table> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <th width="20%" bgcolor="#ffffff"><?php echo $this->_var['lang']['name']; ?></th> <th bgcolor="#ffffff"><?php echo $this->_var['lang']['describe']; ?></th> <th width="40%" bgcolor="#ffffff"><?php echo $this->_var['lang']['fee']; ?></th> <th width="15%" bgcolor="#ffffff"><?php echo $this->_var['lang']['insure_fee']; ?></th> </tr> <?php $_from = $this->_var['shipping_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'shipping');if (count($_from)): foreach ($_from AS $this->_var['shipping']): ?> <tr> <td valign="top" bgcolor="#ffffff"><strong><?php echo $this->_var['shipping']['shipping_name']; ?></strong></td> <td valign="top" bgcolor="#ffffff" ><?php echo $this->_var['shipping']['shipping_desc']; ?></td> <td valign="top" bgcolor="#ffffff"><?php echo $this->_var['shipping']['fee']; ?></td> <td align="center" valign="top" bgcolor="#ffffff"> <?php if ($this->_var['shipping']['insure'] != 0): ?> <?php echo $this->_var['shipping']['insure_formated']; ?> <?php else: ?> <?php echo $this->_var['lang']['not_support_insure']; ?> <?php endif; ?> </td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table>
zzshop
trunk/temp/compiled/myship.lbi.php
PHP
asf20
5,366
<?php if ($this->_var['pictures']): ?> <div class="clearfix"> <span onmouseover="moveLeft()" onmousedown="clickLeft()" onmouseup="moveLeft()" onmouseout="scrollStop()"></span> <div class="gallery"> <div id="demo"> <div id="demo1" style="float:left"> <ul> <?php $_from = $this->_var['pictures']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'picture');if (count($_from)): foreach ($_from AS $this->_var['picture']): ?> <li><a href="gallery.php?id=<?php echo $this->_var['id']; ?>&amp;img=<?php echo $this->_var['picture']['img_id']; ?>" target="_blank"><img src="<?php if ($this->_var['picture']['thumb_url']): ?><?php echo $this->_var['picture']['thumb_url']; ?><?php else: ?><?php echo $this->_var['picture']['img_url']; ?><?php endif; ?>" alt="<?php echo $this->_var['goods']['goods_name']; ?>" class="B_blue" /></a> </li> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </ul> </div> <div id="demo2" style="display:inline; overflow:visible;"></div> </div> </div> <span onmouseover="moveRight()" onmousedown="clickRight()" onmouseup="moveRight()" onmouseout="scrollStop()" class="spanR"></span> <script> function $gg(id){ return (document.getElementById) ? document.getElementById(id): document.all[id] } var boxwidth=53;//跟图片的实际尺寸相符 var box=$gg("demo"); var obox=$gg("demo1"); var dulbox=$gg("demo2"); obox.style.width=obox.getElementsByTagName("li").length*boxwidth+'px'; dulbox.style.width=obox.getElementsByTagName("li").length*boxwidth+'px'; box.style.width=obox.getElementsByTagName("li").length*boxwidth*3+'px'; var canroll = false; if (obox.getElementsByTagName("li").length >= 4) { canroll = true; dulbox.innerHTML=obox.innerHTML; } var step=5;temp=1;speed=50; var awidth=obox.offsetWidth; var mData=0; var isStop = 1; var dir = 1; function s(){ if (!canroll) return; if (dir) { if((awidth+mData)>=0) { mData=mData-step; } else { mData=-step; } } else { if(mData>=0) { mData=-awidth; } else { mData+=step; } } obox.style.marginLeft=mData+"px"; if (isStop) return; setTimeout(s,speed) } function moveLeft() { var wasStop = isStop; dir = 1; speed = 50; isStop=0; if (wasStop) { setTimeout(s,speed); } } function moveRight() { var wasStop = isStop; dir = 0; speed = 50; isStop=0; if (wasStop) { setTimeout(s,speed); } } function scrollStop() { isStop=1; } function clickLeft() { var wasStop = isStop; dir = 1; speed = 25; isStop=0; if (wasStop) { setTimeout(s,speed); } } function clickRight() { var wasStop = isStop; dir = 0; speed = 25; isStop=0; if (wasStop) { setTimeout(s,speed); } } </script> </div> <?php endif; ?>
zzshop
trunk/temp/compiled/goods_gallery.lbi.php
PHP
asf20
3,647
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="Generator" content="ECSHOP v2.7.2" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" /> <meta name="Description" content="<?php echo $this->_var['description']; ?>" /> <title><?php echo $this->_var['page_title']; ?></title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="icon" href="animated_favicon.gif" type="image/gif" /> <link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" /> <?php echo $this->smarty_insert_scripts(array('files'=>'common.js,global.js,compare.js')); ?> </head> <body> <?php echo $this->fetch('library/page_header.lbi'); ?> <div class="block box"> <div id="ur_here"> <?php echo $this->fetch('library/ur_here.lbi'); ?> </div> </div> <div class="blank"></div> <div class="block clearfix"> <div class="AreaL"> <?php echo $this->fetch('library/cart.lbi'); ?> <?php echo $this->fetch('library/category_tree.lbi'); ?> <?php echo $this->fetch('library/filter_attr.lbi'); ?> <?php echo $this->fetch('library/price_grade.lbi'); ?> <?php echo $this->fetch('library/history.lbi'); ?> </div> <div class="AreaR"> <?php echo $this->fetch('library/exchange_hot.lbi'); ?> <?php echo $this->fetch('library/exchange_list.lbi'); ?> <?php echo $this->fetch('library/pages.lbi'); ?> </div> </div> <div class="blank5"></div> <div class="block"> <div class="box"> <div class="helpTitBg clearfix"> <?php echo $this->fetch('library/help.lbi'); ?> </div> </div> </div> <div class="blank"></div> <?php if ($this->_var['img_links'] || $this->_var['txt_links']): ?> <div id="bottomNav" class="box"> <div class="box_1"> <div class="links clearfix"> <?php $_from = $this->_var['img_links']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'link');if (count($_from)): foreach ($_from AS $this->_var['link']): ?> <a href="<?php echo $this->_var['link']['url']; ?>" target="_blank" title="<?php echo $this->_var['link']['name']; ?>"><img src="<?php echo $this->_var['link']['logo']; ?>" alt="<?php echo $this->_var['link']['name']; ?>" border="0" /></a> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php if ($this->_var['txt_links']): ?> <?php $_from = $this->_var['txt_links']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'link');if (count($_from)): foreach ($_from AS $this->_var['link']): ?> [<a href="<?php echo $this->_var['link']['url']; ?>" target="_blank" title="<?php echo $this->_var['link']['name']; ?>"><?php echo $this->_var['link']['name']; ?></a>] <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?> </div> </div> </div> <?php endif; ?> <div class="blank"></div> <?php echo $this->fetch('library/page_footer.lbi'); ?> </body> </html>
zzshop
trunk/temp/compiled/exchange_list.dwt.php
PHP
asf20
3,318
<div id="append_parent"></div> <?php if ($this->_var['user_info']): ?> <font style="position:relative; top:10px;"> <?php echo $this->_var['lang']['hello']; ?>,<font class="f4_b"><?php echo $this->_var['user_info']['username']; ?></font>, <?php echo $this->_var['lang']['welcome_return']; ?>! <a href="user.php"><?php echo $this->_var['lang']['user_center']; ?></a>| <a href="user.php?act=logout"><?php echo $this->_var['lang']['user_logout']; ?></a> </font> <?php else: ?> <?php echo $this->_var['lang']['welcome']; ?>&nbsp;&nbsp;&nbsp;&nbsp; <a href="user.php"><img src="themes/default/images/bnt_log.gif" /></a> <a href="user.php?act=register"><img src="themes/default/images/bnt_reg.gif" /></a> <?php endif; ?>
zzshop
trunk/temp/compiled/member_info.lbi.php
PHP
asf20
732
<?php if ($this->_var['helps']): ?> <?php $_from = $this->_var['helps']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'help_cat');if (count($_from)): foreach ($_from AS $this->_var['help_cat']): ?> <dl> <dt><a href='<?php echo $this->_var['help_cat']['cat_id']; ?>' title="<?php echo $this->_var['help_cat']['cat_name']; ?>"><?php echo $this->_var['help_cat']['cat_name']; ?></a></dt> <?php $_from = $this->_var['help_cat']['article']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> <dd><a href="<?php echo $this->_var['item']['url']; ?>" title="<?php echo htmlspecialchars($this->_var['item']['title']); ?>"><?php echo $this->_var['item']['short_title']; ?></a></dd> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </dl> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?>
zzshop
trunk/temp/compiled/help.lbi.php
PHP
asf20
1,030
<?php if ($this->_var['brand_list']): ?> <?php $_from = $this->_var['brand_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'brand');$this->_foreach['brand_foreach'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['brand_foreach']['total'] > 0): foreach ($_from AS $this->_var['brand']): $this->_foreach['brand_foreach']['iteration']++; ?> <?php if (($this->_foreach['brand_foreach']['iteration'] - 1) <= 11): ?> <?php if ($this->_var['brand']['brand_logo']): ?> <a href="<?php echo $this->_var['brand']['url']; ?>"><img src="data/brandlogo/<?php echo $this->_var['brand']['brand_logo']; ?>" alt="<?php echo htmlspecialchars($this->_var['brand']['brand_name']); ?> (<?php echo $this->_var['brand']['goods_num']; ?>)" /></a> <?php else: ?> <a href="<?php echo $this->_var['brand']['url']; ?>"><?php echo htmlspecialchars($this->_var['brand']['brand_name']); ?> <?php if ($this->_var['brand']['goods_num']): ?>(<?php echo $this->_var['brand']['goods_num']; ?>)<?php endif; ?></a> <?php endif; ?> <?php endif; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <div class="brandsMore"><a href="brand.php"><img src="themes/default/images/moreBrands.gif" /></a></div> <?php endif; ?>
zzshop
trunk/temp/compiled/brands.lbi.php
PHP
asf20
1,351
<div class="box"> <div class="box_2"> <div class="top10Tit"></div> <div class="top10List clearfix"> <?php $_from = $this->_var['top_goods']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');$this->_foreach['top_goods'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['top_goods']['total'] > 0): foreach ($_from AS $this->_var['goods']): $this->_foreach['top_goods']['iteration']++; ?> <ul class="clearfix"> <img src="themes/default/images/top_<?php echo $this->_foreach['top_goods']['iteration']; ?>.gif" class="iteration" /> <?php if ($this->_foreach['top_goods']['iteration'] < 4): ?> <li class="topimg"> <a href="<?php echo $this->_var['goods']['url']; ?>"><img src="<?php echo $this->_var['goods']['thumb']; ?>" alt="<?php echo htmlspecialchars($this->_var['goods']['name']); ?>" class="samllimg" /></a> </li> <?php endif; ?> <li <?php if ($this->_foreach['top_goods']['iteration'] < 4): ?>class="iteration1"<?php endif; ?>> <a href="<?php echo $this->_var['goods']['url']; ?>" title="<?php echo htmlspecialchars($this->_var['goods']['name']); ?>"><?php echo $this->_var['goods']['short_name']; ?></a><br /> <?php echo $this->_var['lang']['shop_price']; ?><font class="f1"><?php echo $this->_var['goods']['price']; ?></font><br /> </li> </ul> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </div> </div> </div> <div class="blank5"></div>
zzshop
trunk/temp/compiled/top10.lbi.php
PHP
asf20
1,547
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="Generator" content="ECSHOP v2.7.2" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" /> <meta name="Description" content="<?php echo $this->_var['description']; ?>" /> <meta name="Description" content="<?php echo $this->_var['description']; ?>" /> <?php if ($this->_var['auto_redirect']): ?> <meta http-equiv="refresh" content="3;URL=<?php echo $this->_var['message']['href']; ?>" /> <?php endif; ?> <title><?php echo $this->_var['page_title']; ?></title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="icon" href="animated_favicon.gif" type="image/gif" /> <link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" /> <?php echo $this->smarty_insert_scripts(array('files'=>'common.js')); ?> </head> <body> <?php echo $this->fetch('library/page_header.lbi'); ?> <div class="block box"> <div id="ur_here"> <?php echo $this->fetch('library/ur_here.lbi'); ?> </div> </div> <div class="blank"></div> <div class="block clearfix"> <div class="AreaL"> <?php echo $this->fetch('library/cart.lbi'); ?> <?php echo $this->fetch('library/category_tree.lbi'); ?> <?php echo $this->fetch('library/goods_related.lbi'); ?> <?php echo $this->fetch('library/goods_fittings.lbi'); ?> <?php echo $this->fetch('library/goods_article.lbi'); ?> <?php echo $this->fetch('library/goods_attrlinked.lbi'); ?> <?php echo $this->fetch('library/history.lbi'); ?> </div> <div class="AreaR"> <?php echo $this->fetch('library/message_list.lbi'); ?> <?php echo $this->fetch('library/pages.lbi'); ?> <div class="blank5"></div> <div class="box"> <div class="box_1"> <h3><span><?php echo $this->_var['lang']['post_message']; ?></span></h3> <div class="boxCenterList"> <form action="message.php" method="post" name="formMsg" onSubmit="return submitMsgBoard(this)"> <table width="100%" border="0" cellpadding="3"> <tr> <td align="right"><?php echo $this->_var['lang']['username']; ?></td> <td> <?php if ($_SESSION['user_name']): ?> <font class="f4_b"><?php echo $this->_var['username']; ?></font><label for="anonymous" style="margin-left:8px;"><input type="checkbox" name="anonymous" value="1" id="anonymous" /><?php echo $this->_var['lang']['message_anonymous']; ?></label> <?php else: ?> <?php echo $this->_var['lang']['anonymous']; ?> <?php endif; ?> </td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['email']; ?></td> <td><input name="user_email" type="text" class="inputBg" size="20" value="<?php echo htmlspecialchars($_SESSION['email']); ?>" /></td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['message_board_type']; ?></td> <td><input name="msg_type" type="radio" value="0" checked="checked" /> <?php echo $this->_var['lang']['message_type']['0']; ?> <input type="radio" name="msg_type" value="1" /> <?php echo $this->_var['lang']['message_type']['1']; ?> <input type="radio" name="msg_type" value="2" /> <?php echo $this->_var['lang']['message_type']['2']; ?> <input type="radio" name="msg_type" value="3" /> <?php echo $this->_var['lang']['message_type']['3']; ?> <input type="radio" name="msg_type" value="4" /> <?php echo $this->_var['lang']['message_type']['4']; ?> </td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['message_title']; ?></td> <td><input name="msg_title" type="text" class="inputBg" size="30" /></td> </tr> <?php if ($this->_var['enabled_mes_captcha']): ?> <tr> <td align="right"><?php echo $this->_var['lang']['comment_captcha']; ?></td> <td><input type="text" size="8" name="captcha" class="inputBg" /> <img src="captcha.php?<?php echo $this->_var['rand']; ?>" alt="captcha" style="vertical-align: middle;cursor: pointer;" onClick="this.src='captcha.php?'+Math.random()" /> </td> </tr> <?php endif; ?> <tr> <td align="right" valign="top"><?php echo $this->_var['lang']['message_content']; ?></td> <td><textarea name="msg_content" cols="50" rows="4" wrap="virtual" style="border:1px solid #ccc;"></textarea></td> </tr> <tr> <td>&nbsp;</td> <td><input type="hidden" name="act" value="act_add_message" /> <input type="submit" value="<?php echo $this->_var['lang']['post_message']; ?>" class="bnt_blue_1" /> </td> </tr> </table> </form> <script type="text/javascript"> <?php $_from = $this->_var['lang']['message_board_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> /** * 提交留言信息 */ function submitMsgBoard(frm) { var msg = new Object; msg.user_email = frm.elements['user_email'].value; msg.msg_title = frm.elements['msg_title'].value; msg.msg_content = frm.elements['msg_content'].value; msg.captcha = frm.elements['captcha'] ? frm.elements['captcha'].value : ''; var msg_err = ''; if (msg.user_email.length > 0) { if (!(Utils.isEmail(msg.user_email))) { msg_err += msg_error_email + '\n'; } } else { msg_err += msg_empty_email + '\n'; } if (msg.msg_title.length == 0) { msg_err += msg_title_empty + '\n'; } if (frm.elements['captcha'] && msg.captcha.length==0) { msg_err += msg_captcha_empty + '\n' } if (msg.msg_content.length == 0) { msg_err += msg_content_empty + '\n' } if (msg.msg_title.length > 200) { msg_err += msg_title_limit + '\n'; } if (msg_err.length > 0) { alert(msg_err); return false; } else { return true; } } </script> </div> </div> </div> </div> </div> <div class="blank5"></div> <div class="block"> <div class="box"> <div class="helpTitBg clearfix"> <?php echo $this->fetch('library/help.lbi'); ?> </div> </div> </div> <div class="blank"></div> <?php if ($this->_var['img_links'] || $this->_var['txt_links']): ?> <div id="bottomNav" class="box"> <div class="box_1"> <div class="links clearfix"> <?php $_from = $this->_var['img_links']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'link');if (count($_from)): foreach ($_from AS $this->_var['link']): ?> <a href="<?php echo $this->_var['link']['url']; ?>" target="_blank" title="<?php echo $this->_var['link']['name']; ?>"><img src="<?php echo $this->_var['link']['logo']; ?>" alt="<?php echo $this->_var['link']['name']; ?>" border="0" /></a> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php if ($this->_var['txt_links']): ?> <?php $_from = $this->_var['txt_links']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'link');if (count($_from)): foreach ($_from AS $this->_var['link']): ?> [<a href="<?php echo $this->_var['link']['url']; ?>" target="_blank" title="<?php echo $this->_var['link']['name']; ?>"><?php echo $this->_var['link']['name']; ?></a>] <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?> </div> </div> </div> <?php endif; ?> <div class="blank"></div> <?php echo $this->fetch('library/page_footer.lbi'); ?> </body> </html>
zzshop
trunk/temp/compiled/message_board.dwt.php
PHP
asf20
9,119
<div class="box"> <div class="box_1"> <div id="category_tree"> <?php $_from = $this->_var['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'cat');if (count($_from)): foreach ($_from AS $this->_var['cat']): ?> <dl> <dt><a href="<?php echo $this->_var['cat']['url']; ?>"><?php echo htmlspecialchars($this->_var['cat']['name']); ?></a></dt> <?php $_from = $this->_var['cat']['cat_id']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'child');if (count($_from)): foreach ($_from AS $this->_var['child']): ?> <dd><a href="<?php echo $this->_var['child']['url']; ?>"><?php echo htmlspecialchars($this->_var['child']['name']); ?></a></dd> <?php $_from = $this->_var['child']['cat_id']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'childer');if (count($_from)): foreach ($_from AS $this->_var['childer']): ?> <dd>&nbsp;&nbsp;<a href="<?php echo $this->_var['childer']['url']; ?>"><?php echo htmlspecialchars($this->_var['childer']['name']); ?></a></dd> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </dl> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </div> </div> </div> <div class="blank5"></div>
zzshop
trunk/temp/compiled/category_tree.lbi.php
PHP
asf20
1,485
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="Generator" content="ECSHOP v2.7.2" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" /> <meta name="Description" content="<?php echo $this->_var['description']; ?>" /> <title><?php echo $this->_var['page_title']; ?></title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="icon" href="animated_favicon.gif" type="image/gif" /> <link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" /> <?php echo $this->smarty_insert_scripts(array('files'=>'common.js')); ?> </head> <body> <?php echo $this->fetch('library/page_header.lbi'); ?> <div class="block box"> <div id="ur_here"> <?php echo $this->fetch('library/ur_here.lbi'); ?> </div> </div> <div class="blank"></div> <div class="block"> <h5><span><?php echo $this->_var['lang']['activity_list']; ?></span></h5> <div class="blank"></div> <?php $_from = $this->_var['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'val');if (count($_from)): foreach ($_from AS $this->_var['val']): ?> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <th bgcolor="#ffffff"><?php echo $this->_var['lang']['label_act_name']; ?></th> <td colspan="3" bgcolor="#ffffff"><?php echo $this->_var['val']['act_name']; ?></td> </tr> <tr> <th bgcolor="#ffffff"><?php echo $this->_var['lang']['label_start_time']; ?></th> <td width="200" bgcolor="#ffffff"><?php echo $this->_var['val']['start_time']; ?></td> <th bgcolor="#ffffff"><?php echo $this->_var['lang']['label_max_amount']; ?></th> <td bgcolor="#ffffff"> <?php if ($this->_var['val']['max_amount'] > 0): ?> <?php echo $this->_var['val']['max_amount']; ?> <?php else: ?> <?php echo $this->_var['lang']['nolimit']; ?> <?php endif; ?> </td> </tr> <tr> <th bgcolor="#ffffff"><?php echo $this->_var['lang']['label_end_time']; ?></th> <td bgcolor="#ffffff"><?php echo $this->_var['val']['end_time']; ?></td> <th bgcolor="#ffffff"><?php echo $this->_var['lang']['label_min_amount']; ?></th> <td width="200" bgcolor="#ffffff"><?php echo $this->_var['val']['min_amount']; ?></td> </tr> <tr> <th bgcolor="#ffffff"><?php echo $this->_var['lang']['label_act_range']; ?></th> <td bgcolor="#ffffff"> <?php echo $this->_var['val']['act_range']; ?> <?php if ($this->_var['val']['act_range'] != $this->_var['lang']['far_all']): ?> :<br /> <?php $_from = $this->_var['val']['act_range_ext']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'ext');if (count($_from)): foreach ($_from AS $this->_var['ext']): ?> <a href="<?php echo $this->_var['val']['program']; ?><?php echo $this->_var['ext']['id']; ?>" taget="_blank" class="f6"><span class="f_user_info"><u><?php echo $this->_var['ext']['name']; ?></u></span></a> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?> </td> <th bgcolor="#ffffff"><?php echo $this->_var['lang']['label_user_rank']; ?></th> <td bgcolor="#ffffff"> <?php $_from = $this->_var['val']['user_rank']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'user');if (count($_from)): foreach ($_from AS $this->_var['user']): ?> <?php echo $this->_var['user']; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </td> </tr> <tr> <th bgcolor="#ffffff"><?php echo $this->_var['lang']['label_act_type']; ?></th> <td colspan="3" bgcolor="#ffffff"> <?php echo $this->_var['val']['act_type']; ?><?php if ($this->_var['val']['act_type'] != $this->_var['lang']['fat_goods']): ?><?php echo $this->_var['val']['act_type_ext']; ?><?php endif; ?> </td> </tr> <?php if ($this->_var['val']['gift']): ?> <tr> <td colspan="4" bgcolor="#ffffff"> <?php $_from = $this->_var['val']['gift']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');if (count($_from)): foreach ($_from AS $this->_var['goods']): ?> <table border="0" style="float:left;"> <tr> <td align="center"><a href="goods.php?id=<?php echo $this->_var['goods']['id']; ?>"><img src="<?php echo $this->_var['goods']['thumb']; ?>" alt="<?php echo $this->_var['goods']['name']; ?>" /></a></td> </tr> <tr> <td align="center"><a href="goods.php?id=<?php echo $this->_var['goods']['id']; ?>" class="f6"><?php echo $this->_var['goods']['name']; ?></a></td> </tr> <tr> <td align="center"> <?php if ($this->_var['goods']['price'] > 0): ?> <?php echo $this->_var['goods']['price']; ?><?php echo $this->_var['lang']['unit_yuan']; ?> <?php else: ?> <?php echo $this->_var['lang']['for_free']; ?> <?php endif; ?> </td> </tr> </table> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </td> </tr> <?php endif; ?> </table> <div class="blank5"></div> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </div> <div class="blank5"></div> <div class="block"> <div class="box"> <div class="helpTitBg clearfix"> <?php echo $this->fetch('library/help.lbi'); ?> </div> </div> </div> <div class="blank"></div> <?php if ($this->_var['img_links'] || $this->_var['txt_links']): ?> <div id="bottomNav" class="box"> <div class="box_1"> <div class="links clearfix"> <?php $_from = $this->_var['img_links']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'link');if (count($_from)): foreach ($_from AS $this->_var['link']): ?> <a href="<?php echo $this->_var['link']['url']; ?>" target="_blank" title="<?php echo $this->_var['link']['name']; ?>"><img src="<?php echo $this->_var['link']['logo']; ?>" alt="<?php echo $this->_var['link']['name']; ?>" border="0" /></a> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php if ($this->_var['txt_links']): ?> <?php $_from = $this->_var['txt_links']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'link');if (count($_from)): foreach ($_from AS $this->_var['link']): ?> [<a href="<?php echo $this->_var['link']['url']; ?>" target="_blank" title="<?php echo $this->_var['link']['name']; ?>"><?php echo $this->_var['link']['name']; ?></a>] <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?> </div> </div> </div> <?php endif; ?> <div class="blank"></div> <?php echo $this->fetch('library/page_footer.lbi'); ?> </body> </html>
zzshop
trunk/temp/compiled/activity.dwt.php
PHP
asf20
7,310
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="Generator" content="ECSHOP v2.7.2" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" /> <meta name="Description" content="<?php echo $this->_var['description']; ?>" /> <title><?php echo $this->_var['page_title']; ?></title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="icon" href="animated_favicon.gif" type="image/gif" /> <link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" /> <?php echo $this->smarty_insert_scripts(array('files'=>'transport.js,common.js,user.js')); ?> </head> <body> <?php echo $this->fetch('library/page_header.lbi'); ?> <div class="block box"> <div id="ur_here"> <?php echo $this->fetch('library/ur_here.lbi'); ?> </div> </div> <div class="blank"></div> <div class="block clearfix"> <div class="AreaL"> <div class="box"> <div class="box_1"> <div class="userCenterBox"> <?php echo $this->fetch('library/user_menu.lbi'); ?> </div> </div> </div> </div> <div class="AreaR"> <div class="box"> <div class="box_1"> <div class="userCenterBox boxCenterList clearfix" style="_height:1%;"> <?php if ($this->_var['action'] == 'default'): ?> <font class="f5"><b class="f4"><?php echo $this->_var['info']['username']; ?></b> <?php echo $this->_var['lang']['welcome_to']; ?> <?php echo $this->_var['info']['shop_name']; ?>!</font><br /> <div class="blank"></div> <?php echo $this->_var['lang']['last_time']; ?>: <?php echo $this->_var['info']['last_time']; ?><br /> <div class="blank5"></div> <?php echo $this->_var['rank_name']; ?> <?php echo $this->_var['next_rank_name']; ?><br /> <div class="blank5"></div> <?php if ($this->_var['info']['is_validate'] == 0): ?> <?php echo $this->_var['lang']['not_validated']; ?> <a href="javascript:sendHashMail()" style="color:#006bd0;"><?php echo $this->_var['lang']['resend_hash_mail']; ?></a><br /> <?php endif; ?> <div style="margin:5px 0; border:1px solid #a1675a;padding:10px 20px; background-color:#e8d1c9;"> <img src="themes/default/images/note.gif" alt="note" />&nbsp;<?php echo $this->_var['user_notice']; ?> </div> <br /><br /> <div class="f_l" style="width:350px;"> <h5><span><?php echo $this->_var['lang']['your_account']; ?></span></h5> <div class="blank"></div> <?php echo $this->_var['lang']['your_surplus']; ?>:<a href="user.php?act=account_log" style="color:#006bd0;"><?php echo $this->_var['info']['surplus']; ?></a><br /> <?php if ($this->_var['info']['credit_line'] > 0): ?> <?php echo $this->_var['lang']['credit_line']; ?>:<?php echo $this->_var['info']['formated_credit_line']; ?><br /> <?php endif; ?> <?php echo $this->_var['lang']['your_bonus']; ?>:<a href="user.php?act=bonus" style="color:#006bd0;"><?php echo $this->_var['info']['bonus']; ?></a><br /> <?php echo $this->_var['lang']['your_integral']; ?>:<?php echo $this->_var['info']['integral']; ?><br /> </div> <div class="f_r" style="width:350px;"> <h5><span><?php echo $this->_var['lang']['your_notice']; ?></span></h5> <div class="blank"></div> <?php $_from = $this->_var['prompt']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> <?php echo $this->_var['item']['text']; ?><br /> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php echo $this->_var['lang']['last_month_order']; ?><?php echo $this->_var['info']['order_count']; ?><?php echo $this->_var['lang']['order_unit']; ?><br /> <?php if ($this->_var['info']['shipped_order']): ?> <?php echo $this->_var['lang']['please_received']; ?><br /> <?php $_from = $this->_var['info']['shipped_order']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> <a href="user.php?act=order_detail&order_id=<?php echo $this->_var['item']['order_id']; ?>" style="color:#006bd0;"><?php echo $this->_var['item']['order_sn']; ?></a> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?> </div> <?php endif; ?> <?php if ($this->_var['action'] == 'message_list'): ?> <h5><span><?php echo $this->_var['lang']['label_message']; ?></span></h5> <div class="blank"></div> <?php $_from = $this->_var['message_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'message');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['message']): ?> <div class="f_l"> <b><?php echo $this->_var['message']['msg_type']; ?>:</b>&nbsp;&nbsp;<font class="f4"><?php echo $this->_var['message']['msg_title']; ?></font> (<?php echo $this->_var['message']['msg_time']; ?>) </div> <div class="f_r"> <a href="user.php?act=del_msg&amp;id=<?php echo $this->_var['key']; ?>&amp;order_id=<?php echo $this->_var['message']['order_id']; ?>" title="<?php echo $this->_var['lang']['drop']; ?>" onclick="if (!confirm('<?php echo $this->_var['lang']['confirm_remove_msg']; ?>')) return false;" class="f6"><?php echo $this->_var['lang']['drop']; ?></a> </div> <div class="msgBottomBorder"> <?php echo $this->_var['message']['msg_content']; ?> <?php if ($this->_var['message']['message_img']): ?> <div align="right"> <a href="data/feedbackimg/<?php echo $this->_var['message']['message_img']; ?>" target="_bank" class="f6"><?php echo $this->_var['lang']['view_upload_file']; ?></a> </div> <?php endif; ?> <br /> <?php if ($this->_var['message']['re_msg_content']): ?> <a href="mailto:<?php echo $this->_var['message']['re_user_email']; ?>" class="f6"><?php echo $this->_var['lang']['shopman_reply']; ?></a> (<?php echo $this->_var['message']['re_msg_time']; ?>)<br /> <?php echo $this->_var['message']['re_msg_content']; ?> <?php endif; ?> </div> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php if ($this->_var['message_list']): ?> <div class="f_r"> <?php echo $this->fetch('library/pages.lbi'); ?> </div> <?php endif; ?> <div class="blank"></div> <form action="user.php" method="post" enctype="multipart/form-data" name="formMsg" onSubmit="return submitMsg()"> <table width="100%" border="0" cellpadding="3"> <?php if ($this->_var['order_info']): ?> <tr> <td align="right"><?php echo $this->_var['lang']['order_number']; ?></td> <td> <a href ="<?php echo $this->_var['order_info']['url']; ?>"><img src="themes/default/images/note.gif" /><?php echo $this->_var['order_info']['order_sn']; ?></a> <input name="msg_type" type="hidden" value="5" /> <input name="order_id" type="hidden" value="<?php echo $this->_var['order_info']['order_id']; ?>" class="inputBg" /> </td> </tr> <?php else: ?> <tr> <td align="right"><?php echo $this->_var['lang']['message_type']; ?>:</td> <td><input name="msg_type" type="radio" value="0" checked="checked" /> <?php echo $this->_var['lang']['type']['0']; ?> <input type="radio" name="msg_type" value="1" /> <?php echo $this->_var['lang']['type']['1']; ?> <input type="radio" name="msg_type" value="2" /> <?php echo $this->_var['lang']['type']['2']; ?> <input type="radio" name="msg_type" value="3" /> <?php echo $this->_var['lang']['type']['3']; ?> <input type="radio" name="msg_type" value="4" /> <?php echo $this->_var['lang']['type']['4']; ?> </td> </tr> <?php endif; ?> <tr> <td align="right"><?php echo $this->_var['lang']['message_title']; ?>:</td> <td><input name="msg_title" type="text" size="30" class="inputBg" /></td> </tr> <tr> <td align="right" valign="top"><?php echo $this->_var['lang']['message_content']; ?>:</td> <td><textarea name="msg_content" cols="50" rows="4" wrap="virtual" class="B_blue"></textarea></td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['upload_img']; ?>:</td> <td><input type="file" name="message_img" size="45" class="inputBg" /></td> </tr> <tr> <td>&nbsp;</td> <td><input type="hidden" name="act" value="act_add_message" /> <input type="submit" value="<?php echo $this->_var['lang']['submit']; ?>" class="bnt_bonus" /> </td> </tr> <tr> <td>&nbsp;</td> <td> <?php echo $this->_var['lang']['img_type_tips']; ?><br /> <?php echo $this->_var['lang']['img_type_list']; ?> </td> </tr> </table> </form> <?php endif; ?> <?php if ($this->_var['action'] == 'comment_list'): ?> <h5><span><?php echo $this->_var['lang']['label_comment']; ?></span></h5> <div class="blank"></div> <?php $_from = $this->_var['comment_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'comment');if (count($_from)): foreach ($_from AS $this->_var['comment']): ?> <div class="f_l"> <b><?php if ($this->_var['comment']['comment_type'] == '0'): ?><?php echo $this->_var['lang']['goods_comment']; ?><?php else: ?><?php echo $this->_var['lang']['article_comment']; ?><?php endif; ?>: </b><font class="f4"><?php echo $this->_var['comment']['cmt_name']; ?></font>&nbsp;&nbsp;(<?php echo $this->_var['comment']['formated_add_time']; ?>) </div> <div class="f_r"> <a href="user.php?act=del_cmt&amp;id=<?php echo $this->_var['comment']['comment_id']; ?>" title="<?php echo $this->_var['lang']['drop']; ?>" onclick="if (!confirm('<?php echo $this->_var['lang']['confirm_remove_msg']; ?>')) return false;" class="f6"><?php echo $this->_var['lang']['drop']; ?></a> </div> <div class="msgBottomBorder"> <?php echo htmlspecialchars($this->_var['comment']['content']); ?><br /> <?php if ($this->_var['comment']['reply_content']): ?> <b><?php echo $this->_var['lang']['reply_comment']; ?>:</b><br /> <?php echo $this->_var['comment']['reply_content']; ?> <?php endif; ?> </div> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php if ($this->_var['comment_list']): ?> <?php echo $this->fetch('library/pages.lbi'); ?> <?php else: ?> <?php echo $this->_var['lang']['no_comments']; ?> <?php endif; ?> <?php endif; ?> <?php if ($this->_var['action'] == 'tag_list'): ?> <h5><span><?php echo $this->_var['lang']['label_tag']; ?></span></h5> <div class="blank"></div> <?php if ($this->_var['tags']): ?> <?php $_from = $this->_var['tags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'tag');if (count($_from)): foreach ($_from AS $this->_var['tag']): ?> <a href="search.php?keywords=<?php echo urlencode($this->_var['tag']['tag_words']); ?>" class="f6"><?php echo htmlspecialchars($this->_var['tag']['tag_words']); ?></a> <a href="user.php?act=act_del_tag&amp;tag_words=<?php echo urlencode($this->_var['tag']['tag_words']); ?>" onclick="if (!confirm('<?php echo $this->_var['lang']['confirm_drop_tag']; ?>')) return false;" title="<?php echo $this->_var['lang']['drop']; ?>"><img src="themes/default/images/drop.gif" alt="<?php echo $this->_var['lang']['drop']; ?>" /></a>&nbsp;&nbsp; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php else: ?> <span style="margin:2px 10px; font-size:14px; line-height:36px;"><?php echo $this->_var['lang']['no_tag']; ?></span> <?php endif; ?> <?php endif; ?> <?php if ($this->_var['action'] == 'collection_list'): ?> <?php echo $this->smarty_insert_scripts(array('files'=>'transport.js,utils.js')); ?> <h5><span><?php echo $this->_var['lang']['label_collection']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr align="center"> <th width="35%" bgcolor="#ffffff"><?php echo $this->_var['lang']['goods_name']; ?></th> <th width="30%" bgcolor="#ffffff"><?php echo $this->_var['lang']['price']; ?></th> <th width="35%" bgcolor="#ffffff"><?php echo $this->_var['lang']['handle']; ?></th> </tr> <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');if (count($_from)): foreach ($_from AS $this->_var['goods']): ?> <tr> <td bgcolor="#ffffff"><a href="<?php echo $this->_var['goods']['url']; ?>" class="f6"><?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?></a></td> <td bgcolor="#ffffff"><?php if ($this->_var['goods']['promote_price'] != ""): ?> <?php echo $this->_var['lang']['promote_price']; ?><span class="goods-price"><?php echo $this->_var['goods']['promote_price']; ?></span> <?php else: ?> <?php echo $this->_var['lang']['shop_price']; ?><span class="goods-price"><?php echo $this->_var['goods']['shop_price']; ?></span> <?php endif; ?> </td> <td align="center" bgcolor="#ffffff"> <?php if ($this->_var['goods']['is_attention']): ?> <a href="javascript:if (confirm('<?php echo $this->_var['lang']['del_attention']; ?>')) location.href='user.php?act=del_attention&rec_id=<?php echo $this->_var['goods']['rec_id']; ?>'" class="f6"><?php echo $this->_var['lang']['no_attention']; ?></a> <?php else: ?> <a href="javascript:if (confirm('<?php echo $this->_var['lang']['add_to_attention']; ?>')) location.href='user.php?act=add_to_attention&rec_id=<?php echo $this->_var['goods']['rec_id']; ?>'" class="f6"><?php echo $this->_var['lang']['attention']; ?></a> <?php endif; ?> <a href="javascript:addToCart(<?php echo $this->_var['goods']['goods_id']; ?>)" class="f6"><?php echo $this->_var['lang']['add_to_cart']; ?></a> <a href="javascript:if (confirm('<?php echo $this->_var['lang']['remove_collection_confirm']; ?>')) location.href='user.php?act=delete_collection&collection_id=<?php echo $this->_var['goods']['rec_id']; ?>'" class="f6"><?php echo $this->_var['lang']['drop']; ?></a> </td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <?php echo $this->fetch('library/pages.lbi'); ?> <div class="blank5"></div> <h5><span><?php echo $this->_var['lang']['label_affiliate']; ?></span></h5> <div class="blank"></div> <form name="theForm" method="post" action=""> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['label_need_image']; ?></td> <td bgcolor="#ffffff"> <select name="need_image" id="need_image" class="inputBg"> <option value="true" selected><?php echo $this->_var['lang']['need']; ?></option> <option value="false"><?php echo $this->_var['lang']['need_not']; ?></option> </select> </td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['label_goods_num']; ?></td> <td bgcolor="#ffffff"><input name="goods_num" type="text" id="goods_num" value="6" class="inputBg" /></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['label_arrange']; ?></td> <td bgcolor="#ffffff"><select name="arrange" id="arrange" class="inputBg"> <option value="h" selected><?php echo $this->_var['lang']['horizontal']; ?></option> <option value="v"><?php echo $this->_var['lang']['verticle']; ?></option> </select></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['label_rows_num']; ?></td> <td bgcolor="#ffffff"><input name="rows_num" type="text" id="rows_num" value="1" class="inputBg" /></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['label_charset']; ?></td> <td bgcolor="#ffffff"><select name="charset" id="charset"> <?php echo $this->html_options(array('options'=>$this->_var['lang_list'])); ?> </select></td> </tr> <tr> <td colspan="2" align="center" bgcolor="#ffffff"><input type="button" name="gen_code" value="<?php echo $this->_var['lang']['generate']; ?>" onclick="genCode()" class="bnt_blue_1" /> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="#ffffff"><textarea name="code" cols="80" rows="5" id="code" class="B_blue"></textarea></td> </tr> </table> </form> <script language="JavaScript"> var elements = document.forms['theForm'].elements; var url = '<?php echo $this->_var['url']; ?>'; var u = '<?php echo $this->_var['user_id']; ?>'; /** * 生成代码 */ function genCode() { // 检查输入 if (isNaN(parseInt(elements['goods_num'].value))) { alert('<?php echo $this->_var['lang']['goods_num_must_be_int']; ?>'); return; } if (elements['goods_num'].value < 1) { alert('<?php echo $this->_var['lang']['goods_num_must_over_0']; ?>'); return; } if (isNaN(parseInt(elements['rows_num'].value))) { alert('<?php echo $this->_var['lang']['rows_num_must_be_int']; ?>'); return; } if (elements['rows_num'].value < 1) { alert('<?php echo $this->_var['lang']['rows_num_must_over_0']; ?>'); return; } // 生成代码 var code = '\<script src=\"' + url + 'goods_script.php?'; code += 'need_image=' + elements['need_image'].value + '&'; code += 'goods_num=' + elements['goods_num'].value + '&'; code += 'arrange=' + elements['arrange'].value + '&'; code += 'rows_num=' + elements['rows_num'].value + '&'; code += 'charset=' + elements['charset'].value + '&u=' + u; code += '\"\>\</script\>'; elements['code'].value = code; elements['code'].select(); if (Browser.isIE) { window.clipboardData.setData("Text",code); } } var compare_no_goods = "<?php echo $this->_var['lang']['compare_no_goods']; ?>"; var btn_buy = "<?php echo $this->_var['lang']['btn_buy']; ?>"; var is_cancel = "<?php echo $this->_var['lang']['is_cancel']; ?>"; var select_spe = "<?php echo $this->_var['lang']['select_spe']; ?>"; </script> <?php endif; ?> <?php if ($this->_var['action'] == 'booking_list'): ?> <h5><span><?php echo $this->_var['lang']['label_booking']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr align="center"> <td width="20%" bgcolor="#ffffff"><?php echo $this->_var['lang']['booking_goods_name']; ?></td> <td width="10%" bgcolor="#ffffff"><?php echo $this->_var['lang']['booking_amount']; ?></td> <td width="20%" bgcolor="#ffffff"><?php echo $this->_var['lang']['booking_time']; ?></td> <td width="35%" bgcolor="#ffffff"><?php echo $this->_var['lang']['process_desc']; ?></td> <td width="15%" bgcolor="#ffffff"><?php echo $this->_var['lang']['handle']; ?></td> </tr> <?php $_from = $this->_var['booking_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> <tr> <td align="left" bgcolor="#ffffff"><a href="<?php echo $this->_var['item']['url']; ?>" target="_blank" class="f6"><?php echo $this->_var['item']['goods_name']; ?></a></td> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['goods_number']; ?></td> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['booking_time']; ?></td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['item']['dispose_note']; ?></td> <td align="center" bgcolor="#ffffff"><a href="javascript:if (confirm('<?php echo $this->_var['lang']['confirm_remove_account']; ?>')) location.href='user.php?act=act_del_booking&id=<?php echo $this->_var['item']['rec_id']; ?>'" class="f6"><?php echo $this->_var['lang']['drop']; ?></a> </td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <?php endif; ?> <div class="blank5"></div> <?php if ($this->_var['action'] == 'add_booking'): ?> <?php echo $this->smarty_insert_scripts(array('files'=>'utils.js')); ?> <script type="text/javascript"> <?php $_from = $this->_var['lang']['booking_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </script> <h5><span><?php echo $this->_var['lang']['add']; ?><?php echo $this->_var['lang']['label_booking']; ?></span></h5> <div class="blank"></div> <form action="user.php" method="post" name="formBooking" onsubmit="return addBooking();"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['booking_goods_name']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['info']['goods_name']; ?></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['booking_amount']; ?>:</td> <td bgcolor="#ffffff"><input name="number" type="text" value="<?php echo $this->_var['info']['goods_number']; ?>" class="inputBg" /></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['describe']; ?>:</td> <td bgcolor="#ffffff"><textarea name="desc" cols="50" rows="5" wrap="virtual" class="B_blue"><?php echo $this->_var['goods_attr']; ?><?php echo htmlspecialchars($this->_var['info']['goods_desc']); ?></textarea> </td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['contact_username']; ?>:</td> <td bgcolor="#ffffff"><input name="linkman" type="text" value="<?php echo htmlspecialchars($this->_var['info']['consignee']); ?>" size="25" class="inputBg"/> </td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['email_address']; ?>:</td> <td bgcolor="#ffffff"><input name="email" type="text" value="<?php echo htmlspecialchars($this->_var['info']['email']); ?>" size="25" class="inputBg" /></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['contact_phone']; ?>:</td> <td bgcolor="#ffffff"><input name="tel" type="text" value="<?php echo htmlspecialchars($this->_var['info']['tel']); ?>" size="25" class="inputBg" /></td> </tr> <tr> <td align="right" bgcolor="#ffffff">&nbsp;</td> <td bgcolor="#ffffff"><input name="act" type="hidden" value="act_add_booking" /> <input name="id" type="hidden" value="<?php echo $this->_var['info']['id']; ?>" /> <input name="rec_id" type="hidden" value="<?php echo $this->_var['info']['rec_id']; ?>" /> <input type="submit" name="submit" class="submit" value="<?php echo $this->_var['lang']['submit_booking_goods']; ?>" /> <input type="reset" name="reset" class="reset" value="<?php echo $this->_var['lang']['button_reset']; ?>" /> </td> </tr> </table> </form> <?php endif; ?> <?php if ($this->_var['affiliate']['on'] == 1): ?> <?php if ($this->_var['action'] == 'affiliate'): ?> <?php if (! $this->_var['goodsid'] || $this->_var['goodsid'] == 0): ?> <h5><span><?php echo $this->_var['lang']['affiliate_detail']; ?></span></h5> <div class="blank"></div> <?php echo $this->_var['affiliate_intro']; ?> <?php if ($this->_var['affiliate']['config']['separate_by'] == 0): ?> <div class="blank"></div> <h5><span><a name="myrecommend"><?php echo $this->_var['lang']['affiliate_member']; ?></a></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_lever']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_num']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['level_point']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['level_money']; ?></td> </tr> <?php $_from = $this->_var['affdb']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('level', 'val');$this->_foreach['affdb'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['affdb']['total'] > 0): foreach ($_from AS $this->_var['level'] => $this->_var['val']): $this->_foreach['affdb']['iteration']++; ?> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['level']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['val']['num']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['val']['point']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['val']['money']; ?></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <?php else: ?> <?php endif; ?> <div class="blank"></div> <h5><span>分成规则</span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['order_number']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_money']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_point']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_mode']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_status']; ?></td> </tr> <?php $_from = $this->_var['logdb']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'val');$this->_foreach['logdb'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['logdb']['total'] > 0): foreach ($_from AS $this->_var['val']): $this->_foreach['logdb']['iteration']++; ?> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['val']['order_sn']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['val']['money']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['val']['point']; ?></td> <td bgcolor="#ffffff"><?php if ($this->_var['val']['separate_type'] == 1 || $this->_var['val']['separate_type'] === 0): ?><?php echo $this->_var['lang']['affiliate_type'][$this->_var['val']['separate_type']]; ?><?php else: ?><?php echo $this->_var['lang']['affiliate_type'][$this->_var['affiliate_type']]; ?><?php endif; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_stats'][$this->_var['val']['is_separate']]; ?></td> </tr> <?php endforeach; else: ?> <tr><td colspan="5" align="center" bgcolor="#ffffff"><?php echo $this->_var['lang']['no_records']; ?></td> </tr> <?php endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php if ($this->_var['logdb']): ?> <tr> <td colspan="5" bgcolor="#ffffff"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> <div id="pager"> <?php echo $this->_var['lang']['pager_1']; ?><?php echo $this->_var['pager']['record_count']; ?><?php echo $this->_var['lang']['pager_2']; ?><?php echo $this->_var['lang']['pager_3']; ?><?php echo $this->_var['pager']['page_count']; ?><?php echo $this->_var['lang']['pager_4']; ?> <span> <a href="<?php echo $this->_var['pager']['page_first']; ?>"><?php echo $this->_var['lang']['page_first']; ?></a> <a href="<?php echo $this->_var['pager']['page_prev']; ?>"><?php echo $this->_var['lang']['page_prev']; ?></a> <a href="<?php echo $this->_var['pager']['page_next']; ?>"><?php echo $this->_var['lang']['page_next']; ?></a> <a href="<?php echo $this->_var['pager']['page_last']; ?>"><?php echo $this->_var['lang']['page_last']; ?></a> </span> <select name="page" id="page" onchange="selectPage(this)"> <?php echo $this->html_options(array('options'=>$this->_var['pager']['array'],'selected'=>$this->_var['pager']['page'])); ?> </select> <input type="hidden" name="act" value="affiliate" /> </div> </form> </td> </tr> <?php endif; ?> </table> <script type="text/javascript" language="JavaScript"> <!-- function selectPage(sel) { sel.form.submit(); } //--> </script> <div class="blank"></div> <h5><span><?php echo $this->_var['lang']['affiliate_code']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="30%" bgcolor="#ffffff"><a href="<?php echo $this->_var['shopurl']; ?>?u=<?php echo $this->_var['userid']; ?>" target="_blank" class="f6"><?php echo $this->_var['shopname']; ?></a></td> <td bgcolor="#ffffff"><input size="40" onclick="this.select();" type="text" value="&lt;a href=&quot;<?php echo $this->_var['shopurl']; ?>?u=<?php echo $this->_var['userid']; ?>&quot; target=&quot;_blank&quot;&gt;<?php echo $this->_var['shopname']; ?>&lt;/a&gt;" style="border:1px solid #ccc;" /> <?php echo $this->_var['lang']['recommend_webcode']; ?></td> </tr> <tr> <td bgcolor="#ffffff"><a href="<?php echo $this->_var['shopurl']; ?>?u=<?php echo $this->_var['userid']; ?>" target="_blank" title="<?php echo $this->_var['shopname']; ?>" class="f6"><img src="<?php echo $this->_var['shopurl']; ?><?php echo $this->_var['logosrc']; ?>" /></a></td> <td bgcolor="#ffffff"><input size="40" onclick="this.select();" type="text" value="&lt;a href=&quot;<?php echo $this->_var['shopurl']; ?>?u=<?php echo $this->_var['userid']; ?>&quot; target=&quot;_blank&quot; title=&quot;<?php echo $this->_var['shopname']; ?>&quot;&gt;&lt;img src=&quot;<?php echo $this->_var['shopurl']; ?><?php echo $this->_var['logosrc']; ?>&quot; /&gt;&lt;/a&gt;" style="border:1px solid #ccc;" /> <?php echo $this->_var['lang']['recommend_webcode']; ?></td> </tr> <tr> <td bgcolor="#ffffff"><a href="<?php echo $this->_var['shopurl']; ?>?u=<?php echo $this->_var['userid']; ?>" target="_blank" class="f6"><?php echo $this->_var['shopname']; ?></a></td> <td bgcolor="#ffffff"><input size="40" onclick="this.select();" type="text" value="[url=<?php echo $this->_var['shopurl']; ?>?u=<?php echo $this->_var['userid']; ?>]<?php echo $this->_var['shopname']; ?>[/url]" style="border:1px solid #ccc;" /> <?php echo $this->_var['lang']['recommend_bbscode']; ?></td> </tr> <tr> <td bgcolor="#ffffff"><a href="<?php echo $this->_var['shopurl']; ?>?u=<?php echo $this->_var['userid']; ?>" target="_blank" title="<?php echo $this->_var['shopname']; ?>" class="f6"><img src="<?php echo $this->_var['shopurl']; ?><?php echo $this->_var['logosrc']; ?>" /></a></td> <td bgcolor="#ffffff"><input size="40" onclick="this.select();" type="text" value="[url=<?php echo $this->_var['shopurl']; ?>?u=<?php echo $this->_var['userid']; ?>][img]<?php echo $this->_var['shopurl']; ?><?php echo $this->_var['logosrc']; ?>[/img][/url]" style="border:1px solid #ccc;" /> <?php echo $this->_var['lang']['recommend_bbscode']; ?></td> </tr> </table> <?php else: ?> <style type="text/css"> .types a{text-decoration:none; color:#006bd0;} </style> <h5><span><?php echo $this->_var['lang']['affiliate_code']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_view']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_code']; ?></td> </tr> <?php $_from = $this->_var['types']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'val');$this->_foreach['types'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['types']['total'] > 0): foreach ($_from AS $this->_var['val']): $this->_foreach['types']['iteration']++; ?> <tr align="center"> <td bgcolor="#ffffff" class="types"><script src="<?php echo $this->_var['shopurl']; ?>affiliate.php?charset=<?php echo $this->_var['ecs_charset']; ?>&gid=<?php echo $this->_var['goodsid']; ?>&u=<?php echo $this->_var['userid']; ?>&type=<?php echo $this->_var['val']; ?>"></script></td> <td bgcolor="#ffffff">javascript <?php echo $this->_var['lang']['affiliate_codetype']; ?><br> <textarea cols=30 rows=2 id="txt<?php echo $this->_foreach['types']['iteration']; ?>" style="border:1px solid #ccc;"><script src="<?php echo $this->_var['shopurl']; ?>affiliate.php?charset=<?php echo $this->_var['ecs_charset']; ?>&gid=<?php echo $this->_var['goodsid']; ?>&u=<?php echo $this->_var['userid']; ?>&type=<?php echo $this->_var['val']; ?>"></script></textarea>[<a href="#" title="Copy To Clipboard" onClick="Javascript:copyToClipboard(document.getElementById('txt<?php echo $this->_foreach['types']['iteration']; ?>').value);alert('<?php echo $this->_var['lang']['copy_to_clipboard']; ?>');" class="f6"><?php echo $this->_var['lang']['code_copy']; ?></a>] <br>iframe <?php echo $this->_var['lang']['affiliate_codetype']; ?><br><textarea cols=30 rows=2 id="txt<?php echo $this->_foreach['types']['iteration']; ?>_iframe" style="border:1px solid #ccc;"><iframe width="250" height="270" src="<?php echo $this->_var['shopurl']; ?>affiliate.php?charset=<?php echo $this->_var['ecs_charset']; ?>&gid=<?php echo $this->_var['goodsid']; ?>&u=<?php echo $this->_var['userid']; ?>&type=<?php echo $this->_var['val']; ?>&display_mode=iframe" frameborder="0" scrolling="no"></iframe></textarea>[<a href="#" title="Copy To Clipboard" onClick="Javascript:copyToClipboard(document.getElementById('txt<?php echo $this->_foreach['types']['iteration']; ?>_iframe').value);alert('<?php echo $this->_var['lang']['copy_to_clipboard']; ?>');" class="f6"><?php echo $this->_var['lang']['code_copy']; ?></a>] <br /><?php echo $this->_var['lang']['bbs']; ?>UBB <?php echo $this->_var['lang']['affiliate_codetype']; ?><br /><textarea cols=30 rows=2 id="txt<?php echo $this->_foreach['types']['iteration']; ?>_ubb" style="border:1px solid #ccc;"><?php if ($this->_var['val'] != 5): ?>[url=<?php echo $this->_var['shopurl']; ?>goods.php?id=<?php echo $this->_var['goodsid']; ?>&u=<?php echo $this->_var['userid']; ?>][img]<?php if ($this->_var['val'] < 3): ?><?php echo $this->_var['goods']['goods_thumb']; ?><?php else: ?><?php echo $this->_var['goods']['goods_img']; ?><?php endif; ?>[/img][/url]<?php endif; ?> [url=<?php echo $this->_var['shopurl']; ?>goods.php?id=<?php echo $this->_var['goodsid']; ?>&u=<?php echo $this->_var['userid']; ?>][b]<?php echo $this->_var['goods']['goods_name']; ?>[/b][/url] <?php if ($this->_var['val'] != 1 && $this->_var['val'] != 3): ?>[s]<?php echo $this->_var['goods']['market_price']; ?>[/s]<?php endif; ?> [color=red]<?php echo $this->_var['goods']['shop_price']; ?>[/color]</textarea>[<a href="#" title="Copy To Clipboard" onClick="Javascript:copyToClipboard(document.getElementById('txt<?php echo $this->_foreach['types']['iteration']; ?>_ubb').value);alert('<?php echo $this->_var['lang']['copy_to_clipboard']; ?>');" class="f6"><?php echo $this->_var['lang']['code_copy']; ?></a>] <?php if ($this->_var['val'] == 5): ?><br /><?php echo $this->_var['lang']['im_code']; ?> <?php echo $this->_var['lang']['affiliate_codetype']; ?><br /><textarea cols=30 rows=2 id="txt<?php echo $this->_foreach['types']['iteration']; ?>_txt" style="border:1px solid #ccc;"><?php echo $this->_var['lang']['show_good_to_you']; ?> <?php echo $this->_var['goods']['goods_name']; ?> <?php echo $this->_var['shopurl']; ?>goods.php?id=<?php echo $this->_var['goodsid']; ?>&u=<?php echo $this->_var['userid']; ?></textarea>[<a href="#" title="Copy To Clipboard" onClick="Javascript:copyToClipboard(document.getElementById('txt<?php echo $this->_foreach['types']['iteration']; ?>_txt').value);alert('<?php echo $this->_var['lang']['copy_to_clipboard']; ?>');" class="f6"><?php echo $this->_var['lang']['code_copy']; ?></a>]<?php endif; ?></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <script language="Javascript"> copyToClipboard = function(txt) { if(window.clipboardData) { window.clipboardData.clearData(); window.clipboardData.setData("Text", txt); } else if(navigator.userAgent.indexOf("Opera") != -1) { //暂时无方法:-( } else if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("<?php echo $this->_var['lang']['firefox_copy_alert']; ?>"); return false; } var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard); if (!clip) return; var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable); if (!trans) return; trans.addDataFlavor('text/unicode'); var str = new Object(); var len = new Object(); var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); var copytext = txt; str.data = copytext; trans.setTransferData("text/unicode",str,copytext.length*2); var clipid = Components.interfaces.nsIClipboard; if (!clip) return false; clip.setData(trans,null,clipid.kGlobalClipboard); } } </script> <?php endif; ?> <?php endif; ?> <?php endif; ?> </div> </div> </div> </div> </div> <div class="blank"></div> <?php echo $this->fetch('library/page_footer.lbi'); ?> </body> <script type="text/javascript"> <?php $_from = $this->_var['lang']['clips_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </script> </html>
zzshop
trunk/temp/compiled/user_clips.dwt.php
PHP
asf20
41,328
<div class="userMenu"> <a href="user.php" <?php if ($this->_var['action'] == 'default'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u1.gif"> <?php echo $this->_var['lang']['label_welcome']; ?></a> <a href="user.php?act=profile"<?php if ($this->_var['action'] == 'profile'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u2.gif"> <?php echo $this->_var['lang']['label_profile']; ?></a> <a href="user.php?act=order_list"<?php if ($this->_var['action'] == 'order_list' || $this->_var['action'] == 'order_detail'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u3.gif"> <?php echo $this->_var['lang']['label_order']; ?></a> <a href="user.php?act=address_list"<?php if ($this->_var['action'] == 'address_list'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u4.gif"> <?php echo $this->_var['lang']['label_address']; ?></a> <a href="user.php?act=collection_list"<?php if ($this->_var['action'] == 'collection_list'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u5.gif"> <?php echo $this->_var['lang']['label_collection']; ?></a> <a href="user.php?act=message_list"<?php if ($this->_var['action'] == 'message_list'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u6.gif"> <?php echo $this->_var['lang']['label_message']; ?></a> <a href="user.php?act=tag_list"<?php if ($this->_var['action'] == 'tag_list'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u7.gif"> <?php echo $this->_var['lang']['label_tag']; ?></a> <a href="user.php?act=booking_list"<?php if ($this->_var['action'] == 'booking_list'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u8.gif"> <?php echo $this->_var['lang']['label_booking']; ?></a> <a href="user.php?act=bonus"<?php if ($this->_var['action'] == 'bonus'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u9.gif"> <?php echo $this->_var['lang']['label_bonus']; ?></a> <?php if ($this->_var['affiliate']['on'] == 1): ?><a href="user.php?act=affiliate"<?php if ($this->_var['action'] == 'affiliate'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u10.gif"> <?php echo $this->_var['lang']['label_affiliate']; ?></a><?php endif; ?> <a href="user.php?act=comment_list"<?php if ($this->_var['action'] == 'comment_list'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u11.gif"> <?php echo $this->_var['lang']['label_comment']; ?></a> <!--<a href="user.php?act=group_buy"><?php echo $this->_var['lang']['label_group_buy']; ?></a>--> <a href="user.php?act=track_packages"<?php if ($this->_var['action'] == 'track_packages'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u12.gif"> <?php echo $this->_var['lang']['label_track_packages']; ?></a> <a href="user.php?act=account_log"<?php if ($this->_var['action'] == 'account_log'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u13.gif"> <?php echo $this->_var['lang']['label_user_surplus']; ?></a> <?php if ($this->_var['show_transform_points']): ?> <a href="user.php?act=transform_points"<?php if ($this->_var['action'] == 'transform_points'): ?>class="curs"<?php endif; ?>><img src="themes/default/images/u14.gif"> <?php echo $this->_var['lang']['label_transform_points']; ?></a> <?php endif; ?> <a href="user.php?act=logout" style="background:none; text-align:right; margin-right:10px;"><img src="themes/default/images/bnt_sign.gif"></a> </div>
zzshop
trunk/temp/compiled/user_menu.lbi.php
PHP
asf20
3,437
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="Generator" content="ECSHOP v2.7.2" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" /> <meta name="Description" content="<?php echo $this->_var['description']; ?>" /> <title><?php echo $this->_var['page_title']; ?></title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="icon" href="animated_favicon.gif" type="image/gif" /> <link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" /> <?php echo $this->smarty_insert_scripts(array('files'=>'common.js,user.js,transport.js')); ?> <body> <?php echo $this->fetch('library/page_header.lbi'); ?> <div class="block box"> <div id="ur_here"> <?php echo $this->fetch('library/ur_here.lbi'); ?> </div> </div> <div class="blank"></div> <?php if ($this->_var['action'] == 'login'): ?> <div class="usBox clearfix"> <div class="usBox_1 f_l"> <div class="logtitle"></div> <form name="formLogin" action="user.php" method="post" onSubmit="return userLogin()"> <table width="100%" border="0" align="left" cellpadding="3" cellspacing="5"> <tr> <td width="15%" align="right"><?php echo $this->_var['lang']['label_username']; ?></td> <td width="85%"><input name="username" type="text" size="25" class="inputBg" /></td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['label_password']; ?></td> <td> <input name="password" type="password" size="15" class="inputBg"/> </td> </tr> <?php if ($this->_var['enabled_captcha']): ?> <tr> <td align="right"><?php echo $this->_var['lang']['comment_captcha']; ?></td> <td><input type="text" size="8" name="captcha" class="inputBg" /> <img src="captcha.php?is_login=1&<?php echo $this->_var['rand']; ?>" alt="captcha" style="vertical-align: middle;cursor: pointer;" onClick="this.src='captcha.php?is_login=1&'+Math.random()" /> </td> </tr> <?php endif; ?> <tr> <td colspan="2"><input type="checkbox" value="1" name="remember" id="remember" /><label for="remember"><?php echo $this->_var['lang']['remember']; ?></label></td> </tr> <tr> <td>&nbsp;</td> <td align="left"> <input type="hidden" name="act" value="act_login" /> <input type="hidden" name="back_act" value="<?php echo $this->_var['back_act']; ?>" /> <input type="submit" name="submit" value="" class="us_Submit" /> </td> </tr> <tr><td></td><td><a href="user.php?act=qpassword_name" class="f3"><?php echo $this->_var['lang']['get_password_by_question']; ?></a>&nbsp;&nbsp;&nbsp;<a href="user.php?act=get_password" class="f3"><?php echo $this->_var['lang']['get_password_by_mail']; ?></a></td></tr> </table> </form> </div> <div class="usTxt"> <strong><?php echo $this->_var['lang']['user_reg_info']['0']; ?></strong> <br /> <strong class="f4"><?php echo $this->_var['lang']['user_reg_info']['1']; ?>:</strong><br /> <?php if ($this->_var['car_off'] == 1): ?> <?php echo $this->_var['lang']['user_reg_info']['2']; ?><br /> <?php endif; ?> <?php if ($this->_var['car_off'] == 0): ?> <?php echo $this->_var['lang']['user_reg_info']['8']; ?><br /> <?php endif; ?> <?php echo $this->_var['lang']['user_reg_info']['3']; ?>:<br /> 1. <?php echo $this->_var['lang']['user_reg_info']['4']; ?><br /> 2. <?php echo $this->_var['lang']['user_reg_info']['5']; ?><br /> 3. <?php echo $this->_var['lang']['user_reg_info']['6']; ?><br /> 4. <?php echo $this->_var['lang']['user_reg_info']['7']; ?> <br /> <a href="user.php?act=register"><img src="themes/default/images/bnt_ur_reg.gif" /></a> </div> </div> <?php endif; ?> <?php if ($this->_var['action'] == 'register'): ?> <?php if ($this->_var['shop_reg_closed'] == 1): ?> <div class="usBox"> <div class="usBox_2 clearfix"> <div class="f1 f5" align="center"><?php echo $this->_var['lang']['shop_register_closed']; ?></div> </div> </div> <?php else: ?> <?php echo $this->smarty_insert_scripts(array('files'=>'utils.js')); ?> <div class="usBox"> <div class="usBox_2 clearfix"> <div class="regtitle"></div> <form action="user.php" method="post" name="formUser" onsubmit="return register();"> <table width="100%" border="0" align="left" cellpadding="5" cellspacing="3"> <tr> <td width="13%" align="right"><?php echo $this->_var['lang']['label_username']; ?></td> <td width="87%"> <input name="username" type="text" size="25" id="username" onblur="is_registered(this.value);" class="inputBg"/> <span id="username_notice" style="color:#FF0000"> *</span> </td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['label_email']; ?></td> <td> <input name="email" type="text" size="25" id="email" onblur="checkEmail(this.value);" class="inputBg"/> <span id="email_notice" style="color:#FF0000"> *</span> </td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['label_password']; ?></td> <td> <input name="password" type="password" id="password1" onblur="check_password(this.value);" onkeyup="checkIntensity(this.value)" class="inputBg" style="width:179px;" /> <span style="color:#FF0000" id="password_notice"> *</span> </td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['label_password_intensity']; ?></td> <td> <table width="145" border="0" cellspacing="0" cellpadding="1"> <tr align="center"> <td width="33%" id="pwd_lower"><?php echo $this->_var['lang']['pwd_lower']; ?></td> <td width="33%" id="pwd_middle"><?php echo $this->_var['lang']['pwd_middle']; ?></td> <td width="33%" id="pwd_high"><?php echo $this->_var['lang']['pwd_high']; ?></td> </tr> </table> </td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['label_confirm_password']; ?></td> <td> <input name="confirm_password" type="password" id="conform_password" onblur="check_conform_password(this.value);" class="inputBg" style="width:179px;"/> <span style="color:#FF0000" id="conform_password_notice"> *</span> </td> </tr> <?php $_from = $this->_var['extend_info_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'field');if (count($_from)): foreach ($_from AS $this->_var['field']): ?> <?php if ($this->_var['field']['id'] == 6): ?> <tr> <td align="right"><?php echo $this->_var['lang']['passwd_question']; ?></td> <td> <select name='sel_question'> <option value='0'><?php echo $this->_var['lang']['sel_question']; ?></option> <?php echo $this->html_options(array('options'=>$this->_var['passwd_questions'])); ?> </select> </td> </tr> <tr> <td align="right" <?php if ($this->_var['field']['is_need']): ?>id="passwd_quesetion"<?php endif; ?>><?php echo $this->_var['lang']['passwd_answer']; ?></td> <td> <input name="passwd_answer" type="text" size="25" class="inputBg" maxlengt='20'/><?php if ($this->_var['field']['is_need']): ?><span style="color:#FF0000"> *</span><?php endif; ?> </td> </tr> <?php else: ?> <tr> <td align="right" <?php if ($this->_var['field']['is_need']): ?>id="extend_field<?php echo $this->_var['field']['id']; ?>i"<?php endif; ?>><?php echo $this->_var['field']['reg_field_name']; ?> <td> <input name="extend_field<?php echo $this->_var['field']['id']; ?>" type="text" size="25" class="inputBg" /><?php if ($this->_var['field']['is_need']): ?><span style="color:#FF0000"> *</span><?php endif; ?> </td> </tr> <?php endif; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php if ($this->_var['enabled_captcha']): ?> <tr> <td align="right"><?php echo $this->_var['lang']['comment_captcha']; ?></td> <td><input type="text" size="8" name="captcha" class="inputBg" /> <img src="captcha.php?<?php echo $this->_var['rand']; ?>" alt="captcha" style="vertical-align: middle;cursor: pointer;" onClick="this.src='captcha.php?'+Math.random()" /> </td> </tr> <?php endif; ?> <tr> <td>&nbsp;</td> <td><label> <input name="agreement" type="checkbox" value="1" checked="checked" /> <?php echo $this->_var['lang']['agreement']; ?></label></td> </tr> <tr> <td>&nbsp;</td> <td align="left"> <input name="act" type="hidden" value="act_register" > <input type="hidden" name="back_act" value="<?php echo $this->_var['back_act']; ?>" /> <input name="Submit" type="submit" value="" class="us_Submit_reg"> </td> </tr> <tr> <td colspan="2">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td class="actionSub"> <a href="user.php?act=login"><?php echo $this->_var['lang']['want_login']; ?></a><br /> <a href="user.php?act=get_password"><?php echo $this->_var['lang']['forgot_password']; ?></a> </td> </tr> </table> </form> </div> </div> <?php endif; ?> <?php endif; ?> <?php if ($this->_var['action'] == 'get_password'): ?> <?php echo $this->smarty_insert_scripts(array('files'=>'utils.js')); ?> <script type="text/javascript"> <?php $_from = $this->_var['lang']['password_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </script> <div class="usBox"> <div class="usBox_2 clearfix"> <form action="user.php" method="post" name="getPassword" onsubmit="return submitPwdInfo();"> <br /> <table width="70%" border="0" align="center"> <tr> <td colspan="2" align="center"><strong><?php echo $this->_var['lang']['username_and_email']; ?></strong></td> </tr> <tr> <td width="29%" align="right"><?php echo $this->_var['lang']['username']; ?></td> <td width="61%"><input name="user_name" type="text" size="30" class="inputBg" /></td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['email']; ?></td> <td><input name="email" type="text" size="30" class="inputBg" /></td> </tr> <tr> <td></td> <td><input type="hidden" name="act" value="send_pwd_email" /> <input type="submit" name="submit" value="<?php echo $this->_var['lang']['submit']; ?>" class="bnt_blue" style="border:none;" /> <input name="button" type="button" onclick="history.back()" value="<?php echo $this->_var['lang']['back_page_up']; ?>" style="border:none;" class="bnt_blue_1" /> </td> </tr> </table> <br /> </form> </div> </div> <?php endif; ?> <?php if ($this->_var['action'] == 'qpassword_name'): ?> <div class="usBox"> <div class="usBox_2 clearfix"> <form action="user.php" method="post"> <br /> <table width="70%" border="0" align="center"> <tr> <td colspan="2" align="center"><strong><?php echo $this->_var['lang']['get_question_username']; ?></strong></td> </tr> <tr> <td width="29%" align="right"><?php echo $this->_var['lang']['username']; ?></td> <td width="61%"><input name="user_name" type="text" size="30" class="inputBg" /></td> </tr> <tr> <td></td> <td><input type="hidden" name="act" value="get_passwd_question" /> <input type="submit" name="submit" value="<?php echo $this->_var['lang']['submit']; ?>" class="bnt_blue" style="border:none;" /> <input name="button" type="button" onclick="history.back()" value="<?php echo $this->_var['lang']['back_page_up']; ?>" style="border:none;" class="bnt_blue_1" /> </td> </tr> </table> <br /> </form> </div> </div> <?php endif; ?> <?php if ($this->_var['action'] == 'get_passwd_question'): ?> <div class="usBox"> <div class="usBox_2 clearfix"> <form action="user.php" method="post"> <br /> <table width="70%" border="0" align="center"> <tr> <td colspan="2" align="center"><strong><?php echo $this->_var['lang']['input_answer']; ?></strong></td> </tr> <tr> <td width="29%" align="right"><?php echo $this->_var['lang']['passwd_question']; ?>:</td> <td width="61%"><?php echo $this->_var['passwd_question']; ?></td> </tr> <tr> <td align="right"><?php echo $this->_var['lang']['passwd_answer']; ?>:</td> <td><input name="passwd_answer" type="text" size="20" class="inputBg" /></td> </tr> <?php if ($this->_var['enabled_captcha']): ?> <tr> <td align="right"><?php echo $this->_var['lang']['comment_captcha']; ?></td> <td><input type="text" size="8" name="captcha" class="inputBg" /> <img src="captcha.php?is_login=1&<?php echo $this->_var['rand']; ?>" alt="captcha" style="vertical-align: middle;cursor: pointer;" onClick="this.src='captcha.php?is_login=1&'+Math.random()" /> </td> </tr> <?php endif; ?> <tr> <td></td> <td><input type="hidden" name="act" value="check_answer" /> <input type="submit" name="submit" value="<?php echo $this->_var['lang']['submit']; ?>" class="bnt_blue" style="border:none;" /> <input name="button" type="button" onclick="history.back()" value="<?php echo $this->_var['lang']['back_page_up']; ?>" style="border:none;" class="bnt_blue_1" /> </td> </tr> </table> <br /> </form> </div> </div> <?php endif; ?> <?php if ($this->_var['action'] == 'reset_password'): ?> <script type="text/javascript"> <?php $_from = $this->_var['lang']['password_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </script> <div class="usBox"> <div class="usBox_2 clearfix"> <form action="user.php" method="post" name="getPassword2" onSubmit="return submitPwd()"> <br /> <table width="80%" border="0" align="center"> <tr> <td><?php echo $this->_var['lang']['new_password']; ?></td> <td><input name="new_password" type="password" size="25" class="inputBg" /></td> </tr> <tr> <td><?php echo $this->_var['lang']['confirm_password']; ?>:</td> <td><input name="confirm_password" type="password" size="25" class="inputBg"/></td> </tr> <tr> <td colspan="2" align="center"> <input type="hidden" name="act" value="act_edit_password" /> <input type="hidden" name="uid" value="<?php echo $this->_var['uid']; ?>" /> <input type="hidden" name="code" value="<?php echo $this->_var['code']; ?>" /> <input type="submit" name="submit" value="<?php echo $this->_var['lang']['confirm_submit']; ?>" /> </td> </tr> </table> <br /> </form> </div> </div> <?php endif; ?> <div class="blank"></div> <?php echo $this->fetch('library/page_footer.lbi'); ?> </body> <script type="text/javascript"> var process_request = "<?php echo $this->_var['lang']['process_request']; ?>"; <?php $_from = $this->_var['lang']['passport_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> var username_exist = "<?php echo $this->_var['lang']['username_exist']; ?>"; </script> </html>
zzshop
trunk/temp/compiled/user_passport.dwt.php
PHP
asf20
17,488
<?php if ($this->_var['index_ad'] == 'sys'): ?> <script type="text/javascript"> var swf_width=484; var swf_height=200; </script> <script type="text/javascript" src="data/flashdata/<?php echo $this->_var['flash_theme']; ?>/cycle_image.js"></script> <?php elseif ($this->_var['index_ad'] == 'cus'): ?> <?php if ($this->_var['ad']['ad_type'] == 0): ?> <a href="<?php echo $this->_var['ad']['url']; ?>" target="_blank"><img src="<?php echo $this->_var['ad']['content']; ?>" width="484" height="200" border="0"></a> <?php elseif ($this->_var['ad']['ad_type'] == 1): ?> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="484" height="200"> <param name="movie" value="<?php echo $this->_var['ad']['content']; ?>" /> <param name="quality" value="high" /> <embed src="<?php echo $this->_var['ad']['content']; ?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="484" height="200"></embed> </object> <?php elseif ($this->_var['ad']['ad_type'] == 2): ?> <?php echo $this->_var['ad']['content']; ?> <?php elseif ($this->_var['ad']['ad_type'] == 3): ?> <a href="<?php echo $this->_var['ad']['url']; ?>" target="_blank"><?php echo $this->_var['ad']['content']; ?></a> <?php endif; ?> <?php else: ?> <?php endif; ?>
zzshop
trunk/temp/compiled/index_ad.lbi.php
PHP
asf20
1,460
<?php if ($this->_var['auction_list']): ?> <div class="box"> <div class="box_1"> <h3><span><?php echo $this->_var['lang']['auction_goods']; ?></span><a href="auction.php"><img src="themes/default/images/more.gif"></a></h3> <div class="centerPadd"> <div class="clearfix goodsBox" style="border:none;"> <?php $_from = $this->_var['auction_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'auction');if (count($_from)): foreach ($_from AS $this->_var['auction']): ?> <div class="goodsItem"> <a href="<?php echo $this->_var['auction']['url']; ?>"><img src="<?php echo $this->_var['auction']['thumb']; ?>" alt="<?php echo htmlspecialchars($this->_var['auction']['goods_name']); ?>" class="goodsimg" /></a><br /> <p><a href="<?php echo $this->_var['auction']['url']; ?>" title="<?php echo htmlspecialchars($this->_var['auction']['goods_name']); ?>"><?php echo htmlspecialchars($this->_var['auction']['short_style_name']); ?></a></p> <font class="shop_s"><?php echo $this->_var['auction']['formated_start_price']; ?></font> </div> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </div> </div> </div> </div> <div class="blank5"></div> <?php endif; ?>
zzshop
trunk/temp/compiled/auction.lbi.php
PHP
asf20
1,322
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="Generator" content="ECSHOP v2.7.2" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" /> <meta name="Description" content="<?php echo $this->_var['description']; ?>" /> <title><?php echo $this->_var['page_title']; ?></title> <link rel="shortcut icon" href="favicon.ico" /> <link rel="icon" href="animated_favicon.gif" type="image/gif" /> <link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" /> <?php echo $this->smarty_insert_scripts(array('files'=>'common.js,user.js')); ?> </head> <body> <?php echo $this->fetch('library/page_header.lbi'); ?> <div class="block box"> <div id="ur_here"> <?php echo $this->fetch('library/ur_here.lbi'); ?> </div> </div> <div class="blank"></div> <div class="block clearfix"> <div class="AreaL"> <div class="box"> <div class="box_1"> <div class="userCenterBox"> <?php echo $this->fetch('library/user_menu.lbi'); ?> </div> </div> </div> </div> <div class="AreaR"> <div class="box"> <div class="box_1"> <div class="userCenterBox boxCenterList clearfix" style="_height:1%;"> <?php if ($this->_var['action'] == 'profile'): ?> <?php echo $this->smarty_insert_scripts(array('files'=>'utils.js')); ?> <script type="text/javascript"> <?php $_from = $this->_var['lang']['profile_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </script> <h5><span><?php echo $this->_var['lang']['profile']; ?></span></h5> <div class="blank"></div> <form name="formEdit" action="user.php" method="post" onSubmit="return userEdit()"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="28%" align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['birthday']; ?>: </td> <td width="72%" align="left" bgcolor="#FFFFFF"> <?php echo $this->html_select_date(array('field_order'=>'YMD','prefix'=>'birthday','start_year'=>'-60','end_year'=>'+1','display_days'=>'true','month_format'=>'%m','day_value_format'=>'%02d','time'=>$this->_var['profile']['birthday'])); ?> </td> </tr> <tr> <td width="28%" align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['sex']; ?>: </td> <td width="72%" align="left" bgcolor="#FFFFFF"><input type="radio" name="sex" value="0" <?php if ($this->_var['profile']['sex'] == 0): ?>checked="checked"<?php endif; ?> /> <?php echo $this->_var['lang']['secrecy']; ?>&nbsp;&nbsp; <input type="radio" name="sex" value="1" <?php if ($this->_var['profile']['sex'] == 1): ?>checked="checked"<?php endif; ?> /> <?php echo $this->_var['lang']['male']; ?>&nbsp;&nbsp; <input type="radio" name="sex" value="2" <?php if ($this->_var['profile']['sex'] == 2): ?>checked="checked"<?php endif; ?> /> <?php echo $this->_var['lang']['female']; ?>&nbsp;&nbsp; </td> </tr> <tr> <td width="28%" align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['email']; ?>: </td> <td width="72%" align="left" bgcolor="#FFFFFF"><input name="email" type="text" value="<?php echo $this->_var['profile']['email']; ?>" size="25" class="inputBg" /><span style="color:#FF0000"> *</span></td> </tr> <?php $_from = $this->_var['extend_info_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'field');if (count($_from)): foreach ($_from AS $this->_var['field']): ?> <?php if ($this->_var['field']['id'] == 6): ?> <tr> <td width="28%" align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['passwd_question']; ?>:</td> <td width="72%" align="left" bgcolor="#FFFFFF"> <select name='sel_question'> <option value='0'><?php echo $this->_var['lang']['sel_question']; ?></option> <?php echo $this->html_options(array('options'=>$this->_var['passwd_questions'],'selected'=>$this->_var['profile']['passwd_question'])); ?> </select> </td> </tr> <tr> <td width="28%" align="right" bgcolor="#FFFFFF" <?php if ($this->_var['field']['is_need']): ?>id="passwd_quesetion"<?php endif; ?>><?php echo $this->_var['lang']['passwd_answer']; ?>:</td> <td width="72%" align="left" bgcolor="#FFFFFF"> <input name="passwd_answer" type="text" size="25" class="inputBg" maxlengt='20' value="<?php echo $this->_var['profile']['passwd_answer']; ?>"/><?php if ($this->_var['field']['is_need']): ?><span style="color:#FF0000"> *</span><?php endif; ?> </td> </tr> <?php else: ?> <tr> <td width="28%" align="right" bgcolor="#FFFFFF" <?php if ($this->_var['field']['is_need']): ?>id="extend_field<?php echo $this->_var['field']['id']; ?>i"<?php endif; ?>><?php echo $this->_var['field']['reg_field_name']; ?>:</td> <td width="72%" align="left" bgcolor="#FFFFFF"> <input name="extend_field<?php echo $this->_var['field']['id']; ?>" type="text" class="inputBg" value="<?php echo $this->_var['field']['content']; ?>"/><?php if ($this->_var['field']['is_need']): ?><span style="color:#FF0000"> *</span><?php endif; ?> </td> </tr> <?php endif; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <tr> <td colspan="2" align="center" bgcolor="#FFFFFF"><input name="act" type="hidden" value="act_edit_profile" /> <input name="submit" type="submit" value="<?php echo $this->_var['lang']['confirm_edit']; ?>" class="bnt_blue_1" style="border:none;" /> </td> </tr> </table> </form> <form name="formPassword" action="user.php" method="post" onSubmit="return editPassword()" > <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="28%" align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['old_password']; ?>:</td> <td width="76%" align="left" bgcolor="#FFFFFF"><input name="old_password" type="password" size="25" class="inputBg" /></td> </tr> <tr> <td width="28%" align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['new_password']; ?>:</td> <td align="left" bgcolor="#FFFFFF"><input name="new_password" type="password" size="25" class="inputBg" /></td> </tr> <tr> <td width="28%" align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['confirm_password']; ?>:</td> <td align="left" bgcolor="#FFFFFF"><input name="comfirm_password" type="password" size="25" class="inputBg" /></td> </tr> <tr> <td colspan="2" align="center" bgcolor="#FFFFFF"><input name="act" type="hidden" value="act_edit_password" /> <input name="submit" type="submit" class="bnt_blue_1" style="border:none;" value="<?php echo $this->_var['lang']['confirm_edit']; ?>" /> </td> </tr> </table> </form> <?php endif; ?> <?php if ($this->_var['action'] == 'bonus'): ?> <script type="text/javascript"> <?php $_from = $this->_var['lang']['profile_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </script> <h5><span><?php echo $this->_var['lang']['label_bonus']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <th align="center" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['bonus_sn']; ?></th> <th align="center" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['bonus_name']; ?></th> <th align="center" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['bonus_amount']; ?></th> <th align="center" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['min_goods_amount']; ?></th> <th align="center" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['bonus_end_date']; ?></th> <th align="center" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['bonus_status']; ?></th> </tr> <?php if ($this->_var['bonus']): ?> <?php $_from = $this->_var['bonus']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> <tr> <td align="center" bgcolor="#FFFFFF"><?php echo empty($this->_var['item']['bonus_sn']) ? 'N/A' : $this->_var['item']['bonus_sn']; ?></td> <td align="center" bgcolor="#FFFFFF"><?php echo $this->_var['item']['type_name']; ?></td> <td align="center" bgcolor="#FFFFFF"><?php echo $this->_var['item']['type_money']; ?></td> <td align="center" bgcolor="#FFFFFF"><?php echo $this->_var['item']['min_goods_amount']; ?></td> <td align="center" bgcolor="#FFFFFF"><?php echo $this->_var['item']['use_enddate']; ?></td> <td align="center" bgcolor="#FFFFFF"><?php echo $this->_var['item']['status']; ?></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php else: ?> <tr> <td colspan="6" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['user_bonus_empty']; ?></td> </tr> <?php endif; ?> </table> <div class="blank5"></div> <?php echo $this->fetch('library/pages.lbi'); ?> <div class="blank5"></div> <h5><span><?php echo $this->_var['lang']['add_bonus']; ?></span></h5> <div class="blank"></div> <form name="addBouns" action="user.php" method="post" onSubmit="return addBonus()"> <div style="padding: 15px;"> <?php echo $this->_var['lang']['bonus_number']; ?> <input name="bonus_sn" type="text" size="30" class="inputBg" /> <input type="hidden" name="act" value="act_add_bonus" class="inputBg" /> <input type="submit" class="bnt_blue_1" style="border:none;" value="<?php echo $this->_var['lang']['add_bonus']; ?>" /> </div> </form> <?php endif; ?> <?php if ($this->_var['action'] == 'order_list'): ?> <h5><span><?php echo $this->_var['lang']['label_order']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['order_number']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['order_addtime']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['order_money']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['order_status']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['handle']; ?></td> </tr> <?php $_from = $this->_var['orders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> <tr> <td align="center" bgcolor="#ffffff"><a href="user.php?act=order_detail&order_id=<?php echo $this->_var['item']['order_id']; ?>" class="f6"><?php echo $this->_var['item']['order_sn']; ?></a></td> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['order_time']; ?></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['item']['total_fee']; ?></td> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['order_status']; ?></td> <td align="center" bgcolor="#ffffff"><font class="f6"><?php echo $this->_var['item']['handler']; ?></font></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <div class="blank5"></div> <?php echo $this->fetch('library/pages.lbi'); ?> <div class="blank5"></div> <h5><span><?php echo $this->_var['lang']['merge_order']; ?></span></h5> <div class="blank"></div> <script type="text/javascript"> <?php $_from = $this->_var['lang']['merge_order_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </script> <form action="user.php" method="post" name="formOrder" onsubmit="return mergeOrder()"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="22%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['first_order']; ?>:</td> <td width="12%" align="left" bgcolor="#ffffff"><select name="to_order"> <option value="0"><?php echo $this->_var['lang']['select']; ?></option> <?php echo $this->html_options(array('options'=>$this->_var['merge'])); ?> </select></td> <td width="19%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['second_order']; ?>:</td> <td width="11%" align="left" bgcolor="#ffffff"><select name="from_order"> <option value="0"><?php echo $this->_var['lang']['select']; ?></option> <?php echo $this->html_options(array('options'=>$this->_var['merge'])); ?> </select></td> <td width="36%" bgcolor="#ffffff">&nbsp;<input name="act" value="merge_order" type="hidden" /> <input type="submit" name="Submit" class="bnt_blue_1" style="border:none;" value="<?php echo $this->_var['lang']['merge_order']; ?>" /></td> </tr> <tr> <td bgcolor="#ffffff">&nbsp;</td> <td colspan="4" align="left" bgcolor="#ffffff"><?php echo $this->_var['lang']['merge_order_notice']; ?></td> </tr> </table> </form> <?php endif; ?> <?php if ($this->_var['action'] == 'track_packages'): ?> <h5><span><?php echo $this->_var['lang']['label_track_packages']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd" id="order_table"> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['order_number']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['handle']; ?></td> </tr> <?php $_from = $this->_var['orders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> <tr> <td align="center" bgcolor="#ffffff"><a href="user.php?act=order_detail&order_id=<?php echo $this->_var['item']['order_id']; ?>"><?php echo $this->_var['item']['order_sn']; ?></a></td> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['query_link']; ?></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <script> var query_status = '<?php echo $this->_var['lang']['query_status']; ?>'; var ot = document.getElementById('order_table'); for (var i = 1; i < ot.rows.length; i++) { var row = ot.rows[i]; var cel = row.cells[1]; cel.getElementsByTagName('a').item(0).innerHTML = query_status; } </script> <div class="blank5"></div> <?php echo $this->fetch('library/pages.lbi'); ?> <?php endif; ?> <?php if ($this->_var['action'] == order_detail): ?> <h5><span><?php echo $this->_var['lang']['order_status']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['detail_order_sn']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['order_sn']; ?> <?php if ($this->_var['order']['extension_code'] == "group_buy"): ?> <a href="./group_buy.php?act=view&id=<?php echo $this->_var['order']['extension_id']; ?>" class="f6"><strong><?php echo $this->_var['lang']['order_is_group_buy']; ?></strong></a> <?php elseif ($this->_var['order']['extension_code'] == "exchange_goods"): ?> <a href="./exchange.php?act=view&id=<?php echo $this->_var['order']['extension_id']; ?>" class="f6"><strong><?php echo $this->_var['lang']['order_is_exchange']; ?></strong></a> <?php endif; ?> <a href="user.php?act=message_list&order_id=<?php echo $this->_var['order']['order_id']; ?>" class="f6">[<?php echo $this->_var['lang']['business_message']; ?>]</a> </td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['detail_order_status']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['order_status']; ?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $this->_var['order']['confirm_time']; ?></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['detail_pay_status']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['pay_status']; ?>&nbsp;&nbsp;&nbsp;&nbsp;<?php if ($this->_var['order']['order_amount'] > 0): ?><?php echo $this->_var['order']['pay_online']; ?><?php endif; ?><?php echo $this->_var['order']['pay_time']; ?></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['detail_shipping_status']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['shipping_status']; ?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $this->_var['order']['shipping_time']; ?></td> </tr> <?php if ($this->_var['order']['invoice_no']): ?> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['consignment']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['invoice_no']; ?></td> </tr> <?php endif; ?> <?php if ($this->_var['order']['to_buyer']): ?> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['detail_to_buyer']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['to_buyer']; ?></td> </tr> <?php endif; ?> <?php if ($this->_var['virtual_card']): ?> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['virtual_card_info']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"> <?php $_from = $this->_var['virtual_card']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'vgoods');if (count($_from)): foreach ($_from AS $this->_var['vgoods']): ?> <?php $_from = $this->_var['vgoods']['info']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'card');if (count($_from)): foreach ($_from AS $this->_var['card']): ?> <?php if ($this->_var['card']['card_sn']): ?><?php echo $this->_var['lang']['card_sn']; ?>:<span style="color:red;"><?php echo $this->_var['card']['card_sn']; ?></span><?php endif; ?> <?php if ($this->_var['card']['card_password']): ?><?php echo $this->_var['lang']['card_password']; ?>:<span style="color:red;"><?php echo $this->_var['card']['card_password']; ?></span><?php endif; ?> <?php if ($this->_var['card']['end_date']): ?><?php echo $this->_var['lang']['end_date']; ?>:<?php echo $this->_var['card']['end_date']; ?><?php endif; ?><br /> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </td> </tr> <?php endif; ?> </table> <div class="blank"></div> <h5><span><?php echo $this->_var['lang']['goods_list']; ?></span> <?php if ($this->_var['allow_to_cart']): ?> <a href="javascript:;" onclick="returnToCart(<?php echo $this->_var['order']['order_id']; ?>)" class="f6"><?php echo $this->_var['lang']['return_to_cart']; ?></a> <?php endif; ?> </h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <th width="23%" align="center" bgcolor="#ffffff"><?php echo $this->_var['lang']['goods_name']; ?></th> <th width="29%" align="center" bgcolor="#ffffff"><?php echo $this->_var['lang']['goods_attr']; ?></th> <!--<th><?php echo $this->_var['lang']['market_price']; ?></th>--> <th width="26%" align="center" bgcolor="#ffffff"><?php echo $this->_var['lang']['goods_price']; ?><?php if ($this->_var['order']['extension_code'] == "group_buy"): ?><?php echo $this->_var['lang']['gb_deposit']; ?><?php endif; ?></th> <th width="9%" align="center" bgcolor="#ffffff"><?php echo $this->_var['lang']['number']; ?></th> <th width="20%" align="center" bgcolor="#ffffff"><?php echo $this->_var['lang']['subtotal']; ?></th> </tr> <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');if (count($_from)): foreach ($_from AS $this->_var['goods']): ?> <tr> <td bgcolor="#ffffff"> <?php if ($this->_var['goods']['goods_id'] > 0 && $this->_var['goods']['extension_code'] != 'package_buy'): ?> <a href="goods.php?id=<?php echo $this->_var['goods']['goods_id']; ?>" target="_blank" class="f6"><?php echo $this->_var['goods']['goods_name']; ?></a> <?php if ($this->_var['goods']['parent_id'] > 0): ?> <span style="color:#FF0000">(<?php echo $this->_var['lang']['accessories']; ?>)</span> <?php elseif ($this->_var['goods']['is_gift']): ?> <span style="color:#FF0000">(<?php echo $this->_var['lang']['largess']; ?>)</span> <?php endif; ?> <?php elseif ($this->_var['goods']['goods_id'] > 0 && $this->_var['goods']['extension_code'] == 'package_buy'): ?> <a href="javascript:void(0)" onclick="setSuitShow(<?php echo $this->_var['goods']['goods_id']; ?>)" class="f6"><?php echo $this->_var['goods']['goods_name']; ?><span style="color:#FF0000;">(礼包)</span></a> <div id="suit_<?php echo $this->_var['goods']['goods_id']; ?>" style="display:none"> <?php $_from = $this->_var['goods']['package_goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'package_goods_list');if (count($_from)): foreach ($_from AS $this->_var['package_goods_list']): ?> <a href="goods.php?id=<?php echo $this->_var['package_goods_list']['goods_id']; ?>" target="_blank" class="f6"><?php echo $this->_var['package_goods_list']['goods_name']; ?></a><br /> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </div> <?php endif; ?> </td> <td align="left" bgcolor="#ffffff"><?php echo nl2br($this->_var['goods']['goods_attr']); ?></td> <!--<td align="right"><?php echo $this->_var['goods']['market_price']; ?></td>--> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['goods']['goods_price']; ?></td> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['goods']['goods_number']; ?></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['goods']['subtotal']; ?></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <tr> <td colspan="8" bgcolor="#ffffff" align="right"> <?php echo $this->_var['lang']['shopping_money']; ?><?php if ($this->_var['order']['extension_code'] == "group_buy"): ?><?php echo $this->_var['lang']['gb_deposit']; ?><?php endif; ?>: <?php echo $this->_var['order']['formated_goods_amount']; ?> </td> </tr> </table> <div class="blank"></div> <h5><span><?php echo $this->_var['lang']['fee_total']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td align="right" bgcolor="#ffffff"> <?php echo $this->_var['lang']['goods_all_price']; ?><?php if ($this->_var['order']['extension_code'] == "group_buy"): ?><?php echo $this->_var['lang']['gb_deposit']; ?><?php endif; ?>: <?php echo $this->_var['order']['formated_goods_amount']; ?> <?php if ($this->_var['order']['discount'] > 0): ?> - <?php echo $this->_var['lang']['discount']; ?>: <?php echo $this->_var['order']['formated_discount']; ?> <?php endif; ?> <?php if ($this->_var['order']['tax'] > 0): ?> + <?php echo $this->_var['lang']['tax']; ?>: <?php echo $this->_var['order']['formated_tax']; ?> <?php endif; ?> <?php if ($this->_var['order']['shipping_fee'] > 0): ?> + <?php echo $this->_var['lang']['shipping_fee']; ?>: <?php echo $this->_var['order']['formated_shipping_fee']; ?> <?php endif; ?> <?php if ($this->_var['order']['insure_fee'] > 0): ?> + <?php echo $this->_var['lang']['insure_fee']; ?>: <?php echo $this->_var['order']['formated_insure_fee']; ?> <?php endif; ?> <?php if ($this->_var['order']['pay_fee'] > 0): ?> + <?php echo $this->_var['lang']['pay_fee']; ?>: <?php echo $this->_var['order']['formated_pay_fee']; ?> <?php endif; ?> <?php if ($this->_var['order']['pack_fee'] > 0): ?> + <?php echo $this->_var['lang']['pack_fee']; ?>: <?php echo $this->_var['order']['formated_pack_fee']; ?> <?php endif; ?> <?php if ($this->_var['order']['card_fee'] > 0): ?> + <?php echo $this->_var['lang']['card_fee']; ?>: <?php echo $this->_var['order']['formated_card_fee']; ?> <?php endif; ?> </td> </tr> <tr> <td align="right" bgcolor="#ffffff"> <?php if ($this->_var['order']['money_paid'] > 0): ?> - <?php echo $this->_var['lang']['order_money_paid']; ?>: <?php echo $this->_var['order']['formated_money_paid']; ?> <?php endif; ?> <?php if ($this->_var['order']['surplus'] > 0): ?> - <?php echo $this->_var['lang']['use_surplus']; ?>: <?php echo $this->_var['order']['formated_surplus']; ?> <?php endif; ?> <?php if ($this->_var['order']['integral_money'] > 0): ?> - <?php echo $this->_var['lang']['use_integral']; ?>: <?php echo $this->_var['order']['formated_integral_money']; ?> <?php endif; ?> <?php if ($this->_var['order']['bonus'] > 0): ?> - <?php echo $this->_var['lang']['use_bonus']; ?>: <?php echo $this->_var['order']['formated_bonus']; ?> <?php endif; ?> </td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['order_amount']; ?>: <?php echo $this->_var['order']['formated_order_amount']; ?> <?php if ($this->_var['order']['extension_code'] == "group_buy"): ?><br /> <?php echo $this->_var['lang']['notice_gb_order_amount']; ?><?php endif; ?></td> </tr> <?php if ($this->_var['allow_edit_surplus']): ?> <tr> <td align="right" bgcolor="#ffffff"> <form action="user.php" method="post" name="formFee" id="formFee"><?php echo $this->_var['lang']['use_more_surplus']; ?>: <input name="surplus" type="text" size="8" value="0" style="border:1px solid #ccc;"/><?php echo $this->_var['max_surplus']; ?> <input type="submit" name="Submit" class="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" /> <input type="hidden" name="act" value="act_edit_surplus" /> <input type="hidden" name="order_id" value="<?php echo $_GET['order_id']; ?>" /> </form></td> </tr> <?php endif; ?> </table> <div class="blank"></div> <h5><span><?php echo $this->_var['lang']['consignee_info']; ?></span></h5> <div class="blank"></div> <?php if ($this->_var['order']['allow_update_address'] > 0): ?> <form action="user.php" method="post" name="formAddress" id="formAddress"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['consignee_name']; ?>: </td> <td width="35%" align="left" bgcolor="#ffffff"><input name="consignee" type="text" class="inputBg" value="<?php echo htmlspecialchars($this->_var['order']['consignee']); ?>" size="25"> </td> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['email_address']; ?>: </td> <td width="35%" align="left" bgcolor="#ffffff"><input name="email" type="text" class="inputBg" value="<?php echo htmlspecialchars($this->_var['order']['email']); ?>" size="25" /> </td> </tr> <?php if ($this->_var['order']['exist_real_goods']): ?> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['detailed_address']; ?>: </td> <td align="left" bgcolor="#ffffff"><input name="address" type="text" class="inputBg" value="<?php echo htmlspecialchars($this->_var['order']['address']); ?> " size="25" /></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['postalcode']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="zipcode" type="text" class="inputBg" value="<?php echo htmlspecialchars($this->_var['order']['zipcode']); ?>" size="25" /></td> </tr> <?php endif; ?> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['phone']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="tel" type="text" class="inputBg" value="<?php echo htmlspecialchars($this->_var['order']['tel']); ?>" size="25" /></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['backup_phone']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="mobile" type="text" class="inputBg" value="<?php echo htmlspecialchars($this->_var['order']['mobile']); ?>" size="25" /></td> </tr> <?php if ($this->_var['order']['exist_real_goods']): ?> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['sign_building']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="sign_building" class="inputBg" type="text" value="<?php echo htmlspecialchars($this->_var['order']['sign_building']); ?>" size="25" /> </td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['deliver_goods_time']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="best_time" type="text" class="inputBg" value="<?php echo htmlspecialchars($this->_var['order']['best_time']); ?>" size="25" /> </td> </tr> <?php endif; ?> <tr> <td colspan="4" align="center" bgcolor="#ffffff"><input type="hidden" name="act" value="save_order_address" /> <input type="hidden" name="order_id" value="<?php echo $this->_var['order']['order_id']; ?>" /> <input type="submit" class="bnt_blue_2" value="<?php echo $this->_var['lang']['update_address']; ?>" /> </td> </tr> </table> </form> <?php else: ?> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['consignee_name']; ?>:</td> <td width="35%" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['consignee']; ?></td> <td width="15%" align="right" bgcolor="#ffffff" ><?php echo $this->_var['lang']['email_address']; ?>:</td> <td width="35%" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['email']; ?></td> </tr> <?php if ($this->_var['order']['exist_real_goods']): ?> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['detailed_address']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['address']; ?> <?php if ($this->_var['order']['zipcode']): ?> [<?php echo $this->_var['lang']['postalcode']; ?>: <?php echo $this->_var['order']['zipcode']; ?>] <?php endif; ?></td> </tr> <?php endif; ?> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['phone']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['tel']; ?> </td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['backup_phone']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['mobile']; ?></td> </tr> <?php if ($this->_var['order']['exist_real_goods']): ?> <tr> <td align="right" bgcolor="#ffffff" ><?php echo $this->_var['lang']['sign_building']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['sign_building']; ?> </td> <td align="right" bgcolor="#ffffff" ><?php echo $this->_var['lang']['deliver_goods_time']; ?>:</td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['best_time']; ?></td> </tr> <?php endif; ?> </table> <?php endif; ?> <div class="blank"></div> <h5><span><?php echo $this->_var['lang']['payment']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td bgcolor="#ffffff"> <?php echo $this->_var['lang']['select_payment']; ?>: <?php echo $this->_var['order']['pay_name']; ?>。<?php echo $this->_var['lang']['order_amount']; ?>: <strong><?php echo $this->_var['order']['formated_order_amount']; ?></strong><br /> <?php echo $this->_var['order']['pay_desc']; ?> </td> </tr> <tr> <td bgcolor="#ffffff" align="right"> <?php if ($this->_var['payment_list']): ?> <form name="payment" method="post" action="user.php"> <?php echo $this->_var['lang']['change_payment']; ?>: <select name="pay_id"> <?php $_from = $this->_var['payment_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'payment');if (count($_from)): foreach ($_from AS $this->_var['payment']): ?> <option value="<?php echo $this->_var['payment']['pay_id']; ?>"> <?php echo $this->_var['payment']['pay_name']; ?>(<?php echo $this->_var['lang']['pay_fee']; ?>:<?php echo $this->_var['payment']['format_pay_fee']; ?>) </option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> <input type="hidden" name="act" value="act_edit_payment" /> <input type="hidden" name="order_id" value="<?php echo $this->_var['order']['order_id']; ?>" /> <input type="submit" name="Submit" class="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" /> </form> <?php endif; ?> </td> </tr> </table> <div class="blank"></div> <h5><span><?php echo $this->_var['lang']['other_info']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <?php if ($this->_var['order']['shipping_id'] > 0): ?> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['shipping']; ?>:</td> <td colspan="3" width="85%" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['shipping_name']; ?></td> </tr> <?php endif; ?> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['payment']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['pay_name']; ?></td> </tr> <?php if ($this->_var['order']['insure_fee'] > 0): ?> <?php endif; ?> <?php if ($this->_var['order']['pack_name']): ?> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['use_pack']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['pack_name']; ?></td> </tr> <?php endif; ?> <?php if ($this->_var['order']['card_name']): ?> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['use_card']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['card_name']; ?></td> </tr> <?php endif; ?> <?php if ($this->_var['order']['card_message']): ?> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['bless_note']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['card_message']; ?></td> </tr> <?php endif; ?> <?php if ($this->_var['order']['surplus'] > 0): ?> <?php endif; ?> <?php if ($this->_var['order']['integral'] > 0): ?> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['use_integral']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['integral']; ?></td> </tr> <?php endif; ?> <?php if ($this->_var['order']['bonus'] > 0): ?> <?php endif; ?> <?php if ($this->_var['order']['inv_payee'] && $this->_var['order']['inv_content']): ?> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['invoice_title']; ?>:</td> <td width="36%" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['inv_payee']; ?></td> <td width="19%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['invoice_content']; ?>:</td> <td width="25%" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['inv_content']; ?></td> </tr> <?php endif; ?> <?php if ($this->_var['order']['postscript']): ?> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['order_postscript']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['postscript']; ?></td> </tr> <?php endif; ?> <tr> <td width="15%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['booking_process']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"><?php echo $this->_var['order']['how_oos_name']; ?></td> </tr> </table> <?php endif; ?> <?php if ($this->_var['action'] == "account_raply" || $this->_var['action'] == "account_log" || $this->_var['action'] == "account_deposit" || $this->_var['action'] == "account_detail"): ?> <script type="text/javascript"> <?php $_from = $this->_var['lang']['account_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </script> <h5><span><?php echo $this->_var['lang']['user_balance']; ?></span></h5> <div class="blank"></div> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td align="right" bgcolor="#ffffff"><a href="user.php?act=account_deposit" class="f6"><?php echo $this->_var['lang']['surplus_type_0']; ?></a> | <a href="user.php?act=account_raply" class="f6"><?php echo $this->_var['lang']['surplus_type_1']; ?></a> | <a href="user.php?act=account_detail" class="f6"><?php echo $this->_var['lang']['add_surplus_log']; ?></a> | <a href="user.php?act=account_log" class="f6"><?php echo $this->_var['lang']['view_application']; ?></a> </td> </tr> </table> <?php endif; ?> <?php if ($this->_var['action'] == "account_raply"): ?> <form name="formSurplus" method="post" action="user.php" onSubmit="return submitSurplus()"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="15%" bgcolor="#ffffff"><?php echo $this->_var['lang']['repay_money']; ?>:</td> <td bgcolor="#ffffff" align="left"><input type="text" name="amount" value="<?php echo htmlspecialchars($this->_var['order']['amount']); ?>" class="inputBg" size="30" /> </td> </tr> <tr> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['process_notic']; ?>:</td> <td bgcolor="#ffffff" align="left"><textarea name="user_note" cols="55" rows="6" style="border:1px solid #ccc;"><?php echo htmlspecialchars($this->_var['order']['user_note']); ?></textarea></td> </tr> <tr> <td bgcolor="#ffffff" colspan="2" align="center"> <input type="hidden" name="surplus_type" value="1" /> <input type="hidden" name="act" value="act_account" /> <input type="submit" name="submit" class="bnt_blue_1" value="<?php echo $this->_var['lang']['submit_request']; ?>" /> <input type="reset" name="reset" class="bnt_blue_1" value="<?php echo $this->_var['lang']['button_reset']; ?>" /> </td> </tr> </table> </form> <?php endif; ?> <?php if ($this->_var['action'] == "account_deposit"): ?> <form name="formSurplus" method="post" action="user.php" onSubmit="return submitSurplus()"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="15%" bgcolor="#ffffff"><?php echo $this->_var['lang']['deposit_money']; ?>:</td> <td align="left" bgcolor="#ffffff"><input type="text" name="amount" class="inputBg" value="<?php echo htmlspecialchars($this->_var['order']['amount']); ?>" size="30" /></td> </tr> <tr> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['process_notic']; ?>:</td> <td align="left" bgcolor="#ffffff"><textarea name="user_note" cols="55" rows="6" style="border:1px solid #ccc;"><?php echo htmlspecialchars($this->_var['order']['user_note']); ?></textarea></td> </tr> </table> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr align="center"> <td bgcolor="#ffffff" colspan="3" align="left"><?php echo $this->_var['lang']['payment']; ?>:</td> </tr> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['pay_name']; ?></td> <td bgcolor="#ffffff" width="60%"><?php echo $this->_var['lang']['pay_desc']; ?></td> <td bgcolor="#ffffff" width="17%"><?php echo $this->_var['lang']['pay_fee']; ?></td> </tr> <?php $_from = $this->_var['payment']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)): foreach ($_from AS $this->_var['list']): ?> <tr> <td bgcolor="#ffffff" align="left"> <input type="radio" name="payment_id" value="<?php echo $this->_var['list']['pay_id']; ?>" /><?php echo $this->_var['list']['pay_name']; ?></td> <td bgcolor="#ffffff" align="left"><?php echo $this->_var['list']['pay_desc']; ?></td> <td bgcolor="#ffffff" align="center"><?php echo $this->_var['list']['pay_fee']; ?></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <tr> <td bgcolor="#ffffff" colspan="3" align="center"> <input type="hidden" name="surplus_type" value="0" /> <input type="hidden" name="rec_id" value="<?php echo $this->_var['order']['id']; ?>" /> <input type="hidden" name="act" value="act_account" /> <input type="submit" class="bnt_blue_1" name="submit" value="<?php echo $this->_var['lang']['submit_request']; ?>" /> <input type="reset" class="bnt_blue_1" name="reset" value="<?php echo $this->_var['lang']['button_reset']; ?>" /> </td> </tr> </table> </form> <?php endif; ?> <?php if ($this->_var['action'] == "act_account"): ?> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="25%" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['surplus_amount']; ?></td> <td width="80%" bgcolor="#ffffff"><?php echo $this->_var['amount']; ?></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['payment_name']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['payment']['pay_name']; ?></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['payment_fee']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['pay_fee']; ?></td> </tr> <tr> <td align="right" valign="middle" bgcolor="#ffffff"><?php echo $this->_var['lang']['payment_desc']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['payment']['pay_desc']; ?></td> </tr> <tr> <td colspan="2" bgcolor="#ffffff"><?php echo $this->_var['payment']['pay_button']; ?></td> </tr> </table> <?php endif; ?> <?php if ($this->_var['action'] == "account_detail"): ?> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['process_time']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['surplus_pro_type']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['money']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['change_desc']; ?></td> </tr> <?php $_from = $this->_var['account_log']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> <tr> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['change_time']; ?></td> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['type']; ?></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['item']['amount']; ?></td> <td bgcolor="#ffffff" title="<?php echo $this->_var['item']['change_desc']; ?>">&nbsp;&nbsp;<?php echo $this->_var['item']['short_change_desc']; ?></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <tr> <td colspan="4" align="center" bgcolor="#ffffff"><div align="right"><?php echo $this->_var['lang']['current_surplus']; ?><?php echo $this->_var['surplus_amount']; ?></div></td> </tr> </table> <?php echo $this->fetch('library/pages.lbi'); ?> <?php endif; ?> <?php if ($this->_var['action'] == "account_log"): ?> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr align="center"> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['process_time']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['surplus_pro_type']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['money']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['process_notic']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['admin_notic']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['is_paid']; ?></td> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['handle']; ?></td> </tr> <?php $_from = $this->_var['account_log']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> <tr> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['add_time']; ?></td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['item']['type']; ?></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['item']['amount']; ?></td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['item']['short_user_note']; ?></td> <td align="left" bgcolor="#ffffff"><?php echo $this->_var['item']['short_admin_note']; ?></td> <td align="center" bgcolor="#ffffff"><?php echo $this->_var['item']['pay_status']; ?></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['item']['handle']; ?> <?php if (( $this->_var['item']['is_paid'] == 0 && $this->_var['item']['process_type'] == 1 ) || $this->_var['item']['handle']): ?> <a href="user.php?act=cancel&id=<?php echo $this->_var['item']['id']; ?>" onclick="if (!confirm('<?php echo $this->_var['lang']['confirm_remove_account']; ?>')) return false;"><?php echo $this->_var['lang']['is_cancel']; ?></a> <?php endif; ?> </td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <tr> <td colspan="7" align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['current_surplus']; ?><?php echo $this->_var['surplus_amount']; ?></td> </tr> </table> <?php echo $this->fetch('library/pages.lbi'); ?> <?php endif; ?> <?php if ($this->_var['action'] == 'address_list'): ?> <h5><span><?php echo $this->_var['lang']['consignee_info']; ?></span></h5> <div class="blank"></div> <?php echo $this->smarty_insert_scripts(array('files'=>'utils.js,transport.js,region.js,shopping_flow.js')); ?> <script type="text/javascript"> region.isAdmin = false; <?php $_from = $this->_var['lang']['flow_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> onload = function() { if (!document.all) { document.forms['theForm'].reset(); } } </script> <?php $_from = $this->_var['consignee_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('sn', 'consignee');if (count($_from)): foreach ($_from AS $this->_var['sn'] => $this->_var['consignee']): ?> <form action="user.php" method="post" name="theForm" onsubmit="return checkConsignee(this)"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['country_province']; ?>:</td> <td colspan="3" align="left" bgcolor="#ffffff"><select name="country" id="selCountries_<?php echo $this->_var['sn']; ?>" onchange="region.changed(this, 1, 'selProvinces_<?php echo $this->_var['sn']; ?>')"> <option value="0"><?php echo $this->_var['lang']['please_select']; ?><?php echo $this->_var['name_of_region']['0']; ?></option> <?php $_from = $this->_var['country_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'country');if (count($_from)): foreach ($_from AS $this->_var['country']): ?> <option value="<?php echo $this->_var['country']['region_id']; ?>" <?php if ($this->_var['consignee']['country'] == $this->_var['country']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['country']['region_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> <select name="province" id="selProvinces_<?php echo $this->_var['sn']; ?>" onchange="region.changed(this, 2, 'selCities_<?php echo $this->_var['sn']; ?>')"> <option value="0"><?php echo $this->_var['lang']['please_select']; ?><?php echo $this->_var['name_of_region']['1']; ?></option> <?php $_from = $this->_var['province_list'][$this->_var['sn']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'province');if (count($_from)): foreach ($_from AS $this->_var['province']): ?> <option value="<?php echo $this->_var['province']['region_id']; ?>" <?php if ($this->_var['consignee']['province'] == $this->_var['province']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['province']['region_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> <select name="city" id="selCities_<?php echo $this->_var['sn']; ?>" onchange="region.changed(this, 3, 'selDistricts_<?php echo $this->_var['sn']; ?>')"> <option value="0"><?php echo $this->_var['lang']['please_select']; ?><?php echo $this->_var['name_of_region']['2']; ?></option> <?php $_from = $this->_var['city_list'][$this->_var['sn']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'city');if (count($_from)): foreach ($_from AS $this->_var['city']): ?> <option value="<?php echo $this->_var['city']['region_id']; ?>" <?php if ($this->_var['consignee']['city'] == $this->_var['city']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['city']['region_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> <select name="district" id="selDistricts_<?php echo $this->_var['sn']; ?>" <?php if (! $this->_var['district_list'][$this->_var['sn']]): ?>style="display:none"<?php endif; ?>> <option value="0"><?php echo $this->_var['lang']['please_select']; ?><?php echo $this->_var['name_of_region']['3']; ?></option> <?php $_from = $this->_var['district_list'][$this->_var['sn']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'district');if (count($_from)): foreach ($_from AS $this->_var['district']): ?> <option value="<?php echo $this->_var['district']['region_id']; ?>" <?php if ($this->_var['consignee']['district'] == $this->_var['district']['region_id']): ?>selected<?php endif; ?>><?php echo $this->_var['district']['region_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> <?php echo $this->_var['lang']['require_field']; ?> </td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['consignee_name']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="consignee" type="text" class="inputBg" id="consignee_<?php echo $this->_var['sn']; ?>" value="<?php echo htmlspecialchars($this->_var['consignee']['consignee']); ?>" /> <?php echo $this->_var['lang']['require_field']; ?> </td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['email_address']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="email" type="text" class="inputBg" id="email_<?php echo $this->_var['sn']; ?>" value="<?php echo htmlspecialchars($this->_var['consignee']['email']); ?>" /> <?php echo $this->_var['lang']['require_field']; ?></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['detailed_address']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="address" type="text" class="inputBg" id="address_<?php echo $this->_var['sn']; ?>" value="<?php echo htmlspecialchars($this->_var['consignee']['address']); ?>" /> <?php echo $this->_var['lang']['require_field']; ?></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['postalcode']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="zipcode" type="text" class="inputBg" id="zipcode_<?php echo $this->_var['sn']; ?>" value="<?php echo htmlspecialchars($this->_var['consignee']['zipcode']); ?>" /></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['phone']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="tel" type="text" class="inputBg" id="tel_<?php echo $this->_var['sn']; ?>" value="<?php echo htmlspecialchars($this->_var['consignee']['tel']); ?>" /> <?php echo $this->_var['lang']['require_field']; ?></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['backup_phone']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="mobile" type="text" class="inputBg" id="mobile_<?php echo $this->_var['sn']; ?>" value="<?php echo htmlspecialchars($this->_var['consignee']['mobile']); ?>" /></td> </tr> <tr> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['sign_building']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="sign_building" type="text" class="inputBg" id="sign_building_<?php echo $this->_var['sn']; ?>" value="<?php echo htmlspecialchars($this->_var['consignee']['sign_building']); ?>" /></td> <td align="right" bgcolor="#ffffff"><?php echo $this->_var['lang']['deliver_goods_time']; ?>:</td> <td align="left" bgcolor="#ffffff"><input name="best_time" type="text" class="inputBg" id="best_time_<?php echo $this->_var['sn']; ?>" value="<?php echo htmlspecialchars($this->_var['consignee']['best_time']); ?>" /></td> </tr> <tr> <td align="right" bgcolor="#ffffff">&nbsp;</td> <td colspan="3" align="center" bgcolor="#ffffff"><?php if ($this->_var['consignee']['consignee'] && $this->_var['consignee']['email']): ?> <input type="submit" name="submit" class="bnt_blue_1" value="<?php echo $this->_var['lang']['confirm_edit']; ?>" /> <input name="button" type="button" class="bnt_blue" onclick="if (confirm('<?php echo $this->_var['lang']['confirm_drop_address']; ?>'))location.href='user.php?act=drop_consignee&id=<?php echo $this->_var['consignee']['address_id']; ?>'" value="<?php echo $this->_var['lang']['drop']; ?>" /> <?php else: ?> <input type="submit" name="submit" class="bnt_blue_2" value="<?php echo $this->_var['lang']['add_address']; ?>"/> <?php endif; ?> <input type="hidden" name="act" value="act_edit_address" /> <input name="address_id" type="hidden" value="<?php echo $this->_var['consignee']['address_id']; ?>" /> </td> </tr> </table> </form> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?> <?php if ($this->_var['action'] == 'transform_points'): ?> <h5><span><?php echo $this->_var['lang']['transform_points']; ?></span></h5> <div class="blank"></div> <?php if ($this->_var['exchange_type'] == 'ucenter'): ?> <form action="user.php" method="post" name="transForm" onsubmit="return calcredit();"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <th width="120" bgcolor="#FFFFFF" align="right" valign="top"><?php echo $this->_var['lang']['cur_points']; ?>:</th> <td bgcolor="#FFFFFF"> <label for="pay_points"><?php echo $this->_var['lang']['exchange_points']['1']; ?>:</label><input type="text" size="15" id="pay_points" name="pay_points" value="<?php echo $this->_var['shop_points']['pay_points']; ?>" style="border:0;border-bottom:1px solid #DADADA;" readonly="readonly" /><br /> <div class="blank"></div> <label for="rank_points"><?php echo $this->_var['lang']['exchange_points']['0']; ?>:</label><input type="text" size="15" id="rank_points" name="rank_points" value="<?php echo $this->_var['shop_points']['rank_points']; ?>" style="border:0;border-bottom:1px solid #DADADA;" readonly="readonly" /> </td> </tr> <tr><td bgcolor="#FFFFFF">&nbsp;</td> <td bgcolor="#FFFFFF">&nbsp;</td> </tr> <tr> <th align="right" bgcolor="#FFFFFF"><label for="amount"><?php echo $this->_var['lang']['exchange_amount']; ?>:</label></th> <td bgcolor="#FFFFFF"><input size="15" name="amount" id="amount" value="0" onkeyup="calcredit();" type="text" /> <select name="fromcredits" id="fromcredits" onchange="calcredit();"> <?php echo $this->html_options(array('options'=>$this->_var['lang']['exchange_points'],'selected'=>$this->_var['selected_org'])); ?> </select> </td> </tr> <tr> <th align="right" bgcolor="#FFFFFF"><label for="desamount"><?php echo $this->_var['lang']['exchange_desamount']; ?>:</label></th> <td bgcolor="#FFFFFF"><input type="text" name="desamount" id="desamount" disabled="disabled" value="0" size="15" /> <select name="tocredits" id="tocredits" onchange="calcredit();"> <?php echo $this->html_options(array('options'=>$this->_var['to_credits_options'],'selected'=>$this->_var['selected_dst'])); ?> </select> </td> </tr> <tr> <th align="right" bgcolor="#FFFFFF"><?php echo $this->_var['lang']['exchange_ratio']; ?>:</th> <td bgcolor="#FFFFFF">1 <span id="orgcreditunit"><?php echo $this->_var['orgcreditunit']; ?></span> <span id="orgcredittitle"><?php echo $this->_var['orgcredittitle']; ?></span> <?php echo $this->_var['lang']['exchange_action']; ?> <span id="descreditamount"><?php echo $this->_var['descreditamount']; ?></span> <span id="descreditunit"><?php echo $this->_var['descreditunit']; ?></span> <span id="descredittitle"><?php echo $this->_var['descredittitle']; ?></span></td> </tr> <tr><td bgcolor="#FFFFFF">&nbsp;</td> <td bgcolor="#FFFFFF"><input type="hidden" name="act" value="act_transform_ucenter_points" /><input type="submit" name="transfrom" value="<?php echo $this->_var['lang']['transform']; ?>" /></td></tr> </table> </form> <script type="text/javascript"> <?php $_from = $this->_var['lang']['exchange_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'lang_js');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['lang_js']): ?> var <?php echo $this->_var['key']; ?> = '<?php echo $this->_var['lang_js']; ?>'; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> var out_exchange_allow = new Array(); <?php $_from = $this->_var['out_exchange_allow']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'ratio');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['ratio']): ?> out_exchange_allow['<?php echo $this->_var['key']; ?>'] = '<?php echo $this->_var['ratio']; ?>'; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> function calcredit() { var frm = document.forms['transForm']; var src_credit = frm.fromcredits.value; var dest_credit = frm.tocredits.value; var in_credit = frm.amount.value; var org_title = frm.fromcredits[frm.fromcredits.selectedIndex].innerHTML; var dst_title = frm.tocredits[frm.tocredits.selectedIndex].innerHTML; var radio = 0; var shop_points = ['rank_points', 'pay_points']; if (parseFloat(in_credit) > parseFloat(document.getElementById(shop_points[src_credit]).value)) { alert(balance.replace('{%s}', org_title)); frm.amount.value = frm.desamount.value = 0; return false; } if (typeof(out_exchange_allow[dest_credit+'|'+src_credit]) == 'string') { radio = (1 / parseFloat(out_exchange_allow[dest_credit+'|'+src_credit])).toFixed(2); } document.getElementById('orgcredittitle').innerHTML = org_title; document.getElementById('descreditamount').innerHTML = radio; document.getElementById('descredittitle').innerHTML = dst_title; if (in_credit > 0) { if (typeof(out_exchange_allow[dest_credit+'|'+src_credit]) == 'string') { frm.desamount.value = Math.floor(parseFloat(in_credit) / parseFloat(out_exchange_allow[dest_credit+'|'+src_credit])); frm.transfrom.disabled = false; return true; } else { frm.desamount.value = deny; frm.transfrom.disabled = true; return false; } } else { return false; } } </script> <?php else: ?> <b><?php echo $this->_var['lang']['cur_points']; ?>:</b> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd"> <tr> <td width="30%" valign="top" bgcolor="#FFFFFF"><table border="0"> <?php $_from = $this->_var['bbs_points']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'points');if (count($_from)): foreach ($_from AS $this->_var['points']): ?> <tr> <th><?php echo $this->_var['points']['title']; ?>:</th> <td width="120" style="border-bottom:1px solid #DADADA;"><?php echo $this->_var['points']['value']; ?></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table></td> <td width="50%" valign="top" bgcolor="#FFFFFF"><table> <tr> <th><?php echo $this->_var['lang']['pay_points']; ?>:</th> <td width="120" style="border-bottom:1px solid #DADADA;"><?php echo $this->_var['shop_points']['pay_points']; ?></td> </tr> <tr> <th><?php echo $this->_var['lang']['rank_points']; ?>:</th> <td width="120" style="border-bottom:1px solid #DADADA;"><?php echo $this->_var['shop_points']['rank_points']; ?></td> </tr> </table></td> </tr> </table> <br /> <b><?php echo $this->_var['lang']['rule_list']; ?>:</b> <ul class="point clearfix"> <?php $_from = $this->_var['rule_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'rule');if (count($_from)): foreach ($_from AS $this->_var['rule']): ?> <li><font class="f1">·</font>"<?php echo $this->_var['rule']['from']; ?>" <?php echo $this->_var['lang']['transform']; ?> "<?php echo $this->_var['rule']['to']; ?>" <?php echo $this->_var['lang']['rate_is']; ?> <?php echo $this->_var['rule']['rate']; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </ul> <form action="user.php" method="post" name="theForm"> <table width="100%" border="1" align="center" cellpadding="5" cellspacing="0" style="border-collapse:collapse;border:1px solid #DADADA;"> <tr style="background:#F1F1F1;"> <th><?php echo $this->_var['lang']['rule']; ?></th> <th><?php echo $this->_var['lang']['transform_num']; ?></th> <th><?php echo $this->_var['lang']['transform_result']; ?></th> </tr> <tr> <td> <select name="rule_index" onchange="changeRule()"> <?php $_from = $this->_var['rule_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'rule');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['rule']): ?> <option value="<?php echo $this->_var['key']; ?>"><?php echo $this->_var['rule']['from']; ?>-><?php echo $this->_var['rule']['to']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> </td> <td> <input type="text" name="num" value="0" onkeyup="calPoints()"/> </td> <td><span id="ECS_RESULT">0</span></td> </tr> <tr> <td colspan="3" align="center"><input type="hidden" name="act" value="act_transform_points" /><input type="submit" value="<?php echo $this->_var['lang']['transform']; ?>" /></td> </tr> </table> </form> <script type="text/javascript"> //<![CDATA[ var rule_list = new Object(); var invalid_input = '<?php echo $this->_var['lang']['invalid_input']; ?>'; <?php $_from = $this->_var['rule_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'rule');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['rule']): ?> rule_list['<?php echo $this->_var['key']; ?>'] = '<?php echo $this->_var['rule']['rate']; ?>'; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> function calPoints() { var frm = document.forms['theForm']; var rule_index = frm.elements['rule_index'].value; var num = parseInt(frm.elements['num'].value); var rate = rule_list[rule_index]; if (isNaN(num) || num < 0 || num != frm.elements['num'].value) { document.getElementById('ECS_RESULT').innerHTML = invalid_input; rerutn; } var arr = rate.split(':'); var from = parseInt(arr[0]); var to = parseInt(arr[1]); if (from <=0 || to <=0) { from = 1; to = 0; } document.getElementById('ECS_RESULT').innerHTML = parseInt(num * to / from); } function changeRule() { document.forms['theForm'].elements['num'].value = 0; document.getElementById('ECS_RESULT').innerHTML = 0; } //]]> </script> <?php endif; ?> <?php endif; ?> </div> </div> </div> </div> </div> <div class="blank"></div> <?php echo $this->fetch('library/page_footer.lbi'); ?> </body> <script type="text/javascript"> <?php $_from = $this->_var['lang']['clips_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>"; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </script> </html>
zzshop
trunk/temp/compiled/user_transaction.dwt.php
PHP
asf20
76,889
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- $Id: drag.htm 14216 2008-03-10 02:27:21Z testyang $ --> <html> <head> <title></title> <style type="text/css"> body { margin: 0; padding: 0; background: #80BDCB; cursor: E-resize; } </style> <script type="text/javascript" language="JavaScript"> <!-- var pic = new Image(); pic.src="images/arrow_right.gif"; function toggleMenu() { frmBody = parent.document.getElementById('frame-body'); imgArrow = document.getElementById('img'); if (frmBody.cols == "0, 10, *") { frmBody.cols="200, 10, *"; imgArrow.src = "images/arrow_left.gif"; } else { frmBody.cols="0, 10, *"; imgArrow.src = "images/arrow_right.gif"; } } var orgX = 0; document.onmousedown = function(e) { var evt = Utils.fixEvent(e); orgX = evt.clientX; if (Browser.isIE) document.getElementById('tbl').setCapture(); } document.onmouseup = function(e) { var evt = Utils.fixEvent(e); frmBody = parent.document.getElementById('frame-body'); frmWidth = frmBody.cols.substr(0, frmBody.cols.indexOf(',')); frmWidth = (parseInt(frmWidth) + (evt.clientX - orgX)); frmBody.cols = frmWidth + ", 10, *"; if (Browser.isIE) document.releaseCapture(); } var Browser = new Object(); Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument != 'undefined'); Browser.isIE = window.ActiveXObject ? true : false; Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox") != - 1); Browser.isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != - 1); Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != - 1); var Utils = new Object(); Utils.fixEvent = function(e) { var evt = (typeof e == "undefined") ? window.event : e; return evt; } //--> </script> </head> <body onselect="return false;"> <table height="100%" cellspacing="0" cellpadding="0" id="tbl"> <tr><td><a href="javascript:toggleMenu();"><img src="images/arrow_left.gif" width="10" height="30" id="img" border="0" /></a></td></tr> </table> </body> </html>
zzshop
trunk/temp/compiled/admin/drag.htm.php
Hack
asf20
2,228
<!-- $Id: account_list.htm 14928 2008-10-06 09:25:48Z testyang $ --> <?php if ($this->_var['full_page']): ?> <?php echo $this->fetch('pageheader.htm'); ?> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,listtable.js')); ?> <div class="form-div"> <form method="post" action="account_log.php?act=list&user_id=<?php echo $_GET['user_id']; ?>" name="searchForm"> <select name="account_type" onchange="document.forms['searchForm'].submit()"> <option value="" <?php if ($this->_var['account_type'] == ''): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['lang']['all_account']; ?></option> <option value="user_money" <?php if ($this->_var['account_type'] == 'user_money'): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['lang']['user_money']; ?></option> <option value="frozen_money" <?php if ($this->_var['account_type'] == 'frozen_money'): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['lang']['frozen_money']; ?></option> <option value="rank_points" <?php if ($this->_var['account_type'] == 'rank_points'): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['lang']['rank_points']; ?></option> <option value="pay_points" <?php if ($this->_var['account_type'] == 'pay_points'): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['lang']['pay_points']; ?></option> </select> <strong><?php echo $this->_var['lang']['label_user_name']; ?></strong><?php echo $this->_var['user']['user_name']; ?> <strong><?php echo $this->_var['lang']['label_user_money']; ?></strong><?php echo $this->_var['user']['formated_user_money']; ?> <strong><?php echo $this->_var['lang']['label_frozen_money']; ?></strong><?php echo $this->_var['user']['formated_frozen_money']; ?> <strong><?php echo $this->_var['lang']['label_rank_points']; ?></strong><?php echo $this->_var['user']['rank_points']; ?> <strong><?php echo $this->_var['lang']['label_pay_points']; ?></strong><?php echo $this->_var['user']['pay_points']; ?> </form> </div> <form method="post" action="" name="listForm"> <div class="list-div" id="listDiv"> <?php endif; ?> <table cellpadding="3" cellspacing="1"> <tr> <th width="20%"><?php echo $this->_var['lang']['change_time']; ?></th> <th width="30%"><?php echo $this->_var['lang']['change_desc']; ?></th> <th><?php echo $this->_var['lang']['user_money']; ?></th> <th><?php echo $this->_var['lang']['frozen_money']; ?></th> <th><?php echo $this->_var['lang']['rank_points']; ?></th> <th><?php echo $this->_var['lang']['pay_points']; ?></th> </tr> <?php $_from = $this->_var['account_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'account');if (count($_from)): foreach ($_from AS $this->_var['account']): ?> <tr> <td><?php echo $this->_var['account']['change_time']; ?></td> <td><?php echo htmlspecialchars($this->_var['account']['change_desc']); ?></td> <td align="right"> <?php if ($this->_var['account']['user_money'] > 0): ?> <span style="color:#0000FF">+<?php echo $this->_var['account']['user_money']; ?></span> <?php elseif ($this->_var['account']['user_money'] < 0): ?> <span style="color:#FF0000"><?php echo $this->_var['account']['user_money']; ?></span> <?php else: ?> <?php echo $this->_var['account']['user_money']; ?> <?php endif; ?> </td> <td align="right"> <?php if ($this->_var['account']['frozen_money'] > 0): ?> <span style="color:#0000FF">+<?php echo $this->_var['account']['frozen_money']; ?></span> <?php elseif ($this->_var['account']['frozen_money'] < 0): ?> <span style="color:#FF0000"><?php echo $this->_var['account']['frozen_money']; ?></span> <?php else: ?> <?php echo $this->_var['account']['frozen_money']; ?> <?php endif; ?> </td> <td align="right"> <?php if ($this->_var['account']['rank_points'] > 0): ?> <span style="color:#0000FF">+<?php echo $this->_var['account']['rank_points']; ?></span> <?php elseif ($this->_var['account']['rank_points'] < 0): ?> <span style="color:#FF0000"><?php echo $this->_var['account']['rank_points']; ?></span> <?php else: ?> <?php echo $this->_var['account']['rank_points']; ?> <?php endif; ?> </td> <td align="right"> <?php if ($this->_var['account']['pay_points'] > 0): ?> <span style="color:#0000FF">+<?php echo $this->_var['account']['pay_points']; ?></span> <?php elseif ($this->_var['account']['pay_points'] < 0): ?> <span style="color:#FF0000"><?php echo $this->_var['account']['pay_points']; ?></span> <?php else: ?> <?php echo $this->_var['account']['pay_points']; ?> <?php endif; ?> </td> </tr> <?php endforeach; else: ?> <tr><td class="no-records" colspan="6"><?php echo $this->_var['lang']['no_records']; ?></td></tr> <?php endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <table id="page-table" cellspacing="0"> <tr> <td align="right" nowrap="true"> <?php echo $this->fetch('page.htm'); ?> </td> </tr> </table> <?php if ($this->_var['full_page']): ?> </div> </form> <script type="text/javascript" language="javascript"> <!-- listTable.recordCount = <?php echo $this->_var['record_count']; ?>; listTable.pageCount = <?php echo $this->_var['page_count']; ?>; <?php $_from = $this->_var['filter']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> listTable.filter.<?php echo $this->_var['key']; ?> = '<?php echo $this->_var['item']; ?>'; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> onload = function() { // 开始检查订单 startCheckOrder(); } //--> </script> <?php echo $this->fetch('pagefooter.htm'); ?> <?php endif; ?>
zzshop
trunk/temp/compiled/admin/account_list.htm.php
PHP
asf20
6,207
<!-- $Id: user_info.htm 16854 2009-12-07 06:20:09Z sxc_shop $ --> <?php echo $this->fetch('pageheader.htm'); ?> <div class="main-div"> <form method="post" action="users.php" name="theForm" onsubmit="return validate()"> <table width="100%" > <tr> <td class="label"><?php echo $this->_var['lang']['username']; ?>:</td> <td><?php if ($this->_var['form_action'] == "update"): ?><?php echo $this->_var['user']['user_name']; ?><input type="hidden" name="username" value="<?php echo $this->_var['user']['user_name']; ?>" /><?php else: ?><input type="text" name="username" maxlength="60" value="<?php echo $this->_var['user']['user_name']; ?>" /><?php echo $this->_var['lang']['require_field']; ?><?php endif; ?></td> </tr> <?php if ($this->_var['form_action'] == "update"): ?> <tr> <td class="label"><?php echo $this->_var['lang']['user_money']; ?>:</td> <td><?php echo $this->_var['user']['formated_user_money']; ?> <a href="account_log.php?act=list&user_id=<?php echo $this->_var['user']['user_id']; ?>&account_type=user_money">[ <?php echo $this->_var['lang']['view_detail_account']; ?> ]</a> </td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['frozen_money']; ?>:</td> <td><?php echo $this->_var['user']['formated_frozen_money']; ?> <a href="account_log.php?act=list&user_id=<?php echo $this->_var['user']['user_id']; ?>&account_type=frozen_money">[ <?php echo $this->_var['lang']['view_detail_account']; ?> ]</a> </td> </tr> <tr> <td class="label"><a href="javascript:showNotice('noticeRankPoints');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a> <?php echo $this->_var['lang']['rank_points']; ?>:</td> <td><?php echo $this->_var['user']['rank_points']; ?> <a href="account_log.php?act=list&user_id=<?php echo $this->_var['user']['user_id']; ?>&account_type=rank_points">[ <?php echo $this->_var['lang']['view_detail_account']; ?> ]</a> <br /><span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticeRankPoints"><?php echo $this->_var['lang']['notice_rank_points']; ?></span></td> </tr> <tr> <td class="label"><a href="javascript:showNotice('noticePayPoints');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>" /></a> <?php echo $this->_var['lang']['pay_points']; ?>:</td> <td><?php echo $this->_var['user']['pay_points']; ?> <a href="account_log.php?act=list&user_id=<?php echo $this->_var['user']['user_id']; ?>&account_type=pay_points">[ <?php echo $this->_var['lang']['view_detail_account']; ?> ]</a> <br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticePayPoints"><?php echo $this->_var['lang']['notice_pay_points']; ?></span></td> </tr> <?php endif; ?> <tr> <td class="label"><?php echo $this->_var['lang']['email']; ?>:</td> <td><input type="text" name="email" maxlength="60" size="40" value="<?php echo $this->_var['user']['email']; ?>" /><?php echo $this->_var['lang']['require_field']; ?></td> </tr> <?php if ($this->_var['form_action'] == "insert"): ?> <tr> <td class="label"><?php echo $this->_var['lang']['password']; ?>:</td> <td><input type="password" name="password" maxlength="20" size="20" /><?php echo $this->_var['lang']['require_field']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['confirm_password']; ?>:</td> <td><input type="password" name="confirm_password" maxlength="20" size="20" /><?php echo $this->_var['lang']['require_field']; ?></td> </tr> <?php elseif ($this->_var['form_action'] == "update"): ?> <tr> <td class="label"><?php echo $this->_var['lang']['newpass']; ?>:</td> <td><input type="password" name="password" maxlength="20" size="20" /></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['confirm_password']; ?>:</td> <td><input type="password" name="confirm_password" maxlength="20" size="20" /></td> </tr> <?php endif; ?> <tr> <td class="label"><?php echo $this->_var['lang']['user_rank']; ?>:</td> <td><select name="user_rank"> <option value="0"><?php echo $this->_var['lang']['not_special_rank']; ?></option> <?php echo $this->html_options(array('options'=>$this->_var['special_ranks'],'selected'=>$this->_var['user']['user_rank'])); ?> </select></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['gender']; ?>:</td> <td><?php echo $this->html_radios(array('name'=>'sex','options'=>$this->_var['lang']['sex'],'checked'=>$this->_var['user']['sex'])); ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['birthday']; ?>:</td> <td><?php echo $this->html_select_date(array('field_order'=>'YMD','prefix'=>'birthday','time'=>$this->_var['user']['birthday'],'start_year'=>'-60','end_year'=>'+1','display_days'=>'true','month_format'=>'%m')); ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['credit_line']; ?>:</td> <td><input name="credit_line" type="text" id="credit_line" value="<?php echo $this->_var['user']['credit_line']; ?>" size="10" /></td> </tr> <?php $_from = $this->_var['extend_info_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'field');if (count($_from)): foreach ($_from AS $this->_var['field']): ?> <tr> <td class="label"><?php echo $this->_var['field']['reg_field_name']; ?>:</td> <td> <input name="extend_field<?php echo $this->_var['field']['id']; ?>" type="text" size="40" class="inputBg" value="<?php echo $this->_var['field']['content']; ?>"/> </td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php if ($this->_var['user']['parent_id']): ?> <tr> <td class="label"><?php echo $this->_var['lang']['parent_user']; ?>:</td> <td><a href="users.php?act=edit&id=<?php echo $this->_var['user']['parent_id']; ?>"><?php echo $this->_var['user']['parent_username']; ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="users.php?act=remove_parent&id=<?php echo $this->_var['user']['user_id']; ?>"><?php echo $this->_var['lang']['parent_remove']; ?></a></td> </tr> <?php endif; ?> <?php if ($this->_var['affiliate']['on'] == 1 && $this->_var['affdb']): ?> <tr> <td class="label"><?php echo $this->_var['lang']['affiliate_user']; ?>:</td> <td>[<a href="users.php?act=aff_list&auid=<?php echo $this->_var['user']['user_id']; ?>"><?php echo $this->_var['lang']['show_affiliate_users']; ?></a>][<a href="affiliate_ck.php?act=list&auid=<?php echo $this->_var['user']['user_id']; ?>"><?php echo $this->_var['lang']['show_affiliate_orders']; ?></a>]</td> </tr> <tr> <td></td> <td> <table border="0" cellspacing="1" style="background: #dddddd; width:30%;"> <tr> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_lever']; ?></td> <?php $_from = $this->_var['affdb']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('level', 'val0');if (count($_from)): foreach ($_from AS $this->_var['level'] => $this->_var['val0']): ?> <td bgcolor="#ffffff"><?php echo $this->_var['level']; ?></td> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </tr> <tr> <td bgcolor="#ffffff"><?php echo $this->_var['lang']['affiliate_num']; ?></td> <?php $_from = $this->_var['affdb']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'val');if (count($_from)): foreach ($_from AS $this->_var['val']): ?> <td bgcolor="#ffffff"><?php echo $this->_var['val']['num']; ?></td> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </tr> </table> </td> </tr> <?php endif; ?> <tr> <td colspan="2" align="center"> <input type="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" class="button" /> <input type="reset" value="<?php echo $this->_var['lang']['button_reset']; ?>" class="button" /> <input type="hidden" name="act" value="<?php echo $this->_var['form_action']; ?>" /> <input type="hidden" name="id" value="<?php echo $this->_var['user']['user_id']; ?>" /> </td> </tr> </table> </form> </div> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,validator.js')); ?> <script language="JavaScript"> <!-- if (document.forms['theForm'].elements['act'].value == "insert") { document.forms['theForm'].elements['username'].focus(); } else { document.forms['theForm'].elements['email'].focus(); } onload = function() { // 开始检查订单 startCheckOrder(); } /** * 检查表单输入的数据 */ function validate() { validator = new Validator("theForm"); validator.isEmail("email", invalid_email, true); if (document.forms['theForm'].elements['act'].value == "insert") { validator.required("username", no_username); validator.required("password", no_password); validator.required("confirm_password", no_confirm_password); validator.eqaul("password", "confirm_password", password_not_same); var password_value = document.forms['theForm'].elements['password'].value; if (password_value.length < 6) { validator.addErrorMsg(less_password); } if (/ /.test(password_value) == true) { validator.addErrorMsg(passwd_balnk); } } else if (document.forms['theForm'].elements['act'].value == "update") { var newpass = document.forms['theForm'].elements['password']; var confirm_password = document.forms['theForm'].elements['confirm_password']; if(newpass.value.length > 0 || confirm_password.value.length) { if(newpass.value.length >= 6 || confirm_password.value.length >= 6) { validator.eqaul("password", "confirm_password", password_not_same); } else { validator.addErrorMsg(password_len_err); } } } return validator.passed(); } //--> </script> <?php echo $this->fetch('pagefooter.htm'); ?>
zzshop
trunk/temp/compiled/admin/user_info.htm.php
PHP
asf20
10,673
<?php if ($this->_var['full_page']): ?> <?php echo $this->fetch('pageheader.htm'); ?> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,listtable.js')); ?> <?php echo $this->smarty_insert_scripts(array('files'=>'validator.js')); ?> <div class="form-div"> <form method="post" action="affiliate.php"> <input type="radio" name="on" value="1" <?php if ($this->_var['config']['on'] == 1): ?> checked="true" <?php endif; ?> onClick="javascript:actDiv('separate','');actDiv('btnon','none');"><?php echo $this->_var['lang']['on']; ?> <input type="radio" name="on" value="0" <?php if (! $this->_var['config']['on'] || $this->_var['config']['on'] == 0): ?> checked="true" <?php endif; ?> onClick="javascript:actDiv('separate','none');actDiv('btnon','');"><?php echo $this->_var['lang']['off']; ?> <br><br> <input type="hidden" name="act" value="on" /> <input type="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" class="button" id="btnon"/> </form> </div> <div id="separate"> <div class="form-div"> <form method="post" action="affiliate.php"> <table width="100%" border="0" cellspacing="0" cellpadding="4"> <tr> <td colspan="2" style="border-bottom:1px dashed #dadada;"><input type="radio" name="separate_by" value="0" <?php if (! $this->_var['config']['config']['separate_by'] || $this->_var['config']['config']['separate_by'] == 0): ?> checked="true" <?php endif; ?> onClick="actDiv('listDiv','');"> <?php echo $this->_var['lang']['separate_by']['0']; ?><input type="radio" name="separate_by" value="1" <?php if ($this->_var['config']['config']['separate_by'] == 1): ?> checked="true" <?php endif; ?> onClick="actDiv('listDiv','none');"> <?php echo $this->_var['lang']['separate_by']['1']; ?></td> </tr> <tr> <td width="20%" align="right" class="label"><a href="javascript:showNotice('notice1');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>" /></a><?php echo $this->_var['lang']['expire']; ?> </td> <td><input type="text" name="expire" maxlength="150" size="10" value="<?php echo $this->_var['config']['config']['expire']; ?>" /> <select name="expire_unit"> <?php echo $this->html_options(array('options'=>$this->_var['lang']['unit'],'selected'=>$this->_var['config']['config']['expire_unit'])); ?> </select> <br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="notice1"><?php echo nl2br($this->_var['lang']['help_expire']); ?></span> </td> </tr> <tr> <td align="right" class="label"><a href="javascript:showNotice('notice2');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>" /></a><?php echo $this->_var['lang']['level_point_all']; ?> </td> <td><input type="text" name="level_point_all" maxlength="150" size="10" value="<?php echo $this->_var['config']['config']['level_point_all']; ?>" /> <br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="notice2"><?php echo nl2br($this->_var['lang']['help_lpa']); ?></span></td> </tr> <tr> <td align="right" class="label"><a href="javascript:showNotice('notice3');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>" /></a><?php echo $this->_var['lang']['level_money_all']; ?> </td> <td><input type="text" name="level_money_all" maxlength="150" size="10" value="<?php echo $this->_var['config']['config']['level_money_all']; ?>" /> <br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="notice3"><?php echo nl2br($this->_var['lang']['help_lma']); ?></span></td> </tr> <tr> <td align="right" class="label"><a href="javascript:showNotice('notice4');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>" /></a><?php echo $this->_var['lang']['level_register_all']; ?></td> <td><input type="text" name="level_register_all" maxlength="150" size="10" value="<?php echo $this->_var['config']['config']['level_register_all']; ?>" /> <br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="notice4"><?php echo nl2br($this->_var['lang']['help_lra']); ?></span></td> </tr> <tr> <td align="right" class="label"><a href="javascript:showNotice('notice5');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>" /></a><?php echo $this->_var['lang']['level_register_up']; ?></td> <td><input type="text" name="level_register_up" maxlength="150" size="10" value="<?php echo $this->_var['config']['config']['level_register_up']; ?>" /> <br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="notice5"><?php echo nl2br($this->_var['lang']['help_lru']); ?></span></td> <tr><td></td> <td><input type="hidden" name="act" value="updata" /><input type="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" class="button" /></td> </tr> </tr> </table> </form> </div> <div class="list-div" id="listDiv"> <?php endif; ?> <table cellspacing='1' cellpadding='3'> <tr> <th name="levels" ReadOnly="true" width="10%"><?php echo $this->_var['lang']['levels']; ?></th> <th name="level_point" Type="TextBox"><?php echo $this->_var['lang']['level_point']; ?></th> <th name="level_money" Type="TextBox"><?php echo $this->_var['lang']['level_money']; ?></th> <th Type="Button"><?php echo $this->_var['lang']['handler']; ?></th> </tr> <?php $_from = $this->_var['config']['item']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'val');$this->_foreach['nav'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['nav']['total'] > 0): foreach ($_from AS $this->_var['val']): $this->_foreach['nav']['iteration']++; ?> <tr align="center"> <td><?php echo $this->_foreach['nav']['iteration']; ?></td> <td><span onclick="listTable.edit(this, 'edit_point', '<?php echo $this->_foreach['nav']['iteration']; ?>'); return false;"><?php echo $this->_var['val']['level_point']; ?></span></td> <td><span onclick="listTable.edit(this, 'edit_money', '<?php echo $this->_foreach['nav']['iteration']; ?>'); return false;"><?php echo $this->_var['val']['level_money']; ?></span></td> <td ><a href="javascript:confirm_redirect(lang_removeconfirm, 'affiliate.php?act=del&id=<?php echo $this->_foreach['nav']['iteration']; ?>')"><img style="border:0px;" src="images/no.gif" /></a></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <?php if ($this->_var['full_page']): ?> </div> </div> <script type="Text/Javascript" language="JavaScript"> <!-- <?php if (! $this->_var['config']['on'] || $this->_var['config']['on'] == 0): ?> actDiv('separate','none'); <?php else: ?> actDiv('btnon','none'); <?php endif; ?> <?php if ($this->_var['config']['config']['separate_by'] == 1): ?> actDiv('listDiv','none'); <?php endif; ?> var all_null = '<?php echo $this->_var['lang']['all_null']; ?>'; onload = function() { // 开始检查订单 startCheckOrder(); cleanWhitespace(document.getElementById("listDiv")); if (document.getElementById("listDiv").childNodes[0].rows.length<6) { listTable.addRow(check); } } function check(frm) { if (frm['level_point'].value == "" && frm['level_money'].value == "") { frm['level_point'].focus(); alert(all_null); return false; } return true; } function actDiv(divname, flag) { document.getElementById(divname).style.display = flag; } //--> </script> <?php echo $this->fetch('pagefooter.htm'); ?> <?php endif; ?>
zzshop
trunk/temp/compiled/admin/affiliate.htm.php
PHP
asf20
9,254
<!-- $Id: goods_trash.htm 14216 2008-03-10 02:27:21Z testyang $ --> <?php if ($this->_var['full_page']): ?> <?php echo $this->fetch('pageheader.htm'); ?> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,../js/transport.js,listtable.js')); ?> <!-- 商品搜索 --> <?php echo $this->fetch('goods_search.htm'); ?> <!-- 商品列表 --> <form method="post" action="" name="listForm" onsubmit="return confirmSubmit(this)"> <!-- start goods list --> <div class="list-div" id="listDiv"> <?php endif; ?> <table cellpadding="3" cellspacing="1"> <tr> <th> <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" /> <a href="javascript:listTable.sort('goods_id'); "><?php echo $this->_var['lang']['record_id']; ?></a><?php echo $this->_var['sort_goods_id']; ?> </th> <th><a href="javascript:listTable.sort('goods_name'); "><?php echo $this->_var['lang']['goods_name']; ?></a><?php echo $this->_var['sort_goods_name']; ?></th> <th><a href="javascript:listTable.sort('goods_sn'); "><?php echo $this->_var['lang']['goods_sn']; ?></a><?php echo $this->_var['sort_goods_sn']; ?></th> <th><a href="javascript:listTable.sort('shop_price'); "><?php echo $this->_var['lang']['shop_price']; ?></a><?php echo $this->_var['sort_shop_price']; ?></th> <th><?php echo $this->_var['lang']['handler']; ?></th> <tr> <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');if (count($_from)): foreach ($_from AS $this->_var['goods']): ?> <tr> <td><input type="checkbox" name="checkboxes[]" value="<?php echo $this->_var['goods']['goods_id']; ?>" /><?php echo $this->_var['goods']['goods_id']; ?></td> <td><?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?></td> <td><?php echo $this->_var['goods']['goods_sn']; ?></td> <td align="right"><?php echo $this->_var['goods']['shop_price']; ?></td> <td align="center"> <a href="javascript:;" onclick="listTable.remove(<?php echo $this->_var['goods']['goods_id']; ?>, '<?php echo $this->_var['lang']['restore_goods_confirm']; ?>', 'restore_goods')"><?php echo $this->_var['lang']['restore']; ?></a> | <a href="javascript:;" onclick="listTable.remove(<?php echo $this->_var['goods']['goods_id']; ?>, '<?php echo $this->_var['lang']['drop_goods_confirm']; ?>', 'drop_goods')"><?php echo $this->_var['lang']['drop']; ?></a> </td> </tr> <?php endforeach; else: ?> <tr><td class="no-records" colspan="10"><?php echo $this->_var['lang']['no_records']; ?></td></tr> <?php endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <!-- end goods list --> <!-- 分页 --> <table id="page-table" cellspacing="0"> <tr> <td> <input type="hidden" name="act" value="batch" /> <select name="type" id="selAction" onchange="changeAction()"> <option value=""><?php echo $this->_var['lang']['select_please']; ?></option> <option value="restore"><?php echo $this->_var['lang']['restore']; ?></option> <option value="drop"><?php echo $this->_var['lang']['remove']; ?></option> </select> <select name="target_cat" style="display:none" onchange="checkIsLeaf(this)"><option value="0"><?php echo $this->_var['lang']['select_please']; ?></caption><?php echo $this->_var['cat_list']; ?></select> <input type="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" id="btnSubmit" name="btnSubmit" class="button" disabled="true" /> </td> <td align="right" nowrap="true"> <?php echo $this->fetch('page.htm'); ?> </td> </tr> </table> </div> <?php if ($this->_var['full_page']): ?> </form> <script language="JavaScript"> listTable.recordCount = <?php echo $this->_var['record_count']; ?>; listTable.pageCount = <?php echo $this->_var['page_count']; ?>; <?php $_from = $this->_var['filter']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> listTable.filter.<?php echo $this->_var['key']; ?> = '<?php echo $this->_var['item']; ?>'; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> onload = function() { startCheckOrder(); // 开始检查订单 document.forms['listForm'].reset(); } function confirmSubmit(frm, ext) { if (frm.elements['type'].value == 'restore') { return confirm("<?php echo $this->_var['lang']['restore_goods_confirm']; ?>"); } else if (frm.elements['type'].value == 'drop') { return confirm("<?php echo $this->_var['lang']['batch_drop_confirm']; ?>"); } else if (frm.elements['type'].value == '') { return false; } else { return true; } } function changeAction() { var frm = document.forms['listForm']; if (!document.getElementById('btnSubmit').disabled && confirmSubmit(frm, false)) { frm.submit(); } } </script> <?php echo $this->fetch('pagefooter.htm'); ?> <?php endif; ?>
zzshop
trunk/temp/compiled/admin/goods_trash.htm.php
PHP
asf20
5,298
<div id="footer"> <?php echo $this->_var['query_info']; ?><?php echo $this->_var['gzip_enabled']; ?><?php echo $this->_var['memory_info']; ?><br /> <?php echo $this->_var['lang']['copyright']; ?> </div> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js')); ?> <!-- 新订单提示信息 --> <div id="popMsg"> <table cellspacing="0" cellpadding="0" width="100%" bgcolor="#cfdef4" border="0"> <tr> <td style="color: #0f2c8c" width="30" height="24"></td> <td style="font-weight: normal; color: #1f336b; padding-top: 4px;padding-left: 4px" valign="center" width="100%"> <?php echo $this->_var['lang']['order_notify']; ?></td> <td style="padding-top: 2px;padding-right:2px" valign="center" align="right" width="19"><span title="关闭" style="cursor: hand;cursor:pointer;color:red;font-size:12px;font-weight:bold;margin-right:4px;" onclick="Message.close()" >×</span><!-- <img title=关闭 style="cursor: hand" onclick=closediv() hspace=3 src="msgclose.jpg"> --></td> </tr> <tr> <td style="padding-right: 1px; padding-bottom: 1px" colspan="3" height="70"> <div id="popMsgContent"> <p><?php echo $this->_var['lang']['new_order_1']; ?><strong style="color:#ff0000" id="spanNewOrder">1</strong><?php echo $this->_var['lang']['new_order_2']; ?> <strong style="color:#ff0000" id="spanNewPaid">0</strong><?php echo $this->_var['lang']['new_order_3']; ?></p> <p align="center" style="word-break:break-all"><a href="order.php?act=list"><span style="color:#ff0000"><?php echo $this->_var['lang']['new_order_link']; ?></span></a></p> </div> </td> </tr> </table> </div> <!-- <embed src="images/online.wav" width="0" height="0" autostart="false" name="msgBeep" id="msgBeep" enablejavascript="true"/> --> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" id="msgBeep" width="1" height="1"> <param name="movie" value="images/online.swf"> <param name="quality" value="high"> <embed src="images/online.swf" name="msgBeep" id="msgBeep" quality="high" width="0" height="0" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash"> </embed> </object> <script language="JavaScript"> document.onmousemove=function(e) { var obj = Utils.srcElement(e); if (typeof(obj.onclick) == 'function' && obj.onclick.toString().indexOf('listTable.edit') != -1) { obj.title = '<?php echo $this->_var['lang']['span_edit_help']; ?>'; obj.style.cssText = 'background: #278296;'; obj.onmouseout = function(e) { this.style.cssText = ''; } } else if (typeof(obj.href) != 'undefined' && obj.href.indexOf('listTable.sort') != -1) { obj.title = '<?php echo $this->_var['lang']['href_sort_help']; ?>'; } } <!-- <?php if ($this->_var['enable_order_check'] == '0'): ?> startCheckOrder = function(){} <?php endif; ?> var MyTodolist; function showTodoList(adminid) { if(!MyTodolist) { var global = $import("../js/global.js","js"); global.onload = global.onreadystatechange= function() { if(this.readyState && this.readyState=="loading")return; var md5 = $import("js/md5.js","js"); md5.onload = md5.onreadystatechange= function() { if(this.readyState && this.readyState=="loading")return; var todolist = $import("js/todolist.js","js"); todolist.onload = todolist.onreadystatechange = function() { if(this.readyState && this.readyState=="loading")return; MyTodolist = new Todolist(); MyTodolist.show(); } } } } else { if(MyTodolist.visibility) { MyTodolist.hide(); } else { MyTodolist.show(); } } } if (Browser.isIE) { onscroll = function() { //document.getElementById('calculator').style.top = document.body.scrollTop; document.getElementById('popMsg').style.top = (document.body.scrollTop + document.body.clientHeight - document.getElementById('popMsg').offsetHeight) + "px"; } } if (document.getElementById("listDiv")) { document.getElementById("listDiv").onmouseover = function(e) { obj = Utils.srcElement(e); if (obj) { if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode; else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode; else return; for (i = 0; i < row.cells.length; i++) { if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#F4FAFB'; } } } document.getElementById("listDiv").onmouseout = function(e) { obj = Utils.srcElement(e); if (obj) { if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode; else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode; else return; for (i = 0; i < row.cells.length; i++) { if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF'; } } } document.getElementById("listDiv").onclick = function(e) { var obj = Utils.srcElement(e); if (obj.tagName == "INPUT" && obj.type == "checkbox") { if (!document.forms['listForm']) { return; } var nodes = document.forms['listForm'].elements; var checked = false; for (i = 0; i < nodes.length; i++) { if (nodes[i].checked) { checked = true; break; } } if(document.getElementById("btnSubmit")) { document.getElementById("btnSubmit").disabled = !checked; } for (i = 1; i <= 10; i++) { if (document.getElementById("btnSubmit" + i)) { document.getElementById("btnSubmit" + i).disabled = !checked; } } } } } //--> </script> </body> </html>
zzshop
trunk/temp/compiled/admin/pagefooter.htm.php
PHP
asf20
6,140
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>ECSHOP Menu</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="styles/general.css" rel="stylesheet" type="text/css" /> <script language="JavaScript"> <!-- var noHelp = "<p align='center' style='color: #666'><?php echo $this->_var['lang']['no_help']; ?></p>"; var helpLang = "<?php echo $this->_var['help_lang']; ?>"; //--> </script> <style type="text/css"> body { background: #80BDCB; } #tabbar-div { background: #278296; padding-left: 10px; height: 21px; padding-top: 0px; } #tabbar-div p { margin: 1px 0 0 0; } .tab-front { background: #80BDCB; line-height: 20px; font-weight: bold; padding: 4px 15px 4px 18px; border-right: 2px solid #335b64; cursor: hand; cursor: pointer; } .tab-back { color: #F4FAFB; line-height: 20px; padding: 4px 15px 4px 18px; cursor: hand; cursor: pointer; } .tab-hover { color: #F4FAFB; line-height: 20px; padding: 4px 15px 4px 18px; cursor: hand; cursor: pointer; background: #2F9DB5; } #top-div { padding: 3px 0 2px; background: #BBDDE5; margin: 5px; text-align: center; } #main-div { border: 1px solid #345C65; padding: 5px; margin: 5px; background: #FFF; } #menu-list { padding: 0; margin: 0; } #menu-list ul { padding: 0; margin: 0; list-style-type: none; color: #335B64; } #menu-list li { padding-left: 16px; line-height: 16px; cursor: hand; cursor: pointer; } #main-div a:visited, #menu-list a:link, #menu-list a:hover { color: #335B64 text-decoration: none; } #menu-list a:active { color: #EB8A3D; } .explode { background: url(images/menu_minus.gif) no-repeat 0px 3px; font-weight: bold; } .collapse { background: url(images/menu_plus.gif) no-repeat 0px 3px; font-weight: bold; } .menu-item { background: url(images/menu_arrow.gif) no-repeat 0px 3px; font-weight: normal; } #help-title { font-size: 14px; color: #000080; margin: 5px 0; padding: 0px; } #help-content { margin: 0; padding: 0; } .tips { color: #CC0000; } .link { color: #000099; } </style> </head> <body> <div id="tabbar-div"> <p><span style="float:right; padding: 3px 5px;" ><a href="javascript:toggleCollapse();"><img id="toggleImg" src="images/menu_minus.gif" width="9" height="9" border="0" alt="<?php echo $this->_var['lang']['collapse_all']; ?>" /></a></span> <span class="tab-front" id="menu-tab"><?php echo $this->_var['lang']['menu']; ?></span> </p> </div> <div id="main-div"> <div id="menu-list"> <ul> <?php $_from = $this->_var['menus']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('k', 'menu');if (count($_from)): foreach ($_from AS $this->_var['k'] => $this->_var['menu']): ?> <?php if ($this->_var['menu']['action']): ?> <li class="explode"><a href="<?php echo $this->_var['menu']['action']; ?>" target="main-frame"><?php echo $this->_var['menu']['label']; ?></a></li> <?php else: ?> <li class="explode" key="<?php echo $this->_var['k']; ?>" name="menu"> <?php echo $this->_var['menu']['label']; ?> <?php if ($this->_var['menu']['children']): ?> <ul> <?php $_from = $this->_var['menu']['children']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'child');if (count($_from)): foreach ($_from AS $this->_var['child']): ?> <li class="menu-item"><a href="<?php echo $this->_var['child']['action']; ?>" target="main-frame"><?php echo $this->_var['child']['label']; ?></a></li> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </ul> <?php endif; ?> </li> <?php endif; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <script language="JavaScript" src="http://api.ecshop.com/menu_ext.php?charset=<?php echo $this->_var['charset']; ?>&lang=<?php echo $this->_var['help_lang']; ?>"></script> </ul> </div> <div id="help-div" style="display:none"> <h1 id="help-title"></h1> <div id="help-content"></div> </div> </div> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/global.js,../js/utils.js,../js/transport.js')); ?> <script language="JavaScript"> <!-- var collapse_all = "<?php echo $this->_var['lang']['collapse_all']; ?>"; var expand_all = "<?php echo $this->_var['lang']['expand_all']; ?>"; var collapse = true; function toggleCollapse() { var items = document.getElementsByTagName('LI'); for (i = 0; i < items.length; i++) { if (collapse) { if (items[i].className == "explode") { toggleCollapseExpand(items[i], "collapse"); } } else { if ( items[i].className == "collapse") { toggleCollapseExpand(items[i], "explode"); ToggleHanlder.Reset(); } } } collapse = !collapse; document.getElementById('toggleImg').src = collapse ? 'images/menu_minus.gif' : 'images/menu_plus.gif'; document.getElementById('toggleImg').alt = collapse ? collapse_all : expand_all; } function toggleCollapseExpand(obj, status) { if (obj.tagName.toLowerCase() == 'li' && obj.className != 'menu-item') { for (i = 0; i < obj.childNodes.length; i++) { if (obj.childNodes[i].tagName == "UL") { if (status == null) { if (obj.childNodes[1].style.display != "none") { obj.childNodes[1].style.display = "none"; ToggleHanlder.RecordState(obj.getAttribute("key"), "collapse"); obj.className = "collapse"; } else { obj.childNodes[1].style.display = "block"; ToggleHanlder.RecordState(obj.getAttribute("key"), "explode"); obj.className = "explode"; } break; } else { if( status == "collapse") { ToggleHanlder.RecordState(obj.getAttribute("key"), "collapse"); obj.className = "collapse"; } else { ToggleHanlder.RecordState(obj.getAttribute("key"), "explode"); obj.className = "explode"; } obj.childNodes[1].style.display = (status == "explode") ? "block" : "none"; } } } } } document.getElementById('menu-list').onclick = function(e) { var obj = Utils.srcElement(e); toggleCollapseExpand(obj); } document.getElementById('tabbar-div').onmouseover=function(e) { var obj = Utils.srcElement(e); if (obj.className == "tab-back") { obj.className = "tab-hover"; } } document.getElementById('tabbar-div').onmouseout=function(e) { var obj = Utils.srcElement(e); if (obj.className == "tab-hover") { obj.className = "tab-back"; } } document.getElementById('tabbar-div').onclick=function(e) { var obj = Utils.srcElement(e); // var mnuTab = document.getElementById('menu-tab'); var hlpTab = document.getElementById('help-tab'); var mnuDiv = document.getElementById('menu-list'); var hlpDiv = document.getElementById('help-div'); //if (obj.id == 'menu-tab') // { // mnuTab.className = 'tab-front'; // hlpTab.className = 'tab-back'; // mnuDiv.style.display = "block"; // hlpDiv.style.display = "none"; // } if (obj.id == 'help-tab') { mnuTab.className = 'tab-back'; hlpTab.className = 'tab-front'; mnuDiv.style.display = "none"; hlpDiv.style.display = "block"; loc = parent.frames['main-frame'].location.href; pos1 = loc.lastIndexOf("/"); pos2 = loc.lastIndexOf("?"); pos3 = loc.indexOf("act="); pos4 = loc.indexOf("&", pos3); filename = loc.substring(pos1 + 1, pos2 - 4); act = pos4 < 0 ? loc.substring(pos3 + 4) : loc.substring(pos3 + 4, pos4); loadHelp(filename, act); } } /** * 创建XML对象 */ function createDocument() { var xmlDoc; // create a DOM object if (window.ActiveXObject) { try { xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0"); } catch (e) { try { xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0"); } catch (e) { try { xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0"); } catch (e) { try { xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0"); } catch (e) { alert(e.message); } } } } } else { if (document.implementation && document.implementation.createDocument) { xmlDoc = document.implementation.createDocument("","doc",null); } else { alert("Create XML object is failed."); } } xmlDoc.async = false; return xmlDoc; } //菜单展合状态处理器 var ToggleHanlder = new Object(); Object.extend(ToggleHanlder ,{ SourceObject : new Object(), CookieName : 'Toggle_State', RecordState : function(name,state) { if(state == "collapse") { this.SourceObject[name] = state; } else { if(this.SourceObject[name]) { delete(this.SourceObject[name]); } } var date = new Date(); date.setTime(date.getTime() + 99999999); document.setCookie(this.CookieName, this.SourceObject.toJSONString(), date.toGMTString()); }, Reset :function() { var date = new Date(); date.setTime(date.getTime() + 99999999); document.setCookie(this.CookieName, "{}" , date.toGMTString()); }, Load : function() { if (document.getCookie(this.CookieName) != null) { this.SourceObject = eval("("+ document.getCookie(this.CookieName) +")"); var items = document.getElementsByTagName('LI'); for (var i = 0; i < items.length; i++) { if ( items[0].getAttribute("name") == "menu") { for (var k in this.SourceObject) { if ( typeof(items[i]) == "object") { if (items[i].getAttribute('key') == k) { toggleCollapseExpand(items[i], this.SourceObject[k]); collapse = false; } } } } } } document.getElementById('toggleImg').src = collapse ? 'images/menu_minus.gif' : 'images/menu_plus.gif'; document.getElementById('toggleImg').alt = collapse ? collapse_all : expand_all; } }); ToggleHanlder.CookieName += "_<?php echo $this->_var['admin_id']; ?>"; //初始化菜单状态 ToggleHanlder.Load(); //--> </script> </body> </html>
zzshop
trunk/temp/compiled/admin/menu.htm.php
PHP
asf20
10,984
<!-- $Id: link_list.htm 14216 2008-03-10 02:27:21Z testyang $ --> <?php if ($this->_var['full_page']): ?> <?php echo $this->fetch('pageheader.htm'); ?> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,listtable.js')); ?> <form method="post" action="" name="listForm"> <!-- start ads list --> <div class="list-div" id="listDiv"> <?php endif; ?> <table cellpadding="3" cellspacing="1"> <tr> <th><a href="javascript:listTable.sort('link_name'); "><?php echo $this->_var['lang']['link_name']; ?></a><?php echo $this->_var['sort_link_name']; ?></th> <th><a href="javascript:listTable.sort('link_url'); "><?php echo $this->_var['lang']['link_url']; ?></a><?php echo $this->_var['sort_link_url']; ?></th> <th><a href="javascript:listTable.sort('link_logo'); "><?php echo $this->_var['lang']['link_logo']; ?></a><?php echo $this->_var['sort_link_logo']; ?></th> <th><a href="javascript:listTable.sort('show_order'); "><?php echo $this->_var['lang']['show_order']; ?></a><?php echo $this->_var['sort_show_order']; ?></th> <th><?php echo $this->_var['lang']['handler']; ?></th> </tr> <tr> <?php $_from = $this->_var['links_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'link');if (count($_from)): foreach ($_from AS $this->_var['link']): ?> <tr> <td class="first-cell"><span onclick="listTable.edit(this, 'edit_link_name', <?php echo $this->_var['link']['link_id']; ?>)"><?php echo htmlspecialchars($this->_var['link']['link_name']); ?></span></td> <td align="left"><span><a href="<?php echo $this->_var['link']['link_url']; ?>" target="_blank"><?php echo htmlspecialchars($this->_var['link']['link_url']); ?></a></span></td> <td align="center"><span><?php echo $this->_var['link']['link_logo']; ?></span></td> <td align="right"><span onclick="listTable.edit(this, 'edit_show_order', <?php echo $this->_var['link']['link_id']; ?>)"><?php echo $this->_var['link']['show_order']; ?></span></td> <td align="center"><span> <a href="friend_link.php?act=edit&id=<?php echo $this->_var['link']['link_id']; ?>" title="<?php echo $this->_var['lang']['edit']; ?>"><img src="images/icon_edit.gif" border="0" height="16" width="16" /></a>&nbsp; <a href="javascript:;" onclick="listTable.remove(<?php echo $this->_var['link']['link_id']; ?>, '<?php echo $this->_var['lang']['drop_confirm']; ?>')" title="<?php echo $this->_var['lang']['remove']; ?>"><img src="images/icon_drop.gif" border="0" height="16" width="16" /></a></span></td> </tr> <?php endforeach; else: ?> <tr><td class="no-records" colspan="10"><?php echo $this->_var['lang']['no_links']; ?></td></tr> <?php endif; unset($_from); ?><?php $this->pop_vars();; ?> <tr> <td align="right" nowrap="true" colspan="10"><?php echo $this->fetch('page.htm'); ?></td> </tr> </table> <?php if ($this->_var['full_page']): ?> </div> <!-- end ad_position list --> </form> <script type="text/javascript" language="JavaScript"> listTable.recordCount = <?php echo $this->_var['record_count']; ?>; listTable.pageCount = <?php echo $this->_var['page_count']; ?>; <?php $_from = $this->_var['filter']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['item']): ?> listTable.filter.<?php echo $this->_var['key']; ?> = '<?php echo $this->_var['item']; ?>'; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> onload = function() { // 开始检查订单 startCheckOrder(); } </script> <?php echo $this->fetch('pagefooter.htm'); ?> <?php endif; ?>
zzshop
trunk/temp/compiled/admin/link_list.htm.php
PHP
asf20
3,772
<!-- $Id: start.htm 17110 2010-04-15 07:47:51Z sxc_shop $ --> <?php echo $this->fetch('pageheader.htm'); ?> <!-- directory install start --> <ul id="lilist" style="padding:0; margin: 0; list-style-type:none; color: #CC0000;"> <?php $_from = $this->_var['warning_arr']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'warning');if (count($_from)): foreach ($_from AS $this->_var['warning']): ?> <li style="border: 1px solid #CC0000; background: #FFFFCC; padding: 10px; margin-bottom: 5px;" ><?php echo $this->_var['warning']; ?></li> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </ul> <ul style="padding:0; margin: 0; list-style-type:none; color: #CC0000;"> <!-- <script type="text/javascript" src="http://bbs.ecshop.com/notice.php?v=1&n=8&f=ul"></script>--> </ul> <!-- directory install end --> <!-- start personal message --> <?php if ($this->_var['admin_msg']): ?> <div class="list-div" style="border: 1px solid #CC0000"> <table cellspacing='1' cellpadding='3'> <tr> <th><?php echo $this->_var['lang']['pm_title']; ?></th> <th><?php echo $this->_var['lang']['pm_username']; ?></th> <th><?php echo $this->_var['lang']['pm_time']; ?></th> </tr> <?php $_from = $this->_var['admin_msg']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'msg');if (count($_from)): foreach ($_from AS $this->_var['msg']): ?> <tr align="center"> <td align="left"><a href="message.php?act=view&id=<?php echo $this->_var['msg']['message_id']; ?>"><?php echo sub_str($this->_var['msg']['title'],60); ?></a></td> <td><?php echo $this->_var['msg']['user_name']; ?></td> <td><?php echo $this->_var['msg']['send_date']; ?></td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> </div> <br /> <?php endif; ?> <!-- end personal message --> <!-- start order statistics --> <div class="list-div"> <table cellspacing='1' cellpadding='3'> <tr> <th colspan="4" class="group-title"><?php echo $this->_var['lang']['order_stat']; ?></th> </tr> <tr> <td width="20%"><a href="order.php?act=list&composite_status=<?php echo $this->_var['status']['await_ship']; ?>"><?php echo $this->_var['lang']['await_ship']; ?></a></td> <td width="30%"><strong style="color: red"><?php echo $this->_var['order']['await_ship']; ?></strong></td> <td width="20%"><a href="order.php?act=list&composite_status=<?php echo $this->_var['status']['unconfirmed']; ?>"><?php echo $this->_var['lang']['unconfirmed']; ?></a></td> <td width="30%"><strong><?php echo $this->_var['order']['unconfirmed']; ?></strong></td> </tr> <tr> <td><a href="order.php?act=list&composite_status=<?php echo $this->_var['status']['await_pay']; ?>"><?php echo $this->_var['lang']['await_pay']; ?></a></td> <td><strong><?php echo $this->_var['order']['await_pay']; ?></strong></td> <td><a href="order.php?act=list&composite_status=<?php echo $this->_var['status']['finished']; ?>"><?php echo $this->_var['lang']['finished']; ?></a></td> <td><strong><?php echo $this->_var['order']['finished']; ?></strong></td> </tr> <tr> <td><a href="goods_booking.php?act=list_all"><?php echo $this->_var['lang']['new_booking']; ?></a></td> <td><strong><?php echo $this->_var['booking_goods']; ?></strong></td> <td><a href="user_account.php?act=list&process_type=1&is_paid=0"><?php echo $this->_var['lang']['new_reimburse']; ?></a></td> <td><strong><?php echo $this->_var['new_repay']; ?></strong></td> </tr> </table> </div> <!-- end order statistics --> <br /> <!-- start goods statistics --> <div class="list-div"> <table cellspacing='1' cellpadding='3'> <tr> <th colspan="4" class="group-title"><?php echo $this->_var['lang']['goods_stat']; ?></th> </tr> <tr> <td width="20%"><?php echo $this->_var['lang']['goods_count']; ?></td> <td width="30%"><strong><?php echo $this->_var['goods']['total']; ?></strong></td> <td width="20%"><a href="goods.php?act=list&stock_warning=1"><?php echo $this->_var['lang']['warn_goods']; ?></a></td> <td width="30%"><strong style="color: red"><?php echo $this->_var['goods']['warn']; ?></strong></td> </tr> <tr> <td><a href="goods.php?act=list&amp;intro_type=is_new"><?php echo $this->_var['lang']['new_goods']; ?></a></td> <td><strong><?php echo $this->_var['goods']['new']; ?></strong></td> <td><a href="goods.php?act=list&amp;intro_type=is_best"><?php echo $this->_var['lang']['recommed_goods']; ?></a></td> <td><strong><?php echo $this->_var['goods']['best']; ?></strong></td> </tr> <tr> <td><a href="goods.php?act=list&amp;intro_type=is_hot"><?php echo $this->_var['lang']['hot_goods']; ?></a></td> <td><strong><?php echo $this->_var['goods']['hot']; ?></strong></td> <td><a href="goods.php?act=list&amp;intro_type=is_promote"><?php echo $this->_var['lang']['sales_count']; ?></a></td> <td><strong><?php echo $this->_var['goods']['promote']; ?></strong></td> </tr> </table> </div> <br /> <!-- Virtual Card --> <div class="list-div"> <table cellspacing='1' cellpadding='3'> <tr> <th colspan="4" class="group-title"><?php echo $this->_var['lang']['virtual_card_stat']; ?></th> </tr> <tr> <td width="20%"><?php echo $this->_var['lang']['goods_count']; ?></td> <td width="30%"><strong><?php echo $this->_var['virtual_card']['total']; ?></strong></td> <td width="20%"><a href="goods.php?act=list&amp;stock_warning=1&amp;extension_code=virtual_card"><?php echo $this->_var['lang']['warn_goods']; ?></a></td> <td width="30%"><strong style="color: red"><?php echo $this->_var['virtual_card']['warn']; ?></strong></td> </tr> <tr> <td><a href="goods.php?act=list&amp;intro_type=is_new&amp;extension_code=virtual_card"><?php echo $this->_var['lang']['new_goods']; ?></a></td> <td><strong><?php echo $this->_var['virtual_card']['new']; ?></strong></td> <td><a href="goods.php?act=list&amp;intro_type=is_best&amp;extension_code=virtual_card"><?php echo $this->_var['lang']['recommed_goods']; ?></a></td> <td><strong><?php echo $this->_var['virtual_card']['best']; ?></strong></td> </tr> <tr> <td><a href="goods.php?act=list&amp;intro_type=is_hot&amp;extension_code=virtual_card"><?php echo $this->_var['lang']['hot_goods']; ?></a></td> <td><strong><?php echo $this->_var['virtual_card']['hot']; ?></strong></td> <td><a href="goods.php?act=list&amp;intro_type=is_promote&amp;extension_code=virtual_card"><?php echo $this->_var['lang']['sales_count']; ?></a></td> <td><strong><?php echo $this->_var['virtual_card']['promote']; ?></strong></td> </tr> </table> </div> <!-- end order statistics --> <br /> <!-- start access statistics --> <div class="list-div"> <table cellspacing='1' cellpadding='3'> <tr> <th colspan="4" class="group-title"><?php echo $this->_var['lang']['acess_stat']; ?></th> </tr> <tr> <td width="20%"><?php echo $this->_var['lang']['acess_today']; ?></td> <td width="30%"><strong><?php echo $this->_var['today_visit']; ?></strong></td> <td width="20%"><?php echo $this->_var['lang']['online_users']; ?></td> <td width="30%"><strong><?php echo $this->_var['online_users']; ?></strong></td> </tr> <tr> <td><a href="user_msg.php?act=list_all"><?php echo $this->_var['lang']['new_feedback']; ?></a></td> <td><strong><?php echo $this->_var['feedback_number']; ?></strong></td> <td><a href="comment_manage.php?act=list"><?php echo $this->_var['lang']['new_comments']; ?></a></td> <td><strong><?php echo $this->_var['comment_number']; ?></strong></td> </tr> </table> </div> <!-- end access statistics --> <br /> <!-- start system information --> <div class="list-div"> <table cellspacing='1' cellpadding='3'> <tr> <th colspan="4" class="group-title"><?php echo $this->_var['lang']['system_info']; ?></th> </tr> <tr> <td width="20%"><?php echo $this->_var['lang']['os']; ?></td> <td width="30%"><?php echo $this->_var['sys_info']['os']; ?> (<?php echo $this->_var['sys_info']['ip']; ?>)</td> <td width="20%"><?php echo $this->_var['lang']['web_server']; ?></td> <td width="30%"><?php echo $this->_var['sys_info']['web_server']; ?></td> </tr> <tr> <td><?php echo $this->_var['lang']['php_version']; ?></td> <td><?php echo $this->_var['sys_info']['php_ver']; ?></td> <td><?php echo $this->_var['lang']['mysql_version']; ?></td> <td><?php echo $this->_var['sys_info']['mysql_ver']; ?></td> </tr> <tr> <td><?php echo $this->_var['lang']['safe_mode']; ?></td> <td><?php echo $this->_var['sys_info']['safe_mode']; ?></td> <td><?php echo $this->_var['lang']['safe_mode_gid']; ?></td> <td><?php echo $this->_var['sys_info']['safe_mode_gid']; ?></td> </tr> <tr> <td><?php echo $this->_var['lang']['socket']; ?></td> <td><?php echo $this->_var['sys_info']['socket']; ?></td> <td><?php echo $this->_var['lang']['timezone']; ?></td> <td><?php echo $this->_var['sys_info']['timezone']; ?></td> </tr> <tr> <td><?php echo $this->_var['lang']['gd_version']; ?></td> <td><?php echo $this->_var['sys_info']['gd']; ?></td> <td><?php echo $this->_var['lang']['zlib']; ?></td> <td><?php echo $this->_var['sys_info']['zlib']; ?></td> </tr> <tr> <td><?php echo $this->_var['lang']['ip_version']; ?></td> <td><?php echo $this->_var['sys_info']['ip_version']; ?></td> <td><?php echo $this->_var['lang']['max_filesize']; ?></td> <td><?php echo $this->_var['sys_info']['max_filesize']; ?></td> </tr> <tr> <td><?php echo $this->_var['lang']['ecs_version']; ?></td> <td><?php echo $this->_var['ecs_version']; ?> RELEASE <?php echo $this->_var['ecs_release']; ?></td> <td><?php echo $this->_var['lang']['install_date']; ?></td> <td><?php echo $this->_var['install_date']; ?></td> </tr> <tr> <td><?php echo $this->_var['lang']['ec_charset']; ?></td> <td><?php echo $this->_var['ecs_charset']; ?></td> <td></td> <td></td> </tr> </table> </div> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js')); ?> <script type="Text/Javascript" language="JavaScript"> <!-- onload = function() { /* 检查订单 */ startCheckOrder(); } Ajax.call('index.php?is_ajax=1&act=main_api','', start_api, 'GET', 'TEXT','FLASE'); function start_api(result) { apilist = document.getElementById("lilist").innerHTML; document.getElementById("lilist").innerHTML =result+apilist; if(document.getElementById("mar") != null) { var Mar = document.getElementById("mar"); lis = Mar.getElementsByTagName('div'); //alert(lis.length); //显示li元素的个数 if(lis.length>3) { api_styel(); } } } function api_styel() { if(document.getElementById("mar") != null) { var Mar = document.getElementById("mar"); if (Browser.isIE) { Mar.style.height = "52px"; } else { Mar.style.height = "36px"; } var child_div=Mar.getElementsByTagName("div"); var picH = 16;//移动高度 var scrollstep=2;//移动步幅,越大越快 var scrolltime=30;//移动频度(毫秒)越大越慢 var stoptime=4000;//间断时间(毫秒) var tmpH = 0; function start() { if(tmpH < picH) { tmpH += scrollstep; if(tmpH > picH )tmpH = picH ; Mar.scrollTop = tmpH; setTimeout(start,scrolltime); } else { tmpH = 0; Mar.appendChild(child_div[0]); Mar.scrollTop = 0; setTimeout(start,stoptime); } } setTimeout(start,stoptime); } } //--> </script> <?php echo $this->fetch('pagefooter.htm'); ?>
zzshop
trunk/temp/compiled/admin/start.htm.php
PHP
asf20
12,316
<!-- $Id: goods_info.htm 17126 2010-04-23 10:30:26Z liuhui $ --> <?php echo $this->fetch('pageheader.htm'); ?> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,selectzone.js,colorselector.js')); ?> <script type="text/javascript" src="../js/calendar.php?lang=<?php echo $this->_var['cfg_lang']; ?>"></script> <link href="../js/calendar/calendar.css" rel="stylesheet" type="text/css" /> <?php if ($this->_var['warning']): ?> <ul style="padding:0; margin: 0; list-style-type:none; color: #CC0000;"> <li style="border: 1px solid #CC0000; background: #FFFFCC; padding: 10px; margin-bottom: 5px;" ><?php echo $this->_var['warning']; ?></li> </ul> <?php endif; ?> <!-- start goods form --> <div class="tab-div"> <!-- tab bar --> <div id="tabbar-div"> <p> <span class="tab-front" id="general-tab"><?php echo $this->_var['lang']['tab_general']; ?></span><span class="tab-back" id="detail-tab"><?php echo $this->_var['lang']['tab_detail']; ?></span><span class="tab-back" id="mix-tab"><?php echo $this->_var['lang']['tab_mix']; ?></span><?php if ($this->_var['goods_type_list']): ?><span class="tab-back" id="properties-tab"><?php echo $this->_var['lang']['tab_properties']; ?></span><?php endif; ?><span class="tab-back" id="gallery-tab"><?php echo $this->_var['lang']['tab_gallery']; ?></span><span class="tab-back" id="linkgoods-tab"><?php echo $this->_var['lang']['tab_linkgoods']; ?></span><?php if ($this->_var['code'] == ''): ?><span class="tab-back" id="groupgoods-tab"><?php echo $this->_var['lang']['tab_groupgoods']; ?></span><?php endif; ?><span class="tab-back" id="article-tab"><?php echo $this->_var['lang']['tab_article']; ?></span> </p> </div> <!-- tab body --> <div id="tabbody-div"> <form enctype="multipart/form-data" action="" method="post" name="theForm" onsubmit="return validate();"> <!-- 最大文件限制 --> <input type="hidden" name="MAX_FILE_SIZE" value="2097152" /> <!-- 通用信息 --> <table width="90%" id="general-table" align="center"> <tr> <td class="label"><?php echo $this->_var['lang']['lab_goods_name']; ?></td> <td><input type="text" name="goods_name" value="<?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?>" style="float:left;color:<?php echo $this->_var['goods_name_color']; ?>;" size="30" /><div style="background-color:<?php echo $this->_var['goods_name_color']; ?>;float:left;margin-left:2px;" id="font_color" onclick="ColorSelecter.Show(this);"><img src="images/color_selecter.gif" style="margin-top:-1px;" /></div><input type="hidden" id="goods_name_color" name="goods_name_color" value="<?php echo $this->_var['goods_name_color']; ?>" />&nbsp; <select name="goods_name_style"> <option value=""><?php echo $this->_var['lang']['select_font']; ?></option> <?php echo $this->html_options(array('options'=>$this->_var['lang']['font_styles'],'selected'=>$this->_var['goods_name_style'])); ?> </select> <?php echo $this->_var['lang']['require_field']; ?></td> </tr> <tr> <td class="label"> <a href="javascript:showNotice('noticeGoodsSN');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a> <?php echo $this->_var['lang']['lab_goods_sn']; ?> </td> <td><input type="text" name="goods_sn" value="<?php echo htmlspecialchars($this->_var['goods']['goods_sn']); ?>" size="20" onblur="checkGoodsSn(this.value,'<?php echo $this->_var['goods']['goods_id']; ?>')" /><span id="goods_sn_notice"></span><br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticeGoodsSN"><?php echo $this->_var['lang']['notice_goods_sn']; ?></span></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['lab_goods_cat']; ?></td> <td><select name="cat_id" onchange="hideCatDiv()" ><option value="0"><?php echo $this->_var['lang']['select_please']; ?></option><?php echo $this->_var['cat_list']; ?></select> <?php if ($this->_var['is_add']): ?> <a href="javascript:void(0)" onclick="rapidCatAdd()" title="<?php echo $this->_var['lang']['rapid_add_cat']; ?>" class="special"><?php echo $this->_var['lang']['rapid_add_cat']; ?></a> <span id="category_add" style="display:none;"> <input class="text" size="10" name="addedCategoryName" /> <a href="javascript:void(0)" onclick="addCategory()" title="<?php echo $this->_var['lang']['button_submit']; ?>" class="special" ><?php echo $this->_var['lang']['button_submit']; ?></a> <a href="javascript:void(0)" onclick="return goCatPage()" title="<?php echo $this->_var['lang']['category_manage']; ?>" class="special" ><?php echo $this->_var['lang']['category_manage']; ?></a> <a href="javascript:void(0)" onclick="hideCatDiv()" title="<?php echo $this->_var['lang']['hide']; ?>" class="special" ><<</a> </span> <?php endif; ?> <?php echo $this->_var['lang']['require_field']; ?> </td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['lab_other_cat']; ?></td> <td> <input type="button" value="<?php echo $this->_var['lang']['add']; ?>" onclick="addOtherCat(this.parentNode)" class="button" /> <?php $_from = $this->_var['goods']['other_cat']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'cat_id');if (count($_from)): foreach ($_from AS $this->_var['cat_id']): ?> <select name="other_cat[]"><option value="0"><?php echo $this->_var['lang']['select_please']; ?></option><?php echo $this->_var['other_cat_list'][$this->_var['cat_id']]; ?></select> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['lab_goods_brand']; ?></td> <td><select name="brand_id" onchange="hideBrandDiv()" ><option value="0"><?php echo $this->_var['lang']['select_please']; ?><?php echo $this->html_options(array('options'=>$this->_var['brand_list'],'selected'=>$this->_var['goods']['brand_id'])); ?></select> <?php if ($this->_var['is_add']): ?> <a href="javascript:void(0)" title="<?php echo $this->_var['lang']['rapid_add_brand']; ?>" onclick="rapidBrandAdd()" class="special" ><?php echo $this->_var['lang']['rapid_add_brand']; ?></a> <span id="brand_add" style="display:none;"> <input class="text" size="15" name="addedBrandName" /> <a href="javascript:void(0)" onclick="addBrand()" class="special" ><?php echo $this->_var['lang']['button_submit']; ?></a> <a href="javascript:void(0)" onclick="return goBrandPage()" title="<?php echo $this->_var['lang']['brand_manage']; ?>" class="special" ><?php echo $this->_var['lang']['brand_manage']; ?></a> <a href="javascript:void(0)" onclick="hideBrandDiv()" title="<?php echo $this->_var['lang']['hide']; ?>" class="special" ><<</a> </span> <?php endif; ?> </td> </tr> <?php if ($this->_var['suppliers_exists'] == 1): ?> <tr> <td class="label"><?php echo $this->_var['lang']['label_suppliers']; ?></td> <td><select name="suppliers_id" id="suppliers_id"> <option value="0"><?php echo $this->_var['lang']['suppliers_no']; ?></option> <?php echo $this->html_options(array('options'=>$this->_var['suppliers_list_name'],'selected'=>$this->_var['goods']['suppliers_id'])); ?> </select></td> </tr> <?php endif; ?> <tr> <td class="label"><?php echo $this->_var['lang']['lab_shop_price']; ?></td> <td><input type="text" name="shop_price" value="<?php echo $this->_var['goods']['shop_price']; ?>" size="20" onblur="priceSetted()"/> <input type="button" value="<?php echo $this->_var['lang']['compute_by_mp']; ?>" onclick="marketPriceSetted()" /> <?php echo $this->_var['lang']['require_field']; ?></td> </tr> <?php if ($this->_var['user_rank_list']): ?> <tr> <td class="label"><a href="javascript:showNotice('noticeUserPrice');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a><?php echo $this->_var['lang']['lab_user_price']; ?></td> <td> <?php $_from = $this->_var['user_rank_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'user_rank');if (count($_from)): foreach ($_from AS $this->_var['user_rank']): ?> <?php echo $this->_var['user_rank']['rank_name']; ?><span id="nrank_<?php echo $this->_var['user_rank']['rank_id']; ?>"></span><input type="text" id="rank_<?php echo $this->_var['user_rank']['rank_id']; ?>" name="user_price[]" value="<?php echo empty($this->_var['member_price_list'][$this->_var['user_rank']['rank_id']]) ? '-1' : $this->_var['member_price_list'][$this->_var['user_rank']['rank_id']]; ?>" onkeyup="if(parseInt(this.value)<-1){this.value='-1';};set_price_note(<?php echo $this->_var['user_rank']['rank_id']; ?>)" size="8" /> <input type="hidden" name="user_rank[]" value="<?php echo $this->_var['user_rank']['rank_id']; ?>" /> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticeUserPrice"><?php echo $this->_var['lang']['notice_user_price']; ?></span> </td> </tr> <?php endif; ?> <!--商品优惠价格--> <tr> <td class="label"><a href="javascript:showNotice('volumePrice');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a><?php echo $this->_var['lang']['lab_volume_price']; ?></td> <td> <table width="100%" id="tbody-volume" align="center"> <?php $_from = $this->_var['volume_price_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'volume_price');$this->_foreach['volume_price_tab'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['volume_price_tab']['total'] > 0): foreach ($_from AS $this->_var['volume_price']): $this->_foreach['volume_price_tab']['iteration']++; ?> <tr> <td> <?php if ($this->_foreach['volume_price_tab']['iteration'] == 1): ?> <a href="javascript:;" onclick="addVolumePrice(this)">[+]</a> <?php else: ?> <a href="javascript:;" onclick="removeVolumePrice(this)">[-]</a> <?php endif; ?> <?php echo $this->_var['lang']['volume_number']; ?> <input type="text" name="volume_number[]" size="8" value="<?php echo $this->_var['volume_price']['number']; ?>"/> <?php echo $this->_var['lang']['volume_price']; ?> <input type="text" name="volume_price[]" size="8" value="<?php echo $this->_var['volume_price']['price']; ?>"/> </td> </tr> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </table> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="volumePrice"><?php echo $this->_var['lang']['notice_volume_price']; ?></span> </td> </tr> <!--商品优惠价格 end --> <tr> <td class="label"><?php echo $this->_var['lang']['lab_market_price']; ?></td> <td><input type="text" name="market_price" value="<?php echo $this->_var['goods']['market_price']; ?>" size="20" /> <input type="button" value="<?php echo $this->_var['lang']['integral_market_price']; ?>" onclick="integral_market_price()" /> </td> </tr> <tr> <td class="label"><a href="javascript:showNotice('giveIntegral');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a> <?php echo $this->_var['lang']['lab_give_integral']; ?></td> <td><input type="text" name="give_integral" value="<?php echo $this->_var['goods']['give_integral']; ?>" size="20" /> <br /><span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="giveIntegral"><?php echo $this->_var['lang']['notice_give_integral']; ?></span></td> </tr> <tr> <td class="label"><a href="javascript:showNotice('rankIntegral');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a> <?php echo $this->_var['lang']['lab_rank_integral']; ?></td> <td><input type="text" name="rank_integral" value="<?php echo $this->_var['goods']['rank_integral']; ?>" size="20" /> <br /><span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="rankIntegral"><?php echo $this->_var['lang']['notice_rank_integral']; ?></span></td> </tr> <tr> <td class="label"><a href="javascript:showNotice('noticPoints');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a> <?php echo $this->_var['lang']['lab_integral']; ?></td> <td><input type="text" name="integral" value="<?php echo $this->_var['goods']['integral']; ?>" size="20" onblur="parseint_integral()";/> <br /><span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticPoints"><?php echo $this->_var['lang']['notice_integral']; ?></span> </td> </tr> <tr> <td class="label"><label for="is_promote"><input type="checkbox" id="is_promote" name="is_promote" value="1" <?php if ($this->_var['goods']['is_promote']): ?>checked="checked"<?php endif; ?> onclick="handlePromote(this.checked);" /> <?php echo $this->_var['lang']['lab_promote_price']; ?></label></td> <td id="promote_3"><input type="text" id="promote_1" name="promote_price" value="<?php echo $this->_var['goods']['promote_price']; ?>" size="20" /></td> </tr> <tr id="promote_4"> <td class="label" id="promote_5"><?php echo $this->_var['lang']['lab_promote_date']; ?></td> <td id="promote_6"> <input name="promote_start_date" type="text" id="promote_start_date" size="12" value='<?php echo $this->_var['goods']['promote_start_date']; ?>' readonly="readonly" /><input name="selbtn1" type="button" id="selbtn1" onclick="return showCalendar('promote_start_date', '%Y-%m-%d', false, false, 'selbtn1');" value="<?php echo $this->_var['lang']['btn_select']; ?>" class="button"/> - <input name="promote_end_date" type="text" id="promote_end_date" size="12" value='<?php echo $this->_var['goods']['promote_end_date']; ?>' readonly="readonly" /><input name="selbtn2" type="button" id="selbtn2" onclick="return showCalendar('promote_end_date', '%Y-%m-%d', false, false, 'selbtn2');" value="<?php echo $this->_var['lang']['btn_select']; ?>" class="button"/> </td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['lab_picture']; ?></td> <td> <input type="file" name="goods_img" size="35" /> <?php if ($this->_var['goods']['goods_img']): ?> <a href="goods.php?act=show_image&img_url=<?php echo $this->_var['goods']['goods_img']; ?>" target="_blank"><img src="images/yes.gif" border="0" /></a> <?php else: ?> <img src="images/no.gif" /> <?php endif; ?> <br /><input type="text" size="40" value="<?php echo $this->_var['lang']['lab_picture_url']; ?>" style="color:#aaa;" onfocus="if (this.value == '<?php echo $this->_var['lang']['lab_picture_url']; ?>'){this.value='http://';this.style.color='#000';}" name="goods_img_url"/> </td> </tr> <tr id="auto_thumb_1"> <td class="label"> <?php echo $this->_var['lang']['lab_thumb']; ?></td> <td id="auto_thumb_3"> <input type="file" name="goods_thumb" size="35" /> <?php if ($this->_var['goods']['goods_thumb']): ?> <a href="goods.php?act=show_image&img_url=<?php echo $this->_var['goods']['goods_thumb']; ?>" target="_blank"><img src="images/yes.gif" border="0" /></a> <?php else: ?> <img src="images/no.gif" /> <?php endif; ?> <br /><input type="text" size="40" value="<?php echo $this->_var['lang']['lab_thumb_url']; ?>" style="color:#aaa;" onfocus="if (this.value == '<?php echo $this->_var['lang']['lab_thumb_url']; ?>'){this.value='http://';this.style.color='#000';}" name="goods_thumb_url"/> <?php if ($this->_var['gd'] > 0): ?> <br /><label for="auto_thumb"><input type="checkbox" id="auto_thumb" name="auto_thumb" checked="true" value="1" onclick="handleAutoThumb(this.checked)" /><?php echo $this->_var['lang']['auto_thumb']; ?></label><?php endif; ?> </td> </tr> </table> <!-- 详细描述 --> <table width="90%" id="detail-table" style="display:none"> <tr> <td><?php echo $this->_var['FCKeditor']; ?></td> </tr> </table> <!-- 其他信息 --> <table width="90%" id="mix-table" style="display:none" align="center"> <?php if ($this->_var['code'] == ''): ?> <tr> <td class="label"><?php echo $this->_var['lang']['lab_goods_weight']; ?></td> <td><input type="text" name="goods_weight" value="<?php echo $this->_var['goods']['goods_weight_by_unit']; ?>" size="20" /> <select name="weight_unit"><?php echo $this->html_options(array('options'=>$this->_var['unit_list'],'selected'=>$this->_var['weight_unit'])); ?></select></td> </tr> <?php endif; ?> <?php if ($this->_var['cfg']['use_storage']): ?> <tr> <td class="label"><a href="javascript:showNotice('noticeStorage');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a> <?php echo $this->_var['lang']['lab_goods_number']; ?></td> <!-- <td><input type="text" name="goods_number" value="<?php echo $this->_var['goods']['goods_number']; ?>" size="20" <?php if ($this->_var['code'] != '' || $this->_var['goods']['_attribute'] != ''): ?>readonly="readonly"<?php endif; ?> /><br />--> <td><input type="text" name="goods_number" value="<?php echo $this->_var['goods']['goods_number']; ?>" size="20" /><br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticeStorage"><?php echo $this->_var['lang']['notice_storage']; ?></span></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['lab_warn_number']; ?></td> <td><input type="text" name="warn_number" value="<?php echo $this->_var['goods']['warn_number']; ?>" size="20" /></td> </tr> <?php endif; ?> <tr> <td class="label"><?php echo $this->_var['lang']['lab_intro']; ?></td> <td><input type="checkbox" name="is_best" value="1" <?php if ($this->_var['goods']['is_best']): ?>checked="checked"<?php endif; ?> /><?php echo $this->_var['lang']['is_best']; ?> <input type="checkbox" name="is_new" value="1" <?php if ($this->_var['goods']['is_new']): ?>checked="checked"<?php endif; ?> /><?php echo $this->_var['lang']['is_new']; ?> <input type="checkbox" name="is_hot" value="1" <?php if ($this->_var['goods']['is_hot']): ?>checked="checked"<?php endif; ?> /><?php echo $this->_var['lang']['is_hot']; ?></td> </tr> <tr id="alone_sale_1"> <td class="label" id="alone_sale_2"><?php echo $this->_var['lang']['lab_is_on_sale']; ?></td> <td id="alone_sale_3"><input type="checkbox" name="is_on_sale" value="1" <?php if ($this->_var['goods']['is_on_sale']): ?>checked="checked"<?php endif; ?> /> <?php echo $this->_var['lang']['on_sale_desc']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['lab_is_alone_sale']; ?></td> <td><input type="checkbox" name="is_alone_sale" value="1" <?php if ($this->_var['goods']['is_alone_sale']): ?>checked="checked"<?php endif; ?> /> <?php echo $this->_var['lang']['alone_sale']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['lab_is_free_shipping']; ?></td> <td><input type="checkbox" name="is_shipping" value="1" <?php if ($this->_var['goods']['is_shipping']): ?>checked="checked"<?php endif; ?> /> <?php echo $this->_var['lang']['free_shipping']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['lab_keywords']; ?></td> <td><input type="text" name="keywords" value="<?php echo htmlspecialchars($this->_var['goods']['keywords']); ?>" size="40" /> <?php echo $this->_var['lang']['notice_keywords']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['lab_goods_brief']; ?></td> <td><textarea name="goods_brief" cols="40" rows="3"><?php echo htmlspecialchars($this->_var['goods']['goods_brief']); ?></textarea></td> </tr> <tr> <td class="label"> <a href="javascript:showNotice('noticeSellerNote');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a> <?php echo $this->_var['lang']['lab_seller_note']; ?> </td> <td><textarea name="seller_note" cols="40" rows="3"><?php echo $this->_var['goods']['seller_note']; ?></textarea><br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticeSellerNote"><?php echo $this->_var['lang']['notice_seller_note']; ?></span></td> </tr> </table> <!-- 属性与规格 --> <?php if ($this->_var['goods_type_list']): ?> <table width="90%" id="properties-table" style="display:none" align="center"> <tr> <td class="label"><a href="javascript:showNotice('noticeGoodsType');" title="<?php echo $this->_var['lang']['form_notice']; ?>"><img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a><?php echo $this->_var['lang']['lab_goods_type']; ?></td> <td> <select name="goods_type" onchange="getAttrList(<?php echo $this->_var['goods']['goods_id']; ?>)"> <option value="0"><?php echo $this->_var['lang']['sel_goods_type']; ?></option> <?php echo $this->_var['goods_type_list']; ?> </select><br /> <span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="noticeGoodsType"><?php echo $this->_var['lang']['notice_goods_type']; ?></span></td> </tr> <tr> <td id="tbody-goodsAttr" colspan="2" style="padding:0"><?php echo $this->_var['goods_attr_html']; ?></td> </tr> </table> <?php endif; ?> <!-- 商品相册 --> <table width="90%" id="gallery-table" style="display:none" align="center"> <!-- 图片列表 --> <tr> <td> <?php $_from = $this->_var['img_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('i', 'img');if (count($_from)): foreach ($_from AS $this->_var['i'] => $this->_var['img']): ?> <div id="gallery_<?php echo $this->_var['img']['img_id']; ?>" style="float:left; text-align:center; border: 1px solid #DADADA; margin: 4px; padding:2px;"> <a href="javascript:;" onclick="if (confirm('<?php echo $this->_var['lang']['drop_img_confirm']; ?>')) dropImg('<?php echo $this->_var['img']['img_id']; ?>')">[-]</a><br /> <a href="goods.php?act=show_image&img_url=<?php echo $this->_var['img']['img_url']; ?>" target="_blank"> <img src="../<?php if ($this->_var['img']['thumb_url']): ?><?php echo $this->_var['img']['thumb_url']; ?><?php else: ?><?php echo $this->_var['img']['img_url']; ?><?php endif; ?>" <?php if ($this->_var['thumb_width'] != 0): ?>width="<?php echo $this->_var['thumb_width']; ?>"<?php endif; ?> <?php if ($this->_var['thumb_height'] != 0): ?>height="<?php echo $this->_var['thumb_height']; ?>"<?php endif; ?> border="0" /> </a><br /> <input type="text" value="<?php echo htmlspecialchars($this->_var['img']['img_desc']); ?>" size="15" name="old_img_desc[<?php echo $this->_var['img']['img_id']; ?>]" /> </div> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </td> </tr> <tr><td>&nbsp;</td></tr> <!-- 上传图片 --> <tr> <td> <a href="javascript:;" onclick="addImg(this)">[+]</a> <?php echo $this->_var['lang']['img_desc']; ?> <input type="text" name="img_desc[]" size="20" /> <?php echo $this->_var['lang']['img_url']; ?> <input type="file" name="img_url[]" /> <input type="text" size="40" value="<?php echo $this->_var['lang']['img_file']; ?>" style="color:#aaa;" onfocus="if (this.value == '<?php echo $this->_var['lang']['img_file']; ?>'){this.value='http://';this.style.color='#000';}" name="img_file[]"/> </td> </tr> </table> <!-- 关联商品 --> <table width="90%" id="linkgoods-table" style="display:none" align="center"> <!-- 商品搜索 --> <tr> <td colspan="3"> <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" /> <select name="cat_id1"><option value="0"><?php echo $this->_var['lang']['all_category']; ?><?php echo $this->_var['cat_list']; ?></select> <select name="brand_id1"><option value="0"><?php echo $this->_var['lang']['all_brand']; ?><?php echo $this->html_options(array('options'=>$this->_var['brand_list'])); ?></select> <input type="text" name="keyword1" /> <input type="button" value="<?php echo $this->_var['lang']['button_search']; ?>" class="button" onclick="searchGoods(sz1, 'cat_id1','brand_id1','keyword1')" /> </td> </tr> <!-- 商品列表 --> <tr> <th><?php echo $this->_var['lang']['all_goods']; ?></th> <th><?php echo $this->_var['lang']['handler']; ?></th> <th><?php echo $this->_var['lang']['link_goods']; ?></th> </tr> <tr> <td width="42%"> <select name="source_select1" size="20" style="width:100%" ondblclick="sz1.addItem(false, 'add_link_goods', goodsId, this.form.elements['is_single'][0].checked)" multiple="true"> </select> </td> <td align="center"> <p><input name="is_single" type="radio" value="1" checked="checked" /><?php echo $this->_var['lang']['single']; ?><br /><input name="is_single" type="radio" value="0" /><?php echo $this->_var['lang']['double']; ?></p> <p><input type="button" value=">>" onclick="sz1.addItem(true, 'add_link_goods', goodsId, this.form.elements['is_single'][0].checked)" class="button" /></p> <p><input type="button" value=">" onclick="sz1.addItem(false, 'add_link_goods', goodsId, this.form.elements['is_single'][0].checked)" class="button" /></p> <p><input type="button" value="<" onclick="sz1.dropItem(false, 'drop_link_goods', goodsId, elements['is_single'][0].checked)" class="button" /></p> <p><input type="button" value="<<" onclick="sz1.dropItem(true, 'drop_link_goods', goodsId, elements['is_single'][0].checked)" class="button" /></p> </td> <td width="42%"> <select name="target_select1" size="20" style="width:100%" multiple ondblclick="sz1.dropItem(false, 'drop_link_goods', goodsId, elements['is_single'][0].checked)"> <?php $_from = $this->_var['link_goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'link_goods');if (count($_from)): foreach ($_from AS $this->_var['link_goods']): ?> <option value="<?php echo $this->_var['link_goods']['goods_id']; ?>"><?php echo $this->_var['link_goods']['goods_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> </td> </tr> </table> <!-- 配件 --> <table width="90%" id="groupgoods-table" style="display:none" align="center"> <!-- 商品搜索 --> <tr> <td colspan="3"> <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" /> <select name="cat_id2"><option value="0"><?php echo $this->_var['lang']['all_category']; ?><?php echo $this->_var['cat_list']; ?></select> <select name="brand_id2"><option value="0"><?php echo $this->_var['lang']['all_brand']; ?><?php echo $this->html_options(array('options'=>$this->_var['brand_list'])); ?></select> <input type="text" name="keyword2" /> <input type="button" value="<?php echo $this->_var['lang']['button_search']; ?>" onclick="searchGoods(sz2, 'cat_id2', 'brand_id2', 'keyword2')" class="button" /> </td> </tr> <!-- 商品列表 --> <tr> <th><?php echo $this->_var['lang']['all_goods']; ?></th> <th><?php echo $this->_var['lang']['handler']; ?></th> <th><?php echo $this->_var['lang']['group_goods']; ?></th> </tr> <tr> <td width="42%"> <select name="source_select2" size="20" style="width:100%" onchange="sz2.priceObj.value = this.options[this.selectedIndex].id" ondblclick="sz2.addItem(false, 'add_group_goods', goodsId, this.form.elements['price2'].value)"> </select> </td> <td align="center"> <p><?php echo $this->_var['lang']['price']; ?><br /><input name="price2" type="text" size="6" /></p> <p><input type="button" value=">" onclick="sz2.addItem(false, 'add_group_goods', goodsId, this.form.elements['price2'].value)" class="button" /></p> <p><input type="button" value="<" onclick="sz2.dropItem(false, 'drop_group_goods', goodsId, elements['is_single'][0].checked)" class="button" /></p> <p><input type="button" value="<<" onclick="sz2.dropItem(true, 'drop_group_goods', goodsId, elements['is_single'][0].checked)" class="button" /></p> </td> <td width="42%"> <select name="target_select2" size="20" style="width:100%" multiple ondblclick="sz2.dropItem(false, 'drop_group_goods', goodsId, elements['is_single'][0].checked)"> <?php $_from = $this->_var['group_goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'group_goods');if (count($_from)): foreach ($_from AS $this->_var['group_goods']): ?> <option value="<?php echo $this->_var['group_goods']['goods_id']; ?>"><?php echo $this->_var['group_goods']['goods_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> </td> </tr> </table> <!-- 关联文章 --> <table width="90%" id="article-table" style="display:none" align="center"> <!-- 文章搜索 --> <tr> <td colspan="3"> <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" /> <?php echo $this->_var['lang']['article_title']; ?> <input type="text" name="article_title" /> <input type="button" value="<?php echo $this->_var['lang']['button_search']; ?>" onclick="searchArticle()" class="button" /> </td> </tr> <!-- 文章列表 --> <tr> <th><?php echo $this->_var['lang']['all_article']; ?></th> <th><?php echo $this->_var['lang']['handler']; ?></th> <th><?php echo $this->_var['lang']['goods_article']; ?></th> </tr> <tr> <td width="45%"> <select name="source_select3" size="20" style="width:100%" multiple ondblclick="sz3.addItem(false, 'add_goods_article', goodsId, this.form.elements['price2'].value)"> </select> </td> <td align="center"> <p><input type="button" value=">>" onclick="sz3.addItem(true, 'add_goods_article', goodsId, this.form.elements['price2'].value)" class="button" /></p> <p><input type="button" value=">" onclick="sz3.addItem(false, 'add_goods_article', goodsId, this.form.elements['price2'].value)" class="button" /></p> <p><input type="button" value="<" onclick="sz3.dropItem(false, 'drop_goods_article', goodsId, elements['is_single'][0].checked)" class="button" /></p> <p><input type="button" value="<<" onclick="sz3.dropItem(true, 'drop_goods_article', goodsId, elements['is_single'][0].checked)" class="button" /></p> </td> <td width="45%"> <select name="target_select3" size="20" style="width:100%" multiple ondblclick="sz3.dropItem(false, 'drop_goods_article', goodsId, elements['is_single'][0].checked)"> <?php $_from = $this->_var['goods_article_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods_article');if (count($_from)): foreach ($_from AS $this->_var['goods_article']): ?> <option value="<?php echo $this->_var['goods_article']['article_id']; ?>"><?php echo $this->_var['goods_article']['title']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> </td> </tr> </table> <div class="button-div"> <input type="hidden" name="goods_id" value="<?php echo $this->_var['goods']['goods_id']; ?>" /> <?php if ($this->_var['code'] != ''): ?> <input type="hidden" name="extension_code" value="<?php echo $this->_var['code']; ?>" /> <?php endif; ?> <input type="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" class="button" /> <input type="reset" value="<?php echo $this->_var['lang']['button_reset']; ?>" class="button" /> </div> <input type="hidden" name="act" value="<?php echo $this->_var['form_act']; ?>" /> </form> </div> </div> <!-- end goods form --> <?php echo $this->smarty_insert_scripts(array('files'=>'validator.js,tab.js')); ?> <script language="JavaScript"> var goodsId = '<?php echo $this->_var['goods']['goods_id']; ?>'; var elements = document.forms['theForm'].elements; var sz1 = new SelectZone(1, elements['source_select1'], elements['target_select1']); var sz2 = new SelectZone(2, elements['source_select2'], elements['target_select2'], elements['price2']); var sz3 = new SelectZone(1, elements['source_select3'], elements['target_select3']); var marketPriceRate = <?php echo empty($this->_var['cfg']['market_price_rate']) ? '1' : $this->_var['cfg']['market_price_rate']; ?>; var integralPercent = <?php echo empty($this->_var['cfg']['integral_percent']) ? '0' : $this->_var['cfg']['integral_percent']; ?>; onload = function() { handlePromote(document.forms['theForm'].elements['is_promote'].checked); if (document.forms['theForm'].elements['auto_thumb']) { handleAutoThumb(document.forms['theForm'].elements['auto_thumb'].checked); } // 检查新订单 startCheckOrder(); <?php $_from = $this->_var['user_rank_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> set_price_note(<?php echo $this->_var['item']['rank_id']; ?>); <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> document.forms['theForm'].reset(); } function validate() { var validator = new Validator('theForm'); validator.required('goods_name', goods_name_not_null); if (document.forms['theForm'].elements['cat_id'].value == 0) { validator.addErrorMsg(goods_cat_not_null); } checkVolumeData("1",validator); validator.required('shop_price', shop_price_not_null); validator.isNumber('shop_price', shop_price_not_number, true); validator.isNumber('market_price', market_price_not_number, false); if (document.forms['theForm'].elements['is_promote'].checked) { validator.required('promote_start_date', promote_start_not_null); validator.required('promote_end_date', promote_end_not_null); validator.islt('promote_start_date', 'promote_end_date', promote_not_lt); } if (document.forms['theForm'].elements['goods_number'] != undefined) { validator.isInt('goods_number', goods_number_not_int, false); validator.isInt('warn_number', warn_number_not_int, false); } return validator.passed(); } /** * 切换商品类型 */ function getAttrList(goodsId) { var selGoodsType = document.forms['theForm'].elements['goods_type']; if (selGoodsType != undefined) { var goodsType = selGoodsType.options[selGoodsType.selectedIndex].value; Ajax.call('goods.php?is_ajax=1&act=get_attr', 'goods_id=' + goodsId + "&goods_type=" + goodsType, setAttrList, "GET", "JSON"); } } function setAttrList(result, text_result) { document.getElementById('tbody-goodsAttr').innerHTML = result.content; } /** * 按比例计算价格 * @param string inputName 输入框名称 * @param float rate 比例 * @param string priceName 价格输入框名称(如果没有,取shop_price) */ function computePrice(inputName, rate, priceName) { var shopPrice = priceName == undefined ? document.forms['theForm'].elements['shop_price'].value : document.forms['theForm'].elements[priceName].value; shopPrice = Utils.trim(shopPrice) != '' ? parseFloat(shopPrice)* rate : 0; if(inputName == 'integral') { shopPrice = parseInt(shopPrice); } shopPrice += ""; n = shopPrice.lastIndexOf("."); if (n > -1) { shopPrice = shopPrice.substr(0, n + 3); } if (document.forms['theForm'].elements[inputName] != undefined) { document.forms['theForm'].elements[inputName].value = shopPrice; } else { document.getElementById(inputName).value = shopPrice; } } /** * 设置了一个商品价格,改变市场价格、积分以及会员价格 */ function priceSetted() { computePrice('market_price', marketPriceRate); computePrice('integral', integralPercent / 100); <?php $_from = $this->_var['user_rank_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> set_price_note(<?php echo $this->_var['item']['rank_id']; ?>); <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> } /** * 设置会员价格注释 */ function set_price_note(rank_id) { var shop_price = parseFloat(document.forms['theForm'].elements['shop_price'].value); var rank = new Array(); <?php $_from = $this->_var['user_rank_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> rank[<?php echo $this->_var['item']['rank_id']; ?>] = <?php echo empty($this->_var['item']['discount']) ? '100' : $this->_var['item']['discount']; ?>; <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> if (shop_price >0 && rank[rank_id] && document.getElementById('rank_' + rank_id) && parseInt(document.getElementById('rank_' + rank_id).value) == -1) { var price = parseInt(shop_price * rank[rank_id] + 0.5) / 100; if (document.getElementById('nrank_' + rank_id)) { document.getElementById('nrank_' + rank_id).innerHTML = '(' + price + ')'; } } else { if (document.getElementById('nrank_' + rank_id)) { document.getElementById('nrank_' + rank_id).innerHTML = ''; } } } /** * 根据市场价格,计算并改变商店价格、积分以及会员价格 */ function marketPriceSetted() { computePrice('shop_price', 1/marketPriceRate, 'market_price'); computePrice('integral', integralPercent / 100); <?php $_from = $this->_var['user_rank_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'item');if (count($_from)): foreach ($_from AS $this->_var['item']): ?> set_price_note(<?php echo $this->_var['item']['rank_id']; ?>); <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> } /** * 新增一个规格 */ function addSpec(obj) { var src = obj.parentNode.parentNode; var idx = rowindex(src); var tbl = document.getElementById('attrTable'); var row = tbl.insertRow(idx + 1); var cell1 = row.insertCell(-1); var cell2 = row.insertCell(-1); var regx = /<a([^>]+)<\/a>/i; cell1.className = 'label'; cell1.innerHTML = src.childNodes[0].innerHTML.replace(/(.*)(addSpec)(.*)(\[)(\+)/i, "$1removeSpec$3$4-"); cell2.innerHTML = src.childNodes[1].innerHTML.replace(/readOnly([^\s|>]*)/i, ''); } /** * 删除规格值 */ function removeSpec(obj) { var row = rowindex(obj.parentNode.parentNode); var tbl = document.getElementById('attrTable'); tbl.deleteRow(row); } /** * 处理规格 */ function handleSpec() { var elementCount = document.forms['theForm'].elements.length; for (var i = 0; i < elementCount; i++) { var element = document.forms['theForm'].elements[i]; if (element.id.substr(0, 5) == 'spec_') { var optCount = element.options.length; var value = new Array(optCount); for (var j = 0; j < optCount; j++) { value[j] = element.options[j].value; } var hiddenSpec = document.getElementById('hidden_' + element.id); hiddenSpec.value = value.join(String.fromCharCode(13)); // 用回车键隔开每个规格 } } return true; } function handlePromote(checked) { document.forms['theForm'].elements['promote_price'].disabled = !checked; document.forms['theForm'].elements['selbtn1'].disabled = !checked; document.forms['theForm'].elements['selbtn2'].disabled = !checked; } function handleAutoThumb(checked) { document.forms['theForm'].elements['goods_thumb'].disabled = checked; document.forms['theForm'].elements['goods_thumb_url'].disabled = checked; } /** * 快速添加品牌 */ function rapidBrandAdd(conObj) { var brand_div = document.getElementById("brand_add"); if(brand_div.style.display != '') { var brand =document.forms['theForm'].elements['addedBrandName']; brand.value = ''; brand_div.style.display = ''; } } function hideBrandDiv() { var brand_add_div = document.getElementById("brand_add"); if(brand_add_div.style.display != 'none') { brand_add_div.style.display = 'none'; } } function goBrandPage() { if(confirm(go_brand_page)) { window.location.href='brand.php?act=add'; } else { return; } } function rapidCatAdd() { var cat_div = document.getElementById("category_add"); if(cat_div.style.display != '') { var cat =document.forms['theForm'].elements['addedCategoryName']; cat.value = ''; cat_div.style.display = ''; } } function addBrand() { var brand = document.forms['theForm'].elements['addedBrandName']; if(brand.value.replace(/^\s+|\s+$/g, '') == '') { alert(brand_cat_not_null); return; } var params = 'brand=' + brand.value; Ajax.call('brand.php?is_ajax=1&act=add_brand', params, addBrandResponse, 'GET', 'JSON'); } function addBrandResponse(result) { if (result.error == '1' && result.message != '') { alert(result.message); return; } var brand_div = document.getElementById("brand_add"); brand_div.style.display = 'none'; var response = result.content; var selCat = document.forms['theForm'].elements['brand_id']; var opt = document.createElement("OPTION"); opt.value = response.id; opt.selected = true; opt.text = response.brand; if (Browser.isIE) { selCat.add(opt); } else { selCat.appendChild(opt); } return; } function addCategory() { var parent_id = document.forms['theForm'].elements['cat_id']; var cat = document.forms['theForm'].elements['addedCategoryName']; if(cat.value.replace(/^\s+|\s+$/g, '') == '') { alert(category_cat_not_null); return; } var params = 'parent_id=' + parent_id.value; params += '&cat=' + cat.value; Ajax.call('category.php?is_ajax=1&act=add_category', params, addCatResponse, 'GET', 'JSON'); } function hideCatDiv() { var category_add_div = document.getElementById("category_add"); if(category_add_div.style.display != null) { category_add_div.style.display = 'none'; } } function addCatResponse(result) { if (result.error == '1' && result.message != '') { alert(result.message); return; } var category_add_div = document.getElementById("category_add"); category_add_div.style.display = 'none'; var response = result.content; var selCat = document.forms['theForm'].elements['cat_id']; var opt = document.createElement("OPTION"); opt.value = response.id; opt.selected = true; opt.innerHTML = response.cat; //获取子分类的空格数 var str = selCat.options[selCat.selectedIndex].text; var temp = str.replace(/^\s+/g, ''); var lengOfSpace = str.length - temp.length; if(response.parent_id != 0) { lengOfSpace += 4; } for (i = 0; i < lengOfSpace; i++) { opt.innerHTML = '&nbsp;' + opt.innerHTML; } for (i = 0; i < selCat.length; i++) { if(selCat.options[i].value == response.parent_id) { if(i == selCat.length) { if (Browser.isIE) { selCat.add(opt); } else { selCat.appendChild(opt); } } else { selCat.insertBefore(opt, selCat.options[i + 1]); } //opt.selected = true; break; } } return; } function goCatPage() { if(confirm(go_category_page)) { window.location.href='category.php?act=add'; } else { return; } } /** * 删除快速分类 */ function removeCat() { if(!document.forms['theForm'].elements['parent_cat'] || !document.forms['theForm'].elements['new_cat_name']) { return; } var cat_select = document.forms['theForm'].elements['parent_cat']; var cat = document.forms['theForm'].elements['new_cat_name']; cat.parentNode.removeChild(cat); cat_select.parentNode.removeChild(cat_select); } /** * 删除快速品牌 */ function removeBrand() { if (!document.forms['theForm'].elements['new_brand_name']) { return; } var brand = document.theForm.new_brand_name; brand.parentNode.removeChild(brand); } /** * 添加扩展分类 */ function addOtherCat(conObj) { var sel = document.createElement("SELECT"); var selCat = document.forms['theForm'].elements['cat_id']; for (i = 0; i < selCat.length; i++) { var opt = document.createElement("OPTION"); opt.text = selCat.options[i].text; opt.value = selCat.options[i].value; if (Browser.isIE) { sel.add(opt); } else { sel.appendChild(opt); } } conObj.appendChild(sel); sel.name = "other_cat[]"; sel.onChange = function() {checkIsLeaf(this);}; } /* 关联商品函数 */ function searchGoods(szObject, catId, brandId, keyword) { var filters = new Object; filters.cat_id = elements[catId].value; filters.brand_id = elements[brandId].value; filters.keyword = Utils.trim(elements[keyword].value); filters.exclude = document.forms['theForm'].elements['goods_id'].value; szObject.loadOptions('get_goods_list', filters); } /** * 关联文章函数 */ function searchArticle() { var filters = new Object; filters.title = Utils.trim(elements['article_title'].value); sz3.loadOptions('get_article_list', filters); } /** * 新增一个图片 */ function addImg(obj) { var src = obj.parentNode.parentNode; var idx = rowindex(src); var tbl = document.getElementById('gallery-table'); var row = tbl.insertRow(idx + 1); var cell = row.insertCell(-1); cell.innerHTML = src.cells[0].innerHTML.replace(/(.*)(addImg)(.*)(\[)(\+)/i, "$1removeImg$3$4-"); } /** * 删除图片上传 */ function removeImg(obj) { var row = rowindex(obj.parentNode.parentNode); var tbl = document.getElementById('gallery-table'); tbl.deleteRow(row); } /** * 删除图片 */ function dropImg(imgId) { Ajax.call('goods.php?is_ajax=1&act=drop_image', "img_id="+imgId, dropImgResponse, "GET", "JSON"); } function dropImgResponse(result) { if (result.error == 0) { document.getElementById('gallery_' + result.content).style.display = 'none'; } } /** * 将市场价格取整 */ function integral_market_price() { document.forms['theForm'].elements['market_price'].value = parseInt(document.forms['theForm'].elements['market_price'].value); } /** * 将积分购买额度取整 */ function parseint_integral() { document.forms['theForm'].elements['integral'].value = parseInt(document.forms['theForm'].elements['integral'].value); } /** * 检查货号是否存在 */ function checkGoodsSn(goods_sn, goods_id) { if (goods_sn == '') { document.getElementById('goods_sn_notice').innerHTML = ""; return; } var callback = function(res) { if (res.error > 0) { document.getElementById('goods_sn_notice').innerHTML = res.message; document.getElementById('goods_sn_notice').style.color = "red"; } else { document.getElementById('goods_sn_notice').innerHTML = ""; } } Ajax.call('goods.php?is_ajax=1&act=check_goods_sn', "goods_sn=" + goods_sn + "&goods_id=" + goods_id, callback, "GET", "JSON"); } /** * 新增一个优惠价格 */ function addVolumePrice(obj) { var src = obj.parentNode.parentNode; var tbl = document.getElementById('tbody-volume'); var validator = new Validator('theForm'); checkVolumeData("0",validator); if (!validator.passed()) { return false; } var row = tbl.insertRow(tbl.rows.length); var cell = row.insertCell(-1); cell.innerHTML = src.cells[0].innerHTML.replace(/(.*)(addVolumePrice)(.*)(\[)(\+)/i, "$1removeVolumePrice$3$4-"); var number_list = document.getElementsByName("volume_number[]"); var price_list = document.getElementsByName("volume_price[]"); number_list[number_list.length-1].value = ""; price_list[price_list.length-1].value = ""; } /** * 删除优惠价格 */ function removeVolumePrice(obj) { var row = rowindex(obj.parentNode.parentNode); var tbl = document.getElementById('tbody-volume'); tbl.deleteRow(row); } /** * 校验优惠数据是否正确 */ function checkVolumeData(isSubmit,validator) { var volumeNum = document.getElementsByName("volume_number[]"); var volumePri = document.getElementsByName("volume_price[]"); var numErrNum = 0; var priErrNum = 0; for (i = 0 ; i < volumePri.length ; i ++) { if ((isSubmit != 1 || volumeNum.length > 1) && numErrNum <= 0 && volumeNum.item(i).value == "") { validator.addErrorMsg(volume_num_not_null); numErrNum++; } if (numErrNum <= 0 && Utils.trim(volumeNum.item(i).value) != "" && ! Utils.isNumber(Utils.trim(volumeNum.item(i).value))) { validator.addErrorMsg(volume_num_not_number); numErrNum++; } if ((isSubmit != 1 || volumePri.length > 1) && priErrNum <= 0 && volumePri.item(i).value == "") { validator.addErrorMsg(volume_price_not_null); priErrNum++; } if (priErrNum <= 0 && Utils.trim(volumePri.item(i).value) != "" && ! Utils.isNumber(Utils.trim(volumePri.item(i).value))) { validator.addErrorMsg(volume_price_not_number); priErrNum++; } } } </script> <?php echo $this->fetch('pagefooter.htm'); ?>
zzshop
trunk/temp/compiled/admin/goods_info.htm.php
PHP
asf20
57,296
<!-- $Id: goods_search.htm 16790 2009-11-10 08:56:15Z wangleisvn $ --> <div class="form-div"> <form action="javascript:searchGoods()" name="searchForm"> <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" /> <?php if ($_GET['act'] != "trash"): ?> <!-- 分类 --> <select name="cat_id"><option value="0"><?php echo $this->_var['lang']['goods_cat']; ?></option><?php echo $this->_var['cat_list']; ?></select> <!-- 品牌 --> <select name="brand_id"><option value="0"><?php echo $this->_var['lang']['goods_brand']; ?></option><?php echo $this->html_options(array('options'=>$this->_var['brand_list'])); ?></select> <!-- 推荐 --> <select name="intro_type"><option value="0"><?php echo $this->_var['lang']['intro_type']; ?></option><?php echo $this->html_options(array('options'=>$this->_var['intro_list'],'selected'=>$_GET['intro_type'])); ?></select> <?php if ($this->_var['suppliers_exists'] == 1): ?> <!-- 供货商 --> <select name="suppliers_id"><option value="0"><?php echo $this->_var['lang']['intro_type']; ?></option><?php echo $this->html_options(array('options'=>$this->_var['suppliers_list_name'],'selected'=>$_GET['suppliers_id'])); ?></select> <?php endif; ?> <!-- 上架 --> <select name="is_on_sale"><option value=''><?php echo $this->_var['lang']['intro_type']; ?></option><option value="1"><?php echo $this->_var['lang']['on_sale']; ?></option><option value="0"><?php echo $this->_var['lang']['not_on_sale']; ?></option></select> <?php endif; ?> <!-- 关键字 --> <?php echo $this->_var['lang']['keyword']; ?> <input type="text" name="keyword" size="15" /> <input type="submit" value="<?php echo $this->_var['lang']['button_search']; ?>" class="button" /> </form> </div> <script language="JavaScript"> function searchGoods() { <?php if ($_GET['act'] != "trash"): ?> listTable.filter['cat_id'] = document.forms['searchForm'].elements['cat_id'].value; listTable.filter['brand_id'] = document.forms['searchForm'].elements['brand_id'].value; listTable.filter['intro_type'] = document.forms['searchForm'].elements['intro_type'].value; <?php if ($this->_var['suppliers_exists'] == 1): ?> listTable.filter['suppliers_id'] = document.forms['searchForm'].elements['suppliers_id'].value; <?php endif; ?> listTable.filter['is_on_sale'] = document.forms['searchForm'].elements['is_on_sale'].value; <?php endif; ?> listTable.filter['keyword'] = Utils.trim(document.forms['searchForm'].elements['keyword'].value); listTable.filter['page'] = 1; listTable.loadList(); } </script>
zzshop
trunk/temp/compiled/admin/goods_search.htm.php
PHP
asf20
2,765
<!-- $Id: area_list.htm 14216 2008-03-10 02:27:21Z testyang $ --> <?php if ($this->_var['full_page']): ?> <?php echo $this->fetch('pageheader.htm'); ?> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,listtable.js')); ?> <div class="form-div"> <form method="post" action="area_manage.php" name="theForm" onsubmit="return add_area()"> <?php if ($this->_var['region_type'] == '0'): ?><?php echo $this->_var['lang']['add_country']; ?>: <?php elseif ($this->_var['region_type'] == '1'): ?><?php echo $this->_var['lang']['add_province']; ?>: <?php elseif ($this->_var['region_type'] == '2'): ?><?php echo $this->_var['lang']['add_city']; ?>: <?php elseif ($this->_var['region_type'] == '3'): ?><?php echo $this->_var['lang']['add_cantonal']; ?>: <?php endif; ?> <input type="text" name="region_name" maxlength="150" size="40" /> <input type="hidden" name="region_type" value="<?php echo $this->_var['region_type']; ?>" /> <input type="hidden" name="parent_id" value="<?php echo $this->_var['parent_id']; ?>" /> <input type="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" class="button" /> </form> </div> <!-- start category list --> <div class="list-div"> <table cellspacing='1' cellpadding='3' id='listTable'> <tr> <th><?php echo $this->_var['area_here']; ?></th> </tr> </table> </div> <div class="list-div" id="listDiv"> <?php endif; ?> <table cellspacing='1' cellpadding='3' id='listTable'> <tr> <?php $_from = $this->_var['region_arr']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');$this->_foreach['area_name'] = array('total' => count($_from), 'iteration' => 0); if ($this->_foreach['area_name']['total'] > 0): foreach ($_from AS $this->_var['list']): $this->_foreach['area_name']['iteration']++; ?> <?php if ($this->_foreach['area_name']['iteration'] > 1 && ( $this->_foreach['area_name']['iteration'] - 1 ) % 3 == 0): ?> </tr><tr> <?php endif; ?> <td class="first-cell" align="left"> <span onclick="listTable.edit(this, 'edit_area_name', '<?php echo $this->_var['list']['region_id']; ?>'); return false;"><?php echo htmlspecialchars($this->_var['list']['region_name']); ?></span> <span class="link-span"> <?php if ($this->_var['region_type'] < 3): ?> <a href="area_manage.php?act=list&type=<?php echo $this->_var['list']['region_type+1']; ?>&pid=<?php echo $this->_var['list']['region_id']; ?>" title="<?php echo $this->_var['lang']['manage_area']; ?>"> <?php echo $this->_var['lang']['manage_area']; ?></a>&nbsp;&nbsp; <?php endif; ?> <a href="javascript:listTable.remove(<?php echo $this->_var['list']['region_id']; ?>, '<?php echo $this->_var['lang']['drop_confirm']; ?>', 'drop_area')" title="<?php echo $this->_var['lang']['drop']; ?>"><?php echo $this->_var['lang']['drop']; ?></a> </span> </td> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </tr> </table> <?php if ($this->_var['full_page']): ?> </div> <script language="JavaScript"> <!-- onload = function() { document.forms['theForm'].elements['region_name'].focus(); // 开始检查订单 startCheckOrder(); } /** * 新建区域 */ function add_area() { var region_name = Utils.trim(document.forms['theForm'].elements['region_name'].value); var region_type = Utils.trim(document.forms['theForm'].elements['region_type'].value); var parent_id = Utils.trim(document.forms['theForm'].elements['parent_id'].value); if (region_name.length == 0) { alert(region_name_empty); } else { Ajax.call('area_manage.php?is_ajax=1&act=add_area', 'parent_id=' + parent_id + '&region_name=' + region_name + '&region_type=' + region_type, listTable.listCallback, 'POST', 'JSON'); } return false; } //--> </script> <?php echo $this->fetch('pagefooter.htm'); ?> <?php endif; ?>
zzshop
trunk/temp/compiled/admin/area_list.htm.php
PHP
asf20
4,046
<!-- $Id: account_info.htm 14216 2008-03-10 02:27:21Z testyang $ --> <?php echo $this->fetch('pageheader.htm'); ?> <div class="main-div"> <form method="post" action="account_log.php" name="theForm" onsubmit="return validate()"> <table cellspacing="1" cellpadding="3" width="100%"> <tr> <td class="label"><?php echo $this->_var['lang']['label_user_name']; ?></td> <td><?php echo $this->_var['user']['user_name']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['label_change_desc']; ?></td> <td><textarea name="change_desc" cols="60" rows="4"></textarea></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['label_user_money']; ?></td> <td><select name="add_sub_user_money" id="add_sub_user_money"> <option value="1" selected="selected"><?php echo $this->_var['lang']['add']; ?></option> <option value="-1"><?php echo $this->_var['lang']['subtract']; ?></option> </select> <input name="user_money" type="text" id="user_money" style="text-align:right" value="0" size="10" /> <?php echo $this->_var['lang']['current_value']; ?><?php echo $this->_var['user']['formated_user_money']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['label_frozen_money']; ?></td> <td><select name="add_sub_frozen_money" id="add_sub_frozen_money"> <option value="1" selected="selected"><?php echo $this->_var['lang']['add']; ?></option> <option value="-1"><?php echo $this->_var['lang']['subtract']; ?></option> </select> <input name="frozen_money" type="text" id="frozen_money" style="text-align:right" value="0" size="10" /> <?php echo $this->_var['lang']['current_value']; ?><?php echo $this->_var['user']['formated_frozen_money']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['label_rank_points']; ?></td> <td><select name="add_sub_rank_points" id="add_sub_rank_points"> <option value="1" selected="selected"><?php echo $this->_var['lang']['add']; ?></option> <option value="-1"><?php echo $this->_var['lang']['subtract']; ?></option> </select> <input name="rank_points" type="text" id="rank_points" style="text-align:right" value="0" size="10" /> <?php echo $this->_var['lang']['current_value']; ?><?php echo $this->_var['user']['rank_points']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['label_pay_points']; ?></td> <td><select name="add_sub_pay_points" id="add_sub_pay_points"> <option value="1" selected="selected"><?php echo $this->_var['lang']['add']; ?></option> <option value="-1"><?php echo $this->_var['lang']['subtract']; ?></option> </select> <input name="pay_points" type="text" id="pay_points" style="text-align:right" value="0" size="10" /> <?php echo $this->_var['lang']['current_value']; ?><?php echo $this->_var['user']['pay_points']; ?></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" class="button" value="<?php echo $this->_var['lang']['button_submit']; ?>" /> <input type="reset" class="button" value="<?php echo $this->_var['lang']['button_reset']; ?>" /> <input type="hidden" name="act" value="insert" /> <input type="hidden" name="user_id" value="<?php echo $this->_var['user']['user_id']; ?>" /> </tr> </table> </form> </div> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,validator.js')); ?> <script language="JavaScript"> <!-- onload = function() { // 开始检查订单 startCheckOrder(); } /** * 检查表单输入的数据 */ function validate() { validator = new Validator("theForm"); validator.required("change_desc", no_change_desc); validator.isNumber("user_money", user_money_not_number); validator.isNumber("frozen_money", frozen_money_not_number); validator.isInt("rank_points", rank_points_not_int); validator.isInt("pay_points", pay_points_not_int); return validator.passed(); } //--> </script> <?php echo $this->fetch('pagefooter.htm'); ?>
zzshop
trunk/temp/compiled/admin/account_info.htm.php
PHP
asf20
4,137
<!-- $Id: picture_batch.htm 15409 2008-12-09 02:36:22Z sunxiaodong $ --> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js')); ?> <?php echo $this->fetch('pageheader.htm'); ?> <div class="main-div"> <form action="picture_batch.php" method="post" name="theForm" onsubmit="return start()"> <table cellspacing="1" cellpadding="3" width="100%"> <tr> <td><?php echo $this->_var['lang']['notes']; ?></td> </tr> <tr> <td ><select name="cat_id" onchange="goods_list(this);"><option value="0"><?php echo $this->_var['lang']['all_category']; ?></caption><?php echo $this->_var['cat_list']; ?></select> <select name="brand_id" onchange="goods_list(this);"><option value="0"><?php echo $this->_var['lang']['all_brand']; ?></caption><?php echo $this->html_options(array('options'=>$this->_var['brand_list'])); ?></select> <span id="list"><select name="goods_id"><option value="0"><?php echo $this->_var['lang']['all_goods']; ?></option></select></span> <input type="button" value=" + " onclick="add_search_goods();" /> </td> </tr> <tr> <td id="goods_list"> </td> </tr> <tr> <td> <label for="do_icon"><input type="checkbox" name="do_icon" value="1" id="do_icon" checked="true" /><?php echo $this->_var['lang']['do_icon']; ?></label> <label for="do_album"><input type="checkbox" name="do_album" value="1" id="do_album" checked="true" /><?php echo $this->_var['lang']['do_album']; ?></label> </td> </tr> <tr> <td><label for="process_thumb"><input type="checkbox" name="process_thumb" value="1" id="process_thumb" checked="true" /><?php echo $this->_var['lang']['thumb']; ?></label></td> </tr> <tr> <td><label for="process_watermark"><input type="checkbox" name="process_watermark" value="1" id="process_watermark" checked="true" /><?php echo $this->_var['lang']['watermark']; ?></label></td> </tr> <tr> <td> <label for="yes_change"><input type="radio" name="change_link" value="1" id="yes_change" /><?php echo $this->_var['lang']['yes_change']; ?></label> <label for="no_change"><input type="radio" name="change_link" value="0" checked="true" id="no_change" /><?php echo $this->_var['lang']['no_change']; ?></label> </td> </tr> <tr> <td> <label for="silent"><input type="radio" name="silent" value="1" id="silent" checked="checked" /><?php echo $this->_var['lang']['silent']; ?></label> <label for="no_silent"><input type="radio" name="silent" value="0" id="no_silent" /><?php echo $this->_var['lang']['no_silent']; ?></label> </td> </tr> <tr> <td align="center"> <input type="submit" class="button" value="<?php echo $this->_var['lang']['button_submit']; ?>" /> </td> </tr> </table> </form> </div> <div class="list-div" id="listDiv"> <table cellspacing='1' cellpadding='3' id='listTable'> <tr> <th><?php echo $this->_var['lang']['page']; ?></th> <th><?php echo $this->_var['lang']['total']; ?></th> <th><?php echo $this->_var['lang']['time']; ?></th> </tr> </table> </div> <div style="display:none;border: 1px solid rgb(204, 0, 0);margin-top:10px; padding: 4px; background-color: rgb(255, 255, 206); color: rgb(206, 0, 0);" id="errorMsg" ></div> <script type="Text/Javascript" language="JavaScript"> <!-- onload = function() { // 开始检查订单 startCheckOrder(); } /** * 取得商品数据并生成option */ function goods_list(obj) { var brand_id = obj.form.elements['brand_id'].value; var cat_id = obj.form.elements['cat_id'].value; Ajax.call('picture_batch.php?is_ajax=1&get_goods=1', 'brand_id=' + brand_id + '&cat_id=' + cat_id, make_goods_option, 'GET', 'JSON'); } function make_goods_option(result) { var len = result.length; var opt = '<select name="goods_id"><option value="0"><?php echo $this->_var['lang']['all_goods']; ?></option>'; for (var i = 0; i < len; ++i) { opt += '<option value="' + result[i].goods_id + '">' + result[i].goods_name + '</option>'; } opt += '</select>'; document.getElementById('list').innerHTML = opt; } function add_search_goods(obj) { var goods_id = document.forms['theForm'].elements['goods_id'].value; var goods_name = ''; var len = document.forms['theForm'].elements['goods_id'].options.length; for (var i = 0; i < len; ++i) { if (document.forms['theForm'].elements['goods_id'].options[i].selected) { goods_name = document.forms['theForm'].elements['goods_id'].options[i].innerHTML; break; } } if (goods_id == '0' || document.getElementById('goods_' + goods_id)) { return ; } var goods_div = document.createElement("div"); goods_div.id = 'goods_' + goods_id; goods_div.innerHTML = '<input type="hidden" name="multi_goods_id[]" value="' + goods_id + '">' + goods_name + '&nbsp;&nbsp;<img style="cursor: pointer;" onclick="del_search_goods(\'' + 'goods_' + goods_id + '\');" src="images/no.gif"/>'; document.getElementById('goods_list').appendChild(goods_div); } function del_search_goods(gid) { var boldElm = document.getElementById(gid); if (boldElm) { var removed = document.getElementById(gid).parentNode.removeChild(boldElm); } } var first_act = 'icon'; var restart = 1; /** * 开始处理数据 */ function start() { var thumb = document.forms['theForm'].elements['process_thumb'].checked ? 1 : 0; var watermark = document.forms['theForm'].elements['process_watermark'].checked ? 1 : 0; var change = document.forms['theForm'].elements['change_link'][0].checked? 1 : 0; var silent = document.forms['theForm'].elements['silent'][0].checked? 1 : 0; var cat_id = document.forms['theForm'].elements['cat_id'].value; var brand_id = document.forms['theForm'].elements['brand_id'].value; var do_album = document.forms['theForm'].elements['do_album'].checked? 1 : 0; var do_icon = document.forms['theForm'].elements['do_icon'].checked? 1 : 0; var goods_id = 0; var multi_goods = document.forms['theForm'].elements['multi_goods_id[]']; if (!multi_goods) { goods_id = document.forms['theForm'].elements['goods_id'].value;; } else { if( multi_goods.length > 0) { goods_id = ''; for(var i = 0; i < multi_goods.length; i++) { goods_id += (multi_goods.length != i + 1) ?( multi_goods[i].value + ',') : multi_goods[i].value; } } else { goods_id = multi_goods.value } } if (do_album == 0 && do_icon == 0) { alert('<?php echo $this->_var['lang']['action_notice']; ?>'); return false; } if (do_icon == 0) { first_act = 'album'; } if (thumb || watermark ) { if (restart) { var tbl = document.getElementById("listTable"); for (i = tbl.rows.length - 1; i > 0; i--) { tbl.deleteRow(i); } restart = 0; } var elem = document.getElementById('errorMsg'); elem.style.display = 'none'; elem.innerHTML = ''; Ajax.call('picture_batch.php?is_ajax=1&start=1', 'total_' + first_act + '=1&thumb=' + thumb + '&watermark=' + watermark + '&change=' + change + '&silent=' + silent + '&do_icon=' + do_icon + '&do_album=' + do_album + '&goods_id=' + goods_id + '&brand_id=' + brand_id + '&cat_id=' + cat_id , start_response, 'GET', 'JSON'); } else { alert(no_action); } return false; } /** * 处理反馈信息 * @param: result * @return */ function start_response(result) { //没有执行错误 if (result.error == 0) { if (result.done == 0 && first_act == 'icon' && document.forms['theForm'].elements['do_album'].checked) { document.getElementById('time_1').id = first_act + 'done'; first_act = 'album'; start(); } else if (result.done == 0) { document.getElementById('time_1').id = first_act + 'done'; first_act = 'icon'; restart = 1; /* 结束时,删除多余的最后一行 */ var tbl = document.getElementById("listTable"); //获取表格对象 tbl.deleteRow(tbl.rows.length - 1); } else { var cell; var tbl = document.getElementById("listTable"); //获取表格对象 if (result.done == 1) { if (result.module_no > 0 ) { if (tbl.rows.length >1) /* 已经换模块,删除多余的最后一行 */ { tbl.deleteRow(tbl.rows.length - 1); } } /* 产生一个标题行 */ var row = tbl.insertRow(-1); cell = row.insertCell(0); cell.className = 'first-cell'; cell.colSpan = '3'; cell.innerHTML = result.title ; } else { document.getElementById(result.row.pre_id).innerHTML = result.row.pre_time; //更新上一行执行时间 } //创建新任务行 var row = tbl.insertRow(-1); cell = row.insertCell(0); cell.innerHTML = result.row.new_page ; cell = row.insertCell(1); cell.innerHTML = result.row.new_total ; cell = row.insertCell(2); cell.id = result.row.cur_id; cell.innerHTML = result.row.new_time ; //提交任务 Ajax.call('picture_batch.php?is_ajax=1', 'thumb=' + result.thumb + '&watermark=' + result.watermark + '&change=' + result.change + '&module_no=' + result.module_no + '&page=' + result.page + '&page_size=' + result.page_size + '&total=' + result.total + '&silent=' + result.silent + '&do_icon=' + result.do_icon + '&do_album=' + result.do_album + '&goods_id=' + result.goods_id + '&brand_id=' + result.brand_id + '&cat_id=' + result.cat_id , start_response, 'GET', 'JSON'); } if (result.silent && result.content.length > 0) { var elem = document.getElementById('errorMsg'); elem.style.display = ''; elem.innerHTML += result.content; } } if (result.message.length > 0) { //有信息则输出出错信息 alert(result.message); } } //--> </script> <?php echo $this->fetch('pagefooter.htm'); ?>
zzshop
trunk/temp/compiled/admin/picture_batch.htm.php
PHP
asf20
10,627
<!-- $Id: privilege_info.htm 16616 2009-08-27 01:56:35Z liuhui $ --> <?php echo $this->fetch('pageheader.htm'); ?> <div class="main-div"> <form name="theForm" method="post" enctype="multipart/form-data" onsubmit="return validate();"> <table width="100%"> <tr> <td class="label"><?php echo $this->_var['lang']['user_name']; ?></td> <td> <input type="text" name="user_name" maxlength="20" value="<?php echo htmlspecialchars($this->_var['user']['user_name']); ?>" size="34"/><?php echo $this->_var['lang']['require_field']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['email']; ?></td> <td> <input type="text" name="email" value="<?php echo htmlspecialchars($this->_var['user']['email']); ?>" size="34" /><?php echo $this->_var['lang']['require_field']; ?></td> </tr> <?php if ($this->_var['action'] == "add"): ?> <tr> <td class="label"><?php echo $this->_var['lang']['password']; ?></td> <td> <input type="password" name="password" maxlength="32" size="34" /><?php echo $this->_var['lang']['require_field']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['pwd_confirm']; ?></td> <td> <input type="password" name="pwd_confirm" maxlength="32" size="34" /><?php echo $this->_var['lang']['require_field']; ?></td> </tr> <?php endif; ?> <?php if ($this->_var['action'] != "add"): ?> <tr> <td class="label"> <a href="javascript:showNotice('passwordNotic');" title="<?php echo $this->_var['lang']['form_notice']; ?>"> <img src="images/notice.gif" width="16" height="16" border="0" alt="<?php echo $this->_var['lang']['form_notice']; ?>"></a><?php echo $this->_var['lang']['old_password']; ?></td> <td> <input type="password" name="old_password" size="34" /><?php echo $this->_var['lang']['require_field']; ?> <br /><span class="notice-span" <?php if ($this->_var['help_open']): ?>style="display:block" <?php else: ?> style="display:none" <?php endif; ?> id="passwordNotic"><?php echo $this->_var['lang']['password_notic']; ?></span></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['new_password']; ?></td> <td> <input type="password" name="new_password" maxlength="32" size="34" /><?php echo $this->_var['lang']['require_field']; ?></td> </tr> <tr> <td class="label"><?php echo $this->_var['lang']['pwd_confirm']; ?></td> <td> <input type="password" name="pwd_confirm" value="" size="34" /><?php echo $this->_var['lang']['require_field']; ?></td> </tr> <?php if ($this->_var['user']['agency_name']): ?> <tr> <td class="label"><?php echo $this->_var['lang']['agency']; ?></td> <td><?php echo $this->_var['user']['agency_name']; ?></td> </tr> <?php endif; ?> <?php endif; ?> <?php if ($this->_var['select_role']): ?> <tr> <td class="label"><?php echo $this->_var['lang']['select_role']; ?></td> <td> <select name="select_role"> <option value=""><?php echo $this->_var['lang']['select_please']; ?></option> <?php $_from = $this->_var['select_role']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)): foreach ($_from AS $this->_var['list']): ?> <option value="<?php echo $this->_var['list']['role_id']; ?>" <?php if ($this->_var['list']['role_id'] == $this->_var['user']['role_id']): ?> selected="selected" <?php endif; ?> ><?php echo $this->_var['list']['role_name']; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select> </td> </tr> <?php endif; ?> <?php if ($this->_var['action'] == "modif"): ?> <tr> <td align="left" class="label"><?php echo $this->_var['lang']['edit_navi']; ?></td> <td> <table style="width:300px" cellspacing="0"> <tr> <td valign="top"> <input type="hidden" name="nav_list[]" id="nav_list[]" /> <select name="menus_navlist" id="menus_navlist" multiple="true" style="width: 120px; height: 180px" onclick="setTimeout('toggleButtonSatus()', 1);"> <?php echo $this->html_options(array('options'=>$this->_var['nav_arr'])); ?> </select></td> <td align="center"> <input type="button" class="button" value="<?php echo $this->_var['lang']['move_up']; ?>" id="btnMoveUp" onclick="moveOptions('up')" disabled="true" /> <input type="button" class="button" value="<?php echo $this->_var['lang']['move_down']; ?>" id="btnMoveDown" onclick="moveOptions('down')" disabled="true" /> <input type="button" value="<?php echo $this->_var['lang']['add_nav']; ?>" id="btnAdd" onclick="JavaScript:addItem(theForm.all_menu_list,theForm.menus_navlist); this.disabled=true; " class="button" disabled="true" /><br /> <input type="button" value="<?php echo $this->_var['lang']['remove_nav']; ?>" onclick="JavaScript:delItem(theForm.menus_navlist); toggleButtonSatus()" class="button" disabled="true" id="btnRemove" /></td> <td> <select id="all_menu_list" name="all_menu_list" size="15" multiple="true" style="width:150px; height: 180px" onchange="toggleAddButton()"> <?php $_from = $this->_var['menus']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'menu');if (count($_from)): foreach ($_from AS $this->_var['key'] => $this->_var['menu']): ?> <?php if ($this->_var['key'] != "admin_home"): ?> <option value="" style="font-weight:bold;"><?php echo $this->_var['lang'][$this->_var['key']]; ?></option> <?php $_from = $this->_var['menus'][$this->_var['key']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('k', 'item');if (count($_from)): foreach ($_from AS $this->_var['k'] => $this->_var['item']): ?> <option value="<?php echo $this->_var['item']; ?>">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $this->_var['lang'][$this->_var['k']]; ?></option> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> <?php endif; ?> <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?> </select></td> </tr> </table></td> </tr> <?php endif; ?> <tr> <td colspan="2" align="center"> <input type="submit" value="<?php echo $this->_var['lang']['button_submit']; ?>" class="button" />&nbsp;&nbsp;&nbsp; <input type="reset" value="<?php echo $this->_var['lang']['button_reset']; ?>" class="button" /> <input type="hidden" name="act" value="<?php echo $this->_var['form_act']; ?>" /> <input type="hidden" name="id" value="<?php echo $this->_var['user']['user_id']; ?>" /></td> </tr> </table> </form> </div> <?php echo $this->smarty_insert_scripts(array('files'=>'../js/utils.js,validator.js')); ?> <script language="JavaScript"> var action = "<?php echo $this->_var['action']; ?>"; <!-- document.forms['theForm'].elements['user_name'].focus(); onload = function() { // 开始检查订单 startCheckOrder(); } /** * 切换增加按钮的状态 */ function toggleAddButton() { var sel = document.getElementById("all_menu_list"); document.getElementById("btnAdd").disabled = (sel.selectedIndex > -1) ? false : true; } /** * 切换移出,上移,下移按钮状态 */ function toggleButtonSatus() { var sel = document.getElementById("menus_navlist"); document.getElementById("btnRemove").disabled = (sel.selectedIndex > -1) ? false : true; document.getElementById("btnMoveUp").disabled = (sel.selectedIndex > -1) ? false : true; document.getElementById("btnMoveDown").disabled = (sel.selectedIndex > -1) ? false : true; } /** * 移动选定的列表项 */ function moveOptions(direction) { var sel = document.getElementById('menus_navlist'); if (sel.selectedIndex == -1) { return; } len = sel.length for (i = 0; i < len; i++) { if (sel.options[i].selected) { if (i == 0 && direction == 'up') { return; } newOpt = sel.options[i].cloneNode(true); sel.removeChild(sel.options[i]); tarOpt = (direction == "up") ? sel.options[i-1] : sel.options[i+1] sel.insertBefore(newOpt, tarOpt); newOpt.selected = true; break; } } } /** * 检查表单输入的数据 */ function validate() { get_navlist(); validator = new Validator("theForm"); validator.password = function (controlId, msg) { var obj = document.forms[this.formName].elements[controlId]; obj.value = Utils.trim(obj.value); if (!(obj.value.length >= 6 && /\d+/.test(obj.value) && /[a-zA-Z]+/.test(obj.value))) { this.addErrorMsg(msg); } } validator.required("user_name", user_name_empty); validator.required("email", email_empty, 1); validator.isEmail("email", email_error); if (action == "add") { if (document.forms['theForm'].elements['password']) { validator.password("password", password_invaild); validator.eqaul("password", "pwd_confirm", password_error); } } if (action == "edit" || action == "modif") { if (document.forms['theForm'].elements['old_password'].value.length > 0) { validator.password("new_password", password_invaild); validator.eqaul("new_password", "pwd_confirm", password_error); } } return validator.passed(); } function get_navlist() { if (!document.getElementById('nav_list[]')) { return; } document.getElementById('nav_list[]').value = joinItem(document.getElementById('menus_navlist')); //alert(document.getElementById('nav_list[]').value); } //--> </script> <?php echo $this->fetch('pagefooter.htm'); ?>
zzshop
trunk/temp/compiled/admin/privilege_info.htm.php
PHP
asf20
10,077