本文整理汇总了PHP中output函数的典型用法代码示例。如果您正苦于以下问题:PHP output函数的具体用法?PHP output怎么用?PHP output使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了output函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: iitems_crates_gypsy_run
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;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:25,代码来源:iitems_crates_gypsy.php
示例2: pestle_cli
/**
* 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: index
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: index
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: pestle_cli
/**
* 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: index
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);
}
}
示例7: marriage_lovedrinks
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);
}
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:32,代码来源:lovedrinks.php
示例8: index
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: index
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);
}
示例10: index
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: index
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);
}
示例12: index
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: index
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: index
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: index
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);
}