function iitems_crates_gypsy_run()
{
    global $session;
    page_header("Crate Locations");
    $cost = get_module_setting("cost", "iitems_crates_gypsy");
    if ($cost == 1) {
        $p = "Cigarette";
    } else {
        $p = "Cigarettes";
    }
    if ($session['user']['gems'] >= $cost) {
        $session['user']['gems'] -= $cost;
        output("`5You hand over the %s and the old man chuckles.  \"`!Aaah, thank ye kindly.  Now, here we are!  I'd recommend you write these down.  And be quick about it - these crates tend to disappear `ifast!`i`5\"`n`nHe reaches under his desk and brings up a chalkboard with all the locations of the Island's crates written upon it, corresponding to the squares on your crudely-drawn World Map and laid out as X and Y co-ordinates.  You spend a few minutes studying the board.`n`n", $p);
        $crates = unserialize(get_module_setting("crates", "iitemcrates"));
        foreach ($crates as $key => $vals) {
            output("%s,%s`n", $vals['loc']['x'], $vals['loc']['y']);
        }
    } else {
        output("`5You enthusiastically agree to the price, before realising that you don't actually have that many cigarettes.  Whoops.");
    }
    addnav("Leave");
    addnav("Return to the Outpost", "village.php");
    page_footer();
    return true;
}
예제 #2
0
파일: module.php 프로젝트: mrtuvn/pestle
/**
* Creates a Route XML
* generate_route module area id 
* @command generate_route
*/
function pestle_cli($argv)
{
    $module_info = askForModuleAndReturnInfo($argv);
    $module = $module_info->name;
    $legend = ['frontend' => 'standard', 'adminhtml' => 'admin'];
    $areas = array_keys($legend);
    $area = inputOrIndex('Which area? [frontend, adminhtml]', 'frontend', $argv, 1);
    $router_id = $legend[$area];
    if (!in_array($area, $areas)) {
        throw new Exception("Invalid areas");
    }
    $frontname = inputOrIndex('Frontname/Route ID?', null, $argv, 2);
    $route_id = $frontname;
    $path = $module_info->folder . '/etc/' . $area . '/routes.xml';
    if (!file_exists($path)) {
        $xml = simplexml_load_string(getBlankXml('routes'));
        writeStringToFile($path, $xml->asXml());
    }
    $xml = simplexml_load_file($path);
    simpleXmlAddNodesXpath($xml, "router[@id={$router_id}]/" . "route[@id={$route_id},@frontName={$frontname}]/" . "module[@name={$module}]");
    writeStringToFile($path, formatXmlString($xml->asXml()));
    $class = str_replace('_', '\\', $module) . '\\Controller\\Index\\Index';
    $controllerClass = createControllerClass($class, $area);
    $path_controller = getPathFromClass($class);
    writeStringToFile($path_controller, $controllerClass);
    output($path);
    output($path_controller);
}
예제 #3
0
 public function index()
 {
     $merchant_id = intval($GLOBALS['request']['merchant_id']);
     /*商家ID*/
     $page = intval($GLOBALS['request']['page']);
     /*分页*/
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $root = array();
     $root['return'] = 1;
     $page = $page == 0 ? 1 : $page;
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $supplier_locationinfo = $GLOBALS['db']->getRow("select name,id,new_dp_count_time from " . DB_PREFIX . "supplier_location where id = " . $merchant_id);
     syn_supplier_locationcount($supplier_locationinfo);
     $condition = " dp.status = 1 and dp.supplier_location_id = " . $merchant_id . " ";
     $sql_count = "select count(*) from " . DB_PREFIX . "supplier_location_dp dp where " . $condition;
     $total = $GLOBALS['db']->getOne($sql_count);
     $page_total = ceil($total / $page_size);
     //$root['sql_count'] = $sql_count;
     $sql = "select dp.*,u.user_name from " . DB_PREFIX . "supplier_location_dp as dp left outer join " . DB_PREFIX . "user as u on u.id = dp.user_id  where " . $condition . " order by dp.is_top desc, dp.create_time desc limit " . $limit;
     $root['sql'] = $sql;
     $list = $GLOBALS['db']->getAll($sql);
     foreach ($list as $k => $v) {
         $list[$k]['merchant_id'] = $v['supplier_location_id'];
         $list[$k]['create_time_format'] = getBeforeTimelag($v['create_time']);
         $list[$k]['width'] = $v['point'] / 5 * 100;
     }
     //星级点评数
     $root['star_1'] = 0;
     $root['star_2'] = 0;
     $root['star_3'] = 0;
     $root['star_4'] = 0;
     $root['star_5'] = 0;
     $root['star_dp_width_1'] = 0;
     $root['star_dp_width_2'] = 0;
     $root['star_dp_width_3'] = 0;
     $root['star_dp_width_4'] = 0;
     $root['star_dp_width_5'] = 0;
     $buy_dp_sum = 0.0;
     $buy_dp_group = $GLOBALS['db']->getAll("select point,count(*) as num from " . DB_PREFIX . "supplier_location_dp where supplier_location_id = " . $merchant_id . " group by point");
     foreach ($buy_dp_group as $dp_k => $dp_v) {
         $star = intval($dp_v['point']);
         if ($star >= 1 && $star <= 5) {
             $root['star_' . $star] = $dp_v['num'];
             $buy_dp_sum += $star * $dp_v['num'];
             $root['star_dp_width_' . $star] = round($dp_v['num'] / $total, 1) * 100;
         }
     }
     //点评平均分
     $root['buy_dp_sum'] = $buy_dp_sum;
     $root['buy_dp_avg'] = round($buy_dp_sum / $total, 1);
     $root['buy_dp_width'] = round($buy_dp_sum / $total, 1) / 5 * 100;
     $root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
     $root['message_list'] = $list;
     $root['merchant_id'] = $merchant_id;
     $root['page_title'] = "点评列表";
     output($root);
 }
