<?php
/**
 * Created by PhpStorm.
 * User: stanley-king
 * Date: 2017/11/3
 * Time: 下午8:55
 */

require_once (BASE_ROOT_PATH . '/helper/session_helper.php');
require_once (BASE_ROOT_PATH . '/helper/util_helper.php');

class url_helper
{
    public static function member_index($member_id)
    {
        $data = util::encrypt_data($member_id);
        $data = urlencode($data);
        $relay_id = session_helper::share_id();

        $url = BASE_SITE_URL . "/mobile/index.php?act=index&op=member&member_id={$data}&relay_id={$relay_id}";
        return $url;
    }

    public static function bonus_open_url($type_sn)
    {
        $relay_id = session_helper::share_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn={$type_sn}&relay_id={$relay_id}";
        return $url;
    }

    public static function bonus_grab_url($type_sn)
    {
        $relay_id = session_helper::share_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=grab&client_type=wap&type_sn={$type_sn}&relay_id={$relay_id}";
        return $url;
    }

    public static function fcode_url($common_id,$batch_code)
    {
        $relay_id = session_helper::share_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=fcode&op=index&client_type=wap&common_id={$common_id}&batch_code={$batch_code}&relay_id={$relay_id}";
        return $url;
    }

    public static function mshop_special($special_id)
    {
        $relay_id = session_helper::share_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=mshop&op=special&special_id={$special_id}&relay_id={$relay_id}";
        return $url;
    }
    public static function mshop_goods($goods_id)
    {
        $relay_id = session_helper::share_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=mshop&op=goods&goods_id={$goods_id}&relay_id={$relay_id}";
        return $url;
    }
    public static function ugc_url($special_id)
    {
        $relay_id = session_helper::share_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=special&op=index&special_id={$special_id}&client_type=wap&relay_id={$relay_id}";
        return $url;
    }
    public static function inviter_url()
    {
        $relay_id = session_helper::share_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=invite_friend&op=index&client_type=wap&curuser={$relay_id}&relay_id={$relay_id}";
        return $url;
    }
}

class author_url
{
    public static function member_index($member_id)
    {
        $data = util::encrypt_data($member_id);
        $data = urlencode($data);
        $relay_id = session_helper::relay_id();

        $url = BASE_SITE_URL . "/mobile/index.php?act=index&op=member&member_id={$data}&relay_id={$relay_id}";
        return $url;
    }

    public static function bonus_open_url($type_sn)
    {
        $relay_id = session_helper::relay_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn={$type_sn}&relay_id={$relay_id}";
        return $url;
    }

    public static function bonus_grab_url($type_sn)
    {
        $relay_id = session_helper::relay_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=grab&client_type=wap&type_sn={$type_sn}&relay_id={$relay_id}";
        return $url;
    }

    public static function fcode_url($common_id,$batch_code)
    {
        $relay_id = session_helper::relay_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=fcode&op=index&client_type=wap&common_id={$common_id}&batch_code={$batch_code}&relay_id={$relay_id}";
        return $url;
    }

    public static function mshop_special($special_id)
    {
        $relay_id = session_helper::relay_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=mshop&op=special&special_id={$special_id}&relay_id={$relay_id}";
        return $url;
    }
    public static function mshop_goods($goods_id)
    {
        $relay_id = session_helper::relay_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=mshop&op=goods&goods_id={$goods_id}&relay_id={$relay_id}";
        return $url;
    }
    public static function ugc_url($special_id)
    {
        $relay_id = session_helper::relay_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=special&op=index&special_id={$special_id}&client_type=wap&relay_id={$relay_id}";
        return $url;
    }
    public static function inviter_url($user)
    {
        $relay_id = session_helper::relay_id();
        $url = BASE_SITE_URL . "/mobile/index.php?act=invite_friend&op=index&client_type=wap&curuser={$user}&relay_id={$relay_id}";
        return $url;
    }
}