예제 #4
0
 public function index()
 {
     //分页
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $root = array();
     //$root['biz_article_cate_id'] = $GLOBALS['m_config']['biz_article_cate_id'];//我的消息,(文章分类ID)
     $cate_id = intval($GLOBALS['request']['cate_id']);
     if ($cate_id == 0) {
         $cate_id = intval($GLOBALS['m_config']['biz_article_cate_id']);
     }
     $cate_id = 19;
     //分页
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $sql = "select id,title from " . DB_PREFIX . "article where is_effect = 1 and cate_id = " . $cate_id . " order by sort";
     $sql .= " limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "article where is_effect = 1 and cate_id = " . $cate_id;
     $count = $GLOBALS['db']->getOne($sql_count);
     $list = $GLOBALS['db']->getAll($sql);
     $root['page'] = array("page" => $page, "page_total" => ceil($count / PAGE_SIZE), "page_size" => PAGE_SIZE);
     //$root['sql'] = $sql;
     $root['return'] = 1;
     $root['list'] = $list;
     output($root);
 }
예제 #5
0
파일: module.php 프로젝트: cmykna/pestle
/**
* Generates Magento 2 Observer
* This command generates the necessary files and configuration to add 
* an event observer to a Magento 2 system.
*
*    pestle.phar generate_observer Pulsestorm_Generate controller_action_predispatch pulsestorm_generate_listener3 'Pulsestorm\Generate\Model\Observer3'
*
* @command generate_observer
* @argument module Full Module Name? [Pulsestorm_Generate]
* @argument event_name Event Name? [controller_action_predispatch]
* @argument observer_name Observer Name? [<$module$>_listener]
* @argument model_name Class Name? [<$module$>\Model\Observer]
*/
function pestle_cli($argv)
{
    $module = $argv['module'];
    $event_name = $argv['event_name'];
    $observer_name = $argv['observer_name'];
    $model_name = $argv['model_name'];
    $method_name = 'execute';
    $path_xml_event = initilizeModuleConfig($module, 'events.xml', 'urn:magento:framework:Event/etc/events.xsd');
    $xml = simplexml_load_file($path_xml_event);
    $nodes = $xml->xpath('//event[@name="' . $event_name . '"]');
    $node = array_shift($nodes);
    $event = $node;
    if (!$node) {
        $event = $node ? $node : $xml->addChild('event');
        $event->addAttribute('name', $event_name);
    }
    $observer = $event->addChild('observer');
    $observer->addAttribute('name', $observer_name);
    $observer->addAttribute('instance', $model_name);
    // $observer->addAttribute('method',   $method_name);
    output("Creating: {$path_xml_event}");
    $path = writeStringToFile($path_xml_event, $xml->asXml());
    output("Creating: {$model_name}");
    $contents = createClassTemplate($model_name, false, '\\Magento\\Framework\\Event\\ObserverInterface');
    $contents = str_replace('<$body$>', "\n" . '    public function execute(\\Magento\\Framework\\Event\\Observer $observer){exit(__FILE__);}' . "\n", $contents);
    createClassFile($model_name, $contents);
}
예제 #6
0
 public function index()
 {
     $root = array();
     $root['return'] = 1;
     $email = addslashes($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = md5(addslashes($GLOBALS['request']['pwd']));
     //原始密码
     $user_info = user_check($email, $pwd);
     $user_id = intval($user_info['id']);
     if (!$user_info) {
         $root['status'] = 0;
         $root['message'] = "用户密码错误";
         output($root);
     } else {
         $new_password = addslashes($GLOBALS['request']['new_password']);
         if (strlen($new_password) < 4) {
             $root['status'] = 0;
             $root['message'] = "注册密码不能少于4位";
             output($root);
         }
         $sql = "update " . DB_PREFIX . "user set is_account = 1, user_pwd = '" . md5($new_password) . "' where id = {$user_id}";
         $GLOBALS['db']->query($sql);
         $rs = $GLOBALS['db']->affected_rows();
         $root['status'] = 1;
         $root['uid'] = $user_id;
         $root['user_name'] = $email;
         $root['password'] = md5($new_password);
         $root['is_account'] = 1;
         output($root);
     }
 }
function marriage_lovedrinks()
{
    $z = 2;
    $s = get_module_setting('loveDrinksAdd');
    if (is_module_installed('drinks') && $s < $z) {
        $sql = array();
        $ladd = array();
        if ($s < 1) {
            // We use 'lessthan' so more drinks can be packaged with this
            $sql[] = "INSERT INTO " . db_prefix("drinks") . " VALUES (0, 'Love Brew', 1, 25, 5, 0, 0, 0, 20, 0, 5, 15, 0.0, 0, 0, 'Cedrik reaches under the bar, pulling out a purple cupid shaped bottle... as he pours it into a crystalline glass, the glass shines and he puts a pineapple within the liquid... \"Here, have a Love Brew..\" says Cedrik.. and as you try it, you feel uplifted!', '`%Love Brew', 12, 'You remember love..', 'Despair sets in.', '1.1', '.9', '1.5', '0', '', '', '')";
            $ladd[] = "Love Brew";
        }
        if ($s < 2) {
            // We use 'lessthan' so more drinks can be packaged with this
            $sql[] = "INSERT INTO " . db_prefix("drinks") . " VALUES (0, 'Heart Mist', 1, 25, 5, 0, 0, 0, 20, 0, 5, 15, 0.0, 0, 0, 'Cedrik grabs for a rather garish looking bottle on the shelf behind him... as he pours it into a large yellow mug, the porcelain seems to dissolve.. ooh er.. he puts a tomato within the sweet smelling gunk... \"Here, have a Heart Mist..\" says Cedrik.. and as you try it, you see symbols of love!', '`\$Heart Mist', 18, '`%Misty hearts fly around you..', '`#The sky falls...', '1.1', '.9', '1.5', '0', '', '', '')";
            $ladd[] = "Heart Misy";
        }
        foreach ($sql as $val) {
            db_query($val);
        }
        foreach ($ladd as $val) {
            $sql = "SELECT * FROM " . db_prefix("drinks") . " WHERE name='{$val}' ORDER BY costperlevel";
            $result = db_query($sql);
            $row = db_fetch_assoc($result);
            set_module_objpref('drinks', $row['drinkid'], 'loveOnly', 1, 'marriage');
        }
        set_module_setting('loveDrinksAdd', $z);
        output("`n`c`b`^Marriage Module - Drinks have been added to the Loveshack`0`b`c");
    } elseif (!is_module_active('drinks')) {
        set_module_setting('loveDrinksAdd', 0);
    }
}
예제 #8
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['biz_email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['biz_pwd']);
     //密码
     //检查用户,用户密码
     $biz_user = biz_check($email, $pwd);
     $supplier_id = intval($biz_user['supplier_id']);
     $deal_id = intval($GLOBALS['request']['deal_id']);
     //团购商品id
     if ($supplier_id > 0) {
         $root['user_login_status'] = 1;
         //用户登陆状态:1:成功登陆;0:未成功登陆
         $sql = "update " . DB_PREFIX . "message set is_read = 1 where is_read = 0 and rel_id = " . $deal_id . " and rel_table = 'deal' and pid = 0 and is_buy = 1";
         //$root['sql'] = $sql;
         $GLOBALS['db']->query($sql);
         $root['return'] = 1;
     } else {
         $root['return'] = 0;
         $root['user_login_status'] = 0;
         //用户登陆状态:1:成功登陆;0:未成功登陆
         $root['info'] = "商户不存在或密码错误";
     }
     output($root);
 }
예제 #9
0
 public function index()
 {
     $root = array();
     $id = intval($GLOBALS['request']['id']);
     $deal = get_deal($id);
     //send_deal_contract_email($id,$deal,$deal['user_id']);  //发送电子协议邮件
     $root['deal'] = $deal;
     //借款列表
     $load_list = $GLOBALS['db']->getAll("SELECT deal_id,user_id,user_name,money,is_auto,create_time FROM " . DB_PREFIX . "deal_load WHERE deal_id = " . $id);
     $u_info = get_user("*", $deal['user_id']);
     //可用额度
     $can_use_quota = get_can_use_quota($deal['user_id']);
     $root['can_use_quota'] = $can_use_quota;
     $credit_file = get_user_credit_file($deal['user_id']);
     $deal['is_faved'] = 0;
     /*
     		if($GLOBALS['user_info']){
     			$deal['is_faved'] = $GLOBALS['db']->getOne("SELECT count(*) FROM ".DB_PREFIX."deal_collect WHERE deal_id = ".$id." AND user_id=".intval($GLOBALS['user_info']['id']));
     				
     			if($deal['deal_status'] >=4){
     				//还款列表
     				$loan_repay_list = get_deal_load_list($deal);
     				
     				$root['loan_repay_list']= $loan_repay_list;
     				
     				
     				foreach($load_list as $k=>$v){
     					$load_list[$k]['remain_money'] = $v['money'] - $GLOBALS['db']->getOne("SELECT sum(self_money) FROM ".DB_PREFIX."deal_load_repay WHERE user_id=".$v['user_id']." AND deal_id=".$id);
     					if($load_list[$k]['remain_money'] <=0){
     						$load_list[$k]['remain_money'] = 0;
     						$load_list[$k]['status'] = 1;
     					}
     				}
     			}
     			
     		}*/
     $user_statics = sys_user_status($deal['user_id'], true);
     $root['user_statics'] = $user_statics;
     //借款笔数
     $root['load_list'] = $load_list;
     $root['credit_file'] = $credit_file;
     $root['u_info'] = $u_info;
     //工作认证是否过期
     $root['expire'] = user_info_expire($u_info);
     //留言
     $message_list = $GLOBALS['db']->getAll("SELECT title,content,a.create_time,rel_id,a.user_id,a.is_effect,b.user_name FROM " . DB_PREFIX . "message as a left join " . DB_PREFIX . "user as b on  a.user_id = b.id WHERE rel_id = " . $id);
     $root['message'] = $message_list;
     //seo
     if ($deal['type_match_row']) {
         $seo_title = $deal['seo_title'] != '' ? $deal['seo_title'] : $deal['type_match_row'] . " - " . $deal['name'];
     } else {
         $seo_title = $deal['seo_title'] != '' ? $deal['seo_title'] : $deal['name'];
     }
     $root['page_title'] = $seo_title;
     $seo_keyword = $deal['seo_keyword'] != '' ? $deal['seo_keyword'] : $deal['type_match_row'] . "," . $deal['name'];
     $root['page_keyword'] = $seo_keyword;
     $seo_description = $deal['seo_description'] != '' ? $deal['seo_description'] : $deal['name'];
     $root['seo_description'] = $seo_description;
     output($root);
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $root['page_title'] = "发起项目";
         $region_lv2 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where region_level = 2 order by py asc");
         //二级地址
         $root['region_lv2'] = $region_lv2;
         $cate_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_cate order by sort asc");
         $root['cate_list'] = $cate_list;
         $deal_image = es_session::get("deal_image");
         $root['deal_image'] = $deal_image;
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
예제 #11
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     $mode = strim($GLOBALS['request']['mode']);
     //index,invite,ing,over,bad
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $result = getInvestList($mode, $user_id, $page);
         $root['item'] = $result['list'];
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("DEAL_PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = strim($GLOBALS['request']['id']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $GLOBALS['db']->query("DELETE FROM " . DB_PREFIX . "user_bank where user_id=" . intval($GLOBALS['user_info']['id']) . " and id in (" . $id . ")");
         if ($GLOBALS['db']->affected_rows()) {
             $root['response_code'] = 1;
             $root['show_err'] = $GLOBALS['lang']['DELETE_SUCCESS'];
         } else {
             $root['response_code'] = 0;
             $root['show_err'] = "删除失败";
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
예제 #13
0
 public function index()
 {
     $root = array();
     $root['return'] = 1;
     $page = intval($GLOBALS['request']['page']);
     //分页
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $page = $page == 0 ? 1 : $page;
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $url = get_domain() . APP_ROOT;
     $share_url = str_replace("sjmapi", "wap", $url);
     if ($user_id) {
         $share_url .= "?r=" . base64_encode(intval($user_id));
     }
     $root['share_url'] = $share_url;
     $root['city_name'] = $city_name;
     $root['page_title'] = "邀请链接";
     //fwb 2014-08-27
     output($root);
 }
예제 #14
0
 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $mobile = trim($GLOBALS['request']['mobile']);
     $pwd = strim($GLOBALS['request']['password']);
     if ($mobile == '') {
         $root['status'] = 0;
         $root['info'] = '手机号码不能为空';
         output($root);
     }
     if (!check_mobile($mobile)) {
         $root['status'] = 0;
         $root['info'] = "请输入正确的手机号码";
         output($root);
     }
     if (strlen($pwd) < 4) {
         $root['status'] = 0;
         $root['info'] = "密码不能低于四位";
         output($root);
     }
     $db_code = $GLOBALS['db']->getRow("select id from " . DB_PREFIX . "sms_mobile_verify where status=1 and mobile_phone = '{$mobile}' and type=0 order by id desc");
     if (!$db_code) {
         $root['status'] = 0;
         $root['info'] = "手机号码未通过验证";
         output($root);
     }
     $root = mobile_reg($mobile, $pwd);
     output($root);
 }
예제 #15
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $dltid = intval($GLOBALS['request']['dltid']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $GLOBALS['db']->query("UPDATE " . DB_PREFIX . "deal_load_transfer SET status=0,callback_count = callback_count+1 where id=" . $dltid . " AND t_user_id=0 and user_id = " . $user_id);
         if ($GLOBALS['db']->affected_rows()) {
             $root['response_code'] = 1;
             $root['show_err'] = "撤销操作成功";
         } else {
             $root['response_code'] = 0;
             $root['show_err'] = "撤销操作失败";
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $paypassword = strim($GLOBALS['request']['paypassword']);
         $amount = floatval($GLOBALS['request']['amount']);
         $bid = intval($GLOBALS['request']['bid']);
         $result = getUcSaveCarry($amount, $paypassword, $bid);
         $root['response_code'] = $result['status'];
         $root['show_err'] = $result['show_err'];
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
예제 #17
0
 public function index()
 {
     $root = array();
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     if ($user_id == 0) {
         $root['user_login_status'] = 0;
         //用户登陆状态:1:成功登陆;0:未成功登陆
         output($root);
     } else {
         $root['user_login_status'] = 1;
     }
     $userfrequented = array('uid' => $user_id, 'title' => $GLOBALS['request']['title'], 'addr' => $GLOBALS['request']['addr'], 'zoom_level' => floatval($GLOBALS['request']['zoom_level']), 'latitude_top' => floatval($GLOBALS['request']['latitude_top']), 'latitude_bottom' => floatval($GLOBALS['request']['latitude_bottom']), 'longitude_left' => floatval($GLOBALS['request']['longitude_left']), 'longitude_right' => floatval($GLOBALS['request']['longitude_right']), 'xpoint' => floatval($GLOBALS['request']['xpoint']), 'ypoint' => floatval($GLOBALS['request']['ypoint']));
     $GLOBALS['db']->autoExecute(DB_PREFIX . "user_frequented", $userfrequented, 'INSERT');
     $uid = $GLOBALS['db']->insert_id();
     $root['uid'] = $uid;
     if ($uid > 0) {
         $root['return'] = 1;
         $root['info'] = "添加成功";
     } else {
         $root['return'] = 0;
         $root['info'] = "添加失败";
     }
     output($root);
 }
 public function index()
 {
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     if (app_conf("SMS_ON") == 0) {
         $root['response_code'] = 0;
         $root['show_err'] = $GLOBALS['lang']['SMS_OFF'];
         //短信未开启
         output($root);
     }
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     $root['user_id'] = $user_id;
     if ($user_id > 0) {
         $mobile = $user['mobile'];
         $code = intval($user['bind_verify']);
         if ($mobile == '') {
             $root['response_code'] = 0;
             $root['show_err'] = $GLOBALS['lang']['MOBILE_EMPTY_TIP'];
             output($root);
         }
         if (!check_mobile($mobile)) {
             $root['response_code'] = 0;
             $root['show_err'] = $GLOBALS['lang']['FILL_CORRECT_MOBILE_PHONE'];
             output($root);
         }
         if (!check_ipop_limit(get_client_ip(), "mobile_verify", 60, 0)) {
             $root['response_code'] = 0;
             $root['show_err'] = $GLOBALS['lang']['MOBILE_SMS_SEND_FAST'];
             //短信发送太快
             output($root);
         }
         //开始生成手机验证
         if ($code == 0) {
             //已经生成过了,则使用旧的验证码;反之生成一个新的
             $code = rand(1111, 9999);
             $GLOBALS['db']->query("update " . DB_PREFIX . "user set bind_verify = '" . $code . "',verify_create_time = '" . TIME_UTC . "' where id = " . $user_id);
         }
         //使用立即发送方式
         $result = send_verify_sms($mobile, $code, $user, true);
         //
         $root['response_code'] = $result['status'];
         if ($root['response_code'] == 1) {
             $root['show_err'] = $GLOBALS['lang']['MOBILE_VERIFY_SEND_OK'];
         } else {
             $root['show_err'] = $result['msg'];
             if ($root['show_err'] == null || $root['show_err'] == '') {
                 $root['show_err'] = "验证码发送失败";
             }
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
예제 #19
0
 public function index()
 {
     $filenamezip = APP_ROOT_PATH . "public/mobile_goods_down_region_conf.zip";
     if (!file_exists($filenamezip)) {
         $sql = "select id,pid,name,'' as postcode,'' as py from " . DB_PREFIX . "delivery_region";
         $list = $GLOBALS['db']->getAll($sql);
         $root = array();
         $root['return'] = 1;
         $region_list = "";
         foreach ($list as $item) {
             $sql = "insert into region_conf(id,pid,name,postcode,py) values('{$item['id']}','{$item['pid']}','{$item['name']}','{$item['postcode']}','{$item['py']}');";
             if ($region_list == "") {
                 $region_list = $sql;
             } else {
                 $region_list = $region_list . "\n" . $sql;
             }
         }
         $ziper = new zipfile();
         $ziper->addFile($region_list, "region_conf.txt");
         $ziper->output($filenamezip);
     }
     $root = array();
     $root['return'] = 1;
     if (file_exists($filenamezip)) {
         $root['file_exists'] = 1;
     } else {
         $root['file_exists'] = 0;
     }
     $sql = "select count(*) as num from " . DB_PREFIX . "delivery_region";
     $root['region_num'] = $GLOBALS['db']->getOne($sql);
     //配置地区数量
     $root['file_url'] = get_domain() . APP_ROOT . "/../public/mobile_goods_down_region_conf.zip";
     $root['file_size'] = abs(filesize($filenamezip));
     output($root);
 }
예제 #20
0
 public function index()
 {
     $root = array();
     $root['return'] = 1;
     $group_id = intval($_REQUEST['id']);
     $page = intval($GLOBALS['request']['page']);
     //分页
     $page = $page == 0 ? 1 : $page;
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     if ($user_id == 0) {
         $root['return'] = 0;
         $root['info'] = "请先登陆";
     }
     $group_id = intval($_REQUEST['id']);
     $group_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic_group where is_effect = 1 and id = " . $group_id . " limit " . $limit);
     if (!$group_item) {
         $root['return'] = 0;
         $root['info'] = "不存在该主题";
     }
     $count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic_group where is_effect = 1 and id = " . $group_id);
     $root['id'] = $group_id;
     $root['page'] = array("page" => $page, "page_total" => ceil($count / PAGE_SIZE), "page_size" => PAGE_SIZE);
     $root['page_title'] = "发表主题";
     output($root);
 }
예제 #21
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_user_incharge($limit, $GLOBALS['user_info']['id']);
         $root['item'] = $result['list'];
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
예제 #22
0
 public function index()
 {
     //分页
     $page = intval($GLOBALS['request']['p']);
     if ($page == 0) {
         $page = 1;
     }
     $deal_id = intval($_REQUEST['deal_id']);
     $rel_table = 'deal';
     $condition = "rel_table = '" . $rel_table . "' and rel_id = " . $deal_id;
     if (app_conf("USER_MESSAGE_AUTO_EFFECT") == 0) {
         $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']);
     } else {
         //留言是否需要审核
         $message_type = $GLOBALS['db']->getOne("select is_effect from " . DB_PREFIX . "message_type where type_name='" . $rel_table . "'");
         if ($message_type == 0) {
             $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']);
         }
     }
     $root = array();
     //分页
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $msg_condition = $condition . " AND is_effect = 1 ";
     $message = get_message_list($limit, $msg_condition);
     $root['page'] = array("page" => $page, "page_total" => ceil($message['count'] / app_conf("PAGE_SIZE")));
     foreach ($message['list'] as $k => $v) {
         $msg_sub = get_message_list("", "pid=" . $v['id'], false);
         $message['list'][$k]["sub"] = $msg_sub["list"];
     }
     $root['response_code'] = 1;
     //$root['show_err'] = ;  //当response_code != 0 时,返回:错误内容
     $root['message_list'] = $message['list'];
     output($root);
 }
예제 #23
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     $status = strim($GLOBALS['request']['status']);
     //0:全部;1:可转让;2:转让中;3:已转让;4:已撤销;
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $result = getUcTransferBuys($page, $status);
         $root['item'] = $result['list'];
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("DEAL_PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
function oneshotteleporter_run()
{
    global $session;
    $to = httpget("to");
    if ($to == "") {
        page_header("The Void");
        output("You press the button on your One-Shot Teleporter.  One obligatory blinding flash of light and pain later, you find yourself floating around in empty black nothingness!`n`nA flashing red light and an annoying BEEPing noise from your device insists that you select a destination, and quickly, before you find yourself stuck here or imploded.");
        $vloc = array();
        $vname = getsetting("villagename", LOCATION_FIELDS);
        $vloc[$vname] = "village";
        $vloc = modulehook("validlocation", $vloc);
        ksort($vloc);
        reset($vloc);
        addnav("Choose a Destination");
        foreach ($vloc as $loc => $val) {
            addnav(array("Go to %s", $loc), "runmodule.php?module=oneshotteleporter&to=" . htmlentities($loc));
        }
    } else {
        page_header("Back to Reality");
        output("You quickly select an outpost from the list.  With a sudden jolt, you find yourself standing in the middle of your chosen outpost!  You look around for your teleporting device, but realise that it must have only teleported you, not itself.  What a piece of junk.");
        $session['user']['location'] = $to;
        $session['user']['specialinc'] = "";
        addnav("Continue");
        addnav("Back to the Outpost", "village.php");
    }
    page_footer();
    return true;
}
예제 #25
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_user_log($limit, $GLOBALS['user_info']['id'], 'money');
         $list = $result['list'];
         foreach ($list as $k => $v) {
             $list[$k]['log_time_format'] = to_date($v['log_time'], "Y-m-d H:i:s");
             $list[$k]['money_format'] = format_price($v['money']);
             $list[$k]['lock_money_format'] = format_price($v['lock_money']);
         }
         $root['item'] = $list;
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
예제 #26
0
 public function transactional($message_id = 0)
 {
     if (is_null($result = $this->lib_message->add_request($message_id))) {
         output_error($this->lib_message->get_error_message());
     }
     output($result);
 }
예제 #27
0
파일: module.php 프로젝트: astorm/pestle
/**
* Generates plugin XML
* This command generates the necessary files and configuration 
* to "plugin" to a preexisting Magento 2 object manager object. 
*
*     pestle.phar generate_plugin_xml Pulsestorm_Helloworld 'Magento\Framework\Logger\Monolog' 'Pulsestorm\Helloworld\Plugin\Magento\Framework\Logger\Monolog'
* 
* @argument module_name Create in which module? [Pulsestorm_Helloworld]
* @argument class Which class are you plugging into? [Magento\Framework\Logger\Monolog]
* @argument class_plugin What's your plugin class name? [<$module_name$>\Plugin\<$class$>]
* @command generate_plugin_xml
*/
function pestle_cli($argv)
{
    // $module_info = askForModuleAndReturnInfo($argv);
    $module_info = getModuleInformation($argv['module_name']);
    $class = $argv['class'];
    $class_plugin = $argv['class_plugin'];
    $path_di = $module_info->folder . '/etc/di.xml';
    if (!file_exists($path_di)) {
        $xml = simplexml_load_string(getBlankXml('di'));
        writeStringToFile($path_di, $xml->asXml());
        output("Created new {$path_di}");
    }
    $xml = simplexml_load_file($path_di);
    //     $plugin_name    = strToLower($module_info->name) . '_' . underscoreClass($class);
    //     simpleXmlAddNodesXpath($xml,
    //         "/type[@name=$class]/plugin[@name=$plugin_name,@type=$class_plugin]");
    $type = $xml->addChild('type');
    $type->addAttribute('name', $class);
    $plugin = $type->addChild('plugin');
    $plugin->addAttribute('name', strToLower($module_info->name) . '_' . underscoreClass($class));
    $plugin->addAttribute('type', $class_plugin);
    writeStringToFile($path_di, formatXmlString($xml->asXml()));
    output("Added nodes to {$path_di}");
    $path_plugin = getPathFromClass($class_plugin);
    $body = implode("\n", ['    //function beforeMETHOD($subject, $arg1, $arg2){}', '    //function aroundMETHOD($subject, $procede, $arg1, $arg2){return $proceed($arg1, $arg2);}', '    //function afterMETHOD($subject, $result){return $result;}']);
    $class_definition = str_replace('<$body$>', "\n{$body}\n", createClassTemplate($class_plugin));
    writeStringToFile($path_plugin, $class_definition);
    output("Created file {$path_plugin}");
}
예제 #28
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $result = getUcToTransfer($id);
         $root['transfer'] = $result['transfer'];
         $root['response_code'] = $result['status'];
         $root['show_err'] = $result['show_err'];
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     $root['program_title'] = "转让详情";
     output($root);
 }
예제 #29
0
function output($txt)
{
    if (is_hash($txt)) {
        $out = '[';
        foreach ($txt as $k => $v) {
            $out .= output($k) . " => " . output($v) . ', ';
        }
        $out .= "]";
        return $out;
    } else {
        if (is_array($txt)) {
            $out = '[';
            foreach ($txt as $k) {
                $out .= output($k) . ', ';
            }
            $out .= "]";
            return $out;
        } else {
            if ($txt === TRUE || $txt === FALSE) {
                return $txt === TRUE ? "true" : "false";
            } else {
                return "'{$txt}'";
            }
        }
    }
}
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $order_id = intval($_REQUEST['id']);
         $order_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where order_status = 0 and user_id = " . intval($GLOBALS['user_info']['id']) . " and id = " . $order_id);
         if (!$order_info) {
             $root['info'] = '无效的订单';
         } else {
             $money = $order_info['credit_pay'];
             $GLOBALS['db']->query("delete from " . DB_PREFIX . "deal_order where id = " . $order_id . " and user_id = " . intval($GLOBALS['user_info']['id']) . " and order_status = 0");
             if ($GLOBALS['db']->affected_rows() > 0) {
                 if ($money > 0) {
                     require_once APP_ROOT_PATH . "system/libs/user.php";
                     modify_account(array("money" => $money), intval($GLOBALS['user_info']['id']), "删除" . $order_info['deal_name'] . "项目支付,退回支付款。");
                 }
             }
             $root['response_code'] = 1;
             $root['info'] = '删除成功';
         }
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }